Repository: microsoft/ApplicationInsights-JS Branch: main Commit: 68ec51069efe Files: 1088 Total size: 20.5 MB Directory structure: gitextract_9gu592nz/ ├── .aiAutoMinify.json ├── .eslintrc ├── .gitattributes ├── .github/ │ ├── CODEOWNERS │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── feature_request.md │ ├── codeql/ │ │ └── codeql-config.yml │ ├── copilot-instructions.md │ ├── prompts/ │ │ └── release-pr.prompt.md │ └── workflows/ │ ├── ci.yml │ ├── codeql-analysis.yml │ ├── delete-merged-branches.yml │ ├── jekyll-gh-pages.yml │ ├── lock.yml │ ├── stale-assigned.yml │ └── stale.yml ├── .gitignore ├── .npmignore ├── .travis/ │ ├── test_react_native.sh │ └── test_rush.sh ├── AISKU/ │ ├── .npmignore │ ├── API.md │ ├── LICENSE │ ├── NOTICE │ ├── PRIVACY │ ├── README.md │ ├── Tests/ │ │ ├── Manual/ │ │ │ ├── HelloWorld.html │ │ │ ├── README.md │ │ │ ├── ai1.test.js │ │ │ ├── ai2.test.js │ │ │ ├── ai3.test.js │ │ │ ├── aisku-example-index.gbl.js │ │ │ ├── latestSnippet.html │ │ │ ├── span-e2e-manual-test.html │ │ │ ├── style/ │ │ │ │ └── style.css │ │ │ └── testVersionConflict.html │ │ ├── Perf/ │ │ │ └── src/ │ │ │ ├── AISKUPerf.Tests.ts │ │ │ ├── AISKUPerf.ts │ │ │ └── aiskuperftests.ts │ │ ├── PerfTests.html │ │ ├── Unit/ │ │ │ └── src/ │ │ │ ├── AISKUSize.Tests.ts │ │ │ ├── CdnPackaging.tests.ts │ │ │ ├── CdnThrottle.tests.ts │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ ├── IAnalyticsConfig.Tests.ts │ │ │ ├── NonRecordingSpan.Tests.ts │ │ │ ├── OTelInit.Tests.ts │ │ │ ├── SnippetInitialization.Tests.ts │ │ │ ├── SpanContextPropagation.Tests.ts │ │ │ ├── SpanE2E.Tests.ts │ │ │ ├── SpanErrorHandling.Tests.ts │ │ │ ├── SpanHelperUtils.Tests.ts │ │ │ ├── SpanLifeCycle.Tests.ts │ │ │ ├── SpanPluginIntegration.Tests.ts │ │ │ ├── SpanUtils.Tests.ts │ │ │ ├── StartSpan.Tests.ts │ │ │ ├── TelemetryItemGeneration.Tests.ts │ │ │ ├── ThrottleSentMessage.tests.ts │ │ │ ├── TraceContext.Tests.ts │ │ │ ├── TraceProvider.Tests.ts │ │ │ ├── TraceSuppression.Tests.ts │ │ │ ├── UseSpan.Tests.ts │ │ │ ├── WithSpan.Tests.ts │ │ │ ├── aiskuunittests.ts │ │ │ ├── applicationinsights.e2e.fetch.tests.ts │ │ │ ├── applicationinsights.e2e.tests.ts │ │ │ ├── sanitizer.e2e.tests.ts │ │ │ ├── sender.e2e.tests.ts │ │ │ ├── testLegacySnippet.ts │ │ │ ├── testSnippetV5.ts │ │ │ ├── testSnippetV6.ts │ │ │ └── validate.e2e.tests.ts │ │ ├── UnitTests.html │ │ ├── es6-module-type-check/ │ │ │ ├── package.json │ │ │ ├── src/ │ │ │ │ └── main.ts │ │ │ └── tsconfig.json │ │ └── tsconfig.json │ ├── api-extractor.json │ ├── dist-history/ │ │ ├── aisdk.0.0.13.js │ │ ├── aisdk.0.0.15.js │ │ ├── aisdk.0.0.17.js │ │ ├── aisdk.0.0.18.js │ │ ├── aisdk.0.0.19.js │ │ ├── aisdk.0.0.8.js │ │ ├── aisdk.min.0.0.8.js │ │ └── aisdk.min.0.0.9.js │ ├── examples/ │ │ └── span-usage-example.ts │ ├── package.json │ ├── rollup.config.js │ ├── samples/ │ │ └── HelloWorld/ │ │ └── index-snippet.html │ ├── scripts/ │ │ ├── README.md │ │ ├── listAzCdnVersions.ps1 │ │ ├── publishAzImgToCdn.ps1 │ │ ├── publishAzReleaseToCdn.ps1 │ │ └── setAzActiveCdnVersion.ps1 │ ├── snippet/ │ │ ├── README.md │ │ └── snippet.js │ ├── src/ │ │ ├── AISku.ts │ │ ├── ApplicationInsightsContainer.ts │ │ ├── IApplicationInsights.ts │ │ ├── Init.ts │ │ ├── InternalConstants.ts │ │ ├── Snippet.ts │ │ ├── applicationinsights-web.ts │ │ └── internal/ │ │ └── trace/ │ │ └── spanUtils.ts │ ├── tsconfig.json │ ├── tsdoc.json │ ├── tslint.json │ └── typedoc.json ├── AISKULight/ │ ├── .npmignore │ ├── LICENSE │ ├── NOTICE │ ├── PRIVACY │ ├── README.md │ ├── Tests/ │ │ ├── Unit/ │ │ │ └── src/ │ │ │ ├── AISKULightSize.Tests.ts │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ ├── aiskuliteunittests.ts │ │ │ ├── config.tests.ts │ │ │ ├── dynamicconfig.tests.ts │ │ │ └── otelNegative.tests.ts │ │ ├── UnitTests.html │ │ └── tsconfig.json │ ├── api-extractor.json │ ├── build.cmd │ ├── dist-history/ │ │ ├── aisdklight.js │ │ └── aisdklite.0.0.3.js │ ├── package.json │ ├── rollup.config.js │ ├── src/ │ │ └── index.ts │ ├── tsconfig.json │ ├── tsdoc.json │ ├── tslint.json │ └── typedoc.json ├── API-reference.md ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE ├── PRIVACY ├── README.md ├── RELEASES.md ├── SECURITY.md ├── SUPPORT.md ├── ThirdPartyNotices.txt ├── TreeShakingRecommendations.md ├── channels/ │ ├── 1ds-post-js/ │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.TXT │ │ ├── NOTICE │ │ ├── PRIVACY │ │ ├── README.md │ │ ├── SECURITY.md │ │ ├── SUPPORT.md │ │ ├── api-extractor.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── BatchNotificationActions.ts │ │ │ ├── ClockSkewManager.ts │ │ │ ├── DataModels.ts │ │ │ ├── EventBatch.ts │ │ │ ├── HttpManager.ts │ │ │ ├── Index.ts │ │ │ ├── InternalConstants.ts │ │ │ ├── KillSwitch.ts │ │ │ ├── PostChannel.ts │ │ │ ├── RetryPolicy.ts │ │ │ ├── Serializer.ts │ │ │ ├── TimeoutOverrideWrapper.ts │ │ │ └── typings/ │ │ │ └── XDomainRequest.ts │ │ ├── test/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── FileSizeCheckTest.ts │ │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ │ ├── HttpManagerTest.ts │ │ │ │ ├── KillSwitchTest.ts │ │ │ │ ├── PostChannelTest.ts │ │ │ │ ├── SerializerTest.ts │ │ │ │ ├── TestHelper.ts │ │ │ │ └── post.unittests.ts │ │ │ ├── UnitTests.html │ │ │ └── tsconfig.json │ │ ├── tsconfig.json │ │ ├── tsdoc.json │ │ └── typedoc.json │ ├── applicationinsights-channel-js/ │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── PRIVACY │ │ ├── README.md │ │ ├── Tests/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ │ ├── Sample.tests.ts │ │ │ │ ├── Sender.tests.ts │ │ │ │ ├── StatsBeat.tests.ts │ │ │ │ └── aichannel.tests.ts │ │ │ ├── UnitTests.html │ │ │ └── tsconfig.json │ │ ├── api-extractor.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── EnvelopeCreator.ts │ │ │ ├── Interfaces/ │ │ │ │ └── Contracts/ │ │ │ │ └── IRequestData.ts │ │ │ ├── Interfaces.ts │ │ │ ├── InternalConstants.ts │ │ │ ├── SendBuffer.ts │ │ │ ├── Sender.ts │ │ │ ├── Serializer.ts │ │ │ ├── Telemetry/ │ │ │ │ ├── Common/ │ │ │ │ │ └── Data.ts │ │ │ │ ├── RemoteDependencyData.ts │ │ │ │ └── RequestData.ts │ │ │ ├── TelemetryProcessors/ │ │ │ │ ├── Sample.ts │ │ │ │ └── SamplingScoreGenerators/ │ │ │ │ ├── HashCodeScoreGenerator.ts │ │ │ │ └── SamplingScoreGenerator.ts │ │ │ └── applicationinsights-channel-js.ts │ │ ├── tsconfig.json │ │ ├── tsdoc.json │ │ ├── tslint.json │ │ └── typedoc.json │ ├── offline-channel-js/ │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.TXT │ │ ├── PRIVACY │ │ ├── README.md │ │ ├── SECURITY.md │ │ ├── SUPPORT.md │ │ ├── Tests/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ │ ├── IndexedDB.tests.ts │ │ │ │ ├── TestHelper.ts │ │ │ │ ├── channel.tests.ts │ │ │ │ ├── customprovider.tests.ts │ │ │ │ ├── dbprovider.tests.ts │ │ │ │ ├── inmemorybatch.tests.ts │ │ │ │ ├── offlinebatchhandler.tests.ts │ │ │ │ ├── offlinechannel.tests.ts │ │ │ │ ├── offlinetimer.tests.ts │ │ │ │ └── webprovider.tests.ts │ │ │ ├── UnitTests.html │ │ │ └── tsconfig.json │ │ ├── api-extractor.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── Helpers/ │ │ │ │ └── Utils.ts │ │ │ ├── InMemoryBatch.ts │ │ │ ├── Interfaces/ │ │ │ │ ├── IInMemoryBatch.ts │ │ │ │ ├── IOfflineBatch.ts │ │ │ │ ├── IOfflineIndexDb.ts │ │ │ │ ├── IOfflineProvider.ts │ │ │ │ └── ISender.ts │ │ │ ├── OfflineBatchHandler.ts │ │ │ ├── OfflineChannel.ts │ │ │ ├── PayloadHelper.ts │ │ │ ├── Providers/ │ │ │ │ ├── IndexDbHelper.ts │ │ │ │ ├── IndexDbProvider.ts │ │ │ │ └── WebStorageProvider.ts │ │ │ ├── Sender.ts │ │ │ └── applicationinsights-offlinechannel-js.ts │ │ ├── tsconfig.json │ │ ├── tsdoc.json │ │ └── typedoc.json │ └── tee-channel-js/ │ ├── .npmignore │ ├── LICENSE │ ├── NOTICE │ ├── PRIVACY │ ├── README.md │ ├── Tests/ │ │ ├── Unit/ │ │ │ └── src/ │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ ├── TeeChannelCore.Tests.ts │ │ │ └── teechannel.tests.ts │ │ ├── UnitTests.html │ │ └── tsconfig.json │ ├── api-extractor.json │ ├── package.json │ ├── rollup.config.js │ ├── src/ │ │ ├── ChannelController.ts │ │ ├── Interfaces/ │ │ │ └── ITeeChannelConfig.ts │ │ ├── TeeChannel.ts │ │ └── applicationinsights-teechannel-js.ts │ ├── tsconfig.json │ ├── tsdoc.json │ └── typedoc.json ├── common/ │ ├── Tests/ │ │ ├── External/ │ │ │ ├── blanket-1.2.2.js │ │ │ ├── blanket-reporter.js │ │ │ ├── jquery.d.ts │ │ │ ├── magic-string.umd.js │ │ │ ├── qunit-1.23.1.css │ │ │ ├── qunit-1.23.1.js │ │ │ ├── qunit-2.9.1.css │ │ │ ├── qunit-2.9.1.js │ │ │ ├── qunit-2.9.3.css │ │ │ ├── qunit-2.9.3.js │ │ │ ├── qunit.d.ts │ │ │ ├── require-2.2.0.js │ │ │ ├── require-2.3.6.js │ │ │ ├── sinon-1.17.2.js │ │ │ ├── sinon-2.3.8.js │ │ │ ├── sinon-7.3.1.js │ │ │ ├── sinon.d.ts │ │ │ ├── whatwg-fetch.3.0.0.js │ │ │ └── whatwg-fetch.3.6.2.js │ │ ├── Framework/ │ │ │ ├── package.json │ │ │ ├── rollup.config.js │ │ │ ├── src/ │ │ │ │ ├── AITestClass.ts │ │ │ │ ├── Assert.ts │ │ │ │ ├── DebugHelpers.ts │ │ │ │ ├── PollingAssert.ts │ │ │ │ ├── StepResult.ts │ │ │ │ ├── TelemetryValidation/ │ │ │ │ │ ├── CommonValidator.ts │ │ │ │ │ ├── EventValidator.ts │ │ │ │ │ ├── ExceptionValidator.ts │ │ │ │ │ ├── ITypeValidator.ts │ │ │ │ │ ├── MetricValidator.ts │ │ │ │ │ ├── PageViewPerformanceValidator.ts │ │ │ │ │ ├── PageViewValidator.ts │ │ │ │ │ ├── RemoteDepdencyValidator.ts │ │ │ │ │ └── TraceValidator.ts │ │ │ │ ├── TestHelper.ts │ │ │ │ ├── ai-test-framework.ts │ │ │ │ └── interfaces/ │ │ │ │ ├── FakeXMLHttpRequest.ts │ │ │ │ ├── IASyncQueue.ts │ │ │ │ ├── IBeaconRequest.ts │ │ │ │ ├── IFetchRequest.ts │ │ │ │ ├── ITestCase.ts │ │ │ │ ├── ITestCaseAsync.ts │ │ │ │ └── ITestContext.ts │ │ │ └── tsconfig.json │ │ └── Selenium/ │ │ ├── ExceptionHelper.js │ │ └── ModuleLoader.js │ ├── changes/ │ │ └── @microsoft/ │ │ └── applicationinsights-web/ │ │ └── markwolff-refactor_readme_2019-10-04-20-34.json │ ├── config/ │ │ └── rush/ │ │ ├── .npmrc │ │ ├── command-line.json │ │ ├── common-versions.json │ │ ├── npm-shrinkwrap.json │ │ └── version-policies.json │ └── scripts/ │ ├── install-run-rush-silent.js │ ├── install-run-rush.js │ ├── install-run-rushx.js │ ├── install-run-silent.js │ └── install-run.js ├── docs/ │ ├── API-reference.md │ ├── Dependency.md │ ├── ExtensionErrorSteps.md │ ├── OTel/ │ │ ├── README.md │ │ ├── examples.md │ │ ├── otelApi.md │ │ ├── startActiveSpan.md │ │ ├── traceApi.md │ │ ├── useSpan.md │ │ └── withSpan.md │ ├── PageUnloadEvents.md │ ├── PerformanceMonitoring.md │ ├── README.md │ ├── SdkLoadFailure.md │ ├── SdkLoadFailureSteps.md │ ├── ThrottleMgr.md │ ├── WebConfig.md │ ├── es3_Support.md │ ├── exceptionTelemetry.md │ ├── upgrade/ │ │ ├── MergeCommonToCore.md │ │ ├── v2_UpgradeGuide.md │ │ └── v3_BreakingChanges.md │ └── webSdk/ │ └── README.md ├── examples/ │ ├── AISKU/ │ │ ├── README.md │ │ ├── index.html │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── aisku-example-index.ts │ │ │ ├── aisku-init.ts │ │ │ └── utils.ts │ │ ├── style/ │ │ │ └── style.css │ │ └── tsconfig.json │ ├── README.md │ ├── cfgSync/ │ │ ├── CfgSync.html │ │ ├── README.md │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── example-cfgsync-index.ts │ │ │ ├── example-cfgsync-init.ts │ │ │ ├── listener1.ts │ │ │ ├── listener2.ts │ │ │ └── main.ts │ │ └── tsconfig.json │ ├── dependency/ │ │ ├── README.md │ │ ├── index.html │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── appinsights-init.ts │ │ │ ├── dependencies-example-index.ts │ │ │ ├── startSpan-example.ts │ │ │ └── utils.ts │ │ ├── style/ │ │ │ └── style.css │ │ └── tsconfig.json │ ├── shared-worker/ │ │ ├── README.md │ │ ├── SharedWorker.html │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── example-shared-worker.ts │ │ │ ├── interfaces/ │ │ │ │ └── IExampleMessage.ts │ │ │ ├── worker-npm-init.ts │ │ │ ├── worker.ts │ │ │ └── worker2.ts │ │ └── tsconfig.json │ └── startSpan/ │ ├── package.json │ ├── rollup.config.js │ ├── src/ │ │ ├── startSpanExample.ts │ │ └── startspan-example-index.ts │ └── tsconfig.json ├── extensions/ │ ├── applicationinsights-analytics-js/ │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── PRIVACY │ │ ├── README.md │ │ ├── Tests/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── AnalyticsExtensionSize.tests.ts │ │ │ │ ├── AnalyticsPlugin.tests.ts │ │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ │ ├── TelemetryItemCreator.tests.ts │ │ │ │ └── appinsights-analytics.tests.ts │ │ │ ├── UnitTests.html │ │ │ └── tsconfig.json │ │ ├── api-extractor.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── JavaScriptSDK/ │ │ │ │ ├── AnalyticsPlugin.ts │ │ │ │ ├── Interfaces/ │ │ │ │ │ └── IAnalyticsConfig.ts │ │ │ │ ├── Telemetry/ │ │ │ │ │ ├── PageViewManager.ts │ │ │ │ │ ├── PageViewPerformanceManager.ts │ │ │ │ │ └── PageVisitTimeManager.ts │ │ │ │ └── Timing.ts │ │ │ └── applicationinsights-analytics-js.ts │ │ ├── tsconfig.json │ │ ├── tsdoc.json │ │ ├── tslint.json │ │ └── typedoc.json │ ├── applicationinsights-angularplugin-js/ │ │ ├── README.md │ │ └── tsdoc.json │ ├── applicationinsights-cfgsync-js/ │ │ ├── .npmignore │ │ ├── README.md │ │ ├── Tests/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ │ ├── cfgsync.tests.ts │ │ │ │ ├── cfgsynchelper.tests.ts │ │ │ │ └── cfgsyncplugin.tests.ts │ │ │ ├── UnitTests.html │ │ │ └── tsconfig.json │ │ ├── api-extractor.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── CfgSyncHelperFuncs.ts │ │ │ ├── CfgSyncPlugin.ts │ │ │ ├── Interfaces/ │ │ │ │ ├── ICfgSyncCdnConfig.ts │ │ │ │ ├── ICfgSyncConfig.ts │ │ │ │ └── ICfgSyncPlugin.ts │ │ │ └── applicationinsights-cfgsync-js.ts │ │ ├── tsconfig.json │ │ ├── tsdoc.json │ │ ├── tslint.json │ │ └── typedoc.json │ ├── applicationinsights-clickanalytics-js/ │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── PRIVACY │ │ ├── README.md │ │ ├── Tests/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── ClickEventTest.ts │ │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ │ └── appinsights-clickanalytics.tests.ts │ │ │ ├── UnitTests.html │ │ │ └── tsconfig.json │ │ ├── api-extractor.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── scripts/ │ │ │ ├── listAzCdnVersions.ps1 │ │ │ ├── publishAzReleaseToCdn.ps1 │ │ │ └── setAzActiveCdnVersion.ps1 │ │ ├── src/ │ │ │ ├── Behaviours.ts │ │ │ ├── ClickAnalyticsPlugin.ts │ │ │ ├── DataCollector.ts │ │ │ ├── Enums.ts │ │ │ ├── Interfaces/ │ │ │ │ └── Datamodel.ts │ │ │ ├── applicationinsights-clickanalytics-js.ts │ │ │ ├── common/ │ │ │ │ └── Utils.ts │ │ │ ├── events/ │ │ │ │ ├── PageAction.ts │ │ │ │ └── WebEvent.ts │ │ │ └── handlers/ │ │ │ ├── AutoCaptureHandler.ts │ │ │ └── DomContentHandler.ts │ │ ├── tsconfig.json │ │ ├── tsdoc.json │ │ ├── tslint.json │ │ └── typedoc.json │ ├── applicationinsights-debugplugin-js/ │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── PRIVACY │ │ ├── README.md │ │ ├── api-extractor.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── sample/ │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ └── public/ │ │ │ ├── index.html │ │ │ └── sample.js │ │ ├── scripts/ │ │ │ ├── listAzCdnVersions.ps1 │ │ │ ├── publishAzReleaseToCdn.ps1 │ │ │ └── setAzActiveCdnVersion.ps1 │ │ ├── src/ │ │ │ ├── DebugPlugin.ts │ │ │ ├── applicationinsights-debugplugin-js.ts │ │ │ ├── components/ │ │ │ │ ├── Dashboard.ts │ │ │ │ ├── LogEntry.ts │ │ │ │ ├── debugBins.ts │ │ │ │ ├── filterList.ts │ │ │ │ ├── helpers.ts │ │ │ │ └── styleNodeSrc.ts │ │ │ ├── interfaces/ │ │ │ │ └── IDebugPluginConfig.ts │ │ │ └── localization/ │ │ │ └── EN-US.json │ │ ├── tsconfig.json │ │ ├── tsdoc.json │ │ ├── tslint.json │ │ └── typedoc.json │ ├── applicationinsights-dependencies-js/ │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── PRIVACY │ │ ├── README.md │ │ ├── Tests/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ │ ├── TestChannelPlugin.ts │ │ │ │ ├── W3CTraceStateDependency.tests.ts │ │ │ │ ├── ajax.tests.ts │ │ │ │ └── dependencies.tests.ts │ │ │ ├── UnitTests.html │ │ │ └── tsconfig.json │ │ ├── api-extractor.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── DependencyInitializer.ts │ │ │ ├── DependencyListener.ts │ │ │ ├── InternalConstants.ts │ │ │ ├── ajax.ts │ │ │ ├── ajaxRecord.ts │ │ │ └── applicationinsights-dependencies-js.ts │ │ ├── tsconfig.json │ │ ├── tsdoc.json │ │ ├── tslint.json │ │ └── typedoc.json │ ├── applicationinsights-osplugin-js/ │ │ ├── .npmignore │ │ ├── README.md │ │ ├── Tests/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── OsPluginTest.ts │ │ │ │ └── applicationinsights-osplugin.tests.ts │ │ │ ├── UnitTests.html │ │ │ └── tsconfig.json │ │ ├── api-extractor.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── DataModels.ts │ │ │ ├── OsPlugin.ts │ │ │ └── applicationinsights-osplugin-js.ts │ │ ├── tsconfig.json │ │ ├── tsdoc.json │ │ └── typedoc.json │ ├── applicationinsights-perfmarkmeasure-js/ │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── PRIVACY │ │ ├── README.md │ │ ├── Tests/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ │ ├── MarkMeasureTests.ts │ │ │ │ └── appinsights-perfmarkmeasure.tests.ts │ │ │ ├── UnitTests.html │ │ │ └── tsconfig.json │ │ ├── api-extractor.json │ │ ├── example/ │ │ │ └── cdn-usage.html │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── scripts/ │ │ │ ├── listAzCdnVersions.ps1 │ │ │ ├── publishAzReleaseToCdn.ps1 │ │ │ └── setAzActiveCdnVersion.ps1 │ │ ├── src/ │ │ │ ├── PerfMarkMeasureManager.ts │ │ │ ├── applicationinsights-perfmarkmeasure-js.ts │ │ │ └── interfaces/ │ │ │ └── IPerfMarkMeasureConfiguration.ts │ │ ├── tsconfig.json │ │ ├── tsdoc.json │ │ ├── tslint.json │ │ └── typedoc.json │ ├── applicationinsights-properties-js/ │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── PRIVACY │ │ ├── README.md │ │ ├── Tests/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ │ ├── SessionManager.Tests.ts │ │ │ │ ├── TelemetryContext.Tests.ts │ │ │ │ ├── TestChannelPlugin.ts │ │ │ │ ├── prop.tests.ts │ │ │ │ ├── properties.tests.ts │ │ │ │ └── propertiesSize.tests.ts │ │ │ ├── UnitTests.html │ │ │ └── tsconfig.json │ │ ├── api-extractor.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── Context/ │ │ │ │ ├── Application.ts │ │ │ │ ├── Device.ts │ │ │ │ ├── Internal.ts │ │ │ │ ├── Location.ts │ │ │ │ ├── Session.ts │ │ │ │ └── User.ts │ │ │ ├── Interfaces/ │ │ │ │ ├── IPropTelemetryContext.ts │ │ │ │ └── IPropertiesConfig.ts │ │ │ ├── PropertiesPlugin.ts │ │ │ ├── TelemetryContext.ts │ │ │ └── applicationinsights-properties-js.ts │ │ ├── tsconfig.json │ │ ├── tsdoc.json │ │ ├── tslint.json │ │ └── typedoc.json │ ├── applicationinsights-react-js/ │ │ ├── NOTICE │ │ ├── PRIVACY │ │ └── README.md │ └── applicationinsights-react-native/ │ ├── NOTICE │ ├── PRIVACY │ └── README.md ├── gruntfile.js ├── legacy/ │ └── README.md ├── nuget/ │ └── Microsoft.ApplicationInsights.JavaScript.Snippet.nuspec ├── package.json ├── policheck-exclusions.xml ├── rollup.base.config.js ├── rush.json ├── scripts/ │ └── dtsgen.js ├── shared/ │ ├── 1ds-core-js/ │ │ ├── .npmignore │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.TXT │ │ ├── NOTICE │ │ ├── PRIVACY │ │ ├── README.md │ │ ├── SECURITY.md │ │ ├── SUPPORT.md │ │ ├── api-extractor.json │ │ ├── auto-minify.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ └── Index.ts │ │ ├── test/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── FileSizeCheckTest.ts │ │ │ │ └── core.unittests.ts │ │ │ ├── UnitTests.html │ │ │ └── tsconfig.json │ │ ├── tsconfig.json │ │ ├── tsdoc.json │ │ └── typedoc.json │ ├── AppInsightsCommon/ │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── PRIVACY │ │ ├── README.md │ │ ├── api-extractor.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ └── applicationinsights-common.ts │ │ ├── tsconfig.json │ │ ├── tsdoc.json │ │ ├── tslint.json │ │ └── typedoc.json │ └── AppInsightsCore/ │ ├── .npmignore │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── NOTICE │ ├── PRIVACY │ ├── README.md │ ├── SpanImplementationSummary.md │ ├── Span_Implementation_Refactoring_Summary.md │ ├── Tests/ │ │ ├── Perf/ │ │ │ ├── src/ │ │ │ │ ├── CorePerfCheck.Tests.ts │ │ │ │ └── aiperftests.ts │ │ │ └── tsconfig.json │ │ ├── PerfTests.html │ │ ├── Unit/ │ │ │ └── src/ │ │ │ ├── OpenTelemetry/ │ │ │ │ ├── commonUtils.Tests.ts │ │ │ │ ├── errors.Tests.ts │ │ │ │ └── otelNegative.Tests.ts │ │ │ ├── ai/ │ │ │ │ ├── AppInsightsCommon.tests.ts │ │ │ │ ├── AppInsightsCoreSize.Tests.ts │ │ │ │ ├── ApplicationInsightsCore.Tests.ts │ │ │ │ ├── ConnectionStringParser.tests.ts │ │ │ │ ├── CookieManager.Tests.ts │ │ │ │ ├── EventHelper.Tests.ts │ │ │ │ ├── EventsDiscardedReason.Tests.ts │ │ │ │ ├── Exception.tests.ts │ │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ │ ├── HelperFunc.Tests.ts │ │ │ │ ├── LoggingEnum.Tests.ts │ │ │ │ ├── RequestHeaders.tests.ts │ │ │ │ ├── SendPostManager.Tests.ts │ │ │ │ ├── SeverityLevel.tests.ts │ │ │ │ ├── StatsBeat.Tests.ts │ │ │ │ ├── TestPlugins.ts │ │ │ │ ├── ThrottleMgr.tests.ts │ │ │ │ ├── UpdateConfig.Tests.ts │ │ │ │ └── Util.tests.ts │ │ │ ├── aiunittests.ts │ │ │ ├── attribute/ │ │ │ │ └── attributeContainer.Tests.ts │ │ │ ├── config/ │ │ │ │ ├── Dynamic.Tests.ts │ │ │ │ └── DynamicConfig.Tests.ts │ │ │ ├── ext/ │ │ │ │ ├── CoreTest.ts │ │ │ │ ├── DynamicProtoTests.ts │ │ │ │ ├── ESPromiseSchedulerTests.ts │ │ │ │ ├── ESPromiseTests.ts │ │ │ │ ├── GlobalTestHooks.Test.ts │ │ │ │ ├── SpanUtilsTests.ts │ │ │ │ ├── TestHelper.ts │ │ │ │ ├── UtilsTest.ts │ │ │ │ └── ValueSanitizerTests.ts │ │ │ └── trace/ │ │ │ ├── W3CTraceStateModes.tests.ts │ │ │ ├── W3cTraceParentTests.ts │ │ │ ├── W3cTraceState.Tests.ts │ │ │ ├── span.Tests.ts │ │ │ ├── traceState.Tests.ts │ │ │ └── traceUtils.Tests.ts │ │ ├── UnitTests.html │ │ └── tsconfig.json │ ├── api-extractor.json │ ├── package.json │ ├── rollup.config.js │ ├── src/ │ │ ├── config/ │ │ │ ├── ConfigDefaultHelpers.ts │ │ │ ├── ConfigDefaults.ts │ │ │ ├── DynamicConfig.ts │ │ │ ├── DynamicProperty.ts │ │ │ ├── DynamicState.ts │ │ │ └── DynamicSupport.ts │ │ ├── constants/ │ │ │ ├── Constants.ts │ │ │ └── InternalConstants.ts │ │ ├── core/ │ │ │ ├── AggregationError.ts │ │ │ ├── AppInsightsCore.ts │ │ │ ├── AsyncUtils.ts │ │ │ ├── BaseTelemetryPlugin.ts │ │ │ ├── CookieMgr.ts │ │ │ ├── DbgExtensionUtils.ts │ │ │ ├── InstrumentHooks.ts │ │ │ ├── NotificationManager.ts │ │ │ ├── PerfManager.ts │ │ │ ├── ProcessTelemetryContext.ts │ │ │ ├── ResponseHelpers.ts │ │ │ ├── SenderPostManager.ts │ │ │ ├── StatsBeat.ts │ │ │ ├── TelemetryHelpers.ts │ │ │ ├── TelemetryInitializerPlugin.ts │ │ │ ├── UnloadHandlerContainer.ts │ │ │ └── UnloadHookContainer.ts │ │ ├── diagnostics/ │ │ │ ├── DiagnosticLogger.ts │ │ │ └── ThrottleMgr.ts │ │ ├── enums/ │ │ │ ├── EnumHelperFuncs.ts │ │ │ ├── W3CTraceFlags.ts │ │ │ ├── ai/ │ │ │ │ ├── DependencyTypes.ts │ │ │ │ ├── Enums.ts │ │ │ │ ├── EventsDiscardedReason.ts │ │ │ │ ├── FeatureOptInEnums.ts │ │ │ │ ├── InitActiveStatusEnum.ts │ │ │ │ ├── LoggingEnums.ts │ │ │ │ ├── SendRequestReason.ts │ │ │ │ ├── StatsType.ts │ │ │ │ ├── TelemetryUnloadReason.ts │ │ │ │ ├── TelemetryUpdateReason.ts │ │ │ │ ├── TraceHeadersMode.ts │ │ │ │ └── UrlRedactionOptions.ts │ │ │ ├── ext/ │ │ │ │ └── Enums.ts │ │ │ └── otel/ │ │ │ ├── OTelSamplingDecision.ts │ │ │ ├── OTelSpanKind.ts │ │ │ ├── OTelSpanStatus.ts │ │ │ └── eAttributeChangeOp.ts │ │ ├── ext/ │ │ │ ├── AppInsightsExtCore.ts │ │ │ ├── ValueSanitizer.ts │ │ │ ├── extSpanUtils.ts │ │ │ └── extUtils.ts │ │ ├── index.ts │ │ ├── interfaces/ │ │ │ ├── IException.ts │ │ │ ├── IOTelHrTime.ts │ │ │ ├── ai/ │ │ │ │ ├── ConnectionString.ts │ │ │ │ ├── IAppInsights.ts │ │ │ │ ├── IAppInsightsCore.ts │ │ │ │ ├── IChannelControls.ts │ │ │ │ ├── IChannelControlsHost.ts │ │ │ │ ├── IConfig.ts │ │ │ │ ├── IConfiguration.ts │ │ │ │ ├── ICookieMgr.ts │ │ │ │ ├── ICorrelationConfig.ts │ │ │ │ ├── IDbgExtension.ts │ │ │ │ ├── IDependencyTelemetry.ts │ │ │ │ ├── IDiagnosticLogger.ts │ │ │ │ ├── IDistributedTraceContext.ts │ │ │ │ ├── IEventTelemetry.ts │ │ │ │ ├── IExceptionConfig.ts │ │ │ │ ├── IExceptionTelemetry.ts │ │ │ │ ├── IFeatureOptIn.ts │ │ │ │ ├── IInstrumentHooks.ts │ │ │ │ ├── IMetricTelemetry.ts │ │ │ │ ├── INetworkStatsbeat.ts │ │ │ │ ├── INotificationListener.ts │ │ │ │ ├── INotificationManager.ts │ │ │ │ ├── IPageViewPerformanceTelemetry.ts │ │ │ │ ├── IPageViewTelemetry.ts │ │ │ │ ├── IPartC.ts │ │ │ │ ├── IPerfEvent.ts │ │ │ │ ├── IPerfManager.ts │ │ │ │ ├── IProcessTelemetryContext.ts │ │ │ │ ├── IPropertiesPlugin.ts │ │ │ │ ├── IRequestContext.ts │ │ │ │ ├── IRequestTelemetry.ts │ │ │ │ ├── ISenderPostManager.ts │ │ │ │ ├── IStatsBeat.ts │ │ │ │ ├── IStatsEventData.ts │ │ │ │ ├── IStatsMgr.ts │ │ │ │ ├── IStorageBuffer.ts │ │ │ │ ├── ITelemetryContext.ts │ │ │ │ ├── ITelemetryInitializers.ts │ │ │ │ ├── ITelemetryItem.ts │ │ │ │ ├── ITelemetryPlugin.ts │ │ │ │ ├── ITelemetryPluginChain.ts │ │ │ │ ├── ITelemetryUnloadState.ts │ │ │ │ ├── ITelemetryUpdateState.ts │ │ │ │ ├── IThrottleMgr.ts │ │ │ │ ├── ITraceParent.ts │ │ │ │ ├── ITraceProvider.ts │ │ │ │ ├── ITraceTelemetry.ts │ │ │ │ ├── IUnloadHook.ts │ │ │ │ ├── IUnloadableComponent.ts │ │ │ │ ├── IW3cTraceState.ts │ │ │ │ ├── IXDomainRequest.ts │ │ │ │ ├── IXHROverride.ts │ │ │ │ ├── PartAExtensions.ts │ │ │ │ ├── context/ │ │ │ │ │ ├── IApplication.ts │ │ │ │ │ ├── IDevice.ts │ │ │ │ │ ├── IInternal.ts │ │ │ │ │ ├── ILocation.ts │ │ │ │ │ ├── IOperatingSystem.ts │ │ │ │ │ ├── ISample.ts │ │ │ │ │ ├── ISession.ts │ │ │ │ │ ├── ISessionManager.ts │ │ │ │ │ ├── ITelemetryTrace.ts │ │ │ │ │ ├── IUser.ts │ │ │ │ │ └── IWeb.ts │ │ │ │ ├── contracts/ │ │ │ │ │ ├── AvailabilityData.ts │ │ │ │ │ ├── ContextTagKeys.ts │ │ │ │ │ ├── DataPointType.ts │ │ │ │ │ ├── DependencyKind.ts │ │ │ │ │ ├── DependencySourceType.ts │ │ │ │ │ ├── IBase.ts │ │ │ │ │ ├── IData.ts │ │ │ │ │ ├── IDataPoint.ts │ │ │ │ │ ├── IDomain.ts │ │ │ │ │ ├── IEventData.ts │ │ │ │ │ ├── IExceptionData.ts │ │ │ │ │ ├── IExceptionDetails.ts │ │ │ │ │ ├── IMessageData.ts │ │ │ │ │ ├── IMetricData.ts │ │ │ │ │ ├── IPageViewData.ts │ │ │ │ │ ├── IPageViewPerfData.ts │ │ │ │ │ ├── IRemoteDependencyData.ts │ │ │ │ │ ├── IStackFrame.ts │ │ │ │ │ └── SeverityLevel.ts │ │ │ │ └── telemetry/ │ │ │ │ ├── IEnvelope.ts │ │ │ │ └── ISerializable.ts │ │ │ ├── config/ │ │ │ │ ├── IConfigDefaults.ts │ │ │ │ ├── IDynamicConfigHandler.ts │ │ │ │ ├── IDynamicPropertyHandler.ts │ │ │ │ ├── IDynamicWatcher.ts │ │ │ │ └── _IDynamicConfigHandlerState.ts │ │ │ ├── ext/ │ │ │ │ └── DataModels.ts │ │ │ └── otel/ │ │ │ ├── IOTelApi.ts │ │ │ ├── IOTelApiCtx.ts │ │ │ ├── IOTelAttributes.ts │ │ │ ├── attribute/ │ │ │ │ └── IAttributeContainer.ts │ │ │ ├── config/ │ │ │ │ ├── IOTelAttributeLimits.ts │ │ │ │ ├── IOTelConfig.ts │ │ │ │ ├── IOTelErrorHandlers.ts │ │ │ │ ├── IOTelSpanLimits.ts │ │ │ │ └── IOTelTraceCfg.ts │ │ │ └── trace/ │ │ │ ├── IOTelSpan.ts │ │ │ ├── IOTelSpanContext.ts │ │ │ ├── IOTelSpanCtx.ts │ │ │ ├── IOTelSpanOptions.ts │ │ │ ├── IOTelSpanStatus.ts │ │ │ ├── IOTelTraceApi.ts │ │ │ ├── IOTelTraceState.ts │ │ │ ├── IOTelTracer.ts │ │ │ ├── IOTelTracerOptions.ts │ │ │ ├── IOTelTracerProvider.ts │ │ │ └── IReadableSpan.ts │ │ ├── internal/ │ │ │ ├── EventHelpers.ts │ │ │ ├── attributeHelpers.ts │ │ │ ├── commonUtils.ts │ │ │ ├── handleErrors.ts │ │ │ ├── noopHelpers.ts │ │ │ └── timeHelpers.ts │ │ ├── otel/ │ │ │ ├── api/ │ │ │ │ ├── OTelApi.ts │ │ │ │ ├── errors/ │ │ │ │ │ ├── OTelError.ts │ │ │ │ │ ├── OTelInvalidAttributeError.ts │ │ │ │ │ └── OTelSpanError.ts │ │ │ │ └── trace/ │ │ │ │ ├── span.ts │ │ │ │ ├── spanContext.ts │ │ │ │ ├── traceApi.ts │ │ │ │ ├── traceProvider.ts │ │ │ │ ├── traceState.ts │ │ │ │ ├── tracer.ts │ │ │ │ ├── tracerProvider.ts │ │ │ │ └── utils.ts │ │ │ └── attribute/ │ │ │ ├── SemanticConventions.ts │ │ │ └── attributeContainer.ts │ │ ├── telemetry/ │ │ │ ├── ConnectionStringParser.ts │ │ │ ├── RequestResponseHeaders.ts │ │ │ ├── TelemetryItemCreator.ts │ │ │ ├── W3cTraceState.ts │ │ │ └── ai/ │ │ │ ├── Common/ │ │ │ │ ├── Data.ts │ │ │ │ ├── DataPoint.ts │ │ │ │ ├── DataSanitizer.ts │ │ │ │ └── Envelope.ts │ │ │ ├── DataTypes.ts │ │ │ ├── EnvelopeTypes.ts │ │ │ ├── Event.ts │ │ │ ├── Exception.ts │ │ │ ├── Metric.ts │ │ │ ├── PageView.ts │ │ │ ├── PageViewPerformance.ts │ │ │ ├── RemoteDependencyData.ts │ │ │ └── Trace.ts │ │ └── utils/ │ │ ├── CoreUtils.ts │ │ ├── DataCacheHelper.ts │ │ ├── DomHelperFuncs.ts │ │ ├── EnvUtils.ts │ │ ├── HelperFuncs.ts │ │ ├── Offline.ts │ │ ├── RandomHelper.ts │ │ ├── StorageHelperFuncs.ts │ │ ├── TraceParent.ts │ │ ├── UrlHelperFuncs.ts │ │ └── Util.ts │ ├── tsconfig.json │ ├── tsdoc.json │ ├── tslint.json │ └── typedoc.json ├── tools/ │ ├── applicationinsights-web-snippet/ │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── PRIVACY │ │ ├── README.md │ │ ├── Tests/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── SnippetTests.ts │ │ │ │ └── snippet.tests.ts │ │ │ ├── UnitTests.html │ │ │ ├── manual/ │ │ │ │ ├── cspUseNounceTest.html │ │ │ │ └── cspUsePolicyTest.html │ │ │ └── tsconfig.json │ │ ├── api-extractor.json │ │ ├── createAiSnippet.js │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── rollupOneDSSnippet.config.js │ │ ├── rollupSnippet.config.js │ │ ├── src/ │ │ │ ├── 1dsSupport.ts │ │ │ ├── 1dsType.ts │ │ │ ├── aiSupport.ts │ │ │ ├── applicationinsights-web-snippet.ts │ │ │ ├── common/ │ │ │ │ └── utils.ts │ │ │ ├── snippet-config.jsonc │ │ │ ├── snippet.ts │ │ │ ├── support.ts │ │ │ └── type.ts │ │ ├── trustedTypeSupport.md │ │ ├── tsconfig.json │ │ ├── tslint.json │ │ └── typedoc.json │ ├── chrome-debug-extension/ │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── PRIVACY │ │ ├── README.md │ │ ├── manifest.json │ │ ├── package.json │ │ ├── pages/ │ │ │ └── popup.html │ │ ├── rollup.config.js │ │ ├── scripts/ │ │ │ ├── listAzCdnVersions.ps1 │ │ │ ├── publishAzReleaseToCdn.ps1 │ │ │ └── setAzActiveCdnVersion.ps1 │ │ ├── src/ │ │ │ ├── Enums.ts │ │ │ ├── LogEntry.ts │ │ │ ├── UpdateCheck.ts │ │ │ ├── background.ts │ │ │ ├── components/ │ │ │ │ ├── IFilterSettings.ts │ │ │ │ ├── configurationSelection.tsx │ │ │ │ ├── eventDetails.tsx │ │ │ │ ├── eventTable.tsx │ │ │ │ ├── eventTypeCounter.tsx │ │ │ │ ├── eventTypeFilter.tsx │ │ │ │ ├── eventTypeIcon.tsx │ │ │ │ ├── optionsBar.tsx │ │ │ │ ├── splitPanel.tsx │ │ │ │ └── telemetryViewer.tsx │ │ │ ├── configuration/ │ │ │ │ ├── Configuration.types.ts │ │ │ │ ├── IConfiguration.ts │ │ │ │ ├── IPopupSettings.ts │ │ │ │ ├── PopupConfigCache.ts │ │ │ │ ├── configuration.ts │ │ │ │ └── defaultConfiguration.ts │ │ │ ├── contentLoad.ts │ │ │ ├── dataSources/ │ │ │ │ ├── IDataEvent.ts │ │ │ │ ├── IDataSource.ts │ │ │ │ ├── dataHelpers.ts │ │ │ │ ├── dataSources.ts │ │ │ │ ├── defaultDataSource.ts │ │ │ │ └── noOpDataSource.ts │ │ │ ├── helpers.ts │ │ │ ├── interfaces/ │ │ │ │ └── IMessage.ts │ │ │ ├── pageHelper.ts │ │ │ ├── popup.tsx │ │ │ ├── session.ts │ │ │ └── telemetryViewerPopup.tsx │ │ ├── styles/ │ │ │ └── popup.css │ │ └── tsconfig.json │ ├── config/ │ │ ├── README.md │ │ ├── config.json │ │ ├── package.json │ │ ├── scripts/ │ │ │ ├── listAzCdnVersions.ps1 │ │ │ ├── publishAzReleaseToCdn.ps1 │ │ │ └── setAzActiveCdnVersion.ps1 │ │ └── test-config.json │ ├── github-page-script-injection/ │ │ └── injectScript.js │ ├── grunt-tasks/ │ │ ├── chrome/ │ │ │ └── bridge.js │ │ ├── minifyNames.js │ │ ├── qunit.js │ │ └── stringReplace.js │ ├── release-tools/ │ │ ├── README.md │ │ ├── npm_package.js │ │ ├── npm_publish.js │ │ ├── npm_set_latest.js │ │ ├── package.json │ │ ├── package_groups.json │ │ ├── setVersion.js │ │ ├── updatemanifest.js │ │ └── zipbrowser.js │ ├── rollup-es5/ │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── Tests/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── Es5Rollup.Tests.ts │ │ │ │ └── Es5RollupTests.ts │ │ │ ├── UnitTests.html │ │ │ └── tsconfig.json │ │ ├── api-extractor.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── ImportCheck.ts │ │ │ ├── applicationinsights-rollup-es5.ts │ │ │ └── es5/ │ │ │ ├── Es5Check.ts │ │ │ ├── Es5Poly.ts │ │ │ ├── Es5Tokens.ts │ │ │ ├── FormatError.ts │ │ │ ├── Interfaces.ts │ │ │ └── Utils.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── rollup-plugin-uglify3-js/ │ │ ├── .eslintrc │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ └── uglify3-js.ts │ │ └── tsconfig.json │ ├── shims/ │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── Tests/ │ │ │ ├── Unit/ │ │ │ │ └── src/ │ │ │ │ ├── ShimsTests.ts │ │ │ │ └── shims.tests.ts │ │ │ ├── UnitTests.html │ │ │ └── tsconfig.json │ │ ├── api-extractor.json │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── Constants.ts │ │ │ ├── TsLibGlobals.ts │ │ │ ├── TsLibShims.ts │ │ │ └── applicationinsights-shims.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── sizeImageGenerator/ │ │ ├── package.json │ │ └── size-image-generator.js │ ├── status-tools/ │ │ ├── github-status.js │ │ └── package.json │ ├── subResourceIntegrity/ │ │ └── generateIntegrityFile.js │ └── updateDistEsm/ │ └── updateDistEsm.js ├── tsconfig.json ├── tsconfigmodule.json ├── tsdoc.json ├── tslint-base.json ├── tslint.json ├── version.json └── versionConflict.md ================================================ FILE CONTENTS ================================================ ================================================ FILE: .aiAutoMinify.json ================================================ { "pkgs": { "@microsoft/applicationinsights-core-js": { "constEnums": [ "_eSetDynamicPropertyFlags", "ePendingOp", "CallbackType", "eW3CTraceFlags", "eRequestHeaders", "eTraceStateKeyType", "eOfflineValue", "eDependencyTypes", "eStorageType", "FieldType", "eDistributedTracingModes", "EventPersistenceValue", "eEventsDiscardedReason", "eBatchDiscardedReason", "FeatureOptInMode", "CdnFeatureMode", "eActiveStatus", "eLoggingSeverity", "_eInternalMessageId", "SendRequestReason", "eStatsType", "TelemetryUnloadReason", "TelemetryUpdateReason", "eTraceHeadersMode", "eUrlRedactionOptions", "eValueKind", "EventLatencyValue", "eEventPropertyType", "EventSendType", "eTraceLevel", "_eExtendedInternalMessageId", "GuidStyle", "FieldValueSanitizerType", "TransportType", "eAttributeChangeOp", "eOTelSamplingDecision", "eOTelSpanKind", "eOTelSpanStatusCode", "eAttributeSource", "AddAttributeResult", "DataPointType", "DependencyKind", "DependencySourceType", "eSeverityLevel", "eAttributeFilter", "DataSanitizerValues" ] }, "@microsoft/applicationinsights-perfmarkmeasure-js": { "constEnums": [] }, "@microsoft/applicationinsights-common": { "constEnums": [] }, "@microsoft/applicationinsights-properties-js": { "constEnums": [] }, "@microsoft/applicationinsights-dependencies-js": { "constEnums": [] }, "@microsoft/applicationinsights-debugplugin-js": { "constEnums": [] }, "@microsoft/applicationinsights-channel-js": { "constEnums": [ "eSerializeType" ] }, "@microsoft/applicationinsights-react-native": { "constEnums": [] }, "@microsoft/applicationinsights-clickanalytics-js": { "constEnums": [] }, "@microsoft/applicationinsights-web-basic": { "constEnums": [] }, "@microsoft/applicationinsights-analytics-js": { "constEnums": [ "eRouteTraceStrategy" ] }, "@microsoft/applicationinsights-web": { "constEnums": [] }, "@microsoft/applicationinsights-react-js": { "constEnums": [] }, "@microsoft/applicationinsights-teechannel-js": { "constEnums": [] }, "@microsoft/applicationinsights-cfgsync-js": { "constEnums": [ "ICfgSyncMode" ] }, "@microsoft/1ds-core-js": { "constEnums": [] }, "@microsoft/1ds-post-js": { "constEnums": [ "EventBatchNotificationReason" ] }, "@microsoft/applicationinsights-offlinechannel-js": { "constEnums": [ "eStorageType", "eBatchSendStatus", "eBatchStoreStatus", "CursorProcessResult", "eStorageProviders", "ValueQueryType" ] }, "@microsoft/applicationinsights-osplugin-js": { "constEnums": [] } } } ================================================ FILE: .eslintrc ================================================ { "env": { "browser": true, "es2021": true }, "plugins": [ "security" ], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:security/recommended" ], "rules": { "indent": ["error"], // Enabling for auto fixing "quotes": ["warn", "double"], // Enabled for auto fixing "curly": [ "error" ], // Enabling for auto fixing "brace-style": [ "error" ], // Enabling for auto fixing "prefer-const": "off", "prefer-spread": "off", "no-var": "off", "no-extra-boolean-cast": "off", "prefer-rest-params": "off", "no-case-declarations": "off", "no-prototype-builtins": "off", "no-useless-escape": "off", // Suppressing Error -- need to Review Later "no-trailing-spaces": [ "warn", { "skipBlankLines": true }],// Enabled for auto fixing "no-const-assign": "error", "comma-dangle": [ "error", "never" ], // Enabled for auto fixing "security/detect-object-injection": "off", // Suppress Warning -- need to Review Later "security/detect-non-literal-fs-filename": "off", // This was causing a bunch of false positive matches for dynamic config "watch" function "@typescript-eslint/ban-types": "off", "@typescript-eslint/no-unused-vars": [ "warn", { "vars": "all", "args": "none", "argsIgnorePattern": "^_", "ignoreRestSiblings": true } ], "@typescript-eslint/triple-slash-reference": "off", "@typescript-eslint/no-inferrable-types": "off", "@typescript-eslint/no-this-alias": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-empty-interface": "off", "@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/no-extra-semi": "error", // Enabled for auto fixing "@typescript-eslint/no-non-null-assertion": "error" } } ================================================ FILE: .gitattributes ================================================ ############################################################################### # Set default behavior to automatically normalize line endings. ############################################################################### * text=auto # Don't allow people to merge changes to these generated files, because the result # may be invalid. You need to run "rush update" again. shrinkwrap.yaml merge=binary npm-shrinkwrap.json merge=binary yarn.lock merge=binary ############################################################################### # Set default behavior for command prompt diff. # # This is need for earlier builds of msysgit that does not have it on by # default for csharp files. # Note: This is only used by command line ############################################################################### #*.cs diff=csharp ############################################################################### # Set the merge driver for project and solution files # # Merging from the command prompt will add diff markers to the files if there # are conflicts (Merging from VS is not affected by the settings below, in VS # the diff markers are never inserted). Diff markers may cause the following # file extensions to fail to load in VS. An alternative would be to treat # these files as binary and thus will always conflict and require user # intervention with every merge. To do so, just uncomment the entries below ############################################################################### #*.sln merge=binary #*.csproj merge=binary #*.vbproj merge=binary #*.vcxproj merge=binary #*.vcproj merge=binary #*.dbproj merge=binary #*.fsproj merge=binary #*.lsproj merge=binary #*.wixproj merge=binary #*.modelproj merge=binary #*.sqlproj merge=binary #*.wwaproj merge=binary ############################################################################### # behavior for image files # # image files are treated as binary by default. ############################################################################### #*.jpg binary #*.png binary #*.gif binary ############################################################################### # diff behavior for common document formats # # Convert binary document formats to text before diffing them. This feature # is only available from the command line. Turn it on by uncommenting the # entries below. ############################################################################### #*.doc diff=astextplain #*.DOC diff=astextplain #*.docx diff=astextplain #*.DOCX diff=astextplain #*.dot diff=astextplain #*.DOT diff=astextplain #*.pdf diff=astextplain #*.PDF diff=astextplain #*.rtf diff=astextplain #*.RTF diff=astextplain ================================================ FILE: .github/CODEOWNERS ================================================ * @microsoft/ApplicationInsights-JS-owners * @microsoft/ApplicationInsights-JS-CodeOwners /.github/CODEOWNERS @microsoft/ApplicationInsights-JS-owners ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug report about: Create a new bug report title: "[BUG]" labels: '' assignees: '' --- **Description/Screenshot** **Steps to Reproduce** - OS/Browser: - SDK Version [e.g. 22]: - How you initialized the SDK: **Expected behavior** **Additional context** Add any other context about the problem here. ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.md ================================================ --- name: Feature request about: Suggest an idea for this project title: '' labels: '' assignees: '' --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here. ================================================ FILE: .github/codeql/codeql-config.yml ================================================ name: "CodeQL config" queries: - uses: security-and-quality paths-ignore: - '**/test/' - '**/Tests/' - '**/dist-history/' - '**/rollup.config.js' - '**/docs/webSdk/' - '**/tools/**/*.jsonc' - '**/node_modules/' - '**/*.d.ts' - '**/out/' - '**/build/' - '**/bundle/' - '**/dist/' - '**/dist-es*/' - 'common/temp/' - '**/samples/' ================================================ FILE: .github/copilot-instructions.md ================================================ # GitHub Copilot Instructions for Application Insights JavaScript SDK ## Workflow Prompts Detailed step-by-step workflow instructions are available as prompt files in `.github/prompts/`. When asked to perform one of these tasks, **always read and follow the corresponding prompt file**: - **Release PR**: `.github/prompts/release-pr.prompt.md` — Full workflow for creating a release PR (version bump, README updates, RELEASES.md, gruntfile, lint, commit, and build validation) ## Project Overview This is the **Microsoft Application Insights JavaScript SDK** - a browser-based telemetry library for monitoring web applications. The SDK tracks page views, user interactions, performance metrics, exceptions, and custom events. ## Architecture & Structure ### Monorepo Structure - **AISKU/**: Main Application Insights SDK package - **AISKULight/**: Lightweight version of the SDK - **shared/**: Core shared libraries (AppInsightsCore, AppInsightsCommon, 1ds-core-js) - **extensions/**: Plugin-based extensions (analytics, dependencies, etc.) - **channels/**: Data transmission channels (online, offline, tee) - **tools/**: Build and development tools - **examples/**: Sample implementations ### Key Technologies - **TypeScript/JavaScript**: Primary languages (ES5 target for browser compatibility) - **Rush**: Monorepo management tool - **Rollup**: Module bundler - **Grunt**: Task runner - **Dynamic Proto**: Dynamic prototype pattern for performance ## Code Style & Patterns ### Required Before Each Commit - Do not commit any changes that are only end-of-file whitespace changes - Ensure all TypeScript files are formatted and imports are reordered correctly by running `npm run lint-fix` before committing - This will apply ESLint fixes to all TypeScript files - It will also reorder imports to maintain consistent style ### TypeScript/JavaScript Conventions - Use **ES5-compatible** syntax for browser support and target ES5 for modern browsers - Prefer `function` declarations over arrow functions for better IE compatibility - Use `var` instead of `let/const` in JavaScript files for ES5 compatibility (use `let/const` in TypeScript files) - Always use semicolons - Use 4-space indentation - Maximum line length: 140 characters ### Naming Conventions - **Classes**: PascalCase (e.g., `PageViewManager`, `TelemetryContext`) - **Interfaces**: PascalCase with `I` prefix (e.g., `ITelemetryItem`, `IPageViewTelemetry`) - **Methods/Functions**: camelCase (e.g., `trackPageView`, `sendTelemetry`) - **Constants**: UPPER_SNAKE_CASE (e.g., `MAX_DURATION_ALLOWED`) - **Private variables**: underscore prefix (e.g., `_logger`, `_hasInitialized`) - **Enums**: PascalCase with `e` prefix (e.g., `eLoggingSeverity`, `eInternalMessageId`) - Must be const enums with integer values (not strings) - Use `createEnumStyle` helper for exported enums - All usage should reference the const enum directly ### Dynamic Proto Pattern This project uses a unique `dynamicProto` pattern for performance optimization. This pattern should be used for all classes: ```typescript export class MyClass { constructor() { dynamicProto(MyClass, this, (_self, _base) => { // Private variables should be included inside the constructor closure // They are not publicly visible on the class let _logger = _self._logger; let _hasInitialized = false; // Public methods need @DynamicProtoStub comment for TypeScript definitions _self.myMethod = () => { // Method implementation }; }); } /** * @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging */ public myMethod(): void { // This stub will be replaced by the dynamicProto implementation } } ``` Key requirements: - Use this pattern for all classes - Private variables must be inside the constructor closure - Public functions need `@DynamicProtoStub` comment for TypeScript definition generation - Never add implementation code to the stub methods ### Error Handling - Use `_throwInternal` for logging diagnostic errors - Always include telemetry context in error messages - Use appropriate logging severity levels: `CRITICAL`, `WARNING`, `INFORMATION` ```typescript _throwInternal(_logger, eLoggingSeverity.WARNING, _eInternalMessageId.InvalidDurationValue, "Invalid page load duration value", { total, network, request, response, dom }); ``` ### Performance Considerations - Minimize object allocations in hot paths - Use `doPerf()` wrapper for performance tracking - Avoid synchronous operations that could block the browser - Implement lazy initialization where possible - Use object pooling for frequently created objects - Minimize the size of generated JavaScript by avoiding certain TypeScript features: - Do not use the spread `...` operator - Do not use optional chaining `?.` operator - Do not use the nullish coalescing `??` operator - use `||` instead - These restrictions will be removed once ES5 support is discontinued ## Browser Compatibility ### Target Support - **Modern browsers**: Chrome, Firefox, Safari, Edge (targeting ES5 for modern browsers) - **Legacy support**: Internet Explorer 8+ (ES5 compatibility required) - **Mobile browsers**: iOS Safari, Android Chrome - **Non-browser runtimes**: Node.js and other browser-like environments (for worker contexts and server-side rendering) ### Compatibility Patterns - Feature detection over browser detection - Graceful degradation for missing APIs - Use existing polyfills rather than creating new ones - Safe API usage with null checks ### Async Operations Support Support async operations using ts-async helpers instead of native async/await: - Use `doAwait` for `await` operations - Use `doAwaitResponse` to handle catch operations for asynchronous operations - Use `createPromise`, `createSyncPromise`, `createIdlePromise` instead of declaring functions as `async` - Return type should use `IPromise` instead of `Promise` for IE support ```typescript const perf = getPerformance(); if (perf && perf.timing && perf.timing.navigationStart) { // Use performance API } ``` ## Telemetry & Data Collection ### Core Telemetry Types - **Page Views**: `IPageViewTelemetry` - Track page navigation - **Events**: `IEventTelemetry` - Custom user actions - **Metrics**: `IMetricTelemetry` - Numeric measurements - **Exceptions**: `IExceptionTelemetry` - Error tracking - **Dependencies**: `IDependencyTelemetry` - External calls - **Traces**: `ITraceTelemetry` - Logging messages ### Data Privacy & Compliance - Never collect PII (personally identifiable information) by default - Sanitize URLs and remove sensitive query parameters - Implement data sampling and throttling - Support opt-out mechanisms - Follow GDPR/privacy regulations ### Performance Monitoring - Use `IPerfManager` and `IPerfEvent` for internal performance tracking - Collect browser timing APIs (Navigation Timing, Resource Timing) - Track page load performance metrics - Monitor SDK overhead and impact ## Plugin Architecture ### Plugin Development - Extend `BaseTelemetryPlugin` for new plugins - Implement `ITelemetryPlugin` interface - Use `IProcessTelemetryContext` for processing pipeline - Support plugin chaining and dependencies ```typescript export class MyPlugin extends BaseTelemetryPlugin { public processTelemetry(evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext) { // Process telemetry this.processNext(evt, itemCtx); } } ``` ### Extension Points - **Telemetry Initializers**: Modify telemetry before sending - **Dependency Listeners**: Track AJAX/fetch calls - **Channels**: Custom data transmission ## Testing Patterns ### Unit Testing - Use framework-agnostic test patterns - Mock browser APIs consistently - Test both success and failure scenarios - Verify telemetry data structure and content ### Testing Framework Requirements - **Extend AITestClass**: All test classes must extend `AITestClass` from `@microsoft/ai-test-framework` - **Use Framework Tools**: Leverage existing framework helpers like `this.hookFetch()`, `this.useFakeTimers()`, and `this.onDone()` - **Proper Registration**: Implement `registerTests()` method and use `this.testCase()` for test registration - **Async Tests**: Return `IPromise` from test functions for asynchronous operations (do not use deprecated `testCaseAsync`) ### Critical Cleanup & Resource Management - **Mandatory Core Cleanup**: Always call `appInsightsCore.unload(false)` in test cleanup to prevent hook pollution between tests - **Extension Teardown**: Only call `teardown()` on extension instances that were NOT added to a core instance; `core.unload()` handles teardown for initialized extensions - **Hook Validation**: The framework validates that all hooks are properly removed; tests will fail if cleanup is incomplete - **Resource Isolation**: Each test must be completely isolated - no shared state or leftover hooks ### Configuration Testing Requirements - **Static Configuration**: Test initial configuration setup and validation - **Dynamic Configuration**: **REQUIRED** - All tests that touch configuration must include post-initialization configuration change tests - **onConfigChange Testing**: Components using `onConfigChange` callbacks must be tested for runtime configuration updates - **Configuration Validation**: Test both valid and invalid configuration scenarios with proper error handling ```typescript // Example dynamic configuration test pattern public testDynamicConfig() { // Initial setup with one config let initialConfig = { enableFeature: false }; core.initialize(initialConfig, channels); // Verify initial behavior Assert.equal(false, component.isFeatureEnabled()); // Update configuration dynamically core.config.enableFeature = true; // Note: core.onConfigChange() only registers callbacks, it doesn't trigger changes // To trigger config change detection, use one of these patterns: // Option 1: Using fake timers (synchronous) this.clock.tick(1); // Trigger 1ms timer for config change detection // Option 2: Async test without fake timers // return createPromise((resolve) => { // setTimeout(() => { // Assert.equal(true, component.isFeatureEnabled()); // resolve(); // }, 10); // }); // Verify behavior changed (when using fake timers) Assert.equal(true, component.isFeatureEnabled()); } ``` ### Package Organization & Dependencies - **Respect Package Boundaries**: Place tests in the package that owns the functionality being tested - **Dependency Injection**: Extensions must include dependencies in `config.extensions` array for proper initialization - **Cross-Package Coordination**: Understand which package owns which functionality when testing integrated features - **Import Resolution**: Use proper module imports and avoid direct file path dependencies ### HTTP API & Network Testing - **Use Framework Helpers**: Use `this.hookFetch()` instead of custom fetch mocking implementations - **XMLHttpRequest Testing**: Use framework's built-in mechanisms for XHR validation - **Header Validation**: Test both presence and absence of headers based on different configuration modes - **Network Scenarios**: Test success, failure, timeout, and edge cases consistently ### Async Testing Patterns - **IPromise Return**: Use `this.testCase()` and return `IPromise` for asynchronous operations instead of deprecated `testCaseAsync` - **Promise Handling**: Handle both resolution and rejection paths in async tests - **Timing Control**: Use `this.clock.tick()` when `useFakeTimers: true` for deterministic timing - **Cleanup in Async**: Ensure cleanup happens in both success and failure paths of async tests ```typescript // Example async test pattern this.testCase({ name: "Async operation test", test: () => { return createPromise((resolve, reject) => { // Setup async operation someAsyncOperation().then(() => { try { // Assertions Assert.ok(true, "Operation succeeded"); resolve(); } catch (e) { reject(e); } }).catch(reject); }); } }); ``` ### Unit Testing Best Practices - **Comprehensive Coverage**: Test all major code paths including edge cases and error conditions - **Mock Browser APIs**: Mock browser APIs consistently using framework-provided mechanisms - **Telemetry Validation**: Verify telemetry data structure, content, and proper formatting - **State Testing**: Test both empty/null states and populated states for data structures ### Browser Testing - **Cross-browser Compatibility**: Test across different browser environments and API availability - **Performance Regression**: Monitor test execution time and detect performance regressions - **Memory Leak Detection**: Verify proper cleanup and resource management in long-running scenarios - **API Graceful Degradation**: Test behavior when browser APIs are unavailable or disabled ### Test Organization - **Collocate Tests**: Place tests in `Tests/` directories within the same package as source code - **Descriptive Naming**: Use clear, descriptive test names that explain the scenario being tested - **Logical Grouping**: Group related tests in test suites within the same test class - **Documentation**: Include comments explaining complex test scenarios and edge cases ### Common Anti-Patterns to Avoid - **Skipping Cleanup**: Not calling `unload()` or `teardown()` methods leads to test interference - **Custom Implementations**: Implementing custom mocks/helpers instead of using framework-provided tools - **Configuration Gaps**: Testing only static configuration without dynamic configuration change scenarios - **Hook Pollution**: Leaving hooks active between tests causing false positives/negatives - **Incomplete Coverage**: Missing edge cases, error conditions, or state transitions - **Deprecated Async**: Using deprecated `testCaseAsync` instead of `testCase` with `IPromise` return ## Configuration & Initialization ### SDK Configuration - Support both snippet and npm installation - Provide sensible defaults - Allow runtime configuration changes - Validate configuration parameters - Configuration names should be descriptive but mindful of browser bundle size by keeping names concise and readable ```typescript const config: IConfiguration = { instrumentationKey: "your-key", enableAutoRouteTracking: true, disableTelemetry: false, samplingPercentage: 100 }; ``` ### Initialization Patterns - Lazy initialization to minimize startup impact - Graceful handling of initialization failures - Support for multiple SDK instances - Plugin dependency resolution ## Performance Guidelines ### Bundle Size Optimization - Tree-shaking friendly exports - Conditional feature loading - Minimize third-party dependencies - Use rollup for optimal bundling ### Runtime Performance - Avoid blocking the main thread - Use requestIdleCallback when available - Batch telemetry operations - Implement efficient queuing mechanisms ### Memory Management - Clean up event listeners on teardown - Avoid memory leaks in long-running applications - Use weak references where appropriate - Implement proper disposal patterns ### Code Organization & Tree-Shaking - Each package should be side-effect free to enable proper tree-shaking - All code should be tree-shakable - avoid global side effects - Use lazy initialization for any globals via `ILazyValue` interface or similar patterns - Distinguish between "value not yet checked/assigned" vs "resulting value is null/undefined" - Export functions and classes individually rather than as default exports - Avoid executing code at module load time ## Common Patterns & Anti-Patterns ### ✅ Good Practices - Use TypeScript interfaces for contracts - Implement proper error boundaries - Follow the plugin architecture - Use performance monitoring internally - Sanitize all user inputs - Support both sync and async operations ### ❌ Anti-Patterns - Don't block the browser UI thread - Avoid throwing unhandled exceptions - Don't collect sensitive user data - Avoid tight coupling between components - Don't ignore browser compatibility - Avoid memory leaks in event handlers ## Documentation Standards ### Code Comments - Use TypeDoc format for public APIs - Document complex algorithms and business logic - Include examples for public methods - Explain browser compatibility considerations ### Interface Documentation - Document all public interfaces thoroughly using TypeDoc comments - Include parameter validation requirements - Include defaults and any relevant examples - Specify return value contracts - Note any side effects or state changes ## Build & Deployment ### Build Process - Rush for monorepo management - TypeScript compilation with strict settings - Rollup bundling with multiple output formats - Minification and size optimization ### Release Process #### Version Management The project uses `version.json` in the root to track release versions and an automated `setVersion.js` script to update all packages consistently. **`version.json` key fields:** - `release`: The current base version (e.g., `"3.4.0"`) - `next`: The default increment type for `-next` flag (`"patch"`, `"minor"`, or `"major"`) - `pkgs`: Per-package version overrides (some packages like `1ds-*` or `offline-channel` have independent version numbers) **Using the setVersion script:** ```bash # Common release commands: npm run setVersion -- -next # Increment based on version.json "next" field (e.g., patch: 3.3.11 => 3.3.12) npm run setVersion -- -next -release # Increment and remove any pre-release tag npm run setVersion -- -patch # Force patch increment (x.y.z => x.y.[z+1]) npm run setVersion -- -minor # Force minor increment (x.y.z => x.[y+1].0) npm run setVersion -- -major # Force major increment (x.y.z => [x+1].0.0) npm run setVersion -- 3.4.0 # Set an explicit version # Pre-release variants: npm run setVersion -- -next -dev # Increment + dev pre-release tag (x.y.z-dev) npm run setVersion -- -next -beta # Increment + beta pre-release tag (x.y.z-beta) npm run setVersion -- -next -alpha # Increment + alpha pre-release tag (x.y.z-alpha) npm run setVersion -- -release # Strip pre-release tag from current version (x.y.z-beta => x.y.z) # Dry run (logs changes without modifying files): npm run setVersion -- -next -test ``` **What setVersion updates:** 1. `version.json` — updates `release` and per-package versions in `pkgs` 2. All `package.json` files — updates `version`, `publishConfig.tag`, and all internal `@microsoft/applicationinsights-*` and `@microsoft/1ds-*` dependency references 3. Source files (`.ts`, `.tsx`, `.html`) — replaces hardcoded version strings #### Creating a Release PR For the full step-by-step release PR workflow (version bump, README updates, RELEASES.md, gruntfile, lint, commit, and build validation), see the prompt file at `.github/prompts/release-pr.prompt.md`. Summary of the steps: 1. Run `npm run setVersion -- -next -release` to bump the version 2. Update `AISKU/README.md` CDN version table 3. Update `RELEASES.md` with the new version entry, moving the "Unreleased Changes" content into the new version section 4. Update `gruntfile.js` perfTestVersions array 5. Run `npm run lint-fix` 6. Commit all changes 7. Run `npm run fullCleanBuild` to validate (must be run outside VS Code due to file locks) #### Publishing (post-merge) - `npm run npm-package` — Creates `.tgz` packages for a package group - `npm run npm-publish` — Publishes packages to npm - `npm run npm-set-latest` — Updates the npm `latest` tag - Package groups are defined in `tools/release-tools/package_groups.json` #### General Guidelines - Semantic versioning - Automated testing before release - Bundle size monitoring - Browser compatibility verification --- *This document helps GitHub Copilot understand the unique patterns, architecture, and requirements of the Application Insights JavaScript SDK project.* ================================================ FILE: .github/prompts/release-pr.prompt.md ================================================ --- description: "Create a release PR: bump version, update READMEs, RELEASES.md, gruntfile, and commit" agent: "agent" --- # Create Release PR Prepare a release by incrementing the version and updating all required files. Do NOT create a new branch — use the current branch. ## Step 1: Increment the Version **IMPORTANT: You MUST run the setVersion command FIRST and wait for it to complete BEFORE reading `version.json`.** Do NOT read `version.json` beforehand — the current value is the *old* version. The script increments the version, and only after it finishes will `version.json` contain the correct new version. Run the following command from the repo root to bump the version based on the `next` field in `version.json`: ``` npm run setVersion -- -next ``` After the command completes, THEN read `version.json` to determine the new version number (the `release` field). This is referred to as `X.Y.Z` in the steps below. Do NOT assume you know the version from any prior reading of the file. ## Step 2: Update AISKU/README.md CDN Version Table In [AISKU/README.md](../AISKU/README.md), find the `## CDN Version Release Summary (with Size tracking)` table. Add a new row for `X.Y.Z` immediately after the nightly row and before the previous release entry. Use this exact format (substitute the actual version): ``` | X.Y.Z: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.X.Y.Z.js.svg)](https://js.monitor.azure.com/scripts/b/ai.X.Y.Z.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.X.Y.Z.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.X.Y.Z.min.js.gzip.svg) ``` Remove the oldest version row from the v3.x section to keep the table from growing unbounded (keep the last ~25 v3.x entries). Do NOT remove any v2.x entries. ## Step 3: Update RELEASES.md In [RELEASES.md](../RELEASES.md): 1. **Create a new release heading** at the top of the file (after the initial note and before any existing release entries), using format: ``` ## X.Y.Z (Month DDth, YYYY) ``` Use today's date. The new release section is always inserted at the top — above all existing entries including any beta/alpha/pre-release entries. 2. **Include Significant Changes**: If this release includes significant new features, breaking changes, behavioral changes, package deprecations, or other notable updates, add a `### Significant Changes (since PREV_VERSION)` section (where `PREV_VERSION` is the previous full release version) summarizing them. Review the existing beta/pre-release entry (if any) for content that should be carried forward (duplicated) into the new release. This section should be human-readable and describe the impact to users. **You MUST always thoroughly review every PR/commit since the previous release** to identify all significant changes — do not rely solely on what was already written in the beta or unreleased sections. PRs that introduce new features, change behavior, deprecate packages, modify default configuration values, or improve reliability/performance should all be included as significant changes even if they were not called out in prior sections. If any packages have been merged, deprecated, or are now published only as compatibility shims, add a `### Package Deprecation` section describing which packages are affected, that they are still published as shims, and that consumers should migrate to the new package. If any of the significant changes were previously included in a beta/alpha/pre-release, add a blockquote note immediately after the heading: ``` > The following are the significant changes since the previous full release (PREV_VERSION). Some of these changes were previously included in the X.Y.Z-beta release. ``` This makes it clear why content may appear duplicated across release entries. 3. **Include Breaking Changes and Potential Breaking Changes**: If the existing unreleased or beta sections contain `### Breaking Changes` or `### Potential Breaking Changes` or `### Potential behavioral changes` sections, duplicate them into the new release section. Do NOT remove them from the original beta/pre-release entry. 4. **Build the Changelog**: Combine: - All entries currently under `## Unreleased Changes (from Main)` changelog - All entries from any beta/pre-release section changelog (e.g., `## X.Y.Z-beta`) — these should be **duplicated** into the new release, NOT moved - Review git history since the last release tag for any significant PRs that may have been missed - Do NOT include PRs that only bump dependency versions (e.g., "bump @microsoft/xxx from A to B") - Each entry should be a clickable link: `- #NNNN Description` where `#NNNN` links to the GitHub PR **CRITICAL: NEVER strip or remove sub-bullet details from changelog entries.** If an entry in the Unreleased section or a prior release includes sub-bullets with additional context (e.g., potential breaking changes, enhancement notes, configuration details), those sub-bullets MUST be preserved exactly as-is in the new release changelog. Do not flatten detailed entries into single-line summaries. 5. **Add a comparison link** at the end of the new release section: ``` **Full Changelog**: https://github.com/microsoft/ApplicationInsights-JS/compare/PREV_VERSION...X.Y.Z ``` Where `PREV_VERSION` is the previous release version tag. 6. **Clean up the Unreleased section only**: Remove or comment out the `## Unreleased Changes (from Main)` section content. Leave behind a commented placeholder: ``` ``` **CRITICAL: NEVER delete or remove any existing release entries from RELEASES.md** — this includes beta, alpha, RC, and all prior full releases. Even if a beta/pre-release contains the same changes as the new full release, the beta entry must remain in the file. The only section that gets removed is the `## Unreleased Changes (from Main)` section. Even when told to use version X.Y.Z as the "previous release" for changelog purposes, this only affects which PRs to include in the new entry and the comparison link — it does NOT mean you should delete any intervening release entries (beta, alpha, etc.) from the file. ## Step 4: Update gruntfile.js perfTestVersions In [gruntfile.js](../gruntfile.js), update the `perfTestVersions` array to include the new version: ```javascript const perfTestVersions=["X.Y.Z"]; ``` Replace the existing version value — this array should contain only the new release version. ## Step 5: Run lint-fix Run the following command to ensure all files are properly formatted: ``` npm run lint-fix ``` ## Step 6: Commit Stage all changes and commit with the message: ``` [Release] Increase version to X.Y.Z ``` If there are significant changes worth calling out (breaking changes, major new features), add them as additional lines after the subject line. It is valid for this commit to have no additional body content beyond the subject. Do NOT push the branch — just create the local commit. ## Step 7: Validate the Build Run the full clean build to ensure no build issues: ``` npm run fullCleanBuild ``` - **If running from GitHub Actions, automation, or a CI environment**: Run this command directly before creating the PR. Resolve any unexpected build failures before proceeding. - **If running interactively from VS Code or Visual Studio**: This command cannot be run from within the editor because open editors and extensions hold file locks that will cause the clean build step to fail. Instead, inform the user that they need to **manually** run `npm run fullCleanBuild` from a **separate terminal** (e.g., Windows Terminal, PowerShell, or Command Prompt) pointed at the repo root, and resolve any issues before creating the PR. ================================================ FILE: .github/workflows/ci.yml ================================================ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: Node.js CI on: push: branches: [ main, master, beta, Release2.7, release-3.0 ] pull_request: branches: [ main, master, beta, Release2.7, release-3.0 ] merge_group: branches: [ "main", "master", "beta", "Release*", "release*", "*-legacy", "legacy-v1" ] jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [ 16, 18, 20 ] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Update rush shrinkwrap dependencies (for different node versions) run: node common/scripts/install-run-rush.js update --full --recheck - run: npm install rollup -g - run: npm install grunt-cli - run: npm install - run: node common/scripts/install-run-rush.js check - run: node common/scripts/install-run-rush.js update --full --recheck - run: npm run build --verbose timeout-minutes: 20 - run: npm run test --verbose timeout-minutes: 30 ================================================ FILE: .github/workflows/codeql-analysis.yml ================================================ # For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # # You may wish to alter this file to override the set of languages analyzed, # or to provide custom queries or build logic. # # ******** NOTE ******** # We have attempted to detect the languages in your repository. Please check # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # name: "CodeQL" on: push: branches: [ "main", "master", "beta", "Release*", "release*", "*-legacy", "legacy-v1" ] pull_request: # The branches below must be a subset of the branches above branches: [ "main", "master", "beta", "Release*", "release*", "*-legacy", "legacy-v1" ] schedule: - cron: '15 17 * * 2' # Every Tuesday at 17:15 UTC jobs: analyze: name: Analyze (${{ matrix.language }}) runs-on: ubuntu-latest permissions: # required for all workflows security-events: write # required to fetch internal or private CodeQL packs packages: read # only required for workflows in private repositories actions: read contents: read strategy: fail-fast: false matrix: include: - language: actions - language: javascript - language: javascript-typescript node-version: '18' # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' # Use `c-cpp` to analyze code written in C, C++ or both # Use 'java-kotlin' to analyze code written in Java, Kotlin or both # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages steps: - name: Checkout repository uses: actions/checkout@v4 # Setup Node.js for JavaScript projects - name: Setup Node.js ${{ matrix.node-version }} # Only run the build for Typescript/JavaScript language match if: matrix.language == 'javascript-typescript' uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} # Install dependencies for JavaScript projects - name: Install dependencies # Only run the build for Typescript/JavaScript language match if: matrix.language == 'javascript-typescript' run: | node common/scripts/install-run-rush.js update --full --recheck npm install rollup -g npm install grunt-cli npm install node common/scripts/install-run-rush.js update --full --recheck # Initializes the CodeQL tools for scanning - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} config-file: ./.github/codeql/codeql-config.yml # Build JavaScript project specifically (skipping autobuild for JavaScript) - name: Build JavaScript # Only run the build for Typescript/JavaScript language match if: matrix.language == 'javascript-typescript' run: npm run build # Perform the CodeQL Analysis - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" upload-database: false # Debug CodeQL configuration - name: Debug CodeQL configuration if: always() run: | echo "Executed CodeQL for language: ${{ matrix.language }}" echo "Category used: /language:${{ matrix.language }}" echo "Node version: ${{ matrix.node-version || 'N/A' }}" ================================================ FILE: .github/workflows/delete-merged-branches.yml ================================================ --- name: 'Delete Merged Branches' # This workflow automatically deletes branches that are associated with # closed or merged pull requests. It runs weekly on Sundays at midnight UTC. # # Protected branches (will NOT be deleted): # - main # - master # - beta # - otel-sdk # - release* (case-insensitive: release-1.0, release/v2.0, etc.) # - Release* (case-insensitive: Release-1.0, Release/v2.0, etc.) # - legacy-* (e.g., legacy-v1, legacy-old) # - *-legacy (e.g., old-legacy, v1-legacy) # # The workflow will only delete branches that: # 1. Have associated pull requests # 2. All PRs for the branch are either merged or closed (no open PRs) # 3. Do not match any protected branch pattern on: schedule: # Run every Sunday at midnight UTC - cron: '0 0 * * 0' workflow_dispatch: # Required permissions for this workflow: # - contents: write - Required to delete branch references via GitHub API # - pull-requests: read - Required to query PR status and metadata # See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions # See: https://docs.github.com/en/rest/overview/permissions-required-for-github-apps permissions: contents: write pull-requests: read jobs: delete-merged-branches: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 - name: Delete merged branches env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Weekly branch cleanup script # # This script safely deletes branches associated with merged PRs # while protecting important branches like main, master, release, etc. # # Logic: # 1. Get all remote branches # 2. Filter out protected branches using pattern matching # 3. For each non-protected branch: # - Check if it has associated PRs # - Skip if no PRs found # - Skip if any PRs are still open # - Delete if all PRs are closed or merged # Protected branch patterns (case-insensitive matching) PROTECTED_PATTERNS=( "main" "master" "beta" "otel-sdk" "release*" "Release*" "legacy-*" "*-legacy" ) echo "Starting branch cleanup..." # Get all remote branches except HEAD git fetch --all --prune branches=$(git for-each-ref \ --format='%(refname:short)' refs/remotes/origin | \ grep -v 'origin/HEAD' | sed 's|origin/||') for branch in $branches; do echo "Checking branch: $branch" # Check if branch matches any protected pattern # Use [[ ]] pattern matching instead of case statement to properly # support wildcard patterns stored in variables (e.g., "release*", "*-legacy") # See: https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html protected=false for pattern in "${PROTECTED_PATTERNS[@]}"; do if [[ "$branch" =~ $pattern ]]; then protected=true echo " → Protected (matches: $pattern), skipping" break fi done if [ "$protected" = true ]; then continue fi # Check if branch is associated with a merged or closed PR echo " → Checking PR status for branch: $branch" # Get PRs for this branch (both merged and closed) # GitHub context variables used here: # - github.repository: owner/repo-name (e.g., microsoft/ApplicationInsights-JS) # - github.repository_owner: repository owner (e.g., microsoft) # - GITHUB_TOKEN: automatically provided GitHub token for API access # See: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context repo_api="https://api.github.com/repos/${{ github.repository }}" query="?head=${{ github.repository_owner }}:$branch&state=all" pr_response=$(curl -s \ -H "Authorization: token $GITHUB_TOKEN" \ -H "Accept: application/vnd.github.v3+json" \ "${repo_api}/pulls${query}") # Check if any PRs exist for this branch pr_count=$(echo "$pr_response" | jq '. | length') if [ "$pr_count" -eq 0 ]; then echo " → No PR found for branch, skipping" continue fi # Check if all PRs for this branch are either merged or closed open_prs=$(echo "$pr_response" | jq '[.[] | select(.state == "open")] | length') if [ "$open_prs" -gt 0 ]; then echo " → Branch has open PR(s), skipping" continue fi # All PRs are either merged or closed, safe to delete merged_prs=$(echo "$pr_response" | jq '[.[] | select(.merged_at != null)] | length') closed_prs=$(echo "$pr_response" | jq '[.[] | select(.state == "closed" and .merged_at == null)] | length') echo " → Branch has $merged_prs merged and $closed_prs closed PRs" echo " → Deleting branch: $branch" # Delete the remote branch using GitHub REST API # See: https://docs.github.com/en/rest/git/refs#delete-a-reference delete_url="https://api.github.com/repos/${{ github.repository }}" delete_response=$(curl -s -X DELETE \ -H "Authorization: token $GITHUB_TOKEN" \ -H "Accept: application/vnd.github.v3+json" \ "${delete_url}/git/refs/heads/$branch") if echo "$delete_response" | jq -e '.message' > /dev/null 2>&1; then error_msg=$(echo "$delete_response" | jq -r '.message') echo " → Error deleting branch: $error_msg" else echo " → Successfully deleted branch: $branch" fi done echo "Branch cleanup completed!" ================================================ FILE: .github/workflows/jekyll-gh-pages.yml ================================================ # Sample workflow for building and deploying a Jekyll site to GitHub Pages name: Deploy Jekyll with GitHub Pages dependencies preinstalled on: # Runs on pushes targeting the default branch push: branches: ["main"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: group: "pages" cancel-in-progress: false jobs: # Build job build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Update rush shrinkwrap dependencies (for different node versions) run: node common/scripts/install-run-rush.js update --full - run: npm install rollup -g - run: npm install grunt-cli - run: npm install - run: node common/scripts/install-run-rush.js check - run: node common/scripts/install-run-rush.js update --full --recheck - run: npm run build --verbose timeout-minutes: 20 - name: doc generate run: npm run api-docs - name: Inject Script run: node ./tools/github-page-script-injection/injectScript.js - name: Setup Pages uses: actions/configure-pages@v4 - name: Build with Jekyll uses: actions/jekyll-build-pages@v1 with: source: ./docs destination: ./_site - name: Upload artifact uses: actions/upload-pages-artifact@v3 # Deployment job deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 ================================================ FILE: .github/workflows/lock.yml ================================================ name: 'Lock Threads' on: schedule: - cron: '0 0 * * *' permissions: actions: write issues: write pull-requests: write jobs: action: runs-on: ubuntu-latest steps: - uses: dessant/lock-threads@v2 with: github-token: ${{ github.token }} issue-lock-comment: > This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. process-only: 'issues' ================================================ FILE: .github/workflows/stale-assigned.yml ================================================ name: 'Stale issue handler' on: workflow_dispatch: schedule: - cron: '0 7 * * *' permissions: actions: write issues: write pull-requests: write jobs: stale: runs-on: ubuntu-latest steps: - uses: actions/stale@v9 id: stale with: stale-issue-message: 'This Issue will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action.' stale-pr-message: 'This PR will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action.' operations-per-run: 200 days-before-stale: 300 days-before-close: 30 stale-issue-label: 'stale' stale-pr-label: 'stale' close-issue-label: 'closed' close-pr-label: 'closed' exempt-issue-labels: 'bug,enhancement,documentation,waiting,keep' exempt-pr-labels: 'waiting,keep' include-only-assigned: true ================================================ FILE: .github/workflows/stale.yml ================================================ name: 'Stale issue handler' on: workflow_dispatch: schedule: - cron: '0 7 * * *' permissions: actions: write issues: write pull-requests: write jobs: stale: runs-on: ubuntu-latest steps: - uses: actions/stale@v9 id: stale with: stale-issue-message: 'This Issue will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action.' stale-pr-message: 'This PR will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action.' operations-per-run: 200 days-before-stale: 240 days-before-close: 30 stale-issue-label: 'stale' stale-pr-label: 'stale' close-issue-label: 'closed' close-pr-label: 'closed' exempt-issue-labels: 'bug,enhancement,documentation,waiting,keep' exempt-pr-labels: 'waiting,keep' exempt-all-milestones: true exempt-all-assignees: true mark-abandoned: runs-on: ubuntu-latest steps: - uses: actions/stale@v9 id: mark-abandoned with: days-before-stale: 30 days-before-close: -1 days-before-issue-stale: -1 days-before-issue-close: -1 stale-pr-message: 'This PR has been inactive for 30 days and has been marked as abandoned. You can remove this label by commenting or pushing new changes. If it remains inactive with the abandoned label, it will eventually also be marked as stale and closed.' stale-pr-label: 'abandoned' exempt-pr-labels: 'keep,wontfix,stale' operations-per-run: 100 remove-stale-when-updated: true exempt-all-milestones: false exempt-all-assignees: false stale-wontfix: runs-on: ubuntu-latest steps: - uses: actions/stale@v9 id: stale-wontfix with: stale-issue-message: 'This Issue will be closed in 14 days. Please remove the "Stale" label or comment to avoid closure with no action.' stale-pr-message: 'This PR will be closed in 14 days. Please remove the "Stale" label or comment to avoid closure with no action.' operations-per-run: 100 days-before-stale: 14 days-before-close: 14 stale-issue-label: 'stale' stale-pr-label: 'stale' close-issue-label: 'closed' close-pr-label: 'closed' any-of-labels: 'wontfix,abandoned' exempt-issue-labels: 'keep' exempt-pr-labels: 'keep' exempt-all-milestones: false exempt-all-assignees: false ================================================ FILE: .gitignore ================================================ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. # User-specific files *.suo *.user *.sln.docstates # Build results [Dd]ebug/ [Rr]elease/ [Bb]in/ [Oo]bj/ [Oo]bj//Core/Javascript/ai*.[tj]s* # Telemetry output *.onesipkg # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets !packages/*/build/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* report.*.json *_i.c *_p.c *.ilk *.meta *.obj *.pch *.pdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb *.log *.scc # Visual C++ cache files ipch/ *.aps *.ncb *.opensdf *.sdf *.cachefile # Local tgz files *.tgz # Visual Studio profiler *.psess *.vsp *.vspx # Visual Studio Code .vscode/** # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # NCrunch *.ncrunch* .*crunch*.local.xml # Installshield output folder [Ee]xpress/ # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html # Click-Once directory publish/ # Publish Web Output *.Publish.xml # NuGet binaries downloaded automatically packages/ # Windows Azure Build Output csx *.build.csdef # Windows Store app package directory AppPackages/ # Others sql/ *.Cache ClientBin/ [Ss]tyle[Cc]op.* ~$* *~ *.dbmdl *.[Pp]ublish.xml *.publishsettings # RIA/Silverlight projects Generated_Code/ # Backup & report files from converting an old project file to a newer # Visual Studio version. Backup files are not needed, because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm # SQL Server files App_Data/*.mdf App_Data/*.ldf #LightSwitch generated files GeneratedArtifacts/ _Pvt_Extensions/ ModelManifest.xml # ========================= # Windows detritus # ========================= # Windows image file caches Thumbs.db ehthumbs.db # Folder config file Desktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # Mac desktop service store files .DS_Store # Build log files *.err *.prf *.wrn # Visual studio 2015 user specific files legacy/JavaScript/.vs # Temp directories bundle/ node_modules/ out/ coreSDK/node_modules build/ dist-es*/ browser/ types/ dist/ dest/ drop/ .cdn/ # Don't commit the sub resource integrity generated files **/*.integrity.json # Grunt .tscache **/Tests/Selenium/*tests.js **/Tests/Selenium/*tests.d.ts **/Tests/Selenium/*tests.js.map # Misc statistics.html npm tests_output # Logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* # Runtime data *.pid *.seed *.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage # nyc test coverage .nyc_output # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) bower_components # node-waf configuration .lock-wscript # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release # Dependency directories jspm_packages/ # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variables file .env # next.js build output .next # Common toolchain intermediate files temp # Rush files common/temp/** package-deps.json package-lock.json rush-logs/ # test output aicore.tests.js* aicore.tests.d.ts ai.tests.d.ts /.vs /index.html # Generated Constant File **/__DynamicConstants.ts # Generated Docs docs/webSdk/applicationinsights*/** docs/webSdk/1ds*/** ================================================ FILE: .npmignore ================================================ # NPM Ignore # ignore everything * # ... but these files !/package.json !/CODE_OF_CONDUCT.md !/CONTRIBUTING.md !/README.md !/SECURITY.md !/SUPPORT.md !/NOTICE !/PRIVACY !/LICENSE !/LICENSE.TXT !/docs/API-reference.md !/bundle/ai.module.* !/dist/ai.js !/dist/ai.js.map !/dist/ai.0.js !/dist/ai.0.js.map ================================================ FILE: .travis/test_react_native.sh ================================================ cd extensions/applicationinsights-react-native echo -en 'travis_fold:end:change\\r' echo 'Checking for inconsistent dependency versions' && echo -en 'travis_fold:start:check\\r' node common/scripts/install-run-rush.js check echo -en 'travis_fold:end:check\\r' echo 'Installing...' && echo -en 'travis_fold:start:install\\r' rm -rf common/temp/npm-local node common/scripts/install-run-rush.js install npm install npm run build npm run test npm run lint ================================================ FILE: .travis/test_rush.sh ================================================ set -e set NO_UPDATE_NOTIFIER=1 # echo 'Checking for missing change logs...' && echo -en 'travis_fold:start:change\\r' # git fetch origin master:refs/remotes/origin/master -a # node common/scripts/install-run-rush.js change -v echo -en 'travis_fold:end:change\\r' echo 'Checking for inconsistent dependency versions' && echo -en 'travis_fold:start:check\\r' node common/scripts/install-run-rush.js check echo -en 'travis_fold:end:check\\r' echo 'Installing...' && echo -en 'travis_fold:start:install\\r' rm -rf common/temp/npm-local node common/scripts/install-run-rush.js install echo -en 'travis_fold:end:install\\r' echo 'Building...' && echo -en 'travis_fold:start:build\\r' node common/scripts/install-run-rush.js rebuild --verbose echo -en 'travis_fold:end:build\\r' echo 'Running test...' && echo -en 'travis_fold:start:tests\\r' node common/scripts/install-run-rush.js test --verbose echo -en 'travis_fold:end:tests\\r' echo 'Running tslint...' && echo -en 'travis_fold:start:lint\\r' node common/scripts/install-run-rush.js lint --verbose echo -en 'travis_fold:end:lint\\r' ================================================ FILE: AISKU/.npmignore ================================================ # NPM Ignore # ignore everything * # ... but these files !package.json !tsconfig.json !/CODE_OF_CONDUCT.md !/CONTRIBUTING.md !/README.md !/SECURITY.md !/SUPPORT.md !/NOTICE !/PRIVACY !/LICENSE !/LICENSE.TXT !dist-es*/** !dist/** !browser/** !types/** ================================================ FILE: AISKU/API.md ================================================ ### trackPageView ```ts applicationInsights.trackPageView(pageView: IPageViewTelemetry, customProperties?: { [key: string]: any }) ``` The [`IPageViewTelemetry`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IPageViewTelemetry.html) interface is below: Parameter | Type | Description ---|---|--- [`name?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IPageViewTelemetry.html#name) | string | **Optional**
Name of the pageview. Defaults to the document `title`. [`uri?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IPageViewTelemetry.html#uri) | string | **Optional**
A relative or absolute URL that identifies the page or other item. Defaults to the window location. [`refUri?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IPageViewTelemetry.html#refUri) | string | **Optional**
The URL of the previous page that sent the user to the current page. [`pageType?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IPageViewTelemetry.html#pageType) | string | **Optional**
Page Type string. Describes how you classify this page, e.g. errorPage, formPage, etc. [`isLoggedIn?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IPageViewTelemetry.html#isLoggedIn) | boolean | **Optional**
Whether or not the user is logged in [`pageTags?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IPageViewTelemetry.html#pageTags) | dictionary | **Optional**
Property bag to contain an extension to domain properties - extension to Part B ### startTrackPage ```ts startTrackPage(name?: string) ``` Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops, but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view and send the event. Parameter | Type | Description ---|---|--- `name?` | string | **Optional**
The name used to identify the page in the portal. Defaults to the document title. ### stopTrackPage ```ts stopTrackPage(name?: string, url?: string, customProperties?: { [name: string]: any; }); ``` Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements. The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`. Parameter | Type | Description ---|---|--- `name?` | string | **Optional**
The name used to identify the page in the portal. Defaults to the document title. `url?` | string | **Optional**
A relative or absolute URL that identifies the page or similar item. Defaults to the window location. `customProperties?` | dictionary | **Optional**
Map of string to string: Additional data used to [filter pages](https://azure.microsoft.com/documentation/articles/app-insights-api-custom-events-metrics/#properties) in the portal. Defaults to empty. ### trackMetric ```ts trackMetric(metric: IMetricTelemetry, customProperties?: {[name: string]: any}) ``` Log a positive numeric value that is not associated with a specific event. Typically used to send regular reports of performance indicators. To send a single measurement, use just the first two parameters. If you take measurements very frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements and sending the resulting `average` and `sampleCount` at intervals. [`IMetricTelemetry`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IMetricTelemetry.html) is described below Parameter | Type | Description ---|---|--- [`name`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IMetricTelemetry.html#name) | string | **Required**
A string that identifies the metric. In the portal, you can select metrics for display by name. [`average`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IMetricTelemetry.html#average) | number | **Required**
Either a single measurement, or the average of several measurements. Should be >=0 to be correctly displayed. [`sampleCount?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IMetricTelemetry.html#sampleCount) | number | **Optional**
Count of measurements represented by the average. Defaults to 1. Should be >=1. [`min?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IMetricTelemetry.html#min) | number | **Optional**
The smallest measurement in the sample. Defaults to the average. Should be >= 0. [`max?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IMetricTelemetry.html#max) | number | **Optional**
The largest measurement in the sample. Defaults to the average. Should be >= 0. [`stdDev?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IMetricTelemetry.html#stdDev) | number | **Optional**
The standard deviation for the sample. Defaults to undefined which is reported as zero (0). ```typescript appInsights.trackMetric({ name: "my_custom_metric", average: 1.5, sampleCount: 2, min: 1, max: 2, stdDev: 1.0 }); ``` ### trackException ```ts trackException(exception: IExceptionTelemtry, customProperties?: {[key: string]: any}) ``` Log an exception you have caught. Exceptions caught by the browser are also automatically logged. [`IExceptionTelemetry`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IExceptionTelemetry.html) is described below Parameter | Type | Description ---|---|--- [`error`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IExceptionTelemetry.html#exception) | [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) | **Required**
Error object [`severityLevel?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IExceptionTelemetry.html#severityLevel) | [SeverityLevel (number)](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-common/enums/eSeverityLevel.html) | **Optional**
Severity of the message, ranging from verbose to critical By default, uncaught browser exceptions are caught by the SDK and reported to the portal. To disable this behavior, insert the following line in the config section below your connection string: ```ts { connectionString: "your connection string", disableExceptionTracking: true } ``` ### trackTrace ```ts trackTrace(trace: ITraceTelemetry, customProperties?: {[key: string]: any}) ``` Log a diagnostic event such as entering or leaving a method. The [`ITraceTelemetry`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/ITraceTelemetry.html) interface is described below Parameter | Type | Description ---|---|--- [`message`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/ITraceTelemetry.html#message) | string | **Required**
Diagnostic data. Can be much longer than an event's name. [`severityLevel?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/ITraceTelemetry.html#severityLevel) | [SeverityLevel (number)](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-common/enums/eSeverityLevel.html) | **Optional**
Severity of the message, ranging from verbose to critical In the portal, you can search on message content and [display individual trackTrace events](https://azure.microsoft.com/documentation/articles/app-insights-diagnostic-search/). (Unlike `trackEvent`, you can't filter on the message content in the portal.) ### trackDependencyData ```ts trackDependencyData(dependency: IDependencyTelemetry, customProperties?: {[key: string]: any}, systemProperties?: {[key: string]: any}) ``` Log a dependency call (for instance: ajax) The [`IDependencyTelemetry`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IDependencyTelemetry.html) interface is described below Parameter | Type | Description ---|---|--- [`id`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IDependencyTelemetry.html#id) | string | **Required**
Unique id, this is used by the backend to correlate server requests. [`absoluteUrl`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IDependencyTelemetry.html#absoluteUrl) | string | **Required**
Absolute url used to make the dependency request [`success`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IDependencyTelemetry.html#success) | boolean | **Required**
Whether or not the request was successful or not (e.g., `responseCode` in the range 200-299) [`resultCode`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IDependencyTelemetry.html#resultCode) | number | **Required**
Response code returned by the dependency request (e.g., `200` for a success) [`commandName?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IDependencyTelemetry.html#commandName) | string| **Optional**
Command used to make the dependency request [`duration?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IDependencyTelemetry.html#duration) | number | **Optional**
Elapsed time of request & reply [`method?`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IDependencyTelemetry.html#method) | string | **Optional**
Represents request verb (GET, POST, etc.) ### flush ```ts flush(async?: boolean = true) ``` Immediately send all queued telemetry. By default, it is sent async. > *Note:* You don't have to use flush, as it is automatically called at an interval and when the user closes the window. ### setAuthenticatedUserContext ```ts setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string, storeInCookie = false) ``` Set the authenticated user id and the account id. Use this when you have identified a specific signed-in user. Parameters must not contain spaces or ,;=| The method will only set the `authenticatedUserId` and `accountId` for all events in the current page view. To set them for all events within the whole session, you should either call this method on every page view or set `storeInCookie = true`. Parameter | Type |Description ---|---|-- `authenticatedUserId` | string | **Required**
An id that uniquely identifies a user of your app. No spaces, comma, semicolon, equals or vertical bar. `accountId?` | string | **Optional**
An optional account id, if your app groups users into accounts. No spaces, comma, semicolon, equals or vertical bar. In the portal, this will add to the count of authenticated users. Authenticated users provide a more reliable count of the number of real users than the count of anonymous users. The authenticated user id will be available as part of the context of the telemetry sent to the portal, so that you can filter and search on it. It will also be saved as a cookie and sent to the server, where the server SDK (if installed) will attach it to server telemetry. ### clearAuthenticatedUserContext ```ts clearAuthenticatedUserContext () ``` Clears the authenticated user id and the account id from the user context, and clears the associated cookie. ### addTelemetryInitializer ```ts public addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void) ``` Adds a telemetry initializer to the collection. Telemetry initializers will be called one by one, in the order they were added, before the telemetry item is pushed for sending. If one of the telemetry initializers returns false or throws an error, then the telemetry item will not be sent. See [`ITelemetryItem`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITelemetryItem.html) for the full interface definition. ```ts interface ITelemetryItem { /** * Unique name of the telemetry item */ name: string; /** * Timestamp when item was sent */ timestamp?: Date; /** * Identifier of the resource that uniquely identifies which resource data is sent to */ instrumentationKey?: string; /** * System properties with well defined extensions, documentation coming soon */ ctx?: {[key: string]: any}; /** * Part A custom extensions */ tags?: Tags; // Tags[] is deprecated since 4.1.0 /** * Telemetry type used for part B */ baseType?: string; /** * Based on schema for part B */ baseData?: { [key: string]: any }; /** * Telemetry data used for Part C */ data?: { [key: string]: any; }, } ``` ### Custom extension A custom plugin can be loaded by the SDK through config.extensions. All plugins must implement [`ITelemetryPlugin`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITelemetryPlugin.html) interface. These provide the capability of inspecting and updating data as it leaves the system, but also provides additional functionality to for one time initialization of extension state and pass in custom configuration through SKU configuration etc. ```ts interface ITelemetryPlugin { /** * Call back for telemetry processing before it is sent to next plugin for processing (needs to be invoked by caller) */ processTelemetry: (env: ITelemetryItem) => void; /** * Extension name */ identifier: string; /** * Set next extension for telemetry processing */ setNextPlugin: (next: ITelemetryPlugin) => void; /** * Priority of the extension * * 1 - 100: customer plugins * 100 - 199: reserved for internal plugins. * > 200: channel plugins (that implement IChannelControls to send data to an endpoint) */ priority: number; } ``` ## [`ITelemetryContext`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITelemetryContext.html) ### context.application ```ts application: IApplication ``` Details of the app you're monitoring. See [`IApplication`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IApplication.html). Property | Type | Description ---|---|--- [`application.ver`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IApplication.html#ver) | string | Application version [`application.build`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IApplication.html#build) | string | Application build ### context.device ```ts device: IDevice ``` The device the app is running on. See [`IDevice`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDevice.html). Property | Type | Description ---|---|--- [`device.id`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDevice.html#id) | string | Unique ID [`device.deviceClass`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDevice.html#deviceClass) | string | Device class [`device.model`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDevice.html#model) | string | Device model [`device.resolution`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDevice.html#resolution) | string | Screen resolution [`device.ip`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDevice.html#ip) | string | IP address ### context.user ```ts user: IUserContext ``` Data about the current user. Users are identified by cookie, so one person can look like more than one user if they use different machines or browsers, or delete cookies. See [`IUserContext`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IUserContext.html). Property | Type | Description ---|---|--- [`user.id`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IUserContext.html#id) | string | Unique, cookie-based user id, automatically assigned. [`user.authenticatedId`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IUserContext.html#authenticatedId) | string | Id set by your app using [`setAuthenticatedUserContext`](#setAuthenticatedUserContext) when the user signs in. [`user.accountId`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IUserContext.html#accountId) | string | Set by your app when the user signs in, if your app groups users into accounts. [`user.accountAcquisitionDate`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IUserContext.html#accountAcquisitionDate) | string | Account acquisition date ### context.session ```ts session: ISession ``` The user session. A session represents a series of user actions. A session starts with a user action. It ends at the last user activity when there is no more activity for sessionRenewalMs, or if it lasts longer than sessionExpirationMs. See [`ISession`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ISession.html). Property | Type | Description ---|---|--- [`session.id`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ISession.html#id) | string | Automatically assigned id [`session.acquisitionDate`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ISession.html#acquisitionDate) | number | The dateTime when this session was created. [`session.renewalDate`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ISession.html#renewalDate) | number | DateTime when telemetry was last sent with this session. ### context.location ```ts location: ILocation ``` Data from which the geographical location of the user's device can be guessed. See [`ILocation`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ILocation.html). Property | Type | Description ---|---|--- [`location.ip`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ILocation.html#ip) | string | IP address ### context.telemetryTrace > **Deprecated:** Use [`appInsights.getTraceCtx()`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITraceHost.html#getTraceCtx) instead to get/set the current trace context. This returns an [`IDistributedTraceContext`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDistributedTraceContext.html) which supports distributed tracing and allows the core to manage the trace context. ```ts telemetryTrace: ITelemetryTrace ``` Represents the distributed trace context. See [`ITelemetryTrace`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITelemetryTrace.html). Property | Type | Description ---|---|--- [`telemetryTrace.traceID`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITelemetryTrace.html#traceID) | string | Trace ID [`telemetryTrace.parentID`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITelemetryTrace.html#parentID) | string | Parent ID [`telemetryTrace.traceFlags`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITelemetryTrace.html#traceFlags) | number | W3C trace flags [`telemetryTrace.name`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITelemetryTrace.html#name) | string | Operation name ### Distributed Trace Context (Recommended) Use [`getTraceCtx()`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITraceHost.html#getTraceCtx) to access the current [`IDistributedTraceContext`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDistributedTraceContext.html). This is the recommended replacement for the deprecated `telemetryTrace`. ```ts // Get the current trace context - using the standard SKU (AISKU) let traceCtx = appInsights.getTraceCtx(); // Or when using the core directly // let traceCtx = appInsights.core.getTraceCtx(); // Read trace values let traceId = traceCtx.traceId; let spanId = traceCtx.spanId; let traceFlags = traceCtx.traceFlags; let pageName = traceCtx.pageName; // Update trace values (updates current context only) traceCtx.traceId = "new-trace-id"; traceCtx.spanId = "new-span-id"; traceCtx.traceFlags = 1; traceCtx.pageName = "my-page"; // Replace the entire trace context appInsights.core.setTraceCtx(newTraceCtx); ``` Property | Type | Description ---|---|--- [`traceId`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDistributedTraceContext.html#traceId) | string | 32 lowercase hex character trace ID, shared across all spans in a trace [`spanId`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDistributedTraceContext.html#spanId) | string | 16 lowercase hex character span ID, unique identifier for this span [`traceFlags`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDistributedTraceContext.html#traceFlags) | number | W3C trace flags (8-bit bitmap), bit 0x01 indicates sampling [`pageName`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDistributedTraceContext.html#pageName) | string | Current page name [`traceState`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDistributedTraceContext.html#traceState) | IW3cTraceState | Vendor-specific trace state for cross-system correlation [`parentCtx`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDistributedTraceContext.html#parentCtx) | IDistributedTraceContext | Parent context (read-only) [`isRemote`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDistributedTraceContext.html#isRemote) | boolean | Whether context was propagated from a remote parent ================================================ FILE: AISKU/LICENSE ================================================ The MIT License (MIT) Copyright (c) Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: AISKU/NOTICE ================================================ NOTICES AND INFORMATION Do Not Translate or Localize This software incorporates material from third parties. Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, or you may send a check or money order for US $5.00, including the product name, the open source component name, and version number, to: Source Code Compliance Team Microsoft Corporation One Microsoft Way Redmond, WA 98052 USA Notwithstanding any other terms, you may reverse engineer this software to the extent required to debug changes to any libraries licensed under the GNU Lesser General Public License. ================================================ FILE: AISKU/PRIVACY ================================================ # Data Collection The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ================================================ FILE: AISKU/README.md ================================================ # Microsoft Application Insights JavaScript SDK - Web [![GitHub Workflow Status (main)](https://img.shields.io/github/actions/workflow/status/microsoft/ApplicationInsights-JS/ci.yml?branch=main)](https://github.com/microsoft/ApplicationInsights-JS/tree/main) [![Build Status](https://dev.azure.com/mseng/AppInsights/_apis/build/status/AppInsights%20-%20DevTools/1DS%20JavaScript%20SDK%20web%20SKU%20vNext?branchName=main)](https://dev.azure.com/mseng/AppInsights/_build/latest?definitionId=8184&branchName=main) [![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-web.svg)](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-web) Application Insights SDK is a package that combines commonly used packages for Web scenarios. Refer to [our GitHub page](https://github.com/microsoft/applicationinsights-js) for more details on getting started. ## V3.x Release Breaking changes - Removed ES3 / IE8 Support - Removed V1 API Backward Compatibility (Upgrading V1 -> V3) See [Breaking Changes](https://microsoft.github.io/ApplicationInsights-JS/upgrade/v3_BreakingChanges.html) ## CDN Version Release Summary (with Size tracking) | Version | Full Size | Raw Minified | GZip Size |---------|-----------|--------------|------------- | [<nightly3>](https://github.com/microsoft/ApplicationInsights-JS/tree/main/AISKU) | [![full size size](https://js.monitor.azure.com/nightly/ai.3-nightly3.js.svg)](https://js.monitor.azure.com/nightly/ai.3-nightly3.js.svg)| ![minified size size](https://js.monitor.azure.com/nightly/ai.3-nightly3.min.js.svg) | ![gzip size](https://js.monitor.azure.com/nightly/ai.3-nightly3.min.js.gzip.svg) | 3.4.1: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.4.1.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.4.1.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.4.1.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.4.1.min.js.gzip.svg) | 3.4.0-beta: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.4.0-beta.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.4.0-beta.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.4.0-beta.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.3.11.min.js.gzip.svg) | 3.3.11: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.3.11.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.3.11.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.3.11.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.3.11.min.js.gzip.svg) | 3.3.10: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.3.10.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.3.10.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.3.10.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.3.10.min.js.gzip.svg) | 3.3.9: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.3.9.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.3.9.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.3.9.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.3.9.min.js.gzip.svg) | 3.3.8: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.3.8.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.3.8.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.3.8.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.3.8.min.js.gzip.svg) | 3.3.7: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.3.7.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.3.7.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.3.7.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.3.7.min.js.gzip.svg) | 3.3.6: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.3.6.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.3.6.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.3.6.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.3.6.min.js.gzip.svg) | 3.3.5: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.3.5.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.3.5.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.3.5.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.3.5.min.js.gzip.svg) | 3.3.4: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.3.4.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.3.4.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.3.4.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.3.4.min.js.gzip.svg) | 3.3.3: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.3.3.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.3.3.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.3.3.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.3.3.min.js.gzip.svg) | 3.3.2: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.3.2.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.3.2.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.3.2.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.3.2.min.js.gzip.svg) | 3.3.1: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.3.1.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.3.1.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.3.1.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.3.1.min.js.gzip.svg) | 3.3.0: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.3.0.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.3.0.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.3.0.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.3.0.min.js.gzip.svg) | 3.2.2: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.2.2.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.2.2.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.2.2.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.2.2.min.js.gzip.svg) | 3.2.1: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.2.1.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.2.1.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.2.1.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.2.1.min.js.gzip.svg) | 3.2.0: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.2.0.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.2.0.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.2.0.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.2.0.min.js.gzip.svg) | 3.1.2: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.1.2.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.1.2.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.1.2.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.1.2.min.js.gzip.svg) | 3.1.1: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.1.1.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.1.1.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.1.1.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.1.1.min.js.gzip.svg) | 3.1.0: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.1.0.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.1.0.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.1.0.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.1.0.min.js.gzip.svg) | 3.0.9: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.0.9.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.0.9.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.0.9.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.0.8.min.js.gzip.svg) | 3.0.8: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.0.8.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.0.8.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.0.8.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.0.8.min.js.gzip.svg) | 3.0.7: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.0.7.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.0.7.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.0.7.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.0.7.min.js.gzip.svg) | 3.0.6: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.0.6.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.0.6.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.0.6.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.0.5.min.js.gzip.svg) | 3.0.5: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.0.5.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.0.5.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.0.5.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.0.5.min.js.gzip.svg) | 3.0.4: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.0.4.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.0.4.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.0.4.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.0.4.min.js.gzip.svg) | [](https://github.com/microsoft/ApplicationInsights-JS/tree/master/AISKU) | [![full size size](https://js.monitor.azure.com/nightly/ai.2-nightly.js.svg)](https://js.monitor.azure.com/nightly/ai.2-nightly.js.svg)| ![minified size size](https://js.monitor.azure.com/nightly/ai.2-nightly.min.js.svg) | ![gzip size](https://js.monitor.azure.com/nightly/ai.2-nightly.min.js.gzip.svg) | 2.8.18: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.18.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.18.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.18.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.18.min.js.gzip.svg) | 2.8.17: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.17.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.17.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.17.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.17.min.js.gzip.svg) | 2.8.16: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.16.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.16.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.16.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.16.min.js.gzip.svg) | 2.8.15: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.15.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.15.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.15.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.15.min.js.gzip.svg) | 2.8.14: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.14.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.14.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.14.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.14.min.js.gzip.svg) | 2.8.13: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.13.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.13.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.13.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.13.min.js.gzip.svg) | [2.8.12](https://github.com/microsoft/ApplicationInsights-JS/tree/master/AISKU): | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.12.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.12.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.12.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.12.min.js.gzip.svg) | 2.8.11: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.11.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.11.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.11.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.11.min.js.gzip.svg) | 2.8.10: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.10.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.10.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.10.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.10.min.js.gzip.svg) | 2.8.9: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.9.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.9.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.9.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.9.min.js.gzip.svg) | 2.8.8: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.8.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.8.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.8.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.8.min.js.gzip.svg) | 2.8.7: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.7.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.7.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.7.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.7.min.js.gzip.svg) | 2.8.6: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.6.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.6.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.6.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.6.min.js.gzip.svg) | 2.8.5: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.5.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.5.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.5.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.5.min.js.gzip.svg) | 2.8.4: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.4.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.4.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.4.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.4.min.js.gzip.svg) | 2.8.3: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.3.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.3.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.3.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.3.min.js.gzip.svg) | 2.8.2: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.2.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.2.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.2.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.2.min.js.gzip.svg) | 2.8.1: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.1.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.1.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.1.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.1.min.js.gzip.svg) | 2.8.0: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.0.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.0.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.0.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.0.min.js.gzip.svg) | 2.7.4: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.7.4.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.7.4.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.7.4.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.7.4.min.js.gzip.svg) | 2.7.3: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.7.3.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.7.3.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.7.3.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.7.3.min.js.gzip.svg) | 2.7.2: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.7.2.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.7.2.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.7.2.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.7.2.min.js.gzip.svg) | 2.7.1: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.7.1.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.7.1.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.7.1.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.7.1.min.js.gzip.svg) | 2.7.0: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.7.0.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.7.0.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.7.0.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.7.0.min.js.gzip.svg) | 2.6.5: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.6.5.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.6.5.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.6.5.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.6.5.min.js.gzip.svg) | 2.6.4: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.6.4.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.6.4.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.6.4.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.6.4.min.js.gzip.svg) | 2.6.3: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.6.3.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.6.3.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.6.3.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.6.3.min.js.gzip.svg) | 2.6.2: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.6.2.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.6.2.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.6.2.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.6.2.min.js.gzip.svg) | 2.6.1: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.6.1.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.6.1.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.6.1.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.6.1.min.js.gzip.svg) | 2.6.0: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.6.0.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.6.0.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.6.0.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.6.0.min.js.gzip.svg) | 2.5.11: | ![full size size](https://js.monitor.azure.com/scripts/b/ai.2.5.11.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.5.11.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.5.11.min.js.gzip.svg) | 2.5.10: | ![full size size](https://js.monitor.azure.com/scripts/b/ai.2.5.10.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.5.10.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.5.10.min.js.gzip.svg) | 2.5.9: | ![full size size](https://js.monitor.azure.com/scripts/b/ai.2.5.9.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.5.9.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.5.9.min.js.gzip.svg) | 2.5.8: | ![full size size](https://js.monitor.azure.com/scripts/b/ai.2.5.8.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.5.8.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.5.8.min.js.gzip.svg) | 2.5.7: | ![full size size](https://js.monitor.azure.com/scripts/b/ai.2.5.7.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.5.7.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.5.7.min.js.gzip.svg) | 2.5.6: | ![full size size](https://js.monitor.azure.com/scripts/b/ai.2.5.6.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.5.6.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.5.6.min.js.gzip.svg) | 2.5.5: | ![full size size](https://js.monitor.azure.com/scripts/b/ai.2.5.5.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.5.5.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.5.5.min.js.gzip.svg) | 2.5.4: | ![full size size](https://js.monitor.azure.com/scripts/b/ai.2.5.4.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.5.4.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.5.4.min.js.gzip.svg) | 2.5.3: | ![full size size](https://js.monitor.azure.com/scripts/b/ai.2.5.3.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.5.3.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.5.3.min.js.gzip.svg) | 2.5.2: | ![full size size](https://js.monitor.azure.com/scripts/b/ai.2.5.2.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.5.2.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.5.2.min.js.gzip.svg) | 2.5.0 - 2.5.1 | Not Deployed to CDN | | | 2.4.4: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.4.4.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.4.4.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.4.4.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.4.4.min.js.gzip.svg) | 2.4.3: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.4.3.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.4.3.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.4.3.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.4.3.min.js.gzip.svg) | 2.4.2: | Not Deployed to CDN | 2.4.1: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.4.1.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.4.1.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.4.1.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.4.1.min.js.gzip.svg) | 2.4.0: | Not Deployed to CDN | 2.3.1: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.3.1.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.3.1.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.3.1.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.3.1.min.js.gzip.svg) | 2.3.0: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.3.0.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.3.0.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.3.0.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.3.0.min.js.gzip.svg) | 2.2.2: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.2.2.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.2.2.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.2.2.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.2.2.min.js.gzip.svg) | 2.2.1: | Not Deployed to CDN | 2.2.0: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.2.0.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.2.0.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.2.0.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.2.0.min.js.gzip.svg) | 2.1.0: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.1.0.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.1.0.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.1.0.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.1.0.min.js.gzip.svg) | 2.0.1: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.0.1.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.0.1.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.0.1.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.0.1.min.js.gzip.svg) | 2.0.0: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.0.0.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.0.0.js.svg) | ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.0.0.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.0.0.min.js.gzip.svg) ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. ## License [MIT](LICENSE) ================================================ FILE: AISKU/Tests/Manual/HelloWorld.html ================================================ Home Page - HelloWorld
From your repository
Perform a full build rush rebuild
Enable the test http server npm run serve
Load this page from the local service
  • Load in different browsers and ensure that the events are attempted to be sent
  • Use different browsers, Firefox, Chrome and Edge
  • Using Edge enable IE Mode
  • Use IEChooser to debug and change the Emulation mode
    • Default IE 11
    • Default IE 10
    • Default IE 9
    • Default IE 8
    • Default IE 7 - This will fail due to no JSON implementation, the console should show a warning
Note: The send attempt will fail, but you should see the outbound network attempt. If not debug the code and find out why!
© 2019 - HelloWorld
================================================ FILE: AISKU/Tests/Manual/README.md ================================================ # Span API End-to-End (E2E) Tests This directory contains end-to-end tests for the new Span APIs that send real telemetry to Azure Application Insights (Breeze endpoint) for manual validation in the Azure Portal. ## 📁 Files - **`SpanE2E.Tests.ts`** - Automated E2E test suite that can be configured to send real telemetry - **`span-e2e-manual-test.html`** - Interactive HTML page for manual testing with visual feedback ## 🚀 Quick Start - Manual HTML Testing The easiest way to test is using the interactive HTML page: 1. **Get your Application Insights credentials**: - Go to [Azure Portal](https://portal.azure.com) - Navigate to your Application Insights resource (or create a new one) - Copy the **Instrumentation Key** or **Connection String** from the Overview page 2. **Open the test page**: ```bash # Option 1: Open directly in browser open AISKU/Tests/Manual/span-e2e-manual-test.html # Option 2: Serve via local web server cd AISKU/Tests/Manual python -m http.server 8080 # Then open http://localhost:8080/span-e2e-manual-test.html ``` 3. **Run tests**: - Paste your Instrumentation Key or Connection String - Click "Initialize SDK" - Run individual tests or click "Run All Tests" - Watch the output log for confirmation 4. **View results in Azure Portal**: - Wait 1-2 minutes for telemetry to arrive - Go to your Application Insights resource - Navigate to **Performance** → **Dependencies** or **Requests** - Use **Search** to find specific test scenarios - Click **"View in End-to-End Transaction"** to see distributed traces ## 🧪 Automated Test Suite ### Configuration To run the automated test suite with real telemetry: 1. Open [`SpanE2E.Tests.ts`](../Unit/src/SpanE2E.Tests.ts) 2. Update the configuration: ```typescript // Set to true to send real telemetry private static readonly MANUAL_E2E_TEST = true; // Replace with your instrumentation key private static readonly _instrumentationKey = "YOUR-IKEY-HERE"; ``` 3. Run the tests: ```bash # From repository root rush build rush test ``` ### Test Scenarios Included The test suite covers: #### Basic Span Tests - ✅ CLIENT span → RemoteDependency - ✅ SERVER span → Request - ✅ Failed span → success=false #### Distributed Trace Tests - ✅ Parent-child relationships - ✅ 3-level nested hierarchy - ✅ Context propagation #### HTTP Dependency Tests - ✅ Various HTTP methods (GET, POST, PUT, DELETE) - ✅ Multiple status codes (2xx, 4xx, 5xx) - ✅ Full HTTP details (headers, body size, response time) #### Database Dependency Tests - ✅ MySQL, PostgreSQL, MongoDB, Redis, SQL Server - ✅ SQL statements and operations - ✅ Slow query scenarios #### Complex Scenarios - ✅ E-commerce checkout flow (7 dependencies) - ✅ Mixed success and failure operations - ✅ Rich custom properties for filtering ## 🔍 What to Look For in the Portal ### Performance Blade **Dependencies Tab**: - Look for CLIENT, PRODUCER, and INTERNAL spans - Verify dependency types (Http, mysql, postgresql, redis, etc.) - Check duration, target, and result codes - Examine custom properties in the details pane **Requests Tab**: - Look for SERVER and CONSUMER spans - Verify URLs, methods, and status codes - Check success/failure status - View response codes and durations ### Search Feature Filter by custom properties to find specific test runs: ``` customDimensions.test.scenario == "ecommerce" customDimensions.test.timestamp >= datetime(2025-12-01) customDimensions.business.tenant == "manual-test-corp" ``` ### End-to-End Transaction View 1. Click any request or dependency 2. Click **"View in End-to-End Transaction"** 3. See the complete distributed trace: - Timeline showing span durations - Parent-child relationships - All related dependencies - Custom properties at each level ### Transaction Timeline Look for: - ✅ Correct parent-child relationships (indentation) - ✅ Proper span nesting (visual hierarchy) - ✅ Accurate duration calculations - ✅ Operation IDs matching across spans - ✅ Custom dimensions preserved throughout ## 📊 Expected Results ### Test: Basic CLIENT Span - **Portal Location**: Performance → Dependencies - **Dependency Type**: "Dependency" or "Http" - **Custom Properties**: test.scenario, test.timestamp ### Test: Parent-Child Trace - **Portal Location**: End-to-End Transaction view - **Expected**: 1 Request + 2 Dependencies - **Relationship**: Both children reference same parent operation.id ### Test: E-commerce Checkout - **Portal Location**: End-to-End Transaction view - **Expected**: 1 Request + 7 Dependencies - **Types**: Http (inventory, payment, email), Database (create order), Redis (cache) - **Duration**: Parent spans entire operation ### Test: Rich Custom Properties - **Portal Location**: Search → Custom dimensions filter - **Expected Properties**: - business.tenant - user.subscription - feature.* flags - performance.* metrics ## 🐛 Troubleshooting ### Telemetry not appearing in portal 1. **Wait longer**: Initial ingestion can take 1-3 minutes 2. **Check time filter**: Ensure portal is showing last 30 minutes 3. **Verify iKey**: Confirm instrumentation key is correct 4. **Check browser console**: Look for SDK errors 5. **Flush telemetry**: Call `appInsights.flush()` in tests ### SDK initialization fails 1. **Valid credentials**: Verify instrumentation key format 2. **CORS issues**: Ensure application is running on http/https (not file://) 3. **Browser compatibility**: Use modern browser (Chrome, Edge, Firefox) ### Missing custom properties 1. **Property name limits**: Check for truncation (8192 char limit) 2. **Reserved names**: Some property names are filtered (http.*, db.*, microsoft.*) 3. **Type preservation**: Ensure values are correct types (string, number, boolean) ## 📝 Adding New Test Scenarios To add a new E2E test scenario: 1. **In SpanE2E.Tests.ts**: ```typescript this.testCase({ name: "E2E: Your new scenario", test: () => { const span = this._ai.startSpan("E2E-YourScenario", { kind: eOTelSpanKind.CLIENT, attributes: { "test.scenario": "your-scenario", "custom.property": "value" } }); if (span) { span.setStatus({ code: eOTelSpanStatusCode.OK }); span.end(); } this._ai.flush(); Assert.ok(span, "Span created"); } }); ``` 2. **In span-e2e-manual-test.html**: ```javascript function testYourScenario() { if (!appInsights) return; const span = appInsights.startSpan('E2E-Manual-YourScenario', { kind: 1, // CLIENT attributes: { 'test.scenario': 'your-scenario', 'custom.property': 'value' } }); if (span) { span.setStatus({ code: 1 }); span.end(); log('✅ Your scenario sent', 'success'); } appInsights.flush(); } ``` ## 🎯 Best Practices 1. **Use descriptive names**: Prefix test spans with "E2E-" or "Manual-" 2. **Include timestamps**: Add test.timestamp for filtering 3. **Add scenario tags**: Use test.scenario for grouping 4. **Flush after tests**: Always call `flush()` to send immediately 5. **Wait before checking**: Give telemetry 1-2 minutes to arrive 6. **Use unique identifiers**: Help distinguish between test runs 7. **Clean up regularly**: Archive or delete old test data ## 🔗 Resources - [Application Insights Overview](https://docs.microsoft.com/azure/azure-monitor/app/app-insights-overview) - [OpenTelemetry Specification](https://opentelemetry.io/docs/specs/otel/trace/api/) - [Azure Portal](https://portal.azure.com) - [Application Insights SDK Documentation](../../../README.md) ## 🤝 Contributing When adding new E2E tests: 1. Follow existing naming conventions (E2E-* prefix) 2. Include relevant custom properties 3. Document expected portal behavior 4. Update this README with new scenarios 5. Test manually before committing ================================================ FILE: AISKU/Tests/Manual/ai1.test.js ================================================ "use strict";var AI,Microsoft,__extends=this&&this.__extends||function(){var i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();function _endsWith(e,t){var n=e.length,i=n-t.length;return e.substring(0<=i?i:0,n)===t}!function(e){e.ApplicationInsights||(e.ApplicationInsights={})}(Microsoft||(Microsoft={})),function(e){var t;t=function n(){},(e.Telemetry||(e.Telemetry={})).Base=t}(Microsoft||(Microsoft={})),function(e){var t;t=function n(){this.ver=1,this.sampleRate=100,this.tags={}},(e.Telemetry||(e.Telemetry={})).Envelope=t}(Microsoft||(Microsoft={})),function(e){var t;(t=e.ApplicationInsights||(e.ApplicationInsights={})).Context||(t.Context={})}(Microsoft||(Microsoft={})),function(e){var t;(t=e.ApplicationInsights||(e.ApplicationInsights={})).Context||(t.Context={})}(Microsoft||(Microsoft={})),function(e){var t;(t=e.ApplicationInsights||(e.ApplicationInsights={})).Context||(t.Context={})}(Microsoft||(Microsoft={})),function(e){var t;(t=e.ApplicationInsights||(e.ApplicationInsights={})).Context||(t.Context={})}(Microsoft||(Microsoft={})),function(e){var t;(t=e.ApplicationInsights||(e.ApplicationInsights={})).Context||(t.Context={})}(Microsoft||(Microsoft={})),function(e){var t;(t=e.ApplicationInsights||(e.ApplicationInsights={})).Context||(t.Context={})}(Microsoft||(Microsoft={})),function(e){var t;(t=e.ApplicationInsights||(e.ApplicationInsights={})).Context||(t.Context={})}(Microsoft||(Microsoft={})),function(e){var t;(t=e.ApplicationInsights||(e.ApplicationInsights={})).Context||(t.Context={})}(Microsoft||(Microsoft={})),function(e){e.ApplicationInsights||(e.ApplicationInsights={})}(Microsoft||(Microsoft={})),function(e){e.ApplicationInsights||(e.ApplicationInsights={})}(Microsoft||(Microsoft={})),function(e){e.ApplicationInsights||(e.ApplicationInsights={})}(Microsoft||(Microsoft={})),function(e){var t;(t=e.SeverityLevel||(e.SeverityLevel={}))[t.Verbose=0]="Verbose",t[t.Information=1]="Information",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.Critical=4]="Critical"}(AI||(AI={})),function(e){e.ApplicationInsights||(e.ApplicationInsights={})}(Microsoft||(Microsoft={})),function(e){!function(s){var l,e,c,t;(e=l=s.LoggingSeverity||(s.LoggingSeverity={}))[e.CRITICAL=0]="CRITICAL",e[e.WARNING=1]="WARNING",(t=c=s._InternalMessageId||(s._InternalMessageId={}))[t.BrowserDoesNotSupportLocalStorage=0]="BrowserDoesNotSupportLocalStorage",t[t.BrowserCannotReadLocalStorage=1]="BrowserCannotReadLocalStorage",t[t.BrowserCannotReadSessionStorage=2]="BrowserCannotReadSessionStorage",t[t.BrowserCannotWriteLocalStorage=3]="BrowserCannotWriteLocalStorage",t[t.BrowserCannotWriteSessionStorage=4]="BrowserCannotWriteSessionStorage",t[t.BrowserFailedRemovalFromLocalStorage=5]="BrowserFailedRemovalFromLocalStorage",t[t.BrowserFailedRemovalFromSessionStorage=6]="BrowserFailedRemovalFromSessionStorage",t[t.CannotSendEmptyTelemetry=7]="CannotSendEmptyTelemetry",t[t.ClientPerformanceMathError=8]="ClientPerformanceMathError",t[t.ErrorParsingAISessionCookie=9]="ErrorParsingAISessionCookie",t[t.ErrorPVCalc=10]="ErrorPVCalc",t[t.ExceptionWhileLoggingError=11]="ExceptionWhileLoggingError",t[t.FailedAddingTelemetryToBuffer=12]="FailedAddingTelemetryToBuffer",t[t.FailedMonitorAjaxAbort=13]="FailedMonitorAjaxAbort",t[t.FailedMonitorAjaxDur=14]="FailedMonitorAjaxDur",t[t.FailedMonitorAjaxOpen=15]="FailedMonitorAjaxOpen",t[t.FailedMonitorAjaxRSC=16]="FailedMonitorAjaxRSC",t[t.FailedMonitorAjaxSend=17]="FailedMonitorAjaxSend",t[t.FailedMonitorAjaxGetCorrelationHeader=18]="FailedMonitorAjaxGetCorrelationHeader",t[t.FailedToAddHandlerForOnBeforeUnload=19]="FailedToAddHandlerForOnBeforeUnload",t[t.FailedToSendQueuedTelemetry=20]="FailedToSendQueuedTelemetry",t[t.FailedToReportDataLoss=21]="FailedToReportDataLoss",t[t.FlushFailed=22]="FlushFailed",t[t.MessageLimitPerPVExceeded=23]="MessageLimitPerPVExceeded",t[t.MissingRequiredFieldSpecification=24]="MissingRequiredFieldSpecification",t[t.NavigationTimingNotSupported=25]="NavigationTimingNotSupported",t[t.OnError=26]="OnError",t[t.SessionRenewalDateIsZero=27]="SessionRenewalDateIsZero",t[t.SenderNotInitialized=28]="SenderNotInitialized",t[t.StartTrackEventFailed=29]="StartTrackEventFailed",t[t.StopTrackEventFailed=30]="StopTrackEventFailed",t[t.StartTrackFailed=31]="StartTrackFailed",t[t.StopTrackFailed=32]="StopTrackFailed",t[t.TelemetrySampledAndNotSent=33]="TelemetrySampledAndNotSent",t[t.TrackEventFailed=34]="TrackEventFailed",t[t.TrackExceptionFailed=35]="TrackExceptionFailed",t[t.TrackMetricFailed=36]="TrackMetricFailed",t[t.TrackPVFailed=37]="TrackPVFailed",t[t.TrackPVFailedCalc=38]="TrackPVFailedCalc",t[t.TrackTraceFailed=39]="TrackTraceFailed",t[t.TransmissionFailed=40]="TransmissionFailed",t[t.FailedToSetStorageBuffer=41]="FailedToSetStorageBuffer",t[t.FailedToRestoreStorageBuffer=42]="FailedToRestoreStorageBuffer",t[t.InvalidBackendResponse=43]="InvalidBackendResponse",t[t.FailedToFixDepricatedValues=44]="FailedToFixDepricatedValues",t[t.InvalidDurationValue=45]="InvalidDurationValue",t[t.CannotSerializeObject=46]="CannotSerializeObject",t[t.CannotSerializeObjectNonSerializable=47]="CannotSerializeObjectNonSerializable",t[t.CircularReferenceDetected=48]="CircularReferenceDetected",t[t.ClearAuthContextFailed=49]="ClearAuthContextFailed",t[t.ExceptionTruncated=50]="ExceptionTruncated",t[t.IllegalCharsInName=51]="IllegalCharsInName",t[t.ItemNotInArray=52]="ItemNotInArray",t[t.MaxAjaxPerPVExceeded=53]="MaxAjaxPerPVExceeded",t[t.MessageTruncated=54]="MessageTruncated",t[t.NameTooLong=55]="NameTooLong",t[t.SampleRateOutOfRange=56]="SampleRateOutOfRange",t[t.SetAuthContextFailed=57]="SetAuthContextFailed",t[t.SetAuthContextFailedAccountName=58]="SetAuthContextFailedAccountName",t[t.StringValueTooLong=59]="StringValueTooLong",t[t.StartCalledMoreThanOnce=60]="StartCalledMoreThanOnce",t[t.StopCalledWithoutStart=61]="StopCalledWithoutStart",t[t.TelemetryInitializerFailed=62]="TelemetryInitializerFailed",t[t.TrackArgumentsNotSpecified=63]="TrackArgumentsNotSpecified",t[t.UrlTooLong=64]="UrlTooLong",t[t.SessionStorageBufferFull=65]="SessionStorageBufferFull",t[t.CannotAccessCookie=66]="CannotAccessCookie",t[t.IdTooLong=67]="IdTooLong";var g=function(){function a(e,t,n,i){void 0===n&&(n=!1),this.messageId=e,this.message=(n?a.AiUserActionablePrefix:a.AiNonUserActionablePrefix)+c[e].toString();var o=(t?" message:"+a.sanitizeDiagnosticText(t):"")+(i?" props:"+a.sanitizeDiagnosticText(JSON.stringify(i)):"");this.message+=o}return a.sanitizeDiagnosticText=function(e){return'"'+e.replace(/\"/g,"")+'"'},a.AiNonUserActionablePrefix="AI (Internal): ",a.AiUserActionablePrefix="AI: ",a}();s._InternalLogMessage=g;var n=function(){function r(){}return r.throwInternal=function(e,t,n,i,o){void 0===o&&(o=!1);var a=new g(t,n,o,i);if(this.enableDebugExceptions())throw a;if(void 0!==a&&a&&"undefined"!=typeof a.message){if(o){var r=c[a.messageId];this._messageLogged[r]&&!this.verboseLogging()||(this.warnToConsole(a.message),this._messageLogged[r]=!0)}else this.verboseLogging()&&this.warnToConsole(a.message);this.logInternalMessage(e,a)}},r.warnToConsole=function(e){"undefined"!=typeof console&&console&&("function"==typeof console.warn?console.warn(e):"function"==typeof console.log&&console.log(e))},r.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},r.clearInternalMessageLoggedTypes=function(){if(s.Util.canUseSessionStorage())for(var e=s.Util.getSessionStorageKeys(),t=0;t=this.MAX_INTERNAL_MESSAGE_LIMIT},r.AIInternalMessagePrefix="AITR_",r.enableDebugExceptions=function(){return!1},r.verboseLogging=function(){return!1},r.queue=[],r.MAX_INTERNAL_MESSAGE_LIMIT=25,r._messageCount=0,r._messageLogged={},r}();s._InternalLogging=n}(e.ApplicationInsights||(e.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(e){var t,n;t=e.ApplicationInsights||(e.ApplicationInsights={}),n=function(){function e(){}return e.newId=function(){for(var e="",t=1073741824*Math.random();0this.config.sessionExpirationMs(),n=e-this.automaticSession.renewalDate>this.config.sessionRenewalMs();t||n?(this.automaticSession.isFirst=undefined,this.renew()):(!this.cookieUpdatedTimestamp||e-this.cookieUpdatedTimestamp>i.cookieUpdateInterval)&&(this.automaticSession.renewalDate=e,this.setCookie(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate))},i.prototype.backup=function(){this.setStorage(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate)},i.prototype.initializeAutomaticSession=function(){var e=l.Util.getCookie("ai_session");if(e&&"function"==typeof e.split)this.initializeAutomaticSessionWithData(e);else{var t=l.Util.getStorage("ai_session");t&&this.initializeAutomaticSessionWithData(t)}this.automaticSession.id||(this.automaticSession.isFirst=!0,this.renew())},i.prototype.initializeAutomaticSessionWithData=function(e){var t=e.split("|");0r.MAX_NAME_LENGTH&&(e=e.substring(0,r.MAX_NAME_LENGTH),i._InternalLogging.throwInternal(i.LoggingSeverity.WARNING,i._InternalMessageId.NameTooLong,"name is too long. It has been truncated to "+r.MAX_NAME_LENGTH+" characters.",{name:e},!0)),e},r.sanitizeString=function(e,t){return void 0===t&&(t=r.MAX_STRING_LENGTH),e&&(t=t||r.MAX_STRING_LENGTH,(e=i.Util.trim(e)).toString().length>t&&(e=e.toString().substring(0,t),i._InternalLogging.throwInternal(i.LoggingSeverity.WARNING,i._InternalMessageId.StringValueTooLong,"string value is too long. It has been truncated to "+t+" characters.",{value:e},!0))),e},r.sanitizeUrl=function(e){return r.sanitizeInput(e,r.MAX_URL_LENGTH,i._InternalMessageId.UrlTooLong)},r.sanitizeMessage=function(e){return e&&e.length>r.MAX_MESSAGE_LENGTH&&(e=e.substring(0,r.MAX_MESSAGE_LENGTH),i._InternalLogging.throwInternal(i.LoggingSeverity.WARNING,i._InternalMessageId.MessageTruncated,"message is too long, it has been truncated to "+r.MAX_MESSAGE_LENGTH+" characters.",{message:e},!0)),e},r.sanitizeException=function(e){return e&&e.length>r.MAX_EXCEPTION_LENGTH&&(e=e.substring(0,r.MAX_EXCEPTION_LENGTH),i._InternalLogging.throwInternal(i.LoggingSeverity.WARNING,i._InternalMessageId.ExceptionTruncated,"exception is too long, it has been truncated to "+r.MAX_EXCEPTION_LENGTH+" characters.",{exception:e},!0)),e},r.sanitizeProperties=function(e){if(e){var t={};for(var n in e){var i=r.sanitizeString(e[n],r.MAX_PROPERTY_LENGTH);t[n=r.sanitizeKeyAndAddUniqueness(n,t)]=i}e=t}return e},r.sanitizeMeasurements=function(e){if(e){var t={};for(var n in e){var i=e[n];t[n=r.sanitizeKeyAndAddUniqueness(n,t)]=i}e=t}return e},r.sanitizeId=function(e){return e?r.sanitizeInput(e,r.MAX_ID_LENGTH,i._InternalMessageId.IdTooLong).toString():e},r.sanitizeInput=function(e,t,n){return e&&(e=i.Util.trim(e)).length>t&&(e=e.substring(0,t),i._InternalLogging.throwInternal(i.LoggingSeverity.WARNING,n,"input is too long, it has been truncated to "+t+" characters.",{data:e},!0)),e},r.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},r.MAX_NAME_LENGTH=150,r.MAX_ID_LENGTH=128,r.MAX_PROPERTY_LENGTH=8192,r.MAX_STRING_LENGTH=1024,r.MAX_URL_LENGTH=2048,r.MAX_MESSAGE_LENGTH=32768,r.MAX_EXCEPTION_LENGTH=32768,r}(),n.DataSanitizer=o}(Microsoft||(Microsoft={})),function(e){var p,d,t;p=e.ApplicationInsights||(e.ApplicationInsights={}),d=p.Telemetry||(p.Telemetry={}),t=function(u){function e(e,t,n,i,o,a,r,s,l){var c=u.call(this)||this;c.aiDataContract={id:p.FieldType.Required,ver:p.FieldType.Required,name:p.FieldType.Default,resultCode:p.FieldType.Default,duration:p.FieldType.Default,success:p.FieldType.Default,data:p.FieldType.Default,target:p.FieldType.Default,type:p.FieldType.Default,properties:p.FieldType.Default,measurements:p.FieldType.Default,kind:p.FieldType.Default,value:p.FieldType.Default,count:p.FieldType.Default,min:p.FieldType.Default,max:p.FieldType.Default,stdDev:p.FieldType.Default,dependencyKind:p.FieldType.Default,dependencySource:p.FieldType.Default,commandName:p.FieldType.Default,dependencyTypeName:p.FieldType.Default},c.id=e,c.duration=p.Util.msToTimeSpan(i),c.success=o,c.resultCode=a+"",c.type="Ajax",c.data=d.Common.DataSanitizer.sanitizeUrl(n);var g=p.AjaxHelper.ParseDependencyPath(t,r,n);return c.target=g.target,c.name=g.name,c.properties=p.Telemetry.Common.DataSanitizer.sanitizeProperties(s),c.measurements=p.Telemetry.Common.DataSanitizer.sanitizeMeasurements(l),c}return __extends(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(AI.RemoteDependencyData),d.RemoteDependencyData=t}(Microsoft||(Microsoft={})),function(s){var l,e;l=s.ApplicationInsights||(s.ApplicationInsights={}),e=function(){function r(e){this.currentWindowHost="object"==typeof window?window.location.host&&window.location.host.toLowerCase():undefined,this.appInsights=e,this.initialized=!1,this.Init()}return r.prototype.Init=function(){this.supportsMonitoring()&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},r.prototype.isMonitoredInstance=function(e,t){return this.initialized&&(!0===t||!l.extensions.IsNullOrUndefined(e.ajaxData))&&!0!==e[r.DisabledPropertyName]},r.prototype.supportsMonitoring=function(){var e=!0;("function"!=typeof XMLHttpRequest||l.extensions.IsNullOrUndefined(XMLHttpRequest)||l.extensions.IsNullOrUndefined(XMLHttpRequest.prototype)||l.extensions.IsNullOrUndefined(XMLHttpRequest.prototype.open)||l.extensions.IsNullOrUndefined(XMLHttpRequest.prototype.send)||l.extensions.IsNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1);try{" a ".trim()}catch(t){e=!1}return e},r.prototype.instrumentOpen=function(){var o=XMLHttpRequest.prototype.open,a=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!a.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||a.openHandler(this,e,t,n)}catch(i){l._InternalLogging.throwInternal(l.LoggingSeverity.CRITICAL,l._InternalMessageId.FailedMonitorAjaxOpen,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(this),exception:s.ApplicationInsights.Util.dump(i)})}return o.apply(this,arguments)}},r.prototype.openHandler=function(e,t,n,i){var o="|"+this.appInsights.context.operation.id+"."+l.Util.newId(),a=new l.ajaxRecord(o);a.method=t,a.requestUrl=n,a.xhrMonitoringState.openDone=!0,e.ajaxData=a,this.attachToOnReadyStateChange(e)},r.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{l.extensions.IsNullOrUndefined(e)||l.extensions.IsNullOrUndefined(e.ajaxData)||l.extensions.IsNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(n){}return t},r.prototype.instrumentSend=function(){var n=XMLHttpRequest.prototype.send,i=this;XMLHttpRequest.prototype.send=function(e){try{i.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.sendDone&&i.sendHandler(this,e)}catch(t){l._InternalLogging.throwInternal(l.LoggingSeverity.CRITICAL,l._InternalMessageId.FailedMonitorAjaxSend,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(this),exception:s.ApplicationInsights.Util.dump(t)})}return n.apply(this,arguments)}},r.prototype.sendHandler=function(e,t){if(e.ajaxData.requestSentTime=l.dateTime.Now(),l.CorrelationIdHelper.canIncludeCorrelationHeader(this.appInsights.config,e.ajaxData.getAbsoluteUrl(),this.currentWindowHost)&&(e.setRequestHeader(l.RequestHeaders.requestIdHeader,e.ajaxData.id),this.appInsights.context)){var n=this.appInsights.context.appId();n&&e.setRequestHeader(l.RequestHeaders.requestContextHeader,l.RequestHeaders.requestContextAppIdFormat+n)}e.ajaxData.xhrMonitoringState.sendDone=!0},r.prototype.instrumentAbort=function(){var t=XMLHttpRequest.prototype.abort,n=this;XMLHttpRequest.prototype.abort=function(){try{n.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.abortDone&&(this.ajaxData.aborted=1,this.ajaxData.xhrMonitoringState.abortDone=!0)}catch(e){l._InternalLogging.throwInternal(l.LoggingSeverity.CRITICAL,l._InternalMessageId.FailedMonitorAjaxAbort,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(this),exception:s.ApplicationInsights.Util.dump(e)})}return t.apply(this,arguments)}},r.prototype.attachToOnReadyStateChange=function(n){var i=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=l.EventHelper.AttachEvent(n,"readystatechange",function(){try{i.isMonitoredInstance(n)&&4===n.readyState&&i.onAjaxComplete(n)}catch(t){var e=s.ApplicationInsights.Util.dump(t);e&&-1!=e.toLowerCase().indexOf("c00c023f")||l._InternalLogging.throwInternal(l.LoggingSeverity.CRITICAL,l._InternalMessageId.FailedMonitorAjaxRSC,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(n),exception:s.ApplicationInsights.Util.dump(t)})}})},r.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=l.dateTime.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)l._InternalLogging.throwInternal(l.LoggingSeverity.WARNING,l._InternalMessageId.FailedMonitorAjaxDur,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t=new l.Telemetry.RemoteDependencyData(e.ajaxData.id,e.ajaxData.getAbsoluteUrl(),e.ajaxData.getPathName(),e.ajaxData.ajaxTotalDuration,200<=+e.ajaxData.status&&+e.ajaxData.status<400,+e.ajaxData.status,e.ajaxData.method),n=this.getCorrelationContext(e);n&&(t.target=t.target+" | "+n),this.appInsights.trackDependencyData(t),e.ajaxData=null}},r.prototype.getCorrelationContext=function(e){try{var t=e.getAllResponseHeaders();if(null!==t)if(-1!==t.toLowerCase().indexOf(l.RequestHeaders.requestContextHeaderLowerCase)){var n=e.getResponseHeader(l.RequestHeaders.requestContextHeader);return l.CorrelationIdHelper.getCorrelationContext(n)}}catch(i){l._InternalLogging.throwInternal(l.LoggingSeverity.WARNING,l._InternalMessageId.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(e),exception:s.ApplicationInsights.Util.dump(i)})}},r.instrumentedByAppInsightsName="InstrumentedByAppInsights",r.DisabledPropertyName="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",r}(),l.AjaxMonitor=e}(Microsoft||(Microsoft={})),function(e){!function(o){var e=function(){function e(e){this._config=e,this._buffer=[]}return e.prototype.enqueue=function(e){this._buffer.push(e)},e.prototype.count=function(){return this._buffer.length},e.prototype.clear=function(){this._buffer.length=0},e.prototype.getItems=function(){return this._buffer.slice(0)},e.prototype.batchPayloads=function(e){return e&&0i.MAX_BUFFER_SIZE&&(this._buffer.length=i.MAX_BUFFER_SIZE),this.setBuffer(i.SENT_BUFFER_KEY,[]),this.setBuffer(i.BUFFER_KEY,this._buffer)}return i.prototype.enqueue=function(e){this._buffer.length>=i.MAX_BUFFER_SIZE?this._bufferFullMessageSent||(o._InternalLogging.throwInternal(o.LoggingSeverity.WARNING,o._InternalMessageId.SessionStorageBufferFull,"Maximum buffer size reached: "+this._buffer.length,!0),this._bufferFullMessageSent=!0):(this._buffer.push(e),this.setBuffer(i.BUFFER_KEY,this._buffer))},i.prototype.count=function(){return this._buffer.length},i.prototype.clear=function(){this._buffer.length=0,this.setBuffer(i.BUFFER_KEY,[]),this.setBuffer(i.SENT_BUFFER_KEY,[]),this._bufferFullMessageSent=!1},i.prototype.getItems=function(){return this._buffer.slice(0)},i.prototype.batchPayloads=function(e){return e&&0i.MAX_BUFFER_SIZE&&(o._InternalLogging.throwInternal(o.LoggingSeverity.CRITICAL,o._InternalMessageId.SessionStorageBufferFull,"Sent buffer reached its maximum size: "+t.length,!0),t.length=i.MAX_BUFFER_SIZE),this.setBuffer(i.SENT_BUFFER_KEY,t))},i.prototype.clearSent=function(e){var t=this.getBuffer(i.SENT_BUFFER_KEY);t=this.removePayloadsFromBuffer(e,t),this.setBuffer(i.SENT_BUFFER_KEY,t)},i.prototype.removePayloadsFromBuffer=function(e,t){var n=[];for(var i in t){var o=!1;for(var a in e)if(e[a]===t[i]){o=!0;break}o||n.push(t[i])}return n},i.prototype.getBuffer=function(e){try{var t=o.Util.getSessionStorage(e);if(t){var n=JSON.parse(t);if(n)return n}}catch(i){o._InternalLogging.throwInternal(o.LoggingSeverity.CRITICAL,o._InternalMessageId.FailedToRestoreStorageBuffer," storage key: "+e+", "+o.Util.getExceptionName(i),{exception:o.Util.dump(i)})}return[]},i.prototype.setBuffer=function(e,t){try{var n=JSON.stringify(t);o.Util.setSessionStorage(e,n)}catch(i){o.Util.setSessionStorage(e,JSON.stringify([])),o._InternalLogging.throwInternal(o.LoggingSeverity.WARNING,o._InternalMessageId.FailedToSetStorageBuffer," storage key: "+e+", "+o.Util.getExceptionName(i)+". Buffer cleared",{exception:o.Util.dump(i)})}},i.BUFFER_KEY="AI_buffer",i.SENT_BUFFER_KEY="AI_sentBuffer",i.MAX_BUFFER_SIZE=2e3,i}();o.SessionStorageSendBuffer=t}(e.ApplicationInsights||(e.ApplicationInsights={}))}(Microsoft||(Microsoft={})),function(e){var l,t;l=e.ApplicationInsights||(e.ApplicationInsights={}),t=function(){function e(e){(this._XMLHttpRequestSupported=!1,this._consecutiveErrors=0,this._retryAt=null,this._lastSend=0,this._config=e,this._sender=null,this._buffer=l.Util.canUseSessionStorage()&&this._config.enableSessionStorageBuffer()?new l.SessionStorageSendBuffer(e):new l.ArraySendBuffer(e),!this._config.isBeaconApiDisabled()&&l.Util.IsBeaconApiSupported())?this._sender=this._beaconSender:"undefined"!=typeof XMLHttpRequest&&("withCredentials"in new XMLHttpRequest?(this._sender=this._xhrSender,this._XMLHttpRequestSupported=!0):"undefined"!=typeof XDomainRequest&&(this._sender=this._xdrSender))}return e.prototype.send=function(e){try{if(this._config.disableTelemetry())return;if(!e)return void l._InternalLogging.throwInternal(l.LoggingSeverity.CRITICAL,l._InternalMessageId.CannotSendEmptyTelemetry,"Cannot send empty telemetry");if(!this._sender)return void l._InternalLogging.throwInternal(l.LoggingSeverity.CRITICAL,l._InternalMessageId.SenderNotInitialized,"Sender was not initialized");var t=l.Serializer.serialize(e),n=this._buffer.getItems(),i=this._buffer.batchPayloads(n);i&&i.length+t.length>this._config.maxBatchSizeInBytes()&&this.triggerSend(),this._buffer.enqueue(t),this._setupTimer()}catch(o){l._InternalLogging.throwInternal(l.LoggingSeverity.WARNING,l._InternalMessageId.FailedAddingTelemetryToBuffer,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+l.Util.getExceptionName(o),{exception:l.Util.dump(o)})}},e.prototype._setupTimer=function(){var e=this;if(!this._timeoutHandle){var t=this._retryAt?Math.max(0,this._retryAt-Date.now()):0,n=Math.max(this._config.maxBatchInterval(),t);this._timeoutHandle=setTimeout(function(){e.triggerSend()},n)}},e.prototype._getSizeInBytes=function(e){var t=0;if(e&&e.length)for(var n=0;n=t.itemsAccepted&&t.itemsReceived-t.itemsAccepted==t.errors.length)return t}}catch(n){l._InternalLogging.throwInternal(l.LoggingSeverity.CRITICAL,l._InternalMessageId.InvalidBackendResponse,"Cannot parse the response. "+l.Util.getExceptionName(n),{response:e})}return null},e.prototype._isRetriable=function(e){return 408==e||429==e||500==e||503==e},e.prototype._resendPayload=function(e){if(e&&0!==e.length){this._buffer.clearSent(e),this._consecutiveErrors++;for(var t=0,n=e;tn.itemsAccepted&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,n):this._onError(t,this._formatErrorMessageXdr(e))}else this._consecutiveErrors=0,this._onSuccess(t,0)},e.prototype._onPartialSuccess=function(e,t){for(var n=[],i=[],o=0,a=t.errors.reverse();o",n.assembly=s.Util.trim(e);var i=e.match(a.regex);return i&&5<=i.length&&(n.method=s.Util.trim(i[2])||n.method,n.fileName=s.Util.trim(i[4]),n.line=parseInt(i[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return __extends(a,o),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(AI.StackFrame);o._StackFrame=f})((s=e.ApplicationInsights||(e.ApplicationInsights={})).Telemetry||(s.Telemetry={}))}(Microsoft||(Microsoft={})),function(e){var t;(t=e.DataPointType||(e.DataPointType={}))[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"}(AI||(AI={})),function(e){var t=function n(){this.kind=e.DataPointType.Measurement};e.DataPoint=t}(AI||(AI={})),function(e){var t=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return __extends(e,t),e}(Microsoft.Telemetry.Domain);e.MetricData=t}(AI||(AI={})),function(e){var n,t,i,o;n=e.ApplicationInsights||(e.ApplicationInsights={}),t=n.Telemetry||(n.Telemetry={}),i=t.Common||(t.Common={}),o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:n.FieldType.Required,kind:n.FieldType.Default,value:n.FieldType.Required,count:n.FieldType.Default,min:n.FieldType.Default,max:n.FieldType.Default,stdDev:n.FieldType.Default},e}return __extends(e,t),e}(AI.DataPoint),i.DataPoint=o}(Microsoft||(Microsoft={})),function(c){var g,u,e;g=c.ApplicationInsights||(c.ApplicationInsights={}),u=g.Telemetry||(g.Telemetry={}),e=function(l){function e(e,t,n,i,o,a){var r=l.call(this)||this;r.aiDataContract={ver:g.FieldType.Required,metrics:g.FieldType.Required,properties:g.FieldType.Default};var s=new c.ApplicationInsights.Telemetry.Common.DataPoint;return s.count=0=d.MAX_DURATION_ALLOWED)return!1;return!0},d.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",d.dataType="PageviewPerformanceData",d.MAX_DURATION_ALLOWED=36e5,d}(AI.PageViewPerfData),h.PageViewPerformance=t}(Microsoft||(Microsoft={})),function(o){var s,e;s=o.ApplicationInsights||(o.ApplicationInsights={}),e=function(){function e(e){var t=this;this._config=e,this._sender=new s.Sender(e),this.appId=function(){return t._sender._appId},e.appId()&&(this._sender._appId=e.appId()),this.telemetryInitializers=[],"undefined"!=typeof window&&(this._sessionManager=new s.Context._SessionManager(e),this.application=new s.Context.Application,this.device=new s.Context.Device,this.internal=new s.Context.Internal(e),this.location=new s.Context.Location,this.user=new s.Context.User(e),this.operation=new s.Context.Operation,this.session=new s.Context.Session,this.sample=new s.Context.Sample(e.sampleRate())),this._addDefaultTelemetryInitializers()}return e.prototype.addTelemetryInitializer=function(e){this.telemetryInitializers.push(e)},e.prototype.track=function(e){return e?(e.name===s.Telemetry.PageView.envelopeType&&s._InternalLogging.resetInternalMessageCount(),this.session&&"string"!=typeof this.session.id&&this._sessionManager.update(),this._track(e)):s._InternalLogging.throwInternal(s.LoggingSeverity.CRITICAL,s._InternalMessageId.TrackArgumentsNotSpecified,"cannot call .track() with a null or undefined argument",null,!0),e},e.prototype._addDefaultTelemetryInitializers=function(){if(!this._config.isBrowserLinkTrackingEnabled()){var i=["/browserLinkSignalR/","/__browserLink/"];this.addTelemetryInitializer(function(e){if(e.name===o.ApplicationInsights.Telemetry.RemoteDependencyData.envelopeType){var t=e.data;if(t&&t.baseData)for(var n=0;n= searchLen && !(result = value === search)) { var pos = valLen - 1; for (var lp = searchLen - 1; lp >= 0; lp--) { if (value[pos] != search[lp]) { return false; } pos--; } result = true; } return result; } function strContains(value, search) { if (value && search) { return value[_DYN_INDEX_OF$2 ](search) !== -1; } return false; } function isDate(obj) { return !!(obj && _objToString[_DYN_CALL ](obj) === "[object Date]"); } var isArray = _isArray || _isArrayPoly; function _isArrayPoly(obj) { return !!(obj && _objToString[_DYN_CALL ](obj) === "[object Array]"); } function isError(obj) { return !!(obj && _objToString[_DYN_CALL ](obj) === "[object Error]"); } function isString(value) { return typeof value === "string"; } function isNumber(value) { return typeof value === "number"; } function isBoolean(value) { return typeof value === "boolean"; } function isPlainObject(value) { var result = false; if (value && typeof value === "object") { var proto = _objGetPrototypeOf$1 ? _objGetPrototypeOf$1(value) : _getObjProto$1(value); if (!proto) { result = true; } else { if (proto[strConstructor] && ObjHasOwnProperty[_DYN_CALL ](proto, strConstructor)) { proto = proto[strConstructor]; } result = typeof proto === strShimFunction && _fnToString[_DYN_CALL ](proto) === _objFunctionString; } } return result; } function toISOString(date) { if (date) { return _dataToISOString ? date[strToISOString]() : _toISOStringPoly(date); } } function _toISOStringPoly(date) { if (date && date.getUTCFullYear) { var pad = function (num) { var r = String(num); if (r[_DYN_LENGTH$5 ] === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } function arrForEach(arr, callbackfn, thisArg) { var len = arr[_DYN_LENGTH$5 ]; try { for (var idx = 0; idx < len; idx++) { if (idx in arr) { if (callbackfn[_DYN_CALL ](thisArg || arr, arr[idx], idx, arr) === -1) { break; } } } } catch (e) { } } function arrIndexOf(arr, searchElement, fromIndex) { if (arr) { if (arr[strIndexOf]) { return arr[strIndexOf](searchElement, fromIndex); } var len = arr[_DYN_LENGTH$5 ]; var from = fromIndex || 0; try { for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) { if (lp in arr && arr[lp] === searchElement) { return lp; } } } catch (e) { } } return -1; } function arrMap(arr, callbackfn, thisArg) { var results; if (arr) { if (arr[strMap]) { return arr[strMap](callbackfn, thisArg); } var len = arr[_DYN_LENGTH$5 ]; var _this = thisArg || arr; results = new Array(len); try { for (var lp = 0; lp < len; lp++) { if (lp in arr) { results[lp] = callbackfn[_DYN_CALL ](_this, arr[lp], arr); } } } catch (e) { } } return results; } function arrReduce(arr, callbackfn, initialValue) { var value; if (arr) { if (arr[strReduce]) { return arr[strReduce](callbackfn, initialValue); } var len = arr[_DYN_LENGTH$5 ]; var lp = 0; if (arguments[_DYN_LENGTH$5 ] >= 3) { value = arguments[2]; } else { while (lp < len && !(lp in arr)) { lp++; } value = arr[lp++]; } while (lp < len) { if (lp in arr) { value = callbackfn(value, arr[lp], lp, arr); } lp++; } } return value; } function strTrim(str) { if (str) { str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str[_DYN_REPLACE ] ? str[_DYN_REPLACE ](/^\s+|(?=\s)\s+$/g, STR_EMPTY) : str); } return str; } var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString"); var _objKeysDontEnums = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ]; function objKeys(obj) { var objType = typeof obj; if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) { throwTypeError("objKeys called on non-object"); } if (!_objKeysHasDontEnumBug && _objKeys) { return _objKeys(obj); } var result = []; for (var prop in obj) { if (obj && ObjHasOwnProperty[_DYN_CALL ](obj, prop)) { result[_DYN_PUSH$2 ](prop); } } if (_objKeysHasDontEnumBug) { var dontEnumsLength = _objKeysDontEnums[_DYN_LENGTH$5 ]; for (var lp = 0; lp < dontEnumsLength; lp++) { if (obj && ObjHasOwnProperty[_DYN_CALL ](obj, _objKeysDontEnums[lp])) { result[_DYN_PUSH$2 ](_objKeysDontEnums[lp]); } } } return result; } function objDefineAccessors(target, prop, getProp, setProp) { if (_objDefineProperty$1) { try { var descriptor = { enumerable: true, configurable: true }; if (getProp) { descriptor.get = getProp; } if (setProp) { descriptor.set = setProp; } _objDefineProperty$1(target, prop, descriptor); return true; } catch (e) { } } return false; } function _doNothing(value) { return value; } function deepFreeze(obj) { if (_objFreeze) { objForEachKey(obj, function (name, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(obj); } var objFreeze = _objFreeze || _doNothing; function dateNow() { var dt = Date; return dt.now ? dt.now() : new dt().getTime(); } function getExceptionName(object) { if (isError(object)) { return object[_DYN_NAME$3 ]; } return STR_EMPTY; } function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } function getSetValue(target, field, defValue) { var theValue; if (target) { theValue = target[field]; if (!theValue && isNullOrUndefined(theValue)) { theValue = !isUndefined(defValue) ? defValue : {}; target[field] = theValue; } } else { theValue = !isUndefined(defValue) ? defValue : {}; } return theValue; } function getCfgValue(theValue, defaultValue) { return !isNullOrUndefined(theValue) ? theValue : defaultValue; } function isTruthy(value) { return !!value; } function throwError(message) { throw new Error(message); } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName][_DYN_APPLY ](src, originalArguments); } }; } function proxyAssign(target, source, chkSet) { if (target && source && isObject(target) && isObject(source)) { var _loop_1 = function (field) { if (isString(field)) { var value = source[field]; if (isFunction(value)) { if (!chkSet || chkSet(field, true, source, target)) { target[field] = _createProxyFunction(source, field); } } else if (!chkSet || chkSet(field, false, source, target)) { if (hasOwnProperty(target, field)) { delete target[field]; } if (!objDefineAccessors(target, field, function () { return source[field]; }, function (theValue) { source[field] = theValue; })) { target[field] = value; } } } }; for (var field in source) { _loop_1(field); } } return target; } function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } function proxyFunctions(target, source, functionsToProxy, overwriteTarget) { if (target && source && isObject(target) && isArray(functionsToProxy)) { arrForEach(functionsToProxy, function (theFuncName) { if (isString(theFuncName)) { proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget); } }); } return target; } function createClassFromInterface(defaults) { return /** @class */ (function () { function class_1() { var _this_1 = this; if (defaults) { objForEachKey(defaults, function (field, value) { _this_1[field] = value; }); } } return class_1; }()); } function optimizeObject(theObject) { if (theObject && ObjAssign) { theObject = ObjClass(ObjAssign({}, theObject)); } return theObject; } function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs[_DYN_LENGTH$5 ]; var deep = false; var idx = 1; if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } if (!isObject(extended)) { extended = {}; } for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty[_DYN_CALL ](arg, prop))); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { clone = []; } } else if (!isPlainObject(clone)) { clone = {}; } newValue = objExtend(deep, clone, newValue); } if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } function createEnumStyle(values) { var enumClass = {}; objForEachKey(values, function (field, value) { enumClass[field] = value; enumClass[value] = field; }); return deepFreeze(enumClass); } function createValueMap(values) { var mapClass = {}; objForEachKey(values, function (field, value) { mapClass[field] = value[1]; mapClass[value[0]] = value[1]; }); return deepFreeze(mapClass); } /*! * Microsoft Dynamic Proto Utility, 1.1.9 * Copyright (c) Microsoft and contributors. All rights reserved. */ var _a$3; var UNDEFINED = "undefined"; var Constructor = 'constructor'; var Prototype = 'prototype'; var strFunction = 'function'; var DynInstFuncTable = '_dynInstFuncs'; var DynProxyTag = '_isDynProxy'; var DynClassName = '_dynClass'; var DynClassNamePrefix = '_dynCls$'; var DynInstChkTag = '_dynInstChk'; var DynAllowInstChkTag = DynInstChkTag; var DynProtoDefaultOptions = '_dfOpts'; var UnknownValue = '_unknown_'; var str__Proto = "__proto__"; var DynProtoBaseProto = "_dyn" + str__Proto; var DynProtoGlobalSettings = "__dynProto$Gbl"; var DynProtoCurrent = "_dynInstProto"; var strUseBaseInst = 'useBaseInst'; var strSetInstFuncs = 'setInstFuncs'; var Obj = Object; var _objGetPrototypeOf = Obj["getPrototypeOf"]; var _objGetOwnProps = Obj["getOwnPropertyNames"]; function _getGlobal() { var result; if (typeof globalThis !== UNDEFINED) { result = globalThis; } if (!result && typeof self !== UNDEFINED) { result = self; } if (!result && typeof window !== UNDEFINED) { result = window; } if (!result && typeof global !== UNDEFINED) { result = global; } return result || {}; } var _gbl = _getGlobal(); var _gblInst = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = { o: (_a$3 = {}, _a$3[strSetInstFuncs] = true, _a$3[strUseBaseInst] = true, _a$3), n: 1000 }); function _hasOwnProperty(obj, prop) { return obj && Obj[Prototype].hasOwnProperty.call(obj, prop); } function _isObjectOrArrayPrototype(target) { return target && (target === Obj[Prototype] || target === Array[Prototype]); } function _isObjectArrayOrFunctionPrototype(target) { return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; } function _getObjProto(target) { var newProto; if (target) { if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); newProto = target[DynProtoBaseProto] || curProto; if (!_hasOwnProperty(target, DynProtoBaseProto)) { delete target[DynProtoCurrent]; newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; target[DynProtoCurrent] = curProto; } } return newProto; } function _forEachProp(target, func) { var props = []; if (_objGetOwnProps) { props = _objGetOwnProps(target); } else { for (var name_1 in target) { if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) { props.push(name_1); } } } if (props && props.length > 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } function _getInstanceFuncs(thisTarget) { var instFuncs = {}; _forEachProp(thisTarget, function (name) { if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { instFuncs[name] = thisTarget[name]; } }); return instFuncs; } function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { return theFunc.apply(target, arguments); }; } var baseFuncs = {}; _forEachProp(instFuncs, function (name) { baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); var baseProto = _getObjProto(classProto); var visited = []; while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { _forEachProp(baseProto, function (name) { if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { _throwTypeError("Missing [" + funcName + "] " + strFunction); } if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { var canAddInst = !_hasOwnProperty(target, funcName); var objProto = _getObjProto(target); var visited = []; while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { target[funcName] = instFunc; } instFunc[DynInstChkTag] = 1; } catch (e) { instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; if (protoFunc === currentDynProtoProxy) { protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); return instFunc.apply(this, arguments); }; dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { instFuncs_1[name] = target[name]; delete target[name]; if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } function _checkPrototype(classProto, thisTarget) { if (_objGetPrototypeOf) { var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } return true; } function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } function dynamicProto(theClass, target, delegateFunc, options) { if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] not in hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { className = classProto[DynClassName]; } else { className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _gblInst.n; _gblInst.n++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } var instFuncs = _getInstanceFuncs(target); var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); delegateFunc(target, baseFuncs); var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } dynamicProto[DynProtoDefaultOptions] = _gblInst.o; var strWindow = "window"; var strDocument = "document"; var strDocumentMode = "documentMode"; var strNavigator = "navigator"; var strHistory = "history"; var strLocation = "location"; var strConsole = "console"; var strPerformance = "performance"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { } } } return supported; } function getGlobalInst(name) { var gbl = getGlobal(); if (gbl && gbl[name]) { return gbl[name]; } if (name === strWindow && hasWindow()) { return window; } return null; } function hasWindow() { return Boolean(typeof window === strShimObject && window); } function getWindow() { if (hasWindow()) { return window; } return getGlobalInst(strWindow); } function hasDocument() { return Boolean(typeof document === strShimObject && document); } function getDocument() { if (hasDocument()) { return document; } return getGlobalInst(strDocument); } function hasNavigator() { return Boolean(typeof navigator === strShimObject && navigator); } function getNavigator() { if (hasNavigator()) { return navigator; } return getGlobalInst(strNavigator); } function hasHistory() { return Boolean(typeof history === strShimObject && history); } function getHistory() { if (hasHistory()) { return history; } return getGlobalInst(strHistory); } function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getGlobalInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getGlobalInst(strLocation); } function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getGlobalInst(strConsole); } function getPerformance() { return getGlobalInst(strPerformance); } function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null); } function getJSON() { if (hasJSON()) { return JSON || getGlobalInst(strJSON); } return null; } function getCrypto() { return getGlobalInst(strCrypto); } function getMsCrypto() { return getGlobalInst(strMsCrypto); } function isReactNative() { var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } function isIE() { var nav = getNavigator(); if (nav && (nav[_DYN_USER_AGENT ] !== _navUserAgentCheck || _isTrident === null)) { _navUserAgentCheck = nav[_DYN_USER_AGENT ]; var userAgent = (_navUserAgentCheck || STR_EMPTY)[_DYN_TO_LOWER_CASE$2 ](); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } function getIEVersion(userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } if (!userAgentStr) { var navigator_1 = getNavigator() || {}; userAgentStr = navigator_1 ? (navigator_1[_DYN_USER_AGENT ] || STR_EMPTY)[_DYN_TO_LOWER_CASE$2 ]() : STR_EMPTY; } var ua = (userAgentStr || STR_EMPTY)[_DYN_TO_LOWER_CASE$2 ](); if (strContains(ua, strMsie)) { var doc = getDocument() || {}; return Math.max(parseInt(ua[_DYN_SPLIT$1 ](strMsie)[1]), (doc[strDocumentMode] || 0)); } else if (strContains(ua, strTrident)) { var tridentVer = parseInt(ua[_DYN_SPLIT$1 ](strTrident)[1]); if (tridentVer) { return tridentVer + 4; } } return null; } function dumpObj(object) { var objectTypeDump = Object[strShimPrototype].toString[_DYN_CALL ](object); var propertyValueDump = STR_EMPTY; if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object[_DYN_NAME$3 ] + "'"; } else if (hasJSON()) { propertyValueDump = getJSON().stringify(object); } return objectTypeDump + propertyValueDump; } function isBeaconsSupported() { if (_beaconsSupported === null) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getGlobalInst("fetch"); var request = getGlobalInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { } return isSupported; } function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getGlobalInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { } return isSupported; } function _getNamedValue(values, name) { if (values) { for (var i = 0; i < values[_DYN_LENGTH$5 ]; i++) { var value = values[i]; if (value[_DYN_NAME$3 ]) { if (value[_DYN_NAME$3 ] === name) { return value; } } } } return {}; } function findMetaTag(name) { var doc = getDocument(); if (doc && name) { return _getNamedValue(doc.querySelectorAll("meta"), name).content; } return null; } function findNamedServerTiming(name) { var value; var perf = getPerformance(); if (perf) { var navPerf = perf.getEntriesByType("navigation") || []; value = _getNamedValue((navPerf[_DYN_LENGTH$5 ] > 0 ? navPerf[0] : {}).serverTiming, name).description; } return value; } var listenerFuncs = ["eventsSent", "eventsDiscarded", "eventsSendRequest", "perfEvent"]; var _aiNamespace = null; var _debugListener; function _listenerProxyFunc(name, config) { return function () { var args = arguments; var dbgExt = getDebugExt(config); if (dbgExt) { var listener = dbgExt.listener; if (listener && listener[name]) { listener[name][_DYN_APPLY ](listener, args); } } }; } function _getExtensionNamespace() { var target = getGlobalInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } function getDebugListener(config) { if (!_debugListener) { _debugListener = {}; for (var lp = 0; lp < listenerFuncs[_DYN_LENGTH$5 ]; lp++) { _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config); } } return _debugListener; } var AiNonUserActionablePrefix = "AI (Internal): "; var AiUserActionablePrefix = "AI: "; var AIInternalMessagePrefix = "AITR_"; function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY) + "\""; } return STR_EMPTY; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self[_DYN_MESSAGE_ID ] = msgId; _self[_DYN_MESSAGE$2 ] = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = STR_EMPTY; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY); _self[_DYN_MESSAGE$2 ] += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); function safeGetLogger(core, config) { return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; this.queue = []; var _messageCount = 0; var _messageLogged = {}; var _loggingLevelConsole; var _loggingLevelTelemetry; var _maxInternalMessageLimit; var _enableDebug; dynamicProto(DiagnosticLogger, this, function (_self) { _setDefaultsFromConfig(config || {}); _self.consoleLoggingLevel = function () { return _loggingLevelConsole; }; _self.telemetryLoggingLevel = function () { return _loggingLevelTelemetry; }; _self.maxInternalMessageLimit = function () { return _maxInternalMessageLimit; }; _self[_DYN_ENABLE_DEBUG_EXCEPTI4 ] = function () { return _enableDebug; }; _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_enableDebug) { throw dumpObj(message); } else { var logFunc = severity === 1 ? STR_ERROR_TO_CONSOLE : STR_WARN_TO_CONSOLE; if (!isUndefined(message[_DYN_MESSAGE$2 ])) { if (isUserAct) { var messageKey = +message[_DYN_MESSAGE_ID ]; if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) { _self[logFunc](message[_DYN_MESSAGE$2 ]); _messageLogged[messageKey] = true; } } else { if (_loggingLevelConsole >= severity) { _self[logFunc](message[_DYN_MESSAGE$2 ]); } } _logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message); } } }; _self[STR_WARN_TO_CONSOLE ] = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; _self[STR_ERROR_TO_CONSOLE ] = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; _self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage; function _logInternalMessage(severity, message) { if (_areInternalMessagesThrottled()) { return; } var logMessage = true; var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID ]; if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { if (severity <= _loggingLevelTelemetry) { _self.queue[_DYN_PUSH$2 ](message); _messageCount++; _debugExtMsg((severity === 1 ? "error" : "warn"), message); } if (_messageCount === _maxInternalMessageLimit) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false); _self.queue[_DYN_PUSH$2 ](throttleMessage); if (severity === 1 ) { _self[STR_ERROR_TO_CONSOLE ](throttleLimitMessage); } else { _self[STR_WARN_TO_CONSOLE ](throttleLimitMessage); } } } } function _setDefaultsFromConfig(config) { _loggingLevelConsole = getCfgValue(config.loggingLevelConsole, 0); _loggingLevelTelemetry = getCfgValue(config.loggingLevelTelemetry, 1); _maxInternalMessageLimit = getCfgValue(config.maxMessageLimit, 25); _enableDebug = getCfgValue(config.enableDebug, getCfgValue(config[_DYN_ENABLE_DEBUG_EXCEPTI4 ], false)); } function _areInternalMessagesThrottled() { return _messageCount >= _maxInternalMessageLimit; } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config || {}); if (dbgExt && dbgExt[_DYN_DIAG_LOG$2 ]) { dbgExt[_DYN_DIAG_LOG$2 ](name, data); } } }); } DiagnosticLogger.__ieDyn=1; return DiagnosticLogger; }()); function _getLogger(logger) { return (logger || new DiagnosticLogger()); } function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } _getLogger(logger).throwInternal(severity, msgId, msg, properties, isUserAct); } function _warnToConsole(logger, message) { _getLogger(logger)[STR_WARN_TO_CONSOLE ](message); } function _logInternalMessage(logger, severity, message) { _getLogger(logger)[_DYN_LOG_INTERNAL_MESSAGE ](severity, message); } var strExecutionContextKey = "ctx"; var strParentContextKey = "ParentContextKey"; var strChildrenContextKey = "ChildrenContextKey"; var _defaultPerfManager = null; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; var accessorDefined = false; _self.start = dateNow(); _self[_DYN_NAME$3 ] = name; _self[_DYN_IS_ASYNC ] = isAsync; _self[_DYN_IS_CHILD_EVT ] = function () { return false; }; if (isFunction(payloadDetails)) { var theDetails_1; accessorDefined = objDefineAccessors(_self, "payload", function () { if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); payloadDetails = null; } return theDetails_1; }); } _self[_DYN_GET_CTX ] = function (key) { if (key) { if (key === PerfEvent[strParentContextKey] || key === PerfEvent[strChildrenContextKey]) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self[_DYN_SET_CTX ] = function (key, value) { if (key) { if (key === PerfEvent[strParentContextKey]) { if (!_self[key]) { _self[_DYN_IS_CHILD_EVT ] = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent[strChildrenContextKey]) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self[_DYN_COMPLETE ] = function () { var childTime = 0; var childEvts = _self[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts[_DYN_LENGTH$5 ]; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt[_DYN_TIME ]; } } } _self[_DYN_TIME ] = dateNow() - _self.start; _self.exTime = _self[_DYN_TIME ] - childTime; _self[_DYN_COMPLETE ] = function () { }; if (!accessorDefined && isFunction(payloadDetails)) { _self.payload = payloadDetails(); } }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); var PerfManager = /** @class */ (function () { function PerfManager(manager) { this.ctx = {}; dynamicProto(PerfManager, this, function (_self) { _self.create = function (src, payloadDetails, isAsync) { return new PerfEvent(src, payloadDetails, isAsync); }; _self.fire = function (perfEvent) { if (perfEvent) { perfEvent[_DYN_COMPLETE ](); if (manager && isFunction(manager[STR_PERF_EVENT ])) { manager[STR_PERF_EVENT ](perfEvent); } } }; _self[_DYN_SET_CTX ] = function (key, value) { if (key) { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } }; _self[_DYN_GET_CTX ] = function (key) { return (_self[strExecutionContextKey] || {})[key]; }; }); } PerfManager.__ieDyn=1; return PerfManager; }()); var doPerfActiveKey = "CoreUtils.doPerf"; function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (perfMgr[STR_GET_PERF_MGR]) { perfMgr = perfMgr[STR_GET_PERF_MGR](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr[_DYN_GET_CTX ](doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt[_DYN_SET_CTX ]) { perfEvt[_DYN_SET_CTX ](PerfEvent[strParentContextKey], currentActive); if (currentActive[_DYN_GET_CTX ] && currentActive[_DYN_SET_CTX ]) { var children = currentActive[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]); if (!children) { children = []; currentActive[_DYN_SET_CTX ](PerfEvent[strChildrenContextKey], children); } children[_DYN_PUSH$2 ](perfEvt); } } perfMgr[_DYN_SET_CTX ](doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt[_DYN_SET_CTX ]) { perfEvt[_DYN_SET_CTX ]("exception", ex); } } finally { if (perfEvt) { perfMgr.fire(perfEvt); } perfMgr[_DYN_SET_CTX ](doPerfActiveKey, currentActive); } } } return func(); } function getGblPerfMgr() { return _defaultPerfManager; } var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; var _mwcSeeded = false; var _mwcW = 123456789; var _mwcZ = 987654321; function _mwcSeed(seedValue) { if (seedValue < 0) { seedValue >>>= 0; } _mwcW = (123456789 + seedValue) & MaxUInt32; _mwcZ = (987654321 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { try { var now = dateNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { } } function randomValue(maxValue) { if (maxValue > 0) { return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0; } return 0; } function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { if (!_mwcSeeded) { _autoSeedMwc(); } value = mwcRandom32() & MaxUInt32; } if (value === 0) { value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { value >>>= 0; } return value; } function mwcRandomSeed(value) { if (!value) { _autoSeedMwc(); } else { _mwcSeed(value); } } function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { value >>>= 0; } return value; } function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var number = random32() >>> 0; var chars = 0; var result = STR_EMPTY; while (result[_DYN_LENGTH$5 ] < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; if (chars === 5) { number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; } } return result; } var _objDefineProperty = ObjDefineProperty; var version = '2.8.14'; var instanceName = "." + newId(6); var _dataUid = 0; function _createAccessor(target, prop, value) { if (_objDefineProperty) { try { _objDefineProperty(target, prop, { value: value, enumerable: false, configurable: true }); return true; } catch (e) { } } return false; } function _canAcceptData(target) { return target[_DYN_NODE_TYPE ] === 1 || target[_DYN_NODE_TYPE ] === 9 || !(+target[_DYN_NODE_TYPE ]); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { if (!_createAccessor(target, data.id, theCache)) { target[data.id] = theCache; } } } catch (e) { } } return theCache; } function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : STR_EMPTY) + instanceName); } function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || STR_EMPTY) + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { } } } }; return data; } var strToGMTString = "toGMTString"; var strToUTCString = "toUTCString"; var strCookie = "cookie"; var strExpires = "expires"; var strEnabled = "enabled"; var strIsCookieUseDisabled = "isCookieUseDisabled"; var strDisableCookiesUsage = "disableCookiesUsage"; var strConfigCookieMgr = "_ckMgr"; var _supportsCookies = null; var _allowUaSameSite = null; var _parsedCookieValue = null; var _doc = getDocument(); var _cookieCache = {}; var _globalCookieConfig = {}; function _gblCookieMgr(config, logger) { var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr]; if (!inst) { inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger); _globalCookieConfig[strConfigCookieMgr] = inst; } return inst; } function _isMgrEnabled(cookieMgr) { if (cookieMgr) { return cookieMgr.isEnabled(); } return true; } function _createCookieMgrConfig(rootConfig) { var cookieMgrCfg = rootConfig[_DYN_COOKIE_CFG ] = rootConfig[_DYN_COOKIE_CFG ] || {}; setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined); setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined); if (isNullOrUndefined(cookieMgrCfg[strEnabled])) { var cookieEnabled = void 0; if (!isUndefined(rootConfig[strIsCookieUseDisabled])) { cookieEnabled = !rootConfig[strIsCookieUseDisabled]; } if (!isUndefined(rootConfig[strDisableCookiesUsage])) { cookieEnabled = !rootConfig[strDisableCookiesUsage]; } cookieMgrCfg[strEnabled] = cookieEnabled; } return cookieMgrCfg; } function _isIgnoredCookie(cookieMgrCfg, name) { if (name && cookieMgrCfg && isArray(cookieMgrCfg.ignoreCookies)) { return cookieMgrCfg.ignoreCookies[_DYN_INDEX_OF$2 ](name) !== -1; } return false; } function _isBlockedCookie(cookieMgrCfg, name) { if (name && cookieMgrCfg && isArray(cookieMgrCfg.blockedCookies)) { if (cookieMgrCfg.blockedCookies[_DYN_INDEX_OF$2 ](name) !== -1) { return true; } } return _isIgnoredCookie(cookieMgrCfg, name); } function safeGetCookieMgr(core, config) { var cookieMgr; if (core) { cookieMgr = core.getCookieMgr(); } else if (config) { var cookieCfg = config[_DYN_COOKIE_CFG ]; if (cookieCfg[strConfigCookieMgr]) { cookieMgr = cookieCfg[strConfigCookieMgr]; } else { cookieMgr = createCookieMgr(config); } } if (!cookieMgr) { cookieMgr = _gblCookieMgr(config, (core || {})[_DYN_LOGGER ]); } return cookieMgr; } function createCookieMgr(rootConfig, logger) { var _a; var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig); var _path = cookieMgrConfig.path || "/"; var _domain = cookieMgrConfig.domain; var _enabled = cookieMgrConfig[strEnabled] !== false; var cookieMgr = (_a = { isEnabled: function () { var enabled = _enabled && areCookiesSupported(logger); var gblManager = _globalCookieConfig[strConfigCookieMgr]; if (enabled && gblManager && cookieMgr !== gblManager) { enabled = _isMgrEnabled(gblManager); } return enabled; } }, _a[_DYN_SET_ENABLED ] = function (value) { _enabled = value !== false; }, _a.set = function (name, value, maxAgeSec, domain, path) { var result = false; if (_isMgrEnabled(cookieMgr) && !_isBlockedCookie(cookieMgrConfig, name)) { var values = {}; var theValue = strTrim(value || STR_EMPTY); var idx = theValue[_DYN_INDEX_OF$2 ](";"); if (idx !== -1) { theValue = strTrim(value[_DYN_SUBSTRING$1 ](0, idx)); values = _extractParts(value[_DYN_SUBSTRING$1 ](idx + 1)); } setValue(values, "domain", domain || _domain, isTruthy, isUndefined); if (!isNullOrUndefined(maxAgeSec)) { var _isIE = isIE(); if (isUndefined(values[strExpires])) { var nowMs = dateNow(); var expireMs = nowMs + (maxAgeSec * 1000); if (expireMs > 0) { var expiry = new Date(); expiry.setTime(expireMs); setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy); } } if (!_isIE) { setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined); } } var location_1 = getLocation(); if (location_1 && location_1.protocol === "https:") { setValue(values, "secure", null, null, isUndefined); if (_allowUaSameSite === null) { _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]); } if (_allowUaSameSite) { setValue(values, "SameSite", "None", null, isUndefined); } } setValue(values, "path", path || _path, null, isUndefined); var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue; setCookieFn(name, _formatCookieValue(theValue, values)); result = true; } return result; }, _a.get = function (name) { var value = STR_EMPTY; if (_isMgrEnabled(cookieMgr) && !_isIgnoredCookie(cookieMgrConfig, name)) { value = (cookieMgrConfig.getCookie || _getCookieValue)(name); } return value; }, _a.del = function (name, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { result = cookieMgr.purge(name, path); } return result; }, _a.purge = function (name, path) { var _a; var result = false; if (areCookiesSupported(logger)) { var values = (_a = {}, _a["path"] = path ? path : "/", _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT", _a); if (!isIE()) { values["max-age"] = "0"; } var delCookie = cookieMgrConfig.delCookie || _setCookieValue; delCookie(name, _formatCookieValue(STR_EMPTY, values)); result = true; } return result; }, _a); cookieMgr[strConfigCookieMgr] = cookieMgr; return cookieMgr; } function areCookiesSupported(logger) { if (_supportsCookies === null) { _supportsCookies = false; try { var doc = _doc || {}; _supportsCookies = doc[strCookie] !== undefined; } catch (e) { _throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) }); } } return _supportsCookies; } function _extractParts(theValue) { var values = {}; if (theValue && theValue[_DYN_LENGTH$5 ]) { var parts = strTrim(theValue)[_DYN_SPLIT$1 ](";"); arrForEach(parts, function (thePart) { thePart = strTrim(thePart || STR_EMPTY); if (thePart) { var idx = thePart[_DYN_INDEX_OF$2 ]("="); if (idx === -1) { values[thePart] = null; } else { values[strTrim(thePart[_DYN_SUBSTRING$1 ](0, idx))] = strTrim(thePart[_DYN_SUBSTRING$1 ](idx + 1)); } } }); } return values; } function _formatDate(theDate, func) { if (isFunction(theDate[func])) { return theDate[func](); } return null; } function _formatCookieValue(value, values) { var cookieValue = value || STR_EMPTY; objForEachKey(values, function (name, theValue) { cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : STR_EMPTY); }); return cookieValue; } function _getCookieValue(name) { var cookieValue = STR_EMPTY; if (_doc) { var theCookie = _doc[strCookie] || STR_EMPTY; if (_parsedCookieValue !== theCookie) { _cookieCache = _extractParts(theCookie); _parsedCookieValue = theCookie; } cookieValue = strTrim(_cookieCache[name] || STR_EMPTY); } return cookieValue; } function _setCookieValue(name, cookieValue) { if (_doc) { _doc[strCookie] = name + "=" + cookieValue; } } function uaDisallowsSameSiteNone(userAgent) { if (!isString(userAgent)) { return false; } if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) { return true; } if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) { return true; } if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) { return true; } if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) { return true; } return false; } var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name[_DYN_REPLACE ]) { return name[_DYN_REPLACE ](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g, STR_EMPTY); } return name; } function _getEvtNamespace(eventName, evtNamespace) { var _a; if (evtNamespace) { var theNamespace_1 = STR_EMPTY; if (isArray(evtNamespace)) { theNamespace_1 = STR_EMPTY; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } eventName = (eventName || STR_EMPTY) + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY) || []); return _a = {}, _a[_DYN_TYPE ] = parsedEvent[1], _a.ns = ((parsedEvent[2] || STR_EMPTY).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY)[_DYN_SPLIT$1 ](".").sort()).join("."), _a; } function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName[_DYN_TYPE ]) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName[_DYN_TYPE ], handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName[_DYN_TYPE ] && handlerRef) { if (obj[strAddEventHelper]) { obj[strAddEventHelper](evtName[_DYN_TYPE ], handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { obj[strAttachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events[_DYN_LENGTH$5 ]; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent[_DYN_HANDLER ], theEvent.capture); events[_DYN_SPLICE ](idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName[_DYN_TYPE ]) { _doUnregister(target, _getRegisteredEvents(target, evtName[_DYN_TYPE ]), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); if (objKeys(eventCache)[_DYN_LENGTH$5 ] === 0) { elmNodeData.kill(target, strEvents); } } } function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns)[_DYN_SPLIT$1 ]("."); } else { newNamespaces = theNamespace; } return newNamespaces; } function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { var _a; if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = (_a = { guid: _guid++, evtName: evtName }, _a[_DYN_HANDLER ] = handlerRef, _a.capture = useCapture, _a); _getRegisteredEvents(target, evtName.type)[_DYN_PUSH$2 ](registeredEvent); } } catch (e) { } } return result; } function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent[_DYN_HANDLER ] === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { } } } function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture); } function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events[_DYN_LENGTH$5 ] > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents[_DYN_LENGTH$5 ] > 0) { added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } function removePageHideEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } var _cookieMgrs = null; var _canUseCookies; function newGuid() { var uuid = generateW3CId(); return uuid[_DYN_SUBSTRING$1 ](0, 8) + "-" + uuid[_DYN_SUBSTRING$1 ](8, 12) + "-" + uuid[_DYN_SUBSTRING$1 ](12, 16) + "-" + uuid[_DYN_SUBSTRING$1 ](16, 20) + "-" + uuid[_DYN_SUBSTRING$1 ](20); } function perfNow() { var perf = getPerformance(); if (perf && perf.now) { return perf.now(); } return dateNow(); } function generateW3CId() { var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; var oct = STR_EMPTY, tmp; for (var a = 0; a < 4; a++) { tmp = random32(); oct += hexValues[tmp & 0xF] + hexValues[tmp >> 4 & 0xF] + hexValues[tmp >> 8 & 0xF] + hexValues[tmp >> 12 & 0xF] + hexValues[tmp >> 16 & 0xF] + hexValues[tmp >> 20 & 0xF] + hexValues[tmp >> 24 & 0xF] + hexValues[tmp >> 28 & 0xF]; } var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0]; return oct[_DYN_SUBSTR ](0, 8) + oct[_DYN_SUBSTR ](9, 4) + "4" + oct[_DYN_SUBSTR ](13, 3) + clockSequenceHi + oct[_DYN_SUBSTR ](16, 3) + oct[_DYN_SUBSTR ](19, 12); } var CoreUtils = { _canUseCookies: undefined, isTypeof: isTypeof, isUndefined: isUndefined, isNullOrUndefined: isNullOrUndefined, hasOwnProperty: hasOwnProperty, isFunction: isFunction, isObject: isObject, isDate: isDate, isArray: isArray, isError: isError, isString: isString, isNumber: isNumber, isBoolean: isBoolean, toISOString: toISOString, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, strTrim: strTrim, objCreate: objCreateFn, objKeys: objKeys, objDefineAccessors: objDefineAccessors, addEventHandler: addEventHandler, dateNow: dateNow, isIE: isIE, disableCookies: disableCookies, newGuid: newGuid, perfNow: perfNow, newId: newId, randomValue: randomValue, random32: random32, mwcRandomSeed: mwcRandomSeed, mwcRandom32: mwcRandom32, generateW3CId: generateW3CId }; function _legacyCookieMgr(config, logger) { var cookieMgr = _gblCookieMgr(config, logger); var legacyCanUseCookies = CoreUtils._canUseCookies; if (_cookieMgrs === null) { _cookieMgrs = []; _canUseCookies = legacyCanUseCookies; objDefineAccessors(CoreUtils, "_canUseCookies", function () { return _canUseCookies; }, function (value) { _canUseCookies = value; arrForEach(_cookieMgrs, function (mgr) { mgr[_DYN_SET_ENABLED ](value); }); }); } if (arrIndexOf(_cookieMgrs, cookieMgr) === -1) { _cookieMgrs[_DYN_PUSH$2 ](cookieMgr); } if (isBoolean(legacyCanUseCookies)) { cookieMgr[_DYN_SET_ENABLED ](legacyCanUseCookies); } if (isBoolean(_canUseCookies)) { cookieMgr[_DYN_SET_ENABLED ](_canUseCookies); } return cookieMgr; } function disableCookies() { _legacyCookieMgr()[_DYN_SET_ENABLED ](false); } function canUseCookies(logger) { return _legacyCookieMgr(null, logger).isEnabled(); } function getCookie(logger, name) { return _legacyCookieMgr(null, logger).get(name); } function setCookie(logger, name, value, domain) { _legacyCookieMgr(null, logger).set(name, value, null, domain); } function deleteCookie(logger, name) { return _legacyCookieMgr(null, logger).del(name); } var TRACE_PARENT_REGEX = /^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})(-[^\s]*)?$/; var DEFAULT_VERSION = "00"; var INVALID_VERSION = "ff"; var INVALID_TRACE_ID = "00000000000000000000000000000000"; var INVALID_SPAN_ID = "0000000000000000"; function _isValid(value, len, invalidValue) { if (value && value[_DYN_LENGTH$5 ] === len && value !== invalidValue) { return !!value.match(/^[\da-f]*$/); } return false; } function _formatValue(value, len, defValue) { if (_isValid(value, len)) { return value; } return defValue; } function _formatFlags(value) { if (isNaN(value) || value < 0 || value > 255) { value = 0x01; } var result = value.toString(16); while (result[_DYN_LENGTH$5 ] < 2) { result = "0" + result; } return result; } function createTraceParent(traceId, spanId, flags, version) { var _a; return _a = {}, _a[_DYN_VERSION$1 ] = _isValid(version, 2, INVALID_VERSION) ? version : DEFAULT_VERSION, _a[_DYN_TRACE_ID$2 ] = isValidTraceId(traceId) ? traceId : generateW3CId(), _a.spanId = isValidSpanId(spanId) ? spanId : generateW3CId()[_DYN_SUBSTR ](0, 16), _a.traceFlags = flags >= 0 && flags <= 0xFF ? flags : 1, _a; } function parseTraceParent(value) { var _a; if (!value) { return null; } if (isArray(value)) { value = value[0] || ""; } if (!value || !isString(value) || value[_DYN_LENGTH$5 ] > 8192) { return null; } var match = TRACE_PARENT_REGEX.exec(strTrim(value)); if (!match || match[1] === INVALID_VERSION || match[2] === INVALID_TRACE_ID || match[3] === INVALID_SPAN_ID) { return null; } return _a = {}, _a[_DYN_VERSION$1 ] = match[1], _a[_DYN_TRACE_ID$2 ] = match[2], _a[_DYN_SPAN_ID$1 ] = match[3], _a[_DYN_TRACE_FLAGS$1 ] = parseInt(match[4], 16), _a; } function isValidTraceId(value) { return _isValid(value, 32, INVALID_TRACE_ID); } function isValidSpanId(value) { return _isValid(value, 16, INVALID_SPAN_ID); } function formatTraceParent(value) { if (value) { var flags = _formatFlags(value[_DYN_TRACE_FLAGS$1 ]); if (!_isValid(flags, 2)) { flags = "01"; } var version = value[_DYN_VERSION$1 ] || DEFAULT_VERSION; if (version !== "00" && version !== "ff") { version = DEFAULT_VERSION; } return "".concat(version, "-").concat(_formatValue(value.traceId, 32, INVALID_TRACE_ID), "-").concat(_formatValue(value.spanId, 16, INVALID_SPAN_ID), "-").concat(flags); } return ""; } function findW3cTraceParent() { var name = "traceparent"; var traceParent = parseTraceParent(findMetaTag(name)); if (!traceParent) { traceParent = parseTraceParent(findNamedServerTiming(name)); } return traceParent; } var pluginStateData = createElmNodeData("plugin"); function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } function initializePlugins(processContext, extensions) { var initPlugins = []; var lastPlugin = null; var proxy = processContext[_DYN_GET_NEXT ](); var pluginState; while (proxy) { var thePlugin = proxy[_DYN_GET_PLUGIN ](); if (thePlugin) { if (lastPlugin && isFunction(lastPlugin[_DYN_SET_NEXT_PLUGIN ]) && isFunction(thePlugin[STR_PROCESS_TELEMETRY ])) { lastPlugin[_DYN_SET_NEXT_PLUGIN ](thePlugin); } var isInitialized = false; if (isFunction(thePlugin[_DYN_IS_INITIALIZED ])) { isInitialized = thePlugin[_DYN_IS_INITIALIZED ](); } else { pluginState = _getPluginState(thePlugin); isInitialized = pluginState[_DYN_IS_INITIALIZED ]; } if (!isInitialized) { initPlugins[_DYN_PUSH$2 ](thePlugin); } lastPlugin = thePlugin; proxy = proxy[_DYN_GET_NEXT ](); } } arrForEach(initPlugins, function (thePlugin) { var core = processContext[STR_CORE](); thePlugin[_DYN_INITIALIZE ](processContext.getCfg(), core, extensions, processContext[_DYN_GET_NEXT ]()); pluginState = _getPluginState(thePlugin); if (!thePlugin[STR_CORE] && !pluginState[STR_CORE]) { pluginState[STR_CORE] = core; } pluginState[_DYN_IS_INITIALIZED ] = true; delete pluginState[_DYN_TEARDOWN ]; }); } function sortPlugins(plugins) { return plugins.sort(function (extA, extB) { var result = 0; if (extB) { var bHasProcess = isFunction(extB[STR_PROCESS_TELEMETRY]); if (isFunction(extA[STR_PROCESS_TELEMETRY])) { result = bHasProcess ? extA[STR_PRIORITY] - extB[STR_PRIORITY] : 1; } else if (bHasProcess) { result = -1; } } else { result = extA ? 1 : -1; } return result; }); } function createDistributedTraceContext(parentCtx) { var trace = {}; return { getName: function () { return trace[_DYN_NAME$3 ]; }, setName: function (newValue) { parentCtx && parentCtx.setName(newValue); trace[_DYN_NAME$3 ] = newValue; }, getTraceId: function () { return trace[_DYN_TRACE_ID$2 ]; }, setTraceId: function (newValue) { parentCtx && parentCtx.setTraceId(newValue); if (isValidTraceId(newValue)) { trace[_DYN_TRACE_ID$2 ] = newValue; } }, getSpanId: function () { return trace[_DYN_SPAN_ID$1 ]; }, setSpanId: function (newValue) { parentCtx && parentCtx.setSpanId(newValue); if (isValidSpanId(newValue)) { trace[_DYN_SPAN_ID$1 ] = newValue; } }, getTraceFlags: function () { return trace[_DYN_TRACE_FLAGS$1 ]; }, setTraceFlags: function (newTraceFlags) { parentCtx && parentCtx.setTraceFlags(newTraceFlags); trace[_DYN_TRACE_FLAGS$1 ] = newTraceFlags; } }; } var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy[_DYN_GET_PLUGIN ]() === startAt) { return proxy; } proxy = proxy[_DYN_GET_NEXT ](); } return createTelemetryProxyChain([startAt], core[_DYN_CONFIG$2 ] || {}, core); } function _createInternalContext(telemetryChain, config, core, startAt) { var _nextProxy = null; var _onComplete = []; if (startAt !== null) { _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, config); }, getCfg: function () { return config; }, getExtCfg: _getExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete[_DYN_PUSH$2 ]({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; _nextProxy = nextProxy ? nextProxy[_DYN_GET_NEXT ]() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete[_DYN_LENGTH$5 ] > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func[_DYN_CALL ](completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core[_DYN_LOGGER ], 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, defaultValue, mergeDefault) { if (defaultValue === void 0) { defaultValue = {}; } if (mergeDefault === void 0) { mergeDefault = 0 ; } var theConfig; if (config) { var extConfig = config[STR_EXTENSION_CONFIG ]; if (extConfig && identifier) { theConfig = extConfig[identifier]; } } if (!theConfig) { theConfig = defaultValue; } else if (isObject(defaultValue)) { if (mergeDefault !== 0 ) { var newConfig_1 = objExtend(true, defaultValue, theConfig); if (config && mergeDefault === 2 ) { objForEachKey(defaultValue, function (field) { if (isNullOrUndefined(newConfig_1[field])) { var cfgValue = config[field]; if (!isNullOrUndefined(cfgValue)) { newConfig_1[field] = cfgValue; } } }); } theConfig = newConfig_1; } } return theConfig; } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, null); if (extConfig && !isNullOrUndefined(extConfig[field])) { theValue = extConfig[field]; } else if (config && !isNullOrUndefined(config[field])) { theValue = config[field]; } return !isNullOrUndefined(theValue) ? theValue : defaultValue; } function _iterateChain(cb) { var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin[_DYN_GET_PLUGIN ](); if (plugin) { cb(plugin); } } } return context; } function createProcessTelemetryContext(telemetryChain, config, core, startAt) { var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin[STR_PROCESS_TELEMETRY ](env, context); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryContext(plugins || context[_DYN_GET_NEXT ](), config, core, startAt); } context[_DYN_PROCESS_NEXT ] = _processNext; context[_DYN_CREATE_NEW ] = _createNew; return context; } function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = core[_DYN_CONFIG$2 ] || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.unload(context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context[_DYN_GET_NEXT ](), core, startAt); } context[_DYN_PROCESS_NEXT ] = _processNext; context[_DYN_CREATE_NEW ] = _createNew; return context; } function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = core[_DYN_CONFIG$2 ] || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin[_DYN_UPDATE$1 ])) { plugin[_DYN_UPDATE$1 ](context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context[_DYN_GET_NEXT ](), core, startAt); } context[_DYN_PROCESS_NEXT ] = _processNext; context[_DYN_CREATE_NEW ] = _createNew; return context; } function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins[_DYN_LENGTH$5 ] > 0) { var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin[STR_PROCESS_TELEMETRY ])) { var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin[STR_PROCESS_TELEMETRY ]); var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN ]); var chainId; if (plugin) { chainId = plugin[_DYN_IDENTIFIER ] + "-" + plugin[STR_PRIORITY ] + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; if (plugin && isFunction(plugin[strGetTelCtx])) { itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin[_DYN_IDENTIFIER ] : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { hasRunContext = itemCtx[strHasRunFlags] = {}; } itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[STR_CORE ](), function () { return identifier + ":" + name; }, function () { hasRunContext[chainId] = true; try { var nextId = nextProxy ? nextProxy._id : STR_EMPTY; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { hasRun = true; } if (!nextProxy || !hasNextRun) { _throwInternal(itemCtx[_DYN_DIAG_LOG$2 ](), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState[_DYN_TEARDOWN ] || pluginState[STR_DISABLED]) { return false; } if (hasSetNext) { plugin[_DYN_SET_NEXT_PLUGIN ](nextProxy); } plugin[STR_PROCESS_TELEMETRY ](env, itemCtx); return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { itemCtx[_DYN_PROCESS_NEXT ](env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE ]; if (plugin && (!pluginCore || pluginCore === unloadCtx.core()) && !pluginState[_DYN_TEARDOWN ]) { pluginState[STR_CORE ] = null; pluginState[_DYN_TEARDOWN ] = true; pluginState[_DYN_IS_INITIALIZED ] = false; if (plugin[_DYN_TEARDOWN ] && plugin[_DYN_TEARDOWN ](unloadCtx, unloadState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState[_DYN_IS_ASYNC ])) { unloadCtx[_DYN_PROCESS_NEXT ](unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE ]; if (plugin && (!pluginCore || pluginCore === updateCtx.core()) && !pluginState[_DYN_TEARDOWN ]) { if (plugin[_DYN_UPDATE$1 ] && plugin[_DYN_UPDATE$1 ](updateCtx, updateState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { updateCtx[_DYN_PROCESS_NEXT ](updateState); } } return objFreeze(proxyChain); } var ChannelControllerPriority = 500; var ChannelValidationMessage = "Channel has invalid priority - "; function _addChannelQueue(channelQueue, queue, core) { if (queue && isArray(queue) && queue[_DYN_LENGTH$5 ] > 0) { queue = queue.sort(function (a, b) { return a[STR_PRIORITY ] - b[STR_PRIORITY ]; }); arrForEach(queue, function (queueItem) { if (queueItem[STR_PRIORITY ] < ChannelControllerPriority) { throwError(ChannelValidationMessage + queueItem[_DYN_IDENTIFIER ]); } }); channelQueue[_DYN_PUSH$2 ]({ queue: objFreeze(queue), chain: createTelemetryProxyChain(queue, core[_DYN_CONFIG$2 ], core) }); } } function createChannelControllerPlugin(channelQueue, core) { function _getTelCtx() { return createProcessTelemetryContext(null, core[_DYN_CONFIG$2 ], core, null); } function _processChannelQueue(theChannels, itemCtx, processFn, onComplete) { var waiting = theChannels ? (theChannels[_DYN_LENGTH$5 ] + 1) : 1; function _runChainOnComplete() { waiting--; if (waiting === 0) { onComplete && onComplete(); onComplete = null; } } if (waiting > 0) { arrForEach(theChannels, function (channels) { if (channels && channels.queue[_DYN_LENGTH$5 ] > 0) { var channelChain = channels.chain; var chainCtx = itemCtx[_DYN_CREATE_NEW ](channelChain); chainCtx[_DYN_ON_COMPLETE ](_runChainOnComplete); processFn(chainCtx); } else { waiting--; } }); } _runChainOnComplete(); } function _doUpdate(updateCtx, updateState) { var theUpdateState = updateState || { reason: 0 }; _processChannelQueue(channelQueue, updateCtx, function (chainCtx) { chainCtx[_DYN_PROCESS_NEXT ](theUpdateState); }, function () { updateCtx[_DYN_PROCESS_NEXT ](theUpdateState); }); return true; } function _doTeardown(unloadCtx, unloadState) { var theUnloadState = unloadState || { reason: 0 , isAsync: false }; _processChannelQueue(channelQueue, unloadCtx, function (chainCtx) { chainCtx[_DYN_PROCESS_NEXT ](theUnloadState); }, function () { unloadCtx[_DYN_PROCESS_NEXT ](theUnloadState); isInitialized = false; }); return true; } function _getChannel(pluginIdentifier) { var thePlugin = null; if (channelQueue && channelQueue[_DYN_LENGTH$5 ] > 0) { arrForEach(channelQueue, function (channels) { if (channels && channels.queue[_DYN_LENGTH$5 ] > 0) { arrForEach(channels.queue, function (ext) { if (ext[_DYN_IDENTIFIER ] === pluginIdentifier) { thePlugin = ext; return -1; } }); if (thePlugin) { return -1; } } }); } return thePlugin; } var isInitialized = false; var channelController = { identifier: "ChannelControllerPlugin", priority: ChannelControllerPriority, initialize: function (config, core, extensions, pluginChain) { isInitialized = true; arrForEach(channelQueue, function (channels) { if (channels && channels.queue[_DYN_LENGTH$5 ] > 0) { initializePlugins(createProcessTelemetryContext(channels.chain, config, core), extensions); } }); }, isInitialized: function () { return isInitialized; }, processTelemetry: function (item, itemCtx) { _processChannelQueue(channelQueue, itemCtx || _getTelCtx(), function (chainCtx) { chainCtx[_DYN_PROCESS_NEXT ](item); }, function () { itemCtx[_DYN_PROCESS_NEXT ](item); }); }, update: _doUpdate, pause: function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin.pause && plugin.pause(); }); }, null); }, resume: function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin.resume && plugin.resume(); }); }, null); }, teardown: _doTeardown, getChannel: _getChannel, flush: function (isAsync, callBack, sendReason, cbTimeout) { var waiting = 1; var doneIterating = false; var cbTimer = null; cbTimeout = cbTimeout || 5000; function doCallback() { waiting--; if (doneIterating && waiting === 0) { if (cbTimer) { clearTimeout(cbTimer); cbTimer = null; } callBack && callBack(doneIterating); callBack = null; } } _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { if (plugin[_DYN_FLUSH ]) { waiting++; var handled_1 = false; if (!plugin[_DYN_FLUSH ](isAsync, function () { handled_1 = true; doCallback(); }, sendReason)) { if (!handled_1) { if (isAsync && cbTimer == null) { cbTimer = setTimeout(function () { cbTimer = null; doCallback(); }, cbTimeout); } else { doCallback(); } } } } }); }, function () { doneIterating = true; doCallback(); }); return true; }, _setQueue: function (queue) { channelQueue = queue; } }; return channelController; } function createChannelQueues(channels, extensions, core) { var channelQueue = []; if (channels) { arrForEach(channels, function (queue) { return _addChannelQueue(channelQueue, queue, core); }); } if (extensions) { var extensionQueue_1 = []; arrForEach(extensions, function (plugin) { if (plugin[STR_PRIORITY ] > ChannelControllerPriority) { extensionQueue_1[_DYN_PUSH$2 ](plugin); } }); _addChannelQueue(channelQueue, extensionQueue_1, core); } return channelQueue; } function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers[_DYN_PUSH$2 ](handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx[_DYN_DIAG_LOG$2 ](), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } var strGetPlugin = "getPlugin"; var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; var _isinitialized; var _rootCtx; var _nextPlugin; var _unloadHandlerContainer; var _hooks; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self[_DYN_INITIALIZE ] = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self[_DYN_TEARDOWN ] = function (unloadCtx, unloadState) { var _a; var core = _self[STR_CORE ]; if (!core || (unloadCtx && core !== unloadCtx[STR_CORE ]())) { return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || (_a = { reason: 0 }, _a[_DYN_IS_ASYNC ] = false, _a); function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); var oldHooks = _hooks; _hooks = []; arrForEach(oldHooks, function (fn) { fn.rm(); }); if (result === true) { theUnloadCtx[_DYN_PROCESS_NEXT ](theUnloadState); } _initDefaults(); } } if (!_self[_DYN__DO_TEARDOWN ] || _self[_DYN__DO_TEARDOWN ](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { result = true; } return result; }; _self[_DYN_UPDATE$1 ] = function (updateCtx, updateState) { var core = _self[STR_CORE ]; if (!core || (updateCtx && core !== updateCtx[STR_CORE ]())) { return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx[_DYN_GET_NEXT ]()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; _self._addHook = function (hooks) { if (hooks) { if (isArray(hooks)) { _hooks = _hooks.concat(hooks); } else { _hooks[_DYN_PUSH$2 ](hooks); } } }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); }); _self[_DYN_DIAG_LOG$2 ] = function (itemCtx) { return _getTelCtx(itemCtx)[_DYN_DIAG_LOG$2 ](); }; _self[_DYN_IS_INITIALIZED ] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; _self[_DYN_SET_NEXT_PLUGIN ] = function (next) { _nextPlugin = next; }; _self[_DYN_PROCESS_NEXT ] = function (env, itemCtx) { if (itemCtx) { itemCtx[_DYN_PROCESS_NEXT ](env); } else if (_nextPlugin && isFunction(_nextPlugin[STR_PROCESS_TELEMETRY ])) { _nextPlugin[STR_PROCESS_TELEMETRY ](env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self[STR_CORE ]); if (_nextPlugin && _nextPlugin[strGetPlugin]) { itemCtx = rootCtx[_DYN_CREATE_NEW ](null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx[_DYN_CREATE_NEW ](null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { if (config) { setValue(config, STR_EXTENSION_CONFIG, [], null, isNullOrUndefined); } if (!pluginChain && core) { pluginChain = core[_DYN_GET_PROCESS_TEL_CONT0 ]()[_DYN_GET_NEXT ](); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { nextPlugin = _nextPlugin[strGetPlugin](); } _self[STR_CORE ] = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self[STR_CORE ] = null; _rootCtx = null; _nextPlugin = null; _hooks = []; _unloadHandlerContainer = createUnloadHandlerContainer(); } } BaseTelemetryPlugin.__ieDyn=1; return BaseTelemetryPlugin; }()); var TelemetryInitializerPlugin = /** @class */ (function (_super) { __extendsFn(TelemetryInitializerPlugin, _super); function TelemetryInitializerPlugin() { var _this = _super.call(this) || this; _this.identifier = "TelemetryInitializerPlugin"; _this.priority = 199; var _id; var _initializers; _initDefaults(); dynamicProto(TelemetryInitializerPlugin, _this, function (_self, _base) { _self.addTelemetryInitializer = function (telemetryInitializer) { var theInitializer = { id: _id++, fn: telemetryInitializer }; _initializers[_DYN_PUSH$2 ](theInitializer); var handler = { remove: function () { arrForEach(_initializers, function (initializer, idx) { if (initializer.id === theInitializer.id) { _initializers[_DYN_SPLICE ](idx, 1); return -1; } }); } }; return handler; }; _self[STR_PROCESS_TELEMETRY ] = function (item, itemCtx) { var doNotSendItem = false; var telemetryInitializersCount = _initializers[_DYN_LENGTH$5 ]; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = _initializers[i]; if (telemetryInitializer) { try { if (telemetryInitializer.fn[_DYN_APPLY ](null, [item]) === false) { doNotSendItem = true; break; } } catch (e) { _throwInternal(itemCtx[_DYN_DIAG_LOG$2 ](), 1 , 64 , "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true); } } } if (!doNotSendItem) { _self[_DYN_PROCESS_NEXT ](item, itemCtx); } }; _self[_DYN__DO_TEARDOWN ] = function () { _initDefaults(); }; }); function _initDefaults() { _id = 0; _initializers = []; } return _this; } TelemetryInitializerPlugin.__ieDyn=1; return TelemetryInitializerPlugin; }(BaseTelemetryPlugin)); var strValidationError = "Plugins must provide initialize method"; var strNotificationManager = "_notificationManager"; var strSdkUnloadingError = "SDK is still unloading..."; var strSdkNotInitialized = "SDK is not initialized"; var defaultInitConfig = { loggingLevelConsole: 1 }; function _createPerfManager(core, notificationMgr) { return new PerfManager(notificationMgr); } function _validateExtensions(logger, channelPriority, allExtensions) { var _a; var coreExtensions = []; var extPriorities = {}; arrForEach(allExtensions, function (ext) { if (isNullOrUndefined(ext) || isNullOrUndefined(ext[_DYN_INITIALIZE ])) { throwError(strValidationError); } var extPriority = ext[STR_PRIORITY ]; var identifier = ext[_DYN_IDENTIFIER ]; if (ext && extPriority) { if (!isNullOrUndefined(extPriorities[extPriority])) { _warnToConsole(logger, "Two extensions have same priority #" + extPriority + " - " + extPriorities[extPriority] + ", " + identifier); } else { extPriorities[extPriority] = identifier; } } if (!extPriority || extPriority < channelPriority) { coreExtensions[_DYN_PUSH$2 ](ext); } }); return _a = { all: allExtensions }, _a[STR_CORE ] = coreExtensions, _a; } function _isPluginPresent(thePlugin, plugins) { var exists = false; arrForEach(plugins, function (plugin) { if (plugin === thePlugin) { exists = true; return -1; } }); return exists; } function _createDummyNotificationManager() { var _a; return objCreateFn((_a = {}, _a[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) { }, _a[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) { }, _a[STR_EVENTS_SENT ] = function (events) { }, _a[STR_EVENTS_DISCARDED ] = function (events, reason) { }, _a[STR_EVENTS_SEND_REQUEST ] = function (sendReason, isAsync) { }, _a)); } var BaseCore = /** @class */ (function () { function BaseCore() { var _config; var _isInitialized; var _eventQueue; var _notificationManager; var _perfManager; var _cfgPerfManager; var _cookieManager; var _pluginChain; var _configExtensions; var _coreExtensions; var _channelControl; var _channelConfig; var _channelQueue; var _isUnloading; var _telemetryInitializerPlugin; var _internalLogsEventName; var _evtNamespace; var _unloadHandlers; var _debugListener; var _traceCtx; var _internalLogPoller = 0; var _forceStopInternalLogPoller = false; dynamicProto(BaseCore, this, function (_self) { _initDefaults(); _self[_DYN_IS_INITIALIZED ] = function () { return _isInitialized; }; _self[_DYN_INITIALIZE ] = function (config, extensions, logger, notificationManager) { if (_isUnloading) { throwError(strSdkUnloadingError); } if (_self[_DYN_IS_INITIALIZED ]()) { throwError("Core should not be initialized more than once"); } _config = config || {}; _self[_DYN_CONFIG$2 ] = _config; if (isNullOrUndefined(config[_DYN_INSTRUMENTATION_KEY$2 ])) { throwError("Please provide instrumentation key"); } _notificationManager = notificationManager; _self[strNotificationManager] = notificationManager; _initDebugListener(); _initPerfManager(); _initExtConfig(); if (logger) { _self[_DYN_LOGGER ] = logger; } var cfgExtensions = getSetValue(_config, STR_EXTENSIONS, []); _configExtensions = []; _configExtensions[_DYN_PUSH$2 ].apply(_configExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), cfgExtensions)); _channelConfig = getSetValue(_config, STR_CHANNELS, []); _initPluginChain(null); if (!_channelQueue || _channelQueue[_DYN_LENGTH$5 ] === 0) { throwError("No " + STR_CHANNELS + " available"); } _isInitialized = true; _self.releaseQueue(); }; _self.getTransmissionControls = function () { var controls = []; if (_channelQueue) { arrForEach(_channelQueue, function (channels) { controls[_DYN_PUSH$2 ](channels.queue); }); } return objFreeze(controls); }; _self.track = function (telemetryItem) { telemetryItem.iKey = telemetryItem.iKey || _config[_DYN_INSTRUMENTATION_KEY$2 ]; telemetryItem[_DYN_TIME ] = telemetryItem[_DYN_TIME ] || toISOString(new Date()); telemetryItem.ver = telemetryItem.ver || "4.0"; if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]()) { _createTelCtx()[_DYN_PROCESS_NEXT ](telemetryItem); } else { _eventQueue[_DYN_PUSH$2 ](telemetryItem); } }; _self[_DYN_GET_PROCESS_TEL_CONT0 ] = _createTelCtx; _self[_DYN_GET_NOTIFY_MGR ] = function () { if (!_notificationManager) { _notificationManager = _createDummyNotificationManager(); _self[strNotificationManager] = _notificationManager; } return _notificationManager; }; _self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) { if (_notificationManager) { _notificationManager[_DYN_ADD_NOTIFICATION_LIS1 ](listener); } }; _self[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) { if (_notificationManager) { _notificationManager[_DYN_REMOVE_NOTIFICATION_2 ](listener); } }; _self.getCookieMgr = function () { if (!_cookieManager) { _cookieManager = createCookieMgr(_config, _self[_DYN_LOGGER ]); } return _cookieManager; }; _self.setCookieMgr = function (cookieMgr) { _cookieManager = cookieMgr; }; _self[STR_GET_PERF_MGR ] = function () { if (!_perfManager && !_cfgPerfManager) { if (getCfgValue(_config.enablePerfMgr)) { var createPerfMgr = getCfgValue(_config[STR_CREATE_PERF_MGR ]); if (isFunction(createPerfMgr)) { _cfgPerfManager = createPerfMgr(_self, _self[_DYN_GET_NOTIFY_MGR ]()); } } } return _perfManager || _cfgPerfManager || getGblPerfMgr(); }; _self.setPerfMgr = function (perfMgr) { _perfManager = perfMgr; }; _self.eventCnt = function () { return _eventQueue[_DYN_LENGTH$5 ]; }; _self.releaseQueue = function () { if (_isInitialized && _eventQueue[_DYN_LENGTH$5 ] > 0) { var eventQueue = _eventQueue; _eventQueue = []; arrForEach(eventQueue, function (event) { _createTelCtx()[_DYN_PROCESS_NEXT ](event); }); } }; _self.pollInternalLogs = function (eventName) { _internalLogsEventName = eventName || null; _forceStopInternalLogPoller = false; if (_internalLogPoller) { clearInterval(_internalLogPoller); _internalLogPoller = null; } return _startInternalLogTimer(true); }; function _startInternalLogTimer(alwaysStart) { if (!_internalLogPoller && !_forceStopInternalLogPoller) { var shouldStart = alwaysStart || (_self[_DYN_LOGGER ] && _self[_DYN_LOGGER ].queue[_DYN_LENGTH$5 ] > 0); if (shouldStart) { var interval = getCfgValue(_config.diagnosticLogInterval); if (!interval || !(interval > 0)) { interval = 10000; } _internalLogPoller = setInterval(function () { clearInterval(_internalLogPoller); _internalLogPoller = 0; _flushInternalLogs(); }, interval); } } return _internalLogPoller; } _self[_DYN_STOP_POLLING_INTERNA3 ] = function () { _forceStopInternalLogPoller = true; if (_internalLogPoller) { clearInterval(_internalLogPoller); _internalLogPoller = 0; _flushInternalLogs(); } }; proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, ["addTelemetryInitializer"]); _self.unload = function (isAsync, unloadComplete, cbTimeout) { var _a; if (isAsync === void 0) { isAsync = true; } if (!_isInitialized) { throwError(strSdkNotInitialized); } if (_isUnloading) { throwError(strSdkUnloadingError); } var unloadState = (_a = { reason: 50 }, _a[_DYN_IS_ASYNC ] = isAsync, _a.flushComplete = false, _a); var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self); processUnloadCtx[_DYN_ON_COMPLETE ](function () { _initDefaults(); unloadComplete && unloadComplete(unloadState); }, _self); function _doUnload(flushComplete) { unloadState.flushComplete = flushComplete; _isUnloading = true; _unloadHandlers.run(processUnloadCtx, unloadState); _self[_DYN_STOP_POLLING_INTERNA3 ](); processUnloadCtx[_DYN_PROCESS_NEXT ](unloadState); } _flushInternalLogs(); if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) { _doUnload(false); } }; _self[_DYN_GET_PLUGIN ] = _getPlugin; _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) { if (!plugin) { addCb && addCb(false); _logOrThrowError(strValidationError); return; } var existingPlugin = _getPlugin(plugin[_DYN_IDENTIFIER ]); if (existingPlugin && !replaceExisting) { addCb && addCb(false); _logOrThrowError("Plugin [" + plugin[_DYN_IDENTIFIER ] + "] is already loaded!"); return; } var updateState = { reason: 16 }; function _addPlugin(removed) { _configExtensions[_DYN_PUSH$2 ](plugin); updateState.added = [plugin]; _initPluginChain(updateState); addCb && addCb(true); } if (existingPlugin) { var removedPlugins_1 = [existingPlugin.plugin]; var unloadState = { reason: 2 , isAsync: !!isAsync }; _removePlugins(removedPlugins_1, unloadState, function (removed) { if (!removed) { addCb && addCb(false); } else { updateState.removed = removedPlugins_1; updateState.reason |= 32 ; _addPlugin(); } }); } else { _addPlugin(); } }; _self.evtNamespace = function () { return _evtNamespace; }; _self[_DYN_FLUSH ] = _flushChannels; _self.getTraceCtx = function (createNew) { if (!_traceCtx) { _traceCtx = createDistributedTraceContext(); } return _traceCtx; }; _self.setTraceCtx = function (traceCtx) { _traceCtx = traceCtx || null; }; proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add"); function _initDefaults() { _isInitialized = false; _config = objExtend(true, {}, defaultInitConfig); _self[_DYN_CONFIG$2 ] = _config; _self[_DYN_LOGGER ] = new DiagnosticLogger(_config); _self[_DYN__EXTENSIONS ] = []; _telemetryInitializerPlugin = new TelemetryInitializerPlugin(); _eventQueue = []; _notificationManager = null; _perfManager = null; _cfgPerfManager = null; _cookieManager = null; _pluginChain = null; _coreExtensions = null; _configExtensions = []; _channelControl = null; _channelConfig = null; _channelQueue = null; _isUnloading = false; _internalLogsEventName = null; _evtNamespace = createUniqueNamespace("AIBaseCore", true); _unloadHandlers = createUnloadHandlerContainer(); _traceCtx = null; } function _createTelCtx() { var theCtx = createProcessTelemetryContext(_getPluginChain(), _config, _self); theCtx[_DYN_ON_COMPLETE ](_startInternalLogTimer); return theCtx; } function _initPluginChain(updateState) { var theExtensions = _validateExtensions(_self[_DYN_LOGGER ], ChannelControllerPriority, _configExtensions); _coreExtensions = theExtensions[STR_CORE ]; _pluginChain = null; var allExtensions = theExtensions.all; _channelQueue = objFreeze(createChannelQueues(_channelConfig, allExtensions, _self)); if (_channelControl) { var idx = arrIndexOf(allExtensions, _channelControl); if (idx !== -1) { allExtensions[_DYN_SPLICE ](idx, 1); } idx = arrIndexOf(_coreExtensions, _channelControl); if (idx !== -1) { _coreExtensions[_DYN_SPLICE ](idx, 1); } _channelControl._setQueue(_channelQueue); } else { _channelControl = createChannelControllerPlugin(_channelQueue, _self); } allExtensions[_DYN_PUSH$2 ](_channelControl); _coreExtensions[_DYN_PUSH$2 ](_channelControl); _self[_DYN__EXTENSIONS ] = sortPlugins(allExtensions); _channelControl[_DYN_INITIALIZE ](_config, _self, allExtensions); var initCtx = _createTelCtx(); initializePlugins(initCtx, allExtensions); _self[_DYN__EXTENSIONS ] = objFreeze(sortPlugins(_coreExtensions || [])).slice(); if (updateState) { _doUpdate(updateState); } } function _getPlugin(pluginIdentifier) { var _a; var theExt = null; var thePlugin = null; arrForEach(_self[_DYN__EXTENSIONS ], function (ext) { if (ext[_DYN_IDENTIFIER ] === pluginIdentifier && ext !== _channelControl && ext !== _telemetryInitializerPlugin) { thePlugin = ext; return -1; } }); if (!thePlugin && _channelControl) { thePlugin = _channelControl.getChannel(pluginIdentifier); } if (thePlugin) { theExt = (_a = { plugin: thePlugin }, _a[_DYN_SET_ENABLED ] = function (enabled) { _getPluginState(thePlugin)[STR_DISABLED] = !enabled; }, _a.isEnabled = function () { var pluginState = _getPluginState(thePlugin); return !pluginState[_DYN_TEARDOWN ] && !pluginState[STR_DISABLED]; }, _a.remove = function (isAsync, removeCb) { var _a; if (isAsync === void 0) { isAsync = true; } var pluginsToRemove = [thePlugin]; var unloadState = (_a = { reason: 1 }, _a[_DYN_IS_ASYNC ] = isAsync, _a); _removePlugins(pluginsToRemove, unloadState, function (removed) { if (removed) { _initPluginChain({ reason: 32 , removed: pluginsToRemove }); } removeCb && removeCb(removed); }); }, _a); } return theExt; } function _getPluginChain() { if (!_pluginChain) { var extensions = (_coreExtensions || []).slice(); if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) { extensions[_DYN_PUSH$2 ](_telemetryInitializerPlugin); } _pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _config, _self); } return _pluginChain; } function _removePlugins(thePlugins, unloadState, removeComplete) { if (thePlugins && thePlugins[_DYN_LENGTH$5 ] > 0) { var unloadChain = createTelemetryProxyChain(thePlugins, _config, _self); var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self); unloadCtx[_DYN_ON_COMPLETE ](function () { var removed = false; var newConfigExtensions = []; arrForEach(_configExtensions, function (plugin, idx) { if (!_isPluginPresent(plugin, thePlugins)) { newConfigExtensions[_DYN_PUSH$2 ](plugin); } else { removed = true; } }); _configExtensions = newConfigExtensions; var newChannelConfig = []; if (_channelConfig) { arrForEach(_channelConfig, function (queue, idx) { var newQueue = []; arrForEach(queue, function (channel) { if (!_isPluginPresent(channel, thePlugins)) { newQueue[_DYN_PUSH$2 ](channel); } else { removed = true; } }); newChannelConfig[_DYN_PUSH$2 ](newQueue); }); _channelConfig = newChannelConfig; } removeComplete && removeComplete(removed); _startInternalLogTimer(); }); unloadCtx[_DYN_PROCESS_NEXT ](unloadState); } else { removeComplete(false); } } function _flushInternalLogs() { if (_self[_DYN_LOGGER ] && _self[_DYN_LOGGER ].queue) { var queue = _self[_DYN_LOGGER ].queue.slice(0); _self[_DYN_LOGGER ].queue[_DYN_LENGTH$5 ] = 0; arrForEach(queue, function (logMessage) { var _a; var item = (_a = {}, _a[_DYN_NAME$3 ] = _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage[_DYN_MESSAGE_ID ], _a.iKey = getCfgValue(_config[_DYN_INSTRUMENTATION_KEY$2 ]), _a.time = toISOString(new Date()), _a.baseType = _InternalLogMessage.dataType, _a.baseData = { message: logMessage[_DYN_MESSAGE$2 ] }, _a); _self.track(item); }); } } function _flushChannels(isAsync, callBack, sendReason, cbTimeout) { if (_channelControl) { return _channelControl[_DYN_FLUSH ](isAsync, callBack, sendReason || 6 , cbTimeout); } callBack && callBack(false); return true; } function _initDebugListener() { var disableDbgExt = getCfgValue(_config.disableDbgExt); if (disableDbgExt === true && _debugListener) { _notificationManager[_DYN_REMOVE_NOTIFICATION_2 ](_debugListener); _debugListener = null; } if (_notificationManager && !_debugListener && disableDbgExt !== true) { _debugListener = getDebugListener(_config); _notificationManager[_DYN_ADD_NOTIFICATION_LIS1 ](_debugListener); } } function _initPerfManager() { var enablePerfMgr = getCfgValue(_config.enablePerfMgr); if (!enablePerfMgr && _cfgPerfManager) { _cfgPerfManager = null; } if (enablePerfMgr) { getSetValue(_config, STR_CREATE_PERF_MGR, _createPerfManager); } } function _initExtConfig() { var extConfig = getSetValue(_config, STR_EXTENSION_CONFIG, {}); extConfig.NotificationManager = _notificationManager; } function _doUpdate(updateState) { var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self); updateCtx[_DYN_ON_COMPLETE ](_startInternalLogTimer); if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) { updateCtx[_DYN_PROCESS_NEXT ](updateState); } } function _logOrThrowError(message) { var logger = _self[_DYN_LOGGER ]; if (logger) { _throwInternal(logger, 2 , 73 , message); _startInternalLogTimer(); } else { throwError(message); } } }); } BaseCore.__ieDyn=1; return BaseCore; }()); function _runListeners(listeners, name, isAsync, callback) { arrForEach(listeners, function (listener) { if (listener && listener[name]) { if (isAsync) { setTimeout(function () { return callback(listener); }, 0); } else { try { callback(listener); } catch (e) { } } } }); } var NotificationManager = /** @class */ (function () { function NotificationManager(config) { this.listeners = []; var perfEvtsSendAll = !!(config || {}).perfEvtsSendAll; dynamicProto(NotificationManager, this, function (_self) { _self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) { _self.listeners[_DYN_PUSH$2 ](listener); }; _self[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) { var index = arrIndexOf(_self[_DYN_LISTENERS ], listener); while (index > -1) { _self.listeners[_DYN_SPLICE ](index, 1); index = arrIndexOf(_self[_DYN_LISTENERS ], listener); } }; _self[STR_EVENTS_SENT ] = function (events) { _runListeners(_self[_DYN_LISTENERS ], STR_EVENTS_SENT, true, function (listener) { listener[STR_EVENTS_SENT ](events); }); }; _self[STR_EVENTS_DISCARDED ] = function (events, reason) { _runListeners(_self[_DYN_LISTENERS ], STR_EVENTS_DISCARDED, true, function (listener) { listener[STR_EVENTS_DISCARDED ](events, reason); }); }; _self[STR_EVENTS_SEND_REQUEST ] = function (sendReason, isAsync) { _runListeners(_self[_DYN_LISTENERS ], STR_EVENTS_SEND_REQUEST, isAsync, function (listener) { listener[STR_EVENTS_SEND_REQUEST ](sendReason, isAsync); }); }; _self[STR_PERF_EVENT ] = function (perfEvent) { if (perfEvent) { if (perfEvtsSendAll || !perfEvent[_DYN_IS_CHILD_EVT ]()) { _runListeners(_self[_DYN_LISTENERS ], STR_PERF_EVENT, false, function (listener) { if (perfEvent[_DYN_IS_ASYNC ]) { setTimeout(function () { return listener[STR_PERF_EVENT ](perfEvent); }, 0); } else { listener[STR_PERF_EVENT ](perfEvent); } }); } } }; }); } NotificationManager.__ieDyn=1; return NotificationManager; }()); var AppInsightsCore = /** @class */ (function (_super) { __extendsFn(AppInsightsCore, _super); function AppInsightsCore() { var _this = _super.call(this) || this; dynamicProto(AppInsightsCore, _this, function (_self, _base) { _self[_DYN_INITIALIZE ] = function (config, extensions, logger, notificationManager) { _base[_DYN_INITIALIZE ](config, extensions, logger || new DiagnosticLogger(config), notificationManager || new NotificationManager(config)); }; _self.track = function (telemetryItem) { doPerf(_self[STR_GET_PERF_MGR ](), function () { return "AppInsightsCore:track"; }, function () { if (telemetryItem === null) { _notifyInvalidEvent(telemetryItem); throwError("Invalid telemetry item"); } _validateTelemetryItem(telemetryItem); _base.track(telemetryItem); }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync)); }; function _validateTelemetryItem(telemetryItem) { if (isNullOrUndefined(telemetryItem[_DYN_NAME$3 ])) { _notifyInvalidEvent(telemetryItem); throwError("telemetry name required"); } } function _notifyInvalidEvent(telemetryItem) { var manager = _self[_DYN_GET_NOTIFY_MGR ](); if (manager) { manager[STR_EVENTS_DISCARDED ]([telemetryItem], 2 ); } } }); return _this; } AppInsightsCore.__ieDyn=1; return AppInsightsCore; }(BaseCore)); var _a$2; var FAILED = "Failed"; var FAILED_MONITOR_AJAX = FAILED + "MonitorAjax"; var TRACK = "Track"; var START = "Start"; var STOP = "Stop"; var EVENT = "Event"; var AUTH_CONTEXT = "AuthContext"; var EXCEPTION = "Exception"; var LOCAL = "Local"; var SESSION = "Session"; var STORAGE = "Storage"; var BROWSER = "Browser"; var CANNOT = "Cannot"; var BUFFER = "Buffer"; var INSTRUMENTATION_KEY = "InstrumentationKey"; var LoggingSeverity = createEnumStyle({ CRITICAL: 1 , WARNING: 2 }); createEnumStyle((_a$2 = {}, _a$2[BROWSER + "DoesNotSupport" + LOCAL + STORAGE] = 0 , _a$2[BROWSER + CANNOT + "Read" + LOCAL + STORAGE] = 1 , _a$2[BROWSER + CANNOT + "Read" + SESSION + STORAGE] = 2 , _a$2[BROWSER + CANNOT + "Write" + LOCAL + STORAGE] = 3 , _a$2[BROWSER + CANNOT + "Write" + SESSION + STORAGE] = 4 , _a$2[BROWSER + FAILED + "RemovalFrom" + LOCAL + STORAGE] = 5 , _a$2[BROWSER + FAILED + "RemovalFrom" + SESSION + STORAGE] = 6 , _a$2[CANNOT + "SendEmptyTelemetry"] = 7 , _a$2.ClientPerformanceMathError = 8 , _a$2["ErrorParsingAI" + SESSION + "Cookie"] = 9 , _a$2.ErrorPVCalc = 10 , _a$2[EXCEPTION + "WhileLoggingError"] = 11 , _a$2[FAILED + "AddingTelemetryTo" + BUFFER] = 12 , _a$2[FAILED_MONITOR_AJAX + "Abort"] = 13 , _a$2[FAILED_MONITOR_AJAX + "Dur"] = 14 , _a$2[FAILED_MONITOR_AJAX + "Open"] = 15 , _a$2[FAILED_MONITOR_AJAX + "RSC"] = 16 , _a$2[FAILED_MONITOR_AJAX + "Send"] = 17 , _a$2[FAILED_MONITOR_AJAX + "GetCorrelationHeader"] = 18 , _a$2[FAILED + "ToAddHandlerForOnBeforeUnload"] = 19 , _a$2[FAILED + "ToSendQueuedTelemetry"] = 20 , _a$2[FAILED + "ToReportDataLoss"] = 21 , _a$2["Flush" + FAILED] = 22 , _a$2.MessageLimitPerPVExceeded = 23 , _a$2.MissingRequiredFieldSpecification = 24 , _a$2.NavigationTimingNotSupported = 25 , _a$2.OnError = 26 , _a$2[SESSION + "RenewalDateIsZero"] = 27 , _a$2.SenderNotInitialized = 28 , _a$2[START + TRACK + EVENT + FAILED] = 29 , _a$2[STOP + TRACK + EVENT + FAILED] = 30 , _a$2[START + TRACK + FAILED] = 31 , _a$2[STOP + TRACK + FAILED] = 32 , _a$2.TelemetrySampledAndNotSent = 33 , _a$2[TRACK + EVENT + FAILED] = 34 , _a$2[TRACK + EXCEPTION + FAILED] = 35 , _a$2[TRACK + "Metric" + FAILED] = 36 , _a$2[TRACK + "PV" + FAILED] = 37 , _a$2[TRACK + "PV" + FAILED + "Calc"] = 38 , _a$2[TRACK + "Trace" + FAILED] = 39 , _a$2["Transmission" + FAILED] = 40 , _a$2[FAILED + "ToSet" + STORAGE + BUFFER] = 41 , _a$2[FAILED + "ToRestore" + STORAGE + BUFFER] = 42 , _a$2.InvalidBackendResponse = 43 , _a$2[FAILED + "ToFixDepricatedValues"] = 44 , _a$2.InvalidDurationValue = 45 , _a$2.TelemetryEnvelopeInvalid = 46 , _a$2.CreateEnvelopeError = 47 , _a$2[CANNOT + "SerializeObject"] = 48 , _a$2[CANNOT + "SerializeObjectNonSerializable"] = 49 , _a$2.CircularReferenceDetected = 50 , _a$2["Clear" + AUTH_CONTEXT + FAILED] = 51 , _a$2[EXCEPTION + "Truncated"] = 52 , _a$2.IllegalCharsInName = 53 , _a$2.ItemNotInArray = 54 , _a$2.MaxAjaxPerPVExceeded = 55 , _a$2.MessageTruncated = 56 , _a$2.NameTooLong = 57 , _a$2.SampleRateOutOfRange = 58 , _a$2["Set" + AUTH_CONTEXT + FAILED] = 59 , _a$2["Set" + AUTH_CONTEXT + FAILED + "AccountName"] = 60 , _a$2.StringValueTooLong = 61 , _a$2.StartCalledMoreThanOnce = 62 , _a$2.StopCalledWithoutStart = 63 , _a$2["TelemetryInitializer" + FAILED] = 64 , _a$2.TrackArgumentsNotSpecified = 65 , _a$2.UrlTooLong = 66 , _a$2[SESSION + STORAGE + BUFFER + "Full"] = 67 , _a$2[CANNOT + "AccessCookie"] = 68 , _a$2.IdTooLong = 69 , _a$2.InvalidEvent = 70 , _a$2[FAILED_MONITOR_AJAX + "SetRequestHeader"] = 71 , _a$2["Send" + BROWSER + "InfoOnUserInit"] = 72 , _a$2["Plugin" + EXCEPTION] = 73 , _a$2["Notification" + EXCEPTION] = 74 , _a$2.SnippetScriptLoadFailure = 99 , _a$2["Invalid" + INSTRUMENTATION_KEY] = 100 , _a$2[CANNOT + "ParseAiBlobValue"] = 101 , _a$2.InvalidContentBlob = 102 , _a$2[TRACK + "PageAction" + EVENT + FAILED] = 103 , _a$2[FAILED + "AddingCustomDefinedRequestContext"] = 104 , _a$2["InMemory" + STORAGE + BUFFER + "Full"] = 105 , _a$2[INSTRUMENTATION_KEY + "Deprecation"] = 106 , _a$2)); var aiInstrumentHooks = "_aiHooks"; var cbNames = [ "req", "rsp", "hkErr", "fnErr" ]; function _arrLoop(arr, fn) { if (arr) { for (var lp = 0; lp < arr[_DYN_LENGTH$5 ]; lp++) { if (fn(arr[lp], lp)) { break; } } } } function _doCallbacks(hooks, callDetails, cbArgs, hookCtx, type) { if (type >= 0 && type <= 2 ) { _arrLoop(hooks, function (hook, idx) { var cbks = hook.cbks; var cb = cbks[cbNames[type]]; if (cb) { callDetails.ctx = function () { var ctx = hookCtx[idx] = (hookCtx[idx] || {}); return ctx; }; try { cb[_DYN_APPLY ](callDetails.inst, cbArgs); } catch (err) { var orgEx = callDetails.err; try { var hookErrorCb = cbks[cbNames[2 ]]; if (hookErrorCb) { callDetails.err = err; hookErrorCb[_DYN_APPLY ](callDetails.inst, cbArgs); } } catch (e) { } finally { callDetails.err = orgEx; } } } }); } } function _createFunctionHook(aiHook) { return function () { var _a; var funcThis = this; var orgArgs = arguments; var hooks = aiHook.h; var funcArgs = (_a = {}, _a[_DYN_NAME$3 ] = aiHook.n, _a.inst = funcThis, _a.ctx = null, _a.set = _replaceArg, _a); var hookCtx = []; var cbArgs = _createArgs([funcArgs], orgArgs); funcArgs.evt = getGlobalInst("event"); function _createArgs(target, theArgs) { _arrLoop(theArgs, function (arg) { target[_DYN_PUSH$2 ](arg); }); return target; } function _replaceArg(idx, value) { orgArgs = _createArgs([], orgArgs); orgArgs[idx] = value; cbArgs = _createArgs([funcArgs], orgArgs); } _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 0 ); var theFunc = aiHook.f; if (theFunc) { try { funcArgs.rslt = theFunc[_DYN_APPLY ](funcThis, orgArgs); } catch (err) { funcArgs.err = err; _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 3 ); throw err; } } _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 1 ); return funcArgs.rslt; }; } function _getOwner(target, name, checkPrototype, checkParentProto) { var owner = null; if (target) { if (hasOwnProperty(target, name)) { owner = target; } else if (checkPrototype) { owner = _getOwner(_getObjProto$1(target), name, checkParentProto, false); } } return owner; } function InstrumentProto(target, funcName, callbacks) { if (target) { return InstrumentFunc(target[strShimPrototype], funcName, callbacks, false); } return null; } function _createInstrumentHook(owner, funcName, fn, callbacks) { var aiHook = fn && fn[aiInstrumentHooks]; if (!aiHook) { aiHook = { i: 0, n: funcName, f: fn, h: [] }; var newFunc = _createFunctionHook(aiHook); newFunc[aiInstrumentHooks] = aiHook; owner[funcName] = newFunc; } var theHook = { id: aiHook.i, cbks: callbacks, rm: function () { var id = this.id; _arrLoop(aiHook.h, function (hook, idx) { if (hook.id === id) { aiHook.h[_DYN_SPLICE ](idx, 1); return 1; } }); } }; aiHook.i++; aiHook.h[_DYN_PUSH$2 ](theHook); return theHook; } function InstrumentFunc(target, funcName, callbacks, checkPrototype, checkParentProto) { if (checkPrototype === void 0) { checkPrototype = true; } if (target && funcName && callbacks) { var owner = _getOwner(target, funcName, checkPrototype, checkParentProto); if (owner) { var fn = owner[funcName]; if (typeof fn === strShimFunction) { return _createInstrumentHook(owner, funcName, fn, callbacks); } } } return null; } function InstrumentEvent(target, evtName, callbacks, checkPrototype, checkParentProto) { if (target && evtName && callbacks) { var owner = _getOwner(target, evtName, checkPrototype, checkParentProto) || target; if (owner) { return _createInstrumentHook(owner, evtName, owner[evtName], callbacks); } } return null; } var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var SampleRate = "sampleRate"; var ProcessLegacy = "ProcessLegacy"; var HttpMethod = "http.method"; var DEFAULT_BREEZE_ENDPOINT = "https://dc.services.visualstudio.com"; var DEFAULT_BREEZE_PATH = "/v2/track"; var strNotSpecified = "not_specified"; var strIkey = "iKey"; function createDomEvent(eventName) { var event = null; if (isFunction(Event)) { event = new Event(eventName); } else { var doc = getDocument(); if (doc && doc.createEvent) { event = doc.createEvent("Event"); event.initEvent(eventName, true, true); } } return event; } var _DYN_SPLIT = "split"; var _DYN_LENGTH$4 = "length"; var _DYN_TO_LOWER_CASE$1 = "toLowerCase"; var _DYN_INGESTIONENDPOINT = "ingestionendpoint"; var _DYN_TO_STRING$2 = "toString"; var _DYN_REMOVE_ITEM = "removeItem"; var _DYN_NAME$2 = "name"; var _DYN_MESSAGE$1 = "message"; var _DYN_COUNT$1 = "count"; var _DYN_STRINGIFY$1 = "stringify"; var _DYN_PATHNAME = "pathname"; var _DYN_CORRELATION_HEADER_E0 = "correlationHeaderExcludePatterns"; var _DYN_INDEX_OF$1 = "indexOf"; var _DYN_EXTENSION_CONFIG = "extensionConfig"; var _DYN_EXCEPTIONS = "exceptions"; var _DYN_PARSED_STACK = "parsedStack"; var _DYN_PROPERTIES = "properties"; var _DYN_MEASUREMENTS$1 = "measurements"; var _DYN_SIZE_IN_BYTES = "sizeInBytes"; var _DYN_TYPE_NAME = "typeName"; var _DYN_SEVERITY_LEVEL = "severityLevel"; var _DYN_PROBLEM_GROUP = "problemGroup"; var _DYN_IS_MANUAL = "isManual"; var _DYN__CREATE_FROM_INTERFA1 = "CreateFromInterface"; var _DYN_ASSEMBLY = "assembly"; var _DYN_FILE_NAME = "fileName"; var _DYN_HAS_FULL_STACK = "hasFullStack"; var _DYN_LEVEL = "level"; var _DYN_METHOD$1 = "method"; var _DYN_LINE = "line"; var _DYN_DURATION$1 = "duration"; var _DYN_RECEIVED_RESPONSE = "receivedResponse"; var _DYN_SUBSTRING = "substring"; var _DYN_SANITIZE_KEY_AND_ADD2 = "sanitizeKeyAndAddUniqueness"; var _DYN_SANITIZE_EXCEPTION = "sanitizeException"; var _DYN_SANITIZE_PROPERTIES = "sanitizeProperties"; var _DYN_SANITIZE_MEASUREMENT3 = "sanitizeMeasurements"; var strEmpty = ""; function stringToBoolOrDefault(str, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } if (str === undefined || str === null) { return defaultValue; } return str.toString()[_DYN_TO_LOWER_CASE$1 ]() === "true"; } function msToTimeSpan(totalms) { if (isNaN(totalms) || totalms < 0) { totalms = 0; } totalms = Math.round(totalms); var ms = strEmpty + totalms % 1000; var sec = strEmpty + Math.floor(totalms / 1000) % 60; var min = strEmpty + Math.floor(totalms / (1000 * 60)) % 60; var hour = strEmpty + Math.floor(totalms / (1000 * 60 * 60)) % 24; var days = Math.floor(totalms / (1000 * 60 * 60 * 24)); ms = ms[_DYN_LENGTH$4 ] === 1 ? "00" + ms : ms[_DYN_LENGTH$4 ] === 2 ? "0" + ms : ms; sec = sec[_DYN_LENGTH$4 ] < 2 ? "0" + sec : sec; min = min[_DYN_LENGTH$4 ] < 2 ? "0" + min : min; hour = hour[_DYN_LENGTH$4 ] < 2 ? "0" + hour : hour; return (days > 0 ? days + "." : strEmpty) + hour + ":" + min + ":" + sec + "." + ms; } function getExtensionByName(extensions, identifier) { var extension = null; arrForEach(extensions, function (value) { if (value.identifier === identifier) { extension = value; return -1; } }); return extension; } function isCrossOriginError(message, url, lineNumber, columnNumber, error) { return !error && isString(message) && (message === "Script error." || message === "Script error"); } var RequestHeaders = createValueMap({ requestContextHeader: [0 , "Request-Context"], requestContextTargetKey: [1 , "appId"], requestContextAppIdFormat: [2 , "appId=cid-v1:"], requestIdHeader: [3 , "Request-Id"], traceParentHeader: [4 , "traceparent"], traceStateHeader: [5 , "tracestate"], sdkContextHeader: [6 , "Sdk-Context"], sdkContextHeaderAppIdRequest: [7 , "appId"], requestContextHeaderLowerCase: [8 , "request-context"] }); var StorageType = createEnumStyle({ LocalStorage: 0 , SessionStorage: 1 }); var DistributedTracingModes = createEnumStyle({ AI: 0 , AI_AND_W3C: 1 , W3C: 2 }); var _canUseLocalStorage = undefined; var _canUseSessionStorage = undefined; var _storagePrefix = ""; function _getLocalStorageObject() { if (utlCanUseLocalStorage()) { return _getVerifiedStorageObject(StorageType.LocalStorage); } return null; } function _getVerifiedStorageObject(storageType) { try { if (isNullOrUndefined(getGlobal())) { return null; } var uid = (new Date)[_DYN_TO_STRING$2 ](); var storage = getGlobalInst(storageType === StorageType.LocalStorage ? "localStorage" : "sessionStorage"); var name_1 = _storagePrefix + uid; storage.setItem(name_1, uid); var fail = storage.getItem(name_1) !== uid; storage[_DYN_REMOVE_ITEM ](name_1); if (!fail) { return storage; } } catch (exception) { } return null; } function _getSessionStorageObject() { if (utlCanUseSessionStorage()) { return _getVerifiedStorageObject(StorageType.SessionStorage); } return null; } function utlDisableStorage() { _canUseLocalStorage = false; _canUseSessionStorage = false; } function utlSetStoragePrefix(storagePrefix) { _storagePrefix = storagePrefix || ""; } function utlEnableStorage() { _canUseLocalStorage = utlCanUseLocalStorage(true); _canUseSessionStorage = utlCanUseSessionStorage(true); } function utlCanUseLocalStorage(reset) { if (reset || _canUseLocalStorage === undefined) { _canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage); } return _canUseLocalStorage; } function utlGetLocalStorage(logger, name) { var storage = _getLocalStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { _canUseLocalStorage = false; _throwInternal(logger, 2 , 1 , "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) }); } } return null; } function utlSetLocalStorage(logger, name, data) { var storage = _getLocalStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { _canUseLocalStorage = false; _throwInternal(logger, 2 , 3 , "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) }); } } return false; } function utlRemoveStorage(logger, name) { var storage = _getLocalStorageObject(); if (storage !== null) { try { storage[_DYN_REMOVE_ITEM ](name); return true; } catch (e) { _canUseLocalStorage = false; _throwInternal(logger, 2 , 5 , "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) }); } } return false; } function utlCanUseSessionStorage(reset) { if (reset || _canUseSessionStorage === undefined) { _canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage); } return _canUseSessionStorage; } function utlGetSessionStorageKeys() { var keys = []; if (utlCanUseSessionStorage()) { objForEachKey(getGlobalInst("sessionStorage"), function (key) { keys.push(key); }); } return keys; } function utlGetSessionStorage(logger, name) { var storage = _getSessionStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { _canUseSessionStorage = false; _throwInternal(logger, 2 , 2 , "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) }); } } return null; } function utlSetSessionStorage(logger, name, data) { var storage = _getSessionStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { _canUseSessionStorage = false; _throwInternal(logger, 2 , 4 , "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) }); } } return false; } function utlRemoveSessionStorage(logger, name) { var storage = _getSessionStorageObject(); if (storage !== null) { try { storage[_DYN_REMOVE_ITEM ](name); return true; } catch (e) { _canUseSessionStorage = false; _throwInternal(logger, 2 , 6 , "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) }); } } return false; } var _a$1; function dataSanitizeKeyAndAddUniqueness(logger, key, map) { var origLength = key[_DYN_LENGTH$4 ]; var field = dataSanitizeKey(logger, key); if (field[_DYN_LENGTH$4 ] !== origLength) { var i = 0; var uniqueField = field; while (map[uniqueField] !== undefined) { i++; uniqueField = field[_DYN_SUBSTRING ](0, 150 - 3) + dsPadNumber(i); } field = uniqueField; } return field; } function dataSanitizeKey(logger, name) { var nameTrunc; if (name) { name = strTrim(name[_DYN_TO_STRING$2 ]()); if (name[_DYN_LENGTH$4 ] > 150 ) { nameTrunc = name[_DYN_SUBSTRING ](0, 150 ); _throwInternal(logger, 2 , 57 , "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true); } } return nameTrunc || name; } function dataSanitizeString(logger, value, maxLength) { if (maxLength === void 0) { maxLength = 1024 ; } var valueTrunc; if (value) { maxLength = maxLength ? maxLength : 1024 ; value = strTrim(value); if (value.toString()[_DYN_LENGTH$4 ] > maxLength) { valueTrunc = value[_DYN_TO_STRING$2 ]()[_DYN_SUBSTRING ](0, maxLength); _throwInternal(logger, 2 , 61 , "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true); } } return valueTrunc || value; } function dataSanitizeUrl(logger, url) { return dataSanitizeInput(logger, url, 2048 , 66 ); } function dataSanitizeMessage(logger, message) { var messageTrunc; if (message) { if (message[_DYN_LENGTH$4 ] > 32768 ) { messageTrunc = message[_DYN_SUBSTRING ](0, 32768 ); _throwInternal(logger, 2 , 56 , "message is too long, it has been truncated to " + 32768 + " characters.", { message: message }, true); } } return messageTrunc || message; } function dataSanitizeException(logger, exception) { var exceptionTrunc; if (exception) { var value = "" + exception; if (value[_DYN_LENGTH$4 ] > 32768 ) { exceptionTrunc = value[_DYN_SUBSTRING ](0, 32768 ); _throwInternal(logger, 2 , 52 , "exception is too long, it has been truncated to " + 32768 + " characters.", { exception: exception }, true); } } return exceptionTrunc || exception; } function dataSanitizeProperties(logger, properties) { if (properties) { var tempProps_1 = {}; objForEachKey(properties, function (prop, value) { if (isObject(value) && hasJSON()) { try { value = getJSON()[_DYN_STRINGIFY$1 ](value); } catch (e) { _throwInternal(logger, 2 , 49 , "custom property is not valid", { exception: e }, true); } } value = dataSanitizeString(logger, value, 8192 ); prop = dataSanitizeKeyAndAddUniqueness(logger, prop, tempProps_1); tempProps_1[prop] = value; }); properties = tempProps_1; } return properties; } function dataSanitizeMeasurements(logger, measurements) { if (measurements) { var tempMeasurements_1 = {}; objForEachKey(measurements, function (measure, value) { measure = dataSanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements_1); tempMeasurements_1[measure] = value; }); measurements = tempMeasurements_1; } return measurements; } function dataSanitizeId(logger, id) { return id ? dataSanitizeInput(logger, id, 128 , 69 )[_DYN_TO_STRING$2 ]() : id; } function dataSanitizeInput(logger, input, maxLength, _msgId) { var inputTrunc; if (input) { input = strTrim(input); if (input[_DYN_LENGTH$4 ] > maxLength) { inputTrunc = input[_DYN_SUBSTRING ](0, maxLength); _throwInternal(logger, 2 , _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true); } } return inputTrunc || input; } function dsPadNumber(num) { var s = "00" + num; return s.substr(s[_DYN_LENGTH$4 ] - 3); } var DataSanitizer = (_a$1 = { MAX_NAME_LENGTH: 150 , MAX_ID_LENGTH: 128 , MAX_PROPERTY_LENGTH: 8192 , MAX_STRING_LENGTH: 1024 , MAX_URL_LENGTH: 2048 , MAX_MESSAGE_LENGTH: 32768 , MAX_EXCEPTION_LENGTH: 32768 }, _a$1[_DYN_SANITIZE_KEY_AND_ADD2 ] = dataSanitizeKeyAndAddUniqueness, _a$1.sanitizeKey = dataSanitizeKey, _a$1.sanitizeString = dataSanitizeString, _a$1.sanitizeUrl = dataSanitizeUrl, _a$1.sanitizeMessage = dataSanitizeMessage, _a$1[_DYN_SANITIZE_EXCEPTION ] = dataSanitizeException, _a$1[_DYN_SANITIZE_PROPERTIES ] = dataSanitizeProperties, _a$1[_DYN_SANITIZE_MEASUREMENT3 ] = dataSanitizeMeasurements, _a$1.sanitizeId = dataSanitizeId, _a$1.sanitizeInput = dataSanitizeInput, _a$1.padNumber = dsPadNumber, _a$1.trim = strTrim, _a$1); var _document = getDocument() || {}; var _htmlAnchorIdx = 0; var _htmlAnchorElement = [null, null, null, null, null]; function urlParseUrl(url) { var anchorIdx = _htmlAnchorIdx; var anchorCache = _htmlAnchorElement; var tempAnchor = anchorCache[anchorIdx]; if (!_document.createElement) { tempAnchor = { host: urlParseHost(url, true) }; } else if (!anchorCache[anchorIdx]) { tempAnchor = anchorCache[anchorIdx] = _document.createElement("a"); } tempAnchor.href = url; anchorIdx++; if (anchorIdx >= anchorCache[_DYN_LENGTH$4 ]) { anchorIdx = 0; } _htmlAnchorIdx = anchorIdx; return tempAnchor; } function urlGetAbsoluteUrl(url) { var result; var a = urlParseUrl(url); if (a) { result = a.href; } return result; } function urlGetPathName(url) { var result; var a = urlParseUrl(url); if (a) { result = a[_DYN_PATHNAME ]; } return result; } function urlGetCompleteUrl(method, absoluteUrl) { if (method) { return method.toUpperCase() + " " + absoluteUrl; } return absoluteUrl; } function urlParseHost(url, inclPort) { var fullHost = urlParseFullHost(url, inclPort) || ""; if (fullHost) { var match = fullHost.match(/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i); if (match != null && match[_DYN_LENGTH$4 ] > 3 && isString(match[2]) && match[2][_DYN_LENGTH$4 ] > 0) { return match[2] + (match[3] || ""); } } return fullHost; } function urlParseFullHost(url, inclPort) { var result = null; if (url) { var match = url.match(/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i); if (match != null && match[_DYN_LENGTH$4 ] > 2 && isString(match[2]) && match[2][_DYN_LENGTH$4 ] > 0) { result = match[2] || ""; if (inclPort && match[_DYN_LENGTH$4 ] > 2) { var protocol = (match[1] || "")[_DYN_TO_LOWER_CASE$1 ](); var port = match[3] || ""; if (protocol === "http" && port === ":80") { port = ""; } else if (protocol === "https" && port === ":443") { port = ""; } result += port; } } } return result; } var _internalEndpoints = [ DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH, "https://breeze.aimon.applicationinsights.io" + DEFAULT_BREEZE_PATH, "https://dc-int.services.visualstudio.com" + DEFAULT_BREEZE_PATH ]; function isInternalApplicationInsightsEndpoint(endpointUrl) { return arrIndexOf(_internalEndpoints, endpointUrl[_DYN_TO_LOWER_CASE$1 ]()) !== -1; } var Util = { NotSpecified: strNotSpecified, createDomEvent: createDomEvent, disableStorage: utlDisableStorage, isInternalApplicationInsightsEndpoint: isInternalApplicationInsightsEndpoint, canUseLocalStorage: utlCanUseLocalStorage, getStorage: utlGetLocalStorage, setStorage: utlSetLocalStorage, removeStorage: utlRemoveStorage, canUseSessionStorage: utlCanUseSessionStorage, getSessionStorageKeys: utlGetSessionStorageKeys, getSessionStorage: utlGetSessionStorage, setSessionStorage: utlSetSessionStorage, removeSessionStorage: utlRemoveSessionStorage, disableCookies: disableCookies, canUseCookies: canUseCookies, disallowsSameSiteNone: uaDisallowsSameSiteNone, setCookie: setCookie, stringToBoolOrDefault: stringToBoolOrDefault, getCookie: getCookie, deleteCookie: deleteCookie, trim: strTrim, newId: newId, random32: function () { return random32(true); }, generateW3CId: generateW3CId, isArray: isArray, isError: isError, isDate: isDate, toISOStringForIE8: toISOString, getIEVersion: getIEVersion, msToTimeSpan: msToTimeSpan, isCrossOriginError: isCrossOriginError, dump: dumpObj, getExceptionName: getExceptionName, addEventHandler: attachEvent, IsBeaconApiSupported: isBeaconsSupported, getExtension: getExtensionByName }; var UrlHelper = { parseUrl: urlParseUrl, getAbsoluteUrl: urlGetAbsoluteUrl, getPathName: urlGetPathName, getCompleteUrl: urlGetCompleteUrl, parseHost: urlParseHost, parseFullHost: urlParseFullHost }; var CorrelationIdHelper = { correlationIdPrefix: "cid-v1:", canIncludeCorrelationHeader: function (config, requestUrl, currentHost) { if (!requestUrl || (config && config.disableCorrelationHeaders)) { return false; } if (config && config[_DYN_CORRELATION_HEADER_E0 ]) { for (var i = 0; i < config.correlationHeaderExcludePatterns[_DYN_LENGTH$4 ]; i++) { if (config[_DYN_CORRELATION_HEADER_E0 ][i].test(requestUrl)) { return false; } } } var requestHost = urlParseUrl(requestUrl).host[_DYN_TO_LOWER_CASE$1 ](); if (requestHost && (requestHost[_DYN_INDEX_OF$1 ](":443") !== -1 || requestHost[_DYN_INDEX_OF$1 ](":80") !== -1)) { requestHost = (urlParseFullHost(requestUrl, true) || "")[_DYN_TO_LOWER_CASE$1 ](); } if ((!config || !config.enableCorsCorrelation) && (requestHost && requestHost !== currentHost)) { return false; } var includedDomains = config && config.correlationHeaderDomains; if (includedDomains) { var matchExists_1; arrForEach(includedDomains, function (domain) { var regex = new RegExp(domain.toLowerCase().replace(/\\/g, "\\\\").replace(/\./g, "\\.").replace(/\*/g, ".*")); matchExists_1 = matchExists_1 || regex.test(requestHost); }); if (!matchExists_1) { return false; } } var excludedDomains = config && config.correlationHeaderExcludedDomains; if (!excludedDomains || excludedDomains[_DYN_LENGTH$4 ] === 0) { return true; } for (var i = 0; i < excludedDomains[_DYN_LENGTH$4 ]; i++) { var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\\/g, "\\\\").replace(/\./g, "\\.").replace(/\*/g, ".*")); if (regex.test(requestHost)) { return false; } } return requestHost && requestHost[_DYN_LENGTH$4 ] > 0; }, getCorrelationContext: function (responseHeader) { if (responseHeader) { var correlationId = CorrelationIdHelper.getCorrelationContextValue(responseHeader, RequestHeaders[1 ]); if (correlationId && correlationId !== CorrelationIdHelper.correlationIdPrefix) { return correlationId; } } }, getCorrelationContextValue: function (responseHeader, key) { if (responseHeader) { var keyValues = responseHeader[_DYN_SPLIT ](","); for (var i = 0; i < keyValues[_DYN_LENGTH$4 ]; ++i) { var keyValue = keyValues[i][_DYN_SPLIT ]("="); if (keyValue[_DYN_LENGTH$4 ] === 2 && keyValue[0] === key) { return keyValue[1]; } } } } }; function AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName) { var target, name = commandName, data = commandName; if (absoluteUrl && absoluteUrl[_DYN_LENGTH$4 ] > 0) { var parsedUrl = urlParseUrl(absoluteUrl); target = parsedUrl.host; if (!name) { if (parsedUrl[_DYN_PATHNAME ] != null) { var pathName = (parsedUrl.pathname[_DYN_LENGTH$4 ] === 0) ? "/" : parsedUrl[_DYN_PATHNAME ]; if (pathName.charAt(0) !== "/") { pathName = "/" + pathName; } data = parsedUrl[_DYN_PATHNAME ]; name = dataSanitizeString(logger, method ? method + " " + pathName : pathName); } else { name = dataSanitizeString(logger, absoluteUrl); } } } else { target = commandName; name = commandName; } return { target: target, name: name, data: data }; } function dateTimeUtilsNow() { var perf = getPerformance(); if (perf && perf.now && perf.timing) { var now = perf.now() + perf.timing.navigationStart; if (now > 0) { return now; } } return dateNow(); } function dateTimeUtilsDuration(start, end) { var result = null; if (start !== 0 && end !== 0 && !isNullOrUndefined(start) && !isNullOrUndefined(end)) { result = end - start; } return result; } var DateTimeUtils = { Now: dateTimeUtilsNow, GetDuration: dateTimeUtilsDuration }; function createDistributedTraceContextFromTrace(telemetryTrace, parentCtx) { var trace = telemetryTrace || {}; return { getName: function () { return trace[_DYN_NAME$2 ]; }, setName: function (newValue) { parentCtx && parentCtx.setName(newValue); trace[_DYN_NAME$2 ] = newValue; }, getTraceId: function () { return trace.traceID; }, setTraceId: function (newValue) { parentCtx && parentCtx.setTraceId(newValue); if (isValidTraceId(newValue)) { trace.traceID = newValue; } }, getSpanId: function () { return trace.parentID; }, setSpanId: function (newValue) { parentCtx && parentCtx.setSpanId(newValue); if (isValidSpanId(newValue)) { trace.parentID = newValue; } }, getTraceFlags: function () { return trace.traceFlags; }, setTraceFlags: function (newTraceFlags) { parentCtx && parentCtx.setTraceFlags(newTraceFlags); trace.traceFlags = newTraceFlags; } }; } var _FIELDS_SEPARATOR = ";"; var _FIELD_KEY_VALUE_SEPARATOR = "="; function parseConnectionString(connectionString) { if (!connectionString) { return {}; } var kvPairs = connectionString[_DYN_SPLIT ](_FIELDS_SEPARATOR); var result = arrReduce(kvPairs, function (fields, kv) { var kvParts = kv[_DYN_SPLIT ](_FIELD_KEY_VALUE_SEPARATOR); if (kvParts[_DYN_LENGTH$4 ] === 2) { var key = kvParts[0][_DYN_TO_LOWER_CASE$1 ](); var value = kvParts[1]; fields[key] = value; } return fields; }, {}); if (objKeys(result)[_DYN_LENGTH$4 ] > 0) { if (result.endpointsuffix) { var locationPrefix = result.location ? result.location + "." : ""; result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ] || ("https://" + locationPrefix + "dc." + result.endpointsuffix); } result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ] || DEFAULT_BREEZE_ENDPOINT; } return result; } var ConnectionStringParser = { parse: parseConnectionString }; var Envelope = /** @class */ (function () { function Envelope(logger, data, name) { var _this = this; var _self = this; _self.ver = 1; _self.sampleRate = 100.0; _self.tags = {}; _self[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; _self.data = data; _self.time = toISOString(new Date()); _self.aiDataContract = { time: 1 , iKey: 1 , name: 1 , sampleRate: function () { return (_this.sampleRate === 100) ? 4 : 1 ; }, tags: 1 , data: 1 }; } return Envelope; }()); var Event$1 = /** @class */ (function () { function Event(logger, name, properties, measurements) { this.aiDataContract = { ver: 1 , name: 1 , properties: 0 , measurements: 0 }; var _self = this; _self.ver = 2; _self[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); } Event.envelopeType = "Microsoft.ApplicationInsights.{0}.Event"; Event.dataType = "EventData"; return Event; }()); var NoMethod = ""; var strError = "error"; var strStack = "stack"; var strStackDetails = "stackDetails"; var strErrorSrc = "errorSrc"; var strMessage = "message"; var strDescription = "description"; function _stringify(value, convertToString) { var result = value; if (result && !isString(result)) { if (JSON && JSON[_DYN_STRINGIFY$1 ]) { result = JSON[_DYN_STRINGIFY$1 ](value); if (convertToString && (!result || result === "{}")) { if (isFunction(value[_DYN_TO_STRING$2 ])) { result = value[_DYN_TO_STRING$2 ](); } else { result = "" + value; } } } else { result = "" + value + " - (Missing JSON.stringify)"; } } return result || ""; } function _formatMessage(theEvent, errorType) { var evtMessage = theEvent; if (theEvent) { if (evtMessage && !isString(evtMessage)) { evtMessage = theEvent[strMessage] || theEvent[strDescription] || evtMessage; } if (evtMessage && !isString(evtMessage)) { evtMessage = _stringify(evtMessage, true); } if (theEvent["filename"]) { evtMessage = evtMessage + " @" + (theEvent["filename"] || "") + ":" + (theEvent["lineno"] || "?") + ":" + (theEvent["colno"] || "?"); } } if (errorType && errorType !== "String" && errorType !== "Object" && errorType !== "Error" && (evtMessage || "")[_DYN_INDEX_OF$1 ](errorType) === -1) { evtMessage = errorType + ": " + evtMessage; } return evtMessage || ""; } function _isExceptionDetailsInternal(value) { try { if (isObject(value)) { return "hasFullStack" in value && "typeName" in value; } } catch (e) { } return false; } function _isExceptionInternal(value) { try { if (isObject(value)) { return ("ver" in value && "exceptions" in value && "properties" in value); } } catch (e) { } return false; } function _isStackDetails(details) { return details && details.src && isString(details.src) && details.obj && isArray(details.obj); } function _convertStackObj(errorStack) { var src = errorStack || ""; if (!isString(src)) { if (isString(src[strStack])) { src = src[strStack]; } else { src = "" + src; } } var items = src[_DYN_SPLIT ]("\n"); return { src: src, obj: items }; } function _getOperaStack(errorMessage) { var stack = []; var lines = errorMessage[_DYN_SPLIT ]("\n"); for (var lp = 0; lp < lines[_DYN_LENGTH$4 ]; lp++) { var entry = lines[lp]; if (lines[lp + 1]) { entry += "@" + lines[lp + 1]; lp++; } stack.push(entry); } return { src: errorMessage, obj: stack }; } function _getStackFromErrorObj(errorObj) { var details = null; if (errorObj) { try { if (errorObj[strStack]) { details = _convertStackObj(errorObj[strStack]); } else if (errorObj[strError] && errorObj[strError][strStack]) { details = _convertStackObj(errorObj[strError][strStack]); } else if (errorObj["exception"] && errorObj.exception[strStack]) { details = _convertStackObj(errorObj.exception[strStack]); } else if (_isStackDetails(errorObj)) { details = errorObj; } else if (_isStackDetails(errorObj[strStackDetails])) { details = errorObj[strStackDetails]; } else if (window && window["opera"] && errorObj[strMessage]) { details = _getOperaStack(errorObj[_DYN_MESSAGE$1 ]); } else if (errorObj["reason"] && errorObj.reason[strStack]) { details = _convertStackObj(errorObj.reason[strStack]); } else if (isString(errorObj)) { details = _convertStackObj(errorObj); } else { var evtMessage = errorObj[strMessage] || errorObj[strDescription] || ""; if (isString(errorObj[strErrorSrc])) { if (evtMessage) { evtMessage += "\n"; } evtMessage += " from " + errorObj[strErrorSrc]; } if (evtMessage) { details = _convertStackObj(evtMessage); } } } catch (e) { details = _convertStackObj(e); } } return details || { src: "", obj: null }; } function _formatStackTrace(stackDetails) { var stack = ""; if (stackDetails) { if (stackDetails.obj) { arrForEach(stackDetails.obj, function (entry) { stack += entry + "\n"; }); } else { stack = stackDetails.src || ""; } } return stack; } function _parseStack(stack) { var parsedStack; var frames = stack.obj; if (frames && frames[_DYN_LENGTH$4 ] > 0) { parsedStack = []; var level_1 = 0; var totalSizeInBytes_1 = 0; arrForEach(frames, function (frame) { var theFrame = frame[_DYN_TO_STRING$2 ](); if (_StackFrame.regex.test(theFrame)) { var parsedFrame = new _StackFrame(theFrame, level_1++); totalSizeInBytes_1 += parsedFrame[_DYN_SIZE_IN_BYTES ]; parsedStack.push(parsedFrame); } }); var exceptionParsedStackThreshold = 32 * 1024; if (totalSizeInBytes_1 > exceptionParsedStackThreshold) { var left = 0; var right = parsedStack[_DYN_LENGTH$4 ] - 1; var size = 0; var acceptedLeft = left; var acceptedRight = right; while (left < right) { var lSize = parsedStack[left][_DYN_SIZE_IN_BYTES ]; var rSize = parsedStack[right][_DYN_SIZE_IN_BYTES ]; size += lSize + rSize; if (size > exceptionParsedStackThreshold) { var howMany = acceptedRight - acceptedLeft + 1; parsedStack.splice(acceptedLeft, howMany); break; } acceptedLeft = left; acceptedRight = right; left++; right--; } } } return parsedStack; } function _getErrorType(errorType) { var typeName = ""; if (errorType) { typeName = errorType.typeName || errorType[_DYN_NAME$2 ] || ""; if (!typeName) { try { var funcNameRegex = /function (.{1,200})\(/; var results = (funcNameRegex).exec((errorType).constructor[_DYN_TO_STRING$2 ]()); typeName = (results && results[_DYN_LENGTH$4 ] > 1) ? results[1] : ""; } catch (e) { } } } return typeName; } function _formatErrorCode(errorObj) { if (errorObj) { try { if (!isString(errorObj)) { var errorType = _getErrorType(errorObj); var result = _stringify(errorObj, false); if (!result || result === "{}") { if (errorObj[strError]) { errorObj = errorObj[strError]; errorType = _getErrorType(errorObj); } result = _stringify(errorObj, true); } if (result[_DYN_INDEX_OF$1 ](errorType) !== 0 && errorType !== "String") { return errorType + ":" + result; } return result; } } catch (e) { } } return "" + (errorObj || ""); } var Exception = /** @class */ (function () { function Exception(logger, exception, properties, measurements, severityLevel, id) { this.aiDataContract = { ver: 1 , exceptions: 1 , severityLevel: 0 , properties: 0 , measurements: 0 }; var _self = this; _self.ver = 2; if (!_isExceptionInternal(exception)) { if (!properties) { properties = {}; } _self[_DYN_EXCEPTIONS ] = [new _ExceptionDetails(logger, exception, properties)]; _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); if (severityLevel) { _self[_DYN_SEVERITY_LEVEL ] = severityLevel; } if (id) { _self.id = id; } } else { _self[_DYN_EXCEPTIONS ] = exception[_DYN_EXCEPTIONS ] || []; _self[_DYN_PROPERTIES ] = exception[_DYN_PROPERTIES ]; _self[_DYN_MEASUREMENTS$1 ] = exception[_DYN_MEASUREMENTS$1 ]; if (exception[_DYN_SEVERITY_LEVEL ]) { _self[_DYN_SEVERITY_LEVEL ] = exception[_DYN_SEVERITY_LEVEL ]; } if (exception.id) { _self.id = exception.id; } if (exception[_DYN_PROBLEM_GROUP ]) { _self[_DYN_PROBLEM_GROUP ] = exception[_DYN_PROBLEM_GROUP ]; } if (!isNullOrUndefined(exception[_DYN_IS_MANUAL ])) { _self[_DYN_IS_MANUAL ] = exception[_DYN_IS_MANUAL ]; } } } Exception.CreateAutoException = function (message, url, lineNumber, columnNumber, error, evt, stack, errorSrc) { var _a; var errorType = _getErrorType(error || evt || message); return _a = {}, _a[_DYN_MESSAGE$1 ] = _formatMessage(message, errorType), _a.url = url, _a.lineNumber = lineNumber, _a.columnNumber = columnNumber, _a.error = _formatErrorCode(error || evt || message), _a.evt = _formatErrorCode(evt || message), _a[_DYN_TYPE_NAME ] = errorType, _a.stackDetails = _getStackFromErrorObj(stack || error || evt), _a.errorSrc = errorSrc, _a; }; Exception.CreateFromInterface = function (logger, exception, properties, measurements) { var exceptions = exception[_DYN_EXCEPTIONS ] && arrMap(exception[_DYN_EXCEPTIONS ], function (ex) { return _ExceptionDetails[_DYN__CREATE_FROM_INTERFA1 ](logger, ex); }); var exceptionData = new Exception(logger, __assignFn(__assignFn({}, exception), { exceptions: exceptions }), properties, measurements); return exceptionData; }; Exception.prototype.toInterface = function () { var _a; var _b = this, exceptions = _b.exceptions, properties = _b.properties, measurements = _b.measurements, severityLevel = _b.severityLevel, problemGroup = _b.problemGroup, id = _b.id, isManual = _b.isManual; var exceptionDetailsInterface = exceptions instanceof Array && arrMap(exceptions, function (exception) { return exception.toInterface(); }) || undefined; return _a = { ver: "4.0" }, _a[_DYN_EXCEPTIONS ] = exceptionDetailsInterface, _a.severityLevel = severityLevel, _a.properties = properties, _a.measurements = measurements, _a.problemGroup = problemGroup, _a.id = id, _a.isManual = isManual, _a; }; Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) { var _a; return { exceptions: [ (_a = {}, _a[_DYN_HAS_FULL_STACK ] = true, _a.message = message, _a.stack = details, _a.typeName = typeName, _a) ] }; }; Exception.envelopeType = "Microsoft.ApplicationInsights.{0}.Exception"; Exception.dataType = "ExceptionData"; Exception.formatError = _formatErrorCode; return Exception; }()); var _ExceptionDetails = /** @class */ (function () { function _ExceptionDetails(logger, exception, properties) { this.aiDataContract = { id: 0 , outerId: 0 , typeName: 1 , message: 1 , hasFullStack: 0 , stack: 0 , parsedStack: 2 }; var _self = this; if (!_isExceptionDetailsInternal(exception)) { var error = exception; var evt = error && error.evt; if (!isError(error)) { error = error[strError] || evt || error; } _self[_DYN_TYPE_NAME ] = dataSanitizeString(logger, _getErrorType(error)) || strNotSpecified; _self[_DYN_MESSAGE$1 ] = dataSanitizeMessage(logger, _formatMessage(exception || error, _self[_DYN_TYPE_NAME ])) || strNotSpecified; var stack = exception[strStackDetails] || _getStackFromErrorObj(exception); _self[_DYN_PARSED_STACK ] = _parseStack(stack); if (isArray(_self[_DYN_PARSED_STACK ])) { arrMap(_self[_DYN_PARSED_STACK ], function (frame) { frame[_DYN_ASSEMBLY ] = dataSanitizeString(logger, frame[_DYN_ASSEMBLY ]); frame[_DYN_FILE_NAME ] = dataSanitizeString(logger, frame[_DYN_FILE_NAME ]); }); } _self[strStack] = dataSanitizeException(logger, _formatStackTrace(stack)); _self.hasFullStack = isArray(_self.parsedStack) && _self.parsedStack[_DYN_LENGTH$4 ] > 0; if (properties) { properties[_DYN_TYPE_NAME ] = properties[_DYN_TYPE_NAME ] || _self[_DYN_TYPE_NAME ]; } } else { _self[_DYN_TYPE_NAME ] = exception[_DYN_TYPE_NAME ]; _self[_DYN_MESSAGE$1 ] = exception[_DYN_MESSAGE$1 ]; _self[strStack] = exception[strStack]; _self[_DYN_PARSED_STACK ] = exception[_DYN_PARSED_STACK ] || []; _self[_DYN_HAS_FULL_STACK ] = exception[_DYN_HAS_FULL_STACK ]; } } _ExceptionDetails.prototype.toInterface = function () { var _a; var _self = this; var parsedStack = _self[_DYN_PARSED_STACK ] instanceof Array && arrMap(_self[_DYN_PARSED_STACK ], function (frame) { return frame.toInterface(); }); var exceptionDetailsInterface = (_a = { id: _self.id, outerId: _self.outerId, typeName: _self[_DYN_TYPE_NAME ], message: _self[_DYN_MESSAGE$1 ], hasFullStack: _self[_DYN_HAS_FULL_STACK ], stack: _self[strStack] }, _a[_DYN_PARSED_STACK ] = parsedStack || undefined, _a); return exceptionDetailsInterface; }; _ExceptionDetails.CreateFromInterface = function (logger, exception) { var parsedStack = (exception[_DYN_PARSED_STACK ] instanceof Array && arrMap(exception[_DYN_PARSED_STACK ], function (frame) { return _StackFrame[_DYN__CREATE_FROM_INTERFA1 ](frame); })) || exception[_DYN_PARSED_STACK ]; var exceptionDetails = new _ExceptionDetails(logger, __assignFn(__assignFn({}, exception), { parsedStack: parsedStack })); return exceptionDetails; }; return _ExceptionDetails; }()); var _StackFrame = /** @class */ (function () { function _StackFrame(sourceFrame, level) { this.aiDataContract = { level: 1 , method: 1 , assembly: 0 , fileName: 0 , line: 0 }; var _self = this; _self[_DYN_SIZE_IN_BYTES ] = 0; if (typeof sourceFrame === "string") { var frame = sourceFrame; _self[_DYN_LEVEL ] = level; _self[_DYN_METHOD$1 ] = NoMethod; _self[_DYN_ASSEMBLY ] = strTrim(frame); _self[_DYN_FILE_NAME ] = ""; _self[_DYN_LINE ] = 0; var matches = frame.match(_StackFrame.regex); if (matches && matches[_DYN_LENGTH$4 ] >= 5) { _self[_DYN_METHOD$1 ] = strTrim(matches[2]) || _self[_DYN_METHOD$1 ]; _self[_DYN_FILE_NAME ] = strTrim(matches[4]); _self[_DYN_LINE ] = parseInt(matches[5]) || 0; } } else { _self[_DYN_LEVEL ] = sourceFrame[_DYN_LEVEL ]; _self[_DYN_METHOD$1 ] = sourceFrame[_DYN_METHOD$1 ]; _self[_DYN_ASSEMBLY ] = sourceFrame[_DYN_ASSEMBLY ]; _self[_DYN_FILE_NAME ] = sourceFrame[_DYN_FILE_NAME ]; _self[_DYN_LINE ] = sourceFrame[_DYN_LINE ]; _self[_DYN_SIZE_IN_BYTES ] = 0; } _self.sizeInBytes += _self.method[_DYN_LENGTH$4 ]; _self.sizeInBytes += _self.fileName[_DYN_LENGTH$4 ]; _self.sizeInBytes += _self.assembly[_DYN_LENGTH$4 ]; _self[_DYN_SIZE_IN_BYTES ] += _StackFrame.baseSize; _self.sizeInBytes += _self.level.toString()[_DYN_LENGTH$4 ]; _self.sizeInBytes += _self.line.toString()[_DYN_LENGTH$4 ]; } _StackFrame.CreateFromInterface = function (frame) { return new _StackFrame(frame, null ); }; _StackFrame.prototype.toInterface = function () { var _self = this; return { level: _self[_DYN_LEVEL ], method: _self[_DYN_METHOD$1 ], assembly: _self[_DYN_ASSEMBLY ], fileName: _self[_DYN_FILE_NAME ], line: _self[_DYN_LINE ] }; }; _StackFrame.regex = /^([\s]+at)?[\s]{0,50}([^\@\()]+?)[\s]{0,50}(\@|\()([^\(\n]+):([0-9]+):([0-9]+)(\)?)$/; _StackFrame.baseSize = 58; return _StackFrame; }()); var DataPoint = /** @class */ (function () { function DataPoint() { this.aiDataContract = { name: 1 , kind: 0 , value: 1 , count: 0 , min: 0 , max: 0 , stdDev: 0 }; this.kind = 0 ; } return DataPoint; }()); var Metric = /** @class */ (function () { function Metric(logger, name, value, count, min, max, stdDev, properties, measurements) { this.aiDataContract = { ver: 1 , metrics: 1 , properties: 0 }; var _self = this; _self.ver = 2; var dataPoint = new DataPoint(); dataPoint[_DYN_COUNT$1 ] = count > 0 ? count : undefined; dataPoint.max = isNaN(max) || max === null ? undefined : max; dataPoint.min = isNaN(min) || min === null ? undefined : min; dataPoint[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; dataPoint.value = value; dataPoint.stdDev = isNaN(stdDev) || stdDev === null ? undefined : stdDev; _self.metrics = [dataPoint]; _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); } Metric.envelopeType = "Microsoft.ApplicationInsights.{0}.Metric"; Metric.dataType = "MetricData"; return Metric; }()); var PageView = /** @class */ (function () { function PageView(logger, name, url, durationMs, properties, measurements, id) { this.aiDataContract = { ver: 1 , name: 0 , url: 0 , duration: 0 , properties: 0 , measurements: 0 , id: 0 }; var _self = this; _self.ver = 2; _self.id = dataSanitizeId(logger, id); _self.url = dataSanitizeUrl(logger, url); _self[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; if (!isNaN(durationMs)) { _self[_DYN_DURATION$1 ] = msToTimeSpan(durationMs); } _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); } PageView.envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview"; PageView.dataType = "PageviewData"; return PageView; }()); var RemoteDependencyData = /** @class */ (function () { function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, requestAPI, correlationContext, properties, measurements) { if (requestAPI === void 0) { requestAPI = "Ajax"; } this.aiDataContract = { id: 1 , ver: 1 , name: 0 , resultCode: 0 , duration: 0 , success: 0 , data: 0 , target: 0 , type: 0 , properties: 0 , measurements: 0 , kind: 0 , value: 0 , count: 0 , min: 0 , max: 0 , stdDev: 0 , dependencyKind: 0 , dependencySource: 0 , commandName: 0 , dependencyTypeName: 0 }; var _self = this; _self.ver = 2; _self.id = id; _self[_DYN_DURATION$1 ] = msToTimeSpan(value); _self.success = success; _self.resultCode = resultCode + ""; _self.type = dataSanitizeString(logger, requestAPI); var dependencyFields = AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName); _self.data = dataSanitizeUrl(logger, commandName) || dependencyFields.data; _self.target = dataSanitizeString(logger, dependencyFields.target); if (correlationContext) { _self.target = "".concat(_self.target, " | ").concat(correlationContext); } _self[_DYN_NAME$2 ] = dataSanitizeString(logger, dependencyFields[_DYN_NAME$2 ]); _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); } RemoteDependencyData.envelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency"; RemoteDependencyData.dataType = "RemoteDependencyData"; return RemoteDependencyData; }()); var Trace = /** @class */ (function () { function Trace(logger, message, severityLevel, properties, measurements) { this.aiDataContract = { ver: 1 , message: 1 , severityLevel: 0 , properties: 0 }; var _self = this; _self.ver = 2; message = message || strNotSpecified; _self[_DYN_MESSAGE$1 ] = dataSanitizeMessage(logger, message); _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); if (severityLevel) { _self[_DYN_SEVERITY_LEVEL ] = severityLevel; } } Trace.envelopeType = "Microsoft.ApplicationInsights.{0}.Message"; Trace.dataType = "MessageData"; return Trace; }()); var PageViewPerformance = /** @class */ (function () { function PageViewPerformance(logger, name, url, unused, properties, measurements, cs4BaseData) { this.aiDataContract = { ver: 1 , name: 0 , url: 0 , duration: 0 , perfTotal: 0 , networkConnect: 0 , sentRequest: 0 , receivedResponse: 0 , domProcessing: 0 , properties: 0 , measurements: 0 }; var _self = this; _self.ver = 2; _self.url = dataSanitizeUrl(logger, url); _self[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); if (cs4BaseData) { _self.domProcessing = cs4BaseData.domProcessing; _self[_DYN_DURATION$1 ] = cs4BaseData[_DYN_DURATION$1 ]; _self.networkConnect = cs4BaseData.networkConnect; _self.perfTotal = cs4BaseData.perfTotal; _self[_DYN_RECEIVED_RESPONSE ] = cs4BaseData[_DYN_RECEIVED_RESPONSE ]; _self.sentRequest = cs4BaseData.sentRequest; } } PageViewPerformance.envelopeType = "Microsoft.ApplicationInsights.{0}.PageviewPerformance"; PageViewPerformance.dataType = "PageviewPerformanceData"; return PageViewPerformance; }()); var Data = /** @class */ (function () { function Data(baseType, data) { this.aiDataContract = { baseType: 1 , baseData: 1 }; this.baseType = baseType; this.baseData = data; } return Data; }()); var SeverityLevel = createEnumStyle({ Verbose: 0 , Information: 1 , Warning: 2 , Error: 3 , Critical: 4 }); var ConfigurationManager = /** @class */ (function () { function ConfigurationManager() { } ConfigurationManager.getConfig = function (config, field, identifier, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var configValue; if (identifier && config[_DYN_EXTENSION_CONFIG ] && config[_DYN_EXTENSION_CONFIG ][identifier] && !isNullOrUndefined(config[_DYN_EXTENSION_CONFIG ][identifier][field])) { configValue = config[_DYN_EXTENSION_CONFIG ][identifier][field]; } else { configValue = config[field]; } return !isNullOrUndefined(configValue) ? configValue : defaultValue; }; return ConfigurationManager; }()); function _aiNameFunc(baseName) { var aiName = "ai." + baseName + "."; return function (name) { return aiName + name; }; } var _aiApplication = _aiNameFunc("application"); var _aiDevice = _aiNameFunc("device"); var _aiLocation = _aiNameFunc("location"); var _aiOperation = _aiNameFunc("operation"); var _aiSession = _aiNameFunc("session"); var _aiUser = _aiNameFunc("user"); var _aiCloud = _aiNameFunc("cloud"); var _aiInternal = _aiNameFunc("internal"); var ContextTagKeys = /** @class */ (function (_super) { __extendsFn(ContextTagKeys, _super); function ContextTagKeys() { return _super.call(this) || this; } return ContextTagKeys; }(createClassFromInterface({ applicationVersion: _aiApplication("ver"), applicationBuild: _aiApplication("build"), applicationTypeId: _aiApplication("typeId"), applicationId: _aiApplication("applicationId"), applicationLayer: _aiApplication("layer"), deviceId: _aiDevice("id"), deviceIp: _aiDevice("ip"), deviceLanguage: _aiDevice("language"), deviceLocale: _aiDevice("locale"), deviceModel: _aiDevice("model"), deviceFriendlyName: _aiDevice("friendlyName"), deviceNetwork: _aiDevice("network"), deviceNetworkName: _aiDevice("networkName"), deviceOEMName: _aiDevice("oemName"), deviceOS: _aiDevice("os"), deviceOSVersion: _aiDevice("osVersion"), deviceRoleInstance: _aiDevice("roleInstance"), deviceRoleName: _aiDevice("roleName"), deviceScreenResolution: _aiDevice("screenResolution"), deviceType: _aiDevice("type"), deviceMachineName: _aiDevice("machineName"), deviceVMName: _aiDevice("vmName"), deviceBrowser: _aiDevice("browser"), deviceBrowserVersion: _aiDevice("browserVersion"), locationIp: _aiLocation("ip"), locationCountry: _aiLocation("country"), locationProvince: _aiLocation("province"), locationCity: _aiLocation("city"), operationId: _aiOperation("id"), operationName: _aiOperation("name"), operationParentId: _aiOperation("parentId"), operationRootId: _aiOperation("rootId"), operationSyntheticSource: _aiOperation("syntheticSource"), operationCorrelationVector: _aiOperation("correlationVector"), sessionId: _aiSession("id"), sessionIsFirst: _aiSession("isFirst"), sessionIsNew: _aiSession("isNew"), userAccountAcquisitionDate: _aiUser("accountAcquisitionDate"), userAccountId: _aiUser("accountId"), userAgent: _aiUser("userAgent"), userId: _aiUser("id"), userStoreRegion: _aiUser("storeRegion"), userAuthUserId: _aiUser("authUserId"), userAnonymousUserAcquisitionDate: _aiUser("anonUserAcquisitionDate"), userAuthenticatedUserAcquisitionDate: _aiUser("authUserAcquisitionDate"), cloudName: _aiCloud("name"), cloudRole: _aiCloud("role"), cloudRoleVer: _aiCloud("roleVer"), cloudRoleInstance: _aiCloud("roleInstance"), cloudEnvironment: _aiCloud("environment"), cloudLocation: _aiCloud("location"), cloudDeploymentUnit: _aiCloud("deploymentUnit"), internalNodeName: _aiInternal("nodeName"), internalSdkVersion: _aiInternal("sdkVersion"), internalAgentVersion: _aiInternal("agentVersion"), internalSnippet: _aiInternal("snippet"), internalSdkSrc: _aiInternal("sdkSrc") }))); function createTelemetryItem(item, baseType, envelopeName, logger, customProperties, systemProperties) { var _a; envelopeName = dataSanitizeString(logger, envelopeName) || strNotSpecified; if (isNullOrUndefined(item) || isNullOrUndefined(baseType) || isNullOrUndefined(envelopeName)) { throwError("Input doesn't contain all required fields"); } var iKey = ""; if (item[strIkey]) { iKey = item[strIkey]; delete item[strIkey]; } var telemetryItem = (_a = {}, _a[_DYN_NAME$2 ] = envelopeName, _a.time = toISOString(new Date()), _a.iKey = iKey, _a.ext = systemProperties ? systemProperties : {}, _a.tags = [], _a.data = {}, _a.baseType = baseType, _a.baseData = item , _a); if (!isNullOrUndefined(customProperties)) { objForEachKey(customProperties, function (prop, value) { telemetryItem.data[prop] = value; }); } return telemetryItem; } var TelemetryItemCreator = /** @class */ (function () { function TelemetryItemCreator() { } TelemetryItemCreator.create = createTelemetryItem; return TelemetryItemCreator; }()); var Extensions = { UserExt: "user", DeviceExt: "device", TraceExt: "trace", WebExt: "web", AppExt: "app", OSExt: "os", SessionExt: "ses", SDKExt: "sdk" }; var CtxTagKeys = new ContextTagKeys(); var PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin"; var BreezeChannelIdentifier = "AppInsightsChannelPlugin"; var AnalyticsPluginIdentifier = "ApplicationInsightsAnalytics"; var STR_DURATION$1 = "duration"; var STR_PROPERTIES = "properties"; var _DYN_REQUEST_URL = "requestUrl"; var _DYN_INST = "inst"; var _DYN_LENGTH$3 = "length"; var _DYN_TRACE_ID$1 = "traceID"; var _DYN_SPAN_ID = "spanID"; var _DYN_TRACE_FLAGS = "traceFlags"; var _DYN_CONTEXT$1 = "context"; var _DYN_ABORTED = "aborted"; var _DYN_TRACE_ID0 = "traceId"; var _DYN_SPAN_ID1 = "spanId"; var _DYN_CORE$1 = "core"; var _DYN_INCLUDE_CORRELATION_2 = "includeCorrelationHeaders"; var _DYN_CAN_INCLUDE_CORRELAT3 = "canIncludeCorrelationHeader"; var _DYN_GET_ABSOLUTE_URL = "getAbsoluteUrl"; var _DYN_HEADERS = "headers"; var _DYN_REQUEST_HEADERS = "requestHeaders"; var _DYN_APP_ID = "appId"; var _DYN_SET_REQUEST_HEADER$1 = "setRequestHeader"; var _DYN_TRACK_DEPENDENCY_DAT4 = "trackDependencyDataInternal"; var _DYN_DISTRIBUTED_TRACING_5 = "distributedTracingMode"; var _DYN_START_TIME = "startTime"; var _DYN_TO_LOWER_CASE = "toLowerCase"; var _DYN_ENABLE_REQUEST_HEADE6 = "enableRequestHeaderTracking"; var _DYN_ENABLE_AJAX_ERROR_ST7 = "enableAjaxErrorStatusText"; var _DYN_ENABLE_AJAX_PERF_TRA8 = "enableAjaxPerfTracking"; var _DYN_MAX_AJAX_CALLS_PER_V9 = "maxAjaxCallsPerView"; var _DYN_ENABLE_RESPONSE_HEAD10 = "enableResponseHeaderTracking"; var _DYN_EXCLUDE_REQUEST_FROM11 = "excludeRequestFromAutoTrackingPatterns"; var _DYN_ADD_REQUEST_CONTEXT = "addRequestContext"; var _DYN_DISABLE_AJAX_TRACKIN12 = "disableAjaxTracking"; var _DYN_DISABLE_FETCH_TRACKI13 = "disableFetchTracking"; var _DYN_STATUS = "status"; var _DYN_STATUS_TEXT = "statusText"; var _DYN_HEADER_MAP = "headerMap"; var _DYN_OPEN_DONE = "openDone"; var _DYN_SEND_DONE = "sendDone"; var _DYN_REQUEST_SENT_TIME = "requestSentTime"; var _DYN_ABORT_DONE = "abortDone"; var _DYN_GET_TRACE_ID = "getTraceId"; var _DYN_GET_TRACE_FLAGS = "getTraceFlags"; var _DYN_METHOD = "method"; var _DYN_ERROR_STATUS_TEXT = "errorStatusText"; var _DYN_STATE_CHANGE_ATTACHE14 = "stateChangeAttached"; var _DYN_RESPONSE_TEXT = "responseText"; var _DYN_RESPONSE_FINISHED_TI15 = "responseFinishedTime"; var _DYN__CREATE_TRACK_ITEM = "CreateTrackItem"; var _DYN_RESPONSE = "response"; var _DYN_GET_ALL_RESPONSE_HEA16 = "getAllResponseHeaders"; var _DYN_GET_PART_APROPS = "getPartAProps"; var _DYN_GET_CORRELATION_CONT17 = "getCorrelationContext"; var _DYN_PERF_MARK = "perfMark"; var _DYN_AJAX_PERF_LOOKUP_DEL18 = "ajaxPerfLookupDelay"; var _DYN_NAME$1 = "name"; var _DYN_PERF_TIMING = "perfTiming"; var _DYN_CORRELATION_CONTEXT = "correlationContext"; var _DYN_AJAX_TOTAL_DURATION = "ajaxTotalDuration"; var _DYN_EVENT_TRACE_CTX = "eventTraceCtx"; function _calcPerfDuration(resourceEntry, start, end) { var result = 0; var from = resourceEntry[start]; var to = resourceEntry[end]; if (from && to) { result = dateTimeUtilsDuration(from, to); } return result; } function _setPerfDuration(props, name, resourceEntry, start, end) { var result = 0; var value = _calcPerfDuration(resourceEntry, start, end); if (value) { result = _setPerfValue(props, name, msToTimeSpan(value)); } return result; } function _setPerfValue(props, name, value) { var strPerf = "ajaxPerf"; var result = 0; if (props && name && value) { var perfData = props[strPerf] = (props[strPerf] || {}); perfData[name] = value; result = 1; } return result; } function _populatePerfData(ajaxData, dependency) { var resourceEntry = ajaxData[_DYN_PERF_TIMING ]; var props = dependency[STR_PROPERTIES ] || {}; var propsSet = 0; var strName = "name"; var strStart = "Start"; var strEnd = "End"; var strDomainLookup = "domainLookup"; var strConnect = "connect"; var strRedirect = "redirect"; var strRequest = "request"; var strResponse = "response"; var strStartTime = "startTime"; var strDomainLookupStart = strDomainLookup + strStart; var strDomainLookupEnd = strDomainLookup + strEnd; var strConnectStart = strConnect + strStart; var strConnectEnd = strConnect + strEnd; var strRequestStart = strRequest + strStart; var strRequestEnd = strRequest + strEnd; var strResponseStart = strResponse + strStart; var strResponseEnd = strResponse + strEnd; var strRedirectStart = strRedirect + strStart; var strRedirectEnd = strRedirect = strEnd; var strTransferSize = "transferSize"; var strEncodedBodySize = "encodedBodySize"; var strDecodedBodySize = "decodedBodySize"; var strServerTiming = "serverTiming"; if (resourceEntry) { propsSet |= _setPerfDuration(props, strRedirect, resourceEntry, strRedirectStart, strRedirectEnd); propsSet |= _setPerfDuration(props, strDomainLookup, resourceEntry, strDomainLookupStart, strDomainLookupEnd); propsSet |= _setPerfDuration(props, strConnect, resourceEntry, strConnectStart, strConnectEnd); propsSet |= _setPerfDuration(props, strRequest, resourceEntry, strRequestStart, strRequestEnd); propsSet |= _setPerfDuration(props, strResponse, resourceEntry, strResponseStart, strResponseEnd); propsSet |= _setPerfDuration(props, "networkConnect", resourceEntry, strStartTime, strConnectEnd); propsSet |= _setPerfDuration(props, "sentRequest", resourceEntry, strRequestStart, strResponseEnd); var duration = resourceEntry[STR_DURATION$1 ]; if (!duration) { duration = _calcPerfDuration(resourceEntry, strStartTime, strResponseEnd) || 0; } propsSet |= _setPerfValue(props, STR_DURATION$1, duration); propsSet |= _setPerfValue(props, "perfTotal", duration); var serverTiming = resourceEntry[strServerTiming]; if (serverTiming) { var server_1 = {}; arrForEach(serverTiming, function (value, idx) { var name = normalizeJsName(value[strName] || "" + idx); var newValue = server_1[name] || {}; objForEachKey(value, function (key, val) { if (key !== strName && isString(val) || isNumber(val)) { if (newValue[key]) { val = newValue[key] + ";" + val; } if (val || !isString(val)) { newValue[key] = val; } } }); server_1[name] = newValue; }); propsSet |= _setPerfValue(props, strServerTiming, server_1); } propsSet |= _setPerfValue(props, strTransferSize, resourceEntry[strTransferSize]); propsSet |= _setPerfValue(props, strEncodedBodySize, resourceEntry[strEncodedBodySize]); propsSet |= _setPerfValue(props, strDecodedBodySize, resourceEntry[strDecodedBodySize]); } else { if (ajaxData[_DYN_PERF_MARK ]) { propsSet |= _setPerfValue(props, "missing", ajaxData.perfAttempts); } } if (propsSet) { dependency[STR_PROPERTIES ] = props; } } var XHRMonitoringState = /** @class */ (function () { function XHRMonitoringState() { var self = this; self[_DYN_OPEN_DONE ] = false; self.setRequestHeaderDone = false; self[_DYN_SEND_DONE ] = false; self[_DYN_ABORT_DONE ] = false; self[_DYN_STATE_CHANGE_ATTACHE14 ] = false; } return XHRMonitoringState; }()); var ajaxRecord = /** @class */ (function () { function ajaxRecord(traceId, spanId, logger, traceCtx) { var _a; var self = this; var _logger = logger; var strResponseText = "responseText"; self[_DYN_PERF_MARK ] = null; self.completed = false; self.requestHeadersSize = null; self[_DYN_REQUEST_HEADERS ] = null; self.responseReceivingDuration = null; self.callbackDuration = null; self[_DYN_AJAX_TOTAL_DURATION ] = null; self[_DYN_ABORTED ] = 0; self.pageUrl = null; self[_DYN_REQUEST_URL ] = null; self.requestSize = 0; self[_DYN_METHOD ] = null; self[_DYN_STATUS ] = null; self[_DYN_REQUEST_SENT_TIME ] = null; self.responseStartedTime = null; self[_DYN_RESPONSE_FINISHED_TI15 ] = null; self.callbackFinishedTime = null; self.endTime = null; self.xhrMonitoringState = new XHRMonitoringState(); self.clientFailure = 0; self[_DYN_TRACE_ID$1 ] = traceId; self[_DYN_SPAN_ID ] = spanId; self[_DYN_TRACE_FLAGS ] = traceCtx === null || traceCtx === void 0 ? void 0 : traceCtx.getTraceFlags(); if (traceCtx) { self[_DYN_EVENT_TRACE_CTX ] = (_a = {}, _a[_DYN_TRACE_ID0 ] = traceCtx[_DYN_GET_TRACE_ID ](), _a[_DYN_SPAN_ID1 ] = traceCtx.getSpanId(), _a[_DYN_TRACE_FLAGS ] = traceCtx[_DYN_GET_TRACE_FLAGS ](), _a); } else { self[_DYN_EVENT_TRACE_CTX ] = null; } dynamicProto(ajaxRecord, self, function (self) { self.getAbsoluteUrl = function () { return self[_DYN_REQUEST_URL ] ? urlGetAbsoluteUrl(self[_DYN_REQUEST_URL ]) : null; }; self.getPathName = function () { return self[_DYN_REQUEST_URL ] ? dataSanitizeUrl(_logger, urlGetCompleteUrl(self[_DYN_METHOD ], self[_DYN_REQUEST_URL ])) : null; }; self[_DYN__CREATE_TRACK_ITEM ] = function (ajaxType, enableRequestHeaderTracking, getResponse) { var _a; self.ajaxTotalDuration = Math.round(dateTimeUtilsDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000; if (self[_DYN_AJAX_TOTAL_DURATION ] < 0) { return null; } var dependency = (_a = { id: "|" + self[_DYN_TRACE_ID$1 ] + "." + self[_DYN_SPAN_ID ], target: self[_DYN_GET_ABSOLUTE_URL ]() }, _a[_DYN_NAME$1 ] = self.getPathName(), _a.type = ajaxType, _a[_DYN_START_TIME ] = null, _a.duration = self[_DYN_AJAX_TOTAL_DURATION ], _a.success = (+(self[_DYN_STATUS ])) >= 200 && (+(self[_DYN_STATUS ])) < 400, _a.responseCode = (+(self[_DYN_STATUS ])), _a[STR_PROPERTIES] = { HttpMethod: self[_DYN_METHOD ] }, _a); var props = dependency[STR_PROPERTIES]; if (self[_DYN_ABORTED ]) { props[_DYN_ABORTED ] = true; } if (self[_DYN_REQUEST_SENT_TIME ]) { dependency[_DYN_START_TIME ] = new Date(); dependency[_DYN_START_TIME ].setTime(self[_DYN_REQUEST_SENT_TIME ]); } _populatePerfData(self, dependency); if (enableRequestHeaderTracking) { if (objKeys(self.requestHeaders)[_DYN_LENGTH$3 ] > 0) { props[_DYN_REQUEST_HEADERS ] = self[_DYN_REQUEST_HEADERS ]; } } if (getResponse) { var response = getResponse(); if (response) { var correlationContext = response[_DYN_CORRELATION_CONTEXT ]; if (correlationContext) { dependency.correlationContext = correlationContext; } if (response[_DYN_HEADER_MAP ]) { if (objKeys(response.headerMap)[_DYN_LENGTH$3 ] > 0) { props.responseHeaders = response[_DYN_HEADER_MAP ]; } } if (self[_DYN_ERROR_STATUS_TEXT ]) { if (self[_DYN_STATUS ] >= 400) { var responseType = response.type; if (responseType === "" || responseType === "text") { props.responseText = response.responseText ? response[_DYN_STATUS_TEXT ] + " - " + response[strResponseText] : response[_DYN_STATUS_TEXT ]; } if (responseType === "json") { props.responseText = response.response ? response[_DYN_STATUS_TEXT ] + " - " + JSON.stringify(response[_DYN_RESPONSE ]) : response[_DYN_STATUS_TEXT ]; } } else if (self[_DYN_STATUS ] === 0) { props.responseText = response[_DYN_STATUS_TEXT ] || ""; } } } } return dependency; }; self[_DYN_GET_PART_APROPS ] = function () { var _a; var partA = null; var traceCtx = self[_DYN_EVENT_TRACE_CTX ]; if (traceCtx && (traceCtx[_DYN_TRACE_ID0 ] || traceCtx[_DYN_SPAN_ID1 ])) { partA = {}; var traceExt = partA[Extensions.TraceExt] = (_a = {}, _a[_DYN_TRACE_ID$1 ] = traceCtx[_DYN_TRACE_ID0 ], _a.parentID = traceCtx[_DYN_SPAN_ID1 ], _a); if (!isNullOrUndefined(traceCtx[_DYN_TRACE_FLAGS ])) { traceExt[_DYN_TRACE_FLAGS ] = traceCtx[_DYN_TRACE_FLAGS ]; } } return partA; }; }); } ajaxRecord.__ieDyn=1; return ajaxRecord; }()); var AJAX_MONITOR_PREFIX = "ai.ajxmn."; var strDiagLog = "diagLog"; var strAjaxData = "ajaxData"; var STR_FETCH = "fetch"; var ERROR_HEADER = "Failed to monitor XMLHttpRequest"; var ERROR_PREFIX = ", monitoring data for this ajax call "; var ERROR_POSTFIX = ERROR_PREFIX + "may be incorrect."; var ERROR_NOT_SENT = ERROR_PREFIX + "won't be sent."; var CORRELATION_HEADER_ERROR = "Failed to get Request-Context correlation header as it may be not included in the response or not accessible."; var CUSTOM_REQUEST_CONTEXT_ERROR = "Failed to add custom defined request context as configured call back may missing a null check."; var FAILED_TO_CALCULATE_DURATION_ERROR = "Failed to calculate the duration of the "; var _markCount = 0; function _supportsFetch() { var _global = getGlobal(); if (!_global || isNullOrUndefined(_global.Request) || isNullOrUndefined(_global.Request[strShimPrototype]) || isNullOrUndefined(_global[STR_FETCH])) { return null; } return _global[STR_FETCH]; } var _isWebWorker$1 = null; function isWebWorker$1() { if (_isWebWorker$1 == null) { try { _isWebWorker$1 = !!(self && self instanceof WorkerGlobalScope); } catch (e) { _isWebWorker$1 = false; } } return _isWebWorker$1; } function _supportsAjaxMonitoring(ajaxMonitorInstance) { var result = false; if (isXhrSupported()) { var proto = XMLHttpRequest[strShimPrototype]; result = !isNullOrUndefined(proto) && !isNullOrUndefined(proto.open) && !isNullOrUndefined(proto.send) && !isNullOrUndefined(proto.abort); } var ieVer = getIEVersion(); if (ieVer && ieVer < 9) { result = false; } if (result) { try { var xhr = new XMLHttpRequest(); xhr[strAjaxData] = {}; var theOpen = XMLHttpRequest[strShimPrototype].open; XMLHttpRequest[strShimPrototype].open = theOpen; } catch (e) { result = false; _throwInternalCritical(ajaxMonitorInstance, 15 , "Failed to enable XMLHttpRequest monitoring, extension is not supported", { exception: dumpObj(e) }); } } return result; } function _getFailedAjaxDiagnosticsMessage(xhr) { var result = ""; try { if (xhr && xhr[strAjaxData] && xhr[strAjaxData][_DYN_REQUEST_URL ]) { result += "(url: '" + xhr[strAjaxData][_DYN_REQUEST_URL ] + "')"; } } catch (e) { } return result; } function _throwInternalCritical(ajaxMonitorInstance, msgId, message, properties, isUserAct) { _throwInternal(ajaxMonitorInstance[strDiagLog](), 1 , msgId, message, properties, isUserAct); } function _throwInternalWarning(ajaxMonitorInstance, msgId, message, properties, isUserAct) { _throwInternal(ajaxMonitorInstance[strDiagLog](), 2 , msgId, message, properties, isUserAct); } function _createErrorCallbackFunc(ajaxMonitorInstance, internalMessage, message) { return function (args) { _throwInternalCritical(ajaxMonitorInstance, internalMessage, message, { ajaxDiagnosticsMessage: _getFailedAjaxDiagnosticsMessage(args[_DYN_INST ]), exception: dumpObj(args.err) }); }; } function _indexOf(value, match) { if (value && match) { return value.indexOf(match); } return -1; } function _addHandler(container, id, theFunc) { var theHandler = { id: id, fn: theFunc }; container.push(theHandler); return { remove: function () { arrForEach(container, function (initializer, idx) { if (initializer.id === theHandler.id) { container.splice(idx, 1); return -1; } }); } }; } function _processDependencyContainer(core, container, details, message) { var result = true; arrForEach(container, function (theFunc, idx) { try { if (theFunc.fn.call(null, details) === false) { result = false; } } catch (e) { _throwInternal(core && core.logger, 1 , 64 , "Dependency " + message + " [#" + idx + "] failed: " + getExceptionName(e), { exception: dumpObj(e) }, true); } }); return result; } function _processDependencyListeners(listeners, core, ajaxData, xhr, input, init) { var initializersCount = listeners[_DYN_LENGTH$3 ]; if (initializersCount > 0) { var details = { core: core, xhr: xhr, input: input, init: init, traceId: ajaxData[_DYN_TRACE_ID$1 ], spanId: ajaxData[_DYN_SPAN_ID ], traceFlags: ajaxData[_DYN_TRACE_FLAGS ], context: ajaxData[_DYN_CONTEXT$1 ] || {}, aborted: !!ajaxData[_DYN_ABORTED ] }; _processDependencyContainer(core, listeners, details, "listener"); ajaxData[_DYN_TRACE_ID$1 ] = details[_DYN_TRACE_ID0 ]; ajaxData[_DYN_SPAN_ID ] = details[_DYN_SPAN_ID1 ]; ajaxData[_DYN_TRACE_FLAGS ] = details[_DYN_TRACE_FLAGS ]; ajaxData[_DYN_CONTEXT$1 ] = details[_DYN_CONTEXT$1 ]; } } var BLOB_CORE = "*.blob.core."; var DfltAjaxCorrelationHeaderExDomains = deepFreeze([ BLOB_CORE + "windows.net", BLOB_CORE + "chinacloudapi.cn", BLOB_CORE + "cloudapi.de", BLOB_CORE + "usgovcloudapi.net" ]); var _internalExcludeEndpoints = [ /https:\/\/[^\/]*(\.pipe\.aria|aria\.pipe|events\.data|collector\.azure)\.[^\/]+\/(OneCollector\/1|Collector\/3)\.0/i ]; function _getDefaultConfig$1() { var config = { maxAjaxCallsPerView: 500, disableAjaxTracking: false, disableFetchTracking: false, excludeRequestFromAutoTrackingPatterns: undefined, disableCorrelationHeaders: false, distributedTracingMode: 1 , correlationHeaderExcludedDomains: DfltAjaxCorrelationHeaderExDomains, correlationHeaderDomains: undefined, correlationHeaderExcludePatterns: undefined, appId: undefined, enableCorsCorrelation: false, enableRequestHeaderTracking: false, enableResponseHeaderTracking: false, enableAjaxErrorStatusText: false, enableAjaxPerfTracking: false, maxAjaxPerfLookupAttempts: 3, ajaxPerfLookupDelay: 25, ignoreHeaders: [ "Authorization", "X-API-Key", "WWW-Authenticate" ], addRequestContext: undefined, addIntEndpoints: true }; return config; } function _getEmptyConfig() { var emptyConfig = _getDefaultConfig$1(); objForEachKey(emptyConfig, function (value) { emptyConfig[value] = undefined; }); return emptyConfig; } var AjaxMonitor = /** @class */ (function (_super) { __extendsFn(AjaxMonitor, _super); function AjaxMonitor() { var _this = _super.call(this) || this; _this.identifier = AjaxMonitor.identifier; _this.priority = 120; var _fetchInitialized; var _xhrInitialized; var _currentWindowHost; var _config; var _enableRequestHeaderTracking; var _enableAjaxErrorStatusText; var _trackAjaxAttempts; var _context; var _isUsingW3CHeaders; var _isUsingAIHeaders; var _markPrefix; var _enableAjaxPerfTracking; var _maxAjaxCallsPerView; var _enableResponseHeaderTracking; var _disabledUrls; var _disableAjaxTracking; var _disableFetchTracking; var _excludeRequestFromAutoTrackingPatterns; var _addRequestContext; var _evtNamespace; var _dependencyHandlerId; var _dependencyListeners; var _dependencyInitializers; dynamicProto(AjaxMonitor, _this, function (_self, _base) { var _addHook = _base._addHook; _initDefaults(); _self.initialize = function (config, core, extensions, pluginChain) { if (!_self.isInitialized()) { _base.initialize(config, core, extensions, pluginChain); _evtNamespace = mergeEvtNamespace(createUniqueNamespace("ajax"), core && core.evtNamespace && core.evtNamespace()); _populateDefaults(config); _instrumentXhr(); _instrumentFetch(); _populateContext(); } }; _self._doTeardown = function () { _initDefaults(); }; _self.trackDependencyData = function (dependency, properties) { _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE$1 ], null, dependency, properties); }; _self[_DYN_INCLUDE_CORRELATION_2 ] = function (ajaxData, input, init, xhr) { var currentWindowHost = _self["_currentWindowHost"] || _currentWindowHost; _processDependencyListeners(_dependencyListeners, _self[_DYN_CORE$1 ], ajaxData, xhr, input, init); if (input) { if (CorrelationIdHelper[_DYN_CAN_INCLUDE_CORRELAT3 ](_config, ajaxData[_DYN_GET_ABSOLUTE_URL ](), currentWindowHost)) { if (!init) { init = {}; } var headers = new Headers(init[_DYN_HEADERS ] || (input instanceof Request ? (input[_DYN_HEADERS ] || {}) : {})); if (_isUsingAIHeaders) { var id = "|" + ajaxData[_DYN_TRACE_ID$1 ] + "." + ajaxData[_DYN_SPAN_ID ]; headers.set(RequestHeaders[3 ], id); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[3 ]] = id; } } var appId = _config[_DYN_APP_ID ] || (_context && _context[_DYN_APP_ID ]()); if (appId) { headers.set(RequestHeaders[0 ], RequestHeaders[2 ] + appId); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[0 ]] = RequestHeaders[2 ] + appId; } } if (_isUsingW3CHeaders) { var traceFlags = ajaxData[_DYN_TRACE_FLAGS ]; if (isNullOrUndefined(traceFlags)) { traceFlags = 0x01; } var traceParent = formatTraceParent(createTraceParent(ajaxData[_DYN_TRACE_ID$1 ], ajaxData[_DYN_SPAN_ID ], traceFlags)); headers.set(RequestHeaders[4 ], traceParent); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[4 ]] = traceParent; } } init[_DYN_HEADERS ] = headers; } return init; } else if (xhr) { if (CorrelationIdHelper[_DYN_CAN_INCLUDE_CORRELAT3 ](_config, ajaxData[_DYN_GET_ABSOLUTE_URL ](), currentWindowHost)) { if (_isUsingAIHeaders) { var id = "|" + ajaxData[_DYN_TRACE_ID$1 ] + "." + ajaxData[_DYN_SPAN_ID ]; xhr[_DYN_SET_REQUEST_HEADER$1 ](RequestHeaders[3 ], id); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[3 ]] = id; } } var appId = _config[_DYN_APP_ID ] || (_context && _context[_DYN_APP_ID ]()); if (appId) { xhr[_DYN_SET_REQUEST_HEADER$1 ](RequestHeaders[0 ], RequestHeaders[2 ] + appId); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[0 ]] = RequestHeaders[2 ] + appId; } } if (_isUsingW3CHeaders) { var traceFlags = ajaxData[_DYN_TRACE_FLAGS ]; if (isNullOrUndefined(traceFlags)) { traceFlags = 0x01; } var traceParent = formatTraceParent(createTraceParent(ajaxData[_DYN_TRACE_ID$1 ], ajaxData[_DYN_SPAN_ID ], traceFlags)); xhr[_DYN_SET_REQUEST_HEADER$1 ](RequestHeaders[4 ], traceParent); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[4 ]] = traceParent; } } } return xhr; } return undefined; }; _self[_DYN_TRACK_DEPENDENCY_DAT4 ] = function (dependency, properties, systemProperties) { if (_maxAjaxCallsPerView === -1 || _trackAjaxAttempts < _maxAjaxCallsPerView) { if ((_config[_DYN_DISTRIBUTED_TRACING_5 ] === 2 || _config[_DYN_DISTRIBUTED_TRACING_5 ] === 1 ) && typeof dependency.id === "string" && dependency.id[dependency.id[_DYN_LENGTH$3 ] - 1] !== ".") { dependency.id += "."; } if (isNullOrUndefined(dependency[_DYN_START_TIME ])) { dependency[_DYN_START_TIME ] = new Date(); } var item = createTelemetryItem(dependency, RemoteDependencyData.dataType, RemoteDependencyData.envelopeType, _self[strDiagLog](), properties, systemProperties); _self[_DYN_CORE$1 ].track(item); } else if (_trackAjaxAttempts === _maxAjaxCallsPerView) { _throwInternalCritical(_self, 55 , "Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.", true); } ++_trackAjaxAttempts; }; _self.addDependencyListener = function (dependencyListener) { return _addHandler(_dependencyListeners, _dependencyHandlerId++, dependencyListener); }; _self.addDependencyInitializer = function (dependencyInitializer) { return _addHandler(_dependencyInitializers, _dependencyHandlerId++, dependencyInitializer); }; function _initDefaults() { var location = getLocation(); _fetchInitialized = false; _xhrInitialized = false; _currentWindowHost = location && location.host && location.host[_DYN_TO_LOWER_CASE ](); _config = AjaxMonitor.getEmptyConfig(); _enableRequestHeaderTracking = false; _enableAjaxErrorStatusText = false; _trackAjaxAttempts = 0; _context = null; _isUsingW3CHeaders = false; _isUsingAIHeaders = false; _markPrefix = null; _enableAjaxPerfTracking = false; _maxAjaxCallsPerView = 0; _enableResponseHeaderTracking = false; _disabledUrls = {}; _disableAjaxTracking = false; _disableFetchTracking = false; _excludeRequestFromAutoTrackingPatterns = null; _addRequestContext = null; _evtNamespace = null; _dependencyHandlerId = 0; _dependencyListeners = []; _dependencyInitializers = []; } function _populateDefaults(config) { var ctx = createProcessTelemetryContext(null, config, _self[_DYN_CORE$1 ]); _config = _getEmptyConfig(); var defaultConfig = _getDefaultConfig$1(); objForEachKey(defaultConfig, function (field, value) { _config[field] = ctx.getConfig(AjaxMonitor.identifier, field, value); }); var distributedTracingMode = _config[_DYN_DISTRIBUTED_TRACING_5 ]; _enableRequestHeaderTracking = _config[_DYN_ENABLE_REQUEST_HEADE6 ]; _enableAjaxErrorStatusText = _config[_DYN_ENABLE_AJAX_ERROR_ST7 ]; _enableAjaxPerfTracking = _config[_DYN_ENABLE_AJAX_PERF_TRA8 ]; _maxAjaxCallsPerView = _config[_DYN_MAX_AJAX_CALLS_PER_V9 ]; _enableResponseHeaderTracking = _config[_DYN_ENABLE_RESPONSE_HEAD10 ]; _excludeRequestFromAutoTrackingPatterns = [].concat(_config[_DYN_EXCLUDE_REQUEST_FROM11 ] || [], _config.addIntEndpoints !== false ? _internalExcludeEndpoints : []); _addRequestContext = _config[_DYN_ADD_REQUEST_CONTEXT ]; _isUsingAIHeaders = distributedTracingMode === 0 || distributedTracingMode === 1 ; _isUsingW3CHeaders = distributedTracingMode === 1 || distributedTracingMode === 2 ; if (_enableAjaxPerfTracking) { var iKey = config.instrumentationKey || "unkwn"; if (iKey[_DYN_LENGTH$3 ] > 5) { _markPrefix = AJAX_MONITOR_PREFIX + iKey.substring(iKey[_DYN_LENGTH$3 ] - 5) + "."; } else { _markPrefix = AJAX_MONITOR_PREFIX + iKey + "."; } } _disableAjaxTracking = !!_config[_DYN_DISABLE_AJAX_TRACKIN12 ]; _disableFetchTracking = !!_config[_DYN_DISABLE_FETCH_TRACKI13 ]; } function _populateContext() { var propExt = _self[_DYN_CORE$1 ].getPlugin(PropertiesPluginIdentifier); if (propExt) { _context = propExt.plugin[_DYN_CONTEXT$1 ]; } } function _canIncludeHeaders(header) { var rlt = true; if (header || _config.ignoreHeaders) { arrForEach(_config.ignoreHeaders, (function (key) { if (key[_DYN_TO_LOWER_CASE ]() === header[_DYN_TO_LOWER_CASE ]()) { rlt = false; return -1; } })); } return rlt; } function _instrumentFetch() { var fetch = _supportsFetch(); if (!fetch) { return; } var global = getGlobal(); var isPolyfill = fetch.polyfill; if (!_disableFetchTracking && !_fetchInitialized) { _addHook(InstrumentFunc(global, STR_FETCH, { ns: _evtNamespace, req: function (callDetails, input, init) { var fetchData; if (!_disableFetchTracking && _fetchInitialized && !_isDisabledRequest(null, input, init) && !(isPolyfill && _xhrInitialized)) { var ctx = callDetails.ctx(); fetchData = _createFetchRecord(input, init); var newInit = _self[_DYN_INCLUDE_CORRELATION_2 ](fetchData, input, init); if (newInit !== init) { callDetails.set(1, newInit); } ctx.data = fetchData; } }, rsp: function (callDetails, input) { if (!_disableFetchTracking) { var fetchData_1 = callDetails.ctx().data; if (fetchData_1) { callDetails.rslt = callDetails.rslt.then(function (response) { _reportFetchMetrics(callDetails, (response || {})[_DYN_STATUS ], input, response, fetchData_1, function () { var ajaxResponse = { statusText: (response || {})[_DYN_STATUS_TEXT ], headerMap: null, correlationContext: _getFetchCorrelationContext(response) }; if (_enableResponseHeaderTracking && response) { var responseHeaderMap_1 = {}; response.headers.forEach(function (value, name) { if (_canIncludeHeaders(name)) { responseHeaderMap_1[name] = value; } }); ajaxResponse[_DYN_HEADER_MAP ] = responseHeaderMap_1; } return ajaxResponse; }); return response; })["catch"](function (reason) { _reportFetchMetrics(callDetails, 0, input, null, fetchData_1, null, { error: reason.message || dumpObj(reason) }); throw reason; }); } } }, hkErr: _createErrorCallbackFunc(_self, 15 , "Failed to monitor Window.fetch" + ERROR_POSTFIX) }, true, isWebWorker$1())); _fetchInitialized = true; } else if (isPolyfill) { _addHook(InstrumentFunc(global, STR_FETCH, { ns: _evtNamespace, req: function (callDetails, input, init) { _isDisabledRequest(null, input, init); } })); } if (isPolyfill) { global[STR_FETCH].polyfill = isPolyfill; } } function _hookProto(target, funcName, callbacks) { _addHook(InstrumentProto(target, funcName, callbacks)); } function _instrumentXhr() { if (_supportsAjaxMonitoring(_self) && !_disableAjaxTracking && !_xhrInitialized) { _hookProto(XMLHttpRequest, "open", { ns: _evtNamespace, req: function (args, method, url, async) { if (!_disableAjaxTracking) { var xhr = args[_DYN_INST ]; var ajaxData = xhr[strAjaxData]; if (!_isDisabledRequest(xhr, url) && _isMonitoredXhrInstance(xhr, true)) { if (!ajaxData || !ajaxData.xhrMonitoringState[_DYN_OPEN_DONE ]) { _openHandler(xhr, method, url, async); } _attachToOnReadyStateChange(xhr); } } }, hkErr: _createErrorCallbackFunc(_self, 15 , ERROR_HEADER + ".open" + ERROR_POSTFIX) }); _hookProto(XMLHttpRequest, "send", { ns: _evtNamespace, req: function (args, context) { if (!_disableAjaxTracking) { var xhr = args[_DYN_INST ]; var ajaxData = xhr[strAjaxData]; if (_isMonitoredXhrInstance(xhr) && !ajaxData.xhrMonitoringState[_DYN_SEND_DONE ]) { _createMarkId("xhr", ajaxData); ajaxData[_DYN_REQUEST_SENT_TIME ] = dateTimeUtilsNow(); _self[_DYN_INCLUDE_CORRELATION_2 ](ajaxData, undefined, undefined, xhr); ajaxData.xhrMonitoringState[_DYN_SEND_DONE ] = true; } } }, hkErr: _createErrorCallbackFunc(_self, 17 , ERROR_HEADER + ERROR_POSTFIX) }); _hookProto(XMLHttpRequest, "abort", { ns: _evtNamespace, req: function (args) { if (!_disableAjaxTracking) { var xhr = args[_DYN_INST ]; var ajaxData = xhr[strAjaxData]; if (_isMonitoredXhrInstance(xhr) && !ajaxData.xhrMonitoringState[_DYN_ABORT_DONE ]) { ajaxData[_DYN_ABORTED ] = 1; ajaxData.xhrMonitoringState[_DYN_ABORT_DONE ] = true; } } }, hkErr: _createErrorCallbackFunc(_self, 13 , ERROR_HEADER + ".abort" + ERROR_POSTFIX) }); _hookProto(XMLHttpRequest, "setRequestHeader", { ns: _evtNamespace, req: function (args, header, value) { if (!_disableAjaxTracking && _enableRequestHeaderTracking) { var xhr = args[_DYN_INST ]; if (_isMonitoredXhrInstance(xhr) && _canIncludeHeaders(header)) { xhr[strAjaxData][_DYN_REQUEST_HEADERS ][header] = value; } } }, hkErr: _createErrorCallbackFunc(_self, 71 , ERROR_HEADER + ".setRequestHeader" + ERROR_POSTFIX) }); _xhrInitialized = true; } } function _isDisabledRequest(xhr, request, init) { var isDisabled = false; var theUrl = ((!isString(request) ? (request || {}).url || "" : request) || "")[_DYN_TO_LOWER_CASE ](); arrForEach(_excludeRequestFromAutoTrackingPatterns, function (regex) { var theRegex = regex; if (isString(regex)) { theRegex = new RegExp(regex); } if (!isDisabled) { isDisabled = theRegex.test(theUrl); } }); if (isDisabled) { return isDisabled; } var idx = _indexOf(theUrl, "?"); var idx2 = _indexOf(theUrl, "#"); if (idx === -1 || (idx2 !== -1 && idx2 < idx)) { idx = idx2; } if (idx !== -1) { theUrl = theUrl.substring(0, idx); } if (!isNullOrUndefined(xhr)) { isDisabled = xhr[DisabledPropertyName] === true || theUrl[DisabledPropertyName] === true; } else if (!isNullOrUndefined(request)) { isDisabled = (typeof request === "object" ? request[DisabledPropertyName] === true : false) || (init ? init[DisabledPropertyName] === true : false); } if (!isDisabled && theUrl && isInternalApplicationInsightsEndpoint(theUrl)) { isDisabled = true; } if (isDisabled) { if (!_disabledUrls[theUrl]) { _disabledUrls[theUrl] = 1; } } else { if (_disabledUrls[theUrl]) { isDisabled = true; } } return isDisabled; } function _isMonitoredXhrInstance(xhr, excludeAjaxDataValidation) { var ajaxValidation = true; var initialized = _xhrInitialized; if (!isNullOrUndefined(xhr)) { ajaxValidation = excludeAjaxDataValidation === true || !isNullOrUndefined(xhr[strAjaxData]); } return initialized && ajaxValidation; } function _getDistributedTraceCtx() { var distributedTraceCtx = null; if (_self[_DYN_CORE$1 ] && _self[_DYN_CORE$1 ].getTraceCtx) { distributedTraceCtx = _self[_DYN_CORE$1 ].getTraceCtx(false); } if (!distributedTraceCtx && _context && _context.telemetryTrace) { distributedTraceCtx = createDistributedTraceContextFromTrace(_context.telemetryTrace); } return distributedTraceCtx; } function _openHandler(xhr, method, url, async) { var _a; var distributedTraceCtx = _getDistributedTraceCtx(); var traceID = (distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_ID ]()) || generateW3CId(); var spanID = generateW3CId().substr(0, 16); var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog](), (_a = _self.core) === null || _a === void 0 ? void 0 : _a.getTraceCtx()); ajaxData[_DYN_TRACE_FLAGS ] = distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_FLAGS ](); ajaxData[_DYN_METHOD ] = method; ajaxData[_DYN_REQUEST_URL ] = url; ajaxData.xhrMonitoringState[_DYN_OPEN_DONE ] = true; ajaxData[_DYN_REQUEST_HEADERS ] = {}; ajaxData.async = async; ajaxData[_DYN_ERROR_STATUS_TEXT ] = _enableAjaxErrorStatusText; xhr[strAjaxData] = ajaxData; } function _attachToOnReadyStateChange(xhr) { xhr[strAjaxData].xhrMonitoringState[_DYN_STATE_CHANGE_ATTACHE14 ] = eventOn(xhr, "readystatechange", function () { try { if (xhr && xhr.readyState === 4 && _isMonitoredXhrInstance(xhr)) { _onAjaxComplete(xhr); } } catch (e) { var exceptionText = dumpObj(e); if (!exceptionText || _indexOf(exceptionText[_DYN_TO_LOWER_CASE ](), "c00c023f") === -1) { _throwInternalCritical(_self, 16 , ERROR_HEADER + " 'readystatechange' event handler" + ERROR_POSTFIX, { ajaxDiagnosticsMessage: _getFailedAjaxDiagnosticsMessage(xhr), exception: exceptionText }); } } }, _evtNamespace); } function _getResponseText(xhr) { try { var responseType = xhr.responseType; if (responseType === "" || responseType === "text") { return xhr[_DYN_RESPONSE_TEXT ]; } } catch (e) { } return null; } function _onAjaxComplete(xhr) { var ajaxData = xhr[strAjaxData]; ajaxData[_DYN_RESPONSE_FINISHED_TI15 ] = dateTimeUtilsNow(); ajaxData[_DYN_STATUS ] = xhr[_DYN_STATUS ]; function _reportXhrError(e, failedProps) { var errorProps = failedProps || {}; errorProps["ajaxDiagnosticsMessage"] = _getFailedAjaxDiagnosticsMessage(xhr); if (e) { errorProps["exception"] = dumpObj(e); } _throwInternalWarning(_self, 14 , FAILED_TO_CALCULATE_DURATION_ERROR + "ajax call" + ERROR_NOT_SENT, errorProps); } _findPerfResourceEntry("xmlhttprequest", ajaxData, function () { try { var dependency = ajaxData[_DYN__CREATE_TRACK_ITEM ]("Ajax", _enableRequestHeaderTracking, function () { var ajaxResponse = { statusText: xhr[_DYN_STATUS_TEXT ], headerMap: null, correlationContext: _getAjaxCorrelationContext(xhr), type: xhr.responseType, responseText: _getResponseText(xhr), response: xhr[_DYN_RESPONSE ] }; if (_enableResponseHeaderTracking) { var headers = xhr[_DYN_GET_ALL_RESPONSE_HEA16 ](); if (headers) { var arr = strTrim(headers).split(/[\r\n]+/); var responseHeaderMap_2 = {}; arrForEach(arr, function (line) { var parts = line.split(": "); var header = parts.shift(); var value = parts.join(": "); if (_canIncludeHeaders(header)) { responseHeaderMap_2[header] = value; } }); ajaxResponse[_DYN_HEADER_MAP ] = responseHeaderMap_2; } } return ajaxResponse; }); var properties = void 0; try { if (!!_addRequestContext) { properties = _addRequestContext({ status: xhr[_DYN_STATUS ], xhr: xhr }); } } catch (e) { _throwInternalWarning(_self, 104 , CUSTOM_REQUEST_CONTEXT_ERROR); } if (dependency) { if (properties !== undefined) { dependency[STR_PROPERTIES ] = __assignFn(__assignFn({}, dependency.properties), properties); } var sysProperties = ajaxData[_DYN_GET_PART_APROPS ](); _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE$1 ], ajaxData, dependency, null, sysProperties); } else { _reportXhrError(null, { requestSentTime: ajaxData[_DYN_REQUEST_SENT_TIME ], responseFinishedTime: ajaxData[_DYN_RESPONSE_FINISHED_TI15 ] }); } } finally { try { xhr[strAjaxData] = null; } catch (e) { } } }, function (e) { _reportXhrError(e, null); }); } function _getAjaxCorrelationContext(xhr) { try { var responseHeadersString = xhr[_DYN_GET_ALL_RESPONSE_HEA16 ](); if (responseHeadersString !== null) { var index = _indexOf(responseHeadersString[_DYN_TO_LOWER_CASE ](), RequestHeaders[8 ]); if (index !== -1) { var responseHeader = xhr.getResponseHeader(RequestHeaders[0 ]); return CorrelationIdHelper[_DYN_GET_CORRELATION_CONT17 ](responseHeader); } } } catch (e) { _throwInternalWarning(_self, 18 , CORRELATION_HEADER_ERROR, { ajaxDiagnosticsMessage: _getFailedAjaxDiagnosticsMessage(xhr), exception: dumpObj(e) }); } } function _createMarkId(type, ajaxData) { if (ajaxData[_DYN_REQUEST_URL ] && _markPrefix && _enableAjaxPerfTracking) { var performance_1 = getPerformance(); if (performance_1 && isFunction(performance_1.mark)) { _markCount++; var markId = _markPrefix + type + "#" + _markCount; performance_1.mark(markId); var entries = performance_1.getEntriesByName(markId); if (entries && entries[_DYN_LENGTH$3 ] === 1) { ajaxData[_DYN_PERF_MARK ] = entries[0]; } } } } function _findPerfResourceEntry(initiatorType, ajaxData, trackCallback, reportError) { var perfMark = ajaxData[_DYN_PERF_MARK ]; var performance = getPerformance(); var maxAttempts = _config.maxAjaxPerfLookupAttempts; var retryDelay = _config[_DYN_AJAX_PERF_LOOKUP_DEL18 ]; var requestUrl = ajaxData[_DYN_REQUEST_URL ]; var attempt = 0; (function locateResourceTiming() { try { if (performance && perfMark) { attempt++; var perfTiming = null; var entries = performance.getEntries(); for (var lp = entries[_DYN_LENGTH$3 ] - 1; lp >= 0; lp--) { var entry = entries[lp]; if (entry) { if (entry.entryType === "resource") { if (entry.initiatorType === initiatorType && (_indexOf(entry[_DYN_NAME$1 ], requestUrl) !== -1 || _indexOf(requestUrl, entry[_DYN_NAME$1 ]) !== -1)) { perfTiming = entry; } } else if (entry.entryType === "mark" && entry[_DYN_NAME$1 ] === perfMark[_DYN_NAME$1 ]) { ajaxData[_DYN_PERF_TIMING ] = perfTiming; break; } if (entry[_DYN_START_TIME ] < perfMark[_DYN_START_TIME ] - 1000) { break; } } } } if (!perfMark || ajaxData[_DYN_PERF_TIMING ] || attempt >= maxAttempts || ajaxData.async === false) { if (perfMark && isFunction(performance.clearMarks)) { performance.clearMarks(perfMark[_DYN_NAME$1 ]); } ajaxData.perfAttempts = attempt; trackCallback(); } else { setTimeout(locateResourceTiming, retryDelay); } } catch (e) { reportError(e); } })(); } function _createFetchRecord(input, init) { var _a; var distributedTraceCtx = _getDistributedTraceCtx(); var traceID = (distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_ID ]()) || generateW3CId(); var spanID = generateW3CId().substr(0, 16); var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog](), (_a = _self.core) === null || _a === void 0 ? void 0 : _a.getTraceCtx()); ajaxData[_DYN_TRACE_FLAGS ] = distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_FLAGS ](); ajaxData[_DYN_REQUEST_SENT_TIME ] = dateTimeUtilsNow(); ajaxData[_DYN_ERROR_STATUS_TEXT ] = _enableAjaxErrorStatusText; if (input instanceof Request) { ajaxData[_DYN_REQUEST_URL ] = input ? input.url : ""; } else { ajaxData[_DYN_REQUEST_URL ] = input; } var method = "GET"; if (init && init[_DYN_METHOD ]) { method = init[_DYN_METHOD ]; } else if (input && input instanceof Request) { method = input[_DYN_METHOD ]; } ajaxData[_DYN_METHOD ] = method; var requestHeaders = {}; if (_enableRequestHeaderTracking) { var headers = new Headers((init ? init[_DYN_HEADERS ] : 0) || (input instanceof Request ? (input[_DYN_HEADERS ] || {}) : {})); headers.forEach(function (value, key) { if (_canIncludeHeaders(key)) { requestHeaders[key] = value; } }); } ajaxData[_DYN_REQUEST_HEADERS ] = requestHeaders; _createMarkId(STR_FETCH, ajaxData); return ajaxData; } function _getFailedFetchDiagnosticsMessage(input) { var result = ""; try { if (!isNullOrUndefined(input)) { if (typeof (input) === "string") { result += "(url: '".concat(input, "')"); } else { result += "(url: '".concat(input.url, "')"); } } } catch (e) { _throwInternalCritical(_self, 15 , "Failed to grab failed fetch diagnostics message", { exception: dumpObj(e) }); } return result; } function _reportFetchMetrics(callDetails, status, input, response, ajaxData, getResponse, properties) { if (!ajaxData) { return; } function _reportFetchError(msgId, e, failedProps) { var errorProps = failedProps || {}; errorProps["fetchDiagnosticsMessage"] = _getFailedFetchDiagnosticsMessage(input); if (e) { errorProps["exception"] = dumpObj(e); } _throwInternalWarning(_self, msgId, FAILED_TO_CALCULATE_DURATION_ERROR + "fetch call" + ERROR_NOT_SENT, errorProps); } ajaxData[_DYN_RESPONSE_FINISHED_TI15 ] = dateTimeUtilsNow(); ajaxData[_DYN_STATUS ] = status; _findPerfResourceEntry(STR_FETCH, ajaxData, function () { var dependency = ajaxData[_DYN__CREATE_TRACK_ITEM ]("Fetch", _enableRequestHeaderTracking, getResponse); var properties; try { if (!!_addRequestContext) { properties = _addRequestContext({ status: status, request: input, response: response }); } } catch (e) { _throwInternalWarning(_self, 104 , CUSTOM_REQUEST_CONTEXT_ERROR); } if (dependency) { if (properties !== undefined) { dependency[STR_PROPERTIES ] = __assignFn(__assignFn({}, dependency.properties), properties); } var sysProperties = ajaxData[_DYN_GET_PART_APROPS ](); _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE$1 ], ajaxData, dependency, null, sysProperties); } else { _reportFetchError(14 , null, { requestSentTime: ajaxData[_DYN_REQUEST_SENT_TIME ], responseFinishedTime: ajaxData[_DYN_RESPONSE_FINISHED_TI15 ] }); } }, function (e) { _reportFetchError(18 , e, null); }); } function _getFetchCorrelationContext(response) { if (response && response[_DYN_HEADERS ]) { try { var responseHeader = response[_DYN_HEADERS ].get(RequestHeaders[0 ]); return CorrelationIdHelper[_DYN_GET_CORRELATION_CONT17 ](responseHeader); } catch (e) { _throwInternalWarning(_self, 18 , CORRELATION_HEADER_ERROR, { fetchDiagnosticsMessage: _getFailedFetchDiagnosticsMessage(response), exception: dumpObj(e) }); } } } function _reportDependencyInternal(initializers, core, ajaxData, dependency, properties, systemProperties) { var result = true; var initializersCount = initializers[_DYN_LENGTH$3 ]; if (initializersCount > 0) { var details = { item: dependency, properties: properties, sysProperties: systemProperties, context: ajaxData ? ajaxData[_DYN_CONTEXT$1 ] : null, aborted: ajaxData ? !!ajaxData[_DYN_ABORTED ] : false }; result = _processDependencyContainer(core, initializers, details, "initializer"); } if (result) { _self[_DYN_TRACK_DEPENDENCY_DAT4 ](dependency, properties, systemProperties); } } }); return _this; } AjaxMonitor.prototype.processTelemetry = function (item, itemCtx) { this.processNext(item, itemCtx); }; AjaxMonitor.prototype.addDependencyInitializer = function (dependencyInitializer) { return null; }; AjaxMonitor.identifier = "AjaxDependencyPlugin"; AjaxMonitor.getDefaultConfig = _getDefaultConfig$1; AjaxMonitor.getEmptyConfig = _getEmptyConfig; return AjaxMonitor; }(BaseTelemetryPlugin)); var _AUTHENTICATED_USER_CONTEXT = "AuthenticatedUserContext"; var _TRACK = "track"; var STR_SNIPPET = "snippet"; var STR_GET_COOKIE_MGR = "getCookieMgr"; var STR_START_TRACK_PAGE = "startTrackPage"; var STR_STOP_TRACK_PAGE = "stopTrackPage"; var STR_FLUSH = "flush"; var STR_START_TRACK_EVENT = "startTrackEvent"; var STR_STOP_TRACK_EVENT = "stopTrackEvent"; var STR_ADD_TELEMETRY_INITIALIZER = "addTelemetryInitializer"; var STR_ADD_TELEMETRY_INITIALIZERS = STR_ADD_TELEMETRY_INITIALIZER + "s"; var STR_POLL_INTERNAL_LOGS = "pollInternalLogs"; var STR_GET_PLUGIN = "getPlugin"; var STR_EVT_NAMESPACE = "evtNamespace"; var STR_TRACK_EVENT = _TRACK + "Event"; var STR_TRACK_TRACE = _TRACK + "Trace"; var STR_TRACK_METRIC = _TRACK + "Metric"; var STR_TRACK_PAGE_VIEW = _TRACK + "PageView"; var STR_TRACK_EXCEPTION = _TRACK + "Exception"; var STR_TRACK_DEPENDENCY_DATA = _TRACK + "DependencyData"; var STR_SET_AUTHENTICATED_USER_CONTEXT = "set" + _AUTHENTICATED_USER_CONTEXT; var STR_CLEAR_AUTHENTICATED_USER_CONTEXT = "clear" + _AUTHENTICATED_USER_CONTEXT; var _DYN_UPDATE_SNIPPET_DEFIN0 = "updateSnippetDefinitions"; var _DYN_LOAD_APP_INSIGHTS = "loadAppInsights"; var _DYN_ENDPOINT_URL$1 = "endpointUrl"; var _DYN_MAX_BATCH_SIZE_IN_BY1$1 = "maxBatchSizeInBytes"; var _DYN_MAX_BATCH_INTERVAL$1 = "maxBatchInterval"; var _DYN_DISABLE_EXCEPTION_TR2 = "disableExceptionTracking"; var _DYN_DISABLE_TELEMETRY$1 = "disableTelemetry"; var _DYN_EMIT_LINE_DELIMITED_3 = "emitLineDelimitedJson"; var _DYN_DIAGNOSTIC_LOG_INTER4 = "diagnosticLogInterval"; var _DYN_AUTO_TRACK_PAGE_VISI5 = "autoTrackPageVisitTime"; var _DYN_SAMPLING_PERCENTAGE$2 = "samplingPercentage"; var _DYN_DISABLE_AJAX_TRACKIN6 = "disableAjaxTracking"; var _DYN_MAX_AJAX_CALLS_PER_V7 = "maxAjaxCallsPerView"; var _DYN_IS_BEACON_API_DISABL8 = "isBeaconApiDisabled"; var _DYN_DISABLE_CORRELATION_9 = "disableCorrelationHeaders"; var _DYN_CORRELATION_HEADER_E10 = "correlationHeaderExcludedDomains"; var _DYN_DISABLE_FLUSH_ON_BEF11 = "disableFlushOnBeforeUnload"; var _DYN_DISABLE_FLUSH_ON_UNL12 = "disableFlushOnUnload"; var _DYN_ENABLE_SESSION_STORA13 = "enableSessionStorageBuffer"; var _DYN_IS_COOKIE_USE_DISABL14 = "isCookieUseDisabled"; var _DYN_IS_STORAGE_USE_DISAB15 = "isStorageUseDisabled"; var _DYN_IS_BROWSER_LINK_TRAC16 = "isBrowserLinkTrackingEnabled"; var _DYN_ENABLE_CORS_CORRELAT17 = "enableCorsCorrelation"; var _DYN_CONFIG$1 = "config"; var _DYN_CONTEXT = "context"; var _DYN_PUSH$1 = "push"; var _DYN_VERSION = "version"; var _DYN_QUEUE = "queue"; var _DYN_CONNECTION_STRING = "connectionString"; var _DYN_INSTRUMENTATION_KEY$1 = "instrumentationKey"; var _DYN_APP_INSIGHTS = "appInsights"; var _DYN_DISABLE_IKEY_DEPRECA18 = "disableIkeyDeprecationMessage"; var _DYN_GET_TRANSMISSION_CON19 = "getTransmissionControls"; var _DYN_ONUNLOAD_FLUSH = "onunloadFlush"; var _DYN_ADD_HOUSEKEEPING_BEF20 = "addHousekeepingBeforeUnload"; var _DYN_INDEX_OF = "indexOf"; var _ignoreUpdateSnippetProperties$1 = [ STR_SNIPPET, "getDefaultConfig", "_hasLegacyInitializers", "_queue", "_processLegacyInitializers" ]; function getDefaultConfig(config) { if (!config) { config = {}; } config[_DYN_ENDPOINT_URL$1 ] = config[_DYN_ENDPOINT_URL$1 ] || DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; config.sessionRenewalMs = 30 * 60 * 1000; config.sessionExpirationMs = 24 * 60 * 60 * 1000; config[_DYN_MAX_BATCH_SIZE_IN_BY1$1 ] = config[_DYN_MAX_BATCH_SIZE_IN_BY1$1 ] > 0 ? config[_DYN_MAX_BATCH_SIZE_IN_BY1$1 ] : 102400; config[_DYN_MAX_BATCH_INTERVAL$1 ] = !isNaN(config[_DYN_MAX_BATCH_INTERVAL$1 ]) ? config[_DYN_MAX_BATCH_INTERVAL$1 ] : 15000; config.enableDebug = stringToBoolOrDefault(config.enableDebug); config[_DYN_DISABLE_EXCEPTION_TR2 ] = stringToBoolOrDefault(config[_DYN_DISABLE_EXCEPTION_TR2 ]); config[_DYN_DISABLE_TELEMETRY$1 ] = stringToBoolOrDefault(config[_DYN_DISABLE_TELEMETRY$1 ]); config.verboseLogging = stringToBoolOrDefault(config.verboseLogging); config[_DYN_EMIT_LINE_DELIMITED_3 ] = stringToBoolOrDefault(config[_DYN_EMIT_LINE_DELIMITED_3 ]); config[_DYN_DIAGNOSTIC_LOG_INTER4 ] = config[_DYN_DIAGNOSTIC_LOG_INTER4 ] || 10000; config[_DYN_AUTO_TRACK_PAGE_VISI5 ] = stringToBoolOrDefault(config[_DYN_AUTO_TRACK_PAGE_VISI5 ]); if (isNaN(config[_DYN_SAMPLING_PERCENTAGE$2 ]) || config[_DYN_SAMPLING_PERCENTAGE$2 ] <= 0 || config[_DYN_SAMPLING_PERCENTAGE$2 ] >= 100) { config[_DYN_SAMPLING_PERCENTAGE$2 ] = 100; } config[_DYN_DISABLE_AJAX_TRACKIN6 ] = stringToBoolOrDefault(config[_DYN_DISABLE_AJAX_TRACKIN6 ]); config[_DYN_MAX_AJAX_CALLS_PER_V7 ] = !isNaN(config[_DYN_MAX_AJAX_CALLS_PER_V7 ]) ? config[_DYN_MAX_AJAX_CALLS_PER_V7 ] : 500; config[_DYN_IS_BEACON_API_DISABL8 ] = stringToBoolOrDefault(config[_DYN_IS_BEACON_API_DISABL8 ], true); config[_DYN_DISABLE_CORRELATION_9 ] = stringToBoolOrDefault(config[_DYN_DISABLE_CORRELATION_9 ]); config[_DYN_CORRELATION_HEADER_E10 ] = config[_DYN_CORRELATION_HEADER_E10 ] || DfltAjaxCorrelationHeaderExDomains; config[_DYN_DISABLE_FLUSH_ON_BEF11 ] = stringToBoolOrDefault(config[_DYN_DISABLE_FLUSH_ON_BEF11 ]); config.disableFlushOnUnload = stringToBoolOrDefault(config.disableFlushOnUnload, config[_DYN_DISABLE_FLUSH_ON_BEF11 ]); config[_DYN_ENABLE_SESSION_STORA13 ] = stringToBoolOrDefault(config[_DYN_ENABLE_SESSION_STORA13 ], true); config.isRetryDisabled = stringToBoolOrDefault(config.isRetryDisabled); config[_DYN_IS_COOKIE_USE_DISABL14 ] = stringToBoolOrDefault(config[_DYN_IS_COOKIE_USE_DISABL14 ]); config[_DYN_IS_STORAGE_USE_DISAB15 ] = stringToBoolOrDefault(config[_DYN_IS_STORAGE_USE_DISAB15 ]); config[_DYN_IS_BROWSER_LINK_TRAC16 ] = stringToBoolOrDefault(config[_DYN_IS_BROWSER_LINK_TRAC16 ]); config[_DYN_ENABLE_CORS_CORRELAT17 ] = stringToBoolOrDefault(config[_DYN_ENABLE_CORS_CORRELAT17 ]); return config; } var AppInsightsDeprecated = /** @class */ (function () { function AppInsightsDeprecated(snippet, appInsightsNew) { var _this = this; var _hasLegacyInitializers = false; var _queue = []; var _config; dynamicProto(AppInsightsDeprecated, this, function (_self) { _config = getDefaultConfig(snippet[_DYN_CONFIG$1 ]); _self[_DYN_CONFIG$1 ] = _config; _self[STR_SNIPPET ] = snippet; _self.appInsightsNew = appInsightsNew; _self[_DYN_CONTEXT ] = { addTelemetryInitializer: _addTelemetryInitializers.bind(_self) }; _self[STR_ADD_TELEMETRY_INITIALIZERS ] = _addTelemetryInitializers; function _addTelemetryInitializers(callBack) { if (!_hasLegacyInitializers) { appInsightsNew[STR_ADD_TELEMETRY_INITIALIZER ](function (item) { _processLegacyInitializers(item); }); _hasLegacyInitializers = true; } _queue[_DYN_PUSH$1 ](callBack); } proxyFunctions(_self, appInsightsNew, [ STR_GET_COOKIE_MGR, STR_START_TRACK_PAGE, STR_STOP_TRACK_PAGE, STR_FLUSH, STR_START_TRACK_EVENT, STR_STOP_TRACK_EVENT ]); _self[STR_TRACK_PAGE_VIEW ] = function (name, url, properties, measurements, duration) { var telemetry = { name: name, uri: url, properties: properties, measurements: measurements }; appInsightsNew[STR_TRACK_PAGE_VIEW ](telemetry); }; _self[STR_TRACK_EVENT ] = function (name, properties, measurements) { appInsightsNew[STR_TRACK_EVENT ]({ name: name }); }; _self.trackDependency = function (id, method, absoluteUrl, pathName, totalTime, success, resultCode) { appInsightsNew[STR_TRACK_DEPENDENCY_DATA ]({ id: id, target: absoluteUrl, type: pathName, duration: totalTime, properties: { HttpMethod: method }, success: success, responseCode: resultCode }); }; _self[STR_TRACK_EXCEPTION ] = function (exception, handledAt, properties, measurements, severityLevel) { appInsightsNew[STR_TRACK_EXCEPTION ]({ exception: exception }); }; _self[STR_TRACK_METRIC ] = function (name, average, sampleCount, min, max, properties) { appInsightsNew[STR_TRACK_METRIC ]({ name: name, average: average, sampleCount: sampleCount, min: min, max: max }); }; _self[STR_TRACK_TRACE ] = function (message, properties, severityLevel) { appInsightsNew[STR_TRACK_TRACE ]({ message: message, severityLevel: severityLevel }); }; _self[STR_SET_AUTHENTICATED_USER_CONTEXT ] = function (authenticatedUserId, accountId, storeInCookie) { appInsightsNew[_DYN_CONTEXT ].user[STR_SET_AUTHENTICATED_USER_CONTEXT ](authenticatedUserId, accountId, storeInCookie); }; _self[STR_CLEAR_AUTHENTICATED_USER_CONTEXT ] = function () { appInsightsNew[_DYN_CONTEXT ].user[STR_CLEAR_AUTHENTICATED_USER_CONTEXT ](); }; _self._onerror = function (message, url, lineNumber, columnNumber, error) { appInsightsNew._onerror({ message: message, url: url, lineNumber: lineNumber, columnNumber: columnNumber, error: error }); }; _self.downloadAndSetup = function (config) { throwError("downloadAndSetup not implemented in web SKU"); }; _self[_DYN_UPDATE_SNIPPET_DEFIN0 ] = function (snippet) { proxyAssign(snippet, _this, function (name) { return name && arrIndexOf(_ignoreUpdateSnippetProperties$1, name) === -1; }); }; _self[_DYN_LOAD_APP_INSIGHTS ] = function () { if (_self[_DYN_CONFIG$1 ]["iKey"]) { var originalTrackPageView_1 = _self[STR_TRACK_PAGE_VIEW ]; _self[STR_TRACK_PAGE_VIEW ] = function (pagePath, properties, measurements) { originalTrackPageView_1.apply(_self, [null, pagePath, properties, measurements]); }; } var legacyPageView = "logPageView"; if (isFunction(_self[STR_SNIPPET ][legacyPageView])) { _this[legacyPageView] = function (pagePath, properties, measurements) { _self[STR_TRACK_PAGE_VIEW ](null, pagePath, properties, measurements); }; } var legacyEvent = "logEvent"; if (isFunction(_self[STR_SNIPPET ][legacyEvent])) { _this[legacyEvent] = function (name, props, measurements) { _self[STR_TRACK_EVENT ](name, props, measurements); }; } return _this; }; function _processLegacyInitializers(item) { item.tags[ProcessLegacy] = _queue; return item; } }); } AppInsightsDeprecated.__ieDyn=1; return AppInsightsDeprecated; }()); var _DYN_TO_STRING$1 = "toString"; var _DYN_DISABLE_EXCEPTION_TR0 = "disableExceptionTracking"; var _DYN_AUTO_TRACK_PAGE_VISI1 = "autoTrackPageVisitTime"; var _DYN_OVERRIDE_PAGE_VIEW_D2 = "overridePageViewDuration"; var _DYN_ENABLE_UNHANDLED_PRO3 = "enableUnhandledPromiseRejectionTracking"; var _DYN_SAMPLING_PERCENTAGE$1 = "samplingPercentage"; var _DYN_IS_STORAGE_USE_DISAB4 = "isStorageUseDisabled"; var _DYN_IS_BROWSER_LINK_TRAC5 = "isBrowserLinkTrackingEnabled"; var _DYN_ENABLE_AUTO_ROUTE_TR6 = "enableAutoRouteTracking"; var _DYN_NAME_PREFIX$2 = "namePrefix"; var _DYN_DISABLE_FLUSH_ON_BEF7 = "disableFlushOnBeforeUnload"; var _DYN_CORE = "core"; var _DYN_DATA_TYPE$1 = "dataType"; var _DYN_ENVELOPE_TYPE$1 = "envelopeType"; var _DYN_DIAG_LOG$1 = "diagLog"; var _DYN_TRACK = "track"; var _DYN_TRACK_PAGE_VIEW = "trackPageView"; var _DYN_TRACK_PREVIOUS_PAGE_9 = "trackPreviousPageVisit"; var _DYN_SEND_PAGE_VIEW_INTER10 = "sendPageViewInternal"; var _DYN_SEND_PAGE_VIEW_PERFO11 = "sendPageViewPerformanceInternal"; var _DYN_POPULATE_PAGE_VIEW_P12 = "populatePageViewPerformanceEvent"; var _DYN_HREF = "href"; var _DYN_SEND_EXCEPTION_INTER13 = "sendExceptionInternal"; var _DYN_EXCEPTION = "exception"; var _DYN_ERROR = "error"; var _DYN__ONERROR = "_onerror"; var _DYN_ERROR_SRC = "errorSrc"; var _DYN_LINE_NUMBER = "lineNumber"; var _DYN_COLUMN_NUMBER = "columnNumber"; var _DYN_MESSAGE = "message"; var _DYN__CREATE_AUTO_EXCEPTI14 = "CreateAutoException"; var _DYN_ADD_TELEMETRY_INITIA15 = "addTelemetryInitializer"; var _DYN_DURATION = "duration"; var _DYN_LENGTH$2 = "length"; var _DYN_IS_PERFORMANCE_TIMIN16 = "isPerformanceTimingSupported"; var _DYN_GET_PERFORMANCE_TIMI17 = "getPerformanceTiming"; var _DYN_NAVIGATION_START = "navigationStart"; var _DYN_SHOULD_COLLECT_DURAT18 = "shouldCollectDuration"; var _DYN_IS_PERFORMANCE_TIMIN19 = "isPerformanceTimingDataReady"; var _DYN_GET_ENTRIES_BY_TYPE = "getEntriesByType"; var _DYN_RESPONSE_START = "responseStart"; var _DYN_REQUEST_START = "requestStart"; var _DYN_LOAD_EVENT_END = "loadEventEnd"; var _DYN_RESPONSE_END = "responseEnd"; var _DYN_CONNECT_END = "connectEnd"; var _DYN_PAGE_VISIT_START_TIM20 = "pageVisitStartTime"; var _isWebWorker = null; function isWebWorker() { if (_isWebWorker == null) { try { _isWebWorker = !!(self && self instanceof WorkerGlobalScope); } catch (e) { _isWebWorker = false; } } return _isWebWorker; } var PageViewManager = /** @class */ (function () { function PageViewManager(appInsights, overridePageViewDuration, core, pageViewPerformanceManager) { dynamicProto(PageViewManager, this, function (_self) { var queueTimer = null; var itemQueue = []; var pageViewPerformanceSent = false; var _logger; if (core) { _logger = core.logger; } function _flushChannels(isAsync) { if (core) { core.flush(isAsync); } } function _startTimer() { if (!queueTimer) { queueTimer = setTimeout((function () { queueTimer = null; var allItems = itemQueue.slice(0); var doFlush = false; itemQueue = []; arrForEach(allItems, function (item) { if (!item()) { itemQueue.push(item); } else { doFlush = true; } }); if (itemQueue[_DYN_LENGTH$2 ] > 0) { _startTimer(); } if (doFlush) { _flushChannels(true); } }), 100); } } function _addQueue(cb) { itemQueue.push(cb); _startTimer(); } _self[_DYN_TRACK_PAGE_VIEW ] = function (pageView, customProperties) { var name = pageView.name; if (isNullOrUndefined(name) || typeof name !== "string") { var doc = getDocument(); name = pageView.name = doc && doc.title || ""; } var uri = pageView.uri; if (isNullOrUndefined(uri) || typeof uri !== "string") { var location_1 = getLocation(); uri = pageView.uri = location_1 && location_1[_DYN_HREF ] || ""; } if (!pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN16 ]()) { appInsights[_DYN_SEND_PAGE_VIEW_INTER10 ](pageView, customProperties); _flushChannels(true); if (!isWebWorker()) { _throwInternal(_logger, 2 , 25 , "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info."); } return; } var pageViewSent = false; var customDuration; var start = pageViewPerformanceManager[_DYN_GET_PERFORMANCE_TIMI17 ]()[_DYN_NAVIGATION_START ]; if (start > 0) { customDuration = dateTimeUtilsDuration(start, +new Date); if (!pageViewPerformanceManager[_DYN_SHOULD_COLLECT_DURAT18 ](customDuration)) { customDuration = undefined; } } var duration; if (!isNullOrUndefined(customProperties) && !isNullOrUndefined(customProperties[_DYN_DURATION ])) { duration = customProperties[_DYN_DURATION ]; } if (overridePageViewDuration || !isNaN(duration)) { if (isNaN(duration)) { if (!customProperties) { customProperties = {}; } customProperties[_DYN_DURATION ] = customDuration; } appInsights[_DYN_SEND_PAGE_VIEW_INTER10 ](pageView, customProperties); _flushChannels(true); pageViewSent = true; } var maxDurationLimit = 60000; if (!customProperties) { customProperties = {}; } _addQueue(function () { var processed = false; try { if (pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN19 ]()) { processed = true; var pageViewPerformance = { name: name, uri: uri }; pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P12 ](pageViewPerformance); if (!pageViewPerformance.isValid && !pageViewSent) { customProperties[_DYN_DURATION ] = customDuration; appInsights[_DYN_SEND_PAGE_VIEW_INTER10 ](pageView, customProperties); } else { if (!pageViewSent) { customProperties[_DYN_DURATION ] = pageViewPerformance.durationMs; appInsights[_DYN_SEND_PAGE_VIEW_INTER10 ](pageView, customProperties); } if (!pageViewPerformanceSent) { appInsights[_DYN_SEND_PAGE_VIEW_PERFO11 ](pageViewPerformance, customProperties); pageViewPerformanceSent = true; } } } else if (start > 0 && dateTimeUtilsDuration(start, +new Date) > maxDurationLimit) { processed = true; if (!pageViewSent) { customProperties[_DYN_DURATION ] = maxDurationLimit; appInsights[_DYN_SEND_PAGE_VIEW_INTER10 ](pageView, customProperties); } } } catch (e) { _throwInternal(_logger, 1 , 38 , "trackPageView failed on page load calculation: " + getExceptionName(e), { exception: dumpObj(e) }); } return processed; }); }; _self.teardown = function (unloadCtx, unloadState) { if (queueTimer) { clearTimeout(queueTimer); queueTimer = null; var allItems = itemQueue.slice(0); itemQueue = []; arrForEach(allItems, function (item) { if (item()) ; }); } }; }); } PageViewManager.__ieDyn=1; return PageViewManager; }()); var MAX_DURATION_ALLOWED = 3600000; var botAgentNames = ["googlebot", "adsbot-google", "apis-google", "mediapartners-google"]; function _isPerformanceTimingSupported() { var perf = getPerformance(); return perf && !!perf.timing; } function _isPerformanceNavigationTimingSupported() { var perf = getPerformance(); return perf && perf.getEntriesByType && perf.getEntriesByType("navigation")[_DYN_LENGTH$2 ] > 0; } function _isPerformanceTimingDataReady() { var perf = getPerformance(); var timing = perf ? perf.timing : 0; return timing && timing.domainLookupStart > 0 && timing[_DYN_NAVIGATION_START ] > 0 && timing[_DYN_RESPONSE_START ] > 0 && timing[_DYN_REQUEST_START ] > 0 && timing[_DYN_LOAD_EVENT_END ] > 0 && timing[_DYN_RESPONSE_END ] > 0 && timing[_DYN_CONNECT_END ] > 0 && timing.domLoading > 0; } function _getPerformanceTiming() { if (_isPerformanceTimingSupported()) { return getPerformance().timing; } return null; } function _getPerformanceNavigationTiming() { if (_isPerformanceNavigationTimingSupported()) { return getPerformance()[_DYN_GET_ENTRIES_BY_TYPE ]("navigation")[0]; } return null; } function _shouldCollectDuration() { var durations = []; for (var _i = 0; _i < arguments.length; _i++) { durations[_i] = arguments[_i]; } var _navigator = getNavigator() || {}; var userAgent = _navigator.userAgent; var isGoogleBot = false; if (userAgent) { for (var i = 0; i < botAgentNames[_DYN_LENGTH$2 ]; i++) { isGoogleBot = isGoogleBot || userAgent.toLowerCase().indexOf(botAgentNames[i]) !== -1; } } if (isGoogleBot) { return false; } else { for (var i = 0; i < durations[_DYN_LENGTH$2 ]; i++) { if (durations[i] < 0 || durations[i] >= MAX_DURATION_ALLOWED) { return false; } } } return true; } var PageViewPerformanceManager = /** @class */ (function () { function PageViewPerformanceManager(core) { var _logger = safeGetLogger(core); dynamicProto(PageViewPerformanceManager, this, function (_self) { _self[_DYN_POPULATE_PAGE_VIEW_P12 ] = function (pageViewPerformance) { pageViewPerformance.isValid = false; var navigationTiming = _getPerformanceNavigationTiming(); var timing = _getPerformanceTiming(); var total = 0; var network = 0; var request = 0; var response = 0; var dom = 0; if (navigationTiming || timing) { if (navigationTiming) { total = navigationTiming[_DYN_DURATION ]; network = navigationTiming.startTime === 0 ? navigationTiming[_DYN_CONNECT_END ] : dateTimeUtilsDuration(navigationTiming.startTime, navigationTiming[_DYN_CONNECT_END ]); request = dateTimeUtilsDuration(navigationTiming.requestStart, navigationTiming[_DYN_RESPONSE_START ]); response = dateTimeUtilsDuration(navigationTiming[_DYN_RESPONSE_START ], navigationTiming[_DYN_RESPONSE_END ]); dom = dateTimeUtilsDuration(navigationTiming.responseEnd, navigationTiming[_DYN_LOAD_EVENT_END ]); } else { total = dateTimeUtilsDuration(timing[_DYN_NAVIGATION_START ], timing[_DYN_LOAD_EVENT_END ]); network = dateTimeUtilsDuration(timing[_DYN_NAVIGATION_START ], timing[_DYN_CONNECT_END ]); request = dateTimeUtilsDuration(timing.requestStart, timing[_DYN_RESPONSE_START ]); response = dateTimeUtilsDuration(timing[_DYN_RESPONSE_START ], timing[_DYN_RESPONSE_END ]); dom = dateTimeUtilsDuration(timing.responseEnd, timing[_DYN_LOAD_EVENT_END ]); } if (total === 0) { _throwInternal(_logger, 2 , 10 , "error calculating page view performance.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (!_self[_DYN_SHOULD_COLLECT_DURAT18 ](total, network, request, response, dom)) { _throwInternal(_logger, 2 , 45 , "Invalid page load duration value. Browser perf data won't be sent.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (total < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(dom)) { _throwInternal(_logger, 2 , 8 , "client performance math error.", { total: total, network: network, request: request, response: response, dom: dom }); } else { pageViewPerformance.durationMs = total; pageViewPerformance.perfTotal = pageViewPerformance[_DYN_DURATION ] = msToTimeSpan(total); pageViewPerformance.networkConnect = msToTimeSpan(network); pageViewPerformance.sentRequest = msToTimeSpan(request); pageViewPerformance.receivedResponse = msToTimeSpan(response); pageViewPerformance.domProcessing = msToTimeSpan(dom); pageViewPerformance.isValid = true; } } }; _self[_DYN_GET_PERFORMANCE_TIMI17 ] = _getPerformanceTiming; _self[_DYN_IS_PERFORMANCE_TIMIN16 ] = _isPerformanceTimingSupported; _self[_DYN_IS_PERFORMANCE_TIMIN19 ] = _isPerformanceTimingDataReady; _self[_DYN_SHOULD_COLLECT_DURAT18 ] = _shouldCollectDuration; }); } PageViewPerformanceManager.__ieDyn=1; return PageViewPerformanceManager; }()); var PageVisitTimeManager = /** @class */ (function () { function PageVisitTimeManager(logger, pageVisitTimeTrackingHandler) { var prevPageVisitDataKeyName = "prevPageVisitData"; dynamicProto(PageVisitTimeManager, this, function (_self) { _self[_DYN_TRACK_PREVIOUS_PAGE_9 ] = function (currentPageName, currentPageUrl) { try { var prevPageVisitTimeData = restartPageVisitTimer(currentPageName, currentPageUrl); if (prevPageVisitTimeData) { pageVisitTimeTrackingHandler(prevPageVisitTimeData.pageName, prevPageVisitTimeData.pageUrl, prevPageVisitTimeData.pageVisitTime); } } catch (e) { _warnToConsole(logger, "Auto track page visit time failed, metric will not be collected: " + dumpObj(e)); } }; function restartPageVisitTimer(pageName, pageUrl) { var prevPageVisitData = null; try { prevPageVisitData = stopPageVisitTimer(); startPageVisitTimer(pageName, pageUrl); } catch (e) { _warnToConsole(logger, "Call to restart failed: " + dumpObj(e)); prevPageVisitData = null; } return prevPageVisitData; } function startPageVisitTimer(pageName, pageUrl) { try { if (utlCanUseSessionStorage()) { if (utlGetSessionStorage(logger, prevPageVisitDataKeyName) != null) { throwError("Cannot call startPageVisit consecutively without first calling stopPageVisit"); } var currPageVisitData = new PageVisitData(pageName, pageUrl); var currPageVisitDataStr = getJSON().stringify(currPageVisitData); utlSetSessionStorage(logger, prevPageVisitDataKeyName, currPageVisitDataStr); } } catch (e) { _warnToConsole(logger, "Call to start failed: " + dumpObj(e)); } } function stopPageVisitTimer() { var prevPageVisitData = null; try { if (utlCanUseSessionStorage()) { var pageVisitEndTime = dateNow(); var pageVisitDataJsonStr = utlGetSessionStorage(logger, prevPageVisitDataKeyName); if (pageVisitDataJsonStr && hasJSON()) { prevPageVisitData = getJSON().parse(pageVisitDataJsonStr); prevPageVisitData.pageVisitTime = pageVisitEndTime - prevPageVisitData[_DYN_PAGE_VISIT_START_TIM20 ]; utlRemoveSessionStorage(logger, prevPageVisitDataKeyName); } } } catch (e) { _warnToConsole(logger, "Stop page visit timer failed: " + dumpObj(e)); prevPageVisitData = null; } return prevPageVisitData; } objDefineAccessors(_self, "_logger", function () { return logger; }); objDefineAccessors(_self, "pageVisitTimeTrackingHandler", function () { return pageVisitTimeTrackingHandler; }); }); } PageVisitTimeManager.__ieDyn=1; return PageVisitTimeManager; }()); var PageVisitData = /** @class */ (function () { function PageVisitData(pageName, pageUrl) { this[_DYN_PAGE_VISIT_START_TIM20 ] = dateNow(); this.pageName = pageName; this.pageUrl = pageUrl; } return PageVisitData; }()); var Timing = /** @class */ (function () { function Timing(logger, name) { var _self = this; var _events = {}; _self.start = function (name) { if (typeof _events[name] !== "undefined") { _throwInternal(logger, 2 , 62 , "start was called more than once for this event without calling stop.", { name: name, key: name }, true); } _events[name] = +new Date; }; _self.stop = function (name, url, properties, measurements) { var start = _events[name]; if (isNaN(start)) { _throwInternal(logger, 2 , 63 , "stop was called without a corresponding start.", { name: name, key: name }, true); } else { var end = +new Date; var duration = dateTimeUtilsDuration(start, end); _self.action(name, url, duration, properties, measurements); } delete _events[name]; _events[name] = undefined; }; } return Timing; }()); var strEvent = "event"; function _dispatchEvent(target, evnt) { if (target && target.dispatchEvent && evnt) { target.dispatchEvent(evnt); } } function _getReason(error) { if (error && error.reason) { var reason = error.reason; if (!isString(reason) && isFunction(reason[_DYN_TO_STRING$1 ])) { return reason[_DYN_TO_STRING$1 ](); } return dumpObj(reason); } return error || ""; } var MinMilliSeconds = 60000; function _configMilliseconds(value, defValue) { value = value || defValue; if (value < MinMilliSeconds) { value = MinMilliSeconds; } return value; } function _getDefaultConfig(config) { if (!config) { config = {}; } config.sessionRenewalMs = _configMilliseconds(config.sessionRenewalMs, 30 * 60 * 1000); config.sessionExpirationMs = _configMilliseconds(config.sessionExpirationMs, 24 * 60 * 60 * 1000); config[_DYN_DISABLE_EXCEPTION_TR0 ] = stringToBoolOrDefault(config[_DYN_DISABLE_EXCEPTION_TR0 ]); config[_DYN_AUTO_TRACK_PAGE_VISI1 ] = stringToBoolOrDefault(config[_DYN_AUTO_TRACK_PAGE_VISI1 ]); config[_DYN_OVERRIDE_PAGE_VIEW_D2 ] = stringToBoolOrDefault(config[_DYN_OVERRIDE_PAGE_VIEW_D2 ]); config[_DYN_ENABLE_UNHANDLED_PRO3 ] = stringToBoolOrDefault(config[_DYN_ENABLE_UNHANDLED_PRO3 ]); if (isNaN(config[_DYN_SAMPLING_PERCENTAGE$1 ]) || config[_DYN_SAMPLING_PERCENTAGE$1 ] <= 0 || config[_DYN_SAMPLING_PERCENTAGE$1 ] >= 100) { config[_DYN_SAMPLING_PERCENTAGE$1 ] = 100; } config[_DYN_IS_STORAGE_USE_DISAB4 ] = stringToBoolOrDefault(config[_DYN_IS_STORAGE_USE_DISAB4 ]); config[_DYN_IS_BROWSER_LINK_TRAC5 ] = stringToBoolOrDefault(config[_DYN_IS_BROWSER_LINK_TRAC5 ]); config[_DYN_ENABLE_AUTO_ROUTE_TR6 ] = stringToBoolOrDefault(config[_DYN_ENABLE_AUTO_ROUTE_TR6 ]); config[_DYN_NAME_PREFIX$2 ] = config[_DYN_NAME_PREFIX$2 ] || ""; config.enableDebug = stringToBoolOrDefault(config.enableDebug); config[_DYN_DISABLE_FLUSH_ON_BEF7 ] = stringToBoolOrDefault(config[_DYN_DISABLE_FLUSH_ON_BEF7 ]); config.disableFlushOnUnload = stringToBoolOrDefault(config.disableFlushOnUnload, config[_DYN_DISABLE_FLUSH_ON_BEF7 ]); return config; } function _updateStorageUsage(extConfig) { if (!isUndefined(extConfig[_DYN_IS_STORAGE_USE_DISAB4 ])) { if (extConfig[_DYN_IS_STORAGE_USE_DISAB4 ]) { utlDisableStorage(); } else { utlEnableStorage(); } } } var AnalyticsPlugin = /** @class */ (function (_super) { __extendsFn(AnalyticsPlugin, _super); function AnalyticsPlugin() { var _this = _super.call(this) || this; _this.identifier = AnalyticsPluginIdentifier; _this.priority = 180; _this.autoRoutePVDelay = 500; var _eventTracking; var _pageTracking; var _pageViewManager; var _pageViewPerformanceManager; var _pageVisitTimeManager; var _preInitTelemetryInitializers; var _isBrowserLinkTrackingEnabled; var _browserLinkInitializerAdded; var _enableAutoRouteTracking; var _historyListenerAdded; var _disableExceptionTracking; var _autoExceptionInstrumented; var _enableUnhandledPromiseRejectionTracking; var _autoUnhandledPromiseInstrumented; var _prevUri; var _currUri; var _evtNamespace; dynamicProto(AnalyticsPlugin, _this, function (_self, _base) { var _addHook = _base._addHook; _initDefaults(); _self.getCookieMgr = function () { return safeGetCookieMgr(_self[_DYN_CORE ]); }; _self.processTelemetry = function (env, itemCtx) { _self.processNext(env, itemCtx); }; _self.trackEvent = function (event, customProperties) { try { var telemetryItem = createTelemetryItem(event, Event$1[_DYN_DATA_TYPE$1 ], Event$1[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), customProperties); _self[_DYN_CORE ][_DYN_TRACK ](telemetryItem); } catch (e) { _throwInternal(2 , 39 , "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.startTrackEvent = function (name) { try { _eventTracking.start(name); } catch (e) { _throwInternal(1 , 29 , "startTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.stopTrackEvent = function (name, properties, measurements) { try { _eventTracking.stop(name, undefined, properties, measurements); } catch (e) { _throwInternal(1 , 30 , "stopTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.trackTrace = function (trace, customProperties) { try { var telemetryItem = createTelemetryItem(trace, Trace[_DYN_DATA_TYPE$1 ], Trace[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), customProperties); _self[_DYN_CORE ][_DYN_TRACK ](telemetryItem); } catch (e) { _throwInternal(2 , 39 , "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.trackMetric = function (metric, customProperties) { try { var telemetryItem = createTelemetryItem(metric, Metric[_DYN_DATA_TYPE$1 ], Metric[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), customProperties); _self[_DYN_CORE ][_DYN_TRACK ](telemetryItem); } catch (e) { _throwInternal(1 , 36 , "trackMetric failed, metric will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self[_DYN_TRACK_PAGE_VIEW ] = function (pageView, customProperties) { try { var inPv = pageView || {}; _pageViewManager[_DYN_TRACK_PAGE_VIEW ](inPv, __assignFn(__assignFn(__assignFn({}, inPv.properties), inPv.measurements), customProperties)); if (_self.config[_DYN_AUTO_TRACK_PAGE_VISI1 ]) { _pageVisitTimeManager[_DYN_TRACK_PREVIOUS_PAGE_9 ](inPv.name, inPv.uri); } } catch (e) { _throwInternal(1 , 37 , "trackPageView failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self[_DYN_SEND_PAGE_VIEW_INTER10 ] = function (pageView, properties, systemProperties) { var doc = getDocument(); if (doc) { pageView.refUri = pageView.refUri === undefined ? doc.referrer : pageView.refUri; } var telemetryItem = createTelemetryItem(pageView, PageView[_DYN_DATA_TYPE$1 ], PageView[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), properties, systemProperties); _self[_DYN_CORE ][_DYN_TRACK ](telemetryItem); }; _self[_DYN_SEND_PAGE_VIEW_PERFO11 ] = function (pageViewPerformance, properties, systemProperties) { var telemetryItem = createTelemetryItem(pageViewPerformance, PageViewPerformance[_DYN_DATA_TYPE$1 ], PageViewPerformance[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), properties, systemProperties); _self[_DYN_CORE ][_DYN_TRACK ](telemetryItem); }; _self.trackPageViewPerformance = function (pageViewPerformance, customProperties) { var inPvp = pageViewPerformance || {}; try { _pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P12 ](inPvp); _self[_DYN_SEND_PAGE_VIEW_PERFO11 ](inPvp, customProperties); } catch (e) { _throwInternal(1 , 37 , "trackPageViewPerformance failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.startTrackPage = function (name) { try { if (typeof name !== "string") { var doc = getDocument(); name = doc && doc.title || ""; } _pageTracking.start(name); } catch (e) { _throwInternal(1 , 31 , "startTrackPage failed, page view may not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.stopTrackPage = function (name, url, properties, measurement) { try { if (typeof name !== "string") { var doc = getDocument(); name = doc && doc.title || ""; } if (typeof url !== "string") { var loc = getLocation(); url = loc && loc[_DYN_HREF ] || ""; } _pageTracking.stop(name, url, properties, measurement); if (_self.config[_DYN_AUTO_TRACK_PAGE_VISI1 ]) { _pageVisitTimeManager[_DYN_TRACK_PREVIOUS_PAGE_9 ](name, url); } } catch (e) { _throwInternal(1 , 32 , "stopTrackPage failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self[_DYN_SEND_EXCEPTION_INTER13 ] = function (exception, customProperties, systemProperties) { var theError = (exception && (exception[_DYN_EXCEPTION ] || exception[_DYN_ERROR ])) || isError(exception) && exception || { name: (exception && typeof exception), message: exception || strNotSpecified }; exception = exception || {}; var exceptionPartB = new Exception(_self[_DYN_DIAG_LOG$1 ](), theError, exception.properties || customProperties, exception.measurements, exception.severityLevel, exception.id).toInterface(); var telemetryItem = createTelemetryItem(exceptionPartB, Exception[_DYN_DATA_TYPE$1 ], Exception[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), customProperties, systemProperties); _self[_DYN_CORE ][_DYN_TRACK ](telemetryItem); }; _self.trackException = function (exception, customProperties) { if (exception && !exception[_DYN_EXCEPTION ] && exception[_DYN_ERROR ]) { exception[_DYN_EXCEPTION ] = exception[_DYN_ERROR ]; } try { _self[_DYN_SEND_EXCEPTION_INTER13 ](exception, customProperties); } catch (e) { _throwInternal(1 , 35 , "trackException failed, exception will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self[_DYN__ONERROR ] = function (exception) { var error = exception && exception[_DYN_ERROR ]; var evt = exception && exception.evt; try { if (!evt) { var _window = getWindow(); if (_window) { evt = _window[strEvent]; } } var url = (exception && exception.url) || (getDocument() || {}).URL; var errorSrc = exception[_DYN_ERROR_SRC ] || "window.onerror@" + url + ":" + (exception[_DYN_LINE_NUMBER ] || 0) + ":" + (exception[_DYN_COLUMN_NUMBER ] || 0); var properties = { errorSrc: errorSrc, url: url, lineNumber: exception[_DYN_LINE_NUMBER ] || 0, columnNumber: exception[_DYN_COLUMN_NUMBER ] || 0, message: exception[_DYN_MESSAGE ] }; if (isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception[_DYN_ERROR ])) { _sendCORSException(Exception[_DYN__CREATE_AUTO_EXCEPTI14 ]("Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.", url, exception[_DYN_LINE_NUMBER ] || 0, exception[_DYN_COLUMN_NUMBER ] || 0, error, evt, null, errorSrc), properties); } else { if (!exception[_DYN_ERROR_SRC ]) { exception[_DYN_ERROR_SRC ] = errorSrc; } _self.trackException({ exception: exception, severityLevel: 3 }, properties); } } catch (e) { var errorString = error ? (error.name + ", " + error[_DYN_MESSAGE ]) : "null"; _throwInternal(1 , 11 , "_onError threw exception while logging error, error will not be collected: " + getExceptionName(e), { exception: dumpObj(e), errorString: errorString }); } }; _self[_DYN_ADD_TELEMETRY_INITIA15 ] = function (telemetryInitializer) { if (_self[_DYN_CORE ]) { return _self[_DYN_CORE ][_DYN_ADD_TELEMETRY_INITIA15 ](telemetryInitializer); } if (!_preInitTelemetryInitializers) { _preInitTelemetryInitializers = []; } _preInitTelemetryInitializers.push(telemetryInitializer); }; _self.initialize = function (config, core, extensions, pluginChain) { if (_self.isInitialized()) { return; } if (isNullOrUndefined(core)) { throwError("Error initializing"); } _base.initialize(config, core, extensions, pluginChain); if (config.storagePrefix) { utlSetStoragePrefix(config.storagePrefix); } try { _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace()); if (_preInitTelemetryInitializers) { arrForEach(_preInitTelemetryInitializers, function (initializer) { core[_DYN_ADD_TELEMETRY_INITIA15 ](initializer); }); _preInitTelemetryInitializers = null; } var extConfig = _populateDefaults(config); _updateStorageUsage(extConfig); _pageViewPerformanceManager = new PageViewPerformanceManager(_self[_DYN_CORE ]); _pageViewManager = new PageViewManager(_self, extConfig[_DYN_OVERRIDE_PAGE_VIEW_D2 ], _self[_DYN_CORE ], _pageViewPerformanceManager); _pageVisitTimeManager = new PageVisitTimeManager(_self[_DYN_DIAG_LOG$1 ](), function (pageName, pageUrl, pageVisitTime) { return trackPageVisitTime(pageName, pageUrl, pageVisitTime); }); _updateBrowserLinkTracking(extConfig, config); _eventTracking = new Timing(_self[_DYN_DIAG_LOG$1 ](), "trackEvent"); _eventTracking.action = function (name, url, duration, properties, measurements) { if (!properties) { properties = {}; } if (!measurements) { measurements = {}; } properties.duration = duration[_DYN_TO_STRING$1 ](); _self.trackEvent({ name: name, properties: properties, measurements: measurements }); }; _pageTracking = new Timing(_self[_DYN_DIAG_LOG$1 ](), "trackPageView"); _pageTracking.action = function (name, url, duration, properties, measurements) { if (isNullOrUndefined(properties)) { properties = {}; } properties.duration = duration[_DYN_TO_STRING$1 ](); var pageViewItem = { name: name, uri: url, properties: properties, measurements: measurements }; _self[_DYN_SEND_PAGE_VIEW_INTER10 ](pageViewItem, properties); }; if (hasWindow()) { _updateExceptionTracking(extConfig); _updateLocationChange(extConfig); } } catch (e) { _self.setInitialized(false); throw e; } }; _self._doTeardown = function (unloadCtx, unloadState) { _pageViewManager && _pageViewManager.teardown(unloadCtx, unloadState); eventOff(window, null, null, _evtNamespace); _initDefaults(); }; function _populateDefaults(config) { var ctx = createProcessTelemetryContext(null, config, _self[_DYN_CORE ]); var identifier = _self.identifier; var defaults = _getDefaultConfig(config); var extConfig = _self.config = ctx.getExtCfg(identifier); if (defaults !== undefined) { objForEachKey(defaults, function (field, value) { extConfig[field] = ctx.getConfig(identifier, field, value); if (extConfig[field] === undefined) { extConfig = value; } }); } return extConfig; } function _updateBrowserLinkTracking(extConfig, config) { _isBrowserLinkTrackingEnabled = extConfig[_DYN_IS_BROWSER_LINK_TRAC5 ] || config[_DYN_IS_BROWSER_LINK_TRAC5 ]; _addDefaultTelemetryInitializers(); } function trackPageVisitTime(pageName, pageUrl, pageVisitTime) { var properties = { PageName: pageName, PageUrl: pageUrl }; _self.trackMetric({ name: "PageVisitTime", average: pageVisitTime, max: pageVisitTime, min: pageVisitTime, sampleCount: 1 }, properties); } function _addDefaultTelemetryInitializers() { if (!_browserLinkInitializerAdded && _isBrowserLinkTrackingEnabled) { var browserLinkPaths_1 = ["/browserLinkSignalR/", "/__browserLink/"]; var dropBrowserLinkRequests = function (envelope) { if (_isBrowserLinkTrackingEnabled && envelope.baseType === RemoteDependencyData[_DYN_DATA_TYPE$1 ]) { var remoteData = envelope.baseData; if (remoteData) { for (var i = 0; i < browserLinkPaths_1[_DYN_LENGTH$2 ]; i++) { if (remoteData.target && remoteData.target.indexOf(browserLinkPaths_1[i]) >= 0) { return false; } } } } return true; }; _self[_DYN_ADD_TELEMETRY_INITIA15 ](dropBrowserLinkRequests); _browserLinkInitializerAdded = true; } } function _sendCORSException(exception, properties) { var telemetryItem = createTelemetryItem(exception, Exception[_DYN_DATA_TYPE$1 ], Exception[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), properties); _self[_DYN_CORE ][_DYN_TRACK ](telemetryItem); } function _updateExceptionTracking(extConfig) { var _window = getWindow(); var locn = getLocation(true); _disableExceptionTracking = extConfig[_DYN_DISABLE_EXCEPTION_TR0 ]; if (!_disableExceptionTracking && !_autoExceptionInstrumented && !extConfig.autoExceptionInstrumented) { _addHook(InstrumentEvent(_window, "onerror", { ns: _evtNamespace, rsp: function (callDetails, message, url, lineNumber, columnNumber, error) { if (!_disableExceptionTracking && callDetails.rslt !== true) { _self[_DYN__ONERROR ](Exception[_DYN__CREATE_AUTO_EXCEPTI14 ](message, url, lineNumber, columnNumber, error, callDetails.evt)); } } }, false)); _autoExceptionInstrumented = true; } _addUnhandledPromiseRejectionTracking(extConfig, _window, locn); } function _updateLocationChange(extConfig) { var win = getWindow(); var locn = getLocation(true); _enableAutoRouteTracking = extConfig[_DYN_ENABLE_AUTO_ROUTE_TR6 ] === true; if (win && _enableAutoRouteTracking && hasHistory()) { var _history = getHistory(); if (isFunction(_history.pushState) && isFunction(_history.replaceState) && typeof Event !== strShimUndefined) { _addHistoryListener(extConfig, win, _history, locn); } } } function _getDistributedTraceCtx() { var distributedTraceCtx = null; if (_self[_DYN_CORE ] && _self[_DYN_CORE ].getTraceCtx) { distributedTraceCtx = _self[_DYN_CORE ].getTraceCtx(false); } if (!distributedTraceCtx) { var properties = _self[_DYN_CORE ].getPlugin(PropertiesPluginIdentifier); if (properties) { var context = properties.plugin.context; if (context) { distributedTraceCtx = createDistributedTraceContextFromTrace(context.telemetryTrace); } } } return distributedTraceCtx; } function _addHistoryListener(extConfig, win, history, locn) { var namePrefix = extConfig[_DYN_NAME_PREFIX$2 ] || ""; function _popstateHandler() { if (_enableAutoRouteTracking) { _dispatchEvent(win, createDomEvent(namePrefix + "locationchange")); } } function _locationChangeHandler() { if (_currUri) { _prevUri = _currUri; _currUri = locn && locn[_DYN_HREF ] || ""; } else { _currUri = locn && locn[_DYN_HREF ] || ""; } if (_enableAutoRouteTracking) { var distributedTraceCtx = _getDistributedTraceCtx(); if (distributedTraceCtx) { distributedTraceCtx.setTraceId(generateW3CId()); var traceLocationName = "_unknown_"; if (locn && locn.pathname) { traceLocationName = locn.pathname + (locn.hash || ""); } distributedTraceCtx.setName(dataSanitizeString(_self[_DYN_DIAG_LOG$1 ](), traceLocationName)); } setTimeout((function (uri) { _self[_DYN_TRACK_PAGE_VIEW ]({ refUri: uri, properties: { duration: 0 } }); }).bind(_self, _prevUri), _self.autoRoutePVDelay); } } if (!_historyListenerAdded) { _addHook(InstrumentEvent(history, "pushState", { ns: _evtNamespace, rsp: function () { if (_enableAutoRouteTracking) { _dispatchEvent(win, createDomEvent(namePrefix + "pushState")); _dispatchEvent(win, createDomEvent(namePrefix + "locationchange")); } } }, true)); _addHook(InstrumentEvent(history, "replaceState", { ns: _evtNamespace, rsp: function () { if (_enableAutoRouteTracking) { _dispatchEvent(win, createDomEvent(namePrefix + "replaceState")); _dispatchEvent(win, createDomEvent(namePrefix + "locationchange")); } } }, true)); eventOn(win, namePrefix + "popstate", _popstateHandler, _evtNamespace); eventOn(win, namePrefix + "locationchange", _locationChangeHandler, _evtNamespace); _historyListenerAdded = true; } } function _addUnhandledPromiseRejectionTracking(extConfig, _window, _location) { _enableUnhandledPromiseRejectionTracking = extConfig[_DYN_ENABLE_UNHANDLED_PRO3 ] === true; if (_enableUnhandledPromiseRejectionTracking && !_autoUnhandledPromiseInstrumented) { _addHook(InstrumentEvent(_window, "onunhandledrejection", { ns: _evtNamespace, rsp: function (callDetails, error) { if (_enableUnhandledPromiseRejectionTracking && callDetails.rslt !== true) { _self[_DYN__ONERROR ](Exception[_DYN__CREATE_AUTO_EXCEPTI14 ](_getReason(error), _location ? _location[_DYN_HREF ] : "", 0, 0, error, callDetails.evt)); } } }, false)); _autoUnhandledPromiseInstrumented = true; extConfig.autoUnhandledPromiseInstrumented = _autoUnhandledPromiseInstrumented; } } function _throwInternal(severity, msgId, msg, properties, isUserAct) { _self[_DYN_DIAG_LOG$1 ]().throwInternal(severity, msgId, msg, properties, isUserAct); } function _initDefaults() { _eventTracking = null; _pageTracking = null; _pageViewManager = null; _pageViewPerformanceManager = null; _pageVisitTimeManager = null; _preInitTelemetryInitializers = null; _isBrowserLinkTrackingEnabled = false; _browserLinkInitializerAdded = false; _enableAutoRouteTracking = false; _historyListenerAdded = false; _disableExceptionTracking = false; _autoExceptionInstrumented = false; _enableUnhandledPromiseRejectionTracking = false; _autoUnhandledPromiseInstrumented = false; var location = getLocation(true); _prevUri = location && location[_DYN_HREF ] || ""; _currUri = null; _evtNamespace = null; } objDefineAccessors(_self, "_pageViewManager", function () { return _pageViewManager; }); objDefineAccessors(_self, "_pageViewPerformanceManager", function () { return _pageViewPerformanceManager; }); objDefineAccessors(_self, "_pageVisitTimeManager", function () { return _pageVisitTimeManager; }); objDefineAccessors(_self, "_evtNamespace", function () { return "." + _evtNamespace; }); }); return _this; } AnalyticsPlugin.Version = '2.8.14'; AnalyticsPlugin.getDefaultConfig = _getDefaultConfig; return AnalyticsPlugin; }(BaseTelemetryPlugin)); var STR_DURATION = "duration"; var _DYN_TAGS = "tags"; var _DYN_DEVICE_TYPE = "deviceType"; var _DYN_DATA = "data"; var _DYN_NAME = "name"; var _DYN_TRACE_ID = "traceID"; var _DYN_LENGTH$1 = "length"; var _DYN_STRINGIFY = "stringify"; var _DYN_MEASUREMENTS = "measurements"; var _DYN_DATA_TYPE = "dataType"; var _DYN_ENVELOPE_TYPE = "envelopeType"; var _DYN_TO_STRING = "toString"; var _DYN_ON_LINE = "onLine"; var _DYN_IS_ONLINE = "isOnline"; var _DYN_ENQUEUE = "enqueue"; var _DYN_COUNT = "count"; var _DYN_PUSH = "push"; var _DYN_EMIT_LINE_DELIMITED_0 = "emitLineDelimitedJson"; var _DYN_CLEAR = "clear"; var _DYN_BATCH_PAYLOADS = "batchPayloads"; var _DYN_MARK_AS_SENT = "markAsSent"; var _DYN_CLEAR_SENT = "clearSent"; var _DYN_BUFFER_OVERRIDE = "bufferOverride"; var _DYN__BUFFER__KEY = "BUFFER_KEY"; var _DYN__SENT__BUFFER__KEY = "SENT_BUFFER_KEY"; var _DYN__MAX__BUFFER__SIZE = "MAX_BUFFER_SIZE"; var _DYN_NAME_PREFIX$1 = "namePrefix"; var _DYN_MAX_BATCH_SIZE_IN_BY1 = "maxBatchSizeInBytes"; var _DYN_TRIGGER_SEND = "triggerSend"; var _DYN_DIAG_LOG = "diagLog"; var _DYN_ONUNLOAD_DISABLE_BEA2 = "onunloadDisableBeacon"; var _DYN_IS_BEACON_API_DISABL3 = "isBeaconApiDisabled"; var _DYN__SENDER = "_sender"; var _DYN__SENDER_CONFIG = "_senderConfig"; var _DYN_ENABLE_SESSION_STORA4 = "enableSessionStorageBuffer"; var _DYN__BUFFER = "_buffer"; var _DYN_SAMPLING_PERCENTAGE = "samplingPercentage"; var _DYN_INSTRUMENTATION_KEY = "instrumentationKey"; var _DYN_ENDPOINT_URL = "endpointUrl"; var _DYN_CUSTOM_HEADERS = "customHeaders"; var _DYN_DISABLE_XHR = "disableXhr"; var _DYN_ONUNLOAD_DISABLE_FET5 = "onunloadDisableFetch"; var _DYN_DISABLE_TELEMETRY = "disableTelemetry"; var _DYN_BASE_TYPE = "baseType"; var _DYN_SAMPLE_RATE = "sampleRate"; var _DYN_CONVERT_UNDEFINED = "convertUndefined"; var _DYN__XHR_READY_STATE_CHA6 = "_xhrReadyStateChange"; var _DYN__ON_ERROR = "_onError"; var _DYN__ON_PARTIAL_SUCCESS = "_onPartialSuccess"; var _DYN__ON_SUCCESS = "_onSuccess"; var _DYN_ITEMS_ACCEPTED = "itemsAccepted"; var _DYN_ITEMS_RECEIVED = "itemsReceived"; var _DYN_IS_RETRY_DISABLED = "isRetryDisabled"; var _DYN_SET_REQUEST_HEADER = "setRequestHeader"; var _DYN_MAX_BATCH_INTERVAL = "maxBatchInterval"; var _DYN_EVENTS_SEND_REQUEST = "eventsSendRequest"; var _DYN_DISABLE_INSTRUMENTAT7 = "disableInstrumentationKeyValidation"; var _DYN_GET_SAMPLING_SCORE = "getSamplingScore"; var _DYN_GET_HASH_CODE_SCORE = "getHashCodeScore"; var strBaseType = "baseType"; var strBaseData = "baseData"; var strProperties = "properties"; var strTrue = "true"; function _setValueIf(target, field, value) { return setValue(target, field, value, isTruthy); } function _extractPartAExtensions(logger, item, env) { var envTags = env[_DYN_TAGS ] = env[_DYN_TAGS ] || {}; var itmExt = item.ext = item.ext || {}; var itmTags = item[_DYN_TAGS ] = item[_DYN_TAGS ] || []; var extUser = itmExt.user; if (extUser) { _setValueIf(envTags, CtxTagKeys.userAuthUserId, extUser.authId); _setValueIf(envTags, CtxTagKeys.userId, extUser.id || extUser.localId); } var extApp = itmExt.app; if (extApp) { _setValueIf(envTags, CtxTagKeys.sessionId, extApp.sesId); } var extDevice = itmExt.device; if (extDevice) { _setValueIf(envTags, CtxTagKeys.deviceId, extDevice.id || extDevice.localId); _setValueIf(envTags, CtxTagKeys[_DYN_DEVICE_TYPE ], extDevice.deviceClass); _setValueIf(envTags, CtxTagKeys.deviceIp, extDevice.ip); _setValueIf(envTags, CtxTagKeys.deviceModel, extDevice.model); _setValueIf(envTags, CtxTagKeys[_DYN_DEVICE_TYPE ], extDevice[_DYN_DEVICE_TYPE ]); } var web = item.ext.web; if (web) { _setValueIf(envTags, CtxTagKeys.deviceLanguage, web.browserLang); _setValueIf(envTags, CtxTagKeys.deviceBrowserVersion, web.browserVer); _setValueIf(envTags, CtxTagKeys.deviceBrowser, web.browser); var envData = env[_DYN_DATA ] = env[_DYN_DATA ] || {}; var envBaseData = envData[strBaseData] = envData[strBaseData] || {}; var envProps = envBaseData[strProperties] = envBaseData[strProperties] || {}; _setValueIf(envProps, "domain", web.domain); _setValueIf(envProps, "isManual", web.isManual ? strTrue : null); _setValueIf(envProps, "screenRes", web.screenRes); _setValueIf(envProps, "userConsent", web.userConsent ? strTrue : null); } var extOs = itmExt.os; if (extOs) { _setValueIf(envTags, CtxTagKeys.deviceOS, extOs[_DYN_NAME ]); } var extTrace = itmExt.trace; if (extTrace) { _setValueIf(envTags, CtxTagKeys.operationParentId, extTrace.parentID); _setValueIf(envTags, CtxTagKeys.operationName, dataSanitizeString(logger, extTrace[_DYN_NAME ])); _setValueIf(envTags, CtxTagKeys.operationId, extTrace[_DYN_TRACE_ID ]); } var tgs = {}; for (var i = itmTags[_DYN_LENGTH$1 ] - 1; i >= 0; i--) { var tg = itmTags[i]; objForEachKey(tg, function (key, value) { tgs[key] = value; }); itmTags.splice(i, 1); } objForEachKey(itmTags, function (tg, value) { tgs[tg] = value; }); var theTags = __assignFn(__assignFn({}, envTags), tgs); if (!theTags[CtxTagKeys.internalSdkVersion]) { theTags[CtxTagKeys.internalSdkVersion] = dataSanitizeString(logger, "javascript:".concat(EnvelopeCreator.Version), 64); } env[_DYN_TAGS ] = optimizeObject(theTags); } function _extractPropsAndMeasurements(data, properties, measurements) { if (!isNullOrUndefined(data)) { objForEachKey(data, function (key, value) { if (isNumber(value)) { measurements[key] = value; } else if (isString(value)) { properties[key] = value; } else if (hasJSON()) { properties[key] = getJSON()[_DYN_STRINGIFY ](value); } }); } } function _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue) { if (!isNullOrUndefined(properties)) { objForEachKey(properties, function (key, value) { properties[key] = value || customUndefinedValue; }); } } function _createEnvelope(logger, envelopeType, telemetryItem, data) { var envelope = new Envelope(logger, data, envelopeType); _setValueIf(envelope, "sampleRate", telemetryItem[SampleRate]); if ((telemetryItem[strBaseData] || {}).startTime) { envelope.time = toISOString(telemetryItem[strBaseData].startTime); } envelope.iKey = telemetryItem.iKey; var iKeyNoDashes = telemetryItem.iKey.replace(/-/g, ""); envelope[_DYN_NAME ] = envelope[_DYN_NAME ].replace("{0}", iKeyNoDashes); _extractPartAExtensions(logger, telemetryItem, envelope); telemetryItem[_DYN_TAGS ] = telemetryItem[_DYN_TAGS ] || []; return optimizeObject(envelope); } function EnvelopeCreatorInit(logger, telemetryItem) { if (isNullOrUndefined(telemetryItem[strBaseData])) { _throwInternal(logger, 1 , 46 , "telemetryItem.baseData cannot be null."); } } var EnvelopeCreator = { Version: '2.8.14' }; function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS ] || {}; var customProperties = telemetryItem[strBaseData][strProperties] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], customProperties, customMeasurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue); } var bd = telemetryItem[strBaseData]; if (isNullOrUndefined(bd)) { _warnToConsole(logger, "Invalid input for dependency data"); return null; } var method = bd[strProperties] && bd[strProperties][HttpMethod] ? bd[strProperties][HttpMethod] : "GET"; var remoteDepData = new RemoteDependencyData(logger, bd.id, bd.target, bd[_DYN_NAME ], bd[STR_DURATION ], bd.success, bd.responseCode, method, bd.type, bd.correlationContext, customProperties, customMeasurements); var data = new Data(RemoteDependencyData[_DYN_DATA_TYPE ], remoteDepData); return _createEnvelope(logger, RemoteDependencyData[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function EventEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var customProperties = {}; var customMeasurements = {}; if (telemetryItem[strBaseType] !== Event$1[_DYN_DATA_TYPE ]) { customProperties["baseTypeSource"] = telemetryItem[strBaseType]; } if (telemetryItem[strBaseType] === Event$1[_DYN_DATA_TYPE ]) { customProperties = telemetryItem[strBaseData][strProperties] || {}; customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS ] || {}; } else { if (telemetryItem[strBaseData]) { _extractPropsAndMeasurements(telemetryItem[strBaseData], customProperties, customMeasurements); } } _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], customProperties, customMeasurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue); } var eventName = telemetryItem[strBaseData][_DYN_NAME ]; var eventData = new Event$1(logger, eventName, customProperties, customMeasurements); var data = new Data(Event$1[_DYN_DATA_TYPE ], eventData); return _createEnvelope(logger, Event$1[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function ExceptionEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS ] || {}; var customProperties = telemetryItem[strBaseData][strProperties] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], customProperties, customMeasurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue); } var bd = telemetryItem[strBaseData]; var exData = Exception.CreateFromInterface(logger, bd, customProperties, customMeasurements); var data = new Data(Exception[_DYN_DATA_TYPE ], exData); return _createEnvelope(logger, Exception[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function MetricEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var baseData = telemetryItem[strBaseData]; var props = baseData[strProperties] || {}; var measurements = baseData[_DYN_MEASUREMENTS ] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], props, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(props, customUndefinedValue); } var baseMetricData = new Metric(logger, baseData[_DYN_NAME ], baseData.average, baseData.sampleCount, baseData.min, baseData.max, baseData.stdDev, props, measurements); var data = new Data(Metric[_DYN_DATA_TYPE ], baseMetricData); return _createEnvelope(logger, Metric[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function PageViewEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var duration; var baseData = telemetryItem[strBaseData]; if (!isNullOrUndefined(baseData) && !isNullOrUndefined(baseData[strProperties]) && !isNullOrUndefined(baseData[strProperties][STR_DURATION])) { duration = baseData[strProperties][STR_DURATION]; delete baseData[strProperties][STR_DURATION]; } else if (!isNullOrUndefined(telemetryItem[_DYN_DATA ]) && !isNullOrUndefined(telemetryItem[_DYN_DATA ][STR_DURATION])) { duration = telemetryItem[_DYN_DATA ][STR_DURATION]; delete telemetryItem[_DYN_DATA ][STR_DURATION]; } var bd = telemetryItem[strBaseData]; var currentContextId; if (((telemetryItem.ext || {}).trace || {})[_DYN_TRACE_ID ]) { currentContextId = telemetryItem.ext.trace[_DYN_TRACE_ID ]; } var id = bd.id || currentContextId; var name = bd[_DYN_NAME ]; var url = bd.uri; var properties = bd[strProperties] || {}; var measurements = bd[_DYN_MEASUREMENTS ] || {}; if (!isNullOrUndefined(bd.refUri)) { properties["refUri"] = bd.refUri; } if (!isNullOrUndefined(bd.pageType)) { properties["pageType"] = bd.pageType; } if (!isNullOrUndefined(bd.isLoggedIn)) { properties["isLoggedIn"] = bd.isLoggedIn[_DYN_TO_STRING ](); } if (!isNullOrUndefined(bd[strProperties])) { var pageTags = bd[strProperties]; objForEachKey(pageTags, function (key, value) { properties[key] = value; }); } _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], properties, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue); } var pageViewData = new PageView(logger, name, url, duration, properties, measurements, id); var data = new Data(PageView[_DYN_DATA_TYPE ], pageViewData); return _createEnvelope(logger, PageView[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function PageViewPerformanceEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var bd = telemetryItem[strBaseData]; var name = bd[_DYN_NAME ]; var url = bd.uri || bd.url; var properties = bd[strProperties] || {}; var measurements = bd[_DYN_MEASUREMENTS ] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], properties, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue); } var baseData = new PageViewPerformance(logger, name, url, undefined, properties, measurements, bd); var data = new Data(PageViewPerformance[_DYN_DATA_TYPE ], baseData); return _createEnvelope(logger, PageViewPerformance[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function TraceEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var message = telemetryItem[strBaseData].message; var severityLevel = telemetryItem[strBaseData].severityLevel; var props = telemetryItem[strBaseData][strProperties] || {}; var measurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS ] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], props, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(props, customUndefinedValue); } var baseData = new Trace(logger, message, severityLevel, props, measurements); var data = new Data(Trace[_DYN_DATA_TYPE ], baseData); return _createEnvelope(logger, Trace[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function _disableEvents(target, evtNamespace) { eventOff(target, null, null, evtNamespace); } function createOfflineListener(parentEvtNamespace) { var _a; var _document = getDocument(); var _navigator = getNavigator(); var _isListening = false; var _onlineStatus = true; var _evtNamespace = mergeEvtNamespace(createUniqueNamespace("OfflineListener"), parentEvtNamespace); try { if (_enableEvents(getWindow())) { _isListening = true; } if (_document) { var target = _document.body || _document; if (target.ononline) { if (_enableEvents(target)) { _isListening = true; } } } if (_isListening) { if (_navigator && !isNullOrUndefined(_navigator[_DYN_ON_LINE ])) { _onlineStatus = _navigator[_DYN_ON_LINE ]; } } } catch (e) { _isListening = false; } function _enableEvents(target) { var enabled = false; if (target) { enabled = eventOn(target, "online", _setOnline, _evtNamespace); if (enabled) { eventOn(target, "offline", _setOffline, _evtNamespace); } } return enabled; } function _setOnline() { _onlineStatus = true; } function _setOffline() { _onlineStatus = false; } function _isOnline() { var result = true; if (_isListening) { result = _onlineStatus; } else if (_navigator && !isNullOrUndefined(_navigator[_DYN_ON_LINE ])) { result = _navigator[_DYN_ON_LINE ]; } return result; } function _unload() { var win = getWindow(); if (win && _isListening) { _disableEvents(win, _evtNamespace); if (_document) { var target = _document.body || _document; if (!isUndefined(target.ononline)) { _disableEvents(target, _evtNamespace); } } _isListening = false; } } return _a = {}, _a[_DYN_IS_ONLINE ] = _isOnline, _a.isListening = function () { return _isListening; }, _a.unload = _unload, _a; } var BaseSendBuffer = /** @class */ (function () { function BaseSendBuffer(logger, config) { var _buffer = []; var _bufferFullMessageSent = false; this._get = function () { return _buffer; }; this._set = function (buffer) { _buffer = buffer; return _buffer; }; dynamicProto(BaseSendBuffer, this, function (_self) { _self[_DYN_ENQUEUE ] = function (payload) { if (_self[_DYN_COUNT ]() >= config.eventsLimitInMem()) { if (!_bufferFullMessageSent) { _throwInternal(logger, 2 , 105 , "Maximum in-memory buffer size reached: " + _self[_DYN_COUNT ](), true); _bufferFullMessageSent = true; } return; } _buffer[_DYN_PUSH ](payload); }; _self[_DYN_COUNT ] = function () { return _buffer[_DYN_LENGTH$1 ]; }; _self.size = function () { var size = _buffer[_DYN_LENGTH$1 ]; for (var lp = 0; lp < _buffer[_DYN_LENGTH$1 ]; lp++) { size += _buffer[lp][_DYN_LENGTH$1 ]; } if (!config[_DYN_EMIT_LINE_DELIMITED_0 ]()) { size += 2; } return size; }; _self[_DYN_CLEAR ] = function () { _buffer = []; _bufferFullMessageSent = false; }; _self.getItems = function () { return _buffer.slice(0); }; _self[_DYN_BATCH_PAYLOADS ] = function (payload) { if (payload && payload[_DYN_LENGTH$1 ] > 0) { var batch = config[_DYN_EMIT_LINE_DELIMITED_0 ]() ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; }); } BaseSendBuffer.__ieDyn=1; return BaseSendBuffer; }()); var ArraySendBuffer = /** @class */ (function (_super) { __extendsFn(ArraySendBuffer, _super); function ArraySendBuffer(logger, config) { var _this = _super.call(this, logger, config) || this; dynamicProto(ArraySendBuffer, _this, function (_self, _base) { _self[_DYN_MARK_AS_SENT ] = function (payload) { _base[_DYN_CLEAR ](); }; _self[_DYN_CLEAR_SENT ] = function (payload) { }; }); return _this; } ArraySendBuffer.__ieDyn=1; return ArraySendBuffer; }(BaseSendBuffer)); var SessionStorageSendBuffer = /** @class */ (function (_super) { __extendsFn(SessionStorageSendBuffer, _super); function SessionStorageSendBuffer(logger, config) { var _this = _super.call(this, logger, config) || this; var _bufferFullMessageSent = false; var _a = config[_DYN_BUFFER_OVERRIDE ]() || { getItem: utlGetSessionStorage, setItem: utlSetSessionStorage }, getItem = _a.getItem, setItem = _a.setItem; dynamicProto(SessionStorageSendBuffer, _this, function (_self, _base) { var bufferItems = _getBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY ]); var notDeliveredItems = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ]); var buffer = _self._set(bufferItems.concat(notDeliveredItems)); if (buffer[_DYN_LENGTH$1 ] > SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]) { buffer[_DYN_LENGTH$1 ] = SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]; } _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ], []); _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY ], buffer); _self[_DYN_ENQUEUE ] = function (payload) { if (_self[_DYN_COUNT ]() >= SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]) { if (!_bufferFullMessageSent) { _throwInternal(logger, 2 , 67 , "Maximum buffer size reached: " + _self[_DYN_COUNT ](), true); _bufferFullMessageSent = true; } return; } _base[_DYN_ENQUEUE ](payload); _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY ], _self._get()); }; _self[_DYN_CLEAR ] = function () { _base[_DYN_CLEAR ](); _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY ], _self._get()); _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ], []); _bufferFullMessageSent = false; }; _self[_DYN_MARK_AS_SENT ] = function (payload) { _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY ], _self._set(_removePayloadsFromBuffer(payload, _self._get()))); var sentElements = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ]); if (sentElements instanceof Array && payload instanceof Array) { sentElements = sentElements.concat(payload); if (sentElements[_DYN_LENGTH$1 ] > SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]) { _throwInternal(logger, 1 , 67 , "Sent buffer reached its maximum size: " + sentElements[_DYN_LENGTH$1 ], true); sentElements[_DYN_LENGTH$1 ] = SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]; } _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ], sentElements); } }; _self[_DYN_CLEAR_SENT ] = function (payload) { var sentElements = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ]); sentElements = _removePayloadsFromBuffer(payload, sentElements); _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ], sentElements); }; function _removePayloadsFromBuffer(payloads, buffer) { var remaining = []; arrForEach(buffer, function (value) { if (!isFunction(value) && arrIndexOf(payloads, value) === -1) { remaining[_DYN_PUSH ](value); } }); return remaining; } function _getBuffer(key) { var prefixedKey = key; try { prefixedKey = config[_DYN_NAME_PREFIX$1 ] && config[_DYN_NAME_PREFIX$1 ]() ? config[_DYN_NAME_PREFIX$1 ]() + "_" + prefixedKey : prefixedKey; var bufferJson = getItem(logger, prefixedKey); if (bufferJson) { var buffer_1 = getJSON().parse(bufferJson); if (isString(buffer_1)) { buffer_1 = getJSON().parse(buffer_1); } if (buffer_1 && isArray(buffer_1)) { return buffer_1; } } } catch (e) { _throwInternal(logger, 1 , 42 , " storage key: " + prefixedKey + ", " + getExceptionName(e), { exception: dumpObj(e) }); } return []; } function _setBuffer(key, buffer) { var prefixedKey = key; try { prefixedKey = config[_DYN_NAME_PREFIX$1 ] && config[_DYN_NAME_PREFIX$1 ]() ? config[_DYN_NAME_PREFIX$1 ]() + "_" + prefixedKey : prefixedKey; var bufferJson = JSON[_DYN_STRINGIFY ](buffer); setItem(logger, prefixedKey, bufferJson); } catch (e) { setItem(logger, prefixedKey, JSON[_DYN_STRINGIFY ]([])); _throwInternal(logger, 2 , 41 , " storage key: " + prefixedKey + ", " + getExceptionName(e) + ". Buffer cleared", { exception: dumpObj(e) }); } } }); return _this; } SessionStorageSendBuffer.BUFFER_KEY = "AI_buffer"; SessionStorageSendBuffer.SENT_BUFFER_KEY = "AI_sentBuffer"; SessionStorageSendBuffer.MAX_BUFFER_SIZE = 2000; return SessionStorageSendBuffer; }(BaseSendBuffer)); var Serializer = /** @class */ (function () { function Serializer(logger) { dynamicProto(Serializer, this, function (_self) { _self.serialize = function (input) { var output = _serializeObject(input, "root"); try { return getJSON()[_DYN_STRINGIFY ](output); } catch (e) { _throwInternal(logger, 1 , 48 , (e && isFunction(e[_DYN_TO_STRING ])) ? e[_DYN_TO_STRING ]() : "Error serializing object", null, true); } }; function _serializeObject(source, name) { var circularReferenceCheck = "__aiCircularRefCheck"; var output = {}; if (!source) { _throwInternal(logger, 1 , 48 , "cannot serialize object because it is null or undefined", { name: name }, true); return output; } if (source[circularReferenceCheck]) { _throwInternal(logger, 2 , 50 , "Circular reference detected while serializing object", { name: name }, true); return output; } if (!source.aiDataContract) { if (name === "measurements") { output = _serializeStringMap(source, "number", name); } else if (name === "properties") { output = _serializeStringMap(source, "string", name); } else if (name === "tags") { output = _serializeStringMap(source, "string", name); } else if (isArray(source)) { output = _serializeArray(source, name); } else { _throwInternal(logger, 2 , 49 , "Attempting to serialize an object which does not implement ISerializable", { name: name }, true); try { getJSON()[_DYN_STRINGIFY ](source); output = source; } catch (e) { _throwInternal(logger, 1 , 48 , (e && isFunction(e[_DYN_TO_STRING ])) ? e[_DYN_TO_STRING ]() : "Error serializing object", null, true); } } return output; } source[circularReferenceCheck] = true; objForEachKey(source.aiDataContract, function (field, contract) { var isRequired = (isFunction(contract)) ? (contract() & 1 ) : (contract & 1 ); var isHidden = (isFunction(contract)) ? (contract() & 4 ) : (contract & 4 ); var isArray = contract & 2 ; var isPresent = source[field] !== undefined; var isObj = isObject(source[field]) && source[field] !== null; if (isRequired && !isPresent && !isArray) { _throwInternal(logger, 1 , 24 , "Missing required field specification. The field is required but not present on source", { field: field, name: name }); } else if (!isHidden) { var value = void 0; if (isObj) { if (isArray) { value = _serializeArray(source[field], field); } else { value = _serializeObject(source[field], field); } } else { value = source[field]; } if (value !== undefined) { output[field] = value; } } }); delete source[circularReferenceCheck]; return output; } function _serializeArray(sources, name) { var output; if (!!sources) { if (!isArray(sources)) { _throwInternal(logger, 1 , 54 , "This field was specified as an array in the contract but the item is not an array.\r\n", { name: name }, true); } else { output = []; for (var i = 0; i < sources[_DYN_LENGTH$1 ]; i++) { var source = sources[i]; var item = _serializeObject(source, name + "[" + i + "]"); output[_DYN_PUSH ](item); } } } return output; } function _serializeStringMap(map, expectedType, name) { var output; if (map) { output = {}; objForEachKey(map, function (field, value) { if (expectedType === "string") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else if (!value[_DYN_TO_STRING ]) { output[field] = "invalid field: toString() is not defined."; } else { output[field] = value[_DYN_TO_STRING ](); } } else if (expectedType === "number") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else { var num = parseFloat(value); if (isNaN(num)) { output[field] = "NaN"; } else { output[field] = num; } } } else { output[field] = "invalid field: " + name + " is of unknown type."; _throwInternal(logger, 1 , output[field], null, true); } }); } return output; } }); } Serializer.__ieDyn=1; return Serializer; }()); var MIN_INPUT_LENGTH = 8; var HashCodeScoreGenerator = /** @class */ (function () { function HashCodeScoreGenerator() { } HashCodeScoreGenerator.prototype.getHashCodeScore = function (key) { var score = this.getHashCode(key) / HashCodeScoreGenerator.INT_MAX_VALUE; return score * 100; }; HashCodeScoreGenerator.prototype.getHashCode = function (input) { if (input === "") { return 0; } while (input[_DYN_LENGTH$1 ] < MIN_INPUT_LENGTH) { input = input.concat(input); } var hash = 5381; for (var i = 0; i < input[_DYN_LENGTH$1 ]; ++i) { hash = ((hash << 5) + hash) + input.charCodeAt(i); hash = hash & hash; } return Math.abs(hash); }; HashCodeScoreGenerator.INT_MAX_VALUE = 2147483647; return HashCodeScoreGenerator; }()); var SamplingScoreGenerator = /** @class */ (function () { function SamplingScoreGenerator() { var _self = this; var hashCodeGenerator = new HashCodeScoreGenerator(); var keys = new ContextTagKeys(); _self[_DYN_GET_SAMPLING_SCORE ] = function (item) { var score = 0; if (item[_DYN_TAGS ] && item[_DYN_TAGS ][keys.userId]) { score = hashCodeGenerator.getHashCodeScore(item[_DYN_TAGS ][keys.userId]); } else if (item.ext && item.ext.user && item.ext.user.id) { score = hashCodeGenerator[_DYN_GET_HASH_CODE_SCORE ](item.ext.user.id); } else if (item[_DYN_TAGS ] && item[_DYN_TAGS ][keys.operationId]) { score = hashCodeGenerator.getHashCodeScore(item[_DYN_TAGS ][keys.operationId]); } else if (item.ext && item.ext.telemetryTrace && item.ext.telemetryTrace[_DYN_TRACE_ID ]) { score = hashCodeGenerator.getHashCodeScore(item.ext.telemetryTrace[_DYN_TRACE_ID ]); } else { score = (Math.random() * 100); } return score; }; } return SamplingScoreGenerator; }()); var Sample = /** @class */ (function () { function Sample(sampleRate, logger) { this.INT_MAX_VALUE = 2147483647; var _logger = logger || safeGetLogger(null); if (sampleRate > 100 || sampleRate < 0) { _logger.throwInternal(2 , 58 , "Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.", { samplingRate: sampleRate }, true); sampleRate = 100; } this[_DYN_SAMPLE_RATE ] = sampleRate; this.samplingScoreGenerator = new SamplingScoreGenerator(); } Sample.prototype.isSampledIn = function (envelope) { var samplingPercentage = this[_DYN_SAMPLE_RATE ]; var isSampledIn = false; if (samplingPercentage === null || samplingPercentage === undefined || samplingPercentage >= 100) { return true; } else if (envelope.baseType === Metric[_DYN_DATA_TYPE ]) { return true; } isSampledIn = this.samplingScoreGenerator[_DYN_GET_SAMPLING_SCORE ](envelope) < samplingPercentage; return isSampledIn; }; return Sample; }()); var _a; var FetchSyncRequestSizeLimitBytes = 65000; function _getResponseText(xhr) { try { return xhr.responseText; } catch (e) { } return null; } function _getDefaultAppInsightsChannelConfig() { var _a; var defaultValue; var defaultCustomHeaders; return _a = { endpointUrl: function () { return DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; } }, _a[_DYN_EMIT_LINE_DELIMITED_0 ] = function () { return false; }, _a[_DYN_MAX_BATCH_INTERVAL ] = function () { return 15000; }, _a[_DYN_MAX_BATCH_SIZE_IN_BY1 ] = function () { return 102400; }, _a[_DYN_DISABLE_TELEMETRY ] = function () { return false; }, _a[_DYN_ENABLE_SESSION_STORA4 ] = function () { return true; }, _a[_DYN_BUFFER_OVERRIDE ] = function () { return false; }, _a[_DYN_IS_RETRY_DISABLED ] = function () { return false; }, _a[_DYN_IS_BEACON_API_DISABL3 ] = function () { return true; }, _a[_DYN_DISABLE_XHR ] = function () { return false; }, _a[_DYN_ONUNLOAD_DISABLE_FET5 ] = function () { return false; }, _a[_DYN_ONUNLOAD_DISABLE_BEA2 ] = function () { return false; }, _a[_DYN_INSTRUMENTATION_KEY ] = function () { return defaultValue; }, _a[_DYN_NAME_PREFIX$1 ] = function () { return defaultValue; }, _a[_DYN_SAMPLING_PERCENTAGE ] = function () { return 100; }, _a[_DYN_CUSTOM_HEADERS ] = function () { return defaultCustomHeaders; }, _a[_DYN_CONVERT_UNDEFINED ] = function () { return defaultValue; }, _a.eventsLimitInMem = function () { return 10000; }, _a; } var EnvelopeTypeCreator = (_a = {}, _a[Event$1.dataType] = EventEnvelopeCreator, _a[Trace.dataType] = TraceEnvelopeCreator, _a[PageView.dataType] = PageViewEnvelopeCreator, _a[PageViewPerformance.dataType] = PageViewPerformanceEnvelopeCreator, _a[Exception.dataType] = ExceptionEnvelopeCreator, _a[Metric.dataType] = MetricEnvelopeCreator, _a[RemoteDependencyData.dataType] = DependencyEnvelopeCreator, _a); var Sender = /** @class */ (function (_super) { __extendsFn(Sender, _super); function Sender() { var _this = _super.call(this) || this; _this.priority = 1001; _this.identifier = BreezeChannelIdentifier; _this._senderConfig = _getDefaultAppInsightsChannelConfig(); var _consecutiveErrors; var _retryAt; var _paused; var _timeoutHandle; var _serializer; var _stamp_specific_redirects; var _headers; var _syncFetchPayload = 0; var _fallbackSender; var _syncUnloadSender; var _offlineListener; var _evtNamespace; dynamicProto(Sender, _this, function (_self, _base) { _initDefaults(); _self.pause = function () { _clearScheduledTimer(); _paused = true; }; _self.resume = function () { if (_paused) { _paused = false; _retryAt = null; if (_self._buffer.size() > _self._senderConfig[_DYN_MAX_BATCH_SIZE_IN_BY1 ]()) { _self[_DYN_TRIGGER_SEND ](true, null, 10 ); } _setupTimer(); } }; _self.flush = function (isAsync, callBack, sendReason) { if (isAsync === void 0) { isAsync = true; } if (!_paused) { _clearScheduledTimer(); try { _self[_DYN_TRIGGER_SEND ](isAsync, null, sendReason || 1 ); } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 22 , "flush failed, telemetry will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } } }; _self.onunloadFlush = function () { if (!_paused) { if ((_self._senderConfig[_DYN_ONUNLOAD_DISABLE_BEA2 ]() === false || _self[_DYN__SENDER_CONFIG ][_DYN_IS_BEACON_API_DISABL3 ]() === false) && isBeaconsSupported()) { try { _self[_DYN_TRIGGER_SEND ](true, _doUnloadSend, 2 ); } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 20 , "failed to flush with beacon sender on page unload, telemetry will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } } else { _self.flush(); } } }; _self.addHeader = function (name, value) { _headers[name] = value; }; _self.initialize = function (config, core, extensions, pluginChain) { if (_self.isInitialized()) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 28 , "Sender is already initialized"); } _base.initialize(config, core, extensions, pluginChain); var ctx = _self._getTelCtx(); var identifier = _self.identifier; _serializer = new Serializer(core.logger); _consecutiveErrors = 0; _retryAt = null; _self[_DYN__SENDER ] = null; _stamp_specific_redirects = 0; var diagLog = _self[_DYN_DIAG_LOG ](); _evtNamespace = mergeEvtNamespace(createUniqueNamespace("Sender"), core.evtNamespace && core.evtNamespace()); _offlineListener = createOfflineListener(_evtNamespace); var defaultConfig = _getDefaultAppInsightsChannelConfig(); objForEachKey(defaultConfig, function (field, value) { _self[_DYN__SENDER_CONFIG ][field] = function () { var theValue = ctx.getConfig(identifier, field, value()); if (!theValue && field === "endpointUrl") { theValue = value(); } return theValue; }; }); if (config.storagePrefix) { utlSetStoragePrefix(config.storagePrefix); } var useSessionStorage = _self[_DYN__SENDER_CONFIG ][_DYN_ENABLE_SESSION_STORA4 ]() && !!(_self._senderConfig[_DYN_BUFFER_OVERRIDE ]() || utlCanUseSessionStorage()); _self[_DYN__BUFFER ] = useSessionStorage ? new SessionStorageSendBuffer(diagLog, _self[_DYN__SENDER_CONFIG ]) : new ArraySendBuffer(diagLog, _self[_DYN__SENDER_CONFIG ]); _self._sample = new Sample(_self[_DYN__SENDER_CONFIG ][_DYN_SAMPLING_PERCENTAGE ](), diagLog); if (!_validateInstrumentationKey(config)) { _throwInternal(diagLog, 1 , 100 , "Invalid Instrumentation key " + config[_DYN_INSTRUMENTATION_KEY ]); } if (!isInternalApplicationInsightsEndpoint(_self._senderConfig.endpointUrl()) && _self._senderConfig.customHeaders() && _self._senderConfig.customHeaders()[_DYN_LENGTH$1 ] > 0) { arrForEach(_self[_DYN__SENDER_CONFIG ][_DYN_CUSTOM_HEADERS ](), function (customHeader) { _this.addHeader(customHeader.header, customHeader.value); }); } var senderConfig = _self[_DYN__SENDER_CONFIG ]; var sendPostFunc = null; if (!senderConfig[_DYN_DISABLE_XHR ]() && useXDomainRequest()) { sendPostFunc = _xdrSender; } else if (!senderConfig[_DYN_DISABLE_XHR ]() && isXhrSupported()) { sendPostFunc = _xhrSender; } if (!sendPostFunc && isFetchSupported()) { sendPostFunc = _fetchSender; } _fallbackSender = sendPostFunc || _xhrSender; if (!senderConfig[_DYN_IS_BEACON_API_DISABL3 ]() && isBeaconsSupported()) { sendPostFunc = _beaconSender; } _self[_DYN__SENDER ] = sendPostFunc || _xhrSender; if (!senderConfig[_DYN_ONUNLOAD_DISABLE_FET5 ]() && isFetchSupported(true)) { _syncUnloadSender = _fetchKeepAliveSender; } else if (isBeaconsSupported()) { _syncUnloadSender = _beaconSender; } else if (!senderConfig[_DYN_DISABLE_XHR ]() && useXDomainRequest()) { _syncUnloadSender = _xdrSender; } else if (!senderConfig[_DYN_DISABLE_XHR ]() && isXhrSupported()) { _syncUnloadSender = _xhrSender; } else { _syncUnloadSender = _fallbackSender; } }; _self.processTelemetry = function (telemetryItem, itemCtx) { itemCtx = _self._getTelCtx(itemCtx); var diagLogger = itemCtx[_DYN_DIAG_LOG ](); try { if (_self[_DYN__SENDER_CONFIG ][_DYN_DISABLE_TELEMETRY ]()) { return; } if (!telemetryItem) { _throwInternal(diagLogger, 1 , 7 , "Cannot send empty telemetry"); return; } if (telemetryItem.baseData && !telemetryItem[_DYN_BASE_TYPE ]) { _throwInternal(diagLogger, 1 , 70 , "Cannot send telemetry without baseData and baseType"); return; } if (!telemetryItem[_DYN_BASE_TYPE ]) { telemetryItem[_DYN_BASE_TYPE ] = "EventData"; } if (!_self[_DYN__SENDER ]) { _throwInternal(diagLogger, 1 , 28 , "Sender was not initialized"); return; } if (!_isSampledIn(telemetryItem)) { _throwInternal(diagLogger, 2 , 33 , "Telemetry item was sampled out and not sent", { SampleRate: _self._sample[_DYN_SAMPLE_RATE ] }); return; } else { telemetryItem[SampleRate] = _self._sample[_DYN_SAMPLE_RATE ]; } var convertUndefined = _self[_DYN__SENDER_CONFIG ][_DYN_CONVERT_UNDEFINED ]() || undefined; var defaultEnvelopeIkey = telemetryItem.iKey || _self[_DYN__SENDER_CONFIG ][_DYN_INSTRUMENTATION_KEY ](); var aiEnvelope_1 = Sender.constructEnvelope(telemetryItem, defaultEnvelopeIkey, diagLogger, convertUndefined); if (!aiEnvelope_1) { _throwInternal(diagLogger, 1 , 47 , "Unable to create an AppInsights envelope"); return; } var doNotSendItem_1 = false; if (telemetryItem[_DYN_TAGS ] && telemetryItem[_DYN_TAGS ][ProcessLegacy]) { arrForEach(telemetryItem[_DYN_TAGS ][ProcessLegacy], function (callBack) { try { if (callBack && callBack(aiEnvelope_1) === false) { doNotSendItem_1 = true; _warnToConsole(diagLogger, "Telemetry processor check returns false"); } } catch (e) { _throwInternal(diagLogger, 1 , 64 , "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true); } }); delete telemetryItem[_DYN_TAGS ][ProcessLegacy]; } if (doNotSendItem_1) { return; } var payload = _serializer.serialize(aiEnvelope_1); var buffer = _self[_DYN__BUFFER ]; var bufferSize = buffer.size(); if ((bufferSize + payload[_DYN_LENGTH$1 ]) > _self[_DYN__SENDER_CONFIG ][_DYN_MAX_BATCH_SIZE_IN_BY1 ]()) { if (!_offlineListener || _offlineListener[_DYN_IS_ONLINE ]()) { _self[_DYN_TRIGGER_SEND ](true, null, 10 ); } } buffer[_DYN_ENQUEUE ](payload); _setupTimer(); } catch (e) { _throwInternal(diagLogger, 2 , 12 , "Failed adding telemetry to the sender's buffer, some telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) }); } _self.processNext(telemetryItem, itemCtx); }; _self[_DYN__XHR_READY_STATE_CHA6 ] = function (xhr, payload, countOfItemsInPayload) { if (xhr.readyState === 4) { _checkResponsStatus(xhr.status, payload, xhr.responseURL, countOfItemsInPayload, _formatErrorMessageXhr(xhr), _getResponseText(xhr) || xhr.response); } }; _self[_DYN_TRIGGER_SEND ] = function (async, forcedSender, sendReason) { if (async === void 0) { async = true; } if (!_paused) { try { var buffer = _self[_DYN__BUFFER ]; if (!_self[_DYN__SENDER_CONFIG ][_DYN_DISABLE_TELEMETRY ]()) { if (buffer[_DYN_COUNT ]() > 0) { var payload = buffer.getItems(); _notifySendRequest(sendReason || 0 , async); if (forcedSender) { forcedSender.call(_self, payload, async); } else { _self[_DYN__SENDER ](payload, async); } } } else { buffer[_DYN_CLEAR ](); } _clearScheduledTimer(); } catch (e) { var ieVer = getIEVersion(); if (!ieVer || ieVer > 9) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 40 , "Telemetry transmission failed, some telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) }); } } } }; _self._doTeardown = function (unloadCtx, unloadState) { _self.onunloadFlush(); _offlineListener.unload(); _initDefaults(); }; _self[_DYN__ON_ERROR ] = function (payload, message, event) { _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 26 , "Failed to send telemetry.", { message: message }); _self._buffer && _self._buffer[_DYN_CLEAR_SENT ](payload); }; _self[_DYN__ON_PARTIAL_SUCCESS ] = function (payload, results) { var failed = []; var retry = []; var errors = results.errors.reverse(); for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) { var error = errors_1[_i]; var extracted = payload.splice(error.index, 1)[0]; if (_isRetriable(error.statusCode)) { retry[_DYN_PUSH ](extracted); } else { failed[_DYN_PUSH ](extracted); } } if (payload[_DYN_LENGTH$1 ] > 0) { _self[_DYN__ON_SUCCESS ](payload, results[_DYN_ITEMS_ACCEPTED ]); } if (failed[_DYN_LENGTH$1 ] > 0) { _self[_DYN__ON_ERROR ](failed, _formatErrorMessageXhr(null, ["partial success", results[_DYN_ITEMS_ACCEPTED ], "of", results.itemsReceived].join(" "))); } if (retry[_DYN_LENGTH$1 ] > 0) { _resendPayload(retry); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , "Partial success. " + "Delivered: " + payload[_DYN_LENGTH$1 ] + ", Failed: " + failed[_DYN_LENGTH$1 ] + ". Will retry to send " + retry[_DYN_LENGTH$1 ] + " our of " + results[_DYN_ITEMS_RECEIVED ] + " items"); } }; _self[_DYN__ON_SUCCESS ] = function (payload, countOfItemsInPayload) { _self._buffer && _self._buffer[_DYN_CLEAR_SENT ](payload); }; _self._xdrOnLoad = function (xdr, payload) { var responseText = _getResponseText(xdr); if (xdr && (responseText + "" === "200" || responseText === "")) { _consecutiveErrors = 0; _self[_DYN__ON_SUCCESS ](payload, 0); } else { var results = _parseResponse(responseText); if (results && results.itemsReceived && results.itemsReceived > results[_DYN_ITEMS_ACCEPTED ] && !_self[_DYN__SENDER_CONFIG ][_DYN_IS_RETRY_DISABLED ]()) { _self[_DYN__ON_PARTIAL_SUCCESS ](payload, results); } else { _self[_DYN__ON_ERROR ](payload, _formatErrorMessageXdr(xdr)); } } }; function _isSampledIn(envelope) { return _self._sample.isSampledIn(envelope); } function _checkResponsStatus(status, payload, responseUrl, countOfItemsInPayload, errorMessage, res) { var response = null; if (!_self._appId) { response = _parseResponse(res); if (response && response.appId) { _self._appId = response.appId; } } if ((status < 200 || status >= 300) && status !== 0) { if (status === 301 || status === 307 || status === 308) { if (!_checkAndUpdateEndPointUrl(responseUrl)) { _self[_DYN__ON_ERROR ](payload, errorMessage); return; } } if (!_self[_DYN__SENDER_CONFIG ][_DYN_IS_RETRY_DISABLED ]() && _isRetriable(status)) { _resendPayload(payload); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". " + "Response code " + status + ". Will retry to send " + payload[_DYN_LENGTH$1 ] + " items."); } else { _self[_DYN__ON_ERROR ](payload, errorMessage); } } else if (_offlineListener && !_offlineListener[_DYN_IS_ONLINE ]()) { if (!_self[_DYN__SENDER_CONFIG ][_DYN_IS_RETRY_DISABLED ]()) { var offlineBackOffMultiplier = 10; _resendPayload(payload, offlineBackOffMultiplier); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". Offline - Response Code: ".concat(status, ". Offline status: ").concat(!_offlineListener.isOnline(), ". Will retry to send ").concat(payload.length, " items.")); } } else { _checkAndUpdateEndPointUrl(responseUrl); if (status === 206) { if (!response) { response = _parseResponse(res); } if (response && !_self[_DYN__SENDER_CONFIG ][_DYN_IS_RETRY_DISABLED ]()) { _self[_DYN__ON_PARTIAL_SUCCESS ](payload, response); } else { _self[_DYN__ON_ERROR ](payload, errorMessage); } } else { _consecutiveErrors = 0; _self[_DYN__ON_SUCCESS ](payload, countOfItemsInPayload); } } } function _checkAndUpdateEndPointUrl(responseUrl) { if (_stamp_specific_redirects >= 10) { return false; } if (!isNullOrUndefined(responseUrl) && responseUrl !== "") { if (responseUrl !== _self[_DYN__SENDER_CONFIG ][_DYN_ENDPOINT_URL ]()) { _self[_DYN__SENDER_CONFIG ][_DYN_ENDPOINT_URL ] = function () { return responseUrl; }; ++_stamp_specific_redirects; return true; } } return false; } function _doUnloadSend(payload, isAsync) { if (_syncUnloadSender) { _syncUnloadSender(payload, false); } else { _beaconSender(payload); } } function _doBeaconSend(payload) { var nav = getNavigator(); var buffer = _self[_DYN__BUFFER ]; var url = _self[_DYN__SENDER_CONFIG ][_DYN_ENDPOINT_URL ](); var batch = _self._buffer[_DYN_BATCH_PAYLOADS ](payload); var plainTextBatch = new Blob([batch], { type: "text/plain;charset=UTF-8" }); var queued = nav.sendBeacon(url, plainTextBatch); if (queued) { buffer[_DYN_MARK_AS_SENT ](payload); _self._onSuccess(payload, payload[_DYN_LENGTH$1 ]); } return queued; } function _beaconSender(payload, isAsync) { if (isArray(payload) && payload[_DYN_LENGTH$1 ] > 0) { if (!_doBeaconSend(payload)) { var droppedPayload = []; for (var lp = 0; lp < payload[_DYN_LENGTH$1 ]; lp++) { var thePayload = payload[lp]; if (!_doBeaconSend([thePayload])) { droppedPayload[_DYN_PUSH ](thePayload); } } if (droppedPayload[_DYN_LENGTH$1 ] > 0) { _fallbackSender && _fallbackSender(droppedPayload, true); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". " + "Failed to send telemetry with Beacon API, retried with normal sender."); } } } } function _xhrSender(payload, isAsync) { var xhr = new XMLHttpRequest(); var endPointUrl = _self[_DYN__SENDER_CONFIG ][_DYN_ENDPOINT_URL ](); try { xhr[DisabledPropertyName] = true; } catch (e) { } xhr.open("POST", endPointUrl, isAsync); xhr[_DYN_SET_REQUEST_HEADER ]("Content-type", "application/json"); if (isInternalApplicationInsightsEndpoint(endPointUrl)) { xhr[_DYN_SET_REQUEST_HEADER ](RequestHeaders[6 ], RequestHeaders[7 ]); } arrForEach(objKeys(_headers), function (headerName) { xhr[_DYN_SET_REQUEST_HEADER ](headerName, _headers[headerName]); }); xhr.onreadystatechange = function () { return _self._xhrReadyStateChange(xhr, payload, payload[_DYN_LENGTH$1 ]); }; xhr.onerror = function (event) { return _self[_DYN__ON_ERROR ](payload, _formatErrorMessageXhr(xhr), event); }; var batch = _self._buffer[_DYN_BATCH_PAYLOADS ](payload); xhr.send(batch); _self._buffer[_DYN_MARK_AS_SENT ](payload); } function _fetchKeepAliveSender(payload, isAsync) { if (isArray(payload)) { var payloadSize = payload[_DYN_LENGTH$1 ]; for (var lp = 0; lp < payload[_DYN_LENGTH$1 ]; lp++) { payloadSize += payload[lp][_DYN_LENGTH$1 ]; } if ((_syncFetchPayload + payloadSize) <= FetchSyncRequestSizeLimitBytes) { _doFetchSender(payload, false); } else if (isBeaconsSupported()) { _beaconSender(payload); } else { _fallbackSender && _fallbackSender(payload, true); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". " + "Failed to send telemetry with Beacon API, retried with xhrSender."); } } } function _fetchSender(payload, isAsync) { _doFetchSender(payload, true); } function _doFetchSender(payload, isAsync) { var _a; var endPointUrl = _self[_DYN__SENDER_CONFIG ][_DYN_ENDPOINT_URL ](); var batch = _self._buffer[_DYN_BATCH_PAYLOADS ](payload); var plainTextBatch = new Blob([batch], { type: "application/json" }); var requestHeaders = new Headers(); var batchLength = batch[_DYN_LENGTH$1 ]; var ignoreResponse = false; var responseHandled = false; if (isInternalApplicationInsightsEndpoint(endPointUrl)) { requestHeaders.append(RequestHeaders[6 ], RequestHeaders[7 ]); } arrForEach(objKeys(_headers), function (headerName) { requestHeaders.append(headerName, _headers[headerName]); }); var init = (_a = { method: "POST", headers: requestHeaders, body: plainTextBatch }, _a[DisabledPropertyName] = true , _a); if (!isAsync) { init.keepalive = true; ignoreResponse = true; _syncFetchPayload += batchLength; } var request = new Request(endPointUrl, init); try { request[DisabledPropertyName] = true; } catch (e) { } _self._buffer[_DYN_MARK_AS_SENT ](payload); try { fetch(request).then(function (response) { if (!isAsync) { _syncFetchPayload -= batchLength; batchLength = 0; } if (!responseHandled) { responseHandled = true; if (!response.ok) { _self[_DYN__ON_ERROR ](payload, response.statusText); } else { response.text().then(function (text) { _checkResponsStatus(response.status, payload, response.url, payload[_DYN_LENGTH$1 ], response.statusText, text); }); } } })["catch"](function (error) { if (!isAsync) { _syncFetchPayload -= batchLength; batchLength = 0; } if (!responseHandled) { responseHandled = true; _self[_DYN__ON_ERROR ](payload, error.message); } }); } catch (e) { if (!responseHandled) { _self[_DYN__ON_ERROR ](payload, dumpObj(e)); } } if (ignoreResponse && !responseHandled) { responseHandled = true; _self._onSuccess(payload, payload[_DYN_LENGTH$1 ]); } } function _parseResponse(response) { try { if (response && response !== "") { var result = getJSON().parse(response); if (result && result.itemsReceived && result.itemsReceived >= result[_DYN_ITEMS_ACCEPTED ] && result.itemsReceived - result.itemsAccepted === result.errors[_DYN_LENGTH$1 ]) { return result; } } } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 43 , "Cannot parse the response. " + getExceptionName(e), { response: response }); } return null; } function _resendPayload(payload, linearFactor) { if (linearFactor === void 0) { linearFactor = 1; } if (!payload || payload[_DYN_LENGTH$1 ] === 0) { return; } var buffer = _self[_DYN__BUFFER ]; buffer[_DYN_CLEAR_SENT ](payload); _consecutiveErrors++; for (var _i = 0, payload_1 = payload; _i < payload_1.length; _i++) { var item = payload_1[_i]; buffer[_DYN_ENQUEUE ](item); } _setRetryTime(linearFactor); _setupTimer(); } function _setRetryTime(linearFactor) { var SlotDelayInSeconds = 10; var delayInSeconds; if (_consecutiveErrors <= 1) { delayInSeconds = SlotDelayInSeconds; } else { var backOffSlot = (Math.pow(2, _consecutiveErrors) - 1) / 2; var backOffDelay = Math.floor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1; backOffDelay = linearFactor * backOffDelay; delayInSeconds = Math.max(Math.min(backOffDelay, 3600), SlotDelayInSeconds); } var retryAfterTimeSpan = dateNow() + (delayInSeconds * 1000); _retryAt = retryAfterTimeSpan; } function _setupTimer() { if (!_timeoutHandle && !_paused) { var retryInterval = _retryAt ? Math.max(0, _retryAt - dateNow()) : 0; var timerValue = Math.max(_self[_DYN__SENDER_CONFIG ][_DYN_MAX_BATCH_INTERVAL ](), retryInterval); _timeoutHandle = setTimeout(function () { _timeoutHandle = null; _self[_DYN_TRIGGER_SEND ](true, null, 1 ); }, timerValue); } } function _clearScheduledTimer() { clearTimeout(_timeoutHandle); _timeoutHandle = null; _retryAt = null; } function _isRetriable(statusCode) { return statusCode === 401 || statusCode === 403 || statusCode === 408 || statusCode === 429 || statusCode === 500 || statusCode === 502 || statusCode === 503 || statusCode === 504; } function _formatErrorMessageXhr(xhr, message) { if (xhr) { return "XMLHttpRequest,Status:" + xhr.status + ",Response:" + _getResponseText(xhr) || xhr.response || ""; } return message; } function _xdrSender(payload, isAsync) { var buffer = _self[_DYN__BUFFER ]; var _window = getWindow(); var xdr = new XDomainRequest(); xdr.onload = function () { return _self._xdrOnLoad(xdr, payload); }; xdr.onerror = function (event) { return _self[_DYN__ON_ERROR ](payload, _formatErrorMessageXdr(xdr), event); }; var hostingProtocol = _window && _window.location && _window.location.protocol || ""; if (_self[_DYN__SENDER_CONFIG ][_DYN_ENDPOINT_URL ]().lastIndexOf(hostingProtocol, 0) !== 0) { _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". " + "Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."); buffer[_DYN_CLEAR ](); return; } var endpointUrl = _self[_DYN__SENDER_CONFIG ][_DYN_ENDPOINT_URL ]().replace(/^(https?:)/, ""); xdr.open("POST", endpointUrl); var batch = buffer[_DYN_BATCH_PAYLOADS ](payload); xdr.send(batch); buffer[_DYN_MARK_AS_SENT ](payload); } function _formatErrorMessageXdr(xdr, message) { if (xdr) { return "XDomainRequest,Response:" + _getResponseText(xdr) || ""; } return message; } function _getNotifyMgr() { var func = "getNotifyMgr"; if (_self.core[func]) { return _self.core[func](); } return _self.core["_notificationManager"]; } function _notifySendRequest(sendRequest, isAsync) { var manager = _getNotifyMgr(); if (manager && manager[_DYN_EVENTS_SEND_REQUEST ]) { try { manager[_DYN_EVENTS_SEND_REQUEST ](sendRequest, isAsync); } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 74 , "send request notification failed: " + getExceptionName(e), { exception: dumpObj(e) }); } } } function _validateInstrumentationKey(config) { var disableIKeyValidationFlag = isNullOrUndefined(config[_DYN_DISABLE_INSTRUMENTAT7 ]) ? false : config[_DYN_DISABLE_INSTRUMENTAT7 ]; if (disableIKeyValidationFlag) { return true; } var UUID_Regex = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"; var regexp = new RegExp(UUID_Regex); return regexp.test(config[_DYN_INSTRUMENTATION_KEY ]); } function _initDefaults() { _self[_DYN__SENDER ] = null; _self[_DYN__BUFFER ] = null; _self._appId = null; _self._sample = null; _headers = {}; _offlineListener = null; _consecutiveErrors = 0; _retryAt = null; _paused = false; _timeoutHandle = null; _serializer = null; _stamp_specific_redirects = 0; _syncFetchPayload = 0; _fallbackSender = null; _syncUnloadSender = null; _evtNamespace = null; } }); return _this; } Sender.constructEnvelope = function (orig, iKey, logger, convertUndefined) { var envelope; if (iKey !== orig.iKey && !isNullOrUndefined(iKey)) { envelope = __assignFn(__assignFn({}, orig), { iKey: iKey }); } else { envelope = orig; } var creator = EnvelopeTypeCreator[envelope.baseType] || EventEnvelopeCreator; return creator(logger, envelope, convertUndefined); }; return Sender; }(BaseTelemetryPlugin)); var Application = /** @class */ (function () { function Application() { } return Application; }()); var Device = /** @class */ (function () { function Device() { this.id = "browser"; this.deviceClass = "Browser"; } return Device; }()); var _DYN_SESSION_MANAGER = "sessionManager"; var _DYN_UPDATE = "update"; var _DYN_IS_USER_COOKIE_SET = "isUserCookieSet"; var _DYN_IS_NEW_USER = "isNewUser"; var _DYN_GET_TRACE_CTX = "getTraceCtx"; var _DYN_TELEMETRY_TRACE = "telemetryTrace"; var _DYN_APPLY_SESSION_CONTEX0 = "applySessionContext"; var _DYN_APPLY_APPLICATION_CO1 = "applyApplicationContext"; var _DYN_APPLY_DEVICE_CONTEXT = "applyDeviceContext"; var _DYN_APPLY_OPERATION_CONT2 = "applyOperationContext"; var _DYN_APPLY_USER_CONTEXT = "applyUserContext"; var _DYN_APPLY_OPERATING_SYST3 = "applyOperatingSystemContxt"; var _DYN_APPLY_LOCATION_CONTE4 = "applyLocationContext"; var _DYN_APPLY_INTERNAL_CONTE5 = "applyInternalContext"; var _DYN_ACCOUNT_ID = "accountId"; var _DYN_SDK_EXTENSION = "sdkExtension"; var _DYN_GET_SESSION_ID = "getSessionId"; var _DYN_NAME_PREFIX = "namePrefix"; var _DYN_SESSION_COOKIE_POSTF6 = "sessionCookiePostfix"; var _DYN_USER_COOKIE_POSTFIX = "userCookiePostfix"; var _DYN_ID_LENGTH = "idLength"; var _DYN_GET_NEW_ID = "getNewId"; var _DYN_LENGTH = "length"; var _DYN_AUTOMATIC_SESSION = "automaticSession"; var _DYN_AUTHENTICATED_ID = "authenticatedId"; var _DYN_SESSION_EXPIRATION_M7 = "sessionExpirationMs"; var _DYN_SESSION_RENEWAL_MS = "sessionRenewalMs"; var _DYN_CONFIG = "config"; var _DYN_ACQUISITION_DATE = "acquisitionDate"; var _DYN_RENEWAL_DATE = "renewalDate"; var _DYN_COOKIE_DOMAIN = "cookieDomain"; var _DYN_JOIN = "join"; var _DYN_COOKIE_SEPARATOR = "cookieSeparator"; var _DYN_AUTH_USER_COOKIE_NAM8 = "authUserCookieName"; var Version = '2.8.14'; var Internal = /** @class */ (function () { function Internal(config) { this.sdkVersion = (config[_DYN_SDK_EXTENSION ] && config[_DYN_SDK_EXTENSION ]() ? config[_DYN_SDK_EXTENSION ]() + "_" : "") + "javascript:" + Version; } return Internal; }()); var Location = /** @class */ (function () { function Location() { } return Location; }()); var cookieNameConst = "ai_session"; var Session = /** @class */ (function () { function Session() { } return Session; }()); var _SessionManager = /** @class */ (function () { function _SessionManager(config, core) { var self = this; var _storageNamePrefix; var _cookieUpdatedTimestamp; var _logger = safeGetLogger(core); var _cookieManager = safeGetCookieMgr(core); dynamicProto(_SessionManager, self, function (_self) { if (!config) { config = {}; } if (!isFunction(config[_DYN_SESSION_EXPIRATION_M7 ])) { config[_DYN_SESSION_EXPIRATION_M7 ] = function () { return _SessionManager.acquisitionSpan; }; } if (!isFunction(config[_DYN_SESSION_RENEWAL_MS ])) { config[_DYN_SESSION_RENEWAL_MS ] = function () { return _SessionManager.renewalSpan; }; } _self[_DYN_CONFIG ] = config; var sessionCookiePostfix = (_self.config[_DYN_SESSION_COOKIE_POSTF6 ] && _self[_DYN_CONFIG ][_DYN_SESSION_COOKIE_POSTF6 ]()) ? _self.config[_DYN_SESSION_COOKIE_POSTF6 ]() : ((_self.config[_DYN_NAME_PREFIX ] && _self[_DYN_CONFIG ][_DYN_NAME_PREFIX ]()) ? _self[_DYN_CONFIG ][_DYN_NAME_PREFIX ]() : ""); _storageNamePrefix = function () { return cookieNameConst + sessionCookiePostfix; }; _self[_DYN_AUTOMATIC_SESSION ] = new Session(); _self[_DYN_UPDATE ] = function () { var nowMs = dateNow(); var isExpired = false; var session = _self[_DYN_AUTOMATIC_SESSION ]; if (!session.id) { isExpired = !_initializeAutomaticSession(session); } var sessionExpirationMs = _self.config[_DYN_SESSION_EXPIRATION_M7 ](); if (!isExpired && sessionExpirationMs > 0) { var sessionRenewalMs = _self.config[_DYN_SESSION_RENEWAL_MS ](); var timeSinceAcqMs = nowMs - session[_DYN_ACQUISITION_DATE ]; var timeSinceRenewalMs = nowMs - session[_DYN_RENEWAL_DATE ]; isExpired = timeSinceAcqMs < 0 || timeSinceRenewalMs < 0; isExpired = isExpired || timeSinceAcqMs > sessionExpirationMs; isExpired = isExpired || timeSinceRenewalMs > sessionRenewalMs; } if (isExpired) { _renew(nowMs); } else { if (!_cookieUpdatedTimestamp || nowMs - _cookieUpdatedTimestamp > _SessionManager.cookieUpdateInterval) { _setCookie(session, nowMs); } } }; _self.backup = function () { var session = _self[_DYN_AUTOMATIC_SESSION ]; _setStorage(session.id, session[_DYN_ACQUISITION_DATE ], session[_DYN_RENEWAL_DATE ]); }; function _initializeAutomaticSession(session, now) { var isValid = false; var cookieValue = _cookieManager.get(_storageNamePrefix()); if (cookieValue && isFunction(cookieValue.split)) { isValid = _initializeAutomaticSessionWithData(session, cookieValue); } else { var storageValue = utlGetLocalStorage(_logger, _storageNamePrefix()); if (storageValue) { isValid = _initializeAutomaticSessionWithData(session, storageValue); } } return isValid || !!session.id; } function _initializeAutomaticSessionWithData(session, sessionData) { var isValid = false; var sessionReset = ", session will be reset"; var tokens = sessionData.split("|"); if (tokens[_DYN_LENGTH ] >= 2) { try { var acqMs = +tokens[1] || 0; var renewalMs = +tokens[2] || 0; if (isNaN(acqMs) || acqMs <= 0) { _throwInternal(_logger, 2 , 27 , "AI session acquisition date is 0" + sessionReset); } else if (isNaN(renewalMs) || renewalMs <= 0) { _throwInternal(_logger, 2 , 27 , "AI session renewal date is 0" + sessionReset); } else if (tokens[0]) { session.id = tokens[0]; session[_DYN_ACQUISITION_DATE ] = acqMs; session[_DYN_RENEWAL_DATE ] = renewalMs; isValid = true; } } catch (e) { _throwInternal(_logger, 1 , 9 , "Error parsing ai_session value [" + (sessionData || "") + "]" + sessionReset + " - " + getExceptionName(e), { exception: dumpObj(e) }); } } return isValid; } function _renew(nowMs) { var theConfig = (_self[_DYN_CONFIG ] || {}); var getNewId = (theConfig[_DYN_GET_NEW_ID ] ? theConfig[_DYN_GET_NEW_ID ]() : null) || newId; _self.automaticSession.id = getNewId(theConfig[_DYN_ID_LENGTH ] ? theConfig[_DYN_ID_LENGTH ]() : 22); _self[_DYN_AUTOMATIC_SESSION ][_DYN_ACQUISITION_DATE ] = nowMs; _setCookie(_self[_DYN_AUTOMATIC_SESSION ], nowMs); if (!utlCanUseLocalStorage()) { _throwInternal(_logger, 2 , 0 , "Browser does not support local storage. Session durations will be inaccurate."); } } function _setCookie(session, nowMs) { var acq = session[_DYN_ACQUISITION_DATE ]; session[_DYN_RENEWAL_DATE ] = nowMs; var config = _self[_DYN_CONFIG ]; var renewalPeriodMs = config[_DYN_SESSION_RENEWAL_MS ](); var acqTimeLeftMs = (acq + config[_DYN_SESSION_EXPIRATION_M7 ]()) - nowMs; var cookie = [session.id, acq, nowMs]; var maxAgeSec = 0; if (acqTimeLeftMs < renewalPeriodMs) { maxAgeSec = acqTimeLeftMs / 1000; } else { maxAgeSec = renewalPeriodMs / 1000; } var cookieDomain = config[_DYN_COOKIE_DOMAIN ] ? config[_DYN_COOKIE_DOMAIN ]() : null; _cookieManager.set(_storageNamePrefix(), cookie.join("|"), config[_DYN_SESSION_EXPIRATION_M7 ]() > 0 ? maxAgeSec : null, cookieDomain); _cookieUpdatedTimestamp = nowMs; } function _setStorage(guid, acq, renewal) { utlSetLocalStorage(_logger, _storageNamePrefix(), [guid, acq, renewal][_DYN_JOIN ]("|")); } }); } _SessionManager.acquisitionSpan = 86400000; _SessionManager.renewalSpan = 1800000; _SessionManager.cookieUpdateInterval = 60000; return _SessionManager; }()); var TelemetryTrace = /** @class */ (function () { function TelemetryTrace(id, parentId, name, logger) { var _self = this; _self.traceID = id || generateW3CId(); _self.parentID = parentId; var location = getLocation(); if (!name && location && location.pathname) { name = location.pathname; } _self.name = dataSanitizeString(logger, name); } return TelemetryTrace; }()); function _validateUserInput(id) { if (typeof id !== "string" || !id || id.match(/,|;|=| |\|/)) { return false; } return true; } var User = /** @class */ (function () { function User(config, core) { this.isNewUser = false; this.isUserCookieSet = false; var _logger = safeGetLogger(core); var _cookieManager = safeGetCookieMgr(core); var _storageNamePrefix; dynamicProto(User, this, function (_self) { _self[_DYN_CONFIG ] = config; var userCookiePostfix = (_self.config[_DYN_USER_COOKIE_POSTFIX ] && _self[_DYN_CONFIG ][_DYN_USER_COOKIE_POSTFIX ]()) ? _self[_DYN_CONFIG ][_DYN_USER_COOKIE_POSTFIX ]() : ""; _storageNamePrefix = function () { return User.userCookieName + userCookiePostfix; }; var cookie = _cookieManager.get(_storageNamePrefix()); if (cookie) { _self[_DYN_IS_NEW_USER ] = false; var params = cookie.split(User[_DYN_COOKIE_SEPARATOR ]); if (params[_DYN_LENGTH ] > 0) { _self.id = params[0]; _self[_DYN_IS_USER_COOKIE_SET ] = !!_self.id; } } function _generateNewId() { var theConfig = (config || {}); var getNewId = (theConfig[_DYN_GET_NEW_ID ] ? theConfig[_DYN_GET_NEW_ID ]() : null) || newId; var id = getNewId(theConfig[_DYN_ID_LENGTH ] ? config[_DYN_ID_LENGTH ]() : 22); return id; } function _generateNewCookie(userId) { var acqStr = toISOString(new Date()); _self.accountAcquisitionDate = acqStr; _self[_DYN_IS_NEW_USER ] = true; var newCookie = [userId, acqStr]; return newCookie; } function _setUserCookie(cookie) { var oneYear = 31536000; _self[_DYN_IS_USER_COOKIE_SET ] = _cookieManager.set(_storageNamePrefix(), cookie, oneYear); } if (!_self.id) { _self.id = _generateNewId(); var newCookie = _generateNewCookie(_self.id); _setUserCookie(newCookie[_DYN_JOIN ](User[_DYN_COOKIE_SEPARATOR ])); var name_1 = config[_DYN_NAME_PREFIX ] && config[_DYN_NAME_PREFIX ]() ? config[_DYN_NAME_PREFIX ]() + "ai_session" : "ai_session"; utlRemoveStorage(_logger, name_1); } _self[_DYN_ACCOUNT_ID ] = config[_DYN_ACCOUNT_ID ] ? config[_DYN_ACCOUNT_ID ]() : undefined; var authCookie = _cookieManager.get(User[_DYN_AUTH_USER_COOKIE_NAM8 ]); if (authCookie) { authCookie = decodeURI(authCookie); var authCookieString = authCookie.split(User[_DYN_COOKIE_SEPARATOR ]); if (authCookieString[0]) { _self[_DYN_AUTHENTICATED_ID ] = authCookieString[0]; } if (authCookieString[_DYN_LENGTH ] > 1 && authCookieString[1]) { _self[_DYN_ACCOUNT_ID ] = authCookieString[1]; } } _self.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) { if (storeInCookie === void 0) { storeInCookie = false; } var isInvalidInput = !_validateUserInput(authenticatedUserId) || (accountId && !_validateUserInput(accountId)); if (isInvalidInput) { _throwInternal(_logger, 2 , 60 , "Setting auth user context failed. " + "User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.", true); return; } _self[_DYN_AUTHENTICATED_ID ] = authenticatedUserId; var authCookie = _self[_DYN_AUTHENTICATED_ID ]; if (accountId) { _self[_DYN_ACCOUNT_ID ] = accountId; authCookie = [_self[_DYN_AUTHENTICATED_ID ], _self.accountId][_DYN_JOIN ](User[_DYN_COOKIE_SEPARATOR ]); } if (storeInCookie) { _cookieManager.set(User[_DYN_AUTH_USER_COOKIE_NAM8 ], encodeURI(authCookie)); } }; _self.clearAuthenticatedUserContext = function () { _self[_DYN_AUTHENTICATED_ID ] = null; _self[_DYN_ACCOUNT_ID ] = null; _cookieManager.del(User[_DYN_AUTH_USER_COOKIE_NAM8 ]); }; _self[_DYN_UPDATE ] = function (userId) { if (_self.id !== userId || !_self[_DYN_IS_USER_COOKIE_SET ]) { var user_id = userId ? userId : _generateNewId(); var user_cookie = _generateNewCookie(user_id); _setUserCookie(user_cookie[_DYN_JOIN ](User[_DYN_COOKIE_SEPARATOR ])); } }; }); } User.cookieSeparator = "|"; User.userCookieName = "ai_user"; User.authUserCookieName = "ai_authUser"; return User; }()); var strExt = "ext"; var strTags = "tags"; function _removeEmpty(target, name) { if (target && target[name] && objKeys(target[name])[_DYN_LENGTH ] === 0) { delete target[name]; } } var TelemetryContext = /** @class */ (function () { function TelemetryContext(core, defaultConfig, previousTraceCtx) { var _this = this; var logger = core.logger; this.appId = function () { return null; }; this[_DYN_GET_SESSION_ID ] = function () { return null; }; dynamicProto(TelemetryContext, this, function (_self) { _self.application = new Application(); _self.internal = new Internal(defaultConfig); if (hasWindow()) { _self[_DYN_SESSION_MANAGER ] = new _SessionManager(defaultConfig, core); _self.device = new Device(); _self.location = new Location(); _self.user = new User(defaultConfig, core); var traceId = void 0; var parentId = void 0; var name_1; if (previousTraceCtx) { traceId = previousTraceCtx.getTraceId(); parentId = previousTraceCtx.getSpanId(); name_1 = previousTraceCtx.getName(); } _self[_DYN_TELEMETRY_TRACE ] = new TelemetryTrace(traceId, parentId, name_1, logger); _self.session = new Session(); } _self[_DYN_GET_SESSION_ID ] = function () { var session = _self.session; var sesId = null; if (session && isString(session.id)) { sesId = session.id; } else { var autoSession = (_self[_DYN_SESSION_MANAGER ] || {})[_DYN_AUTOMATIC_SESSION ]; sesId = autoSession && isString(autoSession.id) ? autoSession.id : null; } return sesId; }; _self[_DYN_APPLY_SESSION_CONTEX0 ] = function (evt, itemCtx) { setValue(getSetValue(evt.ext, Extensions.AppExt), "sesId", _self[_DYN_GET_SESSION_ID ](), isString); }; _self[_DYN_APPLY_OPERATING_SYST3 ] = function (evt, itemCtx) { setValue(evt.ext, Extensions.OSExt, _self.os); }; _self[_DYN_APPLY_APPLICATION_CO1 ] = function (evt, itemCtx) { var application = _self.application; if (application) { var tags = getSetValue(evt, strTags); setValue(tags, CtxTagKeys.applicationVersion, application.ver, isString); setValue(tags, CtxTagKeys.applicationBuild, application.build, isString); } }; _self[_DYN_APPLY_DEVICE_CONTEXT ] = function (evt, itemCtx) { var device = _self.device; if (device) { var extDevice = getSetValue(getSetValue(evt, strExt), Extensions.DeviceExt); setValue(extDevice, "localId", device.id, isString); setValue(extDevice, "ip", device.ip, isString); setValue(extDevice, "model", device.model, isString); setValue(extDevice, "deviceClass", device.deviceClass, isString); } }; _self[_DYN_APPLY_INTERNAL_CONTE5 ] = function (evt, itemCtx) { var internal = _self.internal; if (internal) { var tags = getSetValue(evt, strTags); setValue(tags, CtxTagKeys.internalAgentVersion, internal.agentVersion, isString); setValue(tags, CtxTagKeys.internalSdkVersion, dataSanitizeString(logger, internal.sdkVersion, 64), isString); if (evt.baseType === _InternalLogMessage.dataType || evt.baseType === PageView.dataType) { setValue(tags, CtxTagKeys.internalSnippet, internal.snippetVer, isString); setValue(tags, CtxTagKeys.internalSdkSrc, internal.sdkSrc, isString); } } }; _self[_DYN_APPLY_LOCATION_CONTE4 ] = function (evt, itemCtx) { var location = _this.location; if (location) { setValue(getSetValue(evt, strTags, []), CtxTagKeys.locationIp, location.ip, isString); } }; _self[_DYN_APPLY_OPERATION_CONT2 ] = function (evt, itemCtx) { var telemetryTrace = _self[_DYN_TELEMETRY_TRACE ]; if (telemetryTrace) { var extTrace = getSetValue(getSetValue(evt, strExt), Extensions.TraceExt, { traceID: undefined, parentID: undefined }); setValue(extTrace, "traceID", telemetryTrace.traceID, isString, isNullOrUndefined); setValue(extTrace, "name", telemetryTrace.name, isString, isNullOrUndefined); setValue(extTrace, "parentID", telemetryTrace.parentID, isString, isNullOrUndefined); } }; _self.applyWebContext = function (evt, itemCtx) { var web = _this.web; if (web) { setValue(getSetValue(evt, strExt), Extensions.WebExt, web); } }; _self[_DYN_APPLY_USER_CONTEXT ] = function (evt, itemCtx) { var user = _self.user; if (user) { var tags = getSetValue(evt, strTags, []); setValue(tags, CtxTagKeys.userAccountId, user[_DYN_ACCOUNT_ID ], isString); var extUser = getSetValue(getSetValue(evt, strExt), Extensions.UserExt); setValue(extUser, "id", user.id, isString); setValue(extUser, "authId", user[_DYN_AUTHENTICATED_ID ], isString); } }; _self.cleanUp = function (evt, itemCtx) { var ext = evt.ext; if (ext) { _removeEmpty(ext, Extensions.DeviceExt); _removeEmpty(ext, Extensions.UserExt); _removeEmpty(ext, Extensions.WebExt); _removeEmpty(ext, Extensions.OSExt); _removeEmpty(ext, Extensions.AppExt); _removeEmpty(ext, Extensions.TraceExt); } }; }); } TelemetryContext.__ieDyn=1; return TelemetryContext; }()); var PropertiesPlugin = /** @class */ (function (_super) { __extendsFn(PropertiesPlugin, _super); function PropertiesPlugin() { var _this = _super.call(this) || this; _this.priority = 110; _this.identifier = PropertiesPluginIdentifier; var _extensionConfig; var _distributedTraceCtx; var _previousTraceCtx; dynamicProto(PropertiesPlugin, _this, function (_self, _base) { _initDefaults(); _self.initialize = function (config, core, extensions, pluginChain) { _base.initialize(config, core, extensions, pluginChain); _populateDefaults(config); }; _self.processTelemetry = function (event, itemCtx) { if (isNullOrUndefined(event)) ; else { itemCtx = _self._getTelCtx(itemCtx); if (event.name === PageView.envelopeType) { itemCtx.diagLog().resetInternalMessageCount(); } var theContext = (_self.context || {}); if (theContext.session) { if (typeof _self.context.session.id !== "string" && theContext[_DYN_SESSION_MANAGER ]) { theContext[_DYN_SESSION_MANAGER ][_DYN_UPDATE ](); } } var userCtx = theContext.user; if (userCtx && !userCtx[_DYN_IS_USER_COOKIE_SET ]) { userCtx[_DYN_UPDATE ](theContext.user.id); } _processTelemetryInternal(event, itemCtx); if (userCtx && userCtx[_DYN_IS_NEW_USER ]) { userCtx[_DYN_IS_NEW_USER ] = false; var message = new _InternalLogMessage(72 , ((getNavigator() || {}).userAgent || "")); _logInternalMessage(itemCtx.diagLog(), 1 , message); } _self.processNext(event, itemCtx); } }; _self._doTeardown = function (unloadCtx, unloadState) { var core = (unloadCtx || {}).core(); if (core && core[_DYN_GET_TRACE_CTX ]) { var traceCtx = core[_DYN_GET_TRACE_CTX ](false); if (traceCtx === _distributedTraceCtx) { core.setTraceCtx(_previousTraceCtx); } } _initDefaults(); }; function _initDefaults() { _extensionConfig = null; _distributedTraceCtx = null; _previousTraceCtx = null; } function _populateDefaults(config) { var identifier = _self.identifier; var core = _self.core; var ctx = createProcessTelemetryContext(null, config, core); var defaultConfig = PropertiesPlugin.getDefaultConfig(); _extensionConfig = _extensionConfig || {}; objForEachKey(defaultConfig, function (field, value) { _extensionConfig[field] = function () { return ctx.getConfig(identifier, field, value()); }; }); if (config.storagePrefix) { utlSetStoragePrefix(config.storagePrefix); } _previousTraceCtx = core[_DYN_GET_TRACE_CTX ](false); _self.context = new TelemetryContext(core, _extensionConfig, _previousTraceCtx); _distributedTraceCtx = createDistributedTraceContextFromTrace(_self.context[_DYN_TELEMETRY_TRACE ], _previousTraceCtx); core.setTraceCtx(_distributedTraceCtx); _self.context.appId = function () { var breezeChannel = core.getPlugin(BreezeChannelIdentifier); return breezeChannel ? breezeChannel.plugin["_appId"] : null; }; _self["_extConfig"] = _extensionConfig; } function _processTelemetryInternal(evt, itemCtx) { getSetValue(evt, "tags", []); getSetValue(evt, "ext", {}); var ctx = _self.context; ctx[_DYN_APPLY_SESSION_CONTEX0 ](evt, itemCtx); ctx[_DYN_APPLY_APPLICATION_CO1 ](evt, itemCtx); ctx[_DYN_APPLY_DEVICE_CONTEXT ](evt, itemCtx); ctx[_DYN_APPLY_OPERATION_CONT2 ](evt, itemCtx); ctx[_DYN_APPLY_USER_CONTEXT ](evt, itemCtx); ctx[_DYN_APPLY_OPERATING_SYST3 ](evt, itemCtx); ctx.applyWebContext(evt, itemCtx); ctx[_DYN_APPLY_LOCATION_CONTE4 ](evt, itemCtx); ctx[_DYN_APPLY_INTERNAL_CONTE5 ](evt, itemCtx); ctx.cleanUp(evt, itemCtx); } }); return _this; } PropertiesPlugin.getDefaultConfig = function () { var _a; var defaultValue; var nullValue = null; var defaultConfig = (_a = { instrumentationKey: function () { return defaultValue; } }, _a[_DYN_ACCOUNT_ID ] = function () { return nullValue; }, _a.sessionRenewalMs = function () { return 30 * 60 * 1000; }, _a.samplingPercentage = function () { return 100; }, _a.sessionExpirationMs = function () { return 24 * 60 * 60 * 1000; }, _a[_DYN_COOKIE_DOMAIN ] = function () { return nullValue; }, _a[_DYN_SDK_EXTENSION ] = function () { return nullValue; }, _a.isBrowserLinkTrackingEnabled = function () { return false; }, _a.appId = function () { return nullValue; }, _a[_DYN_GET_SESSION_ID ] = function () { return nullValue; }, _a[_DYN_NAME_PREFIX ] = function () { return defaultValue; }, _a[_DYN_SESSION_COOKIE_POSTF6 ] = function () { return defaultValue; }, _a[_DYN_USER_COOKIE_POSTFIX ] = function () { return defaultValue; }, _a[_DYN_ID_LENGTH ] = function () { return 22; }, _a[_DYN_GET_NEW_ID ] = function () { return nullValue; }, _a); return defaultConfig; }; return PropertiesPlugin; }(BaseTelemetryPlugin)); var PropertiesPlugin$1 = PropertiesPlugin; var _internalSdkSrc; var _ignoreUpdateSnippetProperties = [ STR_SNIPPET, "dependencies", "properties", "_snippetVersion", "appInsightsNew", "getSKUDefaults" ]; var fieldType = { Default: 0 , Required: 1 , Array: 2 , Hidden: 4 }; var Telemetry = { __proto__: null, PropertiesPluginIdentifier: PropertiesPluginIdentifier, BreezeChannelIdentifier: BreezeChannelIdentifier, AnalyticsPluginIdentifier: AnalyticsPluginIdentifier, Util: Util, CorrelationIdHelper: CorrelationIdHelper, UrlHelper: UrlHelper, DateTimeUtils: DateTimeUtils, ConnectionStringParser: ConnectionStringParser, FieldType: fieldType, RequestHeaders: RequestHeaders, DisabledPropertyName: DisabledPropertyName, ProcessLegacy: ProcessLegacy, SampleRate: SampleRate, HttpMethod: HttpMethod, DEFAULT_BREEZE_ENDPOINT: DEFAULT_BREEZE_ENDPOINT, Envelope: Envelope, Event: Event$1, Exception: Exception, Metric: Metric, PageView: PageView, RemoteDependencyData: RemoteDependencyData, Trace: Trace, PageViewPerformance: PageViewPerformance, Data: Data, SeverityLevel: SeverityLevel, ConfigurationManager: ConfigurationManager, ContextTagKeys: ContextTagKeys, DataSanitizer: DataSanitizer, TelemetryItemCreator: TelemetryItemCreator, CtxTagKeys: CtxTagKeys, Extensions: Extensions, DistributedTracingModes: DistributedTracingModes }; var Initialization = /** @class */ (function () { function Initialization(snippet) { var _this = this; var dependencies; var properties; var _sender; var _snippetVersion; var _evtNamespace; var _houseKeepingNamespace; var _core; dynamicProto(Initialization, this, function (_self) { _initDefaults(); _snippetVersion = "" + (snippet.sv || snippet[_DYN_VERSION ] || ""); snippet[_DYN_QUEUE ] = snippet[_DYN_QUEUE ] || []; snippet[_DYN_VERSION ] = snippet[_DYN_VERSION ] || 2.0; var config = snippet[_DYN_CONFIG$1 ] || {}; if (config[_DYN_CONNECTION_STRING ]) { var cs = parseConnectionString(config[_DYN_CONNECTION_STRING ]); var ingest = cs.ingestionendpoint; config[_DYN_ENDPOINT_URL$1 ] = ingest ? (ingest + DEFAULT_BREEZE_PATH) : config[_DYN_ENDPOINT_URL$1 ]; config[_DYN_INSTRUMENTATION_KEY$1 ] = cs.instrumentationkey || config[_DYN_INSTRUMENTATION_KEY$1 ]; } _self[_DYN_APP_INSIGHTS ] = new AnalyticsPlugin(); properties = new PropertiesPlugin$1(); dependencies = new AjaxMonitor(); _sender = new Sender(); _core = new AppInsightsCore(); _self.core = _core; var isErrMessageDisabled = isNullOrUndefined(config[_DYN_DISABLE_IKEY_DEPRECA18 ]) ? true : config[_DYN_DISABLE_IKEY_DEPRECA18 ]; if (!config[_DYN_CONNECTION_STRING ] && !isErrMessageDisabled) { _throwInternal(_core.logger, 1 , 106 , "Instrumentation key support will end soon, see aka.ms/IkeyMigrate"); } _self[STR_SNIPPET ] = snippet; _self[_DYN_CONFIG$1 ] = config; _getSKUDefaults(); _self[STR_FLUSH ] = function (async) { if (async === void 0) { async = true; } doPerf(_core, function () { return "AISKU.flush"; }, function () { arrForEach(_core[_DYN_GET_TRANSMISSION_CON19 ](), function (channels) { arrForEach(channels, function (channel) { channel[STR_FLUSH ](async); }); }); }, null, async); }; _self[_DYN_ONUNLOAD_FLUSH ] = function (async) { if (async === void 0) { async = true; } arrForEach(_core[_DYN_GET_TRANSMISSION_CON19 ](), function (channels) { arrForEach(channels, function (channel) { if (channel[_DYN_ONUNLOAD_FLUSH ]) { channel[_DYN_ONUNLOAD_FLUSH ](); } else { channel[STR_FLUSH ](async); } }); }); }; _self[_DYN_LOAD_APP_INSIGHTS ] = function (legacyMode, logger, notificationManager) { if (legacyMode === void 0) { legacyMode = false; } function _updateSnippetProperties(snippet) { if (snippet) { var snippetVer = ""; if (!isNullOrUndefined(_snippetVersion)) { snippetVer += _snippetVersion; } if (legacyMode) { snippetVer += ".lg"; } if (_self[_DYN_CONTEXT ] && _self[_DYN_CONTEXT ].internal) { _self[_DYN_CONTEXT ].internal.snippetVer = snippetVer || "-"; } objForEachKey(_self, function (field, value) { if (isString(field) && !isFunction(value) && field && field[0] !== "_" && arrIndexOf(_ignoreUpdateSnippetProperties, field) === -1) { snippet[field] = value; } }); } } if (legacyMode && _self[_DYN_CONFIG$1 ].extensions && _self[_DYN_CONFIG$1 ].extensions.length > 0) { throwError("Extensions not allowed in legacy mode"); } doPerf(_self.core, function () { return "AISKU.loadAppInsights"; }, function () { var extensions = []; extensions[_DYN_PUSH$1 ](_sender); extensions[_DYN_PUSH$1 ](properties); extensions[_DYN_PUSH$1 ](dependencies); extensions[_DYN_PUSH$1 ](_self[_DYN_APP_INSIGHTS ]); _core.initialize(_self[_DYN_CONFIG$1 ], extensions, logger, notificationManager); _self[_DYN_CONTEXT ] = properties[_DYN_CONTEXT ]; if (_internalSdkSrc && _self[_DYN_CONTEXT ]) { _self[_DYN_CONTEXT ].internal.sdkSrc = _internalSdkSrc; } _updateSnippetProperties(_self[STR_SNIPPET ]); _self.emptyQueue(); _self[STR_POLL_INTERNAL_LOGS ](); _self[_DYN_ADD_HOUSEKEEPING_BEF20 ](_self); }); return _self; }; _self[_DYN_UPDATE_SNIPPET_DEFIN0 ] = function (snippet) { proxyAssign(snippet, _self, function (name) { return name && arrIndexOf(_ignoreUpdateSnippetProperties, name) === -1; }); }; _self.emptyQueue = function () { try { if (isArray(_self.snippet[_DYN_QUEUE ])) { var length_1 = _self.snippet[_DYN_QUEUE ].length; for (var i = 0; i < length_1; i++) { var call = _self.snippet[_DYN_QUEUE ][i]; call(); } _self.snippet[_DYN_QUEUE ] = undefined; delete _self.snippet[_DYN_QUEUE ]; } } catch (exception) { var properties_1 = {}; if (exception && isFunction(exception.toString)) { properties_1.exception = exception.toString(); } } }; _self[_DYN_ADD_HOUSEKEEPING_BEF20 ] = function (appInsightsInstance) { if (hasWindow() || hasDocument()) { var performHousekeeping = function () { appInsightsInstance[_DYN_ONUNLOAD_FLUSH ](false); if (isFunction(_this.core[STR_GET_PLUGIN ])) { var loadedPlugin = _this.core[STR_GET_PLUGIN ](PropertiesPluginIdentifier); if (loadedPlugin) { var propertiesPlugin = loadedPlugin.plugin; if (propertiesPlugin && propertiesPlugin[_DYN_CONTEXT ] && propertiesPlugin[_DYN_CONTEXT ]._sessionManager) { propertiesPlugin[_DYN_CONTEXT ]._sessionManager.backup(); } } } }; var added = false; var excludePageUnloadEvents = appInsightsInstance.appInsights[_DYN_CONFIG$1 ].disablePageUnloadEvents; if (!_houseKeepingNamespace) { _houseKeepingNamespace = mergeEvtNamespace(_evtNamespace, _core[STR_EVT_NAMESPACE ] && _core[STR_EVT_NAMESPACE ]()); } if (!appInsightsInstance.appInsights.config[_DYN_DISABLE_FLUSH_ON_BEF11 ]) { if (addPageUnloadEventListener(performHousekeeping, excludePageUnloadEvents, _houseKeepingNamespace)) { added = true; } if (addPageHideEventListener(performHousekeeping, excludePageUnloadEvents, _houseKeepingNamespace)) { added = true; } if (!added && !isReactNative()) { _throwInternal(appInsightsInstance[_DYN_APP_INSIGHTS ].core.logger, 1 , 19 , "Could not add handler for beforeunload and pagehide"); } } if (!added && !appInsightsInstance.appInsights.config[_DYN_DISABLE_FLUSH_ON_UNL12 ]) { addPageHideEventListener(performHousekeeping, excludePageUnloadEvents, _houseKeepingNamespace); } } }; _self.getSender = function () { return _sender; }; _self.unload = function (isAsync, unloadComplete, cbTimeout) { _self[_DYN_ONUNLOAD_FLUSH ](isAsync); if (_houseKeepingNamespace) { removePageUnloadEventListener(null, _houseKeepingNamespace); removePageHideEventListener(null, _houseKeepingNamespace); } _core.unload && _core.unload(isAsync, unloadComplete, cbTimeout); }; proxyFunctions(_self, _self[_DYN_APP_INSIGHTS ], [ STR_GET_COOKIE_MGR, STR_TRACK_EVENT, STR_TRACK_PAGE_VIEW, "trackPageViewPerformance", STR_TRACK_EXCEPTION, "_onerror", STR_TRACK_TRACE, STR_TRACK_METRIC, STR_START_TRACK_PAGE, STR_STOP_TRACK_PAGE, STR_START_TRACK_EVENT, STR_STOP_TRACK_EVENT ]); proxyFunctions(_self, _getCurrentDependencies, [ STR_TRACK_DEPENDENCY_DATA, "addDependencyListener", "addDependencyInitializer" ]); proxyFunctions(_self, _core, [ STR_ADD_TELEMETRY_INITIALIZER, STR_POLL_INTERNAL_LOGS, "stopPollingInternalLogs", STR_GET_PLUGIN, "addPlugin", STR_EVT_NAMESPACE, "addUnloadCb", "getTraceCtx" ]); proxyFunctions(_self, function () { var context = properties[_DYN_CONTEXT ]; return context ? context.user : null; }, [ STR_SET_AUTHENTICATED_USER_CONTEXT, STR_CLEAR_AUTHENTICATED_USER_CONTEXT ]); function _getSKUDefaults() { _self.config[_DYN_DIAGNOSTIC_LOG_INTER4 ] = _self.config[_DYN_DIAGNOSTIC_LOG_INTER4 ] && _self[_DYN_CONFIG$1 ][_DYN_DIAGNOSTIC_LOG_INTER4 ] > 0 ? _self[_DYN_CONFIG$1 ][_DYN_DIAGNOSTIC_LOG_INTER4 ] : 10000; } function _getCurrentDependencies() { return dependencies; } function _initDefaults() { _evtNamespace = createUniqueNamespace("AISKU"); _houseKeepingNamespace = null; dependencies = null; properties = null; _sender = null; _snippetVersion = null; } }); } Initialization.prototype.addDependencyInitializer = function (dependencyInitializer) { return null; }; return Initialization; }()); (function () { var sdkSrc = null; var cdns = [ "://js.monitor.azure.com/", "://az416426.vo.msecnd.net/" ]; try { var scrpt = (document || {}).currentScript; if (scrpt) { sdkSrc = scrpt.src; } } catch (e) { } if (sdkSrc) { try { var url = sdkSrc.toLowerCase(); if (url) { var src = ""; for (var idx = 0; idx < cdns.length; idx++) { if (url[_DYN_INDEX_OF ](cdns[idx]) !== -1) { src = "cdn" + (idx + 1); if (url[_DYN_INDEX_OF ]("/scripts/") === -1) { if (url[_DYN_INDEX_OF ]("/next/") !== -1) { src += "-next"; } else if (url[_DYN_INDEX_OF ]("/beta/") !== -1) { src += "-beta"; } } _internalSdkSrc = src + (""); break; } } } } catch (e) { } } })(); var ApplicationInsightsContainer = /** @class */ (function () { function ApplicationInsightsContainer() { } ApplicationInsightsContainer.getAppInsights = function (snippet, version) { var initialization = new Initialization(snippet); var legacyMode = version >= 2 ? false : true; _legacyCookieMgr(); if (!legacyMode) { initialization[_DYN_UPDATE_SNIPPET_DEFIN0 ](snippet); initialization[_DYN_LOAD_APP_INSIGHTS ](legacyMode); return initialization; } else { var legacy = new AppInsightsDeprecated(snippet, initialization); legacy[_DYN_UPDATE_SNIPPET_DEFIN0 ](snippet); initialization[_DYN_LOAD_APP_INSIGHTS ](legacyMode); return legacy; } }; return ApplicationInsightsContainer; }()); function _logWarn(aiName, message) { var _console = typeof console !== strShimUndefined ? console : null; if (_console && _console.warn) { _console.warn("Failed to initialize AppInsights JS SDK for instance " + (aiName || "") + " - " + message); } } try { var aiName; if (typeof window !== strShimUndefined) { var _window = window; aiName = _window["appInsightsSDK"] || "appInsights"; if (typeof JSON !== strShimUndefined) { if (_window[aiName] !== undefined) { var snippet = _window[aiName] || { version: 2.0 }; if ((snippet[_DYN_VERSION ] >= 2 && _window[aiName].initialize) || snippet[_DYN_VERSION ] === undefined) { ApplicationInsightsContainer.getAppInsights(snippet, snippet[_DYN_VERSION ]); } } } else { _logWarn(aiName, "Missing JSON - you must supply a JSON polyfill!"); } } else { _logWarn(aiName, "Missing window"); } } catch (e) { _logWarn(aiName, e.message); } exports.AnalyticsPluginIdentifier = AnalyticsPluginIdentifier; exports.ApplicationInsights = Initialization; exports.BreezeChannelIdentifier = BreezeChannelIdentifier; exports.CoreUtils = CoreUtils; exports.DEFAULT_BREEZE_ENDPOINT = DEFAULT_BREEZE_ENDPOINT; exports.DisabledPropertyName = DisabledPropertyName; exports.DistributedTracingModes = DistributedTracingModes; exports.LoggingSeverity = LoggingSeverity; exports.PerfEvent = PerfEvent; exports.PerfManager = PerfManager; exports.PropertiesPluginIdentifier = PropertiesPluginIdentifier; exports.RequestHeaders = RequestHeaders; exports.SeverityLevel = SeverityLevel; exports.Telemetry = Telemetry; exports.Util = Util; exports.addEventHandler = addEventHandler; exports.doPerf = doPerf; exports.eventOff = eventOff; exports.eventOn = eventOn; exports.findMetaTag = findMetaTag; exports.findW3cTraceParent = findW3cTraceParent; exports.generateW3CId = generateW3CId; exports.isBeaconsSupported = isBeaconsSupported; exports.mergeEvtNamespace = mergeEvtNamespace; exports.newGuid = newGuid; exports.newId = newId; exports.random32 = random32; exports.randomValue = randomValue; exports.removeEventHandler = removeEventHandler; })); //# sourceMappingURL=ai.2.8.14.js.map ================================================ FILE: AISKU/Tests/Manual/ai3.test.js ================================================ /*! * Application Insights JavaScript SDK - Web, 3.0.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ (function (global, factory) { var undef = "undefined"; typeof exports === "object" && typeof module !== undef ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (function(global){ var nsKey, key, nm, theExports = {}, modName = "es5_ai_3_0_6", msMod="__ms$mod__"; var mods={}, modDetail=mods[modName]={}, ver="3.0.6"; var baseNs=global, nsKey="Microsoft", baseNs=baseNs[nsKey]=(baseNs[nsKey]||{}); // Versioned namespace "Microsoft.ApplicationInsights3" var exportNs=baseNs, nsKey="ApplicationInsights3", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{}); // Global namespace "Microsoft.ApplicationInsights" var destNs=baseNs, nsKey="ApplicationInsights", destNs=destNs[nsKey]=(destNs[nsKey]||{}); var expNsDetail=(exportNs[msMod]=(exportNs[msMod] || {})), expNameVer=(expNsDetail["v"]=(expNsDetail["v"] || [])); var destNsDetail=(destNs[msMod]=(destNs[msMod] || {})), destNameVer=(destNsDetail["v"]=(destNsDetail["v"] || [])); (destNsDetail["o"]=(destNsDetail["o"] || [])).push(mods); factory(theExports); for(var key in theExports) { // Always set the imported value into the "export" versioned namespace (last-write wins) nm="x", exportNs[key]=theExports[key], expNameVer[key]=ver; // Copy over any named element that is not already present (first-write wins) typeof destNs[key]===undef ? (nm="n", destNs[key]=theExports[key]) && (destNameVer[key]=ver) : !destNameVer[key] && (destNameVer[key]="---"); (modDetail[nm] = (modDetail[nm] || [])).push(key); } })(typeof globalThis !== undef ? globalThis : global || self); })(this, (function (exports) { 'use strict'; var UNDEF_VALUE = undefined; var NULL_VALUE = null; var EMPTY = ""; var BOOLEAN = "boolean"; var FUNCTION = "function"; var NUMBER = "number"; var OBJECT = "object"; var PROTOTYPE = "prototype"; var __PROTO__ = "__proto__"; var STRING = "string"; var UNDEFINED = "undefined"; var CONSTRUCTOR = "constructor"; var SYMBOL = "Symbol"; var POLYFILL_TAG = "_polyfill"; var INDEX_OF = "indexOf"; var LAST_INDEX_OF = "lastIndexOf"; var LENGTH = "length"; var DONE = "done"; var VALUE = "value"; var NAME = "name"; var SLICE = "slice"; var CALL = "call"; var ObjClass$1 = Object; var ObjProto$1 = ObjClass$1[PROTOTYPE]; var StrCls = String; var StrProto = StrCls[PROTOTYPE]; var MathCls = Math; var ArrCls = Array; var ArrProto = ArrCls[PROTOTYPE]; function safeGet(cb, defValue) { var result = defValue; try { result = cb(); } catch (e) { } return result; } var PRIMITIVE_TYPES = [STRING, NUMBER, BOOLEAN, UNDEFINED, "symbol", "bigint"]; function _createIs(theType) { return function (value) { return typeof value === theType; }; } function _createObjIs(theName) { var theType = "[object " + theName + "]"; return function (value) { return !!(value && objToString(value) === theType); }; } function objToString(value) { return ObjProto$1.toString[CALL](value); } function isUndefined(value) { return typeof value === UNDEFINED || value === UNDEFINED; } function isNullOrUndefined(value) { return value === NULL_VALUE || isUndefined(value); } function isStrictNullOrUndefined(value) { return value === NULL_VALUE || !isDefined(value); } function isDefined(arg) { return !!arg || arg !== UNDEF_VALUE; } function isPrimitiveType(theType) { return theType !== OBJECT && PRIMITIVE_TYPES.indexOf(theType) !== -1; } var isString = ( _createIs(STRING)); var isFunction = ( _createIs(FUNCTION)); function isObject(value) { if (!value && isNullOrUndefined(value)) { return false; } return !!value && typeof value === OBJECT; } var isArray = ArrCls.isArray; var isDate = ( _createObjIs("Date")); var isNumber = ( _createIs(NUMBER)); var isBoolean = ( _createIs(BOOLEAN)); var isError = ( _createObjIs("Error")); function isPromiseLike(value) { return !!(value && value.then && isFunction(value.then)); } function isTruthy(value) { return !(!value || safeGet(function () { return !(value && (0 + value)); }, !value)); } var objGetOwnPropertyDescriptor = ObjClass$1.getOwnPropertyDescriptor; function objHasOwnProperty(obj, prop) { return obj && ObjProto$1.hasOwnProperty[CALL](obj, prop); } var objHasOwn = ObjClass$1["hasOwn"] || polyObjHasOwn; function polyObjHasOwn(obj, prop) { return objHasOwnProperty(obj, prop) || !!objGetOwnPropertyDescriptor(obj, prop); } function objForEachKey(theObject, callbackfn, thisArg) { if (theObject && isObject(theObject)) { for (var prop in theObject) { if (objHasOwn(theObject, prop)) { if (callbackfn[CALL](thisArg || theObject, prop, theObject[prop]) === -1) { break; } } } } } function _createKeyValueMap(values, keyType, valueType, completeFn) { var theMap = {}; objForEachKey(values, function (key, value) { theMap[key] = keyType ? value : key; theMap[value] = valueType ? value : key; }); return completeFn(theMap); } function throwError(message) { throw new Error(message); } function throwTypeError(message) { throw new TypeError(message); } var _objFreeze = ObjClass$1["freeze"]; function _doNothing(value) { return value; } function _getProto(value) { return value[__PROTO__] || NULL_VALUE; } var objAssign = ObjClass$1["assign"]; function objKeys(value) { if (!isObject(value) || value === NULL_VALUE) { throwTypeError("objKeys called on non-object"); } return ObjClass$1.keys(value); } function objDeepFreeze(value) { if (_objFreeze) { objForEachKey(value, function (key, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(value); } var objFreeze = _objFreeze || _doNothing; var objGetPrototypeOf = ObjClass$1["getPrototypeOf"] || _getProto; function createEnum(values) { return _createKeyValueMap(values, 1 , 0 , objDeepFreeze); } function createEnumKeyMap(values) { return _createKeyValueMap(values, 0 , 0 , objDeepFreeze); } function createSimpleMap(values) { var mapClass = {}; objForEachKey(values, function (key, value) { mapClass[key] = value[1]; mapClass[value[0]] = value[1]; }); return objDeepFreeze(mapClass); } function createTypeMap(values) { return createSimpleMap(values); } var _wellKnownSymbolMap = createEnumKeyMap({ asyncIterator: 0 , hasInstance: 1 , isConcatSpreadable: 2 , iterator: 3 , match: 4 , matchAll: 5 , replace: 6 , search: 7 , species: 8 , split: 9 , toPrimitive: 10 , toStringTag: 11 , unscopables: 12 }); var asString = StrCls; var GLOBAL_CONFIG_KEY = "__tsUtils$gblCfg"; var _globalCfg; function _getGlobalValue() { var result; if (typeof globalThis !== UNDEFINED) { result = globalThis; } if (!result && typeof self !== UNDEFINED) { result = self; } if (!result && typeof window !== UNDEFINED) { result = window; } if (!result && typeof global !== UNDEFINED) { result = global; } return result; } function _getGlobalConfig() { if (!_globalCfg) { var gbl = _getGlobalValue() || {}; _globalCfg = gbl[GLOBAL_CONFIG_KEY] = gbl[GLOBAL_CONFIG_KEY] || {}; } return _globalCfg; } function dumpObj(object, format) { var propertyValueDump = EMPTY; if (isError(object)) { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } else { try { propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? (isNumber(format) ? format : 4) : UNDEF_VALUE); } catch (e) { propertyValueDump = " - " + dumpObj(e, format); } } return objToString(object) + ": " + propertyValueDump; } var _slice; function _throwMissingFunction(funcName, thisArg) { throwTypeError("'" + asString(funcName) + "' not defined for " + dumpObj(thisArg)); } function _unwrapInstFunction(funcName) { _slice = _slice || ArrProto[SLICE]; return function (thisArg) { return thisArg[funcName].apply(thisArg, _slice[CALL](arguments, 1)); }; } function _unwrapFunction(funcName, clsProto) { _slice = _slice || ArrProto[SLICE]; var clsFn = clsProto && clsProto[funcName]; return function (thisArg) { var theFunc = (thisArg && thisArg[funcName]) || clsFn; if (theFunc) { return theFunc.apply(thisArg, _slice[CALL](arguments, 1)); } _throwMissingFunction(funcName, thisArg); }; } function _unwrapFunctionWithPoly(funcName, clsProto, polyFunc) { _slice = _slice || ArrProto[SLICE]; var clsFn = clsProto && clsProto[funcName]; return function (thisArg) { var theFunc = (thisArg && thisArg[funcName]) || clsFn; if (theFunc || polyFunc) { var theArgs = arguments; return (theFunc || polyFunc).apply(thisArg, theFunc ? _slice[CALL](theArgs, 1) : theArgs); } _throwMissingFunction(funcName, thisArg); }; } function _unwrapProp(propName) { return function (thisArg) { return thisArg[propName]; }; } var mathMax = MathCls.max; var strSlice = ( _unwrapFunction(SLICE, StrProto)); var strSubstring = ( _unwrapFunction("substring", StrProto)); var strSubstr = ( _unwrapFunctionWithPoly("substr", StrProto, polyStrSubstr)); function polyStrSubstr(value, start, length) { if (isNullOrUndefined(value)) { throwTypeError("'polyStrSubstr called with invalid " + dumpObj(value)); } if (length < 0) { return EMPTY; } start = start || 0; if (start < 0) { start = mathMax(start + value[LENGTH], 0); } if (isUndefined(length)) { return strSlice(value, start); } return strSlice(value, start, start + length); } function strLeft(value, count) { return strSubstring(value, 0, count); } var UNIQUE_REGISTRY_ID = "_urid"; var _polySymbols; function _globalSymbolRegistry() { if (!_polySymbols) { var gblCfg = _getGlobalConfig(); _polySymbols = gblCfg.gblSym = gblCfg.gblSym || { k: {}, s: {} }; } return _polySymbols; } var _wellKnownSymbolCache = {}; function polyNewSymbol(description) { var theSymbol = { description: asString(description), toString: function () { return SYMBOL + "(" + description + ")"; } }; theSymbol[POLYFILL_TAG] = true; return theSymbol; } function polySymbolFor(key) { var registry = _globalSymbolRegistry(); if (!objHasOwn(registry.k, key)) { var newSymbol_1 = polyNewSymbol(key); var regId_1 = objKeys(registry.s).length; newSymbol_1[UNIQUE_REGISTRY_ID] = function () { return regId_1 + "_" + newSymbol_1.toString(); }; registry.k[key] = newSymbol_1; registry.s[newSymbol_1[UNIQUE_REGISTRY_ID]()] = asString(key); } return registry.k[key]; } function polyGetKnownSymbol(name) { var result; var knownName = _wellKnownSymbolMap[name]; if (knownName) { result = _wellKnownSymbolCache[knownName] = _wellKnownSymbolCache[knownName] || polyNewSymbol(SYMBOL + "." + knownName); } return result; } var propMap = { e: "enumerable", c: "configurable", v: VALUE, w: "writable", g: "get", s: "set" }; function _createProp(value) { var prop = {}; prop[propMap["c"]] = true; prop[propMap["e"]] = true; if (value.l) { prop.get = function () { return value.l.v; }; var desc = objGetOwnPropertyDescriptor(value.l, "v"); if (desc && desc.set) { prop.set = function (newValue) { value.l.v = newValue; }; } } objForEachKey(value, function (key, value) { prop[propMap[key]] = isUndefined(value) ? prop[propMap[key]] : value; }); return prop; } var objDefineProp = ObjClass$1["defineProperty"]; function objDefine(target, key, propDesc) { return objDefineProp(target, key, _createProp(propDesc)); } var _globalLazyTestHooks; var _fetchLazyTestHooks = function () { _globalLazyTestHooks = _getGlobalConfig(); _fetchLazyTestHooks = NULL_VALUE; }; function getLazy(cb) { var lazyValue = {}; _fetchLazyTestHooks && _fetchLazyTestHooks(); lazyValue.b = _globalLazyTestHooks.lzy; objDefineProp(lazyValue, "v", { configurable: true, get: function () { var result = cb(); if (!_globalLazyTestHooks.lzy) { objDefineProp(lazyValue, "v", { value: result }); if (lazyValue.b) { delete lazyValue.b; } } if (_globalLazyTestHooks.lzy && lazyValue.b !== _globalLazyTestHooks.lzy) { lazyValue.b = _globalLazyTestHooks.lzy; } return result; } }); return lazyValue; } function safeGetLazy(cb, defValue) { return getLazy(function () { return safeGet(cb, defValue); }); } var WINDOW = "window"; var _cachedGlobal; var _cachedWindow; var _cachedDocument; var _cachedNavigator; var _cachedHistory; var _isWebWorker; var _isNode; function lazySafeGetInst(name) { return safeGetLazy(function () { return getInst(name) || UNDEF_VALUE; }, UNDEF_VALUE); } function getGlobal(useCached) { (!_cachedGlobal || useCached === false || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = safeGetLazy(_getGlobalValue, NULL_VALUE)); return _cachedGlobal.v; } function getInst(name, useCached) { var gbl = (!_cachedGlobal || useCached === false) ? getGlobal(useCached) : _cachedGlobal.v; if (gbl && gbl[name]) { return gbl[name]; } if (name === WINDOW && _cachedWindow) { return _cachedWindow.v; } return NULL_VALUE; } function hasDocument() { return !!getDocument(); } function getDocument() { (!_cachedDocument || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = lazySafeGetInst("document")); return _cachedDocument.v; } function hasWindow() { return !!getWindow(); } function getWindow() { (!_cachedWindow || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = lazySafeGetInst(WINDOW)); return _cachedWindow.v; } function hasNavigator() { return !!getNavigator(); } function getNavigator() { (!_cachedNavigator || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = lazySafeGetInst("navigator")); return _cachedNavigator.v; } function hasHistory() { return !!getHistory(); } function getHistory() { (!_cachedHistory || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedHistory.b)) && (_cachedHistory = lazySafeGetInst("history")); return _cachedHistory.v; } function isNode() { !_isNode && (_isNode = safeGetLazy(function () { return !!(process && (process.versions || {}).node); }, false)); return _isNode.v; } function isWebWorker() { !_isWebWorker && (_isWebWorker = safeGetLazy(function () { return !!(self && self instanceof WorkerGlobalScope); }, false)); return _isWebWorker.v; } var _symbol; var _symbolFor; var _symbolKeyFor; function _getSymbolValue(name) { return safeGetLazy(function () { return (_symbol.v ? _symbol.v[name] : UNDEF_VALUE); }, UNDEF_VALUE); } function hasSymbol() { return !!getSymbol(); } function getSymbol() { var resetCache = !_symbol || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_symbol.b); resetCache && (_symbol = lazySafeGetInst(SYMBOL)); (!_symbolFor || resetCache) && (_symbolFor = _getSymbolValue("for")); (!_symbolKeyFor || resetCache) && (_symbolKeyFor = _getSymbolValue("keyFor")); return _symbol.v; } function getKnownSymbol(name, noPoly) { var knownName = _wellKnownSymbolMap[name]; (!_symbol || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol(); return _symbol.v ? _symbol.v[knownName || name] : (!noPoly ? polyGetKnownSymbol(name) : UNDEF_VALUE); } function newSymbol(description, noPoly) { (!_symbol || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol(); return _symbol.v ? _symbol.v(description) : (!noPoly ? polyNewSymbol(description) : NULL_VALUE); } function symbolFor(key) { (!_symbolFor || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol(); return (_symbolFor.v || polySymbolFor)(key); } function isIterator(value) { return !!value && isFunction(value.next); } function isIterable(value) { return !isStrictNullOrUndefined(value) && isFunction(value[getKnownSymbol(3 )]); } var _iterSymbol; function iterForOf(iter, callbackfn, thisArg) { if (iter) { if (!isIterator(iter)) { !_iterSymbol && (_iterSymbol = getLazy(function () { return getKnownSymbol(3 ); })); iter = iter[_iterSymbol.v] ? iter[_iterSymbol.v]() : null; } if (isIterator(iter)) { var err = void 0; var iterResult = void 0; try { var count = 0; while (!(iterResult = iter.next())[DONE]) { if (callbackfn[CALL](thisArg || iter, iterResult[VALUE], count, iter) === -1) { break; } count++; } } catch (failed) { err = { e: failed }; if (iter.throw) { iterResult = null; iter.throw(err); } } finally { try { if (iterResult && !iterResult[DONE]) { iter.return && iter.return(iterResult); } } finally { if (err) { throw err.e; } } } } } } var fnApply = ( _unwrapInstFunction("apply")); function arrAppend(target, elms) { if (!isUndefined(elms) && target) { if (isArray(elms)) { fnApply(target.push, target, elms); } else if (isIterator(elms) || isIterable(elms)) { iterForOf(elms, function (elm) { target.push(elm); }); } else { target.push(elms); } } return target; } function arrForEach(theArray, callbackfn, thisArg) { if (theArray) { var len = theArray[LENGTH] >>> 0; for (var idx = 0; idx < len; idx++) { if (idx in theArray) { if (callbackfn[CALL](thisArg || theArray, theArray[idx], idx, theArray) === -1) { break; } } } } } var arrIndexOf = ( _unwrapFunction(INDEX_OF, ArrProto)); ( _unwrapFunction(LAST_INDEX_OF, ArrProto)); var arrMap = ( _unwrapFunction("map", ArrProto)); var arrSlice = ( _unwrapFunction(SLICE, ArrProto)); var arrReduce = ( _unwrapFunction("reduce", ArrProto)); var objCreate = ObjClass$1["create"] || polyObjCreate; function polyObjCreate(obj) { if (!obj) { return {}; } var type = typeof obj; if (type !== OBJECT && type !== FUNCTION) { throw new TypeError("Prototype must be an Object or function: " + dumpObj(obj)); } function tempFunc() { } tempFunc[PROTOTYPE] = obj; return new tempFunc(); } var _isProtoArray; function objSetPrototypeOf(obj, proto) { var fn = ObjClass$1["setPrototypeOf"] || function (d, b) { !_isProtoArray && (_isProtoArray = getLazy(function () { var _a; return ((_a = {}, _a[__PROTO__] = [], _a) instanceof Array); })); _isProtoArray.v ? d[__PROTO__] = b : objForEachKey(b, function (key, value) { return d[key] = value; }); }; return fn(obj, proto); } function _createCustomError(name, d, b) { _safeDefineName(d, name); d = objSetPrototypeOf(d, b); function __() { this.constructor = d; _safeDefineName(this, name); } d[PROTOTYPE] = b === NULL_VALUE ? objCreate(b) : (__[PROTOTYPE] = b[PROTOTYPE], new __()); return d; } var _safeSetName = function (baseClass, name) { try { name && (baseClass[NAME] = name); } catch (e) { } }; var _safeDefineName = function (target, name) { try { objDefine(target, NAME, { v: name, c: true, e: false }); } catch (e) { } }; function createCustomError(name, constructCb, errorBase) { var theBaseClass = errorBase || Error; var orgName = theBaseClass[PROTOTYPE][NAME]; var captureFn = Error.captureStackTrace; return _createCustomError(name, function () { var _this = this; try { _safeSetName(theBaseClass, name); var _self = fnApply(theBaseClass, _this, arrSlice(arguments)) || _this; if (_self !== _this) { var orgProto = objGetPrototypeOf(_this); if (orgProto !== objGetPrototypeOf(_self)) { objSetPrototypeOf(_self, orgProto); } } captureFn && captureFn(_self, _this[CONSTRUCTOR]); constructCb && constructCb(_self, arguments); return _self; } finally { _safeSetName(theBaseClass, orgName); } }, theBaseClass); } var _unsupportedError; function throwUnsupported(message) { if (!_unsupportedError) { _unsupportedError = createCustomError("UnsupportedError"); } throw new _unsupportedError(message); } function utcNow() { return (Date.now || polyUtcNow)(); } function polyUtcNow() { return new Date().getTime(); } function _createTrimFn(exp) { return function _doTrim(value) { if (isNullOrUndefined(value)) { throwTypeError("strTrim called [" + dumpObj(value) + "]"); } if (value && value.replace) { value = value.replace(exp, EMPTY); } return value; }; } var polyStrTrim = ( _createTrimFn(/^\s+|(?=\s)\s+$/g)); var polyStrTrimStart = ( _createTrimFn(/^\s+/g)); var polyStrTrimEnd = ( _createTrimFn(/(?=\s)\s+$/g)); var strTrim = ( _unwrapFunctionWithPoly("trim", StrProto, polyStrTrim)); ( _unwrapFunctionWithPoly("trimStart", StrProto, polyStrTrimStart)); ( _unwrapFunctionWithPoly("trimEnd", StrProto, polyStrTrimEnd)); var _fnToString; var _objCtrFnString; var _gblWindow; function isPlainObject(value) { if (!value || typeof value !== OBJECT) { return false; } if (!_gblWindow) { _gblWindow = hasWindow() ? getWindow() : true; } var result = false; if (value !== _gblWindow) { if (!_objCtrFnString) { _fnToString = Function[PROTOTYPE].toString; _objCtrFnString = _fnToString[CALL](ObjClass$1); } try { var proto = objGetPrototypeOf(value); result = !proto; if (!result) { if (objHasOwnProperty(proto, CONSTRUCTOR)) { proto = proto[CONSTRUCTOR]; } result = proto && typeof proto === FUNCTION && _fnToString[CALL](proto) === _objCtrFnString; } } catch (ex) { } } return result; } var _defaultDeepCopyHandler = function (details) { details.value && plainObjDeepCopyHandler(details); return true; }; var defaultDeepCopyHandlers = [ arrayDeepCopyHandler, plainObjDeepCopyHandler, functionDeepCopyHandler, dateDeepCopyHandler ]; function _getSetVisited(visitMap, source, newPath, cb) { var theEntry; arrForEach(visitMap, function (entry) { if (entry.k === source) { theEntry = entry; return -1; } }); if (!theEntry) { theEntry = { k: source, v: source }; visitMap.push(theEntry); cb(theEntry); } return theEntry.v; } function _deepCopy(visitMap, value, ctx, key) { var userHandler = ctx.handler; var newPath = ctx.path ? (key ? ctx.path.concat(key) : ctx.path) : []; var newCtx = { handler: ctx.handler, src: ctx.src, path: newPath }; var theType = typeof value; var isPlain = false; var isPrim = false; if (value && theType === OBJECT) { isPlain = isPlainObject(value); } else { isPrim = value === NULL_VALUE || isPrimitiveType(theType); } var details = { type: theType, isPrim: isPrim, isPlain: isPlain, value: value, result: value, path: newPath, origin: ctx.src, copy: function (source, newKey) { return _deepCopy(visitMap, source, newKey ? newCtx : ctx, newKey); }, copyTo: function (target, source) { return _copyProps(visitMap, target, source, newCtx); } }; if (!details.isPrim) { return _getSetVisited(visitMap, value, newPath, function (newEntry) { objDefine(details, "result", { g: function () { return newEntry.v; }, s: function (newValue) { newEntry.v = newValue; } }); var idx = 0; var handler = userHandler; while (!(handler || (idx < defaultDeepCopyHandlers.length ? defaultDeepCopyHandlers[idx++] : _defaultDeepCopyHandler))[CALL](ctx, details)) { handler = NULL_VALUE; } }); } if (userHandler && userHandler[CALL](ctx, details)) { return details.result; } return value; } function _copyProps(visitMap, target, source, ctx) { if (!isNullOrUndefined(source)) { for (var key in source) { target[key] = _deepCopy(visitMap, source[key], ctx, key); } } return target; } function objCopyProps(target, source, handler) { var ctx = { handler: handler, src: source, path: [] }; return _copyProps([], target, source, ctx); } function objDeepCopy(source, handler) { var ctx = { handler: handler, src: source }; return _deepCopy([], source, ctx); } function arrayDeepCopyHandler(details) { var value = details.value; if (isArray(value)) { var target = details.result = []; target.length = value.length; details.copyTo(target, value); return true; } return false; } function dateDeepCopyHandler(details) { var value = details.value; if (isDate(value)) { details.result = new Date(value.getTime()); return true; } return false; } function functionDeepCopyHandler(details) { if (details.type === FUNCTION) { return true; } return false; } function plainObjDeepCopyHandler(details) { var value = details.value; if (value && details.isPlain) { var target = details.result = {}; details.copyTo(target, value); return true; } return false; } function _doExtend(target, theArgs) { arrForEach(theArgs, function (theArg) { objCopyProps(target, theArg); }); return target; } function deepExtend(target, obj1, obj2, obj3, obj4, obj5, obj6) { return _doExtend(objDeepCopy(target) || {}, arrSlice(arguments)); } function objExtend$1(target, obj1, obj2, obj3, obj4, obj5, obj6) { return _doExtend(target || {}, arrSlice(arguments)); } var getLength = ( _unwrapProp(LENGTH)); var _perf; function getPerformance() { (!_perf || (!_perf.b && _globalLazyTestHooks && _globalLazyTestHooks.lzy)) && (_perf = lazySafeGetInst("performance")); return _perf.v; } function polyStrSymSplit(value, splitter, limit) { var splitFn = splitter && splitter[getKnownSymbol(9 )]; return splitFn ? splitFn(value, limit) : [value]; } var strSplit = ( _unwrapFunction("split", StrProto)); ( _unwrapFunctionWithPoly("split", StrProto, !hasSymbol() ? polyStrSymSplit : null)); function setValueByKey(target, path, value) { if (target && path) { var parts = strSplit(path, "."); var lastKey = parts.pop(); arrForEach(parts, function (key) { if (isNullOrUndefined(target[key])) { target[key] = {}; } target = target[key]; }); target[lastKey] = value; } } var strEndsWith = ( _unwrapFunctionWithPoly("endsWith", StrProto, polyStrEndsWith)); function polyStrEndsWith(value, searchString, length) { if (!isString(value)) { throwTypeError("'" + dumpObj(value) + "' is not a string"); } var searchValue = isString(searchString) ? searchString : asString(searchString); var chkLen = searchValue[LENGTH]; var len = value[LENGTH]; var end = !isUndefined(length) && length < len ? length : len; return strSubstring(value, end - chkLen, end) === searchValue; } var strIndexOf = ( _unwrapFunction(INDEX_OF, StrProto)); ( _unwrapFunction(LAST_INDEX_OF, StrProto)); var REF = "ref"; var UNREF = "un" + REF; var HAS_REF = "hasRef"; var ENABLED = "enabled"; function _createTimerHandler(startTimer, refreshFn, cancelFn) { var _a; var ref = true; var timerId = startTimer ? refreshFn(NULL_VALUE) : NULL_VALUE; var theTimerHandler; var _unref = function () { ref = false; timerId && timerId[UNREF] && timerId[UNREF](); return theTimerHandler; }; var _ref = function () { ref = true; timerId && timerId[REF] && timerId[REF](); return theTimerHandler; }; var _hasRef = function () { if (timerId && timerId[HAS_REF]) { return timerId[HAS_REF](); } return ref; }; var _refresh = function () { timerId = refreshFn(timerId); if (!ref) { _unref(); } return theTimerHandler; }; var _cancel = function () { timerId && cancelFn(timerId); timerId = NULL_VALUE; }; var _setEnabled = function (value) { !value && timerId && _cancel(); value && !timerId && _refresh(); }; theTimerHandler = (_a = { cancel: _cancel, refresh: _refresh }, _a[HAS_REF] = _hasRef, _a[REF] = _ref, _a[UNREF] = _unref, _a[ENABLED] = false, _a); objDefineProp(theTimerHandler, ENABLED, { get: function () { return !!timerId; }, set: _setEnabled }); return { h: theTimerHandler, dn: function () { timerId = NULL_VALUE; } }; } function _createTimeoutWith(self, startTimer, overrideFn, theArgs) { var isArr = isArray(overrideFn); var len = isArr ? overrideFn.length : 0; var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout; var clearFn = (len > 1 ? overrideFn[1] : UNDEF_VALUE) || clearTimeout; var timerFn = theArgs[0]; theArgs[0] = function () { handler.dn(); fnApply(timerFn, self, arrSlice(arguments)); }; var handler = _createTimerHandler(startTimer, function (timerId) { if (timerId) { if (timerId.refresh) { timerId.refresh(); return timerId; } fnApply(clearFn, self, [timerId]); } return fnApply(setFn, self, theArgs); }, function (timerId) { fnApply(clearFn, self, [timerId]); }); return handler.h; } function scheduleTimeout(callback, timeout) { return _createTimeoutWith(this, true, UNDEF_VALUE, arrSlice(arguments)); } function createTimeout(callback, timeout) { return _createTimeoutWith(this, false, UNDEF_VALUE, arrSlice(arguments)); } var createEnumStyle = createEnum; var createValueMap = createTypeMap; var _DYN_TO_LOWER_CASE$2 = "toLowerCase"; var _DYN_BLK_VAL = "blkVal"; var _DYN_LENGTH$5 = "length"; var _DYN_RD_ONLY = "rdOnly"; var _DYN_NOTIFY = "notify"; var _DYN_WARN_TO_CONSOLE = "warnToConsole"; var _DYN_THROW_INTERNAL = "throwInternal"; var _DYN_SET_DF = "setDf"; var _DYN_WATCH = "watch"; var _DYN_LOGGER = "logger"; var _DYN_APPLY = "apply"; var _DYN_PUSH$2 = "push"; var _DYN_SPLICE = "splice"; var _DYN_HDLR = "hdlr"; var _DYN_CANCEL = "cancel"; var _DYN_INITIALIZE = "initialize"; var _DYN_IDENTIFIER = "identifier"; var _DYN_IS_INITIALIZED = "isInitialized"; var _DYN_GET_PLUGIN = "getPlugin"; var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs"; var _DYN_NAME$3 = "name"; var _DYN_TIME = "time"; var _DYN_PROCESS_NEXT = "processNext"; var _DYN_GET_PROCESS_TEL_CONT0 = "getProcessTelContext"; var _DYN_GET_NOTIFY_MGR = "getNotifyMgr"; var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener"; var _DYN_REMOVE_NOTIFICATION_2 = "removeNotificationListener"; var _DYN_ENABLED = "enabled"; var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs"; var _DYN_UNLOAD = "unload"; var _DYN_ON_COMPLETE = "onComplete"; var _DYN_VERSION$1 = "version"; var _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole"; var _DYN_CREATE_NEW$1 = "createNew"; var _DYN_TEARDOWN = "teardown"; var _DYN_MESSAGE_ID = "messageId"; var _DYN_MESSAGE$2 = "message"; var _DYN_IS_ASYNC = "isAsync"; var _DYN_DIAG_LOG$2 = "diagLog"; var _DYN__DO_TEARDOWN = "_doTeardown"; var _DYN_UPDATE$1 = "update"; var _DYN_GET_NEXT = "getNext"; var _DYN_SET_NEXT_PLUGIN = "setNextPlugin"; var _DYN_USER_AGENT = "userAgent"; var _DYN_SPLIT$1 = "split"; var _DYN_NODE_TYPE = "nodeType"; var _DYN_REPLACE = "replace"; var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage"; var _DYN_TYPE = "type"; var _DYN_HANDLER = "handler"; var _DYN_IS_CHILD_EVT = "isChildEvt"; var _DYN_GET_CTX = "getCtx"; var _DYN_SET_CTX = "setCtx"; var _DYN_COMPLETE = "complete"; var _DYN_TRACE_ID$2 = "traceId"; var _DYN_SPAN_ID$1 = "spanId"; var _DYN_TRACE_FLAGS$1 = "traceFlags"; var aggregationErrorType; function throwAggregationError(message, sourceErrors) { if (!aggregationErrorType) { aggregationErrorType = createCustomError("AggregationError", function (self, args) { if (args[_DYN_LENGTH$5 ] > 1) { self.errors = args[1]; } }); } var theMessage = message || "One or more errors occurred."; arrForEach(sourceErrors, function (srcError, idx) { theMessage += "\n".concat(idx, " > ").concat(dumpObj(srcError)); }); throw new aggregationErrorType(theMessage, sourceErrors || []); } var strShimFunction = "function"; var strShimObject = "object"; var strShimUndefined = "undefined"; var strShimPrototype = "prototype"; var ObjClass = Object; var ObjProto = ObjClass[strShimPrototype]; (getGlobal() || {})["Symbol"]; (getGlobal() || {})["Reflect"]; var strHasOwnProperty = "hasOwnProperty"; var __objAssignFnImpl = function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (ObjProto[strHasOwnProperty].call(s, p)) { t[p] = s[p]; } } } return t; }; var __assignFn = objAssign || __objAssignFnImpl; var extendStaticsFn = function (d, b) { extendStaticsFn = ObjClass["setPrototypeOf"] || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) { if (b[strHasOwnProperty](p)) { d[p] = b[p]; } } }; return extendStaticsFn(d, b); }; function __extendsFn(d, b) { if (typeof b !== strShimFunction && b !== null) { throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); } extendStaticsFn(d, b); function __() { this.constructor = d; } d[strShimPrototype] = b === null ? objCreate(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); } function __spreadArrayFn(to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { to[j] = from[i]; } return to; } var _a$a; var Constructor = 'constructor'; var Prototype = 'prototype'; var strFunction = 'function'; var DynInstFuncTable = '_dynInstFuncs'; var DynProxyTag = '_isDynProxy'; var DynClassName = '_dynClass'; var DynClassNamePrefix = '_dynCls$'; var DynInstChkTag = '_dynInstChk'; var DynAllowInstChkTag = DynInstChkTag; var DynProtoDefaultOptions = '_dfOpts'; var UnknownValue = '_unknown_'; var str__Proto = "__proto__"; var DynProtoBaseProto = "_dyn" + str__Proto; var DynProtoGlobalSettings = "__dynProto$Gbl"; var DynProtoCurrent = "_dynInstProto"; var strUseBaseInst = 'useBaseInst'; var strSetInstFuncs = 'setInstFuncs'; var Obj = Object; var _objGetPrototypeOf = Obj["getPrototypeOf"]; var _objGetOwnProps = Obj["getOwnPropertyNames"]; var _gbl = getGlobal(); var _gblInst = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = { o: (_a$a = {}, _a$a[strSetInstFuncs] = true, _a$a[strUseBaseInst] = true, _a$a), n: 1000 }); function _isObjectOrArrayPrototype(target) { return target && (target === Obj[Prototype] || target === Array[Prototype]); } function _isObjectArrayOrFunctionPrototype(target) { return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; } function _getObjProto$1(target) { var newProto; if (target) { if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); newProto = target[DynProtoBaseProto] || curProto; if (!objHasOwnProperty(target, DynProtoBaseProto)) { delete target[DynProtoCurrent]; newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; target[DynProtoCurrent] = curProto; } } return newProto; } function _forEachProp(target, func) { var props = []; if (_objGetOwnProps) { props = _objGetOwnProps(target); } else { for (var name_1 in target) { if (typeof name_1 === "string" && objHasOwnProperty(target, name_1)) { props.push(name_1); } } } if (props && props.length > 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || objHasOwnProperty(target, funcName))); } function _throwTypeError(message) { throwTypeError("DynamicProto: " + message); } function _getInstanceFuncs(thisTarget) { var instFuncs = {}; _forEachProp(thisTarget, function (name) { if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { instFuncs[name] = thisTarget[name]; } }); return instFuncs; } function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { return theFunc.apply(target, arguments); }; } var baseFuncs = {}; _forEachProp(instFuncs, function (name) { baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); var baseProto = _getObjProto$1(classProto); var visited = []; while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { _forEachProp(baseProto, function (name) { if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); visited.push(baseProto); baseProto = _getObjProto$1(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; if (target && objHasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { _throwTypeError("Missing [" + funcName + "] " + strFunction); } if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { var canAddInst = !objHasOwnProperty(target, funcName); var objProto = _getObjProto$1(target); var visited = []; while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } visited.push(objProto); objProto = _getObjProto$1(objProto); } try { if (canAddInst) { target[funcName] = instFunc; } instFunc[DynInstChkTag] = 1; } catch (e) { instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; if (protoFunc === currentDynProtoProxy) { protoFunc = _getObjProto$1(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); return instFunc.apply(this, arguments); }; dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { instFuncs_1[name] = target[name]; delete target[name]; if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } function _checkPrototype(classProto, thisTarget) { if (_objGetPrototypeOf) { var visited = []; var thisProto = _getObjProto$1(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } visited.push(thisProto); thisProto = _getObjProto$1(thisProto); } return false; } return true; } function _getObjName(target, unknownValue) { if (objHasOwnProperty(target, Prototype)) { return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } function dynamicProto(theClass, target, delegateFunc, options) { if (!objHasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] not in hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (objHasOwnProperty(classProto, DynClassName)) { className = classProto[DynClassName]; } else { className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _gblInst.n; _gblInst.n++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } var instFuncs = _getInstanceFuncs(target); var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); delegateFunc(target, baseFuncs); var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } dynamicProto[DynProtoDefaultOptions] = _gblInst.o; function doAwaitResponse(value, cb) { return doAwait(value, function (value) { return cb ? cb({ value: value, rejected: false }) : value; }, function (reason) { return cb ? cb({ rejected: true, reason: reason }) : reason; }); } function doAwait(value, resolveFn, rejectFn, finallyFn) { var result = value; if (isPromiseLike(value)) { if (resolveFn || rejectFn) { result = value.then(resolveFn, rejectFn); } } else { if (resolveFn) { result = resolveFn(value); } } if (finallyFn) { doFinally(result, finallyFn); } return result; } function doFinally(value, finallyFn) { var result = value; if (finallyFn) { if (isPromiseLike(value)) { if (value.finally) { result = value.finally(finallyFn); } else { result = value.then(function (value) { finallyFn(); return value; }, function (reason) { finallyFn(); throw reason; }); } } else { finallyFn(); } } return result; } var STRING_STATES = [ "pending", "resolving", "resolved", "rejected" ]; var DISPATCH_EVENT = "dispatchEvent"; var _hasInitEvent; function emitEvent(target, evtName, populateEvent, useNewEvent) { var doc = getDocument(); !_hasInitEvent && (_hasInitEvent = safeGetLazy(function () { var evt; if (doc && doc.createEvent) { evt = doc.createEvent("Event"); } return (!!evt && evt.initEvent); }, null)); var theEvt = _hasInitEvent.v ? doc.createEvent("Event") : (useNewEvent ? new Event(evtName) : {}); populateEvent && populateEvent(theEvt); if (_hasInitEvent.v) { theEvt.initEvent(evtName, false, true); } if (theEvt && target[DISPATCH_EVENT]) { target[DISPATCH_EVENT](theEvt); } else { var handler = target["on" + evtName]; if (handler) { handler(theEvt); } else { var theConsole = getInst("console"); theConsole && (theConsole["error"] || theConsole["log"])(evtName, dumpObj(theEvt)); } } } var STR_PROMISE = "Promise"; var NODE_UNHANDLED_REJECTION = "unhandledRejection"; var UNHANDLED_REJECTION = NODE_UNHANDLED_REJECTION.toLowerCase(); var _unhandledRejectionTimeout = 10; var _hasPromiseRejectionEvent; function dumpFnObj(value) { if (isFunction(value)) { return value.toString(); } return dumpObj(value); } function _createPromise(newPromise, processor, executor) { var additionalArgs = arrSlice(arguments, 3); var _state = 0 ; var _hasResolved = false; var _settledValue; var _queue = []; var _handled = false; var _unHandledRejectionHandler = null; var _thePromise; !_hasPromiseRejectionEvent && (_hasPromiseRejectionEvent = lazySafeGetInst(STR_PROMISE + "RejectionEvent")); var _then = function (onResolved, onRejected) { try { _handled = true; _unHandledRejectionHandler && _unHandledRejectionHandler.cancel(); _unHandledRejectionHandler = null; var thenPromise = newPromise(function (resolve, reject) { _queue.push(function () { try { var handler = _state === 2 ? onResolved : onRejected; var value = isUndefined(handler) ? _settledValue : (isFunction(handler) ? handler(_settledValue) : handler); if (isPromiseLike(value)) { value.then(resolve, reject); } else if (handler) { resolve(value); } else if (_state === 3 ) { reject(value); } else { resolve(value); } } catch (e) { reject(e); } }); if (_hasResolved) { _processQueue(); } }, additionalArgs); return thenPromise; } finally { } }; var _catch = function (onRejected) { return _then(undefined, onRejected); }; var _finally = function (onFinally) { var thenFinally = onFinally; var catchFinally = onFinally; if (isFunction(onFinally)) { thenFinally = function (value) { onFinally && onFinally(); return value; }; catchFinally = function (reason) { onFinally && onFinally(); throw reason; }; } return _then(thenFinally, catchFinally); }; var _strState = function () { return STRING_STATES[_state]; }; var _processQueue = function () { if (_queue.length > 0) { var pending = _queue.slice(); _queue = []; _handled = true; processor(pending); _unHandledRejectionHandler && _unHandledRejectionHandler.cancel(); _unHandledRejectionHandler = null; } }; var _createSettleIfFn = function (newState, allowState) { return function (theValue) { if (_state === allowState) { if (newState === 2 && isPromiseLike(theValue)) { _state = 1 ; theValue.then(_createSettleIfFn(2 , 1 ), _createSettleIfFn(3 , 1 )); return; } _state = newState; _hasResolved = true; _settledValue = theValue; _processQueue(); if (!_handled && newState === 3 && !_unHandledRejectionHandler) { _unHandledRejectionHandler = scheduleTimeout(_notifyUnhandledRejection, _unhandledRejectionTimeout); } } }; }; var _notifyUnhandledRejection = function () { if (!_handled) { if (isNode()) { process.emit(NODE_UNHANDLED_REJECTION, _settledValue, _thePromise); } else { var gbl = getWindow() || getGlobal(); emitEvent(gbl, UNHANDLED_REJECTION, function (theEvt) { objDefine(theEvt, "promise", { g: function () { return _thePromise; } }); theEvt.reason = _settledValue; return theEvt; }, !!_hasPromiseRejectionEvent.v); } } }; _thePromise = { then: _then, "catch": _catch, finally: _finally }; objDefineProp(_thePromise, "state", { get: _strState }); if (hasSymbol()) { _thePromise[getKnownSymbol(11 )] = "IPromise"; } var _toString = function () { return "IPromise" + ("") + " " + _strState() + (_hasResolved ? (" - " + dumpFnObj(_settledValue)) : ""); }; _thePromise.toString = _toString; (function _initialize() { if (!isFunction(executor)) { throwTypeError(STR_PROMISE + ": executor is not a function - " + dumpFnObj(executor)); } var _rejectFn = _createSettleIfFn(3 , 0 ); try { executor.call(_thePromise, _createSettleIfFn(2 , 0 ), _rejectFn); } catch (e) { _rejectFn(e); } })(); return _thePromise; } function _createAllPromise(newPromise) { return function (input) { var additionalArgs = arrSlice(arguments, 1); return newPromise(function (resolve, reject) { try { var values_1 = []; var pending_1 = 1; arrForEach(input, function (item, idx) { if (item) { pending_1++; doAwait(item, function (value) { values_1[idx] = value; if (--pending_1 === 0) { resolve(values_1); } }, reject); } }); pending_1--; if (pending_1 === 0) { resolve(values_1); } } catch (e) { reject(e); } }, additionalArgs); }; } var _processPendingItems = function (pending) { arrForEach(pending, function (fn) { try { fn(); } catch (e) { } }); }; function timeoutItemProcessor(timeout) { var callbackTimeout = isNumber(timeout) ? timeout : 0; return function (pending) { scheduleTimeout(function () { _processPendingItems(pending); }, callbackTimeout); }; } function createAsyncPromise(executor, timeout) { return _createPromise(createAsyncPromise, timeoutItemProcessor(timeout), executor, timeout); } var _isPromiseSupported; function createNativePromise(executor, timeout) { !_isPromiseSupported && (_isPromiseSupported = lazySafeGetInst(STR_PROMISE)); var PrmCls = _isPromiseSupported.v; if (!PrmCls) { return createAsyncPromise(executor); } if (!isFunction(executor)) { throwTypeError(STR_PROMISE + ": executor is not a function - " + dumpObj(executor)); } var _state = 0 ; function _strState() { return STRING_STATES[_state]; } var thePromise = new PrmCls(function (resolve, reject) { function _resolve(value) { _state = 2 ; resolve(value); } function _reject(reason) { _state = 3 ; reject(reason); } executor(_resolve, _reject); }); objDefineProp(thePromise, "state", { get: _strState }); return thePromise; } var _promiseCreator; function createPromise(executor, timeout) { !_promiseCreator && (_promiseCreator = getLazy(function () { return createNativePromise; })); return _promiseCreator.v.call(this, executor, timeout); } var createAllPromise = _createAllPromise(createPromise); var UNDEFINED_VALUE$2 = undefined; var STR_EMPTY = ""; var STR_CHANNELS = "channels"; var STR_CORE = "core"; var STR_CREATE_PERF_MGR = "createPerfMgr"; var STR_DISABLED = "disabled"; var STR_EXTENSION_CONFIG = "extensionConfig"; var STR_EXTENSIONS = "extensions"; var STR_PROCESS_TELEMETRY = "processTelemetry"; var STR_PRIORITY = "priority"; var STR_EVENTS_SENT = "eventsSent"; var STR_EVENTS_DISCARDED = "eventsDiscarded"; var STR_EVENTS_SEND_REQUEST = "eventsSendRequest"; var STR_PERF_EVENT = "perfEvent"; var STR_GET_PERF_MGR = "getPerfMgr"; var STR_DOMAIN = "domain"; var STR_PATH = "path"; var STR_NOT_DYNAMIC_ERROR = "Not dynamic - "; var strGetPrototypeOf = "getPrototypeOf"; var rCamelCase = /-([a-z])/g; var rNormalizeInvalid = /([^\w\d_$])/g; var rLeadingNumeric = /^(\d+[\w\d_$])/; var _getObjProto = Object[strGetPrototypeOf]; function isNotNullOrUndefined(value) { return !isNullOrUndefined(value); } function normalizeJsName(name) { var value = name; if (value && isString(value)) { value = value[_DYN_REPLACE ](rCamelCase, function (_all, letter) { return letter.toUpperCase(); }); value = value[_DYN_REPLACE ](rNormalizeInvalid, "_"); value = value[_DYN_REPLACE ](rLeadingNumeric, function (_all, match) { return "_" + match; }); } return value; } function strContains(value, search) { if (value && search) { return strIndexOf(value, search) !== -1; } return false; } function toISOString(date) { return date && date.toISOString() || ""; } function getExceptionName(object) { if (isError(object)) { return object[_DYN_NAME$3 ]; } return STR_EMPTY; } function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } function getSetValue(target, field, defValue) { var theValue; if (target) { theValue = target[field]; if (!theValue && isNullOrUndefined(theValue)) { theValue = !isUndefined(defValue) ? defValue : {}; target[field] = theValue; } } else { theValue = !isUndefined(defValue) ? defValue : {}; } return theValue; } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName][_DYN_APPLY ](src, originalArguments); } }; } function proxyAssign(target, source, chkSet) { if (target && source && isObject(target) && isObject(source)) { var _loop_1 = function (field) { if (isString(field)) { var value = source[field]; if (isFunction(value)) { if (!chkSet || chkSet(field, true, source, target)) { target[field] = _createProxyFunction(source, field); } } else if (!chkSet || chkSet(field, false, source, target)) { if (objHasOwn(target, field)) { delete target[field]; } objDefine(target, field, { g: function () { return source[field]; }, s: function (theValue) { source[field] = theValue; } }); } } }; for (var field in source) { _loop_1(field); } } return target; } function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } function proxyFunctions(target, source, functionsToProxy, overwriteTarget) { if (target && source && isObject(target) && isArray(functionsToProxy)) { arrForEach(functionsToProxy, function (theFuncName) { if (isString(theFuncName)) { proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget); } }); } return target; } function createClassFromInterface(defaults) { return /** @class */ (function () { function class_1() { var _this = this; if (defaults) { objForEachKey(defaults, function (field, value) { _this[field] = value; }); } } return class_1; }()); } function optimizeObject(theObject) { if (theObject && objAssign) { theObject = ObjClass(objAssign({}, theObject)); } return theObject; } function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs[_DYN_LENGTH$5 ]; var deep = false; var idx = 1; if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } if (!isObject(extended)) { extended = {}; } for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && objHasOwn(arg, prop)); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { clone = []; } } else if (!isPlainObject(clone)) { clone = {}; } newValue = objExtend(deep, clone, newValue); } if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } function isFeatureEnabled(feature, cfg) { var rlt = false; var ft = cfg && cfg.featureOptIn && cfg.featureOptIn[feature]; if (feature && ft) { var mode = ft.mode; rlt = (mode == 3 ) || (mode == 1 ); } return rlt; } var strDocumentMode = "documentMode"; var strLocation = "location"; var strConsole = "console"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { } } } return supported; } function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getInst(strLocation); } function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getInst(strConsole); } function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null); } function getJSON() { if (hasJSON()) { return JSON || getInst(strJSON); } return null; } function getCrypto() { return getInst(strCrypto); } function getMsCrypto() { return getInst(strMsCrypto); } function isReactNative() { var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } function isIE() { var nav = getNavigator(); if (nav && (nav[_DYN_USER_AGENT ] !== _navUserAgentCheck || _isTrident === null)) { _navUserAgentCheck = nav[_DYN_USER_AGENT ]; var userAgent = (_navUserAgentCheck || STR_EMPTY)[_DYN_TO_LOWER_CASE$2 ](); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } function getIEVersion(userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } if (!userAgentStr) { var navigator_1 = getNavigator() || {}; userAgentStr = navigator_1 ? (navigator_1.userAgent || STR_EMPTY)[_DYN_TO_LOWER_CASE$2 ]() : STR_EMPTY; } var ua = (userAgentStr || STR_EMPTY)[_DYN_TO_LOWER_CASE$2 ](); if (strContains(ua, strMsie)) { var doc = getDocument() || {}; return Math.max(parseInt(ua[_DYN_SPLIT$1 ](strMsie)[1]), (doc[strDocumentMode] || 0)); } else if (strContains(ua, strTrident)) { var tridentVer = parseInt(ua[_DYN_SPLIT$1 ](strTrident)[1]); if (tridentVer) { return tridentVer + 4; } } return null; } function isBeaconsSupported(useCached) { if (_beaconsSupported === null || useCached === false) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getInst("fetch"); var request = getInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { } return isSupported; } function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { } return isSupported; } function _getNamedValue(values, name) { if (values) { for (var i = 0; i < values[_DYN_LENGTH$5 ]; i++) { var value = values[i]; if (value[_DYN_NAME$3 ]) { if (value[_DYN_NAME$3 ] === name) { return value; } } } } return {}; } function findMetaTag(name) { var doc = getDocument(); if (doc && name) { return _getNamedValue(doc.querySelectorAll("meta"), name).content; } return null; } function findNamedServerTiming(name) { var value; var perf = getPerformance(); if (perf) { var navPerf = perf.getEntriesByType("navigation") || []; value = _getNamedValue((navPerf[_DYN_LENGTH$5 ] > 0 ? navPerf[0] : {}).serverTiming, name).description; } return value; } function dispatchEvent(target, evnt) { if (target && target.dispatchEvent && evnt) { target.dispatchEvent(evnt); return true; } return false; } function createCustomDomEvent(eventName, details) { var event = null; var detail = { detail: details || null }; if (isFunction(CustomEvent)) { event = new CustomEvent(eventName, detail); } else { var doc = getDocument(); if (doc && doc.createEvent) { event = doc.createEvent("CustomEvent"); event.initCustomEvent(eventName, true, true, detail); } } return event; } function sendCustomEvent(evtName, cfg, customDetails) { var global = getGlobal(); if (global && global.CustomEvent) { try { var details = { cfg: cfg || null, customDetails: customDetails || null }; return dispatchEvent(global, createCustomDomEvent(evtName, details)); } catch (e) { } } return false; } var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; var SEED1 = 123456789; var SEED2 = 987654321; var _mwcSeeded = false; var _mwcW = SEED1; var _mwcZ = SEED2; function _mwcSeed(seedValue) { if (seedValue < 0) { seedValue >>>= 0; } _mwcW = (SEED1 + seedValue) & MaxUInt32; _mwcZ = (SEED2 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { try { var now = utcNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { } } function randomValue(maxValue) { if (maxValue > 0) { return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0; } return 0; } function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { if (!_mwcSeeded) { _autoSeedMwc(); } value = mwcRandom32() & MaxUInt32; } if (value === 0) { value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { value >>>= 0; } return value; } function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { value >>>= 0; } return value; } function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var number = random32() >>> 0; var chars = 0; var result = STR_EMPTY; while (result[_DYN_LENGTH$5 ] < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; if (chars === 5) { number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; } } return result; } var version = '3.0.6'; var instanceName = "." + newId(6); var _dataUid = 0; function _canAcceptData(target) { return target[_DYN_NODE_TYPE ] === 1 || target[_DYN_NODE_TYPE ] === 9 || !(+target[_DYN_NODE_TYPE ]); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { objDefine(target, data.id, { e: false, v: theCache }); } } catch (e) { } } return theCache; } function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : STR_EMPTY) + instanceName); } function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || STR_EMPTY) + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { } } } }; return data; } function _isConfigDefaults(value) { return (value && isObject(value) && (value.isVal || value.fb || objHasOwn(value, "v") || objHasOwn(value, "mrg") || objHasOwn(value, "ref") || value.set)); } function _getDefault(dynamicHandler, theConfig, cfgDefaults) { var defValue; var isDefaultValid = cfgDefaults.dfVal || isDefined; if (theConfig && cfgDefaults.fb) { var fallbacks = cfgDefaults.fb; if (!isArray(fallbacks)) { fallbacks = [fallbacks]; } for (var lp = 0; lp < fallbacks[_DYN_LENGTH$5 ]; lp++) { var fallback = fallbacks[lp]; var fbValue = theConfig[fallback]; if (isDefaultValid(fbValue)) { defValue = fbValue; } else if (dynamicHandler) { fbValue = dynamicHandler.cfg[fallback]; if (isDefaultValid(fbValue)) { defValue = fbValue; } dynamicHandler.set(dynamicHandler.cfg, asString(fallback), fbValue); } if (isDefaultValid(defValue)) { break; } } } if (!isDefaultValid(defValue) && isDefaultValid(cfgDefaults.v)) { defValue = cfgDefaults.v; } return defValue; } function _resolveDefaultValue(dynamicHandler, theConfig, cfgDefaults) { var theValue = cfgDefaults; if (cfgDefaults && _isConfigDefaults(cfgDefaults)) { theValue = _getDefault(dynamicHandler, theConfig, cfgDefaults); } if (theValue) { if (_isConfigDefaults(theValue)) { theValue = _resolveDefaultValue(dynamicHandler, theConfig, theValue); } var newValue_1; if (isArray(theValue)) { newValue_1 = []; newValue_1[_DYN_LENGTH$5 ] = theValue[_DYN_LENGTH$5 ]; } else if (isPlainObject(theValue)) { newValue_1 = {}; } if (newValue_1) { objForEachKey(theValue, function (key, value) { if (value && _isConfigDefaults(value)) { value = _resolveDefaultValue(dynamicHandler, theConfig, value); } newValue_1[key] = value; }); theValue = newValue_1; } } return theValue; } function _applyDefaultValue(dynamicHandler, theConfig, name, defaultValue) { var isValid; var setFn; var defValue; var cfgDefaults = defaultValue; var mergeDf; var reference; var readOnly; var blkDynamicValue; if (_isConfigDefaults(cfgDefaults)) { isValid = cfgDefaults.isVal; setFn = cfgDefaults.set; readOnly = cfgDefaults[_DYN_RD_ONLY ]; blkDynamicValue = cfgDefaults[_DYN_BLK_VAL ]; mergeDf = cfgDefaults.mrg; reference = cfgDefaults.ref; if (!reference && isUndefined(reference)) { reference = !!mergeDf; } defValue = _getDefault(dynamicHandler, theConfig, cfgDefaults); } else { defValue = defaultValue; } if (blkDynamicValue) { dynamicHandler[_DYN_BLK_VAL ](theConfig, name); } var theValue; var usingDefault = true; var cfgValue = theConfig[name]; if (cfgValue || !isNullOrUndefined(cfgValue)) { theValue = cfgValue; usingDefault = false; if (isValid && theValue !== defValue && !isValid(theValue)) { theValue = defValue; usingDefault = true; } if (setFn) { theValue = setFn(theValue, defValue, theConfig); usingDefault = theValue === defValue; } } if (!usingDefault) { if (isPlainObject(theValue) || isArray(defValue)) { if (mergeDf && defValue && (isPlainObject(defValue) || isArray(defValue))) { objForEachKey(defValue, function (dfName, dfValue) { _applyDefaultValue(dynamicHandler, theValue, dfName, dfValue); }); } } } else if (defValue) { theValue = _resolveDefaultValue(dynamicHandler, theConfig, defValue); } else { theValue = defValue; } dynamicHandler.set(theConfig, name, theValue); if (reference) { dynamicHandler.ref(theConfig, name); } if (readOnly) { dynamicHandler[_DYN_RD_ONLY ](theConfig, name); } } var CFG_HANDLER_LINK = symbolFor("[[ai_dynCfg_1]]"); var BLOCK_DYNAMIC = symbolFor("[[ai_blkDynCfg_1]]"); var FORCE_DYNAMIC = symbolFor("[[ai_frcDynCfg_1]]"); function _cfgDeepCopy(source) { if (source) { var target_1; if (isArray(source)) { target_1 = []; target_1[_DYN_LENGTH$5 ] = source[_DYN_LENGTH$5 ]; } else if (isPlainObject(source)) { target_1 = {}; } if (target_1) { objForEachKey(source, function (key, value) { target_1[key] = _cfgDeepCopy(value); }); return target_1; } } return source; } function getDynamicConfigHandler(value) { if (value) { var handler = value[CFG_HANDLER_LINK] || value; if (handler.cfg && (handler.cfg === value || handler.cfg[CFG_HANDLER_LINK] === handler)) { return handler; } } return null; } function blockDynamicConversion(value) { if (value && (isPlainObject(value) || isArray(value))) { try { value[BLOCK_DYNAMIC] = true; } catch (e) { } } return value; } function _canMakeDynamic(getFunc, state, value) { var result = false; if (value && !getFunc[state.blkVal]) { result = value[FORCE_DYNAMIC]; if (!result && !value[BLOCK_DYNAMIC]) { result = isPlainObject(value) || isArray(value); } } return result; } function throwInvalidAccess(message) { throwTypeError("InvalidAccess:" + message); } var arrayMethodsToPatch = [ "push", "pop", "shift", "unshift", "splice" ]; var _throwDynamicError = function (logger, name, desc, e) { logger && logger[_DYN_THROW_INTERNAL ](3 , 108 , "".concat(desc, " [").concat(name, "] failed - ") + dumpObj(e)); }; function _patchArray(state, target, name) { if (isArray(target)) { arrForEach(arrayMethodsToPatch, function (method) { var orgMethod = target[method]; target[method] = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var result = orgMethod[_DYN_APPLY ](this, args); _makeDynamicObject(state, target, name, "Patching"); return result; }; }); } } function _getOwnPropGetter(target, name) { var propDesc = objGetOwnPropertyDescriptor(target, name); return propDesc && propDesc.get; } function _createDynamicProperty(state, theConfig, name, value) { var detail = { n: name, h: [], trk: function (handler) { if (handler && handler.fn) { if (arrIndexOf(detail.h, handler) === -1) { detail.h[_DYN_PUSH$2 ](handler); } state.trk(handler, detail); } }, clr: function (handler) { var idx = arrIndexOf(detail.h, handler); if (idx !== -1) { detail.h[_DYN_SPLICE ](idx, 1); } } }; var checkDynamic = true; var isObjectOrArray = false; function _getProperty() { if (checkDynamic) { isObjectOrArray = isObjectOrArray || _canMakeDynamic(_getProperty, state, value); if (value && !value[CFG_HANDLER_LINK] && isObjectOrArray) { value = _makeDynamicObject(state, value, name, "Converting"); } checkDynamic = false; } var activeHandler = state.act; if (activeHandler) { detail.trk(activeHandler); } return value; } _getProperty[state.prop] = { chng: function () { state.add(detail); } }; function _setProperty(newValue) { if (value !== newValue) { if (!!_getProperty[state.ro] && !state.upd) { throwInvalidAccess("[" + name + "] is read-only:" + dumpObj(theConfig)); } if (checkDynamic) { isObjectOrArray = isObjectOrArray || _canMakeDynamic(_getProperty, state, value); checkDynamic = false; } var isReferenced = isObjectOrArray && _getProperty[state.rf]; if (isObjectOrArray) { if (isReferenced) { objForEachKey(value, function (key) { value[key] = newValue ? newValue[key] : UNDEFINED_VALUE$2; }); try { objForEachKey(newValue, function (key, theValue) { _setDynamicProperty(state, value, key, theValue); }); newValue = value; } catch (e) { _throwDynamicError((state.hdlr || {})[_DYN_LOGGER ], name, "Assigning", e); isObjectOrArray = false; } } else if (value && value[CFG_HANDLER_LINK]) { objForEachKey(value, function (key) { var getter = _getOwnPropGetter(value, key); if (getter) { var valueState = getter[state.prop]; valueState && valueState.chng(); } }); } } if (newValue !== value) { var newIsObjectOrArray = newValue && _canMakeDynamic(_getProperty, state, newValue); if (!isReferenced && newIsObjectOrArray) { newValue = _makeDynamicObject(state, newValue, name, "Converting"); } value = newValue; isObjectOrArray = newIsObjectOrArray; } state.add(detail); } } objDefine(theConfig, detail.n, { g: _getProperty, s: _setProperty }); } function _setDynamicProperty(state, target, name, value) { if (target) { var getter = _getOwnPropGetter(target, name); var isDynamic = getter && !!getter[state.prop]; if (!isDynamic) { _createDynamicProperty(state, target, name, value); } else { target[name] = value; } } return target; } function _setDynamicPropertyState(state, target, name, flags) { if (target) { var getter = _getOwnPropGetter(target, name); var isDynamic = getter && !!getter[state.prop]; var inPlace = flags && flags[0 ]; var rdOnly = flags && flags[1 ]; var blkProp = flags && flags[2 ]; if (!isDynamic) { if (blkProp) { try { blockDynamicConversion(target); } catch (e) { _throwDynamicError((state.hdlr || {})[_DYN_LOGGER ], name, "Blocking", e); } } try { _setDynamicProperty(state, target, name, target[name]); getter = _getOwnPropGetter(target, name); } catch (e) { _throwDynamicError((state.hdlr || {})[_DYN_LOGGER ], name, "State", e); } } if (inPlace) { getter[state.rf] = inPlace; } if (rdOnly) { getter[state.ro] = rdOnly; } if (blkProp) { getter[state.blkVal] = true; } } return target; } function _makeDynamicObject(state, target, name, desc) { try { objForEachKey(target, function (key, value) { _setDynamicProperty(state, target, key, value); }); if (!target[CFG_HANDLER_LINK]) { objDefineProp(target, CFG_HANDLER_LINK, { get: function () { return state[_DYN_HDLR ]; } }); _patchArray(state, target, name); } } catch (e) { _throwDynamicError((state.hdlr || {})[_DYN_LOGGER ], name, desc, e); } return target; } var symPrefix = "[[ai_"; var symPostfix = "]]"; function _createState(cfgHandler) { var _a; var dynamicPropertySymbol = newSymbol(symPrefix + "get" + cfgHandler.uid + symPostfix); var dynamicPropertyReadOnly = newSymbol(symPrefix + "ro" + cfgHandler.uid + symPostfix); var dynamicPropertyReferenced = newSymbol(symPrefix + "rf" + cfgHandler.uid + symPostfix); var dynamicPropertyBlockValue = newSymbol(symPrefix + "blkVal" + cfgHandler.uid + symPostfix); var dynamicPropertyDetail = newSymbol(symPrefix + "dtl" + cfgHandler.uid + symPostfix); var _waitingHandlers = null; var _watcherTimer = null; var theState; function _useHandler(activeHandler, callback) { var prevWatcher = theState.act; try { theState.act = activeHandler; if (activeHandler && activeHandler[dynamicPropertyDetail]) { arrForEach(activeHandler[dynamicPropertyDetail], function (detail) { detail.clr(activeHandler); }); activeHandler[dynamicPropertyDetail] = []; } callback({ cfg: cfgHandler.cfg, set: cfgHandler.set.bind(cfgHandler), setDf: cfgHandler[_DYN_SET_DF ].bind(cfgHandler), ref: cfgHandler.ref.bind(cfgHandler), rdOnly: cfgHandler[_DYN_RD_ONLY ].bind(cfgHandler) }); } catch (e) { var logger = cfgHandler[_DYN_LOGGER ]; if (logger) { logger[_DYN_THROW_INTERNAL ](1 , 107 , dumpObj(e)); } throw e; } finally { theState.act = prevWatcher || null; } } function _notifyWatchers() { if (_waitingHandlers) { var notifyHandlers = _waitingHandlers; _waitingHandlers = null; _watcherTimer && _watcherTimer[_DYN_CANCEL ](); _watcherTimer = null; var watcherFailures_1 = []; arrForEach(notifyHandlers, function (handler) { if (handler) { if (handler[dynamicPropertyDetail]) { arrForEach(handler[dynamicPropertyDetail], function (detail) { detail.clr(handler); }); handler[dynamicPropertyDetail] = null; } if (handler.fn) { try { _useHandler(handler, handler.fn); } catch (e) { watcherFailures_1[_DYN_PUSH$2 ](e); } } } }); if (_waitingHandlers) { try { _notifyWatchers(); } catch (e) { watcherFailures_1[_DYN_PUSH$2 ](e); } } if (watcherFailures_1[_DYN_LENGTH$5 ] > 0) { throwAggregationError("Watcher error(s): ", watcherFailures_1); } } } function _addWatcher(detail) { if (detail && detail.h[_DYN_LENGTH$5 ] > 0) { if (!_waitingHandlers) { _waitingHandlers = []; } if (!_watcherTimer) { _watcherTimer = scheduleTimeout(function () { _watcherTimer = null; _notifyWatchers(); }, 0); } for (var idx = 0; idx < detail.h[_DYN_LENGTH$5 ]; idx++) { var handler = detail.h[idx]; if (handler && arrIndexOf(_waitingHandlers, handler) === -1) { _waitingHandlers[_DYN_PUSH$2 ](handler); } } } } function _trackHandler(handler, detail) { if (handler) { var details = handler[dynamicPropertyDetail] = handler[dynamicPropertyDetail] || []; if (arrIndexOf(details, detail) === -1) { details[_DYN_PUSH$2 ](detail); } } } theState = (_a = { prop: dynamicPropertySymbol, ro: dynamicPropertyReadOnly, rf: dynamicPropertyReferenced }, _a[_DYN_BLK_VAL ] = dynamicPropertyBlockValue, _a[_DYN_HDLR ] = cfgHandler, _a.add = _addWatcher, _a[_DYN_NOTIFY ] = _notifyWatchers, _a.use = _useHandler, _a.trk = _trackHandler, _a); return theState; } function _createAndUseHandler(state, configHandler) { var handler = { fn: configHandler, rm: function () { handler.fn = null; state = null; configHandler = null; } }; state.use(handler, configHandler); return handler; } function _createDynamicHandler(logger, target, inPlace) { var _a; var dynamicHandler = getDynamicConfigHandler(target); if (dynamicHandler) { return dynamicHandler; } var uid = createUniqueNamespace("dyncfg", true); var newTarget = (target && inPlace !== false) ? target : _cfgDeepCopy(target); var theState; function _notifyWatchers() { theState[_DYN_NOTIFY ](); } function _setValue(target, name, value) { try { target = _setDynamicProperty(theState, target, name, value); } catch (e) { _throwDynamicError(logger, name, "Setting value", e); } return target[name]; } function _watch(configHandler) { return _createAndUseHandler(theState, configHandler); } function _block(configHandler, allowUpdate) { theState.use(null, function (details) { var prevUpd = theState.upd; try { if (!isUndefined(allowUpdate)) { theState.upd = allowUpdate; } configHandler(details); } finally { theState.upd = prevUpd; } }); } function _ref(target, name) { var _a; return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[0 ] = true, _a))[name]; } function _rdOnly(target, name) { var _a; return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[1 ] = true, _a))[name]; } function _blkPropValue(target, name) { var _a; return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[2 ] = true, _a))[name]; } function _applyDefaults(theConfig, defaultValues) { if (defaultValues) { objForEachKey(defaultValues, function (name, value) { _applyDefaultValue(cfgHandler, theConfig, name, value); }); } return theConfig; } var cfgHandler = (_a = { uid: null, cfg: newTarget }, _a[_DYN_LOGGER ] = logger, _a[_DYN_NOTIFY ] = _notifyWatchers, _a.set = _setValue, _a[_DYN_SET_DF ] = _applyDefaults, _a[_DYN_WATCH ] = _watch, _a.ref = _ref, _a[_DYN_RD_ONLY ] = _rdOnly, _a[_DYN_BLK_VAL ] = _blkPropValue, _a._block = _block, _a); objDefine(cfgHandler, "uid", { c: false, e: false, w: false, v: uid }); theState = _createState(cfgHandler); _makeDynamicObject(theState, newTarget, "config", "Creating"); return cfgHandler; } function _logInvalidAccess(logger, message) { if (logger) { logger[_DYN_WARN_TO_CONSOLE ](message); logger[_DYN_THROW_INTERNAL ](2 , 108 , message); } else { throwInvalidAccess(message); } } function createDynamicConfig(config, defaultConfig, logger, inPlace) { var dynamicHandler = _createDynamicHandler(logger, config || {}, inPlace); if (defaultConfig) { dynamicHandler[_DYN_SET_DF ](dynamicHandler.cfg, defaultConfig); } return dynamicHandler; } function onConfigChange(config, configHandler, logger) { var handler = config[CFG_HANDLER_LINK] || config; if (handler.cfg && (handler.cfg === config || handler.cfg[CFG_HANDLER_LINK] === handler)) { return handler[_DYN_WATCH ](configHandler); } _logInvalidAccess(logger, STR_NOT_DYNAMIC_ERROR + dumpObj(config)); return createDynamicConfig(config, null, logger)[_DYN_WATCH ](configHandler); } function runTargetUnload(target, isAsync) { if (target && target[_DYN_UNLOAD ]) { return target[_DYN_UNLOAD ](isAsync); } } function doUnloadAll(targets, isAsync, done) { var result; if (!done) { result = createPromise(function (resolved) { done = resolved; }); } if (targets && getLength(targets) > 0) { doAwaitResponse(runTargetUnload(targets[0], isAsync), function () { doUnloadAll(arrSlice(targets, 1), isAsync, done); }); } else { done(); } return result; } var ChannelControllerPriority = 500; function _stringToBoolOrDefault(theValue, defaultValue, theConfig) { if (!theValue && isNullOrUndefined(theValue)) { return defaultValue; } if (isBoolean(theValue)) { return theValue; } return asString(theValue)[_DYN_TO_LOWER_CASE$2 ]() === "true"; } function cfgDfMerge(defaultValue) { return { mrg: true, v: defaultValue }; } function cfgDfSet(setter, defaultValue) { return { set: setter, v: defaultValue }; } function cfgDfValidate(validator, defaultValue, fallBackName) { return { fb: fallBackName, isVal: validator, v: defaultValue }; } function cfgDfBoolean(defaultValue, fallBackName) { return { fb: fallBackName, set: _stringToBoolOrDefault, v: !!defaultValue }; } function cfgDfString(defaultValue) { return { isVal: isString, v: asString(defaultValue || STR_EMPTY) }; } var listenerFuncs = [STR_EVENTS_SENT, STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_PERF_EVENT]; var _aiNamespace = null; var _debugListener; function _listenerProxyFunc(name, config) { return function () { var args = arguments; var dbgExt = getDebugExt(config); if (dbgExt) { var listener = dbgExt.listener; if (listener && listener[name]) { listener[name][_DYN_APPLY ](listener, args); } } }; } function _getExtensionNamespace() { var target = getInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } function getDebugListener(config) { if (!_debugListener) { _debugListener = {}; for (var lp = 0; lp < listenerFuncs[_DYN_LENGTH$5 ]; lp++) { _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config); } } return _debugListener; } var _a$9; var STR_WARN_TO_CONSOLE = "warnToConsole"; var AiNonUserActionablePrefix = "AI (Internal): "; var AiUserActionablePrefix = "AI: "; var AIInternalMessagePrefix = "AITR_"; var defaultValues$3 = { loggingLevelConsole: 0, loggingLevelTelemetry: 1, maxMessageLimit: 25, enableDebug: false }; var _logFuncs = (_a$9 = {}, _a$9[0 ] = null, _a$9[1 ] = "errorToConsole", _a$9[2 ] = STR_WARN_TO_CONSOLE, _a$9[3 ] = "debugToConsole", _a$9); function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY) + "\""; } return STR_EMPTY; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self[_DYN_MESSAGE_ID ] = msgId; _self[_DYN_MESSAGE$2 ] = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = STR_EMPTY; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY); _self[_DYN_MESSAGE$2 ] += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); function safeGetLogger(core, config) { return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; this.queue = []; var _messageCount = 0; var _messageLogged = {}; var _loggingLevelConsole; var _loggingLevelTelemetry; var _maxInternalMessageLimit; var _enableDebug; var _unloadHandler; dynamicProto(DiagnosticLogger, this, function (_self) { _unloadHandler = _setDefaultsFromConfig(config || {}); _self.consoleLoggingLevel = function () { return _loggingLevelConsole; }; _self[_DYN_THROW_INTERNAL ] = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_enableDebug) { throw dumpObj(message); } else { var logFunc = _logFuncs[severity] || STR_WARN_TO_CONSOLE; if (!isUndefined(message[_DYN_MESSAGE$2 ])) { if (isUserAct) { var messageKey = +message[_DYN_MESSAGE_ID ]; if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) { _self[logFunc](message[_DYN_MESSAGE$2 ]); _messageLogged[messageKey] = true; } } else { if (_loggingLevelConsole >= severity) { _self[logFunc](message[_DYN_MESSAGE$2 ]); } } _logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message); } } }; _self.debugToConsole = function (message) { _logToConsole("debug", message); _debugExtMsg("warning", message); }; _self[_DYN_WARN_TO_CONSOLE ] = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; _self.errorToConsole = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; _self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage; _self[_DYN_UNLOAD ] = function (isAsync) { _unloadHandler && _unloadHandler.rm(); _unloadHandler = null; }; function _logInternalMessage(severity, message) { if (_areInternalMessagesThrottled()) { return; } var logMessage = true; var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID ]; if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { if (severity <= _loggingLevelTelemetry) { _self.queue[_DYN_PUSH$2 ](message); _messageCount++; _debugExtMsg((severity === 1 ? "error" : "warn"), message); } if (_messageCount === _maxInternalMessageLimit) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false); _self.queue[_DYN_PUSH$2 ](throttleMessage); if (severity === 1 ) { _self.errorToConsole(throttleLimitMessage); } else { _self[_DYN_WARN_TO_CONSOLE ](throttleLimitMessage); } } } } function _setDefaultsFromConfig(config) { return onConfigChange(createDynamicConfig(config, defaultValues$3, _self).cfg, function (details) { var config = details.cfg; _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 ]; _loggingLevelTelemetry = config.loggingLevelTelemetry; _maxInternalMessageLimit = config.maxMessageLimit; _enableDebug = config.enableDebug; }); } function _areInternalMessagesThrottled() { return _messageCount >= _maxInternalMessageLimit; } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config || {}); if (dbgExt && dbgExt[_DYN_DIAG_LOG$2 ]) { dbgExt[_DYN_DIAG_LOG$2 ](name, data); } } }); } DiagnosticLogger.__ieDyn=1; return DiagnosticLogger; }()); function _getLogger(logger) { return (logger || new DiagnosticLogger()); } function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } _getLogger(logger)[_DYN_THROW_INTERNAL ](severity, msgId, msg, properties, isUserAct); } function _warnToConsole(logger, message) { _getLogger(logger)[_DYN_WARN_TO_CONSOLE ](message); } function _logInternalMessage(logger, severity, message) { _getLogger(logger)[_DYN_LOG_INTERNAL_MESSAGE ](severity, message); } var _a$8, _b$2; var strToGMTString = "toGMTString"; var strToUTCString = "toUTCString"; var strCookie = "cookie"; var strExpires = "expires"; var strIsCookieUseDisabled = "isCookieUseDisabled"; var strDisableCookiesUsage = "disableCookiesUsage"; var strConfigCookieMgr = "_ckMgr"; var _supportsCookies = null; var _allowUaSameSite = null; var _parsedCookieValue = null; var _doc; var _cookieCache = {}; var _globalCookieConfig = {}; var rootDefaultConfig = (_a$8 = { cookieCfg: cfgDfMerge((_b$2 = {}, _b$2[STR_DOMAIN] = { fb: "cookieDomain", dfVal: isNotNullOrUndefined }, _b$2.path = { fb: "cookiePath", dfVal: isNotNullOrUndefined }, _b$2.enabled = UNDEFINED_VALUE$2, _b$2.ignoreCookies = UNDEFINED_VALUE$2, _b$2.blockedCookies = UNDEFINED_VALUE$2, _b$2)), cookieDomain: UNDEFINED_VALUE$2, cookiePath: UNDEFINED_VALUE$2 }, _a$8[strDisableCookiesUsage] = UNDEFINED_VALUE$2, _a$8); function _getDoc() { !_doc && (_doc = getLazy(function () { return getDocument(); })); } function _gblCookieMgr(config, logger) { var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr]; if (!inst) { inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger); _globalCookieConfig[strConfigCookieMgr] = inst; } return inst; } function _isMgrEnabled(cookieMgr) { if (cookieMgr) { return cookieMgr.isEnabled(); } return true; } function _isIgnoredCookie(cookieMgrCfg, name) { if (name && cookieMgrCfg && isArray(cookieMgrCfg.ignoreCookies)) { return arrIndexOf(cookieMgrCfg.ignoreCookies, name) !== -1; } return false; } function _isBlockedCookie(cookieMgrCfg, name) { if (name && cookieMgrCfg && isArray(cookieMgrCfg.blockedCookies)) { if (arrIndexOf(cookieMgrCfg.blockedCookies, name) !== -1) { return true; } } return _isIgnoredCookie(cookieMgrCfg, name); } function _isCfgEnabled(rootConfig, cookieMgrConfig) { var isCfgEnabled = cookieMgrConfig[_DYN_ENABLED ]; if (isNullOrUndefined(isCfgEnabled)) { var cookieEnabled = void 0; if (!isUndefined(rootConfig[strIsCookieUseDisabled])) { cookieEnabled = !rootConfig[strIsCookieUseDisabled]; } if (!isUndefined(rootConfig[strDisableCookiesUsage])) { cookieEnabled = !rootConfig[strDisableCookiesUsage]; } isCfgEnabled = cookieEnabled; } return isCfgEnabled; } function safeGetCookieMgr(core, config) { var cookieMgr; if (core) { cookieMgr = core.getCookieMgr(); } else if (config) { var cookieCfg = config.cookieCfg; if (cookieCfg && cookieCfg[strConfigCookieMgr]) { cookieMgr = cookieCfg[strConfigCookieMgr]; } else { cookieMgr = createCookieMgr(config); } } if (!cookieMgr) { cookieMgr = _gblCookieMgr(config, (core || {})[_DYN_LOGGER ]); } return cookieMgr; } function createCookieMgr(rootConfig, logger) { var _a; var cookieMgrConfig; var _path; var _domain; var unloadHandler; var _enabled; var _getCookieFn; var _setCookieFn; var _delCookieFn; rootConfig = createDynamicConfig(rootConfig || _globalCookieConfig, null, logger).cfg; unloadHandler = onConfigChange(rootConfig, function (details) { details[_DYN_SET_DF ](details.cfg, rootDefaultConfig); cookieMgrConfig = details.ref(details.cfg, "cookieCfg"); _path = cookieMgrConfig[STR_PATH ] || "/"; _domain = cookieMgrConfig[STR_DOMAIN ]; _enabled = _isCfgEnabled(rootConfig, cookieMgrConfig) !== false; _getCookieFn = cookieMgrConfig.getCookie || _getCookieValue; _setCookieFn = cookieMgrConfig.setCookie || _setCookieValue; _delCookieFn = cookieMgrConfig.delCookie || _setCookieValue; }, logger); var cookieMgr = (_a = { isEnabled: function () { var enabled = _isCfgEnabled(rootConfig, cookieMgrConfig) !== false && _enabled && areCookiesSupported(logger); var gblManager = _globalCookieConfig[strConfigCookieMgr]; if (enabled && gblManager && cookieMgr !== gblManager) { enabled = _isMgrEnabled(gblManager); } return enabled; }, setEnabled: function (value) { _enabled = value !== false; cookieMgrConfig[_DYN_ENABLED ] = value; }, set: function (name, value, maxAgeSec, domain, path) { var result = false; if (_isMgrEnabled(cookieMgr) && !_isBlockedCookie(cookieMgrConfig, name)) { var values = {}; var theValue = strTrim(value || STR_EMPTY); var idx = strIndexOf(theValue, ";"); if (idx !== -1) { theValue = strTrim(strLeft(value, idx)); values = _extractParts(strSubstring(value, idx + 1)); } setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined); if (!isNullOrUndefined(maxAgeSec)) { var _isIE = isIE(); if (isUndefined(values[strExpires])) { var nowMs = utcNow(); var expireMs = nowMs + (maxAgeSec * 1000); if (expireMs > 0) { var expiry = new Date(); expiry.setTime(expireMs); setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy); } } if (!_isIE) { setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined); } } var location_1 = getLocation(); if (location_1 && location_1.protocol === "https:") { setValue(values, "secure", null, null, isUndefined); if (_allowUaSameSite === null) { _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]); } if (_allowUaSameSite) { setValue(values, "SameSite", "None", null, isUndefined); } } setValue(values, STR_PATH, path || _path, null, isUndefined); _setCookieFn(name, _formatCookieValue(theValue, values)); result = true; } return result; }, get: function (name) { var value = STR_EMPTY; if (_isMgrEnabled(cookieMgr) && !_isIgnoredCookie(cookieMgrConfig, name)) { value = _getCookieFn(name); } return value; }, del: function (name, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { result = cookieMgr.purge(name, path); } return result; }, purge: function (name, path) { var _a; var result = false; if (areCookiesSupported(logger)) { var values = (_a = {}, _a[STR_PATH] = path ? path : "/", _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT", _a); if (!isIE()) { values["max-age"] = "0"; } _delCookieFn(name, _formatCookieValue(STR_EMPTY, values)); result = true; } return result; } }, _a[_DYN_UNLOAD ] = function (isAsync) { unloadHandler && unloadHandler.rm(); unloadHandler = null; }, _a); cookieMgr[strConfigCookieMgr] = cookieMgr; return cookieMgr; } function areCookiesSupported(logger) { if (_supportsCookies === null) { _supportsCookies = false; !_doc && _getDoc(); try { var doc = _doc.v || {}; _supportsCookies = doc[strCookie] !== undefined; } catch (e) { _throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) }); } } return _supportsCookies; } function _extractParts(theValue) { var values = {}; if (theValue && theValue[_DYN_LENGTH$5 ]) { var parts = strTrim(theValue)[_DYN_SPLIT$1 ](";"); arrForEach(parts, function (thePart) { thePart = strTrim(thePart || STR_EMPTY); if (thePart) { var idx = strIndexOf(thePart, "="); if (idx === -1) { values[thePart] = null; } else { values[strTrim(strLeft(thePart, idx))] = strTrim(strSubstring(thePart, idx + 1)); } } }); } return values; } function _formatDate(theDate, func) { if (isFunction(theDate[func])) { return theDate[func](); } return null; } function _formatCookieValue(value, values) { var cookieValue = value || STR_EMPTY; objForEachKey(values, function (name, theValue) { cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : STR_EMPTY); }); return cookieValue; } function _getCookieValue(name) { var cookieValue = STR_EMPTY; !_doc && _getDoc(); if (_doc.v) { var theCookie = _doc.v[strCookie] || STR_EMPTY; if (_parsedCookieValue !== theCookie) { _cookieCache = _extractParts(theCookie); _parsedCookieValue = theCookie; } cookieValue = strTrim(_cookieCache[name] || STR_EMPTY); } return cookieValue; } function _setCookieValue(name, cookieValue) { !_doc && _getDoc(); if (_doc.v) { _doc.v[strCookie] = name + "=" + cookieValue; } } function uaDisallowsSameSiteNone(userAgent) { if (!isString(userAgent)) { return false; } if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) { return true; } if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) { return true; } if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) { return true; } if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) { return true; } return false; } var defaultValues$2 = { perfEvtsSendAll: false }; function _runListeners(listeners, name, isAsync, callback) { arrForEach(listeners, function (listener) { if (listener && listener[name]) { if (isAsync) { scheduleTimeout(function () { return callback(listener); }, 0); } else { try { callback(listener); } catch (e) { } } } }); } var NotificationManager = /** @class */ (function () { function NotificationManager(config) { this.listeners = []; var perfEvtsSendAll; var unloadHandler; var _listeners = []; var cfgHandler = createDynamicConfig(config, defaultValues$2); unloadHandler = cfgHandler[_DYN_WATCH ](function (details) { perfEvtsSendAll = !!details.cfg.perfEvtsSendAll; }); dynamicProto(NotificationManager, this, function (_self) { objDefine(_self, "listeners", { g: function () { return _listeners; } }); _self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) { _listeners[_DYN_PUSH$2 ](listener); }; _self[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) { var index = arrIndexOf(_listeners, listener); while (index > -1) { _listeners[_DYN_SPLICE ](index, 1); index = arrIndexOf(_listeners, listener); } }; _self[STR_EVENTS_SENT ] = function (events) { _runListeners(_listeners, STR_EVENTS_SENT, true, function (listener) { listener[STR_EVENTS_SENT ](events); }); }; _self[STR_EVENTS_DISCARDED ] = function (events, reason) { _runListeners(_listeners, STR_EVENTS_DISCARDED, true, function (listener) { listener[STR_EVENTS_DISCARDED ](events, reason); }); }; _self[STR_EVENTS_SEND_REQUEST ] = function (sendReason, isAsync) { _runListeners(_listeners, STR_EVENTS_SEND_REQUEST, isAsync, function (listener) { listener[STR_EVENTS_SEND_REQUEST ](sendReason, isAsync); }); }; _self[STR_PERF_EVENT ] = function (perfEvent) { if (perfEvent) { if (perfEvtsSendAll || !perfEvent[_DYN_IS_CHILD_EVT ]()) { _runListeners(_listeners, STR_PERF_EVENT, false, function (listener) { if (perfEvent[_DYN_IS_ASYNC ]) { scheduleTimeout(function () { return listener[STR_PERF_EVENT ](perfEvent); }, 0); } else { listener[STR_PERF_EVENT ](perfEvent); } }); } } }; _self[_DYN_UNLOAD ] = function (isAsync) { var _finishUnload = function () { unloadHandler && unloadHandler.rm(); unloadHandler = null; _listeners = []; }; var waiting; _runListeners(_listeners, "unload", false, function (listener) { var asyncUnload = listener[_DYN_UNLOAD ](isAsync); if (asyncUnload) { if (!waiting) { waiting = []; } waiting[_DYN_PUSH$2 ](asyncUnload); } }); if (waiting) { return createPromise(function (resolve) { return doAwaitResponse(createAllPromise(waiting), function () { _finishUnload(); resolve(); }); }); } else { _finishUnload(); } }; }); } NotificationManager.__ieDyn=1; return NotificationManager; }()); var strExecutionContextKey = "ctx"; var strParentContextKey = "ParentContextKey"; var strChildrenContextKey = "ChildrenContextKey"; var _defaultPerfManager = null; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; _self.start = utcNow(); _self[_DYN_NAME$3 ] = name; _self[_DYN_IS_ASYNC ] = isAsync; _self[_DYN_IS_CHILD_EVT ] = function () { return false; }; if (isFunction(payloadDetails)) { var theDetails_1; objDefine(_self, "payload", { g: function () { if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); payloadDetails = null; } return theDetails_1; } }); } _self[_DYN_GET_CTX ] = function (key) { if (key) { if (key === PerfEvent[strParentContextKey] || key === PerfEvent[strChildrenContextKey]) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self[_DYN_SET_CTX ] = function (key, value) { if (key) { if (key === PerfEvent[strParentContextKey]) { if (!_self[key]) { _self[_DYN_IS_CHILD_EVT ] = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent[strChildrenContextKey]) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self[_DYN_COMPLETE ] = function () { var childTime = 0; var childEvts = _self[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts[_DYN_LENGTH$5 ]; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt[_DYN_TIME ]; } } } _self[_DYN_TIME ] = utcNow() - _self.start; _self.exTime = _self[_DYN_TIME ] - childTime; _self[_DYN_COMPLETE ] = function () { }; }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); var PerfManager = /** @class */ (function () { function PerfManager(manager) { this.ctx = {}; dynamicProto(PerfManager, this, function (_self) { _self.create = function (src, payloadDetails, isAsync) { return new PerfEvent(src, payloadDetails, isAsync); }; _self.fire = function (perfEvent) { if (perfEvent) { perfEvent[_DYN_COMPLETE ](); if (manager && isFunction(manager[STR_PERF_EVENT ])) { manager[STR_PERF_EVENT ](perfEvent); } } }; _self[_DYN_SET_CTX ] = function (key, value) { if (key) { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } }; _self[_DYN_GET_CTX ] = function (key) { return (_self[strExecutionContextKey] || {})[key]; }; }); } PerfManager.__ieDyn=1; return PerfManager; }()); var doPerfActiveKey = "CoreUtils.doPerf"; function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (perfMgr[STR_GET_PERF_MGR]) { perfMgr = perfMgr[STR_GET_PERF_MGR](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr[_DYN_GET_CTX ](doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt[_DYN_SET_CTX ]) { perfEvt[_DYN_SET_CTX ](PerfEvent[strParentContextKey], currentActive); if (currentActive[_DYN_GET_CTX ] && currentActive[_DYN_SET_CTX ]) { var children = currentActive[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]); if (!children) { children = []; currentActive[_DYN_SET_CTX ](PerfEvent[strChildrenContextKey], children); } children[_DYN_PUSH$2 ](perfEvt); } } perfMgr[_DYN_SET_CTX ](doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt[_DYN_SET_CTX ]) { perfEvt[_DYN_SET_CTX ]("exception", ex); } } finally { if (perfEvt) { perfMgr.fire(perfEvt); } perfMgr[_DYN_SET_CTX ](doPerfActiveKey, currentActive); } } } return func(); } function getGblPerfMgr() { return _defaultPerfManager; } function newGuid() { var uuid = generateW3CId(); return strSubstring(uuid, 0, 8) + "-" + strSubstring(uuid, 8, 12) + "-" + strSubstring(uuid, 12, 16) + "-" + strSubstring(uuid, 16, 20) + "-" + strSubstring(uuid, 20); } function generateW3CId() { var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; var oct = STR_EMPTY, tmp; for (var a = 0; a < 4; a++) { tmp = random32(); oct += hexValues[tmp & 0xF] + hexValues[tmp >> 4 & 0xF] + hexValues[tmp >> 8 & 0xF] + hexValues[tmp >> 12 & 0xF] + hexValues[tmp >> 16 & 0xF] + hexValues[tmp >> 20 & 0xF] + hexValues[tmp >> 24 & 0xF] + hexValues[tmp >> 28 & 0xF]; } var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0]; return strSubstr(oct, 0, 8) + strSubstr(oct, 9, 4) + "4" + strSubstr(oct, 13, 3) + clockSequenceHi + strSubstr(oct, 16, 3) + strSubstr(oct, 19, 12); } var TRACE_PARENT_REGEX = /^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})(-[^\s]{1,64})?$/i; var DEFAULT_VERSION = "00"; var INVALID_VERSION = "ff"; var INVALID_TRACE_ID = "00000000000000000000000000000000"; var INVALID_SPAN_ID = "0000000000000000"; function _isValid(value, len, invalidValue) { if (value && value[_DYN_LENGTH$5 ] === len && value !== invalidValue) { return !!value.match(/^[\da-f]*$/i); } return false; } function _formatValue(value, len, defValue) { if (_isValid(value, len)) { return value; } return defValue; } function _formatFlags(value) { if (isNaN(value) || value < 0 || value > 255) { value = 0x01; } var result = value.toString(16); while (result[_DYN_LENGTH$5 ] < 2) { result = "0" + result; } return result; } function createTraceParent(traceId, spanId, flags, version) { var _a; return _a = {}, _a[_DYN_VERSION$1 ] = _isValid(version, 2, INVALID_VERSION) ? version : DEFAULT_VERSION, _a[_DYN_TRACE_ID$2 ] = isValidTraceId(traceId) ? traceId : generateW3CId(), _a[_DYN_SPAN_ID$1 ] = isValidSpanId(spanId) ? spanId : strLeft(generateW3CId(), 16), _a.traceFlags = flags >= 0 && flags <= 0xFF ? flags : 1, _a; } function parseTraceParent(value, selectIdx) { var _a; if (!value) { return null; } if (isArray(value)) { value = value[0] || ""; } if (!value || !isString(value) || value[_DYN_LENGTH$5 ] > 8192) { return null; } if (value.indexOf(",") !== -1) { var values = value[_DYN_SPLIT$1 ](","); value = values[selectIdx > 0 && values[_DYN_LENGTH$5 ] > selectIdx ? selectIdx : 0]; } var match = TRACE_PARENT_REGEX.exec(strTrim(value)); if (!match || match[1] === INVALID_VERSION || match[2] === INVALID_TRACE_ID || match[3] === INVALID_SPAN_ID) { return null; } return _a = { version: (match[1] || STR_EMPTY)[_DYN_TO_LOWER_CASE$2 ](), traceId: (match[2] || STR_EMPTY)[_DYN_TO_LOWER_CASE$2 ](), spanId: (match[3] || STR_EMPTY)[_DYN_TO_LOWER_CASE$2 ]() }, _a[_DYN_TRACE_FLAGS$1 ] = parseInt(match[4], 16), _a; } function isValidTraceId(value) { return _isValid(value, 32, INVALID_TRACE_ID); } function isValidSpanId(value) { return _isValid(value, 16, INVALID_SPAN_ID); } function formatTraceParent(value) { if (value) { var flags = _formatFlags(value[_DYN_TRACE_FLAGS$1 ]); if (!_isValid(flags, 2)) { flags = "01"; } var version = value[_DYN_VERSION$1 ] || DEFAULT_VERSION; if (version !== "00" && version !== "ff") { version = DEFAULT_VERSION; } return "".concat(version.toLowerCase(), "-").concat(_formatValue(value.traceId, 32, INVALID_TRACE_ID).toLowerCase(), "-").concat(_formatValue(value.spanId, 16, INVALID_SPAN_ID).toLowerCase(), "-").concat(flags.toLowerCase()); } return ""; } function findW3cTraceParent(selectIdx) { var name = "traceparent"; var traceParent = parseTraceParent(findMetaTag(name), selectIdx); if (!traceParent) { traceParent = parseTraceParent(findNamedServerTiming(name), selectIdx); } return traceParent; } var pluginStateData = createElmNodeData("plugin"); function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } function initializePlugins(processContext, extensions) { var initPlugins = []; var lastPlugin = null; var proxy = processContext[_DYN_GET_NEXT ](); var pluginState; while (proxy) { var thePlugin = proxy[_DYN_GET_PLUGIN ](); if (thePlugin) { if (lastPlugin && lastPlugin[_DYN_SET_NEXT_PLUGIN ] && thePlugin[STR_PROCESS_TELEMETRY ]) { lastPlugin[_DYN_SET_NEXT_PLUGIN ](thePlugin); } pluginState = _getPluginState(thePlugin); var isInitialized = !!pluginState[_DYN_IS_INITIALIZED ]; if (thePlugin[_DYN_IS_INITIALIZED ]) { isInitialized = thePlugin[_DYN_IS_INITIALIZED ](); } if (!isInitialized) { initPlugins[_DYN_PUSH$2 ](thePlugin); } lastPlugin = thePlugin; proxy = proxy[_DYN_GET_NEXT ](); } } arrForEach(initPlugins, function (thePlugin) { var core = processContext[STR_CORE ](); thePlugin[_DYN_INITIALIZE ](processContext.getCfg(), core, extensions, processContext[_DYN_GET_NEXT ]()); pluginState = _getPluginState(thePlugin); if (!thePlugin[STR_CORE] && !pluginState[STR_CORE]) { pluginState[STR_CORE] = core; } pluginState[_DYN_IS_INITIALIZED ] = true; delete pluginState[_DYN_TEARDOWN ]; }); } function sortPlugins(plugins) { return plugins.sort(function (extA, extB) { var result = 0; if (extB) { var bHasProcess = extB[STR_PROCESS_TELEMETRY]; if (extA[STR_PROCESS_TELEMETRY]) { result = bHasProcess ? extA[STR_PRIORITY] - extB[STR_PRIORITY] : 1; } else if (bHasProcess) { result = -1; } } else { result = extA ? 1 : -1; } return result; }); } function createDistributedTraceContext(parentCtx) { var trace = {}; return { getName: function () { return trace[_DYN_NAME$3 ]; }, setName: function (newValue) { parentCtx && parentCtx.setName(newValue); trace[_DYN_NAME$3 ] = newValue; }, getTraceId: function () { return trace[_DYN_TRACE_ID$2 ]; }, setTraceId: function (newValue) { parentCtx && parentCtx.setTraceId(newValue); if (isValidTraceId(newValue)) { trace[_DYN_TRACE_ID$2 ] = newValue; } }, getSpanId: function () { return trace[_DYN_SPAN_ID$1 ]; }, setSpanId: function (newValue) { parentCtx && parentCtx.setSpanId(newValue); if (isValidSpanId(newValue)) { trace[_DYN_SPAN_ID$1 ] = newValue; } }, getTraceFlags: function () { return trace[_DYN_TRACE_FLAGS$1 ]; }, setTraceFlags: function (newTraceFlags) { parentCtx && parentCtx.setTraceFlags(newTraceFlags); trace[_DYN_TRACE_FLAGS$1 ] = newTraceFlags; } }; } var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy[_DYN_GET_PLUGIN ]() === startAt) { return proxy; } proxy = proxy[_DYN_GET_NEXT ](); } return createTelemetryProxyChain([startAt], core.config || {}, core); } function _createInternalContext(telemetryChain, dynamicHandler, core, startAt) { var _nextProxy = null; var _onComplete = []; if (!dynamicHandler) { dynamicHandler = createDynamicConfig({}, null, core[_DYN_LOGGER ]); } if (startAt !== null) { _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, dynamicHandler.cfg); }, getCfg: function () { return dynamicHandler.cfg; }, getExtCfg: _resolveExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete[_DYN_PUSH$2 ]({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; _nextProxy = nextProxy ? nextProxy[_DYN_GET_NEXT ]() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete[_DYN_LENGTH$5 ] > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func.call(completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core[_DYN_LOGGER ], 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, createIfMissing) { var idCfg = null; var cfg = dynamicHandler.cfg; if (cfg && identifier) { var extCfg = cfg[STR_EXTENSION_CONFIG ]; if (!extCfg && createIfMissing) { extCfg = {}; } cfg[STR_EXTENSION_CONFIG] = extCfg; extCfg = dynamicHandler.ref(cfg, STR_EXTENSION_CONFIG); if (extCfg) { idCfg = extCfg[identifier]; if (!idCfg && createIfMissing) { idCfg = {}; } extCfg[identifier] = idCfg; idCfg = dynamicHandler.ref(extCfg, identifier); } } return idCfg; } function _resolveExtCfg(identifier, defaultValues) { var newConfig = _getExtCfg(identifier, true); if (defaultValues) { objForEachKey(defaultValues, function (field, defaultValue) { if (isNullOrUndefined(newConfig[field])) { var cfgValue = dynamicHandler.cfg[field]; if (cfgValue || !isNullOrUndefined(cfgValue)) { newConfig[field] = cfgValue; } } _applyDefaultValue(dynamicHandler, newConfig, field, defaultValue); }); } return dynamicHandler[_DYN_SET_DF ](newConfig, defaultValues); } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, false); var rootConfig = dynamicHandler.cfg; if (extConfig && (extConfig[field] || !isNullOrUndefined(extConfig[field]))) { theValue = extConfig[field]; } else if (rootConfig[field] || !isNullOrUndefined(rootConfig[field])) { theValue = rootConfig[field]; } return (theValue || !isNullOrUndefined(theValue)) ? theValue : defaultValue; } function _iterateChain(cb) { var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin[_DYN_GET_PLUGIN ](); if (plugin) { cb(plugin); } } } return context; } function createProcessTelemetryContext(telemetryChain, cfg, core, startAt) { var config = createDynamicConfig(cfg); var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); if (nextPlugin) { nextPlugin[STR_PROCESS_TELEMETRY ](env, context); } return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt); } return createProcessTelemetryContext(plugins || context[_DYN_GET_NEXT ](), config.cfg, core, startAt); } context[_DYN_PROCESS_NEXT ] = _processNext; context[_DYN_CREATE_NEW$1 ] = _createNew; return context; } function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = createDynamicConfig(core.config); var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin[_DYN_UNLOAD ](context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context[_DYN_GET_NEXT ](), core, startAt); } context[_DYN_PROCESS_NEXT ] = _processNext; context[_DYN_CREATE_NEW$1 ] = _createNew; return context; } function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = createDynamicConfig(core.config); var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin[_DYN_UPDATE$1 ])) { plugin[_DYN_UPDATE$1 ](context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context[_DYN_GET_NEXT ](), core, startAt); } context[_DYN_PROCESS_NEXT ] = _processNext; context[_DYN_CREATE_NEW$1 ] = _createNew; return context; } function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins[_DYN_LENGTH$5 ] > 0) { var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin[STR_PROCESS_TELEMETRY ])) { var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin[STR_PROCESS_TELEMETRY ]); var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN ]); var chainId; if (plugin) { chainId = plugin[_DYN_IDENTIFIER ] + "-" + plugin[STR_PRIORITY ] + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; if (plugin && isFunction(plugin[strGetTelCtx])) { itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin[_DYN_IDENTIFIER ] : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { hasRunContext = itemCtx[strHasRunFlags] = {}; } itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[STR_CORE ](), function () { return identifier + ":" + name; }, function () { hasRunContext[chainId] = true; try { var nextId = nextProxy ? nextProxy._id : STR_EMPTY; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { hasRun = true; } if (!nextProxy || !hasNextRun) { _throwInternal(itemCtx[_DYN_DIAG_LOG$2 ](), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState[_DYN_TEARDOWN ] || pluginState[STR_DISABLED]) { return false; } if (hasSetNext) { plugin[_DYN_SET_NEXT_PLUGIN ](nextProxy); } plugin[STR_PROCESS_TELEMETRY ](env, itemCtx); return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { itemCtx[_DYN_PROCESS_NEXT ](env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE ]; if (plugin && (!pluginCore || pluginCore === unloadCtx.core()) && !pluginState[_DYN_TEARDOWN ]) { pluginState[STR_CORE ] = null; pluginState[_DYN_TEARDOWN ] = true; pluginState[_DYN_IS_INITIALIZED ] = false; if (plugin[_DYN_TEARDOWN ] && plugin[_DYN_TEARDOWN ](unloadCtx, unloadState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState[_DYN_IS_ASYNC ])) { unloadCtx[_DYN_PROCESS_NEXT ](unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE ]; if (plugin && (!pluginCore || pluginCore === updateCtx.core()) && !pluginState[_DYN_TEARDOWN ]) { if (plugin[_DYN_UPDATE$1 ] && plugin[_DYN_UPDATE$1 ](updateCtx, updateState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { updateCtx[_DYN_PROCESS_NEXT ](updateState); } } return objFreeze(proxyChain); } function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers[_DYN_PUSH$2 ](handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx[_DYN_DIAG_LOG$2 ](), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } function createUnloadHookContainer() { var _hooks = []; function _doUnload(logger) { var oldHooks = _hooks; _hooks = []; arrForEach(oldHooks, function (fn) { try { (fn.rm || fn.remove).call(fn); } catch (e) { _throwInternal(logger, 2 , 73 , "Unloading:" + dumpObj(e)); } }); } function _addHook(hooks) { if (hooks) { arrAppend(_hooks, hooks); } } return { run: _doUnload, add: _addHook }; } var _a$7; var strGetPlugin = "getPlugin"; var defaultValues$1 = (_a$7 = {}, _a$7[STR_EXTENSION_CONFIG] = { isVal: isNotNullOrUndefined, v: {} }, _a$7); var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; var _isinitialized; var _rootCtx; var _nextPlugin; var _unloadHandlerContainer; var _hookContainer; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self[_DYN_INITIALIZE ] = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self[_DYN_TEARDOWN ] = function (unloadCtx, unloadState) { var _a; var core = _self[STR_CORE ]; if (!core || (unloadCtx && core !== unloadCtx[STR_CORE ]())) { return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || (_a = { reason: 0 }, _a[_DYN_IS_ASYNC ] = false, _a); function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); _hookContainer.run(theUnloadCtx[_DYN_DIAG_LOG$2 ]()); if (result === true) { theUnloadCtx[_DYN_PROCESS_NEXT ](theUnloadState); } _initDefaults(); } } if (!_self[_DYN__DO_TEARDOWN ] || _self[_DYN__DO_TEARDOWN ](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { result = true; } return result; }; _self[_DYN_UPDATE$1 ] = function (updateCtx, updateState) { var core = _self[STR_CORE ]; if (!core || (updateCtx && core !== updateCtx[STR_CORE ]())) { return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx[_DYN_GET_NEXT ]()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); proxyFunctionAs(_self, "_addHook", function () { return _hookContainer; }, "add"); objDefine(_self, "_unloadHooks", { g: function () { return _hookContainer; } }); }); _self[_DYN_DIAG_LOG$2 ] = function (itemCtx) { return _getTelCtx(itemCtx)[_DYN_DIAG_LOG$2 ](); }; _self[_DYN_IS_INITIALIZED ] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; _self[_DYN_SET_NEXT_PLUGIN ] = function (next) { _nextPlugin = next; }; _self[_DYN_PROCESS_NEXT ] = function (env, itemCtx) { if (itemCtx) { itemCtx[_DYN_PROCESS_NEXT ](env); } else if (_nextPlugin && isFunction(_nextPlugin[STR_PROCESS_TELEMETRY ])) { _nextPlugin[STR_PROCESS_TELEMETRY ](env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self[STR_CORE ]); if (_nextPlugin && _nextPlugin[strGetPlugin]) { itemCtx = rootCtx[_DYN_CREATE_NEW$1 ](null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx[_DYN_CREATE_NEW$1 ](null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { createDynamicConfig(config, defaultValues$1, safeGetLogger(core)); if (!pluginChain && core) { pluginChain = core[_DYN_GET_PROCESS_TEL_CONT0 ]()[_DYN_GET_NEXT ](); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { nextPlugin = _nextPlugin[strGetPlugin](); } _self[STR_CORE ] = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self[STR_CORE ] = null; _rootCtx = null; _nextPlugin = null; _hookContainer = createUnloadHookContainer(); _unloadHandlerContainer = createUnloadHandlerContainer(); } } BaseTelemetryPlugin.__ieDyn=1; return BaseTelemetryPlugin; }()); function _addInitializer(_initializers, id, telemetryInitializer) { var theInitializer = { id: id, fn: telemetryInitializer }; arrAppend(_initializers, theInitializer); var handler = { remove: function () { arrForEach(_initializers, function (initializer, idx) { if (initializer.id === theInitializer.id) { _initializers[_DYN_SPLICE ](idx, 1); return -1; } }); } }; return handler; } function _runInitializers(_initializers, item, logger) { var doNotSendItem = false; var telemetryInitializersCount = _initializers[_DYN_LENGTH$5 ]; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = _initializers[i]; if (telemetryInitializer) { try { if (telemetryInitializer.fn[_DYN_APPLY ](null, [item]) === false) { doNotSendItem = true; break; } } catch (e) { _throwInternal(logger, 2 , 64 , "Telemetry initializer failed: " + getExceptionName(e), { exception: dumpObj(e) }, true); } } } return !doNotSendItem; } var TelemetryInitializerPlugin = /** @class */ (function (_super) { __extendsFn(TelemetryInitializerPlugin, _super); function TelemetryInitializerPlugin() { var _this = _super.call(this) || this; _this.identifier = "TelemetryInitializerPlugin"; _this.priority = 199; var _id; var _initializers; _initDefaults(); dynamicProto(TelemetryInitializerPlugin, _this, function (_self, _base) { _self.addTelemetryInitializer = function (telemetryInitializer) { return _addInitializer(_initializers, _id++, telemetryInitializer); }; _self[STR_PROCESS_TELEMETRY ] = function (item, itemCtx) { if (_runInitializers(_initializers, item, itemCtx ? itemCtx[_DYN_DIAG_LOG$2 ]() : _self[_DYN_DIAG_LOG$2 ]())) { _self[_DYN_PROCESS_NEXT ](item, itemCtx); } }; _self[_DYN__DO_TEARDOWN ] = function () { _initDefaults(); }; }); function _initDefaults() { _id = 0; _initializers = []; } return _this; } TelemetryInitializerPlugin.__ieDyn=1; return TelemetryInitializerPlugin; }(BaseTelemetryPlugin)); var _a$6; var strValidationError = "Plugins must provide initialize method"; var strNotificationManager = "_notificationManager"; var strSdkUnloadingError = "SDK is still unloading..."; var strSdkNotInitialized = "SDK is not initialized"; var defaultConfig = objDeepFreeze((_a$6 = { cookieCfg: {} }, _a$6[STR_EXTENSIONS] = { rdOnly: true, ref: true, v: [] }, _a$6[STR_CHANNELS] = { rdOnly: true, ref: true, v: [] }, _a$6[STR_EXTENSION_CONFIG] = { ref: true, v: {} }, _a$6[STR_CREATE_PERF_MGR] = UNDEFINED_VALUE$2, _a$6.loggingLevelConsole = 0 , _a$6.diagnosticLogInterval = UNDEFINED_VALUE$2, _a$6)); function _createPerfManager(core, notificationMgr) { return new PerfManager(notificationMgr); } function _validateExtensions(logger, channelPriority, allExtensions) { var _a; var coreExtensions = []; var channels = []; var extPriorities = {}; arrForEach(allExtensions, function (ext) { if (isNullOrUndefined(ext) || isNullOrUndefined(ext[_DYN_INITIALIZE ])) { throwError(strValidationError); } var extPriority = ext[STR_PRIORITY ]; var identifier = ext[_DYN_IDENTIFIER ]; if (ext && extPriority) { if (!isNullOrUndefined(extPriorities[extPriority])) { _warnToConsole(logger, "Two extensions have same priority #" + extPriority + " - " + extPriorities[extPriority] + ", " + identifier); } else { extPriorities[extPriority] = identifier; } } if (!extPriority || extPriority < channelPriority) { coreExtensions[_DYN_PUSH$2 ](ext); } else { channels[_DYN_PUSH$2 ](ext); } }); return _a = {}, _a[STR_CORE ] = coreExtensions, _a[STR_CHANNELS ] = channels, _a; } function _isPluginPresent(thePlugin, plugins) { var exists = false; arrForEach(plugins, function (plugin) { if (plugin === thePlugin) { exists = true; return -1; } }); return exists; } function _deepMergeConfig(details, target, newValues, merge) { if (newValues) { objForEachKey(newValues, function (key, value) { if (merge) { if (isPlainObject(value) && isPlainObject(target[key])) { _deepMergeConfig(details, target[key], value, merge); } } if (merge && isPlainObject(value) && isPlainObject(target[key])) { _deepMergeConfig(details, target[key], value, merge); } else { details.set(target, key, value); } }); } } function _findWatcher(listeners, newWatcher) { var theListener = null; var idx = -1; arrForEach(listeners, function (listener, lp) { if (listener.w === newWatcher) { theListener = listener; idx = lp; return -1; } }); return { i: idx, l: theListener }; } function _addDelayedCfgListener(listeners, newWatcher) { var theListener = _findWatcher(listeners, newWatcher).l; if (!theListener) { theListener = { w: newWatcher, rm: function () { var fnd = _findWatcher(listeners, newWatcher); if (fnd.i !== -1) { listeners[_DYN_SPLICE ](fnd.i, 1); } } }; listeners[_DYN_PUSH$2 ](theListener); } return theListener; } function _registerDelayedCfgListener(config, listeners, logger) { arrForEach(listeners, function (listener) { var unloadHdl = onConfigChange(config, listener.w, logger); delete listener.w; listener.rm = function () { unloadHdl.rm(); }; }); } var AppInsightsCore = /** @class */ (function () { function AppInsightsCore() { var _configHandler; var _isInitialized; var _logger; var _eventQueue; var _notificationManager; var _perfManager; var _cfgPerfManager; var _cookieManager; var _pluginChain; var _configExtensions; var _channelConfig; var _channels; var _isUnloading; var _telemetryInitializerPlugin; var _internalLogsEventName; var _evtNamespace; var _unloadHandlers; var _hookContainer; var _debugListener; var _traceCtx; var _instrumentationKey; var _cfgListeners; var _extensions; var _pluginVersionStringArr; var _pluginVersionString; var _internalLogPoller; var _internalLogPollerListening; var _forceStopInternalLogPoller; dynamicProto(AppInsightsCore, this, function (_self) { _initDefaults(); _self["_getDbgPlgTargets"] = function () { return [_extensions]; }; _self[_DYN_IS_INITIALIZED ] = function () { return _isInitialized; }; _self[_DYN_INITIALIZE ] = function (config, extensions, logger, notificationManager) { if (_isUnloading) { throwError(strSdkUnloadingError); } if (_self[_DYN_IS_INITIALIZED ]()) { throwError("Core cannot be initialized more than once"); } _configHandler = createDynamicConfig(config, defaultConfig, logger || _self[_DYN_LOGGER ], false); config = _configHandler.cfg; _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) { _instrumentationKey = details.cfg.instrumentationKey; var extCfg = details.ref(details.cfg, STR_EXTENSION_CONFIG); objForEachKey(extCfg, function (key) { details.ref(extCfg, key); }); if (isNullOrUndefined(_instrumentationKey)) { throwError("Please provide instrumentation key"); } })); _notificationManager = notificationManager; _initDebugListener(); _initPerfManager(); _self[_DYN_LOGGER ] = logger; var cfgExtensions = config[STR_EXTENSIONS ]; _configExtensions = []; _configExtensions[_DYN_PUSH$2 ].apply(_configExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), cfgExtensions)); _channelConfig = config[STR_CHANNELS ]; _initPluginChain(null); if (!_channels || _channels[_DYN_LENGTH$5 ] === 0) { throwError("No " + STR_CHANNELS + " available"); } if (_channelConfig && _channelConfig[_DYN_LENGTH$5 ] > 1) { var teeController = _self[_DYN_GET_PLUGIN ]("TeeChannelController"); if (!teeController || !teeController.plugin) { _throwInternal(_logger, 1 , 28 , "TeeChannel required"); } } _registerDelayedCfgListener(config, _cfgListeners, _logger); _cfgListeners = null; _isInitialized = true; _self.releaseQueue(); _self[_DYN_POLL_INTERNAL_LOGS ](); }; _self.getChannels = function () { var controls = []; if (_channels) { arrForEach(_channels, function (channel) { controls[_DYN_PUSH$2 ](channel); }); } return objFreeze(controls); }; _self.track = function (telemetryItem) { doPerf(_self[STR_GET_PERF_MGR ](), function () { return "AppInsightsCore:track"; }, function () { if (telemetryItem === null) { _notifyInvalidEvent(telemetryItem); throwError("Invalid telemetry item"); } if (!telemetryItem[_DYN_NAME$3 ] && isNullOrUndefined(telemetryItem[_DYN_NAME$3 ])) { _notifyInvalidEvent(telemetryItem); throwError("telemetry name required"); } telemetryItem.iKey = telemetryItem.iKey || _instrumentationKey; telemetryItem[_DYN_TIME ] = telemetryItem[_DYN_TIME ] || toISOString(new Date()); telemetryItem.ver = telemetryItem.ver || "4.0"; if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]()) { _createTelCtx()[_DYN_PROCESS_NEXT ](telemetryItem); } else { _eventQueue[_DYN_PUSH$2 ](telemetryItem); } }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync)); }; _self[_DYN_GET_PROCESS_TEL_CONT0 ] = _createTelCtx; _self[_DYN_GET_NOTIFY_MGR ] = function () { if (!_notificationManager) { _notificationManager = new NotificationManager(_configHandler.cfg); _self[strNotificationManager] = _notificationManager; } return _notificationManager; }; _self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) { _self[_DYN_GET_NOTIFY_MGR ]()[_DYN_ADD_NOTIFICATION_LIS1 ](listener); }; _self[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) { if (_notificationManager) { _notificationManager[_DYN_REMOVE_NOTIFICATION_2 ](listener); } }; _self.getCookieMgr = function () { if (!_cookieManager) { _cookieManager = createCookieMgr(_configHandler.cfg, _self[_DYN_LOGGER ]); } return _cookieManager; }; _self.setCookieMgr = function (cookieMgr) { if (_cookieManager !== cookieMgr) { runTargetUnload(_cookieManager, false); _cookieManager = cookieMgr; } }; _self[STR_GET_PERF_MGR ] = function () { if (!_perfManager && !_cfgPerfManager) { _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) { if (details.cfg.enablePerfMgr) { var createPerfMgr = details.cfg[STR_CREATE_PERF_MGR ]; if (isFunction(createPerfMgr)) { _cfgPerfManager = createPerfMgr(_self, _self[_DYN_GET_NOTIFY_MGR ]()); } } })); } return _perfManager || _cfgPerfManager || getGblPerfMgr(); }; _self.setPerfMgr = function (perfMgr) { _perfManager = perfMgr; }; _self.eventCnt = function () { return _eventQueue[_DYN_LENGTH$5 ]; }; _self.releaseQueue = function () { if (_isInitialized && _eventQueue[_DYN_LENGTH$5 ] > 0) { var eventQueue = _eventQueue; _eventQueue = []; arrForEach(eventQueue, function (event) { _createTelCtx()[_DYN_PROCESS_NEXT ](event); }); } }; _self[_DYN_POLL_INTERNAL_LOGS ] = function (eventName) { _internalLogsEventName = eventName || null; _forceStopInternalLogPoller = false; _internalLogPoller && _internalLogPoller[_DYN_CANCEL ](); return _startLogPoller(true); }; function _startLogPoller(alwaysStart) { if ((!_internalLogPoller || !_internalLogPoller[_DYN_ENABLED ]) && !_forceStopInternalLogPoller) { var shouldStart = alwaysStart || (_logger && _logger.queue[_DYN_LENGTH$5 ] > 0); if (shouldStart) { if (!_internalLogPollerListening) { _internalLogPollerListening = true; _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) { var interval = details.cfg.diagnosticLogInterval; if (!interval || !(interval > 0)) { interval = 10000; } var isRunning = false; if (_internalLogPoller) { isRunning = _internalLogPoller[_DYN_ENABLED ]; _internalLogPoller[_DYN_CANCEL ](); } _internalLogPoller = createTimeout(_flushInternalLogs, interval); _internalLogPoller.unref(); _internalLogPoller[_DYN_ENABLED ] = isRunning; })); } _internalLogPoller[_DYN_ENABLED ] = true; } } return _internalLogPoller; } _self[_DYN_STOP_POLLING_INTERNA3 ] = function () { _forceStopInternalLogPoller = true; _internalLogPoller && _internalLogPoller[_DYN_CANCEL ](); _flushInternalLogs(); }; proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, ["addTelemetryInitializer"]); _self[_DYN_UNLOAD ] = function (isAsync, unloadComplete, cbTimeout) { var _a; if (isAsync === void 0) { isAsync = true; } if (!_isInitialized) { throwError(strSdkNotInitialized); } if (_isUnloading) { throwError(strSdkUnloadingError); } var unloadState = (_a = { reason: 50 }, _a[_DYN_IS_ASYNC ] = isAsync, _a.flushComplete = false, _a); var result; if (isAsync && !unloadComplete) { result = createPromise(function (resolve) { unloadComplete = resolve; }); } var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self); processUnloadCtx[_DYN_ON_COMPLETE ](function () { _hookContainer.run(_self[_DYN_LOGGER ]); doUnloadAll([_cookieManager, _notificationManager, _logger], isAsync, function () { _initDefaults(); unloadComplete && unloadComplete(unloadState); }); }, _self); function _doUnload(flushComplete) { unloadState.flushComplete = flushComplete; _isUnloading = true; _unloadHandlers.run(processUnloadCtx, unloadState); _self[_DYN_STOP_POLLING_INTERNA3 ](); processUnloadCtx[_DYN_PROCESS_NEXT ](unloadState); } _flushInternalLogs(); if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) ; return result; }; _self[_DYN_GET_PLUGIN ] = _getPlugin; _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) { if (!plugin) { addCb && addCb(false); _logOrThrowError(strValidationError); return; } var existingPlugin = _getPlugin(plugin[_DYN_IDENTIFIER ]); if (existingPlugin && !replaceExisting) { addCb && addCb(false); _logOrThrowError("Plugin [" + plugin[_DYN_IDENTIFIER ] + "] is already loaded!"); return; } var updateState = { reason: 16 }; function _addPlugin(removed) { _configExtensions[_DYN_PUSH$2 ](plugin); updateState.added = [plugin]; _initPluginChain(updateState); addCb && addCb(true); } if (existingPlugin) { var removedPlugins_1 = [existingPlugin.plugin]; var unloadState = { reason: 2 , isAsync: !!isAsync }; _removePlugins(removedPlugins_1, unloadState, function (removed) { if (!removed) { addCb && addCb(false); } else { updateState.removed = removedPlugins_1; updateState.reason |= 32 ; _addPlugin(); } }); } else { _addPlugin(); } }; _self.updateCfg = function (newConfig, mergeExisting) { if (mergeExisting === void 0) { mergeExisting = true; } var updateState; if (_self[_DYN_IS_INITIALIZED ]()) { updateState = { reason: 1 , cfg: _configHandler.cfg, oldCfg: deepExtend({}, _configHandler.cfg), newConfig: deepExtend({}, newConfig), merge: mergeExisting }; newConfig = updateState.newConfig; var cfg = _configHandler.cfg; newConfig[STR_EXTENSIONS ] = cfg[STR_EXTENSIONS ]; newConfig[STR_CHANNELS ] = cfg[STR_CHANNELS ]; } _configHandler._block(function (details) { var theConfig = details.cfg; _deepMergeConfig(details, theConfig, newConfig, mergeExisting); if (!mergeExisting) { objForEachKey(theConfig, function (key) { if (!objHasOwn(newConfig, key)) { details.set(theConfig, key, UNDEFINED_VALUE$2); } }); } details[_DYN_SET_DF ](theConfig, defaultConfig); }, true); _configHandler[_DYN_NOTIFY ](); if (updateState) { _doUpdate(updateState); } }; _self.evtNamespace = function () { return _evtNamespace; }; _self.flush = _flushChannels; _self.getTraceCtx = function (createNew) { if (!_traceCtx) { _traceCtx = createDistributedTraceContext(); } return _traceCtx; }; _self.setTraceCtx = function (traceCtx) { _traceCtx = traceCtx || null; }; _self.addUnloadHook = _addUnloadHook; proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add"); _self.onCfgChange = function (handler) { var unloadHook; if (!_isInitialized) { unloadHook = _addDelayedCfgListener(_cfgListeners, handler); } else { unloadHook = onConfigChange(_configHandler.cfg, handler, _self[_DYN_LOGGER ]); } return { rm: function () { unloadHook.rm(); } }; }; _self.getWParam = function () { return (hasDocument() || !!_configHandler.cfg.enableWParam) ? 0 : -1; }; function _setPluginVersions() { var thePlugins = {}; _pluginVersionStringArr = []; var _addPluginVersions = function (plugins) { if (plugins) { arrForEach(plugins, function (plugin) { if (plugin[_DYN_IDENTIFIER ] && plugin[_DYN_VERSION$1 ] && !thePlugins[plugin.identifier]) { var ver = plugin[_DYN_IDENTIFIER ] + "=" + plugin[_DYN_VERSION$1 ]; _pluginVersionStringArr[_DYN_PUSH$2 ](ver); thePlugins[plugin.identifier] = plugin; } }); } }; _addPluginVersions(_channels); if (_channelConfig) { arrForEach(_channelConfig, function (channels) { _addPluginVersions(channels); }); } _addPluginVersions(_configExtensions); } function _initDefaults() { _isInitialized = false; _configHandler = createDynamicConfig({}, defaultConfig, _self[_DYN_LOGGER ]); _configHandler.cfg[_DYN_LOGGING_LEVEL_CONSOL4 ] = 1 ; objDefine(_self, "config", { g: function () { return _configHandler.cfg; }, s: function (newValue) { _self.updateCfg(newValue, false); } }); objDefine(_self, "pluginVersionStringArr", { g: function () { if (!_pluginVersionStringArr) { _setPluginVersions(); } return _pluginVersionStringArr; } }); objDefine(_self, "pluginVersionString", { g: function () { if (!_pluginVersionString) { if (!_pluginVersionStringArr) { _setPluginVersions(); } _pluginVersionString = _pluginVersionStringArr.join(";"); } return _pluginVersionString || STR_EMPTY; } }); objDefine(_self, "logger", { g: function () { if (!_logger) { _logger = new DiagnosticLogger(_configHandler.cfg); _configHandler[_DYN_LOGGER ] = _logger; } return _logger; }, s: function (newLogger) { _configHandler[_DYN_LOGGER ] = newLogger; if (_logger !== newLogger) { runTargetUnload(_logger, false); _logger = newLogger; } } }); _self[_DYN_LOGGER ] = new DiagnosticLogger(_configHandler.cfg); _extensions = []; var cfgExtensions = _self.config[STR_EXTENSIONS ] || []; cfgExtensions.splice(0, cfgExtensions[_DYN_LENGTH$5 ]); arrAppend(cfgExtensions, _extensions); _telemetryInitializerPlugin = new TelemetryInitializerPlugin(); _eventQueue = []; runTargetUnload(_notificationManager, false); _notificationManager = null; _perfManager = null; _cfgPerfManager = null; runTargetUnload(_cookieManager, false); _cookieManager = null; _pluginChain = null; _configExtensions = []; _channelConfig = null; _channels = null; _isUnloading = false; _internalLogsEventName = null; _evtNamespace = createUniqueNamespace("AIBaseCore", true); _unloadHandlers = createUnloadHandlerContainer(); _traceCtx = null; _instrumentationKey = null; _hookContainer = createUnloadHookContainer(); _cfgListeners = []; _pluginVersionString = null; _pluginVersionStringArr = null; _forceStopInternalLogPoller = false; } function _createTelCtx() { var theCtx = createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self); theCtx[_DYN_ON_COMPLETE ](_startLogPoller); return theCtx; } function _initPluginChain(updateState) { var theExtensions = _validateExtensions(_self[_DYN_LOGGER ], ChannelControllerPriority, _configExtensions); _pluginChain = null; _pluginVersionString = null; _pluginVersionStringArr = null; _channels = (_channelConfig || [])[0] || []; _channels = sortPlugins(arrAppend(_channels, theExtensions[STR_CHANNELS ])); var allExtensions = arrAppend(sortPlugins(theExtensions[STR_CORE ]), _channels); _extensions = objFreeze(allExtensions); var cfgExtensions = _self.config[STR_EXTENSIONS ] || []; cfgExtensions.splice(0, cfgExtensions[_DYN_LENGTH$5 ]); arrAppend(cfgExtensions, _extensions); var rootCtx = _createTelCtx(); if (_channels && _channels[_DYN_LENGTH$5 ] > 0) { initializePlugins(rootCtx[_DYN_CREATE_NEW$1 ](_channels), allExtensions); } initializePlugins(rootCtx, allExtensions); if (updateState) { _doUpdate(updateState); } } function _getPlugin(pluginIdentifier) { var theExt = null; var thePlugin = null; var channelHosts = []; arrForEach(_extensions, function (ext) { if (ext[_DYN_IDENTIFIER ] === pluginIdentifier && ext !== _telemetryInitializerPlugin) { thePlugin = ext; return -1; } if (ext.getChannel) { channelHosts[_DYN_PUSH$2 ](ext); } }); if (!thePlugin && channelHosts[_DYN_LENGTH$5 ] > 0) { arrForEach(channelHosts, function (host) { thePlugin = host.getChannel(pluginIdentifier); if (!thePlugin) { return -1; } }); } if (thePlugin) { theExt = { plugin: thePlugin, setEnabled: function (enabled) { _getPluginState(thePlugin)[STR_DISABLED] = !enabled; }, isEnabled: function () { var pluginState = _getPluginState(thePlugin); return !pluginState[_DYN_TEARDOWN ] && !pluginState[STR_DISABLED]; }, remove: function (isAsync, removeCb) { var _a; if (isAsync === void 0) { isAsync = true; } var pluginsToRemove = [thePlugin]; var unloadState = (_a = { reason: 1 }, _a[_DYN_IS_ASYNC ] = isAsync, _a); _removePlugins(pluginsToRemove, unloadState, function (removed) { if (removed) { _initPluginChain({ reason: 32 , removed: pluginsToRemove }); } removeCb && removeCb(removed); }); } }; } return theExt; } function _getPluginChain() { if (!_pluginChain) { var extensions = (_extensions || []).slice(); if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) { extensions[_DYN_PUSH$2 ](_telemetryInitializerPlugin); } _pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _configHandler.cfg, _self); } return _pluginChain; } function _removePlugins(thePlugins, unloadState, removeComplete) { if (thePlugins && thePlugins[_DYN_LENGTH$5 ] > 0) { var unloadChain = createTelemetryProxyChain(thePlugins, _configHandler.cfg, _self); var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self); unloadCtx[_DYN_ON_COMPLETE ](function () { var removed = false; var newConfigExtensions = []; arrForEach(_configExtensions, function (plugin, idx) { if (!_isPluginPresent(plugin, thePlugins)) { newConfigExtensions[_DYN_PUSH$2 ](plugin); } else { removed = true; } }); _configExtensions = newConfigExtensions; _pluginVersionString = null; _pluginVersionStringArr = null; var newChannelConfig = []; if (_channelConfig) { arrForEach(_channelConfig, function (queue, idx) { var newQueue = []; arrForEach(queue, function (channel) { if (!_isPluginPresent(channel, thePlugins)) { newQueue[_DYN_PUSH$2 ](channel); } else { removed = true; } }); newChannelConfig[_DYN_PUSH$2 ](newQueue); }); _channelConfig = newChannelConfig; } removeComplete && removeComplete(removed); _startLogPoller(); }); unloadCtx[_DYN_PROCESS_NEXT ](unloadState); } else { removeComplete(false); } } function _flushInternalLogs() { if (_logger && _logger.queue) { var queue = _logger.queue.slice(0); _logger.queue[_DYN_LENGTH$5 ] = 0; arrForEach(queue, function (logMessage) { var _a; var item = (_a = {}, _a[_DYN_NAME$3 ] = _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage[_DYN_MESSAGE_ID ], _a.iKey = _instrumentationKey, _a[_DYN_TIME ] = toISOString(new Date()), _a.baseType = _InternalLogMessage.dataType, _a.baseData = { message: logMessage[_DYN_MESSAGE$2 ] }, _a); _self.track(item); }); } } function _flushChannels(isAsync, callBack, sendReason, cbTimeout) { var waiting = 1; var doneIterating = false; var cbTimer = null; cbTimeout = cbTimeout || 5000; function doCallback() { waiting--; if (doneIterating && waiting === 0) { cbTimer && cbTimer[_DYN_CANCEL ](); cbTimer = null; callBack && callBack(doneIterating); callBack = null; } } if (_channels && _channels[_DYN_LENGTH$5 ] > 0) { var flushCtx = _createTelCtx()[_DYN_CREATE_NEW$1 ](_channels); flushCtx.iterate(function (plugin) { if (plugin.flush) { waiting++; var handled_1 = false; if (!plugin.flush(isAsync, function () { handled_1 = true; doCallback(); }, sendReason)) { if (!handled_1) { if (isAsync && cbTimer == null) { cbTimer = scheduleTimeout(function () { cbTimer = null; doCallback(); }, cbTimeout); } else { doCallback(); } } } } }); } doneIterating = true; doCallback(); return true; } function _initDebugListener() { !_notificationManager && _self[_DYN_GET_NOTIFY_MGR ](); _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) { var disableDbgExt = details.cfg.disableDbgExt; if (disableDbgExt === true && _debugListener) { _notificationManager[_DYN_REMOVE_NOTIFICATION_2 ](_debugListener); _debugListener = null; } if (_notificationManager && !_debugListener && disableDbgExt !== true) { _debugListener = getDebugListener(details.cfg); _notificationManager[_DYN_ADD_NOTIFICATION_LIS1 ](_debugListener); } })); } function _initPerfManager() { _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) { var enablePerfMgr = details.cfg.enablePerfMgr; if (!enablePerfMgr && _cfgPerfManager) { _cfgPerfManager = null; } if (enablePerfMgr) { getSetValue(details.cfg, STR_CREATE_PERF_MGR, _createPerfManager); } })); } function _doUpdate(updateState) { var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self); updateCtx[_DYN_ON_COMPLETE ](_startLogPoller); if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) { updateCtx[_DYN_PROCESS_NEXT ](updateState); } } function _logOrThrowError(message) { var logger = _self[_DYN_LOGGER ]; if (logger) { _throwInternal(logger, 2 , 73 , message); _startLogPoller(); } else { throwError(message); } } function _notifyInvalidEvent(telemetryItem) { var manager = _self[_DYN_GET_NOTIFY_MGR ](); if (manager) { manager[STR_EVENTS_DISCARDED ]([telemetryItem], 2 ); } } function _addUnloadHook(hooks) { _hookContainer.add(hooks); } }); } AppInsightsCore.__ieDyn=1; return AppInsightsCore; }()); var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name[_DYN_REPLACE ]) { return name[_DYN_REPLACE ](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g, STR_EMPTY); } return name; } function _getEvtNamespace(eventName, evtNamespace) { var _a; if (evtNamespace) { var theNamespace_1 = STR_EMPTY; if (isArray(evtNamespace)) { theNamespace_1 = STR_EMPTY; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } eventName = (eventName || STR_EMPTY) + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY) || []); return _a = {}, _a[_DYN_TYPE ] = parsedEvent[1], _a.ns = ((parsedEvent[2] || STR_EMPTY).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY)[_DYN_SPLIT$1 ](".").sort()).join("."), _a; } function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName[_DYN_TYPE ]) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName[_DYN_TYPE ], handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName[_DYN_TYPE ] && handlerRef) { if (obj[strAddEventHelper]) { obj[strAddEventHelper](evtName[_DYN_TYPE ], handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { obj[strAttachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events[_DYN_LENGTH$5 ]; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent[_DYN_HANDLER ], theEvent.capture); events[_DYN_SPLICE ](idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName[_DYN_TYPE ]) { _doUnregister(target, _getRegisteredEvents(target, evtName[_DYN_TYPE ]), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); if (objKeys(eventCache)[_DYN_LENGTH$5 ] === 0) { elmNodeData.kill(target, strEvents); } } } function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns)[_DYN_SPLIT$1 ]("."); } else { newNamespaces = theNamespace; } return newNamespaces; } function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { var _a; if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = (_a = { guid: _guid++, evtName: evtName }, _a[_DYN_HANDLER ] = handlerRef, _a.capture = useCapture, _a); _getRegisteredEvents(target, evtName.type)[_DYN_PUSH$2 ](registeredEvent); } } catch (e) { } } return result; } function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent[_DYN_HANDLER ] === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { } } } function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events[_DYN_LENGTH$5 ] > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents[_DYN_LENGTH$5 ] > 0) { added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } function removePageHideEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } var LoggingSeverity = createEnumStyle({ DISABLED: 0 , CRITICAL: 1 , WARNING: 2 , DEBUG: 3 }); var aiInstrumentHooks = "_aiHooks"; var cbNames = [ "req", "rsp", "hkErr", "fnErr" ]; function _arrLoop(arr, fn) { if (arr) { for (var lp = 0; lp < arr[_DYN_LENGTH$5 ]; lp++) { if (fn(arr[lp], lp)) { break; } } } } function _doCallbacks(hooks, callDetails, cbArgs, hookCtx, type) { if (type >= 0 && type <= 2 ) { _arrLoop(hooks, function (hook, idx) { var cbks = hook.cbks; var cb = cbks[cbNames[type]]; if (cb) { callDetails.ctx = function () { var ctx = hookCtx[idx] = (hookCtx[idx] || {}); return ctx; }; try { cb[_DYN_APPLY ](callDetails.inst, cbArgs); } catch (err) { var orgEx = callDetails.err; try { var hookErrorCb = cbks[cbNames[2 ]]; if (hookErrorCb) { callDetails.err = err; hookErrorCb[_DYN_APPLY ](callDetails.inst, cbArgs); } } catch (e) { } finally { callDetails.err = orgEx; } } } }); } } function _createFunctionHook(aiHook) { return function () { var _a; var funcThis = this; var orgArgs = arguments; var hooks = aiHook.h; var funcArgs = (_a = {}, _a[_DYN_NAME$3 ] = aiHook.n, _a.inst = funcThis, _a.ctx = null, _a.set = _replaceArg, _a); var hookCtx = []; var cbArgs = _createArgs([funcArgs], orgArgs); funcArgs.evt = getInst("event"); function _createArgs(target, theArgs) { _arrLoop(theArgs, function (arg) { target[_DYN_PUSH$2 ](arg); }); return target; } function _replaceArg(idx, value) { orgArgs = _createArgs([], orgArgs); orgArgs[idx] = value; cbArgs = _createArgs([funcArgs], orgArgs); } _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 0 ); var theFunc = aiHook.f; if (theFunc) { try { funcArgs.rslt = theFunc[_DYN_APPLY ](funcThis, orgArgs); } catch (err) { funcArgs.err = err; _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 3 ); throw err; } } _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 1 ); return funcArgs.rslt; }; } function _getOwner(target, name, checkPrototype, checkParentProto) { var owner = null; if (target) { if (objHasOwnProperty(target, name)) { owner = target; } else if (checkPrototype) { owner = _getOwner(_getObjProto(target), name, checkParentProto, false); } } return owner; } function InstrumentProto(target, funcName, callbacks) { if (target) { return InstrumentFunc(target[strShimPrototype], funcName, callbacks, false); } return null; } function _createInstrumentHook(owner, funcName, fn, callbacks) { var aiHook = fn && fn[aiInstrumentHooks]; if (!aiHook) { aiHook = { i: 0, n: funcName, f: fn, h: [] }; var newFunc = _createFunctionHook(aiHook); newFunc[aiInstrumentHooks] = aiHook; owner[funcName] = newFunc; } var theHook = { id: aiHook.i, cbks: callbacks, rm: function () { var id = this.id; _arrLoop(aiHook.h, function (hook, idx) { if (hook.id === id) { aiHook.h[_DYN_SPLICE ](idx, 1); return 1; } }); } }; aiHook.i++; aiHook.h[_DYN_PUSH$2 ](theHook); return theHook; } function InstrumentFunc(target, funcName, callbacks, checkPrototype, checkParentProto) { if (checkPrototype === void 0) { checkPrototype = true; } if (target && funcName && callbacks) { var owner = _getOwner(target, funcName, checkPrototype, checkParentProto); if (owner) { var fn = owner[funcName]; if (typeof fn === strShimFunction) { return _createInstrumentHook(owner, funcName, fn, callbacks); } } } return null; } function InstrumentEvent(target, evtName, callbacks, checkPrototype, checkParentProto) { if (target && evtName && callbacks) { var owner = _getOwner(target, evtName, checkPrototype, checkParentProto) || target; if (owner) { return _createInstrumentHook(owner, evtName, owner[evtName], callbacks); } } return null; } var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var SampleRate = "sampleRate"; var ProcessLegacy = "ProcessLegacy"; var HttpMethod = "http.method"; var DEFAULT_BREEZE_ENDPOINT = "https://dc.services.visualstudio.com"; var DEFAULT_BREEZE_PATH = "/v2/track"; var strNotSpecified = "not_specified"; var strIkey = "iKey"; var RequestHeaders = createValueMap({ requestContextHeader: [0 , "Request-Context"], requestContextTargetKey: [1 , "appId"], requestContextAppIdFormat: [2 , "appId=cid-v1:"], requestIdHeader: [3 , "Request-Id"], traceParentHeader: [4 , "traceparent"], traceStateHeader: [5 , "tracestate"], sdkContextHeader: [6 , "Sdk-Context"], sdkContextHeaderAppIdRequest: [7 , "appId"], requestContextHeaderLowerCase: [8 , "request-context"] }); var _DYN_SPLIT = "split"; var _DYN_LENGTH$4 = "length"; var _DYN_TO_LOWER_CASE$1 = "toLowerCase"; var _DYN_INGESTIONENDPOINT = "ingestionendpoint"; var _DYN_TO_STRING$2 = "toString"; var _DYN_PUSH$1 = "push"; var _DYN_REMOVE_ITEM = "removeItem"; var _DYN_NAME$2 = "name"; var _DYN_MESSAGE$1 = "message"; var _DYN_COUNT$1 = "count"; var _DYN_PRE_TRIGGER_DATE = "preTriggerDate"; var _DYN_DISABLED = "disabled"; var _DYN_INTERVAL = "interval"; var _DYN_DAYS_OF_MONTH = "daysOfMonth"; var _DYN_DATE = "date"; var _DYN_GET_UTCDATE = "getUTCDate"; var _DYN_STRINGIFY$1 = "stringify"; var _DYN_PATHNAME = "pathname"; var _DYN_CORRELATION_HEADER_E0 = "correlationHeaderExcludePatterns"; var _DYN_EXCEPTIONS = "exceptions"; var _DYN_PARSED_STACK = "parsedStack"; var _DYN_PROPERTIES$1 = "properties"; var _DYN_MEASUREMENTS$1 = "measurements"; var _DYN_SIZE_IN_BYTES = "sizeInBytes"; var _DYN_TYPE_NAME = "typeName"; var _DYN_SEVERITY_LEVEL = "severityLevel"; var _DYN_PROBLEM_GROUP = "problemGroup"; var _DYN_IS_MANUAL = "isManual"; var _DYN__CREATE_FROM_INTERFA1 = "CreateFromInterface"; var _DYN_ASSEMBLY = "assembly"; var _DYN_FILE_NAME = "fileName"; var _DYN_HAS_FULL_STACK = "hasFullStack"; var _DYN_LEVEL = "level"; var _DYN_METHOD$1 = "method"; var _DYN_LINE = "line"; var _DYN_DURATION$1 = "duration"; var _DYN_RECEIVED_RESPONSE = "receivedResponse"; function dataSanitizeKeyAndAddUniqueness(logger, key, map) { var origLength = key[_DYN_LENGTH$4 ]; var field = dataSanitizeKey(logger, key); if (field[_DYN_LENGTH$4 ] !== origLength) { var i = 0; var uniqueField = field; while (map[uniqueField] !== undefined) { i++; uniqueField = strSubstring(field, 0, 150 - 3) + dsPadNumber(i); } field = uniqueField; } return field; } function dataSanitizeKey(logger, name) { var nameTrunc; if (name) { name = strTrim(asString(name)); if (name[_DYN_LENGTH$4 ] > 150 ) { nameTrunc = strSubstring(name, 0, 150 ); _throwInternal(logger, 2 , 57 , "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true); } } return nameTrunc || name; } function dataSanitizeString(logger, value, maxLength) { if (maxLength === void 0) { maxLength = 1024 ; } var valueTrunc; if (value) { maxLength = maxLength ? maxLength : 1024 ; value = strTrim(asString(value)); if (value[_DYN_LENGTH$4 ] > maxLength) { valueTrunc = strSubstring(value, 0, maxLength); _throwInternal(logger, 2 , 61 , "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true); } } return valueTrunc || value; } function dataSanitizeUrl(logger, url) { return dataSanitizeInput(logger, url, 2048 , 66 ); } function dataSanitizeMessage(logger, message) { var messageTrunc; if (message) { if (message[_DYN_LENGTH$4 ] > 32768 ) { messageTrunc = strSubstring(message, 0, 32768 ); _throwInternal(logger, 2 , 56 , "message is too long, it has been truncated to " + 32768 + " characters.", { message: message }, true); } } return messageTrunc || message; } function dataSanitizeException(logger, exception) { var exceptionTrunc; if (exception) { var value = "" + exception; if (value[_DYN_LENGTH$4 ] > 32768 ) { exceptionTrunc = strSubstring(value, 0, 32768 ); _throwInternal(logger, 2 , 52 , "exception is too long, it has been truncated to " + 32768 + " characters.", { exception: exception }, true); } } return exceptionTrunc || exception; } function dataSanitizeProperties(logger, properties) { if (properties) { var tempProps_1 = {}; objForEachKey(properties, function (prop, value) { if (isObject(value) && hasJSON()) { try { value = getJSON()[_DYN_STRINGIFY$1 ](value); } catch (e) { _throwInternal(logger, 2 , 49 , "custom property is not valid", { exception: e }, true); } } value = dataSanitizeString(logger, value, 8192 ); prop = dataSanitizeKeyAndAddUniqueness(logger, prop, tempProps_1); tempProps_1[prop] = value; }); properties = tempProps_1; } return properties; } function dataSanitizeMeasurements(logger, measurements) { if (measurements) { var tempMeasurements_1 = {}; objForEachKey(measurements, function (measure, value) { measure = dataSanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements_1); tempMeasurements_1[measure] = value; }); measurements = tempMeasurements_1; } return measurements; } function dataSanitizeId(logger, id) { return id ? dataSanitizeInput(logger, id, 128 , 69 )[_DYN_TO_STRING$2 ]() : id; } function dataSanitizeInput(logger, input, maxLength, _msgId) { var inputTrunc; if (input) { input = strTrim(asString(input)); if (input[_DYN_LENGTH$4 ] > maxLength) { inputTrunc = strSubstring(input, 0, maxLength); _throwInternal(logger, 2 , _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true); } } return inputTrunc || input; } function dsPadNumber(num) { var s = "00" + num; return strSubstr(s, s[_DYN_LENGTH$4 ] - 3); } var _document = getDocument() || {}; var _htmlAnchorIdx = 0; var _htmlAnchorElement = [null, null, null, null, null]; function urlParseUrl(url) { var anchorIdx = _htmlAnchorIdx; var anchorCache = _htmlAnchorElement; var tempAnchor = anchorCache[anchorIdx]; if (!_document.createElement) { tempAnchor = { host: urlParseHost(url, true) }; } else if (!anchorCache[anchorIdx]) { tempAnchor = anchorCache[anchorIdx] = _document.createElement("a"); } tempAnchor.href = url; anchorIdx++; if (anchorIdx >= anchorCache[_DYN_LENGTH$4 ]) { anchorIdx = 0; } _htmlAnchorIdx = anchorIdx; return tempAnchor; } function urlGetAbsoluteUrl(url) { var result; var a = urlParseUrl(url); if (a) { result = a.href; } return result; } function urlGetCompleteUrl(method, absoluteUrl) { if (method) { return method.toUpperCase() + " " + absoluteUrl; } return absoluteUrl; } function urlParseHost(url, inclPort) { var fullHost = urlParseFullHost(url, inclPort) || ""; if (fullHost) { var match = fullHost.match(/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i); if (match != null && match[_DYN_LENGTH$4 ] > 3 && isString(match[2]) && match[2][_DYN_LENGTH$4 ] > 0) { return match[2] + (match[3] || ""); } } return fullHost; } function urlParseFullHost(url, inclPort) { var result = null; if (url) { var match = url.match(/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i); if (match != null && match[_DYN_LENGTH$4 ] > 2 && isString(match[2]) && match[2][_DYN_LENGTH$4 ] > 0) { result = match[2] || ""; if (inclPort && match[_DYN_LENGTH$4 ] > 2) { var protocol = (match[1] || "")[_DYN_TO_LOWER_CASE$1 ](); var port = match[3] || ""; if (protocol === "http" && port === ":80") { port = ""; } else if (protocol === "https" && port === ":443") { port = ""; } result += port; } } } return result; } var _internalEndpoints = [ DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH, "https://breeze.aimon.applicationinsights.io" + DEFAULT_BREEZE_PATH, "https://dc-int.services.visualstudio.com" + DEFAULT_BREEZE_PATH ]; var _correlationIdPrefix = "cid-v1:"; function isInternalApplicationInsightsEndpoint(endpointUrl) { return arrIndexOf(_internalEndpoints, endpointUrl[_DYN_TO_LOWER_CASE$1 ]()) !== -1; } function correlationIdCanIncludeCorrelationHeader(config, requestUrl, currentHost) { if (!requestUrl || (config && config.disableCorrelationHeaders)) { return false; } if (config && config[_DYN_CORRELATION_HEADER_E0 ]) { for (var i = 0; i < config.correlationHeaderExcludePatterns[_DYN_LENGTH$4 ]; i++) { if (config[_DYN_CORRELATION_HEADER_E0 ][i].test(requestUrl)) { return false; } } } var requestHost = urlParseUrl(requestUrl).host[_DYN_TO_LOWER_CASE$1 ](); if (requestHost && (strIndexOf(requestHost, ":443") !== -1 || strIndexOf(requestHost, ":80") !== -1)) { requestHost = (urlParseFullHost(requestUrl, true) || "")[_DYN_TO_LOWER_CASE$1 ](); } if ((!config || !config.enableCorsCorrelation) && (requestHost && requestHost !== currentHost)) { return false; } var includedDomains = config && config.correlationHeaderDomains; if (includedDomains) { var matchExists_1; arrForEach(includedDomains, function (domain) { var regex = new RegExp(domain.toLowerCase().replace(/\\/g, "\\\\").replace(/\./g, "\\.").replace(/\*/g, ".*")); matchExists_1 = matchExists_1 || regex.test(requestHost); }); if (!matchExists_1) { return false; } } var excludedDomains = config && config.correlationHeaderExcludedDomains; if (!excludedDomains || excludedDomains[_DYN_LENGTH$4 ] === 0) { return true; } for (var i = 0; i < excludedDomains[_DYN_LENGTH$4 ]; i++) { var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\\/g, "\\\\").replace(/\./g, "\\.").replace(/\*/g, ".*")); if (regex.test(requestHost)) { return false; } } return requestHost && requestHost[_DYN_LENGTH$4 ] > 0; } function correlationIdGetCorrelationContext(responseHeader) { if (responseHeader) { var correlationId = correlationIdGetCorrelationContextValue(responseHeader, RequestHeaders[1 ]); if (correlationId && correlationId !== _correlationIdPrefix) { return correlationId; } } } function correlationIdGetCorrelationContextValue(responseHeader, key) { if (responseHeader) { var keyValues = responseHeader[_DYN_SPLIT ](","); for (var i = 0; i < keyValues[_DYN_LENGTH$4 ]; ++i) { var keyValue = keyValues[i][_DYN_SPLIT ]("="); if (keyValue[_DYN_LENGTH$4 ] === 2 && keyValue[0] === key) { return keyValue[1]; } } } } function AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName) { var target, name = commandName, data = commandName; if (absoluteUrl && absoluteUrl[_DYN_LENGTH$4 ] > 0) { var parsedUrl = urlParseUrl(absoluteUrl); target = parsedUrl.host; if (!name) { if (parsedUrl[_DYN_PATHNAME ] != null) { var pathName = (parsedUrl.pathname[_DYN_LENGTH$4 ] === 0) ? "/" : parsedUrl[_DYN_PATHNAME ]; if (pathName.charAt(0) !== "/") { pathName = "/" + pathName; } data = parsedUrl[_DYN_PATHNAME ]; name = dataSanitizeString(logger, method ? method + " " + pathName : pathName); } else { name = dataSanitizeString(logger, absoluteUrl); } } } else { target = commandName; name = commandName; } return { target: target, name: name, data: data }; } function dateTimeUtilsNow() { var perf = getPerformance(); if (perf && perf.now && perf.timing) { var now = perf.now() + perf.timing.navigationStart; if (now > 0) { return now; } } return utcNow(); } function dateTimeUtilsDuration(start, end) { var result = null; if (start !== 0 && end !== 0 && !isNullOrUndefined(start) && !isNullOrUndefined(end)) { result = end - start; } return result; } function createDistributedTraceContextFromTrace(telemetryTrace, parentCtx) { var trace = telemetryTrace || {}; return { getName: function () { return trace[_DYN_NAME$2 ]; }, setName: function (newValue) { parentCtx && parentCtx.setName(newValue); trace[_DYN_NAME$2 ] = newValue; }, getTraceId: function () { return trace.traceID; }, setTraceId: function (newValue) { parentCtx && parentCtx.setTraceId(newValue); if (isValidTraceId(newValue)) { trace.traceID = newValue; } }, getSpanId: function () { return trace.parentID; }, setSpanId: function (newValue) { parentCtx && parentCtx.setSpanId(newValue); if (isValidSpanId(newValue)) { trace.parentID = newValue; } }, getTraceFlags: function () { return trace.traceFlags; }, setTraceFlags: function (newTraceFlags) { parentCtx && parentCtx.setTraceFlags(newTraceFlags); trace.traceFlags = newTraceFlags; } }; } var StorageType = createEnumStyle({ LocalStorage: 0 , SessionStorage: 1 }); var DistributedTracingModes = createEnumStyle({ AI: 0 , AI_AND_W3C: 1 , W3C: 2 }); var _canUseLocalStorage = undefined; var _canUseSessionStorage = undefined; var _storagePrefix = ""; function _getLocalStorageObject() { if (utlCanUseLocalStorage()) { return _getVerifiedStorageObject(StorageType.LocalStorage); } return null; } function _getVerifiedStorageObject(storageType) { try { if (isNullOrUndefined(getGlobal())) { return null; } var uid = (new Date)[_DYN_TO_STRING$2 ](); var storage = getInst(storageType === StorageType.LocalStorage ? "localStorage" : "sessionStorage"); var name_1 = _storagePrefix + uid; storage.setItem(name_1, uid); var fail = storage.getItem(name_1) !== uid; storage[_DYN_REMOVE_ITEM ](name_1); if (!fail) { return storage; } } catch (exception) { } return null; } function _getSessionStorageObject() { if (utlCanUseSessionStorage()) { return _getVerifiedStorageObject(StorageType.SessionStorage); } return null; } function utlDisableStorage() { _canUseLocalStorage = false; _canUseSessionStorage = false; } function utlSetStoragePrefix(storagePrefix) { _storagePrefix = storagePrefix || ""; } function utlEnableStorage() { _canUseLocalStorage = utlCanUseLocalStorage(true); _canUseSessionStorage = utlCanUseSessionStorage(true); } function utlCanUseLocalStorage(reset) { if (reset || _canUseLocalStorage === undefined) { _canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage); } return _canUseLocalStorage; } function utlGetLocalStorage(logger, name) { var storage = _getLocalStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { _canUseLocalStorage = false; _throwInternal(logger, 2 , 1 , "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) }); } } return null; } function utlSetLocalStorage(logger, name, data) { var storage = _getLocalStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { _canUseLocalStorage = false; _throwInternal(logger, 2 , 3 , "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) }); } } return false; } function utlRemoveStorage(logger, name) { var storage = _getLocalStorageObject(); if (storage !== null) { try { storage[_DYN_REMOVE_ITEM ](name); return true; } catch (e) { _canUseLocalStorage = false; _throwInternal(logger, 2 , 5 , "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) }); } } return false; } function utlCanUseSessionStorage(reset) { if (reset || _canUseSessionStorage === undefined) { _canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage); } return _canUseSessionStorage; } function utlGetSessionStorage(logger, name) { var storage = _getSessionStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { _canUseSessionStorage = false; _throwInternal(logger, 2 , 2 , "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) }); } } return null; } function utlSetSessionStorage(logger, name, data) { var storage = _getSessionStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { _canUseSessionStorage = false; _throwInternal(logger, 2 , 4 , "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) }); } } return false; } function utlRemoveSessionStorage(logger, name) { var storage = _getSessionStorageObject(); if (storage !== null) { try { storage[_DYN_REMOVE_ITEM ](name); return true; } catch (e) { _canUseSessionStorage = false; _throwInternal(logger, 2 , 6 , "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) }); } } return false; } var THROTTLE_STORAGE_PREFIX = "appInsightsThrottle"; var ThrottleMgr = /** @class */ (function () { function ThrottleMgr(core, namePrefix) { var _self = this; var _canUseLocalStorage; var _logger; var _config; var _localStorageObj; var _isTriggered; var _namePrefix; var _queue; var _isReady = false; var _isSpecificDaysGiven = false; _initConfig(); _self["_getDbgPlgTargets"] = function () { return [_queue]; }; _self.getConfig = function () { return _config; }; _self.canThrottle = function (msgId) { var localObj = _getLocalStorageObjByKey(msgId); var cfg = _getCfgByKey(msgId); return _canThrottle(cfg, _canUseLocalStorage, localObj); }; _self.isTriggered = function (msgId) { return _isTrigger(msgId); }; _self.isReady = function () { return _isReady; }; _self.flush = function (msgId) { try { var queue = _getQueueByKey(msgId); if (queue && queue[_DYN_LENGTH$4 ] > 0) { var items = queue.slice(0); _queue[msgId] = []; arrForEach(items, function (item) { _flushMessage(item.msgID, item[_DYN_MESSAGE$1 ], item.severity, false); }); return true; } } catch (err) { } return false; }; _self.flushAll = function () { try { if (_queue) { var result_1 = true; objForEachKey(_queue, function (key) { var isFlushed = _self.flush(parseInt(key)); result_1 = result_1 && isFlushed; }); return result_1; } } catch (err) { } return false; }; _self.onReadyState = function (isReady, flushAll) { if (flushAll === void 0) { flushAll = true; } _isReady = isNullOrUndefined(isReady) ? true : isReady; if (_isReady && flushAll) { return _self.flushAll(); } return null; }; _self.sendMessage = function (msgID, message, severity) { return _flushMessage(msgID, message, severity, true); }; function _flushMessage(msgID, message, severity, saveUnsentMsg) { if (_isReady) { var isSampledIn = _canSampledIn(msgID); if (!isSampledIn) { return; } var cfg = _getCfgByKey(msgID); var localStorageObj = _getLocalStorageObjByKey(msgID); var canThrottle = _canThrottle(cfg, _canUseLocalStorage, localStorageObj); var throttled = false; var number = 0; var isTriggered = _isTrigger(msgID); try { if (canThrottle && !isTriggered) { number = Math.min(cfg.limit.maxSendNumber, localStorageObj[_DYN_COUNT$1 ] + 1); localStorageObj[_DYN_COUNT$1 ] = 0; throttled = true; _isTriggered[msgID] = true; localStorageObj[_DYN_PRE_TRIGGER_DATE ] = new Date(); } else { _isTriggered[msgID] = canThrottle; localStorageObj[_DYN_COUNT$1 ] += 1; } var localStorageName = _getLocalStorageName(msgID); _resetLocalStorage(_logger, localStorageName, localStorageObj); for (var i = 0; i < number; i++) { _sendMessage(msgID, _logger, message, severity); } } catch (e) { } return { isThrottled: throttled, throttleNum: number }; } else { if (!!saveUnsentMsg) { var queue = _getQueueByKey(msgID); queue[_DYN_PUSH$1 ]({ msgID: msgID, message: message, severity: severity }); } } return null; } function _initConfig() { _logger = safeGetLogger(core); _isTriggered = {}; _localStorageObj = {}; _queue = {}; _config = {}; _setCfgByKey(109 ); _namePrefix = isNotNullOrUndefined(namePrefix) ? namePrefix : ""; core.addUnloadHook(onConfigChange(core.config, function (details) { var coreConfig = details.cfg; _canUseLocalStorage = utlCanUseLocalStorage(); var configMgr = coreConfig.throttleMgrCfg || {}; objForEachKey(configMgr, function (key, cfg) { _setCfgByKey(parseInt(key), cfg); }); })); } function _getCfgByKey(msgID) { return _config[msgID] || _config[109 ]; } function _setCfgByKey(msgID, config) { var _a, _b; try { var cfg = config || {}; var curCfg = {}; curCfg[_DYN_DISABLED ] = !!cfg[_DYN_DISABLED ]; var configInterval = cfg[_DYN_INTERVAL ] || {}; _isSpecificDaysGiven = (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth) && (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth[_DYN_LENGTH$4 ]) > 0; curCfg[_DYN_INTERVAL ] = _getIntervalConfig(configInterval); var limit = { samplingRate: ((_a = cfg.limit) === null || _a === void 0 ? void 0 : _a.samplingRate) || 100, maxSendNumber: ((_b = cfg.limit) === null || _b === void 0 ? void 0 : _b.maxSendNumber) || 1 }; curCfg.limit = limit; _config[msgID] = curCfg; } catch (e) { } } function _getIntervalConfig(interval) { interval = interval || {}; var monthInterval = interval === null || interval === void 0 ? void 0 : interval.monthInterval; var dayInterval = interval === null || interval === void 0 ? void 0 : interval.dayInterval; if (isNullOrUndefined(monthInterval) && isNullOrUndefined(dayInterval)) { interval.monthInterval = 3; if (!_isSpecificDaysGiven) { interval[_DYN_DAYS_OF_MONTH ] = [28]; _isSpecificDaysGiven = true; } } interval = { monthInterval: interval === null || interval === void 0 ? void 0 : interval.monthInterval, dayInterval: interval === null || interval === void 0 ? void 0 : interval.dayInterval, daysOfMonth: interval === null || interval === void 0 ? void 0 : interval.daysOfMonth }; return interval; } function _canThrottle(config, canUseLocalStorage, localStorageObj) { if (config && !config[_DYN_DISABLED ] && canUseLocalStorage && isNotNullOrUndefined(localStorageObj)) { var curDate = _getThrottleDate(); var date = localStorageObj[_DYN_DATE ]; var interval = config[_DYN_INTERVAL ]; var monthCheck = 1; if (interval === null || interval === void 0 ? void 0 : interval.monthInterval) { var monthExpand = (curDate.getUTCFullYear() - date.getUTCFullYear()) * 12 + curDate.getUTCMonth() - date.getUTCMonth(); monthCheck = _checkInterval(interval.monthInterval, 0, monthExpand); } var dayCheck = 1; if (_isSpecificDaysGiven) { dayCheck = arrIndexOf(interval[_DYN_DAYS_OF_MONTH ], curDate[_DYN_GET_UTCDATE ]()); } else if (interval === null || interval === void 0 ? void 0 : interval.dayInterval) { var daySpan = Math.floor((curDate.getTime() - date.getTime()) / 86400000); dayCheck = _checkInterval(interval.dayInterval, 0, daySpan); } return monthCheck >= 0 && dayCheck >= 0; } return false; } function _getLocalStorageName(msgKey, prefix) { var fix = isNotNullOrUndefined(prefix) ? prefix : ""; if (msgKey) { return THROTTLE_STORAGE_PREFIX + fix + "-" + msgKey; } return null; } function _isTriggeredOnCurDate(preTriggerDate) { try { if (preTriggerDate) { var curDate = new Date(); return preTriggerDate.getUTCFullYear() === curDate.getUTCFullYear() && preTriggerDate.getUTCMonth() === curDate.getUTCMonth() && preTriggerDate[_DYN_GET_UTCDATE ]() === curDate[_DYN_GET_UTCDATE ](); } } catch (e) { } return false; } function _getLocalStorageObj(value, logger, storageName) { try { var storageObj = { date: _getThrottleDate(), count: 0 }; if (value) { var obj = JSON.parse(value); var curObj = { date: _getThrottleDate(obj[_DYN_DATE ]) || storageObj[_DYN_DATE ], count: obj[_DYN_COUNT$1 ] || storageObj[_DYN_COUNT$1 ], preTriggerDate: obj.preTriggerDate ? _getThrottleDate(obj[_DYN_PRE_TRIGGER_DATE ]) : undefined }; return curObj; } else { _resetLocalStorage(logger, storageName, storageObj); return storageObj; } } catch (e) { } return null; } function _getThrottleDate(dateStr) { try { if (dateStr) { var date = new Date(dateStr); if (!isNaN(date.getDate())) { return date; } } else { return new Date(); } } catch (e) { } return null; } function _resetLocalStorage(logger, storageName, obj) { try { return utlSetLocalStorage(logger, storageName, strTrim(JSON[_DYN_STRINGIFY$1 ](obj))); } catch (e) { } return false; } function _checkInterval(interval, start, current) { if (interval <= 0) { return 1; } return (current >= start) && (current - start) % interval == 0 ? Math.floor((current - start) / interval) + 1 : -1; } function _sendMessage(msgID, logger, message, severity) { _throwInternal(logger, severity || 1 , msgID, message); } function _canSampledIn(msgID) { try { var cfg = _getCfgByKey(msgID); return randomValue(1000000) <= cfg.limit.samplingRate; } catch (e) { } return false; } function _getLocalStorageObjByKey(key) { try { var curObj = _localStorageObj[key]; if (!curObj) { var localStorageName = _getLocalStorageName(key, _namePrefix); curObj = _getLocalStorageObj(utlGetLocalStorage(_logger, localStorageName), _logger, localStorageName); _localStorageObj[key] = curObj; } return _localStorageObj[key]; } catch (e) { } return null; } function _isTrigger(key) { var isTrigger = _isTriggered[key]; if (isNullOrUndefined(isTrigger)) { isTrigger = false; var localStorageObj = _getLocalStorageObjByKey(key); if (localStorageObj) { isTrigger = _isTriggeredOnCurDate(localStorageObj[_DYN_PRE_TRIGGER_DATE ]); } _isTriggered[key] = isTrigger; } return _isTriggered[key]; } function _getQueueByKey(key) { _queue = _queue || {}; if (isNullOrUndefined(_queue[key])) { _queue[key] = []; } return _queue[key]; } } return ThrottleMgr; }()); var _FIELDS_SEPARATOR = ";"; var _FIELD_KEY_VALUE_SEPARATOR = "="; function parseConnectionString(connectionString) { if (!connectionString) { return {}; } var kvPairs = connectionString[_DYN_SPLIT ](_FIELDS_SEPARATOR); var result = arrReduce(kvPairs, function (fields, kv) { var kvParts = kv[_DYN_SPLIT ](_FIELD_KEY_VALUE_SEPARATOR); if (kvParts[_DYN_LENGTH$4 ] === 2) { var key = kvParts[0][_DYN_TO_LOWER_CASE$1 ](); var value = kvParts[1]; fields[key] = value; } return fields; }, {}); if (objKeys(result)[_DYN_LENGTH$4 ] > 0) { if (result.endpointsuffix) { var locationPrefix = result.location ? result.location + "." : ""; result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ] || ("https://" + locationPrefix + "dc." + result.endpointsuffix); } result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ] || DEFAULT_BREEZE_ENDPOINT; if (strEndsWith(result[_DYN_INGESTIONENDPOINT ], "/")) { result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ].slice(0, -1); } } return result; } var Envelope = /** @class */ (function () { function Envelope(logger, data, name) { var _this = this; var _self = this; _self.ver = 1; _self.sampleRate = 100.0; _self.tags = {}; _self[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; _self.data = data; _self.time = toISOString(new Date()); _self.aiDataContract = { time: 1 , iKey: 1 , name: 1 , sampleRate: function () { return (_this.sampleRate === 100) ? 4 : 1 ; }, tags: 1 , data: 1 }; } return Envelope; }()); var Event$1 = /** @class */ (function () { function Event(logger, name, properties, measurements) { this.aiDataContract = { ver: 1 , name: 1 , properties: 0 , measurements: 0 }; var _self = this; _self.ver = 2; _self[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; _self[_DYN_PROPERTIES$1 ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); } Event.envelopeType = "Microsoft.ApplicationInsights.{0}.Event"; Event.dataType = "EventData"; return Event; }()); var NoMethod = ""; var strError = "error"; var strStack = "stack"; var strStackDetails = "stackDetails"; var strErrorSrc = "errorSrc"; var strMessage = "message"; var strDescription = "description"; function _stringify(value, convertToString) { var result = value; if (result && !isString(result)) { if (JSON && JSON[_DYN_STRINGIFY$1 ]) { result = JSON[_DYN_STRINGIFY$1 ](value); if (convertToString && (!result || result === "{}")) { if (isFunction(value[_DYN_TO_STRING$2 ])) { result = value[_DYN_TO_STRING$2 ](); } else { result = "" + value; } } } else { result = "" + value + " - (Missing JSON.stringify)"; } } return result || ""; } function _formatMessage(theEvent, errorType) { var evtMessage = theEvent; if (theEvent) { if (evtMessage && !isString(evtMessage)) { evtMessage = theEvent[strMessage] || theEvent[strDescription] || evtMessage; } if (evtMessage && !isString(evtMessage)) { evtMessage = _stringify(evtMessage, true); } if (theEvent["filename"]) { evtMessage = evtMessage + " @" + (theEvent["filename"] || "") + ":" + (theEvent["lineno"] || "?") + ":" + (theEvent["colno"] || "?"); } } if (errorType && errorType !== "String" && errorType !== "Object" && errorType !== "Error" && strIndexOf(evtMessage || "", errorType) === -1) { evtMessage = errorType + ": " + evtMessage; } return evtMessage || ""; } function _isExceptionDetailsInternal(value) { try { if (isObject(value)) { return "hasFullStack" in value && "typeName" in value; } } catch (e) { } return false; } function _isExceptionInternal(value) { try { if (isObject(value)) { return ("ver" in value && "exceptions" in value && "properties" in value); } } catch (e) { } return false; } function _isStackDetails(details) { return details && details.src && isString(details.src) && details.obj && isArray(details.obj); } function _convertStackObj(errorStack) { var src = errorStack || ""; if (!isString(src)) { if (isString(src[strStack])) { src = src[strStack]; } else { src = "" + src; } } var items = src[_DYN_SPLIT ]("\n"); return { src: src, obj: items }; } function _getOperaStack(errorMessage) { var stack = []; var lines = errorMessage[_DYN_SPLIT ]("\n"); for (var lp = 0; lp < lines[_DYN_LENGTH$4 ]; lp++) { var entry = lines[lp]; if (lines[lp + 1]) { entry += "@" + lines[lp + 1]; lp++; } stack[_DYN_PUSH$1 ](entry); } return { src: errorMessage, obj: stack }; } function _getStackFromErrorObj(errorObj) { var details = null; if (errorObj) { try { if (errorObj[strStack]) { details = _convertStackObj(errorObj[strStack]); } else if (errorObj[strError] && errorObj[strError][strStack]) { details = _convertStackObj(errorObj[strError][strStack]); } else if (errorObj["exception"] && errorObj.exception[strStack]) { details = _convertStackObj(errorObj.exception[strStack]); } else if (_isStackDetails(errorObj)) { details = errorObj; } else if (_isStackDetails(errorObj[strStackDetails])) { details = errorObj[strStackDetails]; } else if (getWindow() && getWindow()["opera"] && errorObj[strMessage]) { details = _getOperaStack(errorObj[_DYN_MESSAGE$1 ]); } else if (errorObj["reason"] && errorObj.reason[strStack]) { details = _convertStackObj(errorObj.reason[strStack]); } else if (isString(errorObj)) { details = _convertStackObj(errorObj); } else { var evtMessage = errorObj[strMessage] || errorObj[strDescription] || ""; if (isString(errorObj[strErrorSrc])) { if (evtMessage) { evtMessage += "\n"; } evtMessage += " from " + errorObj[strErrorSrc]; } if (evtMessage) { details = _convertStackObj(evtMessage); } } } catch (e) { details = _convertStackObj(e); } } return details || { src: "", obj: null }; } function _formatStackTrace(stackDetails) { var stack = ""; if (stackDetails) { if (stackDetails.obj) { arrForEach(stackDetails.obj, function (entry) { stack += entry + "\n"; }); } else { stack = stackDetails.src || ""; } } return stack; } function _parseStack(stack) { var parsedStack; var frames = stack.obj; if (frames && frames[_DYN_LENGTH$4 ] > 0) { parsedStack = []; var level_1 = 0; var totalSizeInBytes_1 = 0; arrForEach(frames, function (frame) { var theFrame = frame[_DYN_TO_STRING$2 ](); if (_StackFrame.regex.test(theFrame)) { var parsedFrame = new _StackFrame(theFrame, level_1++); totalSizeInBytes_1 += parsedFrame[_DYN_SIZE_IN_BYTES ]; parsedStack[_DYN_PUSH$1 ](parsedFrame); } }); var exceptionParsedStackThreshold = 32 * 1024; if (totalSizeInBytes_1 > exceptionParsedStackThreshold) { var left = 0; var right = parsedStack[_DYN_LENGTH$4 ] - 1; var size = 0; var acceptedLeft = left; var acceptedRight = right; while (left < right) { var lSize = parsedStack[left][_DYN_SIZE_IN_BYTES ]; var rSize = parsedStack[right][_DYN_SIZE_IN_BYTES ]; size += lSize + rSize; if (size > exceptionParsedStackThreshold) { var howMany = acceptedRight - acceptedLeft + 1; parsedStack.splice(acceptedLeft, howMany); break; } acceptedLeft = left; acceptedRight = right; left++; right--; } } } return parsedStack; } function _getErrorType(errorType) { var typeName = ""; if (errorType) { typeName = errorType.typeName || errorType[_DYN_NAME$2 ] || ""; if (!typeName) { try { var funcNameRegex = /function (.{1,200})\(/; var results = (funcNameRegex).exec((errorType).constructor[_DYN_TO_STRING$2 ]()); typeName = (results && results[_DYN_LENGTH$4 ] > 1) ? results[1] : ""; } catch (e) { } } } return typeName; } function _formatErrorCode(errorObj) { if (errorObj) { try { if (!isString(errorObj)) { var errorType = _getErrorType(errorObj); var result = _stringify(errorObj, false); if (!result || result === "{}") { if (errorObj[strError]) { errorObj = errorObj[strError]; errorType = _getErrorType(errorObj); } result = _stringify(errorObj, true); } if (strIndexOf(result, errorType) !== 0 && errorType !== "String") { return errorType + ":" + result; } return result; } } catch (e) { } } return "" + (errorObj || ""); } var Exception = /** @class */ (function () { function Exception(logger, exception, properties, measurements, severityLevel, id) { this.aiDataContract = { ver: 1 , exceptions: 1 , severityLevel: 0 , properties: 0 , measurements: 0 }; var _self = this; _self.ver = 2; if (!_isExceptionInternal(exception)) { if (!properties) { properties = {}; } _self[_DYN_EXCEPTIONS ] = [new _ExceptionDetails(logger, exception, properties)]; _self[_DYN_PROPERTIES$1 ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); if (severityLevel) { _self[_DYN_SEVERITY_LEVEL ] = severityLevel; } if (id) { _self.id = id; } } else { _self[_DYN_EXCEPTIONS ] = exception[_DYN_EXCEPTIONS ] || []; _self[_DYN_PROPERTIES$1 ] = exception[_DYN_PROPERTIES$1 ]; _self[_DYN_MEASUREMENTS$1 ] = exception[_DYN_MEASUREMENTS$1 ]; if (exception[_DYN_SEVERITY_LEVEL ]) { _self[_DYN_SEVERITY_LEVEL ] = exception[_DYN_SEVERITY_LEVEL ]; } if (exception.id) { _self.id = exception.id; } if (exception[_DYN_PROBLEM_GROUP ]) { _self[_DYN_PROBLEM_GROUP ] = exception[_DYN_PROBLEM_GROUP ]; } if (!isNullOrUndefined(exception[_DYN_IS_MANUAL ])) { _self[_DYN_IS_MANUAL ] = exception[_DYN_IS_MANUAL ]; } } } Exception.CreateAutoException = function (message, url, lineNumber, columnNumber, error, evt, stack, errorSrc) { var _a; var errorType = _getErrorType(error || evt || message); return _a = {}, _a[_DYN_MESSAGE$1 ] = _formatMessage(message, errorType), _a.url = url, _a.lineNumber = lineNumber, _a.columnNumber = columnNumber, _a.error = _formatErrorCode(error || evt || message), _a.evt = _formatErrorCode(evt || message), _a[_DYN_TYPE_NAME ] = errorType, _a.stackDetails = _getStackFromErrorObj(stack || error || evt), _a.errorSrc = errorSrc, _a; }; Exception.CreateFromInterface = function (logger, exception, properties, measurements) { var exceptions = exception[_DYN_EXCEPTIONS ] && arrMap(exception[_DYN_EXCEPTIONS ], function (ex) { return _ExceptionDetails[_DYN__CREATE_FROM_INTERFA1 ](logger, ex); }); var exceptionData = new Exception(logger, __assignFn(__assignFn({}, exception), { exceptions: exceptions }), properties, measurements); return exceptionData; }; Exception.prototype.toInterface = function () { var _a; var _b = this, exceptions = _b.exceptions, properties = _b.properties, measurements = _b.measurements, severityLevel = _b.severityLevel, problemGroup = _b.problemGroup, id = _b.id, isManual = _b.isManual; var exceptionDetailsInterface = exceptions instanceof Array && arrMap(exceptions, function (exception) { return exception.toInterface(); }) || undefined; return _a = { ver: "4.0" }, _a[_DYN_EXCEPTIONS ] = exceptionDetailsInterface, _a.severityLevel = severityLevel, _a.properties = properties, _a.measurements = measurements, _a.problemGroup = problemGroup, _a.id = id, _a.isManual = isManual, _a; }; Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) { var _a; return { exceptions: [ (_a = {}, _a[_DYN_HAS_FULL_STACK ] = true, _a.message = message, _a.stack = details, _a.typeName = typeName, _a) ] }; }; Exception.envelopeType = "Microsoft.ApplicationInsights.{0}.Exception"; Exception.dataType = "ExceptionData"; Exception.formatError = _formatErrorCode; return Exception; }()); var _ExceptionDetails = /** @class */ (function () { function _ExceptionDetails(logger, exception, properties) { this.aiDataContract = { id: 0 , outerId: 0 , typeName: 1 , message: 1 , hasFullStack: 0 , stack: 0 , parsedStack: 2 }; var _self = this; if (!_isExceptionDetailsInternal(exception)) { var error = exception; var evt = error && error.evt; if (!isError(error)) { error = error[strError] || evt || error; } _self[_DYN_TYPE_NAME ] = dataSanitizeString(logger, _getErrorType(error)) || strNotSpecified; _self[_DYN_MESSAGE$1 ] = dataSanitizeMessage(logger, _formatMessage(exception || error, _self[_DYN_TYPE_NAME ])) || strNotSpecified; var stack = exception[strStackDetails] || _getStackFromErrorObj(exception); _self[_DYN_PARSED_STACK ] = _parseStack(stack); if (isArray(_self[_DYN_PARSED_STACK ])) { arrMap(_self[_DYN_PARSED_STACK ], function (frame) { frame[_DYN_ASSEMBLY ] = dataSanitizeString(logger, frame[_DYN_ASSEMBLY ]); frame[_DYN_FILE_NAME ] = dataSanitizeString(logger, frame[_DYN_FILE_NAME ]); }); } _self[strStack] = dataSanitizeException(logger, _formatStackTrace(stack)); _self.hasFullStack = isArray(_self.parsedStack) && _self.parsedStack[_DYN_LENGTH$4 ] > 0; if (properties) { properties[_DYN_TYPE_NAME ] = properties[_DYN_TYPE_NAME ] || _self[_DYN_TYPE_NAME ]; } } else { _self[_DYN_TYPE_NAME ] = exception[_DYN_TYPE_NAME ]; _self[_DYN_MESSAGE$1 ] = exception[_DYN_MESSAGE$1 ]; _self[strStack] = exception[strStack]; _self[_DYN_PARSED_STACK ] = exception[_DYN_PARSED_STACK ] || []; _self[_DYN_HAS_FULL_STACK ] = exception[_DYN_HAS_FULL_STACK ]; } } _ExceptionDetails.prototype.toInterface = function () { var _a; var _self = this; var parsedStack = _self[_DYN_PARSED_STACK ] instanceof Array && arrMap(_self[_DYN_PARSED_STACK ], function (frame) { return frame.toInterface(); }); var exceptionDetailsInterface = (_a = { id: _self.id, outerId: _self.outerId, typeName: _self[_DYN_TYPE_NAME ], message: _self[_DYN_MESSAGE$1 ], hasFullStack: _self[_DYN_HAS_FULL_STACK ], stack: _self[strStack] }, _a[_DYN_PARSED_STACK ] = parsedStack || undefined, _a); return exceptionDetailsInterface; }; _ExceptionDetails.CreateFromInterface = function (logger, exception) { var parsedStack = (exception[_DYN_PARSED_STACK ] instanceof Array && arrMap(exception[_DYN_PARSED_STACK ], function (frame) { return _StackFrame[_DYN__CREATE_FROM_INTERFA1 ](frame); })) || exception[_DYN_PARSED_STACK ]; var exceptionDetails = new _ExceptionDetails(logger, __assignFn(__assignFn({}, exception), { parsedStack: parsedStack })); return exceptionDetails; }; return _ExceptionDetails; }()); var _StackFrame = /** @class */ (function () { function _StackFrame(sourceFrame, level) { this.aiDataContract = { level: 1 , method: 1 , assembly: 0 , fileName: 0 , line: 0 }; var _self = this; _self[_DYN_SIZE_IN_BYTES ] = 0; if (typeof sourceFrame === "string") { var frame = sourceFrame; _self[_DYN_LEVEL ] = level; _self[_DYN_METHOD$1 ] = NoMethod; _self[_DYN_ASSEMBLY ] = strTrim(frame); _self[_DYN_FILE_NAME ] = ""; _self[_DYN_LINE ] = 0; var matches = frame.match(_StackFrame.regex); if (matches && matches[_DYN_LENGTH$4 ] >= 5) { _self[_DYN_METHOD$1 ] = strTrim(matches[2]) || _self[_DYN_METHOD$1 ]; _self[_DYN_FILE_NAME ] = strTrim(matches[4]); _self[_DYN_LINE ] = parseInt(matches[5]) || 0; } } else { _self[_DYN_LEVEL ] = sourceFrame[_DYN_LEVEL ]; _self[_DYN_METHOD$1 ] = sourceFrame[_DYN_METHOD$1 ]; _self[_DYN_ASSEMBLY ] = sourceFrame[_DYN_ASSEMBLY ]; _self[_DYN_FILE_NAME ] = sourceFrame[_DYN_FILE_NAME ]; _self[_DYN_LINE ] = sourceFrame[_DYN_LINE ]; _self[_DYN_SIZE_IN_BYTES ] = 0; } _self.sizeInBytes += _self.method[_DYN_LENGTH$4 ]; _self.sizeInBytes += _self.fileName[_DYN_LENGTH$4 ]; _self.sizeInBytes += _self.assembly[_DYN_LENGTH$4 ]; _self[_DYN_SIZE_IN_BYTES ] += _StackFrame.baseSize; _self.sizeInBytes += _self.level.toString()[_DYN_LENGTH$4 ]; _self.sizeInBytes += _self.line.toString()[_DYN_LENGTH$4 ]; } _StackFrame.CreateFromInterface = function (frame) { return new _StackFrame(frame, null ); }; _StackFrame.prototype.toInterface = function () { var _self = this; return { level: _self[_DYN_LEVEL ], method: _self[_DYN_METHOD$1 ], assembly: _self[_DYN_ASSEMBLY ], fileName: _self[_DYN_FILE_NAME ], line: _self[_DYN_LINE ] }; }; _StackFrame.regex = /^([\s]+at)?[\s]{0,50}([^\@\()]+?)[\s]{0,50}(\@|\()([^\(\n]+):([0-9]+):([0-9]+)(\)?)$/; _StackFrame.baseSize = 58; return _StackFrame; }()); var DataPoint = /** @class */ (function () { function DataPoint() { this.aiDataContract = { name: 1 , kind: 0 , value: 1 , count: 0 , min: 0 , max: 0 , stdDev: 0 }; this.kind = 0 ; } return DataPoint; }()); var Metric = /** @class */ (function () { function Metric(logger, name, value, count, min, max, stdDev, properties, measurements) { this.aiDataContract = { ver: 1 , metrics: 1 , properties: 0 }; var _self = this; _self.ver = 2; var dataPoint = new DataPoint(); dataPoint[_DYN_COUNT$1 ] = count > 0 ? count : undefined; dataPoint.max = isNaN(max) || max === null ? undefined : max; dataPoint.min = isNaN(min) || min === null ? undefined : min; dataPoint[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; dataPoint.value = value; dataPoint.stdDev = isNaN(stdDev) || stdDev === null ? undefined : stdDev; _self.metrics = [dataPoint]; _self[_DYN_PROPERTIES$1 ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); } Metric.envelopeType = "Microsoft.ApplicationInsights.{0}.Metric"; Metric.dataType = "MetricData"; return Metric; }()); var strEmpty = ""; function msToTimeSpan(totalms) { if (isNaN(totalms) || totalms < 0) { totalms = 0; } totalms = Math.round(totalms); var ms = strEmpty + totalms % 1000; var sec = strEmpty + Math.floor(totalms / 1000) % 60; var min = strEmpty + Math.floor(totalms / (1000 * 60)) % 60; var hour = strEmpty + Math.floor(totalms / (1000 * 60 * 60)) % 24; var days = Math.floor(totalms / (1000 * 60 * 60 * 24)); ms = ms[_DYN_LENGTH$4 ] === 1 ? "00" + ms : ms[_DYN_LENGTH$4 ] === 2 ? "0" + ms : ms; sec = sec[_DYN_LENGTH$4 ] < 2 ? "0" + sec : sec; min = min[_DYN_LENGTH$4 ] < 2 ? "0" + min : min; hour = hour[_DYN_LENGTH$4 ] < 2 ? "0" + hour : hour; return (days > 0 ? days + "." : strEmpty) + hour + ":" + min + ":" + sec + "." + ms; } function isCrossOriginError(message, url, lineNumber, columnNumber, error) { return !error && isString(message) && (message === "Script error." || message === "Script error"); } var PageView = /** @class */ (function () { function PageView(logger, name, url, durationMs, properties, measurements, id) { this.aiDataContract = { ver: 1 , name: 0 , url: 0 , duration: 0 , properties: 0 , measurements: 0 , id: 0 }; var _self = this; _self.ver = 2; _self.id = dataSanitizeId(logger, id); _self.url = dataSanitizeUrl(logger, url); _self[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; if (!isNaN(durationMs)) { _self[_DYN_DURATION$1 ] = msToTimeSpan(durationMs); } _self[_DYN_PROPERTIES$1 ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); } PageView.envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview"; PageView.dataType = "PageviewData"; return PageView; }()); var RemoteDependencyData = /** @class */ (function () { function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, requestAPI, correlationContext, properties, measurements) { if (requestAPI === void 0) { requestAPI = "Ajax"; } this.aiDataContract = { id: 1 , ver: 1 , name: 0 , resultCode: 0 , duration: 0 , success: 0 , data: 0 , target: 0 , type: 0 , properties: 0 , measurements: 0 , kind: 0 , value: 0 , count: 0 , min: 0 , max: 0 , stdDev: 0 , dependencyKind: 0 , dependencySource: 0 , commandName: 0 , dependencyTypeName: 0 }; var _self = this; _self.ver = 2; _self.id = id; _self[_DYN_DURATION$1 ] = msToTimeSpan(value); _self.success = success; _self.resultCode = resultCode + ""; _self.type = dataSanitizeString(logger, requestAPI); var dependencyFields = AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName); _self.data = dataSanitizeUrl(logger, commandName) || dependencyFields.data; _self.target = dataSanitizeString(logger, dependencyFields.target); if (correlationContext) { _self.target = "".concat(_self.target, " | ").concat(correlationContext); } _self[_DYN_NAME$2 ] = dataSanitizeString(logger, dependencyFields[_DYN_NAME$2 ]); _self[_DYN_PROPERTIES$1 ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); } RemoteDependencyData.envelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency"; RemoteDependencyData.dataType = "RemoteDependencyData"; return RemoteDependencyData; }()); var Trace = /** @class */ (function () { function Trace(logger, message, severityLevel, properties, measurements) { this.aiDataContract = { ver: 1 , message: 1 , severityLevel: 0 , properties: 0 }; var _self = this; _self.ver = 2; message = message || strNotSpecified; _self[_DYN_MESSAGE$1 ] = dataSanitizeMessage(logger, message); _self[_DYN_PROPERTIES$1 ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); if (severityLevel) { _self[_DYN_SEVERITY_LEVEL ] = severityLevel; } } Trace.envelopeType = "Microsoft.ApplicationInsights.{0}.Message"; Trace.dataType = "MessageData"; return Trace; }()); var PageViewPerformance = /** @class */ (function () { function PageViewPerformance(logger, name, url, unused, properties, measurements, cs4BaseData) { this.aiDataContract = { ver: 1 , name: 0 , url: 0 , duration: 0 , perfTotal: 0 , networkConnect: 0 , sentRequest: 0 , receivedResponse: 0 , domProcessing: 0 , properties: 0 , measurements: 0 }; var _self = this; _self.ver = 2; _self.url = dataSanitizeUrl(logger, url); _self[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; _self[_DYN_PROPERTIES$1 ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); if (cs4BaseData) { _self.domProcessing = cs4BaseData.domProcessing; _self[_DYN_DURATION$1 ] = cs4BaseData[_DYN_DURATION$1 ]; _self.networkConnect = cs4BaseData.networkConnect; _self.perfTotal = cs4BaseData.perfTotal; _self[_DYN_RECEIVED_RESPONSE ] = cs4BaseData[_DYN_RECEIVED_RESPONSE ]; _self.sentRequest = cs4BaseData.sentRequest; } } PageViewPerformance.envelopeType = "Microsoft.ApplicationInsights.{0}.PageviewPerformance"; PageViewPerformance.dataType = "PageviewPerformanceData"; return PageViewPerformance; }()); var Data = /** @class */ (function () { function Data(baseType, data) { this.aiDataContract = { baseType: 1 , baseData: 1 }; this.baseType = baseType; this.baseData = data; } return Data; }()); var SeverityLevel = createEnumStyle({ Verbose: 0 , Information: 1 , Warning: 2 , Error: 3 , Critical: 4 }); function _aiNameFunc(baseName) { var aiName = "ai." + baseName + "."; return function (name) { return aiName + name; }; } var _aiApplication = _aiNameFunc("application"); var _aiDevice = _aiNameFunc("device"); var _aiLocation = _aiNameFunc("location"); var _aiOperation = _aiNameFunc("operation"); var _aiSession = _aiNameFunc("session"); var _aiUser = _aiNameFunc("user"); var _aiCloud = _aiNameFunc("cloud"); var _aiInternal = _aiNameFunc("internal"); var ContextTagKeys = /** @class */ (function (_super) { __extendsFn(ContextTagKeys, _super); function ContextTagKeys() { return _super.call(this) || this; } return ContextTagKeys; }(createClassFromInterface({ applicationVersion: _aiApplication("ver"), applicationBuild: _aiApplication("build"), applicationTypeId: _aiApplication("typeId"), applicationId: _aiApplication("applicationId"), applicationLayer: _aiApplication("layer"), deviceId: _aiDevice("id"), deviceIp: _aiDevice("ip"), deviceLanguage: _aiDevice("language"), deviceLocale: _aiDevice("locale"), deviceModel: _aiDevice("model"), deviceFriendlyName: _aiDevice("friendlyName"), deviceNetwork: _aiDevice("network"), deviceNetworkName: _aiDevice("networkName"), deviceOEMName: _aiDevice("oemName"), deviceOS: _aiDevice("os"), deviceOSVersion: _aiDevice("osVersion"), deviceRoleInstance: _aiDevice("roleInstance"), deviceRoleName: _aiDevice("roleName"), deviceScreenResolution: _aiDevice("screenResolution"), deviceType: _aiDevice("type"), deviceMachineName: _aiDevice("machineName"), deviceVMName: _aiDevice("vmName"), deviceBrowser: _aiDevice("browser"), deviceBrowserVersion: _aiDevice("browserVersion"), locationIp: _aiLocation("ip"), locationCountry: _aiLocation("country"), locationProvince: _aiLocation("province"), locationCity: _aiLocation("city"), operationId: _aiOperation("id"), operationName: _aiOperation("name"), operationParentId: _aiOperation("parentId"), operationRootId: _aiOperation("rootId"), operationSyntheticSource: _aiOperation("syntheticSource"), operationCorrelationVector: _aiOperation("correlationVector"), sessionId: _aiSession("id"), sessionIsFirst: _aiSession("isFirst"), sessionIsNew: _aiSession("isNew"), userAccountAcquisitionDate: _aiUser("accountAcquisitionDate"), userAccountId: _aiUser("accountId"), userAgent: _aiUser("userAgent"), userId: _aiUser("id"), userStoreRegion: _aiUser("storeRegion"), userAuthUserId: _aiUser("authUserId"), userAnonymousUserAcquisitionDate: _aiUser("anonUserAcquisitionDate"), userAuthenticatedUserAcquisitionDate: _aiUser("authUserAcquisitionDate"), cloudName: _aiCloud("name"), cloudRole: _aiCloud("role"), cloudRoleVer: _aiCloud("roleVer"), cloudRoleInstance: _aiCloud("roleInstance"), cloudEnvironment: _aiCloud("environment"), cloudLocation: _aiCloud("location"), cloudDeploymentUnit: _aiCloud("deploymentUnit"), internalNodeName: _aiInternal("nodeName"), internalSdkVersion: _aiInternal("sdkVersion"), internalAgentVersion: _aiInternal("agentVersion"), internalSnippet: _aiInternal("snippet"), internalSdkSrc: _aiInternal("sdkSrc") }))); function createTelemetryItem(item, baseType, envelopeName, logger, customProperties, systemProperties) { var _a; envelopeName = dataSanitizeString(logger, envelopeName) || strNotSpecified; if (isNullOrUndefined(item) || isNullOrUndefined(baseType) || isNullOrUndefined(envelopeName)) { throwError("Input doesn't contain all required fields"); } var iKey = ""; if (item[strIkey]) { iKey = item[strIkey]; delete item[strIkey]; } var telemetryItem = (_a = {}, _a[_DYN_NAME$2 ] = envelopeName, _a.time = toISOString(new Date()), _a.iKey = iKey, _a.ext = systemProperties ? systemProperties : {}, _a.tags = [], _a.data = {}, _a.baseType = baseType, _a.baseData = item , _a); if (!isNullOrUndefined(customProperties)) { objForEachKey(customProperties, function (prop, value) { telemetryItem.data[prop] = value; }); } return telemetryItem; } var Extensions = { UserExt: "user", DeviceExt: "device", TraceExt: "trace", WebExt: "web", AppExt: "app", OSExt: "os", SessionExt: "ses", SDKExt: "sdk" }; var CtxTagKeys = new ContextTagKeys(); function createDomEvent(eventName) { var event = null; if (isFunction(Event)) { event = new Event(eventName); } else { var doc = getDocument(); if (doc && doc.createEvent) { event = doc.createEvent("Event"); event.initEvent(eventName, true, true); } } return event; } function _disableEvents(target, evtNamespace) { eventOff(target, null, null, evtNamespace); } function createOfflineListener(parentEvtNamespace) { var _document = getDocument(); var _navigator = getNavigator(); var _isListening = false; var listenerList = []; var rState = 1 ; if (_navigator && !isNullOrUndefined(_navigator.onLine) && !_navigator.onLine) { rState = 2 ; } var uState = 0 ; var _currentState = calCurrentState(); var _evtNamespace = mergeEvtNamespace(createUniqueNamespace("OfflineListener"), parentEvtNamespace); try { if (_enableEvents(getWindow())) { _isListening = true; } if (_document) { var target = _document.body || _document; if (target.ononline) { if (_enableEvents(target)) { _isListening = true; } } } } catch (e) { _isListening = false; } function _enableEvents(target) { var enabled = false; if (target) { enabled = eventOn(target, "online", _setOnline, _evtNamespace); if (enabled) { eventOn(target, "offline", _setOffline, _evtNamespace); } } return enabled; } function _isOnline() { return _currentState; } function calCurrentState() { if (uState === 2 || rState === 2 ) { return false; } return true; } function listnerNoticeCheck() { var newState = calCurrentState(); if (_currentState !== newState) { _currentState = newState; arrForEach(listenerList, function (callback) { var offlineState = { isOnline: _currentState, rState: rState, uState: uState }; try { callback(offlineState); } catch (e) { } }); } } function setOnlineState(newState) { uState = newState; listnerNoticeCheck(); } function _setOnline() { rState = 1 ; listnerNoticeCheck(); } function _setOffline() { rState = 2 ; listnerNoticeCheck(); } function _unload() { var win = getWindow(); if (win && _isListening) { _disableEvents(win, _evtNamespace); if (_document) { var target = _document.body || _document; if (!isUndefined(target.ononline)) { _disableEvents(target, _evtNamespace); } } _isListening = false; } } function addListener(callback) { listenerList[_DYN_PUSH$1 ](callback); return { rm: function () { var index = listenerList.indexOf(callback); if (index > -1) { return listenerList.splice(index, 1); } else { return; } } }; } return { isOnline: _isOnline, isListening: function () { return _isListening; }, unload: _unload, addListener: addListener, setOnlineState: setOnlineState }; } var PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin"; var BreezeChannelIdentifier = "AppInsightsChannelPlugin"; var AnalyticsPluginIdentifier = "ApplicationInsightsAnalytics"; var _DYN_TO_STRING$1 = "toString"; var _DYN_IS_STORAGE_USE_DISAB0 = "isStorageUseDisabled"; var _DYN__ADD_HOOK$1 = "_addHook"; var _DYN_CORE$1 = "core"; var _DYN_DATA_TYPE$1 = "dataType"; var _DYN_ENVELOPE_TYPE$1 = "envelopeType"; var _DYN_DIAG_LOG$1 = "diagLog"; var _DYN_TRACK = "track"; var _DYN_TRACK_PAGE_VIEW = "trackPageView"; var _DYN_TRACK_PREVIOUS_PAGE_1 = "trackPreviousPageVisit"; var _DYN_SEND_PAGE_VIEW_INTER2 = "sendPageViewInternal"; var _DYN_START_TIME$1 = "startTime"; var _DYN_PROPERTIES = "properties"; var _DYN_DURATION = "duration"; var _DYN_SEND_PAGE_VIEW_PERFO3 = "sendPageViewPerformanceInternal"; var _DYN_POPULATE_PAGE_VIEW_P4 = "populatePageViewPerformanceEvent"; var _DYN_HREF = "href"; var _DYN_SEND_EXCEPTION_INTER5 = "sendExceptionInternal"; var _DYN_EXCEPTION$1 = "exception"; var _DYN_ERROR = "error"; var _DYN__ONERROR = "_onerror"; var _DYN_ERROR_SRC = "errorSrc"; var _DYN_LINE_NUMBER = "lineNumber"; var _DYN_COLUMN_NUMBER = "columnNumber"; var _DYN_MESSAGE = "message"; var _DYN__CREATE_AUTO_EXCEPTI6 = "CreateAutoException"; var _DYN_ADD_TELEMETRY_INITIA7 = "addTelemetryInitializer"; var _DYN_OVERRIDE_PAGE_VIEW_D8 = "overridePageViewDuration"; var _DYN_AUTO_TRACK_PAGE_VISI9 = "autoTrackPageVisitTime"; var _DYN_IS_BROWSER_LINK_TRAC10 = "isBrowserLinkTrackingEnabled"; var _DYN_LENGTH$3 = "length"; var _DYN_ENABLE_AUTO_ROUTE_TR11 = "enableAutoRouteTracking"; var _DYN_ENABLE_UNHANDLED_PRO12 = "enableUnhandledPromiseRejectionTracking"; var _DYN_AUTO_UNHANDLED_PROMI13 = "autoUnhandledPromiseInstrumented"; var _DYN_GET_ENTRIES_BY_TYPE = "getEntriesByType"; var _DYN_IS_PERFORMANCE_TIMIN14 = "isPerformanceTimingSupported"; var _DYN_GET_PERFORMANCE_TIMI15 = "getPerformanceTiming"; var _DYN_NAVIGATION_START = "navigationStart"; var _DYN_SHOULD_COLLECT_DURAT16 = "shouldCollectDuration"; var _DYN_IS_PERFORMANCE_TIMIN17 = "isPerformanceTimingDataReady"; var _DYN_RESPONSE_START = "responseStart"; var _DYN_REQUEST_START = "requestStart"; var _DYN_LOAD_EVENT_END = "loadEventEnd"; var _DYN_RESPONSE_END = "responseEnd"; var _DYN_CONNECT_END = "connectEnd"; var _DYN_PAGE_VISIT_START_TIM18 = "pageVisitStartTime"; var PageViewManager = /** @class */ (function () { function PageViewManager(appInsights, overridePageViewDuration, core, pageViewPerformanceManager) { dynamicProto(PageViewManager, this, function (_self) { var queueTimer = null; var itemQueue = []; var pageViewPerformanceSent = false; var firstPageViewSent = false; var _logger; if (core) { _logger = core.logger; } function _flushChannels(isAsync) { if (core) { core.flush(isAsync, function () { }); } } function _startTimer() { if (!queueTimer) { queueTimer = scheduleTimeout((function () { queueTimer = null; var allItems = itemQueue.slice(0); var doFlush = false; itemQueue = []; arrForEach(allItems, function (item) { if (!item()) { itemQueue.push(item); } else { doFlush = true; } }); if (itemQueue[_DYN_LENGTH$3 ] > 0) { _startTimer(); } if (doFlush) { _flushChannels(true); } }), 100); } } function _addQueue(cb) { itemQueue.push(cb); _startTimer(); } _self[_DYN_TRACK_PAGE_VIEW ] = function (pageView, customProperties) { var name = pageView.name; if (isNullOrUndefined(name) || typeof name !== "string") { var doc = getDocument(); name = pageView.name = doc && doc.title || ""; } var uri = pageView.uri; if (isNullOrUndefined(uri) || typeof uri !== "string") { var location_1 = getLocation(); uri = pageView.uri = location_1 && location_1[_DYN_HREF ] || ""; } if (!firstPageViewSent) { var perf = getPerformance(); var navigationEntries = (perf && perf[_DYN_GET_ENTRIES_BY_TYPE ] && perf[_DYN_GET_ENTRIES_BY_TYPE ]("navigation")); if (navigationEntries && navigationEntries[0] && !isUndefined(perf.timeOrigin)) { var loadEventStart = navigationEntries[0].loadEventStart; pageView[_DYN_START_TIME$1 ] = new Date(perf.timeOrigin + loadEventStart); } else { var duration_1 = ((customProperties || pageView[_DYN_PROPERTIES ] || {})[_DYN_DURATION ] || 0); pageView[_DYN_START_TIME$1 ] = new Date(new Date().getTime() - duration_1); } firstPageViewSent = true; } if (!pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN14 ]()) { appInsights[_DYN_SEND_PAGE_VIEW_INTER2 ](pageView, customProperties); _flushChannels(true); if (!isWebWorker()) { _throwInternal(_logger, 2 , 25 , "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info."); } return; } var pageViewSent = false; var customDuration; var start = pageViewPerformanceManager[_DYN_GET_PERFORMANCE_TIMI15 ]()[_DYN_NAVIGATION_START ]; if (start > 0) { customDuration = dateTimeUtilsDuration(start, +new Date); if (!pageViewPerformanceManager[_DYN_SHOULD_COLLECT_DURAT16 ](customDuration)) { customDuration = undefined; } } var duration; if (!isNullOrUndefined(customProperties) && !isNullOrUndefined(customProperties[_DYN_DURATION ])) { duration = customProperties[_DYN_DURATION ]; } if (overridePageViewDuration || !isNaN(duration)) { if (isNaN(duration)) { if (!customProperties) { customProperties = {}; } customProperties[_DYN_DURATION ] = customDuration; } appInsights[_DYN_SEND_PAGE_VIEW_INTER2 ](pageView, customProperties); _flushChannels(true); pageViewSent = true; } var maxDurationLimit = 60000; if (!customProperties) { customProperties = {}; } _addQueue(function () { var processed = false; try { if (pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN17 ]()) { processed = true; var pageViewPerformance = { name: name, uri: uri }; pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P4 ](pageViewPerformance); if (!pageViewPerformance.isValid && !pageViewSent) { customProperties[_DYN_DURATION ] = customDuration; appInsights[_DYN_SEND_PAGE_VIEW_INTER2 ](pageView, customProperties); } else { if (!pageViewSent) { customProperties[_DYN_DURATION ] = pageViewPerformance.durationMs; appInsights[_DYN_SEND_PAGE_VIEW_INTER2 ](pageView, customProperties); } if (!pageViewPerformanceSent) { appInsights[_DYN_SEND_PAGE_VIEW_PERFO3 ](pageViewPerformance, customProperties); pageViewPerformanceSent = true; } } } else if (start > 0 && dateTimeUtilsDuration(start, +new Date) > maxDurationLimit) { processed = true; if (!pageViewSent) { customProperties[_DYN_DURATION ] = maxDurationLimit; appInsights[_DYN_SEND_PAGE_VIEW_INTER2 ](pageView, customProperties); } } } catch (e) { _throwInternal(_logger, 1 , 38 , "trackPageView failed on page load calculation: " + getExceptionName(e), { exception: dumpObj(e) }); } return processed; }); }; _self.teardown = function (unloadCtx, unloadState) { if (queueTimer) { queueTimer.cancel(); queueTimer = null; var allItems = itemQueue.slice(0); itemQueue = []; arrForEach(allItems, function (item) { if (item()) ; }); } }; }); } PageViewManager.__ieDyn=1; return PageViewManager; }()); var MAX_DURATION_ALLOWED = 3600000; var botAgentNames = ["googlebot", "adsbot-google", "apis-google", "mediapartners-google"]; function _isPerformanceTimingSupported() { var perf = getPerformance(); return perf && !!perf.timing; } function _isPerformanceNavigationTimingSupported() { var perf = getPerformance(); return perf && perf.getEntriesByType && perf.getEntriesByType("navigation")[_DYN_LENGTH$3 ] > 0; } function _isPerformanceTimingDataReady() { var perf = getPerformance(); var timing = perf ? perf.timing : 0; return timing && timing.domainLookupStart > 0 && timing[_DYN_NAVIGATION_START ] > 0 && timing[_DYN_RESPONSE_START ] > 0 && timing[_DYN_REQUEST_START ] > 0 && timing[_DYN_LOAD_EVENT_END ] > 0 && timing[_DYN_RESPONSE_END ] > 0 && timing[_DYN_CONNECT_END ] > 0 && timing.domLoading > 0; } function _getPerformanceTiming() { if (_isPerformanceTimingSupported()) { return getPerformance().timing; } return null; } function _getPerformanceNavigationTiming() { if (_isPerformanceNavigationTimingSupported()) { return getPerformance()[_DYN_GET_ENTRIES_BY_TYPE ]("navigation")[0]; } return null; } function _shouldCollectDuration() { var durations = []; for (var _i = 0; _i < arguments.length; _i++) { durations[_i] = arguments[_i]; } var _navigator = getNavigator() || {}; var userAgent = _navigator.userAgent; var isGoogleBot = false; if (userAgent) { for (var i = 0; i < botAgentNames[_DYN_LENGTH$3 ]; i++) { isGoogleBot = isGoogleBot || strIndexOf(userAgent.toLowerCase(), botAgentNames[i]) !== -1; } } if (isGoogleBot) { return false; } else { for (var i = 0; i < durations[_DYN_LENGTH$3 ]; i++) { if (durations[i] < 0 || durations[i] >= MAX_DURATION_ALLOWED) { return false; } } } return true; } var PageViewPerformanceManager = /** @class */ (function () { function PageViewPerformanceManager(core) { var _logger = safeGetLogger(core); dynamicProto(PageViewPerformanceManager, this, function (_self) { _self[_DYN_POPULATE_PAGE_VIEW_P4 ] = function (pageViewPerformance) { pageViewPerformance.isValid = false; var navigationTiming = _getPerformanceNavigationTiming(); var timing = _getPerformanceTiming(); var total = 0; var network = 0; var request = 0; var response = 0; var dom = 0; if (navigationTiming || timing) { if (navigationTiming) { total = navigationTiming[_DYN_DURATION ]; network = navigationTiming[_DYN_START_TIME$1 ] === 0 ? navigationTiming[_DYN_CONNECT_END ] : dateTimeUtilsDuration(navigationTiming[_DYN_START_TIME$1 ], navigationTiming[_DYN_CONNECT_END ]); request = dateTimeUtilsDuration(navigationTiming.requestStart, navigationTiming[_DYN_RESPONSE_START ]); response = dateTimeUtilsDuration(navigationTiming[_DYN_RESPONSE_START ], navigationTiming[_DYN_RESPONSE_END ]); dom = dateTimeUtilsDuration(navigationTiming.responseEnd, navigationTiming[_DYN_LOAD_EVENT_END ]); } else { total = dateTimeUtilsDuration(timing[_DYN_NAVIGATION_START ], timing[_DYN_LOAD_EVENT_END ]); network = dateTimeUtilsDuration(timing[_DYN_NAVIGATION_START ], timing[_DYN_CONNECT_END ]); request = dateTimeUtilsDuration(timing.requestStart, timing[_DYN_RESPONSE_START ]); response = dateTimeUtilsDuration(timing[_DYN_RESPONSE_START ], timing[_DYN_RESPONSE_END ]); dom = dateTimeUtilsDuration(timing.responseEnd, timing[_DYN_LOAD_EVENT_END ]); } if (total === 0) { _throwInternal(_logger, 2 , 10 , "error calculating page view performance.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (!_self[_DYN_SHOULD_COLLECT_DURAT16 ](total, network, request, response, dom)) { _throwInternal(_logger, 2 , 45 , "Invalid page load duration value. Browser perf data won't be sent.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (total < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(dom)) { _throwInternal(_logger, 2 , 8 , "client performance math error.", { total: total, network: network, request: request, response: response, dom: dom }); } else { pageViewPerformance.durationMs = total; pageViewPerformance.perfTotal = pageViewPerformance[_DYN_DURATION ] = msToTimeSpan(total); pageViewPerformance.networkConnect = msToTimeSpan(network); pageViewPerformance.sentRequest = msToTimeSpan(request); pageViewPerformance.receivedResponse = msToTimeSpan(response); pageViewPerformance.domProcessing = msToTimeSpan(dom); pageViewPerformance.isValid = true; } } }; _self[_DYN_GET_PERFORMANCE_TIMI15 ] = _getPerformanceTiming; _self[_DYN_IS_PERFORMANCE_TIMIN14 ] = _isPerformanceTimingSupported; _self[_DYN_IS_PERFORMANCE_TIMIN17 ] = _isPerformanceTimingDataReady; _self[_DYN_SHOULD_COLLECT_DURAT16 ] = _shouldCollectDuration; }); } PageViewPerformanceManager.__ieDyn=1; return PageViewPerformanceManager; }()); var PageVisitTimeManager = /** @class */ (function () { function PageVisitTimeManager(logger, pageVisitTimeTrackingHandler) { var prevPageVisitDataKeyName = "prevPageVisitData"; dynamicProto(PageVisitTimeManager, this, function (_self) { _self[_DYN_TRACK_PREVIOUS_PAGE_1 ] = function (currentPageName, currentPageUrl) { try { var prevPageVisitTimeData = restartPageVisitTimer(currentPageName, currentPageUrl); if (prevPageVisitTimeData) { pageVisitTimeTrackingHandler(prevPageVisitTimeData.pageName, prevPageVisitTimeData.pageUrl, prevPageVisitTimeData.pageVisitTime); } } catch (e) { _warnToConsole(logger, "Auto track page visit time failed, metric will not be collected: " + dumpObj(e)); } }; function restartPageVisitTimer(pageName, pageUrl) { var prevPageVisitData = null; try { prevPageVisitData = stopPageVisitTimer(); if (utlCanUseSessionStorage()) { if (utlGetSessionStorage(logger, prevPageVisitDataKeyName) != null) { throwError("Cannot call startPageVisit consecutively without first calling stopPageVisit"); } var currPageVisitDataStr = getJSON().stringify(new PageVisitData(pageName, pageUrl)); utlSetSessionStorage(logger, prevPageVisitDataKeyName, currPageVisitDataStr); } } catch (e) { _warnToConsole(logger, "Call to restart failed: " + dumpObj(e)); prevPageVisitData = null; } return prevPageVisitData; } function stopPageVisitTimer() { var prevPageVisitData = null; try { if (utlCanUseSessionStorage()) { var pageVisitEndTime = utcNow(); var pageVisitDataJsonStr = utlGetSessionStorage(logger, prevPageVisitDataKeyName); if (pageVisitDataJsonStr && hasJSON()) { prevPageVisitData = getJSON().parse(pageVisitDataJsonStr); prevPageVisitData.pageVisitTime = pageVisitEndTime - prevPageVisitData[_DYN_PAGE_VISIT_START_TIM18 ]; utlRemoveSessionStorage(logger, prevPageVisitDataKeyName); } } } catch (e) { _warnToConsole(logger, "Stop page visit timer failed: " + dumpObj(e)); prevPageVisitData = null; } return prevPageVisitData; } objDefine(_self, "_logger", { g: function () { return logger; } }); objDefine(_self, "pageVisitTimeTrackingHandler", { g: function () { return pageVisitTimeTrackingHandler; } }); }); } PageVisitTimeManager.__ieDyn=1; return PageVisitTimeManager; }()); var PageVisitData = /** @class */ (function () { function PageVisitData(pageName, pageUrl) { this[_DYN_PAGE_VISIT_START_TIM18 ] = utcNow(); this.pageName = pageName; this.pageUrl = pageUrl; } return PageVisitData; }()); var Timing = /** @class */ (function () { function Timing(logger, name) { var _self = this; var _events = {}; _self.start = function (name) { if (typeof _events[name] !== "undefined") { _throwInternal(logger, 2 , 62 , "start was called more than once for this event without calling stop.", { name: name, key: name }, true); } _events[name] = +new Date; }; _self.stop = function (name, url, properties, measurements) { var start = _events[name]; if (isNaN(start)) { _throwInternal(logger, 2 , 63 , "stop was called without a corresponding start.", { name: name, key: name }, true); } else { var end = +new Date; var duration = dateTimeUtilsDuration(start, end); _self.action(name, url, duration, properties, measurements); } delete _events[name]; _events[name] = undefined; }; } return Timing; }()); var _a$5; var strEvent = "event"; function _dispatchEvent(target, evnt) { if (target && target.dispatchEvent && evnt) { target.dispatchEvent(evnt); } } function _getReason(error) { if (error && error.reason) { var reason = error.reason; if (!isString(reason) && isFunction(reason[_DYN_TO_STRING$1 ])) { return reason[_DYN_TO_STRING$1 ](); } return dumpObj(reason); } return error || ""; } var MinMilliSeconds = 60000; var defaultValues = objDeepFreeze((_a$5 = { sessionRenewalMs: cfgDfSet(_chkConfigMilliseconds, 30 * 60 * 1000), sessionExpirationMs: cfgDfSet(_chkConfigMilliseconds, 24 * 60 * 60 * 1000), disableExceptionTracking: cfgDfBoolean() }, _a$5[_DYN_AUTO_TRACK_PAGE_VISI9 ] = cfgDfBoolean(), _a$5[_DYN_OVERRIDE_PAGE_VIEW_D8 ] = cfgDfBoolean(), _a$5[_DYN_ENABLE_UNHANDLED_PRO12 ] = cfgDfBoolean(), _a$5[_DYN_AUTO_UNHANDLED_PROMI13 ] = false, _a$5.samplingPercentage = cfgDfValidate(_chkSampling$1, 100), _a$5[_DYN_IS_STORAGE_USE_DISAB0 ] = cfgDfBoolean(), _a$5[_DYN_IS_BROWSER_LINK_TRAC10 ] = cfgDfBoolean(), _a$5[_DYN_ENABLE_AUTO_ROUTE_TR11 ] = cfgDfBoolean(), _a$5.namePrefix = cfgDfString(), _a$5.enableDebug = cfgDfBoolean(), _a$5.disableFlushOnBeforeUnload = cfgDfBoolean(), _a$5.disableFlushOnUnload = cfgDfBoolean(false, "disableFlushOnBeforeUnload"), _a$5)); function _chkConfigMilliseconds(value, defValue) { value = value || defValue; if (value < MinMilliSeconds) { value = MinMilliSeconds; } return +value; } function _chkSampling$1(value) { return !isNaN(value) && value > 0 && value <= 100; } function _updateStorageUsage(extConfig) { if (!isUndefined(extConfig[_DYN_IS_STORAGE_USE_DISAB0 ])) { if (extConfig[_DYN_IS_STORAGE_USE_DISAB0 ]) { utlDisableStorage(); } else { utlEnableStorage(); } } } var AnalyticsPlugin = /** @class */ (function (_super) { __extendsFn(AnalyticsPlugin, _super); function AnalyticsPlugin() { var _this = _super.call(this) || this; _this.identifier = AnalyticsPluginIdentifier; _this.priority = 180; _this.autoRoutePVDelay = 500; var _eventTracking; var _pageTracking; var _pageViewManager; var _pageViewPerformanceManager; var _pageVisitTimeManager; var _preInitTelemetryInitializers; var _isBrowserLinkTrackingEnabled; var _browserLinkInitializerAdded; var _enableAutoRouteTracking; var _historyListenerAdded; var _disableExceptionTracking; var _autoExceptionInstrumented; var _enableUnhandledPromiseRejectionTracking; var _autoUnhandledPromiseInstrumented; var _extConfig; var _autoTrackPageVisitTime; var _prevUri; var _currUri; var _evtNamespace; dynamicProto(AnalyticsPlugin, _this, function (_self, _base) { var _addHook = _base[_DYN__ADD_HOOK$1 ]; _initDefaults(); _self.getCookieMgr = function () { return safeGetCookieMgr(_self[_DYN_CORE$1 ]); }; _self.processTelemetry = function (env, itemCtx) { _self.processNext(env, itemCtx); }; _self.trackEvent = function (event, customProperties) { try { var telemetryItem = createTelemetryItem(event, Event$1[_DYN_DATA_TYPE$1 ], Event$1[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), customProperties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); } catch (e) { _throwInternal(2 , 39 , "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.startTrackEvent = function (name) { try { _eventTracking.start(name); } catch (e) { _throwInternal(1 , 29 , "startTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.stopTrackEvent = function (name, properties, measurements) { try { _eventTracking.stop(name, undefined, properties, measurements); } catch (e) { _throwInternal(1 , 30 , "stopTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.trackTrace = function (trace, customProperties) { try { var telemetryItem = createTelemetryItem(trace, Trace[_DYN_DATA_TYPE$1 ], Trace[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), customProperties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); } catch (e) { _throwInternal(2 , 39 , "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.trackMetric = function (metric, customProperties) { try { var telemetryItem = createTelemetryItem(metric, Metric[_DYN_DATA_TYPE$1 ], Metric[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), customProperties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); } catch (e) { _throwInternal(1 , 36 , "trackMetric failed, metric will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self[_DYN_TRACK_PAGE_VIEW ] = function (pageView, customProperties) { try { var inPv = pageView || {}; _pageViewManager[_DYN_TRACK_PAGE_VIEW ](inPv, __assignFn(__assignFn(__assignFn({}, inPv.properties), inPv.measurements), customProperties)); if (_autoTrackPageVisitTime) { _pageVisitTimeManager[_DYN_TRACK_PREVIOUS_PAGE_1 ](inPv.name, inPv.uri); } } catch (e) { _throwInternal(1 , 37 , "trackPageView failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self[_DYN_SEND_PAGE_VIEW_INTER2 ] = function (pageView, properties, systemProperties) { var doc = getDocument(); if (doc) { pageView.refUri = pageView.refUri === undefined ? doc.referrer : pageView.refUri; } if (isNullOrUndefined(pageView[_DYN_START_TIME$1 ])) { var duration = ((properties || pageView[_DYN_PROPERTIES ] || {})[_DYN_DURATION ] || 0); pageView[_DYN_START_TIME$1 ] = new Date(new Date().getTime() - duration); } var telemetryItem = createTelemetryItem(pageView, PageView[_DYN_DATA_TYPE$1 ], PageView[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), properties, systemProperties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); }; _self[_DYN_SEND_PAGE_VIEW_PERFO3 ] = function (pageViewPerformance, properties, systemProperties) { var telemetryItem = createTelemetryItem(pageViewPerformance, PageViewPerformance[_DYN_DATA_TYPE$1 ], PageViewPerformance[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), properties, systemProperties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); }; _self.trackPageViewPerformance = function (pageViewPerformance, customProperties) { var inPvp = pageViewPerformance || {}; try { _pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P4 ](inPvp); _self[_DYN_SEND_PAGE_VIEW_PERFO3 ](inPvp, customProperties); } catch (e) { _throwInternal(1 , 37 , "trackPageViewPerformance failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.startTrackPage = function (name) { try { if (typeof name !== "string") { var doc = getDocument(); name = doc && doc.title || ""; } _pageTracking.start(name); } catch (e) { _throwInternal(1 , 31 , "startTrackPage failed, page view may not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.stopTrackPage = function (name, url, properties, measurement) { try { if (typeof name !== "string") { var doc = getDocument(); name = doc && doc.title || ""; } if (typeof url !== "string") { var loc = getLocation(); url = loc && loc[_DYN_HREF ] || ""; } _pageTracking.stop(name, url, properties, measurement); if (_autoTrackPageVisitTime) { _pageVisitTimeManager[_DYN_TRACK_PREVIOUS_PAGE_1 ](name, url); } } catch (e) { _throwInternal(1 , 32 , "stopTrackPage failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self[_DYN_SEND_EXCEPTION_INTER5 ] = function (exception, customProperties, systemProperties) { var theError = (exception && (exception[_DYN_EXCEPTION$1 ] || exception[_DYN_ERROR ])) || isError(exception) && exception || { name: (exception && typeof exception), message: exception || strNotSpecified }; exception = exception || {}; var exceptionPartB = new Exception(_self[_DYN_DIAG_LOG$1 ](), theError, exception[_DYN_PROPERTIES ] || customProperties, exception.measurements, exception.severityLevel, exception.id).toInterface(); var telemetryItem = createTelemetryItem(exceptionPartB, Exception[_DYN_DATA_TYPE$1 ], Exception[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), customProperties, systemProperties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); }; _self.trackException = function (exception, customProperties) { if (exception && !exception[_DYN_EXCEPTION$1 ] && exception[_DYN_ERROR ]) { exception[_DYN_EXCEPTION$1 ] = exception[_DYN_ERROR ]; } try { _self[_DYN_SEND_EXCEPTION_INTER5 ](exception, customProperties); } catch (e) { _throwInternal(1 , 35 , "trackException failed, exception will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self[_DYN__ONERROR ] = function (exception) { var error = exception && exception[_DYN_ERROR ]; var evt = exception && exception.evt; try { if (!evt) { var _window = getWindow(); if (_window) { evt = _window[strEvent]; } } var url = (exception && exception.url) || (getDocument() || {}).URL; var errorSrc = exception[_DYN_ERROR_SRC ] || "window.onerror@" + url + ":" + (exception[_DYN_LINE_NUMBER ] || 0) + ":" + (exception[_DYN_COLUMN_NUMBER ] || 0); var properties = { errorSrc: errorSrc, url: url, lineNumber: exception[_DYN_LINE_NUMBER ] || 0, columnNumber: exception[_DYN_COLUMN_NUMBER ] || 0, message: exception[_DYN_MESSAGE ] }; if (isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception[_DYN_ERROR ])) { _sendCORSException(Exception[_DYN__CREATE_AUTO_EXCEPTI6 ]("Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.", url, exception[_DYN_LINE_NUMBER ] || 0, exception[_DYN_COLUMN_NUMBER ] || 0, error, evt, null, errorSrc), properties); } else { if (!exception[_DYN_ERROR_SRC ]) { exception[_DYN_ERROR_SRC ] = errorSrc; } _self.trackException({ exception: exception, severityLevel: 3 }, properties); } } catch (e) { var errorString = error ? (error.name + ", " + error[_DYN_MESSAGE ]) : "null"; _throwInternal(1 , 11 , "_onError threw exception while logging error, error will not be collected: " + getExceptionName(e), { exception: dumpObj(e), errorString: errorString }); } }; _self[_DYN_ADD_TELEMETRY_INITIA7 ] = function (telemetryInitializer) { if (_self[_DYN_CORE$1 ]) { return _self[_DYN_CORE$1 ][_DYN_ADD_TELEMETRY_INITIA7 ](telemetryInitializer); } if (!_preInitTelemetryInitializers) { _preInitTelemetryInitializers = []; } _preInitTelemetryInitializers.push(telemetryInitializer); }; _self.initialize = function (config, core, extensions, pluginChain) { if (_self.isInitialized()) { return; } if (isNullOrUndefined(core)) { throwError("Error initializing"); } _base.initialize(config, core, extensions, pluginChain); try { _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace()); if (_preInitTelemetryInitializers) { arrForEach(_preInitTelemetryInitializers, function (initializer) { core[_DYN_ADD_TELEMETRY_INITIA7 ](initializer); }); _preInitTelemetryInitializers = null; } _populateDefaults(config); _pageViewPerformanceManager = new PageViewPerformanceManager(_self[_DYN_CORE$1 ]); _pageViewManager = new PageViewManager(_self, _extConfig.overridePageViewDuration, _self[_DYN_CORE$1 ], _pageViewPerformanceManager); _pageVisitTimeManager = new PageVisitTimeManager(_self[_DYN_DIAG_LOG$1 ](), function (pageName, pageUrl, pageVisitTime) { return trackPageVisitTime(pageName, pageUrl, pageVisitTime); }); _eventTracking = new Timing(_self[_DYN_DIAG_LOG$1 ](), "trackEvent"); _eventTracking.action = function (name, url, duration, properties, measurements) { if (!properties) { properties = {}; } if (!measurements) { measurements = {}; } properties.duration = duration[_DYN_TO_STRING$1 ](); _self.trackEvent({ name: name, properties: properties, measurements: measurements }); }; _pageTracking = new Timing(_self[_DYN_DIAG_LOG$1 ](), "trackPageView"); _pageTracking.action = function (name, url, duration, properties, measurements) { if (isNullOrUndefined(properties)) { properties = {}; } properties.duration = duration[_DYN_TO_STRING$1 ](); var pageViewItem = { name: name, uri: url, properties: properties, measurements: measurements }; _self[_DYN_SEND_PAGE_VIEW_INTER2 ](pageViewItem, properties); }; if (hasWindow()) { _updateExceptionTracking(); _updateLocationChange(); } } catch (e) { _self.setInitialized(false); throw e; } }; _self._doTeardown = function (unloadCtx, unloadState) { _pageViewManager && _pageViewManager.teardown(unloadCtx, unloadState); eventOff(window, null, null, _evtNamespace); _initDefaults(); }; function _populateDefaults(config) { var identifier = _self.identifier; var core = _self[_DYN_CORE$1 ]; _self[_DYN__ADD_HOOK$1 ](onConfigChange(config, function () { var ctx = createProcessTelemetryContext(null, config, core); _extConfig = ctx.getExtCfg(identifier, defaultValues); _autoTrackPageVisitTime = _extConfig[_DYN_AUTO_TRACK_PAGE_VISI9 ]; if (config.storagePrefix) { utlSetStoragePrefix(config.storagePrefix); } _updateStorageUsage(_extConfig); _isBrowserLinkTrackingEnabled = _extConfig[_DYN_IS_BROWSER_LINK_TRAC10 ]; _addDefaultTelemetryInitializers(); })); } function trackPageVisitTime(pageName, pageUrl, pageVisitTime) { var properties = { PageName: pageName, PageUrl: pageUrl }; _self.trackMetric({ name: "PageVisitTime", average: pageVisitTime, max: pageVisitTime, min: pageVisitTime, sampleCount: 1 }, properties); } function _addDefaultTelemetryInitializers() { if (!_browserLinkInitializerAdded && _isBrowserLinkTrackingEnabled) { var browserLinkPaths_1 = ["/browserLinkSignalR/", "/__browserLink/"]; var dropBrowserLinkRequests = function (envelope) { if (_isBrowserLinkTrackingEnabled && envelope.baseType === RemoteDependencyData[_DYN_DATA_TYPE$1 ]) { var remoteData = envelope.baseData; if (remoteData) { for (var i = 0; i < browserLinkPaths_1[_DYN_LENGTH$3 ]; i++) { if (remoteData.target && strIndexOf(remoteData.target, browserLinkPaths_1[i]) >= 0) { return false; } } } } return true; }; _self[_DYN__ADD_HOOK$1 ](_self[_DYN_ADD_TELEMETRY_INITIA7 ](dropBrowserLinkRequests)); _browserLinkInitializerAdded = true; } } function _sendCORSException(exception, properties) { var telemetryItem = createTelemetryItem(exception, Exception[_DYN_DATA_TYPE$1 ], Exception[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), properties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); } function _updateExceptionTracking() { var _window = getWindow(); var locn = getLocation(true); _self[_DYN__ADD_HOOK$1 ](onConfigChange(_extConfig, function () { _disableExceptionTracking = _extConfig.disableExceptionTracking; if (!_disableExceptionTracking && !_autoExceptionInstrumented && !_extConfig.autoExceptionInstrumented) { _addHook(InstrumentEvent(_window, "onerror", { ns: _evtNamespace, rsp: function (callDetails, message, url, lineNumber, columnNumber, error) { if (!_disableExceptionTracking && callDetails.rslt !== true) { _self[_DYN__ONERROR ](Exception[_DYN__CREATE_AUTO_EXCEPTI6 ](message, url, lineNumber, columnNumber, error, callDetails.evt)); } } }, false)); _autoExceptionInstrumented = true; } })); _addUnhandledPromiseRejectionTracking(_window, locn); } function _updateLocationChange() { var win = getWindow(); var locn = getLocation(true); _self[_DYN__ADD_HOOK$1 ](onConfigChange(_extConfig, function () { _enableAutoRouteTracking = _extConfig[_DYN_ENABLE_AUTO_ROUTE_TR11 ] === true; if (win && _enableAutoRouteTracking && !_historyListenerAdded && hasHistory()) { var _history = getHistory(); if (isFunction(_history.pushState) && isFunction(_history.replaceState) && typeof Event !== strShimUndefined) { _addHistoryListener(win, _history, locn); } } })); } function _getDistributedTraceCtx() { var distributedTraceCtx = null; if (_self[_DYN_CORE$1 ] && _self[_DYN_CORE$1 ].getTraceCtx) { distributedTraceCtx = _self[_DYN_CORE$1 ].getTraceCtx(false); } if (!distributedTraceCtx) { var properties = _self[_DYN_CORE$1 ].getPlugin(PropertiesPluginIdentifier); if (properties) { var context = properties.plugin.context; if (context) { distributedTraceCtx = createDistributedTraceContextFromTrace(context.telemetryTrace); } } } return distributedTraceCtx; } function _addHistoryListener(win, history, locn) { if (_historyListenerAdded) { return; } var namePrefix = _extConfig.namePrefix || ""; function _popstateHandler() { if (_enableAutoRouteTracking) { _dispatchEvent(win, createDomEvent(namePrefix + "locationchange")); } } function _locationChangeHandler() { if (_currUri) { _prevUri = _currUri; _currUri = locn && locn[_DYN_HREF ] || ""; } else { _currUri = locn && locn[_DYN_HREF ] || ""; } if (_enableAutoRouteTracking) { var distributedTraceCtx = _getDistributedTraceCtx(); if (distributedTraceCtx) { distributedTraceCtx.setTraceId(generateW3CId()); var traceLocationName = "_unknown_"; if (locn && locn.pathname) { traceLocationName = locn.pathname + (locn.hash || ""); } distributedTraceCtx.setName(dataSanitizeString(_self[_DYN_DIAG_LOG$1 ](), traceLocationName)); } scheduleTimeout((function (uri) { _self[_DYN_TRACK_PAGE_VIEW ]({ refUri: uri, properties: { duration: 0 } }); }).bind(_self, _prevUri), _self.autoRoutePVDelay); } } _addHook(InstrumentEvent(history, "pushState", { ns: _evtNamespace, rsp: function () { if (_enableAutoRouteTracking) { _dispatchEvent(win, createDomEvent(namePrefix + "pushState")); _dispatchEvent(win, createDomEvent(namePrefix + "locationchange")); } } }, true)); _addHook(InstrumentEvent(history, "replaceState", { ns: _evtNamespace, rsp: function () { if (_enableAutoRouteTracking) { _dispatchEvent(win, createDomEvent(namePrefix + "replaceState")); _dispatchEvent(win, createDomEvent(namePrefix + "locationchange")); } } }, true)); eventOn(win, namePrefix + "popstate", _popstateHandler, _evtNamespace); eventOn(win, namePrefix + "locationchange", _locationChangeHandler, _evtNamespace); _historyListenerAdded = true; } function _addUnhandledPromiseRejectionTracking(_window, _location) { _self[_DYN__ADD_HOOK$1 ](onConfigChange(_extConfig, function () { _enableUnhandledPromiseRejectionTracking = _extConfig[_DYN_ENABLE_UNHANDLED_PRO12 ] === true; _autoExceptionInstrumented = _autoExceptionInstrumented || _extConfig[_DYN_AUTO_UNHANDLED_PROMI13 ]; if (_enableUnhandledPromiseRejectionTracking && !_autoUnhandledPromiseInstrumented) { _addHook(InstrumentEvent(_window, "onunhandledrejection", { ns: _evtNamespace, rsp: function (callDetails, error) { if (_enableUnhandledPromiseRejectionTracking && callDetails.rslt !== true) { _self[_DYN__ONERROR ](Exception[_DYN__CREATE_AUTO_EXCEPTI6 ](_getReason(error), _location ? _location[_DYN_HREF ] : "", 0, 0, error, callDetails.evt)); } } }, false)); _extConfig[_DYN_AUTO_UNHANDLED_PROMI13 ] = _autoUnhandledPromiseInstrumented = true; } })); } function _throwInternal(severity, msgId, msg, properties, isUserAct) { _self[_DYN_DIAG_LOG$1 ]().throwInternal(severity, msgId, msg, properties, isUserAct); } function _initDefaults() { _eventTracking = null; _pageTracking = null; _pageViewManager = null; _pageViewPerformanceManager = null; _pageVisitTimeManager = null; _preInitTelemetryInitializers = null; _isBrowserLinkTrackingEnabled = false; _browserLinkInitializerAdded = false; _enableAutoRouteTracking = false; _historyListenerAdded = false; _disableExceptionTracking = false; _autoExceptionInstrumented = false; _enableUnhandledPromiseRejectionTracking = false; _autoUnhandledPromiseInstrumented = false; _autoTrackPageVisitTime = false; var location = getLocation(true); _prevUri = location && location[_DYN_HREF ] || ""; _currUri = null; _evtNamespace = null; _extConfig = null; objDefine(_self, "config", { g: function () { return _extConfig; } }); } objDefine(_self, "_pageViewManager", { g: function () { return _pageViewManager; } }); objDefine(_self, "_pageViewPerformanceManager", { g: function () { return _pageViewPerformanceManager; } }); objDefine(_self, "_pageVisitTimeManager", { g: function () { return _pageVisitTimeManager; } }); objDefine(_self, "_evtNamespace", { g: function () { return "." + _evtNamespace; } }); }); return _this; } AnalyticsPlugin.Version = '3.0.6'; return AnalyticsPlugin; }(BaseTelemetryPlugin)); var _DYN_FEATURE_OPT_IN = "featureOptIn"; var _DYN_ON_CFG_CHANGE_RECEIV0 = "onCfgChangeReceive"; var _DYN_NON_OVERRIDE_CONFIGS = "nonOverrideConfigs"; var _DYN_SCHEDULE_FETCH_TIMEO1 = "scheduleFetchTimeout"; function replaceByNonOverrideCfg(cfg, nonOverrideConfigs, curLevel, maxLevel) { try { var exceedMaxLevel = curLevel > maxLevel; if (exceedMaxLevel) { cfg = null; } var curCfg_1 = curLevel == 0 ? objExtend$1({}, cfg) : cfg; if (curCfg_1 && nonOverrideConfigs && !exceedMaxLevel) { objForEachKey(curCfg_1, function (key) { var nonOverrideVal = nonOverrideConfigs[key]; if (!!nonOverrideVal) { if (isObject(curCfg_1[key]) && isObject(nonOverrideVal)) { curCfg_1[key] = replaceByNonOverrideCfg(curCfg_1[key], nonOverrideVal, ++curLevel, maxLevel); } else { delete curCfg_1[key]; } } }); } return curCfg_1; } catch (e) { } return cfg; } var F = "featureOptIn."; var M = ".mode"; var ON = ".onCfg"; var OFF = ".offCfg"; function resolveCdnFeatureCfg(field, cdnCfg, userOptInDetails) { var _a; if (!cdnCfg || !cdnCfg.enabled) { return null; } var cdnFt = (cdnCfg[_DYN_FEATURE_OPT_IN ] || {})[field] || { mode: 1 }; var cdnM = cdnFt.mode; var cdnOnV = cdnFt.onCfg; var cdnOffV = cdnFt.offCfg; var userFt = (userOptInDetails || {})[field] || { mode: 2 }; var userM = userFt.mode; var userOnV = userFt.onCfg; var userOffV = userFt.offCfg; var blockCdn = !!userFt.blockCdnCfg; var mFld = F + field + M; var onFld = F + field + ON; var offFld = F + field + OFF; var mode = userM; var onV = userOnV; var offV = userOffV; if (!blockCdn) { if (cdnM === 4 || cdnM === 5 ) { mode = (cdnM == 4 ? 3 : 2 ); onV = cdnOnV || userOnV; offV = cdnOffV || userOffV; } else if (cdnM === 2 || userM === 2 ) { mode = 2 ; onV = userOnV || cdnOnV; offV = userOffV || cdnOffV; } else if (cdnM === 3 ) { mode = 3 ; onV = userOnV || cdnOnV; offV = userOffV || cdnOffV; } else if (cdnM === 1 && userM === 1 ) { mode = 1 ; } } return _a = {}, _a[mFld] = mode, _a[onFld] = onV, _a[offFld] = offV, _a; } function applyCdnfeatureCfg(cdnCfg, core) { try { if (!cdnCfg || !cdnCfg.enabled) { return null; } if (!cdnCfg[_DYN_FEATURE_OPT_IN ]) { return cdnCfg.config; } var optInMap = cdnCfg[_DYN_FEATURE_OPT_IN ]; var cdnConfig_1 = cdnCfg.config || {}; objForEachKey(optInMap, function (key) { var featureVal = resolveCdnFeatureCfg(key, cdnCfg, core.config[_DYN_FEATURE_OPT_IN ]); if (!isNullOrUndefined(featureVal)) { objForEachKey(featureVal, function (config, val) { setValueByKey(cdnConfig_1, config, val); }); _overrideCdnCfgByFeature(key, featureVal, cdnConfig_1); } }); return cdnConfig_1; } catch (e) { } return null; } function _overrideCdnCfgByFeature(field, ftVal, config) { var mode = ftVal[F + field + M]; var val = ftVal[F + field + ON]; var dVal = ftVal[F + field + OFF]; var target = null; if (mode === 3 ) { target = val; } if (mode === 2 ) { target = dVal; } if (target) { objForEachKey(target, function (key, cfg) { setValueByKey(config, key, cfg); }); } } var _a$4; var EVENT_NAME = "ai_cfgsync"; var STR_GET_METHOD = "GET"; var FETCH_TIMEOUT = 1800000; var udfVal = undefined; var defaultNonOverrideCfg = { instrumentationKey: true, connectionString: true, endpointUrl: true }; var _defaultConfig$2 = objDeepFreeze((_a$4 = { syncMode: 1 , blkCdnCfg: udfVal, customEvtName: udfVal, cfgUrl: udfVal, overrideSyncFn: udfVal, overrideFetchFn: udfVal }, _a$4[_DYN_ON_CFG_CHANGE_RECEIV0 ] = udfVal, _a$4[_DYN_SCHEDULE_FETCH_TIMEO1 ] = FETCH_TIMEOUT, _a$4[_DYN_NON_OVERRIDE_CONFIGS ] = defaultNonOverrideCfg, _a$4)); var CfgSyncPlugin = /** @class */ (function (_super) { __extendsFn(CfgSyncPlugin, _super); function CfgSyncPlugin() { var _this = _super.call(this) || this; _this.priority = 198; _this.identifier = "AppInsightsCfgSyncPlugin"; var _extensionConfig; var _mainConfig; var _evtName; var _evtNamespace; var _cfgUrl; var _timeoutHandle; var _receiveChanges; var _broadcastChanges; var _blkCdnCfg; var _fetchTimeout; var _retryCnt; var _onCfgChangeReceive; var _nonOverrideConfigs; var _fetchFn; var _overrideFetchFn; var _overrideSyncFn; var _paused = false; dynamicProto(CfgSyncPlugin, _this, function (_self, _base) { _initDefaults(); _self.initialize = function (config, core, extensions, pluginChain) { _base.initialize(config, core, extensions, pluginChain); _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace()); _populateDefaults(config); }; _self.getCfg = function () { return _mainConfig; }; _self.pause = function () { _paused = true; _clearScheduledTimer(); }; _self.resume = function () { _paused = false; _setupTimer(); }; _self.setCfg = function (config) { return _setCfg(config); }; _self.sync = function (customDetails) { return _sendCfgsyncEvents(customDetails); }; _self.updateEventListenerName = function (eventName) { return _updateEventListenerName(eventName); }; _self._doTeardown = function (unloadCtx, unloadState) { _eventOff(); _clearScheduledTimer(); _initDefaults(); }; _self["_getDbgPlgTargets"] = function () { return [_broadcastChanges, _receiveChanges, _evtName, _blkCdnCfg]; }; function _initDefaults() { _mainConfig = null; _evtName = null; _evtNamespace = null; _cfgUrl = null; _receiveChanges = null; _broadcastChanges = null; _nonOverrideConfigs = null; _timeoutHandle = null; _fetchTimeout = null; _retryCnt = null; _blkCdnCfg = null; _overrideFetchFn = null; _overrideSyncFn = null; _onCfgChangeReceive = null; } function _populateDefaults(config) { var identifier = _self.identifier; var core = _self.core; _self._addHook(onConfigChange(config, function () { var ctx = createProcessTelemetryContext(null, config, core); _extensionConfig = ctx.getExtCfg(identifier, _defaultConfig$2); var preBlkCdn = _blkCdnCfg; _blkCdnCfg = !!_extensionConfig.blkCdnCfg; if (!isNullOrUndefined(preBlkCdn) && preBlkCdn !== _blkCdnCfg) { if (!_blkCdnCfg && _cfgUrl) { _fetchFn && _fetchFn(_cfgUrl, _onFetchComplete, _broadcastChanges); } else { _clearScheduledTimer(); } } if (isNullOrUndefined(_receiveChanges)) { _receiveChanges = _extensionConfig.syncMode === 2 ; } if (isNullOrUndefined(_broadcastChanges)) { _broadcastChanges = _extensionConfig.syncMode === 1 ; } var newEvtName = _extensionConfig.customEvtName || EVENT_NAME; if (_evtName !== newEvtName) { if (_receiveChanges) { _updateEventListenerName(newEvtName); } else { _eventOff(); _evtName = newEvtName; } } if (isNullOrUndefined(_cfgUrl)) { _cfgUrl = _extensionConfig.cfgUrl; } if (!_cfgUrl) { _mainConfig = config; if (_broadcastChanges) { _sendCfgsyncEvents(); } } })); _overrideSyncFn = _extensionConfig.overrideSyncFn; _overrideFetchFn = _extensionConfig.overrideFetchFn; _onCfgChangeReceive = _extensionConfig[_DYN_ON_CFG_CHANGE_RECEIV0 ]; _nonOverrideConfigs = _extensionConfig[_DYN_NON_OVERRIDE_CONFIGS ]; _fetchTimeout = _extensionConfig[_DYN_SCHEDULE_FETCH_TIMEO1 ]; _fetchFn = _getFetchFnInterface(); _retryCnt = 0; if (_cfgUrl && !_blkCdnCfg) { _fetchFn && _fetchFn(_cfgUrl, _onFetchComplete, _broadcastChanges); } } function _setCfg(config, isAutoSync) { if (config) { _mainConfig = config; if (!!isAutoSync && !_paused) { return _sendCfgsyncEvents(); } if (_receiveChanges && !_paused) { _self.core.updateCfg(config); return true; } } return false; } function _eventOff() { try { var global_1 = getGlobal(); if (global_1) { eventOff(global_1, null, null, _evtNamespace); } } catch (e) { } } function _sendCfgsyncEvents(customDetails) { try { if (!!_overrideSyncFn && isFunction(_overrideSyncFn)) { return _overrideSyncFn(_mainConfig, customDetails); } return sendCustomEvent(_evtName, _mainConfig, customDetails); } catch (e) { } return false; } function _updateEventListenerName(name) { try { _eventOff(); if (name) { _evtName = name; _addEventListener(); } return true; } catch (e) { } return false; } function _getFetchFnInterface() { var _fetchFn = _overrideFetchFn; if (isNullOrUndefined(_fetchFn)) { if (isFetchSupported()) { _fetchFn = _fetchSender; } else if (isXhrSupported()) { _fetchFn = _xhrSender; } } return _fetchFn; } function _fetchSender(url, oncomplete, isAutoSync) { var global = getGlobal(); var fetchFn = (global && global.fetch) || null; if (url && fetchFn && isFunction(fetchFn)) { try { var init = { method: STR_GET_METHOD }; var request = new Request(url, init); doAwaitResponse(fetch(request), function (result) { var response = result.value; if (!result.rejected) { if (response.ok) { doAwaitResponse(response.text(), function (res) { _doOnComplete(oncomplete, response.status, res.value, isAutoSync); }); } else { _doOnComplete(oncomplete, response.status, null, isAutoSync); } } else { _doOnComplete(oncomplete, 400); } }); } catch (e) { } } } function _xhrSender(url, oncomplete, isAutoSync) { try { var xhr_1 = new XMLHttpRequest(); xhr_1.open(STR_GET_METHOD, url); xhr_1.onreadystatechange = function () { if (xhr_1.readyState === XMLHttpRequest.DONE) { _doOnComplete(oncomplete, xhr_1.status, xhr_1.responseText, isAutoSync); } }; xhr_1.onerror = function () { _doOnComplete(oncomplete, 400); }; xhr_1.ontimeout = function () { _doOnComplete(oncomplete, 400); }; xhr_1.send(); } catch (e) { } } function _onFetchComplete(status, response, isAutoSync) { try { if (status >= 200 && status < 400 && response) { _retryCnt = 0; var JSON_1 = getJSON(); if (JSON_1) { var cdnCfg = JSON_1.parse(response); var cfg = applyCdnfeatureCfg(cdnCfg, _self.core); cfg && _setCfg(cfg, isAutoSync); } } else { _retryCnt++; } if (_retryCnt < 3) { _setupTimer(); } } catch (e) { } } function _doOnComplete(oncomplete, status, response, isAutoSync) { try { oncomplete(status, response, isAutoSync); } catch (e) { } } function _addEventListener() { if (_receiveChanges) { var global_2 = getGlobal(); if (global_2) { try { eventOn(global_2, _evtName, function (event) { var cfgEvent = event && event.detail; if (_onCfgChangeReceive && cfgEvent) { _onCfgChangeReceive(cfgEvent); } else { var cfg = cfgEvent && cfgEvent.cfg; var newCfg = cfg && isPlainObject(cfg) && _replaceTartgetByKeys(cfg); newCfg && _setCfg(newCfg); } }, _evtNamespace, true); } catch (e) { } } } } function _replaceTartgetByKeys(cfg, level) { var _cfg = null; try { if (cfg) { _cfg = replaceByNonOverrideCfg(cfg, _nonOverrideConfigs, 0, 5); } } catch (e) { } return _cfg; } function _setupTimer() { if (!_timeoutHandle && _fetchTimeout) { _timeoutHandle = scheduleTimeout(function () { _timeoutHandle = null; _fetchFn(_cfgUrl, _onFetchComplete, _broadcastChanges); }, _fetchTimeout); _timeoutHandle.unref(); } } function _clearScheduledTimer() { _timeoutHandle && _timeoutHandle.cancel(); _timeoutHandle = null; _retryCnt = 0; } _self.processTelemetry = function (env, itemCtx) { _self.processNext(env, itemCtx); }; }); return _this; } CfgSyncPlugin.__ieDyn=1; return CfgSyncPlugin; }(BaseTelemetryPlugin)); var STR_DURATION$1 = "duration"; var _DYN_TAGS = "tags"; var _DYN_DEVICE_TYPE = "deviceType"; var _DYN_DATA = "data"; var _DYN_NAME$1 = "name"; var _DYN_TRACE_ID$1 = "traceID"; var _DYN_LENGTH$2 = "length"; var _DYN_STRINGIFY = "stringify"; var _DYN_MEASUREMENTS = "measurements"; var _DYN_DATA_TYPE = "dataType"; var _DYN_ENVELOPE_TYPE = "envelopeType"; var _DYN_TO_STRING = "toString"; var _DYN__GET = "_get"; var _DYN_ENQUEUE = "enqueue"; var _DYN_COUNT = "count"; var _DYN_EVENTS_LIMIT_IN_MEM = "eventsLimitInMem"; var _DYN_PUSH = "push"; var _DYN_EMIT_LINE_DELIMITED_0 = "emitLineDelimitedJson"; var _DYN_CLEAR = "clear"; var _DYN_BATCH_PAYLOADS = "batchPayloads"; var _DYN_CREATE_NEW = "createNew"; var _DYN_MARK_AS_SENT = "markAsSent"; var _DYN_CLEAR_SENT = "clearSent"; var _DYN_BUFFER_OVERRIDE = "bufferOverride"; var _DYN__BUFFER__KEY = "BUFFER_KEY"; var _DYN__SENT__BUFFER__KEY = "SENT_BUFFER_KEY"; var _DYN_CONCAT = "concat"; var _DYN__MAX__BUFFER__SIZE = "MAX_BUFFER_SIZE"; var _DYN_SEND_POST = "sendPOST"; var _DYN_TRIGGER_SEND = "triggerSend"; var _DYN_DIAG_LOG = "diagLog"; var _DYN__SENDER = "_sender"; var _DYN_CUSTOM_HEADERS = "customHeaders"; var _DYN_MAX_BATCH_SIZE_IN_BY1 = "maxBatchSizeInBytes"; var _DYN_ONUNLOAD_DISABLE_BEA2 = "onunloadDisableBeacon"; var _DYN_IS_BEACON_API_DISABL3 = "isBeaconApiDisabled"; var _DYN_ALWAYS_USE_XHR_OVERR4 = "alwaysUseXhrOverride"; var _DYN_ENABLE_SESSION_STORA5 = "enableSessionStorageBuffer"; var _DYN__BUFFER = "_buffer"; var _DYN_ONUNLOAD_DISABLE_FET6 = "onunloadDisableFetch"; var _DYN_DISABLE_SEND_BEACON_7 = "disableSendBeaconSplit"; var _DYN_INSTRUMENTATION_KEY$1 = "instrumentationKey"; var _DYN_UNLOAD_TRANSPORTS = "unloadTransports"; var _DYN_CONVERT_UNDEFINED = "convertUndefined"; var _DYN_MAX_BATCH_INTERVAL = "maxBatchInterval"; var _DYN_BASE_TYPE = "baseType"; var _DYN_SAMPLE_RATE = "sampleRate"; var _DYN__XHR_READY_STATE_CHA8 = "_xhrReadyStateChange"; var _DYN__ON_ERROR = "_onError"; var _DYN__ON_PARTIAL_SUCCESS = "_onPartialSuccess"; var _DYN__ON_SUCCESS = "_onSuccess"; var _DYN_ITEMS_ACCEPTED = "itemsAccepted"; var _DYN_ITEMS_RECEIVED = "itemsReceived"; var _DYN_ORI_PAYLOAD = "oriPayload"; var _DYN_SET_REQUEST_HEADER$1 = "setRequestHeader"; var _DYN_EVENTS_SEND_REQUEST = "eventsSendRequest"; var _DYN_GET_SAMPLING_SCORE = "getSamplingScore"; var _DYN_GET_HASH_CODE_SCORE = "getHashCodeScore"; var strBaseType = "baseType"; var strBaseData = "baseData"; var strProperties = "properties"; var strTrue = "true"; function _setValueIf(target, field, value) { return setValue(target, field, value, isTruthy); } function _extractPartAExtensions(logger, item, env) { var envTags = env[_DYN_TAGS ] = env[_DYN_TAGS ] || {}; var itmExt = item.ext = item.ext || {}; var itmTags = item[_DYN_TAGS ] = item[_DYN_TAGS ] || []; var extUser = itmExt.user; if (extUser) { _setValueIf(envTags, CtxTagKeys.userAuthUserId, extUser.authId); _setValueIf(envTags, CtxTagKeys.userId, extUser.id || extUser.localId); } var extApp = itmExt.app; if (extApp) { _setValueIf(envTags, CtxTagKeys.sessionId, extApp.sesId); } var extDevice = itmExt.device; if (extDevice) { _setValueIf(envTags, CtxTagKeys.deviceId, extDevice.id || extDevice.localId); _setValueIf(envTags, CtxTagKeys[_DYN_DEVICE_TYPE ], extDevice.deviceClass); _setValueIf(envTags, CtxTagKeys.deviceIp, extDevice.ip); _setValueIf(envTags, CtxTagKeys.deviceModel, extDevice.model); _setValueIf(envTags, CtxTagKeys[_DYN_DEVICE_TYPE ], extDevice[_DYN_DEVICE_TYPE ]); } var web = item.ext.web; if (web) { _setValueIf(envTags, CtxTagKeys.deviceLanguage, web.browserLang); _setValueIf(envTags, CtxTagKeys.deviceBrowserVersion, web.browserVer); _setValueIf(envTags, CtxTagKeys.deviceBrowser, web.browser); var envData = env[_DYN_DATA ] = env[_DYN_DATA ] || {}; var envBaseData = envData[strBaseData] = envData[strBaseData] || {}; var envProps = envBaseData[strProperties] = envBaseData[strProperties] || {}; _setValueIf(envProps, "domain", web.domain); _setValueIf(envProps, "isManual", web.isManual ? strTrue : null); _setValueIf(envProps, "screenRes", web.screenRes); _setValueIf(envProps, "userConsent", web.userConsent ? strTrue : null); } var extOs = itmExt.os; if (extOs) { _setValueIf(envTags, CtxTagKeys.deviceOS, extOs[_DYN_NAME$1 ]); } var extTrace = itmExt.trace; if (extTrace) { _setValueIf(envTags, CtxTagKeys.operationParentId, extTrace.parentID); _setValueIf(envTags, CtxTagKeys.operationName, dataSanitizeString(logger, extTrace[_DYN_NAME$1 ])); _setValueIf(envTags, CtxTagKeys.operationId, extTrace[_DYN_TRACE_ID$1 ]); } var tgs = {}; for (var i = itmTags[_DYN_LENGTH$2 ] - 1; i >= 0; i--) { var tg = itmTags[i]; objForEachKey(tg, function (key, value) { tgs[key] = value; }); itmTags.splice(i, 1); } objForEachKey(itmTags, function (tg, value) { tgs[tg] = value; }); var theTags = __assignFn(__assignFn({}, envTags), tgs); if (!theTags[CtxTagKeys.internalSdkVersion]) { theTags[CtxTagKeys.internalSdkVersion] = dataSanitizeString(logger, "javascript:".concat(EnvelopeCreator.Version), 64); } env[_DYN_TAGS ] = optimizeObject(theTags); } function _extractPropsAndMeasurements(data, properties, measurements) { if (!isNullOrUndefined(data)) { objForEachKey(data, function (key, value) { if (isNumber(value)) { measurements[key] = value; } else if (isString(value)) { properties[key] = value; } else if (hasJSON()) { properties[key] = getJSON()[_DYN_STRINGIFY ](value); } }); } } function _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue) { if (!isNullOrUndefined(properties)) { objForEachKey(properties, function (key, value) { properties[key] = value || customUndefinedValue; }); } } function _createEnvelope(logger, envelopeType, telemetryItem, data) { var envelope = new Envelope(logger, data, envelopeType); _setValueIf(envelope, "sampleRate", telemetryItem[SampleRate]); if ((telemetryItem[strBaseData] || {}).startTime) { envelope.time = toISOString(telemetryItem[strBaseData].startTime); } envelope.iKey = telemetryItem.iKey; var iKeyNoDashes = telemetryItem.iKey.replace(/-/g, ""); envelope[_DYN_NAME$1 ] = envelope[_DYN_NAME$1 ].replace("{0}", iKeyNoDashes); _extractPartAExtensions(logger, telemetryItem, envelope); telemetryItem[_DYN_TAGS ] = telemetryItem[_DYN_TAGS ] || []; return optimizeObject(envelope); } function EnvelopeCreatorInit(logger, telemetryItem) { if (isNullOrUndefined(telemetryItem[strBaseData])) { _throwInternal(logger, 1 , 46 , "telemetryItem.baseData cannot be null."); } } var EnvelopeCreator = { Version: '3.0.6' }; function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS ] || {}; var customProperties = telemetryItem[strBaseData][strProperties] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], customProperties, customMeasurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue); } var bd = telemetryItem[strBaseData]; if (isNullOrUndefined(bd)) { _warnToConsole(logger, "Invalid input for dependency data"); return null; } var method = bd[strProperties] && bd[strProperties][HttpMethod] ? bd[strProperties][HttpMethod] : "GET"; var remoteDepData = new RemoteDependencyData(logger, bd.id, bd.target, bd[_DYN_NAME$1 ], bd[STR_DURATION$1 ], bd.success, bd.responseCode, method, bd.type, bd.correlationContext, customProperties, customMeasurements); var data = new Data(RemoteDependencyData[_DYN_DATA_TYPE ], remoteDepData); return _createEnvelope(logger, RemoteDependencyData[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function EventEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var customProperties = {}; var customMeasurements = {}; if (telemetryItem[strBaseType] !== Event$1[_DYN_DATA_TYPE ]) { customProperties["baseTypeSource"] = telemetryItem[strBaseType]; } if (telemetryItem[strBaseType] === Event$1[_DYN_DATA_TYPE ]) { customProperties = telemetryItem[strBaseData][strProperties] || {}; customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS ] || {}; } else { if (telemetryItem[strBaseData]) { _extractPropsAndMeasurements(telemetryItem[strBaseData], customProperties, customMeasurements); } } _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], customProperties, customMeasurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue); } var eventName = telemetryItem[strBaseData][_DYN_NAME$1 ]; var eventData = new Event$1(logger, eventName, customProperties, customMeasurements); var data = new Data(Event$1[_DYN_DATA_TYPE ], eventData); return _createEnvelope(logger, Event$1[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function ExceptionEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS ] || {}; var customProperties = telemetryItem[strBaseData][strProperties] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], customProperties, customMeasurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue); } var bd = telemetryItem[strBaseData]; var exData = Exception.CreateFromInterface(logger, bd, customProperties, customMeasurements); var data = new Data(Exception[_DYN_DATA_TYPE ], exData); return _createEnvelope(logger, Exception[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function MetricEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var baseData = telemetryItem[strBaseData]; var props = baseData[strProperties] || {}; var measurements = baseData[_DYN_MEASUREMENTS ] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], props, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(props, customUndefinedValue); } var baseMetricData = new Metric(logger, baseData[_DYN_NAME$1 ], baseData.average, baseData.sampleCount, baseData.min, baseData.max, baseData.stdDev, props, measurements); var data = new Data(Metric[_DYN_DATA_TYPE ], baseMetricData); return _createEnvelope(logger, Metric[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function PageViewEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var duration; var baseData = telemetryItem[strBaseData]; if (!isNullOrUndefined(baseData) && !isNullOrUndefined(baseData[strProperties]) && !isNullOrUndefined(baseData[strProperties][STR_DURATION$1])) { duration = baseData[strProperties][STR_DURATION$1]; delete baseData[strProperties][STR_DURATION$1]; } else if (!isNullOrUndefined(telemetryItem[_DYN_DATA ]) && !isNullOrUndefined(telemetryItem[_DYN_DATA ][STR_DURATION$1])) { duration = telemetryItem[_DYN_DATA ][STR_DURATION$1]; delete telemetryItem[_DYN_DATA ][STR_DURATION$1]; } var bd = telemetryItem[strBaseData]; var currentContextId; if (((telemetryItem.ext || {}).trace || {})[_DYN_TRACE_ID$1 ]) { currentContextId = telemetryItem.ext.trace[_DYN_TRACE_ID$1 ]; } var id = bd.id || currentContextId; var name = bd[_DYN_NAME$1 ]; var url = bd.uri; var properties = bd[strProperties] || {}; var measurements = bd[_DYN_MEASUREMENTS ] || {}; if (!isNullOrUndefined(bd.refUri)) { properties["refUri"] = bd.refUri; } if (!isNullOrUndefined(bd.pageType)) { properties["pageType"] = bd.pageType; } if (!isNullOrUndefined(bd.isLoggedIn)) { properties["isLoggedIn"] = bd.isLoggedIn[_DYN_TO_STRING ](); } if (!isNullOrUndefined(bd[strProperties])) { var pageTags = bd[strProperties]; objForEachKey(pageTags, function (key, value) { properties[key] = value; }); } _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], properties, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue); } var pageViewData = new PageView(logger, name, url, duration, properties, measurements, id); var data = new Data(PageView[_DYN_DATA_TYPE ], pageViewData); return _createEnvelope(logger, PageView[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function PageViewPerformanceEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var bd = telemetryItem[strBaseData]; var name = bd[_DYN_NAME$1 ]; var url = bd.uri || bd.url; var properties = bd[strProperties] || {}; var measurements = bd[_DYN_MEASUREMENTS ] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], properties, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue); } var baseData = new PageViewPerformance(logger, name, url, undefined, properties, measurements, bd); var data = new Data(PageViewPerformance[_DYN_DATA_TYPE ], baseData); return _createEnvelope(logger, PageViewPerformance[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function TraceEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var message = telemetryItem[strBaseData].message; var severityLevel = telemetryItem[strBaseData].severityLevel; var props = telemetryItem[strBaseData][strProperties] || {}; var measurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS ] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], props, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(props, customUndefinedValue); } var baseData = new Trace(logger, message, severityLevel, props, measurements); var data = new Data(Trace[_DYN_DATA_TYPE ], baseData); return _createEnvelope(logger, Trace[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } var BaseSendBuffer = /** @class */ (function () { function BaseSendBuffer(logger, config) { var _buffer = []; var _bufferFullMessageSent = false; this[_DYN__GET ] = function () { return _buffer; }; this._set = function (buffer) { _buffer = buffer; return _buffer; }; dynamicProto(BaseSendBuffer, this, function (_self) { _self[_DYN_ENQUEUE ] = function (payload) { if (_self[_DYN_COUNT ]() >= config[_DYN_EVENTS_LIMIT_IN_MEM ]) { if (!_bufferFullMessageSent) { _throwInternal(logger, 2 , 105 , "Maximum in-memory buffer size reached: " + _self[_DYN_COUNT ](), true); _bufferFullMessageSent = true; } return; } _buffer[_DYN_PUSH ](payload); }; _self[_DYN_COUNT ] = function () { return _buffer[_DYN_LENGTH$2 ]; }; _self.size = function () { var size = _buffer[_DYN_LENGTH$2 ]; for (var lp = 0; lp < _buffer[_DYN_LENGTH$2 ]; lp++) { size += _buffer[lp][_DYN_LENGTH$2 ]; } if (!config[_DYN_EMIT_LINE_DELIMITED_0 ]) { size += 2; } return size; }; _self[_DYN_CLEAR ] = function () { _buffer = []; _bufferFullMessageSent = false; }; _self.getItems = function () { return _buffer.slice(0); }; _self[_DYN_BATCH_PAYLOADS ] = function (payload) { if (payload && payload[_DYN_LENGTH$2 ] > 0) { var batch = config[_DYN_EMIT_LINE_DELIMITED_0 ] ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; _self[_DYN_CREATE_NEW ] = function (newLogger, newConfig, canUseSessionStorage) { var items = _buffer.slice(0); newLogger = newLogger || logger; newConfig = newConfig || {}; var newBuffer = !!canUseSessionStorage ? new SessionStorageSendBuffer(newLogger, newConfig) : new ArraySendBuffer(newLogger, newConfig); arrForEach(items, function (payload) { newBuffer[_DYN_ENQUEUE ](payload); }); return newBuffer; }; }); } BaseSendBuffer.__ieDyn=1; return BaseSendBuffer; }()); var ArraySendBuffer = /** @class */ (function (_super) { __extendsFn(ArraySendBuffer, _super); function ArraySendBuffer(logger, config) { var _this = _super.call(this, logger, config) || this; dynamicProto(ArraySendBuffer, _this, function (_self, _base) { _self[_DYN_MARK_AS_SENT ] = function (payload) { _base[_DYN_CLEAR ](); }; _self[_DYN_CLEAR_SENT ] = function (payload) { }; }); return _this; } ArraySendBuffer.__ieDyn=1; return ArraySendBuffer; }(BaseSendBuffer)); var SessionStorageSendBuffer = /** @class */ (function (_super) { __extendsFn(SessionStorageSendBuffer, _super); function SessionStorageSendBuffer(logger, config) { var _this = _super.call(this, logger, config) || this; var _bufferFullMessageSent = false; var _namePrefix = config === null || config === void 0 ? void 0 : config.namePrefix; var _a = config[_DYN_BUFFER_OVERRIDE ] || { getItem: utlGetSessionStorage, setItem: utlSetSessionStorage }, getItem = _a.getItem, setItem = _a.setItem; dynamicProto(SessionStorageSendBuffer, _this, function (_self, _base) { var bufferItems = _getBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY ]); var notDeliveredItems = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ]); var buffer = _self._set(bufferItems[_DYN_CONCAT ](notDeliveredItems)); if (buffer[_DYN_LENGTH$2 ] > SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]) { buffer[_DYN_LENGTH$2 ] = SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]; } _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ], []); _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY ], buffer); _self[_DYN_ENQUEUE ] = function (payload) { if (_self[_DYN_COUNT ]() >= SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]) { if (!_bufferFullMessageSent) { _throwInternal(logger, 2 , 67 , "Maximum buffer size reached: " + _self[_DYN_COUNT ](), true); _bufferFullMessageSent = true; } return; } _base[_DYN_ENQUEUE ](payload); _setBuffer(SessionStorageSendBuffer.BUFFER_KEY, _self[_DYN__GET ]()); }; _self[_DYN_CLEAR ] = function () { _base[_DYN_CLEAR ](); _setBuffer(SessionStorageSendBuffer.BUFFER_KEY, _self[_DYN__GET ]()); _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ], []); _bufferFullMessageSent = false; }; _self[_DYN_MARK_AS_SENT ] = function (payload) { _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY ], _self._set(_removePayloadsFromBuffer(payload, _self[_DYN__GET ]()))); var sentElements = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ]); if (sentElements instanceof Array && payload instanceof Array) { sentElements = sentElements[_DYN_CONCAT ](payload); if (sentElements[_DYN_LENGTH$2 ] > SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]) { _throwInternal(logger, 1 , 67 , "Sent buffer reached its maximum size: " + sentElements[_DYN_LENGTH$2 ], true); sentElements[_DYN_LENGTH$2 ] = SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]; } _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ], sentElements); } }; _self[_DYN_CLEAR_SENT ] = function (payload) { var sentElements = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ]); sentElements = _removePayloadsFromBuffer(payload, sentElements); _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ], sentElements); }; _self[_DYN_CREATE_NEW ] = function (newLogger, newConfig, canUseSessionStorage) { canUseSessionStorage = !!canUseSessionStorage; var unsentItems = _self[_DYN__GET ]().slice(0); var sentItems = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ]).slice(0); newLogger = newLogger || logger; newConfig = newConfig || {}; _self[_DYN_CLEAR ](); var newBuffer = canUseSessionStorage ? new SessionStorageSendBuffer(newLogger, newConfig) : new ArraySendBuffer(newLogger, newConfig); arrForEach(unsentItems, function (payload) { newBuffer[_DYN_ENQUEUE ](payload); }); if (canUseSessionStorage) { newBuffer[_DYN_MARK_AS_SENT ](sentItems); } return newBuffer; }; function _removePayloadsFromBuffer(payloads, buffer) { var remaining = []; arrForEach(buffer, function (value) { if (!isFunction(value) && arrIndexOf(payloads, value) === -1) { remaining[_DYN_PUSH ](value); } }); return remaining; } function _getBuffer(key) { var prefixedKey = key; try { prefixedKey = _namePrefix ? _namePrefix + "_" + prefixedKey : prefixedKey; var bufferJson = getItem(logger, prefixedKey); if (bufferJson) { var buffer_1 = getJSON().parse(bufferJson); if (isString(buffer_1)) { buffer_1 = getJSON().parse(buffer_1); } if (buffer_1 && isArray(buffer_1)) { return buffer_1; } } } catch (e) { _throwInternal(logger, 1 , 42 , " storage key: " + prefixedKey + ", " + getExceptionName(e), { exception: dumpObj(e) }); } return []; } function _setBuffer(key, buffer) { var prefixedKey = key; try { prefixedKey = _namePrefix ? _namePrefix + "_" + prefixedKey : prefixedKey; var bufferJson = JSON[_DYN_STRINGIFY ](buffer); setItem(logger, prefixedKey, bufferJson); } catch (e) { setItem(logger, prefixedKey, JSON[_DYN_STRINGIFY ]([])); _throwInternal(logger, 2 , 41 , " storage key: " + prefixedKey + ", " + getExceptionName(e) + ". Buffer cleared", { exception: dumpObj(e) }); } } }); return _this; } SessionStorageSendBuffer.BUFFER_KEY = "AI_buffer"; SessionStorageSendBuffer.SENT_BUFFER_KEY = "AI_sentBuffer"; SessionStorageSendBuffer.MAX_BUFFER_SIZE = 2000; return SessionStorageSendBuffer; }(BaseSendBuffer)); var Serializer = /** @class */ (function () { function Serializer(logger) { dynamicProto(Serializer, this, function (_self) { _self.serialize = function (input) { var output = _serializeObject(input, "root"); try { return getJSON()[_DYN_STRINGIFY ](output); } catch (e) { _throwInternal(logger, 1 , 48 , (e && isFunction(e[_DYN_TO_STRING ])) ? e[_DYN_TO_STRING ]() : "Error serializing object", null, true); } }; function _serializeObject(source, name) { var circularReferenceCheck = "__aiCircularRefCheck"; var output = {}; if (!source) { _throwInternal(logger, 1 , 48 , "cannot serialize object because it is null or undefined", { name: name }, true); return output; } if (source[circularReferenceCheck]) { _throwInternal(logger, 2 , 50 , "Circular reference detected while serializing object", { name: name }, true); return output; } if (!source.aiDataContract) { if (name === "measurements") { console.log("measurements"); output = _serializeStringMap(source, "number", name); } else if (name === "properties") { console.log("properties"); output = _serializeStringMap(source, "string", name); } else if (name === "tags") { output = _serializeStringMap(source, "string", name); } else if (isArray(source)) { output = _serializeArray(source, name); } else { _throwInternal(logger, 2 , 49 , "Attempting to serialize an object which does not implement ISerializable", { name: name }, true); try { getJSON()[_DYN_STRINGIFY ](source); output = source; } catch (e) { _throwInternal(logger, 1 , 48 , (e && isFunction(e[_DYN_TO_STRING ])) ? e[_DYN_TO_STRING ]() : "Error serializing object", null, true); } } return output; } source[circularReferenceCheck] = true; objForEachKey(source.aiDataContract, function (field, contract) { var isRequired = (isFunction(contract)) ? (contract() & 1 ) : (contract & 1 ); var isHidden = (isFunction(contract)) ? (contract() & 4 ) : (contract & 4 ); var isArray = contract & 2 ; var isPresent = source[field] !== undefined; var isObj = isObject(source[field]) && source[field] !== null; if (isRequired && !isPresent && !isArray) { _throwInternal(logger, 1 , 24 , "Missing required field specification. The field is required but not present on source", { field: field, name: name }); } else if (!isHidden) { var value = void 0; if (isObj) { if (isArray) { value = _serializeArray(source[field], field); } else { value = _serializeObject(source[field], field); } } else { value = source[field]; } if (value !== undefined) { output[field] = value; } } }); delete source[circularReferenceCheck]; return output; } function _serializeArray(sources, name) { var output; if (!!sources) { if (!isArray(sources)) { _throwInternal(logger, 1 , 54 , "This field was specified as an array in the contract but the item is not an array.\r\n", { name: name }, true); } else { output = []; for (var i = 0; i < sources[_DYN_LENGTH$2 ]; i++) { var source = sources[i]; var item = _serializeObject(source, name + "[" + i + "]"); output[_DYN_PUSH ](item); } } } return output; } function _serializeStringMap(map, expectedType, name) { var output; if (map) { output = {}; objForEachKey(map, function (field, value) { if (expectedType === "string") { console.log("string", value); if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else if (!value[_DYN_TO_STRING ]) { output[field] = "invalid field: toString() is not defined."; } else { output[field] = value[_DYN_TO_STRING ](); } } else if (expectedType === "number") { console.log("number", field, value); if (value === undefined) { console.log("number undefined", value); output[field] = "undefined"; } else if (value === null) { console.log("number null", value); output[field] = "null"; } else { var num = parseFloat(value); console.log("number covert", num); console.log("isNaN(num)", isNaN(num)); if (isNaN(num)) { output[field] = "another"; } else { output[field] = num; } } } else { output[field] = "invalid field: " + name + " is of unknown type."; _throwInternal(logger, 1 , output[field], null, true); } }); } return output; } }); } Serializer.__ieDyn=1; return Serializer; }()); var MIN_INPUT_LENGTH = 8; var HashCodeScoreGenerator = /** @class */ (function () { function HashCodeScoreGenerator() { } HashCodeScoreGenerator.prototype.getHashCodeScore = function (key) { var score = this.getHashCode(key) / HashCodeScoreGenerator.INT_MAX_VALUE; return score * 100; }; HashCodeScoreGenerator.prototype.getHashCode = function (input) { if (input === "") { return 0; } while (input[_DYN_LENGTH$2 ] < MIN_INPUT_LENGTH) { input = input[_DYN_CONCAT ](input); } var hash = 5381; for (var i = 0; i < input[_DYN_LENGTH$2 ]; ++i) { hash = ((hash << 5) + hash) + input.charCodeAt(i); hash = hash & hash; } return Math.abs(hash); }; HashCodeScoreGenerator.INT_MAX_VALUE = 2147483647; return HashCodeScoreGenerator; }()); var SamplingScoreGenerator = /** @class */ (function () { function SamplingScoreGenerator() { var _self = this; var hashCodeGenerator = new HashCodeScoreGenerator(); var keys = new ContextTagKeys(); _self[_DYN_GET_SAMPLING_SCORE ] = function (item) { var score = 0; if (item[_DYN_TAGS ] && item[_DYN_TAGS ][keys.userId]) { score = hashCodeGenerator.getHashCodeScore(item[_DYN_TAGS ][keys.userId]); } else if (item.ext && item.ext.user && item.ext.user.id) { score = hashCodeGenerator[_DYN_GET_HASH_CODE_SCORE ](item.ext.user.id); } else if (item[_DYN_TAGS ] && item[_DYN_TAGS ][keys.operationId]) { score = hashCodeGenerator.getHashCodeScore(item[_DYN_TAGS ][keys.operationId]); } else if (item.ext && item.ext.telemetryTrace && item.ext.telemetryTrace[_DYN_TRACE_ID$1 ]) { score = hashCodeGenerator.getHashCodeScore(item.ext.telemetryTrace[_DYN_TRACE_ID$1 ]); } else { score = (Math.random() * 100); } return score; }; } return SamplingScoreGenerator; }()); var Sample = /** @class */ (function () { function Sample(sampleRate, logger) { this.INT_MAX_VALUE = 2147483647; var _logger = logger || safeGetLogger(null); if (sampleRate > 100 || sampleRate < 0) { _logger.throwInternal(2 , 58 , "Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.", { samplingRate: sampleRate }, true); sampleRate = 100; } this[_DYN_SAMPLE_RATE ] = sampleRate; this.samplingScoreGenerator = new SamplingScoreGenerator(); } Sample.prototype.isSampledIn = function (envelope) { var samplingPercentage = this[_DYN_SAMPLE_RATE ]; var isSampledIn = false; if (samplingPercentage === null || samplingPercentage === undefined || samplingPercentage >= 100) { return true; } else if (envelope.baseType === Metric[_DYN_DATA_TYPE ]) { return true; } isSampledIn = this.samplingScoreGenerator[_DYN_GET_SAMPLING_SCORE ](envelope) < samplingPercentage; return isSampledIn; }; return Sample; }()); var _a$3, _b$1; var UNDEFINED_VALUE$1 = undefined; var FetchSyncRequestSizeLimitBytes = 65000; function _getResponseText(xhr) { try { return xhr.responseText; } catch (e) { } return null; } function isOverrideFn(httpXHROverride) { return httpXHROverride && httpXHROverride[_DYN_SEND_POST ]; } function _prependTransports(theTransports, newTransports) { if (newTransports) { if (isNumber(newTransports)) { theTransports = [newTransports][_DYN_CONCAT ](theTransports); } else if (isArray(newTransports)) { theTransports = newTransports[_DYN_CONCAT ](theTransports); } } return theTransports; } var defaultAppInsightsChannelConfig = objDeepFreeze((_a$3 = { endpointUrl: cfgDfValidate(isTruthy, DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH) }, _a$3[_DYN_EMIT_LINE_DELIMITED_0 ] = cfgDfBoolean(), _a$3[_DYN_MAX_BATCH_INTERVAL ] = 15000, _a$3[_DYN_MAX_BATCH_SIZE_IN_BY1 ] = 102400, _a$3.disableTelemetry = cfgDfBoolean(), _a$3[_DYN_ENABLE_SESSION_STORA5 ] = cfgDfBoolean(true), _a$3.isRetryDisabled = cfgDfBoolean(), _a$3[_DYN_IS_BEACON_API_DISABL3 ] = cfgDfBoolean(true), _a$3[_DYN_DISABLE_SEND_BEACON_7 ] = cfgDfBoolean(), _a$3.disableXhr = cfgDfBoolean(), _a$3[_DYN_ONUNLOAD_DISABLE_FET6 ] = cfgDfBoolean(), _a$3[_DYN_ONUNLOAD_DISABLE_BEA2 ] = cfgDfBoolean(), _a$3[_DYN_INSTRUMENTATION_KEY$1 ] = UNDEFINED_VALUE$1, _a$3.namePrefix = UNDEFINED_VALUE$1, _a$3.samplingPercentage = cfgDfValidate(_chkSampling, 100), _a$3[_DYN_CUSTOM_HEADERS ] = UNDEFINED_VALUE$1, _a$3[_DYN_CONVERT_UNDEFINED ] = UNDEFINED_VALUE$1, _a$3[_DYN_EVENTS_LIMIT_IN_MEM ] = 10000, _a$3[_DYN_BUFFER_OVERRIDE ] = false, _a$3.httpXHROverride = { isVal: isOverrideFn, v: UNDEFINED_VALUE$1 }, _a$3[_DYN_ALWAYS_USE_XHR_OVERR4 ] = cfgDfBoolean(), _a$3.transports = UNDEFINED_VALUE$1, _a$3)); function _chkSampling(value) { return !isNaN(value) && value > 0 && value <= 100; } var EnvelopeTypeCreator = (_b$1 = {}, _b$1[Event$1.dataType] = EventEnvelopeCreator, _b$1[Trace.dataType] = TraceEnvelopeCreator, _b$1[PageView.dataType] = PageViewEnvelopeCreator, _b$1[PageViewPerformance.dataType] = PageViewPerformanceEnvelopeCreator, _b$1[Exception.dataType] = ExceptionEnvelopeCreator, _b$1[Metric.dataType] = MetricEnvelopeCreator, _b$1[RemoteDependencyData.dataType] = DependencyEnvelopeCreator, _b$1); var Sender = /** @class */ (function (_super) { __extendsFn(Sender, _super); function Sender() { var _this = _super.call(this) || this; _this.priority = 1001; _this.identifier = BreezeChannelIdentifier; var _consecutiveErrors; var _retryAt; var _paused; var _timeoutHandle; var _serializer; var _stamp_specific_redirects; var _headers; var _syncFetchPayload = 0; var _syncUnloadSender; var _offlineListener; var _evtNamespace; var _endpointUrl; var _orgEndpointUrl; var _maxBatchSizeInBytes; var _beaconSupported; var _beaconOnUnloadSupported; var _beaconNormalSupported; var _customHeaders; var _disableTelemetry; var _instrumentationKey; var _convertUndefined; var _isRetryDisabled; var _maxBatchInterval; var _sessionStorageUsed; var _bufferOverrideUsed; var _namePrefix; var _enableSendPromise; var _alwaysUseCustomSend; var _disableXhr; var _fetchKeepAlive; var _xhrSend; var _fallbackSend; var _disableBeaconSplit; dynamicProto(Sender, _this, function (_self, _base) { _initDefaults(); _self.pause = function () { _clearScheduledTimer(); _paused = true; }; _self.resume = function () { if (_paused) { _paused = false; _retryAt = null; _checkMaxSize(); _setupTimer(); } }; _self.flush = function (isAsync, callBack, sendReason) { if (isAsync === void 0) { isAsync = true; } if (!_paused) { _clearScheduledTimer(); try { return _self[_DYN_TRIGGER_SEND ](isAsync, null, sendReason || 1 ); } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 22 , "flush failed, telemetry will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } } }; _self.onunloadFlush = function () { if (!_paused) { if (_beaconSupported || _alwaysUseCustomSend) { try { return _self[_DYN_TRIGGER_SEND ](true, _doUnloadSend, 2 ); } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 20 , "failed to flush with beacon sender on page unload, telemetry will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } } else { _self.flush(false); } } }; _self.addHeader = function (name, value) { _headers[name] = value; }; _self.initialize = function (config, core, extensions, pluginChain) { if (_self.isInitialized()) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 28 , "Sender is already initialized"); } _base.initialize(config, core, extensions, pluginChain); var identifier = _self.identifier; _serializer = new Serializer(core.logger); _consecutiveErrors = 0; _retryAt = null; _self[_DYN__SENDER ] = null; _stamp_specific_redirects = 0; var diagLog = _self[_DYN_DIAG_LOG ](); _evtNamespace = mergeEvtNamespace(createUniqueNamespace("Sender"), core.evtNamespace && core.evtNamespace()); _offlineListener = createOfflineListener(_evtNamespace); _self._addHook(onConfigChange(config, function (details) { var config = details.cfg; if (config.storagePrefix) { utlSetStoragePrefix(config.storagePrefix); } var ctx = createProcessTelemetryContext(null, config, core); var senderConfig = ctx.getExtCfg(identifier, defaultAppInsightsChannelConfig); objDefine(_self, "_senderConfig", { g: function () { return senderConfig; } }); if (_orgEndpointUrl !== senderConfig.endpointUrl) { _endpointUrl = _orgEndpointUrl = senderConfig.endpointUrl; } if (_customHeaders && _customHeaders !== senderConfig[_DYN_CUSTOM_HEADERS ]) { arrForEach(_customHeaders, function (customHeader) { delete _headers[customHeader.header]; }); } _maxBatchSizeInBytes = senderConfig[_DYN_MAX_BATCH_SIZE_IN_BY1 ]; _beaconSupported = (senderConfig[_DYN_ONUNLOAD_DISABLE_BEA2 ] === false || senderConfig[_DYN_IS_BEACON_API_DISABL3 ] === false) && isBeaconsSupported(); _beaconOnUnloadSupported = senderConfig[_DYN_ONUNLOAD_DISABLE_BEA2 ] === false && isBeaconsSupported(); _beaconNormalSupported = senderConfig[_DYN_IS_BEACON_API_DISABL3 ] === false && isBeaconsSupported(); _alwaysUseCustomSend = senderConfig[_DYN_ALWAYS_USE_XHR_OVERR4 ]; _disableXhr = !!senderConfig.disableXhr; var bufferOverride = senderConfig[_DYN_BUFFER_OVERRIDE ]; var canUseSessionStorage = !!senderConfig[_DYN_ENABLE_SESSION_STORA5 ] && (!!bufferOverride || utlCanUseSessionStorage()); var namePrefix = senderConfig.namePrefix; var shouldUpdate = (canUseSessionStorage !== _sessionStorageUsed) || (canUseSessionStorage && (_namePrefix !== namePrefix)) || (canUseSessionStorage && (_bufferOverrideUsed !== bufferOverride)); if (_self[_DYN__BUFFER ]) { if (shouldUpdate) { try { _self._buffer = _self._buffer[_DYN_CREATE_NEW ](diagLog, senderConfig, canUseSessionStorage); } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 12 , "failed to transfer telemetry to different buffer storage, telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) }); } } _checkMaxSize(); } else { _self[_DYN__BUFFER ] = canUseSessionStorage ? new SessionStorageSendBuffer(diagLog, senderConfig) : new ArraySendBuffer(diagLog, senderConfig); } _namePrefix = namePrefix; _sessionStorageUsed = canUseSessionStorage; _bufferOverrideUsed = bufferOverride; _fetchKeepAlive = !senderConfig[_DYN_ONUNLOAD_DISABLE_FET6 ] && isFetchSupported(true); _disableBeaconSplit = !!senderConfig[_DYN_DISABLE_SEND_BEACON_7 ]; _self._sample = new Sample(senderConfig.samplingPercentage, diagLog); _instrumentationKey = senderConfig[_DYN_INSTRUMENTATION_KEY$1 ]; if (!_validateInstrumentationKey(_instrumentationKey, config)) { _throwInternal(diagLog, 1 , 100 , "Invalid Instrumentation key " + _instrumentationKey); } _customHeaders = senderConfig[_DYN_CUSTOM_HEADERS ]; if (!isInternalApplicationInsightsEndpoint(_endpointUrl) && _customHeaders && _customHeaders[_DYN_LENGTH$2 ] > 0) { arrForEach(_customHeaders, function (customHeader) { _this.addHeader(customHeader.header, customHeader.value); }); } else { _customHeaders = null; } _enableSendPromise = senderConfig.enableSendPromise; var customInterface = senderConfig.httpXHROverride; var httpInterface = null; var syncInterface = null; var theTransports = _prependTransports([3 , 1 , 2 ], senderConfig.transports); httpInterface = _getSenderInterface(theTransports, false); var xhrInterface = { sendPOST: _xhrSender }; _xhrSend = function (payload, isAsync) { return _doSend(xhrInterface, payload, isAsync); }; _fallbackSend = function (payload, isAsync) { return _doSend(xhrInterface, payload, isAsync, false); }; httpInterface = _alwaysUseCustomSend ? customInterface : (httpInterface || customInterface || xhrInterface); _self[_DYN__SENDER ] = function (payload, isAsync) { return _doSend(httpInterface, payload, isAsync); }; if (_fetchKeepAlive) { _syncUnloadSender = _fetchKeepAliveSender; } var syncTransports = _prependTransports([3 , 1 ], senderConfig[_DYN_UNLOAD_TRANSPORTS ]); if (!_fetchKeepAlive) { syncTransports = syncTransports.filter(function (transport) { return transport !== 2 ; }); } syncInterface = _getSenderInterface(syncTransports, true); syncInterface = _alwaysUseCustomSend ? customInterface : (syncInterface || customInterface); if ((_alwaysUseCustomSend || senderConfig[_DYN_UNLOAD_TRANSPORTS ] || !_syncUnloadSender) && syncInterface) { _syncUnloadSender = function (payload, isAsync) { return _doSend(syncInterface, payload, isAsync); }; } if (!_syncUnloadSender) { _syncUnloadSender = _xhrSend; } _disableTelemetry = senderConfig.disableTelemetry; _convertUndefined = senderConfig[_DYN_CONVERT_UNDEFINED ] || UNDEFINED_VALUE$1; _isRetryDisabled = senderConfig.isRetryDisabled; _maxBatchInterval = senderConfig[_DYN_MAX_BATCH_INTERVAL ]; })); }; _self.processTelemetry = function (telemetryItem, itemCtx) { itemCtx = _self._getTelCtx(itemCtx); var diagLogger = itemCtx[_DYN_DIAG_LOG ](); try { if (_disableTelemetry) { return; } if (!telemetryItem) { _throwInternal(diagLogger, 1 , 7 , "Cannot send empty telemetry"); return; } if (telemetryItem.baseData && !telemetryItem[_DYN_BASE_TYPE ]) { _throwInternal(diagLogger, 1 , 70 , "Cannot send telemetry without baseData and baseType"); return; } if (!telemetryItem[_DYN_BASE_TYPE ]) { telemetryItem[_DYN_BASE_TYPE ] = "EventData"; } if (!_self[_DYN__SENDER ]) { _throwInternal(diagLogger, 1 , 28 , "Sender was not initialized"); return; } if (!_isSampledIn(telemetryItem)) { _throwInternal(diagLogger, 2 , 33 , "Telemetry item was sampled out and not sent", { SampleRate: _self._sample[_DYN_SAMPLE_RATE ] }); return; } else { telemetryItem[SampleRate] = _self._sample[_DYN_SAMPLE_RATE ]; } var defaultEnvelopeIkey = telemetryItem.iKey || _instrumentationKey; var aiEnvelope_1 = Sender.constructEnvelope(telemetryItem, defaultEnvelopeIkey, diagLogger, _convertUndefined); if (!aiEnvelope_1) { _throwInternal(diagLogger, 1 , 47 , "Unable to create an AppInsights envelope"); return; } var doNotSendItem_1 = false; if (telemetryItem[_DYN_TAGS ] && telemetryItem[_DYN_TAGS ][ProcessLegacy]) { arrForEach(telemetryItem[_DYN_TAGS ][ProcessLegacy], function (callBack) { try { if (callBack && callBack(aiEnvelope_1) === false) { doNotSendItem_1 = true; _warnToConsole(diagLogger, "Telemetry processor check returns false"); } } catch (e) { _throwInternal(diagLogger, 1 , 64 , "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true); } }); delete telemetryItem[_DYN_TAGS ][ProcessLegacy]; } if (doNotSendItem_1) { return; } var payload = _serializer.serialize(aiEnvelope_1); var buffer = _self[_DYN__BUFFER ]; _checkMaxSize(payload); buffer[_DYN_ENQUEUE ](payload); _setupTimer(); } catch (e) { _throwInternal(diagLogger, 2 , 12 , "Failed adding telemetry to the sender's buffer, some telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) }); } _self.processNext(telemetryItem, itemCtx); }; _self[_DYN__XHR_READY_STATE_CHA8 ] = function (xhr, payload, countOfItemsInPayload) { if (xhr.readyState === 4) { _checkResponsStatus(xhr.status, payload, xhr.responseURL, countOfItemsInPayload, _formatErrorMessageXhr(xhr), _getResponseText(xhr) || xhr.response); } }; _self[_DYN_TRIGGER_SEND ] = function (async, forcedSender, sendReason) { if (async === void 0) { async = true; } var result; if (!_paused) { try { var buffer = _self[_DYN__BUFFER ]; if (!_disableTelemetry) { if (buffer[_DYN_COUNT ]() > 0) { var payload = buffer.getItems(); _notifySendRequest(sendReason || 0 , async); if (forcedSender) { result = forcedSender.call(_self, payload, async); } else { result = _self[_DYN__SENDER ](payload, async); } } } else { buffer[_DYN_CLEAR ](); } _clearScheduledTimer(); } catch (e) { var ieVer = getIEVersion(); if (!ieVer || ieVer > 9) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 40 , "Telemetry transmission failed, some telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) }); } } } return result; }; _self._doTeardown = function (unloadCtx, unloadState) { _self.onunloadFlush(); runTargetUnload(_offlineListener, false); _initDefaults(); }; _self[_DYN__ON_ERROR ] = function (payload, message, event) { _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 26 , "Failed to send telemetry.", { message: message }); _self._buffer && _self._buffer[_DYN_CLEAR_SENT ](payload); }; _self[_DYN__ON_PARTIAL_SUCCESS ] = function (payload, results) { var failed = []; var retry = []; var errors = results.errors.reverse(); for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) { var error = errors_1[_i]; var extracted = payload.splice(error.index, 1)[0]; if (_isRetriable(error.statusCode)) { retry[_DYN_PUSH ](extracted); } else { failed[_DYN_PUSH ](extracted); } } if (payload[_DYN_LENGTH$2 ] > 0) { _self[_DYN__ON_SUCCESS ](payload, results[_DYN_ITEMS_ACCEPTED ]); } if (failed[_DYN_LENGTH$2 ] > 0) { _self[_DYN__ON_ERROR ](failed, _formatErrorMessageXhr(null, ["partial success", results[_DYN_ITEMS_ACCEPTED ], "of", results.itemsReceived].join(" "))); } if (retry[_DYN_LENGTH$2 ] > 0) { _resendPayload(retry); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , "Partial success. " + "Delivered: " + payload[_DYN_LENGTH$2 ] + ", Failed: " + failed[_DYN_LENGTH$2 ] + ". Will retry to send " + retry[_DYN_LENGTH$2 ] + " our of " + results[_DYN_ITEMS_RECEIVED ] + " items"); } }; _self[_DYN__ON_SUCCESS ] = function (payload, countOfItemsInPayload) { _self._buffer && _self._buffer[_DYN_CLEAR_SENT ](payload); }; _self._xdrOnLoad = function (xdr, payload) { var responseText = _getResponseText(xdr); if (xdr && (responseText + "" === "200" || responseText === "")) { _consecutiveErrors = 0; _self[_DYN__ON_SUCCESS ](payload, 0); } else { var results = _parseResponse(responseText); if (results && results.itemsReceived && results.itemsReceived > results[_DYN_ITEMS_ACCEPTED ] && !_isRetryDisabled) { _self[_DYN__ON_PARTIAL_SUCCESS ](payload, results); } else { _self[_DYN__ON_ERROR ](payload, _formatErrorMessageXdr(xdr)); } } }; function _isSampledIn(envelope) { return _self._sample.isSampledIn(envelope); } function _getSenderInterface(transports, syncSupport) { var _a; var transportType = null; var sendPostFunc = null; var lp = 0; while (sendPostFunc == null && lp < transports[_DYN_LENGTH$2 ]) { transportType = transports[lp]; if (!_disableXhr && transportType === 1 ) { if (useXDomainRequest()) { sendPostFunc = _xdrSender; } else if (isXhrSupported()) { sendPostFunc = _xhrSender; } } else if (transportType === 2 && isFetchSupported(syncSupport)) { sendPostFunc = _fetchSender; } else if (transportType === 3 && (syncSupport ? _beaconOnUnloadSupported : _beaconNormalSupported)) { sendPostFunc = _beaconSender; } lp++; } if (sendPostFunc) { return _a = {}, _a[_DYN_SEND_POST ] = sendPostFunc, _a; } return null; } function _getOnComplete(payload, status, headers, response) { if (status === 200 && payload) { _self._onSuccess(payload, payload[_DYN_LENGTH$2 ]); } else { response && _self[_DYN__ON_ERROR ](payload, response); } } function _doSend(sendInterface, payload, isAsync, markAsSent) { if (markAsSent === void 0) { markAsSent = true; } var onComplete = function (status, headers, response) { return _getOnComplete(payload, status, headers, response); }; var payloadData = _getPayload(payload); var sendPostFunc = sendInterface && sendInterface[_DYN_SEND_POST ]; if (sendPostFunc && payloadData) { if (markAsSent) { _self._buffer[_DYN_MARK_AS_SENT ](payload); } return sendPostFunc(payloadData, onComplete, !isAsync); } return null; } function _getPayload(payload) { var _a; if (isArray(payload) && payload[_DYN_LENGTH$2 ] > 0) { var batch = _self._buffer[_DYN_BATCH_PAYLOADS ](payload); var payloadData = (_a = {}, _a[_DYN_DATA ] = batch, _a.urlString = _endpointUrl, _a.headers = _headers, _a.disableXhrSync = _disableXhr, _a.disableFetchKeepAlive = !_fetchKeepAlive, _a[_DYN_ORI_PAYLOAD ] = payload, _a); return payloadData; } return null; } function _fetchSender(payload, oncomplete, sync) { return _doFetchSender(payload, oncomplete, false); } function _checkMaxSize(incomingPayload) { var incomingSize = incomingPayload ? incomingPayload[_DYN_LENGTH$2 ] : 0; if ((_self[_DYN__BUFFER ].size() + incomingSize) > _maxBatchSizeInBytes) { if (!_offlineListener || _offlineListener.isOnline()) { _self[_DYN_TRIGGER_SEND ](true, null, 10 ); } return true; } return false; } function _checkResponsStatus(status, payload, responseUrl, countOfItemsInPayload, errorMessage, res) { var response = null; if (!_self._appId) { response = _parseResponse(res); if (response && response.appId) { _self._appId = response.appId; } } if ((status < 200 || status >= 300) && status !== 0) { if (status === 301 || status === 307 || status === 308) { if (!_checkAndUpdateEndPointUrl(responseUrl)) { _self[_DYN__ON_ERROR ](payload, errorMessage); return; } } if (!_isRetryDisabled && _isRetriable(status)) { _resendPayload(payload); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". " + "Response code " + status + ". Will retry to send " + payload[_DYN_LENGTH$2 ] + " items."); } else { _self[_DYN__ON_ERROR ](payload, errorMessage); } } else if (_offlineListener && !_offlineListener.isOnline()) { if (!_isRetryDisabled) { var offlineBackOffMultiplier = 10; _resendPayload(payload, offlineBackOffMultiplier); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". Offline - Response Code: ".concat(status, ". Offline status: ").concat(!_offlineListener.isOnline(), ". Will retry to send ").concat(payload.length, " items.")); } } else { _checkAndUpdateEndPointUrl(responseUrl); if (status === 206) { if (!response) { response = _parseResponse(res); } if (response && !_isRetryDisabled) { _self[_DYN__ON_PARTIAL_SUCCESS ](payload, response); } else { _self[_DYN__ON_ERROR ](payload, errorMessage); } } else { _consecutiveErrors = 0; _self[_DYN__ON_SUCCESS ](payload, countOfItemsInPayload); } } } function _checkAndUpdateEndPointUrl(responseUrl) { if (_stamp_specific_redirects >= 10) { return false; } if (!isNullOrUndefined(responseUrl) && responseUrl !== "") { if (responseUrl !== _endpointUrl) { _endpointUrl = responseUrl; ++_stamp_specific_redirects; return true; } } return false; } function _doOnComplete(oncomplete, status, headers, response) { try { oncomplete(status, headers, response); } catch (e) { } } function _doUnloadSend(payload, isAsync) { if (_syncUnloadSender) { _syncUnloadSender(payload, false); } else { var payloadData = _getPayload(payload); _beaconSender(payloadData); } } function _doBeaconSend(payload, oncomplete) { var nav = getNavigator(); var url = _endpointUrl; var buffer = _self[_DYN__BUFFER ]; var batch = buffer[_DYN_BATCH_PAYLOADS ](payload); var plainTextBatch = new Blob([batch], { type: "text/plain;charset=UTF-8" }); var queued = nav.sendBeacon(url, plainTextBatch); if (queued) { _self._onSuccess(payload, payload[_DYN_LENGTH$2 ]); } return queued; } function _beaconSender(payload, oncomplete, sync) { var internalPayload = payload; var data = internalPayload && internalPayload[_DYN_ORI_PAYLOAD ]; if (isArray(data) && data[_DYN_LENGTH$2 ] > 0) { if (!_doBeaconSend(data)) { if (!_disableBeaconSplit) { var droppedPayload = []; for (var lp = 0; lp < data[_DYN_LENGTH$2 ]; lp++) { var thePayload = data[lp]; if (!_doBeaconSend([thePayload])) { droppedPayload[_DYN_PUSH ](thePayload); } } if (droppedPayload[_DYN_LENGTH$2 ] > 0) { _fallbackSend && _fallbackSend(droppedPayload, true); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". " + "Failed to send telemetry with Beacon API, retried with normal sender."); } } else { _fallbackSend && _fallbackSend(data, true); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". " + "Failed to send telemetry with Beacon API, retried with normal sender."); } } } } function _xhrSender(payload, oncomplete, sync) { var internalPayload = payload; var thePromise; var resolveFunc; var rejectFunc; var xhr = new XMLHttpRequest(); var endPointUrl = _endpointUrl; try { xhr[DisabledPropertyName] = true; } catch (e) { } xhr.open("POST", endPointUrl, !sync); xhr[_DYN_SET_REQUEST_HEADER$1 ]("Content-type", "application/json"); if (isInternalApplicationInsightsEndpoint(endPointUrl)) { xhr[_DYN_SET_REQUEST_HEADER$1 ](RequestHeaders[6 ], RequestHeaders[7 ]); } arrForEach(objKeys(_headers), function (headerName) { xhr[_DYN_SET_REQUEST_HEADER$1 ](headerName, _headers[headerName]); }); xhr.onreadystatechange = function () { var oriPayload = internalPayload[_DYN_ORI_PAYLOAD ]; _self._xhrReadyStateChange(xhr, oriPayload, oriPayload[_DYN_LENGTH$2 ]); if (xhr.readyState === 4) { resolveFunc && resolveFunc(true); } }; xhr.onerror = function (event) { _doOnComplete(oncomplete, 400, {}, _formatErrorMessageXhr(xhr)); rejectFunc && rejectFunc(event); }; if (!sync && _enableSendPromise) { thePromise = createPromise(function (resolve, reject) { resolveFunc = resolve; rejectFunc = reject; }); } xhr.send(payload[_DYN_DATA ]); return thePromise; } function _fetchKeepAliveSender(payload, isAsync) { var onComplete = function (status, headers, response) { return _getOnComplete(payload, status, headers, response); }; if (isArray(payload)) { var payloadSize = payload[_DYN_LENGTH$2 ]; for (var lp = 0; lp < payload[_DYN_LENGTH$2 ]; lp++) { payloadSize += payload[lp][_DYN_LENGTH$2 ]; } var payloadData = _getPayload(payload); _self._buffer[_DYN_MARK_AS_SENT ](payload); if ((_syncFetchPayload + payloadSize) <= FetchSyncRequestSizeLimitBytes) { _doFetchSender(payloadData, onComplete, true); } else if (isBeaconsSupported()) { _beaconSender(payloadData); } else { _fallbackSend && _fallbackSend(payload, true); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". " + "Failed to send telemetry with Beacon API, retried with xhrSender."); } } } function _doFetchSender(payload, oncomplete, sync) { var _a; var endPointUrl = _endpointUrl; var internalPayload = payload; var batch = internalPayload[_DYN_DATA ]; var plainTextBatch = new Blob([batch], { type: "application/json" }); var thePromise; var resolveFunc; var rejectFunc; var requestHeaders = new Headers(); var batchLength = batch[_DYN_LENGTH$2 ]; var ignoreResponse = false; var responseHandled = false; if (isInternalApplicationInsightsEndpoint(endPointUrl)) { requestHeaders.append(RequestHeaders[6 ], RequestHeaders[7 ]); } arrForEach(objKeys(_headers), function (headerName) { requestHeaders.append(headerName, _headers[headerName]); }); var init = (_a = { method: "POST", headers: requestHeaders, body: plainTextBatch }, _a[DisabledPropertyName] = true , _a); if (sync) { init.keepalive = true; ignoreResponse = true; _syncFetchPayload += batchLength; } var request = new Request(endPointUrl, init); try { request[DisabledPropertyName] = true; } catch (e) { } if (!sync && _enableSendPromise) { thePromise = createPromise(function (resolve, reject) { resolveFunc = resolve; rejectFunc = reject; }); } try { doAwaitResponse(fetch(request), function (result) { if (sync) { _syncFetchPayload -= batchLength; batchLength = 0; } if (!responseHandled) { responseHandled = true; if (!result.rejected) { var response_1 = result.value; if (!response_1.ok) { _doOnComplete(oncomplete, 400, {}, response_1.statusText); resolveFunc && resolveFunc(false); } else { doAwaitResponse(response_1.text(), function (resp) { var oriPayload = internalPayload[_DYN_ORI_PAYLOAD ]; _checkResponsStatus(response_1.status, oriPayload, response_1.url, oriPayload[_DYN_LENGTH$2 ], response_1.statusText, resp.value || ""); resolveFunc && resolveFunc(true); }); } } else { _doOnComplete(oncomplete, 400, {}, result.reason && result.reason.message); rejectFunc && rejectFunc(result.reason); } } }); } catch (e) { if (!responseHandled) { _doOnComplete(oncomplete, 400, {}, dumpObj(e)); rejectFunc && rejectFunc(e); } } if (ignoreResponse && !responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 200, {}); resolveFunc && resolveFunc(true); } return thePromise; } function _parseResponse(response) { try { if (response && response !== "") { var result = getJSON().parse(response); if (result && result.itemsReceived && result.itemsReceived >= result[_DYN_ITEMS_ACCEPTED ] && result.itemsReceived - result.itemsAccepted === result.errors[_DYN_LENGTH$2 ]) { return result; } } } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 43 , "Cannot parse the response. " + getExceptionName(e), { response: response }); } return null; } function _resendPayload(payload, linearFactor) { if (linearFactor === void 0) { linearFactor = 1; } if (!payload || payload[_DYN_LENGTH$2 ] === 0) { return; } var buffer = _self[_DYN__BUFFER ]; buffer[_DYN_CLEAR_SENT ](payload); _consecutiveErrors++; for (var _i = 0, payload_1 = payload; _i < payload_1.length; _i++) { var item = payload_1[_i]; buffer[_DYN_ENQUEUE ](item); } _setRetryTime(linearFactor); _setupTimer(); } function _setRetryTime(linearFactor) { var SlotDelayInSeconds = 10; var delayInSeconds; if (_consecutiveErrors <= 1) { delayInSeconds = SlotDelayInSeconds; } else { var backOffSlot = (Math.pow(2, _consecutiveErrors) - 1) / 2; var backOffDelay = Math.floor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1; backOffDelay = linearFactor * backOffDelay; delayInSeconds = Math.max(Math.min(backOffDelay, 3600), SlotDelayInSeconds); } var retryAfterTimeSpan = utcNow() + (delayInSeconds * 1000); _retryAt = retryAfterTimeSpan; } function _setupTimer() { if (!_timeoutHandle && !_paused) { var retryInterval = _retryAt ? Math.max(0, _retryAt - utcNow()) : 0; var timerValue = Math.max(_maxBatchInterval, retryInterval); _timeoutHandle = scheduleTimeout(function () { _timeoutHandle = null; _self[_DYN_TRIGGER_SEND ](true, null, 1 ); }, timerValue); } } function _clearScheduledTimer() { _timeoutHandle && _timeoutHandle.cancel(); _timeoutHandle = null; _retryAt = null; } function _isRetriable(statusCode) { return statusCode === 401 || statusCode === 403 || statusCode === 408 || statusCode === 429 || statusCode === 500 || statusCode === 502 || statusCode === 503 || statusCode === 504; } function _formatErrorMessageXhr(xhr, message) { if (xhr) { return "XMLHttpRequest,Status:" + xhr.status + ",Response:" + _getResponseText(xhr) || xhr.response || ""; } return message; } function _xdrSender(payload, oncomplete, sync) { var internalPayload = payload; var _window = getWindow(); var xdr = new XDomainRequest(); var data = internalPayload[_DYN_DATA ]; xdr.onload = function () { var oriPayload = internalPayload[_DYN_ORI_PAYLOAD ]; _self._xdrOnLoad(xdr, oriPayload); }; xdr.onerror = function () { _doOnComplete(oncomplete, 400, {}, _formatErrorMessageXdr(xdr)); }; var hostingProtocol = _window && _window.location && _window.location.protocol || ""; if (_endpointUrl.lastIndexOf(hostingProtocol, 0) !== 0) { _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". " + "Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."); _self._buffer[_DYN_CLEAR ](); return; } var endpointUrl = _endpointUrl.replace(/^(https?:)/, ""); xdr.open("POST", endpointUrl); xdr.send(data); } function _formatErrorMessageXdr(xdr, message) { if (xdr) { return "XDomainRequest,Response:" + _getResponseText(xdr) || ""; } return message; } function _getNotifyMgr() { var func = "getNotifyMgr"; if (_self.core[func]) { return _self.core[func](); } return _self.core["_notificationManager"]; } function _notifySendRequest(sendRequest, isAsync) { var manager = _getNotifyMgr(); if (manager && manager[_DYN_EVENTS_SEND_REQUEST ]) { try { manager[_DYN_EVENTS_SEND_REQUEST ](sendRequest, isAsync); } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 74 , "send request notification failed: " + getExceptionName(e), { exception: dumpObj(e) }); } } } function _validateInstrumentationKey(instrumentationKey, config) { var disableValidation = config.disableInstrumentationKeyValidation; var disableIKeyValidationFlag = isNullOrUndefined(disableValidation) ? false : disableValidation; if (disableIKeyValidationFlag) { return true; } var UUID_Regex = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"; var regexp = new RegExp(UUID_Regex); return regexp.test(instrumentationKey); } function _initDefaults() { _self[_DYN__SENDER ] = null; _self[_DYN__BUFFER ] = null; _self._appId = null; _self._sample = null; _headers = {}; _offlineListener = null; _consecutiveErrors = 0; _retryAt = null; _paused = false; _timeoutHandle = null; _serializer = null; _stamp_specific_redirects = 0; _syncFetchPayload = 0; _syncUnloadSender = null; _evtNamespace = null; _endpointUrl = null; _orgEndpointUrl = null; _maxBatchSizeInBytes = 0; _beaconSupported = false; _customHeaders = null; _disableTelemetry = false; _instrumentationKey = null; _convertUndefined = UNDEFINED_VALUE$1; _isRetryDisabled = false; _sessionStorageUsed = null; _namePrefix = UNDEFINED_VALUE$1; _disableXhr = false; _fetchKeepAlive = false; _disableBeaconSplit = false; _xhrSend = null; _fallbackSend = null; objDefine(_self, "_senderConfig", { g: function () { return objExtend({}, defaultAppInsightsChannelConfig); } }); } }); return _this; } Sender.constructEnvelope = function (orig, iKey, logger, convertUndefined) { var envelope; if (iKey !== orig.iKey && !isNullOrUndefined(iKey)) { envelope = __assignFn(__assignFn({}, orig), { iKey: iKey }); } else { envelope = orig; } var creator = EnvelopeTypeCreator[envelope.baseType] || EventEnvelopeCreator; return creator(logger, envelope, convertUndefined); }; return Sender; }(BaseTelemetryPlugin)); var STR_DURATION = "duration"; var STR_PROPERTIES = "properties"; var _DYN_REQUEST_URL = "requestUrl"; var _DYN_INST = "inst"; var _DYN_LENGTH$1 = "length"; var _DYN_TRACE_ID = "traceID"; var _DYN_SPAN_ID = "spanID"; var _DYN_TRACE_FLAGS = "traceFlags"; var _DYN_CONTEXT$1 = "context"; var _DYN_ABORTED = "aborted"; var _DYN_TRACE_ID0 = "traceId"; var _DYN_SPAN_ID1 = "spanId"; var _DYN__ADD_HOOK = "_addHook"; var _DYN_CORE = "core"; var _DYN_INCLUDE_CORRELATION_2 = "includeCorrelationHeaders"; var _DYN_GET_ABSOLUTE_URL = "getAbsoluteUrl"; var _DYN_HEADERS = "headers"; var _DYN_REQUEST_HEADERS = "requestHeaders"; var _DYN_SET_REQUEST_HEADER = "setRequestHeader"; var _DYN_TRACK_DEPENDENCY_DAT3 = "trackDependencyDataInternal"; var _DYN_START_TIME = "startTime"; var _DYN_TO_LOWER_CASE = "toLowerCase"; var _DYN_ENABLE_REQUEST_HEADE4 = "enableRequestHeaderTracking"; var _DYN_ENABLE_AJAX_ERROR_ST5 = "enableAjaxErrorStatusText"; var _DYN_ENABLE_AJAX_PERF_TRA6 = "enableAjaxPerfTracking"; var _DYN_MAX_AJAX_CALLS_PER_V7 = "maxAjaxCallsPerView"; var _DYN_EXCLUDE_REQUEST_FROM8 = "excludeRequestFromAutoTrackingPatterns"; var _DYN_ADD_REQUEST_CONTEXT = "addRequestContext"; var _DYN_DISABLE_AJAX_TRACKIN9 = "disableAjaxTracking"; var _DYN_AJAX_PERF_LOOKUP_DEL10 = "ajaxPerfLookupDelay"; var _DYN_DISABLE_FETCH_TRACKI11 = "disableFetchTracking"; var _DYN_ENABLE_RESPONSE_HEAD12 = "enableResponseHeaderTracking"; var _DYN_STATUS = "status"; var _DYN_STATUS_TEXT = "statusText"; var _DYN_HEADER_MAP = "headerMap"; var _DYN_OPEN_DONE = "openDone"; var _DYN_SEND_DONE = "sendDone"; var _DYN_REQUEST_SENT_TIME = "requestSentTime"; var _DYN_ABORT_DONE = "abortDone"; var _DYN_GET_TRACE_ID = "getTraceId"; var _DYN_GET_TRACE_FLAGS = "getTraceFlags"; var _DYN_METHOD = "method"; var _DYN_ERROR_STATUS_TEXT = "errorStatusText"; var _DYN_STATE_CHANGE_ATTACHE13 = "stateChangeAttached"; var _DYN_RESPONSE_TEXT = "responseText"; var _DYN_RESPONSE_FINISHED_TI14 = "responseFinishedTime"; var _DYN__CREATE_TRACK_ITEM = "CreateTrackItem"; var _DYN_RESPONSE = "response"; var _DYN_GET_ALL_RESPONSE_HEA15 = "getAllResponseHeaders"; var _DYN_GET_PART_APROPS = "getPartAProps"; var _DYN_PERF_MARK = "perfMark"; var _DYN_NAME = "name"; var _DYN_PERF_TIMING = "perfTiming"; var _DYN_EXCEPTION = "exception"; var _DYN_AJAX_DIAGNOSTICS_MES16 = "ajaxDiagnosticsMessage"; var _DYN_CORRELATION_CONTEXT = "correlationContext"; var _DYN_AJAX_TOTAL_DURATION = "ajaxTotalDuration"; var _DYN_EVENT_TRACE_CTX = "eventTraceCtx"; function _calcPerfDuration(resourceEntry, start, end) { var result = 0; var from = resourceEntry[start]; var to = resourceEntry[end]; if (from && to) { result = dateTimeUtilsDuration(from, to); } return result; } function _setPerfDuration(props, name, resourceEntry, start, end) { var result = 0; var value = _calcPerfDuration(resourceEntry, start, end); if (value) { result = _setPerfValue(props, name, msToTimeSpan(value)); } return result; } function _setPerfValue(props, name, value) { var strPerf = "ajaxPerf"; var result = 0; if (props && name && value) { var perfData = props[strPerf] = (props[strPerf] || {}); perfData[name] = value; result = 1; } return result; } function _populatePerfData(ajaxData, dependency) { var resourceEntry = ajaxData[_DYN_PERF_TIMING ]; var props = dependency[STR_PROPERTIES ] || {}; var propsSet = 0; var strName = "name"; var strStart = "Start"; var strEnd = "End"; var strDomainLookup = "domainLookup"; var strConnect = "connect"; var strRedirect = "redirect"; var strRequest = "request"; var strResponse = "response"; var strStartTime = "startTime"; var strDomainLookupStart = strDomainLookup + strStart; var strDomainLookupEnd = strDomainLookup + strEnd; var strConnectStart = strConnect + strStart; var strConnectEnd = strConnect + strEnd; var strRequestStart = strRequest + strStart; var strRequestEnd = strRequest + strEnd; var strResponseStart = strResponse + strStart; var strResponseEnd = strResponse + strEnd; var strRedirectStart = strRedirect + strStart; var strRedirectEnd = strRedirect = strEnd; var strTransferSize = "transferSize"; var strEncodedBodySize = "encodedBodySize"; var strDecodedBodySize = "decodedBodySize"; var strServerTiming = "serverTiming"; if (resourceEntry) { propsSet |= _setPerfDuration(props, strRedirect, resourceEntry, strRedirectStart, strRedirectEnd); propsSet |= _setPerfDuration(props, strDomainLookup, resourceEntry, strDomainLookupStart, strDomainLookupEnd); propsSet |= _setPerfDuration(props, strConnect, resourceEntry, strConnectStart, strConnectEnd); propsSet |= _setPerfDuration(props, strRequest, resourceEntry, strRequestStart, strRequestEnd); propsSet |= _setPerfDuration(props, strResponse, resourceEntry, strResponseStart, strResponseEnd); propsSet |= _setPerfDuration(props, "networkConnect", resourceEntry, strStartTime, strConnectEnd); propsSet |= _setPerfDuration(props, "sentRequest", resourceEntry, strRequestStart, strResponseEnd); var duration = resourceEntry[STR_DURATION ]; if (!duration) { duration = _calcPerfDuration(resourceEntry, strStartTime, strResponseEnd) || 0; } propsSet |= _setPerfValue(props, STR_DURATION, duration); propsSet |= _setPerfValue(props, "perfTotal", duration); var serverTiming = resourceEntry[strServerTiming]; if (serverTiming) { var server_1 = {}; arrForEach(serverTiming, function (value, idx) { var name = normalizeJsName(value[strName] || "" + idx); var newValue = server_1[name] || {}; objForEachKey(value, function (key, val) { if (key !== strName && isString(val) || isNumber(val)) { if (newValue[key]) { val = newValue[key] + ";" + val; } if (val || !isString(val)) { newValue[key] = val; } } }); server_1[name] = newValue; }); propsSet |= _setPerfValue(props, strServerTiming, server_1); } propsSet |= _setPerfValue(props, strTransferSize, resourceEntry[strTransferSize]); propsSet |= _setPerfValue(props, strEncodedBodySize, resourceEntry[strEncodedBodySize]); propsSet |= _setPerfValue(props, strDecodedBodySize, resourceEntry[strDecodedBodySize]); } else { if (ajaxData[_DYN_PERF_MARK ]) { propsSet |= _setPerfValue(props, "missing", ajaxData.perfAttempts); } } if (propsSet) { dependency[STR_PROPERTIES ] = props; } } var XHRMonitoringState = /** @class */ (function () { function XHRMonitoringState() { var self = this; self[_DYN_OPEN_DONE ] = false; self.setRequestHeaderDone = false; self[_DYN_SEND_DONE ] = false; self[_DYN_ABORT_DONE ] = false; self[_DYN_STATE_CHANGE_ATTACHE13 ] = false; } return XHRMonitoringState; }()); var ajaxRecord = /** @class */ (function () { function ajaxRecord(traceId, spanId, logger, traceCtx) { var _a; var self = this; var _logger = logger; var strResponseText = "responseText"; self[_DYN_PERF_MARK ] = null; self.completed = false; self.requestHeadersSize = null; self[_DYN_REQUEST_HEADERS ] = null; self.responseReceivingDuration = null; self.callbackDuration = null; self[_DYN_AJAX_TOTAL_DURATION ] = null; self[_DYN_ABORTED ] = 0; self.pageUrl = null; self[_DYN_REQUEST_URL ] = null; self.requestSize = 0; self[_DYN_METHOD ] = null; self[_DYN_STATUS ] = null; self[_DYN_REQUEST_SENT_TIME ] = null; self.responseStartedTime = null; self[_DYN_RESPONSE_FINISHED_TI14 ] = null; self.callbackFinishedTime = null; self.endTime = null; self.xhrMonitoringState = new XHRMonitoringState(); self.clientFailure = 0; self[_DYN_TRACE_ID ] = traceId; self[_DYN_SPAN_ID ] = spanId; self[_DYN_TRACE_FLAGS ] = traceCtx === null || traceCtx === void 0 ? void 0 : traceCtx.getTraceFlags(); if (traceCtx) { self[_DYN_EVENT_TRACE_CTX ] = (_a = {}, _a[_DYN_TRACE_ID0 ] = traceCtx[_DYN_GET_TRACE_ID ](), _a[_DYN_SPAN_ID1 ] = traceCtx.getSpanId(), _a[_DYN_TRACE_FLAGS ] = traceCtx[_DYN_GET_TRACE_FLAGS ](), _a); } else { self[_DYN_EVENT_TRACE_CTX ] = null; } dynamicProto(ajaxRecord, self, function (self) { self.getAbsoluteUrl = function () { return self[_DYN_REQUEST_URL ] ? urlGetAbsoluteUrl(self[_DYN_REQUEST_URL ]) : null; }; self.getPathName = function () { return self[_DYN_REQUEST_URL ] ? dataSanitizeUrl(_logger, urlGetCompleteUrl(self[_DYN_METHOD ], self[_DYN_REQUEST_URL ])) : null; }; self[_DYN__CREATE_TRACK_ITEM ] = function (ajaxType, enableRequestHeaderTracking, getResponse) { var _a; self.ajaxTotalDuration = Math.round(dateTimeUtilsDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000; if (self[_DYN_AJAX_TOTAL_DURATION ] < 0) { return null; } var dependency = (_a = { id: "|" + self[_DYN_TRACE_ID ] + "." + self[_DYN_SPAN_ID ], target: self[_DYN_GET_ABSOLUTE_URL ]() }, _a[_DYN_NAME ] = self.getPathName(), _a.type = ajaxType, _a[_DYN_START_TIME ] = null, _a.duration = self[_DYN_AJAX_TOTAL_DURATION ], _a.success = (+(self[_DYN_STATUS ])) >= 200 && (+(self[_DYN_STATUS ])) < 400, _a.responseCode = (+(self[_DYN_STATUS ])), _a[STR_PROPERTIES] = { HttpMethod: self[_DYN_METHOD ] }, _a); var props = dependency[STR_PROPERTIES]; if (self[_DYN_ABORTED ]) { props[_DYN_ABORTED ] = true; } if (self[_DYN_REQUEST_SENT_TIME ]) { dependency[_DYN_START_TIME ] = new Date(); dependency[_DYN_START_TIME ].setTime(self[_DYN_REQUEST_SENT_TIME ]); } _populatePerfData(self, dependency); if (enableRequestHeaderTracking) { if (objKeys(self.requestHeaders)[_DYN_LENGTH$1 ] > 0) { props[_DYN_REQUEST_HEADERS ] = self[_DYN_REQUEST_HEADERS ]; } } if (getResponse) { var response = getResponse(); if (response) { var correlationContext = response[_DYN_CORRELATION_CONTEXT ]; if (correlationContext) { dependency.correlationContext = correlationContext; } if (response[_DYN_HEADER_MAP ]) { if (objKeys(response.headerMap)[_DYN_LENGTH$1 ] > 0) { props.responseHeaders = response[_DYN_HEADER_MAP ]; } } if (self[_DYN_ERROR_STATUS_TEXT ]) { if (self[_DYN_STATUS ] >= 400) { var responseType = response.type; if (responseType === "" || responseType === "text") { props.responseText = response.responseText ? response[_DYN_STATUS_TEXT ] + " - " + response[strResponseText] : response[_DYN_STATUS_TEXT ]; } if (responseType === "json") { props.responseText = response.response ? response[_DYN_STATUS_TEXT ] + " - " + JSON.stringify(response[_DYN_RESPONSE ]) : response[_DYN_STATUS_TEXT ]; } } else if (self[_DYN_STATUS ] === 0) { props.responseText = response[_DYN_STATUS_TEXT ] || ""; } } } } return dependency; }; self[_DYN_GET_PART_APROPS ] = function () { var _a; var partA = null; var traceCtx = self[_DYN_EVENT_TRACE_CTX ]; if (traceCtx && (traceCtx[_DYN_TRACE_ID0 ] || traceCtx[_DYN_SPAN_ID1 ])) { partA = {}; var traceExt = partA[Extensions.TraceExt] = (_a = {}, _a[_DYN_TRACE_ID ] = traceCtx[_DYN_TRACE_ID0 ], _a.parentID = traceCtx[_DYN_SPAN_ID1 ], _a); if (!isNullOrUndefined(traceCtx[_DYN_TRACE_FLAGS ])) { traceExt[_DYN_TRACE_FLAGS ] = traceCtx[_DYN_TRACE_FLAGS ]; } } return partA; }; }); } ajaxRecord.__ieDyn=1; return ajaxRecord; }()); var _a$2; var AJAX_MONITOR_PREFIX = "ai.ajxmn."; var strDiagLog = "diagLog"; var AJAX_DATA_CONTAINER = "_ajaxData"; var STR_FETCH = "fetch"; var ERROR_HEADER = "Failed to monitor XMLHttpRequest"; var ERROR_PREFIX = ", monitoring data for this ajax call "; var ERROR_POSTFIX = ERROR_PREFIX + "may be incorrect."; var ERROR_NOT_SENT = ERROR_PREFIX + "won't be sent."; var CORRELATION_HEADER_ERROR = "Failed to get Request-Context correlation header as it may be not included in the response or not accessible."; var CUSTOM_REQUEST_CONTEXT_ERROR = "Failed to add custom defined request context as configured call back may missing a null check."; var FAILED_TO_CALCULATE_DURATION_ERROR = "Failed to calculate the duration of the "; var _markCount = 0; function _supportsFetch() { var _global = getGlobal(); if (!_global || isNullOrUndefined(_global.Request) || isNullOrUndefined(_global.Request[strShimPrototype]) || isNullOrUndefined(_global[STR_FETCH])) { return null; } return _global[STR_FETCH]; } function _supportsAjaxMonitoring(ajaxMonitorInstance, ajaxDataId) { var _a, _b; var result = false; if (isXhrSupported()) { var proto = XMLHttpRequest[strShimPrototype]; result = !isNullOrUndefined(proto) && !isNullOrUndefined(proto.open) && !isNullOrUndefined(proto.send) && !isNullOrUndefined(proto.abort); } var ieVer = getIEVersion(); if (ieVer && ieVer < 9) { result = false; } if (result) { try { var xhr = new XMLHttpRequest(); var xhrData = { xh: [], i: (_a = {}, _a[ajaxDataId] = {}, _a) }; xhr[AJAX_DATA_CONTAINER] = xhrData; var theOpen = XMLHttpRequest[strShimPrototype].open; XMLHttpRequest[strShimPrototype].open = theOpen; } catch (e) { result = false; _throwInternalCritical(ajaxMonitorInstance, 15 , "Failed to enable XMLHttpRequest monitoring, extension is not supported", (_b = {}, _b[_DYN_EXCEPTION ] = dumpObj(e), _b)); } } return result; } var _getAjaxData = function (xhr, ajaxDataId) { if (xhr && ajaxDataId && xhr[AJAX_DATA_CONTAINER]) { return (xhr[AJAX_DATA_CONTAINER].i || {})[ajaxDataId]; } return null; }; var _addSharedXhrHeaders = function (xhr, name, value) { if (xhr) { var headers = (xhr[AJAX_DATA_CONTAINER] || {}).xh; if (headers) { headers.push({ n: name, v: value }); } } }; var _isHeaderSet = function (xhr, name) { var isPresent = false; if (xhr) { var headers = (xhr[AJAX_DATA_CONTAINER] || {}).xh; if (headers) { arrForEach(headers, function (header) { if (header.n === name) { isPresent = true; return -1; } }); } } return isPresent; }; function _getFailedAjaxDiagnosticsMessage(xhr, ajaxDataId) { var result = ""; try { var ajaxData = _getAjaxData(xhr, ajaxDataId); if (ajaxData && ajaxData[_DYN_REQUEST_URL ]) { result += "(url: '" + ajaxData[_DYN_REQUEST_URL ] + "')"; } } catch (e) { } return result; } function _throwInternalCritical(ajaxMonitorInstance, msgId, message, properties, isUserAct) { _throwInternal(ajaxMonitorInstance[strDiagLog](), 1 , msgId, message, properties, isUserAct); } function _throwInternalWarning(ajaxMonitorInstance, msgId, message, properties, isUserAct) { _throwInternal(ajaxMonitorInstance[strDiagLog](), 2 , msgId, message, properties, isUserAct); } function _createErrorCallbackFunc(ajaxMonitorInstance, internalMessage, message) { return function (callDetails) { var _a; _throwInternalCritical(ajaxMonitorInstance, internalMessage, message, (_a = { ajaxDiagnosticsMessage: _getFailedAjaxDiagnosticsMessage(callDetails[_DYN_INST ], ajaxMonitorInstance._ajaxDataId) }, _a[_DYN_EXCEPTION ] = dumpObj(callDetails.err), _a)); }; } function _indexOf(value, match) { if (value && match) { return strIndexOf(value, match); } return -1; } function _addHandler(container, id, theFunc) { var theHandler = { id: id, fn: theFunc }; container.push(theHandler); return { remove: function () { arrForEach(container, function (initializer, idx) { if (initializer.id === theHandler.id) { container.splice(idx, 1); return -1; } }); } }; } function _processDependencyContainer(core, container, details, message) { var result = true; arrForEach(container, function (theFunc, idx) { try { if (theFunc.fn.call(null, details) === false) { result = false; } } catch (e) { _throwInternal(core && core.logger, 1 , 64 , "Dependency " + message + " [#" + idx + "] failed: " + getExceptionName(e), { exception: dumpObj(e) }, true); } }); return result; } function _processDependencyListeners(listeners, core, ajaxData, xhr, input, init) { var _a; var initializersCount = listeners[_DYN_LENGTH$1 ]; if (initializersCount > 0) { var details = (_a = {}, _a[_DYN_CORE ] = core, _a.xhr = xhr, _a.input = input, _a.init = init, _a.traceId = ajaxData[_DYN_TRACE_ID ], _a.spanId = ajaxData[_DYN_SPAN_ID ], _a.traceFlags = ajaxData[_DYN_TRACE_FLAGS ], _a.context = ajaxData[_DYN_CONTEXT$1 ] || {}, _a.aborted = !!ajaxData[_DYN_ABORTED ], _a); _processDependencyContainer(core, listeners, details, "listener"); ajaxData[_DYN_TRACE_ID ] = details[_DYN_TRACE_ID0 ]; ajaxData[_DYN_SPAN_ID ] = details[_DYN_SPAN_ID1 ]; ajaxData[_DYN_TRACE_FLAGS ] = details[_DYN_TRACE_FLAGS ]; ajaxData[_DYN_CONTEXT$1 ] = details[_DYN_CONTEXT$1 ]; } } var BLOB_CORE = "*.blob.core."; var DfltAjaxCorrelationHeaderExDomains = objFreeze([ BLOB_CORE + "windows.net", BLOB_CORE + "chinacloudapi.cn", BLOB_CORE + "cloudapi.de", BLOB_CORE + "usgovcloudapi.net" ]); var _internalExcludeEndpoints = [ /https:\/\/[^\/]*(\.pipe\.aria|aria\.pipe|events\.data|collector\.azure)\.[^\/]+\/(OneCollector\/1|Collector\/3)\.0/i ]; var _defaultConfig$1 = objFreeze((_a$2 = {}, _a$2[_DYN_MAX_AJAX_CALLS_PER_V7 ] = 500, _a$2[_DYN_DISABLE_AJAX_TRACKIN9 ] = false, _a$2[_DYN_DISABLE_FETCH_TRACKI11 ] = false, _a$2[_DYN_EXCLUDE_REQUEST_FROM8 ] = undefined, _a$2.disableCorrelationHeaders = false, _a$2.distributedTracingMode = 1 , _a$2.correlationHeaderExcludedDomains = DfltAjaxCorrelationHeaderExDomains, _a$2.correlationHeaderDomains = undefined, _a$2.correlationHeaderExcludePatterns = undefined, _a$2.appId = undefined, _a$2.enableCorsCorrelation = false, _a$2[_DYN_ENABLE_REQUEST_HEADE4 ] = false, _a$2[_DYN_ENABLE_RESPONSE_HEAD12 ] = false, _a$2[_DYN_ENABLE_AJAX_ERROR_ST5 ] = false, _a$2[_DYN_ENABLE_AJAX_PERF_TRA6 ] = false, _a$2.maxAjaxPerfLookupAttempts = 3, _a$2[_DYN_AJAX_PERF_LOOKUP_DEL10 ] = 25, _a$2.ignoreHeaders = [ "Authorization", "X-API-Key", "WWW-Authenticate" ], _a$2[_DYN_ADD_REQUEST_CONTEXT ] = undefined, _a$2.addIntEndpoints = true, _a$2)); var AjaxMonitor = /** @class */ (function (_super) { __extendsFn(AjaxMonitor, _super); function AjaxMonitor() { var _this = _super.call(this) || this; _this.identifier = AjaxMonitor.identifier; _this.priority = 120; var _fetchInitialized; var _xhrInitialized; var _currentWindowHost; var _extensionConfig; var _enableRequestHeaderTracking; var _enableAjaxErrorStatusText; var _trackAjaxAttempts; var _context; var _isUsingW3CHeaders; var _isUsingAIHeaders; var _markPrefix; var _enableAjaxPerfTracking; var _maxAjaxCallsPerView; var _enableResponseHeaderTracking; var _disabledUrls; var _disableAjaxTracking; var _disableFetchTracking; var _excludeRequestFromAutoTrackingPatterns; var _addRequestContext; var _evtNamespace; var _ajaxDataId; var _dependencyHandlerId; var _dependencyListeners; var _dependencyInitializers; var _ignoreHeaders; var _maxAjaxPerfLookupAttempts; var _ajaxPerfLookupDelay; var _distributedTracingMode; var _appId; var _polyfillInitialized; dynamicProto(AjaxMonitor, _this, function (_self, _base) { var _addHook = _base[_DYN__ADD_HOOK ]; _initDefaults(); _self.initialize = function (config, core, extensions, pluginChain) { if (!_self.isInitialized()) { _base.initialize(config, core, extensions, pluginChain); _evtNamespace = mergeEvtNamespace(createUniqueNamespace("ajax"), core && core.evtNamespace && core.evtNamespace()); _populateDefaults(config); _instrumentXhr(); _instrumentFetch(); _populateContext(); } }; _self._doTeardown = function () { _initDefaults(); }; _self.trackDependencyData = function (dependency, properties) { _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE ], null, dependency, properties); }; _self[_DYN_INCLUDE_CORRELATION_2 ] = function (ajaxData, input, init, xhr) { var currentWindowHost = _self["_currentWindowHost"] || _currentWindowHost; _processDependencyListeners(_dependencyListeners, _self[_DYN_CORE ], ajaxData, xhr, input, init); if (input || input === "") { if (correlationIdCanIncludeCorrelationHeader(_extensionConfig, ajaxData[_DYN_GET_ABSOLUTE_URL ](), currentWindowHost)) { if (!init) { init = {}; } var headers = new Headers(init[_DYN_HEADERS ] || (input instanceof Request ? (input[_DYN_HEADERS ] || {}) : {})); if (_isUsingAIHeaders) { var id = "|" + ajaxData[_DYN_TRACE_ID ] + "." + ajaxData[_DYN_SPAN_ID ]; headers.set(RequestHeaders[3 ], id); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[3 ]] = id; } } var appId = _appId || (_context && _context.appId()); if (appId) { headers.set(RequestHeaders[0 ], RequestHeaders[2 ] + appId); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[0 ]] = RequestHeaders[2 ] + appId; } } if (_isUsingW3CHeaders) { var traceFlags = ajaxData[_DYN_TRACE_FLAGS ]; if (isNullOrUndefined(traceFlags)) { traceFlags = 0x01; } var traceParent = formatTraceParent(createTraceParent(ajaxData[_DYN_TRACE_ID ], ajaxData[_DYN_SPAN_ID ], traceFlags)); headers.set(RequestHeaders[4 ], traceParent); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[4 ]] = traceParent; } } init[_DYN_HEADERS ] = headers; } return init; } else if (xhr) { if (correlationIdCanIncludeCorrelationHeader(_extensionConfig, ajaxData[_DYN_GET_ABSOLUTE_URL ](), currentWindowHost)) { if (_isUsingAIHeaders) { if (!_isHeaderSet(xhr, RequestHeaders[3 ])) { var id = "|" + ajaxData[_DYN_TRACE_ID ] + "." + ajaxData[_DYN_SPAN_ID ]; xhr[_DYN_SET_REQUEST_HEADER ](RequestHeaders[3 ], id); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[3 ]] = id; } } else { _throwInternalWarning(_self, 71 , "Unable to set [" + RequestHeaders[3 ] + "] as it has already been set by another instance"); } } var appId = _appId || (_context && _context.appId()); if (appId) { if (!_isHeaderSet(xhr, RequestHeaders[0 ])) { xhr[_DYN_SET_REQUEST_HEADER ](RequestHeaders[0 ], RequestHeaders[2 ] + appId); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[0 ]] = RequestHeaders[2 ] + appId; } } else { _throwInternalWarning(_self, 71 , "Unable to set [" + RequestHeaders[0 ] + "] as it has already been set by another instance"); } } if (_isUsingW3CHeaders) { var traceFlags = ajaxData[_DYN_TRACE_FLAGS ]; if (isNullOrUndefined(traceFlags)) { traceFlags = 0x01; } if (!_isHeaderSet(xhr, RequestHeaders[4 ])) { var traceParent = formatTraceParent(createTraceParent(ajaxData[_DYN_TRACE_ID ], ajaxData[_DYN_SPAN_ID ], traceFlags)); xhr[_DYN_SET_REQUEST_HEADER ](RequestHeaders[4 ], traceParent); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[4 ]] = traceParent; } } else { _throwInternalWarning(_self, 71 , "Unable to set [" + RequestHeaders[4 ] + "] as it has already been set by another instance"); } } } return xhr; } return undefined; }; _self[_DYN_TRACK_DEPENDENCY_DAT3 ] = function (dependency, properties, systemProperties) { if (_maxAjaxCallsPerView === -1 || _trackAjaxAttempts < _maxAjaxCallsPerView) { if ((_distributedTracingMode === 2 || _distributedTracingMode === 1 ) && typeof dependency.id === "string" && dependency.id[dependency.id[_DYN_LENGTH$1 ] - 1] !== ".") { dependency.id += "."; } if (isNullOrUndefined(dependency[_DYN_START_TIME ])) { dependency[_DYN_START_TIME ] = new Date(); } var item = createTelemetryItem(dependency, RemoteDependencyData.dataType, RemoteDependencyData.envelopeType, _self[strDiagLog](), properties, systemProperties); _self[_DYN_CORE ].track(item); } else if (_trackAjaxAttempts === _maxAjaxCallsPerView) { _throwInternalCritical(_self, 55 , "Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.", true); } ++_trackAjaxAttempts; }; _self.addDependencyListener = function (dependencyListener) { return _addHandler(_dependencyListeners, _dependencyHandlerId++, dependencyListener); }; _self.addDependencyInitializer = function (dependencyInitializer) { return _addHandler(_dependencyInitializers, _dependencyHandlerId++, dependencyInitializer); }; function _initDefaults() { var location = getLocation(); _fetchInitialized = false; _xhrInitialized = false; _polyfillInitialized = false; _currentWindowHost = location && location.host && location.host[_DYN_TO_LOWER_CASE ](); _extensionConfig = null; _enableRequestHeaderTracking = false; _enableAjaxErrorStatusText = false; _trackAjaxAttempts = 0; _context = null; _isUsingW3CHeaders = false; _isUsingAIHeaders = false; _markPrefix = null; _enableAjaxPerfTracking = false; _maxAjaxCallsPerView = 0; _enableResponseHeaderTracking = false; _disabledUrls = {}; _disableAjaxTracking = false; _disableFetchTracking = false; _excludeRequestFromAutoTrackingPatterns = null; _addRequestContext = null; _evtNamespace = null; _dependencyHandlerId = 0; _dependencyListeners = []; _dependencyInitializers = []; _ajaxDataId = createUniqueNamespace("ajaxData"); _self._ajaxDataId = _ajaxDataId; _ignoreHeaders = null; _maxAjaxPerfLookupAttempts = 1; _ajaxPerfLookupDelay = 1; _distributedTracingMode = 1 ; _appId = null; } function _populateDefaults(config) { _self[_DYN__ADD_HOOK ](onConfigChange(config, function (details) { var config = details.cfg; var ctx = createProcessTelemetryContext(null, config, _self[_DYN_CORE ]); _extensionConfig = ctx.getExtCfg(AjaxMonitor.identifier, _defaultConfig$1); _distributedTracingMode = _extensionConfig.distributedTracingMode; _enableRequestHeaderTracking = _extensionConfig[_DYN_ENABLE_REQUEST_HEADE4 ]; _enableAjaxErrorStatusText = _extensionConfig[_DYN_ENABLE_AJAX_ERROR_ST5 ]; _enableAjaxPerfTracking = _extensionConfig[_DYN_ENABLE_AJAX_PERF_TRA6 ]; _maxAjaxCallsPerView = _extensionConfig[_DYN_MAX_AJAX_CALLS_PER_V7 ]; _excludeRequestFromAutoTrackingPatterns = [].concat(_extensionConfig[_DYN_EXCLUDE_REQUEST_FROM8 ] || [], _extensionConfig.addIntEndpoints !== false ? _internalExcludeEndpoints : []); _addRequestContext = _extensionConfig[_DYN_ADD_REQUEST_CONTEXT ]; _isUsingAIHeaders = _distributedTracingMode === 0 || _distributedTracingMode === 1 ; _isUsingW3CHeaders = _distributedTracingMode === 1 || _distributedTracingMode === 2 ; if (_enableAjaxPerfTracking) { var iKey = config.instrumentationKey || "unkwn"; if (iKey[_DYN_LENGTH$1 ] > 5) { _markPrefix = AJAX_MONITOR_PREFIX + strSubstring(iKey, iKey[_DYN_LENGTH$1 ] - 5) + "."; } else { _markPrefix = AJAX_MONITOR_PREFIX + iKey + "."; } } _disableAjaxTracking = !!_extensionConfig[_DYN_DISABLE_AJAX_TRACKIN9 ]; _maxAjaxPerfLookupAttempts = _extensionConfig.maxAjaxPerfLookupAttempts; _ajaxPerfLookupDelay = _extensionConfig[_DYN_AJAX_PERF_LOOKUP_DEL10 ]; _ignoreHeaders = _extensionConfig.ignoreHeaders; _appId = _extensionConfig.appId; })); } function _populateContext() { var propExt = _self[_DYN_CORE ].getPlugin(PropertiesPluginIdentifier); if (propExt) { _context = propExt.plugin[_DYN_CONTEXT$1 ]; } } function _canIncludeHeaders(header) { var rlt = true; if (header || _ignoreHeaders) { arrForEach(_ignoreHeaders, (function (key) { if (key[_DYN_TO_LOWER_CASE ]() === header[_DYN_TO_LOWER_CASE ]()) { rlt = false; return -1; } })); } return rlt; } function _instrumentFetch() { var fetch = _supportsFetch(); if (!fetch) { return; } var global = getGlobal(); var isPolyfill = fetch.polyfill; _self[_DYN__ADD_HOOK ](onConfigChange(_extensionConfig, function () { _disableFetchTracking = !!_extensionConfig[_DYN_DISABLE_FETCH_TRACKI11 ]; _enableResponseHeaderTracking = _extensionConfig[_DYN_ENABLE_RESPONSE_HEAD12 ]; if (!_disableFetchTracking && !_fetchInitialized) { _addHook(InstrumentFunc(global, STR_FETCH, { ns: _evtNamespace, req: function (callDetails, input, init) { var fetchData; if (!_disableFetchTracking && _fetchInitialized && !_isDisabledRequest(null, input, init) && !(isPolyfill && _xhrInitialized)) { var ctx = callDetails.ctx(); fetchData = _createFetchRecord(input, init); var newInit = _self[_DYN_INCLUDE_CORRELATION_2 ](fetchData, input, init); if (newInit !== init) { callDetails.set(1, newInit); } ctx.data = fetchData; } }, rsp: function (callDetails, input) { if (!_disableFetchTracking) { var fetchData_1 = callDetails.ctx().data; if (fetchData_1) { callDetails.rslt = callDetails.rslt.then(function (response) { _reportFetchMetrics(callDetails, (response || {})[_DYN_STATUS ], input, response, fetchData_1, function () { var _a; var ajaxResponse = (_a = { statusText: (response || {})[_DYN_STATUS_TEXT ] }, _a[_DYN_HEADER_MAP ] = null, _a[_DYN_CORRELATION_CONTEXT ] = _getFetchCorrelationContext(response), _a); if (_enableResponseHeaderTracking && response) { var responseHeaderMap_1 = {}; response.headers.forEach(function (value, name) { if (_canIncludeHeaders(name)) { responseHeaderMap_1[name] = value; } }); ajaxResponse[_DYN_HEADER_MAP ] = responseHeaderMap_1; } return ajaxResponse; }); return response; }) .catch(function (reason) { _reportFetchMetrics(callDetails, 0, input, null, fetchData_1, null, { error: reason.message || dumpObj(reason) }); throw reason; }); } } }, hkErr: _createErrorCallbackFunc(_self, 15 , "Failed to monitor Window.fetch" + ERROR_POSTFIX) }, true, isWebWorker())); _fetchInitialized = true; } else if (isPolyfill && !_polyfillInitialized) { _addHook(InstrumentFunc(global, STR_FETCH, { ns: _evtNamespace, req: function (callDetails, input, init) { _isDisabledRequest(null, input, init); } })); _polyfillInitialized = true; } })); if (isPolyfill) { global[STR_FETCH].polyfill = isPolyfill; } } function _hookProto(target, funcName, callbacks) { _addHook(InstrumentProto(target, funcName, callbacks)); } function _instrumentXhr() { if (!_supportsAjaxMonitoring(_self, _ajaxDataId)) { return; } _self[_DYN__ADD_HOOK ](onConfigChange(_extensionConfig, function () { _disableAjaxTracking = !!_extensionConfig[_DYN_DISABLE_AJAX_TRACKIN9 ]; _enableRequestHeaderTracking = _extensionConfig[_DYN_ENABLE_REQUEST_HEADE4 ]; if (!_disableAjaxTracking && !_xhrInitialized) { _hookProto(XMLHttpRequest, "open", { ns: _evtNamespace, req: function (callDetails, method, url, async) { if (!_disableAjaxTracking) { var xhr = callDetails[_DYN_INST ]; var ajaxData = _getAjaxData(xhr, _ajaxDataId); if (!_isDisabledRequest(xhr, url) && _isMonitoredXhrInstance(xhr, ajaxData, true)) { if (!ajaxData || !ajaxData.xhrMonitoringState[_DYN_OPEN_DONE ]) { ajaxData = _openHandler(xhr, method, url, async); } _attachToOnReadyStateChange(xhr, ajaxData); } } }, hkErr: _createErrorCallbackFunc(_self, 15 , ERROR_HEADER + ".open" + ERROR_POSTFIX) }); _hookProto(XMLHttpRequest, "send", { ns: _evtNamespace, req: function (callDetails, context) { if (!_disableAjaxTracking) { var xhr = callDetails[_DYN_INST ]; var ajaxData = _getAjaxData(xhr, _ajaxDataId); if (_isMonitoredXhrInstance(xhr, ajaxData) && !ajaxData.xhrMonitoringState[_DYN_SEND_DONE ]) { _createMarkId("xhr", ajaxData); ajaxData[_DYN_REQUEST_SENT_TIME ] = dateTimeUtilsNow(); _self[_DYN_INCLUDE_CORRELATION_2 ](ajaxData, undefined, undefined, xhr); ajaxData.xhrMonitoringState[_DYN_SEND_DONE ] = true; } } }, hkErr: _createErrorCallbackFunc(_self, 17 , ERROR_HEADER + ERROR_POSTFIX) }); _hookProto(XMLHttpRequest, "abort", { ns: _evtNamespace, req: function (callDetails) { if (!_disableAjaxTracking) { var xhr = callDetails[_DYN_INST ]; var ajaxData = _getAjaxData(xhr, _ajaxDataId); if (_isMonitoredXhrInstance(xhr, ajaxData) && !ajaxData.xhrMonitoringState[_DYN_ABORT_DONE ]) { ajaxData[_DYN_ABORTED ] = 1; ajaxData.xhrMonitoringState[_DYN_ABORT_DONE ] = true; } } }, hkErr: _createErrorCallbackFunc(_self, 13 , ERROR_HEADER + ".abort" + ERROR_POSTFIX) }); _hookProto(XMLHttpRequest, "setRequestHeader", { ns: _evtNamespace, req: function (callDetails, header, value) { if (!_disableAjaxTracking) { var xhr = callDetails[_DYN_INST ]; var ajaxData = _getAjaxData(xhr, _ajaxDataId); if (ajaxData && _isMonitoredXhrInstance(xhr, ajaxData)) { _addSharedXhrHeaders(xhr, header, value); if (_enableRequestHeaderTracking && _canIncludeHeaders(header)) { if (ajaxData) { ajaxData[_DYN_REQUEST_HEADERS ][header] = value; } } } } }, hkErr: _createErrorCallbackFunc(_self, 71 , ERROR_HEADER + ".setRequestHeader" + ERROR_POSTFIX) }); _xhrInitialized = true; } })); } function _isDisabledRequest(xhr, request, init) { var isDisabled = false; var theUrl = ((!isString(request) ? (request || {}).url || "" : request) || "")[_DYN_TO_LOWER_CASE ](); arrForEach(_excludeRequestFromAutoTrackingPatterns, function (regex) { var theRegex = regex; if (isString(regex)) { theRegex = new RegExp(regex); } if (!isDisabled) { isDisabled = theRegex.test(theUrl); } }); if (isDisabled) { return isDisabled; } var idx = _indexOf(theUrl, "?"); var idx2 = _indexOf(theUrl, "#"); if (idx === -1 || (idx2 !== -1 && idx2 < idx)) { idx = idx2; } if (idx !== -1) { theUrl = theUrl.substring(0, idx); } if (!isNullOrUndefined(xhr)) { isDisabled = xhr[DisabledPropertyName] === true || theUrl[DisabledPropertyName] === true; } else if (!isNullOrUndefined(request)) { isDisabled = (typeof request === "object" ? request[DisabledPropertyName] === true : false) || (init ? init[DisabledPropertyName] === true : false); } if (!isDisabled && theUrl && isInternalApplicationInsightsEndpoint(theUrl)) { isDisabled = true; } if (isDisabled) { if (!_disabledUrls[theUrl]) { _disabledUrls[theUrl] = 1; } } else { if (_disabledUrls[theUrl]) { isDisabled = true; } } return isDisabled; } function _isMonitoredXhrInstance(xhr, ajaxData, excludeAjaxDataValidation) { var ajaxValidation = true; var initialized = _xhrInitialized; if (!isNullOrUndefined(xhr)) { ajaxValidation = excludeAjaxDataValidation === true || !isNullOrUndefined(ajaxData); } return initialized && ajaxValidation; } function _getDistributedTraceCtx() { var distributedTraceCtx = null; if (_self[_DYN_CORE ] && _self[_DYN_CORE ].getTraceCtx) { distributedTraceCtx = _self[_DYN_CORE ].getTraceCtx(false); } if (!distributedTraceCtx && _context && _context.telemetryTrace) { distributedTraceCtx = createDistributedTraceContextFromTrace(_context.telemetryTrace); } return distributedTraceCtx; } function _openHandler(xhr, method, url, async) { var _a; var distributedTraceCtx = _getDistributedTraceCtx(); var traceID = (distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_ID ]()) || generateW3CId(); var spanID = strSubstr(generateW3CId(), 0, 16); var xhrRequestData = xhr[AJAX_DATA_CONTAINER] = (xhr[AJAX_DATA_CONTAINER] || { xh: [], i: {} }); var ajaxDataCntr = xhrRequestData.i = (xhrRequestData.i || {}); var ajaxData = ajaxDataCntr[_ajaxDataId] = (ajaxDataCntr[_ajaxDataId] || new ajaxRecord(traceID, spanID, _self[strDiagLog](), (_a = _self.core) === null || _a === void 0 ? void 0 : _a.getTraceCtx())); ajaxData[_DYN_TRACE_FLAGS ] = distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_FLAGS ](); ajaxData[_DYN_METHOD ] = method; ajaxData[_DYN_REQUEST_URL ] = url; ajaxData.xhrMonitoringState[_DYN_OPEN_DONE ] = true; ajaxData[_DYN_REQUEST_HEADERS ] = {}; ajaxData.async = async; ajaxData[_DYN_ERROR_STATUS_TEXT ] = _enableAjaxErrorStatusText; return ajaxData; } function _attachToOnReadyStateChange(xhr, ajaxData) { ajaxData.xhrMonitoringState[_DYN_STATE_CHANGE_ATTACHE13 ] = eventOn(xhr, "readystatechange", function () { var _a; try { if (xhr && xhr.readyState === 4 && _isMonitoredXhrInstance(xhr, ajaxData)) { _onAjaxComplete(xhr); } } catch (e) { var exceptionText = dumpObj(e); if (!exceptionText || _indexOf(exceptionText[_DYN_TO_LOWER_CASE ](), "c00c023f") === -1) { _throwInternalCritical(_self, 16 , ERROR_HEADER + " 'readystatechange' event handler" + ERROR_POSTFIX, (_a = {}, _a[_DYN_AJAX_DIAGNOSTICS_MES16 ] = _getFailedAjaxDiagnosticsMessage(xhr, _ajaxDataId), _a[_DYN_EXCEPTION ] = exceptionText, _a)); } } }, _evtNamespace); } function _getResponseText(xhr) { try { var responseType = xhr.responseType; if (responseType === "" || responseType === "text") { return xhr[_DYN_RESPONSE_TEXT ]; } } catch (e) { } return null; } function _onAjaxComplete(xhr) { var ajaxData = _getAjaxData(xhr, _ajaxDataId); ajaxData[_DYN_RESPONSE_FINISHED_TI14 ] = dateTimeUtilsNow(); ajaxData[_DYN_STATUS ] = xhr[_DYN_STATUS ]; function _reportXhrError(e, failedProps) { var errorProps = failedProps || {}; errorProps["ajaxDiagnosticsMessage"] = _getFailedAjaxDiagnosticsMessage(xhr, _ajaxDataId); if (e) { errorProps["exception"] = dumpObj(e); } _throwInternalWarning(_self, 14 , FAILED_TO_CALCULATE_DURATION_ERROR + "ajax call" + ERROR_NOT_SENT, errorProps); } _findPerfResourceEntry("xmlhttprequest", ajaxData, function () { try { var dependency = ajaxData[_DYN__CREATE_TRACK_ITEM ]("Ajax", _enableRequestHeaderTracking, function () { var _a; var ajaxResponse = (_a = { statusText: xhr[_DYN_STATUS_TEXT ] }, _a[_DYN_HEADER_MAP ] = null, _a[_DYN_CORRELATION_CONTEXT ] = _getAjaxCorrelationContext(xhr), _a.type = xhr.responseType, _a[_DYN_RESPONSE_TEXT ] = _getResponseText(xhr), _a.response = xhr[_DYN_RESPONSE ], _a); if (_enableResponseHeaderTracking) { var headers = xhr[_DYN_GET_ALL_RESPONSE_HEA15 ](); if (headers) { var arr = strTrim(headers).split(/[\r\n]+/); var responseHeaderMap_2 = {}; arrForEach(arr, function (line) { var parts = line.split(": "); var header = parts.shift(); var value = parts.join(": "); if (_canIncludeHeaders(header)) { responseHeaderMap_2[header] = value; } }); ajaxResponse[_DYN_HEADER_MAP ] = responseHeaderMap_2; } } return ajaxResponse; }); var properties = void 0; try { if (!!_addRequestContext) { properties = _addRequestContext({ status: xhr[_DYN_STATUS ], xhr: xhr }); } } catch (e) { _throwInternalWarning(_self, 104 , CUSTOM_REQUEST_CONTEXT_ERROR); } if (dependency) { if (properties !== undefined) { dependency[STR_PROPERTIES ] = __assignFn(__assignFn({}, dependency.properties), properties); } var sysProperties = ajaxData[_DYN_GET_PART_APROPS ](); _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE ], ajaxData, dependency, null, sysProperties); } else { _reportXhrError(null, { requestSentTime: ajaxData[_DYN_REQUEST_SENT_TIME ], responseFinishedTime: ajaxData[_DYN_RESPONSE_FINISHED_TI14 ] }); } } finally { try { var xhrRequestData = (xhr[AJAX_DATA_CONTAINER] || { i: {} }); var ajaxDataCntr = (xhrRequestData.i || {}); if (ajaxDataCntr[_ajaxDataId]) { ajaxDataCntr[_ajaxDataId] = null; } } catch (e) { } } }, function (e) { _reportXhrError(e, null); }); } function _getAjaxCorrelationContext(xhr) { var _a; try { var responseHeadersString = xhr[_DYN_GET_ALL_RESPONSE_HEA15 ](); if (responseHeadersString !== null) { var index = _indexOf(responseHeadersString[_DYN_TO_LOWER_CASE ](), RequestHeaders[8 ]); if (index !== -1) { var responseHeader = xhr.getResponseHeader(RequestHeaders[0 ]); return correlationIdGetCorrelationContext(responseHeader); } } } catch (e) { _throwInternalWarning(_self, 18 , CORRELATION_HEADER_ERROR, (_a = {}, _a[_DYN_AJAX_DIAGNOSTICS_MES16 ] = _getFailedAjaxDiagnosticsMessage(xhr, _ajaxDataId), _a[_DYN_EXCEPTION ] = dumpObj(e), _a)); } } function _createMarkId(type, ajaxData) { if (ajaxData[_DYN_REQUEST_URL ] && _markPrefix && _enableAjaxPerfTracking) { var performance_1 = getPerformance(); if (performance_1 && isFunction(performance_1.mark)) { _markCount++; var markId = _markPrefix + type + "#" + _markCount; performance_1.mark(markId); var entries = performance_1.getEntriesByName(markId); if (entries && entries[_DYN_LENGTH$1 ] === 1) { ajaxData[_DYN_PERF_MARK ] = entries[0]; } } } } function _findPerfResourceEntry(initiatorType, ajaxData, trackCallback, reportError) { var perfMark = ajaxData[_DYN_PERF_MARK ]; var performance = getPerformance(); var maxAttempts = _maxAjaxPerfLookupAttempts; var retryDelay = _ajaxPerfLookupDelay; var requestUrl = ajaxData[_DYN_REQUEST_URL ]; var attempt = 0; (function locateResourceTiming() { try { if (performance && perfMark) { attempt++; var perfTiming = null; var entries = performance.getEntries(); for (var lp = entries[_DYN_LENGTH$1 ] - 1; lp >= 0; lp--) { var entry = entries[lp]; if (entry) { if (entry.entryType === "resource") { if (entry.initiatorType === initiatorType && (_indexOf(entry[_DYN_NAME ], requestUrl) !== -1 || _indexOf(requestUrl, entry[_DYN_NAME ]) !== -1)) { perfTiming = entry; } } else if (entry.entryType === "mark" && entry[_DYN_NAME ] === perfMark[_DYN_NAME ]) { ajaxData[_DYN_PERF_TIMING ] = perfTiming; break; } if (entry[_DYN_START_TIME ] < perfMark[_DYN_START_TIME ] - 1000) { break; } } } } if (!perfMark || ajaxData[_DYN_PERF_TIMING ] || attempt >= maxAttempts || ajaxData.async === false) { if (perfMark && isFunction(performance.clearMarks)) { performance.clearMarks(perfMark[_DYN_NAME ]); } ajaxData.perfAttempts = attempt; trackCallback(); } else { scheduleTimeout(locateResourceTiming, retryDelay); } } catch (e) { reportError(e); } })(); } function _createFetchRecord(input, init) { var _a; var distributedTraceCtx = _getDistributedTraceCtx(); var traceID = (distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_ID ]()) || generateW3CId(); var spanID = strSubstr(generateW3CId(), 0, 16); var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog](), (_a = _self.core) === null || _a === void 0 ? void 0 : _a.getTraceCtx()); ajaxData[_DYN_TRACE_FLAGS ] = distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_FLAGS ](); ajaxData[_DYN_REQUEST_SENT_TIME ] = dateTimeUtilsNow(); ajaxData[_DYN_ERROR_STATUS_TEXT ] = _enableAjaxErrorStatusText; var requestUrl; if (input instanceof Request) { requestUrl = (input || {}).url || ""; } else { requestUrl = input; } if (requestUrl === "") { var location_1 = getLocation(); if (location_1 && location_1.href) { requestUrl = strSplit(location_1.href, "#")[0]; } } ajaxData[_DYN_REQUEST_URL ] = requestUrl; var method = "GET"; if (init && init[_DYN_METHOD ]) { method = init[_DYN_METHOD ]; } else if (input && input instanceof Request) { method = input[_DYN_METHOD ]; } ajaxData[_DYN_METHOD ] = method; var requestHeaders = {}; if (_enableRequestHeaderTracking) { var headers = new Headers((init ? init[_DYN_HEADERS ] : 0) || (input instanceof Request ? (input[_DYN_HEADERS ] || {}) : {})); headers.forEach(function (value, key) { if (_canIncludeHeaders(key)) { requestHeaders[key] = value; } }); } ajaxData[_DYN_REQUEST_HEADERS ] = requestHeaders; _createMarkId(STR_FETCH, ajaxData); return ajaxData; } function _getFailedFetchDiagnosticsMessage(input) { var result = ""; try { if (!isNullOrUndefined(input)) { if (typeof (input) === "string") { result += "(url: '".concat(input, "')"); } else { result += "(url: '".concat(input.url, "')"); } } } catch (e) { _throwInternalCritical(_self, 15 , "Failed to grab failed fetch diagnostics message", { exception: dumpObj(e) }); } return result; } function _reportFetchMetrics(callDetails, status, input, response, ajaxData, getResponse, properties) { if (!ajaxData) { return; } function _reportFetchError(msgId, e, failedProps) { var errorProps = failedProps || {}; errorProps["fetchDiagnosticsMessage"] = _getFailedFetchDiagnosticsMessage(input); if (e) { errorProps["exception"] = dumpObj(e); } _throwInternalWarning(_self, msgId, FAILED_TO_CALCULATE_DURATION_ERROR + "fetch call" + ERROR_NOT_SENT, errorProps); } ajaxData[_DYN_RESPONSE_FINISHED_TI14 ] = dateTimeUtilsNow(); ajaxData[_DYN_STATUS ] = status; _findPerfResourceEntry(STR_FETCH, ajaxData, function () { var dependency = ajaxData[_DYN__CREATE_TRACK_ITEM ]("Fetch", _enableRequestHeaderTracking, getResponse); var properties; try { if (!!_addRequestContext) { properties = _addRequestContext({ status: status, request: input, response: response }); } } catch (e) { _throwInternalWarning(_self, 104 , CUSTOM_REQUEST_CONTEXT_ERROR); } if (dependency) { if (properties !== undefined) { dependency[STR_PROPERTIES ] = __assignFn(__assignFn({}, dependency.properties), properties); } var sysProperties = ajaxData[_DYN_GET_PART_APROPS ](); _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE ], ajaxData, dependency, null, sysProperties); } else { _reportFetchError(14 , null, { requestSentTime: ajaxData[_DYN_REQUEST_SENT_TIME ], responseFinishedTime: ajaxData[_DYN_RESPONSE_FINISHED_TI14 ] }); } }, function (e) { _reportFetchError(18 , e, null); }); } function _getFetchCorrelationContext(response) { var _a; if (response && response[_DYN_HEADERS ]) { try { var responseHeader = response[_DYN_HEADERS ].get(RequestHeaders[0 ]); return correlationIdGetCorrelationContext(responseHeader); } catch (e) { _throwInternalWarning(_self, 18 , CORRELATION_HEADER_ERROR, (_a = { fetchDiagnosticsMessage: _getFailedFetchDiagnosticsMessage(response) }, _a[_DYN_EXCEPTION ] = dumpObj(e), _a)); } } } function _reportDependencyInternal(initializers, core, ajaxData, dependency, properties, systemProperties) { var _a; var result = true; var initializersCount = initializers[_DYN_LENGTH$1 ]; if (initializersCount > 0) { var details = (_a = { item: dependency }, _a[STR_PROPERTIES ] = properties, _a.sysProperties = systemProperties, _a.context = ajaxData ? ajaxData[_DYN_CONTEXT$1 ] : null, _a.aborted = ajaxData ? !!ajaxData[_DYN_ABORTED ] : false, _a); result = _processDependencyContainer(core, initializers, details, "initializer"); } if (result) { _self[_DYN_TRACK_DEPENDENCY_DAT3 ](dependency, properties, systemProperties); } } }); return _this; } AjaxMonitor.prototype.processTelemetry = function (item, itemCtx) { this.processNext(item, itemCtx); }; AjaxMonitor.prototype.addDependencyInitializer = function (dependencyInitializer) { return null; }; AjaxMonitor.identifier = "AjaxDependencyPlugin"; return AjaxMonitor; }(BaseTelemetryPlugin)); var Application = /** @class */ (function () { function Application() { } return Application; }()); var Device = /** @class */ (function () { function Device() { this.id = "browser"; this.deviceClass = "Browser"; } return Device; }()); var Version = '3.0.6'; var Internal = /** @class */ (function () { function Internal(config, unloadHookContainer) { var _this = this; var unloadHook = onConfigChange((config), function () { var prefix = config.sdkExtension; _this.sdkVersion = (prefix ? prefix + "_" : "") + "javascript:" + Version; }); unloadHookContainer && unloadHookContainer.add(unloadHook); } return Internal; }()); var Location = /** @class */ (function () { function Location() { } return Location; }()); var _DYN_SESSION_MANAGER = "sessionManager"; var _DYN_UPDATE = "update"; var _DYN_IS_USER_COOKIE_SET = "isUserCookieSet"; var _DYN_IS_NEW_USER = "isNewUser"; var _DYN_GET_TRACE_CTX = "getTraceCtx"; var _DYN_TELEMETRY_TRACE = "telemetryTrace"; var _DYN_APPLY_SESSION_CONTEX0 = "applySessionContext"; var _DYN_APPLY_APPLICATION_CO1 = "applyApplicationContext"; var _DYN_APPLY_DEVICE_CONTEXT = "applyDeviceContext"; var _DYN_APPLY_OPERATION_CONT2 = "applyOperationContext"; var _DYN_APPLY_USER_CONTEXT = "applyUserContext"; var _DYN_APPLY_OPERATING_SYST3 = "applyOperatingSystemContxt"; var _DYN_APPLY_LOCATION_CONTE4 = "applyLocationContext"; var _DYN_APPLY_INTERNAL_CONTE5 = "applyInternalContext"; var _DYN_ACCOUNT_ID = "accountId"; var _DYN_GET_SESSION_ID = "getSessionId"; var _DYN_NAME_PREFIX = "namePrefix"; var _DYN_SESSION_COOKIE_POSTF6 = "sessionCookiePostfix"; var _DYN_USER_COOKIE_POSTFIX = "userCookiePostfix"; var _DYN_ID_LENGTH = "idLength"; var _DYN_GET_NEW_ID = "getNewId"; var _DYN_LENGTH = "length"; var _DYN_AUTOMATIC_SESSION = "automaticSession"; var _DYN_AUTHENTICATED_ID = "authenticatedId"; var _DYN_ACQUISITION_DATE = "acquisitionDate"; var _DYN_RENEWAL_DATE = "renewalDate"; var _DYN_JOIN = "join"; var _DYN_COOKIE_SEPARATOR = "cookieSeparator"; var _DYN_AUTH_USER_COOKIE_NAM7 = "authUserCookieName"; var SESSION_COOKIE_NAME = "ai_session"; var ACQUISITION_SPAN = 86400000; var RENEWAL_SPAN = 1800000; var COOKIE_UPDATE_INTERVAL = 60000; var Session = /** @class */ (function () { function Session() { } return Session; }()); var _SessionManager = /** @class */ (function () { function _SessionManager(config, core, unloadHookContainer) { var self = this; var _storageNamePrefix; var _cookieUpdatedTimestamp; var _logger = safeGetLogger(core); var _cookieManager = safeGetCookieMgr(core); var _sessionExpirationMs; var _sessionRenewalMs; dynamicProto(_SessionManager, self, function (_self) { if (!config) { config = {}; } var unloadHook = onConfigChange(config, function (details) { _sessionExpirationMs = config.sessionExpirationMs || ACQUISITION_SPAN; _sessionRenewalMs = config.sessionRenewalMs || RENEWAL_SPAN; var sessionCookiePostfix = config.sessionCookiePostfix || config[_DYN_NAME_PREFIX ] || ""; _storageNamePrefix = SESSION_COOKIE_NAME + sessionCookiePostfix; }); unloadHookContainer && unloadHookContainer.add(unloadHook); _self[_DYN_AUTOMATIC_SESSION ] = new Session(); _self[_DYN_UPDATE ] = function () { var nowMs = utcNow(); var isExpired = false; var session = _self[_DYN_AUTOMATIC_SESSION ]; if (!session.id) { isExpired = !_initializeAutomaticSession(session); } if (!isExpired && _sessionExpirationMs > 0) { var timeSinceAcqMs = nowMs - session[_DYN_ACQUISITION_DATE ]; var timeSinceRenewalMs = nowMs - session[_DYN_RENEWAL_DATE ]; isExpired = timeSinceAcqMs < 0 || timeSinceRenewalMs < 0; isExpired = isExpired || timeSinceAcqMs > _sessionExpirationMs; isExpired = isExpired || timeSinceRenewalMs > _sessionRenewalMs; } if (isExpired) { _renew(nowMs); } else { if (!_cookieUpdatedTimestamp || nowMs - _cookieUpdatedTimestamp > COOKIE_UPDATE_INTERVAL) { _setCookie(session, nowMs); } } }; _self.backup = function () { var session = _self[_DYN_AUTOMATIC_SESSION ]; _setStorage(session.id, session[_DYN_ACQUISITION_DATE ], session[_DYN_RENEWAL_DATE ]); }; function _initializeAutomaticSession(session, now) { var isValid = false; var cookieValue = _cookieManager.get(_storageNamePrefix); if (cookieValue && isFunction(cookieValue.split)) { isValid = _initializeAutomaticSessionWithData(session, cookieValue); } else { var storageValue = utlGetLocalStorage(_logger, _storageNamePrefix); if (storageValue) { isValid = _initializeAutomaticSessionWithData(session, storageValue); } } return isValid || !!session.id; } function _initializeAutomaticSessionWithData(session, sessionData) { var isValid = false; var sessionReset = ", session will be reset"; var tokens = sessionData.split("|"); if (tokens[_DYN_LENGTH ] >= 2) { try { var acqMs = +tokens[1] || 0; var renewalMs = +tokens[2] || 0; if (isNaN(acqMs) || acqMs <= 0) { _throwInternal(_logger, 2 , 27 , "AI session acquisition date is 0" + sessionReset); } else if (isNaN(renewalMs) || renewalMs <= 0) { _throwInternal(_logger, 2 , 27 , "AI session renewal date is 0" + sessionReset); } else if (tokens[0]) { session.id = tokens[0]; session[_DYN_ACQUISITION_DATE ] = acqMs; session[_DYN_RENEWAL_DATE ] = renewalMs; isValid = true; } } catch (e) { _throwInternal(_logger, 1 , 9 , "Error parsing ai_session value [" + (sessionData || "") + "]" + sessionReset + " - " + getExceptionName(e), { exception: dumpObj(e) }); } } return isValid; } function _renew(nowMs) { var getNewId = config[_DYN_GET_NEW_ID ] || newId; _self.automaticSession.id = getNewId(config[_DYN_ID_LENGTH ] || 22); _self[_DYN_AUTOMATIC_SESSION ][_DYN_ACQUISITION_DATE ] = nowMs; _setCookie(_self[_DYN_AUTOMATIC_SESSION ], nowMs); if (!utlCanUseLocalStorage()) { _throwInternal(_logger, 2 , 0 , "Browser does not support local storage. Session durations will be inaccurate."); } } function _setCookie(session, nowMs) { var acq = session[_DYN_ACQUISITION_DATE ]; session[_DYN_RENEWAL_DATE ] = nowMs; var renewalPeriodMs = _sessionRenewalMs; var acqTimeLeftMs = (acq + _sessionExpirationMs) - nowMs; var cookie = [session.id, acq, nowMs]; var maxAgeSec = 0; if (acqTimeLeftMs < renewalPeriodMs) { maxAgeSec = acqTimeLeftMs / 1000; } else { maxAgeSec = renewalPeriodMs / 1000; } var cookieDomain = config.cookieDomain || null; _cookieManager.set(_storageNamePrefix, cookie[_DYN_JOIN ]("|"), _sessionExpirationMs > 0 ? maxAgeSec : null, cookieDomain); _cookieUpdatedTimestamp = nowMs; } function _setStorage(guid, acq, renewal) { utlSetLocalStorage(_logger, _storageNamePrefix, [guid, acq, renewal][_DYN_JOIN ]("|")); } }); } _SessionManager.__ieDyn=1; return _SessionManager; }()); var TelemetryTrace = /** @class */ (function () { function TelemetryTrace(id, parentId, name, logger) { var _self = this; _self.traceID = id || generateW3CId(); _self.parentID = parentId; var location = getLocation(); if (!name && location && location.pathname) { name = location.pathname; } _self.name = dataSanitizeString(logger, name); } return TelemetryTrace; }()); function _validateUserInput(id) { if (typeof id !== "string" || !id || id.match(/,|;|=| |\|/)) { return false; } return true; } var User = /** @class */ (function () { function User(config, core, unloadHookContainer) { this.isNewUser = false; this.isUserCookieSet = false; var _logger = safeGetLogger(core); var _cookieManager = safeGetCookieMgr(core); var _storageNamePrefix; dynamicProto(User, this, function (_self) { objDefine(_self, "config", { g: function () { return config; } }); var unloadHook = onConfigChange(config, function () { var userCookiePostfix = config[_DYN_USER_COOKIE_POSTFIX ] || ""; _storageNamePrefix = User.userCookieName + userCookiePostfix; var cookie = _cookieManager.get(_storageNamePrefix); if (cookie) { _self[_DYN_IS_NEW_USER ] = false; var params = cookie.split(User[_DYN_COOKIE_SEPARATOR ]); if (params[_DYN_LENGTH ] > 0) { _self.id = params[0]; _self[_DYN_IS_USER_COOKIE_SET ] = !!_self.id; } } if (!_self.id) { _self.id = _generateNewId(); var newCookie = _generateNewCookie(_self.id); _setUserCookie(newCookie[_DYN_JOIN ](User[_DYN_COOKIE_SEPARATOR ])); var name_1 = (config[_DYN_NAME_PREFIX ] || "") + "ai_session"; utlRemoveStorage(_logger, name_1); } _self[_DYN_ACCOUNT_ID ] = config[_DYN_ACCOUNT_ID ] || undefined; var authCookie = _cookieManager.get(User[_DYN_AUTH_USER_COOKIE_NAM7 ]); if (authCookie) { authCookie = decodeURI(authCookie); var authCookieString = authCookie.split(User[_DYN_COOKIE_SEPARATOR ]); if (authCookieString[0]) { _self[_DYN_AUTHENTICATED_ID ] = authCookieString[0]; } if (authCookieString[_DYN_LENGTH ] > 1 && authCookieString[1]) { _self[_DYN_ACCOUNT_ID ] = authCookieString[1]; } } }); unloadHookContainer && unloadHookContainer.add(unloadHook); function _generateNewId() { var theConfig = (config || {}); var getNewId = theConfig[_DYN_GET_NEW_ID ] || newId; var id = getNewId(theConfig[_DYN_ID_LENGTH ] ? config[_DYN_ID_LENGTH ] : 22); return id; } function _generateNewCookie(userId) { var acqStr = toISOString(new Date()); _self.accountAcquisitionDate = acqStr; _self[_DYN_IS_NEW_USER ] = true; var newCookie = [userId, acqStr]; return newCookie; } function _setUserCookie(cookie) { var oneYear = 31536000; _self[_DYN_IS_USER_COOKIE_SET ] = _cookieManager.set(_storageNamePrefix, cookie, oneYear); } _self.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) { if (storeInCookie === void 0) { storeInCookie = false; } var isInvalidInput = !_validateUserInput(authenticatedUserId) || (accountId && !_validateUserInput(accountId)); if (isInvalidInput) { _throwInternal(_logger, 2 , 60 , "Setting auth user context failed. " + "User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.", true); return; } _self[_DYN_AUTHENTICATED_ID ] = authenticatedUserId; var authCookie = _self[_DYN_AUTHENTICATED_ID ]; if (accountId) { _self[_DYN_ACCOUNT_ID ] = accountId; authCookie = [_self[_DYN_AUTHENTICATED_ID ], _self.accountId][_DYN_JOIN ](User[_DYN_COOKIE_SEPARATOR ]); } if (storeInCookie) { _cookieManager.set(User[_DYN_AUTH_USER_COOKIE_NAM7 ], encodeURI(authCookie)); } }; _self.clearAuthenticatedUserContext = function () { _self[_DYN_AUTHENTICATED_ID ] = null; _self[_DYN_ACCOUNT_ID ] = null; _cookieManager.del(User[_DYN_AUTH_USER_COOKIE_NAM7 ]); }; _self[_DYN_UPDATE ] = function (userId) { if (_self.id !== userId || !_self[_DYN_IS_USER_COOKIE_SET ]) { var user_id = userId ? userId : _generateNewId(); var user_cookie = _generateNewCookie(user_id); _setUserCookie(user_cookie[_DYN_JOIN ](User[_DYN_COOKIE_SEPARATOR ])); } }; }); } User.cookieSeparator = "|"; User.userCookieName = "ai_user"; User.authUserCookieName = "ai_authUser"; return User; }()); var strExt = "ext"; var strTags = "tags"; function _removeEmpty(target, name) { if (target && target[name] && objKeys(target[name])[_DYN_LENGTH ] === 0) { delete target[name]; } } function _nullResult() { return null; } var TelemetryContext = /** @class */ (function () { function TelemetryContext(core, defaultConfig, previousTraceCtx, unloadHookContainer) { var _this = this; var logger = core.logger; dynamicProto(TelemetryContext, this, function (_self) { _self.appId = _nullResult; _self[_DYN_GET_SESSION_ID ] = _nullResult; _self.application = new Application(); _self.internal = new Internal(defaultConfig, unloadHookContainer); if (hasWindow()) { _self[_DYN_SESSION_MANAGER ] = new _SessionManager(defaultConfig, core, unloadHookContainer); _self.device = new Device(); _self.location = new Location(); _self.user = new User(defaultConfig, core, unloadHookContainer); var traceId = void 0; var parentId = void 0; var name_1; if (previousTraceCtx) { traceId = previousTraceCtx.getTraceId(); parentId = previousTraceCtx.getSpanId(); name_1 = previousTraceCtx.getName(); } _self[_DYN_TELEMETRY_TRACE ] = new TelemetryTrace(traceId, parentId, name_1, logger); _self.session = new Session(); } _self[_DYN_GET_SESSION_ID ] = function () { var session = _self.session; var sesId = null; if (session && isString(session.id)) { sesId = session.id; } else { var autoSession = (_self[_DYN_SESSION_MANAGER ] || {})[_DYN_AUTOMATIC_SESSION ]; sesId = autoSession && isString(autoSession.id) ? autoSession.id : null; } return sesId; }; _self[_DYN_APPLY_SESSION_CONTEX0 ] = function (evt, itemCtx) { setValue(getSetValue(evt.ext, Extensions.AppExt), "sesId", _self[_DYN_GET_SESSION_ID ](), isString); }; _self[_DYN_APPLY_OPERATING_SYST3 ] = function (evt, itemCtx) { setValue(evt.ext, Extensions.OSExt, _self.os); }; _self[_DYN_APPLY_APPLICATION_CO1 ] = function (evt, itemCtx) { var application = _self.application; if (application) { var tags = getSetValue(evt, strTags); setValue(tags, CtxTagKeys.applicationVersion, application.ver, isString); setValue(tags, CtxTagKeys.applicationBuild, application.build, isString); } }; _self[_DYN_APPLY_DEVICE_CONTEXT ] = function (evt, itemCtx) { var device = _self.device; if (device) { var extDevice = getSetValue(getSetValue(evt, strExt), Extensions.DeviceExt); setValue(extDevice, "localId", device.id, isString); setValue(extDevice, "ip", device.ip, isString); setValue(extDevice, "model", device.model, isString); setValue(extDevice, "deviceClass", device.deviceClass, isString); } }; _self[_DYN_APPLY_INTERNAL_CONTE5 ] = function (evt, itemCtx) { var internal = _self.internal; if (internal) { var tags = getSetValue(evt, strTags); setValue(tags, CtxTagKeys.internalAgentVersion, internal.agentVersion, isString); setValue(tags, CtxTagKeys.internalSdkVersion, dataSanitizeString(logger, internal.sdkVersion, 64), isString); if (evt.baseType === _InternalLogMessage.dataType || evt.baseType === PageView.dataType) { setValue(tags, CtxTagKeys.internalSnippet, internal.snippetVer, isString); setValue(tags, CtxTagKeys.internalSdkSrc, internal.sdkSrc, isString); } } }; _self[_DYN_APPLY_LOCATION_CONTE4 ] = function (evt, itemCtx) { var location = _this.location; if (location) { setValue(getSetValue(evt, strTags, []), CtxTagKeys.locationIp, location.ip, isString); } }; _self[_DYN_APPLY_OPERATION_CONT2 ] = function (evt, itemCtx) { var telemetryTrace = _self[_DYN_TELEMETRY_TRACE ]; if (telemetryTrace) { var extTrace = getSetValue(getSetValue(evt, strExt), Extensions.TraceExt, { traceID: undefined, parentID: undefined }); setValue(extTrace, "traceID", telemetryTrace.traceID, isString, isNullOrUndefined); setValue(extTrace, "name", telemetryTrace.name, isString, isNullOrUndefined); setValue(extTrace, "parentID", telemetryTrace.parentID, isString, isNullOrUndefined); } }; _self.applyWebContext = function (evt, itemCtx) { var web = _this.web; if (web) { setValue(getSetValue(evt, strExt), Extensions.WebExt, web); } }; _self[_DYN_APPLY_USER_CONTEXT ] = function (evt, itemCtx) { var user = _self.user; if (user) { var tags = getSetValue(evt, strTags, []); setValue(tags, CtxTagKeys.userAccountId, user[_DYN_ACCOUNT_ID ], isString); var extUser = getSetValue(getSetValue(evt, strExt), Extensions.UserExt); setValue(extUser, "id", user.id, isString); setValue(extUser, "authId", user[_DYN_AUTHENTICATED_ID ], isString); } }; _self.cleanUp = function (evt, itemCtx) { var ext = evt.ext; if (ext) { _removeEmpty(ext, Extensions.DeviceExt); _removeEmpty(ext, Extensions.UserExt); _removeEmpty(ext, Extensions.WebExt); _removeEmpty(ext, Extensions.OSExt); _removeEmpty(ext, Extensions.AppExt); _removeEmpty(ext, Extensions.TraceExt); } }; }); } TelemetryContext.__ieDyn=1; return TelemetryContext; }()); var _a$1; var undefString; var nullValue = null; var _defaultConfig = objDeepFreeze((_a$1 = {}, _a$1[_DYN_ACCOUNT_ID ] = nullValue, _a$1.sessionRenewalMs = 30 * 60 * 1000, _a$1.samplingPercentage = 100, _a$1.sessionExpirationMs = 24 * 60 * 60 * 1000, _a$1.cookieDomain = nullValue, _a$1.sdkExtension = nullValue, _a$1.isBrowserLinkTrackingEnabled = false, _a$1.appId = nullValue, _a$1[_DYN_GET_SESSION_ID ] = nullValue, _a$1[_DYN_NAME_PREFIX ] = undefString, _a$1[_DYN_SESSION_COOKIE_POSTF6 ] = undefString, _a$1[_DYN_USER_COOKIE_POSTFIX ] = undefString, _a$1[_DYN_ID_LENGTH ] = 22, _a$1[_DYN_GET_NEW_ID ] = nullValue, _a$1)); var PropertiesPlugin = /** @class */ (function (_super) { __extendsFn(PropertiesPlugin, _super); function PropertiesPlugin() { var _this = _super.call(this) || this; _this.priority = 110; _this.identifier = PropertiesPluginIdentifier; var _extensionConfig; var _distributedTraceCtx; var _previousTraceCtx; var _context; var _disableUserInitMessage; dynamicProto(PropertiesPlugin, _this, function (_self, _base) { _initDefaults(); objDefine(_self, "context", { g: function () { return _context; } }); _self.initialize = function (config, core, extensions, pluginChain) { _base.initialize(config, core, extensions, pluginChain); _populateDefaults(config); }; _self.processTelemetry = function (event, itemCtx) { if (!isNullOrUndefined(event)) { itemCtx = _self._getTelCtx(itemCtx); if (event.name === PageView.envelopeType) { itemCtx.diagLog().resetInternalMessageCount(); } var theContext = (_context || {}); if (theContext.session) { if (typeof _context.session.id !== "string" && theContext[_DYN_SESSION_MANAGER ]) { theContext[_DYN_SESSION_MANAGER ][_DYN_UPDATE ](); } } var userCtx = theContext.user; if (userCtx && !userCtx[_DYN_IS_USER_COOKIE_SET ]) { userCtx[_DYN_UPDATE ](theContext.user.id); } _processTelemetryInternal(event, itemCtx); if (userCtx && userCtx[_DYN_IS_NEW_USER ]) { userCtx[_DYN_IS_NEW_USER ] = false; if (!_disableUserInitMessage) { var message = new _InternalLogMessage(72 , ((getNavigator() || {}).userAgent || "")); _logInternalMessage(itemCtx.diagLog(), 1 , message); } } _self.processNext(event, itemCtx); } }; _self._doTeardown = function (unloadCtx, unloadState) { var core = (unloadCtx || {}).core(); if (core && core[_DYN_GET_TRACE_CTX ]) { var traceCtx = core[_DYN_GET_TRACE_CTX ](false); if (traceCtx === _distributedTraceCtx) { core.setTraceCtx(_previousTraceCtx); } } _initDefaults(); }; function _initDefaults() { _extensionConfig = null; _distributedTraceCtx = null; _previousTraceCtx = null; _context = null; _disableUserInitMessage = false; } function _populateDefaults(config) { var identifier = _self.identifier; var core = _self.core; _self._addHook(onConfigChange(config, function () { var ctx = createProcessTelemetryContext(null, config, core); if (config.storagePrefix) { utlSetStoragePrefix(config.storagePrefix); } _disableUserInitMessage = config.disableUserInitMessage || false; _extensionConfig = ctx.getExtCfg(identifier, _defaultConfig); _self["_extConfig"] = _extensionConfig; })); _previousTraceCtx = core[_DYN_GET_TRACE_CTX ](false); _context = new TelemetryContext(core, _extensionConfig, _previousTraceCtx, _self._unloadHooks); _distributedTraceCtx = createDistributedTraceContextFromTrace(_self.context[_DYN_TELEMETRY_TRACE ], _previousTraceCtx); core.setTraceCtx(_distributedTraceCtx); _self.context.appId = function () { var breezeChannel = core.getPlugin(BreezeChannelIdentifier); return breezeChannel ? breezeChannel.plugin["_appId"] : null; }; } function _processTelemetryInternal(evt, itemCtx) { getSetValue(evt, "tags", []); getSetValue(evt, "ext", {}); var ctx = _self.context; ctx[_DYN_APPLY_SESSION_CONTEX0 ](evt, itemCtx); ctx[_DYN_APPLY_APPLICATION_CO1 ](evt, itemCtx); ctx[_DYN_APPLY_DEVICE_CONTEXT ](evt, itemCtx); ctx[_DYN_APPLY_OPERATION_CONT2 ](evt, itemCtx); ctx[_DYN_APPLY_USER_CONTEXT ](evt, itemCtx); ctx[_DYN_APPLY_OPERATING_SYST3 ](evt, itemCtx); ctx.applyWebContext(evt, itemCtx); ctx[_DYN_APPLY_LOCATION_CONTE4 ](evt, itemCtx); ctx[_DYN_APPLY_INTERNAL_CONTE5 ](evt, itemCtx); ctx.cleanUp(evt, itemCtx); } }); return _this; } PropertiesPlugin.__ieDyn=1; return PropertiesPlugin; }(BaseTelemetryPlugin)); var PropertiesPlugin$1 = PropertiesPlugin; var _AUTHENTICATED_USER_CONTEXT = "AuthenticatedUserContext"; var _TRACK = "track"; var STR_SNIPPET = "snippet"; var STR_GET_COOKIE_MGR = "getCookieMgr"; var STR_START_TRACK_PAGE = "startTrackPage"; var STR_STOP_TRACK_PAGE = "stopTrackPage"; var STR_FLUSH = "flush"; var STR_START_TRACK_EVENT = "startTrackEvent"; var STR_STOP_TRACK_EVENT = "stopTrackEvent"; var STR_ADD_TELEMETRY_INITIALIZER = "addTelemetryInitializer"; var STR_POLL_INTERNAL_LOGS = "pollInternalLogs"; var STR_GET_PLUGIN = "getPlugin"; var STR_EVT_NAMESPACE = "evtNamespace"; var STR_TRACK_EVENT = _TRACK + "Event"; var STR_TRACK_TRACE = _TRACK + "Trace"; var STR_TRACK_METRIC = _TRACK + "Metric"; var STR_TRACK_PAGE_VIEW = _TRACK + "PageView"; var STR_TRACK_EXCEPTION = _TRACK + "Exception"; var STR_TRACK_DEPENDENCY_DATA = _TRACK + "DependencyData"; var STR_SET_AUTHENTICATED_USER_CONTEXT = "set" + _AUTHENTICATED_USER_CONTEXT; var STR_CLEAR_AUTHENTICATED_USER_CONTEXT = "clear" + _AUTHENTICATED_USER_CONTEXT; var _DYN_VERSION = "version"; var _DYN_QUEUE = "queue"; var _DYN_CONNECTION_STRING = "connectionString"; var _DYN_ENDPOINT_URL = "endpointUrl"; var _DYN_INSTRUMENTATION_KEY = "instrumentationKey"; var _DYN_ONUNLOAD_FLUSH = "onunloadFlush"; var _DYN_CONTEXT = "context"; var _DYN_ADD_HOUSEKEEPING_BEF0 = "addHousekeepingBeforeUnload"; var _DYN_SEND_MESSAGE = "sendMessage"; var _DYN_UPDATE_SNIPPET_DEFIN1 = "updateSnippetDefinitions"; var _a, _b, _c; var _internalSdkSrc; var _ignoreUpdateSnippetProperties = [ STR_SNIPPET, "dependencies", "properties", "_snippetVersion", "appInsightsNew", "getSKUDefaults" ]; var IKEY_USAGE = "iKeyUsage"; var CDN_USAGE = "CdnUsage"; var SDK_LOADER_VER = "SdkLoaderVer"; var UNDEFINED_VALUE = undefined; var default_limit = { samplingRate: 100, maxSendNumber: 1 }; var default_interval = { monthInterval: 3, daysOfMonth: [28] }; var default_throttle_config = { disabled: true, limit: cfgDfMerge(default_limit), interval: cfgDfMerge(default_interval) }; var defaultConfigValues = (_a = {}, _a[_DYN_CONNECTION_STRING ] = UNDEFINED_VALUE, _a[_DYN_ENDPOINT_URL ] = UNDEFINED_VALUE, _a[_DYN_INSTRUMENTATION_KEY ] = UNDEFINED_VALUE, _a.diagnosticLogInterval = cfgDfValidate(_chkDiagLevel, 10000), _a.featureOptIn = (_b = {}, _b[IKEY_USAGE] = { mode: 2 }, _b[CDN_USAGE] = { mode: 2 }, _b[SDK_LOADER_VER] = { mode: 2 }, _b), _a.throttleMgrCfg = cfgDfMerge((_c = {}, _c[109 ] = cfgDfMerge(default_throttle_config), _c[106 ] = cfgDfMerge(default_throttle_config), _c[111 ] = cfgDfMerge(default_throttle_config), _c[110 ] = cfgDfMerge(default_throttle_config), _c)), _a); function _chkDiagLevel(value) { return value && value > 0; } var AppInsightsSku = /** @class */ (function () { function AppInsightsSku(snippet) { var _this = this; var dependencies; var properties; var _sender; var _snippetVersion; var _evtNamespace; var _houseKeepingNamespace; var _core; var _config; var _analyticsPlugin; var _cfgSyncPlugin; var _throttleMgr; var _iKeySentMessage; var _cdnSentMessage; var _sdkVerSentMessage; dynamicProto(AppInsightsSku, this, function (_self) { _initDefaults(); objDefine(_self, "config", { g: function () { return _config; } }); arrForEach(["pluginVersionStringArr", "pluginVersionString"], function (key) { objDefine(_self, key, { g: function () { if (_core) { return _core[key]; } return null; } }); }); _snippetVersion = "" + (snippet.sv || snippet[_DYN_VERSION ] || ""); snippet[_DYN_QUEUE ] = snippet[_DYN_QUEUE ] || []; snippet[_DYN_VERSION ] = snippet[_DYN_VERSION ] || 2.0; var cfgHandler = createDynamicConfig(snippet.config || {}, defaultConfigValues); _config = cfgHandler.cfg; _analyticsPlugin = new AnalyticsPlugin(); objDefine(_self, "appInsights", { g: function () { return _analyticsPlugin; } }); properties = new PropertiesPlugin$1(); dependencies = new AjaxMonitor(); _sender = new Sender(); _core = new AppInsightsCore(); objDefine(_self, "core", { g: function () { return _core; } }); _addUnloadHook(onConfigChange(cfgHandler, function () { if (_config[_DYN_CONNECTION_STRING ]) { var cs = parseConnectionString(_config[_DYN_CONNECTION_STRING ]); var ingest = cs.ingestionendpoint; _config[_DYN_ENDPOINT_URL ] = ingest ? (ingest + DEFAULT_BREEZE_PATH) : _config[_DYN_ENDPOINT_URL ]; _config[_DYN_INSTRUMENTATION_KEY ] = cs.instrumentationkey || _config[_DYN_INSTRUMENTATION_KEY ]; } })); _self[STR_SNIPPET ] = snippet; _self[STR_FLUSH ] = function (async, callBack) { if (async === void 0) { async = true; } var result; doPerf(_core, function () { return "AISKU.flush"; }, function () { if (async && !callBack) { result = createPromise(function (resolve) { callBack = resolve; }); } var waiting = 1; var flushDone = function () { waiting--; if (waiting === 0) { callBack(); } }; arrForEach(_core.getChannels(), function (channel) { if (channel) { waiting++; channel[STR_FLUSH ](async, flushDone); } }); flushDone(); }, null, async); return result; }; _self[_DYN_ONUNLOAD_FLUSH ] = function (async) { if (async === void 0) { async = true; } arrForEach(_core.getChannels(), function (channel) { if (channel[_DYN_ONUNLOAD_FLUSH ]) { channel[_DYN_ONUNLOAD_FLUSH ](); } else { channel[STR_FLUSH ](async); } }); }; _self.loadAppInsights = function (legacyMode, logger, notificationManager) { if (legacyMode === void 0) { legacyMode = false; } if (legacyMode) { throwUnsupported("Legacy Mode is no longer supported"); } function _updateSnippetProperties(snippet) { if (snippet) { var snippetVer = ""; if (!isNullOrUndefined(_snippetVersion)) { snippetVer += _snippetVersion; } if (_self[_DYN_CONTEXT ] && _self[_DYN_CONTEXT ].internal) { _self[_DYN_CONTEXT ].internal.snippetVer = snippetVer || "-"; } objForEachKey(_self, function (field, value) { if (isString(field) && !isFunction(value) && field && field[0] !== "_" && arrIndexOf(_ignoreUpdateSnippetProperties, field) === -1) { if (snippet[field] !== value) { snippet[field] = value; } } }); } } doPerf(_self.core, function () { return "AISKU.loadAppInsights"; }, function () { _core.initialize(_config, [_sender, properties, dependencies, _analyticsPlugin, _cfgSyncPlugin], logger, notificationManager); objDefine(_self, "context", { g: function () { return properties[_DYN_CONTEXT ]; } }); if (!_throttleMgr) { _throttleMgr = new ThrottleMgr(_core); } var sdkSrc = _findSdkSourceFile(); if (sdkSrc && _self[_DYN_CONTEXT ]) { _self[_DYN_CONTEXT ].internal.sdkSrc = sdkSrc; } _updateSnippetProperties(_self[STR_SNIPPET ]); _self.emptyQueue(); _self[STR_POLL_INTERNAL_LOGS ](); _self[_DYN_ADD_HOUSEKEEPING_BEF0 ](_self); _addUnloadHook(onConfigChange(cfgHandler, function () { var defaultEnable = false; if (_config.throttleMgrCfg[109 ]) { defaultEnable = !_config.throttleMgrCfg[109 ].disabled; } if (!_throttleMgr.isReady() && _config.extensionConfig && _config.extensionConfig[_cfgSyncPlugin.identifier] && defaultEnable) { _throttleMgr.onReadyState(true); } if (!_iKeySentMessage && !_config[_DYN_CONNECTION_STRING ] && isFeatureEnabled(IKEY_USAGE, _config)) { _throttleMgr[_DYN_SEND_MESSAGE ](106 , "See Instrumentation key support at aka.ms/IkeyMigrate"); _iKeySentMessage = true; } if (!_cdnSentMessage && _self[_DYN_CONTEXT ].internal.sdkSrc && _self[_DYN_CONTEXT ].internal.sdkSrc.indexOf("az416426") != -1 && isFeatureEnabled(CDN_USAGE, _config)) { _throttleMgr[_DYN_SEND_MESSAGE ](110 , "See Cdn support notice at aka.ms/JsActiveCdn"); _cdnSentMessage = true; } if (!_sdkVerSentMessage && parseInt(_snippetVersion) < 6 && isFeatureEnabled(SDK_LOADER_VER, _config)) { _throttleMgr[_DYN_SEND_MESSAGE ](111 , "An updated Sdk Loader is available, see aka.ms/SnippetVer"); _sdkVerSentMessage = true; } })); }); return _self; }; _self[_DYN_UPDATE_SNIPPET_DEFIN1 ] = function (snippet) { proxyAssign(snippet, _self, function (name) { return name && arrIndexOf(_ignoreUpdateSnippetProperties, name) === -1; }); }; _self.emptyQueue = function () { try { if (isArray(_self.snippet[_DYN_QUEUE ])) { var length_1 = _self.snippet[_DYN_QUEUE ].length; for (var i = 0; i < length_1; i++) { var call = _self.snippet[_DYN_QUEUE ][i]; call(); } _self.snippet[_DYN_QUEUE ] = undefined; delete _self.snippet[_DYN_QUEUE ]; } } catch (exception) { var properties_1 = {}; if (exception && isFunction(exception.toString)) { properties_1.exception = exception.toString(); } } }; _self[_DYN_ADD_HOUSEKEEPING_BEF0 ] = function (appInsightsInstance) { if (hasWindow() || hasDocument()) { var performHousekeeping_1 = function () { appInsightsInstance[_DYN_ONUNLOAD_FLUSH ](false); if (isFunction(_self.core[STR_GET_PLUGIN ])) { var loadedPlugin = _this.core[STR_GET_PLUGIN ](PropertiesPluginIdentifier); if (loadedPlugin) { var propertiesPlugin = loadedPlugin.plugin; if (propertiesPlugin && propertiesPlugin[_DYN_CONTEXT ] && propertiesPlugin[_DYN_CONTEXT ]._sessionManager) { propertiesPlugin[_DYN_CONTEXT ]._sessionManager.backup(); } } } }; var added_1 = false; if (!_houseKeepingNamespace) { _houseKeepingNamespace = mergeEvtNamespace(_evtNamespace, _core[STR_EVT_NAMESPACE ] && _core[STR_EVT_NAMESPACE ]()); } _addUnloadHook(onConfigChange(_config, function (details) { var coreConfig = details.cfg; var analyticsPlugin = appInsightsInstance.appInsights; var ctx = createProcessTelemetryContext(null, coreConfig, analyticsPlugin.core); var extConfig = ctx.getExtCfg(analyticsPlugin.identifier || AnalyticsPluginIdentifier); _removePageEventHandlers(); var excludePageUnloadEvents = coreConfig.disablePageUnloadEvents; if (!extConfig.disableFlushOnBeforeUnload) { if (addPageUnloadEventListener(performHousekeeping_1, excludePageUnloadEvents, _houseKeepingNamespace)) { added_1 = true; } if (addPageHideEventListener(performHousekeeping_1, excludePageUnloadEvents, _houseKeepingNamespace)) { added_1 = true; } if (!added_1 && !isReactNative()) { _throwInternal(_core.logger, 1 , 19 , "Could not add handler for beforeunload and pagehide"); } } if (!added_1 && !extConfig.disableFlushOnUnload) { addPageHideEventListener(performHousekeeping_1, excludePageUnloadEvents, _houseKeepingNamespace); } })); } }; _self.getSender = function () { return _sender; }; _self.unload = function (isAsync, unloadComplete, cbTimeout) { var unloadDone = false; var result; if (isAsync && !unloadComplete) { result = createPromise(function (resolve) { unloadComplete = resolve; }); } function _unloadCallback(unloadState) { if (!unloadDone) { unloadDone = true; _initDefaults(); unloadComplete && unloadComplete(unloadState); } } _self[_DYN_ONUNLOAD_FLUSH ](isAsync); _removePageEventHandlers(); _core.unload && _core.unload(isAsync, _unloadCallback, cbTimeout); return result; }; proxyFunctions(_self, _analyticsPlugin, [ STR_GET_COOKIE_MGR, STR_TRACK_EVENT, STR_TRACK_PAGE_VIEW, "trackPageViewPerformance", STR_TRACK_EXCEPTION, "_onerror", STR_TRACK_TRACE, STR_TRACK_METRIC, STR_START_TRACK_PAGE, STR_STOP_TRACK_PAGE, STR_START_TRACK_EVENT, STR_STOP_TRACK_EVENT ]); proxyFunctions(_self, _getCurrentDependencies, [ STR_TRACK_DEPENDENCY_DATA, "addDependencyListener", "addDependencyInitializer" ]); proxyFunctions(_self, _core, [ STR_ADD_TELEMETRY_INITIALIZER, STR_POLL_INTERNAL_LOGS, "stopPollingInternalLogs", STR_GET_PLUGIN, "addPlugin", STR_EVT_NAMESPACE, "addUnloadCb", "getTraceCtx", "updateCfg", "onCfgChange" ]); proxyFunctions(_self, function () { var context = properties[_DYN_CONTEXT ]; return context ? context.user : null; }, [ STR_SET_AUTHENTICATED_USER_CONTEXT, STR_CLEAR_AUTHENTICATED_USER_CONTEXT ]); function _getCurrentDependencies() { return dependencies; } function _initDefaults() { _evtNamespace = createUniqueNamespace("AISKU"); _houseKeepingNamespace = null; dependencies = null; properties = null; _sender = null; _snippetVersion = null; _throttleMgr = null; _iKeySentMessage = false; _cdnSentMessage = false; _sdkVerSentMessage = false; _cfgSyncPlugin = new CfgSyncPlugin(); } function _removePageEventHandlers() { if (_houseKeepingNamespace) { removePageUnloadEventListener(null, _houseKeepingNamespace); removePageHideEventListener(null, _houseKeepingNamespace); } } function _addUnloadHook(hooks) { _core.addUnloadHook(hooks); } }); } AppInsightsSku.prototype.addDependencyInitializer = function (dependencyInitializer) { return null; }; return AppInsightsSku; }()); function _findSdkSourceFile() { if (_internalSdkSrc) { return _internalSdkSrc; } var sdkSrc = null; var cdns = [ "://js.monitor.azure.com/", "://az416426.vo.msecnd.net/" ]; try { var scrpt = (document || {}).currentScript; if (scrpt) { sdkSrc = scrpt.src; } } catch (e) { } if (sdkSrc) { try { var url_1 = sdkSrc.toLowerCase(); if (url_1) { var src_1 = ""; arrForEach(cdns, function (value, idx) { if (strIndexOf(url_1, value) !== -1) { src_1 = "cdn" + (idx + 1); if (strIndexOf(url_1, "/scripts/") === -1) { if (strIndexOf(url_1, "/next/") !== -1) { src_1 += "-next"; } else if (strIndexOf(url_1, "/beta/") !== -1) { src_1 += "-beta"; } } _internalSdkSrc = src_1 + (""); return -1; } }); } } catch (e) { } _internalSdkSrc = sdkSrc; } return _internalSdkSrc; } var ApplicationInsightsContainer = /** @class */ (function () { function ApplicationInsightsContainer() { } ApplicationInsightsContainer.getAppInsights = function (snippet, version) { var theSku = new AppInsightsSku(snippet); if (version >= 2.0) { theSku[_DYN_UPDATE_SNIPPET_DEFIN1 ](snippet); theSku.loadAppInsights(false); return theSku; } throwUnsupported("V1 API compatibility is no longer supported"); }; return ApplicationInsightsContainer; }()); function _logWarn(aiName, message) { var _console = getInst("console"); if (_console && _console.warn) { _console.warn("Failed to initialize AppInsights JS SDK for instance " + (aiName || "") + " - " + message); } } try { var aiName; if (typeof window !== strShimUndefined) { var _window = window; aiName = _window["appInsightsSDK"] || "appInsights"; if (typeof JSON !== strShimUndefined) { if (_window[aiName] !== undefined) { var snippet = _window[aiName] || { version: 2.0 }; if ((snippet[_DYN_VERSION ] >= 2 && _window[aiName].initialize) || snippet[_DYN_VERSION ] === undefined) { ApplicationInsightsContainer.getAppInsights(snippet, snippet[_DYN_VERSION ]); } } } else { _logWarn(aiName, "Missing JSON - you must supply a JSON polyfill!"); } } else { _logWarn(aiName, "Missing window"); } } catch (e) { _logWarn(aiName, e.message); } exports.AnalyticsPluginIdentifier = AnalyticsPluginIdentifier; exports.ApplicationInsights = AppInsightsSku; exports.BreezeChannelIdentifier = BreezeChannelIdentifier; exports.DEFAULT_BREEZE_ENDPOINT = DEFAULT_BREEZE_ENDPOINT; exports.DisabledPropertyName = DisabledPropertyName; exports.DistributedTracingModes = DistributedTracingModes; exports.LoggingSeverity = LoggingSeverity; exports.PerfEvent = PerfEvent; exports.PerfManager = PerfManager; exports.PropertiesPluginIdentifier = PropertiesPluginIdentifier; exports.RequestHeaders = RequestHeaders; exports.SeverityLevel = SeverityLevel; exports.addEventHandler = addEventHandler; exports.doPerf = doPerf; exports.eventOff = eventOff; exports.eventOn = eventOn; exports.findMetaTag = findMetaTag; exports.findW3cTraceParent = findW3cTraceParent; exports.generateW3CId = generateW3CId; exports.isBeaconsSupported = isBeaconsSupported; exports.mergeEvtNamespace = mergeEvtNamespace; exports.newGuid = newGuid; exports.newId = newId; exports.random32 = random32; exports.randomValue = randomValue; exports.removeEventHandler = removeEventHandler; })); //# sourceMappingURL=ai.3.0.6.js.map ================================================ FILE: AISKU/Tests/Manual/aisku-example-index.gbl.js ================================================ /*! * Application Insights JavaScript SDK Example - AISKU, 3.0.2 * Copyright (c) Microsoft and contributors. All rights reserved. */ (function () { 'use strict'; var UNDEF_VALUE = undefined; var NULL_VALUE = null; var EMPTY = ""; var BOOLEAN = "boolean"; var FUNCTION = "function"; var NUMBER = "number"; var OBJECT = "object"; var PROTOTYPE = "prototype"; var __PROTO__ = "__proto__"; var STRING = "string"; var UNDEFINED = "undefined"; var CONSTRUCTOR = "constructor"; var SYMBOL = "Symbol"; var POLYFILL_TAG = "_polyfill"; var INDEX_OF = "indexOf"; var LENGTH = "length"; var DONE = "done"; var VALUE = "value"; var NAME = "name"; var SLICE = "slice"; var ObjClass$1 = Object; var ObjProto$1 = ObjClass$1[PROTOTYPE]; var StrCls = String; var StrProto = StrCls[PROTOTYPE]; var MathCls = Math; var ArrCls = Array; var ArrProto = ArrCls[PROTOTYPE]; function safeGet(cb, defValue) { var result = defValue; try { result = cb(); } catch (e) { } return result; } var PRIMITIVE_TYPES = [STRING, NUMBER, BOOLEAN, UNDEFINED, "symbol", "bigint"]; function _createIs(theType) { return function (value) { return typeof value === theType; }; } function _createObjIs(theName) { var theType = "[object " + theName + "]"; return function (value) { return !!(value && objToString(value) === theType); }; } function objToString(value) { return ObjProto$1.toString.call(value); } function isUndefined(value) { return typeof value === UNDEFINED || value === UNDEFINED; } function isNullOrUndefined(value) { return value === NULL_VALUE || isUndefined(value); } function isStrictNullOrUndefined(value) { return value === NULL_VALUE || !isDefined(value); } function isDefined(arg) { return !!arg || arg !== UNDEF_VALUE; } var isPrimitiveType = function (theType) { return theType !== OBJECT && PRIMITIVE_TYPES.indexOf(theType) !== -1; }; var isString = _createIs(STRING); var isFunction = _createIs(FUNCTION); function isObject(value) { if (!value && isNullOrUndefined(value)) { return false; } return !!value && typeof value === OBJECT; } var isArray = ArrCls.isArray; var isDate = _createObjIs("Date"); var isNumber = _createIs(NUMBER); var isBoolean = _createIs(BOOLEAN); var isError = _createObjIs("Error"); function isPromiseLike(value) { return !!value && isFunction(value.then); } function isTruthy(value) { return !(!value || safeGet(function () { return !(value && (0 + value)); }, !value)); } var objGetOwnPropertyDescriptor = ObjClass$1.getOwnPropertyDescriptor; function objHasOwnProperty(obj, prop) { return obj && ObjProto$1.hasOwnProperty.call(obj, prop); } var objHasOwn = ObjClass$1["hasOwn"] || polyObjHasOwn; function polyObjHasOwn(obj, prop) { return objHasOwnProperty(obj, prop) || !!objGetOwnPropertyDescriptor(obj, prop); } function objForEachKey(theObject, callbackfn, thisArg) { if (theObject && isObject(theObject)) { for (var prop in theObject) { if (objHasOwn(theObject, prop)) { if (callbackfn.call(thisArg || theObject, prop, theObject[prop]) === -1) { break; } } } } } function _createKeyValueMap(values, keyType, valueType, completeFn) { var theMap = {}; objForEachKey(values, function (key, value) { theMap[key] = keyType ? value : key; theMap[value] = valueType ? value : key; }); return completeFn(theMap); } function throwError(message) { throw new Error(message); } function throwTypeError(message) { throw new TypeError(message); } var _objFreeze = ObjClass$1["freeze"]; var _doNothing = function (value) { return value; }; var _getProto = function (value) { return value[__PROTO__] || NULL_VALUE; }; var objAssign = ObjClass$1["assign"]; function objKeys(value) { if (!isObject(value) || value === NULL_VALUE) { throwTypeError("objKeys called on non-object"); } return ObjClass$1.keys(value); } function objDeepFreeze(value) { if (_objFreeze) { objForEachKey(value, function (key, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(value); } var objFreeze = _objFreeze || _doNothing; var objGetPrototypeOf = ObjClass$1["getPrototypeOf"] || _getProto; function createEnum(values) { return _createKeyValueMap(values, 1 , 0 , objDeepFreeze); } function createEnumKeyMap(values) { return _createKeyValueMap(values, 0 , 0 , objDeepFreeze); } function createSimpleMap(values) { var mapClass = {}; objForEachKey(values, function (key, value) { mapClass[key] = value[1]; mapClass[value[0]] = value[1]; }); return objDeepFreeze(mapClass); } function createTypeMap(values) { return createSimpleMap(values); } var _wellKnownSymbolMap = createEnumKeyMap({ asyncIterator: 0 , hasInstance: 1 , isConcatSpreadable: 2 , iterator: 3 , match: 4 , matchAll: 5 , replace: 6 , search: 7 , species: 8 , split: 9 , toPrimitive: 10 , toStringTag: 11 , unscopables: 12 }); var asString = StrCls; var GLOBAL_CONFIG_KEY = "__tsUtils$gblCfg"; var _globalCfg; function _getGlobalValue() { var result; if (typeof globalThis !== UNDEFINED) { result = globalThis; } if (!result && typeof self !== UNDEFINED) { result = self; } if (!result && typeof window !== UNDEFINED) { result = window; } if (!result && typeof global !== UNDEFINED) { result = global; } return result; } function _getGlobalConfig() { if (!_globalCfg) { var gbl = _getGlobalValue() || {}; _globalCfg = gbl[GLOBAL_CONFIG_KEY] = gbl[GLOBAL_CONFIG_KEY] || {}; } return _globalCfg; } function dumpObj(object, format) { var propertyValueDump = EMPTY; if (isError(object)) { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } else { try { propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? (isNumber(format) ? format : 4) : UNDEF_VALUE); } catch (e) { propertyValueDump = " - " + dumpObj(e, format); } } return objToString(object) + ": " + propertyValueDump; } var _arrSlice = ArrProto[SLICE]; var _throwMissingFunction = function (funcName, thisArg) { throwTypeError("'" + asString(funcName) + "' not defined for " + dumpObj(thisArg)); }; var _unwrapInstFunction = function (funcName) { return function (thisArg) { return thisArg[funcName].apply(thisArg, _arrSlice.call(arguments, 1)); }; }; var _unwrapFunction = function (funcName, clsProto) { var clsFn = clsProto && clsProto[funcName]; return function (thisArg) { var theFunc = (thisArg && thisArg[funcName]) || clsFn; if (theFunc) { return theFunc.apply(thisArg, _arrSlice.call(arguments, 1)); } _throwMissingFunction(funcName, thisArg); }; }; var _unwrapFunctionWithPoly = function (funcName, clsProto, polyFunc) { var clsFn = clsProto && clsProto[funcName]; return function (thisArg) { var theFunc = (thisArg && thisArg[funcName]) || clsFn; if (theFunc || polyFunc) { var theArgs = arguments; return (theFunc || polyFunc).apply(thisArg, theFunc ? _arrSlice.call(theArgs, 1) : theArgs); } _throwMissingFunction(funcName, thisArg); }; }; function _unwrapProp(propName) { return function (thisArg) { return thisArg[propName]; }; } var mathMax = MathCls.max; var strSlice = _unwrapFunction(SLICE, StrProto); var strSubstring = _unwrapFunction("substring", StrProto); var strSubstr = _unwrapFunctionWithPoly("substr", StrProto, polyStrSubstr); function polyStrSubstr(value, start, length) { if (isNullOrUndefined(value)) { throwTypeError("'polyStrSubstr called with invalid " + dumpObj(value)); } if (length < 0) { return EMPTY; } start = start || 0; if (start < 0) { start = mathMax(start + value[LENGTH], 0); } if (isUndefined(length)) { return strSlice(value, start); } return strSlice(value, start, start + length); } function strLeft(value, count) { return strSubstring(value, 0, count); } var _polySymbols; function _globalSymbolRegistry() { if (!_polySymbols) { var gblCfg = _getGlobalConfig(); _polySymbols = gblCfg.gblSym = gblCfg.gblSym || { k: {}, s: {} }; } return _polySymbols; } var _wellKnownSymbolCache = {}; function polyNewSymbol(description) { var theSymbol = { description: asString(description), toString: function () { return SYMBOL + "(" + description + ")"; } }; theSymbol[POLYFILL_TAG] = true; return theSymbol; } function polySymbolFor(key) { var registry = _globalSymbolRegistry(); if (!objHasOwn(registry, key)) { var newSymbol = polyNewSymbol(key); registry.k[key] = newSymbol; registry.s[newSymbol] = asString(key); } return registry.k[key]; } function polyGetKnownSymbol(name) { var result; var knownName = _wellKnownSymbolMap[name]; if (knownName) { result = _wellKnownSymbolCache[knownName] = _wellKnownSymbolCache[knownName] || polyNewSymbol(SYMBOL + "." + knownName); } return result; } var propMap = { e: "enumerable", c: "configurable", v: VALUE, w: "writable", g: "get", s: "set" }; function _createProp(value) { var prop = {}; prop[propMap["c"]] = true; prop[propMap["e"]] = true; if (value.l) { prop.get = function () { return value.l.v; }; var desc = objGetOwnPropertyDescriptor(value.l, "v"); if (desc && desc.set) { prop.set = function (newValue) { value.l.v = newValue; }; } } objForEachKey(value, function (key, value) { prop[propMap[key]] = isUndefined(value) ? prop[propMap[key]] : value; }); return prop; } var objDefineProp = ObjClass$1["defineProperty"]; function objDefine(target, key, propDesc) { return objDefineProp(target, key, _createProp(propDesc)); } var _globalLazyTestHooks; var _fetchLazyTestHooks = function () { _globalLazyTestHooks = _getGlobalConfig(); _fetchLazyTestHooks = NULL_VALUE; }; function getLazy(cb) { var lazyValue = {}; _fetchLazyTestHooks && _fetchLazyTestHooks(); lazyValue.b = _globalLazyTestHooks.lzy; objDefineProp(lazyValue, "v", { configurable: true, get: function () { var result = cb(); if (!_globalLazyTestHooks.lzy) { objDefineProp(lazyValue, "v", { value: result }); if (lazyValue.b) { delete lazyValue.b; } } if (_globalLazyTestHooks.lzy && lazyValue.b !== _globalLazyTestHooks.lzy) { lazyValue.b = _globalLazyTestHooks.lzy; } return result; } }); return lazyValue; } function safeGetLazy(cb, defValue) { return getLazy(function () { return safeGet(cb, defValue); }); } var WINDOW = "window"; var _cachedGlobal; var _cachedWindow; var _cachedDocument; var _cachedNavigator; var _cachedHistory; var _isWebWorker; var _isNode; var lazySafeGetInst = function (name) { return safeGetLazy(function () { return getInst(name) || UNDEF_VALUE; }, UNDEF_VALUE); }; var getGlobal = function (useCached) { (!_cachedGlobal || useCached === false || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = safeGetLazy(_getGlobalValue, NULL_VALUE)); return _cachedGlobal.v; }; var getInst = function (name, useCached) { var gbl = (!_cachedGlobal || useCached === false) ? getGlobal(useCached) : _cachedGlobal.v; if (gbl && gbl[name]) { return gbl[name]; } if (name === WINDOW && _cachedWindow) { return _cachedWindow.v; } return NULL_VALUE; }; var hasDocument = function () { return !!getDocument(); }; var getDocument = function () { (!_cachedDocument || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = lazySafeGetInst("document")); return _cachedDocument.v; }; var hasWindow = function () { return !!getWindow(); }; var getWindow = function () { (!_cachedWindow || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = lazySafeGetInst(WINDOW)); return _cachedWindow.v; }; var hasNavigator = function () { return !!getNavigator(); }; var getNavigator = function () { (!_cachedNavigator || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = lazySafeGetInst("navigator")); return _cachedNavigator.v; }; var hasHistory = function () { return !!getHistory(); }; var getHistory = function () { (!_cachedHistory || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedHistory.b)) && (_cachedHistory = lazySafeGetInst("history")); return _cachedHistory.v; }; var isNode = function () { !_isNode && (_isNode = safeGetLazy(function () { return !!(process && (process.versions || {}).node); }, false)); return _isNode.v; }; var isWebWorker = function () { !_isWebWorker && (_isWebWorker = safeGetLazy(function () { return !!(self && self instanceof WorkerGlobalScope); }, false)); return _isWebWorker.v; }; var _symbol; var _symbolFor; var _symbolKeyFor; function _getSymbolValue(name) { return safeGetLazy(function () { return (_symbol.v ? _symbol[name] : UNDEF_VALUE); }, UNDEF_VALUE); } function hasSymbol() { return !!getSymbol(); } function getSymbol() { var resetCache = !_symbol || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_symbol.b); resetCache && (_symbol = lazySafeGetInst(SYMBOL)); (!_symbolFor || resetCache) && (_symbolFor = _getSymbolValue("for")); (!_symbolKeyFor || resetCache) && (_symbolKeyFor = _getSymbolValue("keyFor")); return _symbol.v; } function getKnownSymbol(name, noPoly) { var knownName = _wellKnownSymbolMap[name]; (!_symbol || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol(); return _symbol.v ? _symbol.v[knownName || name] : (!noPoly ? polyGetKnownSymbol(name) : UNDEF_VALUE); } function newSymbol(description, noPoly) { (!_symbol || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol(); return _symbol.v ? _symbol.v(description) : (!noPoly ? polyNewSymbol(description) : NULL_VALUE); } function symbolFor(key) { (!_symbolFor || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol(); return (_symbolFor.v || polySymbolFor)(key); } function isIterator(value) { return !!value && isFunction(value.next); } function isIterable(value) { return !isStrictNullOrUndefined(value) && isFunction(value[getKnownSymbol(3 )]); } var _iterSymbol; function iterForOf(iter, callbackfn, thisArg) { if (iter) { if (!isIterator(iter)) { !_iterSymbol && (_iterSymbol = getLazy(function () { return getKnownSymbol(3 ); })); iter = iter[_iterSymbol.v] ? iter[_iterSymbol.v]() : null; } if (isIterator(iter)) { var err = void 0; var iterResult = void 0; try { var count = 0; while (!(iterResult = iter.next())[DONE]) { if (callbackfn.call(thisArg || iter, iterResult[VALUE], count, iter) === -1) { break; } count++; } } catch (failed) { err = { e: failed }; if (iter.throw) { iterResult = null; iter.throw(err); } } finally { try { if (iterResult && !iterResult[DONE]) { iter.return && iter.return(iterResult); } } finally { if (err) { throw err.e; } } } } } } var fnApply = _unwrapInstFunction("apply"); function arrAppend(target, elms) { if (!isUndefined(elms) && target) { if (isArray(elms)) { fnApply(target.push, target, elms); } else if (isIterator(elms) || isIterable(elms)) { iterForOf(elms, function (elm) { target.push(elm); }); } else { target.push(elms); } } return target; } function arrForEach(theArray, callbackfn, thisArg) { if (theArray) { var len = theArray[LENGTH] >>> 0; for (var idx = 0; idx < len; idx++) { if (idx in theArray) { if (callbackfn.call(thisArg || theArray, theArray[idx], idx, theArray) === -1) { break; } } } } } var arrIndexOf = _unwrapFunction(INDEX_OF, ArrProto); var arrMap = _unwrapFunction("map", ArrProto); var arrSlice = _unwrapFunction(SLICE, ArrProto); var fnCall = _unwrapInstFunction("call"); function polyArrIncludes(theArray, searchElement, fromIndex) { return arrIndexOf(theArray, searchElement, fromIndex) !== -1; } var arrIncludes = _unwrapFunctionWithPoly("includes", ArrProto, polyArrIncludes); var arrReduce = _unwrapFunction("reduce", ArrProto); var _objCreate = ObjClass$1["create"]; var objCreate = _objCreate || polyObjCreate; function polyObjCreate(obj) { if (!obj) { return {}; } var type = typeof obj; if (type !== OBJECT && type !== FUNCTION) { throw new TypeError("Prototype must be an Object or function: " + dumpObj(obj)); } function tempFunc() { } tempFunc[PROTOTYPE] = obj; return new tempFunc(); } var _isProtoArray; function objSetPrototypeOf(obj, proto) { var fn = ObjClass$1["setPrototypeOf"] || function (d, b) { !_isProtoArray && (_isProtoArray = getLazy(function () { var _a; return ((_a = {}, _a[__PROTO__] = [], _a) instanceof Array); })); _isProtoArray.v ? d[__PROTO__] = b : objForEachKey(b, function (key, value) { return d[key] = value; }); }; return fn(obj, proto); } var _createCustomError = function (name, d, b) { _safeDefineName(d, name); d = objSetPrototypeOf(d, b); function __() { this.constructor = d; _safeDefineName(this, name); } d[PROTOTYPE] = b === NULL_VALUE ? objCreate(b) : (__[PROTOTYPE] = b[PROTOTYPE], new __()); return d; }; var _safeSetName = function (baseClass, name) { try { name && (baseClass[NAME] = name); } catch (e) { } }; var _safeDefineName = function (target, name) { try { objDefine(target, NAME, { v: name, c: true, e: false }); } catch (e) { } }; function createCustomError(name, constructCb, errorBase) { var theBaseClass = errorBase || Error; var orgName = theBaseClass[PROTOTYPE][NAME]; var captureFn = Error.captureStackTrace; return _createCustomError(name, function () { var _this = this; try { _safeSetName(theBaseClass, name); var _self = fnApply(theBaseClass, _this, arrSlice(arguments)) || _this; if (_self !== _this) { var orgProto = objGetPrototypeOf(_this); if (orgProto !== objGetPrototypeOf(_self)) { objSetPrototypeOf(_self, orgProto); } } captureFn && captureFn(_self, _this[CONSTRUCTOR]); constructCb && constructCb(_self, arguments); return _self; } finally { _safeSetName(theBaseClass, orgName); } }, theBaseClass); } var _unsupportedError; function throwUnsupported(message) { if (!_unsupportedError) { _unsupportedError = createCustomError("UnsupportedError"); } throw new _unsupportedError(message); } function utcNow() { return (Date.now || polyUtcNow)(); } function polyUtcNow() { return new Date().getTime(); } function _createTrimFn(exp) { return function _doTrim(value) { if (isNullOrUndefined(value)) { throwTypeError("strTrim called [" + dumpObj(value) + "]"); } if (value && value.replace) { value = value.replace(exp, EMPTY); } return value; }; } var polyStrTrim = _createTrimFn(/^\s+|(?=\s)\s+$/g); var strTrim = _unwrapFunctionWithPoly("trim", StrProto, polyStrTrim); var _fnToString; var _objCtrFnString; var _gblWindow; function isPlainObject(value) { if (!value || typeof value !== OBJECT) { return false; } if (!_gblWindow) { _gblWindow = hasWindow() ? getWindow() : true; } var result = false; if (value !== _gblWindow) { if (!_objCtrFnString) { _fnToString = Function[PROTOTYPE].toString; _objCtrFnString = fnCall(_fnToString, ObjClass$1); } try { var proto = objGetPrototypeOf(value); result = !proto; if (!result) { if (objHasOwnProperty(proto, CONSTRUCTOR)) { proto = proto[CONSTRUCTOR]; } result = proto && typeof proto === FUNCTION && _fnToString.call(proto) === _objCtrFnString; } } catch (ex) { } } return result; } var _defaultDeepCopyHandler = function (details) { details.value && plainObjDeepCopyHandler(details); return true; }; var defaultDeepCopyHandlers = [ arrayDeepCopyHandler, plainObjDeepCopyHandler, functionDeepCopyHandler, dateDeepCopyHandler ]; function _getSetVisited(visitMap, source, newPath, cb) { var theEntry; arrForEach(visitMap, function (entry) { if (entry.k === source) { theEntry = entry; return -1; } }); if (!theEntry) { theEntry = { k: source, v: source }; visitMap.push(theEntry); cb(theEntry); } return theEntry.v; } function _deepCopy(visitMap, value, ctx, key) { var userHandler = ctx.handler; var newPath = ctx.path ? (key ? ctx.path.concat(key) : ctx.path) : []; var newCtx = { handler: ctx.handler, src: ctx.src, path: newPath }; var theType = typeof value; var isPlain = false; var isPrim = false; if (value && theType === OBJECT) { isPlain = isPlainObject(value); } else { isPrim = value === NULL_VALUE || isPrimitiveType(theType); } var details = { type: theType, isPrim: isPrim, isPlain: isPlain, value: value, result: value, path: newPath, origin: ctx.src, copy: function (source, newKey) { return _deepCopy(visitMap, source, newKey ? newCtx : ctx, newKey); }, copyTo: function (target, source) { return _copyProps(visitMap, target, source, newCtx); } }; if (!details.isPrim) { return _getSetVisited(visitMap, value, newPath, function (newEntry) { objDefine(details, "result", { g: function () { return newEntry.v; }, s: function (newValue) { newEntry.v = newValue; } }); var idx = 0; var handler = userHandler; while (!fnCall(handler || (idx < defaultDeepCopyHandlers.length ? defaultDeepCopyHandlers[idx++] : _defaultDeepCopyHandler), ctx, details)) { handler = NULL_VALUE; } }); } if (userHandler && fnCall(userHandler, ctx, details)) { return details.result; } return value; } function _copyProps(visitMap, target, source, ctx) { if (!isNullOrUndefined(source)) { for (var key in source) { target[key] = _deepCopy(visitMap, source[key], ctx, key); } } return target; } function objCopyProps(target, source, handler) { var ctx = { handler: handler, src: source, path: [] }; return _copyProps([], target, source, ctx); } function objDeepCopy(source, handler) { var ctx = { handler: handler, src: source }; return _deepCopy([], source, ctx); } function arrayDeepCopyHandler(details) { var value = details.value; if (isArray(value)) { var target = details.result = []; target.length = value.length; details.copyTo(target, value); return true; } return false; } function dateDeepCopyHandler(details) { var value = details.value; if (isDate(value)) { details.result = new Date(value.getTime()); return true; } return false; } function functionDeepCopyHandler(details) { if (details.type === FUNCTION) { return true; } return false; } function plainObjDeepCopyHandler(details) { var value = details.value; if (value && details.isPlain) { var target = details.result = {}; details.copyTo(target, value); return true; } return false; } function _doExtend(target, theArgs) { arrForEach(theArgs, function (theArg) { objCopyProps(target, theArg); }); return target; } function deepExtend(target, obj1, obj2, obj3, obj4, obj5, obj6) { return _doExtend(objDeepCopy(target) || {}, arrSlice(arguments)); } var getLength = _unwrapProp(LENGTH); var _perf; function getPerformance() { (!_perf || (!_perf.b && _globalLazyTestHooks && _globalLazyTestHooks.lzy)) && (_perf = lazySafeGetInst("performance")); return _perf.v; } var strEndsWith = _unwrapFunctionWithPoly("endsWith", StrProto, polyStrEndsWith); function polyStrEndsWith(value, searchString, length) { if (!isString(value)) { throwTypeError("'" + dumpObj(value) + "' is not a string"); } var searchValue = isString(searchString) ? searchString : asString(searchString); var chkLen = searchValue[LENGTH]; var len = value[LENGTH]; var end = !isUndefined(length) && length < len ? length : len; return strSubstring(value, end - chkLen, end) === searchValue; } var strIndexOf = _unwrapFunction(INDEX_OF, StrProto); var REF = "ref"; var UNREF = "un" + REF; var HAS_REF = "hasRef"; var ENABLED = "enabled"; function _createTimerHandler(startTimer, refreshFn, cancelFn) { var _a; var ref = true; var timerId = startTimer ? refreshFn(NULL_VALUE) : NULL_VALUE; var theTimerHandler; var _unref = function () { ref = false; timerId && timerId[UNREF] && timerId[UNREF](); return theTimerHandler; }; var _ref = function () { ref = true; timerId && timerId[REF] && timerId[REF](); return theTimerHandler; }; var _hasRef = function () { if (timerId && timerId[HAS_REF]) { return timerId[HAS_REF](); } return ref; }; var _refresh = function () { timerId = refreshFn(timerId); if (!ref) { _unref(); } return theTimerHandler; }; var _cancel = function () { timerId && cancelFn(timerId); timerId = NULL_VALUE; }; var _setEnabled = function (value) { !value && timerId && _cancel(); value && !timerId && _refresh(); }; theTimerHandler = (_a = { cancel: _cancel, refresh: _refresh }, _a[HAS_REF] = _hasRef, _a[REF] = _ref, _a[UNREF] = _unref, _a[ENABLED] = false, _a); objDefineProp(theTimerHandler, ENABLED, { get: function () { return !!timerId; }, set: _setEnabled }); return { h: theTimerHandler, dn: function () { timerId = NULL_VALUE; } }; } function _createTimeoutWith(self, startTimer, overrideFn, theArgs) { var isArr = isArray(overrideFn); var len = isArr ? overrideFn.length : 0; var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout; var clearFn = (len > 1 ? overrideFn[1] : UNDEF_VALUE) || clearTimeout; var timerFn = theArgs[0]; theArgs[0] = function () { handler.dn(); fnApply(timerFn, self, arrSlice(arguments)); }; var handler = _createTimerHandler(startTimer, function (timerId) { if (timerId) { if (timerId.refresh) { timerId.refresh(); return timerId; } fnApply(clearFn, self, [timerId]); } return fnApply(setFn, self, theArgs); }, function (timerId) { fnApply(clearFn, self, [timerId]); }); return handler.h; } function scheduleTimeout(callback, timeout) { return _createTimeoutWith(this, true, UNDEF_VALUE, arrSlice(arguments)); } function createTimeout(callback, timeout) { return _createTimeoutWith(this, false, UNDEF_VALUE, arrSlice(arguments)); } var _a$9; var Constructor = 'constructor'; var Prototype = 'prototype'; var strFunction = 'function'; var DynInstFuncTable = '_dynInstFuncs'; var DynProxyTag = '_isDynProxy'; var DynClassName = '_dynClass'; var DynClassNamePrefix = '_dynCls$'; var DynInstChkTag = '_dynInstChk'; var DynAllowInstChkTag = DynInstChkTag; var DynProtoDefaultOptions = '_dfOpts'; var UnknownValue = '_unknown_'; var str__Proto = "__proto__"; var DynProtoBaseProto = "_dyn" + str__Proto; var DynProtoGlobalSettings = "__dynProto$Gbl"; var DynProtoCurrent = "_dynInstProto"; var strUseBaseInst = 'useBaseInst'; var strSetInstFuncs = 'setInstFuncs'; var Obj = Object; var _objGetPrototypeOf = Obj["getPrototypeOf"]; var _objGetOwnProps = Obj["getOwnPropertyNames"]; var _gbl = getGlobal(); var _gblInst = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = { o: (_a$9 = {}, _a$9[strSetInstFuncs] = true, _a$9[strUseBaseInst] = true, _a$9), n: 1000 }); function _isObjectOrArrayPrototype(target) { return target && (target === Obj[Prototype] || target === Array[Prototype]); } function _isObjectArrayOrFunctionPrototype(target) { return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; } function _getObjProto$1(target) { var newProto; if (target) { if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); newProto = target[DynProtoBaseProto] || curProto; if (!objHasOwnProperty(target, DynProtoBaseProto)) { delete target[DynProtoCurrent]; newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; target[DynProtoCurrent] = curProto; } } return newProto; } function _forEachProp(target, func) { var props = []; if (_objGetOwnProps) { props = _objGetOwnProps(target); } else { for (var name_1 in target) { if (typeof name_1 === "string" && objHasOwnProperty(target, name_1)) { props.push(name_1); } } } if (props && props.length > 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || objHasOwnProperty(target, funcName))); } function _throwTypeError(message) { throwTypeError("DynamicProto: " + message); } function _getInstanceFuncs(thisTarget) { var instFuncs = {}; _forEachProp(thisTarget, function (name) { if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { instFuncs[name] = thisTarget[name]; } }); return instFuncs; } function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { return theFunc.apply(target, arguments); }; } var baseFuncs = {}; _forEachProp(instFuncs, function (name) { baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); var baseProto = _getObjProto$1(classProto); var visited = []; while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { _forEachProp(baseProto, function (name) { if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); visited.push(baseProto); baseProto = _getObjProto$1(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; if (target && objHasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { _throwTypeError("Missing [" + funcName + "] " + strFunction); } if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { var canAddInst = !objHasOwnProperty(target, funcName); var objProto = _getObjProto$1(target); var visited = []; while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } visited.push(objProto); objProto = _getObjProto$1(objProto); } try { if (canAddInst) { target[funcName] = instFunc; } instFunc[DynInstChkTag] = 1; } catch (e) { instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; if (protoFunc === currentDynProtoProxy) { protoFunc = _getObjProto$1(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); return instFunc.apply(this, arguments); }; dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { instFuncs_1[name] = target[name]; delete target[name]; if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } function _checkPrototype(classProto, thisTarget) { if (_objGetPrototypeOf) { var visited = []; var thisProto = _getObjProto$1(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } visited.push(thisProto); thisProto = _getObjProto$1(thisProto); } return false; } return true; } function _getObjName(target, unknownValue) { if (objHasOwnProperty(target, Prototype)) { return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } function dynamicProto(theClass, target, delegateFunc, options) { if (!objHasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] not in hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (objHasOwnProperty(classProto, DynClassName)) { className = classProto[DynClassName]; } else { className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _gblInst.n; _gblInst.n++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } var instFuncs = _getInstanceFuncs(target); var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); delegateFunc(target, baseFuncs); var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } dynamicProto[DynProtoDefaultOptions] = _gblInst.o; var strShimFunction = "function"; var strShimObject = "object"; var strShimUndefined = "undefined"; var strShimPrototype = "prototype"; var ObjClass = Object; var ObjProto = ObjClass[strShimPrototype]; (getGlobal() || {})["Symbol"]; (getGlobal() || {})["Reflect"]; var strHasOwnProperty = "hasOwnProperty"; var __objAssignFnImpl = function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (ObjProto[strHasOwnProperty].call(s, p)) { t[p] = s[p]; } } } return t; }; var __assignFn = objAssign || __objAssignFnImpl; var extendStaticsFn = function (d, b) { extendStaticsFn = ObjClass["setPrototypeOf"] || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) { if (b[strHasOwnProperty](p)) { d[p] = b[p]; } } }; return extendStaticsFn(d, b); }; function __extendsFn(d, b) { if (typeof b !== strShimFunction && b !== null) { throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); } extendStaticsFn(d, b); function __() { this.constructor = d; } d[strShimPrototype] = b === null ? objCreate(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); } function __spreadArrayFn(to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { to[j] = from[i]; } return to; } var createEnumStyle = createEnum; var createValueMap = createTypeMap; var _DYN_TO_LOWER_CASE$2 = "toLowerCase"; var _DYN_BLK_VAL = "blkVal"; var _DYN_LENGTH$5 = "length"; var _DYN_RD_ONLY = "rdOnly"; var _DYN_NOTIFY = "notify"; var _DYN_WARN_TO_CONSOLE = "warnToConsole"; var _DYN_THROW_INTERNAL = "throwInternal"; var _DYN_SET_DF = "setDf"; var _DYN_WATCH = "watch"; var _DYN_LOGGER = "logger"; var _DYN_APPLY = "apply"; var _DYN_PUSH$1 = "push"; var _DYN_SPLICE = "splice"; var _DYN_HDLR = "hdlr"; var _DYN_CANCEL = "cancel"; var _DYN_INITIALIZE = "initialize"; var _DYN_IDENTIFIER = "identifier"; var _DYN_IS_INITIALIZED = "isInitialized"; var _DYN_GET_PLUGIN = "getPlugin"; var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs"; var _DYN_NAME$3 = "name"; var _DYN_TIME = "time"; var _DYN_PROCESS_NEXT = "processNext"; var _DYN_GET_PROCESS_TEL_CONT0 = "getProcessTelContext"; var _DYN_GET_NOTIFY_MGR = "getNotifyMgr"; var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener"; var _DYN_REMOVE_NOTIFICATION_2 = "removeNotificationListener"; var _DYN_ENABLED = "enabled"; var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs"; var _DYN_UNLOAD = "unload"; var _DYN_ON_COMPLETE = "onComplete"; var _DYN_VERSION$1 = "version"; var _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole"; var _DYN_CREATE_NEW$1 = "createNew"; var _DYN_TEARDOWN = "teardown"; var _DYN_MESSAGE_ID = "messageId"; var _DYN_MESSAGE$2 = "message"; var _DYN_IS_ASYNC = "isAsync"; var _DYN_DIAG_LOG$2 = "diagLog"; var _DYN__DO_TEARDOWN = "_doTeardown"; var _DYN_UPDATE$1 = "update"; var _DYN_GET_NEXT = "getNext"; var _DYN_SET_NEXT_PLUGIN = "setNextPlugin"; var _DYN_USER_AGENT = "userAgent"; var _DYN_SPLIT$1 = "split"; var _DYN_NODE_TYPE = "nodeType"; var _DYN_REPLACE = "replace"; var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage"; var _DYN_TYPE = "type"; var _DYN_HANDLER = "handler"; var _DYN_IS_CHILD_EVT = "isChildEvt"; var _DYN_GET_CTX = "getCtx"; var _DYN_SET_CTX = "setCtx"; var _DYN_COMPLETE = "complete"; var _DYN_TRACE_ID$2 = "traceId"; var _DYN_SPAN_ID$1 = "spanId"; var _DYN_TRACE_FLAGS$1 = "traceFlags"; var aggregationErrorType; function throwAggregationError(message, sourceErrors) { if (!aggregationErrorType) { aggregationErrorType = createCustomError("AggregationError", function (self, args) { if (args[_DYN_LENGTH$5 ] > 1) { self.errors = args[1]; } }); } var theMessage = message || "One or more errors occurred."; arrForEach(sourceErrors, function (srcError, idx) { theMessage += "\n".concat(idx, " > ").concat(dumpObj(srcError)); }); throw new aggregationErrorType(theMessage, sourceErrors || []); } function doAwaitResponse(value, cb) { return doAwait(value, function (value) { cb && cb({ value: value, rejected: false }); }, function (reason) { cb && cb({ rejected: true, reason: reason }); }); } function doAwait(value, resolveFn, rejectFn, finallyFn) { var result = value; if (isPromiseLike(value)) { if (resolveFn || rejectFn) { result = value.then(resolveFn, rejectFn); } } else { resolveFn && resolveFn(value); } if (finallyFn) { result = doFinally(result, finallyFn); } return result; } function doFinally(value, finallyFn) { var result = value; if (finallyFn) { if (isPromiseLike(value)) { if (value.finally) { result = value.finally(finallyFn); } else { result = value.then(function (value) { finallyFn(); return value; }, function (reason) { finallyFn(); throw reason; }); } } else { finallyFn(); } } return result; } var STRING_STATES = [ "pending", "resolving", "resolved", "rejected" ]; var DISPATCH_EVENT = "dispatchEvent"; var _hasInitEvent; function emitEvent(target, evtName, populateEvent, useNewEvent) { var doc = getDocument(); !_hasInitEvent && (_hasInitEvent = safeGetLazy(function () { var evt; if (doc && doc.createEvent) { evt = doc.createEvent("Event"); } return (!!evt && evt.initEvent); }, null)); var theEvt = _hasInitEvent.v ? doc.createEvent("Event") : (useNewEvent ? new Event(evtName) : {}); populateEvent && populateEvent(theEvt); if (_hasInitEvent.v) { theEvt.initEvent(evtName, false, true); } if (theEvt && target[DISPATCH_EVENT]) { target[DISPATCH_EVENT](theEvt); } else { var handler = target["on" + evtName]; if (handler) { handler(theEvt); } else { var theConsole = getInst("console"); theConsole && (theConsole["error"] || theConsole["log"])(evtName, dumpObj(theEvt)); } } } var STR_PROMISE = "Promise"; var NODE_UNHANDLED_REJECTION = "unhandledRejection"; var UNHANDLED_REJECTION = NODE_UNHANDLED_REJECTION.toLowerCase(); var _unhandledRejectionTimeout = 10; var _hasPromiseRejectionEvent; function dumpFnObj(value) { if (isFunction(value)) { return value.toString(); } return dumpObj(value); } function _createPromise(newPromise, processor, executor) { var additionalArgs = arrSlice(arguments, 3); var _state = 0 ; var _hasResolved = false; var _settledValue; var _queue = []; var _handled = false; var _unHandledRejectionHandler = null; var _thePromise; !_hasPromiseRejectionEvent && (_hasPromiseRejectionEvent = lazySafeGetInst(STR_PROMISE + "RejectionEvent")); var _then = function (onResolved, onRejected) { try { _handled = true; _unHandledRejectionHandler && _unHandledRejectionHandler.cancel(); _unHandledRejectionHandler = null; var thenPromise = newPromise(function (resolve, reject) { _queue.push(function () { try { var handler = _state === 2 ? onResolved : onRejected; var value = isUndefined(handler) ? _settledValue : (isFunction(handler) ? handler(_settledValue) : handler); if (isPromiseLike(value)) { value.then(resolve, reject); } else if (handler) { resolve(value); } else if (_state === 3 ) { reject(value); } else { resolve(value); } } catch (e) { reject(e); } }); if (_hasResolved) { _processQueue(); } }, additionalArgs); return thenPromise; } finally { } }; var _catch = function (onRejected) { return _then(undefined, onRejected); }; var _finally = function (onFinally) { var thenFinally = onFinally; var catchFinally = onFinally; if (isFunction(onFinally)) { thenFinally = function (value) { onFinally && onFinally(); return value; }; catchFinally = function (reason) { onFinally && onFinally(); throw reason; }; } return _then(thenFinally, catchFinally); }; var _strState = function () { return STRING_STATES[_state]; }; var _processQueue = function () { if (_queue.length > 0) { var pending = _queue.slice(); _queue = []; _handled = true; processor(pending); _unHandledRejectionHandler && _unHandledRejectionHandler.cancel(); _unHandledRejectionHandler = null; } }; var _createSettleIfFn = function (newState, allowState) { return function (theValue) { if (_state === allowState) { if (newState === 2 && isPromiseLike(theValue)) { _state = 1 ; theValue.then(_createSettleIfFn(2 , 1 ), _createSettleIfFn(3 , 1 )); return; } _state = newState; _hasResolved = true; _settledValue = theValue; _processQueue(); if (!_handled && newState === 3 && !_unHandledRejectionHandler) { _unHandledRejectionHandler = scheduleTimeout(_notifyUnhandledRejection, _unhandledRejectionTimeout); } } }; }; var _notifyUnhandledRejection = function () { if (!_handled) { if (isNode()) { process.emit(NODE_UNHANDLED_REJECTION, _settledValue, _thePromise); } else { var gbl = getWindow() || getGlobal(); emitEvent(gbl, UNHANDLED_REJECTION, function (theEvt) { objDefine(theEvt, "promise", { g: function () { return _thePromise; } }); theEvt.reason = _settledValue; return theEvt; }, !!_hasPromiseRejectionEvent.v); } } }; _thePromise = { then: _then, "catch": _catch, finally: _finally }; objDefineProp(_thePromise, "state", { get: _strState }); if (hasSymbol()) { _thePromise[getKnownSymbol(11 )] = "IPromise"; } var _toString = function () { return "IPromise" + ("") + " " + _strState() + (_hasResolved ? (" - " + dumpFnObj(_settledValue)) : ""); }; _thePromise.toString = _toString; (function _initialize() { if (!isFunction(executor)) { throwTypeError(STR_PROMISE + ": executor is not a function - " + dumpFnObj(executor)); } var _rejectFn = _createSettleIfFn(3 , 0 ); try { executor.call(_thePromise, _createSettleIfFn(2 , 0 ), _rejectFn); } catch (e) { _rejectFn(e); } })(); return _thePromise; } function _createAllPromise(newPromise) { return function (input) { var additionalArgs = arrSlice(arguments, 1); return newPromise(function (resolve, reject) { try { var values_1 = []; var pending_1 = 1; arrForEach(input, function (item, idx) { if (item) { pending_1++; doAwait(item, function (value) { values_1[idx] = value; if (--pending_1 === 0) { resolve(values_1); } }, reject); } }); pending_1--; if (pending_1 === 0) { resolve(values_1); } } catch (e) { reject(e); } }, additionalArgs); }; } var _processPendingItems = function (pending) { arrForEach(pending, function (fn) { try { fn(); } catch (e) { } }); }; function timeoutItemProcessor(timeout) { var callbackTimeout = isNumber(timeout) ? timeout : 0; return function (pending) { scheduleTimeout(function () { _processPendingItems(pending); }, callbackTimeout); }; } function createAsyncPromise(executor, timeout) { return _createPromise(createAsyncPromise, timeoutItemProcessor(timeout), executor, timeout); } var _isPromiseSupported; function createNativePromise(executor, timeout) { !_isPromiseSupported && (_isPromiseSupported = lazySafeGetInst(STR_PROMISE)); var PrmCls = _isPromiseSupported.v; if (!PrmCls) { return createAsyncPromise(executor); } if (!isFunction(executor)) { throwTypeError(STR_PROMISE + ": executor is not a function - " + dumpObj(executor)); } var _state = 0 ; function _strState() { return STRING_STATES[_state]; } var thePromise = new PrmCls(function (resolve, reject) { function _resolve(value) { _state = 2 ; resolve(value); } function _reject(reason) { _state = 3 ; reject(reason); } executor(_resolve, _reject); }); objDefineProp(thePromise, "state", { get: _strState }); return thePromise; } var _promiseCreator; function createPromise(executor, timeout) { !_promiseCreator && (_promiseCreator = getLazy(function () { return createNativePromise; })); return _promiseCreator.v.call(this, executor, timeout); } var createAllPromise = _createAllPromise(createPromise); var UNDEFINED_VALUE$2 = undefined; var STR_EMPTY = ""; var STR_CHANNELS = "channels"; var STR_CORE = "core"; var STR_CREATE_PERF_MGR = "createPerfMgr"; var STR_DISABLED = "disabled"; var STR_EXTENSION_CONFIG = "extensionConfig"; var STR_EXTENSIONS = "extensions"; var STR_PROCESS_TELEMETRY = "processTelemetry"; var STR_PRIORITY = "priority"; var STR_EVENTS_SENT = "eventsSent"; var STR_EVENTS_DISCARDED = "eventsDiscarded"; var STR_EVENTS_SEND_REQUEST = "eventsSendRequest"; var STR_PERF_EVENT = "perfEvent"; var STR_GET_PERF_MGR = "getPerfMgr"; var STR_DOMAIN = "domain"; var STR_PATH = "path"; var STR_NOT_DYNAMIC_ERROR = "Not dynamic - "; var strGetPrototypeOf = "getPrototypeOf"; var rCamelCase = /-([a-z])/g; var rNormalizeInvalid = /([^\w\d_$])/g; var rLeadingNumeric = /^(\d+[\w\d_$])/; var _getObjProto = Object[strGetPrototypeOf]; function isNotNullOrUndefined(value) { return !isNullOrUndefined(value); } function normalizeJsName(name) { var value = name; if (value && isString(value)) { value = value[_DYN_REPLACE ](rCamelCase, function (_all, letter) { return letter.toUpperCase(); }); value = value[_DYN_REPLACE ](rNormalizeInvalid, "_"); value = value[_DYN_REPLACE ](rLeadingNumeric, function (_all, match) { return "_" + match; }); } return value; } function strContains(value, search) { if (value && search) { return strIndexOf(value, search) !== -1; } return false; } function toISOString(date) { return date && date.toISOString() || ""; } function getExceptionName(object) { if (isError(object)) { return object[_DYN_NAME$3 ]; } return STR_EMPTY; } function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } function getSetValue(target, field, defValue) { var theValue; if (target) { theValue = target[field]; if (!theValue && isNullOrUndefined(theValue)) { theValue = !isUndefined(defValue) ? defValue : {}; target[field] = theValue; } } else { theValue = !isUndefined(defValue) ? defValue : {}; } return theValue; } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName][_DYN_APPLY ](src, originalArguments); } }; } function proxyAssign(target, source, chkSet) { if (target && source && isObject(target) && isObject(source)) { var _loop_1 = function (field) { if (isString(field)) { var value = source[field]; if (isFunction(value)) { if (!chkSet || chkSet(field, true, source, target)) { target[field] = _createProxyFunction(source, field); } } else if (!chkSet || chkSet(field, false, source, target)) { if (objHasOwn(target, field)) { delete target[field]; } objDefine(target, field, { g: function () { return source[field]; }, s: function (theValue) { source[field] = theValue; } }); } } }; for (var field in source) { _loop_1(field); } } return target; } function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } function proxyFunctions(target, source, functionsToProxy, overwriteTarget) { if (target && source && isObject(target) && isArray(functionsToProxy)) { arrForEach(functionsToProxy, function (theFuncName) { if (isString(theFuncName)) { proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget); } }); } return target; } function createClassFromInterface(defaults) { return /** @class */ (function () { function class_1() { var _this = this; if (defaults) { objForEachKey(defaults, function (field, value) { _this[field] = value; }); } } return class_1; }()); } function optimizeObject(theObject) { if (theObject && objAssign) { theObject = ObjClass(objAssign({}, theObject)); } return theObject; } function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs[_DYN_LENGTH$5 ]; var deep = false; var idx = 1; if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } if (!isObject(extended)) { extended = {}; } for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && objHasOwn(arg, prop)); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { clone = []; } } else if (!isPlainObject(clone)) { clone = {}; } newValue = objExtend(deep, clone, newValue); } if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } var strDocumentMode = "documentMode"; var strLocation = "location"; var strConsole = "console"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { } } } return supported; } function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getInst(strLocation); } function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getInst(strConsole); } function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null); } function getJSON() { if (hasJSON()) { return JSON || getInst(strJSON); } return null; } function getCrypto() { return getInst(strCrypto); } function getMsCrypto() { return getInst(strMsCrypto); } function isReactNative() { var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } function isIE() { var nav = getNavigator(); if (nav && (nav[_DYN_USER_AGENT ] !== _navUserAgentCheck || _isTrident === null)) { _navUserAgentCheck = nav[_DYN_USER_AGENT ]; var userAgent = (_navUserAgentCheck || STR_EMPTY)[_DYN_TO_LOWER_CASE$2 ](); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } function getIEVersion(userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } if (!userAgentStr) { var navigator_1 = getNavigator() || {}; userAgentStr = navigator_1 ? (navigator_1.userAgent || STR_EMPTY)[_DYN_TO_LOWER_CASE$2 ]() : STR_EMPTY; } var ua = (userAgentStr || STR_EMPTY)[_DYN_TO_LOWER_CASE$2 ](); if (strContains(ua, strMsie)) { var doc = getDocument() || {}; return Math.max(parseInt(ua[_DYN_SPLIT$1 ](strMsie)[1]), (doc[strDocumentMode] || 0)); } else if (strContains(ua, strTrident)) { var tridentVer = parseInt(ua[_DYN_SPLIT$1 ](strTrident)[1]); if (tridentVer) { return tridentVer + 4; } } return null; } function isBeaconsSupported(useCached) { if (_beaconsSupported === null || useCached === false) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getInst("fetch"); var request = getInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { } return isSupported; } function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { } return isSupported; } var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; var SEED1 = 123456789; var SEED2 = 987654321; var _mwcSeeded = false; var _mwcW = SEED1; var _mwcZ = SEED2; function _mwcSeed(seedValue) { if (seedValue < 0) { seedValue >>>= 0; } _mwcW = (SEED1 + seedValue) & MaxUInt32; _mwcZ = (SEED2 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { try { var now = utcNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { } } function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { if (!_mwcSeeded) { _autoSeedMwc(); } value = mwcRandom32() & MaxUInt32; } if (value === 0) { value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { value >>>= 0; } return value; } function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { value >>>= 0; } return value; } function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var number = random32() >>> 0; var chars = 0; var result = STR_EMPTY; while (result[_DYN_LENGTH$5 ] < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; if (chars === 5) { number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; } } return result; } var version = '3.0.2'; var instanceName = "." + newId(6); var _dataUid = 0; function _canAcceptData(target) { return target[_DYN_NODE_TYPE ] === 1 || target[_DYN_NODE_TYPE ] === 9 || !(+target[_DYN_NODE_TYPE ]); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { objDefine(target, data.id, { e: false, v: theCache }); } } catch (e) { } } return theCache; } function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : STR_EMPTY) + instanceName); } function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || STR_EMPTY) + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { } } } }; return data; } function _isConfigDefaults(value) { return (value && isObject(value) && (value.isVal || value.fb || objHasOwn(value, "v") || objHasOwn(value, "mrg") || objHasOwn(value, "ref") || value.set)); } function _getDefault(dynamicHandler, theConfig, cfgDefaults) { var defValue; var isDefaultValid = cfgDefaults.dfVal || isDefined; if (theConfig && cfgDefaults.fb) { var fallbacks = cfgDefaults.fb; if (!isArray(fallbacks)) { fallbacks = [fallbacks]; } for (var lp = 0; lp < fallbacks[_DYN_LENGTH$5 ]; lp++) { var fallback = fallbacks[lp]; var fbValue = theConfig[fallback]; if (isDefaultValid(fbValue)) { defValue = fbValue; } else if (dynamicHandler) { fbValue = dynamicHandler.cfg[fallback]; if (isDefaultValid(fbValue)) { defValue = fbValue; } dynamicHandler.set(dynamicHandler.cfg, asString(fallback), fbValue); } if (isDefaultValid(defValue)) { break; } } } if (!isDefaultValid(defValue) && isDefaultValid(cfgDefaults.v)) { defValue = cfgDefaults.v; } return defValue; } function _resolveDefaultValue(dynamicHandler, theConfig, cfgDefaults) { var theValue = cfgDefaults; if (cfgDefaults && _isConfigDefaults(cfgDefaults)) { theValue = _getDefault(dynamicHandler, theConfig, cfgDefaults); } if (theValue) { if (_isConfigDefaults(theValue)) { theValue = _resolveDefaultValue(dynamicHandler, theConfig, theValue); } var newValue_1; if (isArray(theValue)) { newValue_1 = []; newValue_1[_DYN_LENGTH$5 ] = theValue[_DYN_LENGTH$5 ]; } else if (isPlainObject(theValue)) { newValue_1 = {}; } if (newValue_1) { objForEachKey(theValue, function (key, value) { if (value && _isConfigDefaults(value)) { value = _resolveDefaultValue(dynamicHandler, theConfig, value); } newValue_1[key] = value; }); theValue = newValue_1; } } return theValue; } function _applyDefaultValue(dynamicHandler, theConfig, name, defaultValue) { var isValid; var setFn; var defValue; var cfgDefaults = defaultValue; var mergeDf; var reference; var readOnly; var blkDynamicValue; if (_isConfigDefaults(cfgDefaults)) { isValid = cfgDefaults.isVal; setFn = cfgDefaults.set; readOnly = cfgDefaults[_DYN_RD_ONLY ]; blkDynamicValue = cfgDefaults[_DYN_BLK_VAL ]; mergeDf = cfgDefaults.mrg; reference = cfgDefaults.ref; if (!reference && isUndefined(reference)) { reference = !!mergeDf; } defValue = _getDefault(dynamicHandler, theConfig, cfgDefaults); } else { defValue = defaultValue; } if (blkDynamicValue) { dynamicHandler[_DYN_BLK_VAL ](theConfig, name); } var theValue; var usingDefault = true; var cfgValue = theConfig[name]; if (cfgValue || !isNullOrUndefined(cfgValue)) { theValue = cfgValue; usingDefault = false; if (isValid && theValue !== defValue && !isValid(theValue)) { theValue = defValue; usingDefault = true; } if (setFn) { theValue = setFn(theValue, defValue, theConfig); usingDefault = theValue === defValue; } } if (!usingDefault) { if (isPlainObject(theValue) || isArray(defValue)) { if (mergeDf && defValue && (isPlainObject(defValue) || isArray(defValue))) { objForEachKey(defValue, function (dfName, dfValue) { _applyDefaultValue(dynamicHandler, theValue, dfName, dfValue); }); } } } else if (defValue) { theValue = _resolveDefaultValue(dynamicHandler, theConfig, defValue); } else { theValue = defValue; } dynamicHandler.set(theConfig, name, theValue); if (reference) { dynamicHandler.ref(theConfig, name); } if (readOnly) { dynamicHandler[_DYN_RD_ONLY ](theConfig, name); } } var CFG_HANDLER_LINK = symbolFor("[[ai_dynCfg_1]]"); var BLOCK_DYNAMIC = symbolFor("[[ai_blkDynCfg_1]]"); var FORCE_DYNAMIC = symbolFor("[[ai_frcDynCfg_1]]"); function _cfgDeepCopy(source) { if (source) { var target_1; if (isArray(source)) { target_1 = []; target_1[_DYN_LENGTH$5 ] = source[_DYN_LENGTH$5 ]; } else if (isPlainObject(source)) { target_1 = {}; } if (target_1) { objForEachKey(source, function (key, value) { target_1[key] = _cfgDeepCopy(value); }); return target_1; } } return source; } function getDynamicConfigHandler(value) { if (value) { var handler = value[CFG_HANDLER_LINK] || value; if (handler.cfg && (handler.cfg === value || handler.cfg[CFG_HANDLER_LINK] === handler)) { return handler; } } return null; } function blockDynamicConversion(value) { if (value && (isPlainObject(value) || isArray(value))) { try { value[BLOCK_DYNAMIC] = true; } catch (e) { } } return value; } function _canMakeDynamic(getFunc, state, value) { var result = false; if (value && !getFunc[state.blkVal]) { result = value[FORCE_DYNAMIC]; if (!result && !value[BLOCK_DYNAMIC]) { result = isPlainObject(value) || isArray(value); } } return result; } function throwInvalidAccess(message) { throwTypeError("InvalidAccess:" + message); } var arrayMethodsToPatch = [ "push", "pop", "shift", "unshift", "splice" ]; var _throwDynamicError = function (logger, name, desc, e) { logger && logger[_DYN_THROW_INTERNAL ](3 , 108 , "".concat(desc, " [").concat(name, "] failed - ") + dumpObj(e)); }; function _patchArray(state, target, name) { if (isArray(target)) { arrForEach(arrayMethodsToPatch, function (method) { var orgMethod = target[method]; target[method] = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var result = orgMethod[_DYN_APPLY ](this, args); _makeDynamicObject(state, target, name, "Patching"); return result; }; }); } } function _getOwnPropGetter(target, name) { var propDesc = objGetOwnPropertyDescriptor(target, name); return propDesc && propDesc.get; } function _createDynamicProperty(state, theConfig, name, value) { var detail = { n: name, h: [], trk: function (handler) { if (handler && handler.fn) { if (arrIndexOf(detail.h, handler) === -1) { detail.h[_DYN_PUSH$1 ](handler); } state.trk(handler, detail); } }, clr: function (handler) { var idx = arrIndexOf(detail.h, handler); if (idx !== -1) { detail.h[_DYN_SPLICE ](idx, 1); } } }; var checkDynamic = true; var isObjectOrArray = false; function _getProperty() { if (checkDynamic) { isObjectOrArray = isObjectOrArray || _canMakeDynamic(_getProperty, state, value); if (value && !value[CFG_HANDLER_LINK] && isObjectOrArray) { value = _makeDynamicObject(state, value, name, "Converting"); } checkDynamic = false; } var activeHandler = state.act; if (activeHandler) { detail.trk(activeHandler); } return value; } _getProperty[state.prop] = { chng: function () { state.add(detail); } }; function _setProperty(newValue) { if (value !== newValue) { if (!!_getProperty[state.ro] && !state.upd) { throwInvalidAccess("[" + name + "] is read-only:" + dumpObj(theConfig)); } if (checkDynamic) { isObjectOrArray = isObjectOrArray || _canMakeDynamic(_getProperty, state, value); checkDynamic = false; } var isReferenced = isObjectOrArray && _getProperty[state.rf]; if (isObjectOrArray) { if (isReferenced) { objForEachKey(value, function (key) { value[key] = newValue ? newValue[key] : UNDEFINED_VALUE$2; }); try { objForEachKey(newValue, function (key, theValue) { _setDynamicProperty(state, value, key, theValue); }); newValue = value; } catch (e) { _throwDynamicError((state.hdlr || {})[_DYN_LOGGER ], name, "Assigning", e); isObjectOrArray = false; } } else if (value && value[CFG_HANDLER_LINK]) { objForEachKey(value, function (key) { var getter = _getOwnPropGetter(value, key); if (getter) { var valueState = getter[state.prop]; valueState && valueState.chng(); } }); } } if (newValue !== value) { var newIsObjectOrArray = newValue && _canMakeDynamic(_getProperty, state, newValue); if (!isReferenced && newIsObjectOrArray) { newValue = _makeDynamicObject(state, newValue, name, "Converting"); } value = newValue; isObjectOrArray = newIsObjectOrArray; } state.add(detail); } } objDefine(theConfig, detail.n, { g: _getProperty, s: _setProperty }); } function _setDynamicProperty(state, target, name, value) { if (target) { var getter = _getOwnPropGetter(target, name); var isDynamic = getter && !!getter[state.prop]; if (!isDynamic) { _createDynamicProperty(state, target, name, value); } else { target[name] = value; } } return target; } function _setDynamicPropertyState(state, target, name, flags) { if (target) { var getter = _getOwnPropGetter(target, name); var isDynamic = getter && !!getter[state.prop]; var inPlace = flags && flags[0 ]; var rdOnly = flags && flags[1 ]; var blkProp = flags && flags[2 ]; if (!isDynamic) { if (blkProp) { try { blockDynamicConversion(target); } catch (e) { _throwDynamicError((state.hdlr || {})[_DYN_LOGGER ], name, "Blocking", e); } } try { _setDynamicProperty(state, target, name, target[name]); getter = _getOwnPropGetter(target, name); } catch (e) { _throwDynamicError((state.hdlr || {})[_DYN_LOGGER ], name, "State", e); } } if (inPlace) { getter[state.rf] = inPlace; } if (rdOnly) { getter[state.ro] = rdOnly; } if (blkProp) { getter[state.blkVal] = true; } } return target; } function _makeDynamicObject(state, target, name, desc) { try { objForEachKey(target, function (key, value) { _setDynamicProperty(state, target, key, value); }); if (!target[CFG_HANDLER_LINK]) { objDefineProp(target, CFG_HANDLER_LINK, { get: function () { return state[_DYN_HDLR ]; } }); _patchArray(state, target, name); } } catch (e) { _throwDynamicError((state.hdlr || {})[_DYN_LOGGER ], name, desc, e); } return target; } var symPrefix = "[[ai_"; var symPostfix = "]]"; function _createState(cfgHandler) { var _a; var dynamicPropertySymbol = newSymbol(symPrefix + "get" + cfgHandler.uid + symPostfix); var dynamicPropertyReadOnly = newSymbol(symPrefix + "ro" + cfgHandler.uid + symPostfix); var dynamicPropertyReferenced = newSymbol(symPrefix + "rf" + cfgHandler.uid + symPostfix); var dynamicPropertyBlockValue = newSymbol(symPrefix + "blkVal" + cfgHandler.uid + symPostfix); var dynamicPropertyDetail = newSymbol(symPrefix + "dtl" + cfgHandler.uid + symPostfix); var _waitingHandlers = null; var _watcherTimer = null; var theState; function _useHandler(activeHandler, callback) { var prevWatcher = theState.act; try { theState.act = activeHandler; if (activeHandler && activeHandler[dynamicPropertyDetail]) { arrForEach(activeHandler[dynamicPropertyDetail], function (detail) { detail.clr(activeHandler); }); activeHandler[dynamicPropertyDetail] = []; } callback({ cfg: cfgHandler.cfg, set: cfgHandler.set.bind(cfgHandler), setDf: cfgHandler[_DYN_SET_DF ].bind(cfgHandler), ref: cfgHandler.ref.bind(cfgHandler), rdOnly: cfgHandler[_DYN_RD_ONLY ].bind(cfgHandler) }); } catch (e) { var logger = cfgHandler[_DYN_LOGGER ]; if (logger) { logger[_DYN_THROW_INTERNAL ](1 , 107 , dumpObj(e)); } throw e; } finally { theState.act = prevWatcher || null; } } function _notifyWatchers() { if (_waitingHandlers) { var notifyHandlers = _waitingHandlers; _waitingHandlers = null; _watcherTimer && _watcherTimer[_DYN_CANCEL ](); _watcherTimer = null; var watcherFailures_1 = []; arrForEach(notifyHandlers, function (handler) { if (handler) { if (handler[dynamicPropertyDetail]) { arrForEach(handler[dynamicPropertyDetail], function (detail) { detail.clr(handler); }); handler[dynamicPropertyDetail] = null; } if (handler.fn) { try { _useHandler(handler, handler.fn); } catch (e) { watcherFailures_1[_DYN_PUSH$1 ](e); } } } }); if (_waitingHandlers) { try { _notifyWatchers(); } catch (e) { watcherFailures_1[_DYN_PUSH$1 ](e); } } if (watcherFailures_1[_DYN_LENGTH$5 ] > 0) { throwAggregationError("Watcher error(s): ", watcherFailures_1); } } } function _addWatcher(detail) { if (detail && detail.h[_DYN_LENGTH$5 ] > 0) { if (!_waitingHandlers) { _waitingHandlers = []; } if (!_watcherTimer) { _watcherTimer = scheduleTimeout(function () { _watcherTimer = null; _notifyWatchers(); }, 0); } for (var idx = 0; idx < detail.h[_DYN_LENGTH$5 ]; idx++) { var handler = detail.h[idx]; if (handler && arrIndexOf(_waitingHandlers, handler) === -1) { _waitingHandlers[_DYN_PUSH$1 ](handler); } } } } function _trackHandler(handler, detail) { if (handler) { var details = handler[dynamicPropertyDetail] = handler[dynamicPropertyDetail] || []; if (arrIndexOf(details, detail) === -1) { details[_DYN_PUSH$1 ](detail); } } } theState = (_a = { prop: dynamicPropertySymbol, ro: dynamicPropertyReadOnly, rf: dynamicPropertyReferenced }, _a[_DYN_BLK_VAL ] = dynamicPropertyBlockValue, _a[_DYN_HDLR ] = cfgHandler, _a.add = _addWatcher, _a[_DYN_NOTIFY ] = _notifyWatchers, _a.use = _useHandler, _a.trk = _trackHandler, _a); return theState; } function _createAndUseHandler(state, configHandler) { var handler = { fn: configHandler, rm: function () { handler.fn = null; state = null; configHandler = null; } }; state.use(handler, configHandler); return handler; } function _createDynamicHandler(logger, target, inPlace) { var _a; var dynamicHandler = getDynamicConfigHandler(target); if (dynamicHandler) { return dynamicHandler; } var uid = createUniqueNamespace("dyncfg", true); var newTarget = (target && inPlace !== false) ? target : _cfgDeepCopy(target); var theState; function _notifyWatchers() { theState[_DYN_NOTIFY ](); } function _setValue(target, name, value) { try { target = _setDynamicProperty(theState, target, name, value); } catch (e) { _throwDynamicError(logger, name, "Setting value", e); } return target[name]; } function _watch(configHandler) { return _createAndUseHandler(theState, configHandler); } function _block(configHandler, allowUpdate) { theState.use(null, function (details) { var prevUpd = theState.upd; try { if (!isUndefined(allowUpdate)) { theState.upd = allowUpdate; } configHandler(details); } finally { theState.upd = prevUpd; } }); } function _ref(target, name) { var _a; return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[0 ] = true, _a))[name]; } function _rdOnly(target, name) { var _a; return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[1 ] = true, _a))[name]; } function _blkPropValue(target, name) { var _a; return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[2 ] = true, _a))[name]; } function _applyDefaults(theConfig, defaultValues) { if (defaultValues) { objForEachKey(defaultValues, function (name, value) { _applyDefaultValue(cfgHandler, theConfig, name, value); }); } return theConfig; } var cfgHandler = (_a = { uid: null, cfg: newTarget }, _a[_DYN_LOGGER ] = logger, _a[_DYN_NOTIFY ] = _notifyWatchers, _a.set = _setValue, _a[_DYN_SET_DF ] = _applyDefaults, _a[_DYN_WATCH ] = _watch, _a.ref = _ref, _a[_DYN_RD_ONLY ] = _rdOnly, _a[_DYN_BLK_VAL ] = _blkPropValue, _a._block = _block, _a); objDefine(cfgHandler, "uid", { c: false, e: false, w: false, v: uid }); theState = _createState(cfgHandler); _makeDynamicObject(theState, newTarget, "config", "Creating"); return cfgHandler; } function _logInvalidAccess(logger, message) { if (logger) { logger[_DYN_WARN_TO_CONSOLE ](message); logger[_DYN_THROW_INTERNAL ](2 , 108 , message); } else { throwInvalidAccess(message); } } function createDynamicConfig(config, defaultConfig, logger, inPlace) { var dynamicHandler = _createDynamicHandler(logger, config || {}, inPlace); if (defaultConfig) { dynamicHandler[_DYN_SET_DF ](dynamicHandler.cfg, defaultConfig); } return dynamicHandler; } function onConfigChange(config, configHandler, logger) { var handler = config[CFG_HANDLER_LINK] || config; if (handler.cfg && (handler.cfg === config || handler.cfg[CFG_HANDLER_LINK] === handler)) { return handler[_DYN_WATCH ](configHandler); } _logInvalidAccess(logger, STR_NOT_DYNAMIC_ERROR + dumpObj(config)); return createDynamicConfig(config, null, logger)[_DYN_WATCH ](configHandler); } function runTargetUnload(target, isAsync) { if (target && target[_DYN_UNLOAD ]) { return target[_DYN_UNLOAD ](isAsync); } } function doUnloadAll(targets, isAsync, done) { var result; if (!done) { result = createPromise(function (resolved) { done = resolved; }); } if (targets && getLength(targets) > 0) { doAwaitResponse(runTargetUnload(targets[0], isAsync), function () { doUnloadAll(arrSlice(targets, 1), isAsync, done); }); } else { done(); } return result; } var ChannelControllerPriority = 500; function _stringToBoolOrDefault(theValue, defaultValue, theConfig) { if (!theValue && isNullOrUndefined(theValue)) { return defaultValue; } if (isBoolean(theValue)) { return theValue; } return asString(theValue)[_DYN_TO_LOWER_CASE$2 ]() === "true"; } function cfgDfMerge(defaultValue) { return { mrg: true, v: defaultValue }; } function cfgDfSet(setter, defaultValue) { return { set: setter, v: defaultValue }; } function cfgDfValidate(validator, defaultValue, fallBackName) { return { fb: fallBackName, isVal: validator, v: defaultValue }; } function cfgDfBoolean(defaultValue, fallBackName) { return { fb: fallBackName, set: _stringToBoolOrDefault, v: !!defaultValue }; } function cfgDfString(defaultValue) { return { isVal: isString, v: asString(defaultValue || STR_EMPTY) }; } var listenerFuncs = [STR_EVENTS_SENT, STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_PERF_EVENT]; var _aiNamespace = null; var _debugListener; function _listenerProxyFunc(name, config) { return function () { var args = arguments; var dbgExt = getDebugExt(config); if (dbgExt) { var listener = dbgExt.listener; if (listener && listener[name]) { listener[name][_DYN_APPLY ](listener, args); } } }; } function _getExtensionNamespace() { var target = getInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } function getDebugListener(config) { if (!_debugListener) { _debugListener = {}; for (var lp = 0; lp < listenerFuncs[_DYN_LENGTH$5 ]; lp++) { _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config); } } return _debugListener; } var _a$8; var STR_WARN_TO_CONSOLE = "warnToConsole"; var AiNonUserActionablePrefix = "AI (Internal): "; var AiUserActionablePrefix = "AI: "; var AIInternalMessagePrefix = "AITR_"; var defaultValues$3 = { loggingLevelConsole: 0, loggingLevelTelemetry: 1, maxMessageLimit: 25, enableDebug: false }; var _logFuncs = (_a$8 = {}, _a$8[0 ] = null, _a$8[1 ] = "errorToConsole", _a$8[2 ] = STR_WARN_TO_CONSOLE, _a$8[3 ] = "debugToConsole", _a$8); function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY) + "\""; } return STR_EMPTY; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self[_DYN_MESSAGE_ID ] = msgId; _self[_DYN_MESSAGE$2 ] = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = STR_EMPTY; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY); _self[_DYN_MESSAGE$2 ] += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); function safeGetLogger(core, config) { return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; this.queue = []; var _messageCount = 0; var _messageLogged = {}; var _loggingLevelConsole; var _loggingLevelTelemetry; var _maxInternalMessageLimit; var _enableDebug; var _unloadHandler; dynamicProto(DiagnosticLogger, this, function (_self) { _unloadHandler = _setDefaultsFromConfig(config || {}); _self.consoleLoggingLevel = function () { return _loggingLevelConsole; }; _self[_DYN_THROW_INTERNAL ] = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_enableDebug) { throw dumpObj(message); } else { var logFunc = _logFuncs[severity] || STR_WARN_TO_CONSOLE; if (!isUndefined(message[_DYN_MESSAGE$2 ])) { if (isUserAct) { var messageKey = +message[_DYN_MESSAGE_ID ]; if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) { _self[logFunc](message[_DYN_MESSAGE$2 ]); _messageLogged[messageKey] = true; } } else { if (_loggingLevelConsole >= severity) { _self[logFunc](message[_DYN_MESSAGE$2 ]); } } _logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message); } } }; _self.debugToConsole = function (message) { _logToConsole("debug", message); _debugExtMsg("warning", message); }; _self[_DYN_WARN_TO_CONSOLE ] = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; _self.errorToConsole = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; _self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage; _self[_DYN_UNLOAD ] = function (isAsync) { _unloadHandler && _unloadHandler.rm(); _unloadHandler = null; }; function _logInternalMessage(severity, message) { if (_areInternalMessagesThrottled()) { return; } var logMessage = true; var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID ]; if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { if (severity <= _loggingLevelTelemetry) { _self.queue[_DYN_PUSH$1 ](message); _messageCount++; _debugExtMsg((severity === 1 ? "error" : "warn"), message); } if (_messageCount === _maxInternalMessageLimit) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false); _self.queue[_DYN_PUSH$1 ](throttleMessage); if (severity === 1 ) { _self.errorToConsole(throttleLimitMessage); } else { _self[_DYN_WARN_TO_CONSOLE ](throttleLimitMessage); } } } } function _setDefaultsFromConfig(config) { return onConfigChange(createDynamicConfig(config, defaultValues$3, _self).cfg, function (details) { var config = details.cfg; _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 ]; _loggingLevelTelemetry = config.loggingLevelTelemetry; _maxInternalMessageLimit = config.maxMessageLimit; _enableDebug = config.enableDebug; }); } function _areInternalMessagesThrottled() { return _messageCount >= _maxInternalMessageLimit; } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config || {}); if (dbgExt && dbgExt[_DYN_DIAG_LOG$2 ]) { dbgExt[_DYN_DIAG_LOG$2 ](name, data); } } }); } DiagnosticLogger.__ieDyn=1; return DiagnosticLogger; }()); function _getLogger(logger) { return (logger || new DiagnosticLogger()); } function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } _getLogger(logger)[_DYN_THROW_INTERNAL ](severity, msgId, msg, properties, isUserAct); } function _warnToConsole(logger, message) { _getLogger(logger)[_DYN_WARN_TO_CONSOLE ](message); } function _logInternalMessage(logger, severity, message) { _getLogger(logger)[_DYN_LOG_INTERNAL_MESSAGE ](severity, message); } var _a$7, _b$1; var strToGMTString = "toGMTString"; var strToUTCString = "toUTCString"; var strCookie = "cookie"; var strExpires = "expires"; var strIsCookieUseDisabled = "isCookieUseDisabled"; var strDisableCookiesUsage = "disableCookiesUsage"; var strConfigCookieMgr = "_ckMgr"; var _supportsCookies = null; var _allowUaSameSite = null; var _parsedCookieValue = null; var _doc; var _cookieCache = {}; var _globalCookieConfig = {}; var rootDefaultConfig = (_a$7 = { cookieCfg: cfgDfMerge((_b$1 = {}, _b$1[STR_DOMAIN] = { fb: "cookieDomain", dfVal: isNotNullOrUndefined }, _b$1.path = { fb: "cookiePath", dfVal: isNotNullOrUndefined }, _b$1.enabled = UNDEFINED_VALUE$2, _b$1.ignoreCookies = UNDEFINED_VALUE$2, _b$1.blockedCookies = UNDEFINED_VALUE$2, _b$1)), cookieDomain: UNDEFINED_VALUE$2, cookiePath: UNDEFINED_VALUE$2 }, _a$7[strDisableCookiesUsage] = UNDEFINED_VALUE$2, _a$7); function _getDoc() { !_doc && (_doc = getLazy(function () { return getDocument(); })); } function _gblCookieMgr(config, logger) { var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr]; if (!inst) { inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger); _globalCookieConfig[strConfigCookieMgr] = inst; } return inst; } function _isMgrEnabled(cookieMgr) { if (cookieMgr) { return cookieMgr.isEnabled(); } return true; } function _isIgnoredCookie(cookieMgrCfg, name) { if (name && cookieMgrCfg && isArray(cookieMgrCfg.ignoreCookies)) { return arrIndexOf(cookieMgrCfg.ignoreCookies, name) !== -1; } return false; } function _isBlockedCookie(cookieMgrCfg, name) { if (name && cookieMgrCfg && isArray(cookieMgrCfg.blockedCookies)) { if (arrIndexOf(cookieMgrCfg.blockedCookies, name) !== -1) { return true; } } return _isIgnoredCookie(cookieMgrCfg, name); } function _isCfgEnabled(rootConfig, cookieMgrConfig) { var isCfgEnabled = cookieMgrConfig[_DYN_ENABLED ]; if (isNullOrUndefined(isCfgEnabled)) { var cookieEnabled = void 0; if (!isUndefined(rootConfig[strIsCookieUseDisabled])) { cookieEnabled = !rootConfig[strIsCookieUseDisabled]; } if (!isUndefined(rootConfig[strDisableCookiesUsage])) { cookieEnabled = !rootConfig[strDisableCookiesUsage]; } isCfgEnabled = cookieEnabled; } return isCfgEnabled; } function safeGetCookieMgr(core, config) { var cookieMgr; if (core) { cookieMgr = core.getCookieMgr(); } else if (config) { var cookieCfg = config.cookieCfg; if (cookieCfg && cookieCfg[strConfigCookieMgr]) { cookieMgr = cookieCfg[strConfigCookieMgr]; } else { cookieMgr = createCookieMgr(config); } } if (!cookieMgr) { cookieMgr = _gblCookieMgr(config, (core || {})[_DYN_LOGGER ]); } return cookieMgr; } function createCookieMgr(rootConfig, logger) { var _a; var cookieMgrConfig; var _path; var _domain; var unloadHandler; var _enabled; var _getCookieFn; var _setCookieFn; var _delCookieFn; rootConfig = createDynamicConfig(rootConfig || _globalCookieConfig, null, logger).cfg; unloadHandler = onConfigChange(rootConfig, function (details) { details[_DYN_SET_DF ](details.cfg, rootDefaultConfig); cookieMgrConfig = details.ref(details.cfg, "cookieCfg"); _path = cookieMgrConfig[STR_PATH ] || "/"; _domain = cookieMgrConfig[STR_DOMAIN ]; _enabled = _isCfgEnabled(rootConfig, cookieMgrConfig) !== false; _getCookieFn = cookieMgrConfig.getCookie || _getCookieValue; _setCookieFn = cookieMgrConfig.setCookie || _setCookieValue; _delCookieFn = cookieMgrConfig.delCookie || _setCookieValue; }, logger); var cookieMgr = (_a = { isEnabled: function () { var enabled = _isCfgEnabled(rootConfig, cookieMgrConfig) !== false && _enabled && areCookiesSupported(logger); var gblManager = _globalCookieConfig[strConfigCookieMgr]; if (enabled && gblManager && cookieMgr !== gblManager) { enabled = _isMgrEnabled(gblManager); } return enabled; }, setEnabled: function (value) { _enabled = value !== false; cookieMgrConfig[_DYN_ENABLED ] = value; }, set: function (name, value, maxAgeSec, domain, path) { var result = false; if (_isMgrEnabled(cookieMgr) && !_isBlockedCookie(cookieMgrConfig, name)) { var values = {}; var theValue = strTrim(value || STR_EMPTY); var idx = strIndexOf(theValue, ";"); if (idx !== -1) { theValue = strTrim(strLeft(value, idx)); values = _extractParts(strSubstring(value, idx + 1)); } setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined); if (!isNullOrUndefined(maxAgeSec)) { var _isIE = isIE(); if (isUndefined(values[strExpires])) { var nowMs = utcNow(); var expireMs = nowMs + (maxAgeSec * 1000); if (expireMs > 0) { var expiry = new Date(); expiry.setTime(expireMs); setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy); } } if (!_isIE) { setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined); } } var location_1 = getLocation(); if (location_1 && location_1.protocol === "https:") { setValue(values, "secure", null, null, isUndefined); if (_allowUaSameSite === null) { _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]); } if (_allowUaSameSite) { setValue(values, "SameSite", "None", null, isUndefined); } } setValue(values, STR_PATH, path || _path, null, isUndefined); _setCookieFn(name, _formatCookieValue(theValue, values)); result = true; } return result; }, get: function (name) { var value = STR_EMPTY; if (_isMgrEnabled(cookieMgr) && !_isIgnoredCookie(cookieMgrConfig, name)) { value = _getCookieFn(name); } return value; }, del: function (name, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { result = cookieMgr.purge(name, path); } return result; }, purge: function (name, path) { var _a; var result = false; if (areCookiesSupported(logger)) { var values = (_a = {}, _a[STR_PATH] = path ? path : "/", _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT", _a); if (!isIE()) { values["max-age"] = "0"; } _delCookieFn(name, _formatCookieValue(STR_EMPTY, values)); result = true; } return result; } }, _a[_DYN_UNLOAD ] = function (isAsync) { unloadHandler && unloadHandler.rm(); unloadHandler = null; }, _a); cookieMgr[strConfigCookieMgr] = cookieMgr; return cookieMgr; } function areCookiesSupported(logger) { if (_supportsCookies === null) { _supportsCookies = false; !_doc && _getDoc(); try { var doc = _doc.v || {}; _supportsCookies = doc[strCookie] !== undefined; } catch (e) { _throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) }); } } return _supportsCookies; } function _extractParts(theValue) { var values = {}; if (theValue && theValue[_DYN_LENGTH$5 ]) { var parts = strTrim(theValue)[_DYN_SPLIT$1 ](";"); arrForEach(parts, function (thePart) { thePart = strTrim(thePart || STR_EMPTY); if (thePart) { var idx = strIndexOf(thePart, "="); if (idx === -1) { values[thePart] = null; } else { values[strTrim(strLeft(thePart, idx))] = strTrim(strSubstring(thePart, idx + 1)); } } }); } return values; } function _formatDate(theDate, func) { if (isFunction(theDate[func])) { return theDate[func](); } return null; } function _formatCookieValue(value, values) { var cookieValue = value || STR_EMPTY; objForEachKey(values, function (name, theValue) { cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : STR_EMPTY); }); return cookieValue; } function _getCookieValue(name) { var cookieValue = STR_EMPTY; !_doc && _getDoc(); if (_doc.v) { var theCookie = _doc.v[strCookie] || STR_EMPTY; if (_parsedCookieValue !== theCookie) { _cookieCache = _extractParts(theCookie); _parsedCookieValue = theCookie; } cookieValue = strTrim(_cookieCache[name] || STR_EMPTY); } return cookieValue; } function _setCookieValue(name, cookieValue) { !_doc && _getDoc(); if (_doc.v) { _doc.v[strCookie] = name + "=" + cookieValue; } } function uaDisallowsSameSiteNone(userAgent) { if (!isString(userAgent)) { return false; } if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) { return true; } if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) { return true; } if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) { return true; } if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) { return true; } return false; } var defaultValues$2 = { perfEvtsSendAll: false }; function _runListeners(listeners, name, isAsync, callback) { arrForEach(listeners, function (listener) { if (listener && listener[name]) { if (isAsync) { scheduleTimeout(function () { return callback(listener); }, 0); } else { try { callback(listener); } catch (e) { } } } }); } var NotificationManager = /** @class */ (function () { function NotificationManager(config) { this.listeners = []; var perfEvtsSendAll; var unloadHandler; var _listeners = []; var cfgHandler = createDynamicConfig(config, defaultValues$2); unloadHandler = cfgHandler[_DYN_WATCH ](function (details) { perfEvtsSendAll = !!details.cfg.perfEvtsSendAll; }); dynamicProto(NotificationManager, this, function (_self) { objDefine(_self, "listeners", { g: function () { return _listeners; } }); _self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) { _listeners[_DYN_PUSH$1 ](listener); }; _self[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) { var index = arrIndexOf(_listeners, listener); while (index > -1) { _listeners[_DYN_SPLICE ](index, 1); index = arrIndexOf(_listeners, listener); } }; _self[STR_EVENTS_SENT ] = function (events) { _runListeners(_listeners, STR_EVENTS_SENT, true, function (listener) { listener[STR_EVENTS_SENT ](events); }); }; _self[STR_EVENTS_DISCARDED ] = function (events, reason) { _runListeners(_listeners, STR_EVENTS_DISCARDED, true, function (listener) { listener[STR_EVENTS_DISCARDED ](events, reason); }); }; _self[STR_EVENTS_SEND_REQUEST ] = function (sendReason, isAsync) { _runListeners(_listeners, STR_EVENTS_SEND_REQUEST, isAsync, function (listener) { listener[STR_EVENTS_SEND_REQUEST ](sendReason, isAsync); }); }; _self[STR_PERF_EVENT ] = function (perfEvent) { if (perfEvent) { if (perfEvtsSendAll || !perfEvent[_DYN_IS_CHILD_EVT ]()) { _runListeners(_listeners, STR_PERF_EVENT, false, function (listener) { if (perfEvent[_DYN_IS_ASYNC ]) { scheduleTimeout(function () { return listener[STR_PERF_EVENT ](perfEvent); }, 0); } else { listener[STR_PERF_EVENT ](perfEvent); } }); } } }; _self[_DYN_UNLOAD ] = function (isAsync) { var _finishUnload = function () { unloadHandler && unloadHandler.rm(); unloadHandler = null; _listeners = []; }; var waiting; _runListeners(_listeners, "unload", false, function (listener) { var asyncUnload = listener[_DYN_UNLOAD ](isAsync); if (asyncUnload) { if (!waiting) { waiting = []; } waiting[_DYN_PUSH$1 ](asyncUnload); } }); if (waiting) { return createPromise(function (resolve) { return doAwaitResponse(createAllPromise(waiting), function () { _finishUnload(); resolve(); }); }); } else { _finishUnload(); } }; }); } NotificationManager.__ieDyn=1; return NotificationManager; }()); var strExecutionContextKey = "ctx"; var strParentContextKey = "ParentContextKey"; var strChildrenContextKey = "ChildrenContextKey"; var _defaultPerfManager = null; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; _self.start = utcNow(); _self[_DYN_NAME$3 ] = name; _self[_DYN_IS_ASYNC ] = isAsync; _self[_DYN_IS_CHILD_EVT ] = function () { return false; }; if (isFunction(payloadDetails)) { var theDetails_1; objDefine(_self, "payload", { g: function () { if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); payloadDetails = null; } return theDetails_1; } }); } _self[_DYN_GET_CTX ] = function (key) { if (key) { if (key === PerfEvent[strParentContextKey] || key === PerfEvent[strChildrenContextKey]) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self[_DYN_SET_CTX ] = function (key, value) { if (key) { if (key === PerfEvent[strParentContextKey]) { if (!_self[key]) { _self[_DYN_IS_CHILD_EVT ] = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent[strChildrenContextKey]) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self[_DYN_COMPLETE ] = function () { var childTime = 0; var childEvts = _self[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts[_DYN_LENGTH$5 ]; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt[_DYN_TIME ]; } } } _self[_DYN_TIME ] = utcNow() - _self.start; _self.exTime = _self[_DYN_TIME ] - childTime; _self[_DYN_COMPLETE ] = function () { }; }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); var PerfManager = /** @class */ (function () { function PerfManager(manager) { this.ctx = {}; dynamicProto(PerfManager, this, function (_self) { _self.create = function (src, payloadDetails, isAsync) { return new PerfEvent(src, payloadDetails, isAsync); }; _self.fire = function (perfEvent) { if (perfEvent) { perfEvent[_DYN_COMPLETE ](); if (manager && isFunction(manager[STR_PERF_EVENT ])) { manager[STR_PERF_EVENT ](perfEvent); } } }; _self[_DYN_SET_CTX ] = function (key, value) { if (key) { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } }; _self[_DYN_GET_CTX ] = function (key) { return (_self[strExecutionContextKey] || {})[key]; }; }); } PerfManager.__ieDyn=1; return PerfManager; }()); var doPerfActiveKey = "CoreUtils.doPerf"; function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (perfMgr[STR_GET_PERF_MGR]) { perfMgr = perfMgr[STR_GET_PERF_MGR](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr[_DYN_GET_CTX ](doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt[_DYN_SET_CTX ]) { perfEvt[_DYN_SET_CTX ](PerfEvent[strParentContextKey], currentActive); if (currentActive[_DYN_GET_CTX ] && currentActive[_DYN_SET_CTX ]) { var children = currentActive[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]); if (!children) { children = []; currentActive[_DYN_SET_CTX ](PerfEvent[strChildrenContextKey], children); } children[_DYN_PUSH$1 ](perfEvt); } } perfMgr[_DYN_SET_CTX ](doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt[_DYN_SET_CTX ]) { perfEvt[_DYN_SET_CTX ]("exception", ex); } } finally { if (perfEvt) { perfMgr.fire(perfEvt); } perfMgr[_DYN_SET_CTX ](doPerfActiveKey, currentActive); } } } return func(); } function getGblPerfMgr() { return _defaultPerfManager; } function generateW3CId() { var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; var oct = STR_EMPTY, tmp; for (var a = 0; a < 4; a++) { tmp = random32(); oct += hexValues[tmp & 0xF] + hexValues[tmp >> 4 & 0xF] + hexValues[tmp >> 8 & 0xF] + hexValues[tmp >> 12 & 0xF] + hexValues[tmp >> 16 & 0xF] + hexValues[tmp >> 20 & 0xF] + hexValues[tmp >> 24 & 0xF] + hexValues[tmp >> 28 & 0xF]; } var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0]; return strSubstr(oct, 0, 8) + strSubstr(oct, 9, 4) + "4" + strSubstr(oct, 13, 3) + clockSequenceHi + strSubstr(oct, 16, 3) + strSubstr(oct, 19, 12); } var DEFAULT_VERSION = "00"; var INVALID_VERSION = "ff"; var INVALID_TRACE_ID = "00000000000000000000000000000000"; var INVALID_SPAN_ID = "0000000000000000"; function _isValid(value, len, invalidValue) { if (value && value[_DYN_LENGTH$5 ] === len && value !== invalidValue) { return !!value.match(/^[\da-f]*$/i); } return false; } function _formatValue(value, len, defValue) { if (_isValid(value, len)) { return value; } return defValue; } function _formatFlags(value) { if (isNaN(value) || value < 0 || value > 255) { value = 0x01; } var result = value.toString(16); while (result[_DYN_LENGTH$5 ] < 2) { result = "0" + result; } return result; } function createTraceParent(traceId, spanId, flags, version) { var _a; return _a = {}, _a[_DYN_VERSION$1 ] = _isValid(version, 2, INVALID_VERSION) ? version : DEFAULT_VERSION, _a[_DYN_TRACE_ID$2 ] = isValidTraceId(traceId) ? traceId : generateW3CId(), _a[_DYN_SPAN_ID$1 ] = isValidSpanId(spanId) ? spanId : strLeft(generateW3CId(), 16), _a.traceFlags = flags >= 0 && flags <= 0xFF ? flags : 1, _a; } function isValidTraceId(value) { return _isValid(value, 32, INVALID_TRACE_ID); } function isValidSpanId(value) { return _isValid(value, 16, INVALID_SPAN_ID); } function formatTraceParent(value) { if (value) { var flags = _formatFlags(value[_DYN_TRACE_FLAGS$1 ]); if (!_isValid(flags, 2)) { flags = "01"; } var version = value[_DYN_VERSION$1 ] || DEFAULT_VERSION; if (version !== "00" && version !== "ff") { version = DEFAULT_VERSION; } return "".concat(version.toLowerCase(), "-").concat(_formatValue(value.traceId, 32, INVALID_TRACE_ID).toLowerCase(), "-").concat(_formatValue(value.spanId, 16, INVALID_SPAN_ID).toLowerCase(), "-").concat(flags.toLowerCase()); } return ""; } var pluginStateData = createElmNodeData("plugin"); function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } function initializePlugins(processContext, extensions) { var initPlugins = []; var lastPlugin = null; var proxy = processContext[_DYN_GET_NEXT ](); var pluginState; while (proxy) { var thePlugin = proxy[_DYN_GET_PLUGIN ](); if (thePlugin) { if (lastPlugin && lastPlugin[_DYN_SET_NEXT_PLUGIN ] && thePlugin[STR_PROCESS_TELEMETRY ]) { lastPlugin[_DYN_SET_NEXT_PLUGIN ](thePlugin); } pluginState = _getPluginState(thePlugin); var isInitialized = !!pluginState[_DYN_IS_INITIALIZED ]; if (thePlugin[_DYN_IS_INITIALIZED ]) { isInitialized = thePlugin[_DYN_IS_INITIALIZED ](); } if (!isInitialized) { initPlugins[_DYN_PUSH$1 ](thePlugin); } lastPlugin = thePlugin; proxy = proxy[_DYN_GET_NEXT ](); } } arrForEach(initPlugins, function (thePlugin) { var core = processContext[STR_CORE ](); thePlugin[_DYN_INITIALIZE ](processContext.getCfg(), core, extensions, processContext[_DYN_GET_NEXT ]()); pluginState = _getPluginState(thePlugin); if (!thePlugin[STR_CORE] && !pluginState[STR_CORE]) { pluginState[STR_CORE] = core; } pluginState[_DYN_IS_INITIALIZED ] = true; delete pluginState[_DYN_TEARDOWN ]; }); } function sortPlugins(plugins) { return plugins.sort(function (extA, extB) { var result = 0; if (extB) { var bHasProcess = extB[STR_PROCESS_TELEMETRY]; if (extA[STR_PROCESS_TELEMETRY]) { result = bHasProcess ? extA[STR_PRIORITY] - extB[STR_PRIORITY] : 1; } else if (bHasProcess) { result = -1; } } else { result = extA ? 1 : -1; } return result; }); } function createDistributedTraceContext(parentCtx) { var trace = {}; return { getName: function () { return trace[_DYN_NAME$3 ]; }, setName: function (newValue) { parentCtx && parentCtx.setName(newValue); trace[_DYN_NAME$3 ] = newValue; }, getTraceId: function () { return trace[_DYN_TRACE_ID$2 ]; }, setTraceId: function (newValue) { parentCtx && parentCtx.setTraceId(newValue); if (isValidTraceId(newValue)) { trace[_DYN_TRACE_ID$2 ] = newValue; } }, getSpanId: function () { return trace[_DYN_SPAN_ID$1 ]; }, setSpanId: function (newValue) { parentCtx && parentCtx.setSpanId(newValue); if (isValidSpanId(newValue)) { trace[_DYN_SPAN_ID$1 ] = newValue; } }, getTraceFlags: function () { return trace[_DYN_TRACE_FLAGS$1 ]; }, setTraceFlags: function (newTraceFlags) { parentCtx && parentCtx.setTraceFlags(newTraceFlags); trace[_DYN_TRACE_FLAGS$1 ] = newTraceFlags; } }; } var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy[_DYN_GET_PLUGIN ]() === startAt) { return proxy; } proxy = proxy[_DYN_GET_NEXT ](); } return createTelemetryProxyChain([startAt], core.config || {}, core); } function _createInternalContext(telemetryChain, dynamicHandler, core, startAt) { var _nextProxy = null; var _onComplete = []; if (!dynamicHandler) { dynamicHandler = createDynamicConfig({}, null, core[_DYN_LOGGER ]); } if (startAt !== null) { _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, dynamicHandler.cfg); }, getCfg: function () { return dynamicHandler.cfg; }, getExtCfg: _resolveExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete[_DYN_PUSH$1 ]({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; _nextProxy = nextProxy ? nextProxy[_DYN_GET_NEXT ]() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete[_DYN_LENGTH$5 ] > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func.call(completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core[_DYN_LOGGER ], 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, createIfMissing) { var idCfg = null; var cfg = dynamicHandler.cfg; if (cfg && identifier) { var extCfg = cfg[STR_EXTENSION_CONFIG ]; if (!extCfg && createIfMissing) { extCfg = {}; } cfg[STR_EXTENSION_CONFIG] = extCfg; extCfg = dynamicHandler.ref(cfg, STR_EXTENSION_CONFIG); if (extCfg) { idCfg = extCfg[identifier]; if (!idCfg && createIfMissing) { idCfg = {}; } extCfg[identifier] = idCfg; idCfg = dynamicHandler.ref(extCfg, identifier); } } return idCfg; } function _resolveExtCfg(identifier, defaultValues) { var newConfig = _getExtCfg(identifier, true); if (defaultValues) { objForEachKey(defaultValues, function (field, defaultValue) { if (isNullOrUndefined(newConfig[field])) { var cfgValue = dynamicHandler.cfg[field]; if (cfgValue || !isNullOrUndefined(cfgValue)) { newConfig[field] = cfgValue; } } _applyDefaultValue(dynamicHandler, newConfig, field, defaultValue); }); } return dynamicHandler[_DYN_SET_DF ](newConfig, defaultValues); } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, false); var rootConfig = dynamicHandler.cfg; if (extConfig && (extConfig[field] || !isNullOrUndefined(extConfig[field]))) { theValue = extConfig[field]; } else if (rootConfig[field] || !isNullOrUndefined(rootConfig[field])) { theValue = rootConfig[field]; } return (theValue || !isNullOrUndefined(theValue)) ? theValue : defaultValue; } function _iterateChain(cb) { var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin[_DYN_GET_PLUGIN ](); if (plugin) { cb(plugin); } } } return context; } function createProcessTelemetryContext(telemetryChain, cfg, core, startAt) { var config = createDynamicConfig(cfg); var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); if (nextPlugin) { nextPlugin[STR_PROCESS_TELEMETRY ](env, context); } return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt); } return createProcessTelemetryContext(plugins || context[_DYN_GET_NEXT ](), config.cfg, core, startAt); } context[_DYN_PROCESS_NEXT ] = _processNext; context[_DYN_CREATE_NEW$1 ] = _createNew; return context; } function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = createDynamicConfig(core.config); var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin[_DYN_UNLOAD ](context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context[_DYN_GET_NEXT ](), core, startAt); } context[_DYN_PROCESS_NEXT ] = _processNext; context[_DYN_CREATE_NEW$1 ] = _createNew; return context; } function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = createDynamicConfig(core.config); var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin[_DYN_UPDATE$1 ])) { plugin[_DYN_UPDATE$1 ](context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context[_DYN_GET_NEXT ](), core, startAt); } context[_DYN_PROCESS_NEXT ] = _processNext; context[_DYN_CREATE_NEW$1 ] = _createNew; return context; } function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins[_DYN_LENGTH$5 ] > 0) { var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin[STR_PROCESS_TELEMETRY ])) { var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin[STR_PROCESS_TELEMETRY ]); var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN ]); var chainId; if (plugin) { chainId = plugin[_DYN_IDENTIFIER ] + "-" + plugin[STR_PRIORITY ] + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; if (plugin && isFunction(plugin[strGetTelCtx])) { itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin[_DYN_IDENTIFIER ] : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { hasRunContext = itemCtx[strHasRunFlags] = {}; } itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[STR_CORE ](), function () { return identifier + ":" + name; }, function () { hasRunContext[chainId] = true; try { var nextId = nextProxy ? nextProxy._id : STR_EMPTY; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { hasRun = true; } if (!nextProxy || !hasNextRun) { _throwInternal(itemCtx[_DYN_DIAG_LOG$2 ](), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState[_DYN_TEARDOWN ] || pluginState[STR_DISABLED]) { return false; } if (hasSetNext) { plugin[_DYN_SET_NEXT_PLUGIN ](nextProxy); } plugin[STR_PROCESS_TELEMETRY ](env, itemCtx); return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { itemCtx[_DYN_PROCESS_NEXT ](env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE ]; if (plugin && (!pluginCore || pluginCore === unloadCtx.core()) && !pluginState[_DYN_TEARDOWN ]) { pluginState[STR_CORE ] = null; pluginState[_DYN_TEARDOWN ] = true; pluginState[_DYN_IS_INITIALIZED ] = false; if (plugin[_DYN_TEARDOWN ] && plugin[_DYN_TEARDOWN ](unloadCtx, unloadState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState[_DYN_IS_ASYNC ])) { unloadCtx[_DYN_PROCESS_NEXT ](unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE ]; if (plugin && (!pluginCore || pluginCore === updateCtx.core()) && !pluginState[_DYN_TEARDOWN ]) { if (plugin[_DYN_UPDATE$1 ] && plugin[_DYN_UPDATE$1 ](updateCtx, updateState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { updateCtx[_DYN_PROCESS_NEXT ](updateState); } } return objFreeze(proxyChain); } function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers[_DYN_PUSH$1 ](handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx[_DYN_DIAG_LOG$2 ](), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } function createUnloadHookContainer() { var _hooks = []; function _doUnload(logger) { var oldHooks = _hooks; _hooks = []; arrForEach(oldHooks, function (fn) { try { (fn.rm || fn.remove).call(fn); } catch (e) { _throwInternal(logger, 2 , 73 , "Unloading:" + dumpObj(e)); } }); } function _addHook(hooks) { if (hooks) { arrAppend(_hooks, hooks); } } return { run: _doUnload, add: _addHook }; } var _a$6; var strGetPlugin = "getPlugin"; var defaultValues$1 = (_a$6 = {}, _a$6[STR_EXTENSION_CONFIG] = { isVal: isNotNullOrUndefined, v: {} }, _a$6); var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; var _isinitialized; var _rootCtx; var _nextPlugin; var _unloadHandlerContainer; var _hookContainer; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self[_DYN_INITIALIZE ] = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self[_DYN_TEARDOWN ] = function (unloadCtx, unloadState) { var _a; var core = _self[STR_CORE ]; if (!core || (unloadCtx && core !== unloadCtx[STR_CORE ]())) { return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || (_a = { reason: 0 }, _a[_DYN_IS_ASYNC ] = false, _a); function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); _hookContainer.run(theUnloadCtx[_DYN_DIAG_LOG$2 ]()); if (result === true) { theUnloadCtx[_DYN_PROCESS_NEXT ](theUnloadState); } _initDefaults(); } } if (!_self[_DYN__DO_TEARDOWN ] || _self[_DYN__DO_TEARDOWN ](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { result = true; } return result; }; _self[_DYN_UPDATE$1 ] = function (updateCtx, updateState) { var core = _self[STR_CORE ]; if (!core || (updateCtx && core !== updateCtx[STR_CORE ]())) { return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx[_DYN_GET_NEXT ]()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); proxyFunctionAs(_self, "_addHook", function () { return _hookContainer; }, "add"); objDefine(_self, "_unloadHooks", { g: function () { return _hookContainer; } }); }); _self[_DYN_DIAG_LOG$2 ] = function (itemCtx) { return _getTelCtx(itemCtx)[_DYN_DIAG_LOG$2 ](); }; _self[_DYN_IS_INITIALIZED ] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; _self[_DYN_SET_NEXT_PLUGIN ] = function (next) { _nextPlugin = next; }; _self[_DYN_PROCESS_NEXT ] = function (env, itemCtx) { if (itemCtx) { itemCtx[_DYN_PROCESS_NEXT ](env); } else if (_nextPlugin && isFunction(_nextPlugin[STR_PROCESS_TELEMETRY ])) { _nextPlugin[STR_PROCESS_TELEMETRY ](env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self[STR_CORE ]); if (_nextPlugin && _nextPlugin[strGetPlugin]) { itemCtx = rootCtx[_DYN_CREATE_NEW$1 ](null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx[_DYN_CREATE_NEW$1 ](null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { createDynamicConfig(config, defaultValues$1, safeGetLogger(core)); if (!pluginChain && core) { pluginChain = core[_DYN_GET_PROCESS_TEL_CONT0 ]()[_DYN_GET_NEXT ](); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { nextPlugin = _nextPlugin[strGetPlugin](); } _self[STR_CORE ] = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self[STR_CORE ] = null; _rootCtx = null; _nextPlugin = null; _hookContainer = createUnloadHookContainer(); _unloadHandlerContainer = createUnloadHandlerContainer(); } } BaseTelemetryPlugin.__ieDyn=1; return BaseTelemetryPlugin; }()); function _addInitializer(_initializers, id, telemetryInitializer) { var theInitializer = { id: id, fn: telemetryInitializer }; arrAppend(_initializers, theInitializer); var handler = { remove: function () { arrForEach(_initializers, function (initializer, idx) { if (initializer.id === theInitializer.id) { _initializers[_DYN_SPLICE ](idx, 1); return -1; } }); } }; return handler; } function _runInitializers(_initializers, item, logger) { var doNotSendItem = false; var telemetryInitializersCount = _initializers[_DYN_LENGTH$5 ]; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = _initializers[i]; if (telemetryInitializer) { try { if (telemetryInitializer.fn[_DYN_APPLY ](null, [item]) === false) { doNotSendItem = true; break; } } catch (e) { _throwInternal(logger, 2 , 64 , "Telemetry initializer failed: " + getExceptionName(e), { exception: dumpObj(e) }, true); } } } return !doNotSendItem; } var TelemetryInitializerPlugin = /** @class */ (function (_super) { __extendsFn(TelemetryInitializerPlugin, _super); function TelemetryInitializerPlugin() { var _this = _super.call(this) || this; _this.identifier = "TelemetryInitializerPlugin"; _this.priority = 199; var _id; var _initializers; _initDefaults(); dynamicProto(TelemetryInitializerPlugin, _this, function (_self, _base) { _self.addTelemetryInitializer = function (telemetryInitializer) { return _addInitializer(_initializers, _id++, telemetryInitializer); }; _self[STR_PROCESS_TELEMETRY ] = function (item, itemCtx) { if (_runInitializers(_initializers, item, itemCtx ? itemCtx[_DYN_DIAG_LOG$2 ]() : _self[_DYN_DIAG_LOG$2 ]())) { _self[_DYN_PROCESS_NEXT ](item, itemCtx); } }; _self[_DYN__DO_TEARDOWN ] = function () { _initDefaults(); }; }); function _initDefaults() { _id = 0; _initializers = []; } return _this; } TelemetryInitializerPlugin.__ieDyn=1; return TelemetryInitializerPlugin; }(BaseTelemetryPlugin)); var _a$5; var strValidationError = "Plugins must provide initialize method"; var strNotificationManager = "_notificationManager"; var strSdkUnloadingError = "SDK is still unloading..."; var strSdkNotInitialized = "SDK is not initialized"; var defaultConfig = objDeepFreeze((_a$5 = { cookieCfg: {} }, _a$5[STR_EXTENSIONS] = { rdOnly: true, ref: true, v: [] }, _a$5[STR_CHANNELS] = { rdOnly: true, ref: true, v: [] }, _a$5[STR_EXTENSION_CONFIG] = { ref: true, v: {} }, _a$5[STR_CREATE_PERF_MGR] = UNDEFINED_VALUE$2, _a$5.loggingLevelConsole = 0 , _a$5.diagnosticLogInterval = UNDEFINED_VALUE$2, _a$5)); function _createPerfManager(core, notificationMgr) { return new PerfManager(notificationMgr); } function _validateExtensions(logger, channelPriority, allExtensions) { var _a; var coreExtensions = []; var channels = []; var extPriorities = {}; arrForEach(allExtensions, function (ext) { if (isNullOrUndefined(ext) || isNullOrUndefined(ext[_DYN_INITIALIZE ])) { throwError(strValidationError); } var extPriority = ext[STR_PRIORITY ]; var identifier = ext[_DYN_IDENTIFIER ]; if (ext && extPriority) { if (!isNullOrUndefined(extPriorities[extPriority])) { _warnToConsole(logger, "Two extensions have same priority #" + extPriority + " - " + extPriorities[extPriority] + ", " + identifier); } else { extPriorities[extPriority] = identifier; } } if (!extPriority || extPriority < channelPriority) { coreExtensions[_DYN_PUSH$1 ](ext); } else { channels[_DYN_PUSH$1 ](ext); } }); return _a = {}, _a[STR_CORE ] = coreExtensions, _a[STR_CHANNELS ] = channels, _a; } function _isPluginPresent(thePlugin, plugins) { var exists = false; arrForEach(plugins, function (plugin) { if (plugin === thePlugin) { exists = true; return -1; } }); return exists; } function _deepMergeConfig(details, target, newValues, merge) { if (newValues) { objForEachKey(newValues, function (key, value) { if (merge) { if (isPlainObject(value) && isPlainObject(target[key])) { _deepMergeConfig(details, target[key], value, merge); } } if (merge && isPlainObject(value) && isPlainObject(target[key])) { _deepMergeConfig(details, target[key], value, merge); } else { details.set(target, key, value); } }); } } function _findWatcher(listeners, newWatcher) { var theListener = null; var idx = -1; arrForEach(listeners, function (listener, lp) { if (listener.w === newWatcher) { theListener = listener; idx = lp; return -1; } }); return { i: idx, l: theListener }; } function _addDelayedCfgListener(listeners, newWatcher) { var theListener = _findWatcher(listeners, newWatcher).l; if (!theListener) { theListener = { w: newWatcher, rm: function () { var fnd = _findWatcher(listeners, newWatcher); if (fnd.i !== -1) { listeners[_DYN_SPLICE ](fnd.i, 1); } } }; listeners[_DYN_PUSH$1 ](theListener); } return theListener; } function _registerDelayedCfgListener(config, listeners, logger) { arrForEach(listeners, function (listener) { var unloadHdl = onConfigChange(config, listener.w, logger); delete listener.w; listener.rm = function () { unloadHdl.rm(); }; }); } var AppInsightsCore = /** @class */ (function () { function AppInsightsCore() { var _configHandler; var _isInitialized; var _logger; var _eventQueue; var _notificationManager; var _perfManager; var _cfgPerfManager; var _cookieManager; var _pluginChain; var _configExtensions; var _channelConfig; var _channels; var _isUnloading; var _telemetryInitializerPlugin; var _internalLogsEventName; var _evtNamespace; var _unloadHandlers; var _hookContainer; var _debugListener; var _traceCtx; var _instrumentationKey; var _cfgListeners; var _extensions; var _pluginVersionStringArr; var _pluginVersionString; var _internalLogPoller; var _internalLogPollerListening; var _forceStopInternalLogPoller; dynamicProto(AppInsightsCore, this, function (_self) { _initDefaults(); _self["_getDbgPlgTargets"] = function () { return [_extensions]; }; _self[_DYN_IS_INITIALIZED ] = function () { return _isInitialized; }; _self[_DYN_INITIALIZE ] = function (config, extensions, logger, notificationManager) { if (_isUnloading) { throwError(strSdkUnloadingError); } if (_self[_DYN_IS_INITIALIZED ]()) { throwError("Core cannot be initialized more than once"); } _configHandler = createDynamicConfig(config, defaultConfig, logger || _self[_DYN_LOGGER ], false); config = _configHandler.cfg; _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) { _instrumentationKey = details.cfg.instrumentationKey; var extCfg = details.ref(details.cfg, STR_EXTENSION_CONFIG); objForEachKey(extCfg, function (key) { details.ref(extCfg, key); }); if (isNullOrUndefined(_instrumentationKey)) { throwError("Please provide instrumentation key"); } })); _notificationManager = notificationManager; _initDebugListener(); _initPerfManager(); _self[_DYN_LOGGER ] = logger; var cfgExtensions = config[STR_EXTENSIONS ]; _configExtensions = []; _configExtensions[_DYN_PUSH$1 ].apply(_configExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), cfgExtensions)); _channelConfig = config[STR_CHANNELS ]; _initPluginChain(null); if (!_channels || _channels[_DYN_LENGTH$5 ] === 0) { throwError("No " + STR_CHANNELS + " available"); } if (_channelConfig && _channelConfig[_DYN_LENGTH$5 ] > 1) { var teeController = _self[_DYN_GET_PLUGIN ]("TeeChannelController"); if (!teeController || !teeController.plugin) { _throwInternal(_logger, 1 , 28 , "TeeChannel required"); } } _registerDelayedCfgListener(config, _cfgListeners, _logger); _cfgListeners = null; _isInitialized = true; _self.releaseQueue(); _self[_DYN_POLL_INTERNAL_LOGS ](); }; _self.getChannels = function () { var controls = []; if (_channels) { arrForEach(_channels, function (channel) { controls[_DYN_PUSH$1 ](channel); }); } return objFreeze(controls); }; _self.track = function (telemetryItem) { doPerf(_self[STR_GET_PERF_MGR ](), function () { return "AppInsightsCore:track"; }, function () { if (telemetryItem === null) { _notifyInvalidEvent(telemetryItem); throwError("Invalid telemetry item"); } if (!telemetryItem[_DYN_NAME$3 ] && isNullOrUndefined(telemetryItem[_DYN_NAME$3 ])) { _notifyInvalidEvent(telemetryItem); throwError("telemetry name required"); } telemetryItem.iKey = telemetryItem.iKey || _instrumentationKey; telemetryItem[_DYN_TIME ] = telemetryItem[_DYN_TIME ] || toISOString(new Date()); telemetryItem.ver = telemetryItem.ver || "4.0"; if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]()) { _createTelCtx()[_DYN_PROCESS_NEXT ](telemetryItem); } else { _eventQueue[_DYN_PUSH$1 ](telemetryItem); } }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync)); }; _self[_DYN_GET_PROCESS_TEL_CONT0 ] = _createTelCtx; _self[_DYN_GET_NOTIFY_MGR ] = function () { if (!_notificationManager) { _notificationManager = new NotificationManager(_configHandler.cfg); _self[strNotificationManager] = _notificationManager; } return _notificationManager; }; _self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) { _self[_DYN_GET_NOTIFY_MGR ]()[_DYN_ADD_NOTIFICATION_LIS1 ](listener); }; _self[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) { if (_notificationManager) { _notificationManager[_DYN_REMOVE_NOTIFICATION_2 ](listener); } }; _self.getCookieMgr = function () { if (!_cookieManager) { _cookieManager = createCookieMgr(_configHandler.cfg, _self[_DYN_LOGGER ]); } return _cookieManager; }; _self.setCookieMgr = function (cookieMgr) { if (_cookieManager !== cookieMgr) { runTargetUnload(_cookieManager, false); _cookieManager = cookieMgr; } }; _self[STR_GET_PERF_MGR ] = function () { if (!_perfManager && !_cfgPerfManager) { _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) { if (details.cfg.enablePerfMgr) { var createPerfMgr = details.cfg[STR_CREATE_PERF_MGR ]; if (isFunction(createPerfMgr)) { _cfgPerfManager = createPerfMgr(_self, _self[_DYN_GET_NOTIFY_MGR ]()); } } })); } return _perfManager || _cfgPerfManager || getGblPerfMgr(); }; _self.setPerfMgr = function (perfMgr) { _perfManager = perfMgr; }; _self.eventCnt = function () { return _eventQueue[_DYN_LENGTH$5 ]; }; _self.releaseQueue = function () { if (_isInitialized && _eventQueue[_DYN_LENGTH$5 ] > 0) { var eventQueue = _eventQueue; _eventQueue = []; arrForEach(eventQueue, function (event) { _createTelCtx()[_DYN_PROCESS_NEXT ](event); }); } }; _self[_DYN_POLL_INTERNAL_LOGS ] = function (eventName) { _internalLogsEventName = eventName || null; _forceStopInternalLogPoller = false; _internalLogPoller && _internalLogPoller[_DYN_CANCEL ](); return _startLogPoller(true); }; function _startLogPoller(alwaysStart) { if ((!_internalLogPoller || !_internalLogPoller[_DYN_ENABLED ]) && !_forceStopInternalLogPoller) { var shouldStart = alwaysStart || (_logger && _logger.queue[_DYN_LENGTH$5 ] > 0); if (shouldStart) { if (!_internalLogPollerListening) { _internalLogPollerListening = true; _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) { var interval = details.cfg.diagnosticLogInterval; if (!interval || !(interval > 0)) { interval = 10000; } var isRunning = false; if (_internalLogPoller) { isRunning = _internalLogPoller[_DYN_ENABLED ]; _internalLogPoller[_DYN_CANCEL ](); } _internalLogPoller = createTimeout(_flushInternalLogs, interval); _internalLogPoller.unref(); _internalLogPoller[_DYN_ENABLED ] = isRunning; })); } _internalLogPoller[_DYN_ENABLED ] = true; } } return _internalLogPoller; } _self[_DYN_STOP_POLLING_INTERNA3 ] = function () { _forceStopInternalLogPoller = true; _internalLogPoller && _internalLogPoller[_DYN_CANCEL ](); _flushInternalLogs(); }; proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, ["addTelemetryInitializer"]); _self[_DYN_UNLOAD ] = function (isAsync, unloadComplete, cbTimeout) { var _a; if (isAsync === void 0) { isAsync = true; } if (!_isInitialized) { throwError(strSdkNotInitialized); } if (_isUnloading) { throwError(strSdkUnloadingError); } var unloadState = (_a = { reason: 50 }, _a[_DYN_IS_ASYNC ] = isAsync, _a.flushComplete = false, _a); var result; if (isAsync && !unloadComplete) { result = createPromise(function (resolve) { unloadComplete = resolve; }); } var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self); processUnloadCtx[_DYN_ON_COMPLETE ](function () { _hookContainer.run(_self[_DYN_LOGGER ]); doUnloadAll([_cookieManager, _notificationManager, _logger], isAsync, function () { _initDefaults(); unloadComplete && unloadComplete(unloadState); }); }, _self); function _doUnload(flushComplete) { unloadState.flushComplete = flushComplete; _isUnloading = true; _unloadHandlers.run(processUnloadCtx, unloadState); _self[_DYN_STOP_POLLING_INTERNA3 ](); processUnloadCtx[_DYN_PROCESS_NEXT ](unloadState); } _flushInternalLogs(); if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) ; return result; }; _self[_DYN_GET_PLUGIN ] = _getPlugin; _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) { if (!plugin) { addCb && addCb(false); _logOrThrowError(strValidationError); return; } var existingPlugin = _getPlugin(plugin[_DYN_IDENTIFIER ]); if (existingPlugin && !replaceExisting) { addCb && addCb(false); _logOrThrowError("Plugin [" + plugin[_DYN_IDENTIFIER ] + "] is already loaded!"); return; } var updateState = { reason: 16 }; function _addPlugin(removed) { _configExtensions[_DYN_PUSH$1 ](plugin); updateState.added = [plugin]; _initPluginChain(updateState); addCb && addCb(true); } if (existingPlugin) { var removedPlugins_1 = [existingPlugin.plugin]; var unloadState = { reason: 2 , isAsync: !!isAsync }; _removePlugins(removedPlugins_1, unloadState, function (removed) { if (!removed) { addCb && addCb(false); } else { updateState.removed = removedPlugins_1; updateState.reason |= 32 ; _addPlugin(); } }); } else { _addPlugin(); } }; _self.updateCfg = function (newConfig, mergeExisting) { if (mergeExisting === void 0) { mergeExisting = true; } var updateState; if (_self[_DYN_IS_INITIALIZED ]()) { updateState = { reason: 1 , cfg: _configHandler.cfg, oldCfg: deepExtend({}, _configHandler.cfg), newConfig: deepExtend({}, newConfig), merge: mergeExisting }; newConfig = updateState.newConfig; var cfg = _configHandler.cfg; newConfig[STR_EXTENSIONS ] = cfg[STR_EXTENSIONS ]; newConfig[STR_CHANNELS ] = cfg[STR_CHANNELS ]; } _configHandler._block(function (details) { var theConfig = details.cfg; _deepMergeConfig(details, theConfig, newConfig, mergeExisting); if (!mergeExisting) { objForEachKey(theConfig, function (key) { if (!objHasOwn(newConfig, key)) { details.set(theConfig, key, UNDEFINED_VALUE$2); } }); } details[_DYN_SET_DF ](theConfig, defaultConfig); }, true); _configHandler[_DYN_NOTIFY ](); if (updateState) { _doUpdate(updateState); } }; _self.evtNamespace = function () { return _evtNamespace; }; _self.flush = _flushChannels; _self.getTraceCtx = function (createNew) { if (!_traceCtx) { _traceCtx = createDistributedTraceContext(); } return _traceCtx; }; _self.setTraceCtx = function (traceCtx) { _traceCtx = traceCtx || null; }; _self.addUnloadHook = _addUnloadHook; proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add"); _self.onCfgChange = function (handler) { var unloadHook; if (!_isInitialized) { unloadHook = _addDelayedCfgListener(_cfgListeners, handler); } else { unloadHook = onConfigChange(_configHandler.cfg, handler, _self[_DYN_LOGGER ]); } return { rm: function () { unloadHook.rm(); } }; }; _self.getWParam = function () { return (hasDocument() || !!_configHandler.cfg.enableWParam) ? 0 : -1; }; function _setPluginVersions() { var thePlugins = {}; _pluginVersionStringArr = []; var _addPluginVersions = function (plugins) { if (plugins) { arrForEach(plugins, function (plugin) { if (plugin[_DYN_IDENTIFIER ] && plugin[_DYN_VERSION$1 ] && !thePlugins[plugin.identifier]) { var ver = plugin[_DYN_IDENTIFIER ] + "=" + plugin[_DYN_VERSION$1 ]; _pluginVersionStringArr[_DYN_PUSH$1 ](ver); thePlugins[plugin.identifier] = plugin; } }); } }; _addPluginVersions(_channels); if (_channelConfig) { arrForEach(_channelConfig, function (channels) { _addPluginVersions(channels); }); } _addPluginVersions(_configExtensions); } function _initDefaults() { _isInitialized = false; _configHandler = createDynamicConfig({}, defaultConfig, _self[_DYN_LOGGER ]); _configHandler.cfg[_DYN_LOGGING_LEVEL_CONSOL4 ] = 1 ; objDefine(_self, "config", { g: function () { return _configHandler.cfg; }, s: function (newValue) { _self.updateCfg(newValue, false); } }); objDefine(_self, "pluginVersionStringArr", { g: function () { if (!_pluginVersionStringArr) { _setPluginVersions(); } return _pluginVersionStringArr; } }); objDefine(_self, "pluginVersionString", { g: function () { if (!_pluginVersionString) { if (!_pluginVersionStringArr) { _setPluginVersions(); } _pluginVersionString = _pluginVersionStringArr.join(";"); } return _pluginVersionString || STR_EMPTY; } }); objDefine(_self, "logger", { g: function () { if (!_logger) { _logger = new DiagnosticLogger(_configHandler.cfg); _configHandler[_DYN_LOGGER ] = _logger; } return _logger; }, s: function (newLogger) { _configHandler[_DYN_LOGGER ] = newLogger; if (_logger !== newLogger) { runTargetUnload(_logger, false); _logger = newLogger; } } }); _self[_DYN_LOGGER ] = new DiagnosticLogger(_configHandler.cfg); _extensions = []; var cfgExtensions = _self.config[STR_EXTENSIONS ] || []; cfgExtensions.splice(0, cfgExtensions[_DYN_LENGTH$5 ]); arrAppend(cfgExtensions, _extensions); _telemetryInitializerPlugin = new TelemetryInitializerPlugin(); _eventQueue = []; runTargetUnload(_notificationManager, false); _notificationManager = null; _perfManager = null; _cfgPerfManager = null; runTargetUnload(_cookieManager, false); _cookieManager = null; _pluginChain = null; _configExtensions = []; _channelConfig = null; _channels = null; _isUnloading = false; _internalLogsEventName = null; _evtNamespace = createUniqueNamespace("AIBaseCore", true); _unloadHandlers = createUnloadHandlerContainer(); _traceCtx = null; _instrumentationKey = null; _hookContainer = createUnloadHookContainer(); _cfgListeners = []; _pluginVersionString = null; _pluginVersionStringArr = null; _forceStopInternalLogPoller = false; } function _createTelCtx() { var theCtx = createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self); theCtx[_DYN_ON_COMPLETE ](_startLogPoller); return theCtx; } function _initPluginChain(updateState) { var theExtensions = _validateExtensions(_self[_DYN_LOGGER ], ChannelControllerPriority, _configExtensions); _pluginChain = null; _pluginVersionString = null; _pluginVersionStringArr = null; _channels = (_channelConfig || [])[0] || []; _channels = sortPlugins(arrAppend(_channels, theExtensions[STR_CHANNELS ])); var allExtensions = arrAppend(sortPlugins(theExtensions[STR_CORE ]), _channels); _extensions = objFreeze(allExtensions); var cfgExtensions = _self.config[STR_EXTENSIONS ] || []; cfgExtensions.splice(0, cfgExtensions[_DYN_LENGTH$5 ]); arrAppend(cfgExtensions, _extensions); var rootCtx = _createTelCtx(); if (_channels && _channels[_DYN_LENGTH$5 ] > 0) { initializePlugins(rootCtx[_DYN_CREATE_NEW$1 ](_channels), allExtensions); } initializePlugins(rootCtx, allExtensions); if (updateState) { _doUpdate(updateState); } } function _getPlugin(pluginIdentifier) { var theExt = null; var thePlugin = null; var channelHosts = []; arrForEach(_extensions, function (ext) { if (ext[_DYN_IDENTIFIER ] === pluginIdentifier && ext !== _telemetryInitializerPlugin) { thePlugin = ext; return -1; } if (ext.getChannel) { channelHosts[_DYN_PUSH$1 ](ext); } }); if (!thePlugin && channelHosts[_DYN_LENGTH$5 ] > 0) { arrForEach(channelHosts, function (host) { thePlugin = host.getChannel(pluginIdentifier); if (!thePlugin) { return -1; } }); } if (thePlugin) { theExt = { plugin: thePlugin, setEnabled: function (enabled) { _getPluginState(thePlugin)[STR_DISABLED] = !enabled; }, isEnabled: function () { var pluginState = _getPluginState(thePlugin); return !pluginState[_DYN_TEARDOWN ] && !pluginState[STR_DISABLED]; }, remove: function (isAsync, removeCb) { var _a; if (isAsync === void 0) { isAsync = true; } var pluginsToRemove = [thePlugin]; var unloadState = (_a = { reason: 1 }, _a[_DYN_IS_ASYNC ] = isAsync, _a); _removePlugins(pluginsToRemove, unloadState, function (removed) { if (removed) { _initPluginChain({ reason: 32 , removed: pluginsToRemove }); } removeCb && removeCb(removed); }); } }; } return theExt; } function _getPluginChain() { if (!_pluginChain) { var extensions = (_extensions || []).slice(); if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) { extensions[_DYN_PUSH$1 ](_telemetryInitializerPlugin); } _pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _configHandler.cfg, _self); } return _pluginChain; } function _removePlugins(thePlugins, unloadState, removeComplete) { if (thePlugins && thePlugins[_DYN_LENGTH$5 ] > 0) { var unloadChain = createTelemetryProxyChain(thePlugins, _configHandler.cfg, _self); var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self); unloadCtx[_DYN_ON_COMPLETE ](function () { var removed = false; var newConfigExtensions = []; arrForEach(_configExtensions, function (plugin, idx) { if (!_isPluginPresent(plugin, thePlugins)) { newConfigExtensions[_DYN_PUSH$1 ](plugin); } else { removed = true; } }); _configExtensions = newConfigExtensions; _pluginVersionString = null; _pluginVersionStringArr = null; var newChannelConfig = []; if (_channelConfig) { arrForEach(_channelConfig, function (queue, idx) { var newQueue = []; arrForEach(queue, function (channel) { if (!_isPluginPresent(channel, thePlugins)) { newQueue[_DYN_PUSH$1 ](channel); } else { removed = true; } }); newChannelConfig[_DYN_PUSH$1 ](newQueue); }); _channelConfig = newChannelConfig; } removeComplete && removeComplete(removed); _startLogPoller(); }); unloadCtx[_DYN_PROCESS_NEXT ](unloadState); } else { removeComplete(false); } } function _flushInternalLogs() { if (_logger && _logger.queue) { var queue = _logger.queue.slice(0); _logger.queue[_DYN_LENGTH$5 ] = 0; arrForEach(queue, function (logMessage) { var _a; var item = (_a = {}, _a[_DYN_NAME$3 ] = _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage[_DYN_MESSAGE_ID ], _a.iKey = _instrumentationKey, _a[_DYN_TIME ] = toISOString(new Date()), _a.baseType = _InternalLogMessage.dataType, _a.baseData = { message: logMessage[_DYN_MESSAGE$2 ] }, _a); _self.track(item); }); } } function _flushChannels(isAsync, callBack, sendReason, cbTimeout) { var waiting = 1; var doneIterating = false; var cbTimer = null; cbTimeout = cbTimeout || 5000; function doCallback() { waiting--; if (doneIterating && waiting === 0) { cbTimer && cbTimer[_DYN_CANCEL ](); cbTimer = null; callBack && callBack(doneIterating); callBack = null; } } if (_channels && _channels[_DYN_LENGTH$5 ] > 0) { var flushCtx = _createTelCtx()[_DYN_CREATE_NEW$1 ](_channels); flushCtx.iterate(function (plugin) { if (plugin.flush) { waiting++; var handled_1 = false; if (!plugin.flush(isAsync, function () { handled_1 = true; doCallback(); }, sendReason)) { if (!handled_1) { if (isAsync && cbTimer == null) { cbTimer = scheduleTimeout(function () { cbTimer = null; doCallback(); }, cbTimeout); } else { doCallback(); } } } } }); } doneIterating = true; doCallback(); return true; } function _initDebugListener() { !_notificationManager && _self[_DYN_GET_NOTIFY_MGR ](); _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) { var disableDbgExt = details.cfg.disableDbgExt; if (disableDbgExt === true && _debugListener) { _notificationManager[_DYN_REMOVE_NOTIFICATION_2 ](_debugListener); _debugListener = null; } if (_notificationManager && !_debugListener && disableDbgExt !== true) { _debugListener = getDebugListener(details.cfg); _notificationManager[_DYN_ADD_NOTIFICATION_LIS1 ](_debugListener); } })); } function _initPerfManager() { _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) { var enablePerfMgr = details.cfg.enablePerfMgr; if (!enablePerfMgr && _cfgPerfManager) { _cfgPerfManager = null; } if (enablePerfMgr) { getSetValue(details.cfg, STR_CREATE_PERF_MGR, _createPerfManager); } })); } function _doUpdate(updateState) { var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self); updateCtx[_DYN_ON_COMPLETE ](_startLogPoller); if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) { updateCtx[_DYN_PROCESS_NEXT ](updateState); } } function _logOrThrowError(message) { var logger = _self[_DYN_LOGGER ]; if (logger) { _throwInternal(logger, 2 , 73 , message); _startLogPoller(); } else { throwError(message); } } function _notifyInvalidEvent(telemetryItem) { var manager = _self[_DYN_GET_NOTIFY_MGR ](); if (manager) { manager[STR_EVENTS_DISCARDED ]([telemetryItem], 2 ); } } function _addUnloadHook(hooks) { _hookContainer.add(hooks); } }); } AppInsightsCore.__ieDyn=1; return AppInsightsCore; }()); var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name[_DYN_REPLACE ]) { return name[_DYN_REPLACE ](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g, STR_EMPTY); } return name; } function _getEvtNamespace(eventName, evtNamespace) { var _a; if (evtNamespace) { var theNamespace_1 = STR_EMPTY; if (isArray(evtNamespace)) { theNamespace_1 = STR_EMPTY; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } eventName = (eventName || STR_EMPTY) + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY) || []); return _a = {}, _a[_DYN_TYPE ] = parsedEvent[1], _a.ns = ((parsedEvent[2] || STR_EMPTY).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY)[_DYN_SPLIT$1 ](".").sort()).join("."), _a; } function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName[_DYN_TYPE ]) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName[_DYN_TYPE ], handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName[_DYN_TYPE ] && handlerRef) { if (obj[strAddEventHelper]) { obj[strAddEventHelper](evtName[_DYN_TYPE ], handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { obj[strAttachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events[_DYN_LENGTH$5 ]; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent[_DYN_HANDLER ], theEvent.capture); events[_DYN_SPLICE ](idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName[_DYN_TYPE ]) { _doUnregister(target, _getRegisteredEvents(target, evtName[_DYN_TYPE ]), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); if (objKeys(eventCache)[_DYN_LENGTH$5 ] === 0) { elmNodeData.kill(target, strEvents); } } } function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns)[_DYN_SPLIT$1 ]("."); } else { newNamespaces = theNamespace; } return newNamespaces; } function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { var _a; if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = (_a = { guid: _guid++, evtName: evtName }, _a[_DYN_HANDLER ] = handlerRef, _a.capture = useCapture, _a); _getRegisteredEvents(target, evtName.type)[_DYN_PUSH$1 ](registeredEvent); } } catch (e) { } } return result; } function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent[_DYN_HANDLER ] === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { } } } function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events[_DYN_LENGTH$5 ] > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents[_DYN_LENGTH$5 ] > 0) { added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } function removePageHideEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } var aiInstrumentHooks = "_aiHooks"; var cbNames = [ "req", "rsp", "hkErr", "fnErr" ]; function _arrLoop(arr, fn) { if (arr) { for (var lp = 0; lp < arr[_DYN_LENGTH$5 ]; lp++) { if (fn(arr[lp], lp)) { break; } } } } function _doCallbacks(hooks, callDetails, cbArgs, hookCtx, type) { if (type >= 0 && type <= 2 ) { _arrLoop(hooks, function (hook, idx) { var cbks = hook.cbks; var cb = cbks[cbNames[type]]; if (cb) { callDetails.ctx = function () { var ctx = hookCtx[idx] = (hookCtx[idx] || {}); return ctx; }; try { cb[_DYN_APPLY ](callDetails.inst, cbArgs); } catch (err) { var orgEx = callDetails.err; try { var hookErrorCb = cbks[cbNames[2 ]]; if (hookErrorCb) { callDetails.err = err; hookErrorCb[_DYN_APPLY ](callDetails.inst, cbArgs); } } catch (e) { } finally { callDetails.err = orgEx; } } } }); } } function _createFunctionHook(aiHook) { return function () { var _a; var funcThis = this; var orgArgs = arguments; var hooks = aiHook.h; var funcArgs = (_a = {}, _a[_DYN_NAME$3 ] = aiHook.n, _a.inst = funcThis, _a.ctx = null, _a.set = _replaceArg, _a); var hookCtx = []; var cbArgs = _createArgs([funcArgs], orgArgs); funcArgs.evt = getInst("event"); function _createArgs(target, theArgs) { _arrLoop(theArgs, function (arg) { target[_DYN_PUSH$1 ](arg); }); return target; } function _replaceArg(idx, value) { orgArgs = _createArgs([], orgArgs); orgArgs[idx] = value; cbArgs = _createArgs([funcArgs], orgArgs); } _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 0 ); var theFunc = aiHook.f; if (theFunc) { try { funcArgs.rslt = theFunc[_DYN_APPLY ](funcThis, orgArgs); } catch (err) { funcArgs.err = err; _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 3 ); throw err; } } _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 1 ); return funcArgs.rslt; }; } function _getOwner(target, name, checkPrototype, checkParentProto) { var owner = null; if (target) { if (objHasOwnProperty(target, name)) { owner = target; } else if (checkPrototype) { owner = _getOwner(_getObjProto(target), name, checkParentProto, false); } } return owner; } function InstrumentProto(target, funcName, callbacks) { if (target) { return InstrumentFunc(target[strShimPrototype], funcName, callbacks, false); } return null; } function _createInstrumentHook(owner, funcName, fn, callbacks) { var aiHook = fn && fn[aiInstrumentHooks]; if (!aiHook) { aiHook = { i: 0, n: funcName, f: fn, h: [] }; var newFunc = _createFunctionHook(aiHook); newFunc[aiInstrumentHooks] = aiHook; owner[funcName] = newFunc; } var theHook = { id: aiHook.i, cbks: callbacks, rm: function () { var id = this.id; _arrLoop(aiHook.h, function (hook, idx) { if (hook.id === id) { aiHook.h[_DYN_SPLICE ](idx, 1); return 1; } }); } }; aiHook.i++; aiHook.h[_DYN_PUSH$1 ](theHook); return theHook; } function InstrumentFunc(target, funcName, callbacks, checkPrototype, checkParentProto) { if (checkPrototype === void 0) { checkPrototype = true; } if (target && funcName && callbacks) { var owner = _getOwner(target, funcName, checkPrototype, checkParentProto); if (owner) { var fn = owner[funcName]; if (typeof fn === strShimFunction) { return _createInstrumentHook(owner, funcName, fn, callbacks); } } } return null; } function InstrumentEvent(target, evtName, callbacks, checkPrototype, checkParentProto) { if (target && evtName && callbacks) { var owner = _getOwner(target, evtName, checkPrototype, checkParentProto) || target; if (owner) { return _createInstrumentHook(owner, evtName, owner[evtName], callbacks); } } return null; } var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var SampleRate = "sampleRate"; var ProcessLegacy = "ProcessLegacy"; var HttpMethod = "http.method"; var DEFAULT_BREEZE_ENDPOINT = "https://dc.services.visualstudio.com"; var DEFAULT_BREEZE_PATH = "/v2/track"; var strNotSpecified = "not_specified"; var strIkey = "iKey"; var RequestHeaders = createValueMap({ requestContextHeader: [0 , "Request-Context"], requestContextTargetKey: [1 , "appId"], requestContextAppIdFormat: [2 , "appId=cid-v1:"], requestIdHeader: [3 , "Request-Id"], traceParentHeader: [4 , "traceparent"], traceStateHeader: [5 , "tracestate"], sdkContextHeader: [6 , "Sdk-Context"], sdkContextHeaderAppIdRequest: [7 , "appId"], requestContextHeaderLowerCase: [8 , "request-context"] }); var _DYN_SPLIT = "split"; var _DYN_LENGTH$4 = "length"; var _DYN_TO_LOWER_CASE$1 = "toLowerCase"; var _DYN_INGESTIONENDPOINT = "ingestionendpoint"; var _DYN_TO_STRING$2 = "toString"; var _DYN_REMOVE_ITEM = "removeItem"; var _DYN_NAME$2 = "name"; var _DYN_MESSAGE$1 = "message"; var _DYN_COUNT$1 = "count"; var _DYN_STRINGIFY$1 = "stringify"; var _DYN_PATHNAME = "pathname"; var _DYN_CORRELATION_HEADER_E0 = "correlationHeaderExcludePatterns"; var _DYN_EXCEPTIONS = "exceptions"; var _DYN_PARSED_STACK = "parsedStack"; var _DYN_PROPERTIES = "properties"; var _DYN_MEASUREMENTS$1 = "measurements"; var _DYN_SIZE_IN_BYTES = "sizeInBytes"; var _DYN_TYPE_NAME = "typeName"; var _DYN_SEVERITY_LEVEL = "severityLevel"; var _DYN_PROBLEM_GROUP = "problemGroup"; var _DYN_IS_MANUAL = "isManual"; var _DYN__CREATE_FROM_INTERFA1 = "CreateFromInterface"; var _DYN_ASSEMBLY = "assembly"; var _DYN_FILE_NAME = "fileName"; var _DYN_HAS_FULL_STACK = "hasFullStack"; var _DYN_LEVEL = "level"; var _DYN_METHOD$1 = "method"; var _DYN_LINE = "line"; var _DYN_DURATION$1 = "duration"; var _DYN_RECEIVED_RESPONSE = "receivedResponse"; function dataSanitizeKeyAndAddUniqueness(logger, key, map) { var origLength = key[_DYN_LENGTH$4 ]; var field = dataSanitizeKey(logger, key); if (field[_DYN_LENGTH$4 ] !== origLength) { var i = 0; var uniqueField = field; while (map[uniqueField] !== undefined) { i++; uniqueField = strSubstring(field, 0, 150 - 3) + dsPadNumber(i); } field = uniqueField; } return field; } function dataSanitizeKey(logger, name) { var nameTrunc; if (name) { name = strTrim(asString(name)); if (name[_DYN_LENGTH$4 ] > 150 ) { nameTrunc = strSubstring(name, 0, 150 ); _throwInternal(logger, 2 , 57 , "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true); } } return nameTrunc || name; } function dataSanitizeString(logger, value, maxLength) { if (maxLength === void 0) { maxLength = 1024 ; } var valueTrunc; if (value) { maxLength = maxLength ? maxLength : 1024 ; value = strTrim(asString(value)); if (value[_DYN_LENGTH$4 ] > maxLength) { valueTrunc = strSubstring(value, 0, maxLength); _throwInternal(logger, 2 , 61 , "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true); } } return valueTrunc || value; } function dataSanitizeUrl(logger, url) { return dataSanitizeInput(logger, url, 2048 , 66 ); } function dataSanitizeMessage(logger, message) { var messageTrunc; if (message) { if (message[_DYN_LENGTH$4 ] > 32768 ) { messageTrunc = strSubstring(message, 0, 32768 ); _throwInternal(logger, 2 , 56 , "message is too long, it has been truncated to " + 32768 + " characters.", { message: message }, true); } } return messageTrunc || message; } function dataSanitizeException(logger, exception) { var exceptionTrunc; if (exception) { var value = "" + exception; if (value[_DYN_LENGTH$4 ] > 32768 ) { exceptionTrunc = strSubstring(value, 0, 32768 ); _throwInternal(logger, 2 , 52 , "exception is too long, it has been truncated to " + 32768 + " characters.", { exception: exception }, true); } } return exceptionTrunc || exception; } function dataSanitizeProperties(logger, properties) { if (properties) { var tempProps_1 = {}; objForEachKey(properties, function (prop, value) { if (isObject(value) && hasJSON()) { try { value = getJSON()[_DYN_STRINGIFY$1 ](value); } catch (e) { _throwInternal(logger, 2 , 49 , "custom property is not valid", { exception: e }, true); } } value = dataSanitizeString(logger, value, 8192 ); prop = dataSanitizeKeyAndAddUniqueness(logger, prop, tempProps_1); tempProps_1[prop] = value; }); properties = tempProps_1; } return properties; } function dataSanitizeMeasurements(logger, measurements) { if (measurements) { var tempMeasurements_1 = {}; objForEachKey(measurements, function (measure, value) { measure = dataSanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements_1); tempMeasurements_1[measure] = value; }); measurements = tempMeasurements_1; } return measurements; } function dataSanitizeId(logger, id) { return id ? dataSanitizeInput(logger, id, 128 , 69 )[_DYN_TO_STRING$2 ]() : id; } function dataSanitizeInput(logger, input, maxLength, _msgId) { var inputTrunc; if (input) { input = strTrim(asString(input)); if (input[_DYN_LENGTH$4 ] > maxLength) { inputTrunc = strSubstring(input, 0, maxLength); _throwInternal(logger, 2 , _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true); } } return inputTrunc || input; } function dsPadNumber(num) { var s = "00" + num; return strSubstr(s, s[_DYN_LENGTH$4 ] - 3); } var _document = getDocument() || {}; var _htmlAnchorIdx = 0; var _htmlAnchorElement = [null, null, null, null, null]; function urlParseUrl(url) { var anchorIdx = _htmlAnchorIdx; var anchorCache = _htmlAnchorElement; var tempAnchor = anchorCache[anchorIdx]; if (!_document.createElement) { tempAnchor = { host: urlParseHost(url, true) }; } else if (!anchorCache[anchorIdx]) { tempAnchor = anchorCache[anchorIdx] = _document.createElement("a"); } tempAnchor.href = url; anchorIdx++; if (anchorIdx >= anchorCache[_DYN_LENGTH$4 ]) { anchorIdx = 0; } _htmlAnchorIdx = anchorIdx; return tempAnchor; } function urlGetAbsoluteUrl(url) { var result; var a = urlParseUrl(url); if (a) { result = a.href; } return result; } function urlGetCompleteUrl(method, absoluteUrl) { if (method) { return method.toUpperCase() + " " + absoluteUrl; } return absoluteUrl; } function urlParseHost(url, inclPort) { var fullHost = urlParseFullHost(url, inclPort) || ""; if (fullHost) { var match = fullHost.match(/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i); if (match != null && match[_DYN_LENGTH$4 ] > 3 && isString(match[2]) && match[2][_DYN_LENGTH$4 ] > 0) { return match[2] + (match[3] || ""); } } return fullHost; } function urlParseFullHost(url, inclPort) { var result = null; if (url) { var match = url.match(/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i); if (match != null && match[_DYN_LENGTH$4 ] > 2 && isString(match[2]) && match[2][_DYN_LENGTH$4 ] > 0) { result = match[2] || ""; if (inclPort && match[_DYN_LENGTH$4 ] > 2) { var protocol = (match[1] || "")[_DYN_TO_LOWER_CASE$1 ](); var port = match[3] || ""; if (protocol === "http" && port === ":80") { port = ""; } else if (protocol === "https" && port === ":443") { port = ""; } result += port; } } } return result; } var _internalEndpoints = [ DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH, "https://breeze.aimon.applicationinsights.io" + DEFAULT_BREEZE_PATH, "https://dc-int.services.visualstudio.com" + DEFAULT_BREEZE_PATH ]; var _correlationIdPrefix = "cid-v1:"; function isInternalApplicationInsightsEndpoint(endpointUrl) { return arrIndexOf(_internalEndpoints, endpointUrl[_DYN_TO_LOWER_CASE$1 ]()) !== -1; } function correlationIdCanIncludeCorrelationHeader(config, requestUrl, currentHost) { if (!requestUrl || (config && config.disableCorrelationHeaders)) { return false; } if (config && config[_DYN_CORRELATION_HEADER_E0 ]) { for (var i = 0; i < config.correlationHeaderExcludePatterns[_DYN_LENGTH$4 ]; i++) { if (config[_DYN_CORRELATION_HEADER_E0 ][i].test(requestUrl)) { return false; } } } var requestHost = urlParseUrl(requestUrl).host[_DYN_TO_LOWER_CASE$1 ](); if (requestHost && (strIndexOf(requestHost, ":443") !== -1 || strIndexOf(requestHost, ":80") !== -1)) { requestHost = (urlParseFullHost(requestUrl, true) || "")[_DYN_TO_LOWER_CASE$1 ](); } if ((!config || !config.enableCorsCorrelation) && (requestHost && requestHost !== currentHost)) { return false; } var includedDomains = config && config.correlationHeaderDomains; if (includedDomains) { var matchExists_1; arrForEach(includedDomains, function (domain) { var regex = new RegExp(domain.toLowerCase().replace(/\\/g, "\\\\").replace(/\./g, "\\.").replace(/\*/g, ".*")); matchExists_1 = matchExists_1 || regex.test(requestHost); }); if (!matchExists_1) { return false; } } var excludedDomains = config && config.correlationHeaderExcludedDomains; if (!excludedDomains || excludedDomains[_DYN_LENGTH$4 ] === 0) { return true; } for (var i = 0; i < excludedDomains[_DYN_LENGTH$4 ]; i++) { var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\\/g, "\\\\").replace(/\./g, "\\.").replace(/\*/g, ".*")); if (regex.test(requestHost)) { return false; } } return requestHost && requestHost[_DYN_LENGTH$4 ] > 0; } function correlationIdGetCorrelationContext(responseHeader) { if (responseHeader) { var correlationId = correlationIdGetCorrelationContextValue(responseHeader, RequestHeaders[1 ]); if (correlationId && correlationId !== _correlationIdPrefix) { return correlationId; } } } function correlationIdGetCorrelationContextValue(responseHeader, key) { if (responseHeader) { var keyValues = responseHeader[_DYN_SPLIT ](","); for (var i = 0; i < keyValues[_DYN_LENGTH$4 ]; ++i) { var keyValue = keyValues[i][_DYN_SPLIT ]("="); if (keyValue[_DYN_LENGTH$4 ] === 2 && keyValue[0] === key) { return keyValue[1]; } } } } function AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName) { var target, name = commandName, data = commandName; if (absoluteUrl && absoluteUrl[_DYN_LENGTH$4 ] > 0) { var parsedUrl = urlParseUrl(absoluteUrl); target = parsedUrl.host; if (!name) { if (parsedUrl[_DYN_PATHNAME ] != null) { var pathName = (parsedUrl.pathname[_DYN_LENGTH$4 ] === 0) ? "/" : parsedUrl[_DYN_PATHNAME ]; if (pathName.charAt(0) !== "/") { pathName = "/" + pathName; } data = parsedUrl[_DYN_PATHNAME ]; name = dataSanitizeString(logger, method ? method + " " + pathName : pathName); } else { name = dataSanitizeString(logger, absoluteUrl); } } } else { target = commandName; name = commandName; } return { target: target, name: name, data: data }; } function dateTimeUtilsNow() { var perf = getPerformance(); if (perf && perf.now && perf.timing) { var now = perf.now() + perf.timing.navigationStart; if (now > 0) { return now; } } return utcNow(); } function dateTimeUtilsDuration(start, end) { var result = null; if (start !== 0 && end !== 0 && !isNullOrUndefined(start) && !isNullOrUndefined(end)) { result = end - start; } return result; } function createDistributedTraceContextFromTrace(telemetryTrace, parentCtx) { var trace = telemetryTrace || {}; return { getName: function () { return trace[_DYN_NAME$2 ]; }, setName: function (newValue) { parentCtx && parentCtx.setName(newValue); trace[_DYN_NAME$2 ] = newValue; }, getTraceId: function () { return trace.traceID; }, setTraceId: function (newValue) { parentCtx && parentCtx.setTraceId(newValue); if (isValidTraceId(newValue)) { trace.traceID = newValue; } }, getSpanId: function () { return trace.parentID; }, setSpanId: function (newValue) { parentCtx && parentCtx.setSpanId(newValue); if (isValidSpanId(newValue)) { trace.parentID = newValue; } }, getTraceFlags: function () { return trace.traceFlags; }, setTraceFlags: function (newTraceFlags) { parentCtx && parentCtx.setTraceFlags(newTraceFlags); trace.traceFlags = newTraceFlags; } }; } var StorageType = createEnumStyle({ LocalStorage: 0 , SessionStorage: 1 }); createEnumStyle({ AI: 0 , AI_AND_W3C: 1 , W3C: 2 }); var _canUseLocalStorage = undefined; var _canUseSessionStorage = undefined; var _storagePrefix = ""; function _getLocalStorageObject() { if (utlCanUseLocalStorage()) { return _getVerifiedStorageObject(StorageType.LocalStorage); } return null; } function _getVerifiedStorageObject(storageType) { try { if (isNullOrUndefined(getGlobal())) { return null; } var uid = (new Date)[_DYN_TO_STRING$2 ](); var storage = getInst(storageType === StorageType.LocalStorage ? "localStorage" : "sessionStorage"); var name_1 = _storagePrefix + uid; storage.setItem(name_1, uid); var fail = storage.getItem(name_1) !== uid; storage[_DYN_REMOVE_ITEM ](name_1); if (!fail) { return storage; } } catch (exception) { } return null; } function _getSessionStorageObject() { if (utlCanUseSessionStorage()) { return _getVerifiedStorageObject(StorageType.SessionStorage); } return null; } function utlDisableStorage() { _canUseLocalStorage = false; _canUseSessionStorage = false; } function utlSetStoragePrefix(storagePrefix) { _storagePrefix = storagePrefix || ""; } function utlEnableStorage() { _canUseLocalStorage = utlCanUseLocalStorage(true); _canUseSessionStorage = utlCanUseSessionStorage(true); } function utlCanUseLocalStorage(reset) { if (reset || _canUseLocalStorage === undefined) { _canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage); } return _canUseLocalStorage; } function utlGetLocalStorage(logger, name) { var storage = _getLocalStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { _canUseLocalStorage = false; _throwInternal(logger, 2 , 1 , "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) }); } } return null; } function utlSetLocalStorage(logger, name, data) { var storage = _getLocalStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { _canUseLocalStorage = false; _throwInternal(logger, 2 , 3 , "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) }); } } return false; } function utlRemoveStorage(logger, name) { var storage = _getLocalStorageObject(); if (storage !== null) { try { storage[_DYN_REMOVE_ITEM ](name); return true; } catch (e) { _canUseLocalStorage = false; _throwInternal(logger, 2 , 5 , "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) }); } } return false; } function utlCanUseSessionStorage(reset) { if (reset || _canUseSessionStorage === undefined) { _canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage); } return _canUseSessionStorage; } function utlGetSessionStorage(logger, name) { var storage = _getSessionStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { _canUseSessionStorage = false; _throwInternal(logger, 2 , 2 , "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) }); } } return null; } function utlSetSessionStorage(logger, name, data) { var storage = _getSessionStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { _canUseSessionStorage = false; _throwInternal(logger, 2 , 4 , "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) }); } } return false; } function utlRemoveSessionStorage(logger, name) { var storage = _getSessionStorageObject(); if (storage !== null) { try { storage[_DYN_REMOVE_ITEM ](name); return true; } catch (e) { _canUseSessionStorage = false; _throwInternal(logger, 2 , 6 , "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) }); } } return false; } var _FIELDS_SEPARATOR = ";"; var _FIELD_KEY_VALUE_SEPARATOR = "="; function parseConnectionString(connectionString) { if (!connectionString) { return {}; } var kvPairs = connectionString[_DYN_SPLIT ](_FIELDS_SEPARATOR); var result = arrReduce(kvPairs, function (fields, kv) { var kvParts = kv[_DYN_SPLIT ](_FIELD_KEY_VALUE_SEPARATOR); if (kvParts[_DYN_LENGTH$4 ] === 2) { var key = kvParts[0][_DYN_TO_LOWER_CASE$1 ](); var value = kvParts[1]; fields[key] = value; } return fields; }, {}); if (objKeys(result)[_DYN_LENGTH$4 ] > 0) { if (result.endpointsuffix) { var locationPrefix = result.location ? result.location + "." : ""; result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ] || ("https://" + locationPrefix + "dc." + result.endpointsuffix); } result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ] || DEFAULT_BREEZE_ENDPOINT; } return result; } var Envelope = /** @class */ (function () { function Envelope(logger, data, name) { var _this = this; var _self = this; _self.ver = 1; _self.sampleRate = 100.0; _self.tags = {}; _self[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; _self.data = data; _self.time = toISOString(new Date()); _self.aiDataContract = { time: 1 , iKey: 1 , name: 1 , sampleRate: function () { return (_this.sampleRate === 100) ? 4 : 1 ; }, tags: 1 , data: 1 }; } return Envelope; }()); var Event$1 = /** @class */ (function () { function Event(logger, name, properties, measurements) { this.aiDataContract = { ver: 1 , name: 1 , properties: 0 , measurements: 0 }; var _self = this; _self.ver = 2; _self[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); } Event.envelopeType = "Microsoft.ApplicationInsights.{0}.Event"; Event.dataType = "EventData"; return Event; }()); var NoMethod = ""; var strError = "error"; var strStack = "stack"; var strStackDetails = "stackDetails"; var strErrorSrc = "errorSrc"; var strMessage = "message"; var strDescription = "description"; function _stringify(value, convertToString) { var result = value; if (result && !isString(result)) { if (JSON && JSON[_DYN_STRINGIFY$1 ]) { result = JSON[_DYN_STRINGIFY$1 ](value); if (convertToString && (!result || result === "{}")) { if (isFunction(value[_DYN_TO_STRING$2 ])) { result = value[_DYN_TO_STRING$2 ](); } else { result = "" + value; } } } else { result = "" + value + " - (Missing JSON.stringify)"; } } return result || ""; } function _formatMessage(theEvent, errorType) { var evtMessage = theEvent; if (theEvent) { if (evtMessage && !isString(evtMessage)) { evtMessage = theEvent[strMessage] || theEvent[strDescription] || evtMessage; } if (evtMessage && !isString(evtMessage)) { evtMessage = _stringify(evtMessage, true); } if (theEvent["filename"]) { evtMessage = evtMessage + " @" + (theEvent["filename"] || "") + ":" + (theEvent["lineno"] || "?") + ":" + (theEvent["colno"] || "?"); } } if (errorType && errorType !== "String" && errorType !== "Object" && errorType !== "Error" && strIndexOf(evtMessage || "", errorType) === -1) { evtMessage = errorType + ": " + evtMessage; } return evtMessage || ""; } function _isExceptionDetailsInternal(value) { try { if (isObject(value)) { return "hasFullStack" in value && "typeName" in value; } } catch (e) { } return false; } function _isExceptionInternal(value) { try { if (isObject(value)) { return ("ver" in value && "exceptions" in value && "properties" in value); } } catch (e) { } return false; } function _isStackDetails(details) { return details && details.src && isString(details.src) && details.obj && isArray(details.obj); } function _convertStackObj(errorStack) { var src = errorStack || ""; if (!isString(src)) { if (isString(src[strStack])) { src = src[strStack]; } else { src = "" + src; } } var items = src[_DYN_SPLIT ]("\n"); return { src: src, obj: items }; } function _getOperaStack(errorMessage) { var stack = []; var lines = errorMessage[_DYN_SPLIT ]("\n"); for (var lp = 0; lp < lines[_DYN_LENGTH$4 ]; lp++) { var entry = lines[lp]; if (lines[lp + 1]) { entry += "@" + lines[lp + 1]; lp++; } stack.push(entry); } return { src: errorMessage, obj: stack }; } function _getStackFromErrorObj(errorObj) { var details = null; if (errorObj) { try { if (errorObj[strStack]) { details = _convertStackObj(errorObj[strStack]); } else if (errorObj[strError] && errorObj[strError][strStack]) { details = _convertStackObj(errorObj[strError][strStack]); } else if (errorObj["exception"] && errorObj.exception[strStack]) { details = _convertStackObj(errorObj.exception[strStack]); } else if (_isStackDetails(errorObj)) { details = errorObj; } else if (_isStackDetails(errorObj[strStackDetails])) { details = errorObj[strStackDetails]; } else if (window && window["opera"] && errorObj[strMessage]) { details = _getOperaStack(errorObj[_DYN_MESSAGE$1 ]); } else if (errorObj["reason"] && errorObj.reason[strStack]) { details = _convertStackObj(errorObj.reason[strStack]); } else if (isString(errorObj)) { details = _convertStackObj(errorObj); } else { var evtMessage = errorObj[strMessage] || errorObj[strDescription] || ""; if (isString(errorObj[strErrorSrc])) { if (evtMessage) { evtMessage += "\n"; } evtMessage += " from " + errorObj[strErrorSrc]; } if (evtMessage) { details = _convertStackObj(evtMessage); } } } catch (e) { details = _convertStackObj(e); } } return details || { src: "", obj: null }; } function _formatStackTrace(stackDetails) { var stack = ""; if (stackDetails) { if (stackDetails.obj) { arrForEach(stackDetails.obj, function (entry) { stack += entry + "\n"; }); } else { stack = stackDetails.src || ""; } } return stack; } function _parseStack(stack) { var parsedStack; var frames = stack.obj; if (frames && frames[_DYN_LENGTH$4 ] > 0) { parsedStack = []; var level_1 = 0; var totalSizeInBytes_1 = 0; arrForEach(frames, function (frame) { var theFrame = frame[_DYN_TO_STRING$2 ](); if (_StackFrame.regex.test(theFrame)) { var parsedFrame = new _StackFrame(theFrame, level_1++); totalSizeInBytes_1 += parsedFrame[_DYN_SIZE_IN_BYTES ]; parsedStack.push(parsedFrame); } }); var exceptionParsedStackThreshold = 32 * 1024; if (totalSizeInBytes_1 > exceptionParsedStackThreshold) { var left = 0; var right = parsedStack[_DYN_LENGTH$4 ] - 1; var size = 0; var acceptedLeft = left; var acceptedRight = right; while (left < right) { var lSize = parsedStack[left][_DYN_SIZE_IN_BYTES ]; var rSize = parsedStack[right][_DYN_SIZE_IN_BYTES ]; size += lSize + rSize; if (size > exceptionParsedStackThreshold) { var howMany = acceptedRight - acceptedLeft + 1; parsedStack.splice(acceptedLeft, howMany); break; } acceptedLeft = left; acceptedRight = right; left++; right--; } } } return parsedStack; } function _getErrorType(errorType) { var typeName = ""; if (errorType) { typeName = errorType.typeName || errorType[_DYN_NAME$2 ] || ""; if (!typeName) { try { var funcNameRegex = /function (.{1,200})\(/; var results = (funcNameRegex).exec((errorType).constructor[_DYN_TO_STRING$2 ]()); typeName = (results && results[_DYN_LENGTH$4 ] > 1) ? results[1] : ""; } catch (e) { } } } return typeName; } function _formatErrorCode(errorObj) { if (errorObj) { try { if (!isString(errorObj)) { var errorType = _getErrorType(errorObj); var result = _stringify(errorObj, false); if (!result || result === "{}") { if (errorObj[strError]) { errorObj = errorObj[strError]; errorType = _getErrorType(errorObj); } result = _stringify(errorObj, true); } if (strIndexOf(result, errorType) !== 0 && errorType !== "String") { return errorType + ":" + result; } return result; } } catch (e) { } } return "" + (errorObj || ""); } var Exception = /** @class */ (function () { function Exception(logger, exception, properties, measurements, severityLevel, id) { this.aiDataContract = { ver: 1 , exceptions: 1 , severityLevel: 0 , properties: 0 , measurements: 0 }; var _self = this; _self.ver = 2; if (!_isExceptionInternal(exception)) { if (!properties) { properties = {}; } _self[_DYN_EXCEPTIONS ] = [new _ExceptionDetails(logger, exception, properties)]; _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); if (severityLevel) { _self[_DYN_SEVERITY_LEVEL ] = severityLevel; } if (id) { _self.id = id; } } else { _self[_DYN_EXCEPTIONS ] = exception[_DYN_EXCEPTIONS ] || []; _self[_DYN_PROPERTIES ] = exception[_DYN_PROPERTIES ]; _self[_DYN_MEASUREMENTS$1 ] = exception[_DYN_MEASUREMENTS$1 ]; if (exception[_DYN_SEVERITY_LEVEL ]) { _self[_DYN_SEVERITY_LEVEL ] = exception[_DYN_SEVERITY_LEVEL ]; } if (exception.id) { _self.id = exception.id; } if (exception[_DYN_PROBLEM_GROUP ]) { _self[_DYN_PROBLEM_GROUP ] = exception[_DYN_PROBLEM_GROUP ]; } if (!isNullOrUndefined(exception[_DYN_IS_MANUAL ])) { _self[_DYN_IS_MANUAL ] = exception[_DYN_IS_MANUAL ]; } } } Exception.CreateAutoException = function (message, url, lineNumber, columnNumber, error, evt, stack, errorSrc) { var _a; var errorType = _getErrorType(error || evt || message); return _a = {}, _a[_DYN_MESSAGE$1 ] = _formatMessage(message, errorType), _a.url = url, _a.lineNumber = lineNumber, _a.columnNumber = columnNumber, _a.error = _formatErrorCode(error || evt || message), _a.evt = _formatErrorCode(evt || message), _a[_DYN_TYPE_NAME ] = errorType, _a.stackDetails = _getStackFromErrorObj(stack || error || evt), _a.errorSrc = errorSrc, _a; }; Exception.CreateFromInterface = function (logger, exception, properties, measurements) { var exceptions = exception[_DYN_EXCEPTIONS ] && arrMap(exception[_DYN_EXCEPTIONS ], function (ex) { return _ExceptionDetails[_DYN__CREATE_FROM_INTERFA1 ](logger, ex); }); var exceptionData = new Exception(logger, __assignFn(__assignFn({}, exception), { exceptions: exceptions }), properties, measurements); return exceptionData; }; Exception.prototype.toInterface = function () { var _a; var _b = this, exceptions = _b.exceptions, properties = _b.properties, measurements = _b.measurements, severityLevel = _b.severityLevel, problemGroup = _b.problemGroup, id = _b.id, isManual = _b.isManual; var exceptionDetailsInterface = exceptions instanceof Array && arrMap(exceptions, function (exception) { return exception.toInterface(); }) || undefined; return _a = { ver: "4.0" }, _a[_DYN_EXCEPTIONS ] = exceptionDetailsInterface, _a.severityLevel = severityLevel, _a.properties = properties, _a.measurements = measurements, _a.problemGroup = problemGroup, _a.id = id, _a.isManual = isManual, _a; }; Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) { var _a; return { exceptions: [ (_a = {}, _a[_DYN_HAS_FULL_STACK ] = true, _a.message = message, _a.stack = details, _a.typeName = typeName, _a) ] }; }; Exception.envelopeType = "Microsoft.ApplicationInsights.{0}.Exception"; Exception.dataType = "ExceptionData"; Exception.formatError = _formatErrorCode; return Exception; }()); var _ExceptionDetails = /** @class */ (function () { function _ExceptionDetails(logger, exception, properties) { this.aiDataContract = { id: 0 , outerId: 0 , typeName: 1 , message: 1 , hasFullStack: 0 , stack: 0 , parsedStack: 2 }; var _self = this; if (!_isExceptionDetailsInternal(exception)) { var error = exception; var evt = error && error.evt; if (!isError(error)) { error = error[strError] || evt || error; } _self[_DYN_TYPE_NAME ] = dataSanitizeString(logger, _getErrorType(error)) || strNotSpecified; _self[_DYN_MESSAGE$1 ] = dataSanitizeMessage(logger, _formatMessage(exception || error, _self[_DYN_TYPE_NAME ])) || strNotSpecified; var stack = exception[strStackDetails] || _getStackFromErrorObj(exception); _self[_DYN_PARSED_STACK ] = _parseStack(stack); if (isArray(_self[_DYN_PARSED_STACK ])) { arrMap(_self[_DYN_PARSED_STACK ], function (frame) { frame[_DYN_ASSEMBLY ] = dataSanitizeString(logger, frame[_DYN_ASSEMBLY ]); frame[_DYN_FILE_NAME ] = dataSanitizeString(logger, frame[_DYN_FILE_NAME ]); }); } _self[strStack] = dataSanitizeException(logger, _formatStackTrace(stack)); _self.hasFullStack = isArray(_self.parsedStack) && _self.parsedStack[_DYN_LENGTH$4 ] > 0; if (properties) { properties[_DYN_TYPE_NAME ] = properties[_DYN_TYPE_NAME ] || _self[_DYN_TYPE_NAME ]; } } else { _self[_DYN_TYPE_NAME ] = exception[_DYN_TYPE_NAME ]; _self[_DYN_MESSAGE$1 ] = exception[_DYN_MESSAGE$1 ]; _self[strStack] = exception[strStack]; _self[_DYN_PARSED_STACK ] = exception[_DYN_PARSED_STACK ] || []; _self[_DYN_HAS_FULL_STACK ] = exception[_DYN_HAS_FULL_STACK ]; } } _ExceptionDetails.prototype.toInterface = function () { var _a; var _self = this; var parsedStack = _self[_DYN_PARSED_STACK ] instanceof Array && arrMap(_self[_DYN_PARSED_STACK ], function (frame) { return frame.toInterface(); }); var exceptionDetailsInterface = (_a = { id: _self.id, outerId: _self.outerId, typeName: _self[_DYN_TYPE_NAME ], message: _self[_DYN_MESSAGE$1 ], hasFullStack: _self[_DYN_HAS_FULL_STACK ], stack: _self[strStack] }, _a[_DYN_PARSED_STACK ] = parsedStack || undefined, _a); return exceptionDetailsInterface; }; _ExceptionDetails.CreateFromInterface = function (logger, exception) { var parsedStack = (exception[_DYN_PARSED_STACK ] instanceof Array && arrMap(exception[_DYN_PARSED_STACK ], function (frame) { return _StackFrame[_DYN__CREATE_FROM_INTERFA1 ](frame); })) || exception[_DYN_PARSED_STACK ]; var exceptionDetails = new _ExceptionDetails(logger, __assignFn(__assignFn({}, exception), { parsedStack: parsedStack })); return exceptionDetails; }; return _ExceptionDetails; }()); var _StackFrame = /** @class */ (function () { function _StackFrame(sourceFrame, level) { this.aiDataContract = { level: 1 , method: 1 , assembly: 0 , fileName: 0 , line: 0 }; var _self = this; _self[_DYN_SIZE_IN_BYTES ] = 0; if (typeof sourceFrame === "string") { var frame = sourceFrame; _self[_DYN_LEVEL ] = level; _self[_DYN_METHOD$1 ] = NoMethod; _self[_DYN_ASSEMBLY ] = strTrim(frame); _self[_DYN_FILE_NAME ] = ""; _self[_DYN_LINE ] = 0; var matches = frame.match(_StackFrame.regex); if (matches && matches[_DYN_LENGTH$4 ] >= 5) { _self[_DYN_METHOD$1 ] = strTrim(matches[2]) || _self[_DYN_METHOD$1 ]; _self[_DYN_FILE_NAME ] = strTrim(matches[4]); _self[_DYN_LINE ] = parseInt(matches[5]) || 0; } } else { _self[_DYN_LEVEL ] = sourceFrame[_DYN_LEVEL ]; _self[_DYN_METHOD$1 ] = sourceFrame[_DYN_METHOD$1 ]; _self[_DYN_ASSEMBLY ] = sourceFrame[_DYN_ASSEMBLY ]; _self[_DYN_FILE_NAME ] = sourceFrame[_DYN_FILE_NAME ]; _self[_DYN_LINE ] = sourceFrame[_DYN_LINE ]; _self[_DYN_SIZE_IN_BYTES ] = 0; } _self.sizeInBytes += _self.method[_DYN_LENGTH$4 ]; _self.sizeInBytes += _self.fileName[_DYN_LENGTH$4 ]; _self.sizeInBytes += _self.assembly[_DYN_LENGTH$4 ]; _self[_DYN_SIZE_IN_BYTES ] += _StackFrame.baseSize; _self.sizeInBytes += _self.level.toString()[_DYN_LENGTH$4 ]; _self.sizeInBytes += _self.line.toString()[_DYN_LENGTH$4 ]; } _StackFrame.CreateFromInterface = function (frame) { return new _StackFrame(frame, null ); }; _StackFrame.prototype.toInterface = function () { var _self = this; return { level: _self[_DYN_LEVEL ], method: _self[_DYN_METHOD$1 ], assembly: _self[_DYN_ASSEMBLY ], fileName: _self[_DYN_FILE_NAME ], line: _self[_DYN_LINE ] }; }; _StackFrame.regex = /^([\s]+at)?[\s]{0,50}([^\@\()]+?)[\s]{0,50}(\@|\()([^\(\n]+):([0-9]+):([0-9]+)(\)?)$/; _StackFrame.baseSize = 58; return _StackFrame; }()); var DataPoint = /** @class */ (function () { function DataPoint() { this.aiDataContract = { name: 1 , kind: 0 , value: 1 , count: 0 , min: 0 , max: 0 , stdDev: 0 }; this.kind = 0 ; } return DataPoint; }()); var Metric = /** @class */ (function () { function Metric(logger, name, value, count, min, max, stdDev, properties, measurements) { this.aiDataContract = { ver: 1 , metrics: 1 , properties: 0 }; var _self = this; _self.ver = 2; var dataPoint = new DataPoint(); dataPoint[_DYN_COUNT$1 ] = count > 0 ? count : undefined; dataPoint.max = isNaN(max) || max === null ? undefined : max; dataPoint.min = isNaN(min) || min === null ? undefined : min; dataPoint[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; dataPoint.value = value; dataPoint.stdDev = isNaN(stdDev) || stdDev === null ? undefined : stdDev; _self.metrics = [dataPoint]; _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); } Metric.envelopeType = "Microsoft.ApplicationInsights.{0}.Metric"; Metric.dataType = "MetricData"; return Metric; }()); var strEmpty = ""; function msToTimeSpan(totalms) { if (isNaN(totalms) || totalms < 0) { totalms = 0; } totalms = Math.round(totalms); var ms = strEmpty + totalms % 1000; var sec = strEmpty + Math.floor(totalms / 1000) % 60; var min = strEmpty + Math.floor(totalms / (1000 * 60)) % 60; var hour = strEmpty + Math.floor(totalms / (1000 * 60 * 60)) % 24; var days = Math.floor(totalms / (1000 * 60 * 60 * 24)); ms = ms[_DYN_LENGTH$4 ] === 1 ? "00" + ms : ms[_DYN_LENGTH$4 ] === 2 ? "0" + ms : ms; sec = sec[_DYN_LENGTH$4 ] < 2 ? "0" + sec : sec; min = min[_DYN_LENGTH$4 ] < 2 ? "0" + min : min; hour = hour[_DYN_LENGTH$4 ] < 2 ? "0" + hour : hour; return (days > 0 ? days + "." : strEmpty) + hour + ":" + min + ":" + sec + "." + ms; } function isCrossOriginError(message, url, lineNumber, columnNumber, error) { return !error && isString(message) && (message === "Script error." || message === "Script error"); } var PageView = /** @class */ (function () { function PageView(logger, name, url, durationMs, properties, measurements, id) { this.aiDataContract = { ver: 1 , name: 0 , url: 0 , duration: 0 , properties: 0 , measurements: 0 , id: 0 }; var _self = this; _self.ver = 2; _self.id = dataSanitizeId(logger, id); _self.url = dataSanitizeUrl(logger, url); _self[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; if (!isNaN(durationMs)) { _self[_DYN_DURATION$1 ] = msToTimeSpan(durationMs); } _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); } PageView.envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview"; PageView.dataType = "PageviewData"; return PageView; }()); var RemoteDependencyData = /** @class */ (function () { function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, requestAPI, correlationContext, properties, measurements) { if (requestAPI === void 0) { requestAPI = "Ajax"; } this.aiDataContract = { id: 1 , ver: 1 , name: 0 , resultCode: 0 , duration: 0 , success: 0 , data: 0 , target: 0 , type: 0 , properties: 0 , measurements: 0 , kind: 0 , value: 0 , count: 0 , min: 0 , max: 0 , stdDev: 0 , dependencyKind: 0 , dependencySource: 0 , commandName: 0 , dependencyTypeName: 0 }; var _self = this; _self.ver = 2; _self.id = id; _self[_DYN_DURATION$1 ] = msToTimeSpan(value); _self.success = success; _self.resultCode = resultCode + ""; _self.type = dataSanitizeString(logger, requestAPI); var dependencyFields = AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName); _self.data = dataSanitizeUrl(logger, commandName) || dependencyFields.data; _self.target = dataSanitizeString(logger, dependencyFields.target); if (correlationContext) { _self.target = "".concat(_self.target, " | ").concat(correlationContext); } _self[_DYN_NAME$2 ] = dataSanitizeString(logger, dependencyFields[_DYN_NAME$2 ]); _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); } RemoteDependencyData.envelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency"; RemoteDependencyData.dataType = "RemoteDependencyData"; return RemoteDependencyData; }()); var Trace = /** @class */ (function () { function Trace(logger, message, severityLevel, properties, measurements) { this.aiDataContract = { ver: 1 , message: 1 , severityLevel: 0 , properties: 0 }; var _self = this; _self.ver = 2; message = message || strNotSpecified; _self[_DYN_MESSAGE$1 ] = dataSanitizeMessage(logger, message); _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); if (severityLevel) { _self[_DYN_SEVERITY_LEVEL ] = severityLevel; } } Trace.envelopeType = "Microsoft.ApplicationInsights.{0}.Message"; Trace.dataType = "MessageData"; return Trace; }()); var PageViewPerformance = /** @class */ (function () { function PageViewPerformance(logger, name, url, unused, properties, measurements, cs4BaseData) { this.aiDataContract = { ver: 1 , name: 0 , url: 0 , duration: 0 , perfTotal: 0 , networkConnect: 0 , sentRequest: 0 , receivedResponse: 0 , domProcessing: 0 , properties: 0 , measurements: 0 }; var _self = this; _self.ver = 2; _self.url = dataSanitizeUrl(logger, url); _self[_DYN_NAME$2 ] = dataSanitizeString(logger, name) || strNotSpecified; _self[_DYN_PROPERTIES ] = dataSanitizeProperties(logger, properties); _self[_DYN_MEASUREMENTS$1 ] = dataSanitizeMeasurements(logger, measurements); if (cs4BaseData) { _self.domProcessing = cs4BaseData.domProcessing; _self[_DYN_DURATION$1 ] = cs4BaseData[_DYN_DURATION$1 ]; _self.networkConnect = cs4BaseData.networkConnect; _self.perfTotal = cs4BaseData.perfTotal; _self[_DYN_RECEIVED_RESPONSE ] = cs4BaseData[_DYN_RECEIVED_RESPONSE ]; _self.sentRequest = cs4BaseData.sentRequest; } } PageViewPerformance.envelopeType = "Microsoft.ApplicationInsights.{0}.PageviewPerformance"; PageViewPerformance.dataType = "PageviewPerformanceData"; return PageViewPerformance; }()); var Data = /** @class */ (function () { function Data(baseType, data) { this.aiDataContract = { baseType: 1 , baseData: 1 }; this.baseType = baseType; this.baseData = data; } return Data; }()); function _aiNameFunc(baseName) { var aiName = "ai." + baseName + "."; return function (name) { return aiName + name; }; } var _aiApplication = _aiNameFunc("application"); var _aiDevice = _aiNameFunc("device"); var _aiLocation = _aiNameFunc("location"); var _aiOperation = _aiNameFunc("operation"); var _aiSession = _aiNameFunc("session"); var _aiUser = _aiNameFunc("user"); var _aiCloud = _aiNameFunc("cloud"); var _aiInternal = _aiNameFunc("internal"); var ContextTagKeys = /** @class */ (function (_super) { __extendsFn(ContextTagKeys, _super); function ContextTagKeys() { return _super.call(this) || this; } return ContextTagKeys; }(createClassFromInterface({ applicationVersion: _aiApplication("ver"), applicationBuild: _aiApplication("build"), applicationTypeId: _aiApplication("typeId"), applicationId: _aiApplication("applicationId"), applicationLayer: _aiApplication("layer"), deviceId: _aiDevice("id"), deviceIp: _aiDevice("ip"), deviceLanguage: _aiDevice("language"), deviceLocale: _aiDevice("locale"), deviceModel: _aiDevice("model"), deviceFriendlyName: _aiDevice("friendlyName"), deviceNetwork: _aiDevice("network"), deviceNetworkName: _aiDevice("networkName"), deviceOEMName: _aiDevice("oemName"), deviceOS: _aiDevice("os"), deviceOSVersion: _aiDevice("osVersion"), deviceRoleInstance: _aiDevice("roleInstance"), deviceRoleName: _aiDevice("roleName"), deviceScreenResolution: _aiDevice("screenResolution"), deviceType: _aiDevice("type"), deviceMachineName: _aiDevice("machineName"), deviceVMName: _aiDevice("vmName"), deviceBrowser: _aiDevice("browser"), deviceBrowserVersion: _aiDevice("browserVersion"), locationIp: _aiLocation("ip"), locationCountry: _aiLocation("country"), locationProvince: _aiLocation("province"), locationCity: _aiLocation("city"), operationId: _aiOperation("id"), operationName: _aiOperation("name"), operationParentId: _aiOperation("parentId"), operationRootId: _aiOperation("rootId"), operationSyntheticSource: _aiOperation("syntheticSource"), operationCorrelationVector: _aiOperation("correlationVector"), sessionId: _aiSession("id"), sessionIsFirst: _aiSession("isFirst"), sessionIsNew: _aiSession("isNew"), userAccountAcquisitionDate: _aiUser("accountAcquisitionDate"), userAccountId: _aiUser("accountId"), userAgent: _aiUser("userAgent"), userId: _aiUser("id"), userStoreRegion: _aiUser("storeRegion"), userAuthUserId: _aiUser("authUserId"), userAnonymousUserAcquisitionDate: _aiUser("anonUserAcquisitionDate"), userAuthenticatedUserAcquisitionDate: _aiUser("authUserAcquisitionDate"), cloudName: _aiCloud("name"), cloudRole: _aiCloud("role"), cloudRoleVer: _aiCloud("roleVer"), cloudRoleInstance: _aiCloud("roleInstance"), cloudEnvironment: _aiCloud("environment"), cloudLocation: _aiCloud("location"), cloudDeploymentUnit: _aiCloud("deploymentUnit"), internalNodeName: _aiInternal("nodeName"), internalSdkVersion: _aiInternal("sdkVersion"), internalAgentVersion: _aiInternal("agentVersion"), internalSnippet: _aiInternal("snippet"), internalSdkSrc: _aiInternal("sdkSrc") }))); function createTelemetryItem(item, baseType, envelopeName, logger, customProperties, systemProperties) { var _a; envelopeName = dataSanitizeString(logger, envelopeName) || strNotSpecified; if (isNullOrUndefined(item) || isNullOrUndefined(baseType) || isNullOrUndefined(envelopeName)) { throwError("Input doesn't contain all required fields"); } var iKey = ""; if (item[strIkey]) { iKey = item[strIkey]; delete item[strIkey]; } var telemetryItem = (_a = {}, _a[_DYN_NAME$2 ] = envelopeName, _a.time = toISOString(new Date()), _a.iKey = iKey, _a.ext = systemProperties ? systemProperties : {}, _a.tags = [], _a.data = {}, _a.baseType = baseType, _a.baseData = item , _a); if (!isNullOrUndefined(customProperties)) { objForEachKey(customProperties, function (prop, value) { telemetryItem.data[prop] = value; }); } return telemetryItem; } var Extensions = { UserExt: "user", DeviceExt: "device", TraceExt: "trace", WebExt: "web", AppExt: "app", OSExt: "os", SessionExt: "ses", SDKExt: "sdk" }; var CtxTagKeys = new ContextTagKeys(); function createDomEvent(eventName) { var event = null; if (isFunction(Event)) { event = new Event(eventName); } else { var doc = getDocument(); if (doc && doc.createEvent) { event = doc.createEvent("Event"); event.initEvent(eventName, true, true); } } return event; } var PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin"; var BreezeChannelIdentifier = "AppInsightsChannelPlugin"; var AnalyticsPluginIdentifier = "ApplicationInsightsAnalytics"; var _DYN_TO_STRING$1 = "toString"; var _DYN_IS_STORAGE_USE_DISAB0 = "isStorageUseDisabled"; var _DYN__ADD_HOOK$1 = "_addHook"; var _DYN_CORE$1 = "core"; var _DYN_DATA_TYPE$1 = "dataType"; var _DYN_ENVELOPE_TYPE$1 = "envelopeType"; var _DYN_DIAG_LOG$1 = "diagLog"; var _DYN_TRACK = "track"; var _DYN_TRACK_PAGE_VIEW = "trackPageView"; var _DYN_TRACK_PREVIOUS_PAGE_1 = "trackPreviousPageVisit"; var _DYN_SEND_PAGE_VIEW_INTER2 = "sendPageViewInternal"; var _DYN_GET_ENTRIES_BY_TYPE = "getEntriesByType"; var _DYN_START_TIME$1 = "startTime"; var _DYN_DURATION = "duration"; var _DYN_SEND_PAGE_VIEW_PERFO3 = "sendPageViewPerformanceInternal"; var _DYN_POPULATE_PAGE_VIEW_P4 = "populatePageViewPerformanceEvent"; var _DYN_HREF = "href"; var _DYN_SEND_EXCEPTION_INTER5 = "sendExceptionInternal"; var _DYN_EXCEPTION$1 = "exception"; var _DYN_ERROR = "error"; var _DYN__ONERROR = "_onerror"; var _DYN_ERROR_SRC = "errorSrc"; var _DYN_LINE_NUMBER = "lineNumber"; var _DYN_COLUMN_NUMBER = "columnNumber"; var _DYN_MESSAGE = "message"; var _DYN__CREATE_AUTO_EXCEPTI6 = "CreateAutoException"; var _DYN_ADD_TELEMETRY_INITIA7 = "addTelemetryInitializer"; var _DYN_OVERRIDE_PAGE_VIEW_D8 = "overridePageViewDuration"; var _DYN_AUTO_TRACK_PAGE_VISI9 = "autoTrackPageVisitTime"; var _DYN_IS_BROWSER_LINK_TRAC10 = "isBrowserLinkTrackingEnabled"; var _DYN_LENGTH$3 = "length"; var _DYN_ENABLE_AUTO_ROUTE_TR11 = "enableAutoRouteTracking"; var _DYN_ENABLE_UNHANDLED_PRO12 = "enableUnhandledPromiseRejectionTracking"; var _DYN_AUTO_UNHANDLED_PROMI13 = "autoUnhandledPromiseInstrumented"; var _DYN_IS_PERFORMANCE_TIMIN14 = "isPerformanceTimingSupported"; var _DYN_GET_PERFORMANCE_TIMI15 = "getPerformanceTiming"; var _DYN_NAVIGATION_START = "navigationStart"; var _DYN_SHOULD_COLLECT_DURAT16 = "shouldCollectDuration"; var _DYN_IS_PERFORMANCE_TIMIN17 = "isPerformanceTimingDataReady"; var _DYN_RESPONSE_START = "responseStart"; var _DYN_REQUEST_START = "requestStart"; var _DYN_LOAD_EVENT_END = "loadEventEnd"; var _DYN_RESPONSE_END = "responseEnd"; var _DYN_CONNECT_END = "connectEnd"; var _DYN_PAGE_VISIT_START_TIM18 = "pageVisitStartTime"; var PageViewManager = /** @class */ (function () { function PageViewManager(appInsights, overridePageViewDuration, core, pageViewPerformanceManager) { dynamicProto(PageViewManager, this, function (_self) { var queueTimer = null; var itemQueue = []; var pageViewPerformanceSent = false; var _logger; if (core) { _logger = core.logger; } function _flushChannels(isAsync) { if (core) { core.flush(isAsync, function () { }); } } function _startTimer() { if (!queueTimer) { queueTimer = scheduleTimeout((function () { queueTimer = null; var allItems = itemQueue.slice(0); var doFlush = false; itemQueue = []; arrForEach(allItems, function (item) { if (!item()) { itemQueue.push(item); } else { doFlush = true; } }); if (itemQueue[_DYN_LENGTH$3 ] > 0) { _startTimer(); } if (doFlush) { _flushChannels(true); } }), 100); } } function _addQueue(cb) { itemQueue.push(cb); _startTimer(); } _self[_DYN_TRACK_PAGE_VIEW ] = function (pageView, customProperties) { var name = pageView.name; if (isNullOrUndefined(name) || typeof name !== "string") { var doc = getDocument(); name = pageView.name = doc && doc.title || ""; } var uri = pageView.uri; if (isNullOrUndefined(uri) || typeof uri !== "string") { var location_1 = getLocation(); uri = pageView.uri = location_1 && location_1[_DYN_HREF ] || ""; } if (!pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN14 ]()) { appInsights[_DYN_SEND_PAGE_VIEW_INTER2 ](pageView, customProperties); _flushChannels(true); if (!isWebWorker()) { _throwInternal(_logger, 2 , 25 , "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info."); } return; } var pageViewSent = false; var customDuration; var start = pageViewPerformanceManager[_DYN_GET_PERFORMANCE_TIMI15 ]()[_DYN_NAVIGATION_START ]; if (start > 0) { customDuration = dateTimeUtilsDuration(start, +new Date); if (!pageViewPerformanceManager[_DYN_SHOULD_COLLECT_DURAT16 ](customDuration)) { customDuration = undefined; } } var duration; if (!isNullOrUndefined(customProperties) && !isNullOrUndefined(customProperties[_DYN_DURATION ])) { duration = customProperties[_DYN_DURATION ]; } if (overridePageViewDuration || !isNaN(duration)) { if (isNaN(duration)) { if (!customProperties) { customProperties = {}; } customProperties[_DYN_DURATION ] = customDuration; } appInsights[_DYN_SEND_PAGE_VIEW_INTER2 ](pageView, customProperties); _flushChannels(true); pageViewSent = true; } var maxDurationLimit = 60000; if (!customProperties) { customProperties = {}; } _addQueue(function () { var processed = false; try { if (pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN17 ]()) { processed = true; var pageViewPerformance = { name: name, uri: uri }; pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P4 ](pageViewPerformance); if (!pageViewPerformance.isValid && !pageViewSent) { customProperties[_DYN_DURATION ] = customDuration; appInsights[_DYN_SEND_PAGE_VIEW_INTER2 ](pageView, customProperties); } else { if (!pageViewSent) { customProperties[_DYN_DURATION ] = pageViewPerformance.durationMs; appInsights[_DYN_SEND_PAGE_VIEW_INTER2 ](pageView, customProperties); } if (!pageViewPerformanceSent) { appInsights[_DYN_SEND_PAGE_VIEW_PERFO3 ](pageViewPerformance, customProperties); pageViewPerformanceSent = true; } } } else if (start > 0 && dateTimeUtilsDuration(start, +new Date) > maxDurationLimit) { processed = true; if (!pageViewSent) { customProperties[_DYN_DURATION ] = maxDurationLimit; appInsights[_DYN_SEND_PAGE_VIEW_INTER2 ](pageView, customProperties); } } } catch (e) { _throwInternal(_logger, 1 , 38 , "trackPageView failed on page load calculation: " + getExceptionName(e), { exception: dumpObj(e) }); } return processed; }); }; _self.teardown = function (unloadCtx, unloadState) { if (queueTimer) { queueTimer.cancel(); queueTimer = null; var allItems = itemQueue.slice(0); itemQueue = []; arrForEach(allItems, function (item) { if (item()) ; }); } }; }); } PageViewManager.__ieDyn=1; return PageViewManager; }()); var MAX_DURATION_ALLOWED = 3600000; var botAgentNames = ["googlebot", "adsbot-google", "apis-google", "mediapartners-google"]; function _isPerformanceTimingSupported() { var perf = getPerformance(); return perf && !!perf.timing; } function _isPerformanceNavigationTimingSupported() { var perf = getPerformance(); return perf && perf[_DYN_GET_ENTRIES_BY_TYPE ] && perf[_DYN_GET_ENTRIES_BY_TYPE ]("navigation")[_DYN_LENGTH$3 ] > 0; } function _isPerformanceTimingDataReady() { var perf = getPerformance(); var timing = perf ? perf.timing : 0; return timing && timing.domainLookupStart > 0 && timing[_DYN_NAVIGATION_START ] > 0 && timing[_DYN_RESPONSE_START ] > 0 && timing[_DYN_REQUEST_START ] > 0 && timing[_DYN_LOAD_EVENT_END ] > 0 && timing[_DYN_RESPONSE_END ] > 0 && timing[_DYN_CONNECT_END ] > 0 && timing.domLoading > 0; } function _getPerformanceTiming() { if (_isPerformanceTimingSupported()) { return getPerformance().timing; } return null; } function _getPerformanceNavigationTiming() { if (_isPerformanceNavigationTimingSupported()) { return getPerformance()[_DYN_GET_ENTRIES_BY_TYPE ]("navigation")[0]; } return null; } function _shouldCollectDuration() { var durations = []; for (var _i = 0; _i < arguments.length; _i++) { durations[_i] = arguments[_i]; } var _navigator = getNavigator() || {}; var userAgent = _navigator.userAgent; var isGoogleBot = false; if (userAgent) { for (var i = 0; i < botAgentNames[_DYN_LENGTH$3 ]; i++) { isGoogleBot = isGoogleBot || strIndexOf(userAgent.toLowerCase(), botAgentNames[i]) !== -1; } } if (isGoogleBot) { return false; } else { for (var i = 0; i < durations[_DYN_LENGTH$3 ]; i++) { if (durations[i] < 0 || durations[i] >= MAX_DURATION_ALLOWED) { return false; } } } return true; } var PageViewPerformanceManager = /** @class */ (function () { function PageViewPerformanceManager(core) { var _logger = safeGetLogger(core); dynamicProto(PageViewPerformanceManager, this, function (_self) { _self[_DYN_POPULATE_PAGE_VIEW_P4 ] = function (pageViewPerformance) { pageViewPerformance.isValid = false; var navigationTiming = _getPerformanceNavigationTiming(); var timing = _getPerformanceTiming(); var total = 0; var network = 0; var request = 0; var response = 0; var dom = 0; if (navigationTiming || timing) { if (navigationTiming) { total = navigationTiming[_DYN_DURATION ]; network = navigationTiming[_DYN_START_TIME$1 ] === 0 ? navigationTiming[_DYN_CONNECT_END ] : dateTimeUtilsDuration(navigationTiming[_DYN_START_TIME$1 ], navigationTiming[_DYN_CONNECT_END ]); request = dateTimeUtilsDuration(navigationTiming.requestStart, navigationTiming[_DYN_RESPONSE_START ]); response = dateTimeUtilsDuration(navigationTiming[_DYN_RESPONSE_START ], navigationTiming[_DYN_RESPONSE_END ]); dom = dateTimeUtilsDuration(navigationTiming.responseEnd, navigationTiming[_DYN_LOAD_EVENT_END ]); } else { total = dateTimeUtilsDuration(timing[_DYN_NAVIGATION_START ], timing[_DYN_LOAD_EVENT_END ]); network = dateTimeUtilsDuration(timing[_DYN_NAVIGATION_START ], timing[_DYN_CONNECT_END ]); request = dateTimeUtilsDuration(timing.requestStart, timing[_DYN_RESPONSE_START ]); response = dateTimeUtilsDuration(timing[_DYN_RESPONSE_START ], timing[_DYN_RESPONSE_END ]); dom = dateTimeUtilsDuration(timing.responseEnd, timing[_DYN_LOAD_EVENT_END ]); } if (total === 0) { _throwInternal(_logger, 2 , 10 , "error calculating page view performance.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (!_self[_DYN_SHOULD_COLLECT_DURAT16 ](total, network, request, response, dom)) { _throwInternal(_logger, 2 , 45 , "Invalid page load duration value. Browser perf data won't be sent.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (total < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(dom)) { _throwInternal(_logger, 2 , 8 , "client performance math error.", { total: total, network: network, request: request, response: response, dom: dom }); } else { pageViewPerformance.durationMs = total; pageViewPerformance.perfTotal = pageViewPerformance[_DYN_DURATION ] = msToTimeSpan(total); pageViewPerformance.networkConnect = msToTimeSpan(network); pageViewPerformance.sentRequest = msToTimeSpan(request); pageViewPerformance.receivedResponse = msToTimeSpan(response); pageViewPerformance.domProcessing = msToTimeSpan(dom); pageViewPerformance.isValid = true; } } }; _self[_DYN_GET_PERFORMANCE_TIMI15 ] = _getPerformanceTiming; _self[_DYN_IS_PERFORMANCE_TIMIN14 ] = _isPerformanceTimingSupported; _self[_DYN_IS_PERFORMANCE_TIMIN17 ] = _isPerformanceTimingDataReady; _self[_DYN_SHOULD_COLLECT_DURAT16 ] = _shouldCollectDuration; }); } PageViewPerformanceManager.__ieDyn=1; return PageViewPerformanceManager; }()); var PageVisitTimeManager = /** @class */ (function () { function PageVisitTimeManager(logger, pageVisitTimeTrackingHandler) { var prevPageVisitDataKeyName = "prevPageVisitData"; dynamicProto(PageVisitTimeManager, this, function (_self) { _self[_DYN_TRACK_PREVIOUS_PAGE_1 ] = function (currentPageName, currentPageUrl) { try { var prevPageVisitTimeData = restartPageVisitTimer(currentPageName, currentPageUrl); if (prevPageVisitTimeData) { pageVisitTimeTrackingHandler(prevPageVisitTimeData.pageName, prevPageVisitTimeData.pageUrl, prevPageVisitTimeData.pageVisitTime); } } catch (e) { _warnToConsole(logger, "Auto track page visit time failed, metric will not be collected: " + dumpObj(e)); } }; function restartPageVisitTimer(pageName, pageUrl) { var prevPageVisitData = null; try { prevPageVisitData = stopPageVisitTimer(); if (utlCanUseSessionStorage()) { if (utlGetSessionStorage(logger, prevPageVisitDataKeyName) != null) { throwError("Cannot call startPageVisit consecutively without first calling stopPageVisit"); } var currPageVisitDataStr = getJSON().stringify(new PageVisitData(pageName, pageUrl)); utlSetSessionStorage(logger, prevPageVisitDataKeyName, currPageVisitDataStr); } } catch (e) { _warnToConsole(logger, "Call to restart failed: " + dumpObj(e)); prevPageVisitData = null; } return prevPageVisitData; } function stopPageVisitTimer() { var prevPageVisitData = null; try { if (utlCanUseSessionStorage()) { var pageVisitEndTime = utcNow(); var pageVisitDataJsonStr = utlGetSessionStorage(logger, prevPageVisitDataKeyName); if (pageVisitDataJsonStr && hasJSON()) { prevPageVisitData = getJSON().parse(pageVisitDataJsonStr); prevPageVisitData.pageVisitTime = pageVisitEndTime - prevPageVisitData[_DYN_PAGE_VISIT_START_TIM18 ]; utlRemoveSessionStorage(logger, prevPageVisitDataKeyName); } } } catch (e) { _warnToConsole(logger, "Stop page visit timer failed: " + dumpObj(e)); prevPageVisitData = null; } return prevPageVisitData; } objDefine(_self, "_logger", { g: function () { return logger; } }); objDefine(_self, "pageVisitTimeTrackingHandler", { g: function () { return pageVisitTimeTrackingHandler; } }); }); } PageVisitTimeManager.__ieDyn=1; return PageVisitTimeManager; }()); var PageVisitData = /** @class */ (function () { function PageVisitData(pageName, pageUrl) { this[_DYN_PAGE_VISIT_START_TIM18 ] = utcNow(); this.pageName = pageName; this.pageUrl = pageUrl; } return PageVisitData; }()); var Timing = /** @class */ (function () { function Timing(logger, name) { var _self = this; var _events = {}; _self.start = function (name) { if (typeof _events[name] !== "undefined") { _throwInternal(logger, 2 , 62 , "start was called more than once for this event without calling stop.", { name: name, key: name }, true); } _events[name] = +new Date; }; _self.stop = function (name, url, properties, measurements) { var start = _events[name]; if (isNaN(start)) { _throwInternal(logger, 2 , 63 , "stop was called without a corresponding start.", { name: name, key: name }, true); } else { var end = +new Date; var duration = dateTimeUtilsDuration(start, end); _self.action(name, url, duration, properties, measurements); } delete _events[name]; _events[name] = undefined; }; } return Timing; }()); var _a$4; var strEvent = "event"; function _dispatchEvent(target, evnt) { if (target && target.dispatchEvent && evnt) { target.dispatchEvent(evnt); } } function _getReason(error) { if (error && error.reason) { var reason = error.reason; if (!isString(reason) && isFunction(reason[_DYN_TO_STRING$1 ])) { return reason[_DYN_TO_STRING$1 ](); } return dumpObj(reason); } return error || ""; } var MinMilliSeconds = 60000; var defaultValues = objDeepFreeze((_a$4 = { sessionRenewalMs: cfgDfSet(_chkConfigMilliseconds, 30 * 60 * 1000), sessionExpirationMs: cfgDfSet(_chkConfigMilliseconds, 24 * 60 * 60 * 1000), disableExceptionTracking: cfgDfBoolean() }, _a$4[_DYN_AUTO_TRACK_PAGE_VISI9 ] = cfgDfBoolean(), _a$4[_DYN_OVERRIDE_PAGE_VIEW_D8 ] = cfgDfBoolean(), _a$4[_DYN_ENABLE_UNHANDLED_PRO12 ] = cfgDfBoolean(), _a$4[_DYN_AUTO_UNHANDLED_PROMI13 ] = false, _a$4.samplingPercentage = cfgDfValidate(_chkSampling$1, 100), _a$4[_DYN_IS_STORAGE_USE_DISAB0 ] = cfgDfBoolean(), _a$4[_DYN_IS_BROWSER_LINK_TRAC10 ] = cfgDfBoolean(), _a$4[_DYN_ENABLE_AUTO_ROUTE_TR11 ] = cfgDfBoolean(), _a$4.namePrefix = cfgDfString(), _a$4.enableDebug = cfgDfBoolean(), _a$4.disableFlushOnBeforeUnload = cfgDfBoolean(), _a$4.disableFlushOnUnload = cfgDfBoolean(false, "disableFlushOnBeforeUnload"), _a$4)); function _chkConfigMilliseconds(value, defValue) { value = value || defValue; if (value < MinMilliSeconds) { value = MinMilliSeconds; } return +value; } function _chkSampling$1(value) { return !isNaN(value) && value > 0 && value <= 100; } function _updateStorageUsage(extConfig) { if (!isUndefined(extConfig[_DYN_IS_STORAGE_USE_DISAB0 ])) { if (extConfig[_DYN_IS_STORAGE_USE_DISAB0 ]) { utlDisableStorage(); } else { utlEnableStorage(); } } } var AnalyticsPlugin = /** @class */ (function (_super) { __extendsFn(AnalyticsPlugin, _super); function AnalyticsPlugin() { var _this = _super.call(this) || this; _this.identifier = AnalyticsPluginIdentifier; _this.priority = 180; _this.autoRoutePVDelay = 500; var _eventTracking; var _pageTracking; var _pageViewManager; var _pageViewPerformanceManager; var _pageVisitTimeManager; var _preInitTelemetryInitializers; var _isBrowserLinkTrackingEnabled; var _browserLinkInitializerAdded; var _enableAutoRouteTracking; var _historyListenerAdded; var _disableExceptionTracking; var _autoExceptionInstrumented; var _enableUnhandledPromiseRejectionTracking; var _autoUnhandledPromiseInstrumented; var _extConfig; var _autoTrackPageVisitTime; var _prevUri; var _currUri; var _evtNamespace; dynamicProto(AnalyticsPlugin, _this, function (_self, _base) { var _addHook = _base[_DYN__ADD_HOOK$1 ]; _initDefaults(); _self.getCookieMgr = function () { return safeGetCookieMgr(_self[_DYN_CORE$1 ]); }; _self.processTelemetry = function (env, itemCtx) { _self.processNext(env, itemCtx); }; _self.trackEvent = function (event, customProperties) { try { var telemetryItem = createTelemetryItem(event, Event$1[_DYN_DATA_TYPE$1 ], Event$1[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), customProperties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); } catch (e) { _throwInternal(2 , 39 , "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.startTrackEvent = function (name) { try { _eventTracking.start(name); } catch (e) { _throwInternal(1 , 29 , "startTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.stopTrackEvent = function (name, properties, measurements) { try { _eventTracking.stop(name, undefined, properties, measurements); } catch (e) { _throwInternal(1 , 30 , "stopTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.trackTrace = function (trace, customProperties) { try { var telemetryItem = createTelemetryItem(trace, Trace[_DYN_DATA_TYPE$1 ], Trace[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), customProperties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); } catch (e) { _throwInternal(2 , 39 , "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.trackMetric = function (metric, customProperties) { try { var telemetryItem = createTelemetryItem(metric, Metric[_DYN_DATA_TYPE$1 ], Metric[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), customProperties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); } catch (e) { _throwInternal(1 , 36 , "trackMetric failed, metric will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self[_DYN_TRACK_PAGE_VIEW ] = function (pageView, customProperties) { try { var inPv = pageView || {}; _pageViewManager[_DYN_TRACK_PAGE_VIEW ](inPv, __assignFn(__assignFn(__assignFn({}, inPv.properties), inPv.measurements), customProperties)); if (_autoTrackPageVisitTime) { _pageVisitTimeManager[_DYN_TRACK_PREVIOUS_PAGE_1 ](inPv.name, inPv.uri); } } catch (e) { _throwInternal(1 , 37 , "trackPageView failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self[_DYN_SEND_PAGE_VIEW_INTER2 ] = function (pageView, properties, systemProperties) { var doc = getDocument(); if (doc) { pageView.refUri = pageView.refUri === undefined ? doc.referrer : pageView.refUri; } var perf = getPerformance(); var navigationEntries = (perf && perf[_DYN_GET_ENTRIES_BY_TYPE ] && perf[_DYN_GET_ENTRIES_BY_TYPE ]("navigation")); if (navigationEntries) { var navigationEntry = navigationEntries[0]; var loadEventStart = navigationEntry.loadEventStart; pageView[_DYN_START_TIME$1 ] = new Date(perf.timeOrigin + loadEventStart); } else { var duration = ((properties || pageView.properties || {})[_DYN_DURATION ] || 0); pageView[_DYN_START_TIME$1 ] = new Date(new Date().getTime() - duration); } var telemetryItem = createTelemetryItem(pageView, PageView[_DYN_DATA_TYPE$1 ], PageView[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), properties, systemProperties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); }; _self[_DYN_SEND_PAGE_VIEW_PERFO3 ] = function (pageViewPerformance, properties, systemProperties) { var telemetryItem = createTelemetryItem(pageViewPerformance, PageViewPerformance[_DYN_DATA_TYPE$1 ], PageViewPerformance[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), properties, systemProperties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); }; _self.trackPageViewPerformance = function (pageViewPerformance, customProperties) { var inPvp = pageViewPerformance || {}; try { _pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P4 ](inPvp); _self[_DYN_SEND_PAGE_VIEW_PERFO3 ](inPvp, customProperties); } catch (e) { _throwInternal(1 , 37 , "trackPageViewPerformance failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.startTrackPage = function (name) { try { if (typeof name !== "string") { var doc = getDocument(); name = doc && doc.title || ""; } _pageTracking.start(name); } catch (e) { _throwInternal(1 , 31 , "startTrackPage failed, page view may not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self.stopTrackPage = function (name, url, properties, measurement) { try { if (typeof name !== "string") { var doc = getDocument(); name = doc && doc.title || ""; } if (typeof url !== "string") { var loc = getLocation(); url = loc && loc[_DYN_HREF ] || ""; } _pageTracking.stop(name, url, properties, measurement); if (_autoTrackPageVisitTime) { _pageVisitTimeManager[_DYN_TRACK_PREVIOUS_PAGE_1 ](name, url); } } catch (e) { _throwInternal(1 , 32 , "stopTrackPage failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self[_DYN_SEND_EXCEPTION_INTER5 ] = function (exception, customProperties, systemProperties) { var theError = (exception && (exception[_DYN_EXCEPTION$1 ] || exception[_DYN_ERROR ])) || isError(exception) && exception || { name: (exception && typeof exception), message: exception || strNotSpecified }; exception = exception || {}; var exceptionPartB = new Exception(_self[_DYN_DIAG_LOG$1 ](), theError, exception.properties || customProperties, exception.measurements, exception.severityLevel, exception.id).toInterface(); var telemetryItem = createTelemetryItem(exceptionPartB, Exception[_DYN_DATA_TYPE$1 ], Exception[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), customProperties, systemProperties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); }; _self.trackException = function (exception, customProperties) { if (exception && !exception[_DYN_EXCEPTION$1 ] && exception[_DYN_ERROR ]) { exception[_DYN_EXCEPTION$1 ] = exception[_DYN_ERROR ]; } try { _self[_DYN_SEND_EXCEPTION_INTER5 ](exception, customProperties); } catch (e) { _throwInternal(1 , 35 , "trackException failed, exception will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self[_DYN__ONERROR ] = function (exception) { var error = exception && exception[_DYN_ERROR ]; var evt = exception && exception.evt; try { if (!evt) { var _window = getWindow(); if (_window) { evt = _window[strEvent]; } } var url = (exception && exception.url) || (getDocument() || {}).URL; var errorSrc = exception[_DYN_ERROR_SRC ] || "window.onerror@" + url + ":" + (exception[_DYN_LINE_NUMBER ] || 0) + ":" + (exception[_DYN_COLUMN_NUMBER ] || 0); var properties = { errorSrc: errorSrc, url: url, lineNumber: exception[_DYN_LINE_NUMBER ] || 0, columnNumber: exception[_DYN_COLUMN_NUMBER ] || 0, message: exception[_DYN_MESSAGE ] }; if (isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception[_DYN_ERROR ])) { _sendCORSException(Exception[_DYN__CREATE_AUTO_EXCEPTI6 ]("Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.", url, exception[_DYN_LINE_NUMBER ] || 0, exception[_DYN_COLUMN_NUMBER ] || 0, error, evt, null, errorSrc), properties); } else { if (!exception[_DYN_ERROR_SRC ]) { exception[_DYN_ERROR_SRC ] = errorSrc; } _self.trackException({ exception: exception, severityLevel: 3 }, properties); } } catch (e) { var errorString = error ? (error.name + ", " + error[_DYN_MESSAGE ]) : "null"; _throwInternal(1 , 11 , "_onError threw exception while logging error, error will not be collected: " + getExceptionName(e), { exception: dumpObj(e), errorString: errorString }); } }; _self[_DYN_ADD_TELEMETRY_INITIA7 ] = function (telemetryInitializer) { if (_self[_DYN_CORE$1 ]) { return _self[_DYN_CORE$1 ][_DYN_ADD_TELEMETRY_INITIA7 ](telemetryInitializer); } if (!_preInitTelemetryInitializers) { _preInitTelemetryInitializers = []; } _preInitTelemetryInitializers.push(telemetryInitializer); }; _self.initialize = function (config, core, extensions, pluginChain) { if (_self.isInitialized()) { return; } if (isNullOrUndefined(core)) { throwError("Error initializing"); } _base.initialize(config, core, extensions, pluginChain); try { _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace()); if (_preInitTelemetryInitializers) { arrForEach(_preInitTelemetryInitializers, function (initializer) { core[_DYN_ADD_TELEMETRY_INITIA7 ](initializer); }); _preInitTelemetryInitializers = null; } _populateDefaults(config); _pageViewPerformanceManager = new PageViewPerformanceManager(_self[_DYN_CORE$1 ]); _pageViewManager = new PageViewManager(_self, _extConfig.overridePageViewDuration, _self[_DYN_CORE$1 ], _pageViewPerformanceManager); _pageVisitTimeManager = new PageVisitTimeManager(_self[_DYN_DIAG_LOG$1 ](), function (pageName, pageUrl, pageVisitTime) { return trackPageVisitTime(pageName, pageUrl, pageVisitTime); }); _eventTracking = new Timing(_self[_DYN_DIAG_LOG$1 ](), "trackEvent"); _eventTracking.action = function (name, url, duration, properties, measurements) { if (!properties) { properties = {}; } if (!measurements) { measurements = {}; } properties.duration = duration[_DYN_TO_STRING$1 ](); _self.trackEvent({ name: name, properties: properties, measurements: measurements }); }; _pageTracking = new Timing(_self[_DYN_DIAG_LOG$1 ](), "trackPageView"); _pageTracking.action = function (name, url, duration, properties, measurements) { if (isNullOrUndefined(properties)) { properties = {}; } properties.duration = duration[_DYN_TO_STRING$1 ](); var pageViewItem = { name: name, uri: url, properties: properties, measurements: measurements }; _self[_DYN_SEND_PAGE_VIEW_INTER2 ](pageViewItem, properties); }; if (hasWindow()) { _updateExceptionTracking(); _updateLocationChange(); } } catch (e) { _self.setInitialized(false); throw e; } }; _self._doTeardown = function (unloadCtx, unloadState) { _pageViewManager && _pageViewManager.teardown(unloadCtx, unloadState); eventOff(window, null, null, _evtNamespace); _initDefaults(); }; function _populateDefaults(config) { var identifier = _self.identifier; var core = _self[_DYN_CORE$1 ]; _self[_DYN__ADD_HOOK$1 ](onConfigChange(config, function () { var ctx = createProcessTelemetryContext(null, config, core); _extConfig = ctx.getExtCfg(identifier, defaultValues); _autoTrackPageVisitTime = _extConfig[_DYN_AUTO_TRACK_PAGE_VISI9 ]; if (config.storagePrefix) { utlSetStoragePrefix(config.storagePrefix); } _updateStorageUsage(_extConfig); _isBrowserLinkTrackingEnabled = _extConfig[_DYN_IS_BROWSER_LINK_TRAC10 ]; _addDefaultTelemetryInitializers(); })); } function trackPageVisitTime(pageName, pageUrl, pageVisitTime) { var properties = { PageName: pageName, PageUrl: pageUrl }; _self.trackMetric({ name: "PageVisitTime", average: pageVisitTime, max: pageVisitTime, min: pageVisitTime, sampleCount: 1 }, properties); } function _addDefaultTelemetryInitializers() { if (!_browserLinkInitializerAdded && _isBrowserLinkTrackingEnabled) { var browserLinkPaths_1 = ["/browserLinkSignalR/", "/__browserLink/"]; var dropBrowserLinkRequests = function (envelope) { if (_isBrowserLinkTrackingEnabled && envelope.baseType === RemoteDependencyData[_DYN_DATA_TYPE$1 ]) { var remoteData = envelope.baseData; if (remoteData) { for (var i = 0; i < browserLinkPaths_1[_DYN_LENGTH$3 ]; i++) { if (remoteData.target && strIndexOf(remoteData.target, browserLinkPaths_1[i]) >= 0) { return false; } } } } return true; }; _self[_DYN__ADD_HOOK$1 ](_self[_DYN_ADD_TELEMETRY_INITIA7 ](dropBrowserLinkRequests)); _browserLinkInitializerAdded = true; } } function _sendCORSException(exception, properties) { var telemetryItem = createTelemetryItem(exception, Exception[_DYN_DATA_TYPE$1 ], Exception[_DYN_ENVELOPE_TYPE$1 ], _self[_DYN_DIAG_LOG$1 ](), properties); _self[_DYN_CORE$1 ][_DYN_TRACK ](telemetryItem); } function _updateExceptionTracking() { var _window = getWindow(); var locn = getLocation(true); _self[_DYN__ADD_HOOK$1 ](onConfigChange(_extConfig, function () { _disableExceptionTracking = _extConfig.disableExceptionTracking; if (!_disableExceptionTracking && !_autoExceptionInstrumented && !_extConfig.autoExceptionInstrumented) { _addHook(InstrumentEvent(_window, "onerror", { ns: _evtNamespace, rsp: function (callDetails, message, url, lineNumber, columnNumber, error) { if (!_disableExceptionTracking && callDetails.rslt !== true) { _self[_DYN__ONERROR ](Exception[_DYN__CREATE_AUTO_EXCEPTI6 ](message, url, lineNumber, columnNumber, error, callDetails.evt)); } } }, false)); _autoExceptionInstrumented = true; } })); _addUnhandledPromiseRejectionTracking(_window, locn); } function _updateLocationChange() { var win = getWindow(); var locn = getLocation(true); _self[_DYN__ADD_HOOK$1 ](onConfigChange(_extConfig, function () { _enableAutoRouteTracking = _extConfig[_DYN_ENABLE_AUTO_ROUTE_TR11 ] === true; if (win && _enableAutoRouteTracking && !_historyListenerAdded && hasHistory()) { var _history = getHistory(); if (isFunction(_history.pushState) && isFunction(_history.replaceState) && typeof Event !== strShimUndefined) { _addHistoryListener(win, _history, locn); } } })); } function _getDistributedTraceCtx() { var distributedTraceCtx = null; if (_self[_DYN_CORE$1 ] && _self[_DYN_CORE$1 ].getTraceCtx) { distributedTraceCtx = _self[_DYN_CORE$1 ].getTraceCtx(false); } if (!distributedTraceCtx) { var properties = _self[_DYN_CORE$1 ].getPlugin(PropertiesPluginIdentifier); if (properties) { var context = properties.plugin.context; if (context) { distributedTraceCtx = createDistributedTraceContextFromTrace(context.telemetryTrace); } } } return distributedTraceCtx; } function _addHistoryListener(win, history, locn) { if (_historyListenerAdded) { return; } var namePrefix = _extConfig.namePrefix || ""; function _popstateHandler() { if (_enableAutoRouteTracking) { _dispatchEvent(win, createDomEvent(namePrefix + "locationchange")); } } function _locationChangeHandler() { if (_currUri) { _prevUri = _currUri; _currUri = locn && locn[_DYN_HREF ] || ""; } else { _currUri = locn && locn[_DYN_HREF ] || ""; } if (_enableAutoRouteTracking) { var distributedTraceCtx = _getDistributedTraceCtx(); if (distributedTraceCtx) { distributedTraceCtx.setTraceId(generateW3CId()); var traceLocationName = "_unknown_"; if (locn && locn.pathname) { traceLocationName = locn.pathname + (locn.hash || ""); } distributedTraceCtx.setName(dataSanitizeString(_self[_DYN_DIAG_LOG$1 ](), traceLocationName)); } scheduleTimeout((function (uri) { _self[_DYN_TRACK_PAGE_VIEW ]({ refUri: uri, properties: { duration: 0 } }); }).bind(_self, _prevUri), _self.autoRoutePVDelay); } } _addHook(InstrumentEvent(history, "pushState", { ns: _evtNamespace, rsp: function () { if (_enableAutoRouteTracking) { _dispatchEvent(win, createDomEvent(namePrefix + "pushState")); _dispatchEvent(win, createDomEvent(namePrefix + "locationchange")); } } }, true)); _addHook(InstrumentEvent(history, "replaceState", { ns: _evtNamespace, rsp: function () { if (_enableAutoRouteTracking) { _dispatchEvent(win, createDomEvent(namePrefix + "replaceState")); _dispatchEvent(win, createDomEvent(namePrefix + "locationchange")); } } }, true)); eventOn(win, namePrefix + "popstate", _popstateHandler, _evtNamespace); eventOn(win, namePrefix + "locationchange", _locationChangeHandler, _evtNamespace); _historyListenerAdded = true; } function _addUnhandledPromiseRejectionTracking(_window, _location) { _self[_DYN__ADD_HOOK$1 ](onConfigChange(_extConfig, function () { _enableUnhandledPromiseRejectionTracking = _extConfig[_DYN_ENABLE_UNHANDLED_PRO12 ] === true; _autoExceptionInstrumented = _autoExceptionInstrumented || _extConfig[_DYN_AUTO_UNHANDLED_PROMI13 ]; if (_enableUnhandledPromiseRejectionTracking && !_autoUnhandledPromiseInstrumented) { _addHook(InstrumentEvent(_window, "onunhandledrejection", { ns: _evtNamespace, rsp: function (callDetails, error) { if (_enableUnhandledPromiseRejectionTracking && callDetails.rslt !== true) { _self[_DYN__ONERROR ](Exception[_DYN__CREATE_AUTO_EXCEPTI6 ](_getReason(error), _location ? _location[_DYN_HREF ] : "", 0, 0, error, callDetails.evt)); } } }, false)); _extConfig[_DYN_AUTO_UNHANDLED_PROMI13 ] = _autoUnhandledPromiseInstrumented = true; } })); } function _throwInternal(severity, msgId, msg, properties, isUserAct) { _self[_DYN_DIAG_LOG$1 ]().throwInternal(severity, msgId, msg, properties, isUserAct); } function _initDefaults() { _eventTracking = null; _pageTracking = null; _pageViewManager = null; _pageViewPerformanceManager = null; _pageVisitTimeManager = null; _preInitTelemetryInitializers = null; _isBrowserLinkTrackingEnabled = false; _browserLinkInitializerAdded = false; _enableAutoRouteTracking = false; _historyListenerAdded = false; _disableExceptionTracking = false; _autoExceptionInstrumented = false; _enableUnhandledPromiseRejectionTracking = false; _autoUnhandledPromiseInstrumented = false; _autoTrackPageVisitTime = false; var location = getLocation(true); _prevUri = location && location[_DYN_HREF ] || ""; _currUri = null; _evtNamespace = null; _extConfig = null; objDefine(_self, "config", { g: function () { return _extConfig; } }); } objDefine(_self, "_pageViewManager", { g: function () { return _pageViewManager; } }); objDefine(_self, "_pageViewPerformanceManager", { g: function () { return _pageViewPerformanceManager; } }); objDefine(_self, "_pageVisitTimeManager", { g: function () { return _pageVisitTimeManager; } }); objDefine(_self, "_evtNamespace", { g: function () { return "." + _evtNamespace; } }); }); return _this; } AnalyticsPlugin.Version = '3.0.2'; return AnalyticsPlugin; }(BaseTelemetryPlugin)); var STR_DURATION$1 = "duration"; var _DYN_TAGS = "tags"; var _DYN_DEVICE_TYPE = "deviceType"; var _DYN_DATA = "data"; var _DYN_NAME$1 = "name"; var _DYN_TRACE_ID$1 = "traceID"; var _DYN_LENGTH$2 = "length"; var _DYN_STRINGIFY = "stringify"; var _DYN_MEASUREMENTS = "measurements"; var _DYN_DATA_TYPE = "dataType"; var _DYN_ENVELOPE_TYPE = "envelopeType"; var _DYN_TO_STRING = "toString"; var _DYN_ON_LINE = "onLine"; var _DYN_IS_ONLINE = "isOnline"; var _DYN__GET = "_get"; var _DYN_ENQUEUE = "enqueue"; var _DYN_COUNT = "count"; var _DYN_EVENTS_LIMIT_IN_MEM = "eventsLimitInMem"; var _DYN_PUSH = "push"; var _DYN_EMIT_LINE_DELIMITED_0 = "emitLineDelimitedJson"; var _DYN_CLEAR = "clear"; var _DYN_BATCH_PAYLOADS = "batchPayloads"; var _DYN_CREATE_NEW = "createNew"; var _DYN_MARK_AS_SENT = "markAsSent"; var _DYN_CLEAR_SENT = "clearSent"; var _DYN_BUFFER_OVERRIDE = "bufferOverride"; var _DYN__BUFFER__KEY = "BUFFER_KEY"; var _DYN__SENT__BUFFER__KEY = "SENT_BUFFER_KEY"; var _DYN__MAX__BUFFER__SIZE = "MAX_BUFFER_SIZE"; var _DYN_TRIGGER_SEND = "triggerSend"; var _DYN_DIAG_LOG = "diagLog"; var _DYN__SENDER = "_sender"; var _DYN_CUSTOM_HEADERS = "customHeaders"; var _DYN_MAX_BATCH_SIZE_IN_BY1 = "maxBatchSizeInBytes"; var _DYN_ONUNLOAD_DISABLE_BEA2 = "onunloadDisableBeacon"; var _DYN_IS_BEACON_API_DISABL3 = "isBeaconApiDisabled"; var _DYN_ENABLE_SESSION_STORA4 = "enableSessionStorageBuffer"; var _DYN__BUFFER = "_buffer"; var _DYN_INSTRUMENTATION_KEY$1 = "instrumentationKey"; var _DYN_DISABLE_XHR = "disableXhr"; var _DYN_ONUNLOAD_DISABLE_FET5 = "onunloadDisableFetch"; var _DYN_CONVERT_UNDEFINED = "convertUndefined"; var _DYN_MAX_BATCH_INTERVAL = "maxBatchInterval"; var _DYN_BASE_TYPE = "baseType"; var _DYN_SAMPLE_RATE = "sampleRate"; var _DYN__XHR_READY_STATE_CHA6 = "_xhrReadyStateChange"; var _DYN__ON_ERROR = "_onError"; var _DYN__ON_PARTIAL_SUCCESS = "_onPartialSuccess"; var _DYN__ON_SUCCESS = "_onSuccess"; var _DYN_ITEMS_ACCEPTED = "itemsAccepted"; var _DYN_ITEMS_RECEIVED = "itemsReceived"; var _DYN_SET_REQUEST_HEADER$1 = "setRequestHeader"; var _DYN_EVENTS_SEND_REQUEST = "eventsSendRequest"; var _DYN_GET_SAMPLING_SCORE = "getSamplingScore"; var _DYN_GET_HASH_CODE_SCORE = "getHashCodeScore"; var strBaseType = "baseType"; var strBaseData = "baseData"; var strProperties = "properties"; var strTrue = "true"; function _setValueIf(target, field, value) { return setValue(target, field, value, isTruthy); } function _extractPartAExtensions(logger, item, env) { var envTags = env[_DYN_TAGS ] = env[_DYN_TAGS ] || {}; var itmExt = item.ext = item.ext || {}; var itmTags = item[_DYN_TAGS ] = item[_DYN_TAGS ] || []; var extUser = itmExt.user; if (extUser) { _setValueIf(envTags, CtxTagKeys.userAuthUserId, extUser.authId); _setValueIf(envTags, CtxTagKeys.userId, extUser.id || extUser.localId); } var extApp = itmExt.app; if (extApp) { _setValueIf(envTags, CtxTagKeys.sessionId, extApp.sesId); } var extDevice = itmExt.device; if (extDevice) { _setValueIf(envTags, CtxTagKeys.deviceId, extDevice.id || extDevice.localId); _setValueIf(envTags, CtxTagKeys[_DYN_DEVICE_TYPE ], extDevice.deviceClass); _setValueIf(envTags, CtxTagKeys.deviceIp, extDevice.ip); _setValueIf(envTags, CtxTagKeys.deviceModel, extDevice.model); _setValueIf(envTags, CtxTagKeys[_DYN_DEVICE_TYPE ], extDevice[_DYN_DEVICE_TYPE ]); } var web = item.ext.web; if (web) { _setValueIf(envTags, CtxTagKeys.deviceLanguage, web.browserLang); _setValueIf(envTags, CtxTagKeys.deviceBrowserVersion, web.browserVer); _setValueIf(envTags, CtxTagKeys.deviceBrowser, web.browser); var envData = env[_DYN_DATA ] = env[_DYN_DATA ] || {}; var envBaseData = envData[strBaseData] = envData[strBaseData] || {}; var envProps = envBaseData[strProperties] = envBaseData[strProperties] || {}; _setValueIf(envProps, "domain", web.domain); _setValueIf(envProps, "isManual", web.isManual ? strTrue : null); _setValueIf(envProps, "screenRes", web.screenRes); _setValueIf(envProps, "userConsent", web.userConsent ? strTrue : null); } var extOs = itmExt.os; if (extOs) { _setValueIf(envTags, CtxTagKeys.deviceOS, extOs[_DYN_NAME$1 ]); } var extTrace = itmExt.trace; if (extTrace) { _setValueIf(envTags, CtxTagKeys.operationParentId, extTrace.parentID); _setValueIf(envTags, CtxTagKeys.operationName, dataSanitizeString(logger, extTrace[_DYN_NAME$1 ])); _setValueIf(envTags, CtxTagKeys.operationId, extTrace[_DYN_TRACE_ID$1 ]); } var tgs = {}; for (var i = itmTags[_DYN_LENGTH$2 ] - 1; i >= 0; i--) { var tg = itmTags[i]; objForEachKey(tg, function (key, value) { tgs[key] = value; }); itmTags.splice(i, 1); } objForEachKey(itmTags, function (tg, value) { tgs[tg] = value; }); var theTags = __assignFn(__assignFn({}, envTags), tgs); if (!theTags[CtxTagKeys.internalSdkVersion]) { theTags[CtxTagKeys.internalSdkVersion] = dataSanitizeString(logger, "javascript:".concat(EnvelopeCreator.Version), 64); } env[_DYN_TAGS ] = optimizeObject(theTags); } function _extractPropsAndMeasurements(data, properties, measurements) { if (!isNullOrUndefined(data)) { objForEachKey(data, function (key, value) { if (isNumber(value)) { measurements[key] = value; } else if (isString(value)) { properties[key] = value; } else if (hasJSON()) { properties[key] = getJSON()[_DYN_STRINGIFY ](value); } }); } } function _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue) { if (!isNullOrUndefined(properties)) { objForEachKey(properties, function (key, value) { properties[key] = value || customUndefinedValue; }); } } function _createEnvelope(logger, envelopeType, telemetryItem, data) { var envelope = new Envelope(logger, data, envelopeType); _setValueIf(envelope, "sampleRate", telemetryItem[SampleRate]); if ((telemetryItem[strBaseData] || {}).startTime) { envelope.time = toISOString(telemetryItem[strBaseData].startTime); } envelope.iKey = telemetryItem.iKey; var iKeyNoDashes = telemetryItem.iKey.replace(/-/g, ""); envelope[_DYN_NAME$1 ] = envelope[_DYN_NAME$1 ].replace("{0}", iKeyNoDashes); _extractPartAExtensions(logger, telemetryItem, envelope); telemetryItem[_DYN_TAGS ] = telemetryItem[_DYN_TAGS ] || []; return optimizeObject(envelope); } function EnvelopeCreatorInit(logger, telemetryItem) { if (isNullOrUndefined(telemetryItem[strBaseData])) { _throwInternal(logger, 1 , 46 , "telemetryItem.baseData cannot be null."); } } var EnvelopeCreator = { Version: '3.0.2' }; function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS ] || {}; var customProperties = telemetryItem[strBaseData][strProperties] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], customProperties, customMeasurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue); } var bd = telemetryItem[strBaseData]; if (isNullOrUndefined(bd)) { _warnToConsole(logger, "Invalid input for dependency data"); return null; } var method = bd[strProperties] && bd[strProperties][HttpMethod] ? bd[strProperties][HttpMethod] : "GET"; var remoteDepData = new RemoteDependencyData(logger, bd.id, bd.target, bd[_DYN_NAME$1 ], bd[STR_DURATION$1 ], bd.success, bd.responseCode, method, bd.type, bd.correlationContext, customProperties, customMeasurements); var data = new Data(RemoteDependencyData[_DYN_DATA_TYPE ], remoteDepData); return _createEnvelope(logger, RemoteDependencyData[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function EventEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var customProperties = {}; var customMeasurements = {}; if (telemetryItem[strBaseType] !== Event$1[_DYN_DATA_TYPE ]) { customProperties["baseTypeSource"] = telemetryItem[strBaseType]; } if (telemetryItem[strBaseType] === Event$1[_DYN_DATA_TYPE ]) { customProperties = telemetryItem[strBaseData][strProperties] || {}; customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS ] || {}; } else { if (telemetryItem[strBaseData]) { _extractPropsAndMeasurements(telemetryItem[strBaseData], customProperties, customMeasurements); } } _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], customProperties, customMeasurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue); } var eventName = telemetryItem[strBaseData][_DYN_NAME$1 ]; var eventData = new Event$1(logger, eventName, customProperties, customMeasurements); var data = new Data(Event$1[_DYN_DATA_TYPE ], eventData); return _createEnvelope(logger, Event$1[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function ExceptionEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var customMeasurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS ] || {}; var customProperties = telemetryItem[strBaseData][strProperties] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], customProperties, customMeasurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue); } var bd = telemetryItem[strBaseData]; var exData = Exception.CreateFromInterface(logger, bd, customProperties, customMeasurements); var data = new Data(Exception[_DYN_DATA_TYPE ], exData); return _createEnvelope(logger, Exception[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function MetricEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var baseData = telemetryItem[strBaseData]; var props = baseData[strProperties] || {}; var measurements = baseData[_DYN_MEASUREMENTS ] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], props, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(props, customUndefinedValue); } var baseMetricData = new Metric(logger, baseData[_DYN_NAME$1 ], baseData.average, baseData.sampleCount, baseData.min, baseData.max, baseData.stdDev, props, measurements); var data = new Data(Metric[_DYN_DATA_TYPE ], baseMetricData); return _createEnvelope(logger, Metric[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function PageViewEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var duration; var baseData = telemetryItem[strBaseData]; if (!isNullOrUndefined(baseData) && !isNullOrUndefined(baseData[strProperties]) && !isNullOrUndefined(baseData[strProperties][STR_DURATION$1])) { duration = baseData[strProperties][STR_DURATION$1]; delete baseData[strProperties][STR_DURATION$1]; } else if (!isNullOrUndefined(telemetryItem[_DYN_DATA ]) && !isNullOrUndefined(telemetryItem[_DYN_DATA ][STR_DURATION$1])) { duration = telemetryItem[_DYN_DATA ][STR_DURATION$1]; delete telemetryItem[_DYN_DATA ][STR_DURATION$1]; } var bd = telemetryItem[strBaseData]; var currentContextId; if (((telemetryItem.ext || {}).trace || {})[_DYN_TRACE_ID$1 ]) { currentContextId = telemetryItem.ext.trace[_DYN_TRACE_ID$1 ]; } var id = bd.id || currentContextId; var name = bd[_DYN_NAME$1 ]; var url = bd.uri; var properties = bd[strProperties] || {}; var measurements = bd[_DYN_MEASUREMENTS ] || {}; if (!isNullOrUndefined(bd.refUri)) { properties["refUri"] = bd.refUri; } if (!isNullOrUndefined(bd.pageType)) { properties["pageType"] = bd.pageType; } if (!isNullOrUndefined(bd.isLoggedIn)) { properties["isLoggedIn"] = bd.isLoggedIn[_DYN_TO_STRING ](); } if (!isNullOrUndefined(bd[strProperties])) { var pageTags = bd[strProperties]; objForEachKey(pageTags, function (key, value) { properties[key] = value; }); } _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], properties, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue); } var pageViewData = new PageView(logger, name, url, duration, properties, measurements, id); var data = new Data(PageView[_DYN_DATA_TYPE ], pageViewData); return _createEnvelope(logger, PageView[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function PageViewPerformanceEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var bd = telemetryItem[strBaseData]; var name = bd[_DYN_NAME$1 ]; var url = bd.uri || bd.url; var properties = bd[strProperties] || {}; var measurements = bd[_DYN_MEASUREMENTS ] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], properties, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue); } var baseData = new PageViewPerformance(logger, name, url, undefined, properties, measurements, bd); var data = new Data(PageViewPerformance[_DYN_DATA_TYPE ], baseData); return _createEnvelope(logger, PageViewPerformance[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function TraceEnvelopeCreator(logger, telemetryItem, customUndefinedValue) { EnvelopeCreatorInit(logger, telemetryItem); var message = telemetryItem[strBaseData].message; var severityLevel = telemetryItem[strBaseData].severityLevel; var props = telemetryItem[strBaseData][strProperties] || {}; var measurements = telemetryItem[strBaseData][_DYN_MEASUREMENTS ] || {}; _extractPropsAndMeasurements(telemetryItem[_DYN_DATA ], props, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(props, customUndefinedValue); } var baseData = new Trace(logger, message, severityLevel, props, measurements); var data = new Data(Trace[_DYN_DATA_TYPE ], baseData); return _createEnvelope(logger, Trace[_DYN_ENVELOPE_TYPE ], telemetryItem, data); } function _disableEvents(target, evtNamespace) { eventOff(target, null, null, evtNamespace); } function createOfflineListener(parentEvtNamespace) { var _a; var _document = getDocument(); var _navigator = getNavigator(); var _isListening = false; var _onlineStatus = true; var _evtNamespace = mergeEvtNamespace(createUniqueNamespace("OfflineListener"), parentEvtNamespace); try { if (_enableEvents(getWindow())) { _isListening = true; } if (_document) { var target = _document.body || _document; if (target.ononline) { if (_enableEvents(target)) { _isListening = true; } } } if (_isListening) { if (_navigator && !isNullOrUndefined(_navigator[_DYN_ON_LINE ])) { _onlineStatus = _navigator[_DYN_ON_LINE ]; } } } catch (e) { _isListening = false; } function _enableEvents(target) { var enabled = false; if (target) { enabled = eventOn(target, "online", _setOnline, _evtNamespace); if (enabled) { eventOn(target, "offline", _setOffline, _evtNamespace); } } return enabled; } function _setOnline() { _onlineStatus = true; } function _setOffline() { _onlineStatus = false; } function _isOnline() { var result = true; if (_isListening) { result = _onlineStatus; } else if (_navigator && !isNullOrUndefined(_navigator[_DYN_ON_LINE ])) { result = _navigator[_DYN_ON_LINE ]; } return result; } function _unload() { var win = getWindow(); if (win && _isListening) { _disableEvents(win, _evtNamespace); if (_document) { var target = _document.body || _document; if (!isUndefined(target.ononline)) { _disableEvents(target, _evtNamespace); } } _isListening = false; } } return _a = {}, _a[_DYN_IS_ONLINE ] = _isOnline, _a.isListening = function () { return _isListening; }, _a.unload = _unload, _a; } var BaseSendBuffer = /** @class */ (function () { function BaseSendBuffer(logger, config) { var _buffer = []; var _bufferFullMessageSent = false; this[_DYN__GET ] = function () { return _buffer; }; this._set = function (buffer) { _buffer = buffer; return _buffer; }; dynamicProto(BaseSendBuffer, this, function (_self) { _self[_DYN_ENQUEUE ] = function (payload) { if (_self[_DYN_COUNT ]() >= config[_DYN_EVENTS_LIMIT_IN_MEM ]) { if (!_bufferFullMessageSent) { _throwInternal(logger, 2 , 105 , "Maximum in-memory buffer size reached: " + _self[_DYN_COUNT ](), true); _bufferFullMessageSent = true; } return; } _buffer[_DYN_PUSH ](payload); }; _self[_DYN_COUNT ] = function () { return _buffer[_DYN_LENGTH$2 ]; }; _self.size = function () { var size = _buffer[_DYN_LENGTH$2 ]; for (var lp = 0; lp < _buffer[_DYN_LENGTH$2 ]; lp++) { size += _buffer[lp][_DYN_LENGTH$2 ]; } if (!config[_DYN_EMIT_LINE_DELIMITED_0 ]) { size += 2; } return size; }; _self[_DYN_CLEAR ] = function () { _buffer = []; _bufferFullMessageSent = false; }; _self.getItems = function () { return _buffer.slice(0); }; _self[_DYN_BATCH_PAYLOADS ] = function (payload) { if (payload && payload[_DYN_LENGTH$2 ] > 0) { var batch = config[_DYN_EMIT_LINE_DELIMITED_0 ] ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; _self[_DYN_CREATE_NEW ] = function (newLogger, newConfig, canUseSessionStorage) { var items = _buffer.slice(0); newLogger = newLogger || logger; newConfig = newConfig || {}; var newBuffer = !!canUseSessionStorage ? new SessionStorageSendBuffer(newLogger, newConfig) : new ArraySendBuffer(newLogger, newConfig); arrForEach(items, function (payload) { newBuffer[_DYN_ENQUEUE ](payload); }); return newBuffer; }; }); } BaseSendBuffer.__ieDyn=1; return BaseSendBuffer; }()); var ArraySendBuffer = /** @class */ (function (_super) { __extendsFn(ArraySendBuffer, _super); function ArraySendBuffer(logger, config) { var _this = _super.call(this, logger, config) || this; dynamicProto(ArraySendBuffer, _this, function (_self, _base) { _self[_DYN_MARK_AS_SENT ] = function (payload) { _base[_DYN_CLEAR ](); }; _self[_DYN_CLEAR_SENT ] = function (payload) { }; }); return _this; } ArraySendBuffer.__ieDyn=1; return ArraySendBuffer; }(BaseSendBuffer)); var SessionStorageSendBuffer = /** @class */ (function (_super) { __extendsFn(SessionStorageSendBuffer, _super); function SessionStorageSendBuffer(logger, config) { var _this = _super.call(this, logger, config) || this; var _bufferFullMessageSent = false; var _namePrefix = config === null || config === void 0 ? void 0 : config.namePrefix; var _a = config[_DYN_BUFFER_OVERRIDE ] || { getItem: utlGetSessionStorage, setItem: utlSetSessionStorage }, getItem = _a.getItem, setItem = _a.setItem; dynamicProto(SessionStorageSendBuffer, _this, function (_self, _base) { var bufferItems = _getBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY ]); var notDeliveredItems = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ]); var buffer = _self._set(bufferItems.concat(notDeliveredItems)); if (buffer[_DYN_LENGTH$2 ] > SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]) { buffer[_DYN_LENGTH$2 ] = SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]; } _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ], []); _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY ], buffer); _self[_DYN_ENQUEUE ] = function (payload) { if (_self[_DYN_COUNT ]() >= SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]) { if (!_bufferFullMessageSent) { _throwInternal(logger, 2 , 67 , "Maximum buffer size reached: " + _self[_DYN_COUNT ](), true); _bufferFullMessageSent = true; } return; } _base[_DYN_ENQUEUE ](payload); _setBuffer(SessionStorageSendBuffer.BUFFER_KEY, _self[_DYN__GET ]()); }; _self[_DYN_CLEAR ] = function () { _base[_DYN_CLEAR ](); _setBuffer(SessionStorageSendBuffer.BUFFER_KEY, _self[_DYN__GET ]()); _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ], []); _bufferFullMessageSent = false; }; _self[_DYN_MARK_AS_SENT ] = function (payload) { _setBuffer(SessionStorageSendBuffer[_DYN__BUFFER__KEY ], _self._set(_removePayloadsFromBuffer(payload, _self[_DYN__GET ]()))); var sentElements = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ]); if (sentElements instanceof Array && payload instanceof Array) { sentElements = sentElements.concat(payload); if (sentElements[_DYN_LENGTH$2 ] > SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]) { _throwInternal(logger, 1 , 67 , "Sent buffer reached its maximum size: " + sentElements[_DYN_LENGTH$2 ], true); sentElements[_DYN_LENGTH$2 ] = SessionStorageSendBuffer[_DYN__MAX__BUFFER__SIZE ]; } _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ], sentElements); } }; _self[_DYN_CLEAR_SENT ] = function (payload) { var sentElements = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ]); sentElements = _removePayloadsFromBuffer(payload, sentElements); _setBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ], sentElements); }; _self[_DYN_CREATE_NEW ] = function (newLogger, newConfig, canUseSessionStorage) { canUseSessionStorage = !!canUseSessionStorage; var unsentItems = _self[_DYN__GET ]().slice(0); var sentItems = _getBuffer(SessionStorageSendBuffer[_DYN__SENT__BUFFER__KEY ]).slice(0); newLogger = newLogger || logger; newConfig = newConfig || {}; _self[_DYN_CLEAR ](); var newBuffer = canUseSessionStorage ? new SessionStorageSendBuffer(newLogger, newConfig) : new ArraySendBuffer(newLogger, newConfig); arrForEach(unsentItems, function (payload) { newBuffer[_DYN_ENQUEUE ](payload); }); if (canUseSessionStorage) { newBuffer[_DYN_MARK_AS_SENT ](sentItems); } return newBuffer; }; function _removePayloadsFromBuffer(payloads, buffer) { var remaining = []; arrForEach(buffer, function (value) { if (!isFunction(value) && arrIndexOf(payloads, value) === -1) { remaining[_DYN_PUSH ](value); } }); return remaining; } function _getBuffer(key) { var prefixedKey = key; try { prefixedKey = _namePrefix ? _namePrefix + "_" + prefixedKey : prefixedKey; var bufferJson = getItem(logger, prefixedKey); if (bufferJson) { var buffer_1 = getJSON().parse(bufferJson); if (isString(buffer_1)) { buffer_1 = getJSON().parse(buffer_1); } if (buffer_1 && isArray(buffer_1)) { return buffer_1; } } } catch (e) { _throwInternal(logger, 1 , 42 , " storage key: " + prefixedKey + ", " + getExceptionName(e), { exception: dumpObj(e) }); } return []; } function _setBuffer(key, buffer) { var prefixedKey = key; try { prefixedKey = _namePrefix ? _namePrefix + "_" + prefixedKey : prefixedKey; var bufferJson = JSON[_DYN_STRINGIFY ](buffer); setItem(logger, prefixedKey, bufferJson); } catch (e) { setItem(logger, prefixedKey, JSON[_DYN_STRINGIFY ]([])); _throwInternal(logger, 2 , 41 , " storage key: " + prefixedKey + ", " + getExceptionName(e) + ". Buffer cleared", { exception: dumpObj(e) }); } } }); return _this; } SessionStorageSendBuffer.BUFFER_KEY = "AI_buffer"; SessionStorageSendBuffer.SENT_BUFFER_KEY = "AI_sentBuffer"; SessionStorageSendBuffer.MAX_BUFFER_SIZE = 2000; return SessionStorageSendBuffer; }(BaseSendBuffer)); var Serializer = /** @class */ (function () { function Serializer(logger) { dynamicProto(Serializer, this, function (_self) { _self.serialize = function (input) { var output = _serializeObject(input, "root"); try { return getJSON()[_DYN_STRINGIFY ](output); } catch (e) { _throwInternal(logger, 1 , 48 , (e && isFunction(e[_DYN_TO_STRING ])) ? e[_DYN_TO_STRING ]() : "Error serializing object", null, true); } }; function _serializeObject(source, name) { var circularReferenceCheck = "__aiCircularRefCheck"; var output = {}; if (!source) { _throwInternal(logger, 1 , 48 , "cannot serialize object because it is null or undefined", { name: name }, true); return output; } if (source[circularReferenceCheck]) { _throwInternal(logger, 2 , 50 , "Circular reference detected while serializing object", { name: name }, true); return output; } if (!source.aiDataContract) { if (name === "measurements") { output = _serializeStringMap(source, "number", name); } else if (name === "properties") { output = _serializeStringMap(source, "string", name); } else if (name === "tags") { output = _serializeStringMap(source, "string", name); } else if (isArray(source)) { output = _serializeArray(source, name); } else { _throwInternal(logger, 2 , 49 , "Attempting to serialize an object which does not implement ISerializable", { name: name }, true); try { getJSON()[_DYN_STRINGIFY ](source); output = source; } catch (e) { _throwInternal(logger, 1 , 48 , (e && isFunction(e[_DYN_TO_STRING ])) ? e[_DYN_TO_STRING ]() : "Error serializing object", null, true); } } return output; } source[circularReferenceCheck] = true; objForEachKey(source.aiDataContract, function (field, contract) { var isRequired = (isFunction(contract)) ? (contract() & 1 ) : (contract & 1 ); var isHidden = (isFunction(contract)) ? (contract() & 4 ) : (contract & 4 ); var isArray = contract & 2 ; var isPresent = source[field] !== undefined; var isObj = isObject(source[field]) && source[field] !== null; if (isRequired && !isPresent && !isArray) { _throwInternal(logger, 1 , 24 , "Missing required field specification. The field is required but not present on source", { field: field, name: name }); } else if (!isHidden) { var value = void 0; if (isObj) { if (isArray) { value = _serializeArray(source[field], field); } else { value = _serializeObject(source[field], field); } } else { value = source[field]; } if (value !== undefined) { output[field] = value; } } }); delete source[circularReferenceCheck]; return output; } function _serializeArray(sources, name) { var output; if (!!sources) { if (!isArray(sources)) { _throwInternal(logger, 1 , 54 , "This field was specified as an array in the contract but the item is not an array.\r\n", { name: name }, true); } else { output = []; for (var i = 0; i < sources[_DYN_LENGTH$2 ]; i++) { var source = sources[i]; var item = _serializeObject(source, name + "[" + i + "]"); output[_DYN_PUSH ](item); } } } return output; } function _serializeStringMap(map, expectedType, name) { var output; if (map) { output = {}; objForEachKey(map, function (field, value) { if (expectedType === "string") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else if (!value[_DYN_TO_STRING ]) { output[field] = "invalid field: toString() is not defined."; } else { output[field] = value[_DYN_TO_STRING ](); } } else if (expectedType === "number") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else { var num = parseFloat(value); if (isNaN(num)) { output[field] = "NaN"; } else { output[field] = num; } } } else { output[field] = "invalid field: " + name + " is of unknown type."; _throwInternal(logger, 1 , output[field], null, true); } }); } return output; } }); } Serializer.__ieDyn=1; return Serializer; }()); var MIN_INPUT_LENGTH = 8; var HashCodeScoreGenerator = /** @class */ (function () { function HashCodeScoreGenerator() { } HashCodeScoreGenerator.prototype.getHashCodeScore = function (key) { var score = this.getHashCode(key) / HashCodeScoreGenerator.INT_MAX_VALUE; return score * 100; }; HashCodeScoreGenerator.prototype.getHashCode = function (input) { if (input === "") { return 0; } while (input[_DYN_LENGTH$2 ] < MIN_INPUT_LENGTH) { input = input.concat(input); } var hash = 5381; for (var i = 0; i < input[_DYN_LENGTH$2 ]; ++i) { hash = ((hash << 5) + hash) + input.charCodeAt(i); hash = hash & hash; } return Math.abs(hash); }; HashCodeScoreGenerator.INT_MAX_VALUE = 2147483647; return HashCodeScoreGenerator; }()); var SamplingScoreGenerator = /** @class */ (function () { function SamplingScoreGenerator() { var _self = this; var hashCodeGenerator = new HashCodeScoreGenerator(); var keys = new ContextTagKeys(); _self[_DYN_GET_SAMPLING_SCORE ] = function (item) { var score = 0; if (item[_DYN_TAGS ] && item[_DYN_TAGS ][keys.userId]) { score = hashCodeGenerator.getHashCodeScore(item[_DYN_TAGS ][keys.userId]); } else if (item.ext && item.ext.user && item.ext.user.id) { score = hashCodeGenerator[_DYN_GET_HASH_CODE_SCORE ](item.ext.user.id); } else if (item[_DYN_TAGS ] && item[_DYN_TAGS ][keys.operationId]) { score = hashCodeGenerator.getHashCodeScore(item[_DYN_TAGS ][keys.operationId]); } else if (item.ext && item.ext.telemetryTrace && item.ext.telemetryTrace[_DYN_TRACE_ID$1 ]) { score = hashCodeGenerator.getHashCodeScore(item.ext.telemetryTrace[_DYN_TRACE_ID$1 ]); } else { score = (Math.random() * 100); } return score; }; } return SamplingScoreGenerator; }()); var Sample = /** @class */ (function () { function Sample(sampleRate, logger) { this.INT_MAX_VALUE = 2147483647; var _logger = logger || safeGetLogger(null); if (sampleRate > 100 || sampleRate < 0) { _logger.throwInternal(2 , 58 , "Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.", { samplingRate: sampleRate }, true); sampleRate = 100; } this[_DYN_SAMPLE_RATE ] = sampleRate; this.samplingScoreGenerator = new SamplingScoreGenerator(); } Sample.prototype.isSampledIn = function (envelope) { var samplingPercentage = this[_DYN_SAMPLE_RATE ]; var isSampledIn = false; if (samplingPercentage === null || samplingPercentage === undefined || samplingPercentage >= 100) { return true; } else if (envelope.baseType === Metric[_DYN_DATA_TYPE ]) { return true; } isSampledIn = this.samplingScoreGenerator[_DYN_GET_SAMPLING_SCORE ](envelope) < samplingPercentage; return isSampledIn; }; return Sample; }()); var _a$3, _b; var UNDEFINED_VALUE$1 = undefined; var FetchSyncRequestSizeLimitBytes = 65000; function _getResponseText(xhr) { try { return xhr.responseText; } catch (e) { } return null; } var defaultAppInsightsChannelConfig = objDeepFreeze((_a$3 = { endpointUrl: cfgDfValidate(isTruthy, DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH) }, _a$3[_DYN_EMIT_LINE_DELIMITED_0 ] = cfgDfBoolean(), _a$3[_DYN_MAX_BATCH_INTERVAL ] = 15000, _a$3[_DYN_MAX_BATCH_SIZE_IN_BY1 ] = 102400, _a$3.disableTelemetry = cfgDfBoolean(), _a$3[_DYN_ENABLE_SESSION_STORA4 ] = cfgDfBoolean(true), _a$3.isRetryDisabled = cfgDfBoolean(), _a$3[_DYN_IS_BEACON_API_DISABL3 ] = cfgDfBoolean(true), _a$3[_DYN_DISABLE_XHR ] = cfgDfBoolean(), _a$3[_DYN_ONUNLOAD_DISABLE_FET5 ] = cfgDfBoolean(), _a$3[_DYN_ONUNLOAD_DISABLE_BEA2 ] = cfgDfBoolean(), _a$3[_DYN_INSTRUMENTATION_KEY$1 ] = UNDEFINED_VALUE$1, _a$3.namePrefix = UNDEFINED_VALUE$1, _a$3.samplingPercentage = cfgDfValidate(_chkSampling, 100), _a$3[_DYN_CUSTOM_HEADERS ] = UNDEFINED_VALUE$1, _a$3[_DYN_CONVERT_UNDEFINED ] = UNDEFINED_VALUE$1, _a$3[_DYN_EVENTS_LIMIT_IN_MEM ] = 10000, _a$3[_DYN_BUFFER_OVERRIDE ] = false, _a$3)); function _chkSampling(value) { return !isNaN(value) && value > 0 && value <= 100; } var EnvelopeTypeCreator = (_b = {}, _b[Event$1.dataType] = EventEnvelopeCreator, _b[Trace.dataType] = TraceEnvelopeCreator, _b[PageView.dataType] = PageViewEnvelopeCreator, _b[PageViewPerformance.dataType] = PageViewPerformanceEnvelopeCreator, _b[Exception.dataType] = ExceptionEnvelopeCreator, _b[Metric.dataType] = MetricEnvelopeCreator, _b[RemoteDependencyData.dataType] = DependencyEnvelopeCreator, _b); var Sender = /** @class */ (function (_super) { __extendsFn(Sender, _super); function Sender() { var _this = _super.call(this) || this; _this.priority = 1001; _this.identifier = BreezeChannelIdentifier; var _consecutiveErrors; var _retryAt; var _paused; var _timeoutHandle; var _serializer; var _stamp_specific_redirects; var _headers; var _syncFetchPayload = 0; var _fallbackSender; var _syncUnloadSender; var _offlineListener; var _evtNamespace; var _endpointUrl; var _orgEndpointUrl; var _maxBatchSizeInBytes; var _beaconSupported; var _customHeaders; var _disableTelemetry; var _instrumentationKey; var _convertUndefined; var _isRetryDisabled; var _maxBatchInterval; var _sessionStorageUsed; var _bufferOverrideUsed; var _namePrefix; var _enableSendPromise; dynamicProto(Sender, _this, function (_self, _base) { _initDefaults(); _self.pause = function () { _clearScheduledTimer(); _paused = true; }; _self.resume = function () { if (_paused) { _paused = false; _retryAt = null; _checkMaxSize(); _setupTimer(); } }; _self.flush = function (isAsync, callBack, sendReason) { if (isAsync === void 0) { isAsync = true; } if (!_paused) { _clearScheduledTimer(); try { return _self[_DYN_TRIGGER_SEND ](isAsync, null, sendReason || 1 ); } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 22 , "flush failed, telemetry will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } } }; _self.onunloadFlush = function () { if (!_paused) { if (_beaconSupported) { try { return _self[_DYN_TRIGGER_SEND ](true, _doUnloadSend, 2 ); } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 20 , "failed to flush with beacon sender on page unload, telemetry will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } } else { _self.flush(false); } } }; _self.addHeader = function (name, value) { _headers[name] = value; }; _self.initialize = function (config, core, extensions, pluginChain) { if (_self.isInitialized()) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 28 , "Sender is already initialized"); } _base.initialize(config, core, extensions, pluginChain); var identifier = _self.identifier; _serializer = new Serializer(core.logger); _consecutiveErrors = 0; _retryAt = null; _self[_DYN__SENDER ] = null; _stamp_specific_redirects = 0; var diagLog = _self[_DYN_DIAG_LOG ](); _evtNamespace = mergeEvtNamespace(createUniqueNamespace("Sender"), core.evtNamespace && core.evtNamespace()); _offlineListener = createOfflineListener(_evtNamespace); _self._addHook(onConfigChange(config, function (details) { var config = details.cfg; if (config.storagePrefix) { utlSetStoragePrefix(config.storagePrefix); } var ctx = createProcessTelemetryContext(null, config, core); var senderConfig = ctx.getExtCfg(identifier, defaultAppInsightsChannelConfig); objDefine(_self, "_senderConfig", { g: function () { return senderConfig; } }); if (_orgEndpointUrl !== senderConfig.endpointUrl) { _endpointUrl = _orgEndpointUrl = senderConfig.endpointUrl; } if (_customHeaders && _customHeaders !== senderConfig[_DYN_CUSTOM_HEADERS ]) { arrForEach(_customHeaders, function (customHeader) { delete _headers[customHeader.header]; }); } _maxBatchSizeInBytes = senderConfig[_DYN_MAX_BATCH_SIZE_IN_BY1 ]; _beaconSupported = (senderConfig[_DYN_ONUNLOAD_DISABLE_BEA2 ] === false || senderConfig[_DYN_IS_BEACON_API_DISABL3 ] === false) && isBeaconsSupported(); var bufferOverride = senderConfig[_DYN_BUFFER_OVERRIDE ]; var canUseSessionStorage = !!senderConfig[_DYN_ENABLE_SESSION_STORA4 ] && (!!bufferOverride || utlCanUseSessionStorage()); var namePrefix = senderConfig.namePrefix; var shouldUpdate = (canUseSessionStorage !== _sessionStorageUsed) || (canUseSessionStorage && (_namePrefix !== namePrefix)) || (canUseSessionStorage && (_bufferOverrideUsed !== bufferOverride)); if (_self[_DYN__BUFFER ]) { if (shouldUpdate) { try { _self._buffer = _self._buffer[_DYN_CREATE_NEW ](diagLog, senderConfig, canUseSessionStorage); } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 12 , "failed to transfer telemetry to different buffer storage, telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) }); } } _checkMaxSize(); } else { _self[_DYN__BUFFER ] = canUseSessionStorage ? new SessionStorageSendBuffer(diagLog, senderConfig) : new ArraySendBuffer(diagLog, senderConfig); } _namePrefix = namePrefix; _sessionStorageUsed = canUseSessionStorage; _bufferOverrideUsed = bufferOverride; _self._sample = new Sample(senderConfig.samplingPercentage, diagLog); _instrumentationKey = senderConfig[_DYN_INSTRUMENTATION_KEY$1 ]; if (!_validateInstrumentationKey(_instrumentationKey, config)) { _throwInternal(diagLog, 1 , 100 , "Invalid Instrumentation key " + _instrumentationKey); } _customHeaders = senderConfig[_DYN_CUSTOM_HEADERS ]; if (!isInternalApplicationInsightsEndpoint(_endpointUrl) && _customHeaders && _customHeaders[_DYN_LENGTH$2 ] > 0) { arrForEach(_customHeaders, function (customHeader) { _this.addHeader(customHeader.header, customHeader.value); }); } else { _customHeaders = null; } _enableSendPromise = senderConfig.enableSendPromise; var sendPostFunc = null; if (!senderConfig[_DYN_DISABLE_XHR ] && useXDomainRequest()) { sendPostFunc = _xdrSender; } else if (!senderConfig[_DYN_DISABLE_XHR ] && isXhrSupported()) { sendPostFunc = _xhrSender; } if (!sendPostFunc && isFetchSupported()) { sendPostFunc = _fetchSender; } _fallbackSender = sendPostFunc || _xhrSender; if (!senderConfig[_DYN_IS_BEACON_API_DISABL3 ] && isBeaconsSupported()) { sendPostFunc = _beaconSender; } _self[_DYN__SENDER ] = sendPostFunc || _xhrSender; if (!senderConfig[_DYN_ONUNLOAD_DISABLE_FET5 ] && isFetchSupported(true)) { _syncUnloadSender = _fetchKeepAliveSender; } else if (isBeaconsSupported()) { _syncUnloadSender = _beaconSender; } else if (!senderConfig[_DYN_DISABLE_XHR ] && useXDomainRequest()) { _syncUnloadSender = _xdrSender; } else if (!senderConfig[_DYN_DISABLE_XHR ] && isXhrSupported()) { _syncUnloadSender = _xhrSender; } else { _syncUnloadSender = _fallbackSender; } _disableTelemetry = senderConfig.disableTelemetry; _convertUndefined = senderConfig[_DYN_CONVERT_UNDEFINED ] || UNDEFINED_VALUE$1; _isRetryDisabled = senderConfig.isRetryDisabled; _maxBatchInterval = senderConfig[_DYN_MAX_BATCH_INTERVAL ]; })); }; _self.processTelemetry = function (telemetryItem, itemCtx) { itemCtx = _self._getTelCtx(itemCtx); var diagLogger = itemCtx[_DYN_DIAG_LOG ](); try { if (_disableTelemetry) { return; } if (!telemetryItem) { _throwInternal(diagLogger, 1 , 7 , "Cannot send empty telemetry"); return; } if (telemetryItem.baseData && !telemetryItem[_DYN_BASE_TYPE ]) { _throwInternal(diagLogger, 1 , 70 , "Cannot send telemetry without baseData and baseType"); return; } if (!telemetryItem[_DYN_BASE_TYPE ]) { telemetryItem[_DYN_BASE_TYPE ] = "EventData"; } if (!_self[_DYN__SENDER ]) { _throwInternal(diagLogger, 1 , 28 , "Sender was not initialized"); return; } if (!_isSampledIn(telemetryItem)) { _throwInternal(diagLogger, 2 , 33 , "Telemetry item was sampled out and not sent", { SampleRate: _self._sample[_DYN_SAMPLE_RATE ] }); return; } else { telemetryItem[SampleRate] = _self._sample[_DYN_SAMPLE_RATE ]; } var defaultEnvelopeIkey = telemetryItem.iKey || _instrumentationKey; var aiEnvelope_1 = Sender.constructEnvelope(telemetryItem, defaultEnvelopeIkey, diagLogger, _convertUndefined); if (!aiEnvelope_1) { _throwInternal(diagLogger, 1 , 47 , "Unable to create an AppInsights envelope"); return; } var doNotSendItem_1 = false; if (telemetryItem[_DYN_TAGS ] && telemetryItem[_DYN_TAGS ][ProcessLegacy]) { arrForEach(telemetryItem[_DYN_TAGS ][ProcessLegacy], function (callBack) { try { if (callBack && callBack(aiEnvelope_1) === false) { doNotSendItem_1 = true; _warnToConsole(diagLogger, "Telemetry processor check returns false"); } } catch (e) { _throwInternal(diagLogger, 1 , 64 , "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true); } }); delete telemetryItem[_DYN_TAGS ][ProcessLegacy]; } if (doNotSendItem_1) { return; } var payload = _serializer.serialize(aiEnvelope_1); var buffer = _self[_DYN__BUFFER ]; _checkMaxSize(payload); buffer[_DYN_ENQUEUE ](payload); _setupTimer(); } catch (e) { _throwInternal(diagLogger, 2 , 12 , "Failed adding telemetry to the sender's buffer, some telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) }); } _self.processNext(telemetryItem, itemCtx); }; _self[_DYN__XHR_READY_STATE_CHA6 ] = function (xhr, payload, countOfItemsInPayload) { if (xhr.readyState === 4) { _checkResponsStatus(xhr.status, payload, xhr.responseURL, countOfItemsInPayload, _formatErrorMessageXhr(xhr), _getResponseText(xhr) || xhr.response); } }; _self[_DYN_TRIGGER_SEND ] = function (async, forcedSender, sendReason) { if (async === void 0) { async = true; } var result; if (!_paused) { try { var buffer = _self[_DYN__BUFFER ]; if (!_disableTelemetry) { if (buffer[_DYN_COUNT ]() > 0) { var payload = buffer.getItems(); _notifySendRequest(sendReason || 0 , async); if (forcedSender) { result = forcedSender.call(_self, payload, async); } else { result = _self[_DYN__SENDER ](payload, async); } } } else { buffer[_DYN_CLEAR ](); } _clearScheduledTimer(); } catch (e) { var ieVer = getIEVersion(); if (!ieVer || ieVer > 9) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 40 , "Telemetry transmission failed, some telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) }); } } } return result; }; _self._doTeardown = function (unloadCtx, unloadState) { _self.onunloadFlush(); runTargetUnload(_offlineListener, false); _initDefaults(); }; _self[_DYN__ON_ERROR ] = function (payload, message, event) { _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 26 , "Failed to send telemetry.", { message: message }); _self._buffer && _self._buffer[_DYN_CLEAR_SENT ](payload); }; _self[_DYN__ON_PARTIAL_SUCCESS ] = function (payload, results) { var failed = []; var retry = []; var errors = results.errors.reverse(); for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) { var error = errors_1[_i]; var extracted = payload.splice(error.index, 1)[0]; if (_isRetriable(error.statusCode)) { retry[_DYN_PUSH ](extracted); } else { failed[_DYN_PUSH ](extracted); } } if (payload[_DYN_LENGTH$2 ] > 0) { _self[_DYN__ON_SUCCESS ](payload, results[_DYN_ITEMS_ACCEPTED ]); } if (failed[_DYN_LENGTH$2 ] > 0) { _self[_DYN__ON_ERROR ](failed, _formatErrorMessageXhr(null, ["partial success", results[_DYN_ITEMS_ACCEPTED ], "of", results.itemsReceived].join(" "))); } if (retry[_DYN_LENGTH$2 ] > 0) { _resendPayload(retry); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , "Partial success. " + "Delivered: " + payload[_DYN_LENGTH$2 ] + ", Failed: " + failed[_DYN_LENGTH$2 ] + ". Will retry to send " + retry[_DYN_LENGTH$2 ] + " our of " + results[_DYN_ITEMS_RECEIVED ] + " items"); } }; _self[_DYN__ON_SUCCESS ] = function (payload, countOfItemsInPayload) { _self._buffer && _self._buffer[_DYN_CLEAR_SENT ](payload); }; _self._xdrOnLoad = function (xdr, payload) { var responseText = _getResponseText(xdr); if (xdr && (responseText + "" === "200" || responseText === "")) { _consecutiveErrors = 0; _self[_DYN__ON_SUCCESS ](payload, 0); } else { var results = _parseResponse(responseText); if (results && results.itemsReceived && results.itemsReceived > results[_DYN_ITEMS_ACCEPTED ] && !_isRetryDisabled) { _self[_DYN__ON_PARTIAL_SUCCESS ](payload, results); } else { _self[_DYN__ON_ERROR ](payload, _formatErrorMessageXdr(xdr)); } } }; function _isSampledIn(envelope) { return _self._sample.isSampledIn(envelope); } function _checkMaxSize(incomingPayload) { var incomingSize = incomingPayload ? incomingPayload[_DYN_LENGTH$2 ] : 0; if ((_self[_DYN__BUFFER ].size() + incomingSize) > _maxBatchSizeInBytes) { if (!_offlineListener || _offlineListener[_DYN_IS_ONLINE ]()) { _self[_DYN_TRIGGER_SEND ](true, null, 10 ); } return true; } return false; } function _checkResponsStatus(status, payload, responseUrl, countOfItemsInPayload, errorMessage, res) { var response = null; if (!_self._appId) { response = _parseResponse(res); if (response && response.appId) { _self._appId = response.appId; } } if ((status < 200 || status >= 300) && status !== 0) { if (status === 301 || status === 307 || status === 308) { if (!_checkAndUpdateEndPointUrl(responseUrl)) { _self[_DYN__ON_ERROR ](payload, errorMessage); return; } } if (!_isRetryDisabled && _isRetriable(status)) { _resendPayload(payload); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". " + "Response code " + status + ". Will retry to send " + payload[_DYN_LENGTH$2 ] + " items."); } else { _self[_DYN__ON_ERROR ](payload, errorMessage); } } else if (_offlineListener && !_offlineListener[_DYN_IS_ONLINE ]()) { if (!_isRetryDisabled) { var offlineBackOffMultiplier = 10; _resendPayload(payload, offlineBackOffMultiplier); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". Offline - Response Code: ".concat(status, ". Offline status: ").concat(!_offlineListener.isOnline(), ". Will retry to send ").concat(payload.length, " items.")); } } else { _checkAndUpdateEndPointUrl(responseUrl); if (status === 206) { if (!response) { response = _parseResponse(res); } if (response && !_isRetryDisabled) { _self[_DYN__ON_PARTIAL_SUCCESS ](payload, response); } else { _self[_DYN__ON_ERROR ](payload, errorMessage); } } else { _consecutiveErrors = 0; _self[_DYN__ON_SUCCESS ](payload, countOfItemsInPayload); } } } function _checkAndUpdateEndPointUrl(responseUrl) { if (_stamp_specific_redirects >= 10) { return false; } if (!isNullOrUndefined(responseUrl) && responseUrl !== "") { if (responseUrl !== _endpointUrl) { _endpointUrl = responseUrl; ++_stamp_specific_redirects; return true; } } return false; } function _doUnloadSend(payload, isAsync) { if (_syncUnloadSender) { _syncUnloadSender(payload, false); } else { _beaconSender(payload); } } function _doBeaconSend(payload) { var nav = getNavigator(); var buffer = _self[_DYN__BUFFER ]; var url = _endpointUrl; var batch = _self._buffer[_DYN_BATCH_PAYLOADS ](payload); var plainTextBatch = new Blob([batch], { type: "text/plain;charset=UTF-8" }); var queued = nav.sendBeacon(url, plainTextBatch); if (queued) { buffer[_DYN_MARK_AS_SENT ](payload); _self._onSuccess(payload, payload[_DYN_LENGTH$2 ]); } return queued; } function _beaconSender(payload, isAsync) { if (isArray(payload) && payload[_DYN_LENGTH$2 ] > 0) { if (!_doBeaconSend(payload)) { var droppedPayload = []; for (var lp = 0; lp < payload[_DYN_LENGTH$2 ]; lp++) { var thePayload = payload[lp]; if (!_doBeaconSend([thePayload])) { droppedPayload[_DYN_PUSH ](thePayload); } } if (droppedPayload[_DYN_LENGTH$2 ] > 0) { _fallbackSender && _fallbackSender(droppedPayload, true); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". " + "Failed to send telemetry with Beacon API, retried with normal sender."); } } } } function _xhrSender(payload, isAsync) { var thePromise; var resolveFunc; var rejectFunc; var xhr = new XMLHttpRequest(); var endPointUrl = _endpointUrl; try { xhr[DisabledPropertyName] = true; } catch (e) { } xhr.open("POST", endPointUrl, isAsync); xhr[_DYN_SET_REQUEST_HEADER$1 ]("Content-type", "application/json"); if (isInternalApplicationInsightsEndpoint(endPointUrl)) { xhr[_DYN_SET_REQUEST_HEADER$1 ](RequestHeaders[6 ], RequestHeaders[7 ]); } arrForEach(objKeys(_headers), function (headerName) { xhr[_DYN_SET_REQUEST_HEADER$1 ](headerName, _headers[headerName]); }); xhr.onreadystatechange = function () { _self._xhrReadyStateChange(xhr, payload, payload[_DYN_LENGTH$2 ]); if (xhr.readyState === 4) { resolveFunc && resolveFunc(true); } }; xhr.onerror = function (event) { _self[_DYN__ON_ERROR ](payload, _formatErrorMessageXhr(xhr), event); rejectFunc && rejectFunc(event); }; if (isAsync && _enableSendPromise) { thePromise = createPromise(function (resolve, reject) { resolveFunc = resolve; rejectFunc = reject; }); } var batch = _self._buffer[_DYN_BATCH_PAYLOADS ](payload); xhr.send(batch); _self._buffer[_DYN_MARK_AS_SENT ](payload); return thePromise; } function _fetchKeepAliveSender(payload, isAsync) { if (isArray(payload)) { var payloadSize = payload[_DYN_LENGTH$2 ]; for (var lp = 0; lp < payload[_DYN_LENGTH$2 ]; lp++) { payloadSize += payload[lp][_DYN_LENGTH$2 ]; } if ((_syncFetchPayload + payloadSize) <= FetchSyncRequestSizeLimitBytes) { _doFetchSender(payload, false); } else if (isBeaconsSupported()) { _beaconSender(payload); } else { _fallbackSender && _fallbackSender(payload, true); _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". " + "Failed to send telemetry with Beacon API, retried with xhrSender."); } } } function _fetchSender(payload, isAsync) { return _doFetchSender(payload, true); } function _doFetchSender(payload, isAsync) { var _a; var endPointUrl = _endpointUrl; var batch = _self._buffer[_DYN_BATCH_PAYLOADS ](payload); var plainTextBatch = new Blob([batch], { type: "application/json" }); var thePromise; var resolveFunc; var rejectFunc; var requestHeaders = new Headers(); var batchLength = batch[_DYN_LENGTH$2 ]; var ignoreResponse = false; var responseHandled = false; if (isInternalApplicationInsightsEndpoint(endPointUrl)) { requestHeaders.append(RequestHeaders[6 ], RequestHeaders[7 ]); } arrForEach(objKeys(_headers), function (headerName) { requestHeaders.append(headerName, _headers[headerName]); }); var init = (_a = { method: "POST", headers: requestHeaders, body: plainTextBatch }, _a[DisabledPropertyName] = true , _a); if (!isAsync) { init.keepalive = true; ignoreResponse = true; _syncFetchPayload += batchLength; } var request = new Request(endPointUrl, init); try { request[DisabledPropertyName] = true; } catch (e) { } _self._buffer[_DYN_MARK_AS_SENT ](payload); if (isAsync && _enableSendPromise) { thePromise = createPromise(function (resolve, reject) { resolveFunc = resolve; rejectFunc = reject; }); } try { doAwaitResponse(fetch(request), function (result) { if (!isAsync) { _syncFetchPayload -= batchLength; batchLength = 0; } if (!responseHandled) { responseHandled = true; if (!result.rejected) { var response_1 = result.value; if (!response_1.ok) { _self[_DYN__ON_ERROR ](payload, response_1.statusText); resolveFunc && resolveFunc(false); } else { doAwaitResponse(response_1.text(), function (resp) { _checkResponsStatus(response_1.status, payload, response_1.url, payload[_DYN_LENGTH$2 ], response_1.statusText, resp.value || ""); resolveFunc && resolveFunc(true); }); } } else { _self[_DYN__ON_ERROR ](payload, result.reason && result.reason.message); rejectFunc && rejectFunc(result.reason); } } }); } catch (e) { if (!responseHandled) { _self[_DYN__ON_ERROR ](payload, dumpObj(e)); rejectFunc && rejectFunc(e); } } if (ignoreResponse && !responseHandled) { responseHandled = true; _self._onSuccess(payload, payload[_DYN_LENGTH$2 ]); resolveFunc && resolveFunc(true); } return thePromise; } function _parseResponse(response) { try { if (response && response !== "") { var result = getJSON().parse(response); if (result && result.itemsReceived && result.itemsReceived >= result[_DYN_ITEMS_ACCEPTED ] && result.itemsReceived - result.itemsAccepted === result.errors[_DYN_LENGTH$2 ]) { return result; } } } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 43 , "Cannot parse the response. " + getExceptionName(e), { response: response }); } return null; } function _resendPayload(payload, linearFactor) { if (linearFactor === void 0) { linearFactor = 1; } if (!payload || payload[_DYN_LENGTH$2 ] === 0) { return; } var buffer = _self[_DYN__BUFFER ]; buffer[_DYN_CLEAR_SENT ](payload); _consecutiveErrors++; for (var _i = 0, payload_1 = payload; _i < payload_1.length; _i++) { var item = payload_1[_i]; buffer[_DYN_ENQUEUE ](item); } _setRetryTime(linearFactor); _setupTimer(); } function _setRetryTime(linearFactor) { var SlotDelayInSeconds = 10; var delayInSeconds; if (_consecutiveErrors <= 1) { delayInSeconds = SlotDelayInSeconds; } else { var backOffSlot = (Math.pow(2, _consecutiveErrors) - 1) / 2; var backOffDelay = Math.floor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1; backOffDelay = linearFactor * backOffDelay; delayInSeconds = Math.max(Math.min(backOffDelay, 3600), SlotDelayInSeconds); } var retryAfterTimeSpan = utcNow() + (delayInSeconds * 1000); _retryAt = retryAfterTimeSpan; } function _setupTimer() { if (!_timeoutHandle && !_paused) { var retryInterval = _retryAt ? Math.max(0, _retryAt - utcNow()) : 0; var timerValue = Math.max(_maxBatchInterval, retryInterval); _timeoutHandle = scheduleTimeout(function () { _timeoutHandle = null; _self[_DYN_TRIGGER_SEND ](true, null, 1 ); }, timerValue); } } function _clearScheduledTimer() { _timeoutHandle && _timeoutHandle.cancel(); _timeoutHandle = null; _retryAt = null; } function _isRetriable(statusCode) { return statusCode === 401 || statusCode === 403 || statusCode === 408 || statusCode === 429 || statusCode === 500 || statusCode === 502 || statusCode === 503 || statusCode === 504; } function _formatErrorMessageXhr(xhr, message) { if (xhr) { return "XMLHttpRequest,Status:" + xhr.status + ",Response:" + _getResponseText(xhr) || xhr.response || ""; } return message; } function _xdrSender(payload, isAsync) { var buffer = _self[_DYN__BUFFER ]; var _window = getWindow(); var xdr = new XDomainRequest(); xdr.onload = function () { return _self._xdrOnLoad(xdr, payload); }; xdr.onerror = function (event) { return _self[_DYN__ON_ERROR ](payload, _formatErrorMessageXdr(xdr), event); }; var hostingProtocol = _window && _window.location && _window.location.protocol || ""; if (_endpointUrl.lastIndexOf(hostingProtocol, 0) !== 0) { _throwInternal(_self[_DYN_DIAG_LOG ](), 2 , 40 , ". " + "Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."); buffer[_DYN_CLEAR ](); return; } var endpointUrl = _endpointUrl.replace(/^(https?:)/, ""); xdr.open("POST", endpointUrl); var batch = buffer[_DYN_BATCH_PAYLOADS ](payload); xdr.send(batch); buffer[_DYN_MARK_AS_SENT ](payload); } function _formatErrorMessageXdr(xdr, message) { if (xdr) { return "XDomainRequest,Response:" + _getResponseText(xdr) || ""; } return message; } function _getNotifyMgr() { var func = "getNotifyMgr"; if (_self.core[func]) { return _self.core[func](); } return _self.core["_notificationManager"]; } function _notifySendRequest(sendRequest, isAsync) { var manager = _getNotifyMgr(); if (manager && manager[_DYN_EVENTS_SEND_REQUEST ]) { try { manager[_DYN_EVENTS_SEND_REQUEST ](sendRequest, isAsync); } catch (e) { _throwInternal(_self[_DYN_DIAG_LOG ](), 1 , 74 , "send request notification failed: " + getExceptionName(e), { exception: dumpObj(e) }); } } } function _validateInstrumentationKey(instrumentationKey, config) { var disableValidation = config.disableInstrumentationKeyValidation; var disableIKeyValidationFlag = isNullOrUndefined(disableValidation) ? false : disableValidation; if (disableIKeyValidationFlag) { return true; } var UUID_Regex = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"; var regexp = new RegExp(UUID_Regex); return regexp.test(instrumentationKey); } function _initDefaults() { _self[_DYN__SENDER ] = null; _self[_DYN__BUFFER ] = null; _self._appId = null; _self._sample = null; _headers = {}; _offlineListener = null; _consecutiveErrors = 0; _retryAt = null; _paused = false; _timeoutHandle = null; _serializer = null; _stamp_specific_redirects = 0; _syncFetchPayload = 0; _fallbackSender = null; _syncUnloadSender = null; _evtNamespace = null; _endpointUrl = null; _orgEndpointUrl = null; _maxBatchSizeInBytes = 0; _beaconSupported = false; _customHeaders = null; _disableTelemetry = false; _instrumentationKey = null; _convertUndefined = UNDEFINED_VALUE$1; _isRetryDisabled = false; _sessionStorageUsed = null; _namePrefix = UNDEFINED_VALUE$1; objDefine(_self, "_senderConfig", { g: function () { return objExtend({}, defaultAppInsightsChannelConfig); } }); } }); return _this; } Sender.constructEnvelope = function (orig, iKey, logger, convertUndefined) { var envelope; if (iKey !== orig.iKey && !isNullOrUndefined(iKey)) { envelope = __assignFn(__assignFn({}, orig), { iKey: iKey }); } else { envelope = orig; } var creator = EnvelopeTypeCreator[envelope.baseType] || EventEnvelopeCreator; return creator(logger, envelope, convertUndefined); }; return Sender; }(BaseTelemetryPlugin)); var STR_DURATION = "duration"; var STR_PROPERTIES = "properties"; var _DYN_REQUEST_URL = "requestUrl"; var _DYN_INST = "inst"; var _DYN_LENGTH$1 = "length"; var _DYN_TRACE_ID = "traceID"; var _DYN_SPAN_ID = "spanID"; var _DYN_TRACE_FLAGS = "traceFlags"; var _DYN_CONTEXT$1 = "context"; var _DYN_ABORTED = "aborted"; var _DYN_TRACE_ID0 = "traceId"; var _DYN_SPAN_ID1 = "spanId"; var _DYN__ADD_HOOK = "_addHook"; var _DYN_CORE = "core"; var _DYN_INCLUDE_CORRELATION_2 = "includeCorrelationHeaders"; var _DYN_GET_ABSOLUTE_URL = "getAbsoluteUrl"; var _DYN_HEADERS = "headers"; var _DYN_REQUEST_HEADERS = "requestHeaders"; var _DYN_SET_REQUEST_HEADER = "setRequestHeader"; var _DYN_TRACK_DEPENDENCY_DAT3 = "trackDependencyDataInternal"; var _DYN_START_TIME = "startTime"; var _DYN_TO_LOWER_CASE = "toLowerCase"; var _DYN_ENABLE_REQUEST_HEADE4 = "enableRequestHeaderTracking"; var _DYN_ENABLE_AJAX_ERROR_ST5 = "enableAjaxErrorStatusText"; var _DYN_ENABLE_AJAX_PERF_TRA6 = "enableAjaxPerfTracking"; var _DYN_MAX_AJAX_CALLS_PER_V7 = "maxAjaxCallsPerView"; var _DYN_EXCLUDE_REQUEST_FROM8 = "excludeRequestFromAutoTrackingPatterns"; var _DYN_ADD_REQUEST_CONTEXT = "addRequestContext"; var _DYN_DISABLE_AJAX_TRACKIN9 = "disableAjaxTracking"; var _DYN_AJAX_PERF_LOOKUP_DEL10 = "ajaxPerfLookupDelay"; var _DYN_DISABLE_FETCH_TRACKI11 = "disableFetchTracking"; var _DYN_ENABLE_RESPONSE_HEAD12 = "enableResponseHeaderTracking"; var _DYN_STATUS = "status"; var _DYN_STATUS_TEXT = "statusText"; var _DYN_HEADER_MAP = "headerMap"; var _DYN_OPEN_DONE = "openDone"; var _DYN_SEND_DONE = "sendDone"; var _DYN_REQUEST_SENT_TIME = "requestSentTime"; var _DYN_ABORT_DONE = "abortDone"; var _DYN_GET_TRACE_ID = "getTraceId"; var _DYN_GET_TRACE_FLAGS = "getTraceFlags"; var _DYN_METHOD = "method"; var _DYN_ERROR_STATUS_TEXT = "errorStatusText"; var _DYN_STATE_CHANGE_ATTACHE13 = "stateChangeAttached"; var _DYN_RESPONSE_TEXT = "responseText"; var _DYN_RESPONSE_FINISHED_TI14 = "responseFinishedTime"; var _DYN__CREATE_TRACK_ITEM = "CreateTrackItem"; var _DYN_RESPONSE = "response"; var _DYN_GET_ALL_RESPONSE_HEA15 = "getAllResponseHeaders"; var _DYN_GET_PART_APROPS = "getPartAProps"; var _DYN_PERF_MARK = "perfMark"; var _DYN_NAME = "name"; var _DYN_PERF_TIMING = "perfTiming"; var _DYN_EXCEPTION = "exception"; var _DYN_AJAX_DIAGNOSTICS_MES16 = "ajaxDiagnosticsMessage"; var _DYN_CORRELATION_CONTEXT = "correlationContext"; var _DYN_AJAX_TOTAL_DURATION = "ajaxTotalDuration"; var _DYN_EVENT_TRACE_CTX = "eventTraceCtx"; function _calcPerfDuration(resourceEntry, start, end) { var result = 0; var from = resourceEntry[start]; var to = resourceEntry[end]; if (from && to) { result = dateTimeUtilsDuration(from, to); } return result; } function _setPerfDuration(props, name, resourceEntry, start, end) { var result = 0; var value = _calcPerfDuration(resourceEntry, start, end); if (value) { result = _setPerfValue(props, name, msToTimeSpan(value)); } return result; } function _setPerfValue(props, name, value) { var strPerf = "ajaxPerf"; var result = 0; if (props && name && value) { var perfData = props[strPerf] = (props[strPerf] || {}); perfData[name] = value; result = 1; } return result; } function _populatePerfData(ajaxData, dependency) { var resourceEntry = ajaxData[_DYN_PERF_TIMING ]; var props = dependency[STR_PROPERTIES ] || {}; var propsSet = 0; var strName = "name"; var strStart = "Start"; var strEnd = "End"; var strDomainLookup = "domainLookup"; var strConnect = "connect"; var strRedirect = "redirect"; var strRequest = "request"; var strResponse = "response"; var strStartTime = "startTime"; var strDomainLookupStart = strDomainLookup + strStart; var strDomainLookupEnd = strDomainLookup + strEnd; var strConnectStart = strConnect + strStart; var strConnectEnd = strConnect + strEnd; var strRequestStart = strRequest + strStart; var strRequestEnd = strRequest + strEnd; var strResponseStart = strResponse + strStart; var strResponseEnd = strResponse + strEnd; var strRedirectStart = strRedirect + strStart; var strRedirectEnd = strRedirect = strEnd; var strTransferSize = "transferSize"; var strEncodedBodySize = "encodedBodySize"; var strDecodedBodySize = "decodedBodySize"; var strServerTiming = "serverTiming"; if (resourceEntry) { propsSet |= _setPerfDuration(props, strRedirect, resourceEntry, strRedirectStart, strRedirectEnd); propsSet |= _setPerfDuration(props, strDomainLookup, resourceEntry, strDomainLookupStart, strDomainLookupEnd); propsSet |= _setPerfDuration(props, strConnect, resourceEntry, strConnectStart, strConnectEnd); propsSet |= _setPerfDuration(props, strRequest, resourceEntry, strRequestStart, strRequestEnd); propsSet |= _setPerfDuration(props, strResponse, resourceEntry, strResponseStart, strResponseEnd); propsSet |= _setPerfDuration(props, "networkConnect", resourceEntry, strStartTime, strConnectEnd); propsSet |= _setPerfDuration(props, "sentRequest", resourceEntry, strRequestStart, strResponseEnd); var duration = resourceEntry[STR_DURATION ]; if (!duration) { duration = _calcPerfDuration(resourceEntry, strStartTime, strResponseEnd) || 0; } propsSet |= _setPerfValue(props, STR_DURATION, duration); propsSet |= _setPerfValue(props, "perfTotal", duration); var serverTiming = resourceEntry[strServerTiming]; if (serverTiming) { var server_1 = {}; arrForEach(serverTiming, function (value, idx) { var name = normalizeJsName(value[strName] || "" + idx); var newValue = server_1[name] || {}; objForEachKey(value, function (key, val) { if (key !== strName && isString(val) || isNumber(val)) { if (newValue[key]) { val = newValue[key] + ";" + val; } if (val || !isString(val)) { newValue[key] = val; } } }); server_1[name] = newValue; }); propsSet |= _setPerfValue(props, strServerTiming, server_1); } propsSet |= _setPerfValue(props, strTransferSize, resourceEntry[strTransferSize]); propsSet |= _setPerfValue(props, strEncodedBodySize, resourceEntry[strEncodedBodySize]); propsSet |= _setPerfValue(props, strDecodedBodySize, resourceEntry[strDecodedBodySize]); } else { if (ajaxData[_DYN_PERF_MARK ]) { propsSet |= _setPerfValue(props, "missing", ajaxData.perfAttempts); } } if (propsSet) { dependency[STR_PROPERTIES ] = props; } } var XHRMonitoringState = /** @class */ (function () { function XHRMonitoringState() { var self = this; self[_DYN_OPEN_DONE ] = false; self.setRequestHeaderDone = false; self[_DYN_SEND_DONE ] = false; self[_DYN_ABORT_DONE ] = false; self[_DYN_STATE_CHANGE_ATTACHE13 ] = false; } return XHRMonitoringState; }()); var ajaxRecord = /** @class */ (function () { function ajaxRecord(traceId, spanId, logger, traceCtx) { var _a; var self = this; var _logger = logger; var strResponseText = "responseText"; self[_DYN_PERF_MARK ] = null; self.completed = false; self.requestHeadersSize = null; self[_DYN_REQUEST_HEADERS ] = null; self.responseReceivingDuration = null; self.callbackDuration = null; self[_DYN_AJAX_TOTAL_DURATION ] = null; self[_DYN_ABORTED ] = 0; self.pageUrl = null; self[_DYN_REQUEST_URL ] = null; self.requestSize = 0; self[_DYN_METHOD ] = null; self[_DYN_STATUS ] = null; self[_DYN_REQUEST_SENT_TIME ] = null; self.responseStartedTime = null; self[_DYN_RESPONSE_FINISHED_TI14 ] = null; self.callbackFinishedTime = null; self.endTime = null; self.xhrMonitoringState = new XHRMonitoringState(); self.clientFailure = 0; self[_DYN_TRACE_ID ] = traceId; self[_DYN_SPAN_ID ] = spanId; self[_DYN_TRACE_FLAGS ] = traceCtx === null || traceCtx === void 0 ? void 0 : traceCtx.getTraceFlags(); if (traceCtx) { self[_DYN_EVENT_TRACE_CTX ] = (_a = {}, _a[_DYN_TRACE_ID0 ] = traceCtx[_DYN_GET_TRACE_ID ](), _a[_DYN_SPAN_ID1 ] = traceCtx.getSpanId(), _a[_DYN_TRACE_FLAGS ] = traceCtx[_DYN_GET_TRACE_FLAGS ](), _a); } else { self[_DYN_EVENT_TRACE_CTX ] = null; } dynamicProto(ajaxRecord, self, function (self) { self.getAbsoluteUrl = function () { return self[_DYN_REQUEST_URL ] ? urlGetAbsoluteUrl(self[_DYN_REQUEST_URL ]) : null; }; self.getPathName = function () { return self[_DYN_REQUEST_URL ] ? dataSanitizeUrl(_logger, urlGetCompleteUrl(self[_DYN_METHOD ], self[_DYN_REQUEST_URL ])) : null; }; self[_DYN__CREATE_TRACK_ITEM ] = function (ajaxType, enableRequestHeaderTracking, getResponse) { var _a; self.ajaxTotalDuration = Math.round(dateTimeUtilsDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000; if (self[_DYN_AJAX_TOTAL_DURATION ] < 0) { return null; } var dependency = (_a = { id: "|" + self[_DYN_TRACE_ID ] + "." + self[_DYN_SPAN_ID ], target: self[_DYN_GET_ABSOLUTE_URL ]() }, _a[_DYN_NAME ] = self.getPathName(), _a.type = ajaxType, _a[_DYN_START_TIME ] = null, _a.duration = self[_DYN_AJAX_TOTAL_DURATION ], _a.success = (+(self[_DYN_STATUS ])) >= 200 && (+(self[_DYN_STATUS ])) < 400, _a.responseCode = (+(self[_DYN_STATUS ])), _a[STR_PROPERTIES] = { HttpMethod: self[_DYN_METHOD ] }, _a); var props = dependency[STR_PROPERTIES]; if (self[_DYN_ABORTED ]) { props[_DYN_ABORTED ] = true; } if (self[_DYN_REQUEST_SENT_TIME ]) { dependency[_DYN_START_TIME ] = new Date(); dependency[_DYN_START_TIME ].setTime(self[_DYN_REQUEST_SENT_TIME ]); } _populatePerfData(self, dependency); if (enableRequestHeaderTracking) { if (objKeys(self.requestHeaders)[_DYN_LENGTH$1 ] > 0) { props[_DYN_REQUEST_HEADERS ] = self[_DYN_REQUEST_HEADERS ]; } } if (getResponse) { var response = getResponse(); if (response) { var correlationContext = response[_DYN_CORRELATION_CONTEXT ]; if (correlationContext) { dependency.correlationContext = correlationContext; } if (response[_DYN_HEADER_MAP ]) { if (objKeys(response.headerMap)[_DYN_LENGTH$1 ] > 0) { props.responseHeaders = response[_DYN_HEADER_MAP ]; } } if (self[_DYN_ERROR_STATUS_TEXT ]) { if (self[_DYN_STATUS ] >= 400) { var responseType = response.type; if (responseType === "" || responseType === "text") { props.responseText = response.responseText ? response[_DYN_STATUS_TEXT ] + " - " + response[strResponseText] : response[_DYN_STATUS_TEXT ]; } if (responseType === "json") { props.responseText = response.response ? response[_DYN_STATUS_TEXT ] + " - " + JSON.stringify(response[_DYN_RESPONSE ]) : response[_DYN_STATUS_TEXT ]; } } else if (self[_DYN_STATUS ] === 0) { props.responseText = response[_DYN_STATUS_TEXT ] || ""; } } } } return dependency; }; self[_DYN_GET_PART_APROPS ] = function () { var _a; var partA = null; var traceCtx = self[_DYN_EVENT_TRACE_CTX ]; if (traceCtx && (traceCtx[_DYN_TRACE_ID0 ] || traceCtx[_DYN_SPAN_ID1 ])) { partA = {}; var traceExt = partA[Extensions.TraceExt] = (_a = {}, _a[_DYN_TRACE_ID ] = traceCtx[_DYN_TRACE_ID0 ], _a.parentID = traceCtx[_DYN_SPAN_ID1 ], _a); if (!isNullOrUndefined(traceCtx[_DYN_TRACE_FLAGS ])) { traceExt[_DYN_TRACE_FLAGS ] = traceCtx[_DYN_TRACE_FLAGS ]; } } return partA; }; }); } ajaxRecord.__ieDyn=1; return ajaxRecord; }()); var _a$2; var AJAX_MONITOR_PREFIX = "ai.ajxmn."; var strDiagLog = "diagLog"; var strAjaxData = "ajaxData"; var STR_FETCH = "fetch"; var ERROR_HEADER = "Failed to monitor XMLHttpRequest"; var ERROR_PREFIX = ", monitoring data for this ajax call "; var ERROR_POSTFIX = ERROR_PREFIX + "may be incorrect."; var ERROR_NOT_SENT = ERROR_PREFIX + "won't be sent."; var CORRELATION_HEADER_ERROR = "Failed to get Request-Context correlation header as it may be not included in the response or not accessible."; var CUSTOM_REQUEST_CONTEXT_ERROR = "Failed to add custom defined request context as configured call back may missing a null check."; var FAILED_TO_CALCULATE_DURATION_ERROR = "Failed to calculate the duration of the "; var _markCount = 0; function _supportsFetch() { var _global = getGlobal(); if (!_global || isNullOrUndefined(_global.Request) || isNullOrUndefined(_global.Request[strShimPrototype]) || isNullOrUndefined(_global[STR_FETCH])) { return null; } return _global[STR_FETCH]; } function _supportsAjaxMonitoring(ajaxMonitorInstance) { var _a; var result = false; if (isXhrSupported()) { var proto = XMLHttpRequest[strShimPrototype]; result = !isNullOrUndefined(proto) && !isNullOrUndefined(proto.open) && !isNullOrUndefined(proto.send) && !isNullOrUndefined(proto.abort); } var ieVer = getIEVersion(); if (ieVer && ieVer < 9) { result = false; } if (result) { try { var xhr = new XMLHttpRequest(); xhr[strAjaxData] = {}; var theOpen = XMLHttpRequest[strShimPrototype].open; XMLHttpRequest[strShimPrototype].open = theOpen; } catch (e) { result = false; _throwInternalCritical(ajaxMonitorInstance, 15 , "Failed to enable XMLHttpRequest monitoring, extension is not supported", (_a = {}, _a[_DYN_EXCEPTION ] = dumpObj(e), _a)); } } return result; } function _getFailedAjaxDiagnosticsMessage(xhr) { var result = ""; try { if (xhr && xhr[strAjaxData] && xhr[strAjaxData][_DYN_REQUEST_URL ]) { result += "(url: '" + xhr[strAjaxData][_DYN_REQUEST_URL ] + "')"; } } catch (e) { } return result; } function _throwInternalCritical(ajaxMonitorInstance, msgId, message, properties, isUserAct) { _throwInternal(ajaxMonitorInstance[strDiagLog](), 1 , msgId, message, properties, isUserAct); } function _throwInternalWarning(ajaxMonitorInstance, msgId, message, properties, isUserAct) { _throwInternal(ajaxMonitorInstance[strDiagLog](), 2 , msgId, message, properties, isUserAct); } function _createErrorCallbackFunc(ajaxMonitorInstance, internalMessage, message) { return function (args) { var _a; _throwInternalCritical(ajaxMonitorInstance, internalMessage, message, (_a = { ajaxDiagnosticsMessage: _getFailedAjaxDiagnosticsMessage(args[_DYN_INST ]) }, _a[_DYN_EXCEPTION ] = dumpObj(args.err), _a)); }; } function _indexOf(value, match) { if (value && match) { return strIndexOf(value, match); } return -1; } function _addHandler(container, id, theFunc) { var theHandler = { id: id, fn: theFunc }; container.push(theHandler); return { remove: function () { arrForEach(container, function (initializer, idx) { if (initializer.id === theHandler.id) { container.splice(idx, 1); return -1; } }); } }; } function _processDependencyContainer(core, container, details, message) { var result = true; arrForEach(container, function (theFunc, idx) { try { if (theFunc.fn.call(null, details) === false) { result = false; } } catch (e) { _throwInternal(core && core.logger, 1 , 64 , "Dependency " + message + " [#" + idx + "] failed: " + getExceptionName(e), { exception: dumpObj(e) }, true); } }); return result; } function _processDependencyListeners(listeners, core, ajaxData, xhr, input, init) { var _a; var initializersCount = listeners[_DYN_LENGTH$1 ]; if (initializersCount > 0) { var details = (_a = {}, _a[_DYN_CORE ] = core, _a.xhr = xhr, _a.input = input, _a.init = init, _a.traceId = ajaxData[_DYN_TRACE_ID ], _a.spanId = ajaxData[_DYN_SPAN_ID ], _a.traceFlags = ajaxData[_DYN_TRACE_FLAGS ], _a.context = ajaxData[_DYN_CONTEXT$1 ] || {}, _a.aborted = !!ajaxData[_DYN_ABORTED ], _a); _processDependencyContainer(core, listeners, details, "listener"); ajaxData[_DYN_TRACE_ID ] = details[_DYN_TRACE_ID0 ]; ajaxData[_DYN_SPAN_ID ] = details[_DYN_SPAN_ID1 ]; ajaxData[_DYN_TRACE_FLAGS ] = details[_DYN_TRACE_FLAGS ]; ajaxData[_DYN_CONTEXT$1 ] = details[_DYN_CONTEXT$1 ]; } } var BLOB_CORE = "*.blob.core."; var DfltAjaxCorrelationHeaderExDomains = objFreeze([ BLOB_CORE + "windows.net", BLOB_CORE + "chinacloudapi.cn", BLOB_CORE + "cloudapi.de", BLOB_CORE + "usgovcloudapi.net" ]); var _internalExcludeEndpoints = [ /https:\/\/[^\/]*(\.pipe\.aria|aria\.pipe|events\.data|collector\.azure)\.[^\/]+\/(OneCollector\/1|Collector\/3)\.0/i ]; var _defaultConfig$1 = objFreeze((_a$2 = {}, _a$2[_DYN_MAX_AJAX_CALLS_PER_V7 ] = 500, _a$2[_DYN_DISABLE_AJAX_TRACKIN9 ] = false, _a$2[_DYN_DISABLE_FETCH_TRACKI11 ] = false, _a$2[_DYN_EXCLUDE_REQUEST_FROM8 ] = undefined, _a$2.disableCorrelationHeaders = false, _a$2.distributedTracingMode = 1 , _a$2.correlationHeaderExcludedDomains = DfltAjaxCorrelationHeaderExDomains, _a$2.correlationHeaderDomains = undefined, _a$2.correlationHeaderExcludePatterns = undefined, _a$2.appId = undefined, _a$2.enableCorsCorrelation = false, _a$2[_DYN_ENABLE_REQUEST_HEADE4 ] = false, _a$2[_DYN_ENABLE_RESPONSE_HEAD12 ] = false, _a$2[_DYN_ENABLE_AJAX_ERROR_ST5 ] = false, _a$2[_DYN_ENABLE_AJAX_PERF_TRA6 ] = false, _a$2.maxAjaxPerfLookupAttempts = 3, _a$2[_DYN_AJAX_PERF_LOOKUP_DEL10 ] = 25, _a$2.ignoreHeaders = [ "Authorization", "X-API-Key", "WWW-Authenticate" ], _a$2[_DYN_ADD_REQUEST_CONTEXT ] = undefined, _a$2.addIntEndpoints = true, _a$2)); var AjaxMonitor = /** @class */ (function (_super) { __extendsFn(AjaxMonitor, _super); function AjaxMonitor() { var _this = _super.call(this) || this; _this.identifier = AjaxMonitor.identifier; _this.priority = 120; var _fetchInitialized; var _xhrInitialized; var _currentWindowHost; var _extensionConfig; var _enableRequestHeaderTracking; var _enableAjaxErrorStatusText; var _trackAjaxAttempts; var _context; var _isUsingW3CHeaders; var _isUsingAIHeaders; var _markPrefix; var _enableAjaxPerfTracking; var _maxAjaxCallsPerView; var _enableResponseHeaderTracking; var _disabledUrls; var _disableAjaxTracking; var _disableFetchTracking; var _excludeRequestFromAutoTrackingPatterns; var _addRequestContext; var _evtNamespace; var _dependencyHandlerId; var _dependencyListeners; var _dependencyInitializers; var _ignoreHeaders; var _maxAjaxPerfLookupAttempts; var _ajaxPerfLookupDelay; var _distributedTracingMode; var _appId; var _polyfillInitialized; dynamicProto(AjaxMonitor, _this, function (_self, _base) { var _addHook = _base[_DYN__ADD_HOOK ]; _initDefaults(); _self.initialize = function (config, core, extensions, pluginChain) { if (!_self.isInitialized()) { _base.initialize(config, core, extensions, pluginChain); _evtNamespace = mergeEvtNamespace(createUniqueNamespace("ajax"), core && core.evtNamespace && core.evtNamespace()); _populateDefaults(config); _instrumentXhr(); _instrumentFetch(); _populateContext(); } }; _self._doTeardown = function () { _initDefaults(); }; _self.trackDependencyData = function (dependency, properties) { _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE ], null, dependency, properties); }; _self[_DYN_INCLUDE_CORRELATION_2 ] = function (ajaxData, input, init, xhr) { var currentWindowHost = _self["_currentWindowHost"] || _currentWindowHost; _processDependencyListeners(_dependencyListeners, _self[_DYN_CORE ], ajaxData, xhr, input, init); if (input) { if (correlationIdCanIncludeCorrelationHeader(_extensionConfig, ajaxData[_DYN_GET_ABSOLUTE_URL ](), currentWindowHost)) { if (!init) { init = {}; } var headers = new Headers(init[_DYN_HEADERS ] || (input instanceof Request ? (input[_DYN_HEADERS ] || {}) : {})); if (_isUsingAIHeaders) { var id = "|" + ajaxData[_DYN_TRACE_ID ] + "." + ajaxData[_DYN_SPAN_ID ]; headers.set(RequestHeaders[3 ], id); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[3 ]] = id; } } var appId = _appId || (_context && _context.appId()); if (appId) { headers.set(RequestHeaders[0 ], RequestHeaders[2 ] + appId); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[0 ]] = RequestHeaders[2 ] + appId; } } if (_isUsingW3CHeaders) { var traceFlags = ajaxData[_DYN_TRACE_FLAGS ]; if (isNullOrUndefined(traceFlags)) { traceFlags = 0x01; } var traceParent = formatTraceParent(createTraceParent(ajaxData[_DYN_TRACE_ID ], ajaxData[_DYN_SPAN_ID ], traceFlags)); headers.set(RequestHeaders[4 ], traceParent); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[4 ]] = traceParent; } } init[_DYN_HEADERS ] = headers; } return init; } else if (xhr) { if (correlationIdCanIncludeCorrelationHeader(_extensionConfig, ajaxData[_DYN_GET_ABSOLUTE_URL ](), currentWindowHost)) { if (_isUsingAIHeaders) { var id = "|" + ajaxData[_DYN_TRACE_ID ] + "." + ajaxData[_DYN_SPAN_ID ]; xhr[_DYN_SET_REQUEST_HEADER ](RequestHeaders[3 ], id); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[3 ]] = id; } } var appId = _appId || (_context && _context.appId()); if (appId) { xhr[_DYN_SET_REQUEST_HEADER ](RequestHeaders[0 ], RequestHeaders[2 ] + appId); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[0 ]] = RequestHeaders[2 ] + appId; } } if (_isUsingW3CHeaders) { var traceFlags = ajaxData[_DYN_TRACE_FLAGS ]; if (isNullOrUndefined(traceFlags)) { traceFlags = 0x01; } var traceParent = formatTraceParent(createTraceParent(ajaxData[_DYN_TRACE_ID ], ajaxData[_DYN_SPAN_ID ], traceFlags)); xhr[_DYN_SET_REQUEST_HEADER ](RequestHeaders[4 ], traceParent); if (_enableRequestHeaderTracking) { ajaxData[_DYN_REQUEST_HEADERS ][RequestHeaders[4 ]] = traceParent; } } } return xhr; } return undefined; }; _self[_DYN_TRACK_DEPENDENCY_DAT3 ] = function (dependency, properties, systemProperties) { if (_maxAjaxCallsPerView === -1 || _trackAjaxAttempts < _maxAjaxCallsPerView) { if ((_distributedTracingMode === 2 || _distributedTracingMode === 1 ) && typeof dependency.id === "string" && dependency.id[dependency.id[_DYN_LENGTH$1 ] - 1] !== ".") { dependency.id += "."; } if (isNullOrUndefined(dependency[_DYN_START_TIME ])) { dependency[_DYN_START_TIME ] = new Date(); } var item = createTelemetryItem(dependency, RemoteDependencyData.dataType, RemoteDependencyData.envelopeType, _self[strDiagLog](), properties, systemProperties); _self[_DYN_CORE ].track(item); } else if (_trackAjaxAttempts === _maxAjaxCallsPerView) { _throwInternalCritical(_self, 55 , "Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.", true); } ++_trackAjaxAttempts; }; _self.addDependencyListener = function (dependencyListener) { return _addHandler(_dependencyListeners, _dependencyHandlerId++, dependencyListener); }; _self.addDependencyInitializer = function (dependencyInitializer) { return _addHandler(_dependencyInitializers, _dependencyHandlerId++, dependencyInitializer); }; function _initDefaults() { var location = getLocation(); _fetchInitialized = false; _xhrInitialized = false; _polyfillInitialized = false; _currentWindowHost = location && location.host && location.host[_DYN_TO_LOWER_CASE ](); _extensionConfig = null; _enableRequestHeaderTracking = false; _enableAjaxErrorStatusText = false; _trackAjaxAttempts = 0; _context = null; _isUsingW3CHeaders = false; _isUsingAIHeaders = false; _markPrefix = null; _enableAjaxPerfTracking = false; _maxAjaxCallsPerView = 0; _enableResponseHeaderTracking = false; _disabledUrls = {}; _disableAjaxTracking = false; _disableFetchTracking = false; _excludeRequestFromAutoTrackingPatterns = null; _addRequestContext = null; _evtNamespace = null; _dependencyHandlerId = 0; _dependencyListeners = []; _dependencyInitializers = []; _ignoreHeaders = null; _maxAjaxPerfLookupAttempts = 1; _ajaxPerfLookupDelay = 1; _distributedTracingMode = 1 ; _appId = null; } function _populateDefaults(config) { _self[_DYN__ADD_HOOK ](onConfigChange(config, function (details) { var config = details.cfg; var ctx = createProcessTelemetryContext(null, config, _self[_DYN_CORE ]); _extensionConfig = ctx.getExtCfg(AjaxMonitor.identifier, _defaultConfig$1); _distributedTracingMode = _extensionConfig.distributedTracingMode; _enableRequestHeaderTracking = _extensionConfig[_DYN_ENABLE_REQUEST_HEADE4 ]; _enableAjaxErrorStatusText = _extensionConfig[_DYN_ENABLE_AJAX_ERROR_ST5 ]; _enableAjaxPerfTracking = _extensionConfig[_DYN_ENABLE_AJAX_PERF_TRA6 ]; _maxAjaxCallsPerView = _extensionConfig[_DYN_MAX_AJAX_CALLS_PER_V7 ]; _excludeRequestFromAutoTrackingPatterns = [].concat(_extensionConfig[_DYN_EXCLUDE_REQUEST_FROM8 ] || [], _extensionConfig.addIntEndpoints !== false ? _internalExcludeEndpoints : []); _addRequestContext = _extensionConfig[_DYN_ADD_REQUEST_CONTEXT ]; _isUsingAIHeaders = _distributedTracingMode === 0 || _distributedTracingMode === 1 ; _isUsingW3CHeaders = _distributedTracingMode === 1 || _distributedTracingMode === 2 ; if (_enableAjaxPerfTracking) { var iKey = config.instrumentationKey || "unkwn"; if (iKey[_DYN_LENGTH$1 ] > 5) { _markPrefix = AJAX_MONITOR_PREFIX + strSubstring(iKey, iKey[_DYN_LENGTH$1 ] - 5) + "."; } else { _markPrefix = AJAX_MONITOR_PREFIX + iKey + "."; } } _disableAjaxTracking = !!_extensionConfig[_DYN_DISABLE_AJAX_TRACKIN9 ]; _maxAjaxPerfLookupAttempts = _extensionConfig.maxAjaxPerfLookupAttempts; _ajaxPerfLookupDelay = _extensionConfig[_DYN_AJAX_PERF_LOOKUP_DEL10 ]; _ignoreHeaders = _extensionConfig.ignoreHeaders; _appId = _extensionConfig.appId; })); } function _populateContext() { var propExt = _self[_DYN_CORE ].getPlugin(PropertiesPluginIdentifier); if (propExt) { _context = propExt.plugin[_DYN_CONTEXT$1 ]; } } function _canIncludeHeaders(header) { var rlt = true; if (header || _ignoreHeaders) { arrForEach(_ignoreHeaders, (function (key) { if (key[_DYN_TO_LOWER_CASE ]() === header[_DYN_TO_LOWER_CASE ]()) { rlt = false; return -1; } })); } return rlt; } function _instrumentFetch() { var fetch = _supportsFetch(); if (!fetch) { return; } var global = getGlobal(); var isPolyfill = fetch.polyfill; _self[_DYN__ADD_HOOK ](onConfigChange(_extensionConfig, function () { _disableFetchTracking = !!_extensionConfig[_DYN_DISABLE_FETCH_TRACKI11 ]; _enableResponseHeaderTracking = _extensionConfig[_DYN_ENABLE_RESPONSE_HEAD12 ]; if (!_disableFetchTracking && !_fetchInitialized) { _addHook(InstrumentFunc(global, STR_FETCH, { ns: _evtNamespace, req: function (callDetails, input, init) { var fetchData; if (!_disableFetchTracking && _fetchInitialized && !_isDisabledRequest(null, input, init) && !(isPolyfill && _xhrInitialized)) { var ctx = callDetails.ctx(); fetchData = _createFetchRecord(input, init); var newInit = _self[_DYN_INCLUDE_CORRELATION_2 ](fetchData, input, init); if (newInit !== init) { callDetails.set(1, newInit); } ctx.data = fetchData; } }, rsp: function (callDetails, input) { if (!_disableFetchTracking) { var fetchData_1 = callDetails.ctx().data; if (fetchData_1) { callDetails.rslt = callDetails.rslt.then(function (response) { _reportFetchMetrics(callDetails, (response || {})[_DYN_STATUS ], input, response, fetchData_1, function () { var _a; var ajaxResponse = (_a = { statusText: (response || {})[_DYN_STATUS_TEXT ] }, _a[_DYN_HEADER_MAP ] = null, _a[_DYN_CORRELATION_CONTEXT ] = _getFetchCorrelationContext(response), _a); if (_enableResponseHeaderTracking && response) { var responseHeaderMap_1 = {}; response.headers.forEach(function (value, name) { if (_canIncludeHeaders(name)) { responseHeaderMap_1[name] = value; } }); ajaxResponse[_DYN_HEADER_MAP ] = responseHeaderMap_1; } return ajaxResponse; }); return response; }) .catch(function (reason) { _reportFetchMetrics(callDetails, 0, input, null, fetchData_1, null, { error: reason.message || dumpObj(reason) }); throw reason; }); } } }, hkErr: _createErrorCallbackFunc(_self, 15 , "Failed to monitor Window.fetch" + ERROR_POSTFIX) }, true, isWebWorker())); _fetchInitialized = true; } else if (isPolyfill && !_polyfillInitialized) { _addHook(InstrumentFunc(global, STR_FETCH, { ns: _evtNamespace, req: function (callDetails, input, init) { _isDisabledRequest(null, input, init); } })); _polyfillInitialized = true; } })); if (isPolyfill) { global[STR_FETCH].polyfill = isPolyfill; } } function _hookProto(target, funcName, callbacks) { _addHook(InstrumentProto(target, funcName, callbacks)); } function _instrumentXhr() { if (!_supportsAjaxMonitoring(_self)) { return; } _self[_DYN__ADD_HOOK ](onConfigChange(_extensionConfig, function () { _disableAjaxTracking = !!_extensionConfig[_DYN_DISABLE_AJAX_TRACKIN9 ]; _enableRequestHeaderTracking = _extensionConfig[_DYN_ENABLE_REQUEST_HEADE4 ]; if (!_disableAjaxTracking && !_xhrInitialized) { _hookProto(XMLHttpRequest, "open", { ns: _evtNamespace, req: function (args, method, url, async) { if (!_disableAjaxTracking) { var xhr = args[_DYN_INST ]; var ajaxData = xhr[strAjaxData]; if (!_isDisabledRequest(xhr, url) && _isMonitoredXhrInstance(xhr, true)) { if (!ajaxData || !ajaxData.xhrMonitoringState[_DYN_OPEN_DONE ]) { _openHandler(xhr, method, url, async); } _attachToOnReadyStateChange(xhr); } } }, hkErr: _createErrorCallbackFunc(_self, 15 , ERROR_HEADER + ".open" + ERROR_POSTFIX) }); _hookProto(XMLHttpRequest, "send", { ns: _evtNamespace, req: function (args, context) { if (!_disableAjaxTracking) { var xhr = args[_DYN_INST ]; var ajaxData = xhr[strAjaxData]; if (_isMonitoredXhrInstance(xhr) && !ajaxData.xhrMonitoringState[_DYN_SEND_DONE ]) { _createMarkId("xhr", ajaxData); ajaxData[_DYN_REQUEST_SENT_TIME ] = dateTimeUtilsNow(); _self[_DYN_INCLUDE_CORRELATION_2 ](ajaxData, undefined, undefined, xhr); ajaxData.xhrMonitoringState[_DYN_SEND_DONE ] = true; } } }, hkErr: _createErrorCallbackFunc(_self, 17 , ERROR_HEADER + ERROR_POSTFIX) }); _hookProto(XMLHttpRequest, "abort", { ns: _evtNamespace, req: function (args) { if (!_disableAjaxTracking) { var xhr = args[_DYN_INST ]; var ajaxData = xhr[strAjaxData]; if (_isMonitoredXhrInstance(xhr) && !ajaxData.xhrMonitoringState[_DYN_ABORT_DONE ]) { ajaxData[_DYN_ABORTED ] = 1; ajaxData.xhrMonitoringState[_DYN_ABORT_DONE ] = true; } } }, hkErr: _createErrorCallbackFunc(_self, 13 , ERROR_HEADER + ".abort" + ERROR_POSTFIX) }); _hookProto(XMLHttpRequest, "setRequestHeader", { ns: _evtNamespace, req: function (args, header, value) { if (!_disableAjaxTracking && _enableRequestHeaderTracking) { var xhr = args[_DYN_INST ]; if (_isMonitoredXhrInstance(xhr) && _canIncludeHeaders(header)) { xhr[strAjaxData][_DYN_REQUEST_HEADERS ][header] = value; } } }, hkErr: _createErrorCallbackFunc(_self, 71 , ERROR_HEADER + ".setRequestHeader" + ERROR_POSTFIX) }); _xhrInitialized = true; } })); } function _isDisabledRequest(xhr, request, init) { var isDisabled = false; var theUrl = ((!isString(request) ? (request || {}).url || "" : request) || "")[_DYN_TO_LOWER_CASE ](); arrForEach(_excludeRequestFromAutoTrackingPatterns, function (regex) { var theRegex = regex; if (isString(regex)) { theRegex = new RegExp(regex); } if (!isDisabled) { isDisabled = theRegex.test(theUrl); } }); if (isDisabled) { return isDisabled; } var idx = _indexOf(theUrl, "?"); var idx2 = _indexOf(theUrl, "#"); if (idx === -1 || (idx2 !== -1 && idx2 < idx)) { idx = idx2; } if (idx !== -1) { theUrl = theUrl.substring(0, idx); } if (!isNullOrUndefined(xhr)) { isDisabled = xhr[DisabledPropertyName] === true || theUrl[DisabledPropertyName] === true; } else if (!isNullOrUndefined(request)) { isDisabled = (typeof request === "object" ? request[DisabledPropertyName] === true : false) || (init ? init[DisabledPropertyName] === true : false); } if (!isDisabled && theUrl && isInternalApplicationInsightsEndpoint(theUrl)) { isDisabled = true; } if (isDisabled) { if (!_disabledUrls[theUrl]) { _disabledUrls[theUrl] = 1; } } else { if (_disabledUrls[theUrl]) { isDisabled = true; } } return isDisabled; } function _isMonitoredXhrInstance(xhr, excludeAjaxDataValidation) { var ajaxValidation = true; var initialized = _xhrInitialized; if (!isNullOrUndefined(xhr)) { ajaxValidation = excludeAjaxDataValidation === true || !isNullOrUndefined(xhr[strAjaxData]); } return initialized && ajaxValidation; } function _getDistributedTraceCtx() { var distributedTraceCtx = null; if (_self[_DYN_CORE ] && _self[_DYN_CORE ].getTraceCtx) { distributedTraceCtx = _self[_DYN_CORE ].getTraceCtx(false); } if (!distributedTraceCtx && _context && _context.telemetryTrace) { distributedTraceCtx = createDistributedTraceContextFromTrace(_context.telemetryTrace); } return distributedTraceCtx; } function _openHandler(xhr, method, url, async) { var _a; var distributedTraceCtx = _getDistributedTraceCtx(); var traceID = (distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_ID ]()) || generateW3CId(); var spanID = strSubstr(generateW3CId(), 0, 16); var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog](), (_a = _self.core) === null || _a === void 0 ? void 0 : _a.getTraceCtx()); ajaxData[_DYN_TRACE_FLAGS ] = distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_FLAGS ](); ajaxData[_DYN_METHOD ] = method; ajaxData[_DYN_REQUEST_URL ] = url; ajaxData.xhrMonitoringState[_DYN_OPEN_DONE ] = true; ajaxData[_DYN_REQUEST_HEADERS ] = {}; ajaxData.async = async; ajaxData[_DYN_ERROR_STATUS_TEXT ] = _enableAjaxErrorStatusText; xhr[strAjaxData] = ajaxData; } function _attachToOnReadyStateChange(xhr) { xhr[strAjaxData].xhrMonitoringState[_DYN_STATE_CHANGE_ATTACHE13 ] = eventOn(xhr, "readystatechange", function () { var _a; try { if (xhr && xhr.readyState === 4 && _isMonitoredXhrInstance(xhr)) { _onAjaxComplete(xhr); } } catch (e) { var exceptionText = dumpObj(e); if (!exceptionText || _indexOf(exceptionText[_DYN_TO_LOWER_CASE ](), "c00c023f") === -1) { _throwInternalCritical(_self, 16 , ERROR_HEADER + " 'readystatechange' event handler" + ERROR_POSTFIX, (_a = {}, _a[_DYN_AJAX_DIAGNOSTICS_MES16 ] = _getFailedAjaxDiagnosticsMessage(xhr), _a[_DYN_EXCEPTION ] = exceptionText, _a)); } } }, _evtNamespace); } function _getResponseText(xhr) { try { var responseType = xhr.responseType; if (responseType === "" || responseType === "text") { return xhr[_DYN_RESPONSE_TEXT ]; } } catch (e) { } return null; } function _onAjaxComplete(xhr) { var ajaxData = xhr[strAjaxData]; ajaxData[_DYN_RESPONSE_FINISHED_TI14 ] = dateTimeUtilsNow(); ajaxData[_DYN_STATUS ] = xhr[_DYN_STATUS ]; function _reportXhrError(e, failedProps) { var errorProps = failedProps || {}; errorProps["ajaxDiagnosticsMessage"] = _getFailedAjaxDiagnosticsMessage(xhr); if (e) { errorProps["exception"] = dumpObj(e); } _throwInternalWarning(_self, 14 , FAILED_TO_CALCULATE_DURATION_ERROR + "ajax call" + ERROR_NOT_SENT, errorProps); } _findPerfResourceEntry("xmlhttprequest", ajaxData, function () { try { var dependency = ajaxData[_DYN__CREATE_TRACK_ITEM ]("Ajax", _enableRequestHeaderTracking, function () { var _a; var ajaxResponse = (_a = { statusText: xhr[_DYN_STATUS_TEXT ] }, _a[_DYN_HEADER_MAP ] = null, _a[_DYN_CORRELATION_CONTEXT ] = _getAjaxCorrelationContext(xhr), _a.type = xhr.responseType, _a[_DYN_RESPONSE_TEXT ] = _getResponseText(xhr), _a.response = xhr[_DYN_RESPONSE ], _a); if (_enableResponseHeaderTracking) { var headers = xhr[_DYN_GET_ALL_RESPONSE_HEA15 ](); if (headers) { var arr = strTrim(headers).split(/[\r\n]+/); var responseHeaderMap_2 = {}; arrForEach(arr, function (line) { var parts = line.split(": "); var header = parts.shift(); var value = parts.join(": "); if (_canIncludeHeaders(header)) { responseHeaderMap_2[header] = value; } }); ajaxResponse[_DYN_HEADER_MAP ] = responseHeaderMap_2; } } return ajaxResponse; }); var properties = void 0; try { if (!!_addRequestContext) { properties = _addRequestContext({ status: xhr[_DYN_STATUS ], xhr: xhr }); } } catch (e) { _throwInternalWarning(_self, 104 , CUSTOM_REQUEST_CONTEXT_ERROR); } if (dependency) { if (properties !== undefined) { dependency[STR_PROPERTIES ] = __assignFn(__assignFn({}, dependency.properties), properties); } var sysProperties = ajaxData[_DYN_GET_PART_APROPS ](); _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE ], ajaxData, dependency, null, sysProperties); } else { _reportXhrError(null, { requestSentTime: ajaxData[_DYN_REQUEST_SENT_TIME ], responseFinishedTime: ajaxData[_DYN_RESPONSE_FINISHED_TI14 ] }); } } finally { try { xhr[strAjaxData] = null; } catch (e) { } } }, function (e) { _reportXhrError(e, null); }); } function _getAjaxCorrelationContext(xhr) { var _a; try { var responseHeadersString = xhr[_DYN_GET_ALL_RESPONSE_HEA15 ](); if (responseHeadersString !== null) { var index = _indexOf(responseHeadersString[_DYN_TO_LOWER_CASE ](), RequestHeaders[8 ]); if (index !== -1) { var responseHeader = xhr.getResponseHeader(RequestHeaders[0 ]); return correlationIdGetCorrelationContext(responseHeader); } } } catch (e) { _throwInternalWarning(_self, 18 , CORRELATION_HEADER_ERROR, (_a = {}, _a[_DYN_AJAX_DIAGNOSTICS_MES16 ] = _getFailedAjaxDiagnosticsMessage(xhr), _a[_DYN_EXCEPTION ] = dumpObj(e), _a)); } } function _createMarkId(type, ajaxData) { if (ajaxData[_DYN_REQUEST_URL ] && _markPrefix && _enableAjaxPerfTracking) { var performance_1 = getPerformance(); if (performance_1 && isFunction(performance_1.mark)) { _markCount++; var markId = _markPrefix + type + "#" + _markCount; performance_1.mark(markId); var entries = performance_1.getEntriesByName(markId); if (entries && entries[_DYN_LENGTH$1 ] === 1) { ajaxData[_DYN_PERF_MARK ] = entries[0]; } } } } function _findPerfResourceEntry(initiatorType, ajaxData, trackCallback, reportError) { var perfMark = ajaxData[_DYN_PERF_MARK ]; var performance = getPerformance(); var maxAttempts = _maxAjaxPerfLookupAttempts; var retryDelay = _ajaxPerfLookupDelay; var requestUrl = ajaxData[_DYN_REQUEST_URL ]; var attempt = 0; (function locateResourceTiming() { try { if (performance && perfMark) { attempt++; var perfTiming = null; var entries = performance.getEntries(); for (var lp = entries[_DYN_LENGTH$1 ] - 1; lp >= 0; lp--) { var entry = entries[lp]; if (entry) { if (entry.entryType === "resource") { if (entry.initiatorType === initiatorType && (_indexOf(entry[_DYN_NAME ], requestUrl) !== -1 || _indexOf(requestUrl, entry[_DYN_NAME ]) !== -1)) { perfTiming = entry; } } else if (entry.entryType === "mark" && entry[_DYN_NAME ] === perfMark[_DYN_NAME ]) { ajaxData[_DYN_PERF_TIMING ] = perfTiming; break; } if (entry[_DYN_START_TIME ] < perfMark[_DYN_START_TIME ] - 1000) { break; } } } } if (!perfMark || ajaxData[_DYN_PERF_TIMING ] || attempt >= maxAttempts || ajaxData.async === false) { if (perfMark && isFunction(performance.clearMarks)) { performance.clearMarks(perfMark[_DYN_NAME ]); } ajaxData.perfAttempts = attempt; trackCallback(); } else { scheduleTimeout(locateResourceTiming, retryDelay); } } catch (e) { reportError(e); } })(); } function _createFetchRecord(input, init) { var _a; var distributedTraceCtx = _getDistributedTraceCtx(); var traceID = (distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_ID ]()) || generateW3CId(); var spanID = strSubstr(generateW3CId(), 0, 16); var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog](), (_a = _self.core) === null || _a === void 0 ? void 0 : _a.getTraceCtx()); ajaxData[_DYN_TRACE_FLAGS ] = distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_FLAGS ](); ajaxData[_DYN_REQUEST_SENT_TIME ] = dateTimeUtilsNow(); ajaxData[_DYN_ERROR_STATUS_TEXT ] = _enableAjaxErrorStatusText; if (input instanceof Request) { ajaxData[_DYN_REQUEST_URL ] = input ? input.url : ""; } else { ajaxData[_DYN_REQUEST_URL ] = input; } var method = "GET"; if (init && init[_DYN_METHOD ]) { method = init[_DYN_METHOD ]; } else if (input && input instanceof Request) { method = input[_DYN_METHOD ]; } ajaxData[_DYN_METHOD ] = method; var requestHeaders = {}; if (_enableRequestHeaderTracking) { var headers = new Headers((init ? init[_DYN_HEADERS ] : 0) || (input instanceof Request ? (input[_DYN_HEADERS ] || {}) : {})); headers.forEach(function (value, key) { if (_canIncludeHeaders(key)) { requestHeaders[key] = value; } }); } ajaxData[_DYN_REQUEST_HEADERS ] = requestHeaders; _createMarkId(STR_FETCH, ajaxData); return ajaxData; } function _getFailedFetchDiagnosticsMessage(input) { var result = ""; try { if (!isNullOrUndefined(input)) { if (typeof (input) === "string") { result += "(url: '".concat(input, "')"); } else { result += "(url: '".concat(input.url, "')"); } } } catch (e) { _throwInternalCritical(_self, 15 , "Failed to grab failed fetch diagnostics message", { exception: dumpObj(e) }); } return result; } function _reportFetchMetrics(callDetails, status, input, response, ajaxData, getResponse, properties) { if (!ajaxData) { return; } function _reportFetchError(msgId, e, failedProps) { var errorProps = failedProps || {}; errorProps["fetchDiagnosticsMessage"] = _getFailedFetchDiagnosticsMessage(input); if (e) { errorProps["exception"] = dumpObj(e); } _throwInternalWarning(_self, msgId, FAILED_TO_CALCULATE_DURATION_ERROR + "fetch call" + ERROR_NOT_SENT, errorProps); } ajaxData[_DYN_RESPONSE_FINISHED_TI14 ] = dateTimeUtilsNow(); ajaxData[_DYN_STATUS ] = status; _findPerfResourceEntry(STR_FETCH, ajaxData, function () { var dependency = ajaxData[_DYN__CREATE_TRACK_ITEM ]("Fetch", _enableRequestHeaderTracking, getResponse); var properties; try { if (!!_addRequestContext) { properties = _addRequestContext({ status: status, request: input, response: response }); } } catch (e) { _throwInternalWarning(_self, 104 , CUSTOM_REQUEST_CONTEXT_ERROR); } if (dependency) { if (properties !== undefined) { dependency[STR_PROPERTIES ] = __assignFn(__assignFn({}, dependency.properties), properties); } var sysProperties = ajaxData[_DYN_GET_PART_APROPS ](); _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE ], ajaxData, dependency, null, sysProperties); } else { _reportFetchError(14 , null, { requestSentTime: ajaxData[_DYN_REQUEST_SENT_TIME ], responseFinishedTime: ajaxData[_DYN_RESPONSE_FINISHED_TI14 ] }); } }, function (e) { _reportFetchError(18 , e, null); }); } function _getFetchCorrelationContext(response) { var _a; if (response && response[_DYN_HEADERS ]) { try { var responseHeader = response[_DYN_HEADERS ].get(RequestHeaders[0 ]); return correlationIdGetCorrelationContext(responseHeader); } catch (e) { _throwInternalWarning(_self, 18 , CORRELATION_HEADER_ERROR, (_a = { fetchDiagnosticsMessage: _getFailedFetchDiagnosticsMessage(response) }, _a[_DYN_EXCEPTION ] = dumpObj(e), _a)); } } } function _reportDependencyInternal(initializers, core, ajaxData, dependency, properties, systemProperties) { var _a; var result = true; var initializersCount = initializers[_DYN_LENGTH$1 ]; if (initializersCount > 0) { var details = (_a = { item: dependency }, _a[STR_PROPERTIES ] = properties, _a.sysProperties = systemProperties, _a.context = ajaxData ? ajaxData[_DYN_CONTEXT$1 ] : null, _a.aborted = ajaxData ? !!ajaxData[_DYN_ABORTED ] : false, _a); result = _processDependencyContainer(core, initializers, details, "initializer"); } if (result) { _self[_DYN_TRACK_DEPENDENCY_DAT3 ](dependency, properties, systemProperties); } } }); return _this; } AjaxMonitor.prototype.processTelemetry = function (item, itemCtx) { this.processNext(item, itemCtx); }; AjaxMonitor.prototype.addDependencyInitializer = function (dependencyInitializer) { return null; }; AjaxMonitor.identifier = "AjaxDependencyPlugin"; return AjaxMonitor; }(BaseTelemetryPlugin)); var Application = /** @class */ (function () { function Application() { } return Application; }()); var Device = /** @class */ (function () { function Device() { this.id = "browser"; this.deviceClass = "Browser"; } return Device; }()); var Version = '3.0.2'; var Internal = /** @class */ (function () { function Internal(config, unloadHookContainer) { var _this = this; var unloadHook = onConfigChange((config), function () { var prefix = config.sdkExtension; _this.sdkVersion = (prefix ? prefix + "_" : "") + "javascript:" + Version; }); unloadHookContainer && unloadHookContainer.add(unloadHook); } return Internal; }()); var Location = /** @class */ (function () { function Location() { } return Location; }()); var _DYN_SESSION_MANAGER = "sessionManager"; var _DYN_UPDATE = "update"; var _DYN_IS_USER_COOKIE_SET = "isUserCookieSet"; var _DYN_IS_NEW_USER = "isNewUser"; var _DYN_GET_TRACE_CTX = "getTraceCtx"; var _DYN_TELEMETRY_TRACE = "telemetryTrace"; var _DYN_APPLY_SESSION_CONTEX0 = "applySessionContext"; var _DYN_APPLY_APPLICATION_CO1 = "applyApplicationContext"; var _DYN_APPLY_DEVICE_CONTEXT = "applyDeviceContext"; var _DYN_APPLY_OPERATION_CONT2 = "applyOperationContext"; var _DYN_APPLY_USER_CONTEXT = "applyUserContext"; var _DYN_APPLY_OPERATING_SYST3 = "applyOperatingSystemContxt"; var _DYN_APPLY_LOCATION_CONTE4 = "applyLocationContext"; var _DYN_APPLY_INTERNAL_CONTE5 = "applyInternalContext"; var _DYN_ACCOUNT_ID = "accountId"; var _DYN_GET_SESSION_ID = "getSessionId"; var _DYN_NAME_PREFIX = "namePrefix"; var _DYN_SESSION_COOKIE_POSTF6 = "sessionCookiePostfix"; var _DYN_USER_COOKIE_POSTFIX = "userCookiePostfix"; var _DYN_ID_LENGTH = "idLength"; var _DYN_GET_NEW_ID = "getNewId"; var _DYN_LENGTH = "length"; var _DYN_AUTOMATIC_SESSION = "automaticSession"; var _DYN_AUTHENTICATED_ID = "authenticatedId"; var _DYN_ACQUISITION_DATE = "acquisitionDate"; var _DYN_RENEWAL_DATE = "renewalDate"; var _DYN_JOIN = "join"; var _DYN_COOKIE_SEPARATOR = "cookieSeparator"; var _DYN_AUTH_USER_COOKIE_NAM7 = "authUserCookieName"; var SESSION_COOKIE_NAME = "ai_session"; var ACQUISITION_SPAN = 86400000; var RENEWAL_SPAN = 1800000; var COOKIE_UPDATE_INTERVAL = 60000; var Session = /** @class */ (function () { function Session() { } return Session; }()); var _SessionManager = /** @class */ (function () { function _SessionManager(config, core, unloadHookContainer) { var self = this; var _storageNamePrefix; var _cookieUpdatedTimestamp; var _logger = safeGetLogger(core); var _cookieManager = safeGetCookieMgr(core); var _sessionExpirationMs; var _sessionRenewalMs; dynamicProto(_SessionManager, self, function (_self) { if (!config) { config = {}; } var unloadHook = onConfigChange(config, function (details) { _sessionExpirationMs = config.sessionExpirationMs || ACQUISITION_SPAN; _sessionRenewalMs = config.sessionRenewalMs || RENEWAL_SPAN; var sessionCookiePostfix = config.sessionCookiePostfix || config[_DYN_NAME_PREFIX ] || ""; _storageNamePrefix = SESSION_COOKIE_NAME + sessionCookiePostfix; }); unloadHookContainer && unloadHookContainer.add(unloadHook); _self[_DYN_AUTOMATIC_SESSION ] = new Session(); _self[_DYN_UPDATE ] = function () { var nowMs = utcNow(); var isExpired = false; var session = _self[_DYN_AUTOMATIC_SESSION ]; if (!session.id) { isExpired = !_initializeAutomaticSession(session); } if (!isExpired && _sessionExpirationMs > 0) { var timeSinceAcqMs = nowMs - session[_DYN_ACQUISITION_DATE ]; var timeSinceRenewalMs = nowMs - session[_DYN_RENEWAL_DATE ]; isExpired = timeSinceAcqMs < 0 || timeSinceRenewalMs < 0; isExpired = isExpired || timeSinceAcqMs > _sessionExpirationMs; isExpired = isExpired || timeSinceRenewalMs > _sessionRenewalMs; } if (isExpired) { _renew(nowMs); } else { if (!_cookieUpdatedTimestamp || nowMs - _cookieUpdatedTimestamp > COOKIE_UPDATE_INTERVAL) { _setCookie(session, nowMs); } } }; _self.backup = function () { var session = _self[_DYN_AUTOMATIC_SESSION ]; _setStorage(session.id, session[_DYN_ACQUISITION_DATE ], session[_DYN_RENEWAL_DATE ]); }; function _initializeAutomaticSession(session, now) { var isValid = false; var cookieValue = _cookieManager.get(_storageNamePrefix); if (cookieValue && isFunction(cookieValue.split)) { isValid = _initializeAutomaticSessionWithData(session, cookieValue); } else { var storageValue = utlGetLocalStorage(_logger, _storageNamePrefix); if (storageValue) { isValid = _initializeAutomaticSessionWithData(session, storageValue); } } return isValid || !!session.id; } function _initializeAutomaticSessionWithData(session, sessionData) { var isValid = false; var sessionReset = ", session will be reset"; var tokens = sessionData.split("|"); if (tokens[_DYN_LENGTH ] >= 2) { try { var acqMs = +tokens[1] || 0; var renewalMs = +tokens[2] || 0; if (isNaN(acqMs) || acqMs <= 0) { _throwInternal(_logger, 2 , 27 , "AI session acquisition date is 0" + sessionReset); } else if (isNaN(renewalMs) || renewalMs <= 0) { _throwInternal(_logger, 2 , 27 , "AI session renewal date is 0" + sessionReset); } else if (tokens[0]) { session.id = tokens[0]; session[_DYN_ACQUISITION_DATE ] = acqMs; session[_DYN_RENEWAL_DATE ] = renewalMs; isValid = true; } } catch (e) { _throwInternal(_logger, 1 , 9 , "Error parsing ai_session value [" + (sessionData || "") + "]" + sessionReset + " - " + getExceptionName(e), { exception: dumpObj(e) }); } } return isValid; } function _renew(nowMs) { var getNewId = config[_DYN_GET_NEW_ID ] || newId; _self.automaticSession.id = getNewId(config[_DYN_ID_LENGTH ] || 22); _self[_DYN_AUTOMATIC_SESSION ][_DYN_ACQUISITION_DATE ] = nowMs; _setCookie(_self[_DYN_AUTOMATIC_SESSION ], nowMs); if (!utlCanUseLocalStorage()) { _throwInternal(_logger, 2 , 0 , "Browser does not support local storage. Session durations will be inaccurate."); } } function _setCookie(session, nowMs) { var acq = session[_DYN_ACQUISITION_DATE ]; session[_DYN_RENEWAL_DATE ] = nowMs; var renewalPeriodMs = _sessionRenewalMs; var acqTimeLeftMs = (acq + _sessionExpirationMs) - nowMs; var cookie = [session.id, acq, nowMs]; var maxAgeSec = 0; if (acqTimeLeftMs < renewalPeriodMs) { maxAgeSec = acqTimeLeftMs / 1000; } else { maxAgeSec = renewalPeriodMs / 1000; } var cookieDomain = config.cookieDomain || null; _cookieManager.set(_storageNamePrefix, cookie[_DYN_JOIN ]("|"), _sessionExpirationMs > 0 ? maxAgeSec : null, cookieDomain); _cookieUpdatedTimestamp = nowMs; } function _setStorage(guid, acq, renewal) { utlSetLocalStorage(_logger, _storageNamePrefix, [guid, acq, renewal][_DYN_JOIN ]("|")); } }); } _SessionManager.__ieDyn=1; return _SessionManager; }()); var TelemetryTrace = /** @class */ (function () { function TelemetryTrace(id, parentId, name, logger) { var _self = this; _self.traceID = id || generateW3CId(); _self.parentID = parentId; var location = getLocation(); if (!name && location && location.pathname) { name = location.pathname; } _self.name = dataSanitizeString(logger, name); } return TelemetryTrace; }()); function _validateUserInput(id) { if (typeof id !== "string" || !id || id.match(/,|;|=| |\|/)) { return false; } return true; } var User = /** @class */ (function () { function User(config, core, unloadHookContainer) { this.isNewUser = false; this.isUserCookieSet = false; var _logger = safeGetLogger(core); var _cookieManager = safeGetCookieMgr(core); var _storageNamePrefix; dynamicProto(User, this, function (_self) { objDefine(_self, "config", { g: function () { return config; } }); var unloadHook = onConfigChange(config, function () { var userCookiePostfix = config[_DYN_USER_COOKIE_POSTFIX ] || ""; _storageNamePrefix = User.userCookieName + userCookiePostfix; var cookie = _cookieManager.get(_storageNamePrefix); if (cookie) { _self[_DYN_IS_NEW_USER ] = false; var params = cookie.split(User[_DYN_COOKIE_SEPARATOR ]); if (params[_DYN_LENGTH ] > 0) { _self.id = params[0]; _self[_DYN_IS_USER_COOKIE_SET ] = !!_self.id; } } if (!_self.id) { _self.id = _generateNewId(); var newCookie = _generateNewCookie(_self.id); _setUserCookie(newCookie[_DYN_JOIN ](User[_DYN_COOKIE_SEPARATOR ])); var name_1 = (config[_DYN_NAME_PREFIX ] || "") + "ai_session"; utlRemoveStorage(_logger, name_1); } _self[_DYN_ACCOUNT_ID ] = config[_DYN_ACCOUNT_ID ] || undefined; var authCookie = _cookieManager.get(User[_DYN_AUTH_USER_COOKIE_NAM7 ]); if (authCookie) { authCookie = decodeURI(authCookie); var authCookieString = authCookie.split(User[_DYN_COOKIE_SEPARATOR ]); if (authCookieString[0]) { _self[_DYN_AUTHENTICATED_ID ] = authCookieString[0]; } if (authCookieString[_DYN_LENGTH ] > 1 && authCookieString[1]) { _self[_DYN_ACCOUNT_ID ] = authCookieString[1]; } } }); unloadHookContainer && unloadHookContainer.add(unloadHook); function _generateNewId() { var theConfig = (config || {}); var getNewId = theConfig[_DYN_GET_NEW_ID ] || newId; var id = getNewId(theConfig[_DYN_ID_LENGTH ] ? config[_DYN_ID_LENGTH ] : 22); return id; } function _generateNewCookie(userId) { var acqStr = toISOString(new Date()); _self.accountAcquisitionDate = acqStr; _self[_DYN_IS_NEW_USER ] = true; var newCookie = [userId, acqStr]; return newCookie; } function _setUserCookie(cookie) { var oneYear = 31536000; _self[_DYN_IS_USER_COOKIE_SET ] = _cookieManager.set(_storageNamePrefix, cookie, oneYear); } _self.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) { if (storeInCookie === void 0) { storeInCookie = false; } var isInvalidInput = !_validateUserInput(authenticatedUserId) || (accountId && !_validateUserInput(accountId)); if (isInvalidInput) { _throwInternal(_logger, 2 , 60 , "Setting auth user context failed. " + "User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.", true); return; } _self[_DYN_AUTHENTICATED_ID ] = authenticatedUserId; var authCookie = _self[_DYN_AUTHENTICATED_ID ]; if (accountId) { _self[_DYN_ACCOUNT_ID ] = accountId; authCookie = [_self[_DYN_AUTHENTICATED_ID ], _self.accountId][_DYN_JOIN ](User[_DYN_COOKIE_SEPARATOR ]); } if (storeInCookie) { _cookieManager.set(User[_DYN_AUTH_USER_COOKIE_NAM7 ], encodeURI(authCookie)); } }; _self.clearAuthenticatedUserContext = function () { _self[_DYN_AUTHENTICATED_ID ] = null; _self[_DYN_ACCOUNT_ID ] = null; _cookieManager.del(User[_DYN_AUTH_USER_COOKIE_NAM7 ]); }; _self[_DYN_UPDATE ] = function (userId) { if (_self.id !== userId || !_self[_DYN_IS_USER_COOKIE_SET ]) { var user_id = userId ? userId : _generateNewId(); var user_cookie = _generateNewCookie(user_id); _setUserCookie(user_cookie[_DYN_JOIN ](User[_DYN_COOKIE_SEPARATOR ])); } }; }); } User.cookieSeparator = "|"; User.userCookieName = "ai_user"; User.authUserCookieName = "ai_authUser"; return User; }()); var strExt = "ext"; var strTags = "tags"; function _removeEmpty(target, name) { if (target && target[name] && objKeys(target[name])[_DYN_LENGTH ] === 0) { delete target[name]; } } function _nullResult() { return null; } var TelemetryContext = /** @class */ (function () { function TelemetryContext(core, defaultConfig, previousTraceCtx, unloadHookContainer) { var _this = this; var logger = core.logger; dynamicProto(TelemetryContext, this, function (_self) { _self.appId = _nullResult; _self[_DYN_GET_SESSION_ID ] = _nullResult; _self.application = new Application(); _self.internal = new Internal(defaultConfig, unloadHookContainer); if (hasWindow()) { _self[_DYN_SESSION_MANAGER ] = new _SessionManager(defaultConfig, core, unloadHookContainer); _self.device = new Device(); _self.location = new Location(); _self.user = new User(defaultConfig, core, unloadHookContainer); var traceId = void 0; var parentId = void 0; var name_1; if (previousTraceCtx) { traceId = previousTraceCtx.getTraceId(); parentId = previousTraceCtx.getSpanId(); name_1 = previousTraceCtx.getName(); } _self[_DYN_TELEMETRY_TRACE ] = new TelemetryTrace(traceId, parentId, name_1, logger); _self.session = new Session(); } _self[_DYN_GET_SESSION_ID ] = function () { var session = _self.session; var sesId = null; if (session && isString(session.id)) { sesId = session.id; } else { var autoSession = (_self[_DYN_SESSION_MANAGER ] || {})[_DYN_AUTOMATIC_SESSION ]; sesId = autoSession && isString(autoSession.id) ? autoSession.id : null; } return sesId; }; _self[_DYN_APPLY_SESSION_CONTEX0 ] = function (evt, itemCtx) { setValue(getSetValue(evt.ext, Extensions.AppExt), "sesId", _self[_DYN_GET_SESSION_ID ](), isString); }; _self[_DYN_APPLY_OPERATING_SYST3 ] = function (evt, itemCtx) { setValue(evt.ext, Extensions.OSExt, _self.os); }; _self[_DYN_APPLY_APPLICATION_CO1 ] = function (evt, itemCtx) { var application = _self.application; if (application) { var tags = getSetValue(evt, strTags); setValue(tags, CtxTagKeys.applicationVersion, application.ver, isString); setValue(tags, CtxTagKeys.applicationBuild, application.build, isString); } }; _self[_DYN_APPLY_DEVICE_CONTEXT ] = function (evt, itemCtx) { var device = _self.device; if (device) { var extDevice = getSetValue(getSetValue(evt, strExt), Extensions.DeviceExt); setValue(extDevice, "localId", device.id, isString); setValue(extDevice, "ip", device.ip, isString); setValue(extDevice, "model", device.model, isString); setValue(extDevice, "deviceClass", device.deviceClass, isString); } }; _self[_DYN_APPLY_INTERNAL_CONTE5 ] = function (evt, itemCtx) { var internal = _self.internal; if (internal) { var tags = getSetValue(evt, strTags); setValue(tags, CtxTagKeys.internalAgentVersion, internal.agentVersion, isString); setValue(tags, CtxTagKeys.internalSdkVersion, dataSanitizeString(logger, internal.sdkVersion, 64), isString); if (evt.baseType === _InternalLogMessage.dataType || evt.baseType === PageView.dataType) { setValue(tags, CtxTagKeys.internalSnippet, internal.snippetVer, isString); setValue(tags, CtxTagKeys.internalSdkSrc, internal.sdkSrc, isString); } } }; _self[_DYN_APPLY_LOCATION_CONTE4 ] = function (evt, itemCtx) { var location = _this.location; if (location) { setValue(getSetValue(evt, strTags, []), CtxTagKeys.locationIp, location.ip, isString); } }; _self[_DYN_APPLY_OPERATION_CONT2 ] = function (evt, itemCtx) { var telemetryTrace = _self[_DYN_TELEMETRY_TRACE ]; if (telemetryTrace) { var extTrace = getSetValue(getSetValue(evt, strExt), Extensions.TraceExt, { traceID: undefined, parentID: undefined }); setValue(extTrace, "traceID", telemetryTrace.traceID, isString, isNullOrUndefined); setValue(extTrace, "name", telemetryTrace.name, isString, isNullOrUndefined); setValue(extTrace, "parentID", telemetryTrace.parentID, isString, isNullOrUndefined); } }; _self.applyWebContext = function (evt, itemCtx) { var web = _this.web; if (web) { setValue(getSetValue(evt, strExt), Extensions.WebExt, web); } }; _self[_DYN_APPLY_USER_CONTEXT ] = function (evt, itemCtx) { var user = _self.user; if (user) { var tags = getSetValue(evt, strTags, []); setValue(tags, CtxTagKeys.userAccountId, user[_DYN_ACCOUNT_ID ], isString); var extUser = getSetValue(getSetValue(evt, strExt), Extensions.UserExt); setValue(extUser, "id", user.id, isString); setValue(extUser, "authId", user[_DYN_AUTHENTICATED_ID ], isString); } }; _self.cleanUp = function (evt, itemCtx) { var ext = evt.ext; if (ext) { _removeEmpty(ext, Extensions.DeviceExt); _removeEmpty(ext, Extensions.UserExt); _removeEmpty(ext, Extensions.WebExt); _removeEmpty(ext, Extensions.OSExt); _removeEmpty(ext, Extensions.AppExt); _removeEmpty(ext, Extensions.TraceExt); } }; }); } TelemetryContext.__ieDyn=1; return TelemetryContext; }()); var _a$1; var undefString; var nullValue = null; var _defaultConfig = objDeepFreeze((_a$1 = {}, _a$1[_DYN_ACCOUNT_ID ] = nullValue, _a$1.sessionRenewalMs = 30 * 60 * 1000, _a$1.samplingPercentage = 100, _a$1.sessionExpirationMs = 24 * 60 * 60 * 1000, _a$1.cookieDomain = nullValue, _a$1.sdkExtension = nullValue, _a$1.isBrowserLinkTrackingEnabled = false, _a$1.appId = nullValue, _a$1[_DYN_GET_SESSION_ID ] = nullValue, _a$1[_DYN_NAME_PREFIX ] = undefString, _a$1[_DYN_SESSION_COOKIE_POSTF6 ] = undefString, _a$1[_DYN_USER_COOKIE_POSTFIX ] = undefString, _a$1[_DYN_ID_LENGTH ] = 22, _a$1[_DYN_GET_NEW_ID ] = nullValue, _a$1)); var PropertiesPlugin = /** @class */ (function (_super) { __extendsFn(PropertiesPlugin, _super); function PropertiesPlugin() { var _this = _super.call(this) || this; _this.priority = 110; _this.identifier = PropertiesPluginIdentifier; var _extensionConfig; var _distributedTraceCtx; var _previousTraceCtx; var _context; dynamicProto(PropertiesPlugin, _this, function (_self, _base) { _initDefaults(); objDefine(_self, "context", { g: function () { return _context; } }); _self.initialize = function (config, core, extensions, pluginChain) { _base.initialize(config, core, extensions, pluginChain); _populateDefaults(config); }; _self.processTelemetry = function (event, itemCtx) { if (!isNullOrUndefined(event)) { itemCtx = _self._getTelCtx(itemCtx); if (event.name === PageView.envelopeType) { itemCtx.diagLog().resetInternalMessageCount(); } var theContext = (_context || {}); if (theContext.session) { if (typeof _context.session.id !== "string" && theContext[_DYN_SESSION_MANAGER ]) { theContext[_DYN_SESSION_MANAGER ][_DYN_UPDATE ](); } } var userCtx = theContext.user; if (userCtx && !userCtx[_DYN_IS_USER_COOKIE_SET ]) { userCtx[_DYN_UPDATE ](theContext.user.id); } _processTelemetryInternal(event, itemCtx); if (userCtx && userCtx[_DYN_IS_NEW_USER ]) { userCtx[_DYN_IS_NEW_USER ] = false; var message = new _InternalLogMessage(72 , ((getNavigator() || {}).userAgent || "")); _logInternalMessage(itemCtx.diagLog(), 1 , message); } _self.processNext(event, itemCtx); } }; _self._doTeardown = function (unloadCtx, unloadState) { var core = (unloadCtx || {}).core(); if (core && core[_DYN_GET_TRACE_CTX ]) { var traceCtx = core[_DYN_GET_TRACE_CTX ](false); if (traceCtx === _distributedTraceCtx) { core.setTraceCtx(_previousTraceCtx); } } _initDefaults(); }; function _initDefaults() { _extensionConfig = null; _distributedTraceCtx = null; _previousTraceCtx = null; _context = null; } function _populateDefaults(config) { var identifier = _self.identifier; var core = _self.core; _self._addHook(onConfigChange(config, function () { var ctx = createProcessTelemetryContext(null, config, core); if (config.storagePrefix) { utlSetStoragePrefix(config.storagePrefix); } _extensionConfig = ctx.getExtCfg(identifier, _defaultConfig); _self["_extConfig"] = _extensionConfig; })); _previousTraceCtx = core[_DYN_GET_TRACE_CTX ](false); _context = new TelemetryContext(core, _extensionConfig, _previousTraceCtx, _self._unloadHooks); _distributedTraceCtx = createDistributedTraceContextFromTrace(_self.context[_DYN_TELEMETRY_TRACE ], _previousTraceCtx); core.setTraceCtx(_distributedTraceCtx); _self.context.appId = function () { var breezeChannel = core.getPlugin(BreezeChannelIdentifier); return breezeChannel ? breezeChannel.plugin["_appId"] : null; }; } function _processTelemetryInternal(evt, itemCtx) { getSetValue(evt, "tags", []); getSetValue(evt, "ext", {}); var ctx = _self.context; ctx[_DYN_APPLY_SESSION_CONTEX0 ](evt, itemCtx); ctx[_DYN_APPLY_APPLICATION_CO1 ](evt, itemCtx); ctx[_DYN_APPLY_DEVICE_CONTEXT ](evt, itemCtx); ctx[_DYN_APPLY_OPERATION_CONT2 ](evt, itemCtx); ctx[_DYN_APPLY_USER_CONTEXT ](evt, itemCtx); ctx[_DYN_APPLY_OPERATING_SYST3 ](evt, itemCtx); ctx.applyWebContext(evt, itemCtx); ctx[_DYN_APPLY_LOCATION_CONTE4 ](evt, itemCtx); ctx[_DYN_APPLY_INTERNAL_CONTE5 ](evt, itemCtx); ctx.cleanUp(evt, itemCtx); } }); return _this; } PropertiesPlugin.__ieDyn=1; return PropertiesPlugin; }(BaseTelemetryPlugin)); var PropertiesPlugin$1 = PropertiesPlugin; var _AUTHENTICATED_USER_CONTEXT = "AuthenticatedUserContext"; var _TRACK = "track"; var STR_SNIPPET = "snippet"; var STR_GET_COOKIE_MGR = "getCookieMgr"; var STR_START_TRACK_PAGE = "startTrackPage"; var STR_STOP_TRACK_PAGE = "stopTrackPage"; var STR_FLUSH = "flush"; var STR_START_TRACK_EVENT = "startTrackEvent"; var STR_STOP_TRACK_EVENT = "stopTrackEvent"; var STR_ADD_TELEMETRY_INITIALIZER = "addTelemetryInitializer"; var STR_POLL_INTERNAL_LOGS = "pollInternalLogs"; var STR_GET_PLUGIN = "getPlugin"; var STR_EVT_NAMESPACE = "evtNamespace"; var STR_TRACK_EVENT = _TRACK + "Event"; var STR_TRACK_TRACE = _TRACK + "Trace"; var STR_TRACK_METRIC = _TRACK + "Metric"; var STR_TRACK_PAGE_VIEW = _TRACK + "PageView"; var STR_TRACK_EXCEPTION = _TRACK + "Exception"; var STR_TRACK_DEPENDENCY_DATA = _TRACK + "DependencyData"; var STR_SET_AUTHENTICATED_USER_CONTEXT = "set" + _AUTHENTICATED_USER_CONTEXT; var STR_CLEAR_AUTHENTICATED_USER_CONTEXT = "clear" + _AUTHENTICATED_USER_CONTEXT; var _DYN_VERSION = "version"; var _DYN_QUEUE = "queue"; var _DYN_CONNECTION_STRING = "connectionString"; var _DYN_ENDPOINT_URL = "endpointUrl"; var _DYN_INSTRUMENTATION_KEY = "instrumentationKey"; var _DYN_DISABLE_IKEY_DEPRECA0 = "disableIkeyDeprecationMessage"; var _DYN_ONUNLOAD_FLUSH = "onunloadFlush"; var _DYN_CONTEXT = "context"; var _DYN_ADD_HOUSEKEEPING_BEF1 = "addHousekeepingBeforeUnload"; var _DYN_UPDATE_SNIPPET_DEFIN2 = "updateSnippetDefinitions"; var _a; var _internalSdkSrc; var _ignoreUpdateSnippetProperties = [ STR_SNIPPET, "dependencies", "properties", "_snippetVersion", "appInsightsNew", "getSKUDefaults" ]; var UNDEFINED_VALUE = undefined; var defaultConfigValues = (_a = {}, _a[_DYN_CONNECTION_STRING ] = UNDEFINED_VALUE, _a[_DYN_ENDPOINT_URL ] = UNDEFINED_VALUE, _a[_DYN_INSTRUMENTATION_KEY ] = UNDEFINED_VALUE, _a.diagnosticLogInterval = cfgDfValidate(_chkDiagLevel, 10000), _a); function _chkDiagLevel(value) { return value && value > 0; } var AppInsightsSku = /** @class */ (function () { function AppInsightsSku(snippet) { var _this = this; var dependencies; var properties; var _sender; var _snippetVersion; var _evtNamespace; var _houseKeepingNamespace; var _core; var _config; var _analyticsPlugin; dynamicProto(AppInsightsSku, this, function (_self) { _initDefaults(); objDefine(_self, "config", { g: function () { return _config; } }); arrForEach(["pluginVersionStringArr", "pluginVersionString"], function (key) { objDefine(_self, key, { g: function () { if (_core) { return _core[key]; } return null; } }); }); _snippetVersion = "" + (snippet.sv || snippet[_DYN_VERSION ] || ""); snippet[_DYN_QUEUE ] = snippet[_DYN_QUEUE ] || []; snippet[_DYN_VERSION ] = snippet[_DYN_VERSION ] || 2.0; var cfgHandler = createDynamicConfig(snippet.config || {}, defaultConfigValues); _config = cfgHandler.cfg; _analyticsPlugin = new AnalyticsPlugin(); objDefine(_self, "appInsights", { g: function () { return _analyticsPlugin; } }); properties = new PropertiesPlugin$1(); dependencies = new AjaxMonitor(); _sender = new Sender(); _core = new AppInsightsCore(); objDefine(_self, "core", { g: function () { return _core; } }); _addUnloadHook(onConfigChange(cfgHandler, function () { if (_config[_DYN_CONNECTION_STRING ]) { var cs = parseConnectionString(_config[_DYN_CONNECTION_STRING ]); var ingest = cs.ingestionendpoint; _config[_DYN_ENDPOINT_URL ] = ingest ? (ingest + DEFAULT_BREEZE_PATH) : _config[_DYN_ENDPOINT_URL ]; _config[_DYN_INSTRUMENTATION_KEY ] = cs.instrumentationkey || _config[_DYN_INSTRUMENTATION_KEY ]; } })); var isErrMessageDisabled = isNullOrUndefined(_config[_DYN_DISABLE_IKEY_DEPRECA0 ]) ? true : _config[_DYN_DISABLE_IKEY_DEPRECA0 ]; if (!_config[_DYN_CONNECTION_STRING ] && !isErrMessageDisabled) { _throwInternal(_core.logger, 1 , 106 , "Instrumentation key support will end soon, see aka.ms/IkeyMigrate"); } _self[STR_SNIPPET ] = snippet; _self[STR_FLUSH ] = function (async, callBack) { if (async === void 0) { async = true; } var result; doPerf(_core, function () { return "AISKU.flush"; }, function () { if (async && !callBack) { result = createPromise(function (resolve) { callBack = resolve; }); } var waiting = 1; var flushDone = function () { waiting--; if (waiting === 0) { callBack(); } }; arrForEach(_core.getChannels(), function (channel) { if (channel) { waiting++; channel[STR_FLUSH ](async, flushDone); } }); flushDone(); }, null, async); return result; }; _self[_DYN_ONUNLOAD_FLUSH ] = function (async) { if (async === void 0) { async = true; } arrForEach(_core.getChannels(), function (channel) { if (channel[_DYN_ONUNLOAD_FLUSH ]) { channel[_DYN_ONUNLOAD_FLUSH ](); } else { channel[STR_FLUSH ](async); } }); }; _self.loadAppInsights = function (legacyMode, logger, notificationManager) { if (legacyMode === void 0) { legacyMode = false; } if (legacyMode) { throwUnsupported("Legacy Mode is no longer supported"); } function _updateSnippetProperties(snippet) { if (snippet) { var snippetVer = ""; if (!isNullOrUndefined(_snippetVersion)) { snippetVer += _snippetVersion; } if (_self[_DYN_CONTEXT ] && _self[_DYN_CONTEXT ].internal) { _self[_DYN_CONTEXT ].internal.snippetVer = snippetVer || "-"; } objForEachKey(_self, function (field, value) { if (isString(field) && !isFunction(value) && field && field[0] !== "_" && arrIndexOf(_ignoreUpdateSnippetProperties, field) === -1) { if (snippet[field] !== value) { snippet[field] = value; } } }); } } doPerf(_self.core, function () { return "AISKU.loadAppInsights"; }, function () { _core.initialize(_config, [_sender, properties, dependencies, _analyticsPlugin], logger, notificationManager); objDefine(_self, "context", { g: function () { return properties[_DYN_CONTEXT ]; } }); var sdkSrc = _findSdkSourceFile(); if (sdkSrc && _self[_DYN_CONTEXT ]) { _self[_DYN_CONTEXT ].internal.sdkSrc = sdkSrc; } _updateSnippetProperties(_self[STR_SNIPPET ]); _self.emptyQueue(); _self[STR_POLL_INTERNAL_LOGS ](); _self[_DYN_ADD_HOUSEKEEPING_BEF1 ](_self); }); return _self; }; _self[_DYN_UPDATE_SNIPPET_DEFIN2 ] = function (snippet) { proxyAssign(snippet, _self, function (name) { return name && arrIndexOf(_ignoreUpdateSnippetProperties, name) === -1; }); }; _self.emptyQueue = function () { try { if (isArray(_self.snippet[_DYN_QUEUE ])) { var length_1 = _self.snippet[_DYN_QUEUE ].length; for (var i = 0; i < length_1; i++) { var call = _self.snippet[_DYN_QUEUE ][i]; call(); } _self.snippet[_DYN_QUEUE ] = undefined; delete _self.snippet[_DYN_QUEUE ]; } } catch (exception) { var properties_1 = {}; if (exception && isFunction(exception.toString)) { properties_1.exception = exception.toString(); } } }; _self[_DYN_ADD_HOUSEKEEPING_BEF1 ] = function (appInsightsInstance) { if (hasWindow() || hasDocument()) { var performHousekeeping_1 = function () { appInsightsInstance[_DYN_ONUNLOAD_FLUSH ](false); if (isFunction(_self.core[STR_GET_PLUGIN ])) { var loadedPlugin = _this.core[STR_GET_PLUGIN ](PropertiesPluginIdentifier); if (loadedPlugin) { var propertiesPlugin = loadedPlugin.plugin; if (propertiesPlugin && propertiesPlugin[_DYN_CONTEXT ] && propertiesPlugin[_DYN_CONTEXT ]._sessionManager) { propertiesPlugin[_DYN_CONTEXT ]._sessionManager.backup(); } } } }; var added_1 = false; if (!_houseKeepingNamespace) { _houseKeepingNamespace = mergeEvtNamespace(_evtNamespace, _core[STR_EVT_NAMESPACE ] && _core[STR_EVT_NAMESPACE ]()); } _addUnloadHook(onConfigChange(_config, function (details) { var coreConfig = details.cfg; var analyticsPlugin = appInsightsInstance.appInsights; var ctx = createProcessTelemetryContext(null, coreConfig, analyticsPlugin.core); var extConfig = ctx.getExtCfg(analyticsPlugin.identifier || AnalyticsPluginIdentifier); _removePageEventHandlers(); var excludePageUnloadEvents = coreConfig.disablePageUnloadEvents; if (!extConfig.disableFlushOnBeforeUnload) { if (addPageUnloadEventListener(performHousekeeping_1, excludePageUnloadEvents, _houseKeepingNamespace)) { added_1 = true; } if (addPageHideEventListener(performHousekeeping_1, excludePageUnloadEvents, _houseKeepingNamespace)) { added_1 = true; } if (!added_1 && !isReactNative()) { _throwInternal(_core.logger, 1 , 19 , "Could not add handler for beforeunload and pagehide"); } } if (!added_1 && !extConfig.disableFlushOnUnload) { addPageHideEventListener(performHousekeeping_1, excludePageUnloadEvents, _houseKeepingNamespace); } })); } }; _self.getSender = function () { return _sender; }; _self.unload = function (isAsync, unloadComplete, cbTimeout) { var unloadDone = false; var result; if (isAsync && !unloadComplete) { result = createPromise(function (resolve) { unloadComplete = resolve; }); } function _unloadCallback(unloadState) { if (!unloadDone) { unloadDone = true; _initDefaults(); unloadComplete && unloadComplete(unloadState); } } _self[_DYN_ONUNLOAD_FLUSH ](isAsync); _removePageEventHandlers(); _core.unload && _core.unload(isAsync, _unloadCallback, cbTimeout); return result; }; proxyFunctions(_self, _analyticsPlugin, [ STR_GET_COOKIE_MGR, STR_TRACK_EVENT, STR_TRACK_PAGE_VIEW, "trackPageViewPerformance", STR_TRACK_EXCEPTION, "_onerror", STR_TRACK_TRACE, STR_TRACK_METRIC, STR_START_TRACK_PAGE, STR_STOP_TRACK_PAGE, STR_START_TRACK_EVENT, STR_STOP_TRACK_EVENT ]); proxyFunctions(_self, _getCurrentDependencies, [ STR_TRACK_DEPENDENCY_DATA, "addDependencyListener", "addDependencyInitializer" ]); proxyFunctions(_self, _core, [ STR_ADD_TELEMETRY_INITIALIZER, STR_POLL_INTERNAL_LOGS, "stopPollingInternalLogs", STR_GET_PLUGIN, "addPlugin", STR_EVT_NAMESPACE, "addUnloadCb", "getTraceCtx", "updateCfg", "onCfgChange" ]); proxyFunctions(_self, function () { var context = properties[_DYN_CONTEXT ]; return context ? context.user : null; }, [ STR_SET_AUTHENTICATED_USER_CONTEXT, STR_CLEAR_AUTHENTICATED_USER_CONTEXT ]); function _getCurrentDependencies() { return dependencies; } function _initDefaults() { _evtNamespace = createUniqueNamespace("AISKU"); _houseKeepingNamespace = null; dependencies = null; properties = null; _sender = null; _snippetVersion = null; } function _removePageEventHandlers() { if (_houseKeepingNamespace) { removePageUnloadEventListener(null, _houseKeepingNamespace); removePageHideEventListener(null, _houseKeepingNamespace); } } function _addUnloadHook(hooks) { _core.addUnloadHook(hooks); } }); } AppInsightsSku.prototype.addDependencyInitializer = function (dependencyInitializer) { return null; }; return AppInsightsSku; }()); function _findSdkSourceFile() { if (_internalSdkSrc) { return _internalSdkSrc; } var sdkSrc = null; var cdns = [ "://js.monitor.azure.com/", "://az416426.vo.msecnd.net/" ]; try { var scrpt = (document || {}).currentScript; if (scrpt) { sdkSrc = scrpt.src; } } catch (e) { } if (sdkSrc) { try { var url_1 = sdkSrc.toLowerCase(); if (url_1) { var src_1 = ""; arrForEach(cdns, function (value, idx) { if (strIndexOf(url_1, value) !== -1) { src_1 = "cdn" + (idx + 1); if (strIndexOf(url_1, "/scripts/") === -1) { if (strIndexOf(url_1, "/next/") !== -1) { src_1 += "-next"; } else if (strIndexOf(url_1, "/beta/") !== -1) { src_1 += "-beta"; } } _internalSdkSrc = src_1 + (""); return -1; } }); } } catch (e) { } _internalSdkSrc = sdkSrc; } return _internalSdkSrc; } var detailsContainerId = "details-container"; var detailsWatchList = ["baseType", "name", "time", "properties"]; var ajaxDetails = ["disabbleFetchTracking", "disableExceptionTracking", "enableAutoRouteTracking"]; var analyticsDetails = ["autoTrackPageVisitTime", "appId", "enableAjaxPerfTracking", "enableCorsCorrelation"]; var configDetails = __spreadArrayFn(__spreadArrayFn(["connectionString"], ajaxDetails, true), analyticsDetails); var buttonSectionId = "button-section"; var configContainerId = "config-details"; var containerId = "aisku-container"; var ai_session = "ai_session"; var ai_user = "ai_user"; var manual_event = "manual_record_event"; var cookieWatchList = ["isEnabled", ai_session, ai_user]; function randomBoolean() { if (Math.random() > 0.5) { return true; } return false; } function clearEle(id) { var ele = document.getElementById(id); if (ele) { ele.innerHTML = ""; } } function clearDetailsList() { clearEle(detailsContainerId); } function createSubContainer(id, className) { var ele = document.createElement("div"); ele.className = className || "container-main"; ele.id = id; return ele; } function createButton(buttontextContent, buttobuttononclickFn, id) { var btn = document.createElement("button"); if (id) { btn.id = id; } btn.innerHTML = buttontextContent; btn.onclick = buttobuttononclickFn; return btn; } function generateNewConfig() { var prefix = Math.random().toString(36).slice(6); var newConfig = { connectionString: "InstrumentationKey=newKey".concat(prefix), extensionConfig: { ApplicationInsightsAnalytics: { autoTrackPageVisitTime: randomBoolean(), appId: Math.random().toString(36).slice(8), enableAjaxPerfTracking: randomBoolean(), enableCorsCorrelation: randomBoolean() }, AjaxDependencyPlugin: { disabbleFetchTracking: randomBoolean(), disableExceptionTracking: randomBoolean(), enableAutoRouteTracking: randomBoolean() } } }; return newConfig; } function createDetailList(propsToWatch, details, id, title) { var container = document.getElementById(id); var ele = document.createElement("div"); ele.className = "list"; var list = ""; if (details) { list += "\n
".concat(title, " Details
\n

Not all auto-captured events and details are displayed here.

\n

Check console and network trace for complete details

\n "); arrForEach(propsToWatch, function (prop) { var obj; if (details["baseData"]) { obj = details["baseData"][prop] || details[prop] || details["baseData"]; } else { obj = details[prop] || details["baseData"]; } if (arrIncludes(analyticsDetails, prop)) { obj = details["extensionConfig"]["ApplicationInsightsAnalytics"][prop]; } if (arrIncludes(ajaxDetails, prop)) { obj = details["extensionConfig"]["AjaxDependencyPlugin"][prop]; } if (prop === "item") { obj = { name: obj.name, target: obj.target }; } obj = (obj === undefined) ? "undefined" : obj; if (typeof obj === "object") { obj = JSON.stringify(obj); } list += "
  • ".concat(prop, ": ").concat(obj, "
  • "); }); list += "
    -------------------------
    "; ele.innerHTML = list; container === null || container === void 0 ? void 0 : container.appendChild(ele); } } function createContainers() { var container = document.createElement("div"); container.className = "container"; container.id = containerId; var buttonSection = createSubContainer(buttonSectionId, "container"); container.appendChild(buttonSection); var configSection = createSubContainer(configContainerId); container.appendChild(configSection); var detailsSection = createSubContainer(detailsContainerId); container.appendChild(detailsSection); document.body.append(container); } function triggerException() { throw new Error("error is triggered"); } var _appInsights; function initApplicationInsights(config) { if (config === void 0) { config = {}; } if (!_appInsights) { _appInsights = window.appInsights; return _appInsights; } _appInsights = new AppInsightsSku({ config: config }); _appInsights.loadAppInsights(); _appInsights.trackPageView(); return _appInsights; } function trackPageView(pageView) { if (_appInsights) { _appInsights.trackPageView(pageView); return true; } return false; } function trackEvent(event, customProperties) { if (_appInsights) { _appInsights.trackEvent(event, customProperties); return true; } return false; } function startTrackEvent(name) { if (_appInsights) { _appInsights.startTrackEvent(name); return true; } return false; } function stopTrackEvent(name, properties, measurements) { if (_appInsights) { _appInsights.stopTrackEvent(name, properties, measurements); return true; } return false; } function trackTrace(trace) { if (_appInsights) { _appInsights.trackTrace(trace); return true; } return false; } function trackMetric(metric, customProperties) { if (_appInsights) { _appInsights.trackMetric(metric, customProperties); return true; } return false; } function addTelemetryInitializer(telemetryInitializer) { if (_appInsights) { _appInsights.addTelemetryInitializer(telemetryInitializer); return true; } return false; } function getCookieMgr() { if (_appInsights) { return _appInsights.getCookieMgr(); } return null; } function getConfig() { if (_appInsights) { var config = _appInsights["config"]; console.log("current config"); console.log(config); return config; } return null; } function changeConfig() { if (_appInsights) { var newConfig = generateNewConfig(); _appInsights["config"] = newConfig; return true; } return false; } var pageviewItem = { name: "pageviewWithproperities", uri: "https://pageview", refUri: "https://sample", pageType: "type", isLoggedIn: false, properties: { duration: 100, prop: "prop", prop1: { prop1: "prop1" } }, measurements: { metric: 1 } }; var eventItem = { name: "eventWithproperities", properties: { prop: { prop1: "prop1" } }, measurements: { metirc: 1 } }; var traceItem = { message: "trace", severityLevel: 1, properties: { prop: { prop1: "prop1" } }, measurements: { metirc: 1 } }; var metricItem = { name: "metric", average: 1.2, sampleCount: 2, min: 1, max: 2, stdDev: 1.23, properties: { prop: { prop1: "prop1" } }, measurements: { metirc: 1 } }; function createPageviewTracks() { trackPageView(pageviewItem); } function createEventTracks() { trackEvent(eventItem, { prop2: "prop2" }); } function startEvent() { startTrackEvent(manual_event); } function stopEvent() { stopTrackEvent(manual_event, { prop: "prop" }, { metric: 1 }); } function createTraceTracks() { trackTrace(traceItem); } function createMetricTracks() { trackMetric(metricItem, { prop2: "prop2" }); } function getCookieMgrdetails() { var cookieMgr = getCookieMgr(); if (cookieMgr) { var details = { isEnabled: cookieMgr.isEnabled(), ai_session: cookieMgr.get(ai_session), ai_user: cookieMgr.get(ai_user) }; createDetailList(cookieWatchList, details, detailsContainerId, "Cookie"); } } function addTelemetryListener() { addTelemetryInitializer(function (env) { console.log("The following Event is triggered."); console.log(env); createDetailList(detailsWatchList, env, detailsContainerId, "Telemetry"); }); } function createConfigDetails() { var config = getConfig(); clearEle(configContainerId); createDetailList(configDetails, config, configContainerId, "Config"); } function changeConfigOnClick() { changeConfig(); createConfigDetails(); } function createButtonSection() { var container = document.getElementById(buttonSectionId); var changeConfigBtn = createButton("Change Config", changeConfigOnClick); var pageviewButton = createButton("Create Pageview", createPageviewTracks); var eventButton = createButton("Create Event", createEventTracks); var startButton = createButton("Start Tracking Event", startEvent); var stopButton = createButton("Stop Tracking Event", stopEvent); var traceButton = createButton("Create Trace", createTraceTracks); var metricButton = createButton("Create Metric", createMetricTracks); var exceptionButton = createButton("Create Exception", triggerException); var cookieButton = createButton("Get Cookie", getCookieMgrdetails); var clearButton = createButton("Clear Details", clearDetailsList); var buttons = [changeConfigBtn, pageviewButton, eventButton, traceButton, metricButton, startButton, stopButton, exceptionButton, cookieButton, clearButton]; buttons.forEach(function (ele) { container === null || container === void 0 ? void 0 : container.appendChild(ele); }); } function analyticsSample() { initApplicationInsights(); createContainers(); addTelemetryListener(); createButtonSection(); createConfigDetails(); } analyticsSample(); })(); //# sourceMappingURL=aisku-example-index.gbl.js.map ================================================ FILE: AISKU/Tests/Manual/latestSnippet.html ================================================ Home Page - HelloWorld
    From your repository
    Perform a full build rush rebuild
    Enable the test http server npm run serve
    Load this page from the local service
    • Load in different browsers and ensure that the events are attempted to be sent
    • Use different browsers, Firefox, Chrome and Edge
    • Using Edge enable IE Mode
    • Use IEChooser to debug and change the Emulation mode
      • Default IE 11
      • Default IE 10
      • Default IE 9
      • Default IE 8
      • Default IE 7 - This will fail due to no JSON implementation, the console should show a warning
    © 2019 - HelloWorld
    ================================================ FILE: AISKU/Tests/Manual/span-e2e-manual-test.html ================================================ Application Insights - Span API Manual E2E Test

    🔍 Application Insights - Span API Manual E2E Test

    Send real telemetry to Azure Application Insights and verify in the portal

    ⚙️ Configuration

    Get this from: Azure Portal → Your Application Insights resource → Overview → Instrumentation Key

    🧪 Test Scenarios

    Basic Tests

    Distributed Trace Tests

    Dependency Tests

    Complex Scenarios

    Batch Actions

    Utilities

    📊 Statistics

    0
    Spans Created
    0
    Dependencies
    0
    Requests
    0
    Trace IDs

    📝 Output Log

    Ready to start testing. Initialize the SDK first.

    🔗 View Results

    After running tests, wait 1-2 minutes for telemetry to appear in the portal.

    Open Azure Portal
    💡 Tips for viewing in portal:
    • Go to Application Insights → Performance to see requests and dependencies
    • Use the Search feature to find specific operations by custom properties
    • Click "View in End-to-End Transaction" to see distributed traces
    • Use the Timeline view to see span relationships
    • Filter by operation name like "E2E-CheckoutRequest"
    • Check custom dimensions for test.scenario and test.timestamp
    ================================================ FILE: AISKU/Tests/Manual/style/style.css ================================================ body { margin: 0; } h1 { font-size: 1.875rem; margin: 0.67rem 0; } h2 { font-size: 1.5rem; margin: 0.83rem 0; } h3 { font-size: 1.25rem; margin: 1rem 0; } h4 { font-size: 1.05rem; margin: 1.33rem 0; } h5 { font-size: 1rem; margin: 1.5rem 0; } h6 { font-size: 0.875rem; margin: 0.3rem 0; } .uppercase { text-transform: uppercase; } pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; } ol, ul { margin: 1em 0; } .container { max-width: 1600px; padding: 0 2rem; } .container-main { justify-content: space-between; font-size: 0.9rem; position: relative; margin: 1rem auto; padding-left: 1rem; background-color: azure; overflow: auto; max-height: 350px; } body { font-family: "Segoe UI", sans-serif; font-size: 16px; padding-left: 1rem; } code, pre { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; padding: 0.2em; margin: 0; font-size: 0.875rem; border-radius: 0.8em; } button { font-family: "Segoe UI", sans-serif; margin: 0.5rem; padding: 0.2em; } p{ font-size: 12px; margin: 0; } ================================================ FILE: AISKU/Tests/Manual/testVersionConflict.html ================================================ AISKU Sample

    Microsoft Application Insights JavaScript SDK - AISKU

    ================================================ FILE: AISKU/Tests/Perf/src/AISKUPerf.Tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { AppInsightsInitPerfTestClass } from "./AISKUPerf"; import { utlRemoveSessionStorage } from "@microsoft/applicationinsights-core-js"; import { createTimeoutPromise, doAwait } from "@nevware21/ts-async"; function isNullOrUndefined(value: any): boolean { return value === undefined || value === null; } function createTrackEvent(eventName: string, type: string = "EventData", fieldNum?: number) { let number = fieldNum? fieldNum: Math.random() * 10 + 10; let fields = {}; for (let i=1; i <= number; i++) { let field = "field" + i; fields[field] = "value" + i; } return {name: eventName, properties: fields, baseType: type }; } function sendEventWithCollectorUrl(event: any) { let oneDS = window["oneDS"]; const generatedUrl = oneDS.getCollectorUrlGenerator(event); let collectorUrlScript = document.createElement("script"); collectorUrlScript.setAttribute("id", "collectorUrl"); collectorUrlScript.src=generatedUrl; document.head.appendChild(collectorUrlScript); collectorUrlScript.onload=collectorUrlScript["onreadystatechange"] = function() { Assert.ok(true,"telemetry sent"); } } function pushPerfEvents(event: any, AISKUPerfTest: any): void { if (!AISKUPerfTest.doFlush) { AISKUPerfTest.perfEventsBuffer.push(event); } else { AISKUPerfTest.perfEventWaitBuffer.push(event); } } function flush(AISKUPerfTest: any): void { AISKUPerfTest.doFlush = true; console.log("flush " + AISKUPerfTest.perfEventsBuffer.length +" events"); AISKUPerfTest.perfEventsBuffer.forEach((event) => { if (event.baseData) {sendEventWithCollectorUrl(event);} }) AISKUPerfTest.perfEventsBuffer = AISKUPerfTest.perfEventWaitBuffer.slice(0); AISKUPerfTest.doFlush = false; AISKUPerfTest.perfEventWaitBuffer = []; Assert.ok(true, "flush triggered"); } const TENANT_KEY = "2252db2e5e344635a36c5f1c04b3902c-eaced1c8-a046-4e8d-8fa8-c1ecf2077a5d-7256" function createPerfEvent(AISKUInitPerf: any, name: string, value: number, isProcessTime: boolean, msg?: string): void { if (isNullOrUndefined(value) || value < 0 || isNullOrUndefined(AISKUInitPerf)) return; let metricVal = isProcessTime? "ProcessTime":"UsedJSHeapSize"; let unit = isProcessTime? "ms":"KB"; let event = { name: "SDKPerfTest", iKey: TENANT_KEY, ver: "4.0", ext: {}, baseData: { testName: name, sku:AISKUInitPerf.skuName, version: AISKUInitPerf.version, unitOfMeasure: unit, metric: metricVal, value: value } }; pushPerfEvents(event, AISKUInitPerf); let message = msg? msg :`perfEvent: ${event.baseData.testName} ${event.baseData.value}${event.baseData.unitOfMeasure} added`; console.log(message); Assert.ok(true, message); } function parseBatchSendEvent(perfEvent: any, AISKUInitPerf: any, memoryUsageMarks: any): void { let curMemory = performance["memory"]?.usedJSHeapSize; let memoryMarks = Object.keys(memoryUsageMarks); var index = ""; if (memoryMarks && memoryMarks.length && curMemory !== undefined) { index = memoryMarks[memoryMarks.length-1]; createPerfEvent(AISKUInitPerf, perfEvent.name+index, perfEvent?.exTime, true); } } function parseTrackEvent(perfEvent: any, AISKUInitPerf: any): void { let payloadItem = perfEvent["payload"]?.item; let baseType = null; if (perfEvent["time"] && payloadItem) { baseType = payloadItem["baseType"]; } // skip PageviewPerformanceData && MessageData if (isNullOrUndefined(baseType) || baseType == "PageviewPerformanceData" || baseType == "MessageData") return; createPerfEvent(AISKUInitPerf, `Track${baseType}`, perfEvent?.time, true); var childEvts = perfEvent?.childEvts; while (childEvts?.length) { let curEvt = childEvts[0]; let name = `${baseType}-${curEvt.name}`; let value = curEvt?.exTime !== undefined ? curEvt.exTime:curEvt.time; createPerfEvent(AISKUInitPerf, name, value, true); childEvts = curEvt?.childEvts; } } function parseAppInsightsPerfEvent(perfEvent: any, AISKUInitPerf: any, memoryUsageMarks: any): void { let perfEventName = perfEvent?.name; switch (perfEventName) { case "AISKU.flush": parseBatchSendEvent(perfEvent, AISKUInitPerf, memoryUsageMarks); break; case "AppInsightsCore:track": parseTrackEvent(perfEvent, AISKUInitPerf); break; } } function addSnippetLoadingTimeEvent(AISKUPerfTest: any, endtime: number): void { let rawTime = endtime - AISKUPerfTest.snippetStartTime; var duration = Math.round(rawTime*1000)/1000; createPerfEvent(AISKUPerfTest, "SDKInit", duration, true, `AppInsightsInit-Init: Script LoadingTime: ${duration} ms added`); } export class AISKUPerf extends AITestClass { public AISKUPerfTest: AppInsightsInitPerfTestClass; public perfMgr: any; public doPerf: any; public appInsights: any; public initialMemoryUsage: number = 0; public batchStartTimeMarks: any; public memoryUsageMarks: any; public perfMgrSrc: any = null; public testInitialize() { try { this.AISKUPerfTest = new AppInsightsInitPerfTestClass(); Assert.ok(window["oneDS"], "oneDS exists"); Assert.ok(window["Microsoft"]?.ApplicationInsights?.PerfMarkMeasureManager, "perfMgr exists"); Assert.ok(window["Microsoft"]?.ApplicationInsights?.doPerf, "doPerf exists"); this.perfMgr = window["Microsoft"].ApplicationInsights.PerfMarkMeasureManager; this.doPerf = window["Microsoft"].ApplicationInsights.doPerf; window["appInsightsInitPerftest"] = this.AISKUPerfTest; this.memoryUsageMarks = {}; this.batchStartTimeMarks = {}; } catch (e) { console.error("Failed to initialize AISKUPerf Tests", e); } } public testCleanup() { utlRemoveSessionStorage(null as any, "AI_sentBuffer"); utlRemoveSessionStorage(null as any, "AI_buffer"); } public registerTests() { this.addPerfTest(); } constructor() { super("AISKUPerfTest"); } public addPerfTest(): void { this.testCase({ name: "AppInsights AISKU perf Test", assertNoHooks: false, test: () => { Assert.ok(window["appInsightsInitPerftest"], "global appInsightsInitPerftest exists"); Assert.ok(window["oneDS"], "oneDS exists"); Assert.ok(this.perfMgr, "perfMgr exists"); Assert.ok(this.doPerf, "doPerf exists"); console.log(this.AISKUPerfTest.version); try { if (!this.AISKUPerfTest.hasPerfMgr) { this.perfMgrSrc = new this.perfMgr({ useMarks: true, useEndMarks: true, uniqueNames: true }, { perfEvent: (perfEvent) => { parseAppInsightsPerfEvent(perfEvent,this.AISKUPerfTest, this.memoryUsageMarks); } }); } this.initialMemoryUsage = performance["memory"]?.usedJSHeapSize; this._loadSnippet(); } catch (e) { Assert.ok(false, "load snippet error: " + e); } // Wait for 10 seconds to allow the script to load and then check if the appInsights object is available return this._delay(10000, () => { Assert.ok(true, "test version: " + this.AISKUPerfTest.version); }); } }); } protected _loadScriptOnInit(theModule: any): void { var snippetLoadingEndTime = performance.now(); this._addMemoryPerfEvent(this.initialMemoryUsage); Assert.ok(true,"AppInsights script loaded"); addSnippetLoadingTimeEvent(this.AISKUPerfTest, snippetLoadingEndTime); let appInsights = window["appInsights"]; this.appInsights = appInsights; this.onDone(() => { if (appInsights && appInsights.unload && appInsights.core && appInsights.core.isInitialized()) { Assert.ok(true, "Unloading..."); appInsights.unload(false); } else { Assert.ok(true, "Unload not supported..."); } appInsights = null; this.appInsights = null; }); try { let notificationManager = this.appInsights.core["_notificationManager"] ||this.appInsights.core?.getNotifyMgr(); if (notificationManager) { notificationManager.addNotificationListener({ perfEvent: (perfEvent: any) => { parseAppInsightsPerfEvent(perfEvent,this.AISKUPerfTest, this.memoryUsageMarks); }}); } } catch (e) { console.error(e); } this.addPerfEvents(); setTimeout(() => { flush(this.AISKUPerfTest); }, 9000); } protected _loadSnippet():void { let self = this; self.initialMemoryUsage = performance["memory"]?.usedJSHeapSize; window["loadSdkUsingRequire"]({ src: self.getScriptSrc(), onInit: function (theInstance) { console.log("snippet loaded"); self._loadScriptOnInit(theInstance); self.onDone(() => { if (theInstance && theInstance.unload && theInstance.core && theInstance.core.isInitialized()) { Assert.ok(true, "Unloading from onInit..."); theInstance.unload(false); } else { Assert.ok(true, "Unload not supported in onInit..."); } }); }, cfg: { instrumentationKey: "key", enablePerfMgr: true, maxBatchSizeInBytes: 1000000, maxBatchInterval: 30000000, extensionConfig: {} } }); } public addPerfEvents() { this._addMemoryPerfEvent(this.initialMemoryUsage,"Configuration"); this._trackSingleEvent(); setTimeout(() =>{ this._trackBatchEvents(10); setTimeout(() =>{ this._trackBatchEvents(30); setTimeout(() =>{ this._trackBatchEvents(50); setTimeout(() =>{ this._trackBatchEvents(80); setTimeout(() =>{ this._trackBatchEvents(100); },1000); },1000); },1000); },1000); },1000); } public getScriptSrc(): string { let baseUrl = "https://js.monitor.azure.com/scripts/b/ai."; if (this.AISKUPerfTest.version.indexOf("nightly") !== -1) { baseUrl = "https://js.monitor.azure.com/nightly/ai."; } return baseUrl + `${this.AISKUPerfTest.version}.min.js?${this.AISKUPerfTest.testPostfix}`; } private _addMemoryPerfEvent(initialMemoryUsage: number, metric?: string): void { let curMemory = performance["memory"]?.usedJSHeapSize; if (isNullOrUndefined(initialMemoryUsage) || initialMemoryUsage < 0) return; if (!isNullOrUndefined(curMemory)) { let metricName = metric? metric:"SDKInit"; var memoryUsed = Math.round((curMemory - initialMemoryUsage) / 1000); createPerfEvent(this.AISKUPerfTest, metricName, memoryUsed, false, `AppInsightsInit-Init: ${metricName} UsedJSHeapSize ${memoryUsed} KB added`); } } protected _trackSingleEvent() { if (isNullOrUndefined(this.appInsights)) return; var event = createTrackEvent("Track","EventData",20); var curMemeory = performance["memory"]?.usedJSHeapSize; if (! isNullOrUndefined(curMemeory)) { this.memoryUsageMarks["Track"] = curMemeory; } try { if (this.AISKUPerfTest.hasPerfMgr) { this.appInsights.trackEvent(event); } else { this.doPerf(this.perfMgrSrc, () => "AppInsightsCore:track", (perfEvent) => { this.appInsights.trackEvent(event); // A mark has been added to window.performance called 'tst.mark.AppInsightsCore:track' },()=> ({item: event})); } this.appInsights.flush(false); } catch (e) { console.error(e); } } protected _trackBatchEvents(number?: number) { var curTime = performance.now(); if (isNullOrUndefined(this.appInsights)) return; var eventNumber = number && number > 0? number:100; var eventName = "BatchSend" + number; this.batchStartTimeMarks[eventName] = curTime; var event = createTrackEvent("batch","Message",20); var curMemory = performance["memory"]?.usedJSHeapSize; if (!isNullOrUndefined(curMemory)) { this.memoryUsageMarks[eventName] = curMemory; } let beforeCreateBatch = performance.now(); try { for (let i = 0; i < eventNumber; i++) { this.appInsights.trackTrace(event); } let afterCreateBatch = performance.now(); let afterMemoUage = performance["memory"]?.usedJSHeapSize; let val = Math.round((afterMemoUage-curMemory)/1000); val = val < 0? 0:val; let msg = `${eventName} Memory Usage: ${val}KB`; createPerfEvent(this.AISKUPerfTest,eventName,val,false,msg); let duration = Math.round((afterCreateBatch-beforeCreateBatch)*1000)/1000; let createBatchName = `CreateBatch${eventNumber}` let createBatchMsg = `${createBatchName} time: ${duration}ms`; createPerfEvent(this.AISKUPerfTest,createBatchName,duration,true,createBatchMsg); if (this.AISKUPerfTest.hasPerfMgr) { this.appInsights.flush(false); } else { this.doPerf(this.perfMgrSrc, () => "AISKU.flush", (perfEvent) => { this.appInsights.flush(false); // A mark has been added to window.performance called 'tst.mark.AISKU.flush' },()=> ({item: event})); } } catch (e) { console.error(e); } } } ================================================ FILE: AISKU/Tests/Perf/src/AISKUPerf.ts ================================================ export class AppInsightsInitPerfTestClass { public version: string; public perfEventsBuffer: any[]; public perfEventWaitBuffer: any[]; public testPostfix: string; public INTERNAL_TENANT_KEY: string = "INTERNAL_TENANT_KEY"; public doFlush: boolean; public snippetStartTime: number; public skuName: string = "AppInsights"; public loadScriptOnInit: () => void; public flush: () => void; public sku: any = null; public hasPerfMgr: boolean; constructor(ver?: string) { /** * Default current version is 2.7.1 * should update version after new release * version with doperf(): after 2.5.6 * */ var defaultVer = "3.4.1"; this.version = ver? ver:this._getQueryParameterVersion(defaultVer); this.perfEventsBuffer = []; this.perfEventWaitBuffer = []; this.testPostfix = Math.random().toString(36).slice(6); this.doFlush = false; this.snippetStartTime = 0; this.hasPerfMgr = this.version <= "2.5.6"? false:true; } protected _getQueryParameterVersion(defaultVer: string): string { var version = defaultVer; var location = window.location.search; var queryParameter = new URLSearchParams(location); let queryVer = queryParameter.get("version"); if (queryVer && queryVer.length > 0) { version = queryVer;} return version; } } ================================================ FILE: AISKU/Tests/Perf/src/aiskuperftests.ts ================================================ import { AISKUPerf } from "./AISKUPerf.Tests"; export function runTests() { new AISKUPerf().registerTests(); } ================================================ FILE: AISKU/Tests/PerfTests.html ================================================  Tests for Application Insights JavaScript AISKU
    ================================================ FILE: AISKU/Tests/Unit/src/AISKUSize.Tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { dumpObj } from '@nevware21/ts-utils'; import { createPromise, doAwait, IPromise } from '@nevware21/ts-async'; import { strUndefined } from "@microsoft/applicationinsights-core-js"; import { utlRemoveSessionStorage } from "@microsoft/applicationinsights-core-js"; import * as pako from "pako"; import { Snippet } from "../../../src/Snippet"; const PACKAGE_JSON = "../package.json"; function removeTrailingComma(text) { return text.replace(/,(\s*[}\],])/g, "$1"); } function _loadPackageJson(cb:(isNightly: boolean, packageJson: any) => IPromise): IPromise { return createPromise((testCompleted, testFailed) => { function _handleCallback(packageJson: any) { let version = packageJson.version || "unknown"; let isNightly = version.includes("nightly") || version.includes("dev"); doAwait(cb(isNightly, packageJson), () => { testCompleted(); }, (error) => { Assert.ok(false, `checkIsNightlyBuild error: ${error}`); testFailed(error); }); } fetch(PACKAGE_JSON).then((response) => { if (!response.ok) { Assert.ok(false, `fetch package.json error: ${dumpObj(response)}`); _handleCallback(false); } else { return response.text().then((content) => { let json = JSON.parse(removeTrailingComma(content)); _handleCallback(json); }, (error) => { Assert.ok(false, `fetch package.json error: ${error}`); _handleCallback({}); }); } }, (error) => { Assert.ok(false, `fetch package.json error: ${error}`); _handleCallback({}); }); }); } function _checkSize(checkType: string, maxSize: number, size: number, isNightly: boolean): void { if (isNightly) { maxSize += .5; } Assert.ok(size <= maxSize, `exceed ${maxSize} KB, current ${checkType} size is: ${size} KB`); } export class AISKUSizeCheck extends AITestClass { private readonly MAX_RAW_SIZE = 174; private readonly MAX_BUNDLE_SIZE = 174; private readonly MAX_RAW_DEFLATE_SIZE = 70; private readonly MAX_BUNDLE_DEFLATE_SIZE = 70; private readonly rawFilePath = "../dist/es5/applicationinsights-web.min.js"; // Automatically updated by version scripts private readonly currentVer = "3.4.1"; private readonly prodFilePath = `../browser/es5/ai.${this.currentVer[0]}.min.js`; public testInitialize() { } public testFinishedCleanup(): void { if (typeof window !== strUndefined) { var _window = window; let aiName = _window["appInsightsSDK"] || "appInsights"; if (_window[aiName] !== undefined) { const snippet: Snippet = _window[aiName] as any; if (snippet["unload"]) { snippet["unload"](false); } else { if (snippet["appInsightsNew"]) { snippet["appInsightsNew"].unload(); } } } } } public testCleanup() { utlRemoveSessionStorage(null as any, "AI_sentBuffer"); utlRemoveSessionStorage(null as any, "AI_buffer"); } public registerTests() { this.addRawFileSizeCheck(); this.addProdFileSizeCheck(); } constructor() { super("AISKUSizeCheck"); } private addRawFileSizeCheck(): void { this._checkFileSize(false); } private addProdFileSizeCheck(): void { this._checkFileSize(true); } private _checkFileSize(isProd: boolean): void { let _filePath = isProd? this.prodFilePath : this.rawFilePath; let _maxFullSize = isProd ? this.MAX_BUNDLE_SIZE : this.MAX_RAW_SIZE; let _maxDeflateSize = isProd ? this.MAX_BUNDLE_DEFLATE_SIZE : this.MAX_RAW_DEFLATE_SIZE; let postfix = isProd? " (prod)" : " (dist)"; let fileName = _filePath.split("..")[2]; this.testCase({ name: `Test AISKU${postfix} deflate size`, test: () => { Assert.ok(true, `test file: ${fileName}`); return _loadPackageJson((isNightly, packageJson) => { Assert.ok(true, ` checking : ${packageJson.name || "??"} v${packageJson.version || "unknown"}`); let request = new Request(_filePath, {method:"GET"}); return fetch(request).then((response) => { if (!response.ok) { Assert.ok(false, `fetch AISKU${postfix} error: ${response.statusText}`); return; } else { return response.text().then(text => { let size = Math.ceil((text.length/1024) * 100) / 100.0; _checkSize("bundle", _maxFullSize, size, isNightly); let deflateSize = Math.ceil((pako.deflate(text).length/1024) * 100) / 100.0; _checkSize("deflate", _maxDeflateSize, deflateSize, isNightly); }).catch((error: Error) => { Assert.ok(false, `AISKU${postfix} response error: ${error}`); }); } }).catch((error: Error) => { Assert.ok(false, `AISKU${postfix} deflate size error: ${error}`); }); }); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/CdnPackaging.tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { AnalyticsPluginIdentifier, BreezeChannelIdentifier, DEFAULT_BREEZE_ENDPOINT, DisabledPropertyName, DistributedTracingModes, PropertiesPluginIdentifier, RequestHeaders, SeverityLevel } from "@microsoft/applicationinsights-core-js"; import { dumpObj, LoggingSeverity, objForEachKey, objKeys, strUndefined } from "@microsoft/applicationinsights-core-js"; import { Snippet } from "../../../src/Snippet"; declare var define; const enum CdnFormat { Umd = 0, Gbl = 1, CommonJs = 2 } export class CdnPackagingChecks extends AITestClass { // Automatically updated by version scripts private readonly currentVer = "3.4.1"; public testInitialize() { } public testFinishedCleanup(): void { if (typeof window !== strUndefined) { var _window = window; let aiName = _window["appInsightsSDK"] || "appInsights"; if (_window[aiName] !== undefined) { const snippet: Snippet = _window[aiName] as any; if (snippet["unload"]) { snippet["unload"](false); } else { if (snippet["appInsightsNew"]) { snippet["appInsightsNew"].unload(); } } } } } public testCleanup() { } public registerTests() { this.checkFullPackaging(); this.addMinifiedPackaging(); } constructor() { super("CdnPackagingChecks"); } private checkFullPackaging(): void { this._checkPackaging(`../browser/es5/ai.${this.currentVer[0]}.js`, CdnFormat.Umd); this._checkPackaging(`../browser/es5/ai.${this.currentVer[0]}.gbl.js`, CdnFormat.Gbl); this._checkPackaging(`../browser/es5/ai.${this.currentVer[0]}.cjs.js`, CdnFormat.CommonJs); } private addMinifiedPackaging(): void { this._checkPackaging(`../browser/es5/ai.${this.currentVer[0]}.min.js`, CdnFormat.Umd); this._checkPackaging(`../browser/es5/ai.${this.currentVer[0]}.gbl.min.js`, CdnFormat.Gbl); this._checkPackaging(`../browser/es5/ai.${this.currentVer[0]}.cjs.min.js`, CdnFormat.CommonJs); } private _validateExpectedExports(theExports: any) { Assert.ok(theExports.ApplicationInsights, "ApplicationInsights exists"); Assert.ok(!theExports.Telemetry, "Telemetry no longer exists"); // Assert.ok(theExports.Telemetry.DistributedTracingModes, "Telemetry.DistributedTracingModes exists"); // Assert.ok(theExports.Telemetry.Util, "Telemetry exists"); Assert.ok(theExports.LoggingSeverity, "LoggingSeverity exists"); objForEachKey(LoggingSeverity, (name, value) => { Assert.equal(name, theExports.LoggingSeverity[value], `Checking LoggingSeverity.${name} === ${value}`); Assert.equal(value, theExports.LoggingSeverity[name], `Checking LoggingSeverity.${value} === ${name}`); }); Assert.ok(theExports.PerfEvent, "PerfEvent exists"); Assert.ok(theExports.PerfManager, "PerfManager exists"); Assert.ok(theExports.doPerf, "doPerf exists"); Assert.ok(!theExports.CoreUtils, "CoreUtils no longer exists"); Assert.ok(theExports.newId, "newId exists"); Assert.ok(theExports.newGuid, "newGuid exists"); Assert.ok(theExports.random32, "random32 exists"); Assert.ok(theExports.randomValue, "randomValue exists"); Assert.ok(theExports.generateW3CId, "generateW3CId exists"); Assert.ok(theExports.findW3cTraceParent, "findW3cTraceParent exists"); Assert.ok(theExports.findMetaTag, "findMetaTag exists"); Assert.ok(theExports.mergeEvtNamespace, "mergeEvtNamespace exists"); Assert.ok(theExports.eventOn, "eventOn exists"); Assert.ok(theExports.eventOff, "eventOff exists"); Assert.ok(theExports.addEventHandler, "addEventHandler exists"); Assert.ok(theExports.removeEventHandler, "removeEventHandler exists"); Assert.ok(theExports.isBeaconsSupported, "isBeaconsSupported exists"); Assert.ok(!theExports.Util, "Util no longer exists"); // Assert.equal(theExports.Util, theExports.Telemetry.Util, "Telemetry.Util matches Util"); Assert.ok(theExports.RequestHeaders, "RequestHeaders exists"); objForEachKey(RequestHeaders, (name, value) => { Assert.equal(value, theExports.RequestHeaders[name], `Checking RequestHeaders.${value} === ${name}`); Assert.notEqual(undefined, theExports.RequestHeaders[name], `Checking RequestHeaders.${name} exists`); }); Assert.equal(theExports.DisabledPropertyName, DisabledPropertyName, "DisabledPropertyName value"); Assert.equal(theExports.DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_ENDPOINT, "DEFAULT_BREEZE_ENDPOINT value"); Assert.ok(theExports.SeverityLevel, "SeverityLevel exists"); objForEachKey(SeverityLevel, (name, value) => { Assert.equal(name, theExports.SeverityLevel[value], `Checking SeverityLevel.${name} === ${value}`); Assert.equal(value, theExports.SeverityLevel[name], `Checking SeverityLevel.${value} === ${name}`); }); Assert.ok(theExports.DistributedTracingModes, "DistributedTracingModes exists"); objForEachKey(DistributedTracingModes, (name, value) => { Assert.equal(name, theExports.DistributedTracingModes[value], `Checking DistributedTracingMode.${name} === ${value}`); Assert.equal(value, theExports.DistributedTracingModes[name], `Checking DistributedTracingMode.${value} === ${name}`); }); Assert.equal(theExports.PropertiesPluginIdentifier, PropertiesPluginIdentifier, "PropertiesPluginIdentifier value"); Assert.equal(theExports.BreezeChannelIdentifier, BreezeChannelIdentifier, "BreezeChannelIdentifier value"); Assert.equal(theExports.AnalyticsPluginIdentifier, AnalyticsPluginIdentifier, "AnalyticsPluginIdentifier value"); } private _validateExportsAsModule(text: string, format: CdnFormat) { let orgExports = exports; let orgDefine = define; try { // remove any previously registered bundle delete window["Microsoft"]; // Hide define() define = undefined; // Remove any "exports" exports = {}; // Used to simulate globals without overriding them let theExports = {}; let hostValues = this["_hostValues"] = { global: {}, globalThis: undefined, exports: theExports, module: { exports: theExports }, define: undefined }; // "process" the script eval(text); // This test should not be overriding the real globals Assert.equal(0, objKeys(exports || {}), "The exports should not have been changed"); Assert.equal(undefined, define, "define should not have been exposed"); Assert.equal(undefined, window["Microsoft"], "The global window[\"Microsoft\"] should not have been defined"); Assert.equal(undefined, exports["Microsoft"], "global not added to exports"); Assert.equal(undefined, this["Microsoft"], "The this should not have been changed Microsoft namespace does not exists"); if (format == CdnFormat.Umd) { // Because "exports" exists as a module then no namespace is expected Assert.equal(undefined, hostValues.global["Microsoft"], "global Microsoft namespace does not exists"); Assert.equal(undefined, hostValues.exports["Microsoft"], "global not added to cjs exports"); this._validateExpectedExports(hostValues.exports); } else if (format === CdnFormat.Gbl) { let microsoft: any = hostValues.global["Microsoft"]; Assert.equal(0, objKeys(hostValues.exports || {}), "The exports should not have been changed"); Assert.ok(microsoft, "Microsoft namespace exists on this"); Assert.ok(microsoft.ApplicationInsights, "Microsoft namespace exists"); this._validateExpectedExports(microsoft.ApplicationInsights); } else if (format === CdnFormat.CommonJs) { // There is no namespace for common js let microsoft: any = hostValues.global["Microsoft"]; Assert.equal(undefined, microsoft, "global Microsoft namespace does not exists"); Assert.equal(undefined, hostValues.exports["Microsoft"], "global Microsoft namespace does not exist on exports"); this._validateExpectedExports(hostValues.exports); } } catch (e) { Assert.ok(false, dumpObj(e)); } finally { if (orgExports) { exports = orgExports; } else { exports = undefined; } if (orgDefine) { define = orgDefine; } else { define = undefined; } } } private _validateGlobalExports(text: string, format: CdnFormat) { let orgExports = window.exports; let orgDefine = define; try { // remove any previously registered bundle delete window["Microsoft"]; // Hide define() define = undefined; // Remove any "exports" exports = undefined; // Used to simulate globals without overriding them let hostValues = this["_hostValues"] = { global: {}, globalThis: undefined, exports: undefined as any, // Don't provide an "exports" module: undefined, define: undefined }; if (format === CdnFormat.CommonJs) { // CommonJs always needs the "exports" defined hostValues.exports = {}; } // "process" the script eval(text); // This test should not be overriding the real globals Assert.equal(0, objKeys(exports || {}), "The exports should not have been changed"); Assert.equal(undefined, define, "define should not have been exposed"); Assert.equal(undefined, window["Microsoft"], "The global window[\"Microsoft\"] should not have been defined"); Assert.equal(undefined, exports, "global not added to exports"); Assert.equal(undefined, this["Microsoft"], "The this should not have been changed Microsoft namespace does not exists"); if (format == CdnFormat.Umd) { // Because we are simulating no "exports" then there should be a global namespace defined Assert.equal(undefined, hostValues.exports, "No global exports should have been defined"); let microsoft: any = hostValues.global["Microsoft"]; Assert.ok(microsoft, "Microsoft namespace exists"); Assert.ok(microsoft.ApplicationInsights, "Microsoft namespace exists"); this._validateExpectedExports(microsoft.ApplicationInsights); } else if (format === CdnFormat.Gbl) { let microsoft: any = window["Microsoft"]; Assert.equal(undefined, microsoft, "global Microsoft namespace does not exists"); Assert.equal(undefined, hostValues.exports, "global not added to exports"); microsoft = hostValues.global["Microsoft"]; Assert.ok(microsoft, "Microsoft namespace exists on this"); Assert.ok(microsoft.ApplicationInsights, "Microsoft namespace exists"); this._validateExpectedExports(microsoft.ApplicationInsights); } else if (format === CdnFormat.CommonJs) { // There is no namespace for common js let microsoft: any = hostValues.global["Microsoft"]; Assert.equal(undefined, microsoft, "global Microsoft namespace does not exists"); this._validateExpectedExports(hostValues.exports); } } catch (e) { Assert.ok(false, dumpObj(e)); } finally { if (orgExports) { exports = orgExports; } else { exports = undefined; } if (orgDefine) { define = orgDefine; } else { define = undefined; } } } private _validateExportsAsDefine(text: string, format: CdnFormat) { let orgExports = window.exports; let orgDefine = define; try { // remove any previously registered bundle delete window["Microsoft"]; // Hide define() define = undefined; // Remove any "exports" exports = undefined; let simulatedDefine = (names: string[], factory) => { QUnit.assert.ok(false, "Not tagged as 'amd' so should not be called"); } // Used to simulate globals without overriding them let hostValues = this["_hostValues"] = { global: {}, globalThis: undefined, exports: undefined as any, // Don't provide an "exports" module: undefined, define: simulatedDefine }; if (format === CdnFormat.CommonJs) { // CommonJs always needs the "exports" defined hostValues.exports = {}; } // "process" the script eval(text); // This test should not be overriding the real globals Assert.equal(0, objKeys(exports || {}), "The exports should not have been changed"); Assert.equal(undefined, define, "define should not have been exposed"); Assert.equal(undefined, window["Microsoft"], "The global window[\"Microsoft\"] should not have been defined"); Assert.equal(undefined, exports, "global not added to exports"); Assert.equal(undefined, this["Microsoft"], "The this should not have been changed Microsoft namespace does not exists"); if (format == CdnFormat.Umd) { // Because we are simulating no "exports" then there should be a global namespace defined Assert.equal(undefined, hostValues.exports, "No global exports should have been defined"); let microsoft: any = hostValues.global["Microsoft"]; Assert.ok(microsoft, "Microsoft namespace exists"); Assert.ok(microsoft.ApplicationInsights, "Microsoft namespace exists"); this._validateExpectedExports(microsoft.ApplicationInsights); } else if (format === CdnFormat.Gbl) { let microsoft: any = window["Microsoft"]; Assert.equal(undefined, microsoft, "global Microsoft namespace does not exists"); Assert.equal(undefined, hostValues.exports, "global not added to exports"); microsoft = hostValues.global["Microsoft"]; Assert.ok(microsoft, "Microsoft namespace exists on this"); Assert.ok(microsoft.ApplicationInsights, "Microsoft namespace exists"); this._validateExpectedExports(microsoft.ApplicationInsights); } else if (format === CdnFormat.CommonJs) { // There is no namespace for common js let microsoft: any = hostValues.global["Microsoft"]; Assert.equal(undefined, microsoft, "global Microsoft namespace does not exists"); this._validateExpectedExports(hostValues.exports); } } catch (e) { Assert.ok(false, dumpObj(e)); } finally { if (orgExports) { exports = orgExports; } else { exports = undefined; } if (orgDefine) { define = orgDefine; } else { define = undefined; } } } private _validateExportsAsAmdDefine(text: string, format: CdnFormat) { let orgExports = window.exports; let orgDefine = define; try { // remove any previously registered bundle delete window["Microsoft"]; // Hide define() define = undefined; // Remove any "exports" exports = undefined; let defineCalled = false; let theNames: string[]; let theFactory = null; let simulatedDefine = (names: string[], factory) => { defineCalled = true; theNames = names; theFactory = factory; } // Tag the function simulatedDefine["amd"] = true; // Used to simulate globals without overriding them let hostValues = this["_hostValues"] = { global: {}, globalThis: undefined, exports: undefined as any, // Don't provide an "exports" module: undefined, define: simulatedDefine }; if (format === CdnFormat.CommonJs) { // CommonJs always needs the "exports" defined hostValues.exports = {}; } // "process" the script eval(text); // This test should not be overriding the real globals Assert.equal(0, objKeys(exports || {}), "The exports should not have been changed"); Assert.equal(undefined, define, "define should not have been exposed"); Assert.equal(undefined, window["Microsoft"], "The global window[\"Microsoft\"] should not have been defined"); Assert.equal(undefined, exports, "global not added to exports"); Assert.equal(undefined, this["Microsoft"], "The this should not have been changed Microsoft namespace does not exists"); if (format == CdnFormat.Umd) { // Because we are simulating no "exports" then there should be a global namespace defined Assert.equal(undefined, hostValues.exports, "No global exports should have been defined"); Assert.equal(undefined, hostValues.global["Microsoft"], "Microsoft namespace should not have been defined"); let microsoft: any = hostValues.global["Microsoft"]; Assert.equal(undefined, microsoft, "Microsoft namespace does not exist on the global"); Assert.equal(true, defineCalled, "Validate that define was called"); Assert.ok(theNames, "Make sure names was populated"); Assert.equal(1, theNames.length, "Check the provided names") Assert.equal("exports", theNames[0], "Check the provided name") let theExports = {}; Assert.ok(theFactory, "Make sure the factory was provided"); theFactory(theExports); microsoft = theExports["Microsoft"]; Assert.equal(undefined, microsoft, "Microsoft namespace does not exist on the exports"); this._validateExpectedExports(theExports); } else if (format === CdnFormat.Gbl) { let microsoft: any = window["Microsoft"]; Assert.equal(undefined, microsoft, "global Microsoft namespace does not exists"); Assert.equal(undefined, hostValues.exports, "global not added to exports"); microsoft = hostValues.global["Microsoft"]; Assert.ok(microsoft, "Microsoft namespace exists on this"); Assert.ok(microsoft.ApplicationInsights, "Microsoft namespace exists"); Assert.equal(false, defineCalled, "Validate that define was not called"); this._validateExpectedExports(microsoft.ApplicationInsights); } else if (format === CdnFormat.CommonJs) { // There is no namespace for common js let microsoft: any = hostValues.global["Microsoft"]; Assert.equal(undefined, microsoft, "global Microsoft namespace does not exists"); Assert.equal(false, defineCalled, "Validate that define was not called"); this._validateExpectedExports(hostValues.exports); } } catch (e) { Assert.ok(false, dumpObj(e)); } finally { if (orgExports) { exports = orgExports; } else { exports = undefined; } if (orgDefine) { define = orgDefine; } else { define = undefined; } } } private _checkPackaging(cdnPackage: string, format: CdnFormat): void { let fileName = cdnPackage.split("..")[1]; this.testCase({ name: `Test AISKU Cdn packaging - ${fileName}`, test: () => { Assert.ok(true, `test file: ${fileName}`); let request = new Request(cdnPackage, {method:"GET"}); return fetch(request).then((response) => { if (!response.ok) { Assert.ok(false, `fetch bundle AISKU ${fileName} error: ${response.statusText}`); return; } else { return response.text().then(text => { // Wrap in a closure so the global space is not polluted text = "(function(values) {\n" + "function init(hostValues) {\n" + "console.log(\"initializing\");" + "console.log(JSON.stringify(this));\n" + "let globalThis = hostValues.globalThis;\n" + "let exports = hostValues.exports;\n" + "let module = hostValues.module;\n" + "let define = hostValues.define;\n" + "let self = hostValues.global;\n" + "console.log(\"Now running CDN script\");" + text + "\n" + "}\n" + "init.apply(values.global, [values]);\n" + "})(this._hostValues)"; this._validateExportsAsModule(text, format); this._validateGlobalExports(text, format); this._validateExportsAsDefine(text, format); this._validateExportsAsAmdDefine(text, format); }).catch((error: Error) => { Assert.ok(false, `AISKU bundle ${fileName} response error: ${error}`); }); } }).catch((error: Error) => { Assert.ok(false, `AISKU bundle ${fileName} deflate size error: ${error}`); }); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/CdnThrottle.tests.ts ================================================ import { ApplicationInsights, ApplicationInsightsContainer, IApplicationInsights, IConfig, IConfiguration, LoggingSeverity, Snippet, _eInternalMessageId } from '../../../src/applicationinsights-web' import { AITestClass, Assert, IFetchArgs, PollingAssert} from '@microsoft/ai-test-framework'; import { IThrottleInterval, IThrottleLimit, IThrottleMgrConfig } from '@microsoft/applicationinsights-core-js'; import { SinonSpy } from 'sinon'; import { AppInsightsSku } from '../../../src/AISku'; import { createSnippetV5 } from './testSnippetV5'; import { CdnFeatureMode, FeatureOptInMode, getGlobal, getGlobalInst, isFunction, newId } from '@microsoft/applicationinsights-core-js'; import { createSnippetV6 } from './testSnippetV6'; import { CfgSyncPlugin, ICfgSyncConfig, ICfgSyncMode } from '@microsoft/applicationinsights-cfgsync-js'; import { createSyncPromise, doAwait } from '@nevware21/ts-async'; import { ICfgSyncCdnConfig } from '@microsoft/applicationinsights-cfgsync-js/src/Interfaces/ICfgSyncCdnConfig'; const TestInstrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; const default_throttle_config = { disabled: true, limit: { samplingRate: 100, maxSendNumber: 1 }, interval: { monthInterval: 3, daysOfMonth: [28] } } as IThrottleMgrConfig; const throttleCfg = { 109: { disabled: false, limit: { samplingRate: 1000000, maxSendNumber: 2 }, interval: { monthInterval: 2, daysOfMonth:[1] } }, 106: { disabled: false, limit: { samplingRate: 1000000, maxSendNumber: 2 }, interval: { monthInterval: 2, daysOfMonth:[1] } } } const throttleCfgDisable = { 109: { disabled: true, limit: { samplingRate: 1000000, maxSendNumber: 4 }, interval: { monthInterval: 4, daysOfMonth:[1] } }, 106: { disabled: true, limit: { samplingRate: 1000000, maxSendNumber: 4 }, interval: { monthInterval: 4, daysOfMonth:[1] } } } const sampleConfig = { instrumentationKey:"testIkey", enableAjaxPerfTracking: true, throttleMgrCfg: throttleCfg } as IConfiguration & IConfig; export class CdnThrottle extends AITestClass { private _ai: AppInsightsSku; private getAi: ApplicationInsights; private _config: IConfiguration | IConfig; private identifier: string; private fetchStub: any; init: ApplicationInsights; private res: any; private _fetch: any; loggingSpy: any; constructor() { super("CdnThrottle"); } public _getTestConfig() { let config: IConfiguration | IConfig = { instrumentationKey: TestInstrumentationKey, featureOptIn : {["iKeyUsage"]: {mode: FeatureOptInMode.enable}}, extensionConfig : {["AppInsightsCfgSyncPlugin"] : { syncMode: ICfgSyncMode.Receive, cfgUrl: "testurl" }} }; return config; } public testInitialize() { try { if (window.localStorage){ window.localStorage.clear(); } this.identifier = "AppInsightsCfgSyncPlugin"; this._config = this._getTestConfig(); this._fetch = getGlobalInst("fetch"); let doc = getGlobal(); let cdnCfg = { enabled: true, config: sampleConfig } as ICfgSyncConfig; let cdnFeatureOptInCfg = { enabled: true, featureOptIn:{ ["enableWParamFeature"]: {mode: CdnFeatureMode.enable, onCfg: {["maxMessageLimit"]: 11}, offCfg: {["maxMessageLimit"]: 12}}, ["iKeyUsage"]: { mode: CdnFeatureMode.enable, onCfg: { "throttleMgrCfg.106.disabled":false, "throttleMgrCfg.109.disabled":false, }, offCfg: { "throttleMgrCfg.106.disabled":true, "throttleMgrCfg.109.disabled":true, }}, ["zipPayload"]: { mode: CdnFeatureMode.enable}, }, config: { maxMessageLimit: 10, throttleMgrCfg: throttleCfgDisable, } } as ICfgSyncConfig; doc["res"] = new (doc as any).Response(JSON.stringify(cdnCfg), { status: 200, headers: { "Content-type": "application/json" } }); doc["res2"] = new (doc as any).Response(JSON.stringify(cdnFeatureOptInCfg), { status: 200, headers: { "Content-type": "application/json" } }); } catch (e) { console.error('Failed to initialize', e.message); } } public testFinishedCleanup(): void { if (this._ai) { this._ai.unload(false); } this.fetchStub = null; getGlobal().fetch = this._fetch; if (window.localStorage){ window.localStorage.clear(); } } public registerTests() { this.testCase({ name: "CfgSyncPlugin: customer enable ikey messsage change, new config fetch from config url overwrite throttle setting and send message", useFakeTimers: true, test: () => { let doc = getGlobal(); hookFetch((resolve) => { // global instance cannot access test private instance AITestClass.orgSetTimeout(function() { resolve( doc["res"]); }, 0); }); this.fetchStub = this.sandbox.spy((doc as any), "fetch"); this.init = new ApplicationInsights({ config: { instrumentationKey: TestInstrumentationKey, featureOptIn : {["iKeyUsage"]: {mode: FeatureOptInMode.disable}}, extensionConfig : {["AppInsightsCfgSyncPlugin"] : { syncMode: ICfgSyncMode.Receive, cfgUrl: "testurl" }} } }); this.init.loadAppInsights(); this._ai = this.init; let core = this._ai['core']; let _logger = core.logger; this.loggingSpy = this.sandbox.stub(_logger, 'throwInternal'); return this._asyncQueue().add(PollingAssert.asyncTaskPollingAssert(() => { if (this.fetchStub.called){ Assert.equal(this.loggingSpy.called, 0); // now enable feature this.init.config.featureOptIn = {["iKeyUsage"]: {mode: FeatureOptInMode.enable}} this.clock.tick(1); return true; } return false; }, "response received", 60, 1000)).add(PollingAssert.asyncTaskPollingAssert(() => { if (this.loggingSpy.called){ Assert.equal(this.loggingSpy.called, 1); Assert.equal(_eInternalMessageId.InstrumentationKeyDeprecation, this.loggingSpy.args[0][1]); let message= this.loggingSpy.args[0][2]; Assert.ok(message.includes("Instrumentation key")); return true; } return false; }, "response received", 60, 1000)) } }); this.testCase({ name: "CfgSyncPlugin: customer didn't set throttle config, successfully fetch from config url", useFakeTimers: true, test: () => { let doc = getGlobal(); hookFetch((resolve) => { // global instance cannot access test private instance AITestClass.orgSetTimeout(function() { resolve( doc["res"]); }, 0); }); this.fetchStub = this.sandbox.spy((doc as any), "fetch"); this.init = new ApplicationInsights({ config: this._config, }); this.init.loadAppInsights(); this._ai = this.init; return this._asyncQueue().add(PollingAssert.asyncTaskPollingAssert(() => { if (this.fetchStub.called){ let plugin = this._ai.appInsights['core'].getPlugin(this.identifier).plugin; let newCfg = plugin.getCfg(); Assert.equal(JSON.stringify(newCfg.throttleMgrCfg), JSON.stringify(sampleConfig.throttleMgrCfg)); // cdn should not be changed let cdnCfg = this.init.config.throttleMgrCfg[_eInternalMessageId.CdnDeprecation]; Assert.equal(JSON.stringify(cdnCfg), JSON.stringify(default_throttle_config)); return true; } return false; }, "response received", 60, 1000)) } }); this.testCase({ name: "CfgSyncPlugin: customer didn't set feature opt in, successfully get aisku default and fetch from config url, get disable zip config to be true", useFakeTimers: true, test: () => { let doc = getGlobal(); hookFetch((resolve) => { // global instance cannot access test private instance AITestClass.orgSetTimeout(function() { resolve( doc["res2"]); }, 0); }); let noSetconfig = { instrumentationKey: TestInstrumentationKey, extensionConfig : {["AppInsightsCfgSyncPlugin"] : { syncMode: ICfgSyncMode.Receive, cfgUrl: "testurl" }} }; this.fetchStub = this.sandbox.spy((doc as any), "fetch"); this.init = new ApplicationInsights({ config: noSetconfig, }); this.init.loadAppInsights(); this._ai = this.init; return this._asyncQueue().add(PollingAssert.asyncTaskPollingAssert(() => { if (this.fetchStub.called){ this.clock.tick(1) return true; } return false; }, "response received", 60, 1000)).add(PollingAssert.asyncTaskPollingAssert(() => { if (this.fetchStub.called){ let newCfg = this._ai.config; this.clock.tick(1) Assert.equal(newCfg.featureOptIn["zipPayload"]["mode"], FeatureOptInMode.enable); // aisku default is none, overwrite to true by cdn config return true; } return false; }, "response received", 60, 1000)); } }); this.testCase({ name: "CfgSyncPlugin: customer set throttle config, new config fetch from config url could overwrite original one", useFakeTimers: true, test: () => { let doc = getGlobal(); hookFetch((resolve) => { // global instance cannot access test private instance AITestClass.orgSetTimeout(function() { resolve( doc["res"]); }, 0); }); this.fetchStub = this.sandbox.spy((doc as any), "fetch"); let config = { instrumentationKey: TestInstrumentationKey, featureOptIn : {["iKeyUsage"]: {mode: FeatureOptInMode.enable}}, throttleMgrCfg: { 109: { disabled: false, limit: { samplingRate: 50, maxSendNumber: 1 }, interval: { daysOfMonth:[1], monthInterval: 1 } } }, extensionConfig : {["AppInsightsCfgSyncPlugin"] : { syncMode: ICfgSyncMode.Receive, cfgUrl: "testurl" }} }; this.init = new ApplicationInsights({ config: config, }); this.init.loadAppInsights(); this._ai = this.init; return this._asyncQueue().add(PollingAssert.asyncTaskPollingAssert(() => { if (this.fetchStub.called){ this.clock.tick(1) return true; } return false; }, "response received", 60, 1000)).add(PollingAssert.asyncTaskPollingAssert(() => { if (this.fetchStub.called){ let plugin = this._ai.appInsights['core'].getPlugin(this.identifier).plugin; let newCfg = plugin.getCfg(); Assert.equal(JSON.stringify(newCfg.throttleMgrCfg), JSON.stringify(sampleConfig.throttleMgrCfg)); // cdn should not be overwritten let cdnCfg = this.init.config.throttleMgrCfg[_eInternalMessageId.CdnDeprecation]; Assert.equal(JSON.stringify(cdnCfg), JSON.stringify(default_throttle_config)); let ikeyCfg = this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation]; Assert.equal(JSON.stringify(ikeyCfg), JSON.stringify(sampleConfig.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation])); return true; } return false; }, "response received", 60, 1000)); } }); this.testCase({ name: "CfgSyncPlugin: customer enable feature opt in, then the config in cdn feature opt in is applied", useFakeTimers: true, test: () => { let doc = getGlobal(); hookFetch((resolve) => { // global instance cannot access test private instance AITestClass.orgSetTimeout(function() { resolve( doc["res2"]); }, 0); }); this.fetchStub = this.sandbox.spy((doc as any), "fetch"); this.init = new ApplicationInsights({ config: { instrumentationKey: TestInstrumentationKey, extensionConfig : {["AppInsightsCfgSyncPlugin"] : { syncMode: ICfgSyncMode.Receive, cfgUrl: "testurl" }}, featureOptIn : {["iKeyUsage"]: {mode: FeatureOptInMode.enable}, ["enableWParamFeature"]: {mode: FeatureOptInMode.enable}} } }); this.init.loadAppInsights(); this._ai = this.init; return this._asyncQueue().add(PollingAssert.asyncTaskPollingAssert(() => { if (this.fetchStub.called){ this.clock.tick(1) return true; } return false; }, "response received", 60, 1000)).add(PollingAssert.asyncTaskPollingAssert(() => { if (this.fetchStub.called){ Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation].disabled, false); Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.CdnDeprecation].disabled, true); Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation].limit?.maxSendNumber, throttleCfgDisable[_eInternalMessageId.InstrumentationKeyDeprecation].limit?.maxSendNumber); return true; } return false; }, "response received", 60, 1000)); } }); this.testCase({ name: "CfgSyncPlugin: customer disable feature opt in, the origin config on cdn will apply", useFakeTimers: true, test: () => { let doc = getGlobal(); hookFetch((resolve) => { // global instance cannot access test private instance AITestClass.orgSetTimeout(function() { resolve( doc["res2"]); }, 0); }); this.fetchStub = this.sandbox.spy((doc as any), "fetch"); this.init = new ApplicationInsights({ config: { instrumentationKey: TestInstrumentationKey, extensionConfig : {["AppInsightsCfgSyncPlugin"] : { syncMode: ICfgSyncMode.Receive, cfgUrl: "testurl" }}, featureOptIn : { ["enableWParamFeature"]: {mode: FeatureOptInMode.enable}} } }); this.init.loadAppInsights(); this._ai = this.init; return this._asyncQueue().add(PollingAssert.asyncTaskPollingAssert(() => { if (this.fetchStub.called){ this.clock.tick(1) return true; } return false; }, "response received", 60, 1000)).add(PollingAssert.asyncTaskPollingAssert(() => { if (this.fetchStub.called){ Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation].disabled, true); Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.CdnDeprecation].disabled, true); Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation].limit?.maxSendNumber, throttleCfgDisable[_eInternalMessageId.InstrumentationKeyDeprecation].limit?.maxSendNumber); return true; } return false; }, "response received", 60, 1000) as any); } }); } } function hookFetch(executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): IFetchArgs[] { let calls:IFetchArgs[] = []; let global = getGlobal() as any; global.fetch = function(input: RequestInfo, init?: RequestInit) { calls.push({ input, init }); return createSyncPromise(executor); } return calls; } ================================================ FILE: AISKU/Tests/Unit/src/GlobalTestHooks.Test.ts ================================================ import { Assert } from "@microsoft/ai-test-framework"; import { _testHookMaxUnloadHooksCb } from "@microsoft/applicationinsights-core-js"; import { dumpObj } from "@nevware21/ts-utils"; export class GlobalTestHooks { public registerTests() { // Set a global maximum _testHookMaxUnloadHooksCb(20, (state: string, hooks: Array) => { Assert.ok(false, "Max unload hooks exceeded [" + hooks.length + "] - " + state + " - " + dumpObj(hooks)); }); } } ================================================ FILE: AISKU/Tests/Unit/src/IAnalyticsConfig.Tests.ts ================================================ import { ApplicationInsights, IAnalyticsConfig, IAppInsights, IConfig, ApplicationAnalytics } from "../../../src/applicationinsights-web"; import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { AnalyticsPluginIdentifier, utlRemoveSessionStorage } from "@microsoft/applicationinsights-core-js"; import { AppInsightsCore, IConfiguration, isFunction, onConfigChange } from "@microsoft/applicationinsights-core-js"; import { Sender } from "@microsoft/applicationinsights-channel-js"; const TestInstrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; export class IAnalyticsConfigTests extends AITestClass { public testInitialize() { this._disableDynProtoBaseFuncs(); } public testCleanup() { // Clean up session storage utlRemoveSessionStorage(null as any, "AI_sentBuffer"); utlRemoveSessionStorage(null as any, "AI_buffer"); } public registerTests() { this.testCase({ name: "IAnalyticsConfig: Interface compatibility with existing functionality", test: () => { // Test that the interface doesn't break existing functionality // Use root configuration (IConfiguration) for ApplicationInsights initialization const init = new ApplicationInsights({ config: { instrumentationKey: TestInstrumentationKey } }); this.onDone(() => { if (init && init.unload) { init.unload(false); } }); init.loadAppInsights(); // These should work as before Assert.ok(isFunction(init.trackEvent), "trackEvent should be available"); Assert.ok(isFunction(init.trackPageView), "trackPageView should be available"); Assert.ok(isFunction(init.trackException), "trackException should be available"); Assert.ok(isFunction(init.trackTrace), "trackTrace should be available"); Assert.ok(isFunction(init.trackMetric), "trackMetric should be available"); Assert.ok(isFunction(init.trackDependencyData), "trackDependencyData should be available"); } }); this.testCase({ name: "IAnalyticsConfig: onConfigChange integration test", useFakeTimers: true, test: () => { let theConfig: IConfiguration & IConfig = { instrumentationKey: TestInstrumentationKey, samplingPercentage: 50 }; const core = new AppInsightsCore(); const init = new ApplicationInsights({ config: theConfig }); this.onDone(() => { if (init && init.unload) { init.unload(false); } }); init.loadAppInsights(); let onChangeCalled = 0; let expectedSamplingPercentage = 50; let handler = onConfigChange(theConfig, (details) => { onChangeCalled++; Assert.equal(TestInstrumentationKey, details.cfg.instrumentationKey, "Expect the iKey to be set"); if (details.cfg.samplingPercentage !== undefined) { Assert.equal(expectedSamplingPercentage, details.cfg.samplingPercentage, "Expect the sampling percentage to be set"); } }); // Initial call should happen Assert.equal(1, onChangeCalled, "OnCfgChange was called exactly once initially"); let initialCallCount = onChangeCalled; // Change a config value expectedSamplingPercentage = 75; (theConfig as any).samplingPercentage = expectedSamplingPercentage; // Wait for the change to propagate this.clock.tick(1); Assert.ok(onChangeCalled > initialCallCount, "Expected the onChanged was called when config changed"); // Remove the handler handler.rm(); let callCountBeforeRemoval = onChangeCalled; expectedSamplingPercentage = 25; (theConfig as any).samplingPercentage = expectedSamplingPercentage; this.clock.tick(1); Assert.equal(callCountBeforeRemoval, onChangeCalled, "Expected the onChanged was not called after handler removal"); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/NonRecordingSpan.Tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { ApplicationInsights } from "../../../src/applicationinsights-web"; import { eOTelSpanKind, eOTelSpanStatusCode, ITelemetryItem } from "@microsoft/applicationinsights-core-js"; /** * Comprehensive tests for non-recording span behavior * * Non-recording spans are used for: * - Context propagation without telemetry overhead * - Testing and debugging scenarios * - Wrapping external span contexts * - Performance-sensitive scenarios */ export class NonRecordingSpanTests extends AITestClass { private static readonly _instrumentationKey = "b7170927-2d1c-44f1-acec-59f4e1751c11"; private static readonly _connectionString = `InstrumentationKey=${NonRecordingSpanTests._instrumentationKey}`; private _ai!: ApplicationInsights; private _trackCalls: ITelemetryItem[] = []; constructor(testName?: string) { super(testName || "NonRecordingSpanTests"); } public testInitialize() { try { this.useFakeServer = false; this._trackCalls = []; this._ai = new ApplicationInsights({ config: { connectionString: NonRecordingSpanTests._connectionString, disableAjaxTracking: false, disableXhr: false, maxBatchInterval: 0, disableExceptionTracking: false } }); this._ai.loadAppInsights(); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; } catch (e) { console.error("Failed to initialize tests: " + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public registerTests() { this.addBasicNonRecordingTests(); this.addAttributeOperationTests(); this.addStatusAndNameTests(); this.addSpanKindTests(); this.addHierarchyTests(); this.addTelemetryGenerationTests(); this.addPerformanceTests(); this.addEdgeCaseTests(); } private addBasicNonRecordingTests(): void { this.testCase({ name: "NonRecording: span created with recording:false is not recording", test: () => { // Act const span = this._ai.startSpan("non-recording-basic", { recording: false }); // Assert Assert.ok(span, "Span should be created"); Assert.ok(!span.isRecording(), "Span should not be recording"); Assert.equal(span.name, "non-recording-basic", "Span name should be set"); } }); this.testCase({ name: "NonRecording: default recording:true creates recording span", test: () => { // Act const span = this._ai.startSpan("recording-default"); // Assert Assert.ok(span, "Span should be created"); Assert.ok(span.isRecording(), "Span should be recording by default"); } }); this.testCase({ name: "NonRecording: explicit recording:true creates recording span", test: () => { // Act const span = this._ai.startSpan("recording-explicit", { recording: true }); // Assert Assert.ok(span, "Span should be created"); Assert.ok(span.isRecording(), "Span should be recording"); } }); this.testCase({ name: "NonRecording: isRecording() returns false throughout lifecycle", test: () => { // Arrange const span = this._ai.startSpan("non-recording-lifecycle", { recording: false }); // Act & Assert - Before operations Assert.ok(!span.isRecording(), "Should not be recording initially"); // Perform operations span!.setAttribute("key", "value"); Assert.ok(!span.isRecording(), "Should not be recording after setAttribute"); span!.setStatus({ code: eOTelSpanStatusCode.OK }); Assert.ok(!span.isRecording(), "Should not be recording after setStatus"); span!.updateName("new-name"); Assert.ok(!span.isRecording(), "Should not be recording after updateName"); span!.end(); Assert.ok(!span.isRecording(), "Should not be recording after end"); } }); } private addAttributeOperationTests(): void { this.testCase({ name: "NonRecording: setAttribute does not store attributes", test: () => { // Arrange const span = this._ai.startSpan("non-recording-attrs", { recording: false }); // Act span!.setAttribute("key1", "value1"); span!.setAttribute("key2", 123); span!.setAttribute("key3", true); // Assert const attrs = span!.attributes; Assert.ok(attrs, "Attributes object should exist"); // Non-recording spans don't store attributes Assert.equal(Object.keys(attrs).length, 0, "No attributes should be stored"); } }); this.testCase({ name: "NonRecording: setAttributes does not store attributes", test: () => { // Arrange const span = this._ai.startSpan("non-recording-set-attrs", { recording: false }); // Act span!.setAttributes({ "attr1": "value1", "attr2": 456, "attr3": false, "attr4": [1, 2, 3] }); // Assert const attrs = span!.attributes; Assert.equal(Object.keys(attrs).length, 0, "No attributes should be stored"); } }); this.testCase({ name: "NonRecording: setAttribute returns span for chaining", test: () => { // Arrange const span = this._ai.startSpan("non-recording-chain", { recording: false }); // Act const result = span!.setAttribute("key", "value"); // Assert Assert.equal(result, span, "setAttribute should return the span for chaining"); } }); this.testCase({ name: "NonRecording: setAttributes returns span for chaining", test: () => { // Arrange const span = this._ai.startSpan("non-recording-chain-multi", { recording: false }); // Act const result = span!.setAttributes({ "key1": "value1", "key2": "value2" }); // Assert Assert.equal(result, span, "setAttributes should return the span for chaining"); } }); this.testCase({ name: "NonRecording: multiple setAttribute calls increment dropped count", test: () => { // Arrange const span = this._ai.startSpan("non-recording-dropped", { recording: false }); // Act span!.setAttribute("key1", "value1"); span!.setAttribute("key2", "value2"); span!.setAttribute("key3", "value3"); span!.setAttributes({ "key4": "value4", "key5": "value5" }); // Assert const droppedCount = span!.droppedAttributesCount; Assert.ok(droppedCount >= 5, `At least 5 attributes should be dropped, got ${droppedCount}`); } }); this.testCase({ name: "NonRecording: setAttribute after end() increments dropped count", test: () => { // Arrange const span = this._ai.startSpan("non-recording-after-end", { recording: false }); span!.end(); // Act span!.setAttribute("late-key", "late-value"); // Assert - Should not throw, just increment dropped count Assert.ok(span.ended, "Span should be ended"); Assert.ok(span.droppedAttributesCount > 0, "Dropped attribute count should be incremented"); } }); } private addStatusAndNameTests(): void { this.testCase({ name: "NonRecording: setStatus changes status even when not recording", test: () => { // Arrange const span = this._ai.startSpan("non-recording-status", { recording: false }); // Act span!.setStatus({ code: eOTelSpanStatusCode.ERROR, message: "Test error" }); // Assert Assert.equal(span.status.code, eOTelSpanStatusCode.ERROR, "Status code should be set"); Assert.equal(span.status.message, "Test error", "Status message should be set"); } }); this.testCase({ name: "NonRecording: setStatus returns span for chaining", test: () => { // Arrange const span = this._ai.startSpan("non-recording-status-chain", { recording: false }); // Act const result = span!.setStatus({ code: eOTelSpanStatusCode.OK }); // Assert Assert.equal(result, span, "setStatus should return the span for chaining"); } }); this.testCase({ name: "NonRecording: updateName changes name even when not recording", test: () => { // Arrange const span = this._ai.startSpan("original-name", { recording: false }); // Act span!.updateName("updated-name"); // Assert Assert.equal(span.name, "updated-name", "Name should be updated"); } }); this.testCase({ name: "NonRecording: updateName returns span for chaining", test: () => { // Arrange const span = this._ai.startSpan("chain-name", { recording: false }); // Act const result = span!.updateName("new-chain-name"); // Assert Assert.equal(result, span, "updateName should return the span for chaining"); } }); this.testCase({ name: "NonRecording: chained operations work correctly", test: () => { // Arrange const span = this._ai.startSpan("chaining-test", { recording: false }); // Act const result = span .setAttribute("key1", "value1") .setAttributes({ "key2": "value2" }) .setStatus({ code: eOTelSpanStatusCode.OK }) .updateName("chained-name"); // Assert Assert.equal(result, span, "All operations should return the span"); Assert.equal(span.name, "chained-name", "Name should be updated"); Assert.equal(span.status.code, eOTelSpanStatusCode.OK, "Status should be set"); } }); } private addSpanKindTests(): void { this.testCase({ name: "NonRecording: CLIENT kind non-recording span", test: () => { // Act const span = this._ai.startSpan("client-non-recording", { kind: eOTelSpanKind.CLIENT, recording: false }); // Assert Assert.ok(span, "Span should be created"); Assert.equal(span.kind, eOTelSpanKind.CLIENT, "Kind should be CLIENT"); Assert.ok(!span.isRecording(), "Should not be recording"); } }); this.testCase({ name: "NonRecording: SERVER kind non-recording span", test: () => { // Act const span = this._ai.startSpan("server-non-recording", { kind: eOTelSpanKind.SERVER, recording: false }); // Assert Assert.equal(span.kind, eOTelSpanKind.SERVER, "Kind should be SERVER"); Assert.ok(!span.isRecording(), "Should not be recording"); } }); this.testCase({ name: "NonRecording: INTERNAL kind non-recording span", test: () => { // Act const span = this._ai.startSpan("internal-non-recording", { kind: eOTelSpanKind.INTERNAL, recording: false }); // Assert Assert.equal(span.kind, eOTelSpanKind.INTERNAL, "Kind should be INTERNAL"); Assert.ok(!span.isRecording(), "Should not be recording"); } }); this.testCase({ name: "NonRecording: PRODUCER kind non-recording span", test: () => { // Act const span = this._ai.startSpan("producer-non-recording", { kind: eOTelSpanKind.PRODUCER, recording: false }); // Assert Assert.equal(span.kind, eOTelSpanKind.PRODUCER, "Kind should be PRODUCER"); Assert.ok(!span.isRecording(), "Should not be recording"); } }); this.testCase({ name: "NonRecording: CONSUMER kind non-recording span", test: () => { // Act const span = this._ai.startSpan("consumer-non-recording", { kind: eOTelSpanKind.CONSUMER, recording: false }); // Assert Assert.equal(span.kind, eOTelSpanKind.CONSUMER, "Kind should be CONSUMER"); Assert.ok(!span.isRecording(), "Should not be recording"); } }); } private addHierarchyTests(): void { this.testCase({ name: "NonRecording: parent recording, child non-recording", test: () => { // Arrange const parentSpan = this._ai.startSpan("recording-parent", { kind: eOTelSpanKind.SERVER, recording: true }); const parentContext = parentSpan!.spanContext(); // Act const childSpan = this._ai.startSpan("non-recording-child", { kind: eOTelSpanKind.CLIENT, recording: false }, parentContext); // Assert Assert.ok(parentSpan!.isRecording(), "Parent should be recording"); Assert.ok(!childSpan.isRecording(), "Child should not be recording"); Assert.equal(childSpan!.spanContext().traceId, parentContext.traceId, "Child should share parent's trace ID"); } }); this.testCase({ name: "NonRecording: parent non-recording, child recording", test: () => { // Arrange const parentSpan = this._ai.startSpan("non-recording-parent", { kind: eOTelSpanKind.SERVER, recording: false }); const parentContext = parentSpan!.spanContext(); // Act const childSpan = this._ai.startSpan("recording-child", { kind: eOTelSpanKind.CLIENT, recording: true }, parentContext); // Assert Assert.ok(!parentSpan.isRecording(), "Parent should not be recording"); Assert.ok(childSpan!.isRecording(), "Child should be recording"); Assert.equal(childSpan!.spanContext().traceId, parentContext.traceId, "Child should share parent's trace ID"); } }); this.testCase({ name: "NonRecording: both parent and child non-recording", test: () => { // Arrange const parentSpan = this._ai.startSpan("non-recording-parent-2", { recording: false }); const parentContext = parentSpan!.spanContext(); // Act const childSpan = this._ai.startSpan("non-recording-child-2", { recording: false }, parentContext); // Assert Assert.ok(!parentSpan.isRecording(), "Parent should not be recording"); Assert.ok(!childSpan.isRecording(), "Child should not be recording"); } }); this.testCase({ name: "NonRecording: multi-level hierarchy with mixed recording", test: () => { // Arrange const level1 = this._ai.startSpan("level1-recording", { recording: true }); const level1Context = level1!.spanContext(); const level2 = this._ai.startSpan("level2-non-recording", { recording: false }, level1Context); const level2Context = level2!.spanContext(); const level3 = this._ai.startSpan("level3-recording", { recording: true }, level2Context); // Assert Assert.ok(level1!.isRecording(), "Level 1 should be recording"); Assert.ok(!level2.isRecording(), "Level 2 should not be recording"); Assert.ok(level3!.isRecording(), "Level 3 should be recording"); // All should share the same trace ID Assert.equal(level2!.spanContext().traceId, level1Context.traceId, "Level 2 should share trace ID"); Assert.equal(level3!.spanContext().traceId, level1Context.traceId, "Level 3 should share trace ID"); } }); } private addTelemetryGenerationTests(): void { this.testCase({ name: "NonRecording: no telemetry generated on end()", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("non-recording-no-telemetry", { kind: eOTelSpanKind.CLIENT, recording: false }); span!.setAttribute("should-not-appear", "in-telemetry"); span!.setStatus({ code: eOTelSpanStatusCode.OK }); span!.end(); // Assert const telemetryItem = this._trackCalls.find( item => item.baseData?.name === "non-recording-no-telemetry" ); Assert.ok(!telemetryItem, "Non-recording span should not generate telemetry"); } }); this.testCase({ name: "NonRecording: recording span generates telemetry, non-recording does not", test: () => { // Arrange this._trackCalls = []; // Act const recordingSpan = this._ai.startSpan("recording-generates", { kind: eOTelSpanKind.CLIENT, recording: true }); recordingSpan.end(); const nonRecordingSpan = this._ai.startSpan("non-recording-silent", { kind: eOTelSpanKind.CLIENT, recording: false }); nonRecordingSpan.end(); // Assert const recordingTelemetry = this._trackCalls.find( item => item.baseData?.name === "recording-generates" ); const nonRecordingTelemetry = this._trackCalls.find( item => item.baseData?.name === "non-recording-silent" ); Assert.ok(recordingTelemetry, "Recording span should generate telemetry"); Assert.ok(!nonRecordingTelemetry, "Non-recording span should not generate telemetry"); } }); this.testCase({ name: "NonRecording: parent recording generates telemetry, child non-recording does not", test: () => { // Arrange this._trackCalls = []; // Act const parent = this._ai.startSpan("parent-with-telemetry", { kind: eOTelSpanKind.SERVER, recording: true }); const parentContext = parent.spanContext(); const child = this._ai.startSpan("child-without-telemetry", { kind: eOTelSpanKind.CLIENT, recording: false }, parentContext); child.end(); parent.end(); // Assert const parentTelemetry = this._trackCalls.find( item => item.baseData?.name === "parent-with-telemetry" ); const childTelemetry = this._trackCalls.find( item => item.baseData?.name === "child-without-telemetry" ); Assert.ok(parentTelemetry, "Parent recording span should generate telemetry"); Assert.ok(!childTelemetry, "Child non-recording span should not generate telemetry"); } }); } private addPerformanceTests(): void { this.testCase({ name: "NonRecording: multiple non-recording spans minimal overhead", test: () => { // Arrange this._trackCalls = []; const spanCount = 100; // Act const startTime = Date.now(); for (let i = 0; i < spanCount; i++) { const span = this._ai.startSpan(`non-recording-perf-${i}`, { recording: false }); span!.setAttribute("iteration", i); span!.setStatus({ code: eOTelSpanStatusCode.OK }); span!.end(); } const elapsed = Date.now() - startTime; // Assert Assert.ok(elapsed < 1000, `Creating ${spanCount} non-recording spans should be fast, took ${elapsed}ms`); Assert.equal(this._trackCalls.length, 0, "No telemetry should be generated for non-recording spans"); } }); this.testCase({ name: "NonRecording: attribute operations are fast on non-recording spans", test: () => { // Arrange const span = this._ai.startSpan("perf-attrs", { recording: false }); const attrCount = 1000; // Act const startTime = Date.now(); for (let i = 0; i < attrCount; i++) { span!.setAttribute(`key${i}`, `value${i}`); } const elapsed = Date.now() - startTime; // Assert Assert.ok(elapsed < 500, `Setting ${attrCount} attributes should be fast, took ${elapsed}ms`); Assert.equal(Object.keys(span.attributes).length, 0, "Attributes should not be stored"); } }); } private addEdgeCaseTests(): void { this.testCase({ name: "NonRecording: end() can be called multiple times safely", test: () => { // Arrange const span = this._ai.startSpan("multi-end", { recording: false }); // Act & Assert - Should not throw span!.end(); Assert.ok(span.ended, "Span should be ended"); span!.end(); Assert.ok(span.ended, "Span should still be ended"); span!.end(); Assert.ok(span.ended, "Span should still be ended"); } }); this.testCase({ name: "NonRecording: operations after end() do not throw", test: () => { // Arrange const span = this._ai.startSpan("ops-after-end", { recording: false }); span!.end(); // Act & Assert - Should not throw span!.setAttribute("late-attr", "value"); span!.setAttributes({ "late-attrs": "values" }); span!.setStatus({ code: eOTelSpanStatusCode.ERROR }); span!.updateName("late-name"); Assert.ok(span.ended, "Span should remain ended"); } }); this.testCase({ name: "NonRecording: null and undefined attribute values handled", test: () => { // Arrange const span = this._ai.startSpan("null-attrs", { recording: false }); // Act & Assert - Should not throw span!.setAttribute("null-value", null as any); span!.setAttribute("undefined-value", undefined as any); span!.setAttributes({ "null-in-set": null as any, "undefined-in-set": undefined as any }); Assert.ok(!span.isRecording(), "Span should still be non-recording"); } }); this.testCase({ name: "NonRecording: empty string name allowed", test: () => { // Act const span = this._ai.startSpan("", { recording: false }); // Assert Assert.ok(span, "Span with empty name should be created"); Assert.equal(span.name, "", "Name should be empty string"); Assert.ok(!span.isRecording(), "Should not be recording"); } }); this.testCase({ name: "NonRecording: special characters in span name", test: () => { // Arrange const specialNames = [ "span/with/slashes", "span:with:colons", "span-with-dashes", "span.with.dots", "span with spaces", "span\twith\ttabs", "span(with)parens", "span[with]brackets", "span{with}braces" ]; // Act & Assert specialNames.forEach(name => { const span = this._ai.startSpan(name, { recording: false }); Assert.ok(span, `Span with name '${name}' should be created`); Assert.equal(span.name, name, "Name should be preserved"); Assert.ok(!span.isRecording(), "Should not be recording"); }); } }); this.testCase({ name: "NonRecording: very long span name handled", test: () => { // Arrange const longName = "a".repeat(10000); // Act const span = this._ai.startSpan(longName, { recording: false }); // Assert Assert.ok(span, "Span with very long name should be created"); Assert.ok(!span.isRecording(), "Should not be recording"); } }); this.testCase({ name: "NonRecording: spanContext() returns valid context", test: () => { // Act const span = this._ai.startSpan("context-check", { recording: false }); const context = span!.spanContext(); // Assert Assert.ok(context, "Context should exist"); Assert.ok(context.traceId, "Trace ID should exist"); Assert.ok(context.spanId, "Span ID should exist"); Assert.ok(context.traceId.length === 32, "Trace ID should be 32 characters"); Assert.ok(context.spanId.length === 16, "Span ID should be 16 characters"); } }); this.testCase({ name: "NonRecording: status object immutability", test: () => { // Arrange const span = this._ai.startSpan("status-immutable", { recording: false }); span!.setStatus({ code: eOTelSpanStatusCode.OK, message: "Initial" }); // Act const status1 = span!.status; span!.setStatus({ code: eOTelSpanStatusCode.ERROR, message: "Changed" }); const status2 = span!.status; // Assert Assert.equal(status1.code, eOTelSpanStatusCode.OK, "First status should be OK"); Assert.equal(status2.code, eOTelSpanStatusCode.ERROR, "Second status should be ERROR"); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/OTelInit.Tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { ApplicationInsights } from "../../../src/applicationinsights-web"; import { eOTelSpanKind, eOTelSpanStatusCode, isTracingSuppressed, ITelemetryItem, unsuppressTracing } from "@microsoft/applicationinsights-core-js"; import { objIs, setBypassLazyCache } from "@nevware21/ts-utils"; import { AnalyticsPluginIdentifier, PropertiesPluginIdentifier } from "@microsoft/applicationinsights-core-js"; /** * Integration Tests for Span APIs with Properties Plugin and Analytics Plugin * * Tests verify that span telemetry correctly integrates with: * - PropertiesPlugin: session, user, device, application context * - AnalyticsPlugin: telemetry creation, dependency tracking, page views * - Telemetry Initializers: custom property injection * - SDK configuration: sampling, disabled tracking, etc. */ export class OTelInitTests extends AITestClass { private _ai!: ApplicationInsights; constructor(testName?: string) { super(testName || "OTelInitTests"); } public testInitialize() { try { setBypassLazyCache(true); this.useFakeServer = true; this._ai = new ApplicationInsights({ config: { instrumentationKey: "test-ikey-123", disableInstrumentationKeyValidation: true, disableAjaxTracking: false, disableXhr: false, disableFetchTracking: false, enableAutoRouteTracking: false, disableExceptionTracking: false, maxBatchInterval: 100, enableDebug: false, extensionConfig: { ["AppInsightsPropertiesPlugin"]: { accountId: "test-account-id" } }, traceCfg: { coreTrace: 1 } as any } }); this._ai.loadAppInsights(); } catch (e) { Assert.ok(false, "Failed to initialize tests: " + e); console.error("Failed to initialize tests: " + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } setBypassLazyCache(false); } public registerTests() { this.testCase({ name: "OTelInitTests", test: () => { Assert.ok(this._ai, "ApplicationInsights instance should be initialized"); Assert.ok(this._ai.getPlugin(PropertiesPluginIdentifier), "PropertiesPlugin should be loaded"); Assert.ok(this._ai.getPlugin(AnalyticsPluginIdentifier), "AnalyticsPlugin should be loaded"); Assert.ok(!isTracingSuppressed(this._ai.core), "Tracing should not be suppressed by default"); } }); this.testCase({ name: "Validate OTelApi", test: () => { const otelApi = this._ai.otelApi; Assert.ok(otelApi, "OTel API should be available"); Assert.ok(otelApi.cfg, "OTel configuration should be available"); Assert.ok(objIs(this._ai, otelApi.host), "OTel API host should be the same as the SKU instance"); Assert.ok(objIs(otelApi.cfg.traceCfg, this._ai.core.config.traceCfg), "OTel trace configuration should be the same as the SDK config"); Assert.ok(objIs(otelApi.host.config, this._ai.config), "OTel API config should be the same as the SDK config"); Assert.ok(objIs(otelApi.host.config, this._ai.core.config), "OTel API config should be the same as the SDK core config"); Assert.ok(objIs(this._ai.config, this._ai.core.config), "SDK config should be the same as the SDK core config"); } }); this.testCase({ name: "Validate Trace suppression", test: () => { const otelApi = this._ai.otelApi; Assert.ok(otelApi, "OTel API should be available"); Assert.equal(false, isTracingSuppressed(this._ai.core), "Tracing should not be suppressed by default"); Assert.equal(false, otelApi.cfg.traceCfg?.suppressTracing, "supressTracing should be false by default"); Assert.equal(false, this._ai.core.config.traceCfg.suppressTracing, "suppressTracing should be false by default"); this._ai.core.config.traceCfg.suppressTracing = true; Assert.equal(true, isTracingSuppressed(this._ai.core), "Tracing should be suppressed when suppressTracing is set to true"); Assert.equal(true, otelApi.cfg.traceCfg?.suppressTracing, "supressTracing should be true when suppressTracing is set to true"); Assert.equal(true, this._ai.core.config.traceCfg.suppressTracing, "suppressTracing should be true when suppressTracing is set to true"); unsuppressTracing(this._ai.core); Assert.equal(false, isTracingSuppressed(this._ai.core), "Tracing should not be suppressed after unsuppressTracing"); Assert.equal(false, this._ai.core.config.traceCfg.suppressTracing, "suppressTracing should be false by default"); Assert.equal(false, otelApi.cfg.traceCfg?.suppressTracing, "supressTracing should be false after unsuppressTracing"); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/SnippetInitialization.Tests.ts ================================================ import { ApplicationInsightsContainer } from "../../../src/ApplicationInsightsContainer"; import { IApplicationInsights } from "../../../src/IApplicationInsights"; import { Snippet } from "../../../src/Snippet"; import { Sender } from "@microsoft/applicationinsights-channel-js"; import { SinonSpy } from "sinon"; import { AITestClass, Assert, PollingAssert } from "@microsoft/ai-test-framework"; import { createSnippetV5 } from "./testSnippetV5"; import { createSnippetV6 } from "./testSnippetV6"; import { BaseTelemetryPlugin, IProcessTelemetryContext, isNotNullOrUndefined, ITelemetryItem, newId, objForEachKey } from "@microsoft/applicationinsights-core-js"; import { BreezeChannelIdentifier, ContextTagKeys, DistributedTracingModes, IConfig, IDependencyTelemetry, RequestHeaders, utlRemoveSessionStorage, utlSetSessionStorage } from "@microsoft/applicationinsights-core-js"; import { getGlobal } from "@microsoft/applicationinsights-shims"; import { IPropTelemetryContext } from "@microsoft/applicationinsights-properties-js"; import { dumpObj, isPromiseLike, objHasOwnProperty, strSubstring } from "@nevware21/ts-utils"; import { AppInsightsSku } from "../../../src/AISku"; const TestInstrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; const TestConnectionString = 'InstrumentationKey=b7170927-2d1c-44f1-acec-59f4e1751c11'; const _expectedBeforeProperties = [ "config", "cookie" ]; const _expectedAfterProperties = [ "appInsights", "core", "context", "pluginVersionString", "pluginVersionStringArr" ]; const _expectedTrackMethods = [ "startTrackPage", "stopTrackPage", "trackException", "trackEvent", "trackMetric", "trackPageView", "trackTrace", "trackDependencyData", "setAuthenticatedUserContext", "clearAuthenticatedUserContext", "trackPageViewPerformance", "addTelemetryInitializer", "flush" ]; const _expectedMethodsAfterInitialization = [ "getCookieMgr" ]; function getSnippetConfig(sessionPrefix: string, addSampling: boolean = false) { return { src: "", cfg: { connectionString: `InstrumentationKey=${TestInstrumentationKey}`, disableAjaxTracking: false, disableFetchTracking: false, enableRequestHeaderTracking: true, enableResponseHeaderTracking: true, maxBatchInterval: 500, disableExceptionTracking: false, namePrefix: `sessionPrefix`, enableCorsCorrelation: true, distributedTracingMode: DistributedTracingModes.AI_AND_W3C, samplingPercentage: addSampling ? 50 : undefined, extensionConfig: { ["AppInsightsCfgSyncPlugin"]: { cfgUrl: "" } } } as IConfig }; }; function getSnippetConfigConnectionString(sessionPrefix: string) { return { src: "", cfg: { connectionString: TestConnectionString, disableAjaxTracking: false, disableFetchTracking: false, enableRequestHeaderTracking: true, enableResponseHeaderTracking: true, maxBatchInterval: 500, disableExceptionTracking: false, namePrefix: `sessionPrefix`, enableCorsCorrelation: true, distributedTracingMode: DistributedTracingModes.AI_AND_W3C, extensionConfig: { ["AppInsightsCfgSyncPlugin"]: { cfgUrl: "" } } } as IConfig }; }; function getSnippetConfigWrongConnectionString(sessionPrefix: string) { return { src: "", cfg: { connectionString: 'wrong connection string'+TestConnectionString, disableAjaxTracking: false, disableFetchTracking: false, enableRequestHeaderTracking: true, enableResponseHeaderTracking: true, maxBatchInterval: 500, disableExceptionTracking: false, namePrefix: `sessionPrefix`, enableCorsCorrelation: true, distributedTracingMode: DistributedTracingModes.AI_AND_W3C, extensionConfig: { ["AppInsightsCfgSyncPlugin"]: { cfgUrl: "" } } } as IConfig }; }; function getSnippetConfigNotSetConnectionString(sessionPrefix: string) { return { src: "", cfg: { connectionString: '', disableAjaxTracking: false, disableFetchTracking: false, enableRequestHeaderTracking: true, enableResponseHeaderTracking: true, maxBatchInterval: 500, disableExceptionTracking: false, namePrefix: `sessionPrefix`, enableCorsCorrelation: true, distributedTracingMode: DistributedTracingModes.AI_AND_W3C, extensionConfig: { ["AppInsightsCfgSyncPlugin"]: { cfgUrl: "" } } } as IConfig }; }; export class SnippetInitializationTests extends AITestClass { // Context private tagKeys = new ContextTagKeys(); // Sinon private errorSpy: SinonSpy; private successSpy: SinonSpy; private loggingSpy: SinonSpy; private isFetchPolyfill:boolean = false; private sessionPrefix: string = newId(); private trackSpy: SinonSpy; private envelopeConstructorSpy: SinonSpy; constructor(emulateIe: boolean) { super("SnippetInitializationTests", emulateIe); } // Add any new snippet configurations to this map private _theSnippets = { "v5": createSnippetV5, "v6": createSnippetV6 }; public testInitialize() { this._disableDynProtoBaseFuncs(); // We need to disable the useBaseInst performance setting as the sinon spy fools the internal logic and the spy is bypassed try { this.useFakeServer = true; this.useFakeFetch = true; this.fakeServerAutoRespond = true; this.fakeFetchAutoRespond = true; this.isFetchPolyfill = fetch && fetch["polyfill"]; console.log("* testInitialize()"); } catch (e) { console.error('Failed to initialize', e); } } public testCleanup() { utlRemoveSessionStorage(null as any, "AI_sentBuffer", ); utlRemoveSessionStorage(null as any, "AI_buffer", ); utlRemoveSessionStorage(null as any, "sessionPrefix_AI_sentBuffer", ); utlRemoveSessionStorage(null as any, "sessionPrefix_AI_buffer", ); } public registerTests() { objForEachKey(this._theSnippets, (snippetName, snippetCreator) => { this.testCase({ name: "[" + snippetName + "] check NO support for 1.0 apis", test: () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))) as any; Assert.ok(theSnippet, 'ApplicationInsights SDK exists'); Assert.ok(!(theSnippet as any).downloadAndSetup, "The [" + snippetName + "] snippet should NOT have the downloadAndSetup"); // has legacy method } }); this.testCaseAsync({ name: "checkConnectionString", stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfigConnectionString(this.sessionPrefix))); theSnippet.trackEvent({ name: 'event', properties: { "prop1": "value1" }, measurements: { "measurement1": 200 } }); } ] .concat(this.asserts(1)).concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data && data.baseData && data.baseData.properties["prop1"]); Assert.ok(data && data.baseData && data.baseData.measurements["measurement1"]); } }) }); this.testCase({ name: "checkIncorrectConnectionString", test: () => { let theSnippet:any = null; let exception: Error = null; //this.useFakeServer = false; try { let snippet:Snippet = snippetCreator(getSnippetConfigWrongConnectionString(this.sessionPrefix)); // Call the initialization let ai = ((ApplicationInsightsContainer.getAppInsights(snippet, snippet.version)) as IApplicationInsights); Assert.equal(true, ai.appInsights.isInitialized(), "isInitialized"); } catch (e) { Assert.equal(e.message, "Please provide instrumentation key", "Server would not start when get incorrect connection string"); } } }); this.testCase({ name: "checkConnectionStringNotSet", test: () => { let theSnippet:any = null; let exception: Error = null; //this.useFakeServer = false; try { let snippet:Snippet = snippetCreator(getSnippetConfigNotSetConnectionString(this.sessionPrefix)); // Call the initialization ((ApplicationInsightsContainer.getAppInsights(snippet, snippet.version)) as IApplicationInsights); } catch (e) { Assert.equal(e.message, "Please provide instrumentation key", "Server would not start without connection string"); } } }); this.testCaseAsync({ name: "[" + snippetName + "] : Public Members exist", stepDelay: 100, steps: [() => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))) as any; _expectedTrackMethods.forEach(method => { Assert.ok(theSnippet[method], `${method} exists`); Assert.equal('function', typeof theSnippet[method], `${method} is a function`); let funcSpy; if (method === "trackDependencyData" || method === "flush") { // we don't have any available reference to the underlying call, so while we want to check // that this functions exists we can't validate that it is called } else if (method === "setAuthenticatedUserContext" || method === "clearAuthenticatedUserContext") { funcSpy = this.sandbox.spy(theSnippet.context.user, method); } else if (method === "addTelemetryInitializer") { funcSpy = this.sandbox.spy(theSnippet.core, method); } else { funcSpy = this.sandbox.spy(theSnippet.appInsights, method); } try { theSnippet[method](); } catch(e) { // Do nothing } if (funcSpy) { Assert.ok(funcSpy.called, "Function [" + method + "] of the appInsights should have been called") } }); _expectedMethodsAfterInitialization.forEach(method => { Assert.ok(theSnippet[method], `${method} exists`); Assert.equal('function', typeof theSnippet[method], `${method} is a function`); let funcSpy = this.sandbox.spy(theSnippet.appInsights, method); try { theSnippet[method](); } catch(e) { // Do nothing } if (funcSpy) { Assert.ok(funcSpy.called, "Function [" + method + "] of the appInsights should have been called") } }); }, PollingAssert.createPollingAssert(() => { try { Assert.ok(true, "* waiting for scheduled actions to send events " + new Date().toISOString()); if(this.successSpy.called) { let currentCount: number = 0; this.successSpy.args.forEach(call => { call[0].forEach(item => { let message = item; if (typeof item !== "string") { message = item.item; } // Ignore the internal SendBrowserInfoOnUserInit message (Only occurs when running tests in a browser) if (!message || message.indexOf("AI (Internal): 72 ") == -1) { currentCount ++; } }); }); return currentCount > 0; } return false; } catch (e) { Assert.ok(false, "Exception:" + e); } }, "waiting for sender success", 30, 1000) as any] }); this.testCase({ name: "Check properties exist", test: () => { let preSnippet = snippetCreator(getSnippetConfig(this.sessionPrefix)); _expectedBeforeProperties.forEach(property => { Assert.ok(objHasOwnProperty(preSnippet, property), `${property} has property`); Assert.ok(isNotNullOrUndefined(preSnippet[property]), `${property} exists`); }); _expectedAfterProperties.forEach(property => { Assert.ok(!objHasOwnProperty(preSnippet, property), `${property} does not exist`); }); let theSnippet = this._initializeSnippet(preSnippet) as any; _expectedAfterProperties.forEach(property => { Assert.ok(objHasOwnProperty(theSnippet, property) , `${property} exists`); Assert.notEqual('function', typeof theSnippet[property], `${property} is not a function`); }); Assert.ok(isNotNullOrUndefined(theSnippet.core), "Make sure the core is set"); Assert.ok(isNotNullOrUndefined(theSnippet.appInsights.core), "Make sure the appInsights core is set"); Assert.equal(theSnippet.core, theSnippet.appInsights.core, "Make sure the core instances are actually the same"); } }); this.testCase({ name: "Check cookie manager access", test: () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))) as any; let coreCookieMgr = theSnippet.core.getCookieMgr(); Assert.ok(isNotNullOrUndefined(coreCookieMgr), "Make sure the cookie manager is returned"); Assert.equal(true, coreCookieMgr.isEnabled(), "Cookies should be enabled") Assert.equal(coreCookieMgr, theSnippet.getCookieMgr(), "Make sure the cookie manager is returned"); let appInsightsCookieMgr = theSnippet.appInsights.core.getCookieMgr(); Assert.ok(isNotNullOrUndefined(appInsightsCookieMgr), "Make sure the cookie manager is returned"); Assert.equal(true, appInsightsCookieMgr.isEnabled(), "Cookies should be enabled") Assert.equal(appInsightsCookieMgr, theSnippet.getCookieMgr(), "Make sure the cookie manager is returned"); Assert.equal(coreCookieMgr, appInsightsCookieMgr, "Make sure the cookie managers are the same"); Assert.equal(true, theSnippet.getCookieMgr().isEnabled(), "Cookies should be enabled") } }); this.testCase({ name: "Check cookie manager access as disabled", test: () => { let theConfig = getSnippetConfig(this.sessionPrefix); theConfig.cfg.disableCookiesUsage = true; let theSnippet = this._initializeSnippet(snippetCreator(theConfig)) as any; let coreCookieMgr = theSnippet.core.getCookieMgr(); Assert.ok(isNotNullOrUndefined(coreCookieMgr), "Make sure the cookie manager is returned"); Assert.equal(false, coreCookieMgr.isEnabled(), "Cookies should be disabled") Assert.equal(coreCookieMgr, theSnippet.getCookieMgr(), "Make sure the cookie manager is returned"); let appInsightsCookieMgr = theSnippet.appInsights.core.getCookieMgr(); Assert.ok(isNotNullOrUndefined(appInsightsCookieMgr), "Make sure the cookie manager is returned"); Assert.equal(false, appInsightsCookieMgr.isEnabled(), "Cookies should be disabled") Assert.equal(appInsightsCookieMgr, theSnippet.getCookieMgr(), "Make sure the cookie manager is returned"); Assert.equal(coreCookieMgr, appInsightsCookieMgr, "Make sure the cookie managers are the same"); Assert.equal(false, theSnippet.getCookieMgr().isEnabled(), "Cookies should be disabled") } }); this.testCase({ name: "Check plugin version string", test: () => { let theConfig = getSnippetConfig(this.sessionPrefix); let theSnippet = this._initializeSnippet(snippetCreator(theConfig)) as any; QUnit.assert.equal(0, theSnippet.pluginVersionStringArr.length, "Checking the array length"); QUnit.assert.equal("", theSnippet.pluginVersionString); // Add a versioned plugin theSnippet.addPlugin(new TestPlugin()); QUnit.assert.equal(1, theSnippet.pluginVersionStringArr.length, "Checking the array length"); QUnit.assert.equal("TestPlugin=0.99.1", theSnippet.pluginVersionString); } }); this.addAnalyticsApiTests(snippetName, snippetCreator); this.addAsyncTests(snippetName, snippetCreator); this.addDependencyPluginTests(snippetName, snippetCreator); this.addPropertiesPluginTests(snippetName, snippetCreator); }); } public addAnalyticsApiTests(snippetName: string, snippetCreator: (config:any) => Snippet): void { this.testCase({ name: 'E2E.AnalyticsApiTests: Public Members exist', test: () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))) as any; _expectedTrackMethods.forEach(method => { Assert.ok(theSnippet[method], `${method} exists`); Assert.equal('function', typeof theSnippet[method], `${method} is a function`); }); _expectedMethodsAfterInitialization.forEach(method => { Assert.ok(theSnippet[method], `${method} does exists`); Assert.equal('function', typeof theSnippet[method], `${method} is a function`); }); } }); } public addAsyncTests(snippetName: string, snippetCreator: (config:any) => Snippet): void { this.testCaseAsync({ name: 'E2E.GenericTests: trackEvent sends to backend', stepDelay: 100, steps: [() => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); theSnippet.trackEvent({ name: 'event', properties: { "prop1": "value1" }, measurements: { "measurement1": 200 } }); }].concat(this.asserts(1)).concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data && data.baseData && data.baseData.properties["prop1"]); Assert.ok(data && data.baseData && data.baseData.measurements["measurement1"]); } }) }); this.testCaseAsync({ name: 'E2E.GenericTests: trackTrace sends to backend', stepDelay: 100, steps: [() => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); theSnippet.trackTrace({ message: 'trace', properties: { "foo": "bar", "prop2": "value2" } }); }].concat(this.asserts(1)).concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data && data.baseData && data.baseData.properties["foo"] && data.baseData.properties["prop2"]); Assert.equal("bar", data.baseData.properties["foo"]); Assert.equal("value2", data.baseData.properties["prop2"]); }) }); this.testCaseAsync({ name: 'E2E.GenericTests: trackException sends to backend', stepDelay: 100, steps: [() => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); let exception: Error = null; try { window['a']['b'](); Assert.ok(false, 'trackException test not run'); } catch (e) { exception = e; theSnippet.trackException({ exception }); } Assert.ok(exception); }].concat(this.asserts(1)) }); this.testCaseAsync({ name: 'E2E.GenericTests: legacy trackException sends to backend', stepDelay: 100, steps: [() => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); let exception: Error = null; try { window['a']['b'](); Assert.ok(false, 'trackException test not run'); } catch (e) { exception = e; theSnippet.trackException({ error: exception } as any); } Assert.ok(exception); }].concat(this.asserts(1)) }); this.testCaseAsync({ name: "TelemetryContext: track metric", stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); console.log("* calling trackMetric " + new Date().toISOString()); for (let i = 0; i < 100; i++) { theSnippet.trackMetric({ name: "test" + i, average: Math.round(100 * Math.random()) }); } console.log("* done calling trackMetric " + new Date().toISOString()); } ].concat(this.asserts(100)) }); this.testCaseAsync({ name: `TelemetryContext: track page view ${window.location.pathname}`, stepDelay: 500, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); theSnippet.trackPageView({}); // sends 2 } ] .concat(this.asserts(2)) .concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data.baseData.id, "pageView id is defined"); Assert.ok(data.baseData.id.length > 0); Assert.ok(payload.tags["ai.operation.id"]); Assert.equal(data.baseData.id, payload.tags["ai.operation.id"], "pageView id matches current operation id"); } else { Assert.ok(false, "successSpy not called"); } }) }); this.testCaseAsync({ name: "TelemetryContext: track page view performance", stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); theSnippet.trackPageViewPerformance({ name: 'name', uri: 'url' }); } ].concat(this.asserts(1)) }); this.testCaseAsync({ name: "TelemetryContext: track all types in batch", stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); let exception = null; try { window["a"]["b"](); } catch (e) { exception = e; } Assert.ok(exception); theSnippet.trackException({ exception }); theSnippet.trackMetric({ name: "test", average: Math.round(100 * Math.random()) }); theSnippet.trackTrace({ message: "test" }); theSnippet.trackPageView({}); // sends 2 theSnippet.trackPageViewPerformance({ name: 'name', uri: 'http://someurl' }); theSnippet.flush(); } ].concat(this.asserts(6)) }); this.testCaseAsync({ name: "TelemetryContext: track all types in a large batch", stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); let exception = null; try { window["a"]["b"](); } catch (e) { exception = e; } Assert.ok(exception); for (let i = 0; i < 100; i++) { theSnippet.trackException({ exception }); theSnippet.trackMetric({ name: "test", average: Math.round(100 * Math.random()) }); theSnippet.trackTrace({ message: "test" }); theSnippet.trackPageView({ name: `${i}` }); // sends 2 1st time } } ].concat(this.asserts(401, false)) }); this.testCaseAsync({ name: "TelemetryInitializer: E2E override envelope data", stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); // Setup const telemetryInitializer = { init: (envelope) => { envelope.baseData.name = 'other name' return true; } } // Act theSnippet.addTelemetryInitializer(telemetryInitializer.init); theSnippet.trackMetric({ name: "test", average: Math.round(100 * Math.random()) }); } ] .concat(this.asserts(1)) .concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { let payloadItems = payloadStr.length; Assert.equal(1, payloadItems, 'Only 1 track item is sent'); const payload = JSON.parse(payloadStr[0]); Assert.ok(payload); if (payload && payload.baseData) { const nameResult: string = payload.data.baseData.metrics[0].name; const nameExpect: string = 'other name'; Assert.equal(nameExpect, nameResult, 'telemetryinitializer override successful'); } } }) }); } public addDependencyPluginTests(snippetName: string, snippetCreator: (config:any) => Snippet): void { this.testCaseAsync({ name: "TelemetryContext: trackDependencyData", stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); const data: IDependencyTelemetry = { target: 'http://abc', responseCode: 200, type: 'GET', id: 'abc' } theSnippet.trackDependencyData(data); } ].concat(this.asserts(1)) }); if (!this.isEmulatingIe) { // If we are emulating IE then XHR is not hooked this.testCaseAsync({ name: "TelemetryContext: auto collection of ajax requests", stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); const xhr = new XMLHttpRequest(); xhr.open('GET', 'http://localhost:9001/README.md'); xhr.send(); Assert.ok(true); } ].concat(this.asserts(1)) }); } let global = getGlobal(); if (global && global.fetch && !this.isEmulatingIe) { this.testCaseAsync({ name: "DependenciesPlugin: auto collection of outgoing fetch requests " + (this.isFetchPolyfill ? " using polyfill " : ""), stepDelay: 2000, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); fetch('http://localhost:9001/README.md', { method: 'GET', headers: { 'header': 'value'} }); Assert.ok(true, "fetch monitoring is instrumented"); }, () => { fetch('http://localhost:9001/README.md', { method: 'GET' }); Assert.ok(true, "fetch monitoring is instrumented"); }, () => { fetch('http://localhost:9001/README.md'); Assert.ok(true, "fetch monitoring is instrumented"); } ] .concat(this.asserts(3, false, false)) .concat(() => { let args = []; this.trackSpy.args.forEach(call => { let message = call[0].baseData.message||""; // Ignore the internal SendBrowserInfoOnUserInit message (Only occurs when running tests in a browser) if (message.indexOf("AI (Internal): 72 ") == -1) { args.push(call[0]); } }); let type = "Fetch"; if (this.isFetchPolyfill) { type = "Ajax"; Assert.ok(true, "Using fetch polyfill"); } Assert.equal(3, args.length, "track is called 3 times"); let baseData = args[0].baseData; Assert.equal(type, baseData.type, "request is " + type + " type"); Assert.equal('value', baseData.properties.requestHeaders['header'], "fetch request's user defined request header is stored"); Assert.ok(baseData.properties.responseHeaders, "fetch request's reponse header is stored"); baseData = args[1].baseData; Assert.equal(3, Object.keys(baseData.properties.requestHeaders).length, "two request headers set up when there's no user defined request header"); Assert.ok(baseData.properties.requestHeaders[RequestHeaders.requestIdHeader], "Request-Id header"); Assert.ok(baseData.properties.requestHeaders[RequestHeaders.requestContextHeader], "Request-Context header"); Assert.ok(baseData.properties.requestHeaders[RequestHeaders.traceParentHeader], "traceparent"); Assert.ok(!baseData.properties.requestHeaders[RequestHeaders.traceStateHeader], "traceState should not be present in outbound event"); const id: string = baseData.id; const regex = id.match(/\|.{32}\..{16}\./g); Assert.ok(id.length > 0); Assert.equal(1, regex.length) Assert.equal(id, regex[0]); }) }); } else { this.testCase({ name: "DependenciesPlugin: No crash when fetch not supported", test: () => { Assert.ok(true, "fetch monitoring is correctly not instrumented") } }); } } public addPropertiesPluginTests(snippetName: string, snippetCreator: (config:any) => Snippet): void { this.testCaseAsync({ name: 'Custom Tags: allowed to send custom properties via addTelemetryInitializer', stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); theSnippet.addTelemetryInitializer((item: ITelemetryItem) => { item.tags[this.tagKeys.cloudName] = "my.custom.cloud.name"; }); theSnippet.trackEvent({ name: "Custom event via addTelemetryInitializer" }); } ] .concat(this.asserts(1, false, false)) .concat(PollingAssert.createPollingAssert(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length) { const payload = JSON.parse(payloadStr[0]); Assert.equal(1, payloadStr.length, 'Only 1 track item is sent - ' + payload.name); Assert.ok(payload); if (payload && payload.tags) { const tagResult: string = payload.tags && payload.tags[this.tagKeys.cloudName]; const tagExpect: string = 'my.custom.cloud.name'; Assert.equal(tagResult, tagExpect, 'telemetryinitializer tag override successful'); return true; } return false; } }, 'Set custom tags') as any) }); this.testCaseAsync({ name: 'Custom Tags: allowed to send custom properties via addTelemetryInitializer & shimmed addTelemetryInitializer', stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); theSnippet.addTelemetryInitializer((item: ITelemetryItem) => { item.tags.push({[this.tagKeys.cloudName]: "my.shim.cloud.name"}); }); theSnippet.trackEvent({ name: "Custom event" }); } ] .concat(this.asserts(1)) .concat(PollingAssert.createPollingAssert(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { Assert.equal(1, payloadStr.length, 'Only 1 track item is sent'); const payload = JSON.parse(payloadStr[0]); Assert.ok(payload); if (payload && payload.tags) { const tagResult: string = payload.tags && payload.tags[this.tagKeys.cloudName]; const tagExpect: string = 'my.shim.cloud.name'; Assert.equal(tagResult, tagExpect, 'telemetryinitializer tag override successful'); return true; } return false; } }, 'Set custom tags') as any) }); this.testCaseAsync({ name: 'Custom Tags: allowed to send custom properties via shimmed addTelemetryInitializer', stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); theSnippet.addTelemetryInitializer((item: ITelemetryItem) => { item.tags[this.tagKeys.cloudName] = "my.custom.cloud.name"; item.tags[this.tagKeys.locationCity] = "my.custom.location.city"; item.tags.push({[this.tagKeys.locationCountry]: "my.custom.location.country"}); item.tags.push({[this.tagKeys.operationId]: "my.custom.operation.id"}); }); theSnippet.trackEvent({ name: "Custom event via shimmed addTelemetryInitializer" }); } ] .concat(this.asserts(1)) .concat(PollingAssert.createPollingAssert(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); Assert.equal(1, payloadStr.length, 'Only 1 track item is sent - ' + payload.name); if (payloadStr.length > 1) { this.dumpPayloadMessages(this.successSpy); } Assert.ok(payload); if (payload && payload.tags) { const tagResult1: string = payload.tags && payload.tags[this.tagKeys.cloudName]; const tagExpect1: string = 'my.custom.cloud.name'; Assert.equal(tagResult1, tagExpect1, 'telemetryinitializer tag override successful'); const tagResult2: string = payload.tags && payload.tags[this.tagKeys.locationCity]; const tagExpect2: string = 'my.custom.location.city'; Assert.equal(tagResult2, tagExpect2, 'telemetryinitializer tag override successful'); const tagResult3: string = payload.tags && payload.tags[this.tagKeys.locationCountry]; const tagExpect3: string = 'my.custom.location.country'; Assert.equal(tagResult3, tagExpect3, 'telemetryinitializer tag override successful'); const tagResult4: string = payload.tags && payload.tags[this.tagKeys.operationId]; const tagExpect4: string = 'my.custom.operation.id'; Assert.equal(tagResult4, tagExpect4, 'telemetryinitializer tag override successful'); return true; } return false; } }, 'Set custom tags') as any) }); this.testCaseAsync({ name: 'AuthenticatedUserContext: setAuthenticatedUserContext authId', stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); const context = (theSnippet.context) as IPropTelemetryContext; context.user.setAuthenticatedUserContext('10001'); theSnippet.trackTrace({ message: 'authUserContext test' }); } ] .concat(this.asserts(1)) .concat(PollingAssert.createPollingAssert(() => { let payloadStr = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { let payloadEvents = payloadStr.length; let thePayload:string = payloadStr[0]; if (payloadEvents !== 1) { // Only 1 track should be sent return false; } const payload = JSON.parse(thePayload); if (payload && payload.tags) { const tagName: string = this.tagKeys.userAuthUserId; return '10001' === payload.tags[tagName]; } } return false; }, 'user.authenticatedId') as any) }); this.testCaseAsync({ name: 'AuthenticatedUserContext: setAuthenticatedUserContext authId and accountId', stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); const context = (theSnippet.context) as IPropTelemetryContext; context.user.setAuthenticatedUserContext('10001', 'account123'); theSnippet.trackTrace({ message: 'authUserContext test' }); } ] .concat(this.asserts(1)) .concat(PollingAssert.createPollingAssert(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { if (payloadStr.length !== 1) { // Only 1 track should be sent return false; } const payload = JSON.parse(payloadStr[0]); if (payload && payload.tags) { const authTag: string = this.tagKeys.userAuthUserId; const accountTag: string = this.tagKeys.userAccountId; return '10001' === payload.tags[authTag] /*&& 'account123' === payload.tags[accountTag] */; // bug https://msazure.visualstudio.com/One/_workitems/edit/3508825 } } return false; }, 'user.authenticatedId') as any) }); this.testCaseAsync({ name: 'AuthenticatedUserContext: setAuthenticatedUserContext non-ascii authId and accountId', stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); const context = (theSnippet.context) as IPropTelemetryContext; context.user.setAuthenticatedUserContext("\u0428", "\u0429"); theSnippet.trackTrace({ message: 'authUserContext test' }); } ] .concat(this.asserts(1)) .concat(PollingAssert.createPollingAssert(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { if (payloadStr.length !== 1) { // Only 1 track should be sent return false; } const payload = JSON.parse(payloadStr[0]); if (payload && payload.tags) { const authTag: string = this.tagKeys.userAuthUserId; const accountTag: string = this.tagKeys.userAccountId; return '\u0428' === payload.tags[authTag] /* && '\u0429' === payload.tags[accountTag] */; // bug https://msazure.visualstudio.com/One/_workitems/edit/3508825 } } return false; }, 'user.authenticatedId') as any) }); this.testCaseAsync({ name: 'AuthenticatedUserContext: clearAuthenticatedUserContext', stepDelay: 100, steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); const context = (theSnippet.context) as IPropTelemetryContext; context.user.setAuthenticatedUserContext('10002', 'account567'); context.user.clearAuthenticatedUserContext(); theSnippet.trackTrace({ message: 'authUserContext test' }); } ] .concat(this.asserts(1)) .concat(PollingAssert.createPollingAssert(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { if (payloadStr.length !== 1) { // Only 1 track should be sent return false; } const payload = JSON.parse(payloadStr[0]); if (payload && payload.tags) { const authTag: string = this.tagKeys.userAuthUserId; const accountTag: string = this.tagKeys.userAccountId; return undefined === payload.tags[authTag] && undefined === payload.tags[accountTag]; } } return false; }, 'user.authenticatedId') as any) }); // This doesn't need to be e2e this.testCase({ name: 'AuthenticatedUserContext: setAuthenticatedUserContext does not set the cookie by default', test: () => { // Setup let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); const context = (theSnippet.context) as IPropTelemetryContext; const authSpy: SinonSpy = this.sandbox.spy(context.user, 'setAuthenticatedUserContext'); let cookieMgr = theSnippet.getCookieMgr(); const cookieSpy: SinonSpy = this.sandbox.spy(cookieMgr, 'set'); // Act context.user.setAuthenticatedUserContext('10002', 'account567'); // Test Assert.ok(authSpy.calledOnce, 'setAuthenticatedUserContext called'); Assert.equal(false, authSpy.calledWithExactly('10001', 'account567', false), 'Correct default args to setAuthenticatedUserContext'); Assert.ok(cookieSpy.notCalled, 'cookie never set'); } }); this.testCase({ name: 'Sampling: sampleRate is generated as a field in the envelope when it is less than 100', test:() => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix, true))); theSnippet.trackEvent({ name: 'event' }); Assert.ok(this.envelopeConstructorSpy.called); const envelope = this.envelopeConstructorSpy.returnValues[0]; Assert.equal(envelope.sampleRate, 50, "sampleRate is generated"); } }) this.testCase({ name: 'Unload: unload() without parameters should return a promise', test: () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); const result = theSnippet.unload(); Assert.ok(result, "unload() should return a promise when called without parameters"); Assert.ok(isPromiseLike(result), "returned value should be promise-like"); } }); this.testCase({ name: 'Unload: unload(true) should return a promise', test: () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); const result = theSnippet.unload(true); Assert.ok(result, "unload(true) should return a promise"); Assert.ok(isPromiseLike(result), "returned value should be promise-like"); } }); this.testCase({ name: 'Unload: unload(false) should not return a promise', test: () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); const result = theSnippet.unload(false); Assert.equal(result, undefined, "unload(false) should return undefined"); } }); this.testCase({ name: 'Unload: unload with callback should not return a promise', test: () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); let callbackCalled = false; const result = theSnippet.unload(true, () => { callbackCalled = true; }); Assert.equal(result, undefined, "unload with callback should return undefined"); } }); } private _initializeSnippet(snippet: Snippet): IApplicationInsights { try { //this.useFakeServer = false; // Call the initialization ((ApplicationInsightsContainer.getAppInsights(snippet, snippet.version)) as IApplicationInsights); // Setup Sinon stuff const appInsights: AppInsightsSku = (snippet as any).appInsights; this.onDone(() => { if (snippet) { if (snippet["unload"]) { snippet["unload"](false); } else if (snippet["appInsightsNew"]) { snippet["appInsightsNew"].unload(false); } } }); Assert.ok(appInsights, "The App insights instance should be populated"); Assert.ok(appInsights.core, "The Core exists"); Assert.equal(appInsights.core, (snippet as any).core, "The core instances should match"); Assert.equal(true, (appInsights as any).isInitialized(), 'App Analytics is initialized'); Assert.equal(true, appInsights.core.isInitialized(), 'Core is initialized'); const sender: Sender = appInsights.core.getPlugin(BreezeChannelIdentifier).plugin; this.errorSpy = this.sandbox.spy(sender, '_onError'); this.successSpy = this.sandbox.spy(sender, '_onSuccess'); this.loggingSpy = this.sandbox.stub(appInsights.core.logger, 'throwInternal'); this.trackSpy = this.sandbox.spy(appInsights.core, 'track') this.sandbox.stub((sender as any)._sample, 'isSampledIn').returns(true); this.envelopeConstructorSpy = this.sandbox.spy(Sender, 'constructEnvelope'); } catch (e) { console.error('Failed to initialize'); Assert.ok(false, e); } // Note: Explicitly returning the original snippet as this should have been updated! return snippet as any; } private boilerPlateAsserts = () => { Assert.ok(this.successSpy.called, "success"); Assert.ok(!this.errorSpy.called, "no error sending"); const isValidCallCount = this.loggingSpy.callCount === 0; Assert.ok(isValidCallCount, "logging spy was called 0 time(s)"); if (!isValidCallCount) { while (this.loggingSpy.args.length) { Assert.ok(false, "[warning thrown]: " + dumpObj(this.loggingSpy.args.pop())); } } } private asserts: any = (expectedCount: number) => [() => { const message = "polling: " + new Date().toISOString(); Assert.ok(true, message); console.log(message); if (this.successSpy.called) { this.boilerPlateAsserts(); this.testCleanup(); } else if (this.errorSpy.called || this.loggingSpy.called) { this.boilerPlateAsserts(); } }, (PollingAssert.createPollingAssert(() => { Assert.ok(true, "* checking success spy " + new Date().toISOString()); if(this.successSpy.called) { let currentCount: number = 0; this.successSpy.args.forEach(call => { call[0].forEach(item => { let message = item.item; if (typeof item === "string") { message = item; } // Ignore the internal SendBrowserInfoOnUserInit message (Only occurs when running tests in a browser) if (!message || message.indexOf("AI (Internal): 72 ") == -1) { currentCount ++; //console.log(" - " + strSubstring(JSON.stringify(call), 400)); } }); }); console.log('curr: ' + currentCount + ' exp: ' + expectedCount); return currentCount === expectedCount; } else { return false; } }, "sender succeeded", 30, 500))]; } class TestPlugin extends BaseTelemetryPlugin { public identifier: string = "TestPlugin"; public version: string = "0.99.1"; constructor() { super(); } public processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext | undefined): void { itemCtx?.processNext(env); } } ================================================ FILE: AISKU/Tests/Unit/src/SpanContextPropagation.Tests.ts ================================================ import { AITestClass, Assert } from '@microsoft/ai-test-framework'; import { ApplicationInsights } from '../../../src/applicationinsights-web'; import { IReadableSpan, IDistributedTraceContext, ITelemetryItem, asString } from "@microsoft/applicationinsights-core-js"; import { createPromise, IPromise } from '@nevware21/ts-async'; export class SpanContextPropagationTests extends AITestClass { private static readonly _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; private static readonly _connectionString = `InstrumentationKey=${SpanContextPropagationTests._instrumentationKey}`; private _ai!: ApplicationInsights; private _trackCalls: ITelemetryItem[] = []; constructor(testName?: string) { super(testName || "SpanContextPropagationTests"); } public testInitialize() { try { this.useFakeServer = false; this._trackCalls = []; this._ai = new ApplicationInsights({ config: { connectionString: SpanContextPropagationTests._connectionString, disableAjaxTracking: false, disableXhr: false, maxBatchInterval: 0, disableExceptionTracking: false } }); this._ai.loadAppInsights(); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; } catch (e) { console.error('Failed to initialize tests: ' + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public registerTests() { this.addParentChildRelationshipTests(); this.addMultiLevelHierarchyTests(); this.addSiblingSpanTests(); this.addAsyncBoundaryTests(); this.addContextPropagationTests(); } private addParentChildRelationshipTests(): void { this.testCase({ name: "ParentChild: child span should inherit parent's traceId", test: () => { // Arrange const parentSpan = this._ai.startSpan("parent-span"); Assert.ok(parentSpan, "Parent span should be created"); // Act const parentContext = parentSpan!.spanContext(); const childSpan = this._ai.startSpan("child-span", undefined, parentContext); const childContext = childSpan!.spanContext(); // Assert Assert.equal(childContext.traceId, parentContext.traceId, "Child span should inherit parent's traceId"); Assert.notEqual(childContext.spanId, parentContext.spanId, "Child span should have different spanId from parent"); // Cleanup childSpan?.end(); parentSpan?.end(); } }); this.testCase({ name: "ParentChild: child span should have unique spanId", test: () => { // Arrange const parentSpan = this._ai.startSpan("parent-unique-id"); const parentContext = parentSpan!.spanContext(); // Act const child1 = this._ai.startSpan("child-1", undefined, parentContext); const child2 = this._ai.startSpan("child-2", undefined, parentContext); const child1Context = child1!.spanContext(); const child2Context = child2!.spanContext(); // Assert Assert.notEqual(child1Context.spanId, child2Context.spanId, "Sibling children should have unique spanIds"); Assert.notEqual(child1Context.spanId, parentContext.spanId, "Child 1 spanId should differ from parent"); Assert.notEqual(child2Context.spanId, parentContext.spanId, "Child 2 spanId should differ from parent"); // Cleanup child1?.end(); child2?.end(); parentSpan?.end(); } }); this.testCase({ name: "ParentChild: child spans created via getTraceCtx", test: () => { // Arrange const parentSpan = this._ai.startSpan("parent-via-getTraceCtx"); this._ai.setActiveSpan(parentSpan!); // Act - Use getTraceCtx to get current context const currentContext = this._ai.getTraceCtx(); const childSpan = this._ai.startSpan("child-via-getTraceCtx", undefined, currentContext || undefined); // Assert const parentContext = parentSpan!.spanContext(); const childContext = childSpan!.spanContext(); Assert.equal(childContext.traceId, parentContext.traceId, "Child should inherit traceId via getTraceCtx"); Assert.notEqual(childContext.spanId, parentContext.spanId, "Child should have unique spanId"); // Cleanup childSpan?.end(); parentSpan?.end(); } }); this.testCase({ name: "ParentChild: parent context should preserve traceFlags", test: () => { // Arrange const parentSpan = this._ai.startSpan("parent-traceflags"); const parentContext = parentSpan!.spanContext(); // Act const childSpan = this._ai.startSpan("child-traceflags", undefined, parentContext); const childContext = childSpan!.spanContext(); // Assert Assert.equal(childContext.traceFlags, parentContext.traceFlags, "Child should preserve parent's traceFlags"); // Cleanup childSpan?.end(); parentSpan?.end(); } }); this.testCase({ name: "ParentChild: parent context should preserve traceState if present", test: () => { // Arrange - Create parent span const parentSpan = this._ai.startSpan("parent-tracestate"); const parentContext = parentSpan!.spanContext(); // Manually set traceState (if the implementation supports it) if (parentContext.traceState !== undefined) { // Act const childSpan = this._ai.startSpan("child-tracestate", undefined, parentContext); const childContext = childSpan!.spanContext(); // Assert Assert.equal(asString(childContext.traceState), asString(parentContext.traceState), "Child should preserve parent's traceState"); // Cleanup childSpan?.end(); } parentSpan?.end(); } }); this.testCase({ name: "ParentChild: multiple children from same parent share traceId", test: () => { // Arrange const parentSpan = this._ai.startSpan("parent-multiple-children"); const parentContext = parentSpan!.spanContext(); // Act - Create multiple children const children: IReadableSpan[] = []; for (let i = 0; i < 5; i++) { const child = this._ai.startSpan(`child-${i}`, undefined, parentContext); if (child) { children.push(child); } } // Assert children.forEach((child, index) => { const childContext = child.spanContext(); Assert.equal(childContext.traceId, parentContext.traceId, `Child ${index} should have parent's traceId`); }); // All children should have unique spanIds for (let i = 0; i < children.length; i++) { for (let j = i + 1; j < children.length; j++) { const ctx1 = children[i].spanContext(); const ctx2 = children[j].spanContext(); Assert.notEqual(ctx1.spanId, ctx2.spanId, `Child ${i} and child ${j} should have different spanIds`); } } // Cleanup children.forEach(child => child.end()); parentSpan?.end(); } }); } private addMultiLevelHierarchyTests(): void { this.testCase({ name: "MultiLevel: grandchild inherits root traceId", test: () => { // Arrange & Act - Create 3-level hierarchy const rootSpan = this._ai.startSpan("root-span"); const rootContext = rootSpan!.spanContext(); const childSpan = this._ai.startSpan("child-span", undefined, rootContext); const childContext = childSpan!.spanContext(); const grandchildSpan = this._ai.startSpan("grandchild-span", undefined, childContext); const grandchildContext = grandchildSpan!.spanContext(); // Assert Assert.equal(childContext.traceId, rootContext.traceId, "Child should have root's traceId"); Assert.equal(grandchildContext.traceId, rootContext.traceId, "Grandchild should have root's traceId"); Assert.notEqual(childContext.spanId, rootContext.spanId, "Child should have unique spanId"); Assert.notEqual(grandchildContext.spanId, childContext.spanId, "Grandchild should have unique spanId"); Assert.notEqual(grandchildContext.spanId, rootContext.spanId, "Grandchild spanId should differ from root"); // Cleanup grandchildSpan?.end(); childSpan?.end(); rootSpan?.end(); } }); this.testCase({ name: "MultiLevel: deep hierarchy maintains trace consistency", test: () => { // Arrange - Create deep hierarchy (5 levels) const spans: IReadableSpan[] = []; // Act - Create root const rootSpan = this._ai.startSpan("level-0-root"); spans.push(rootSpan!); // Create nested spans for (let i = 1; i <= 4; i++) { const parentContext = spans[i - 1].spanContext(); const childSpan = this._ai.startSpan(`level-${i}`, undefined, parentContext); spans.push(childSpan!); } // Assert - All spans share same traceId const rootTraceId = spans[0].spanContext().traceId; spans.forEach((span, index) => { const context = span.spanContext(); Assert.equal(context.traceId, rootTraceId, `Level ${index} should have root traceId`); }); // All spans should have unique spanIds const spanIds = spans.map(span => span.spanContext().spanId); const uniqueSpanIds = new Set(spanIds); Assert.equal(uniqueSpanIds.size, spans.length, "All spans should have unique spanIds"); // Cleanup for (let i = spans.length - 1; i >= 0; i--) { spans[i].end(); } } }); this.testCase({ name: "MultiLevel: intermediate span can be parent to multiple children", test: () => { // Arrange - Create hierarchy with branching const rootSpan = this._ai.startSpan("root"); const rootContext = rootSpan!.spanContext(); const intermediateSpan = this._ai.startSpan("intermediate", undefined, rootContext); const intermediateContext = intermediateSpan!.spanContext(); // Act - Create multiple children from intermediate const leaf1 = this._ai.startSpan("leaf-1", undefined, intermediateContext); const leaf2 = this._ai.startSpan("leaf-2", undefined, intermediateContext); const leaf3 = this._ai.startSpan("leaf-3", undefined, intermediateContext); // Assert const leaf1Context = leaf1!.spanContext(); const leaf2Context = leaf2!.spanContext(); const leaf3Context = leaf3!.spanContext(); // All share same traceId Assert.equal(leaf1Context.traceId, rootContext.traceId, "Leaf 1 should have root traceId"); Assert.equal(leaf2Context.traceId, rootContext.traceId, "Leaf 2 should have root traceId"); Assert.equal(leaf3Context.traceId, rootContext.traceId, "Leaf 3 should have root traceId"); // All have unique spanIds Assert.notEqual(leaf1Context.spanId, leaf2Context.spanId, "Leaf 1 and 2 should have different spanIds"); Assert.notEqual(leaf2Context.spanId, leaf3Context.spanId, "Leaf 2 and 3 should have different spanIds"); Assert.notEqual(leaf1Context.spanId, leaf3Context.spanId, "Leaf 1 and 3 should have different spanIds"); // Cleanup leaf3?.end(); leaf2?.end(); leaf1?.end(); intermediateSpan?.end(); rootSpan?.end(); } }); } private addSiblingSpanTests(): void { this.testCase({ name: "Siblings: spans with same parent have same traceId", test: () => { // Arrange const parentSpan = this._ai.startSpan("parent-for-siblings"); const parentContext = parentSpan!.spanContext(); // Act - Create sibling spans const sibling1 = this._ai.startSpan("sibling-1", undefined, parentContext); const sibling2 = this._ai.startSpan("sibling-2", undefined, parentContext); const sibling3 = this._ai.startSpan("sibling-3", undefined, parentContext); // Assert const ctx1 = sibling1!.spanContext(); const ctx2 = sibling2!.spanContext(); const ctx3 = sibling3!.spanContext(); Assert.equal(ctx1.traceId, parentContext.traceId, "Sibling 1 should have parent's traceId"); Assert.equal(ctx2.traceId, parentContext.traceId, "Sibling 2 should have parent's traceId"); Assert.equal(ctx3.traceId, parentContext.traceId, "Sibling 3 should have parent's traceId"); // Cleanup sibling3?.end(); sibling2?.end(); sibling1?.end(); parentSpan?.end(); } }); this.testCase({ name: "Siblings: independent root spans have different traceIds", test: () => { // Act - Create independent root spans const root1 = this._ai.startSpan("independent-root-1", { root: true }); const root2 = this._ai.startSpan("independent-root-2", { root: true }); const root3 = this._ai.startSpan("independent-root-3", { root: true }); // Assert const ctx1 = root1!.spanContext(); const ctx2 = root2!.spanContext(); const ctx3 = root3!.spanContext(); Assert.notEqual(ctx1.traceId, ctx2.traceId, "Independent root 1 and 2 should have different traceIds"); Assert.notEqual(ctx2.traceId, ctx3.traceId, "Independent root 2 and 3 should have different traceIds"); Assert.notEqual(ctx1.traceId, ctx3.traceId, "Independent root 1 and 3 should have different traceIds"); // Cleanup root3?.end(); root2?.end(); root1?.end(); } }); this.testCase({ name: "Siblings: sibling spans have unique spanIds", test: () => { // Arrange const parentSpan = this._ai.startSpan("parent-unique-siblings"); const parentContext = parentSpan!.spanContext(); // Act - Create many sibling spans const siblings: IReadableSpan[] = []; for (let i = 0; i < 10; i++) { const sibling = this._ai.startSpan(`sibling-${i}`, undefined, parentContext); if (sibling) { siblings.push(sibling); } } // Assert - All spanIds should be unique const spanIds = siblings.map(s => s.spanContext().spanId); const uniqueSpanIds = new Set(spanIds); Assert.equal(uniqueSpanIds.size, siblings.length, "All sibling spans should have unique spanIds"); // Cleanup siblings.forEach(s => s.end()); parentSpan?.end(); } }); } private addAsyncBoundaryTests(): void { this.testCase({ name: "AsyncBoundary: context can be captured and used across async operations", test: () => { // Arrange const rootSpan = this._ai.startSpan("async-root"); const capturedContext = rootSpan!.spanContext(); // Act - Simulate async boundary by creating child later return createPromise((resolve) => { setTimeout(() => { // Create child span using captured context const childSpan = this._ai.startSpan("async-child", undefined, capturedContext); const childContext = childSpan!.spanContext(); // Assert Assert.equal(childContext.traceId, capturedContext.traceId, "Child created after async boundary should have parent's traceId"); // Cleanup childSpan?.end(); rootSpan?.end(); resolve(); }, 10); }); } }); this.testCase({ name: "AsyncBoundary: getTraceCtx can capture context for async operations", test: () => { // Arrange const rootSpan = this._ai.startSpan("async-getTraceCtx-root"); this._ai.setActiveSpan(rootSpan!); // Capture context using getTraceCtx const capturedContext = this._ai.getTraceCtx(); // Act - Simulate async operation return createPromise((resolve) => { setTimeout(() => { // Use captured context in async boundary const asyncSpan = this._ai.startSpan("async-operation", undefined, capturedContext || undefined); const asyncContext = asyncSpan!.spanContext(); // Assert Assert.equal(asyncContext.traceId, capturedContext.traceId, "Async span should inherit captured traceId"); // Cleanup asyncSpan?.end(); rootSpan?.end(); resolve(); }, 10); }); } }); this.testCase({ name: "AsyncBoundary: nested async operations maintain trace", test: () => { // Arrange const rootSpan = this._ai.startSpan("nested-async-root"); const rootContext = rootSpan!.spanContext(); // Act - Chain async operations return createPromise((resolve) => { setTimeout(() => { const child1 = this._ai.startSpan("async-child-1", undefined, rootContext); const child1Context = child1!.spanContext(); setTimeout(() => { const child2 = this._ai.startSpan("async-child-2", undefined, child1Context); const child2Context = child2!.spanContext(); // Assert Assert.equal(child1Context.traceId, rootContext.traceId, "First async child should have root traceId"); Assert.equal(child2Context.traceId, rootContext.traceId, "Second async child should have root traceId"); // Cleanup child2?.end(); child1?.end(); rootSpan?.end(); resolve(); }, 10); }, 10); }); } }); this.testCase({ name: "AsyncBoundary: parallel async operations share traceId", test: () => { // Arrange const rootSpan = this._ai.startSpan("parallel-async-root"); const rootContext = rootSpan!.spanContext(); // Act - Create parallel async operations const promises: IPromise[] = []; const childContexts: IDistributedTraceContext[] = []; for (let i = 0; i < 3; i++) { const promise = createPromise((resolve) => { setTimeout(() => { const childSpan = this._ai.startSpan(`parallel-child-${i}`, undefined, rootContext); childContexts.push(childSpan!.spanContext()); childSpan?.end(); resolve(); }, 10 + i * 5); }); promises.push(promise); } return Promise.all(promises).then(() => { // Assert - All parallel children should share root traceId childContexts.forEach((ctx, index) => { Assert.equal(ctx.traceId, rootContext.traceId, `Parallel child ${index} should have root traceId`); }); // All should have unique spanIds const spanIds = childContexts.map(ctx => ctx.spanId); const uniqueSpanIds = new Set(spanIds); Assert.equal(uniqueSpanIds.size, childContexts.length, "Parallel children should have unique spanIds"); // Cleanup rootSpan?.end(); }); } }); } private addContextPropagationTests(): void { this.testCase({ name: "ContextPropagation: explicit parent context overrides active context", test: () => { // Arrange - Create two independent traces const trace1Root = this._ai.startSpan("trace-1-root", { root: true }); const trace2Root = this._ai.startSpan("trace-2-root", { root: true }); this._ai.setActiveSpan(trace1Root!); // Act - Create child with explicit trace2 parent const trace2Context = trace2Root!.spanContext(); const childSpan = this._ai.startSpan("explicit-parent-child", undefined, trace2Context); const childContext = childSpan!.spanContext(); // Assert - Child should belong to trace2, not active trace1 Assert.equal(childContext.traceId, trace2Context.traceId, "Explicit parent context should override active context"); Assert.notEqual(childContext.traceId, trace1Root!.spanContext().traceId, "Child should not belong to active trace"); // Cleanup childSpan?.end(); trace2Root?.end(); trace1Root?.end(); } }); this.testCase({ name: "ContextPropagation: spans without parent create new trace", test: () => { // Act - Create spans without explicit parent const span1 = this._ai.startSpan("no-parent-1"); const span2 = this._ai.startSpan("no-parent-2"); const ctx1 = span1!.spanContext(); const ctx2 = span2!.spanContext(); // Assert - Should create independent traces or share active context // (depends on implementation - both are valid) Assert.ok(ctx1.traceId, "Span 1 should have traceId"); Assert.ok(ctx2.traceId, "Span 2 should have traceId"); Assert.ok(ctx1.spanId !== ctx2.spanId, "Spans should have unique spanIds"); // Cleanup span2?.end(); span1?.end(); } }); this.testCase({ name: "ContextPropagation: root option creates new trace", test: () => { // Arrange - Create parent span const parentSpan = this._ai.startSpan("existing-parent"); this._ai.setActiveSpan(parentSpan!); // Act - Create root span (should ignore active parent) const rootSpan = this._ai.startSpan("new-root", { root: true }); const parentContext = parentSpan!.spanContext(); const rootContext = rootSpan!.spanContext(); // Assert - Root span should have different traceId Assert.notEqual(rootContext.traceId, parentContext.traceId, "Root option should create new independent trace"); // Cleanup rootSpan?.end(); parentSpan?.end(); } }); this.testCase({ name: "ContextPropagation: context with all required fields propagates correctly", test: () => { // Arrange - Create context with all fields const parentSpan = this._ai.startSpan("full-context-parent"); const parentContext = parentSpan!.spanContext(); // Act - Create child const childSpan = this._ai.startSpan("full-context-child", undefined, parentContext); const childContext = childSpan!.spanContext(); // Assert - All fields should be present Assert.ok(childContext.traceId, "Child should have traceId"); Assert.ok(childContext.spanId, "Child should have spanId"); Assert.equal(childContext.traceFlags, parentContext.traceFlags, "Child should have traceFlags"); Assert.equal(childContext.traceId, parentContext.traceId, "TraceId should propagate"); Assert.equal(childContext.traceFlags, parentContext.traceFlags, "TraceFlags should propagate"); // Cleanup childSpan?.end(); parentSpan?.end(); } }); this.testCase({ name: "ContextPropagation: recording attribute propagates independently", test: () => { // Arrange - Create recording parent const recordingParent = this._ai.startSpan("recording-parent", { recording: true }); const recordingContext = recordingParent!.spanContext(); // Act - Create non-recording child from recording parent const nonRecordingChild = this._ai.startSpan("non-recording-child", { recording: false }, recordingContext); // Assert - Recording is per-span, not propagated Assert.ok(recordingParent!.isRecording(), "Parent should be recording"); Assert.ok(!nonRecordingChild!.isRecording(), "Child should not be recording despite recording parent"); // But traceId should still propagate Assert.equal(nonRecordingChild!.spanContext().traceId, recordingContext.traceId, "TraceId should propagate regardless of recording state"); // Cleanup nonRecordingChild?.end(); recordingParent?.end(); } }); this.testCase({ name: "ContextPropagation: span attributes do not propagate to children", test: () => { // Arrange - Create parent with attributes const parentAttrs = { "parent.attr1": "value1", "parent.attr2": "value2" }; const parentSpan = this._ai.startSpan("parent-with-attrs", { attributes: parentAttrs }); const parentContext = parentSpan!.spanContext(); // Act - Create child with different attributes const childAttrs = { "child.attr1": "childValue1" }; const childSpan = this._ai.startSpan("child-with-attrs", { attributes: childAttrs }, parentContext); // Assert - Attributes are per-span, not inherited Assert.ok(parentSpan!.attributes["parent.attr1"] === "value1", "Parent should have its attributes"); Assert.ok(childSpan!.attributes["child.attr1"] === "childValue1", "Child should have its attributes"); Assert.ok(!childSpan!.attributes["parent.attr1"], "Child should not inherit parent's attributes"); // But context should propagate Assert.equal(childSpan!.spanContext().traceId, parentContext.traceId, "TraceId should propagate"); // Cleanup childSpan?.end(); parentSpan?.end(); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/SpanE2E.Tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { ApplicationInsights } from "../../../src/applicationinsights-web"; import { eOTelSpanKind, eOTelSpanStatusCode } from "@microsoft/applicationinsights-core-js"; /** * E2E Tests for Span APIs that send real telemetry to Breeze endpoint * * These tests can be run manually to verify telemetry appears correctly in the Azure Portal: * 1. Set MANUAL_E2E_TEST to true * 2. Replace the instrumentationKey with a valid test iKey * 3. Run the tests * 4. Check the Azure Portal for the telemetry within 1-2 minutes * * Look for: * - Dependencies in the "Performance" blade * - Requests in the "Performance" blade * - Custom properties and measurements * - Distributed trace correlation * - End-to-end transaction view */ export class SpanE2ETests extends AITestClass { // Set to true to actually send telemetry to Breeze for manual validation private static readonly MANUAL_E2E_TEST = false; // Replace with your test instrumentation key for manual E2E testing private static readonly _instrumentationKey = "b7170927-2d1c-44f1-acec-59f4e1751c11"; private static readonly _connectionString = `InstrumentationKey=${SpanE2ETests._instrumentationKey}`; private _ai!: ApplicationInsights; constructor(testName?: string) { super(testName || "SpanE2ETests"); } public testInitialize() { try { this.useFakeServer = !SpanE2ETests.MANUAL_E2E_TEST; this._ai = new ApplicationInsights({ config: { connectionString: SpanE2ETests._connectionString, disableAjaxTracking: false, disableXhr: false, disableFetchTracking: false, enableAutoRouteTracking: true, disableExceptionTracking: false, maxBatchInterval: 1000, // Send quickly for manual testing enableDebug: true, loggingLevelConsole: 2 // Show warnings and errors } }); this._ai.loadAppInsights(); if (SpanE2ETests.MANUAL_E2E_TEST) { console.log("=== MANUAL E2E TEST MODE ==="); console.log("Telemetry will be sent to Breeze endpoint"); console.log("Check Azure Portal in 1-2 minutes"); console.log("Instrumentation Key:", SpanE2ETests._instrumentationKey); console.log("============================"); } } catch (e) { console.error("Failed to initialize tests: " + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { // Flush any pending telemetry before cleanup this._ai.flush(); this._ai.unload(false); } } public registerTests() { this.addE2EBasicSpanTests(); this.addE2EDistributedTraceTests(); this.addE2EHttpDependencyTests(); this.addE2EDatabaseDependencyTests(); this.addE2EComplexScenarioTests(); } private addE2EBasicSpanTests(): void { this.testCase({ name: "E2E: Basic CLIENT span creates RemoteDependency in portal", test: () => { // This will appear in the Azure Portal under Performance -> Dependencies const span = this._ai.startSpan("E2E-BasicClientSpan", { kind: eOTelSpanKind.CLIENT, attributes: { "test.scenario": "basic-client", "test.timestamp": new Date().toISOString(), "test.type": "manual-validation", "custom.property": "This should appear in custom properties" } }); // Simulate some work if (span) { span.setAttribute("work.completed", true); span.setStatus({ code: eOTelSpanStatusCode.OK }); span.end(); } // Flush to ensure it's sent this._ai.flush(); Assert.ok(span, "Span should be created"); if (SpanE2ETests.MANUAL_E2E_TEST) { console.log("✓ Basic CLIENT span sent - Check Azure Portal Dependencies"); } } }); this.testCase({ name: "E2E: Basic SERVER span creates Request in portal", test: () => { // This will appear in the Azure Portal under Performance -> Requests const span = this._ai.startSpan("E2E-BasicServerSpan", { kind: eOTelSpanKind.SERVER, attributes: { "http.method": "POST", "http.url": "https://example.com/api/test", "http.status_code": 200, "test.scenario": "basic-server", "test.timestamp": new Date().toISOString() } }); if (span) { span.setStatus({ code: eOTelSpanStatusCode.OK }); span.end(); } this._ai.flush(); Assert.ok(span, "Span should be created"); if (SpanE2ETests.MANUAL_E2E_TEST) { console.log("✓ Basic SERVER span sent - Check Azure Portal Requests"); } } }); this.testCase({ name: "E2E: Failed span shows as error in portal", test: () => { const span = this._ai.startSpan("E2E-FailedOperation", { kind: eOTelSpanKind.CLIENT, attributes: { "test.scenario": "failure-case", "test.timestamp": new Date().toISOString() } }); if (span) { // Simulate a failure span.setAttribute("error.type", "TimeoutError"); span.setAttribute("error.message", "Operation timed out after 5000ms"); span.setStatus({ code: eOTelSpanStatusCode.ERROR, message: "Operation failed due to timeout" }); span.end(); } this._ai.flush(); Assert.ok(span, "Span should be created"); if (SpanE2ETests.MANUAL_E2E_TEST) { console.log("✓ Failed span sent - Should show success=false in portal"); } } }); } private addE2EDistributedTraceTests(): void { this.testCase({ name: "E2E: Parent-child span relationship visible in portal", test: () => { // Create parent span const parentSpan = this._ai.startSpan("E2E-ParentOperation", { kind: eOTelSpanKind.SERVER, attributes: { "test.scenario": "distributed-trace", "test.timestamp": new Date().toISOString(), "operation.level": "parent" } }); const parentContext = parentSpan?.spanContext(); // Create child span with explicit parent const childSpan1 = this._ai.startSpan("E2E-ChildOperation1", { kind: eOTelSpanKind.CLIENT, attributes: { "operation.level": "child", "child.index": 1 } }, parentContext); if (childSpan1) { childSpan1.setAttribute("http.url", "https://api.example.com/users"); childSpan1.setAttribute("http.method", "GET"); childSpan1.setStatus({ code: eOTelSpanStatusCode.OK }); childSpan1.end(); } // Create another child const childSpan2 = this._ai.startSpan("E2E-ChildOperation2", { kind: eOTelSpanKind.CLIENT, attributes: { "operation.level": "child", "child.index": 2 } }, parentContext); if (childSpan2) { childSpan2.setAttribute("http.url", "https://api.example.com/orders"); childSpan2.setAttribute("http.method", "POST"); childSpan2.setStatus({ code: eOTelSpanStatusCode.OK }); childSpan2.end(); } // End parent if (parentSpan) { parentSpan.setAttribute("children.count", 2); parentSpan.setStatus({ code: eOTelSpanStatusCode.OK }); parentSpan.end(); } this._ai.flush(); Assert.ok(parentSpan && childSpan1 && childSpan2, "All spans should be created"); if (SpanE2ETests.MANUAL_E2E_TEST) { console.log("✓ Distributed trace sent - Check End-to-End Transaction view"); console.log(" Parent operation.id:", parentContext?.traceId); } } }); this.testCase({ name: "E2E: Nested span hierarchy (3 levels) visible in portal", test: () => { // Level 1: Root const rootSpan = this._ai.startSpan("E2E-RootOperation", { kind: eOTelSpanKind.SERVER, attributes: { "test.scenario": "nested-hierarchy", "test.timestamp": new Date().toISOString(), "span.level": 1 } }); const rootContext = rootSpan?.spanContext(); // Level 2: Child const level2Span = this._ai.startSpan("E2E-Level2Operation", { kind: eOTelSpanKind.INTERNAL, attributes: { "span.level": 2 } }, rootContext); const level2Context = level2Span?.spanContext(); // Level 3: Grandchild const level3Span = this._ai.startSpan("E2E-Level3Operation", { kind: eOTelSpanKind.CLIENT, attributes: { "span.level": 3, "http.url": "https://api.example.com/deep-call" } }, level2Context); // End in reverse order (child first, parent last) if (level3Span) { level3Span.setStatus({ code: eOTelSpanStatusCode.OK }); level3Span.end(); } if (level2Span) { level2Span.setStatus({ code: eOTelSpanStatusCode.OK }); level2Span.end(); } if (rootSpan) { rootSpan.setStatus({ code: eOTelSpanStatusCode.OK }); rootSpan.end(); } this._ai.flush(); Assert.ok(rootSpan && level2Span && level3Span, "All spans should be created"); if (SpanE2ETests.MANUAL_E2E_TEST) { console.log("✓ 3-level nested trace sent - Check transaction timeline"); } } }); } private addE2EHttpDependencyTests(): void { this.testCase({ name: "E2E: HTTP dependency with full details in portal", test: () => { const span = this._ai.startSpan("E2E-HTTPDependency", { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "POST", "http.url": "https://api.example.com/v1/users/create", "http.status_code": 201, "http.request.header.content-type": "application/json", "http.response.header.content-length": "1234", "test.scenario": "http-dependency", "test.timestamp": new Date().toISOString(), "request.body.size": 512, "response.time.ms": 145 } }); if (span) { span.setStatus({ code: eOTelSpanStatusCode.OK }); span.end(); } this._ai.flush(); Assert.ok(span, "Span should be created"); if (SpanE2ETests.MANUAL_E2E_TEST) { console.log("✓ HTTP dependency sent - Check Dependencies with full HTTP details"); } } }); this.testCase({ name: "E2E: HTTP dependency with various status codes in portal", test: () => { const statusCodes = [200, 201, 204, 400, 401, 403, 404, 500, 502, 503]; for (const statusCode of statusCodes) { const isSuccess = statusCode >= 200 && statusCode < 400; const span = this._ai.startSpan(`E2E-HTTP-${statusCode}`, { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "GET", "http.url": `https://api.example.com/status/${statusCode}`, "http.status_code": statusCode, "test.scenario": "http-status-codes", "test.timestamp": new Date().toISOString() } }); if (span) { span.setStatus({ code: isSuccess ? eOTelSpanStatusCode.OK : eOTelSpanStatusCode.ERROR }); span.end(); } } this._ai.flush(); if (SpanE2ETests.MANUAL_E2E_TEST) { console.log("✓ Multiple HTTP status codes sent - Check success/failure in portal"); } Assert.ok(true, "Multiple status codes tested"); } }); } private addE2EDatabaseDependencyTests(): void { this.testCase({ name: "E2E: Database dependencies appear in portal", test: () => { const databases = [ { system: "mysql", statement: "SELECT * FROM users WHERE id = ?", name: "production_db" }, { system: "postgresql", statement: "INSERT INTO logs (message, level) VALUES ($1, $2)", name: "logs_db" }, { system: "mongodb", statement: "db.products.find({category: 'electronics'})", name: "catalog_db" }, { system: "redis", statement: "GET user:session:abc123", name: "cache_db" }, { system: "mssql", statement: "EXEC sp_GetUserOrders @UserId=123", name: "orders_db" } ]; for (const db of databases) { const span = this._ai.startSpan(`E2E-DB-${db.system}`, { kind: eOTelSpanKind.CLIENT, attributes: { "db.system": db.system, "db.statement": db.statement, "db.name": db.name, "db.user": "app_user", "net.peer.name": `${db.system}.example.com`, "net.peer.port": 5432, "test.scenario": "database-dependencies", "test.timestamp": new Date().toISOString() } }); if (span) { span.setAttribute("db.rows.affected", 42); span.setAttribute("db.duration.ms", 23); span.setStatus({ code: eOTelSpanStatusCode.OK }); span.end(); } } this._ai.flush(); if (SpanE2ETests.MANUAL_E2E_TEST) { console.log("✓ Database dependencies sent - Check Dependencies for SQL/NoSQL types"); } Assert.ok(true, "Database dependencies tested"); } }); this.testCase({ name: "E2E: Database slow query marked appropriately", test: () => { const span = this._ai.startSpan("E2E-SlowDatabaseQuery", { kind: eOTelSpanKind.CLIENT, attributes: { "db.system": "postgresql", "db.statement": "SELECT * FROM orders JOIN users ON orders.user_id = users.id WHERE created_at > NOW() - INTERVAL '30 days'", "db.name": "analytics_db", "test.scenario": "slow-query", "test.timestamp": new Date().toISOString(), "db.query.execution.plan": "SeqScan on orders (cost=0.00..1000.00 rows=10000)", "db.slow.query": true, "db.duration.ms": 5432 } }); if (span) { // Mark as warning (not error, but slow) span.setStatus({ code: eOTelSpanStatusCode.OK }); span.setAttribute("performance.warning", "Query exceeded 1000ms threshold"); span.end(); } this._ai.flush(); Assert.ok(span, "Slow query span created"); if (SpanE2ETests.MANUAL_E2E_TEST) { console.log("✓ Slow database query sent - Check duration in portal"); } } }); } private addE2EComplexScenarioTests(): void { this.testCase({ name: "E2E: Complex e-commerce checkout scenario in portal", test: () => { // Simulate a complete e-commerce checkout flow with multiple dependencies const timestamp = new Date().toISOString(); // 1. Initial checkout request const checkoutSpan = this._ai.startSpan("E2E-CheckoutRequest", { kind: eOTelSpanKind.SERVER, attributes: { "test.scenario": "complex-ecommerce", "test.timestamp": timestamp, "http.method": "POST", "http.url": "https://shop.example.com/api/checkout", "http.status_code": 200, "user.id": "user_12345", "cart.items.count": 3, "cart.total.amount": 299.97 } }); const checkoutContext = checkoutSpan?.spanContext(); // 2. Validate inventory const inventorySpan = this._ai.startSpan("E2E-ValidateInventory", { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "POST", "http.url": "https://inventory-api.example.com/validate", "http.status_code": 200, "items.validated": 3 } }, checkoutContext); if (inventorySpan) { inventorySpan.setStatus({ code: eOTelSpanStatusCode.OK }); inventorySpan.end(); } // 3. Calculate shipping const shippingSpan = this._ai.startSpan("E2E-CalculateShipping", { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "POST", "http.url": "https://shipping-api.example.com/calculate", "http.status_code": 200, "shipping.method": "express", "shipping.cost": 15.99 } }, checkoutContext); if (shippingSpan) { shippingSpan.setStatus({ code: eOTelSpanStatusCode.OK }); shippingSpan.end(); } // 4. Process payment const paymentSpan = this._ai.startSpan("E2E-ProcessPayment", { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "POST", "http.url": "https://payments.example.com/charge", "http.status_code": 200, "payment.method": "credit_card", "payment.amount": 315.96, "payment.currency": "USD" } }, checkoutContext); if (paymentSpan) { paymentSpan.setAttribute("payment.processor", "stripe"); paymentSpan.setAttribute("payment.transaction.id", "txn_abc123xyz"); paymentSpan.setStatus({ code: eOTelSpanStatusCode.OK }); paymentSpan.end(); } // 5. Create order in database const createOrderSpan = this._ai.startSpan("E2E-CreateOrder", { kind: eOTelSpanKind.CLIENT, attributes: { "db.system": "postgresql", "db.statement": "INSERT INTO orders (user_id, total, status) VALUES ($1, $2, $3) RETURNING id", "db.name": "orders_db", "db.operation": "INSERT" } }, checkoutContext); if (createOrderSpan) { createOrderSpan.setAttribute("order.id", "ord_98765"); createOrderSpan.setStatus({ code: eOTelSpanStatusCode.OK }); createOrderSpan.end(); } // 6. Send confirmation email const emailSpan = this._ai.startSpan("E2E-SendConfirmationEmail", { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "POST", "http.url": "https://email-service.example.com/send", "http.status_code": 202, "email.recipient": "user@example.com", "email.template": "order-confirmation" } }, checkoutContext); if (emailSpan) { emailSpan.setStatus({ code: eOTelSpanStatusCode.OK }); emailSpan.end(); } // 7. Update cache const cacheSpan = this._ai.startSpan("E2E-UpdateCache", { kind: eOTelSpanKind.CLIENT, attributes: { "db.system": "redis", "db.statement": "SET user:12345:last_order ord_98765 EX 86400", "cache.operation": "set", "cache.key": "user:12345:last_order" } }, checkoutContext); if (cacheSpan) { cacheSpan.setStatus({ code: eOTelSpanStatusCode.OK }); cacheSpan.end(); } // Complete checkout if (checkoutSpan) { checkoutSpan.setAttribute("checkout.status", "completed"); checkoutSpan.setAttribute("order.id", "ord_98765"); checkoutSpan.setAttribute("dependencies.count", 7); checkoutSpan.setStatus({ code: eOTelSpanStatusCode.OK }); checkoutSpan.end(); } this._ai.flush(); Assert.ok(checkoutSpan, "Checkout span created"); if (SpanE2ETests.MANUAL_E2E_TEST) { console.log("✓ Complex e-commerce scenario sent"); console.log(" Trace ID:", checkoutContext?.traceId); console.log(" Check End-to-End Transaction view for complete flow"); console.log(" Expected: 1 Request + 7 Dependencies"); } } }); this.testCase({ name: "E2E: Mixed success and failure scenario in portal", test: () => { const timestamp = new Date().toISOString(); // Parent operation const operationSpan = this._ai.startSpan("E2E-MixedResultsOperation", { kind: eOTelSpanKind.SERVER, attributes: { "test.scenario": "mixed-success-failure", "test.timestamp": timestamp } }); const operationContext = operationSpan?.spanContext(); // Successful child 1 const successSpan1 = this._ai.startSpan("E2E-SuccessfulCall1", { kind: eOTelSpanKind.CLIENT, attributes: { "http.url": "https://api.example.com/service1", "http.status_code": 200 } }, operationContext); if (successSpan1) { successSpan1.setStatus({ code: eOTelSpanStatusCode.OK }); successSpan1.end(); } // Failed child const failedSpan = this._ai.startSpan("E2E-FailedCall", { kind: eOTelSpanKind.CLIENT, attributes: { "http.url": "https://api.example.com/service2", "http.status_code": 503 } }, operationContext); if (failedSpan) { failedSpan.setAttribute("error.type", "ServiceUnavailable"); failedSpan.setAttribute("retry.count", 3); failedSpan.setStatus({ code: eOTelSpanStatusCode.ERROR, message: "Service temporarily unavailable" }); failedSpan.end(); } // Successful child 2 (after retry) const successSpan2 = this._ai.startSpan("E2E-SuccessfulCall2", { kind: eOTelSpanKind.CLIENT, attributes: { "http.url": "https://api.example.com/service3", "http.status_code": 200 } }, operationContext); if (successSpan2) { successSpan2.setStatus({ code: eOTelSpanStatusCode.OK }); successSpan2.end(); } // Parent partially successful if (operationSpan) { operationSpan.setAttribute("successful.calls", 2); operationSpan.setAttribute("failed.calls", 1); operationSpan.setAttribute("total.calls", 3); operationSpan.setStatus({ code: eOTelSpanStatusCode.OK }); operationSpan.end(); } this._ai.flush(); Assert.ok(operationSpan, "Operation span created"); if (SpanE2ETests.MANUAL_E2E_TEST) { console.log("✓ Mixed success/failure scenario sent"); console.log(" Check for 2 successful + 1 failed dependency in transaction"); } } }); this.testCase({ name: "E2E: Span with rich custom properties for portal search", test: () => { const span = this._ai.startSpan("E2E-RichProperties", { kind: eOTelSpanKind.SERVER, attributes: { "test.scenario": "rich-properties", "test.timestamp": new Date().toISOString(), // Business context "business.tenant": "acme-corp", "business.region": "us-west-2", "business.environment": "production", // User context "user.id": "user_12345", "user.email": "test@example.com", "user.subscription": "premium", "user.account.age.days": 456, // Request context "request.id": "req_abc123", "request.source": "web-app", "request.version": "v2.3.1", // Performance metrics "performance.db.queries": 5, "performance.cache.hits": 3, "performance.cache.misses": 2, "performance.total.ms": 234, // Feature flags "feature.new.checkout": true, "feature.ab.test.group": "variant-b", // Custom measurements "metrics.items.processed": 42, "metrics.data.size.kb": 128 } }); if (span) { span.setStatus({ code: eOTelSpanStatusCode.OK }); span.end(); } this._ai.flush(); Assert.ok(span, "Span with rich properties created"); if (SpanE2ETests.MANUAL_E2E_TEST) { console.log("✓ Span with rich properties sent"); console.log(" Use Application Insights search to filter by custom properties"); console.log(" Example queries:"); console.log(" - customDimensions.business.tenant == 'acme-corp'"); console.log(" - customDimensions.user.subscription == 'premium'"); console.log(" - customDimensions.feature.new.checkout == true"); } } }); } } ================================================ FILE: AISKU/Tests/Unit/src/SpanErrorHandling.Tests.ts ================================================ import { AITestClass, Assert } from '@microsoft/ai-test-framework'; import { ApplicationInsights } from '../../../src/applicationinsights-web'; import { IReadableSpan, eOTelSpanStatusCode, ITelemetryItem } from "@microsoft/applicationinsights-core-js"; export class SpanErrorHandlingTests extends AITestClass { private static readonly _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; private static readonly _connectionString = `InstrumentationKey=${SpanErrorHandlingTests._instrumentationKey}`; private _ai!: ApplicationInsights; private _trackCalls: ITelemetryItem[] = []; constructor(testName?: string) { super(testName || "SpanErrorHandlingTests"); } public testInitialize() { try { this.useFakeServer = false; this._trackCalls = []; this._ai = new ApplicationInsights({ config: { connectionString: SpanErrorHandlingTests._connectionString, disableAjaxTracking: false, disableXhr: false, maxBatchInterval: 0, disableExceptionTracking: false } }); this._ai.loadAppInsights(); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; } catch (e) { console.error('Failed to initialize tests: ' + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public registerTests() { this.addInvalidSpanNameTests(); this.addInvalidAttributeTests(); this.addNullUndefinedInputTests(); this.addInvalidParentContextTests(); this.addInvalidOptionsTests(); this.addEdgeCaseTests(); } private addInvalidSpanNameTests(): void { this.testCase({ name: "SpanName: empty string name should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan(""); span?.end(); }, "Empty string name should not throw"); } }); this.testCase({ name: "SpanName: null name should handle gracefully", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan(null as any); span?.end(); }, "Null name should not throw"); } }); this.testCase({ name: "SpanName: undefined name should handle gracefully", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan(undefined as any); span?.end(); }, "Undefined name should not throw"); } }); this.testCase({ name: "SpanName: very long name should be accepted", test: () => { // Arrange const longName = "a".repeat(10000); // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan(longName); Assert.ok(span, "Should create span with long name"); span?.end(); }, "Very long name should not throw"); } }); this.testCase({ name: "SpanName: special characters in name should be accepted", test: () => { // Arrange const specialNames = [ "span-with-dashes", "span_with_underscores", "span.with.dots", "span/with/slashes", "span:with:colons", "span@with@at", "span#with#hash", "span$with$dollar" ]; // Act & Assert specialNames.forEach(name => { Assert.doesNotThrow(() => { const span = this._ai.startSpan(name); span?.end(); }, `Special character name '${name}' should not throw`); }); } }); } private addInvalidAttributeTests(): void { this.testCase({ name: "Attributes: null attribute value should not throw", test: () => { // Arrange const span = this._ai.startSpan("null-attribute-test"); // Act & Assert Assert.doesNotThrow(() => { span?.setAttribute("nullable.attr", null); }, "Setting null attribute should not throw"); // Cleanup span?.end(); } }); this.testCase({ name: "Attributes: undefined attribute value should not throw", test: () => { // Arrange const span = this._ai.startSpan("undefined-attribute-test"); // Act & Assert Assert.doesNotThrow(() => { span?.setAttribute("undefined.attr", undefined); }, "Setting undefined attribute should not throw"); // Cleanup span?.end(); } }); this.testCase({ name: "Attributes: empty string attribute key should not throw", test: () => { // Arrange const span = this._ai.startSpan("empty-key-test"); // Act & Assert Assert.doesNotThrow(() => { span?.setAttribute("", "value"); }, "Empty string key should not throw"); // Cleanup span?.end(); } }); this.testCase({ name: "Attributes: null attribute key should not throw", test: () => { // Arrange const span = this._ai.startSpan("null-key-test"); // Act & Assert Assert.doesNotThrow(() => { span?.setAttribute(null as any, "value"); }, "Null key should not throw"); // Cleanup span?.end(); } }); this.testCase({ name: "Attributes: undefined attribute key should not throw", test: () => { // Arrange const span = this._ai.startSpan("undefined-key-test"); // Act & Assert Assert.doesNotThrow(() => { span?.setAttribute(undefined as any, "value"); }, "Undefined key should not throw"); // Cleanup span?.end(); } }); this.testCase({ name: "Attributes: invalid attribute value types should not throw", test: () => { // Arrange const span = this._ai.startSpan("invalid-type-test"); // Act & Assert - Test various invalid types Assert.doesNotThrow(() => { span?.setAttribute("object.attr", { nested: "object" } as any); span?.setAttribute("array.attr", [1, 2, 3] as any); span?.setAttribute("function.attr", (() => {}) as any); span?.setAttribute("symbol.attr", Symbol("test") as any); }, "Invalid attribute types should not throw"); // Cleanup span?.end(); } }); this.testCase({ name: "Attributes: setAttributes with null should not throw", test: () => { // Arrange const span = this._ai.startSpan("setAttributes-null-test"); // Act & Assert Assert.doesNotThrow(() => { span?.setAttributes(null as any); }, "setAttributes with null should not throw"); // Cleanup span?.end(); } }); this.testCase({ name: "Attributes: setAttributes with undefined should not throw", test: () => { // Arrange const span = this._ai.startSpan("setAttributes-undefined-test"); // Act & Assert Assert.doesNotThrow(() => { span?.setAttributes(undefined as any); }, "setAttributes with undefined should not throw"); // Cleanup span?.end(); } }); this.testCase({ name: "Attributes: setAttributes with invalid object should not throw", test: () => { // Arrange const span = this._ai.startSpan("setAttributes-invalid-test"); // Act & Assert Assert.doesNotThrow(() => { span?.setAttributes({ "valid": "value", "null.value": null, "undefined.value": undefined, "object.value": { nested: "obj" } as any }); }, "setAttributes with mixed valid/invalid should not throw"); // Cleanup span?.end(); } }); } private addNullUndefinedInputTests(): void { this.testCase({ name: "NullUndefined: startSpan with null options should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("null-options-test", null as any); span?.end(); }, "Null options should not throw"); } }); this.testCase({ name: "NullUndefined: startSpan with undefined options should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("undefined-options-test", undefined); span?.end(); }, "Undefined options should not throw"); } }); this.testCase({ name: "NullUndefined: setStatus with null should not throw", test: () => { // Arrange const span = this._ai.startSpan("null-status-test"); // Act & Assert Assert.doesNotThrow(() => { span?.setStatus(null as any); }, "setStatus with null should not throw"); // Cleanup span?.end(); } }); this.testCase({ name: "NullUndefined: setStatus with undefined should not throw", test: () => { // Arrange const span = this._ai.startSpan("undefined-status-test"); // Act & Assert Assert.doesNotThrow(() => { span?.setStatus(undefined as any); }, "setStatus with undefined should not throw"); // Cleanup span?.end(); } }); this.testCase({ name: "NullUndefined: updateName with null should not throw", test: () => { // Arrange const span = this._ai.startSpan("null-name-update-test"); // Act & Assert Assert.doesNotThrow(() => { span?.updateName(null as any); }, "updateName with null should not throw"); // Cleanup span?.end(); } }); this.testCase({ name: "NullUndefined: updateName with undefined should not throw", test: () => { // Arrange const span = this._ai.startSpan("undefined-name-update-test"); // Act & Assert Assert.doesNotThrow(() => { span?.updateName(undefined as any); }, "updateName with undefined should not throw"); // Cleanup span?.end(); } }); this.testCase({ name: "NullUndefined: end with null time should not throw", test: () => { // Arrange const span = this._ai.startSpan("null-end-time-test"); // Act & Assert Assert.doesNotThrow(() => { span?.end(null as any); }, "end with null time should not throw"); } }); this.testCase({ name: "NullUndefined: end with undefined time should not throw", test: () => { // Arrange const span = this._ai.startSpan("undefined-end-time-test"); // Act & Assert Assert.doesNotThrow(() => { span?.end(undefined); }, "end with undefined time should not throw"); } }); this.testCase({ name: "NullUndefined: recordException with null should not throw", test: () => { // Arrange const span = this._ai.startSpan("null-exception-test"); // Act & Assert Assert.doesNotThrow(() => { span?.recordException(null as any); }, "recordException with null should not throw"); // Cleanup span?.end(); } }); this.testCase({ name: "NullUndefined: recordException with undefined should not throw", test: () => { // Arrange const span = this._ai.startSpan("undefined-exception-test"); // Act & Assert Assert.doesNotThrow(() => { span?.recordException(undefined as any); }, "recordException with undefined should not throw"); // Cleanup span?.end(); } }); } private addInvalidParentContextTests(): void { this.testCase({ name: "ParentContext: null parent context should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("null-parent-test", undefined, null as any); span?.end(); }, "Null parent context should not throw"); } }); this.testCase({ name: "ParentContext: undefined parent context should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("undefined-parent-test", undefined, undefined); span?.end(); }, "Undefined parent context should not throw"); } }); this.testCase({ name: "ParentContext: invalid parent context object should not throw", test: () => { // Arrange - Create invalid context objects const invalidContexts = [ {}, { traceId: "invalid" }, { spanId: "invalid" }, { traceId: "", spanId: "" }, { traceId: "123", spanId: "456" } // Too short ]; // Act & Assert invalidContexts.forEach((ctx, index) => { Assert.doesNotThrow(() => { const span = this._ai.startSpan(`invalid-context-${index}`, undefined, ctx as any); span?.end(); }, `Invalid context ${index} should not throw`); }); } }); this.testCase({ name: "ParentContext: parent context with missing fields should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("missing-fields-test", undefined, { traceId: "12345678901234567890123456789012" // Missing spanId and traceFlags } as any); span?.end(); }, "Parent context with missing fields should not throw"); } }); this.testCase({ name: "ParentContext: parent context with wrong types should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("wrong-types-test", undefined, { traceId: 123456789, // Should be string spanId: 987654321, // Should be string traceFlags: "invalid" // Should be number } as any); span?.end(); }, "Parent context with wrong types should not throw"); } }); } private addInvalidOptionsTests(): void { this.testCase({ name: "Options: invalid kind value should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("invalid-kind-test", { kind: 999 as any // Invalid kind value }); span?.end(); }, "Invalid kind value should not throw"); } }); this.testCase({ name: "Options: negative kind value should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("negative-kind-test", { kind: -1 as any }); span?.end(); }, "Negative kind value should not throw"); } }); this.testCase({ name: "Options: null attributes in options should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("null-attrs-options-test", { attributes: null as any }); span?.end(); }, "Null attributes in options should not throw"); } }); this.testCase({ name: "Options: undefined attributes in options should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("undefined-attrs-options-test", { attributes: undefined }); span?.end(); }, "Undefined attributes in options should not throw"); } }); this.testCase({ name: "Options: invalid startTime should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("invalid-starttime-test", { startTime: "invalid" as any }); span?.end(); }, "Invalid startTime should not throw"); } }); this.testCase({ name: "Options: negative startTime should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("negative-starttime-test", { startTime: -1000 }); span?.end(); }, "Negative startTime should not throw"); } }); this.testCase({ name: "Options: future startTime should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("future-starttime-test", { startTime: Date.now() + 1000000 }); span?.end(); }, "Future startTime should not throw"); } }); this.testCase({ name: "Options: multiple invalid options should not throw", test: () => { // Act & Assert Assert.doesNotThrow(() => { const span = this._ai.startSpan("multi-invalid-options-test", { kind: -999 as any, attributes: null as any, startTime: "invalid" as any, recording: "maybe" as any, root: "yes" as any } as any); span?.end(); }, "Multiple invalid options should not throw"); } }); } private addEdgeCaseTests(): void { this.testCase({ name: "EdgeCase: operations on null span should not throw", test: () => { // Arrange - Force null span (though SDK shouldn't return null) const span: IReadableSpan | null = null; // Act & Assert - All operations should be safe Assert.doesNotThrow(() => { span?.setAttribute("key", "value"); span?.setAttributes({ "key": "value" }); span?.setStatus({ code: eOTelSpanStatusCode.OK }); span?.updateName("new-name"); span?.end(); span?.recordException(new Error("test")); }, "Operations on null span should not throw"); } }); this.testCase({ name: "EdgeCase: extremely large attribute count should not throw", test: () => { // Arrange const span = this._ai.startSpan("large-attr-count-test"); const largeAttrs: any = {}; for (let i = 0; i < 1000; i++) { largeAttrs[`attr_${i}`] = `value_${i}`; } // Act & Assert Assert.doesNotThrow(() => { span?.setAttributes(largeAttrs); span?.end(); }, "Large attribute count should not throw"); } }); this.testCase({ name: "EdgeCase: very long attribute values should not throw", test: () => { // Arrange const span = this._ai.startSpan("long-attr-value-test"); const longValue = "x".repeat(100000); // Act & Assert Assert.doesNotThrow(() => { span?.setAttribute("long.attr", longValue); span?.end(); }, "Very long attribute values should not throw"); } }); this.testCase({ name: "EdgeCase: rapid successive operations should not throw", test: () => { // Arrange const span = this._ai.startSpan("rapid-ops-test"); // Act & Assert Assert.doesNotThrow(() => { for (let i = 0; i < 100; i++) { span?.setAttribute(`rapid_${i}`, i); span?.setStatus({ code: eOTelSpanStatusCode.OK }); span?.updateName(`name_${i}`); } span?.end(); }, "Rapid successive operations should not throw"); } }); this.testCase({ name: "EdgeCase: mixed valid and invalid operations should not throw", test: () => { // Arrange const span = this._ai.startSpan("mixed-ops-test"); // Act & Assert Assert.doesNotThrow(() => { span?.setAttribute("valid", "value"); span?.setAttribute(null as any, "invalid-key"); span?.setAttribute("another.valid", 123); span?.setAttribute("", "empty-key"); span?.setAttributes({ "good": "attr", "bad": null }); span?.setStatus({ code: eOTelSpanStatusCode.OK }); span?.updateName(null as any); span?.updateName("valid-name"); span?.end(); }, "Mixed valid and invalid operations should not throw"); } }); this.testCase({ name: "EdgeCase: special Unicode characters should not throw", test: () => { // Arrange const unicodeStrings = [ "Hello 世界", "Emoji 😀🎉", "RTL العربية", "Combined ñ é ü", "Zero-width\u200B\u200Ccharacters" ]; // Act & Assert unicodeStrings.forEach((str, index) => { Assert.doesNotThrow(() => { const span = this._ai.startSpan(str); span?.setAttribute("unicode.attr", str); span?.updateName(`unicode_${index}_${str}`); span?.end(); }, `Unicode string ${index} should not throw`); }); } }); this.testCase({ name: "EdgeCase: circular reference in error should not throw", test: () => { // Arrange const span = this._ai.startSpan("circular-error-test"); const circularError: any = new Error("Circular test"); circularError.self = circularError; // Create circular reference // Act & Assert Assert.doesNotThrow(() => { span?.recordException(circularError); span?.end(); }, "Circular reference in error should not throw"); } }); this.testCase({ name: "EdgeCase: NaN and Infinity values should not throw", test: () => { // Arrange const span = this._ai.startSpan("special-numbers-test"); // Act & Assert Assert.doesNotThrow(() => { span?.setAttribute("nan.value", NaN as any); span?.setAttribute("infinity.value", Infinity as any); span?.setAttribute("neg.infinity.value", -Infinity as any); span?.end(); }, "NaN and Infinity values should not throw"); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/SpanHelperUtils.Tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { ApplicationInsights } from "../../../src/applicationinsights-web"; import { createDistributedTraceContext, eOTelSpanKind, eOTelSpanStatusCode, IDistributedTraceInit, isReadableSpan, isSpanContextValid, ITelemetryItem, wrapSpanContext } from "@microsoft/applicationinsights-core-js"; /** * Comprehensive tests for span helper utility functions * * Tests verify: * - isSpanContextValid: validates span context * - wrapSpanContext: wraps external span contexts * - isReadableSpan: type guard for spans * - createNonRecordingSpan: creates non-recording spans (tested via wrapSpanContext) */ export class SpanHelperUtilsTests extends AITestClass { private static readonly _instrumentationKey = "b7170927-2d1c-44f1-acec-59f4e1751c11"; private static readonly _connectionString = `InstrumentationKey=${SpanHelperUtilsTests._instrumentationKey}`; private _ai!: ApplicationInsights; private _trackCalls: ITelemetryItem[] = []; constructor(testName?: string) { super(testName || "SpanHelperUtilsTests"); } public testInitialize() { try { this.useFakeServer = false; this._trackCalls = []; this._ai = new ApplicationInsights({ config: { connectionString: SpanHelperUtilsTests._connectionString, disableAjaxTracking: false, disableXhr: false, maxBatchInterval: 0, disableExceptionTracking: false } }); this._ai.loadAppInsights(); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; } catch (e) { console.error("Failed to initialize tests: " + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public registerTests() { this.addIsSpanContextValidTests(); this.addWrapSpanContextTests(); this.addIsReadableSpanTests(); this.addHelperIntegrationTests(); } private addIsSpanContextValidTests(): void { this.testCase({ name: "isSpanContextValid: valid span context returns true", test: () => { // Arrange const span = this._ai.startSpan("test-span"); const spanContext = span?.spanContext(); // Act const isValid = isSpanContextValid(spanContext!); // Assert Assert.ok(isValid, "Valid span context should return true"); span?.end(); } }); this.testCase({ name: "isSpanContextValid: valid traceId and spanId returns true", test: () => { // Arrange - create valid context const validContext = createDistributedTraceContext({ traceId: "0123456789abcdef0123456789abcdef", // 32 hex chars spanId: "0123456789abcdef", // 16 hex chars traceFlags: 1 }); // Act const isValid = isSpanContextValid(validContext); // Assert Assert.ok(isValid, "Context with valid IDs should return true"); } }); this.testCase({ name: "isSpanContextValid: invalid traceId returns false", test: () => { // Arrange - traceId too short (use IDistributedTraceInit directly, not createDistributedTraceContext which validates) const invalidContext: IDistributedTraceInit = { traceId: "0123456789abcdef", // Only 16 chars (should be 32) spanId: "0123456789abcdef", traceFlags: 1 }; // Act const isValid = isSpanContextValid(invalidContext); // Assert Assert.ok(!isValid, "Context with invalid traceId should return false"); } }); this.testCase({ name: "isSpanContextValid: invalid spanId returns false", test: () => { // Arrange - spanId too short (use IDistributedTraceInit directly, not createDistributedTraceContext which validates) const invalidContext: IDistributedTraceInit = { traceId: "0123456789abcdef0123456789abcdef", spanId: "01234567", // Only 8 chars (should be 16) traceFlags: 1 }; // Act const isValid = isSpanContextValid(invalidContext); // Assert Assert.ok(!isValid, "Context with invalid spanId should return false"); } }); this.testCase({ name: "isSpanContextValid: all zeros traceId returns false", test: () => { // Arrange - all zeros is invalid per spec (use IDistributedTraceInit directly, not createDistributedTraceContext which validates) const invalidContext: IDistributedTraceInit = { traceId: "00000000000000000000000000000000", spanId: "0123456789abcdef", traceFlags: 1 }; // Act const isValid = isSpanContextValid(invalidContext); // Assert Assert.ok(!isValid, "Context with all-zero traceId should return false"); } }); this.testCase({ name: "isSpanContextValid: all zeros spanId returns false", test: () => { // Arrange - all zeros is invalid per spec (use IDistributedTraceInit directly, not createDistributedTraceContext which validates) const invalidContext: IDistributedTraceInit = { traceId: "0123456789abcdef0123456789abcdef", spanId: "0000000000000000", traceFlags: 1 }; // Act const isValid = isSpanContextValid(invalidContext); // Assert Assert.ok(!isValid, "Context with all-zero spanId should return false"); } }); this.testCase({ name: "isSpanContextValid: null context returns false", test: () => { // Act const isValid = isSpanContextValid(null as any); // Assert Assert.ok(!isValid, "Null context should return false"); } }); this.testCase({ name: "isSpanContextValid: undefined context returns false", test: () => { // Act const isValid = isSpanContextValid(undefined as any); // Assert Assert.ok(!isValid, "Undefined context should return false"); } }); this.testCase({ name: "isSpanContextValid: empty traceId returns false", test: () => { // Arrange - use IDistributedTraceInit directly, not createDistributedTraceContext which validates const invalidContext: IDistributedTraceInit = { traceId: "", spanId: "0123456789abcdef", traceFlags: 1 }; // Act const isValid = isSpanContextValid(invalidContext); // Assert Assert.ok(!isValid, "Empty traceId should return false"); } }); this.testCase({ name: "isSpanContextValid: empty spanId returns false", test: () => { // Arrange - use IDistributedTraceInit directly, not createDistributedTraceContext which validates const invalidContext: IDistributedTraceInit = { traceId: "0123456789abcdef0123456789abcdef", spanId: "", traceFlags: 1 }; // Act const isValid = isSpanContextValid(invalidContext); // Assert Assert.ok(!isValid, "Empty spanId should return false"); } }); this.testCase({ name: "isSpanContextValid: non-hex characters in traceId returns false", test: () => { // Arrange - use IDistributedTraceInit directly, not createDistributedTraceContext which validates const invalidContext: IDistributedTraceInit = { traceId: "0123456789abcdefghij456789abcdef", // Contains g-j spanId: "0123456789abcdef", traceFlags: 1 }; // Act const isValid = isSpanContextValid(invalidContext); // Assert Assert.ok(!isValid, "TraceId with non-hex chars should return false"); } }); this.testCase({ name: "isSpanContextValid: uppercase hex characters are valid", test: () => { // Arrange const validContext = createDistributedTraceContext({ traceId: "0123456789ABCDEF0123456789ABCDEF", spanId: "0123456789ABCDEF", traceFlags: 1 }); // Act const isValid = isSpanContextValid(validContext); // Assert Assert.ok(isValid, "Uppercase hex characters should be valid"); } }); this.testCase({ name: "isSpanContextValid: mixed case hex characters are valid", test: () => { // Arrange const validContext = createDistributedTraceContext({ traceId: "0123456789AbCdEf0123456789AbCdEf", spanId: "0123456789AbCdEf", traceFlags: 1 }); // Act const isValid = isSpanContextValid(validContext); // Assert Assert.ok(isValid, "Mixed case hex characters should be valid"); } }); } private addWrapSpanContextTests(): void { this.testCase({ name: "wrapSpanContext: creates non-recording span from context", test: () => { // Arrange const originalSpan = this._ai.startSpan("original-span"); const spanContext = originalSpan?.spanContext(); // Act const wrappedSpan = wrapSpanContext(this._ai.otelApi, spanContext!); // Assert Assert.ok(wrappedSpan, "Wrapped span should be created"); Assert.ok(!wrappedSpan.isRecording(), "Wrapped span should not be recording"); Assert.equal(wrappedSpan.spanContext().traceId, spanContext?.traceId, "TraceId should match"); Assert.equal(wrappedSpan.spanContext().spanId, spanContext?.spanId, "SpanId should match"); // Cleanup originalSpan?.end(); wrappedSpan.end(); } }); this.testCase({ name: "wrapSpanContext: wrapped span name includes spanId", test: () => { // Arrange const spanContext = createDistributedTraceContext({ traceId: "0123456789abcdef0123456789abcdef", spanId: "0123456789abcdef", traceFlags: 1 }); // Act const wrappedSpan = wrapSpanContext(this._ai.otelApi, spanContext); // Assert Assert.ok(wrappedSpan.name.includes(spanContext.spanId), "Wrapped span name should include spanId"); Assert.ok(wrappedSpan.name.includes("wrapped"), "Wrapped span name should indicate it's wrapped"); wrappedSpan.end(); } }); this.testCase({ name: "wrapSpanContext: wrapped span does not generate telemetry", test: () => { // Arrange this._trackCalls = []; const spanContext = createDistributedTraceContext({ traceId: "abcdef0123456789abcdef0123456789", spanId: "abcdef0123456789", traceFlags: 1 }); // Act const wrappedSpan = wrapSpanContext(this._ai.otelApi, spanContext); wrappedSpan.setAttribute("test", "value"); wrappedSpan.setStatus({ code: eOTelSpanStatusCode.OK }); wrappedSpan.end(); // Assert Assert.equal(this._trackCalls.length, 0, "Wrapped span should not generate telemetry"); } }); this.testCase({ name: "wrapSpanContext: wrapped span kind is INTERNAL", test: () => { // Arrange const spanContext = createDistributedTraceContext({ traceId: "fedcba9876543210fedcba9876543210", spanId: "fedcba9876543210", traceFlags: 1 }); // Act const wrappedSpan = wrapSpanContext(this._ai.otelApi, spanContext); // Assert Assert.equal(wrappedSpan.kind, eOTelSpanKind.INTERNAL, "Wrapped span should have INTERNAL kind"); wrappedSpan.end(); } }); this.testCase({ name: "wrapSpanContext: can use wrapped span as parent", test: () => { // Arrange const parentContext = createDistributedTraceContext({ traceId: "1234567890abcdef1234567890abcdef", spanId: "1234567890abcdef", traceFlags: 1 }); const wrappedParent = wrapSpanContext(this._ai.otelApi, parentContext); // Act - create child with wrapped parent const childSpan = this._ai.startSpan("child-span", { kind: eOTelSpanKind.CLIENT }, wrappedParent.spanContext()); // Assert Assert.ok(childSpan, "Child span should be created"); Assert.equal(childSpan.spanContext().traceId, parentContext.traceId, "Child should have same traceId as wrapped parent"); // Cleanup childSpan?.end(); wrappedParent.end(); } }); this.testCase({ name: "wrapSpanContext: wrapped span supports all span operations", test: () => { // Arrange const spanContext = createDistributedTraceContext({ traceId: "aabbccddeeff00112233445566778899", spanId: "aabbccddeeff0011", traceFlags: 1 }); const wrappedSpan = wrapSpanContext(this._ai.otelApi, spanContext); // Act - perform various operations wrappedSpan.setAttribute("key1", "value1"); wrappedSpan.setAttributes({ "key2": 123, "key3": true }); wrappedSpan.updateName("new-name"); wrappedSpan.setStatus({ code: eOTelSpanStatusCode.OK, message: "Success" }); wrappedSpan.recordException(new Error("Test error")); // Assert - operations should not throw Assert.ok(true, "All operations should complete without error"); Assert.equal(wrappedSpan.name, "new-name", "Name should be updated"); wrappedSpan.end(); } }); this.testCase({ name: "wrapSpanContext: preserves traceFlags if present", test: () => { // Arrange const spanContext = createDistributedTraceContext({ traceId: "11112222333344445555666677778888", spanId: "1111222233334444", traceFlags: 1 // Sampled }); // Act const wrappedSpan = wrapSpanContext(this._ai.otelApi, spanContext); // Assert Assert.equal(wrappedSpan.spanContext().traceFlags, 1, "TraceFlags should be preserved"); wrappedSpan.end(); } }); this.testCase({ name: "wrapSpanContext: multiple wrapped spans from same context are independent", test: () => { // Arrange const spanContext = createDistributedTraceContext({ traceId: "99887766554433221100ffeeddccbbaa", spanId: "9988776655443322", traceFlags: 1 }); // Act const wrapped1 = wrapSpanContext(this._ai.otelApi, spanContext); const wrapped2 = wrapSpanContext(this._ai.otelApi, spanContext); // Assert - both wrap same context but are different span objects Assert.notEqual(wrapped1, wrapped2, "Should create different span objects"); Assert.equal(wrapped1.spanContext().traceId, wrapped2.spanContext().traceId, "Both should have same traceId"); Assert.equal(wrapped1.spanContext().spanId, wrapped2.spanContext().spanId, "Both should have same spanId"); // Operations on one should not affect the other wrapped1.updateName("wrapped-1"); wrapped2.updateName("wrapped-2"); Assert.equal(wrapped1.name, "wrapped-1", "First span name"); Assert.equal(wrapped2.name, "wrapped-2", "Second span name"); wrapped1.end(); wrapped2.end(); } }); this.testCase({ name: "wrapSpanContext: can wrap context from external system", test: () => { // Arrange - simulate receiving context from external system (e.g., HTTP header) const externalContext = createDistributedTraceContext({ traceId: "00112233445566778899aabbccddeeff", spanId: "0011223344556677", traceFlags: 1 }); // Act const wrappedSpan = wrapSpanContext(this._ai.otelApi, externalContext); // Create child span to continue the trace const childSpan = this._ai.startSpan("continue-external-trace", { kind: eOTelSpanKind.SERVER }, wrappedSpan.spanContext()); // Assert Assert.equal(childSpan?.spanContext().traceId, externalContext.traceId, "Should continue external trace"); Assert.notEqual(childSpan?.spanContext().spanId, externalContext.spanId, "Should have new spanId"); // Cleanup childSpan?.end(); wrappedSpan.end(); } }); } private addIsReadableSpanTests(): void { this.testCase({ name: "isReadableSpan: valid span returns true", test: () => { // Arrange const span = this._ai.startSpan("test-span"); // Act const isValid = isReadableSpan(span); // Assert Assert.ok(isValid, "Valid span should return true"); span?.end(); } }); this.testCase({ name: "isReadableSpan: null returns false", test: () => { // Act const isValid = isReadableSpan(null); // Assert Assert.ok(!isValid, "Null should return false"); } }); this.testCase({ name: "isReadableSpan: undefined returns false", test: () => { // Act const isValid = isReadableSpan(undefined); // Assert Assert.ok(!isValid, "Undefined should return false"); } }); this.testCase({ name: "isReadableSpan: plain object returns false", test: () => { // Arrange const notASpan = { name: "fake-span", kind: eOTelSpanKind.INTERNAL }; // Act const isValid = isReadableSpan(notASpan); // Assert Assert.ok(!isValid, "Plain object should return false"); } }); this.testCase({ name: "isReadableSpan: object with partial span interface returns false", test: () => { // Arrange - object with some but not all required properties const partialSpan = { name: "partial", kind: eOTelSpanKind.CLIENT, spanContext: () => ({ traceId: "123", spanId: "456" }), // Missing: duration, ended, startTime, endTime, etc. }; // Act const isValid = isReadableSpan(partialSpan); // Assert Assert.ok(!isValid, "Partial span interface should return false"); } }); this.testCase({ name: "isReadableSpan: recording span returns true", test: () => { // Arrange const recordingSpan = this._ai.startSpan("recording", { recording: true }); // Act const isValid = isReadableSpan(recordingSpan); // Assert Assert.ok(isValid, "Recording span should return true"); recordingSpan?.end(); } }); this.testCase({ name: "isReadableSpan: non-recording span returns true", test: () => { // Arrange const nonRecordingSpan = this._ai.startSpan("non-recording", { recording: false }); // Act const isValid = isReadableSpan(nonRecordingSpan); // Assert Assert.ok(isValid, "Non-recording span should return true"); nonRecordingSpan?.end(); } }); this.testCase({ name: "isReadableSpan: wrapped span context returns true", test: () => { // Arrange const spanContext = createDistributedTraceContext({ traceId: "aabbccdd00112233aabbccdd00112233", spanId: "aabbccdd00112233", traceFlags: 1 }); const wrappedSpan = wrapSpanContext(this._ai.otelApi, spanContext); // Act const isValid = isReadableSpan(wrappedSpan); // Assert Assert.ok(isValid, "Wrapped span should return true"); wrappedSpan.end(); } }); this.testCase({ name: "isReadableSpan: ended span returns true", test: () => { // Arrange const span = this._ai.startSpan("ended-span"); span?.end(); // Act const isValid = isReadableSpan(span); // Assert Assert.ok(isValid, "Ended span should still return true"); } }); this.testCase({ name: "isReadableSpan: span with all kinds returns true", test: () => { // Arrange & Act & Assert const internalSpan = this._ai.startSpan("internal", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(isReadableSpan(internalSpan), "INTERNAL span should be valid"); internalSpan?.end(); const clientSpan = this._ai.startSpan("client", { kind: eOTelSpanKind.CLIENT }); Assert.ok(isReadableSpan(clientSpan), "CLIENT span should be valid"); clientSpan?.end(); const serverSpan = this._ai.startSpan("server", { kind: eOTelSpanKind.SERVER }); Assert.ok(isReadableSpan(serverSpan), "SERVER span should be valid"); serverSpan?.end(); const producerSpan = this._ai.startSpan("producer", { kind: eOTelSpanKind.PRODUCER }); Assert.ok(isReadableSpan(producerSpan), "PRODUCER span should be valid"); producerSpan?.end(); const consumerSpan = this._ai.startSpan("consumer", { kind: eOTelSpanKind.CONSUMER }); Assert.ok(isReadableSpan(consumerSpan), "CONSUMER span should be valid"); consumerSpan?.end(); } }); this.testCase({ name: "isReadableSpan: string returns false", test: () => { // Act const isValid = isReadableSpan("not a span"); // Assert Assert.ok(!isValid, "String should return false"); } }); this.testCase({ name: "isReadableSpan: number returns false", test: () => { // Act const isValid = isReadableSpan(12345); // Assert Assert.ok(!isValid, "Number should return false"); } }); this.testCase({ name: "isReadableSpan: array returns false", test: () => { // Act const isValid = isReadableSpan([]); // Assert Assert.ok(!isValid, "Array should return false"); } }); this.testCase({ name: "isReadableSpan: function returns false", test: () => { // Act const isValid = isReadableSpan(() => {}); // Assert Assert.ok(!isValid, "Function should return false"); } }); } private addHelperIntegrationTests(): void { this.testCase({ name: "Integration: validate context before wrapping", test: () => { // Arrange - good practice to validate before wrapping const validContext: IDistributedTraceInit = { traceId: "aaaabbbbccccddddeeeeffffaaaabbbb", spanId: "aaaabbbbccccdddd", traceFlags: 1 }; const invalidContext: IDistributedTraceInit = { traceId: "invalid", spanId: "also-bad", traceFlags: 1 }; // Act & Assert - validate before wrapping Assert.ok(isSpanContextValid(validContext), "Valid context should pass validation"); const wrappedSpan = wrapSpanContext(this._ai.otelApi, validContext); Assert.ok(wrappedSpan, "Should wrap valid context"); Assert.ok(isReadableSpan(wrappedSpan), "Wrapped span should be readable"); wrappedSpan.end(); // Don't wrap invalid context Assert.ok(!isSpanContextValid(invalidContext), "Should detect invalid context before wrapping"); } }); this.testCase({ name: "Integration: type-safe span handling with isReadableSpan", test: () => { // Arrange const span = this._ai.startSpan("type-safe"); const maybeSpan: any = span; // Act - type guard allows safe access if (isReadableSpan(maybeSpan)) { // TypeScript knows this is IReadableSpan now const context = maybeSpan.spanContext(); maybeSpan.setAttribute("safe", "access"); maybeSpan.end(); // Assert Assert.ok(context.traceId, "Can safely access span properties"); } else { Assert.ok(false, "Span should be readable"); } } }); this.testCase({ name: "Integration: wrap external trace and continue locally", test: () => { // Arrange - simulate receiving trace context from external service const externalContext = createDistributedTraceContext({ traceId: "1234567890abcdef1234567890abcdef", spanId: "1234567890abcdef", traceFlags: 1 }); // Act - validate and wrap Assert.ok(isSpanContextValid(externalContext), "External context should be valid"); const wrappedExternal = wrapSpanContext( this._ai.otelApi, externalContext ); Assert.ok(isReadableSpan(wrappedExternal), "Wrapped external should be readable"); // Continue trace with local spans const localSpan1 = this._ai.startSpan("local-processing", { kind: eOTelSpanKind.SERVER }, wrappedExternal.spanContext()); const localSpan2 = this._ai.startSpan("database-call", { kind: eOTelSpanKind.CLIENT }, localSpan1?.spanContext()); // Assert - trace continuity Assert.equal(localSpan1?.spanContext().traceId, externalContext.traceId, "Local span should continue external trace"); Assert.equal(localSpan2?.spanContext().traceId, externalContext.traceId, "Nested span should continue external trace"); Assert.notEqual(localSpan2?.spanContext().spanId, externalContext.spanId, "Should have new span IDs"); // Cleanup localSpan2?.end(); localSpan1?.end(); wrappedExternal.end(); } }); this.testCase({ name: "Integration: helper functions work with all span kinds", test: () => { // Test each span kind const kinds = [ eOTelSpanKind.INTERNAL, eOTelSpanKind.CLIENT, eOTelSpanKind.SERVER, eOTelSpanKind.PRODUCER, eOTelSpanKind.CONSUMER ]; for (const kind of kinds) { // Create span const span = this._ai.startSpan(`span-kind-${kind}`, { kind }); Assert.ok(span, `Span with kind ${kind} should be created`); // Verify with isReadableSpan Assert.ok(isReadableSpan(span), `Span kind ${kind} should be readable`); // Get and validate context const context = span?.spanContext(); Assert.ok(isSpanContextValid(context!), `Span kind ${kind} should have valid context`); // Wrap the context const wrapped = wrapSpanContext(this._ai.otelApi, context!); Assert.ok(isReadableSpan(wrapped), `Wrapped span from kind ${kind} should be readable`); // Cleanup span?.end(); wrapped.end(); } Assert.ok(true, "All span kinds tested successfully"); } }); this.testCase({ name: "Integration: helpers work after span lifecycle", test: () => { // Arrange - create and end span const span = this._ai.startSpan("lifecycle-test"); const context = span?.spanContext(); span?.end(); // Act & Assert - helpers should still work with ended span Assert.ok(isReadableSpan(span), "isReadableSpan should work with ended span"); Assert.ok(isSpanContextValid(context!), "isSpanContextValid should work with context from ended span"); const wrapped = wrapSpanContext(this._ai.otelApi, context!); Assert.ok(isReadableSpan(wrapped), "Can wrap context from ended span"); wrapped.end(); } }); this.testCase({ name: "Integration: defensive programming with helpers", test: () => { // Arrange - potentially problematic inputs const nullValue: any = null; const undefinedValue: any = undefined; const emptyObject: any = {}; const wrongType: any = "not a span"; // Act & Assert - helpers should handle gracefully Assert.ok(!isReadableSpan(nullValue), "Handle null"); Assert.ok(!isReadableSpan(undefinedValue), "Handle undefined"); Assert.ok(!isReadableSpan(emptyObject), "Handle empty object"); Assert.ok(!isReadableSpan(wrongType), "Handle wrong type"); Assert.ok(!isSpanContextValid(nullValue), "Validate null context"); Assert.ok(!isSpanContextValid(undefinedValue), "Validate undefined context"); Assert.ok(!isSpanContextValid(emptyObject), "Validate empty context"); Assert.ok(!isSpanContextValid(wrongType), "Validate wrong type context"); } }); this.testCase({ name: "Integration: wrap and use as active span", test: () => { // Arrange const externalContext = createDistributedTraceContext({ traceId: "activespan123456789012345678901234", spanId: "activespan123456", traceFlags: 1 }); // Act - wrap and set as active const wrappedSpan = wrapSpanContext(this._ai.otelApi, externalContext); const scope = this._ai.core.setActiveSpan(wrappedSpan); // Create child that should automatically get wrapped span as parent const childSpan = this._ai.startSpan("auto-child", { kind: eOTelSpanKind.INTERNAL }); // Assert Assert.equal(childSpan?.spanContext().traceId, externalContext.traceId, "Child should inherit traceId from active wrapped span"); // Cleanup childSpan?.end(); scope?.restore(); wrappedSpan.end(); } }); this.testCase({ name: "Integration: validation chain for incoming distributed trace", test: () => { // Simulate complete flow of receiving and processing distributed trace // Step 1: Receive trace context (e.g., from HTTP headers) const receivedContext = createDistributedTraceContext({ traceId: "abcdef0123456789abcdef0123456789", spanId: "abcdef0123456789", traceFlags: 1 }); // Step 2: Validate received context Assert.ok(isSpanContextValid(receivedContext), "Received trace context should be valid"); // Step 3: Wrap context to create local span representation const remoteSpan = wrapSpanContext(this._ai.otelApi, receivedContext); Assert.ok(isReadableSpan(remoteSpan), "Failed to create readable span"); // Step 4: Create local server span as child const serverSpan = this._ai.startSpan("handle-request", { kind: eOTelSpanKind.SERVER }, remoteSpan.spanContext()); Assert.ok(isReadableSpan(serverSpan), "Server span should be readable"); // Step 5: Verify trace continuity const serverContext = serverSpan?.spanContext(); Assert.ok(isSpanContextValid(serverContext!), "Server span should have valid context"); Assert.equal(serverContext?.traceId, receivedContext.traceId, "Trace ID should be preserved across process boundary"); // Step 6: Complete request handling serverSpan?.setAttribute("http.status_code", 200); serverSpan?.setStatus({ code: eOTelSpanStatusCode.OK }); serverSpan?.end(); remoteSpan.end(); Assert.ok(true, "Complete distributed trace flow validated"); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/SpanLifeCycle.Tests.ts ================================================ import { AITestClass, Assert } from '@microsoft/ai-test-framework'; import { ApplicationInsights } from '../../../src/applicationinsights-web'; import { eOTelSpanStatusCode, ITelemetryItem } from "@microsoft/applicationinsights-core-js"; export class SpanLifeCycleTests extends AITestClass { private static readonly _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; private static readonly _connectionString = `InstrumentationKey=${SpanLifeCycleTests._instrumentationKey}`; private _ai!: ApplicationInsights; private _trackCalls: ITelemetryItem[] = []; constructor(testName?: string) { super(testName || "SpanLifeCycleTests"); } public testInitialize() { try { this.useFakeServer = false; this._trackCalls = []; this._ai = new ApplicationInsights({ config: { connectionString: SpanLifeCycleTests._connectionString, disableAjaxTracking: false, disableXhr: false, maxBatchInterval: 0, disableExceptionTracking: false } }); this._ai.loadAppInsights(); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; } catch (e) { console.error('Failed to initialize tests: ' + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public registerTests() { this.addDoubleEndTests(); this.addOperationsOnEndedSpansTests(); this.addEndedPropertyTests(); this.addIsRecordingAfterEndTests(); this.addEndTimeTests(); } private addDoubleEndTests(): void { this.testCase({ name: "DoubleEnd: calling end() twice should not throw", test: () => { // Arrange const span = this._ai.startSpan("double-end-test"); // Act & Assert - First end should succeed Assert.doesNotThrow(() => { span?.end(); }, "First end() should not throw"); // Second end should not throw but should be no-op Assert.doesNotThrow(() => { span?.end(); }, "Second end() should not throw"); } }); this.testCase({ name: "DoubleEnd: second end() should be no-op", test: () => { // Arrange const span = this._ai.startSpan("double-end-noop"); this._trackCalls = []; // Act - End twice span?.end(); const trackCountAfterFirst = this._trackCalls.length; span?.end(); const trackCountAfterSecond = this._trackCalls.length; // Assert - Second end should not generate additional telemetry Assert.equal(trackCountAfterSecond, trackCountAfterFirst, "Second end() should not generate additional telemetry"); } }); this.testCase({ name: "DoubleEnd: ended property remains true after second end", test: () => { // Arrange const span = this._ai.startSpan("double-end-property"); // Act span?.end(); const endedAfterFirst = span?.ended; span?.end(); const endedAfterSecond = span?.ended; // Assert Assert.ok(endedAfterFirst, "Span should be ended after first end()"); Assert.ok(endedAfterSecond, "Span should remain ended after second end()"); } }); this.testCase({ name: "DoubleEnd: multiple end() calls are safe", test: () => { // Arrange const span = this._ai.startSpan("multiple-end-test"); // Act & Assert - Multiple ends should all be safe Assert.doesNotThrow(() => { for (let i = 0; i < 10; i++) { span?.end(); } }, "Multiple end() calls should not throw"); Assert.ok(span?.ended, "Span should be marked as ended"); } }); this.testCase({ name: "DoubleEnd: end with different times only uses first", test: () => { // Arrange const span = this._ai.startSpan("double-end-time"); // Act - End with specific time const firstEndTime = Date.now(); span?.end(firstEndTime); const capturedEndTime1 = span?.endTime; // Try to end again with different time const secondEndTime = Date.now() + 1000; span?.end(secondEndTime); const capturedEndTime2 = span?.endTime; // Assert - End time should not change Assert.deepEqual(capturedEndTime1, capturedEndTime2, "End time should not change on second end()"); } }); } private addOperationsOnEndedSpansTests(): void { this.testCase({ name: "EndedSpan: setAttribute on ended span should not throw", test: () => { // Arrange const span = this._ai.startSpan("ended-setAttribute"); span?.end(); // Act & Assert Assert.doesNotThrow(() => { span?.setAttribute("after.end", "value"); }, "setAttribute should not throw on ended span"); } }); this.testCase({ name: "EndedSpan: setAttribute on ended span should be no-op", test: () => { // Arrange const span = this._ai.startSpan("ended-setAttribute-noop"); span?.setAttribute("before.end", "initialValue"); const attributesBeforeEnd = span?.attributes; span?.end(); // Act span?.setAttribute("after.end", "newValue"); span?.setAttribute("before.end", "modifiedValue"); // Assert const attributesAfterEnd = span?.attributes; Assert.ok(!attributesAfterEnd["after.end"], "New attribute should not be added after end"); Assert.equal(attributesAfterEnd["before.end"], "initialValue", "Existing attribute should not be modified after end"); } }); this.testCase({ name: "EndedSpan: setAttributes on ended span should not throw", test: () => { // Arrange const span = this._ai.startSpan("ended-setAttributes"); span?.end(); // Act & Assert Assert.doesNotThrow(() => { span?.setAttributes({ "attr1": "value1", "attr2": "value2" }); }, "setAttributes should not throw on ended span"); } }); this.testCase({ name: "EndedSpan: setAttributes on ended span should be no-op", test: () => { // Arrange const span = this._ai.startSpan("ended-setAttributes-noop"); span?.setAttributes({ "initial": "value" }); span?.end(); // Act span?.setAttributes({ "after.end.1": "value1", "after.end.2": "value2" }); // Assert const attributes = span?.attributes; Assert.ok(!attributes["after.end.1"], "Attributes should not be added after end"); Assert.ok(!attributes["after.end.2"], "Attributes should not be added after end"); } }); this.testCase({ name: "EndedSpan: setStatus on ended span should not throw", test: () => { // Arrange const span = this._ai.startSpan("ended-setStatus"); span?.end(); // Act & Assert Assert.doesNotThrow(() => { span?.setStatus({ code: eOTelSpanStatusCode.ERROR, message: "Error after end" }); }, "setStatus should not throw on ended span"); } }); this.testCase({ name: "EndedSpan: setStatus on ended span should be no-op", test: () => { // Arrange const span = this._ai.startSpan("ended-setStatus-noop"); span?.setStatus({ code: eOTelSpanStatusCode.OK, message: "Initial status" }); const statusBeforeEnd = span?.status; span?.end(); // Act span?.setStatus({ code: eOTelSpanStatusCode.ERROR, message: "Modified after end" }); // Assert const statusAfterEnd = span?.status; Assert.equal(statusAfterEnd.code, statusBeforeEnd?.code, "Status code should not change after end"); } }); this.testCase({ name: "EndedSpan: updateName on ended span should not throw", test: () => { // Arrange const span = this._ai.startSpan("original-name"); span?.end(); // Act & Assert Assert.doesNotThrow(() => { span?.updateName("new-name-after-end"); }, "updateName should not throw on ended span"); } }); this.testCase({ name: "EndedSpan: updateName on ended span should be no-op", test: () => { // Arrange const originalName = "original-name-noop"; const span = this._ai.startSpan(originalName); span?.end(); // Act span?.updateName("modified-name"); // Assert Assert.equal(span?.name, originalName, "Span name should not change after end"); } }); this.testCase({ name: "EndedSpan: recordException on ended span should not throw", test: () => { // Arrange const span = this._ai.startSpan("ended-recordException"); span?.end(); // Act & Assert Assert.doesNotThrow(() => { span?.recordException(new Error("Exception after end")); }, "recordException should not throw on ended span"); } }); this.testCase({ name: "EndedSpan: multiple operations on ended span should all be safe", test: () => { // Arrange const span = this._ai.startSpan("ended-multiple-ops"); span?.end(); // Act & Assert - All operations should be safe Assert.doesNotThrow(() => { span?.setAttribute("key", "value"); span?.setAttributes({ "key1": "val1", "key2": "val2" }); span?.setStatus({ code: eOTelSpanStatusCode.ERROR }); span?.updateName("new-name"); span?.recordException(new Error("test")); span?.end(); // Try to end again }, "Multiple operations on ended span should not throw"); } }); } private addEndedPropertyTests(): void { this.testCase({ name: "EndedProperty: span should not be ended initially", test: () => { // Arrange & Act const span = this._ai.startSpan("initial-not-ended"); // Assert Assert.ok(!span?.ended, "Span should not be ended initially"); // Cleanup span?.end(); } }); this.testCase({ name: "EndedProperty: span should be ended after end() call", test: () => { // Arrange const span = this._ai.startSpan("ended-after-call"); // Act span?.end(); // Assert Assert.ok(span?.ended, "Span should be ended after end() call"); } }); this.testCase({ name: "EndedProperty: ended property is read-only", test: () => { // Arrange const span = this._ai.startSpan("readonly-ended") as any; // Act - Try to modify ended property const canModify = () => { try { span.ended = true; return true; } catch (e) { return false; } }; // Assert Assert.ok(!span.ended, "Should start not ended"); // Property should be read-only (or modification has no effect) canModify(); Assert.ok(!span.ended, "Manual modification should not affect ended state"); // Cleanup span.end(); } }); this.testCase({ name: "EndedProperty: ended state persists across property reads", test: () => { // Arrange const span = this._ai.startSpan("persistent-ended"); span?.end(); // Act - Read ended property multiple times const ended1 = span?.ended; const ended2 = span?.ended; const ended3 = span?.ended; // Assert Assert.ok(ended1, "First read should show ended"); Assert.ok(ended2, "Second read should show ended"); Assert.ok(ended3, "Third read should show ended"); } }); this.testCase({ name: "EndedProperty: recording and non-recording spans both have ended property", test: () => { // Arrange const recordingSpan = this._ai.startSpan("recording", { recording: true }); const nonRecordingSpan = this._ai.startSpan("non-recording", { recording: false }); // Act recordingSpan?.end(); nonRecordingSpan?.end(); // Assert Assert.ok(recordingSpan?.ended, "Recording span should be ended"); Assert.ok(nonRecordingSpan?.ended, "Non-recording span should be ended"); } }); } private addIsRecordingAfterEndTests(): void { this.testCase({ name: "IsRecording: isRecording() returns false after end()", test: () => { // Arrange const span = this._ai.startSpan("recording-test"); const isRecordingBefore = span?.isRecording(); // Act span?.end(); const isRecordingAfter = span?.isRecording(); // Assert Assert.ok(isRecordingBefore, "Span should be recording before end"); Assert.ok(!isRecordingAfter, "Span should not be recording after end"); } }); this.testCase({ name: "IsRecording: non-recording span stays non-recording after end", test: () => { // Arrange const span = this._ai.startSpan("non-recording-test", { recording: false }); const isRecordingBefore = span?.isRecording(); // Act span?.end(); const isRecordingAfter = span?.isRecording(); // Assert Assert.ok(!isRecordingBefore, "Non-recording span should not be recording before end"); Assert.ok(!isRecordingAfter, "Non-recording span should not be recording after end"); } }); this.testCase({ name: "IsRecording: isRecording() consistent with ended state", test: () => { // Arrange const span = this._ai.startSpan("recording-consistency"); // Assert initial state Assert.ok(span?.isRecording(), "Should be recording when not ended"); Assert.ok(!span?.ended, "Should not be ended initially"); // Act span?.end(); // Assert final state Assert.ok(!span?.isRecording(), "Should not be recording when ended"); Assert.ok(span?.ended, "Should be ended after end()"); } }); this.testCase({ name: "IsRecording: multiple isRecording() calls after end return consistent value", test: () => { // Arrange const span = this._ai.startSpan("recording-multiple-calls"); span?.end(); // Act const check1 = span?.isRecording(); const check2 = span?.isRecording(); const check3 = span?.isRecording(); // Assert Assert.ok(!check1, "First check should return false"); Assert.ok(!check2, "Second check should return false"); Assert.ok(!check3, "Third check should return false"); } }); } private addEndTimeTests(): void { this.testCase({ name: "EndTime: endTime is undefined before end()", test: () => { // Arrange & Act const span = this._ai.startSpan("endtime-undefined"); const endTime = span?.endTime; // Assert Assert.ok(endTime === undefined || endTime === null, "endTime should be undefined/null before end()"); // Cleanup span?.end(); } }); this.testCase({ name: "EndTime: endTime is set after end()", test: () => { // Arrange const span = this._ai.startSpan("endtime-set"); // Act span?.end(); const endTime = span?.endTime; // Assert Assert.ok(endTime !== undefined && endTime !== null, "endTime should be set after end()"); } }); this.testCase({ name: "EndTime: endTime is after startTime", test: () => { // Arrange const span = this._ai.startSpan("endtime-after-start"); // Act span?.end(); // Assert const startTime = span?.startTime; const endTime = span?.endTime; if (startTime && endTime) { // Compare HrTime [seconds, nanoseconds] const startMs = startTime[0] * 1000 + startTime[1] / 1000000; const endMs = endTime[0] * 1000 + endTime[1] / 1000000; Assert.ok(endMs >= startMs, "endTime should be after or equal to startTime"); } } }); this.testCase({ name: "EndTime: custom endTime is respected", test: () => { // Arrange const span = this._ai.startSpan("endtime-custom"); const customEndTime = Date.now(); // Act span?.end(customEndTime); const actualEndTime = span?.endTime; // Assert if (actualEndTime) { const actualMs = actualEndTime[0] * 1000 + actualEndTime[1] / 1000000; const diff = Math.abs(actualMs - customEndTime); Assert.ok(diff < 10, // Allow 10ms difference for conversion "Custom endTime should be approximately respected"); } } }); this.testCase({ name: "EndTime: duration is calculated from startTime to endTime", test: () => { // Arrange const span = this._ai.startSpan("duration-calculation"); // Act - Add small delay const startTime = Date.now(); for (let i = 0; i < 1000; i++) { // Small busy loop } span?.end(); // Assert const duration = span?.duration; if (duration) { const durationMs = duration[0] * 1000 + duration[1] / 1000000; Assert.ok(durationMs >= 0, "Duration should be non-negative"); } } }); this.testCase({ name: "EndTime: endTime does not change after span is ended", test: () => { // Arrange const span = this._ai.startSpan("endtime-immutable"); // Act span?.end(); const endTime1 = span?.endTime; // Try to end again (should be no-op) span?.end(); const endTime2 = span?.endTime; // Assert Assert.deepEqual(endTime1, endTime2, "endTime should not change after first end()"); } }); this.testCase({ name: "EndTime: negative duration is handled gracefully", test: () => { // Arrange const span = this._ai.startSpan("negative-duration"); // Act - End with time before start const futureTime = Date.now() + 10000; span?.end(); // Try to set past end time after span started // (Note: SDK should handle this internally and prevent negative duration) // Assert const duration = span?.duration; if (duration) { const durationMs = duration[0] * 1000 + duration[1] / 1000000; Assert.ok(durationMs >= 0, "Duration should never be negative (SDK should handle this)"); } } }); } } ================================================ FILE: AISKU/Tests/Unit/src/SpanPluginIntegration.Tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { ApplicationInsights } from "../../../src/applicationinsights-web"; import { eOTelSpanKind, eOTelSpanStatusCode, isTracingSuppressed, ITelemetryItem } from "@microsoft/applicationinsights-core-js"; import { setBypassLazyCache } from "@nevware21/ts-utils"; /** * Integration Tests for Span APIs with Properties Plugin and Analytics Plugin * * Tests verify that span telemetry correctly integrates with: * - PropertiesPlugin: session, user, device, application context * - AnalyticsPlugin: telemetry creation, dependency tracking, page views * - Telemetry Initializers: custom property injection * - SDK configuration: sampling, disabled tracking, etc. */ export class SpanPluginIntegrationTests extends AITestClass { private _ai!: ApplicationInsights; constructor(testName?: string) { super(testName || "SpanPluginIntegrationTests"); } public testInitialize() { try { setBypassLazyCache(true); this.useFakeServer = true; this._ai = new ApplicationInsights({ config: { instrumentationKey: "test-ikey-123", disableInstrumentationKeyValidation: true, disableAjaxTracking: false, disableXhr: false, disableFetchTracking: false, enableAutoRouteTracking: false, disableExceptionTracking: false, maxBatchInterval: 100, enableDebug: false, extensionConfig: { ["AppInsightsPropertiesPlugin"]: { accountId: "test-account-id" } } } }); this._ai.loadAppInsights(); } catch (e) { Assert.ok(false, "Failed to initialize tests: " + e); console.error("Failed to initialize tests: " + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } setBypassLazyCache(false); } public registerTests() { this.addPropertiesPluginIntegrationTests(); this.addAnalyticsPluginIntegrationTests(); this.addTelemetryInitializerTests(); this.addSessionContextTests(); this.addUserContextTests(); this.addDeviceContextTests(); this.addDistributedTraceContextTests(); this.addSamplingIntegrationTests(); this.addConfigurationIntegrationTests(); } private addPropertiesPluginIntegrationTests(): void { this.testCase({ name: "PropertiesPlugin: span telemetry includes session context", useFakeTimers: true, useFakeServer: true, test: () => { const span = this._ai.startSpan("test-operation", { kind: eOTelSpanKind.CLIENT }); Assert.ok(span, "Span should be created"); Assert.equal(false, isTracingSuppressed(span), "Span should not be suppressed"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion span!.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.equal(1, sentItems.length, "Telemetry should be sent"); const payload = sentItems[0]; Assert.ok(payload, "Payload should exist"); Assert.ok(payload.tags, "Payload should have tags"); // Session ID is sent in tags with key "ai.session.id" const sessionId = payload.tags["ai.session.id"]; Assert.ok(sessionId, "Session ID should be in tags"); Assert.ok(sessionId.length > 0, "Session ID should not be empty"); } }); this.testCase({ name: "PropertiesPlugin: span telemetry includes user context", useFakeTimers: true, test: () => { // Set user context before creating span this._ai.context.user.authenticatedId = "test-auth-user-123"; this._ai.context.user.accountId = "test-account-456"; const span = this._ai.startSpan("user-operation", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span, "Span should be created"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion span!.setAttribute("custom.prop", "value"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion span!.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.equal(1, sentItems.length, "Telemetry should be sent"); const payload = sentItems[0]; Assert.ok(payload, "Payload should exist"); Assert.ok(payload.tags, "Payload should have tags"); // User auth ID is sent in tags with key "ai.user.authUserId" const authUserId = payload.tags["ai.user.authUserId"]; Assert.equal(authUserId, "test-auth-user-123", "Authenticated ID should match"); // Account ID is sent in tags with key "ai.user.accountId" const accountId = payload.tags["ai.user.accountId"]; Assert.equal(accountId, "test-account-456", "Account ID should be in tags"); } }); this.testCase({ name: "PropertiesPlugin: span telemetry includes device context", useFakeTimers: true, test: () => { const span = this._ai.startSpan("device-operation", { kind: eOTelSpanKind.CLIENT }); Assert.ok(span, "Span should be created"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion span!.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.equal(1, sentItems.length, "Telemetry should be sent"); const payload = sentItems[0]; Assert.ok(payload, "Payload should exist"); Assert.ok(payload.tags, "Payload should have tags"); // Device info is sent in tags with keys "ai.device.type" and "ai.device.id" const deviceType = payload.tags["ai.device.type"]; Assert.equal(deviceType, "Browser", "Device type should be Browser"); const deviceId = payload.tags["ai.device.id"]; Assert.equal(deviceId, "browser", "Device ID should be browser"); } }); this.testCase({ name: "PropertiesPlugin: span telemetry includes SDK version from internal context", useFakeTimers: true, test: () => { const span = this._ai.startSpan("sdk-version-check", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span, "Span should be created"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion span!.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.equal(1, sentItems.length, "Telemetry should be sent"); const payload = sentItems[0]; Assert.ok(payload, "Payload should exist"); Assert.ok(payload.tags, "Payload should have tags"); // SDK version is sent in tags with key "ai.internal.sdkVersion" const sdkVersion = payload.tags["ai.internal.sdkVersion"]; Assert.ok(sdkVersion, "SDK version should exist"); Assert.ok(sdkVersion.indexOf("javascript") >= 0 || sdkVersion.indexOf("ext1") >= 0, "SDK version should contain javascript or extension prefix"); } }); this.testCase({ name: "PropertiesPlugin: web context applied to span telemetry", useFakeTimers: true, test: () => { const span = this._ai.startSpan("web-context-operation", { kind: eOTelSpanKind.SERVER }); Assert.ok(span, "Span should be created"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion span!.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.equal(1, sentItems.length, "Telemetry should be sent"); const payload = sentItems[0]; Assert.ok(payload, "Payload should exist"); // Web context info like browser is sent in data section or tags // Just verify the payload was sent successfully with telemetry Assert.ok(payload.data, "Payload should have data section"); } }); } private addAnalyticsPluginIntegrationTests(): void { this.testCase({ name: "AnalyticsPlugin: CLIENT span creates RemoteDependencyData", useFakeTimers: true, test: () => { const span = this._ai.startSpan("http-request", { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "GET", "http.url": "https://api.example.com/data", "http.status_code": 200 } }); Assert.ok(span, "Span should be created"); if (!span) { return; } span.setStatus({ code: eOTelSpanStatusCode.OK }); span.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.ok(sentItems.length > 0, "Telemetry should be sent"); const item = sentItems[0] as ITelemetryItem; Assert.ok(item.data, "Data should exist"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion Assert.equal(item.data!.baseType, "RemoteDependencyData", "BaseType should be RemoteDependencyData"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion Assert.ok(item.data!.baseData, "BaseData should exist"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion Assert.equal(item.data!.baseData.name, "GET /data", "Name should match span name"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion Assert.equal(item.data!.baseData.success, true, "Success should be true for OK status"); } }); this.testCase({ name: "AnalyticsPlugin: PRODUCER span creates RemoteDependencyData with message type", useFakeTimers: true, test: () => { const span = this._ai.startSpan("send-message", { kind: eOTelSpanKind.PRODUCER, attributes: { "messaging.system": "rabbitmq", "messaging.destination": "orders-queue", "messaging.operation": "send" } }); Assert.ok(span, "Span should be created"); if (!span) { return; } span.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.ok(sentItems.length > 0, "Telemetry should be sent"); const item = sentItems[0] as ITelemetryItem; Assert.ok(item.data, "Data should exist"); if (!item.data) { return; } Assert.equal(item.data.baseType, "RemoteDependencyData", "BaseType should be RemoteDependencyData"); Assert.ok(item.data.baseData, "BaseData should exist"); if (!item.data.baseData) { return; } Assert.ok(item.data.baseData.type, "Type should be set for message dependency"); } }); this.testCase({ name: "AnalyticsPlugin: custom properties merged into baseData", useFakeTimers: true, test: () => { const span = this._ai.startSpan("operation-with-props", { kind: eOTelSpanKind.INTERNAL, attributes: { "custom.string": "value", "custom.number": 42, "custom.boolean": true } }); Assert.ok(span, "Span should be created"); if (!span) { return; } span.setAttribute("runtime.prop", "added-after-start"); span.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.ok(sentItems.length > 0, "Telemetry should be sent"); const item = sentItems[0] as ITelemetryItem; if (!item.data) { return; } Assert.ok(item.data.baseData, "BaseData should exist"); if (!item.data.baseData) { return; } // Custom properties should be in properties object if (item.data.baseData.properties) { Assert.equal(item.data.baseData.properties["custom.string"], "value", "String property should be preserved"); Assert.equal(item.data.baseData.properties["custom.number"], 42, "Number property should be preserved"); Assert.equal(item.data.baseData.properties["custom.boolean"], "true", "Boolean property should be preserved"); Assert.equal(item.data.baseData.properties["runtime.prop"], "added-after-start", "Runtime-added property should be present"); } } }); this.testCase({ name: "AnalyticsPlugin: span duration calculated correctly", useFakeTimers: true, test: () => { const span = this._ai.startSpan("timed-operation", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span, "Span should be created"); if (!span) { return; } // Simulate some time passing this.clock.tick(250); span.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.ok(sentItems.length > 0, "Telemetry should be sent"); const item = sentItems[0] as ITelemetryItem; if (!item.data) { return; } Assert.ok(item.data.baseData, "BaseData should exist"); if (!item.data.baseData) { return; } Assert.equal(item.data.baseData.name, "timed-operation", "Name should match span name"); Assert.ok(item.data.baseData.duration, "Duration should exist"); // Duration should be approximately 250ms (formatted as time span string) const durationMs = this.parseDurationToMs(item.data.baseData.duration); Assert.ok(durationMs >= 240 && durationMs <= 260, "Duration should be ~250ms, got " + durationMs + "ms - " + JSON.stringify(item)); } }); this.testCase({ name: "AnalyticsPlugin: failed span sets success=false", useFakeTimers: true, test: () => { const span = this._ai.startSpan("failing-operation", { kind: eOTelSpanKind.CLIENT }); Assert.ok(span, "Span should be created"); if (!span) { return; } span.setStatus({ code: eOTelSpanStatusCode.ERROR, message: "Operation failed" }); span.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.ok(sentItems.length > 0, "Telemetry should be sent"); const item = sentItems[0] as ITelemetryItem; if (!item.data) { return; } Assert.ok(item.data.baseData, "BaseData should exist"); if (!item.data.baseData) { return; } Assert.equal(item.data.baseData.success, false, "Success should be false for ERROR status"); } }); } private addTelemetryInitializerTests(): void { this.testCase({ name: "TelemetryInitializer: can modify span telemetry", useFakeTimers: true, test: () => { let initializerCalled = false; this._ai.addTelemetryInitializer((item: ITelemetryItem) => { initializerCalled = true; if (item.baseType === "RemoteDependencyData") { // Add custom property via initializer item.baseData = item.baseData || {}; item.baseData.properties = item.baseData.properties || {}; item.baseData.properties["initializer.added"] = "custom-value"; item.baseData.properties["initializer.timestamp"] = new Date().toISOString(); } return true; }); const span = this._ai.startSpan("initialized-span", { kind: eOTelSpanKind.CLIENT }); Assert.ok(span, "Span should be created"); if (!span) { return; } span.end(); this.clock.tick(500); Assert.ok(initializerCalled, "Telemetry initializer should be called"); const sentItems = this.getSentTelemetry(); Assert.ok(sentItems.length > 0, "Telemetry should be sent"); const item = sentItems[0] as ITelemetryItem; if (!item.data) { return; } if (!item.data.baseData) { return; } Assert.ok(item.data.baseData.properties, "Properties should exist"); Assert.equal(item.data.baseData.properties["initializer.added"], "custom-value", "Initializer-added property should be present"); Assert.ok(item.data.baseData.properties["initializer.timestamp"], "Timestamp should be added by initializer"); } }); this.testCase({ name: "TelemetryInitializer: can filter span telemetry", useFakeTimers: true, test: () => { this._ai.addTelemetryInitializer((item: ITelemetryItem) => { // Filter out spans with specific attribute if (item.baseType === "RemoteDependencyData" && item.baseData && item.baseData.properties && item.baseData.properties["filter.me"] === "true") { return false; // Reject this telemetry } return true; }); // This span should be filtered out const filteredSpan = this._ai.startSpan("filtered-span", { kind: eOTelSpanKind.CLIENT, attributes: { "filter.me": "true" } }); Assert.ok(filteredSpan, "Filtered span should be created"); if (filteredSpan) { filteredSpan.end(); } // This span should go through const normalSpan = this._ai.startSpan("normal-span", { kind: eOTelSpanKind.CLIENT }); Assert.ok(normalSpan, "Normal span should be created"); if (normalSpan) { normalSpan.end(); } this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.equal(sentItems.length, 1, "Only one span should be sent (filtered one rejected)"); const item = sentItems[0] as ITelemetryItem; if (item.data && item.data.baseData) { Assert.equal(item.data.baseData.name, "normal-span", "Only normal span should be sent"); } } }); this.testCase({ name: "TelemetryInitializer: can enrich with context data", useFakeTimers: true, test: () => { this._ai.addTelemetryInitializer((item: ITelemetryItem) => { // Add environment and build info to all span telemetry if (item.baseType === "RemoteDependencyData") { item.baseData = item.baseData || {}; item.baseData.properties = item.baseData.properties || {}; item.baseData.properties["environment"] = "test"; item.baseData.properties["build.version"] = "1.2.3"; item.baseData.properties["region"] = "us-west"; } return true; }); const span = this._ai.startSpan("enriched-span", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span, "Span should be created"); if (!span) { return; } span.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); const item = sentItems[0] as ITelemetryItem; if (!item.data) { return; } if (!item.data.baseData) { return; } Assert.equal(item.data.baseData.properties["environment"], "test", "Environment should be added"); Assert.equal(item.data.baseData.properties["build.version"], "1.2.3", "Build version should be added"); Assert.equal(item.data.baseData.properties["region"], "us-west", "Region should be added"); } }); } private addSessionContextTests(): void { this.testCase({ name: "SessionContext: consistent session ID across multiple spans", useFakeTimers: true, test: () => { const span1 = this._ai.startSpan("operation-1", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span1, "First span should be created"); if (span1) { span1.end(); } const span2 = this._ai.startSpan("operation-2", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span2, "Second span should be created"); if (span2) { span2.end(); } this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.equal(sentItems.length, 2, "Two telemetry items should be sent"); const payload1 = sentItems[0]; const payload2 = sentItems[1]; const sessionId1 = payload1.tags ? payload1.tags["ai.session.id"] : undefined; const sessionId2 = payload2.tags ? payload2.tags["ai.session.id"] : undefined; Assert.ok(sessionId1, "First item should have session ID"); Assert.ok(sessionId2, "Second item should have session ID"); Assert.equal(sessionId1, sessionId2, "Session IDs should be consistent"); } }); this.testCase({ name: "SessionContext: session renewal doesn't affect active spans", useFakeTimers: true, test: () => { const span1 = this._ai.startSpan("before-renewal", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span1, "Span before renewal should be created"); if (span1) { span1.end(); } this.clock.tick(500); // Simulate session renewal time passing (30+ minutes) this.clock.tick(31 * 60 * 1000); const span2 = this._ai.startSpan("after-renewal", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span2, "Span after renewal should be created"); if (span2) { span2.end(); } this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.equal(sentItems.length, 2, "Both spans should be sent"); // Session might have renewed, but both spans should have valid session IDs const payload1 = sentItems[0]; const payload2 = sentItems[1]; const sessionId1 = payload1.tags ? payload1.tags["ai.session.id"] : undefined; const sessionId2 = payload2.tags ? payload2.tags["ai.session.id"] : undefined; Assert.ok(sessionId1, "First span should have session ID"); Assert.ok(sessionId2, "Second span should have session ID"); } }); } private addUserContextTests(): void { this.testCase({ name: "UserContext: setting user ID applies to subsequent spans", useFakeTimers: true, test: () => { // Set user context this._ai.context.user.id = "user-12345"; this._ai.context.user.authenticatedId = "auth-user-67890"; const span = this._ai.startSpan("user-operation", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span, "Span should be created"); if (!span) { return; } span.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); const payload = sentItems[0]; Assert.ok(payload.tags, "Payload should have tags"); // User ID is sent in tags with key "ai.user.id" const userId = payload.tags["ai.user.id"]; Assert.equal(userId, "user-12345", "User ID should match"); // Auth user ID is sent in tags with key "ai.user.authUserId" const authUserId = payload.tags["ai.user.authUserId"]; Assert.equal(authUserId, "auth-user-67890", "Authenticated ID should match"); } }); this.testCase({ name: "UserContext: clearing user context removes from spans", useFakeTimers: true, test: () => { // Set then clear this._ai.context.user.authenticatedId = "temp-user"; this._ai.context.user.clearAuthenticatedUserContext(); const span = this._ai.startSpan("after-clear", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span, "Span should be created"); if (!span) { return; } span.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); const payload = sentItems[0]; // User context should still exist but authenticated ID should be undefined/missing if (payload.tags) { const authUserId = payload.tags["ai.user.authUserId"]; Assert.ok(!authUserId || authUserId === undefined, "Authenticated ID should be cleared"); } } }); } private addDeviceContextTests(): void { this.testCase({ name: "DeviceContext: device information included in all spans", useFakeTimers: true, test: () => { const span = this._ai.startSpan("device-check", { kind: eOTelSpanKind.CLIENT }); Assert.ok(span, "Span should be created"); if (!span) { return; } span.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); const payload = sentItems[0]; Assert.ok(payload.tags, "Payload should have tags"); // Device info is sent in tags const deviceType = payload.tags["ai.device.type"]; const deviceId = payload.tags["ai.device.id"]; Assert.ok(deviceType, "Device type should be set"); Assert.ok(deviceId, "Device ID should be set"); } }); } private addDistributedTraceContextTests(): void { this.testCase({ name: "DistributedTrace: parent-child spans share trace ID", useFakeTimers: true, test: () => { const parentSpan = this._ai.startSpan("parent-op", { kind: eOTelSpanKind.SERVER }); Assert.ok(parentSpan, "Parent span should be created"); if (!parentSpan) { return; } const childSpan = this._ai.startSpan("child-op", { kind: eOTelSpanKind.CLIENT }); Assert.ok(childSpan, "Child span should be created"); parentSpan.end(); if (childSpan) { childSpan.end(); } this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.equal(sentItems.length, 2, "Both spans should be sent"); const parentPayload = sentItems[0]; const childPayload = sentItems[1]; // Both should have same operation ID (trace ID) in tags const parentOpId = parentPayload.tags ? parentPayload.tags["ai.operation.id"] : undefined; const childOpId = childPayload.tags ? childPayload.tags["ai.operation.id"] : undefined; Assert.ok(parentOpId, "Parent should have operation ID"); Assert.ok(childOpId, "Child should have operation ID"); Assert.equal(parentOpId, childOpId, "Trace IDs should match for parent and child"); } }); this.testCase({ name: "DistributedTrace: span context propagates through telemetry", useFakeTimers: true, test: () => { const span = this._ai.startSpan("traced-operation", { kind: eOTelSpanKind.CLIENT }); Assert.ok(span, "Span should be created"); if (!span) { return; } const spanContext = span.spanContext(); Assert.ok(spanContext.traceId, "Span should have trace ID"); Assert.ok(spanContext.spanId, "Span should have span ID"); span.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); const payload = sentItems[0]; // Trace context should be in tags if (payload.tags) { const operationId = payload.tags["ai.operation.id"]; const operationParentId = payload.tags["ai.operation.parentId"]; Assert.equal(operationId, spanContext.traceId, "Operation ID should match trace ID"); Assert.ok(operationParentId, "Operation parent ID should be set"); } } }); } private addSamplingIntegrationTests(): void { this.testCase({ name: "Sampling: 1% sampling allows minimal span telemetry", useFakeTimers: true, test: () => { // Recreate AI with 1% sampling (minimum valid value) this._ai.unload(false); this._ai = new ApplicationInsights({ config: { instrumentationKey: "test-ikey-123", samplingPercentage: 1 } }); this._ai.loadAppInsights(); const span = this._ai.startSpan("low-sampled", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span, "Span should still be created"); if (span) { span.end(); } this.clock.tick(500); const sentItems = this.getSentTelemetry(); // With 1% sampling, telemetry may or may not be sent (depends on sample hash) Assert.ok(sentItems.length >= 0, "Telemetry should respect 1% sampling rate"); } }); this.testCase({ name: "Sampling: 100% sampling sends all span telemetry", useFakeTimers: true, test: () => { // Default config has 100% sampling const spans = []; for (let i = 0; i < 10; i++) { const span = this._ai.startSpan("operation-" + i, { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span, "Span " + i + " should be created"); if (span) { span.end(); spans.push(span); } } this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.equal(sentItems.length, 10, "All 10 spans should be sent with 100% sampling"); } }); } private addConfigurationIntegrationTests(): void { this.testCase({ name: "Config: disableAjaxTracking doesn't affect manual spans", useFakeTimers: true, test: () => { // Config already has disableAjaxTracking: false, but manual spans should work regardless const span = this._ai.startSpan("manual-span", { kind: eOTelSpanKind.CLIENT }); Assert.ok(span, "Manual span should be created"); if (!span) { return; } span.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.ok(sentItems.length > 0, "Manual span should be sent regardless of ajax tracking config"); } }); this.testCase({ name: "Config: maxBatchInterval affects when span telemetry is sent", useFakeTimers: true, test: () => { // Current config has maxBatchInterval: 0 (send immediately) const span = this._ai.startSpan("immediate-send", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span, "Span should be created"); if (!span) { return; } span.end(); // No tick needed with maxBatchInterval: 0 this.clock.tick(500); const sentItems = this.getSentTelemetry(); Assert.ok(sentItems.length > 0, "Span should be sent immediately"); } }); this.testCase({ name: "Config: extensionConfig reaches PropertiesPlugin", useFakeTimers: true, test: () => { // We set accountId in extensionConfig during init const span = this._ai.startSpan("config-test", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span, "Span should be created"); if (!span) { return; } span.end(); this.clock.tick(500); const sentItems = this.getSentTelemetry(); const payload = sentItems[0]; // Check if account ID from config made it through tags if (payload.tags) { const accountId = payload.tags["ai.user.accountId"]; if (accountId) { Assert.equal(accountId, "test-account-id", "Account ID from config should be present in tags"); } } } }); this.testCase({ name: "Config: dynamic configuration changes affect new spans", useFakeTimers: true, test: () => { // Create span with initial config const span1 = this._ai.startSpan("before-config-change", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span1, "First span should be created"); if (span1) { span1.end(); } this.clock.tick(500); // Change configuration dynamically this._ai.config.extensionConfig = this._ai.config.extensionConfig || {}; this._ai.config.extensionConfig["AppInsightsChannelPlugin"] = this._ai.config.extensionConfig["AppInsightsChannelPlugin"] || {}; this._ai.config.extensionConfig["AppInsightsChannelPlugin"].samplingPercentage = 1; this.clock.tick(500); // Allow config change to propagate // Create span after config change const span2 = this._ai.startSpan("after-config-change", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(span2, "Second span should be created"); if (span2) { span2.end(); } this.clock.tick(500); const sentItems = this.getSentTelemetry(); // First span should be sent (100% default), second may be sampled (1%) Assert.ok(sentItems.length >= 1, "At least first span should be sent"); const firstItem = sentItems[0] as ITelemetryItem; if (firstItem.data && firstItem.data.baseData) { Assert.equal(firstItem.data.baseData.name, "before-config-change", "First span should be sent before config change"); } } }); } // Helper methods private getSentTelemetry(): any[] { const items: any[] = []; const requests = this.activeXhrRequests; if (requests) { requests.forEach((request: any) => { if (request.requestBody) { try { const payload = JSON.parse(request.requestBody); if (payload && Array.isArray(payload)) { items.push(...payload); } else if (payload) { items.push(payload); } } catch (e) { // Ignore parse errors } } }); } return items; } private parseDurationToMs(duration: string): number { // Duration format: "00:00:00.250" or similar if (!duration) { return 0; } const parts = duration.split(":"); if (parts.length !== 3) { return 0; } const hours = parseInt(parts[0], 10); const minutes = parseInt(parts[1], 10); const secondsParts = parts[2].split("."); const seconds = parseInt(secondsParts[0], 10); const milliseconds = secondsParts[1] ? parseInt(secondsParts[1].padEnd(3, "0").substring(0, 3), 10) : 0; return (hours * 3600000) + (minutes * 60000) + (seconds * 1000) + milliseconds; } } ================================================ FILE: AISKU/Tests/Unit/src/SpanUtils.Tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { ApplicationInsights, IDependencyTelemetry } from "../../../src/applicationinsights-web"; import { eOTelSpanKind, eOTelSpanStatusCode, ITelemetryItem, SEMATTRS_HTTP_METHOD, SEMATTRS_HTTP_URL, SEMATTRS_HTTP_STATUS_CODE, SEMATTRS_DB_SYSTEM, SEMATTRS_DB_STATEMENT, SEMATTRS_DB_NAME, SEMATTRS_RPC_SYSTEM, SEMATTRS_RPC_GRPC_STATUS_CODE, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_ENDUSER_ID, ATTR_ENDUSER_PSEUDO_ID, ATTR_HTTP_ROUTE, MicrosoftClientIp } from "@microsoft/applicationinsights-core-js"; import { IRequestTelemetry } from "@microsoft/applicationinsights-core-js"; export class SpanUtilsTests extends AITestClass { private static readonly _instrumentationKey = "b7170927-2d1c-44f1-acec-59f4e1751c11"; private static readonly _connectionString = `InstrumentationKey=${SpanUtilsTests._instrumentationKey}`; private _ai!: ApplicationInsights; private _trackCalls: ITelemetryItem[] = []; constructor(testName?: string) { super(testName || "SpanUtilsTests"); } public testInitialize() { try { this.useFakeServer = false; this._trackCalls = []; this._ai = new ApplicationInsights({ config: { connectionString: SpanUtilsTests._connectionString, disableAjaxTracking: false, disableXhr: false, maxBatchInterval: 0, disableExceptionTracking: false } }); this._ai.loadAppInsights(); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; } catch (e) { console.error("Failed to initialize tests: " + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public registerTests() { this.addDependencyTelemetryTests(); this.addRequestTelemetryTests(); this.addHttpDependencyTests(); this.addDbDependencyTests(); this.addRpcDependencyTests(); this.addAttributeMappingTests(); this.addTagsCreationTests(); this.addAzureSDKTests(); this.addSemanticAttributeExclusionTests(); this.addEdgeCaseTests(); this.addCrossBrowserCompatibilityTests(); } private addDependencyTelemetryTests(): void { this.testCase({ name: "createDependencyTelemetry: CLIENT span generates RemoteDependency telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("client-operation", { kind: eOTelSpanKind.CLIENT, attributes: { "custom.attr": "value" } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.equal(item.name, "Microsoft.ApplicationInsights.RemoteDependency", "Should be RemoteDependency"); Assert.equal(item.baseType, "RemoteDependencyData", "Should have correct baseType"); Assert.ok(item.baseData, "Should have baseData"); Assert.equal((item.baseData as any).name, "client-operation", "Should have span name"); Assert.equal((item.baseData as any).type, "Dependency", "Should have default dependency type"); } }); this.testCase({ name: "createDependencyTelemetry: PRODUCER span generates QueueMessage dependency", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("queue-producer", { kind: eOTelSpanKind.PRODUCER, attributes: { "messaging.system": "kafka", "messaging.destination": "orders" } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.equal((item.baseData as any).type, "Queue Message", "Should be QueueMessage type"); } }); this.testCase({ name: "createDependencyTelemetry: INTERNAL span with parent generates InProc dependency", test: () => { // Arrange this._trackCalls = []; // Act const parentSpan = this._ai.startSpan("parent-operation"); const parentContext = parentSpan?.spanContext(); const childSpan = this._ai.startSpan("internal-operation", { kind: eOTelSpanKind.INTERNAL }, parentContext); childSpan?.end(); parentSpan?.end(); // Assert const childItem = this._trackCalls.find(t => t.baseData?.name === "internal-operation"); Assert.ok(childItem, "Should have child telemetry"); Assert.equal((childItem?.baseData as any).type, "InProc", "Should be InProc type"); } }); this.testCase({ name: "createDependencyTelemetry: SUCCESS status based on span status code", test: () => { // Arrange this._trackCalls = []; // Act - span with OK status const okSpan = this._ai.startSpan("ok-span", { kind: eOTelSpanKind.CLIENT }); okSpan?.setStatus({ code: eOTelSpanStatusCode.OK }); okSpan?.end(); // Act - span with ERROR status const errorSpan = this._ai.startSpan("error-span", { kind: eOTelSpanKind.CLIENT }); errorSpan?.setStatus({ code: eOTelSpanStatusCode.ERROR, message: "Failed" }); errorSpan?.end(); // Assert const okItem = this._trackCalls.find(t => t.baseData?.name === "ok-span"); const errorItem = this._trackCalls.find(t => t.baseData?.name === "error-span"); Assert.equal((okItem?.baseData as any).success, true, "OK span should have success=true"); Assert.equal((errorItem?.baseData as any).success, false, "ERROR span should have success=false"); } }); this.testCase({ name: "createDependencyTelemetry: includes span context IDs", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("test-span", { kind: eOTelSpanKind.CLIENT }); const spanContext = span?.spanContext(); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.baseData as any).id, spanContext?.spanId, "Should have spanId"); Assert.ok(item.tags, "Should have tags"); Assert.equal((item.tags as any)["ai.operation.id"], spanContext?.traceId, "Should have traceId in tags"); } }); } private addRequestTelemetryTests(): void { this.testCase({ name: "createRequestTelemetry: SERVER span generates Request telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("server-operation", { kind: eOTelSpanKind.SERVER, attributes: { "http.method": "GET", "http.url": "https://example.com/api/users" } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.equal(item.name, "Microsoft.ApplicationInsights.Request", "Should be Request"); Assert.equal(item.baseType, "RequestData", "Should have correct baseType"); Assert.ok(item.baseData, "Should have baseData"); } }); this.testCase({ name: "createRequestTelemetry: CONSUMER span generates Request telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("queue-consumer", { kind: eOTelSpanKind.CONSUMER, attributes: { "messaging.system": "rabbitmq" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal(item.name, "Microsoft.ApplicationInsights.Request", "Should be Request"); } }); this.testCase({ name: "createRequestTelemetry: SUCCESS derived from status code", test: () => { // Arrange this._trackCalls = []; // Act - UNSET status with 2xx HTTP code const successSpan = this._ai.startSpan("success-request", { kind: eOTelSpanKind.SERVER, attributes: { "http.method": "POST", "http.status_code": 201 } }); successSpan?.end(); // Act - UNSET status with 5xx HTTP code const failSpan = this._ai.startSpan("fail-request", { kind: eOTelSpanKind.SERVER, attributes: { "http.method": "GET", "http.status_code": 500 } }); failSpan?.end(); // Assert const successItem = this._trackCalls.find(t => t.baseData?.name === "success-request"); const failItem = this._trackCalls.find(t => t.baseData?.name === "fail-request"); Assert.equal((successItem?.baseData as any).success, true, "2xx should be success"); Assert.equal((failItem?.baseData as any).success, false, "5xx should be failure"); } }); this.testCase({ name: "createRequestTelemetry: OK status overrides HTTP status code", test: () => { // Arrange this._trackCalls = []; // Act - OK status with 5xx code (shouldn't happen but testing precedence) const span = this._ai.startSpan("explicit-ok", { kind: eOTelSpanKind.SERVER, attributes: { "http.method": "GET", "http.status_code": 500 } }); span?.setStatus({ code: eOTelSpanStatusCode.OK }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.baseData as any).success, true, "OK status should take precedence"); } }); this.testCase({ name: "createRequestTelemetry: includes URL for HTTP requests", test: () => { // Arrange this._trackCalls = []; const testUrl = "https://api.example.com/v1/users?id=123"; // Act const span = this._ai.startSpan("http-request", { kind: eOTelSpanKind.SERVER, attributes: { "http.method": "GET", "http.url": testUrl, "http.status_code": 200 } }); span?.end(); // Assert const item = this._trackCalls[0]; const baseData = item.baseData as IRequestTelemetry; Assert.equal(baseData.url, testUrl, "Should include URL"); Assert.equal(baseData.responseCode, 200, "Should include status code"); } }); this.testCase({ name: "createRequestTelemetry: gRPC status code mapping", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("grpc-request", { kind: eOTelSpanKind.SERVER, attributes: { "rpc.system": "grpc", "rpc.grpc.status_code": 0 // OK } }); span?.end(); // Assert const item = this._trackCalls[0]; const baseData = item.baseData as IRequestTelemetry; Assert.equal(baseData.responseCode, 0, "Should map gRPC status code"); } }); } private addHttpDependencyTests(): void { this.testCase({ name: "HTTP Dependency: legacy semantic conventions mapping", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("http-call", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_HTTP_METHOD]: "POST", [SEMATTRS_HTTP_URL]: "https://api.example.com/v1/users", [SEMATTRS_HTTP_STATUS_CODE]: 201 } }); span?.end(); // Assert const item = this._trackCalls[0]; const baseData = item.baseData as IDependencyTelemetry; Assert.equal(baseData.type, "Http", "Should be HTTP type"); Assert.ok(baseData.name?.startsWith("POST"), "Name should include method"); Assert.equal(baseData.data, "https://api.example.com/v1/users", "Should include URL"); Assert.equal(baseData.responseCode, 201, "Should include status code"); } }); this.testCase({ name: "HTTP Dependency: new semantic conventions mapping", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("http-call-new", { kind: eOTelSpanKind.CLIENT, attributes: { [ATTR_HTTP_REQUEST_METHOD]: "GET", [ATTR_URL_FULL]: "https://api.example.com/v2/products", [ATTR_HTTP_RESPONSE_STATUS_CODE]: 200, [ATTR_SERVER_ADDRESS]: "api.example.com", [ATTR_SERVER_PORT]: 443 } }); span?.end(); // Assert const item = this._trackCalls[0]; const baseData = item.baseData as IDependencyTelemetry; Assert.equal(baseData.type, "Http", "Should be HTTP type"); Assert.ok(baseData.data, "Should have data field"); } }); this.testCase({ name: "HTTP Dependency: target with default port removal", test: () => { // Arrange this._trackCalls = []; // Act - HTTPS with default port 443 const httpsSpan = this._ai.startSpan("https-call", { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "GET", "http.url": "https://example.com:443/api", "net.peer.name": "example.com", "net.peer.port": 443 } }); httpsSpan?.end(); // Act - HTTP with default port 80 const httpSpan = this._ai.startSpan("http-call", { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "GET", "http.url": "http://example.com:80/api", "net.peer.name": "example.com", "net.peer.port": 80 } }); httpSpan?.end(); // Assert const httpsItem = this._trackCalls.find(t => t.baseData?.name?.includes("https-call") || t.baseData?.data?.includes("https://example.com:443")); const httpItem = this._trackCalls.find(t => t.baseData?.name?.includes("http-call") || t.baseData?.data?.includes("http://example.com:80")); // Default ports should be stripped from target Assert.ok(httpsItem, "Should have HTTPS telemetry"); Assert.ok(httpItem, "Should have HTTP telemetry"); } }); this.testCase({ name: "HTTP Dependency: target with non-default port preserved", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("custom-port-call", { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "GET", "http.url": "https://example.com:8443/api", "net.peer.name": "example.com", "net.peer.port": 8443 } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.ok((item.baseData as any).target, "Should have target"); // Non-default port should be preserved in target } }); this.testCase({ name: "HTTP Dependency: name generated from URL pathname", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("generic-name", { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "DELETE", "http.url": "https://api.example.com/v1/users/123" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.ok((item.baseData as any).name.includes("DELETE"), "Name should include HTTP method"); Assert.ok((item.baseData as any).name.includes("/v1/users/123"), "Name should include path"); } }); } private addDbDependencyTests(): void { this.testCase({ name: "DB Dependency: MySQL mapping", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("db-query", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_DB_SYSTEM]: "mysql", [SEMATTRS_DB_STATEMENT]: "SELECT * FROM users WHERE id = ?", [SEMATTRS_DB_NAME]: "myapp_db", "net.peer.name": "db.example.com", "net.peer.port": 3306 } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.baseData as any).type, "mysql", "Should be mysql type"); Assert.equal((item.baseData as any).data, "SELECT * FROM users WHERE id = ?", "Should include statement"); Assert.ok((item.baseData as any).target?.includes("myapp_db"), "Target should include DB name"); } }); this.testCase({ name: "DB Dependency: PostgreSQL mapping", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("postgres-query", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_DB_SYSTEM]: "postgresql", [SEMATTRS_DB_STATEMENT]: "INSERT INTO logs (message) VALUES ($1)" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.baseData as any).type, "postgresql", "Should be postgresql type"); } }); this.testCase({ name: "DB Dependency: MongoDB mapping", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("mongo-query", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_DB_SYSTEM]: "mongodb", [SEMATTRS_DB_STATEMENT]: "db.users.find({age: {$gt: 25}})" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.baseData as any).type, "mongodb", "Should be mongodb type"); } }); this.testCase({ name: "DB Dependency: Redis mapping", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("redis-cmd", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_DB_SYSTEM]: "redis", [SEMATTRS_DB_STATEMENT]: "GET user:123" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.baseData as any).type, "redis", "Should be redis type"); } }); this.testCase({ name: "DB Dependency: SQL Server mapping", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("mssql-query", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_DB_SYSTEM]: "mssql", [SEMATTRS_DB_STATEMENT]: "SELECT TOP 10 * FROM Orders" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.baseData as any).type, "SQL", "Should be SQL type for SQL Server"); } }); this.testCase({ name: "DB Dependency: operation used when no statement", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("db-op", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_DB_SYSTEM]: "postgresql", "db.operation": "SELECT", [SEMATTRS_DB_NAME]: "products_db" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.baseData as any).data, "SELECT", "Should use operation when no statement"); } }); this.testCase({ name: "DB Dependency: target formatting with host and dbname", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("db-call", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_DB_SYSTEM]: "mysql", [SEMATTRS_DB_NAME]: "production_db", "net.peer.name": "mysql-prod.example.com", "net.peer.port": 3306 } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.ok((item.baseData as any).target?.includes("mysql-prod.example.com"), "Target should include host"); Assert.ok((item.baseData as any).target?.includes("production_db"), "Target should include DB name"); } }); } private addRpcDependencyTests(): void { this.testCase({ name: "RPC Dependency: gRPC mapping", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("grpc-call", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_RPC_SYSTEM]: "grpc", [SEMATTRS_RPC_GRPC_STATUS_CODE]: 0, "rpc.service": "UserService", "rpc.method": "GetUser" } }); span?.end(); // Assert const item = this._trackCalls[0]; let baseData = item.baseData as IDependencyTelemetry; Assert.equal(baseData.type, "GRPC", "Should be Dependency type"); Assert.equal(baseData.responseCode, 0, "Should include gRPC status code"); } }); this.testCase({ name: "RPC Dependency: WCF mapping", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("wcf-call", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_RPC_SYSTEM]: "wcf", "rpc.service": "CalculatorService" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.baseData as any).type, "WCF Service", "Should be Dependency type"); } }); this.testCase({ name: "RPC Dependency: target from peer service", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("rpc-call", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_RPC_SYSTEM]: "grpc", "net.peer.name": "grpc.example.com", "net.peer.port": 50051 } }); span?.end(); // Assert const item = this._trackCalls[0]; let baseData = item.baseData as IDependencyTelemetry; Assert.ok(baseData.target, "Should have target"); } }); } private addAttributeMappingTests(): void { this.testCase({ name: "Attribute Mapping: custom attributes preserved in properties", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("custom-attrs", { kind: eOTelSpanKind.CLIENT, attributes: { "app.version": "1.2.3", "user.tier": "premium", "request.priority": 5, "feature.enabled": true } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.ok((item.baseData as any).properties, "Should have properties"); Assert.equal((item.baseData as any).properties["app.version"], "1.2.3", "String attribute preserved"); Assert.equal((item.baseData as any).properties["user.tier"], "premium", "String attribute preserved"); Assert.equal((item.baseData as any).properties["request.priority"], 5, "Number attribute preserved"); Assert.equal((item.baseData as any).properties["feature.enabled"], true, "Boolean attribute preserved"); } }); this.testCase({ name: "Attribute Mapping: dt.spanId and dt.traceId always added", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("test-span", { kind: eOTelSpanKind.CLIENT }); const context = span?.spanContext(); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal(item.ext?.dt.spanId, context?.spanId, "Should have dt.spanId"); Assert.equal(item.ext?.dt.traceId, context?.traceId, "Should have dt.traceId"); } }); this.testCase({ name: "Attribute Mapping: sampling.probability mapped to sampleRate", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("sampled-span", { kind: eOTelSpanKind.CLIENT, attributes: { "microsoft.sample_rate": 25 } }); span?.end(); // Assert const item = this._trackCalls[0] as any; Assert.equal(item.sampleRate, 25, "Should map sampling.probability to sampleRate"); } }); } private addTagsCreationTests(): void { this.testCase({ name: "Tags: operation ID from trace ID", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("test-span", { kind: eOTelSpanKind.SERVER }); const context = span?.spanContext(); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.tags as any)["ai.operation.id"], context?.traceId, "Should map traceId to operation.id"); } }); this.testCase({ name: "Tags: operation parent ID from parent span", test: () => { // Arrange this._trackCalls = []; // Act const parentSpan = this._ai.startSpan("parent", { kind: eOTelSpanKind.SERVER }); const parentContext = parentSpan?.spanContext(); const childSpan = this._ai.startSpan("child", { kind: eOTelSpanKind.INTERNAL }, parentContext); childSpan?.end(); parentSpan?.end(); // Assert const childItem = this._trackCalls.find(t => t.baseData?.name === "child"); Assert.equal((childItem?.tags as any)?.["ai.operation.parentId"], parentContext?.spanId, "Should map parent spanId to operation.parentId"); } }); this.testCase({ name: "Tags: enduser.id mapped to user auth ID", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("user-span", { kind: eOTelSpanKind.SERVER, attributes: { [ATTR_ENDUSER_ID]: "user@example.com" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.tags as any)["ai.user.authUserId"], "user@example.com", "Should map enduser.id to user.authUserId"); } }); this.testCase({ name: "Tags: enduser.pseudo.id mapped to user ID", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("pseudo-user-span", { kind: eOTelSpanKind.SERVER, attributes: { [ATTR_ENDUSER_PSEUDO_ID]: "anon-12345" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.tags as any)["ai.user.id"], "anon-12345", "Should map enduser.pseudo.id to user.id"); } }); this.testCase({ name: "Tags: microsoft.client.ip takes precedence", test: () => { // Arrange this._trackCalls = []; const clientIp = "203.0.113.42"; // Act const span = this._ai.startSpan("ip-span", { kind: eOTelSpanKind.SERVER, attributes: { [MicrosoftClientIp]: clientIp, "client.address": "192.168.1.1", // Should be ignored "http.client_ip": "10.0.0.1" // Should be ignored } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.tags as any)["ai.location.ip"], clientIp, "microsoft.client.ip should take precedence"); } }); this.testCase({ name: "Tags: operation name from http.route for SERVER spans", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("http-request", { kind: eOTelSpanKind.SERVER, attributes: { "http.method": "POST", [ATTR_HTTP_ROUTE]: "/api/v1/users/:id", "http.url": "https://example.com/api/v1/users/123" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.ok((item.tags as any)["ai.operation.name"]?.includes("POST"), "Should include method"); Assert.ok((item.tags as any)["ai.operation.name"]?.includes("/api/v1/users/:id"), "Should include route"); } }); this.testCase({ name: "Tags: operation name falls back to URL path when no route", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("http-request-no-route", { kind: eOTelSpanKind.SERVER, attributes: { "http.method": "GET", "http.url": "https://example.com/products/search?q=laptop" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.ok((item.tags as any)["ai.operation.name"]?.includes("GET"), "Should include method"); Assert.ok((item.tags as any)["ai.operation.name"]?.includes("/products/search"), "Should include path"); } }); this.testCase({ name: "Tags: user agent mapped correctly", test: () => { // Arrange this._trackCalls = []; const userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/91.0"; // Act const span = this._ai.startSpan("ua-span", { kind: eOTelSpanKind.SERVER, attributes: { "http.user_agent": userAgent } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.tags as any)["ai.user.userAgent"], userAgent, "Should map user agent"); } }); this.testCase({ name: "Tags: synthetic source detection", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("bot-span", { kind: eOTelSpanKind.SERVER, attributes: { "http.user_agent": "Googlebot/2.1 (+http://www.google.com/bot.html)" } }); span?.end(); // Assert const item = this._trackCalls[0]; // Synthetic source should be detected for bot user agents if ((item.tags as any)["ai.operation.syntheticSource"]) { Assert.equal((item.tags as any)["ai.operation.syntheticSource"], "True", "Should detect synthetic source for bots"); } } }); } private addAzureSDKTests(): void { this.testCase({ name: "Azure SDK: EventHub PRODUCER span mapping", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("EventHubs.send", { kind: eOTelSpanKind.PRODUCER, attributes: { "az.namespace": "Microsoft.EventHub", "message_bus.destination": "telemetry-events", "net.peer.name": "eventhub.servicebus.windows.net" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.ok((item.baseData as any).type?.includes("Queue Message"), "Should be Queue Message type"); Assert.ok((item.baseData as any).type?.includes("Microsoft.EventHub"), "Should include namespace"); Assert.ok((item.baseData as any).target, "Should have target"); } }); this.testCase({ name: "Azure SDK: EventHub CONSUMER span mapping", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("EventHubs.process", { kind: eOTelSpanKind.CONSUMER, attributes: { "az.namespace": "Microsoft.EventHub", "message_bus.destination": "telemetry-events", "net.peer.name": "eventhub.servicebus.windows.net", "enqueuedTime": "1638360000000" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.ok((item.baseData as any).source, "Consumer should have source"); Assert.ok((item.baseData as any).measurements, "Should have measurements"); Assert.ok("timeSinceEnqueued" in (item.baseData as any).measurements, "Should have timeSinceEnqueued measurement"); } }); this.testCase({ name: "Azure SDK: INTERNAL span with Azure namespace", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("internal-azure-op", { kind: eOTelSpanKind.INTERNAL, attributes: { "az.namespace": "Microsoft.Storage" } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.ok((item.baseData as any).type?.includes("InProc"), "Should include InProc"); Assert.ok((item.baseData as any).type?.includes("Microsoft.Storage"), "Should include namespace"); } }); } private addSemanticAttributeExclusionTests(): void { this.testCase({ name: "Semantic Exclusion: HTTP attributes not in properties", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("http-span", { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "POST", "http.url": "https://example.com/api", "http.status_code": 201, "http.user_agent": "TestAgent/1.0", "custom.attribute": "should-be-kept" } }); span?.end(); // Assert const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.ok(!props["http.method"], "http.method should be excluded"); Assert.ok(!props["http.url"], "http.url should be excluded"); Assert.ok(!props["http.status_code"], "http.status_code should be excluded"); Assert.ok(!props["http.user_agent"], "http.user_agent should be excluded"); Assert.equal(props["custom.attribute"], "should-be-kept", "Custom attributes should be kept"); } }); this.testCase({ name: "Semantic Exclusion: DB attributes not in properties", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("db-span", { kind: eOTelSpanKind.CLIENT, attributes: { "db.system": "postgresql", "db.statement": "SELECT * FROM users", "db.name": "mydb", "db.operation": "SELECT", "app.query.id": "query-123" } }); span?.end(); // Assert const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.ok(!props["db.system"], "db.system should be excluded"); Assert.ok(!props["db.statement"], "db.statement should be excluded"); Assert.ok(!props["db.name"], "db.name should be excluded"); Assert.ok(!props["db.operation"], "db.operation should be excluded"); Assert.equal(props["app.query.id"], "query-123", "Custom attributes should be kept"); } }); this.testCase({ name: "Semantic Exclusion: microsoft.* attributes excluded", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("microsoft-attrs", { kind: eOTelSpanKind.CLIENT, attributes: { "microsoft.internal.flag": true, "microsoft.client.ip": "192.168.1.1", "microsoft.custom": "value", "app.microsoft": "not-excluded" } }); span?.end(); // Assert const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.ok(!props["microsoft.internal.flag"], "microsoft.* should be excluded"); Assert.ok(!props["microsoft.client.ip"], "microsoft.* should be excluded"); Assert.ok(!props["microsoft.custom"], "microsoft.* should be excluded"); Assert.equal(props["app.microsoft"], "not-excluded", "Attributes containing 'microsoft' but not prefixed should be kept"); } }); this.testCase({ name: "Semantic Exclusion: operation.name context tag excluded", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("op-name-span", { kind: eOTelSpanKind.CLIENT, attributes: { "ai.operation.name": "CustomOperation", "custom.operation.name": "should-be-kept" } }); span?.end(); // Assert const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.ok(!props["ai.operation.name"], "ai.operation.name should be excluded"); Assert.equal(props["custom.operation.name"], "should-be-kept", "Similar named custom attributes should be kept"); } }); this.testCase({ name: "Semantic Exclusion: new semantic conventions excluded", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("new-semconv", { kind: eOTelSpanKind.CLIENT, attributes: { [ATTR_HTTP_REQUEST_METHOD]: "GET", [ATTR_HTTP_RESPONSE_STATUS_CODE]: 200, [ATTR_URL_FULL]: "https://example.com", [ATTR_SERVER_ADDRESS]: "example.com", [ATTR_SERVER_PORT]: 443, "app.request.id": "req-123" } }); span?.end(); // Assert const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.ok(!props["http.request.method"], "New http attributes should be excluded"); Assert.ok(!props["http.response.status_code"], "New http attributes should be excluded"); Assert.ok(!props["url.full"], "New url attributes should be excluded"); Assert.ok(!props["server.address"], "New server attributes should be excluded"); Assert.ok(!props["server.port"], "New server attributes should be excluded"); Assert.equal(props["app.request.id"], "req-123", "Custom attributes should be kept"); } }); } private addEdgeCaseTests(): void { this.testCase({ name: "Edge Case: Empty span name", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("", { kind: eOTelSpanKind.CLIENT }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry for empty name"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); Assert.equal((item.baseData as any).name, "", "Should preserve empty name"); } }); this.testCase({ name: "Edge Case: Span with null/undefined attributes", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("null-attrs", { kind: eOTelSpanKind.CLIENT, attributes: { "valid.attr": "value", "null.attr": null as any, "undefined.attr": undefined as any, "zero.attr": 0, "false.attr": false, "empty.string": "" } }); span?.end(); // Assert const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.equal(props["valid.attr"], "value", "Valid attributes should be preserved"); Assert.equal(props["zero.attr"], 0, "Zero values should be preserved"); Assert.equal(props["false.attr"], false, "False values should be preserved"); Assert.equal(props["empty.string"], "", "Empty strings should be preserved"); } }); this.testCase({ name: "Edge Case: Span with extremely long attribute values", test: () => { // Arrange this._trackCalls = []; const veryLongValue = "a".repeat(20000); // Act const span = this._ai.startSpan("long-attrs", { kind: eOTelSpanKind.CLIENT, attributes: { "long.value": veryLongValue } }); span?.end(); // Assert const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.ok(props["long.value"], "Long value should be included"); Assert.equal(props["long.value"], veryLongValue, "Long value should be preserved"); } }); this.testCase({ name: "Edge Case: Span with special characters in name and attributes", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("span-with-特殊字符-émojis-🎉", { kind: eOTelSpanKind.CLIENT, attributes: { "unicode.key": "value with 中文 and émojis 🚀", "special.chars": "tab\there\nnewline\r\ncarriage", "quotes": "\"double\" and 'single' quotes" } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should handle special characters"); const item = this._trackCalls[0]; Assert.ok((item.baseData as any).name.includes("特殊字符"), "Should preserve unicode in name"); const props = (item.baseData as any).properties || {}; Assert.ok(props["unicode.key"], "Should preserve unicode attributes"); Assert.ok(props["special.chars"], "Should preserve special characters"); Assert.ok(props["quotes"], "Should preserve quotes"); } }); this.testCase({ name: "Edge Case: Span without explicit kind defaults appropriately", test: () => { // Arrange this._trackCalls = []; // Act - startSpan with no kind specified const span = this._ai.startSpan("no-kind-span"); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item, "Should have telemetry item"); } }); this.testCase({ name: "Edge Case: Multiple rapid span creations and endings", test: () => { // Arrange this._trackCalls = []; const spanCount = 50; // Act - Create and end many spans rapidly for (let i = 0; i < spanCount; i++) { const span = this._ai.startSpan("rapid-span-" + i, { kind: eOTelSpanKind.CLIENT, attributes: { "span.index": i } }); span?.end(); } // Assert Assert.equal(this._trackCalls.length, spanCount, "Should track all spans"); const firstItem = this._trackCalls[0]; const lastItem = this._trackCalls[spanCount - 1]; Assert.equal((firstItem.baseData as any).properties["span.index"], 0, "First span preserved"); Assert.equal((lastItem.baseData as any).properties["span.index"], spanCount - 1, "Last span preserved"); } }); this.testCase({ name: "Edge Case: Span with array attribute values", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("array-attrs", { kind: eOTelSpanKind.CLIENT, attributes: { "string.array": ["value1", "value2", "value3"], "number.array": [1, 2, 3], "mixed.array": ["string", 123, true] as any } }); span?.end(); // Assert const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.ok(props["string.array"], "Array attributes should be included"); } }); this.testCase({ name: "Edge Case: Span with nested object attributes", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("nested-attrs", { kind: eOTelSpanKind.CLIENT, attributes: { "nested.object": { key: "value", nested: { deep: "data" } } as any, "simple.attr": "simple" } }); span?.end(); // Assert const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.ok(props["simple.attr"], "Simple attributes should work"); } }); this.testCase({ name: "Edge Case: Span with malformed HTTP status codes", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("malformed-status", { kind: eOTelSpanKind.SERVER, attributes: { [SEMATTRS_HTTP_STATUS_CODE]: "not-a-number" as any } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should handle malformed status codes"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); } }); this.testCase({ name: "Edge Case: Span with missing parent context", test: () => { // Arrange this._trackCalls = []; // Act - Explicitly pass null/undefined parent context const span = this._ai.startSpan("orphan-span", { kind: eOTelSpanKind.CLIENT }, undefined); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should handle missing parent"); const item = this._trackCalls[0]; Assert.ok((item.tags as any)["ai.operation.id"], "Should have operation ID"); } }); this.testCase({ name: "Edge Case: Span ended multiple times", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("multi-end", { kind: eOTelSpanKind.CLIENT }); span?.end(); const firstCallCount = this._trackCalls.length; span?.end(); // End again const secondCallCount = this._trackCalls.length; // Assert Assert.equal(firstCallCount, 1, "First end should generate telemetry"); Assert.equal(secondCallCount, 1, "Second end should not generate duplicate telemetry"); } }); this.testCase({ name: "Edge Case: Span with extremely large number of attributes", test: () => { // Arrange this._trackCalls = []; const attributes: any = {}; for (let i = 0; i < 1000; i++) { attributes["attr." + i] = "value" + i; } // Act const span = this._ai.startSpan("many-attrs", { kind: eOTelSpanKind.CLIENT, attributes: attributes }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should handle many attributes"); const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.ok(Object.keys(props).length > 0, "Should have some properties"); } }); this.testCase({ name: "Edge Case: Zero duration span", test: () => { // Arrange this._trackCalls = []; // Act - End span immediately const span = this._ai.startSpan("instant-span", { kind: eOTelSpanKind.CLIENT }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); const duration = (item.baseData as any).duration; Assert.ok(duration !== undefined, "Should have duration field"); } }); this.testCase({ name: "Edge Case: HTTP dependency with missing URL", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("http-no-url", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_HTTP_METHOD]: "GET", [SEMATTRS_HTTP_STATUS_CODE]: 200 // No URL attribute } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should handle missing URL"); const item = this._trackCalls[0]; Assert.equal((item.baseData as any).type, "Http", "Should still be HTTP type"); } }); this.testCase({ name: "Edge Case: Database dependency with missing statement", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("db-no-statement", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_DB_SYSTEM]: "postgresql", [SEMATTRS_DB_NAME]: "testdb" // No statement } }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.equal((item.baseData as any).type, "postgresql", "Should have DB type"); } }); } private addCrossBrowserCompatibilityTests(): void { this.testCase({ name: "Cross-Browser: Handles performance.now() unavailable", test: () => { // Arrange this._trackCalls = []; // Act - Create span when performance.now might not be available const span = this._ai.startSpan("perf-test", { kind: eOTelSpanKind.CLIENT }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should work without performance.now"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should generate valid telemetry"); } }); this.testCase({ name: "Cross-Browser: Handles Date.now() for timing", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("date-timing", { kind: eOTelSpanKind.CLIENT }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.ok((item.baseData as any).duration !== undefined, "Should have duration"); Assert.ok((item.baseData as any).duration >= 0, "Duration should be non-negative"); } }); this.testCase({ name: "Cross-Browser: String encoding compatibility", test: () => { // Arrange this._trackCalls = []; const testStrings = [ "ASCII only", "UTF-8: 你好世界", "Emoji: 🎉🚀💻", "Latin: café résumé", "Mixed: Hello世界🌍" ]; // Act for (let i = 0; i < testStrings.length; i++) { const span = this._ai.startSpan(testStrings[i], { kind: eOTelSpanKind.CLIENT, attributes: { "test.string": testStrings[i] } }); span?.end(); } // Assert Assert.equal(this._trackCalls.length, testStrings.length, "Should handle all encodings"); for (let i = 0; i < testStrings.length; i++) { const item = this._trackCalls[i]; Assert.ok(item.baseData, "Should have baseData for encoding test " + i); } } }); this.testCase({ name: "Cross-Browser: JSON serialization of attributes", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("json-test", { kind: eOTelSpanKind.CLIENT, attributes: { "number": 123, "string": "test", "boolean": true, "float": 123.456, "negative": -999, "zero": 0 } }); span?.end(); // Assert const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.equal(typeof props["number"], "number", "Numbers should remain numbers"); Assert.equal(typeof props["string"], "string", "Strings should remain strings"); Assert.equal(typeof props["boolean"], "boolean", "Booleans should remain booleans"); } }); this.testCase({ name: "Cross-Browser: Large payload handling", test: () => { // Arrange this._trackCalls = []; const largeAttributes: any = {}; for (let i = 0; i < 100; i++) { largeAttributes["large.attr." + i] = "x".repeat(100); } // Act const span = this._ai.startSpan("large-payload", { kind: eOTelSpanKind.CLIENT, attributes: largeAttributes }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should handle large payloads"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should generate telemetry"); } }); this.testCase({ name: "Cross-Browser: Handles undefined vs null attributes", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("null-undefined", { kind: eOTelSpanKind.CLIENT, attributes: { "explicit.null": null as any, "explicit.undefined": undefined as any, "valid.value": "test" } }); span?.end(); // Assert const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.equal(props["valid.value"], "test", "Valid values should be preserved"); } }); this.testCase({ name: "Cross-Browser: Whitespace handling in attribute keys", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("whitespace-keys", { kind: eOTelSpanKind.CLIENT, attributes: { "normal.key": "value1", " leading.space": "value2", "trailing.space ": "value3", "has spaces": "value4" } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should handle whitespace in keys"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); } }); this.testCase({ name: "Cross-Browser: Number precision and special values", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("number-precision", { kind: eOTelSpanKind.CLIENT, attributes: { "max.safe.integer": Number.MAX_SAFE_INTEGER, "min.safe.integer": Number.MIN_SAFE_INTEGER, "large.float": 1.7976931348623157e+308, "small.float": 5e-324, "infinity": Infinity as any, "neg.infinity": -Infinity as any, "not.a.number": NaN as any } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should handle special number values"); const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.ok(props["max.safe.integer"] !== undefined, "Should handle large integers"); } }); this.testCase({ name: "Cross-Browser: URL parsing with various formats", test: () => { // Arrange this._trackCalls = []; const urls = [ "http://example.com", "https://example.com:8080/path", "http://example.com/path?query=value", "https://user:pass@example.com/path", "http://192.168.1.1:3000", "https://[::1]:8080/path" ]; // Act for (const url of urls) { const span = this._ai.startSpan("url-test", { kind: eOTelSpanKind.CLIENT, attributes: { [SEMATTRS_HTTP_URL]: url } }); span?.end(); } // Assert Assert.equal(this._trackCalls.length, urls.length, "Should handle all URL formats"); } }); this.testCase({ name: "Cross-Browser: Timestamp handling across timezones", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("timezone-test", { kind: eOTelSpanKind.CLIENT }); span?.end(); // Assert const item = this._trackCalls[0]; Assert.ok(item.time, "Should have timestamp"); const timestamp = new Date(item.time || "").getTime(); Assert.ok(timestamp > 0, "Timestamp should be valid"); } }); this.testCase({ name: "Cross-Browser: Memory efficient attribute storage", test: () => { // Arrange this._trackCalls = []; // Act - Create many spans to test memory handling for (let i = 0; i < 10; i++) { const span = this._ai.startSpan("memory-test-" + i, { kind: eOTelSpanKind.CLIENT, attributes: { "iteration": i, "data": "x".repeat(1000) } }); span?.end(); } // Assert Assert.equal(this._trackCalls.length, 10, "Should handle multiple spans"); Assert.ok(this._trackCalls[0].baseData, "First span should have data"); Assert.ok(this._trackCalls[9].baseData, "Last span should have data"); } }); this.testCase({ name: "Cross-Browser: Concurrent span operations", test: () => { // Arrange this._trackCalls = []; const spans: any[] = []; // Act - Create multiple spans before ending any for (let i = 0; i < 5; i++) { const span = this._ai.startSpan("concurrent-" + i, { kind: eOTelSpanKind.CLIENT, attributes: { "index": i } }); spans.push(span); } // End all spans for (const span of spans) { span?.end(); } // Assert Assert.equal(this._trackCalls.length, 5, "Should handle concurrent spans"); } }); this.testCase({ name: "Cross-Browser: RegExp in attribute values", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("regexp-test", { kind: eOTelSpanKind.CLIENT, attributes: { "pattern": "/test/gi" as any, "normal": "value" } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should handle RegExp-like values"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); } }); this.testCase({ name: "Cross-Browser: Function and Symbol values filtered", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("special-types", { kind: eOTelSpanKind.CLIENT, attributes: { "function": (() => "test") as any, "symbol": Symbol("test") as any, "normal": "value" } }); span?.end(); // Assert const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.equal(props["normal"], "value", "Normal values should be preserved"); } }); this.testCase({ name: "Cross-Browser: Circular reference handling", test: () => { // Arrange this._trackCalls = []; const circular: any = { a: "value" }; circular.self = circular; // Act const span = this._ai.startSpan("circular-test", { kind: eOTelSpanKind.CLIENT, attributes: { "circular": circular, "normal": "value" } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should handle circular references gracefully"); const item = this._trackCalls[0]; const props = (item.baseData as any).properties || {}; Assert.equal(props["normal"], "value", "Normal attributes should still work"); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/StartSpan.Tests.ts ================================================ import { AITestClass, Assert } from '@microsoft/ai-test-framework'; import { ApplicationInsights } from '../../../src/applicationinsights-web'; import { eOTelSpanKind, eOTelSpanStatusCode, ITelemetryItem } from "@microsoft/applicationinsights-core-js"; export class StartSpanTests extends AITestClass { private static readonly _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; private static readonly _connectionString = `InstrumentationKey=${StartSpanTests._instrumentationKey}`; private _ai!: ApplicationInsights; // Track calls to track private _trackCalls: ITelemetryItem[] = []; constructor(testName?: string) { super(testName || "StartSpanTests"); } public testInitialize() { try { this.useFakeServer = false; this._trackCalls = []; this._ai = new ApplicationInsights({ config: { connectionString: StartSpanTests._connectionString, disableAjaxTracking: false, disableXhr: false, maxBatchInterval: 0, disableExceptionTracking: false } }); // Initialize the SDK this._ai.loadAppInsights(); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; } catch (e) { console.error('Failed to initialize tests: ' + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public registerTests() { this.addTests(); } private addTests(): void { this.testCase({ name: "StartSpan: startSpan method should exist on ApplicationInsights instance", test: () => { // Verify that startSpan method exists Assert.ok(this._ai, "ApplicationInsights should be initialized"); Assert.ok(typeof this._ai.startSpan === 'function', "startSpan method should exist"); // Check core initialization Assert.ok(this._ai.core, "Core should be available"); const core = this._ai.core; if (core) { // Check if core has startSpan method Assert.ok(typeof core.startSpan === 'function', "Core should have startSpan method"); // Test basic startSpan call on the core directly after initialization const coreSpan = core.startSpan("debug-core-span"); Assert.ok(coreSpan !== null, `Core startSpan returned ${coreSpan} instead of a span object`); } // Test basic startSpan call after initialization const span = this._ai.startSpan("debug-span"); // Should now return a valid span object Assert.ok(span !== null, `startSpan returned ${span} instead of a span object`); Assert.ok(typeof span!.isRecording === 'function', "Span should have isRecording method"); Assert.ok(typeof span!.end === 'function', "Span should have end method"); const isRecording = span!.isRecording(); Assert.ok(typeof isRecording === 'boolean', `isRecording should return boolean, got ${typeof isRecording}: ${isRecording}`); } }); this.testCase({ name: "StartSpan: Recording span should trigger track when span ends", test: () => { // Clear previous calls this._trackCalls = []; // Create a recording span using startSpan const span = this._ai.startSpan("test-recording-span", { kind: eOTelSpanKind.CLIENT, attributes: { "test.attribute": "test-value", "operation.type": "http" } }); Assert.ok(span, "Span should be created"); // Verify it's a recording span Assert.ok(span!.isRecording(), "Span should be recording"); // End the span - this should trigger track via the onEnd callback span!.end(); // Verify that track was called Assert.equal(1, this._trackCalls.length, "track should have been called once for recording span"); // Add defensive check for the telemetry item Assert.ok(this._trackCalls.length > 0, "Should have at least one track call"); const item = this._trackCalls[0]; Assert.ok(item, "Telemetry item should exist"); Assert.ok(item.name, "Item name should be present"); Assert.ok(item.baseData, "Base data should be present"); Assert.ok(item.baseData.properties, "Custom properties should be present"); Assert.equal("test-value", item.baseData.properties["test.attribute"], "Should include span attributes"); Assert.equal("http", item.baseData.properties["operation.type"], "Should include all span attributes"); } }); this.testCase({ name: "StartSpan: Non-recording span should NOT trigger track when span ends", test: () => { // Clear previous calls this._trackCalls = []; // NOTE: Currently all spans are recording by default // When the recording: false option is implemented, this test will need to be updated // For now, we'll create a regular span and document the expected behavior const span = this._ai.startSpan("test-would-be-non-recording-span", { kind: eOTelSpanKind.CLIENT, attributes: { "test.attribute": "non-recording-value" } }); Assert.ok(span, "Span should be created"); // Currently, all spans are recording by default // eslint-disable-next-line @typescript-eslint/no-non-null-assertion Assert.ok(span!.isRecording(), "Span should be recording (default behavior)"); // End the span - this WILL trigger track since it's recording // eslint-disable-next-line @typescript-eslint/no-non-null-assertion span!.end(); // Currently expecting 1 call since all spans are recording // When non-recording spans are implemented, this should be 0 Assert.equal(1, this._trackCalls.length, "track should be called for recording span (current default behavior)"); // TODO: Update this test when recording: false option is implemented // The test should then use recording: false and expect 0 track calls } }); this.testCase({ name: "StartSpan: Multiple recording spans should each trigger track", test: () => { // Clear previous calls this._trackCalls = []; // Create multiple recording spans const span1 = this._ai.startSpan("span-1", { attributes: { "span.number": 1 } }); const span2 = this._ai.startSpan("span-2", { attributes: { "span.number": 2 } }); Assert.ok(span1 && span2, "Both spans should be created"); // End both spans span1!.end(); span2!.end(); // Should have two track calls Assert.equal(2, this._trackCalls.length, "track should have been called twice"); // Verify both calls have the correct data const item1 = this._trackCalls.find(item => item.baseData && item.baseData.properties && item.baseData.name === "span-1"); const item2 = this._trackCalls.find(item => item.baseData && item.baseData.properties && item.baseData.name === "span-2"); Assert.ok(item1, "Should have item for span-1"); Assert.ok(item2, "Should have item for span-2"); if (item1 && item2) { Assert.equal(1, item1.baseData.properties["span.number"], "First span should have correct attribute"); Assert.equal(2, item2.baseData.properties["span.number"], "Second span should have correct attribute"); } } }); this.testCase({ name: "StartSpan: Error recording spans should generate telemetry with error status", test: () => { // Clear previous calls this._trackCalls = []; // Create an error span const span = this._ai.startSpan("error-span", { kind: eOTelSpanKind.CLIENT, attributes: { "error": true, "error.message": "Something went wrong" } }); Assert.ok(span, "Span should be created"); // Set error status on the span // eslint-disable-next-line @typescript-eslint/no-non-null-assertion span!.setStatus({ code: eOTelSpanStatusCode.ERROR, message: "Test error occurred" }); // End the span // eslint-disable-next-line @typescript-eslint/no-non-null-assertion span!.end(); // Verify track was called Assert.equal(1, this._trackCalls.length, "track should have been called once"); const item = this._trackCalls[0]; Assert.ok(item, "Telemetry item should be present"); Assert.ok(item.baseData, "Base data should be present"); Assert.ok(item.baseData.properties, "Properties should be present"); Assert.equal("error-span", item.baseData.name, "Should include span name"); Assert.ok(item.baseData.properties, "Custom properties should be present"); Assert.equal(true, item.baseData.properties["error"], "Should include error attribute"); Assert.equal("Something went wrong", item.baseData.properties["error.message"], "Should include error message"); } }); this.testCase({ name: "StartSpan: startSpan with parent context should work", test: () => { // Clear previous calls this._trackCalls = []; // Create span with optional parent context parameter // (We'll pass null for now since we're not testing context propagation yet) const parentContext = null; // Create span with parent context const span = this._ai.startSpan("child-span", { attributes: { "has.parent": false } }); Assert.ok(span, "Span should be created with parent context"); // End the span // eslint-disable-next-line @typescript-eslint/no-non-null-assertion span!.end(); // Verify track was called Assert.equal(1, this._trackCalls.length, "track should have been called once"); const item = this._trackCalls[0]; Assert.ok(item, "Telemetry item should be present"); Assert.ok(item.baseData && item.baseData.properties, "Properties should be present"); Assert.equal("child-span", item.baseData.name, "Should include span name"); Assert.equal(false, item.baseData.properties["has.parent"], "Should include span attributes"); } }); this.testCase({ name: "StartSpan: startSpan should return valid span when trace provider is available", test: () => { // After initialization, the trace provider should be available // and startSpan should return a valid span object const span = this._ai.startSpan("test-span"); // Now that initialization is complete, we should get a valid span Assert.ok(span !== null, "startSpan should return a valid span after initialization"); Assert.ok(typeof span === 'object', "Span should be an object"); Assert.ok(typeof span!.end === 'function', "Span should have end method"); Assert.ok(typeof span!.isRecording === 'function', "Span should have isRecording method"); span!.end(); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/TelemetryItemGeneration.Tests.ts ================================================ import { AITestClass, Assert } from '@microsoft/ai-test-framework'; import { ApplicationInsights } from '../../../src/applicationinsights-web'; import { eOTelSpanKind, eOTelSpanStatusCode, ITelemetryItem } from "@microsoft/applicationinsights-core-js"; export class TelemetryItemGenerationTests extends AITestClass { private static readonly _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; private static readonly _connectionString = `InstrumentationKey=${TelemetryItemGenerationTests._instrumentationKey}`; private _ai!: ApplicationInsights; private _trackCalls: ITelemetryItem[] = []; constructor(testName?: string) { super(testName || "TelemetryItemGenerationTests"); } public testInitialize() { try { this.useFakeServer = false; this._trackCalls = []; this._ai = new ApplicationInsights({ config: { connectionString: TelemetryItemGenerationTests._connectionString, disableAjaxTracking: false, disableXhr: false, maxBatchInterval: 0, disableExceptionTracking: false } }); this._ai.loadAppInsights(); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; } catch (e) { console.error('Failed to initialize tests: ' + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public registerTests() { this.addSpanKindTests(); this.addStatusCodeTests(); this.addAttributeTests(); this.addTelemetryItemStructureTests(); this.addComplexScenarioTests(); } private addSpanKindTests(): void { this.testCase({ name: "SpanKind: INTERNAL span generates telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("internal-operation", { kind: eOTelSpanKind.INTERNAL, attributes: { "operation.name": "internal-task" } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate one telemetry item"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); Assert.ok(item.baseData.properties, "Should have properties"); } }); this.testCase({ name: "SpanKind: CLIENT span generates telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("client-request", { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "GET", "http.url": "https://example.com/api", "custom.attribute": "custom-value" } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate one telemetry item"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); // Semantic attributes like http.method are excluded from properties Assert.ok(!item.baseData.properties || !item.baseData.properties["http.method"], "http.method should not be in properties (mapped to baseData)"); // Custom attributes should be in properties Assert.equal(item.baseData.properties?.["custom.attribute"], "custom-value", "Custom attributes should be in properties"); } }); this.testCase({ name: "SpanKind: SERVER span generates telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("server-handler", { kind: eOTelSpanKind.SERVER, attributes: { "http.method": "POST", "http.status_code": 200, "custom.server.id": "server-123" } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate one telemetry item"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); // Semantic attributes are excluded from properties Assert.ok(!item.baseData.properties || !item.baseData.properties["http.method"], "http.method should not be in properties (mapped to baseData)"); // Custom attributes should be in properties Assert.equal(item.baseData.properties?.["custom.server.id"], "server-123", "Custom attributes should be in properties"); } }); this.testCase({ name: "SpanKind: PRODUCER span generates telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("message-producer", { kind: eOTelSpanKind.PRODUCER, attributes: { "messaging.system": "kafka", "messaging.destination": "orders-topic", "producer.id": "producer-456" } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate one telemetry item"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); // messaging.* attributes may or may not be excluded depending on semantic conventions // Custom attributes should be in properties Assert.equal(item.baseData.properties?.["producer.id"], "producer-456", "Custom attributes should be in properties"); } }); this.testCase({ name: "SpanKind: CONSUMER span generates telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("message-consumer", { kind: eOTelSpanKind.CONSUMER, attributes: { "messaging.system": "rabbitmq", "messaging.operation": "receive", "consumer.group": "group-789" } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate one telemetry item"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); // messaging.* attributes may or may not be excluded depending on semantic conventions // Custom attributes should be in properties Assert.equal(item.baseData.properties?.["consumer.group"], "group-789", "Custom attributes should be in properties"); } }); this.testCase({ name: "SpanKind: all span kinds generate independent telemetry", test: () => { // Arrange this._trackCalls = []; const spanKinds = [ eOTelSpanKind.INTERNAL, eOTelSpanKind.CLIENT, eOTelSpanKind.SERVER, eOTelSpanKind.PRODUCER, eOTelSpanKind.CONSUMER ]; // Act spanKinds.forEach((kind, index) => { const span = this._ai.startSpan(`span-kind-${index}`, { kind }); span?.end(); }); // Assert Assert.equal(this._trackCalls.length, spanKinds.length, "Each span kind should generate telemetry"); } }); } private addStatusCodeTests(): void { this.testCase({ name: "StatusCode: UNSET status generates telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("unset-status-span"); // Don't set status - defaults to UNSET span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); } }); this.testCase({ name: "StatusCode: OK status generates telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("ok-status-span"); span?.setStatus({ code: eOTelSpanStatusCode.OK, message: "Operation successful" }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); } }); this.testCase({ name: "StatusCode: ERROR status generates telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("error-status-span"); span?.setStatus({ code: eOTelSpanStatusCode.ERROR, message: "Operation failed" }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); } }); this.testCase({ name: "StatusCode: status with message includes message in telemetry", test: () => { // Arrange this._trackCalls = []; const errorMessage = "Database connection timeout"; // Act const span = this._ai.startSpan("status-with-message"); span?.setStatus({ code: eOTelSpanStatusCode.ERROR, message: errorMessage }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); // Note: Implementation may include status message in properties or elsewhere const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData with status information"); } }); this.testCase({ name: "StatusCode: changing status before end affects telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("changing-status-span"); span?.setStatus({ code: eOTelSpanStatusCode.OK }); span?.setStatus({ code: eOTelSpanStatusCode.ERROR, message: "Changed to error" }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); // The final status (ERROR) should be reflected in telemetry const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData with final status"); } }); this.testCase({ name: "StatusCode: multiple spans with different statuses", test: () => { // Arrange this._trackCalls = []; // Act const span1 = this._ai.startSpan("span-ok"); span1?.setStatus({ code: eOTelSpanStatusCode.OK }); span1?.end(); const span2 = this._ai.startSpan("span-error"); span2?.setStatus({ code: eOTelSpanStatusCode.ERROR }); span2?.end(); const span3 = this._ai.startSpan("span-unset"); // No status set span3?.end(); // Assert Assert.equal(this._trackCalls.length, 3, "Should generate telemetry for all spans"); } }); } private addAttributeTests(): void { this.testCase({ name: "Attributes: span with no attributes generates telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("no-attributes-span"); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); } }); this.testCase({ name: "Attributes: span with string attributes", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("string-attrs-span", { attributes: { "user.id": "user123", "session.id": "session456", "operation.name": "checkout" } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.baseData?.properties, "Should have properties"); // These custom attributes should be in properties Assert.equal(item.baseData.properties["user.id"], "user123", "Should include custom string attributes"); Assert.equal(item.baseData.properties["session.id"], "session456", "Should include custom string attributes"); // operation.name is a context tag key and gets excluded from properties } }); this.testCase({ name: "Attributes: span with number attributes", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("number-attrs-span", { attributes: { "request.size": 1024, "response.time": 156.78, "retry.count": 3 } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.baseData?.properties, "Should have properties"); // Custom number attributes should be in properties Assert.equal(item.baseData.properties["request.size"], 1024, "Should include custom number attributes"); Assert.equal(item.baseData.properties["response.time"], 156.78, "Should include custom number attributes"); } }); this.testCase({ name: "Attributes: span with boolean attributes", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("boolean-attrs-span", { attributes: { "cache.hit": true, "auth.required": false, "retry.enabled": true } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.baseData?.properties, "Should have properties"); Assert.equal(item.baseData.properties["cache.hit"], true, "Should include boolean attributes"); } }); this.testCase({ name: "Attributes: span with mixed type attributes", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("mixed-attrs-span", { attributes: { "string.attr": "value", "number.attr": 42, "boolean.attr": true, "float.attr": 3.14 } }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.baseData?.properties, "Should have properties"); Assert.equal(item.baseData.properties["string.attr"], "value"); Assert.equal(item.baseData.properties["number.attr"], 42); Assert.equal(item.baseData.properties["boolean.attr"], true); } }); this.testCase({ name: "Attributes: setAttribute after creation adds to telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("dynamic-attrs-span"); span?.setAttribute("initial.attr", "initial"); span?.setAttribute("added.later", "later-value"); span?.setAttribute("number.added", 999); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.baseData?.properties, "Should have properties"); Assert.equal(item.baseData.properties["initial.attr"], "initial"); Assert.equal(item.baseData.properties["added.later"], "later-value"); Assert.equal(item.baseData.properties["number.added"], 999); } }); this.testCase({ name: "Attributes: setAttributes adds multiple attributes to telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("batch-attrs-span"); span?.setAttributes({ "batch.attr1": "value1", "batch.attr2": "value2", "batch.attr3": 123 }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.baseData?.properties, "Should have properties"); Assert.equal(item.baseData.properties["batch.attr1"], "value1"); Assert.equal(item.baseData.properties["batch.attr2"], "value2"); Assert.equal(item.baseData.properties["batch.attr3"], 123); } }); this.testCase({ name: "Attributes: updating attribute value reflects in telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("update-attr-span"); span?.setAttribute("status", "pending"); span?.setAttribute("status", "in-progress"); span?.setAttribute("status", "completed"); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.baseData?.properties, "Should have properties"); Assert.equal(item.baseData.properties["status"], "completed", "Should reflect final attribute value"); } }); } private addTelemetryItemStructureTests(): void { this.testCase({ name: "Structure: telemetry item has required fields", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("structure-test-span"); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.name, "Should have name"); Assert.ok(item.baseData, "Should have baseData"); Assert.ok(item.baseData.properties, "Should have properties"); } }); this.testCase({ name: "Structure: span name is in telemetry", test: () => { // Arrange this._trackCalls = []; const spanName = "my-custom-operation"; // Act const span = this._ai.startSpan(spanName); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; // Span name is in baseData.name, not properties.name Assert.ok(item.baseData, "Should have baseData"); Assert.equal(item.baseData.name, spanName, "Span name should be in baseData.name"); } }); this.testCase({ name: "Structure: updated span name reflects in telemetry", test: () => { // Arrange this._trackCalls = []; const originalName = "original-name"; const updatedName = "updated-name"; // Act const span = this._ai.startSpan(originalName); span?.updateName(updatedName); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; // Updated span name should be in baseData.name Assert.ok(item.baseData, "Should have baseData"); Assert.equal(item.baseData.name, updatedName, "Updated span name should be in baseData.name"); } }); this.testCase({ name: "Structure: trace context is in telemetry", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("trace-context-span"); const spanContext = span?.spanContext(); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; // Telemetry should include trace context information Assert.ok(spanContext, "Span should have context"); Assert.ok(spanContext?.traceId, "Should have traceId"); Assert.ok(spanContext?.spanId, "Should have spanId"); } }); this.testCase({ name: "Structure: multiple spans generate separate telemetry items", test: () => { // Arrange this._trackCalls = []; // Act const span1 = this._ai.startSpan("span-1"); span1?.end(); const span2 = this._ai.startSpan("span-2"); span2?.end(); const span3 = this._ai.startSpan("span-3"); span3?.end(); // Assert Assert.equal(this._trackCalls.length, 3, "Should generate 3 telemetry items"); // Span names are in baseData.name, not properties.name const names = this._trackCalls.map(item => item.baseData?.name); Assert.ok(names.includes("span-1"), "Should include span-1"); Assert.ok(names.includes("span-2"), "Should include span-2"); Assert.ok(names.includes("span-3"), "Should include span-3"); } }); } private addComplexScenarioTests(): void { this.testCase({ name: "Complex: span with kind, status, and attributes", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("complex-span", { kind: eOTelSpanKind.CLIENT, attributes: { "http.method": "POST", "http.url": "https://api.example.com/users", "http.status_code": 201, "request.id": "req-12345", "user.action": "create" } }); span?.setStatus({ code: eOTelSpanStatusCode.OK, message: "User created successfully" }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.baseData, "Should have baseData"); // Semantic attributes are excluded from properties Assert.ok(!item.baseData.properties || !item.baseData.properties["http.method"], "http.method should not be in properties"); // Custom attributes should be in properties Assert.equal(item.baseData.properties?.["request.id"], "req-12345", "Custom attributes should be in properties"); Assert.equal(item.baseData.properties?.["user.action"], "create", "Custom attributes should be in properties"); } }); this.testCase({ name: "Complex: parent-child spans generate separate telemetry", test: () => { // Arrange this._trackCalls = []; // Act const parentSpan = this._ai.startSpan("parent-operation"); const parentContext = parentSpan?.spanContext(); const childSpan = this._ai.startSpan("child-operation", undefined, parentContext); childSpan?.end(); parentSpan?.end(); // Assert Assert.equal(this._trackCalls.length, 2, "Should generate telemetry for both spans"); // Span names are in baseData.name, not properties.name const names = this._trackCalls.map(item => item.baseData?.name); Assert.ok(names.includes("child-operation"), "Should include child telemetry"); Assert.ok(names.includes("parent-operation"), "Should include parent telemetry"); } }); this.testCase({ name: "Complex: span with dynamic attributes during execution", test: () => { // Arrange this._trackCalls = []; // Act const span = this._ai.startSpan("dynamic-execution-span", { attributes: { "phase": "start" } }); span?.setAttribute("phase", "processing"); span?.setAttribute("items.processed", 50); span?.setAttribute("phase", "finalizing"); span?.setAttribute("items.processed", 100); span?.setStatus({ code: eOTelSpanStatusCode.OK }); span?.end(); // Assert Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); const item = this._trackCalls[0]; Assert.ok(item.baseData?.properties, "Should have properties"); Assert.equal(item.baseData.properties["phase"], "finalizing", "Should have final phase value"); Assert.equal(item.baseData.properties["items.processed"], 100, "Should have final processed count"); } }); this.testCase({ name: "Complex: all span kinds with attributes and status", test: () => { // Arrange this._trackCalls = []; const testData = [ { kind: eOTelSpanKind.INTERNAL, name: "internal-op", attr: "internal-value" }, { kind: eOTelSpanKind.CLIENT, name: "client-op", attr: "client-value" }, { kind: eOTelSpanKind.SERVER, name: "server-op", attr: "server-value" }, { kind: eOTelSpanKind.PRODUCER, name: "producer-op", attr: "producer-value" }, { kind: eOTelSpanKind.CONSUMER, name: "consumer-op", attr: "consumer-value" } ]; // Act testData.forEach(data => { const span = this._ai.startSpan(data.name, { kind: data.kind, attributes: { "operation.type": data.attr } }); span?.setStatus({ code: eOTelSpanStatusCode.OK }); span?.end(); }); // Assert Assert.equal(this._trackCalls.length, testData.length, "Should generate telemetry for all span types"); testData.forEach(data => { // Span names are in baseData.name, not properties.name const telemetry = this._trackCalls.find( item => item.baseData?.name === data.name ); Assert.ok(telemetry, `Should have telemetry for ${data.name}`); // Custom attributes should be in properties Assert.equal(telemetry?.baseData?.properties?.["operation.type"], data.attr, `Should have correct attributes for ${data.name}`); }); } }); this.testCase({ name: "Complex: non-recording spans do not generate telemetry", test: () => { // Arrange this._trackCalls = []; // Act const recordingSpan = this._ai.startSpan("recording-span", { recording: true }); recordingSpan?.end(); const nonRecordingSpan = this._ai.startSpan("non-recording-span", { recording: false }); nonRecordingSpan?.end(); // Assert // Recording span should generate telemetry, non-recording should not // Span names are in baseData.name, not properties.name const recordingTelemetry = this._trackCalls.find( item => item.baseData?.name === "recording-span" ); const nonRecordingTelemetry = this._trackCalls.find( item => item.baseData?.name === "non-recording-span" ); Assert.ok(recordingTelemetry, "Recording span should generate telemetry"); Assert.ok(!nonRecordingTelemetry, "Non-recording span should not generate telemetry"); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/ThrottleSentMessage.tests.ts ================================================ import { ApplicationInsights, ApplicationInsightsContainer, IApplicationInsights, IConfig, IConfiguration, LoggingSeverity, Snippet, _eInternalMessageId } from '../../../src/applicationinsights-web' import { AITestClass, Assert} from '@microsoft/ai-test-framework'; import { IThrottleInterval, IThrottleLimit, IThrottleMgrConfig } from '@microsoft/applicationinsights-core-js'; import { SinonSpy } from 'sinon'; import { AppInsightsSku } from '../../../src/AISku'; import { createSnippetV5 } from './testSnippetV5'; import { FeatureOptInMode, newId } from '@microsoft/applicationinsights-core-js'; import { createSnippetV6 } from './testSnippetV6'; const TestInstrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; const tconfig = { disabled: false, limit: { samplingRate: 1000000, maxSendNumber:100 } as IThrottleLimit, interval: { monthInterval: 1, daysOfMonth: [1], // must add here dayInterval: undefined } as IThrottleInterval } as IThrottleMgrConfig; export class ThrottleSentMessage extends AITestClass { private _ai: IApplicationInsights; private getAi: ApplicationInsights; private _config: IConfiguration | IConfig; private _logger; constructor() { super("ThrottleSentMessage"); } public _getTestConfig() { let config: IConfiguration & IConfig = { instrumentationKey: TestInstrumentationKey, disableAjaxTracking: false, disableFetchTracking: false, enableRequestHeaderTracking: true, enableResponseHeaderTracking: true, maxBatchInterval: 2500, disableExceptionTracking: false, enableCorsCorrelation: true, samplingPercentage: 50, convertUndefined: "test-value", disablePageUnloadEvents: [ "beforeunload" ], extensionConfig: { ["AppInsightsCfgSyncPlugin"]: { cfgUrl: "" } } }; return config; } public testInitialize() { try { if (window.localStorage){ window.localStorage.clear(); } this.useFakeServer = false; this._config = this._getTestConfig(); const init = new ApplicationInsights({ config: this._config }); this._ai = init.loadAppInsights(); this.getAi = init; let core = this._ai['core']; this._logger = core.logger; } catch (e) { console.error('Failed to initialize'); } } public testFinishedCleanup(): void { if (this._ai && this._ai.unload) { // force unload this._ai.unload(false); } if (window.localStorage){ window.localStorage.clear(); } } public registerTests() { this.cdnDeprecatedMessageTests(); this.ikeyMessageTests(); this.snippetVerMessageTests(); } public cdnDeprecatedMessageTests(): void { this.testCase({ name: "ThrottleSentMessage: Message is sent when az416426 is used", useFakeTimers: true, test: () => { Assert.ok(this._ai, 'ApplicationInsights SDK exists'); Assert.ok(this._ai.appInsights, 'App Analytics exists'); Assert.equal(true, this._ai.appInsights.isInitialized(), 'App Analytics is initialized'); Assert.ok(this._ai.appInsights.core, 'Core exists'); Assert.equal(true, this._ai.appInsights.core.isInitialized(), 'Core is initialized'); let loggingSpy = this.sandbox.stub(this._logger, 'throwInternal'); let config = this.getAi.config; config.throttleMgrCfg= {[_eInternalMessageId.CdnDeprecation]:tconfig}; config.featureOptIn = {["CdnUsage"]: {mode: FeatureOptInMode.enable}}; this.clock.tick(12); // wait enough time for negative test Assert.equal(loggingSpy.callCount, 0); // first enable featureOptin, then enable throttleMsg config.featureOptIn = {["CdnUsage"]: {mode: FeatureOptInMode.enable},["iKeyUsage"]: {mode: FeatureOptInMode.enable}}; config.throttleMgrCfg= {[_eInternalMessageId.CdnDeprecation]:tconfig, [_eInternalMessageId.DefaultThrottleMsgKey]:tconfig}; this._ai.context.internal.sdkSrc = "az416426"; this.clock.tick(1); Assert.equal(loggingSpy.called, 1); Assert.equal(_eInternalMessageId.CdnDeprecation, loggingSpy.args[0][1]); let message= loggingSpy.args[0][2]; Assert.ok(message.includes("Cdn")); } }); this.testCase({ name: "ThrottleSentMessage: Message will not be sent again when other config change", useFakeTimers: true, test: () => { Assert.ok(this._ai, 'ApplicationInsights SDK exists'); Assert.ok(this._ai.appInsights, 'App Analytics exists'); Assert.equal(true, this._ai.appInsights.isInitialized(), 'App Analytics is initialized'); Assert.ok(this._ai.appInsights.core, 'Core exists'); Assert.equal(true, this._ai.appInsights.core.isInitialized(), 'Core is initialized'); let loggingSpy = this.sandbox.stub(this._logger, 'throwInternal'); let config = this.getAi.config; config.throttleMgrCfg= {[_eInternalMessageId.CdnDeprecation]:tconfig, [_eInternalMessageId.DefaultThrottleMsgKey]:tconfig}; config.featureOptIn = {["CdnUsage"]: {mode: FeatureOptInMode.enable},["iKeyUsage"]: {mode: FeatureOptInMode.enable}}; this._ai.context.internal.sdkSrc = "az416426"; this.clock.tick(1); Assert.equal(loggingSpy.called, 1); console.log("is called", loggingSpy.callCount); Assert.equal(_eInternalMessageId.CdnDeprecation, loggingSpy.args[0][1]); let message= loggingSpy.args[0][2]; Assert.ok(message.includes("Cdn")); config.instrumentationKey = "newinstrumentkey"; this.clock.tick(1); Assert.equal(loggingSpy.called, 1); } }); } public ikeyMessageTests(): void { this.testCase({ name: "ThrottleSentMessage: Message is sent when user use connection string", useFakeTimers: true, test: () => { Assert.ok(this._ai, 'ApplicationInsights SDK exists'); Assert.ok(this._ai.appInsights, 'App Analytics exists'); Assert.equal(true, this._ai.appInsights.isInitialized(), 'App Analytics is initialized'); Assert.ok(this._ai.appInsights.core, 'Core exists'); Assert.equal(true, this._ai.appInsights.core.isInitialized(), 'Core is initialized'); let loggingSpy = this.sandbox.stub(this._logger, 'throwInternal'); let config = this.getAi.config; // test throttleCfg has controll on message sending config.throttleMgrCfg= {[_eInternalMessageId.InstrumentationKeyDeprecation]:tconfig, [_eInternalMessageId.DefaultThrottleMsgKey]:tconfig}; this.clock.tick(1); // TODO: the sequence of these two changes cannot be reversed config.featureOptIn = {["iKeyUsage"]: {mode: FeatureOptInMode.enable}}; this.clock.tick(1); Assert.equal(loggingSpy.called, 1); Assert.equal(_eInternalMessageId.InstrumentationKeyDeprecation, loggingSpy.args[0][1]); let message= loggingSpy.args[0][2]; Assert.ok(message.includes("Instrumentation key")); } }); this.testCase({ name: "ThrottleSentMessage: Message will not be sent when user turn off message", useFakeTimers: true, test: () => { let loggingSpy = this.sandbox.stub(this._logger, 'throwInternal'); let config = this._getTestConfig(); config.throttleMgrCfg= {[_eInternalMessageId.InstrumentationKeyDeprecation]:tconfig, [_eInternalMessageId.DefaultThrottleMsgKey]:tconfig}; config.featureOptIn = {["iKeyUsage"]: {mode: FeatureOptInMode.disable}} let init = new ApplicationInsights({ config: config }); let ai = init.loadAppInsights(); Assert.equal(true, ai.appInsights.core.isInitialized(),'Core is initialized'); this.clock.tick(12); // wait enough time for negative test Assert.equal(loggingSpy.callCount, 0); ai.unload(false); } }); } public snippetVerMessageTests(){ this.testCase({ name: "ThrottleSentMessage: Message will be sent for ver 5 snippet", useFakeTimers: true, test: () => { let pieceConfig = this._getTestConfig() let myconfig = {src:"", cfg:pieceConfig}; let snippet = this._initializeSnippet(createSnippetV5(myconfig)); let getcore = snippet['core']; let getcoreLogger = getcore.logger; let loggingSpy = this.sandbox.stub(getcoreLogger, 'throwInternal'); // notice: if featureOptIn does not exist before, the onconfigchange would not be called Assert.equal(true, snippet.appInsights.isInitialized(), "isInitialized"); snippet.config.throttleMgrCfg= {[_eInternalMessageId.SdkLdrUpdate]:tconfig, [_eInternalMessageId.DefaultThrottleMsgKey]:tconfig}; snippet.config.featureOptIn = {["SdkLoaderVer"]: {mode: FeatureOptInMode.enable}} this.clock.tick(1); Assert.equal(loggingSpy.called, 1); Assert.equal(_eInternalMessageId.SdkLdrUpdate, loggingSpy.args[0][1]); } }); this.testCase({ name: "ThrottleSentMessage: Message will not be sent for ver 6 snippet", useFakeTimers: true, test: () => { let pieceConfig = this._getTestConfig() let myconfig = {src:"", cfg:pieceConfig}; let snippet = this._initializeSnippet(createSnippetV6(myconfig)); let getcore = snippet['core']; let getcoreLogger = getcore.logger; let loggingSpy = this.sandbox.stub(getcoreLogger, 'throwInternal'); Assert.equal(true, snippet.appInsights.isInitialized(), "isInitialized"); snippet.config.throttleMgrCfg= {[_eInternalMessageId.SdkLdrUpdate]:tconfig, [_eInternalMessageId.DefaultThrottleMsgKey]:tconfig}; snippet.config.featureOptIn = {["SdkLoaderVer"]: {mode: FeatureOptInMode.enable}} this.clock.tick(12); // wait enough time for negative test Assert.equal(loggingSpy.callCount, 0); } }); } private _initializeSnippet(snippet: Snippet): ApplicationInsights { try { //this.useFakeServer = false; // Call the initialization ((ApplicationInsightsContainer.getAppInsights(snippet, snippet.version)) as IApplicationInsights); // Setup Sinon stuff const appInsights: AppInsightsSku = (snippet as any).appInsights; this.onDone(() => { if (snippet) { if (snippet["unload"]) { snippet["unload"](false); } else if (snippet["appInsightsNew"]) { snippet["appInsightsNew"].unload(false); } } }); Assert.ok(appInsights, "The App insights instance should be populated"); Assert.ok(appInsights.core, "The Core exists"); Assert.equal(appInsights.core, (snippet as any).core, "The core instances should match"); Assert.equal(true, (appInsights as any).isInitialized(), 'App Analytics is initialized'); Assert.equal(true, appInsights.core.isInitialized(), 'Core is initialized'); } catch (e) { console.error('Failed to initialize'); Assert.ok(false, e); } // Note: Explicitly returning the original snippet as this should have been updated! return snippet as any; } } ================================================ FILE: AISKU/Tests/Unit/src/TraceContext.Tests.ts ================================================ import { AITestClass, Assert } from '@microsoft/ai-test-framework'; import { ApplicationInsights } from '../../../src/applicationinsights-web'; import { IOTelSpanOptions, eOTelSpanKind, ITelemetryItem, isUndefined, useSpan, isNumber } from "@microsoft/applicationinsights-core-js"; import { isFunction, objIs } from '@nevware21/ts-utils'; export class TraceContextTests extends AITestClass { private static readonly _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; private static readonly _connectionString = `InstrumentationKey=${TraceContextTests._instrumentationKey}`; private _ai!: ApplicationInsights; private _trackCalls: ITelemetryItem[] = []; constructor(testName?: string) { super(testName || "TraceContextTests"); } public testInitialize() { try { this.useFakeServer = false; this._trackCalls = []; this._ai = new ApplicationInsights({ config: { connectionString: TraceContextTests._connectionString, disableAjaxTracking: false, disableXhr: false, maxBatchInterval: 0, disableExceptionTracking: false } }); this._ai.loadAppInsights(); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; } catch (e) { console.error('Failed to initialize tests: ' + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public registerTests() { this.addGetTraceCtxTests(); this.addActiveSpanTests(); this.addsetActiveSpanTests(); this.addIntegrationTests(); } private addGetTraceCtxTests(): void { this.testCase({ name: "getTraceCtx: should return valid trace context after starting a span", test: () => { // Arrange const spanName = "test-span-with-context"; // Act const span = this._ai.startSpan(spanName); const traceCtx = this._ai.getTraceCtx(); // Assert Assert.ok(span !== null, "Span should be created"); Assert.ok(traceCtx !== null && traceCtx !== undefined, "Should return trace context after starting span"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion Assert.ok(traceCtx!.traceId, "Trace context should have traceId"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion Assert.equal("", traceCtx!.spanId, "Trace context should not have a spanId (the default SDK initialization)"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion Assert.ok(isUndefined(traceCtx!.traceFlags), "Trace context should NOT have have traceFlags"); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion useSpan(this._ai.core, span!, () => { const nestedTraceCtx = this._ai.getTraceCtx(); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion Assert.equal(traceCtx!.traceId, nestedTraceCtx!.traceId, "TraceId should be the same within the span context"); Assert.equal(span?.spanContext().traceId, nestedTraceCtx?.traceId, "TraceId should match the active span's traceId"); Assert.equal(span?.spanContext().spanId, nestedTraceCtx?.spanId, "SpanId should match the active span's spanId"); Assert.equal(span?.spanContext().traceFlags, nestedTraceCtx?.traceFlags, "TraceFlags should match the active span's traceFlags"); }); // Cleanup span?.end(); } }); this.testCase({ name: "getTraceCtx: should return trace context matching active span", test: () => { // Arrange const spanName = "context-matching-span"; // Act const span = this._ai.startSpan(spanName); const traceCtx = this._ai.getTraceCtx(); const spanContext = span?.spanContext(); // Assert Assert.ok(span !== null, "Span should be created"); Assert.ok(traceCtx !== null && traceCtx !== undefined, "Trace context should exist"); Assert.ok(spanContext !== null && spanContext !== undefined, "Span context should exist"); Assert.equal(traceCtx.traceId, spanContext.traceId, "Trace context traceId should match span context"); Assert.notEqual(traceCtx.spanId, spanContext.spanId, "Trace context spanId should match span context"); useSpan(this._ai.core, span!, () => { const activeTraceCtx = this._ai.getTraceCtx(); Assert.equal(activeTraceCtx?.traceId, spanContext.traceId, "The active traceId should match span context"); Assert.equal(activeTraceCtx?.spanId, spanContext.spanId, "The active spanId should match span context"); }); Assert.equal(traceCtx.traceId, spanContext.traceId, "Trace context traceId should match span context"); Assert.notEqual(traceCtx.spanId, spanContext.spanId, "Trace context spanId should match span context"); // Cleanup span?.end(); } }); this.testCase({ name: "getTraceCtx: should have valid traceId format (32 hex chars)", test: () => { // Arrange const span = this._ai.startSpan("format-test-span"); // Act const traceCtx = this._ai.getTraceCtx(); // Assert Assert.ok(traceCtx !== null && traceCtx !== undefined, "Trace context should exist"); if (traceCtx && traceCtx.traceId) { Assert.equal(traceCtx.traceId.length, 32, "TraceId should be 32 characters"); Assert.ok(/^[0-9a-f]{32}$/i.test(traceCtx.traceId), "TraceId should be 32 hex characters"); } // Cleanup span?.end(); } }); this.testCase({ name: "getTraceCtx: should have valid spanId format (16 hex chars)", test: () => { // Arrange const span = this._ai.startSpan("spanid-test-span"); // Act const traceCtx = this._ai.getTraceCtx(); // Assert Assert.ok(traceCtx !== null && traceCtx !== undefined, "Trace context should exist"); if (traceCtx && traceCtx.spanId) { Assert.equal(traceCtx.spanId.length, 16, "SpanId should be 16 characters"); Assert.ok(/^[0-9a-f]{16}$/i.test(traceCtx.spanId), "SpanId should be 16 hex characters"); } // Cleanup span?.end(); } }); this.testCase({ name: "getTraceCtx: should persist context across multiple calls", test: () => { // Arrange const span = this._ai.startSpan("persistence-span"); // Act const traceCtx1 = this._ai.getTraceCtx(); const traceCtx2 = this._ai.getTraceCtx(); const traceCtx3 = this._ai.getTraceCtx(); // Assert Assert.ok(traceCtx1 !== null && traceCtx1 !== undefined, "First call should return context"); Assert.ok(traceCtx2 !== null && traceCtx2 !== undefined, "Second call should return context"); Assert.ok(traceCtx3 !== null && traceCtx3 !== undefined, "Third call should return context"); if (traceCtx1 && traceCtx2 && traceCtx3) { Assert.equal(traceCtx1.traceId, traceCtx2.traceId, "TraceId should be consistent"); Assert.equal(traceCtx2.traceId, traceCtx3.traceId, "TraceId should be consistent"); Assert.equal(traceCtx1.spanId, traceCtx2.spanId, "SpanId should be consistent"); Assert.equal(traceCtx2.spanId, traceCtx3.spanId, "SpanId should be consistent"); } // Cleanup span?.end(); } }); this.testCase({ name: "getTraceCtx: should return context for child spans with same traceId", test: () => { // Arrange const parentSpan = this._ai.startSpan("parent-span"); const parentCtx = this._ai.getTraceCtx(); // Act - create child span const childSpan = this._ai.startSpan("child-span", undefined, parentCtx || undefined); let childCtx; useSpan(this._ai.core, childSpan!, () => { childCtx = this._ai.getTraceCtx(); }); // Assert Assert.ok(parentCtx !== null && parentCtx !== undefined, "Parent context should exist"); Assert.ok(childCtx !== null && childCtx !== undefined, "Child context should exist"); Assert.equal(childCtx.traceId, parentCtx.traceId, "Child span should have same traceId as parent"); Assert.notEqual(childCtx.spanId, parentCtx.spanId, "Child span should have different spanId from parent"); Assert.equal(childSpan?.spanContext().traceId, parentCtx.traceId, "Child span should have same traceId as parent"); Assert.notEqual(childSpan?.spanContext().spanId, parentCtx.spanId, "Child span should have different spanId from parent"); Assert.equal(childSpan?.spanContext().spanId, childCtx.spanId, "Child spanId should match its context"); Assert.equal(childSpan?.spanContext().traceId, childCtx.traceId, "Child traceId should match its context"); // Cleanup childSpan?.end(); parentSpan?.end(); } }); } private addActiveSpanTests(): void { this.testCase({ name: "activeSpan: should return null when no span is active (via trace provider)", test: () => { // Assert // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const activeSpan = this._ai.getActiveSpan(); Assert.ok(activeSpan, "Should Always return a non-null span when no span is active"); Assert.equal(false, activeSpan.isRecording(), "Returned span should be a non-recording span"); } }); this.testCase({ name: "activeSpan: should return null when createNew is false and no span is active", test: () => { // Act const activeSpan = this._ai.getActiveSpan(false); // Assert Assert.equal(activeSpan, null, "Should return null when createNew is false and no active span exists"); } }); this.testCase({ name: "activeSpan: should return existing span when createNew is false and span is active", test: () => { // Arrange const span = this._ai.startSpan("test-span"); this._ai.setActiveSpan(span); // Act const activeSpan = this._ai.getActiveSpan(false); // Assert Assert.ok(activeSpan, "Should return the active span"); Assert.equal(activeSpan, span, "Should return the same span object"); // Cleanup span?.end(); } }); this.testCase({ name: "activeSpan: should return active span after setActiveSpan (via trace provider)", test: () => { // Arrange const span = this._ai.startSpan("active-span-test"); // Act this._ai.setActiveSpan(span); const activeSpan = this._ai.getActiveSpan(); // Assert Assert.ok(activeSpan !== null, "Should return the active span"); Assert.equal(activeSpan.name, span.name, "Active span should match the set span"); // Cleanup span?.end(); } }); this.testCase({ name: "activeSpan: should return the most recently set active span", test: () => { // Arrange const span1 = this._ai.startSpan("span-1"); const span2 = this._ai.startSpan("span-2"); const span3 = this._ai.startSpan("span-3"); // Act & Assert this._ai.setActiveSpan(span1); let activeSpan = this._ai.getActiveSpan(); Assert.equal(activeSpan.name, span1.name, "Should return span1 as active"); this._ai.setActiveSpan(span2); activeSpan = this._ai.getActiveSpan(); Assert.equal(activeSpan.name, span2.name, "Should return span2 as active"); this._ai.setActiveSpan(span3); activeSpan = this._ai.getActiveSpan(); Assert.equal(activeSpan.name, span3.name, "Should return span3 as active"); // Cleanup span1?.end(); span2?.end(); span3?.end(); } }); this.testCase({ name: "activeSpan: active span should have valid span context", test: () => { // Arrange const span = this._ai.startSpan("context-check-span"); // Act this._ai.setActiveSpan(span); const activeSpan = this._ai.getActiveSpan(); const spanContext = activeSpan.spanContext(); // Assert Assert.ok(activeSpan !== null, "Active span should exist"); Assert.ok(objIs(activeSpan, span), "Active span should match the set span"); Assert.ok(spanContext !== null && spanContext !== undefined, "Active span should have valid context"); Assert.ok(spanContext.traceId, "Should have traceId"); Assert.ok(spanContext.spanId, "Should have spanId"); Assert.ok(isUndefined(spanContext.traceFlags), "Should have default traceFlags (undefined)"); Assert.equal(undefined, spanContext?.traceFlags, "TraceFlags should not have sampled flag set by default"); // Cleanup span?.end(); } }); this.testCase({ name: "activeSpan: should work with recording spans", test: () => { // Arrange const options: IOTelSpanOptions = { recording: true, kind: eOTelSpanKind.CLIENT }; const span = this._ai.startSpan("recording-span", options); // Act this._ai.setActiveSpan(span); const activeSpan = this._ai.getActiveSpan(); // Assert Assert.ok(activeSpan !== null, "Active span should exist"); Assert.ok(activeSpan.isRecording(), "Active span should be recording"); // Cleanup span?.end(); } }); this.testCase({ name: "activeSpan: should work with non-recording spans", test: () => { // Arrange const options: IOTelSpanOptions = { recording: false }; const span = this._ai.startSpan("non-recording-span", options); // Act this._ai.setActiveSpan(span); const activeSpan = this._ai.getActiveSpan(); // Assert Assert.ok(activeSpan !== null, "Active span should exist"); Assert.ok(!activeSpan.isRecording(), "Active span should not be recording"); // Cleanup span?.end(); } }); } private addsetActiveSpanTests(): void { this.testCase({ name: "setActiveSpan: should set a span as active", test: () => { // Arrange const span = this._ai.startSpan("set-active-test"); // Act const scope = this._ai.setActiveSpan(span); const activeSpan = this._ai.getActiveSpan(); // Assert Assert.ok(scope !== null, "Scope should be returned"); Assert.equal(scope.span, span, "Scope.span should equal the passed span"); Assert.ok(activeSpan !== null, "Active span should be set"); Assert.equal(activeSpan, span, "ActiveSpan() should return the same span object"); Assert.equal(activeSpan.name, span.name, "Set span should be the active span"); // Cleanup span?.end(); } }); this.testCase({ name: "setActiveSpan: should update getTraceCtx to reflect active span", test: () => { // Arrange const span = this._ai.startSpan("trace-ctx-update-test"); // Act const scope = this._ai.setActiveSpan(span); const activeSpan = this._ai.getActiveSpan(); const traceCtx = this._ai.getTraceCtx(); const spanContext = span.spanContext(); // Assert Assert.ok(scope !== null, "Scope should be returned"); Assert.equal(scope.span, span, "Scope.span should equal the passed span"); Assert.equal(activeSpan, span, "ActiveSpan() should return the same span object"); Assert.ok(traceCtx !== null && traceCtx !== undefined, "Trace context should be updated"); if (traceCtx && spanContext) { Assert.equal(traceCtx.traceId, spanContext.traceId, "Trace context should match active span"); Assert.equal(traceCtx.spanId, spanContext.spanId, "Trace context spanId should match active span"); } // Cleanup span?.end(); } }); this.testCase({ name: "setActiveSpan: should allow switching between multiple spans", test: () => { // Arrange const span1 = this._ai.startSpan("switch-span-1"); const span2 = this._ai.startSpan("switch-span-2"); // Act & Assert // Set first span as active let scope = this._ai.setActiveSpan(span1); let activeSpan = this._ai.getActiveSpan(); Assert.equal(scope.span, span1, "Scope.span should equal span1"); Assert.equal(activeSpan, span1, "ActiveSpan() should return span1"); Assert.equal(activeSpan.name, span1.name, "First span should be active"); // Switch to second span scope = this._ai.setActiveSpan(span2); activeSpan = this._ai.getActiveSpan(); Assert.equal(scope.span, span2, "Scope.span should equal span2"); Assert.equal(activeSpan, span2, "ActiveSpan() should return span2"); Assert.equal(activeSpan.name, span2.name, "Second span should be active"); // Switch back to first span scope = this._ai.setActiveSpan(span1); activeSpan = this._ai.getActiveSpan(); Assert.equal(scope.span, span1, "Scope.span should equal span1 again"); Assert.equal(activeSpan, span1, "ActiveSpan() should return span1 again"); Assert.equal(activeSpan.name, span1.name, "First span should be active again"); // Cleanup span1?.end(); span2?.end(); } }); this.testCase({ name: "setActiveSpan: should work with spans of different kinds", test: () => { // Arrange const clientSpan = this._ai.startSpan("client-span", { kind: eOTelSpanKind.CLIENT }); const serverSpan = this._ai.startSpan("server-span", { kind: eOTelSpanKind.SERVER }); // Act & Assert let scope = this._ai.setActiveSpan(clientSpan); let activeSpan = this._ai.getActiveSpan(); Assert.equal(scope.span, clientSpan, "Scope.span should equal clientSpan"); Assert.equal(activeSpan, clientSpan, "ActiveSpan() should return clientSpan"); Assert.equal(activeSpan.kind, eOTelSpanKind.CLIENT, "Client span should be active with correct kind"); scope = this._ai.setActiveSpan(serverSpan); activeSpan = this._ai.getActiveSpan(); Assert.equal(scope.span, serverSpan, "Scope.span should equal serverSpan"); Assert.equal(activeSpan, serverSpan, "ActiveSpan() should return serverSpan"); Assert.equal(activeSpan.kind, eOTelSpanKind.SERVER, "Server span should be active with correct kind"); // Cleanup clientSpan?.end(); serverSpan?.end(); } }); this.testCase({ name: "setActiveSpan: should work with spans that have attributes", test: () => { // Arrange const attributes = { "http.method": "GET", "http.url": "https://example.com", "custom.attribute": "test-value" }; const span = this._ai.startSpan("attributed-span", { attributes }); // Act const scope = this._ai.setActiveSpan(span); const activeSpan = this._ai.getActiveSpan(); // Assert Assert.ok(scope !== null, "Scope should be returned"); Assert.equal(scope.span, span, "Scope.span should equal the passed span"); Assert.ok(activeSpan !== null, "Active span should exist"); Assert.equal(activeSpan, span, "ActiveSpan() should return the same span object"); Assert.equal(activeSpan.name, span.name, "Span name should match"); const spanAttributes = activeSpan.attributes; Assert.equal(spanAttributes["http.method"], "GET", "Attributes should be preserved"); Assert.equal(spanAttributes["http.url"], "https://example.com", "Attributes should be preserved"); Assert.equal(spanAttributes["custom.attribute"], "test-value", "Custom attributes should be preserved"); // Cleanup span?.end(); } }); this.testCase({ name: "setActiveSpan: should handle ended spans", test: () => { // Arrange const span = this._ai.startSpan("ended-span"); // Act span.end(); const scope = this._ai.setActiveSpan(span); const activeSpan = this._ai.getActiveSpan(); // Assert Assert.ok(scope !== null, "Scope should be returned"); Assert.equal(scope.span, span, "Scope.span should equal the passed ended span"); Assert.ok(activeSpan !== null, "Should be able to set ended span as active"); Assert.equal(activeSpan, span, "ActiveSpan() should return the same ended span object"); Assert.ok(activeSpan.ended, "Active span should be marked as ended"); // Cleanup is already done (span.end() called) } }); } private addIntegrationTests(): void { this.testCase({ name: "Integration: getTraceCtx, activeSpan, and setActiveSpan should work together", test: () => { // Arrange const span1 = this._ai.startSpan("integration-span-1"); const span2 = this._ai.startSpan("integration-span-2"); // Act & Assert - Set first span active this._ai.setActiveSpan(span1); let activeSpan = this._ai.getActiveSpan(); let traceCtx = this._ai.getTraceCtx(); let span1Context = span1.spanContext(); Assert.equal(activeSpan.name, span1.name, "Active span should be span1"); Assert.equal(traceCtx?.spanId, span1Context.spanId, "Trace context should match span1"); // Switch to second span this._ai.setActiveSpan(span2); activeSpan = this._ai.getActiveSpan(); traceCtx = this._ai.getTraceCtx(); let span2Context = span2.spanContext(); Assert.equal(activeSpan.name, span2.name, "Active span should be span2"); Assert.equal(traceCtx?.spanId, span2Context.spanId, "Trace context should match span2"); // Cleanup span1?.end(); span2?.end(); } }); this.testCase({ name: "Integration: parent-child span relationship via getTraceCtx", test: () => { // Arrange & Act const parentSpan = this._ai.startSpan("integration-parent"); this._ai.setActiveSpan(parentSpan); const parentCtx = this._ai.getTraceCtx(); // Create child span using parent context const childSpan = this._ai.startSpan("integration-child", undefined, parentCtx || undefined); this._ai.setActiveSpan(childSpan); const childCtx = this._ai.getTraceCtx(); const activeSpan = this._ai.getActiveSpan(); // Assert Assert.ok(parentCtx !== null && parentCtx !== undefined, "Parent context should exist"); Assert.ok(childCtx !== null && childCtx !== undefined, "Child context should exist"); Assert.equal(childCtx.traceId, parentCtx.traceId, "Child should inherit parent's traceId"); Assert.notEqual(childCtx.spanId, parentCtx.spanId, "Child should have different spanId"); Assert.equal(activeSpan.name, "integration-child", "Active span should be the child span"); // Cleanup childSpan?.end(); parentSpan?.end(); } }); this.testCase({ name: "Integration: multiple spans with trace context propagation", test: () => { // Arrange const rootSpan = this._ai.startSpan("root-span"); this._ai.setActiveSpan(rootSpan); const rootCtx = this._ai.getTraceCtx(); // Create first child const child1Span = this._ai.startSpan("child-1", undefined, rootCtx || undefined); this._ai.setActiveSpan(child1Span); const child1Ctx = this._ai.getTraceCtx(); // Create second child (sibling to first child) const child2Span = this._ai.startSpan("child-2", undefined, rootCtx || undefined); this._ai.setActiveSpan(child2Span); const child2Ctx = this._ai.getTraceCtx(); // Assert - all should share the same traceId Assert.equal(child1Ctx.traceId, rootCtx.traceId, "Child 1 should share root traceId"); Assert.equal(child2Ctx.traceId, rootCtx.traceId, "Child 2 should share root traceId"); // But have different spanIds Assert.notEqual(child1Ctx.spanId, rootCtx.spanId, "Child 1 should have different spanId"); Assert.notEqual(child2Ctx.spanId, rootCtx.spanId, "Child 2 should have different spanId"); Assert.notEqual(child1Ctx.spanId, child2Ctx.spanId, "Siblings should have different spanIds"); // Cleanup child2Span?.end(); child1Span?.end(); rootSpan?.end(); } }); this.testCase({ name: "Integration: trace provider availability check", test: () => { // Act const provider = this._ai.core.getTraceProvider(); Assert.equal(this._ai.getTraceProvider(), provider, "Core and AI instance should return same trace provider"); // Assert Assert.ok(provider !== null && provider !== undefined, "Trace provider should be available"); Assert.ok(isFunction(provider.createSpan), "Provider should have createSpan method"); Assert.ok(isFunction(this._ai.getActiveSpan), "Provider should have activeSpan method"); Assert.ok(isFunction(this._ai.setActiveSpan), "Provider should have setActiveSpan method"); Assert.ok(isFunction(provider.getProviderId), "Provider should have getProviderId method"); Assert.ok(isFunction(provider.isAvailable), "Provider should have isAvailable method"); } }); this.testCase({ name: "Integration: trace provider isAvailable should reflect initialization state", test: () => { // Act const provider = this._ai.core.getTraceProvider(); // Assert const isAvailable = provider.isAvailable(); Assert.ok(typeof isAvailable === 'boolean', "isAvailable should return boolean"); Assert.ok(isAvailable, "Provider should be available after SDK initialization"); } }); this.testCase({ name: "Integration: trace provider should have identifiable providerId", test: () => { // Act const provider = this._ai.core.getTraceProvider(); // Assert if (provider) { const providerId = provider.getProviderId(); Assert.ok(providerId, "Provider should have an ID"); Assert.ok(typeof providerId === 'string', "Provider ID should be a string"); Assert.ok(providerId.length > 0, "Provider ID should not be empty"); } } }); } } ================================================ FILE: AISKU/Tests/Unit/src/TraceProvider.Tests.ts ================================================ import { AITestClass, Assert } from '@microsoft/ai-test-framework'; import { ApplicationInsights } from '../../../src/applicationinsights-web'; import { IReadableSpan, IOTelSpanOptions, eOTelSpanKind, ITraceProvider, ITelemetryItem, isFunction } from "@microsoft/applicationinsights-core-js"; export class TraceProviderTests extends AITestClass { private static readonly _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; private static readonly _connectionString = `InstrumentationKey=${TraceProviderTests._instrumentationKey}`; private _ai!: ApplicationInsights; private _trackCalls: ITelemetryItem[] = []; constructor(testName?: string) { super(testName || "TraceProviderTests"); } public testInitialize() { try { this.useFakeServer = false; this._trackCalls = []; this._ai = new ApplicationInsights({ config: { connectionString: TraceProviderTests._connectionString, disableAjaxTracking: false, disableXhr: false, maxBatchInterval: 0, disableExceptionTracking: false } }); this._ai.loadAppInsights(); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; } catch (e) { console.error('Failed to initialize tests: ' + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public registerTests() { this.addProviderAvailabilityTests(); this.addGetProviderIdTests(); this.addIsAvailableTests(); this.addCreateSpanTests(); this.addProviderIntegrationTests(); } private addProviderAvailabilityTests(): void { this.testCase({ name: "TraceProvider: getTraceProvider should return provider instance", test: () => { // Act const provider = this._ai.core.getTraceProvider(); // Assert Assert.ok(provider !== null && provider !== undefined, "Should return a trace provider instance"); Assert.ok(typeof provider === 'object', "Provider should be an object"); } }); this.testCase({ name: "TraceProvider: provider should have all required methods", test: () => { // Act const provider = this._ai.core.getTraceProvider(); Assert.equal(this._ai.getTraceProvider(), provider, "Core and AI instance should return same trace provider"); // Assert Assert.ok(provider, "Provider should exist"); if (provider) { Assert.ok(isFunction(provider.createSpan), "Should have createSpan method"); Assert.ok(isFunction(this._ai.getActiveSpan), "Should have activeSpan method"); Assert.ok(isFunction(this._ai.setActiveSpan), "Should have setActiveSpan method"); Assert.ok(isFunction(provider.getProviderId), "Should have getProviderId method"); Assert.ok(isFunction(provider.isAvailable), "Should have isAvailable method"); } } }); this.testCase({ name: "TraceProvider: provider should be available after SDK initialization", test: () => { // Act const provider = this._ai.core.getTraceProvider(); // Assert Assert.ok(provider !== null, "Provider should not be null"); Assert.ok(provider !== undefined, "Provider should not be undefined"); } }); this.testCase({ name: "TraceProvider: multiple calls to getTraceProvider should return same provider", test: () => { // Act const provider1 = this._ai.core.getTraceProvider(); const provider2 = this._ai.core.getTraceProvider(); const provider3 = this._ai.core.getTraceProvider(); // Assert Assert.ok(provider1 === provider2, "First and second calls should return same provider"); Assert.ok(provider2 === provider3, "Second and third calls should return same provider"); } }); } private addGetProviderIdTests(): void { this.testCase({ name: "getProviderId: should return a string identifier", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act const providerId = provider?.getProviderId(); // Assert Assert.ok(providerId !== null && providerId !== undefined, "Provider ID should not be null or undefined"); Assert.ok(typeof providerId === 'string', "Provider ID should be a string"); } }); this.testCase({ name: "getProviderId: should return non-empty string", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act const providerId = provider?.getProviderId(); // Assert if (providerId) { Assert.ok(providerId.length > 0, "Provider ID should not be empty"); } } }); this.testCase({ name: "getProviderId: should return consistent ID across multiple calls", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act const providerId1 = provider?.getProviderId(); const providerId2 = provider?.getProviderId(); const providerId3 = provider?.getProviderId(); // Assert Assert.equal(providerId1, providerId2, "Provider ID should be consistent across calls"); Assert.equal(providerId2, providerId3, "Provider ID should be consistent across calls"); } }); this.testCase({ name: "getProviderId: should return identifiable name", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act const providerId = provider?.getProviderId(); // Assert Assert.ok(providerId, "Provider ID should exist"); if (providerId) { // Provider ID should be a meaningful identifier, not just random characters Assert.ok(providerId.length > 2, "Provider ID should be more than 2 characters"); } } }); } private addIsAvailableTests(): void { this.testCase({ name: "isAvailable: should return boolean value", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act const isAvailable = provider?.isAvailable(); // Assert Assert.ok(typeof isAvailable === 'boolean', "isAvailable should return a boolean"); } }); this.testCase({ name: "isAvailable: should return true after SDK initialization", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act const isAvailable = provider?.isAvailable(); // Assert Assert.ok(isAvailable === true, "Provider should be available after SDK initialization"); } }); this.testCase({ name: "isAvailable: should be consistent across multiple calls", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act const isAvailable1 = provider?.isAvailable(); const isAvailable2 = provider?.isAvailable(); const isAvailable3 = provider?.isAvailable(); // Assert Assert.equal(isAvailable1, isAvailable2, "Availability should be consistent"); Assert.equal(isAvailable2, isAvailable3, "Availability should be consistent"); } }); this.testCase({ name: "isAvailable: available provider should allow span creation", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); const isAvailable = provider?.isAvailable(); // Act let canCreateSpan = false; if (provider && isAvailable) { const span = provider.createSpan("availability-test-span"); canCreateSpan = span !== null && span !== undefined; span?.end(); } // Assert Assert.ok(isAvailable, "Provider should be available"); Assert.ok(canCreateSpan, "Available provider should allow span creation"); } }); this.testCase({ name: "isAvailable: should reflect provider initialization state", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // After full SDK initialization, provider should be available Assert.ok(provider !== null, "Provider should not be null"); // Act const isAvailable = provider?.isAvailable(); Assert.ok(isAvailable !== undefined, "isAvailable should not be undefined"); // Assert Assert.ok(isFunction(provider.createSpan), "Available provider should have createSpan"); Assert.ok(isFunction(provider.getProviderId), "Available provider should have getProviderId"); Assert.ok(isFunction(provider.isAvailable), "Available provider should have isAvailable"); Assert.ok(isFunction(this._ai.getActiveSpan), "Available provider should have activeSpan"); Assert.ok(isFunction(this._ai.setActiveSpan), "Available provider should have setActiveSpan"); Assert.ok(isFunction(this._ai.core.getActiveSpan), "Available core should have activeSpan"); Assert.ok(isFunction(this._ai.core.setActiveSpan), "Available core should have setActiveSpan"); } }); } private addCreateSpanTests(): void { this.testCase({ name: "Provider createSpan: should create valid span", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); const spanName = "provider-create-span-test"; // Act let span: IReadableSpan | null = null; if (provider) { span = provider.createSpan(spanName); } // Assert Assert.ok(span !== null && span !== undefined, "Provider should create a span"); if (span) { Assert.equal(span.name, spanName, "Span name should match"); Assert.ok(typeof span.isRecording === 'function', "Span should have isRecording method"); } // Cleanup span?.end(); } }); this.testCase({ name: "Provider createSpan: should create span with options", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); const spanName = "provider-span-with-options"; const options: IOTelSpanOptions = { kind: eOTelSpanKind.CLIENT, attributes: { "test.attribute": "value" } }; // Act let span: IReadableSpan | null = null; if (provider) { span = provider.createSpan(spanName, options); } // Assert Assert.ok(span !== null, "Provider should create span with options"); if (span) { Assert.equal(span.kind, eOTelSpanKind.CLIENT, "Span kind should match options"); Assert.ok(span.attributes["test.attribute"] === "value", "Span attributes should be set"); } // Cleanup span?.end(); } }); this.testCase({ name: "Provider createSpan: should create span with parent context", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); let parentSpan: IReadableSpan | null = null; let childSpan: IReadableSpan | null = null; if (provider) { parentSpan = provider.createSpan("parent-span"); const parentCtx = parentSpan.spanContext(); // Act childSpan = provider.createSpan("child-span", undefined, parentCtx); // Assert Assert.ok(childSpan !== null, "Child span should be created"); if (childSpan && parentSpan) { const childCtx = childSpan.spanContext(); Assert.equal(childCtx.traceId, parentCtx.traceId, "Child should inherit parent traceId"); Assert.notEqual(childCtx.spanId, parentCtx.spanId, "Child should have different spanId"); } } // Cleanup childSpan?.end(); parentSpan?.end(); } }); this.testCase({ name: "Provider createSpan: should create multiple independent spans", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act let span1: IReadableSpan | null = null; let span2: IReadableSpan | null = null; let span3: IReadableSpan | null = null; if (provider) { span1 = provider.createSpan("span-1"); span2 = provider.createSpan("span-2"); span3 = provider.createSpan("span-3"); } // Assert Assert.ok(span1 !== null, "First span should be created"); Assert.ok(span2 !== null, "Second span should be created"); Assert.ok(span3 !== null, "Third span should be created"); if (span1 && span2 && span3) { const ctx1 = span1.spanContext(); const ctx2 = span2.spanContext(); const ctx3 = span3.spanContext(); Assert.notEqual(ctx1.spanId, ctx2.spanId, "Spans should have different spanIds"); Assert.notEqual(ctx2.spanId, ctx3.spanId, "Spans should have different spanIds"); Assert.notEqual(ctx1.spanId, ctx3.spanId, "Spans should have different spanIds"); } // Cleanup span1?.end(); span2?.end(); span3?.end(); } }); this.testCase({ name: "Provider createSpan: should create recording spans by default", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act let span: IReadableSpan | null = null; if (provider) { span = provider.createSpan("recording-test"); } // Assert Assert.ok(span !== null, "Span should be created"); if (span) { Assert.ok(span.isRecording(), "Span should be recording by default"); } // Cleanup span?.end(); } }); this.testCase({ name: "Provider createSpan: should respect recording option when false", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); const options: IOTelSpanOptions = { recording: false }; // Act let span: IReadableSpan | null = null; if (provider) { span = provider.createSpan("non-recording-test", options); } // Assert Assert.ok(span !== null, "Span should be created"); if (span) { Assert.ok(!span.isRecording(), "Span should not be recording when options.recording is false"); } // Cleanup span?.end(); } }); } private addProviderIntegrationTests(): void { this.testCase({ name: "Integration: provider operations should work with SDK instance", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act - Create span via provider let providerSpan: IReadableSpan | null = null; if (provider) { providerSpan = provider.createSpan("provider-integration-span"); } // Create span via SDK const sdkSpan = this._ai.startSpan("sdk-integration-span"); // Assert Assert.ok(providerSpan !== null, "Provider should create span successfully"); Assert.ok(sdkSpan !== null, "SDK should create span successfully"); if (providerSpan && sdkSpan) { // Both spans should have valid contexts const providerCtx = providerSpan.spanContext(); const sdkCtx = sdkSpan.spanContext(); Assert.ok(providerCtx.traceId, "Provider span should have traceId"); Assert.ok(providerCtx.spanId, "Provider span should have spanId"); Assert.ok(sdkCtx.traceId, "SDK span should have traceId"); Assert.ok(sdkCtx.spanId, "SDK span should have spanId"); } // Cleanup providerSpan?.end(); sdkSpan?.end(); } }); this.testCase({ name: "Integration: provider activeSpan and setActiveSpan work together", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act let span: IReadableSpan | null = null; if (provider) { span = provider.createSpan("active-integration-span"); this._ai.setActiveSpan(span); const activeSpan = this._ai.getActiveSpan(); // Assert Assert.ok(activeSpan !== null, "Active span should be retrievable"); Assert.equal(activeSpan.name, span.name, "Active span should match the set span"); Assert.equal(activeSpan, this._ai.core.getActiveSpan(), "Active span from core should match active span from SDK"); } // Cleanup span?.end(); } }); this.testCase({ name: "Integration: provider availability affects span creation", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act const isAvailable = provider?.isAvailable(); let canCreateSpan = false; if (provider) { try { const span = provider.createSpan("availability-integration-test"); canCreateSpan = span !== null; span?.end(); } catch (e) { canCreateSpan = false; } } // Assert if (isAvailable) { Assert.ok(canCreateSpan, "Available provider should successfully create spans"); } else { // If provider is not available, we should handle it gracefully Assert.ok(!canCreateSpan || canCreateSpan, "Provider availability state should be consistent with span creation"); } } }); this.testCase({ name: "Integration: provider ID is consistent with trace operations", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act const providerId = provider?.getProviderId(); let span: IReadableSpan | null = null; if (provider) { span = provider.createSpan("provider-id-integration"); } // Assert Assert.ok(providerId, "Provider should have an ID"); Assert.ok(span !== null, "Provider with ID should be able to create spans"); // Cleanup span?.end(); } }); this.testCase({ name: "Integration: provider methods are callable without errors", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act & Assert - All methods should be callable Assert.ok(provider !== null, "Provider should exist"); if (provider) { // Test getProviderId Assert.doesNotThrow(() => { const id = provider.getProviderId(); Assert.ok(typeof id === 'string', "getProviderId should return string"); }, "getProviderId should not throw"); // Test isAvailable Assert.doesNotThrow(() => { const available = provider.isAvailable(); Assert.ok(typeof available === 'boolean', "isAvailable should return boolean"); }, "isAvailable should not throw"); // Test createSpan Assert.doesNotThrow(() => { const span = provider.createSpan("error-test-span"); Assert.ok(span !== null, "createSpan should return span"); span?.end(); }, "createSpan should not throw"); // Test activeSpan Assert.doesNotThrow(() => { const active = this._ai.getActiveSpan(); // Can be null, that's ok Assert.ok(active === null || typeof active === 'object', "activeSpan should return null or span object"); }, "activeSpan should not throw"); const span = provider.createSpan("set-active-error-test"); // Test setActiveSpan Assert.doesNotThrow(() => { this._ai.setActiveSpan(span); span?.end(); }, "setActiveSpan should not throw"); // Test setActiveSpan Assert.doesNotThrow(() => { this._ai.setActiveSpan(span); }, "setActiveSpan should not throw when the span has already ended"); // Test setActiveSpan Assert.doesNotThrow(() => { span?.end(); }, "ending an already ended span should not throw"); } } }); this.testCase({ name: "Integration: provider supports root span creation", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); // Act let rootSpan: IReadableSpan | null = null; if (provider) { rootSpan = provider.createSpan("root-span", { root: true }); } // Assert Assert.ok(rootSpan !== null, "Root span should be created"); if (rootSpan) { const ctx = rootSpan.spanContext(); Assert.ok(ctx.traceId, "Root span should have traceId"); Assert.ok(ctx.spanId, "Root span should have spanId"); } // Cleanup rootSpan?.end(); } }); this.testCase({ name: "Integration: provider supports different span kinds", test: () => { // Arrange const provider = this._ai.core.getTraceProvider(); const spanKinds = [ eOTelSpanKind.INTERNAL, eOTelSpanKind.SERVER, eOTelSpanKind.CLIENT, eOTelSpanKind.PRODUCER, eOTelSpanKind.CONSUMER ]; // Act & Assert if (provider) { spanKinds.forEach(kind => { const span = provider.createSpan(`span-kind-${kind}`, { kind }); Assert.ok(span !== null, `Span with kind ${kind} should be created`); Assert.equal(span?.kind, kind, `Span should have kind ${kind}`); span?.end(); }); } } }); } } ================================================ FILE: AISKU/Tests/Unit/src/TraceSuppression.Tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { ApplicationInsights } from "../../../src/applicationinsights-web"; import { eOTelSpanKind, ITelemetryItem, suppressTracing, unsuppressTracing, isTracingSuppressed } from "@microsoft/applicationinsights-core-js"; function _createAndInitializeSDK(connectionString: string): ApplicationInsights { let newInst = new ApplicationInsights({ config: { connectionString: connectionString, disableAjaxTracking: false, disableXhr: false, maxBatchInterval: 0, disableExceptionTracking: false } }); // Initialize the SDK newInst.loadAppInsights(); return newInst } export class TraceSuppressionTests extends AITestClass { private static readonly _instrumentationKey = "b7170927-2d1c-44f1-acec-59f4e1751c11"; private static readonly _connectionString = `InstrumentationKey=${TraceSuppressionTests._instrumentationKey}`; private _ai!: ApplicationInsights; // Track calls to track for validation private _trackCalls: ITelemetryItem[] = []; constructor(testName?: string) { super(testName || "TraceSuppressionTests"); } public testInitialize() { try { this.useFakeServer = false; this._trackCalls = []; this._ai = _createAndInitializeSDK(TraceSuppressionTests._connectionString); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; } catch (e) { console.error("Failed to initialize TraceSuppressionTests: " + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public registerTests() { this.addTests(); } private addTests(): void { this.testCase({ name: "TraceSuppression: new SDK instance should have tracing enabled by default and state should not leak between instances", test: () => { // Step 1: Verify first instance has tracing enabled by default Assert.ok(!isTracingSuppressed(this._ai.core), "Instance 1: Tracing should NOT be suppressed in new instance"); Assert.ok(!isTracingSuppressed(this._ai.core.config), "Instance 1: Tracing should NOT be suppressed on config"); Assert.ok(!isTracingSuppressed(this._ai.otelApi), "Instance 1: Tracing should NOT be suppressed on otelApi"); // Verify that spans can record by default const span1 = this._ai.startSpan("default-span"); Assert.ok(span1, "Instance 1: Span should be created"); Assert.ok(span1!.isRecording(), "Instance 1: Span should be recording by default"); span1!.end(); Assert.equal(this._trackCalls.length, 1, "Instance 1: Telemetry should be tracked by default"); // Step 2: Suppress tracing on this instance suppressTracing(this._ai.core); Assert.ok(isTracingSuppressed(this._ai.core), "Instance 1: Tracing should be suppressed after suppressTracing()"); // Verify suppression works - span still reports isRecording()=true but doesn't send telemetry const span2 = this._ai.startSpan("suppressed-span"); Assert.ok(!span2!.isRecording(), "Instance 2: Span reports isRecording()=false when suppressed"); span2!.end(); Assert.equal(this._trackCalls.length, 1, "Instance 1: No additional telemetry when suppressed"); // Step 3: Clean up first instance and create a new instance this._ai.unload(false); this._ai = _createAndInitializeSDK(TraceSuppressionTests._connectionString); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; // Step 4: Verify new instance has tracing enabled by default (not inheriting suppressed state) Assert.ok(!isTracingSuppressed(this._ai.core), "Instance 2: Tracing should NOT be suppressed in new instance"); Assert.ok(!isTracingSuppressed(this._ai.core.config), "Instance 2: Tracing should NOT be suppressed on config"); Assert.ok(!isTracingSuppressed(this._ai.otelApi), "Instance 2: Tracing should NOT be suppressed on otelApi"); // Verify that spans can record in the new instance const span3 = this._ai.startSpan("new-instance-span"); Assert.ok(span3, "Instance 2: Span should be created"); Assert.ok(span3!.isRecording(), "Instance 2: Span should be recording by default (state should not leak)"); span3!.end(); Assert.equal(this._trackCalls.length, 2, "Instance 2: Telemetry should be tracked in new instance"); } }); this.testCase({ name: "TraceSuppression: suppressTracing should be available as exported function", test: () => { // Verify that suppressTracing functions are available as imports Assert.ok(typeof suppressTracing === "function", "suppressTracing should be available as exported function"); Assert.ok(typeof unsuppressTracing === "function", "unsuppressTracing should be available as exported function"); Assert.ok(typeof isTracingSuppressed === "function", "isTracingSuppressed should be available as exported function"); } }); this.testCase({ name: "TraceSuppression: suppressTracing on core should prevent span recording", test: () => { // Arrange this._trackCalls = []; Assert.ok(!isTracingSuppressed(this._ai.core), "Tracing should not be suppressed initially"); // Act - suppress tracing suppressTracing(this._ai.core); Assert.ok(isTracingSuppressed(this._ai.core), "Tracing should be suppressed after calling suppressTracing"); // Create span while tracing is suppressed const span = this._ai.startSpan("suppressed-span", { kind: eOTelSpanKind.INTERNAL, attributes: { "test.suppressed": true } }); // Assert Assert.ok(span, "Span should still be created"); Assert.ok(!span!.isRecording(), "Span reports isRecording()=false"); // End the span - should not generate telemetry span!.end(); Assert.equal(this._trackCalls.length, 0, "No telemetry should be tracked when tracing is suppressed"); } }); this.testCase({ name: "TraceSuppression: unsuppressTracing should restore span recording", test: () => { // Arrange this._trackCalls = []; suppressTracing(this._ai.core); Assert.ok(isTracingSuppressed(this._ai.core), "Tracing should be suppressed"); // Create span while suppressed - still reports isRecording()=true but won't send telemetry const suppressedSpan = this._ai.startSpan("suppressed-span"); Assert.ok(!suppressedSpan!.isRecording(), "Span reports isRecording()=false even when suppressed"); suppressedSpan!.end(); // Act - unsuppress tracing unsuppressTracing(this._ai.core); Assert.ok(!isTracingSuppressed(this._ai.core), "Tracing should not be suppressed after unsuppressTracing"); // Create new span after unsuppressing const recordingSpan = this._ai.startSpan("recording-span", { attributes: { "test.recording": true } }); // Assert Assert.ok(recordingSpan, "Span should be created"); Assert.ok(recordingSpan!.isRecording(), "Span should be recording after unsuppressing"); // End the span - should generate telemetry recordingSpan!.end(); Assert.equal(this._trackCalls.length, 1, "Telemetry should be tracked after unsuppressing"); Assert.equal(this._trackCalls[0].baseData?.name, "recording-span", "Tracked span should have correct name"); } }); this.testCase({ name: "TraceSuppression: suppressTracing on config should prevent span recording", test: () => { // Arrange this._trackCalls = []; // Suppress via config object suppressTracing(this._ai.core.config); Assert.ok(isTracingSuppressed(this._ai.core.config), "Tracing should be suppressed on config"); Assert.ok(isTracingSuppressed(this._ai.core), "Tracing should be suppressed on core"); // Act - create span const span = this._ai.startSpan("config-suppressed-span"); // Assert Assert.ok(span, "Span should be created"); Assert.ok(!span!.isRecording(), "Span reports isRecording()=false"); span!.end(); Assert.equal(this._trackCalls.length, 0, "No telemetry when suppressed via config"); } }); this.testCase({ name: "TraceSuppression: multiple startSpan calls while suppressed should all create non-recording spans", test: () => { // Arrange this._trackCalls = []; suppressTracing(this._ai.core); // Act - create multiple spans const span1 = this._ai.startSpan("span-1"); const span2 = this._ai.startSpan("span-2", { kind: eOTelSpanKind.CLIENT }); const span3 = this._ai.startSpan("span-3", { kind: eOTelSpanKind.SERVER }); // Assert - spans still report isRecording()=true, suppression only affects telemetry output Assert.ok(!span1!.isRecording(), "Span 1 reports isRecording()=false"); Assert.ok(!span2!.isRecording(), "Span 2 reports isRecording()=false"); Assert.ok(!span3!.isRecording(), "Span 3 reports isRecording()=false"); // All spans should still be valid and support operations span1!.setAttribute("test", "value1"); span2!.setStatus({ code: 0 }); span3!.updateName("updated-span-3"); span1!.end(); span2!.end(); span3!.end(); Assert.equal(this._trackCalls.length, 0, "No telemetry should be generated for any suppressed span"); } }); this.testCase({ name: "TraceSuppression: parent-child span hierarchy with suppression", test: () => { // Arrange this._trackCalls = []; suppressTracing(this._ai.core); // Act - create parent and child spans while suppressed const parentSpan = this._ai.startSpan("parent-span", { kind: eOTelSpanKind.SERVER }); Assert.ok(!parentSpan!.isRecording(), "Parent span reports isRecording()=false"); const childSpan = this._ai.startSpan("child-span", { kind: eOTelSpanKind.INTERNAL }); Assert.ok(!childSpan!.isRecording(), "Child span reports isRecording()=false"); // Verify parent-child relationship still established const childContext = childSpan!.spanContext(); const parentContext = parentSpan!.spanContext(); Assert.equal(childContext.traceId, parentContext.traceId, "Child should share traceId with parent"); Assert.notEqual(childContext.spanId, parentContext.spanId, "Child should have different spanId"); childSpan!.end(); parentSpan!.end(); Assert.equal(this._trackCalls.length, 0, "No telemetry for suppressed hierarchy"); } }); this.testCase({ name: "TraceSuppression: toggle suppression during span lifecycle", test: () => { // Arrange this._trackCalls = []; // Create recording span const span1 = this._ai.startSpan("recording-span"); Assert.ok(span1!.isRecording(), "Span should be recording initially"); // Suppress tracing mid-lifecycle suppressTracing(this._ai.core); // Create new span while suppressed const span2 = this._ai.startSpan("suppressed-span"); Assert.ok(!span2!.isRecording(), "Span reports isRecording()=false when suppressed"); // End both spans span1!.end(); // Was recording but tracing has been suppressed before it ends span2!.end(); // Was not recording // Verify telemetry Assert.equal(this._trackCalls.length, 0, "Only the recording span should generate telemetry"); // Unsuppress and create another span unsuppressTracing(this._ai.core); const span3 = this._ai.startSpan("restored-span"); Assert.ok(span3!.isRecording(), "New span should be recording after unsuppressing"); span3!.end(); Assert.equal(this._trackCalls.length, 1, "Restored span should generate telemetry"); } }); this.testCase({ name: "TraceSuppression: toggle suppression during span lifecycle", test: () => { // Arrange this._trackCalls = []; // Create recording span const span1 = this._ai.startSpan("recording-span"); Assert.ok(span1!.isRecording(), "Span should be recording initially"); // Suppress tracing mid-lifecycle suppressTracing(this._ai.core); // Create new span while suppressed const span2 = this._ai.startSpan("suppressed-span"); Assert.ok(!span2!.isRecording(), "Span reports isRecording()=false when suppressed"); // Unsuppress and create another span unsuppressTracing(this._ai.core); // End both spans span1!.end(); // Was recording span2!.end(); // Was not recording as tracing was suppressed when created // Verify telemetry Assert.equal(this._trackCalls.length, 1, "Only the recording span should generate telemetry"); Assert.equal(this._trackCalls[0].baseData?.name, "recording-span", "Recording span telemetry"); const span3 = this._ai.startSpan("restored-span"); Assert.ok(span3!.isRecording(), "New span should be recording after unsuppressing"); span3!.end(); Assert.equal(this._trackCalls.length, 2, "Restored span should generate telemetry"); } }); this.testCase({ name: "TraceSuppression: suppressTracing should affect all span kinds", test: () => { // Arrange this._trackCalls = []; suppressTracing(this._ai.core); // Act - create spans of all kinds const internalSpan = this._ai.startSpan("internal", { kind: eOTelSpanKind.INTERNAL }); const clientSpan = this._ai.startSpan("client", { kind: eOTelSpanKind.CLIENT }); const serverSpan = this._ai.startSpan("server", { kind: eOTelSpanKind.SERVER }); const producerSpan = this._ai.startSpan("producer", { kind: eOTelSpanKind.PRODUCER }); const consumerSpan = this._ai.startSpan("consumer", { kind: eOTelSpanKind.CONSUMER }); // Assert - all spans still report isRecording()=true, suppression only prevents telemetry output Assert.ok(!internalSpan!.isRecording(), "INTERNAL span reports isRecording()=false"); Assert.ok(!clientSpan!.isRecording(), "CLIENT span reports isRecording()=false"); Assert.ok(!serverSpan!.isRecording(), "SERVER span reports isRecording()=false"); Assert.ok(!producerSpan!.isRecording(), "PRODUCER span reports isRecording()=false"); Assert.ok(!consumerSpan!.isRecording(), "CONSUMER span reports isRecording()=false"); // End all spans internalSpan!.end(); clientSpan!.end(); serverSpan!.end(); producerSpan!.end(); consumerSpan!.end(); Assert.equal(this._trackCalls.length, 0, "No telemetry for any span kind when suppressed"); } }); this.testCase({ name: "TraceSuppression: span operations should still work when tracing is suppressed", test: () => { // Arrange suppressTracing(this._ai.core); const span = this._ai.startSpan("suppressed-span"); Assert.ok(!span!.isRecording(), "Span reports isRecording()=false"); // Act - perform various span operations span!.setAttribute("string-attr", "value"); span!.setAttribute("number-attr", 42); span!.setAttribute("boolean-attr", true); span!.setAttributes({ "batch-1": "test1", "batch-2": 123 }); span!.setStatus({ code: 0, message: "Test status" }); span!.updateName("updated-name"); span!.recordException(new Error("Test exception")); // Assert - operations should not throw Assert.ok(true, "All operations completed without throwing"); // Verify span properties Assert.equal(span!.name, "updated-name", "Name should be updated"); Assert.ok(!span!.ended, "Span should not be ended yet"); span!.end(); Assert.ok(span!.ended, "Span should be ended"); } }); this.testCase({ name: "TraceSuppression: isTracingSuppressed should return false when not suppressed", test: () => { // Ensure no suppression unsuppressTracing(this._ai.core); // Assert Assert.ok(!isTracingSuppressed(this._ai.core), "Should return false when not suppressed"); Assert.ok(!isTracingSuppressed(this._ai.core.config), "Config should also not be suppressed"); } }); this.testCase({ name: "TraceSuppression: suppressTracing should return the same context", test: () => { // Act const returnedCore = suppressTracing(this._ai.core); const returnedConfig = suppressTracing(this._ai.core.config); // Assert Assert.equal(returnedCore, this._ai.core, "suppressTracing should return the same core instance"); Assert.equal(returnedConfig, this._ai.core.config, "suppressTracing should return the same config instance"); Assert.ok(isTracingSuppressed(returnedCore), "Returned core should have suppression enabled"); Assert.ok(isTracingSuppressed(returnedConfig), "Returned config should have suppression enabled"); } }); this.testCase({ name: "TraceSuppression: unsuppressTracing should return the same context", test: () => { // Arrange suppressTracing(this._ai.core); // Act const returnedCore = unsuppressTracing(this._ai.core); const returnedConfig = unsuppressTracing(this._ai.core.config); // Assert Assert.equal(returnedCore, this._ai.core, "unsuppressTracing should return the same core instance"); Assert.equal(returnedConfig, this._ai.core.config, "unsuppressTracing should return the same config instance"); Assert.ok(!isTracingSuppressed(returnedCore), "Returned core should have suppression disabled"); Assert.ok(!isTracingSuppressed(returnedConfig), "Returned config should have suppression disabled"); } }); this.testCase({ name: "TraceSuppression: suppression state should persist across multiple checks", test: () => { // Initial state Assert.ok(!isTracingSuppressed(this._ai.core), "Initially not suppressed"); // Suppress suppressTracing(this._ai.core); Assert.ok(isTracingSuppressed(this._ai.core), "Should be suppressed - check 1"); Assert.ok(isTracingSuppressed(this._ai.core), "Should be suppressed - check 2"); Assert.ok(isTracingSuppressed(this._ai.core), "Should be suppressed - check 3"); // Unsuppress unsuppressTracing(this._ai.core); Assert.ok(!isTracingSuppressed(this._ai.core), "Should not be suppressed - check 1"); Assert.ok(!isTracingSuppressed(this._ai.core), "Should not be suppressed - check 2"); Assert.ok(!isTracingSuppressed(this._ai.core), "Should not be suppressed - check 3"); } }); this.testCase({ name: "TraceSuppression: span attributes should be preserved when tracing is suppressed", test: () => { // Arrange this._trackCalls = []; suppressTracing(this._ai.core); // Act - create span with attributes const span = this._ai.startSpan("suppressed-with-attrs", { attributes: { "initial.attr1": "value1", "initial.attr2": 100 } }); Assert.ok(!span!.isRecording(), "Span reports isRecording()=false"); // Add more attributes span!.setAttribute("runtime.attr", "added-later"); // Assert - attributes should still be accessible const attributes = (span as any).attributes || {}; Assert.ok(attributes["initial.attr1"] === undefined || attributes["runtime.attr"] === undefined, "Attributes should not be stored as span was not recording"); span!.end(); Assert.equal(this._trackCalls.length, 0, "No telemetry should be generated"); } }); this.testCase({ name: "TraceSuppression: span context should be valid when tracing is suppressed", test: () => { // Arrange suppressTracing(this._ai.core); // Act const span = this._ai.startSpan("suppressed-context-test"); Assert.ok(!span!.isRecording(), "Span reports isRecording()=false"); // Assert - span context should be valid const spanContext = span!.spanContext(); Assert.ok(spanContext, "Span context should exist"); Assert.ok(spanContext.traceId, "Trace ID should exist"); Assert.ok(spanContext.spanId, "Span ID should exist"); Assert.equal(spanContext.traceId.length, 32, "Trace ID should be 32 hex characters"); Assert.equal(spanContext.spanId.length, 16, "Span ID should be 16 hex characters"); span!.end(); } }); this.testCase({ name: "TraceSuppression: rapid suppression toggling should work correctly", test: () => { // Arrange this._trackCalls = []; // Act - rapidly toggle suppression for (let i = 0; i < 5; i++) { suppressTracing(this._ai.core); Assert.ok(isTracingSuppressed(this._ai.core), `Should be suppressed on iteration ${i}`); unsuppressTracing(this._ai.core); Assert.ok(!isTracingSuppressed(this._ai.core), `Should not be suppressed on iteration ${i}`); } // Final state check Assert.ok(!isTracingSuppressed(this._ai.core), "Should end in unsuppressed state"); // Create a recording span const span = this._ai.startSpan("final-span"); Assert.ok(span!.isRecording(), "Span should be recording after toggles"); span!.end(); Assert.equal(this._trackCalls.length, 1, "Telemetry should be tracked"); } }); this.testCase({ name: "TraceSuppression: suppression should work with explicit parent context", test: () => { // Arrange this._trackCalls = []; // Create a recording parent span first const parentSpan = this._ai.startSpan("parent-recording"); Assert.ok(parentSpan!.isRecording(), "Parent should be recording"); const parentContext = this._ai.getTraceCtx(); // Suppress tracing suppressTracing(this._ai.core); // Act - create child with explicit parent while suppressed const childSpan = this._ai.startSpan("child-suppressed", { kind: eOTelSpanKind.INTERNAL }, parentContext); // Assert Assert.ok(!childSpan!.isRecording(), "Child span reports isRecording()=false when suppressed"); const childContext = childSpan!.spanContext(); Assert.equal(childContext.traceId, parentContext!.traceId, "Child should have same traceId as parent"); unsuppressTracing(this._ai.core); childSpan!.end(); parentSpan!.end(); // Only parent should generate telemetry Assert.equal(this._trackCalls.length, 1, "Only parent span should generate telemetry"); Assert.equal(this._trackCalls[0].baseData?.name, "parent-recording", "Parent span telemetry"); } }); this.testCase({ name: "TraceSuppression: suppression should work even with parent context", test: () => { // Arrange this._trackCalls = []; // Create a recording parent span first const parentSpan = this._ai.startSpan("parent-recording"); Assert.ok(parentSpan!.isRecording(), "Parent should be recording"); const parentContext = this._ai.getTraceCtx(); // Suppress tracing suppressTracing(this._ai.core); // Act - create child with explicit parent while suppressed const childSpan = this._ai.startSpan("child-suppressed", { kind: eOTelSpanKind.INTERNAL }, parentContext); // Assert Assert.ok(!childSpan!.isRecording(), "Child span reports isRecording()=false when suppressed"); const childContext = childSpan!.spanContext(); Assert.equal(childContext.traceId, parentContext!.traceId, "Child should have same traceId as parent"); childSpan!.end(); parentSpan!.end(); // Only parent should generate telemetry Assert.equal(this._trackCalls.length, 0, "Parent span should not generate telemetry either as suppression is active"); } }); this.testCase({ name: "TraceSuppression: isTracingSuppressed should handle null/undefined gracefully", test: () => { // Act & Assert - should not throw let result1: boolean; let result2: boolean; try { result1 = isTracingSuppressed(null as any); result2 = isTracingSuppressed(undefined as any); Assert.ok(true, "isTracingSuppressed should handle null/undefined without throwing"); Assert.ok(!result1, "Should return false for null"); Assert.ok(!result2, "Should return false for undefined"); } catch (e) { Assert.ok(false, "isTracingSuppressed should not throw for null/undefined"); } } }); this.testCase({ name: "TraceSuppression: suppressTracing with startSpan integration test", test: () => { // Arrange this._trackCalls = []; // Test 1: Normal recording const span1 = this._ai.startSpan("normal-1"); Assert.ok(span1!.isRecording(), "Span 1 should be recording"); span1!.end(); Assert.equal(this._trackCalls.length, 1, "Should have 1 telemetry item"); // Test 2: Suppress and verify spans still report isRecording()=true but don't send telemetry suppressTracing(this._ai.core); const span2 = this._ai.startSpan("suppressed-1"); const span3 = this._ai.startSpan("suppressed-2"); Assert.ok(!span2!.isRecording(), "Span 2 reports isRecording()=false when suppressed"); Assert.ok(!span3!.isRecording(), "Span 3 reports isRecording()=false when suppressed"); span2!.end(); span3!.end(); Assert.equal(this._trackCalls.length, 1, "Should still have only 1 telemetry item"); // Test 3: Unsuppress and verify startSpan creates recording spans again unsuppressTracing(this._ai.core); const span4 = this._ai.startSpan("normal-2"); Assert.ok(span4!.isRecording(), "Span 4 should be recording"); span4!.end(); Assert.equal(this._trackCalls.length, 2, "Should have 2 telemetry items"); // Verify telemetry content Assert.equal(this._trackCalls[0].baseData?.name, "normal-1", "First telemetry is from span1"); Assert.equal(this._trackCalls[1].baseData?.name, "normal-2", "Second telemetry is from span4"); } }); this.testCase({ name: "TraceSuppression: suppression with nested spans", test: () => { // Arrange this._trackCalls = []; suppressTracing(this._ai.core); // Create and set active span manually const span1 = this._ai.startSpan("outer-span"); Assert.ok(!span1!.isRecording(), "Outer span reports isRecording()=false"); // Simulate nested operation const span2 = this._ai.startSpan("inner-span"); Assert.ok(!span2!.isRecording(), "Inner span reports isRecording()=false"); span2!.end(); span1!.end(); Assert.equal(this._trackCalls.length, 0, "No telemetry for suppressed nested spans"); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/UseSpan.Tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { ApplicationInsights } from "../../../src/applicationinsights-web"; import { IAppInsightsCore, IReadableSpan, eOTelSpanKind, eOTelSpanStatusCode, useSpan, ITelemetryItem, ISpanScope, ITraceHost } from "@microsoft/applicationinsights-core-js"; export class UseSpanTests extends AITestClass { private static readonly _instrumentationKey = "b7170927-2d1c-44f1-acec-59f4e1751c11"; private static readonly _connectionString = `InstrumentationKey=${UseSpanTests._instrumentationKey}`; private _ai!: ApplicationInsights; // Track calls to track for validation private _trackCalls: ITelemetryItem[] = []; constructor(testName?: string) { super(testName || "UseSpanTests"); } public testInitialize() { try { this.useFakeServer = false; this._trackCalls = []; this._ai = new ApplicationInsights({ config: { connectionString: UseSpanTests._connectionString, disableAjaxTracking: false, disableXhr: false, maxBatchInterval: 0, disableExceptionTracking: false } }); // Initialize the SDK this._ai.loadAppInsights(); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; } catch (e) { console.error("Failed to initialize UseSpan tests: " + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public registerTests() { this.addTests(); } private addTests(): void { this.testCase({ name: "UseSpan: useSpan should be available as exported function", test: () => { // Verify that useSpan is available as an import Assert.ok(typeof useSpan === "function", "useSpan should be available as exported function"); } }); this.testCase({ name: "UseSpan: should execute function within span context", test: () => { // Arrange const testSpan = this._ai.startSpan("useSpan-context-test", { kind: eOTelSpanKind.SERVER, attributes: { "test.type": "context-execution" } }); Assert.ok(testSpan, "Test span should be created"); Assert.ok(this._ai.core, "Core should be available"); let capturedActiveSpan: IReadableSpan | null = null; let capturedHost: ITraceHost | null = null; const testFunction = function(this: ISpanScope) { capturedActiveSpan = this.host.getActiveSpan(); capturedHost = this.host; return "context-success"; }; // Act const result = useSpan(this._ai.core!, testSpan!, testFunction); // Assert Assert.equal(result, "context-success", "Function should execute and return result"); Assert.ok(capturedActiveSpan, "Function should have access to active span"); Assert.equal(capturedActiveSpan, testSpan, "Active span should be the provided test span"); Assert.equal(capturedHost, this._ai.core, "Active host should be the core instance (passed to useSpan)"); } }); this.testCase({ name: "UseSpan: should work with telemetry tracking inside span context", test: () => { // Arrange this._trackCalls = []; const testSpan = this._ai.startSpan("useSpan-telemetry-test", { attributes: { "operation.name": "telemetry-tracking" } }); Assert.ok(testSpan, "Test span should be created"); const telemetryFunction = () => { // Track some telemetry within the span context this._ai.trackEvent({ name: "operation-event", properties: { "event.source": "useSpan-context" } }); this._ai.trackMetric({ name: "operation.duration", average: 123.45 }); return "telemetry-tracked"; }; // Act const result = useSpan(this._ai.core!, testSpan!, telemetryFunction); // Assert Assert.equal(result, "telemetry-tracked", "Function should complete successfully"); // End the span to trigger trace generation testSpan!.end(); // Verify track was called for the span Assert.equal(this._trackCalls.length, 3, "Should have one track call from span ending"); const item = this._trackCalls[2]; Assert.ok(item.baseData && item.baseData.properties, "Item should have properties"); Assert.equal("useSpan-telemetry-test", item.baseData.name, "Should include span name in properties"); } }); this.testCase({ name: "UseSpan: should handle complex function arguments and return values", test: () => { // Arrange const testSpan = this._ai.startSpan("useSpan-arguments-test"); Assert.ok(testSpan, "Test span should be created"); const complexFunction = ( _scope: ISpanScope, stringArg: string, numberArg: number, objectArg: { key: string; value: number }, arrayArg: string[] ) => { return { processedString: stringArg!.toUpperCase(), doubledNumber: numberArg! * 2, extractedValue: objectArg!.value, joinedArray: arrayArg!.join("-"), timestamp: Date.now() }; }; const inputObject = { key: "test-key", value: 42 }; const inputArray = ["item1", "item2", "item3"]; // Act const result = useSpan( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion this._ai.core!, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion testSpan!, complexFunction, undefined, "hello world", 10, inputObject, inputArray ); // Assert Assert.equal(result.processedString, "HELLO WORLD", "String should be processed correctly"); Assert.equal(result.doubledNumber, 20, "Number should be doubled correctly"); Assert.equal(result.extractedValue, 42, "Object value should be extracted correctly"); Assert.equal(result.joinedArray, "item1-item2-item3", "Array should be joined correctly"); Assert.ok(result.timestamp > 0, "Timestamp should be generated"); } }); this.testCase({ name: "UseSpan: should handle function with this context binding", test: () => { // Arrange const testSpan = this._ai.startSpan("useSpan-this-binding-test"); Assert.ok(testSpan, "Test span should be created"); class TestService { private _serviceId: string; private _multiplier: number; constructor(id: string, multiplier: number) { this._serviceId = id; this._multiplier = multiplier; } public processValue(_scope: ISpanScope, input: number): { serviceId: string; result: number; multiplied: number } { return { serviceId: this._serviceId, result: input + 100, multiplied: input * this._multiplier }; } } const service = new TestService("test-service-123", 3); // Act const result = useSpan( this._ai.core!, testSpan!, service.processValue, service, 25 ); // Assert Assert.equal(result.serviceId, "test-service-123", "Service ID should be preserved via this binding"); Assert.equal(result.result, 125, "Input should be processed correctly"); Assert.equal(result.multiplied, 75, "Multiplication should use instance property"); } }); this.testCase({ name: "UseSpan: should maintain span context across async-like operations", test: () => { // Arrange const testSpan = this._ai.startSpan("useSpan-async-like-test", { attributes: { "operation.type": "async-simulation" } }); Assert.ok(testSpan, "Test span should be created"); let spanDuringCallback: IReadableSpan | null = null; let callbackExecuted = false; const asyncLikeFunction = (scope: ISpanScope, callback: (data: string) => void) => { // Simulate async work that completes synchronously in test let currentSpan = scope.span; // Simulate callback execution (would normally be async) setTimeout(() => { spanDuringCallback = this._ai.core!.getActiveSpan(); callback("async-data"); callbackExecuted = true; }, 0); return currentSpan ? (currentSpan as IReadableSpan).name : "no-span"; }; // Act let callbackData = ""; const callback = (data: string) => { callbackData = data; }; const result = useSpan(this._ai.core!, testSpan!, asyncLikeFunction, undefined, callback); // Assert Assert.equal(result, "useSpan-async-like-test", "Function should have access to span name"); // Note: In a real async scenario, the span context wouldn't automatically // propagate to the setTimeout callback without additional context management // This test validates the synchronous behavior of useSpan } }); this.testCase({ name: "UseSpan: should handle exceptions and preserve span operations", test: () => { // Arrange const testSpan = this._ai.startSpan("useSpan-exception-test", { attributes: { "test.expects": "exception" } }); Assert.ok(testSpan, "Test span should be created"); const exceptionFunction = () => { // Perform some span operations before throwing const activeSpan = this._ai.core!.getActiveSpan(); Assert.ok(activeSpan, "Should have active span before exception"); activeSpan!.setAttribute("operation.status", "error"); activeSpan!.setStatus({ code: eOTelSpanStatusCode.ERROR, message: "Operation failed with test exception" }); throw new Error("Test exception for useSpan handling"); }; // Act & Assert let caughtException: Error | null = null; try { useSpan(this._ai.core!, testSpan!, exceptionFunction); } catch (error) { caughtException = error as Error; } Assert.ok(caughtException, "Exception should be thrown and caught"); Assert.equal(caughtException!.message, "Test exception for useSpan handling", "Exception message should be preserved"); // Verify span is still valid and operations were applied Assert.ok(testSpan!.isRecording(), "Span should still be recording after exception"); const readableSpan = testSpan! as IReadableSpan; Assert.ok(!readableSpan.ended, "Span should not be ended by useSpan after exception"); } }); this.testCase({ name: "UseSpan: should work with nested span operations and child spans", test: () => { // Arrange this._trackCalls = []; const parentSpan = this._ai.startSpan("parent-operation", { kind: eOTelSpanKind.SERVER, attributes: { "operation.name": "parent-process" } }); Assert.ok(parentSpan, "Parent span should be created"); const nestedOperations = () => { // Verify we have the parent span as active const currentActive = this._ai.core!.getActiveSpan(); Assert.equal(currentActive, parentSpan, "Parent span should be active"); // Create child operations within the parent span context const childSpan1 = this._ai.startSpan("child-operation-1", { attributes: { "child.order": 1 } }); childSpan1!.setAttribute("child.status", "completed"); childSpan1!.end(); const childSpan2 = this._ai.startSpan("child-operation-2", { attributes: { "child.order": 2 } }); childSpan2!.setAttribute("child.status", "completed"); childSpan2!.end(); return "nested-operations-completed"; }; // Act const result = useSpan(this._ai.core!, parentSpan!, nestedOperations); // Assert Assert.equal(result, "nested-operations-completed", "Nested operations should complete successfully"); // End parent span to generate telemetry parentSpan!.end(); // Should have 3 telemetry items: parent + 2 children Assert.equal(this._trackCalls.length, 3, "Should have telemetry for parent and child spans"); // Verify span names in properties const spanNames = this._trackCalls.map(item => item.baseData?.name).filter(n => n); Assert.ok(spanNames.some(name => name === "parent-operation"), "Should have parent span telemetry"); Assert.ok(spanNames.some(name => name === "child-operation-1"), "Should have child-1 span telemetry"); Assert.ok(spanNames.some(name => name === "child-operation-2"), "Should have child-2 span telemetry"); } }); this.testCase({ name: "UseSpan: should support different return value types", test: () => { // Arrange const testSpan = this._ai.startSpan("useSpan-return-types-test"); Assert.ok(testSpan, "Test span should be created"); // Test various return types const stringResult = useSpan(this._ai.core!, testSpan!, () => "string-result"); const numberResult = useSpan(this._ai.core!, testSpan!, () => 42.5); const booleanResult = useSpan(this._ai.core!, testSpan!, () => true); const arrayResult = useSpan(this._ai.core!, testSpan!, () => [1, 2, 3]); const objectResult = useSpan(this._ai.core!, testSpan!, () => ({ key: "value", nested: { prop: 123 } })); const nullResult = useSpan(this._ai.core!, testSpan!, () => null); const undefinedResult = useSpan(this._ai.core!, testSpan!, () => undefined); // Assert Assert.equal(stringResult, "string-result", "String return should work"); Assert.equal(numberResult, 42.5, "Number return should work"); Assert.equal(booleanResult, true, "Boolean return should work"); Assert.equal(arrayResult.length, 3, "Array return should work"); Assert.equal(arrayResult[1], 2, "Array elements should be preserved"); Assert.equal(objectResult.key, "value", "Object properties should be preserved"); Assert.equal(objectResult.nested.prop, 123, "Nested object properties should be preserved"); Assert.equal(nullResult, null, "Null return should work"); Assert.equal(undefinedResult, undefined, "Undefined return should work"); } }); this.testCase({ name: "UseSpan: should handle rapid successive calls efficiently", test: () => { // Arrange const testSpan = this._ai.startSpan("useSpan-performance-test"); Assert.ok(testSpan, "Test span should be created"); const iterations = 100; let totalResult = 0; // Simple computation function const computeFunction = (_scope: ISpanScope, input: number) => { return input * 2 + 1; }; const startTime = Date.now(); // Act - Multiple rapid useSpan calls for (let i = 0; i < iterations; i++) { const result = useSpan(this._ai.core!, testSpan!, computeFunction, undefined, i); totalResult += result; } const endTime = Date.now(); const duration = endTime - startTime; // Assert const expectedTotal = Array.from({length: iterations}, (_, i) => i * 2 + 1).reduce((sum, val) => sum + val, 0); Assert.equal(totalResult, expectedTotal, "All computations should be correct"); // Performance assertion - should complete reasonably quickly Assert.ok(duration < 1000, `Performance test should complete quickly: ${duration}ms for ${iterations} iterations`); // Verify span is still valid after many operations Assert.ok(testSpan!.isRecording(), "Span should still be recording after multiple useSpan calls"); } }); this.testCase({ name: "UseSpan: should integrate with AI telemetry correlation", test: () => { // Arrange this._trackCalls = []; const operationSpan = this._ai.startSpan("user-operation", { kind: eOTelSpanKind.SERVER, attributes: { "user.id": "user-123", "operation.type": "data-processing" } }); Assert.ok(operationSpan, "Operation span should be created"); const businessLogicFunction = (_scope: ISpanScope, userId: string, dataType: string) => { // Track multiple telemetry items within span context this._ai.trackEvent({ name: "data-processing-started", properties: { "user.id": userId, "data.type": dataType, "processing.stage": "initialization" } }); // Simulate some processing steps for (let step = 1; step <= 3; step++) { this._ai.trackMetric({ name: "processing.step.duration", average: step * 10.5, properties: { "step.number": step.toString() } }); } this._ai.trackEvent({ name: "data-processing-completed", properties: { "user.id": userId, "data.type": dataType, "processing.stage": "completion", "steps.completed": "3" } }); return { userId: userId, dataType: dataType, stepsCompleted: 3, status: "success" }; }; // Act const result = useSpan( this._ai.core!, operationSpan!, businessLogicFunction, undefined, "user-123", "customer-data" ); // End the span to generate trace operationSpan!.end(); // Assert Assert.equal(result.userId, "user-123", "User ID should be processed correctly"); Assert.equal(result.dataType, "customer-data", "Data type should be processed correctly"); Assert.equal(result.stepsCompleted, 3, "All processing steps should be completed"); Assert.equal(result.status, "success", "Operation should complete successfully"); // Verify span telemetry was generated Assert.equal(this._trackCalls.length, 6, "Should have one track call from span ending"); const spanItem = this._trackCalls[5]; Assert.ok(spanItem.baseData && spanItem.baseData.properties, "Item should have properties"); Assert.equal("user-operation", spanItem.baseData.name, "Should include span name"); // Verify span attributes are included in properties Assert.equal(spanItem.baseData.properties["user.id"], "user-123", "Span attributes should be included in telemetry"); Assert.equal(spanItem.baseData.properties["operation.type"], "data-processing", "All span attributes should be preserved"); } }); this.testCase({ name: "UseSpan: should handle empty or no-op functions gracefully", test: () => { // Arrange const testSpan = this._ai.startSpan("useSpan-noop-test"); Assert.ok(testSpan, "Test span should be created"); // Test empty function const emptyFunction = () => {}; // Test function that just returns without doing anything const noOpFunction = () => { return; }; // Test function that returns undefined explicitly const undefinedFunction = () => { return undefined; }; // Act const emptyResult = useSpan(this._ai.core!, testSpan!, emptyFunction); const noOpResult = useSpan(this._ai.core!, testSpan!, noOpFunction); const undefinedResult = useSpan(this._ai.core!, testSpan!, undefinedFunction); // Assert Assert.equal(emptyResult, undefined, "Empty function should return undefined"); Assert.equal(noOpResult, undefined, "No-op function should return undefined"); Assert.equal(undefinedResult, undefined, "Undefined function should return undefined"); // Verify span is still valid Assert.ok(testSpan!.isRecording(), "Span should still be recording after no-op functions"); } }); this.testCase({ name: "UseSpan: should use ISpanScope as 'this' when no thisArg provided", test: () => { // Arrange const span = this._ai.startSpan("usespan-test", { attributes: { "test.id": "useSpan-this-test" } }); let capturedThis: any = null; let capturedScopeParam: any = null; // Act - call useSpan without thisArg (function receives scope as parameter) const result = useSpan(this._ai.core, span!, function(this: ISpanScope, scope: ISpanScope, arg1: string) { capturedThis = this; capturedScopeParam = scope; // Verify 'this' is ISpanScope Assert.ok(this.host, "'this.core' should exist"); Assert.ok(this.span, "'this.span' should exist"); // Verify scope parameter is also ISpanScope Assert.ok(scope.host, "scope.host should exist"); Assert.ok(scope.span, "scope.span should exist"); return `${arg1}-${scope.span.name}`; }, undefined, "result"); // Assert Assert.equal(result, "result-usespan-test", "Function should execute and return result"); Assert.ok(capturedThis, "'this' should be defined"); Assert.ok(capturedThis.host, "'this.host' should exist"); Assert.ok(capturedThis.span, "'this.span' should exist"); Assert.equal(capturedThis.host, this._ai.core, "'this.host' should be the AI core"); Assert.equal(capturedThis.span, span, "'this.span' should be the passed span"); Assert.ok(capturedScopeParam, "scope parameter should be defined"); Assert.equal(capturedScopeParam.host, this._ai.core, "scope.host should be the AI core"); Assert.equal(capturedScopeParam.span, span, "scope.span should be the passed span"); // Both 'this' and scope param should be the same ISpanScope instance Assert.equal(capturedThis, capturedScopeParam, "'this' and scope param should be the same ISpanScope instance"); span!.end(); } }); this.testCase({ name: "UseSpan: should use provided thisArg when specified", test: () => { // Arrange const span = this._ai.startSpan("usespan-thisarg-test"); class ServiceClass { public serviceId: string = "service-456"; public getData(prefix: string): string { return `${prefix}-${this.serviceId}`; } } const service = new ServiceClass(); let capturedThis: any = null; let capturedScopeParam: any = null; // Act - call useSpan with explicit thisArg const result = useSpan(this._ai.core, span!, function(this: ServiceClass, scope: ISpanScope) { capturedThis = this; capturedScopeParam = scope; // 'this' should be the service instance Assert.equal(this.serviceId, "service-456", "'this.serviceId' should match"); Assert.ok(typeof this.getData === "function", "'this.getData' should be a function"); // scope parameter should still be ISpanScope Assert.ok(scope.host, "scope.host should exist"); Assert.ok(scope.span, "scope.span should exist"); return this.getData("custom"); }, service); // Assert Assert.equal(result, "custom-service-456", "Function should execute with custom this context"); Assert.ok(capturedThis, "'this' should be defined"); Assert.equal(capturedThis, service, "'this' should be the service instance"); Assert.equal(capturedThis.serviceId, "service-456", "'this.serviceId' should match"); Assert.ok(!capturedThis.host, "Custom this should not have host property"); Assert.ok(!capturedThis.span, "Custom this should not have span property"); Assert.ok(capturedScopeParam, "scope parameter should be defined"); Assert.ok(capturedScopeParam.host, "scope.host should exist even with custom this"); Assert.ok(capturedScopeParam.span, "scope.span should exist even with custom this"); span!.end(); } }); this.testCase({ name: "UseSpan: scope parameter should provide access to core and span operations", test: () => { // Arrange this._trackCalls = []; const span = this._ai.startSpan("scope-operations-test"); // Act - use scope parameter to perform operations useSpan(this._ai.core, span!, (scope: ISpanScope) => { // Use scope.span to set attributes scope.span.setAttribute("operation.name", "data-processing"); scope.span.setAttribute("operation.step", 1); // Use scope.span to set status scope.span.setStatus({ code: 0, message: "Operation successful" }); // Use scope.span to get context const spanContext = scope.span.spanContext(); Assert.ok(spanContext.traceId, "Should access span context via scope"); Assert.ok(spanContext.spanId, "Should access span ID via scope"); // Verify span name Assert.equal(scope.span.name, "scope-operations-test", "Span name should be accessible"); }); // Assert Assert.ok(span, "Span should exist"); Assert.equal(span!.name, "scope-operations-test", "Span name should match"); span!.end(); Assert.equal(this._trackCalls.length, 1, "Should generate telemetry"); Assert.ok(this._trackCalls[0].baseData?.properties, "Should have properties"); Assert.equal(this._trackCalls[0].baseData.properties["operation.name"], "data-processing", "Attributes should be preserved"); } }); this.testCase({ name: "UseSpan: 'this' binding with nested useSpan calls", test: () => { // Arrange const span = this._ai.startSpan("nested-calls-test"); const outerContext = { contextName: "outer", value: 100 }; let outerThisCapture: any = null; let innerThisCapture: any = null; let ai = this._ai; // Act - nested useSpan calls with different thisArg useSpan(this._ai.core, span!, function(this: typeof outerContext, outerScope: ISpanScope) { outerThisCapture = this; Assert.equal(this.contextName, "outer", "Outer 'this' should be outer context"); Assert.equal(this.value, 100, "Outer 'this.value' should match"); const innerSpan = ai.startSpan("inner-nested-span"); useSpan(ai.core, innerSpan!, function(this: ISpanScope, innerScope: ISpanScope) { innerThisCapture = this; // Inner call without explicit thisArg - should be ISpanScope Assert.ok(this.host, "Inner 'this' should be ISpanScope"); Assert.ok(this.span, "Inner 'this.span' should exist"); Assert.equal(this.span.name, "inner-nested-span", "Inner span name should match"); }); innerSpan!.end(); }, outerContext); // Assert Assert.ok(outerThisCapture, "Outer 'this' should be captured"); Assert.equal(outerThisCapture.contextName, "outer", "Outer context should be preserved"); Assert.ok(innerThisCapture, "Inner 'this' should be captured"); Assert.ok(innerThisCapture.host, "Inner 'this' should have host"); Assert.ok(innerThisCapture.span, "Inner 'this' should have span"); span!.end(); } }); this.testCase({ name: "UseSpan: verify scope.restore() is called to restore previous active span", test: () => { // Arrange const outerSpan = this._ai.startSpan("outer-span"); const innerSpan = this._ai.startSpan("inner-span"); let activeSpanBeforeUseSpan: any = null; let activeSpanInsideUseSpan: any = null; let activeSpanAfterUseSpan: any = null; // Act activeSpanBeforeUseSpan = this._ai.core.getActiveSpan ? this._ai.core.getActiveSpan() : null; useSpan(this._ai.core, innerSpan!, (scope: ISpanScope) => { activeSpanInsideUseSpan = this._ai.core.getActiveSpan ? this._ai.core.getActiveSpan() : null; Assert.equal(activeSpanInsideUseSpan, innerSpan, "Active span inside useSpan should be inner span"); }); activeSpanAfterUseSpan = this._ai.core.getActiveSpan ? this._ai.core.getActiveSpan() : null; // Assert // Active span should be restored after useSpan completes Assert.equal(activeSpanAfterUseSpan, activeSpanBeforeUseSpan, "Active span should be restored after useSpan completes"); innerSpan!.end(); outerSpan!.end(); } }); this.testCase({ name: "UseSpan: trace context should match active span context inside useSpan", test: () => { // Arrange const testSpan = this._ai.startSpan("trace-context-match-test", { attributes: { "test.type": "trace-context-validation" } }); Assert.ok(testSpan, "Test span should be created"); let traceCtxInsideUseSpan: any = null; let spanContextInsideUseSpan: any = null; let activeSpanInsideUseSpan: any = null; // Act useSpan(this._ai.core, testSpan!, (scope: ISpanScope) => { // Get trace context from core traceCtxInsideUseSpan = this._ai.core.getTraceCtx(false); // Get span context from the span spanContextInsideUseSpan = scope.span.spanContext(); // Get active span activeSpanInsideUseSpan = this._ai.core.getActiveSpan ? this._ai.core.getActiveSpan() : null; }); // Assert Assert.ok(traceCtxInsideUseSpan, "Trace context should exist inside useSpan"); Assert.ok(spanContextInsideUseSpan, "Span context should exist"); Assert.ok(activeSpanInsideUseSpan, "Active span should be set"); // Verify active span matches the useSpan span Assert.equal(activeSpanInsideUseSpan, testSpan, "Active span should be the useSpan span"); // Verify trace context matches span context Assert.equal(traceCtxInsideUseSpan.traceId, spanContextInsideUseSpan.traceId, "Trace context traceId should match span context traceId"); Assert.equal(traceCtxInsideUseSpan.spanId, spanContextInsideUseSpan.spanId, "Trace context spanId should match span context spanId"); Assert.equal(traceCtxInsideUseSpan.traceFlags, spanContextInsideUseSpan.traceFlags, "Trace context traceFlags should match span context traceFlags"); testSpan!.end(); } }); this.testCase({ name: "UseSpan: trace context updates when switching between nested useSpan calls", test: () => { // Arrange const outerSpan = this._ai.startSpan("outer-trace-span"); const innerSpan = this._ai.startSpan("inner-trace-span"); let outerTraceCtx: any = null; let outerSpanCtx: any = null; let innerTraceCtx: any = null; let innerSpanCtx: any = null; // Act useSpan(this._ai.core, outerSpan!, (outerScope: ISpanScope) => { outerTraceCtx = this._ai.core.getTraceCtx(false); outerSpanCtx = outerScope.span.spanContext(); // Verify outer trace context matches outer span Assert.equal(outerTraceCtx.spanId, outerSpanCtx.spanId, "Outer trace context should match outer span"); // Nested useSpan with different span useSpan(this._ai.core, innerSpan!, (innerScope: ISpanScope) => { innerTraceCtx = this._ai.core.getTraceCtx(false); innerSpanCtx = innerScope.span.spanContext(); // Verify inner trace context matches inner span Assert.equal(innerTraceCtx.spanId, innerSpanCtx.spanId, "Inner trace context should match inner span"); // Verify inner context is different from outer Assert.notEqual(innerTraceCtx.spanId, outerTraceCtx.spanId, "Inner and outer trace contexts should have different spanIds"); }); // After inner useSpan, verify we're back to outer context const restoredTraceCtx = this._ai.core.getTraceCtx(false); Assert.equal(restoredTraceCtx.spanId, outerSpanCtx.spanId, "Trace context should be restored to outer span after inner useSpan completes"); }); outerSpan!.end(); innerSpan!.end(); } }); this.testCase({ name: "UseSpan: child spans created inside useSpan inherit correct parent context", test: () => { // Arrange const parentSpan = this._ai.startSpan("parent-for-child-test"); let childSpanContext: any = null; let parentSpanContext: any = null; // Act useSpan(this._ai.core, parentSpan!, (scope: ISpanScope) => { parentSpanContext = scope.span.spanContext(); // Create a child span while parent is active const childSpan = this._ai.startSpan("child-span-in-useSpan"); childSpanContext = childSpan!.spanContext(); // Verify trace context matches parent const traceCtx = this._ai.core.getTraceCtx(false); Assert.equal(traceCtx.spanId, parentSpanContext.spanId, "Trace context should match parent span inside useSpan"); childSpan!.end(); }); // Assert Assert.ok(childSpanContext, "Child span context should exist"); Assert.ok(parentSpanContext, "Parent span context should exist"); // Child should have same traceId as parent but different spanId Assert.equal(childSpanContext.traceId, parentSpanContext.traceId, "Child span should have same traceId as parent"); Assert.notEqual(childSpanContext.spanId, parentSpanContext.spanId, "Child span should have different spanId from parent"); parentSpan!.end(); } }); this.testCase({ name: "UseSpan: trace context is restored after useSpan completes", test: () => { // Arrange const testSpan = this._ai.startSpan("temporary-trace-span"); let traceCtxBefore: any = null; let traceCtxInside: any = null; let traceCtxAfter: any = null; // Act traceCtxBefore = this._ai.core.getTraceCtx(false); useSpan(this._ai.core, testSpan!, () => { traceCtxInside = this._ai.core.getTraceCtx(false); }); traceCtxAfter = this._ai.core.getTraceCtx(false); // Assert Assert.ok(traceCtxBefore, "Trace context should exist before useSpan (created by startSpan)"); Assert.ok(traceCtxInside, "Trace context should exist inside useSpan"); Assert.equal(traceCtxInside.spanId, testSpan!.spanContext().spanId, "Trace context inside useSpan should match the test span"); Assert.ok(traceCtxAfter, "Trace context should exist after useSpan"); Assert.equal(traceCtxAfter.spanId, traceCtxBefore.spanId, "Trace context should be restored to previous state after useSpan"); testSpan!.end(); } }); this.testCase({ name: "UseSpan: trace context reflects parent span when useSpan is nested in another active span", test: () => { // Arrange const outerSpan = this._ai.startSpan("outer-active-span"); const provider = this._ai.core.getTraceProvider(); this._ai.setActiveSpan(outerSpan!); const innerSpan = this._ai.startSpan("inner-usespan-span"); let outerSpanCtx: any = null; let traceCtxBeforeUseSpan: any = null; let traceCtxInsideUseSpan: any = null; let traceCtxAfterUseSpan: any = null; // Act outerSpanCtx = outerSpan!.spanContext(); traceCtxBeforeUseSpan = this._ai.core.getTraceCtx(false); // Verify initial trace context matches outer span Assert.equal(traceCtxBeforeUseSpan.spanId, outerSpanCtx.spanId, "Trace context should initially match outer span"); useSpan(this._ai.core, innerSpan!, (scope: ISpanScope) => { traceCtxInsideUseSpan = this._ai.core.getTraceCtx(false); const innerSpanCtx = scope.span.spanContext(); // Inside useSpan, trace context should match inner span Assert.equal(traceCtxInsideUseSpan.spanId, innerSpanCtx.spanId, "Trace context inside useSpan should match inner span"); }); traceCtxAfterUseSpan = this._ai.core.getTraceCtx(false); // After useSpan, trace context should be restored to outer span Assert.equal(traceCtxAfterUseSpan.spanId, outerSpanCtx.spanId, "Trace context should be restored to outer span after useSpan"); innerSpan!.end(); outerSpan!.end(); } }); this.testCase({ name: "UseSpan: trace context traceState is accessible inside useSpan", test: () => { // Arrange const testSpan = this._ai.startSpan("tracestate-test-span"); let traceStateInside: any = null; // Act useSpan(this._ai.core, testSpan!, () => { const traceCtx = this._ai.core.getTraceCtx(false); traceStateInside = traceCtx ? traceCtx.traceState : null; }); // Assert Assert.ok(traceStateInside !== undefined, "Trace state should be accessible inside useSpan"); testSpan!.end(); } }); this.testCase({ name: "UseSpan: span created inside useSpan has parent context matching outer trace context", test: () => { // Arrange const outerSpan = this._ai.startSpan("outer-parent-span"); this._ai.setActiveSpan(outerSpan!); let outerTraceCtx: any = null; let innerSpanParentCtx: any = null; let innerSpanCreated: any = null; // Act outerTraceCtx = this._ai.core.getTraceCtx(false); useSpan(this._ai.core, outerSpan!, (scope: ISpanScope) => { // Create a new span inside useSpan innerSpanCreated = this._ai.startSpan("inner-child-span"); // Get the parent context of the newly created span if (innerSpanCreated) { innerSpanParentCtx = innerSpanCreated.parentSpanContext; } innerSpanCreated!.end(); }); // Assert Assert.ok(outerTraceCtx, "Outer trace context should exist"); Assert.ok(innerSpanParentCtx, "Inner span should have parent context"); // Verify parent context matches outer trace context Assert.equal(innerSpanParentCtx.traceId, outerTraceCtx.traceId, "Inner span parent traceId should match outer trace context traceId"); Assert.equal(innerSpanParentCtx.spanId, outerTraceCtx.spanId, "Inner span parent spanId should match outer trace context spanId"); outerSpan!.end(); } }); this.testCase({ name: "UseSpan: span parent context matches trace context when useSpan wraps different span", test: () => { // Arrange - Create initial trace context const contextSpan = this._ai.startSpan("context-span"); this._ai.setActiveSpan(contextSpan!); const contextTraceCtx = this._ai.core.getTraceCtx(false); // Create a different span to use in useSpan const wrapperSpan = this._ai.startSpan("wrapper-span"); let spanCreatedInCallback: any = null; let spanParentCtx: any = null; // Act - useSpan with a different span than what's in trace context useSpan(this._ai.core, wrapperSpan!, (scope: ISpanScope) => { // The active span is now wrapperSpan // Create a child span - it should have wrapperSpan as parent spanCreatedInCallback = this._ai.startSpan("child-of-wrapper"); if (spanCreatedInCallback) { spanParentCtx = spanCreatedInCallback.parentSpanContext; } spanCreatedInCallback!.end(); }); // Assert Assert.ok(spanParentCtx, "Child span should have parent context"); // Parent should be wrapperSpan (the useSpan span), not contextSpan const wrapperSpanCtx = wrapperSpan!.spanContext(); Assert.equal(spanParentCtx.spanId, wrapperSpanCtx.spanId, "Child span parent should be the wrapper span from useSpan"); Assert.notEqual(spanParentCtx.spanId, contextTraceCtx.spanId, "Child span parent should NOT be the original context span"); wrapperSpan!.end(); contextSpan!.end(); } }); this.testCase({ name: "UseSpan: multiple nested spans maintain correct parent-child relationships with trace context", test: () => { // Arrange const rootSpan = this._ai.startSpan("root-span"); this._ai.setActiveSpan(rootSpan!); const rootTraceCtx = this._ai.core.getTraceCtx(false); const level1Span = this._ai.startSpan("level1-span"); let level2SpanParent: any = null; let level2SpanCtx: any = null; let level3SpanParent: any = null; // Act - Nested useSpan calls useSpan(this._ai.core, level1Span!, (scope1: ISpanScope) => { const level1TraceCtx = this._ai.core.getTraceCtx(false); // Create level2 span - should have level1 as parent const level2Span = this._ai.startSpan("level2-span"); if (level2Span) { level2SpanParent = level2Span.parentSpanContext; level2SpanCtx = level2Span.spanContext(); } useSpan(this._ai.core, level2Span!, (scope2: ISpanScope) => { const level2TraceCtx = this._ai.core.getTraceCtx(false); // Create level3 span - should have level2 as parent const level3Span = this._ai.startSpan("level3-span"); if (level3Span) { level3SpanParent = level3Span.parentSpanContext; } // Verify level3 parent matches level2 trace context Assert.equal(level3SpanParent.spanId, level2TraceCtx.spanId, "Level3 span parent should match level2 trace context"); level3Span!.end(); }); // Verify level2 parent matches level1 trace context Assert.equal(level2SpanParent.spanId, level1TraceCtx.spanId, "Level2 span parent should match level1 trace context"); level2Span!.end(); }); // Assert Assert.ok(level2SpanParent, "Level2 span should have parent context"); Assert.ok(level2SpanCtx, "Level2 span context should exist"); Assert.ok(level3SpanParent, "Level3 span should have parent context"); // Verify the chain: root -> level1 -> level2 -> level3 Assert.equal(level2SpanParent.spanId, level1Span!.spanContext().spanId, "Level2 parent should be level1"); Assert.equal(level3SpanParent.spanId, level2SpanCtx.spanId, "Level3 parent should be level2"); level1Span!.end(); rootSpan!.end(); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/WithSpan.Tests.ts ================================================ import { AITestClass, Assert } from '@microsoft/ai-test-framework'; import { ApplicationInsights } from '../../../src/applicationinsights-web'; import { IReadableSpan, eOTelSpanKind, eOTelSpanStatusCode, withSpan, ITelemetryItem, ISpanScope, ITraceHost } from "@microsoft/applicationinsights-core-js"; export class WithSpanTests extends AITestClass { private static readonly _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; private static readonly _connectionString = `InstrumentationKey=${WithSpanTests._instrumentationKey}`; private _ai!: ApplicationInsights; // Track calls to track for validation private _trackCalls: ITelemetryItem[] = []; constructor(testName?: string) { super(testName || "WithSpanTests"); } public testInitialize() { try { this.useFakeServer = false; this._trackCalls = []; this._ai = new ApplicationInsights({ config: { connectionString: WithSpanTests._connectionString, disableAjaxTracking: false, disableXhr: false, maxBatchInterval: 0, disableExceptionTracking: false } }); // Initialize the SDK this._ai.loadAppInsights(); // Hook core.track to capture calls const originalTrack = this._ai.core.track; this._ai.core.track = (item: ITelemetryItem) => { this._trackCalls.push(item); return originalTrack.call(this._ai.core, item); }; } catch (e) { console.error('Failed to initialize WithSpan tests: ' + e); throw e; } } public testFinishedCleanup() { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public registerTests() { this.addTests(); } private addTests(): void { this.testCase({ name: "WithSpan: withSpan should be available as exported function", test: () => { // Verify that withSpan is available as an import Assert.ok(typeof withSpan === 'function', "withSpan should be available as exported function"); } }); this.testCase({ name: "WithSpan: should execute function within span context", test: () => { // Arrange const testSpan = this._ai.startSpan("withSpan-context-test", { kind: eOTelSpanKind.SERVER, attributes: { "test.type": "context-execution" } }); Assert.ok(testSpan, "Test span should be created"); Assert.ok(this._ai.core, "Core should be available"); let capturedActiveSpan: IReadableSpan | null = null; const testFunction = () => { capturedActiveSpan = this._ai.core!.getActiveSpan(); return "context-success"; }; // Act const result = withSpan(this._ai.core!, testSpan!, testFunction); // Assert Assert.equal(result, "context-success", "Function should execute and return result"); Assert.ok(capturedActiveSpan, "Function should have access to active span"); Assert.equal(capturedActiveSpan, testSpan, "Active span should be the provided test span"); } }); this.testCase({ name: "WithSpan: should work with telemetry tracking inside span context", test: () => { // Arrange this._trackCalls = []; const testSpan = this._ai.startSpan("withSpan-telemetry-test", { attributes: { "operation.name": "telemetry-tracking" } }); Assert.ok(testSpan, "Test span should be created"); const telemetryFunction = () => { // Track some telemetry within the span context this._ai.trackEvent({ name: "operation-event", properties: { "event.source": "withSpan-context" } }); this._ai.trackMetric({ name: "operation.duration", average: 123.45 }); return "telemetry-tracked"; }; // Act const result = withSpan(this._ai.core!, testSpan!, telemetryFunction); // Assert Assert.equal(result, "telemetry-tracked", "Function should complete successfully"); // End the span to trigger trace generation testSpan!.end(); // Verify track was called for the span Assert.equal(this._trackCalls.length, 3, "Should have one track call from span ending"); const item = this._trackCalls[2]; Assert.ok(item.baseData && item.baseData.properties, "Item should have properties"); Assert.equal("withSpan-telemetry-test", item.baseData.name, "Should include span name in properties"); } }); this.testCase({ name: "WithSpan: should handle complex function arguments and return values", test: () => { // Arrange const testSpan = this._ai.startSpan("withSpan-arguments-test"); Assert.ok(testSpan, "Test span should be created"); const complexFunction = ( stringArg: string, numberArg: number, objectArg: { key: string; value: number }, arrayArg: string[] ) => { return { processedString: stringArg.toUpperCase(), doubledNumber: numberArg * 2, extractedValue: objectArg.value, joinedArray: arrayArg.join('-'), timestamp: Date.now() }; }; const inputObject = { key: "test-key", value: 42 }; const inputArray = ["item1", "item2", "item3"]; // Act const result = withSpan( this._ai.core!, testSpan!, complexFunction, undefined, "hello world", 10, inputObject, inputArray ); // Assert Assert.equal(result.processedString, "HELLO WORLD", "String should be processed correctly"); Assert.equal(result.doubledNumber, 20, "Number should be doubled correctly"); Assert.equal(result.extractedValue, 42, "Object value should be extracted correctly"); Assert.equal(result.joinedArray, "item1-item2-item3", "Array should be joined correctly"); Assert.ok(result.timestamp > 0, "Timestamp should be generated"); } }); this.testCase({ name: "WithSpan: should handle function with this context binding", test: () => { // Arrange const testSpan = this._ai.startSpan("withSpan-this-binding-test"); Assert.ok(testSpan, "Test span should be created"); class TestService { private _serviceId: string; private _multiplier: number; constructor(id: string, multiplier: number) { this._serviceId = id; this._multiplier = multiplier; } public processValue(input: number): { serviceId: string; result: number; multiplied: number } { return { serviceId: this._serviceId, result: input + 100, multiplied: input * this._multiplier }; } } const service = new TestService("test-service-123", 3); // Act const result = withSpan( this._ai.core!, testSpan!, service.processValue, service, 25 ); // Assert Assert.equal(result.serviceId, "test-service-123", "Service ID should be preserved via this binding"); Assert.equal(result.result, 125, "Input should be processed correctly"); Assert.equal(result.multiplied, 75, "Multiplication should use instance property"); } }); this.testCase({ name: "WithSpan: should maintain span context across async-like operations", test: () => { // Arrange const testSpan = this._ai.startSpan("withSpan-async-like-test", { attributes: { "operation.type": "async-simulation" } }); Assert.ok(testSpan, "Test span should be created"); let spanDuringCallback: IReadableSpan | null = null; let callbackExecuted = false; const asyncLikeFunction = (callback: (data: string) => void) => { // Simulate async work that completes synchronously in test const currentSpan = this._ai.core!.getActiveSpan(); // Simulate callback execution (would normally be async) setTimeout(() => { spanDuringCallback = this._ai.core!.getActiveSpan(); callback("async-data"); callbackExecuted = true; }, 0); return currentSpan ? (currentSpan as IReadableSpan).name : "no-span"; }; // Act let callbackData = ""; const callback = (data: string) => { callbackData = data; }; const result = withSpan(this._ai.core!, testSpan!, asyncLikeFunction, undefined, callback); // Assert Assert.equal(result, "withSpan-async-like-test", "Function should have access to span name"); // Note: In a real async scenario, the span context wouldn't automatically // propagate to the setTimeout callback without additional context management // This test validates the synchronous behavior of withSpan } }); this.testCase({ name: "WithSpan: should handle exceptions and preserve span operations", test: () => { // Arrange const testSpan = this._ai.startSpan("withSpan-exception-test", { attributes: { "test.expects": "exception" } }); Assert.ok(testSpan, "Test span should be created"); const exceptionFunction = () => { // Perform some span operations before throwing const activeSpan = this._ai.core!.getActiveSpan(); Assert.ok(activeSpan, "Should have active span before exception"); activeSpan!.setAttribute("operation.status", "error"); activeSpan!.setStatus({ code: eOTelSpanStatusCode.ERROR, message: "Operation failed with test exception" }); throw new Error("Test exception for withSpan handling"); }; // Act & Assert let caughtException: Error | null = null; try { withSpan(this._ai.core!, testSpan!, exceptionFunction); } catch (error) { caughtException = error as Error; } Assert.ok(caughtException, "Exception should be thrown and caught"); Assert.equal(caughtException!.message, "Test exception for withSpan handling", "Exception message should be preserved"); // Verify span is still valid and operations were applied Assert.ok(testSpan!.isRecording(), "Span should still be recording after exception"); const readableSpan = testSpan! as IReadableSpan; Assert.ok(!readableSpan.ended, "Span should not be ended by withSpan after exception"); } }); this.testCase({ name: "WithSpan: should work with nested span operations and child spans", test: () => { // Arrange this._trackCalls = []; const parentSpan = this._ai.startSpan("parent-operation", { kind: eOTelSpanKind.SERVER, attributes: { "operation.name": "parent-process" } }); Assert.ok(parentSpan, "Parent span should be created"); const nestedOperations = () => { // Verify we have the parent span as active const currentActive = this._ai.core!.getActiveSpan(); Assert.equal(currentActive, parentSpan, "Parent span should be active"); // Create child operations within the parent span context const childSpan1 = this._ai.startSpan("child-operation-1", { attributes: { "child.order": 1 } }); childSpan1!.setAttribute("child.status", "completed"); childSpan1!.end(); const childSpan2 = this._ai.startSpan("child-operation-2", { attributes: { "child.order": 2 } }); childSpan2!.setAttribute("child.status", "completed"); childSpan2!.end(); return "nested-operations-completed"; }; // Act const result = withSpan(this._ai.core!, parentSpan!, nestedOperations); // Assert Assert.equal(result, "nested-operations-completed", "Nested operations should complete successfully"); // End parent span to generate telemetry parentSpan!.end(); // Should have 3 telemetry items: parent + 2 children Assert.equal(this._trackCalls.length, 3, "Should have telemetry for parent and child spans"); // Verify span names in properties const spanNames = this._trackCalls.map(item => item.baseData?.name).filter(n => n); Assert.ok(spanNames.some(name => name === "parent-operation"), "Should have parent span telemetry"); Assert.ok(spanNames.some(name => name === "child-operation-1"), "Should have child-1 span telemetry"); Assert.ok(spanNames.some(name => name === "child-operation-2"), "Should have child-2 span telemetry"); } }); this.testCase({ name: "WithSpan: should support different return value types", test: () => { // Arrange const testSpan = this._ai.startSpan("withSpan-return-types-test"); Assert.ok(testSpan, "Test span should be created"); // Test various return types const stringResult = withSpan(this._ai.core!, testSpan!, () => "string-result"); const numberResult = withSpan(this._ai.core!, testSpan!, () => 42.5); const booleanResult = withSpan(this._ai.core!, testSpan!, () => true); const arrayResult = withSpan(this._ai.core!, testSpan!, () => [1, 2, 3]); const objectResult = withSpan(this._ai.core!, testSpan!, () => ({ key: "value", nested: { prop: 123 } })); const nullResult = withSpan(this._ai.core!, testSpan!, () => null); const undefinedResult = withSpan(this._ai.core!, testSpan!, () => undefined); // Assert Assert.equal(stringResult, "string-result", "String return should work"); Assert.equal(numberResult, 42.5, "Number return should work"); Assert.equal(booleanResult, true, "Boolean return should work"); Assert.equal(arrayResult.length, 3, "Array return should work"); Assert.equal(arrayResult[1], 2, "Array elements should be preserved"); Assert.equal(objectResult.key, "value", "Object properties should be preserved"); Assert.equal(objectResult.nested.prop, 123, "Nested object properties should be preserved"); Assert.equal(nullResult, null, "Null return should work"); Assert.equal(undefinedResult, undefined, "Undefined return should work"); } }); this.testCase({ name: "WithSpan: should handle rapid successive calls efficiently", test: () => { // Arrange const testSpan = this._ai.startSpan("withSpan-performance-test"); Assert.ok(testSpan, "Test span should be created"); const iterations = 100; let totalResult = 0; // Simple computation function const computeFunction = (input: number) => { return input * 2 + 1; }; const startTime = Date.now(); // Act - Multiple rapid withSpan calls for (let i = 0; i < iterations; i++) { const result = withSpan(this._ai.core!, testSpan!, computeFunction, undefined, i); totalResult += result; } const endTime = Date.now(); const duration = endTime - startTime; // Assert const expectedTotal = Array.from({length: iterations}, (_, i) => i * 2 + 1).reduce((sum, val) => sum + val, 0); Assert.equal(totalResult, expectedTotal, "All computations should be correct"); // Performance assertion - should complete reasonably quickly Assert.ok(duration < 1000, `Performance test should complete quickly: ${duration}ms for ${iterations} iterations`); // Verify span is still valid after many operations Assert.ok(testSpan!.isRecording(), "Span should still be recording after multiple withSpan calls"); } }); this.testCase({ name: "WithSpan: should integrate with AI telemetry correlation", test: () => { // Arrange this._trackCalls = []; const operationSpan = this._ai.startSpan("user-operation", { kind: eOTelSpanKind.SERVER, attributes: { "user.id": "user-123", "operation.type": "data-processing" } }); Assert.ok(operationSpan, "Operation span should be created"); const businessLogicFunction = (userId: string, dataType: string) => { // Track multiple telemetry items within span context this._ai.trackEvent({ name: "data-processing-started", properties: { "user.id": userId, "data.type": dataType, "processing.stage": "initialization" } }); // Simulate some processing steps for (let step = 1; step <= 3; step++) { this._ai.trackMetric({ name: "processing.step.duration", average: step * 10.5, properties: { "step.number": step.toString() } }); } this._ai.trackEvent({ name: "data-processing-completed", properties: { "user.id": userId, "data.type": dataType, "processing.stage": "completion", "steps.completed": "3" } }); return { userId: userId, dataType: dataType, stepsCompleted: 3, status: "success" }; }; // Act const result = withSpan( this._ai.core!, operationSpan!, businessLogicFunction, undefined, "user-123", "customer-data" ); // End the span to generate trace operationSpan!.end(); // Assert Assert.equal(result.userId, "user-123", "User ID should be processed correctly"); Assert.equal(result.dataType, "customer-data", "Data type should be processed correctly"); Assert.equal(result.stepsCompleted, 3, "All processing steps should be completed"); Assert.equal(result.status, "success", "Operation should complete successfully"); // Verify span telemetry was generated Assert.equal(this._trackCalls.length, 6, "Should have one track call from span ending"); const spanItem = this._trackCalls[5]; Assert.ok(spanItem.baseData && spanItem.baseData.properties, "Item should have properties"); Assert.equal("user-operation", spanItem.baseData.name, "Should include span name"); // Verify span attributes are included in properties Assert.equal(spanItem.baseData.properties["user.id"], "user-123", "Span attributes should be included in telemetry"); Assert.equal(spanItem.baseData.properties["operation.type"], "data-processing", "All span attributes should be preserved"); } }); this.testCase({ name: "WithSpan: should handle empty or no-op functions gracefully", test: () => { // Arrange const testSpan = this._ai.startSpan("withSpan-noop-test"); Assert.ok(testSpan, "Test span should be created"); // Test empty function const emptyFunction = () => {}; // Test function that just returns without doing anything const noOpFunction = () => { return; }; // Test function that returns undefined explicitly const undefinedFunction = () => { return undefined; }; // Act const emptyResult = withSpan(this._ai.core!, testSpan!, emptyFunction); const noOpResult = withSpan(this._ai.core!, testSpan!, noOpFunction); const undefinedResult = withSpan(this._ai.core!, testSpan!, undefinedFunction); // Assert Assert.equal(emptyResult, undefined, "Empty function should return undefined"); Assert.equal(noOpResult, undefined, "No-op function should return undefined"); Assert.equal(undefinedResult, undefined, "Undefined function should return undefined"); // Verify span is still valid Assert.ok(testSpan!.isRecording(), "Span should still be recording after no-op functions"); } }); this.testCase({ name: "WithSpan: should use ISpanScope as 'this' when no thisArg provided", test: () => { // Arrange const span = this._ai.startSpan("test-span", { attributes: { "test.id": "withSpan-this-test" } }); let capturedThis: any = null; let capturedHost: ITraceHost | null = null; let capturedSpan: any = null; // Act - call withSpan without thisArg const result = withSpan(this._ai.core, span!, function(this: ISpanScope, arg1: string, arg2: number) { capturedThis = this; capturedHost = this.host; capturedSpan = this.span; return `${arg1}-${arg2}`; }, undefined, "test", 42); // Assert Assert.equal(result, "test-42", "Function should execute and return result"); Assert.ok(capturedThis, "'this' should be defined"); Assert.ok(capturedThis.host, "'this.host' should exist"); Assert.ok(capturedThis.span, "'this.span' should exist"); Assert.equal(capturedHost, this._ai.core, "'this.host' should be the AI core"); Assert.equal(capturedSpan, span, "'this.span' should be the passed span"); Assert.equal(capturedThis.span.name, "test-span", "'this.span.name' should match"); span!.end(); } }); this.testCase({ name: "WithSpan: should use provided thisArg when specified", test: () => { // Arrange const span = this._ai.startSpan("test-span-thisarg"); const customContext = { contextId: "custom-123", multiplier: 10 }; let capturedThis: any = null; // Act - call withSpan with explicit thisArg const result = withSpan(this._ai.core, span!, function(this: typeof customContext, arg1: number) { capturedThis = this; return arg1 * this.multiplier; }, customContext, 5); // Assert Assert.equal(result, 50, "Function should execute with custom this context"); Assert.ok(capturedThis, "'this' should be defined"); Assert.equal(capturedThis, customContext, "'this' should be the custom context"); Assert.equal(capturedThis.contextId, "custom-123", "'this.contextId' should match"); Assert.equal(capturedThis.multiplier, 10, "'this.multiplier' should match"); Assert.ok(!capturedThis.core, "Custom this should not have core property"); Assert.ok(!capturedThis.span, "Custom this should not have span property"); span!.end(); } }); this.testCase({ name: "WithSpan: arrow functions should not override 'this' binding", test: () => { // Arrange const span = this._ai.startSpan("arrow-function-test"); // Act - arrow functions capture their lexical 'this' const result = withSpan(this._ai.core, span!, (arg: string) => { // Arrow function - 'this' is lexically bound to the test class instance Assert.ok(this._ai, "Arrow function should have access to test class 'this'"); return `arrow-${arg}`; }, undefined, "result"); // Assert Assert.equal(result, "arrow-result", "Arrow function should execute correctly"); Assert.ok(this._ai, "Test class instance should still be accessible"); span!.end(); } }); this.testCase({ name: "WithSpan: verify ISpanScope.restore() is called to restore previous active span", test: () => { // Arrange const outerSpan = this._ai.startSpan("outer-span"); const innerSpan = this._ai.startSpan("inner-span"); let activeSpanBeforeWithSpan: any = null; let activeSpanInsideWithSpan: any = null; let activeSpanAfterWithSpan: any = null; // Act activeSpanBeforeWithSpan = this._ai.core.getActiveSpan ? this._ai.core.getActiveSpan() : null; withSpan(this._ai.core, innerSpan!, () => { activeSpanInsideWithSpan = this._ai.core.getActiveSpan ? this._ai.core.getActiveSpan() : null; Assert.equal(activeSpanInsideWithSpan, innerSpan, "Active span inside withSpan should be inner span"); }); activeSpanAfterWithSpan = this._ai.core.getActiveSpan ? this._ai.core.getActiveSpan() : null; // Assert // Active span should be restored after withSpan completes Assert.equal(activeSpanAfterWithSpan, activeSpanBeforeWithSpan, "Active span should be restored after withSpan completes"); innerSpan!.end(); outerSpan!.end(); } }); this.testCase({ name: "WithSpan: 'this' binding with nested withSpan calls", test: () => { // Arrange const outerSpan = this._ai.startSpan("outer-withspan"); const innerSpan = this._ai.startSpan("inner-withspan"); const outerContext = { contextName: "outer", value: 100 }; let outerThisCapture: any = null; let innerThisCapture: any = null; let ai = this._ai; // Act - nested withSpan calls with different thisArg withSpan(ai.core, outerSpan!, function(this: typeof outerContext, arg: number) { outerThisCapture = this; Assert.equal(this.contextName, "outer", "Outer 'this' should be outer context"); Assert.equal(this.value, 100, "Outer 'this.value' should match"); withSpan(ai.core, innerSpan!, function(this: ISpanScope) { innerThisCapture = this; // Inner call without explicit thisArg - should be ISpanScope Assert.ok(this.host, "Inner 'this' should be ISpanScope"); Assert.ok(this.span, "Inner 'this.span' should exist"); Assert.equal(this.span.name, "inner-withspan", "Inner span name should match"); }); return arg * this.value; }, outerContext, 2); // Assert Assert.ok(outerThisCapture, "Outer 'this' should be captured"); Assert.equal(outerThisCapture.contextName, "outer", "Outer context should be preserved"); Assert.ok(innerThisCapture, "Inner 'this' should be captured"); Assert.ok(innerThisCapture.host, "Inner 'this' should have host"); Assert.ok(innerThisCapture.span, "Inner 'this' should have span"); innerSpan!.end(); outerSpan!.end(); } }); this.testCase({ name: "WithSpan: trace context should match active span context inside withSpan", test: () => { // Arrange const testSpan = this._ai.startSpan("trace-context-match-test", { attributes: { "test.type": "trace-context-validation" } }); Assert.ok(testSpan, "Test span should be created"); let traceCtxInsideWithSpan: any = null; let spanContextInsideWithSpan: any = null; let activeSpanInsideWithSpan: any = null; // Act withSpan(this._ai.core, testSpan!, function(this: ISpanScope) { // Get trace context from core traceCtxInsideWithSpan = this.host.getTraceCtx(false); // Get span context from the span spanContextInsideWithSpan = this.span.spanContext(); // Get active span activeSpanInsideWithSpan = this.host.getActiveSpan ? this.host.getActiveSpan() : null; }); // Assert Assert.ok(traceCtxInsideWithSpan, "Trace context should exist inside withSpan"); Assert.ok(spanContextInsideWithSpan, "Span context should exist"); Assert.ok(activeSpanInsideWithSpan, "Active span should be set"); // Verify active span matches the withSpan span Assert.equal(activeSpanInsideWithSpan, testSpan, "Active span should be the withSpan span"); // Verify trace context matches span context Assert.equal(traceCtxInsideWithSpan.traceId, spanContextInsideWithSpan.traceId, "Trace context traceId should match span context traceId"); Assert.equal(traceCtxInsideWithSpan.spanId, spanContextInsideWithSpan.spanId, "Trace context spanId should match span context spanId"); Assert.equal(traceCtxInsideWithSpan.traceFlags, spanContextInsideWithSpan.traceFlags, "Trace context traceFlags should match span context traceFlags"); testSpan!.end(); } }); this.testCase({ name: "WithSpan: trace context updates when switching between nested withSpan calls", test: () => { // Arrange const outerSpan = this._ai.startSpan("outer-trace-span"); const innerSpan = this._ai.startSpan("inner-trace-span"); let outerTraceCtx: any = null; let outerSpanCtx: any = null; let innerTraceCtx: any = null; let innerSpanCtx: any = null; let ai = this._ai; // Act withSpan(ai.core, outerSpan!, function(this: ISpanScope) { outerTraceCtx = this.host.getTraceCtx(false); outerSpanCtx = this.span.spanContext(); // Verify outer trace context matches outer span Assert.equal(outerTraceCtx.spanId, outerSpanCtx.spanId, "Outer trace context should match outer span"); // Nested withSpan with different span withSpan(ai.core, innerSpan!, function(this: ISpanScope) { innerTraceCtx = this.host.getTraceCtx(false); innerSpanCtx = this.span.spanContext(); // Verify inner trace context matches inner span Assert.equal(innerTraceCtx.spanId, innerSpanCtx.spanId, "Inner trace context should match inner span"); // Verify inner context is different from outer Assert.notEqual(innerTraceCtx.spanId, outerTraceCtx.spanId, "Inner and outer trace contexts should have different spanIds"); }); // After inner withSpan, verify we're back to outer context const restoredTraceCtx = this.host.getTraceCtx(false); Assert.equal(restoredTraceCtx.spanId, outerSpanCtx.spanId, "Trace context should be restored to outer span after inner withSpan completes"); }); outerSpan!.end(); innerSpan!.end(); } }); this.testCase({ name: "WithSpan: child spans created inside withSpan inherit correct parent context", test: () => { // Arrange const parentSpan = this._ai.startSpan("parent-for-child-test"); let ai = this._ai; let childSpanContext: any = null; let parentSpanContext: any = null; // Act withSpan(ai.core, parentSpan!, function(this: ISpanScope) { parentSpanContext = this.span.spanContext(); // Create a child span while parent is active const childSpan = ai.startSpan("child-span-in-withSpan"); childSpanContext = childSpan!.spanContext(); // Verify trace context matches parent const traceCtx = this.host.getTraceCtx(false); Assert.equal(traceCtx.spanId, parentSpanContext.spanId, "Trace context should match parent span inside withSpan"); childSpan!.end(); }); // Assert Assert.ok(childSpanContext, "Child span context should exist"); Assert.ok(parentSpanContext, "Parent span context should exist"); // Child should have same traceId as parent but different spanId Assert.equal(childSpanContext.traceId, parentSpanContext.traceId, "Child span should have same traceId as parent"); Assert.notEqual(childSpanContext.spanId, parentSpanContext.spanId, "Child span should have different spanId from parent"); parentSpan!.end(); } }); this.testCase({ name: "WithSpan: trace context is restored after withSpan completes", test: () => { // Arrange const testSpan = this._ai.startSpan("temporary-trace-span"); let traceCtxBefore: any = null; let traceCtxInside: any = null; let traceCtxAfter: any = null; let ai = this._ai; // Act traceCtxBefore = this._ai.core.getTraceCtx(false); withSpan(ai.core, testSpan!, function(this: ISpanScope) { traceCtxInside = this.host.getTraceCtx(false); }); traceCtxAfter = this._ai.core.getTraceCtx(false); // Assert Assert.ok(traceCtxBefore, "Trace context should exist before withSpan (created by startSpan)"); Assert.ok(traceCtxInside, "Trace context should exist inside withSpan"); Assert.equal(traceCtxInside.spanId, testSpan!.spanContext().spanId, "Trace context inside withSpan should match the test span"); Assert.ok(traceCtxAfter, "Trace context should exist after withSpan"); Assert.equal(traceCtxAfter.spanId, traceCtxBefore.spanId, "Trace context should be restored to previous state after withSpan"); testSpan!.end(); } }); this.testCase({ name: "WithSpan: trace context reflects parent span when withSpan is nested in another active span", test: () => { // Arrange const outerSpan = this._ai.startSpan("outer-active-span"); this._ai.setActiveSpan(outerSpan!); const innerSpan = this._ai.startSpan("inner-withspan-span"); let ai = this._ai; let outerSpanCtx: any = null; let traceCtxBeforeWithSpan: any = null; let traceCtxInsideWithSpan: any = null; let traceCtxAfterWithSpan: any = null; // Act outerSpanCtx = outerSpan!.spanContext(); traceCtxBeforeWithSpan = this._ai.core.getTraceCtx(false); // Verify initial trace context matches outer span Assert.equal(traceCtxBeforeWithSpan.spanId, outerSpanCtx.spanId, "Trace context should initially match outer span"); withSpan(ai.core, innerSpan!, function(this: ISpanScope) { traceCtxInsideWithSpan = this.host.getTraceCtx(false); const innerSpanCtx = this.span.spanContext(); // Inside withSpan, trace context should match inner span Assert.equal(traceCtxInsideWithSpan.spanId, innerSpanCtx.spanId, "Trace context inside withSpan should match inner span"); }); traceCtxAfterWithSpan = this._ai.core.getTraceCtx(false); // After withSpan, trace context should be restored to outer span Assert.equal(traceCtxAfterWithSpan.spanId, outerSpanCtx.spanId, "Trace context should be restored to outer span after withSpan"); innerSpan!.end(); outerSpan!.end(); } }); this.testCase({ name: "WithSpan: trace context traceState is accessible inside withSpan", test: () => { // Arrange const testSpan = this._ai.startSpan("tracestate-test-span"); let ai = this._ai; let traceStateInside: any = null; // Act withSpan(ai.core, testSpan!, function(this: ISpanScope) { const traceCtx = this.host.getTraceCtx(false); traceStateInside = traceCtx ? traceCtx.traceState : null; }); // Assert Assert.ok(traceStateInside !== undefined, "Trace state should be accessible inside withSpan"); testSpan!.end(); } }); this.testCase({ name: "WithSpan: span created inside withSpan has parent context matching outer trace context", test: () => { // Arrange const outerSpan = this._ai.startSpan("outer-parent-span"); this._ai.setActiveSpan(outerSpan!); let outerTraceCtx: any = null; let innerSpanParentCtx: any = null; let innerSpanCreated: any = null; let ai = this._ai; // Act outerTraceCtx = this._ai.core.getTraceCtx(false); withSpan(ai.core, outerSpan!, function(this: ISpanScope) { // Create a new span inside withSpan innerSpanCreated = ai.startSpan("inner-child-span"); // Get the parent context of the newly created span if (innerSpanCreated) { innerSpanParentCtx = innerSpanCreated.parentSpanContext; } innerSpanCreated!.end(); }); // Assert Assert.ok(outerTraceCtx, "Outer trace context should exist"); Assert.ok(innerSpanParentCtx, "Inner span should have parent context"); // Verify parent context matches outer trace context Assert.equal(innerSpanParentCtx.traceId, outerTraceCtx.traceId, "Inner span parent traceId should match outer trace context traceId"); Assert.equal(innerSpanParentCtx.spanId, outerTraceCtx.spanId, "Inner span parent spanId should match outer trace context spanId"); outerSpan!.end(); } }); this.testCase({ name: "WithSpan: span parent context matches trace context when withSpan wraps different span", test: () => { // Arrange - Create initial trace context const contextSpan = this._ai.startSpan("context-span"); this._ai.setActiveSpan(contextSpan!); const contextTraceCtx = this._ai.core.getTraceCtx(false); // Create a different span to use in withSpan const wrapperSpan = this._ai.startSpan("wrapper-span"); let spanCreatedInCallback: any = null; let spanParentCtx: any = null; let ai = this._ai; // Act - withSpan with a different span than what's in trace context withSpan(ai.core, wrapperSpan!, function(this: ISpanScope) { // The active span is now wrapperSpan // Create a child span - it should have wrapperSpan as parent spanCreatedInCallback = ai.startSpan("child-of-wrapper"); if (spanCreatedInCallback) { spanParentCtx = spanCreatedInCallback.parentSpanContext; } spanCreatedInCallback!.end(); }); // Assert Assert.ok(spanParentCtx, "Child span should have parent context"); // Parent should be wrapperSpan (the withSpan span), not contextSpan const wrapperSpanCtx = wrapperSpan!.spanContext(); Assert.equal(spanParentCtx.spanId, wrapperSpanCtx.spanId, "Child span parent should be the wrapper span from withSpan"); Assert.notEqual(spanParentCtx.spanId, contextTraceCtx.spanId, "Child span parent should NOT be the original context span"); wrapperSpan!.end(); contextSpan!.end(); } }); this.testCase({ name: "WithSpan: multiple nested spans maintain correct parent-child relationships with trace context", test: () => { // Arrange const rootSpan = this._ai.startSpan("root-span"); this._ai.setActiveSpan(rootSpan!); const level1Span = this._ai.startSpan("level1-span"); let level2SpanParent: any = null; let level2SpanCtx: any = null; let level3SpanParent: any = null; let ai = this._ai; // Act - Nested withSpan calls withSpan(ai.core, level1Span!, function(this: ISpanScope) { const level1TraceCtx = this.host.getTraceCtx(false); // Create level2 span - should have level1 as parent const level2Span = ai.startSpan("level2-span"); if (level2Span) { level2SpanParent = level2Span.parentSpanContext; level2SpanCtx = level2Span.spanContext(); } withSpan(ai.core, level2Span!, function(this: ISpanScope) { const level2TraceCtx = this.host.getTraceCtx(false); // Create level3 span - should have level2 as parent const level3Span = ai.startSpan("level3-span"); if (level3Span) { level3SpanParent = level3Span.parentSpanContext; } // Verify level3 parent matches level2 trace context Assert.equal(level3SpanParent.spanId, level2TraceCtx.spanId, "Level3 span parent should match level2 trace context"); level3Span!.end(); }); // Verify level2 parent matches level1 trace context Assert.equal(level2SpanParent.spanId, level1TraceCtx.spanId, "Level2 span parent should match level1 trace context"); level2Span!.end(); }); // Assert Assert.ok(level2SpanParent, "Level2 span should have parent context"); Assert.ok(level2SpanCtx, "Level2 span context should exist"); Assert.ok(level3SpanParent, "Level3 span should have parent context"); // Verify the chain: root -> level1 -> level2 -> level3 Assert.equal(level2SpanParent.spanId, level1Span!.spanContext().spanId, "Level2 parent should be level1"); Assert.equal(level3SpanParent.spanId, level2SpanCtx.spanId, "Level3 parent should be level2"); level1Span!.end(); rootSpan!.end(); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/aiskuunittests.ts ================================================ import { AISKUSizeCheck } from "./AISKUSize.Tests"; import { ApplicationInsightsTests } from "./applicationinsights.e2e.tests"; import { ApplicationInsightsFetchTests } from "./applicationinsights.e2e.fetch.tests"; import { CdnPackagingChecks } from "./CdnPackaging.tests"; import { GlobalTestHooks } from "./GlobalTestHooks.Test"; import { SanitizerE2ETests } from "./sanitizer.e2e.tests"; import { ValidateE2ETests } from "./validate.e2e.tests"; import { SenderE2ETests } from "./sender.e2e.tests"; import { SnippetInitializationTests } from "./SnippetInitialization.Tests"; import { CdnThrottle} from "./CdnThrottle.tests"; import { ThrottleSentMessage } from "./ThrottleSentMessage.tests"; import { IAnalyticsConfigTests } from "./IAnalyticsConfig.Tests"; import { StartSpanTests } from "./StartSpan.Tests"; import { UseSpanTests } from "./UseSpan.Tests"; import { WithSpanTests } from "./WithSpan.Tests"; import { SpanContextPropagationTests } from "./SpanContextPropagation.Tests"; import { SpanLifeCycleTests } from "./SpanLifeCycle.Tests" import { TelemetryItemGenerationTests } from "./TelemetryItemGeneration.Tests"; import { SpanErrorHandlingTests } from "./SpanErrorHandling.Tests"; import { SpanUtilsTests } from "./SpanUtils.Tests"; import { SpanE2ETests } from "./SpanE2E.Tests"; import { NonRecordingSpanTests } from "./NonRecordingSpan.Tests"; import { SpanPluginIntegrationTests } from "./SpanPluginIntegration.Tests"; import { SpanHelperUtilsTests } from "./SpanHelperUtils.Tests"; import { TraceSuppressionTests } from "./TraceSuppression.Tests"; import { TraceProviderTests } from "./TraceProvider.Tests"; import { TraceContextTests } from "./TraceContext.Tests"; import { OTelInitTests } from "./OTelInit.Tests"; export function runTests() { new OTelInitTests().registerTests(); new TraceSuppressionTests().registerTests(); new SpanErrorHandlingTests().registerTests(); new SpanUtilsTests().registerTests(); new SpanE2ETests().registerTests(); new NonRecordingSpanTests().registerTests(); new SpanPluginIntegrationTests().registerTests(); new SpanHelperUtilsTests().registerTests(); new TraceProviderTests().registerTests(); new TraceContextTests().registerTests(); new GlobalTestHooks().registerTests(); new AISKUSizeCheck().registerTests(); new ApplicationInsightsTests().registerTests(); new ApplicationInsightsFetchTests().registerTests(); new CdnPackagingChecks().registerTests(); new SanitizerE2ETests().registerTests(); new ValidateE2ETests().registerTests(); new SenderE2ETests().registerTests(); new SnippetInitializationTests(false).registerTests(); new SnippetInitializationTests(true).registerTests(); new ThrottleSentMessage().registerTests(); new CdnThrottle().registerTests(); new IAnalyticsConfigTests().registerTests(); new StartSpanTests().registerTests(); new WithSpanTests().registerTests(); new UseSpanTests().registerTests(); new SpanContextPropagationTests().registerTests(); new SpanLifeCycleTests().registerTests(); new TelemetryItemGenerationTests().registerTests(); } ================================================ FILE: AISKU/Tests/Unit/src/applicationinsights.e2e.fetch.tests.ts ================================================ import { DistributedTracingModes, IConfig } from '@microsoft/applicationinsights-core-js'; import { ApplicationInsightsTests } from './applicationinsights.e2e.tests'; import { IConfiguration } from '@microsoft/applicationinsights-core-js'; const _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; const _connectionString = `InstrumentationKey=${_instrumentationKey}`; export class ApplicationInsightsFetchTests extends ApplicationInsightsTests { constructor() { super("ApplicationInsightsFetchTests-XHR Disabled"); } protected _getTestConfig(sessionPrefix: string) { let config: IConfiguration & IConfig = { connectionString: _connectionString, disableAjaxTracking: false, disableFetchTracking: false, disableXhr: true, // Disable XHR support enableRequestHeaderTracking: true, enableResponseHeaderTracking: true, maxBatchInterval: 500, disableExceptionTracking: false, namePrefix: sessionPrefix, enableCorsCorrelation: true, distributedTracingMode: DistributedTracingModes.AI_AND_W3C, samplingPercentage: 50, convertUndefined: "test-value", disablePageUnloadEvents: [ "beforeunload" ], extensionConfig: { ["AppInsightsCfgSyncPlugin"]: { cfgUrl: "" } } }; return config; } public testInitialize() { super.testInitialize(); // Use the fake server for fetch tests as multiple test runs are causing timeout issues // this.useFakeServer = true; // this.fakeServerAutoRespond = true; this.useFakeFetch = true; this.fakeFetchAutoRespond = true; } } ================================================ FILE: AISKU/Tests/Unit/src/applicationinsights.e2e.tests.ts ================================================ import { AITestClass, Assert, PollingAssert, EventValidator, TraceValidator, ExceptionValidator, MetricValidator, PageViewValidator, PageViewPerformanceValidator, RemoteDepdencyValidator } from '@microsoft/ai-test-framework'; import { SinonSpy } from 'sinon'; import { ApplicationInsights } from '../../../src/applicationinsights-web' import { Sender } from '@microsoft/applicationinsights-channel-js'; import { IDependencyTelemetry, ContextTagKeys, Exception, DistributedTracingModes, RequestHeaders, IAutoExceptionTelemetry, BreezeChannelIdentifier, IConfig, EventPersistence, EventDataType, PageViewDataType, TraceDataType, ExceptionDataType, MetricDataType, PageViewPerformanceDataType, RemoteDependencyDataType } from '@microsoft/applicationinsights-core-js'; import { ITelemetryItem, getGlobal, newId, dumpObj, BaseTelemetryPlugin, IProcessTelemetryContext, __getRegisteredEvents, arrForEach, IConfiguration, ActiveStatus, FeatureOptInMode } from "@microsoft/applicationinsights-core-js"; import { IPropTelemetryContext } from '@microsoft/applicationinsights-properties-js'; import { createAsyncResolvedPromise } from '@nevware21/ts-async'; import { CONFIG_ENDPOINT_URL } from '../../../src/InternalConstants'; import { OfflineChannel } from '@microsoft/applicationinsights-offlinechannel-js'; import { IStackFrame } from '@microsoft/applicationinsights-core-js'; import { utcNow } from '@nevware21/ts-utils'; function _checkExpectedFrame(expectedFrame: IStackFrame, actualFrame: IStackFrame, index: number) { Assert.equal(expectedFrame.assembly, actualFrame.assembly, index + ") Assembly is not as expected"); Assert.equal(expectedFrame.fileName, actualFrame.fileName, index + ") FileName is not as expected"); Assert.equal(expectedFrame.line, actualFrame.line, index + ") Line is not as expected"); Assert.equal(expectedFrame.method, actualFrame.method, index + ") Method is not as expected"); Assert.equal(expectedFrame.level, actualFrame.level, index + ") Level is not as expected"); } export class ApplicationInsightsTests extends AITestClass { private static readonly _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; private static readonly _connectionString = `InstrumentationKey=${ApplicationInsightsTests._instrumentationKey}`; private static readonly _expectedTrackMethods = [ "startTrackPage", "stopTrackPage", "trackException", "trackEvent", "trackMetric", "trackPageView", "trackTrace", "trackDependencyData", "setAuthenticatedUserContext", "clearAuthenticatedUserContext", "trackPageViewPerformance", "addTelemetryInitializer", "flush" ]; private _ai: ApplicationInsights; private _aiName: string = 'AppInsightsSDK'; private isFetchPolyfill: boolean = false; // Sinon private errorSpy: SinonSpy; private successSpy: SinonSpy; private loggingSpy: SinonSpy; private userSpy: SinonSpy; private _sessionPrefix: string = newId(); private trackSpy: SinonSpy; private envelopeConstructorSpy: SinonSpy; // Context private tagKeys = new ContextTagKeys(); private _config; private _appId: string; private _ctx: any; constructor(testName?: string) { super(testName || "ApplicationInsightsTests"); } protected _getTestConfig(sessionPrefix: string) { let config: IConfiguration | IConfig = { connectionString: ApplicationInsightsTests._connectionString, disableAjaxTracking: false, disableFetchTracking: false, enableRequestHeaderTracking: true, enableResponseHeaderTracking: true, maxBatchInterval: 2500, disableExceptionTracking: false, namePrefix: sessionPrefix, enableCorsCorrelation: true, distributedTracingMode: DistributedTracingModes.AI_AND_W3C, samplingPercentage: 50, convertUndefined: "test-value", disablePageUnloadEvents: ["beforeunload"], extensionConfig: { ["AppInsightsCfgSyncPlugin"]: { //cfgUrl: "" } } }; return config; } public testInitialize() { try { this.isFetchPolyfill = fetch["polyfill"]; this.useFakeServer = false; this._config = this._getTestConfig(this._sessionPrefix); this._ctx = {}; const init = new ApplicationInsights({ config: this._config }); init.loadAppInsights(); this._ai = init; this._ai.addTelemetryInitializer((item: ITelemetryItem) => { Assert.equal("4.0", item.ver, "Telemetry items inside telemetry initializers should be in CS4.0 format"); }); // Validate that the before unload event was not added let unloadPresent = false; let visibilityChangePresent = false; let beforeUnloadPresent = false; let theEvents = __getRegisteredEvents(window); arrForEach(theEvents, (theEvent) => { if (theEvent.name.startsWith("beforeunload")) { beforeUnloadPresent = true; } if (theEvent.name.startsWith("unload")) { unloadPresent = true; } if (theEvent.name.startsWith("visibilitychange")) { visibilityChangePresent = true; } }); Assert.ok(!beforeUnloadPresent, "The beforeunload event should not be present"); Assert.ok(unloadPresent, "The unload event should be present"); Assert.ok(visibilityChangePresent, "The visibilitychange event should be present"); // Setup Sinon stuff const sender: Sender = this._ai.getPlugin(BreezeChannelIdentifier).plugin; this.errorSpy = this.sandbox.spy(sender, '_onError'); this.successSpy = this.sandbox.spy(sender, '_onSuccess'); this.loggingSpy = this.sandbox.stub(this._ai['core'].logger, 'throwInternal'); this.trackSpy = this.sandbox.spy(this._ai.appInsights.core, 'track') this.sandbox.stub((sender as any)._sample, 'isSampledIn').returns(true); this.envelopeConstructorSpy = this.sandbox.spy(Sender, 'constructEnvelope'); console.log("* testInitialize()"); } catch (e) { console.error('Failed to initialize', e); } } public testFinishedCleanup(): void { if (this._ai && this._ai.unload) { // force unload this._ai.unload(false); } if (this._ai && this._ai["dependencies"]) { this._ai["dependencies"].teardown(); } console.log("* testCleanup(" + (AITestClass.currentTestInfo ? AITestClass.currentTestInfo.name : "") + ")"); } public registerTests() { this.addDynamicConfigTests(); this.addGenericE2ETests(); this.addAnalyticsApiTests(); this.addAsyncTests(); this.addDependencyPluginTests(); this.addPropertiesPluginTests(); this.addCDNOverrideTests(); this.addCdnMonitorTests(); } public addGenericE2ETests(): void { this.testCase({ name: 'E2E.GenericTests: ApplicationInsightsAnalytics is loaded correctly', test: () => { Assert.ok(this._ai, 'ApplicationInsights SDK exists'); // TODO: reenable this test when module is available from window w/o snippet // Assert.deepEqual(this._ai, window[this._aiName], `AI is available from window.${this._aiName}`); Assert.ok(this._ai.appInsights, 'App Analytics exists'); Assert.equal(true, this._ai.appInsights.isInitialized(), 'App Analytics is initialized'); Assert.ok(this._ai.appInsights.core, 'Core exists'); Assert.equal(true, this._ai.appInsights.core.isInitialized(), 'Core is initialized'); } }); this.testCase({ name: "Check plugin version string", test: () => { QUnit.assert.equal(0, this._ai.pluginVersionStringArr.length, "Checking the array length"); QUnit.assert.equal("", this._ai.pluginVersionString); // Add a versioned plugin let testPlugin1 = new TestPlugin(); this._ai.addPlugin(testPlugin1); QUnit.assert.equal(1, this._ai.pluginVersionStringArr.length, "Checking the array length"); QUnit.assert.equal("TestPlugin=0.99.1", this._ai.pluginVersionString); // Add a versioned plugin let testPlugin2 = new TestPlugin(); testPlugin2.identifier = "TestPlugin2"; testPlugin2.version = "1.2.3.4"; this._ai.addPlugin(testPlugin2); QUnit.assert.equal(2, this._ai.pluginVersionStringArr.length, "Checking the array length"); QUnit.assert.equal("TestPlugin=0.99.1;TestPlugin2=1.2.3.4", this._ai.pluginVersionString); // Add a versioned plugin this._ai.getPlugin("TestPlugin").remove(); QUnit.assert.equal(1, this._ai.pluginVersionStringArr.length, "Checking the array length"); QUnit.assert.equal("TestPlugin2=1.2.3.4", this._ai.pluginVersionString); } }); } public addDynamicConfigTests(): void { this.testCase({ name: 'DynamicConfigTests: ApplicationInsights dynamic config works correctly', useFakeTimers: true, test: () => { let config = this._ai.config; let expectedIkey = ApplicationInsightsTests._instrumentationKey; let expectedConnectionString = ApplicationInsightsTests._connectionString; let expectedEndpointUrl = "https://dc.services.visualstudio.com/v2/track"; let expectedLoggingLevel = 10000; Assert.ok(config, "ApplicationInsights config exists"); Assert.equal(expectedConnectionString, config.connectionString, "connection string is set"); Assert.equal(expectedIkey, config.instrumentationKey, "ikey is set"); Assert.equal(expectedLoggingLevel, config.diagnosticLogInterval, "diagnosticLogInterval is set to 1000 by default"); Assert.equal(expectedEndpointUrl, config.endpointUrl, "endpoint url is set from connection string"); Assert.equal(false, config.disableAjaxTracking, "disableAjaxTracking is set to false"); let onChangeCalled = 0; let handler = this._ai.onCfgChange((details) => { onChangeCalled++; Assert.equal(expectedIkey, details.cfg.instrumentationKey, "Expect the iKey to be set"); Assert.equal(expectedEndpointUrl, details.cfg.endpointUrl, "Expect the endpoint to be set"); Assert.equal(expectedLoggingLevel, details.cfg.diagnosticLogInterval, "Expect the diagnosticLogInterval to be set"); }); Assert.equal(1, onChangeCalled, "OnCfgChange was not called"); expectedIkey = "newIKey"; config.instrumentationKey = expectedIkey; Assert.equal(1, onChangeCalled, "Expected the onChanged was called"); this.clock.tick(1); Assert.equal(2, onChangeCalled, "Expected the onChanged was called again"); expectedLoggingLevel = 2000; config.diagnosticLogInterval = expectedLoggingLevel; Assert.equal(2, onChangeCalled, "Expected the onChanged was called"); this.clock.tick(1); Assert.equal(3, onChangeCalled, "Expected the onChanged was called again"); expectedConnectionString = "InstrumentationKey=testKey"; expectedIkey = "testKey"; config.connectionString = expectedConnectionString; Assert.equal(3, onChangeCalled, "Expected the onChanged was called"); this.clock.tick(1); Assert.equal(4, onChangeCalled, "Expected the onChanged was called again"); // Remove the handler handler.rm(); } }); this.testCaseAsync({ name: "Init: init with cs promise, when it is resolved and then change with cs string", stepDelay: 100, useFakeTimers: true, steps: [() => { // unload previous one first let oriInst = this._ai; if (oriInst && oriInst.unload) { // force unload oriInst.unload(false); } if (oriInst && oriInst["dependencies"]) { oriInst["dependencies"].teardown(); } this._config = this._getTestConfig(this._sessionPrefix); let csPromise = createAsyncResolvedPromise("InstrumentationKey=testIkey;ingestionendpoint=testUrl"); this._config.connectionString = csPromise; this._config.initTimeOut = 80000; this._ctx.csPromise = csPromise; let init = new ApplicationInsights({ config: this._config }); init.loadAppInsights(); this._ai = init; let config = this._ai.config; let core = this._ai.core; let status = core.activeStatus && core.activeStatus(); Assert.equal(status, ActiveStatus.PENDING, "status should be set to pending"); }].concat(PollingAssert.createPollingAssert(() => { let core = this._ai.core let activeStatus = core.activeStatus && core.activeStatus(); let csPromise = this._ctx.csPromise; let config = this._ai.config; if (csPromise.state === "resolved" && activeStatus === ActiveStatus.ACTIVE) { Assert.equal("testIkey", core.config.instrumentationKey, "ikey should be set"); Assert.equal("testUrl/v2/track", core.config.endpointUrl, "endpoint shoule be set"); config.connectionString = "InstrumentationKey=testIkey1;ingestionendpoint=testUrl1"; this.clock.tick(1); let status = core.activeStatus && core.activeStatus(); // promise is not resolved, no new changes applied Assert.equal(status, ActiveStatus.ACTIVE, "status should be set to active test1"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60) as any).concat(PollingAssert.createPollingAssert(() => { let core = this._ai.core let activeStatus = core.activeStatus && core.activeStatus(); if (activeStatus === ActiveStatus.ACTIVE) { Assert.equal("testIkey1", core.config.instrumentationKey, "ikey should be set test1"); Assert.equal("testUrl1/v2/track", core.config.endpointUrl, "endpoint shoule be set test1"); return true; } return false; }, "Wait for new string response" + new Date().toISOString(), 60) as any) }); this.testCaseAsync({ name: "Init: init with cs promise and change with cs string at the same time", stepDelay: 100, useFakeTimers: true, steps: [() => { // unload previous one first let oriInst = this._ai; if (oriInst && oriInst.unload) { // force unload oriInst.unload(false); } if (oriInst && oriInst["dependencies"]) { oriInst["dependencies"].teardown(); } this._config = this._getTestConfig(this._sessionPrefix); let csPromise = createAsyncResolvedPromise("InstrumentationKey=testIkey;ingestionendpoint=testUrl"); this._config.connectionString = csPromise; this._config.initTimeOut = 80000; this._ctx.csPromise = csPromise; let init = new ApplicationInsights({ config: this._config }); init.loadAppInsights(); this._ai = init; let config = this._ai.config; let core = this._ai.core; let status = core.activeStatus && core.activeStatus(); Assert.equal(status, ActiveStatus.PENDING, "status should be set to pending"); config.connectionString = "InstrumentationKey=testIkey1;ingestionendpoint=testUrl1"; this.clock.tick(1); status = core.activeStatus && core.activeStatus(); Assert.equal(status, ActiveStatus.ACTIVE, "active status should be set to active in next executing cycle"); // Assert.equal(status, ActiveStatus.PENDING, "status should be set to pending test1"); }].concat(PollingAssert.createPollingAssert(() => { let core = this._ai.core let activeStatus = core.activeStatus && core.activeStatus(); if (activeStatus === ActiveStatus.ACTIVE) { Assert.equal("testIkey", core.config.instrumentationKey, "ikey should be set"); Assert.equal("testUrl/v2/track", core.config.endpointUrl, "endpoint shoule be set"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60) as any) }); this.testCaseAsync({ name: "Init: init with cs promise and offline channel", stepDelay: 100, useFakeTimers: true, steps: [() => { // unload previous one first let oriInst = this._ai; if (oriInst && oriInst.unload) { // force unload oriInst.unload(false); } if (oriInst && oriInst["dependencies"]) { oriInst["dependencies"].teardown(); } this._config = this._getTestConfig(this._sessionPrefix); let csPromise = createAsyncResolvedPromise("InstrumentationKey=testIkey;ingestionendpoint=testUrl"); this._config.connectionString = csPromise; let offlineChannel = new OfflineChannel(); this._config.channels = [[offlineChannel]]; this._config.initTimeOut = 80000; let init = new ApplicationInsights({ config: this._config }); init.loadAppInsights(); this._ai = init; let config = this._ai.config; let core = this._ai.core; let status = core.activeStatus && core.activeStatus(); Assert.equal(status, ActiveStatus.PENDING, "status should be set to pending"); config.connectionString = "InstrumentationKey=testIkey1;ingestionendpoint=testUrl1" this.clock.tick(1); status = core.activeStatus && core.activeStatus(); Assert.equal(status, ActiveStatus.ACTIVE, "active status should be set to active in next executing cycle"); // Assert.equal(status, ActiveStatus.PENDING, "status should be set to pending test1"); }].concat(PollingAssert.createPollingAssert(() => { let core = this._ai.core let activeStatus = core.activeStatus && core.activeStatus(); if (activeStatus === ActiveStatus.ACTIVE) { Assert.equal("testIkey", core.config.instrumentationKey, "ikey should be set"); Assert.equal("testUrl/v2/track", core.config.endpointUrl, "endpoint shoule be set"); let sendChannel = this._ai.getPlugin(BreezeChannelIdentifier); let offlineChannelPlugin = this._ai.getPlugin("OfflineChannel").plugin; Assert.equal(sendChannel.plugin.isInitialized(), true, "sender is initialized"); Assert.equal(offlineChannelPlugin.isInitialized(), true, "offline channel is initialized"); let urlConfig = offlineChannelPlugin["_getDbgPlgTargets"]()[0]; Assert.ok(urlConfig, "offline url config is initialized"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60) as any) }); this.testCaseAsync({ name: "Init: init with cs string, change with cs promise", stepDelay: 100, useFakeTimers: true, steps: [() => { let config = this._ai.config; let expectedIkey = ApplicationInsightsTests._instrumentationKey; let expectedConnectionString = ApplicationInsightsTests._connectionString; let expectedEndpointUrl = "https://dc.services.visualstudio.com/v2/track"; Assert.ok(config, "ApplicationInsights config exists"); Assert.equal(expectedConnectionString, config.connectionString, "connection string is set"); Assert.equal(expectedIkey, config.instrumentationKey, "ikey is set"); Assert.equal(expectedEndpointUrl, config.endpointUrl, "endpoint url is set from connection string"); let core = this._ai.core; let status = core.activeStatus && core.activeStatus(); Assert.equal(status, ActiveStatus.ACTIVE, "status should be set to active"); let csPromise = createAsyncResolvedPromise("InstrumentationKey=testIkey;ingestionendpoint=testUrl"); config.connectionString = csPromise; config.initTimeOut = 80000; this.clock.tick(1); status = core.activeStatus && core.activeStatus(); Assert.equal(status, ActiveStatus.ACTIVE, "active status should be set to active in next executing cycle"); //Assert.equal(status, ActiveStatus.PENDING, "status should be set to pending"); }].concat(PollingAssert.createPollingAssert(() => { let core = this._ai.core let activeStatus = core.activeStatus && core.activeStatus(); if (activeStatus === ActiveStatus.ACTIVE) { Assert.equal("testIkey", core.config.instrumentationKey, "ikey should be set"); Assert.equal("testUrl/v2/track", core.config.endpointUrl, "endpoint shoule be set"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60) as any) }); this.testCaseAsync({ name: "Init: init with cs null, ikey promise, endpoint promise", stepDelay: 100, useFakeTimers: true, steps: [() => { // unload previous one first let oriInst = this._ai; if (oriInst && oriInst.unload) { // force unload oriInst.unload(false); } if (oriInst && oriInst["dependencies"]) { oriInst["dependencies"].teardown(); } this._config = this._getTestConfig(this._sessionPrefix); let ikeyPromise = createAsyncResolvedPromise("testIkey"); let endpointPromise = createAsyncResolvedPromise("testUrl"); //let csPromise = createAsyncResolvedPromise("InstrumentationKey=testIkey;ingestionendpoint=testUrl"); //this._config.connectionString = csPromise; this._config.connectionString = null; this._config.instrumentationKey = ikeyPromise; this._config.endpointUrl = endpointPromise; this._config.initTimeOut = 80000; let init = new ApplicationInsights({ config: this._config }); init.loadAppInsights(); this._ai = init; let config = this._ai.config; let core = this._ai.core; let status = core.activeStatus && core.activeStatus(); Assert.equal(status, ActiveStatus.PENDING, "status should be set to pending"); Assert.equal(config.connectionString, null, "connection string shoule be null"); }].concat(PollingAssert.createPollingAssert(() => { let core = this._ai.core let activeStatus = core.activeStatus && core.activeStatus(); if (activeStatus === ActiveStatus.ACTIVE) { Assert.equal("testIkey", core.config.instrumentationKey, "ikey should be set"); Assert.equal("testUrl", core.config.endpointUrl, "endpoint shoule be set"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60) as any) }); this.testCase({ name: "CfgSync DynamicConfigTests: Prod CDN is Fetched and feature is turned on/off as expected", useFakeTimers: true, test: () => { let fetchcalled = 0; let overrideFetchFn = (url: string, oncomplete: any, isAutoSync?: boolean) => { fetchcalled++; Assert.equal(url, CONFIG_ENDPOINT_URL, "fetch should be called with prod cdn"); }; let config = { instrumentationKey: "testIKey", extensionConfig: { ["AppInsightsCfgSyncPlugin"]: { overrideFetchFn: overrideFetchFn } } } as IConfiguration & IConfig; let ai = new ApplicationInsights({ config: config }); ai.loadAppInsights(); ai.config.extensionConfig = ai.config.extensionConfig || {}; let extConfig = ai.config.extensionConfig["AppInsightsCfgSyncPlugin"]; Assert.equal(extConfig.cfgUrl, CONFIG_ENDPOINT_URL, "default cdn endpoint should be set"); Assert.equal(extConfig.syncMode, 2, "default mode should be set to receive"); let featureOptIn = config.featureOptIn || {}; Assert.equal(featureOptIn["iKeyUsage"].mode, FeatureOptInMode.enable, "ikey message should be turned on"); Assert.equal(fetchcalled, 1, "fetch should be called once"); config.extensionConfig = config.extensionConfig || {}; let expectedTimeout = 2000000000; config.extensionConfig["AppInsightsCfgSyncPlugin"].scheduleFetchTimeout = expectedTimeout; this.clock.tick(1); extConfig = ai.config.extensionConfig["AppInsightsCfgSyncPlugin"]; Assert.equal(extConfig.scheduleFetchTimeout, expectedTimeout, "timeout should be changes dynamically"); ai.unload(false); if (ai && ai["dependencies"]) { ai["dependencies"].teardown(); } } }); this.testCase({ name: "Init Promise: Offline Support can be added and initialized with endpoint url", useFakeTimers: true, test: () => { this.clock.tick(1); // if fake timer is turned on, session data will return 0 and will throw sesson not renew error let offlineChannel = new OfflineChannel(); let config = { instrumentationKey: "testIKey", endpointUrl: "testUrl", extensionConfig: { ["AppInsightsCfgSyncPlugin"]: { cfgUrl: "" } }, extensions: [offlineChannel] } as IConfiguration & IConfig; let ai = new ApplicationInsights({ config: config }); ai.loadAppInsights(); this.clock.tick(1); let sendChannel = ai.getPlugin(BreezeChannelIdentifier); let offlineChannelPlugin = ai.getPlugin("OfflineChannel").plugin; Assert.equal(sendChannel.plugin.isInitialized(), true, "sender is initialized"); Assert.equal(offlineChannelPlugin.isInitialized(), true, "offline channel is initialized"); let urlConfig = offlineChannelPlugin["_getDbgPlgTargets"]()[0]; Assert.ok(urlConfig, "offline url config is initialized"); ai.unload(false); if (ai && ai["dependencies"]) { ai["dependencies"].teardown(); } //offlineChannel.teardown(); } }); this.testCase({ name: "Init Promise: Offline Support can be added and initialized with channels", useFakeTimers: true, test: () => { this.clock.tick(1); let offlineChannel = new OfflineChannel(); let config = { instrumentationKey: "testIKey", endpointUrl: "testUrl", extensionConfig: { ["AppInsightsCfgSyncPlugin"]: { cfgUrl: "" } }, channels: [[offlineChannel]] } as IConfiguration & IConfig; let ai = new ApplicationInsights({ config: config }); ai.loadAppInsights(); this.clock.tick(1); let sendChannel = ai.getPlugin(BreezeChannelIdentifier); let offlineChannelPlugin = ai.getPlugin("OfflineChannel").plugin; Assert.equal(sendChannel.plugin.isInitialized(), true, "sender is initialized"); Assert.equal(offlineChannelPlugin.isInitialized(), true, "offline channel is initialized"); let urlConfig = offlineChannelPlugin["_getDbgPlgTargets"]()[0]; Assert.ok(urlConfig, "offline url config is initialized"); ai.unload(false); if (ai && ai["dependencies"]) { ai["dependencies"].teardown(); } } }); this.testCase({ name: "CfgSync DynamicConfigTests: Offline Support can be added and initialized without endpoint url", useFakeTimers: true, test: () => { this.clock.tick(1); let offlineChannel = new OfflineChannel(); let config = { connectionString: "InstrumentationKey=testIKey", extensionConfig: { ["AppInsightsCfgSyncPlugin"]: { cfgUrl: "" } }, channels: [[offlineChannel]] } as IConfiguration & IConfig; let ai = new ApplicationInsights({ config: config }); ai.loadAppInsights(); this.clock.tick(1); let sendChannel = ai.getPlugin(BreezeChannelIdentifier); let offlineChannelPlugin = ai.getPlugin("OfflineChannel").plugin; Assert.equal(sendChannel.plugin.isInitialized(), true, "sender is initialized"); Assert.equal(offlineChannelPlugin.isInitialized(), true, "offline channel is initialized"); let urlConfig = offlineChannelPlugin["_getDbgPlgTargets"]()[0]; this.clock.tick(1); Assert.ok(urlConfig, "offline url config is initialized"); ai.unload(false); if (ai && ai["dependencies"]) { ai["dependencies"].teardown(); } } }); } public addCDNOverrideTests(): void { this.testCase({ name: 'CDNOverrideTests: customer could overwrite the url endpoint', useFakeTimers: true, test: () => { let ingestionendpoint = "https://dc.services.visualstudio.com"; this._ai.config.connectionString = "InstrumentationKey=xxx;IngestionEndpoint=" + ingestionendpoint + ";LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/" this.clock.tick(100); Assert.deepEqual(this._ai.config.endpointUrl, ingestionendpoint + "/v2/track", "endpoint url is set from connection string"); this._ai.config.userOverrideEndpointUrl = "https://custom.endpoint"; this.clock.tick(100); Assert.deepEqual(this._ai.config.endpointUrl, this._ai.config.userOverrideEndpointUrl, "endpoint url is override by userOverrideEndpointUrl"); } }); } public addAnalyticsApiTests(): void { this.testCase({ name: 'E2E.AnalyticsApiTests: Public Members exist', test: () => { ApplicationInsightsTests._expectedTrackMethods.forEach(method => { Assert.ok(this._ai[method], `${method} exists`); Assert.equal('function', typeof this._ai[method], `${method} is a function`); }); } }); } public addCdnMonitorTests(): void { this.testCaseAsync({ name: "E2E.GenericTests: Fetch Current CDN V3", stepDelay: 1, useFakeServer: false, useFakeFetch: false, fakeFetchAutoRespond: false, steps: [() => { // Use beta endpoint to pre-test any changes before public V3 cdn let random = utcNow(); // Under Cors Mode, Options request will be auto-triggered try { fetch(`https://js.monitor.azure.com/beta/ai.3.gbl.min.js?${random}`, { method: "GET" }).then((res) => { this._ctx.res = res; res.text().then((val) => { this._ctx.val = val; }); }); } catch (e) { Assert.ok(false, "Fetch Error: " + e); } }].concat(PollingAssert.createPollingAssert(() => { if (this._ctx && this._ctx.res && this._ctx.val) { let res = this._ctx.res; let status = res.status; if (status === 200) { // for Response headers: // content-type: text/javascript; charset=utf-8 // x-ms-meta-aijssdksrc: should present // x-ms-meta-aijssdkver should present let headers = res.headers; let headerCnt = 0; headers.forEach((val, key) => { if (key === "content-type") { Assert.deepEqual(val, "text/javascript; charset=utf-8", "should have correct content-type response header"); headerCnt++; } if (key === "x-ms-meta-aijssdksrc") { Assert.ok(val, "should have sdk src response header"); headerCnt++; } if (key === "x-ms-meta-aijssdkver") { Assert.ok(val, "should have version number for response header"); headerCnt++; } }); Assert.equal(headerCnt, 3, "all expected headers should be present"); return true; } return false; } return false; }, "Wait for response" + new Date().toISOString(), 60) as any) }); this.testCaseAsync({ name: "E2E.GenericTests: Fetch Current CDN V2", stepDelay: 1, useFakeServer: false, useFakeFetch: false, fakeFetchAutoRespond: false, steps: [() => { // Use public endpoint for V2 let random = utcNow(); // Under Cors Mode, Options request will be triggered fetch(`https://js.monitor.azure.com/scripts/b/ai.2.gbl.min.js?${random}`, { method: "GET" }).then((res) => { this._ctx.res = res; res.text().then((val) => { this._ctx.val = val; }); }); }].concat(PollingAssert.createPollingAssert(() => { if (this._ctx && this._ctx.res && this._ctx.val) { let res = this._ctx.res; let status = res.status; if (status === 200) { // for Response headers: // content-type: text/javascript; charset=utf-8 // x-ms-meta-aijssdksrc: should present // x-ms-meta-aijssdkver should present let headers = res.headers; let headerCnt = 0; headers.forEach((val, key) => { if (key === "content-type") { Assert.deepEqual(val, "text/javascript; charset=utf-8", "should have correct content-type response header"); headerCnt++; } if (key === "x-ms-meta-aijssdksrc") { Assert.ok(val, "should have sdk src response header"); headerCnt++; } if (key === "x-ms-meta-aijssdkver") { Assert.ok(val, "should have version number for response header"); headerCnt++; } }); Assert.equal(headerCnt, 3, "all expected headers should be present"); return true; } return false; } return false; }, "Wait for response" + new Date().toISOString(), 60) as any) }); this.testCase({ name: "E2E.GenericTests: Fetch Static Web js0 - CDN V3", useFakeServer: false, useFakeFetch: false, fakeFetchAutoRespond: false, test: async () => { // Use beta endpoint to pre-test any changes before public V3 cdn let random = utcNow(); // Under Cors Mode, Options request will be auto-triggered try { let res = await fetch(`https://js0.tst.applicationinsights.io/scripts/b/ai.3.gbl.min.js?${random}`, { method: "GET" }); if (res.ok) { let val = await res.text(); Assert.ok(val, "Response text should be returned"); } else { Assert.fail("Fetch failed with status: " + dumpObj(res)); } } catch (e) { Assert.fail("Fetch Error: " + dumpObj(e)); } } }); this.testCase({ name: "E2E.GenericTests: Fetch Static Web js1 - CDN V3", useFakeServer: false, useFakeFetch: false, fakeFetchAutoRespond: false, test: async () => { // Use beta endpoint to pre-test any changes before public V3 cdn let random = utcNow(); // Under Cors Mode, Options request will be auto-triggered try { let res = await fetch(`https://js1.tst.applicationinsights.io/scripts/b/ai.3.gbl.min.js?${random}`, { method: "GET" }); if (res.ok) { let val = await res.text(); Assert.ok(val, "Response text should be returned"); } else { Assert.fail("Fetch failed with status: " + dumpObj(res)); } } catch (e) { this._ctx.err = e; Assert.fail("Fetch Error: " + dumpObj(e)); } } }); this.testCase({ name: "E2E.GenericTests: Fetch Static Web js2 - CDN V3", useFakeServer: false, useFakeFetch: false, fakeFetchAutoRespond: false, test: async () => { // Use beta endpoint to pre-test any changes before public V3 cdn let random = utcNow(); // Under Cors Mode, Options request will be auto-triggered try { let res = await fetch(`https://js2.tst.applicationinsights.io/scripts/b/ai.3.gbl.min.js?${random}`, { method: "GET" }); if (res.ok) { let val = await res.text(); Assert.ok(val, "Response text should be returned"); } else { Assert.fail("Fetch failed with status: " + dumpObj(res)); } } catch (e) { Assert.fail("Fetch Error: " + dumpObj(e)); } } }); } public addAsyncTests(): void { this.testCaseAsync({ name: "E2E.GenericTests: Send events with offline support", stepDelay: 1, steps: [() => { let offlineChannel = new OfflineChannel(); this._ai.addPlugin(offlineChannel); this._ctx.offlineChannel = offlineChannel; }].concat(PollingAssert.createPollingAssert(() => { let offlineChannel = this._ctx.offlineChannel; if (offlineChannel && offlineChannel.isInitialized()) { let urlConfig = offlineChannel["_getDbgPlgTargets"]()[0]; Assert.ok(urlConfig, "offline url config is initialized"); let offlineListener = offlineChannel.getOfflineListener() as any; Assert.ok(offlineListener, "offlineListener should be initialized"); // online offlineListener.setOnlineState(1); let inMemoTimer = offlineChannel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer, "offline in memo timer should be null"); this._ai.trackEvent({ name: "online event", properties: { "prop1": "value1" }, measurements: { "measurement1": 200 } }); // set to offline status right way offlineListener.setOnlineState(2); this._ai.trackEvent({ name: "offline event", properties: { "prop2": "value2" }, measurements: { "measurement2": 200 } }); inMemoTimer = offlineChannel["_getDbgPlgTargets"]()[3]; Assert.ok(inMemoTimer, "in memo timer should not be null"); let inMemoBatch = offlineChannel["_getDbgPlgTargets"]()[1][EventPersistence.Normal]; Assert.equal(inMemoBatch && inMemoBatch.count(), 1, "should have one event"); return true } return false }, "Wait for init" + new Date().toISOString(), 60) as any).concat(this.asserts(1)).concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(payload && payload.iKey); Assert.equal(ApplicationInsightsTests._instrumentationKey, payload.iKey, "payload ikey is not set correctly"); Assert.ok(data && data.baseData && data.baseData.properties["prop1"]); Assert.ok(data && data.baseData && data.baseData.measurements["measurement1"]); } }) }); this.testCaseAsync({ name: 'E2E.GenericTests: trackEvent sends to backend', stepDelay: 1, steps: [() => { this._ai.trackEvent({ name: 'event', properties: { "prop1": "value1" }, measurements: { "measurement1": 200 } }); }].concat(this.asserts(1)).concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(payload && payload.iKey); Assert.equal(ApplicationInsightsTests._instrumentationKey, payload.iKey, "payload ikey is not set correctly"); Assert.ok(data && data.baseData && data.baseData.properties["prop1"]); Assert.ok(data && data.baseData && data.baseData.measurements["measurement1"]); } }) }); this.testCaseAsync({ name: 'E2E.GenericTests: trackTrace sends to backend', stepDelay: 1, steps: [() => { this._ai.trackTrace({ message: 'trace', properties: { "foo": "bar", "prop2": "value2" } }); }].concat(this.asserts(1)).concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data && data.baseData && data.baseData.properties["foo"] && data.baseData.properties["prop2"]); Assert.equal("bar", data.baseData.properties["foo"]); Assert.equal("value2", data.baseData.properties["prop2"]); }) }); this.testCaseAsync({ name: 'E2E.GenericTests: legacy trackException sends to backend', stepDelay: 1, steps: [() => { let exception: Error = null; try { window['a']['b'](); Assert.ok(false, 'trackException test not run'); } catch (e) { exception = e; this._ai.trackException({ error: exception } as any); } Assert.ok(exception); }].concat(this.asserts(1)) }); this.testCaseAsync({ name: 'E2E.GenericTests: trackException with auto telemetry sends to backend', stepDelay: 1, steps: [() => { let exception: Error = null; try { window['a']['b'](); Assert.ok(false, 'trackException test not run'); } catch (e) { // Simulating window.onerror option let autoTelemetry = { message: e.message, url: "https://dummy.auto.example.com", lineNumber: 42, columnNumber: 53, error: e, evt: null } as IAutoExceptionTelemetry; exception = e; this._ai.trackException({ exception: autoTelemetry }); } Assert.ok(exception); }].concat(this.asserts(1)) }); this.testCaseAsync({ name: 'E2E.GenericTests: trackException with auto telemetry sends to backend with custom properties', stepDelay: 1, steps: [() => { let exception: Error = null; try { window['a']['b'](); Assert.ok(false, 'trackException test not run'); } catch (e) { // Simulating window.onerror option let autoTelemetry = { message: e.message, url: "https://dummy.auto.example.com", lineNumber: 42, columnNumber: 53, error: e, evt: null } as IAutoExceptionTelemetry; exception = e; this._ai.trackException({ exception: autoTelemetry }, { custom: "custom value" }); } Assert.ok(exception); }].concat(this.asserts(1)) }); this.testCaseAsync({ name: 'E2E.GenericTests: trackException with message only sends to backend', stepDelay: 1, steps: [() => { let exception: Error = null; try { window['a']['b'](); Assert.ok(false, 'trackException test not run'); } catch (e) { // Simulating window.onerror option let autoTelemetry = { message: e.toString(), url: "https://dummy.message.example.com", lineNumber: 42, columnNumber: 53, error: e.toString(), evt: null } as IAutoExceptionTelemetry; exception = e; this._ai.trackException({ exception: autoTelemetry }); } Assert.ok(exception); }].concat(this.asserts(1)) }); this.testCaseAsync({ name: 'E2E.GenericTests: trackException with message holding error sends to backend', stepDelay: 1, steps: [() => { let exception: Error = null; try { window['a']['b'](); Assert.ok(false, 'trackException test not run'); } catch (e) { // Simulating window.onerror option let autoTelemetry = { message: e, url: "https://dummy.error.example.com", lineNumber: 42, columnNumber: 53, error: undefined, evt: null } as IAutoExceptionTelemetry; try { exception = e; this._ai.trackException({ exception: autoTelemetry }); } catch (e) { console.log(e); console.log(e.stack); Assert.ok(false, e.stack); } } Assert.ok(exception); }].concat(this.asserts(1)) }); this.testCaseAsync({ name: 'E2E.GenericTests: trackException with message holding error sends to backend with custom properties', stepDelay: 1, steps: [() => { let exception: Error = null; try { window['a']['b'](); Assert.ok(false, 'trackException test not run'); } catch (e) { // Simulating window.onerror option let autoTelemetry = { message: e, url: "https://dummy.error.example.com", lineNumber: 42, columnNumber: 53, error: undefined, evt: null } as IAutoExceptionTelemetry; try { exception = e; this._ai.trackException({ exception: autoTelemetry }, { custom: "custom value" }); } catch (e) { console.log(e); console.log(e.stack); Assert.ok(false, e.stack); } } Assert.ok(exception); }].concat(this.asserts(1)) }); this.testCaseAsync({ name: 'E2E.GenericTests: trackException with no Error sends to backend', stepDelay: 1, steps: [() => { let autoTelemetry = { message: "Test Message", url: "https://dummy.no.error.example.com", lineNumber: 42, columnNumber: 53, error: this, evt: null } as IAutoExceptionTelemetry; this._ai.trackException({ exception: autoTelemetry }); Assert.ok(autoTelemetry); }].concat(this.asserts(1)) }); this.testCaseAsync({ name: 'E2E.GenericTests: trackException with CustomError sends to backend', stepDelay: 1, steps: [() => { this._ai.trackException({ id: "testID", exception: new CustomTestError("Test Custom Error!") }); }].concat(this.asserts(1)).concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data, "Has Data"); if (data) { Assert.ok(data.baseData, "Has BaseData"); let baseData = data.baseData; if (baseData) { const ex = baseData.exceptions[0]; Assert.ok(ex.message.indexOf("Test Custom Error!") !== -1, "Make sure the error message is present [" + ex.message + "]"); Assert.ok(ex.message.indexOf("CustomTestError") !== -1, "Make sure the error type is present [" + ex.message + "]"); Assert.equal("CustomTestError", ex.typeName, "Got the correct typename"); Assert.ok(ex.stack.length > 0, "Has stack"); Assert.ok(ex.parsedStack, "Stack was parsed"); Assert.ok(ex.hasFullStack, "Stack has been decoded"); Assert.equal(baseData.properties.id, "testID", "Make sure the error message id is present [" + baseData.properties + "]"); } } } }) }); this.testCaseAsync({ name: 'E2E.GenericTests: trackException will keep id from the original exception', stepDelay: 1, steps: [() => { this._ai.trackException({ id: "testId", error: new Error("test local exception"), severityLevel: 3 }); }].concat(this.asserts(1)).concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data, "Has Data"); if (data) { Assert.ok(data.baseData, "Has BaseData"); let baseData = data.baseData; if (baseData) { const ex = baseData.exceptions[0]; console.log(JSON.stringify(baseData.properties)); Assert.equal(baseData.properties.id, "testId", "Make sure the error message id is present [" + ex.properties + "]"); } } } }) }); this.testCaseAsync({ name: 'E2E.GenericTests: trackException with CustomError sends to backend with custom properties', stepDelay: 1, steps: [() => { this._ai.trackException({ exception: new CustomTestError("Test Custom Error!") }, { custom: "custom value" }); }].concat(this.asserts(1)).concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data, "Has Data"); if (data) { Assert.ok(data.baseData, "Has BaseData"); let baseData = data.baseData; if (baseData) { const ex = baseData.exceptions[0]; Assert.ok(ex.message.indexOf("Test Custom Error!") !== -1, "Make sure the error message is present [" + ex.message + "]"); Assert.ok(ex.message.indexOf("CustomTestError") !== -1, "Make sure the error type is present [" + ex.message + "]"); Assert.equal("CustomTestError", ex.typeName, "Got the correct typename"); Assert.ok(ex.stack.length > 0, "Has stack"); Assert.ok(ex.parsedStack, "Stack was parsed"); Assert.ok(ex.hasFullStack, "Stack has been decoded"); Assert.ok(baseData.properties, "Has BaseData properties"); Assert.equal(baseData.properties.custom, "custom value"); } } } }) }); this.testCaseAsync({ name: "E2E.GenericTests: trackException with multiple stack frame formats", stepDelay: 1, steps: [() => { let errObj = { name: "E2E.GenericTests", reason: { message: "Test_Error_Throwing_Inside_UseCallback", stack: "Error: Test_Error_Throwing_Inside_UseCallback\n" + "at http://localhost:3000/static/js/main.206f4846.js:2:296748\n" + // Anonymous function with no function name attribution (firefox/ios) "at Object.Re (http://localhost:3000/static/js/main.206f4846.js:2:16814)\n" + // With class.function attribution "at je (http://localhost:3000/static/js/main.206f4846.js:2:16968)\n" + // With function name attribution "at Object. (http://localhost:3000/static/js/main.206f4846.js:2:42819)\n" + // With Object. attribution "at Object. (../localfile.js:2:1234)\n" + // With Object. attribution and local file "at (anonymous) @ VM60:1\n" + // With (anonymous) attribution "at [native code]\n" + // With [native code] attribution "at (at eval at (http://localhost:3000/static/js/main.206f4846.js:2:296748), :1:1)\n" + // With eval attribution "at Object.eval (http://localhost:3000/static/js/main.206f4846.js:2:296748)\n" + // With eval attribution "at eval (http://localhost:3000/static/js/main.206f4846.js:2:296748)\n" + // With eval attribution "at eval (webpack-internal:///./src/App.tsx:1:1)\n" + // With eval attribution "at [arguments not available])@file://localhost/stacktrace.js:21\n" + // With arguments not available attribution "at file://C:/Temp/stacktrace.js:27:1\n" + // With file://localhost attribution " Line 21 of linked script file://localhost/C:/Temp/stacktrace.js\n" + // With Line 21 of linked script attribution " Line 11 of inline#1 script in http://localhost:3000/static/js/main.206f4846.js:2:296748\n" + // With Line 11 of inline#1 script attribution " Line 68 of inline#2 script in file://localhost/teststack.html\n" + // With Line 68 of inline#2 script attribution "at Function.Module._load (module.js:407:3)\n" + " at Function.Module.runMain (module.js:575:10)\n" + " at startup (node.js:159:18)\n" + "at Global code (http://example.com/stacktrace.js:11:1)\n" + "at Object.Module._extensions..js (module.js:550:10)\n" + " at c@http://example.com/stacktrace.js:9:3\n" + " at b@http://example.com/stacktrace.js:6:3\n" + " at a@http://example.com/stacktrace.js:3:3\n" + "http://localhost:3000/static/js/main.206f4846.js:2:296748\n" + // Anonymous function with no function name attribution (firefox/ios) " c@http://example.com/stacktrace.js:9:3\n" + " b@http://example.com/stacktrace.js:6:3\n" + " a@http://example.com/stacktrace.js:3:3\n" + " at Object.testMethod (http://localhost:9001/shared/AppInsightsCommon/node_modules/@microsoft/ai-test-framework/dist/es5/ai-test-framework.js:53058:48)" } }; let exception = Exception.CreateAutoException("Test_Error_Throwing_Inside_UseCallback", "url", 9, 0, errObj ); this._ai.trackException({ exception: exception }, { custom: "custom value" }); }].concat(this.asserts(1)).concat(() => { const expectedParsedStack: IStackFrame[] = [ { level: 0, method: "", assembly: "at http://localhost:3000/static/js/main.206f4846.js:2:296748", fileName: "http://localhost:3000/static/js/main.206f4846.js", line: 2 }, { level: 1, method: "Object.Re", assembly: "at Object.Re (http://localhost:3000/static/js/main.206f4846.js:2:16814)", fileName: "http://localhost:3000/static/js/main.206f4846.js", line: 2 }, { level: 2, method: "je", assembly: "at je (http://localhost:3000/static/js/main.206f4846.js:2:16968)", fileName: "http://localhost:3000/static/js/main.206f4846.js", line: 2 }, { level: 3, method: "Object.", assembly: "at Object. (http://localhost:3000/static/js/main.206f4846.js:2:42819)", fileName: "http://localhost:3000/static/js/main.206f4846.js", line: 2 }, { level: 4, method: "Object.", assembly: "at Object. (../localfile.js:2:1234)", fileName: "../localfile.js", line: 2 }, { level: 5, method: "", assembly: "at (anonymous) @ VM60:1", fileName: "VM60", line: 1 }, { level: 6, method: "", assembly: "at [native code]", fileName: "", line: 0 }, { level: 7, method: "", assembly: "at (at eval at (http://localhost:3000/static/js/main.206f4846.js:2:296748), :1:1)", fileName: "http://localhost:3000/static/js/main.206f4846.js", line: 2 }, { level: 8, method: "Object.eval", assembly: "at Object.eval (http://localhost:3000/static/js/main.206f4846.js:2:296748)", fileName: "http://localhost:3000/static/js/main.206f4846.js", line: 2 }, { level: 9, method: "eval", assembly: "at eval (http://localhost:3000/static/js/main.206f4846.js:2:296748)", fileName: "http://localhost:3000/static/js/main.206f4846.js", line: 2 }, { level: 10, method: "eval", assembly: "at eval (webpack-internal:///./src/App.tsx:1:1)", fileName: "webpack-internal:///./src/App.tsx", line: 1 }, { level: 11, method: "", assembly: "at [arguments not available])@file://localhost/stacktrace.js:21", fileName: "file://localhost/stacktrace.js", line: 21 }, { level: 12, method: "", assembly: "at file://C:/Temp/stacktrace.js:27:1", fileName: "file://C:/Temp/stacktrace.js", line: 27 }, { level: 13, method: "", assembly: "Line 21 of linked script file://localhost/C:/Temp/stacktrace.js", fileName: "file://localhost/C:/Temp/stacktrace.js", line: 0 }, { level: 14, method: "", assembly: "Line 11 of inline#1 script in http://localhost:3000/static/js/main.206f4846.js:2:296748", fileName: "http://localhost:3000/static/js/main.206f4846.js", line: 2 }, { level: 15, method: "", assembly: "Line 68 of inline#2 script in file://localhost/teststack.html", fileName: "file://localhost/teststack.html", line: 0 }, { level: 16, method: "Function.Module._load", assembly: "at Function.Module._load (module.js:407:3)", fileName: "module.js", line: 407 }, { level: 17, method: "Function.Module.runMain", assembly: "at Function.Module.runMain (module.js:575:10)", fileName: "module.js", line: 575 }, { level: 18, method: "startup", assembly: "at startup (node.js:159:18)", fileName: "node.js", line: 159 }, { level: 19, method: "", assembly: "at Global code (http://example.com/stacktrace.js:11:1)", fileName: "http://example.com/stacktrace.js", line: 11 }, { level: 20, method: "Object.Module._extensions..js", assembly: "at Object.Module._extensions..js (module.js:550:10)", fileName: "module.js", line: 550 }, { level: 21, method: "c", assembly: "at c@http://example.com/stacktrace.js:9:3", fileName: "http://example.com/stacktrace.js", line: 9 }, { level: 22, method: "b", assembly: "at b@http://example.com/stacktrace.js:6:3", fileName: "http://example.com/stacktrace.js", line: 6 }, { level: 23, method: "a", assembly: "at a@http://example.com/stacktrace.js:3:3", fileName: "http://example.com/stacktrace.js", line: 3 }, { level: 24, method: "", assembly: "http://localhost:3000/static/js/main.206f4846.js:2:296748", fileName: "http://localhost:3000/static/js/main.206f4846.js", line: 2 }, { level: 25, method: "c", assembly: "c@http://example.com/stacktrace.js:9:3", fileName: "http://example.com/stacktrace.js", line: 9 }, { level: 26, method: "b", assembly: "b@http://example.com/stacktrace.js:6:3", fileName: "http://example.com/stacktrace.js", line: 6 }, { level: 27, method: "a", assembly: "a@http://example.com/stacktrace.js:3:3", fileName: "http://example.com/stacktrace.js", line: 3 }, { level: 28, method: "Object.testMethod", assembly: "at Object.testMethod (http://localhost:9001/shared/AppInsightsCommon/node_modules/@microsoft/ai-test-framework/dist/es5/ai-test-framework.js:53058:48)", fileName: "http://localhost:9001/shared/AppInsightsCommon/node_modules/@microsoft/ai-test-framework/dist/es5/ai-test-framework.js", line: 53058 } ]; const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data, "Has Data"); if (data) { Assert.ok(data.baseData, "Has BaseData"); let baseData = data.baseData; if (baseData) { const ex = baseData.exceptions[0]; Assert.ok(ex.message.indexOf("Test_Error_Throwing_Inside_UseCallback") !== -1, "Make sure the error message is present [" + ex.message + "]"); Assert.ok(ex.stack.length > 0, "Has stack"); Assert.ok(ex.parsedStack, "Stack was parsed"); Assert.ok(ex.hasFullStack, "Stack has been decoded"); Assert.equal(ex.parsedStack.length, 29); for (let lp = 0; lp < ex.parsedStack.length; lp++) { _checkExpectedFrame(expectedParsedStack[lp], ex.parsedStack[lp], lp); } Assert.ok(baseData.properties, "Has BaseData properties"); Assert.equal(baseData.properties.custom, "custom value"); } } } }) }) this.testCaseAsync({ name: "E2E.GenericTests: trackException with multiple line message", stepDelay: 1, steps: [() => { let message = "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n" + "1. You might have mismatching versions of React and the renderer (such as React DOM)\n" + "2. You might be breaking the Rules of Hooks\n" + "3. You might have more than one copy of React in the same app\n" + "See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."; let errObj = { typeName: "Error", reason: { message: "Error: " + message, stack: "Error: " + message + "\n" + " at Object.throwInvalidHookError (https://localhost:44365/static/js/bundle.js:201419:13)\n" + " at useContext (https://localhost:44365/static/js/bundle.js:222943:25)\n" + " at useTenantContext (https://localhost:44365/static/js/bundle.js:5430:68)\n" + " at https://localhost:44365/static/js/bundle.js:4337:72\n" + " at _ZoneDelegate.invoke (https://localhost:44365/static/js/bundle.js:227675:158)\n" + " at ZoneImpl.run (https://localhost:44365/static/js/bundle.js:227446:35)\n" + " at https://localhost:44365/static/js/bundle.js:229764:30\n" + " at _ZoneDelegate.invokeTask (https://localhost:44365/static/js/bundle.js:227700:171)\n" + " at ZoneImpl.runTask (https://localhost:44365/static/js/bundle.js:227499:37)\n" + " at ZoneImpl.patchRunTask (https://localhost:44365/static/js/bundle.js:144112:27)" } }; let exception = Exception.CreateAutoException(message, "url", 9, 0, errObj ); this._ai.trackException({ exception: exception }, { custom: "custom value" }); }].concat(this.asserts(1)).concat(() => { const expectedParsedStack: IStackFrame[] = [ { level: 0, method: "Object.throwInvalidHookError", assembly: "at Object.throwInvalidHookError (https://localhost:44365/static/js/bundle.js:201419:13)", fileName: "https://localhost:44365/static/js/bundle.js", line: 201419 }, { level: 1, method: "useContext", assembly: "at useContext (https://localhost:44365/static/js/bundle.js:222943:25)", fileName: "https://localhost:44365/static/js/bundle.js", line: 222943 }, { level: 2, method: "useTenantContext", assembly: "at useTenantContext (https://localhost:44365/static/js/bundle.js:5430:68)", fileName: "https://localhost:44365/static/js/bundle.js", line: 5430 }, { level: 3, method: "", assembly: "at https://localhost:44365/static/js/bundle.js:4337:72", fileName: "https://localhost:44365/static/js/bundle.js", line: 4337 }, { level: 4, method: "_ZoneDelegate.invoke", assembly: "at _ZoneDelegate.invoke (https://localhost:44365/static/js/bundle.js:227675:158)", fileName: "https://localhost:44365/static/js/bundle.js", line: 227675 }, { level: 5, method: "ZoneImpl.run", assembly: "at ZoneImpl.run (https://localhost:44365/static/js/bundle.js:227446:35)", fileName: "https://localhost:44365/static/js/bundle.js", line: 227446 }, { level: 6, method: "", assembly: "at https://localhost:44365/static/js/bundle.js:229764:30", fileName: "https://localhost:44365/static/js/bundle.js", line: 229764 }, { level: 7, method: "_ZoneDelegate.invokeTask", assembly: "at _ZoneDelegate.invokeTask (https://localhost:44365/static/js/bundle.js:227700:171)", fileName: "https://localhost:44365/static/js/bundle.js", line: 227700 }, { level: 8, method: "ZoneImpl.runTask", assembly: "at ZoneImpl.runTask (https://localhost:44365/static/js/bundle.js:227499:37)", fileName: "https://localhost:44365/static/js/bundle.js", line: 227499 }, { level: 9, method: "ZoneImpl.patchRunTask", assembly: "at ZoneImpl.patchRunTask (https://localhost:44365/static/js/bundle.js:144112:27)", fileName: "https://localhost:44365/static/js/bundle.js", line: 144112 } ]; const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data, "Has Data"); if (data) { Assert.ok(data.baseData, "Has BaseData"); let baseData = data.baseData; if (baseData) { const ex = baseData.exceptions[0]; Assert.ok(ex.message.indexOf("Invalid hook call") !== -1, "Make sure the error message is present [" + ex.message + "]"); Assert.ok(ex.stack.length > 0, "Has stack"); Assert.ok(ex.parsedStack, "Stack was parsed"); Assert.ok(ex.hasFullStack, "Stack has been decoded"); Assert.equal(ex.parsedStack.length, 10); for (let lp = 0; lp < ex.parsedStack.length; lp++) { _checkExpectedFrame(expectedParsedStack[lp], ex.parsedStack[lp], lp); } Assert.ok(baseData.properties, "Has BaseData properties"); Assert.equal(baseData.properties.custom, "custom value"); } } } }) }) this.testCaseAsync({ name: "TelemetryContext: track metric", stepDelay: 1, steps: [ () => { console.log("* calling trackMetric " + new Date().toISOString()); for (let i = 0; i < 100; i++) { this._ai.trackMetric({ name: "test" + i, average: Math.round(100 * Math.random()), min: 1, max: i + 1, stdDev: 10.0 * Math.random() }); } console.log("* done calling trackMetric " + new Date().toISOString()); } ].concat(this.asserts(100)) }); this.testCaseAsync({ name: "TelemetryContext: track custom metric", stepDelay: 1, steps: [ () => { console.log("* calling trackMetric " + new Date().toISOString()); this._ai.trackMetric({ name: "my_custom_metric_0", average: 2 }); this._ai.trackMetric({ name: "my_custom_metric_1", average: 1.1, sampleCount: 1, min: 1, max: 1, stdDev: 1.12 }); this._ai.trackMetric({ name: "my_custom_metric_2", average: 1.2, sampleCount: 2, min: 1, max: 2, stdDev: 1.23 }); this._ai.trackMetric({ name: "my_custom_metric_3", average: 1.3, sampleCount: 3, min: 1, max: 2.5, stdDev: 1.35 }); console.log("* done calling trackMetric " + new Date().toISOString()); } ].concat(this.asserts(4)) }); this.testCaseAsync({ name: `TelemetryContext: track page view ${window.location.pathname}`, stepDelay: 500, steps: [ () => { this._ai.trackPageView(); // sends 2 } ] .concat(this.asserts(2)) .concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data.baseData.id, "pageView id is defined"); Assert.ok(data.baseData.id.length > 0); Assert.ok(payload.tags["ai.operation.id"]); Assert.equal(data.baseData.id, payload.tags["ai.operation.id"], "pageView id matches current operation id"); } else { Assert.ok(false, "successSpy not called"); } }) }); this.testCaseAsync({ name: "TelemetryContext: track page view performance", stepDelay: 1, steps: [ () => { this._ai.trackPageViewPerformance({ name: 'name', uri: 'url' }); } ].concat(this.asserts(1)) }); this.testCaseAsync({ name: "TelemetryContext: track all types in batch", stepDelay: 1, steps: [ () => { let exception = null; try { window["a"]["b"](); } catch (e) { exception = e; } Assert.ok(exception); this._ai.trackException({ exception }); this._ai.trackMetric({ name: "test", average: Math.round(100 * Math.random()) }); this._ai.trackTrace({ message: "test" }); this._ai.trackPageView({}); // sends 2 this._ai.trackPageViewPerformance({ name: 'name', uri: 'http://someurl' }); this._ai.flush(); } ].concat(this.asserts(6)) }); this.testCaseAsync({ name: "TelemetryContext: track all types in a large batch", stepDelay: 1, steps: [ () => { let exception = null; try { window["a"]["b"](); } catch (e) { exception = e; } Assert.ok(exception); for (let i = 0; i < 100; i++) { this._ai.trackException({ exception }); this._ai.trackMetric({ name: "test", average: Math.round(100 * Math.random()) }); this._ai.trackTrace({ message: "test" }); this._ai.trackPageView({ name: `${i}` }); // sends 2 1st time } } ].concat(this.asserts(401, false)) }); this.testCaseAsync({ name: "TelemetryInitializer: E2E override envelope data", stepDelay: 1, steps: [ () => { // Setup const telemetryInitializer = { init: (envelope) => { envelope.baseData.name = 'other name' return true; } } // Act this._ai.addTelemetryInitializer(telemetryInitializer.init); this._ai.trackMetric({ name: "test", average: Math.round(100 * Math.random()) }); } ] .concat(this.asserts(1)) .concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { let payloadItems = payloadStr.length; Assert.equal(1, payloadItems, 'Only 1 track item is sent'); const payload = JSON.parse(payloadStr[0]); Assert.ok(payload); if (payload && payload.baseData) { const nameResult: string = payload.data.baseData.metrics[0].name; const nameExpect: string = 'other name'; Assert.equal(nameExpect, nameResult, 'telemetryinitializer override successful'); } } }) }); this.testCaseAsync({ name: 'E2E.GenericTests: undefined properties are replaced by customer defined value with config convertUndefined.', stepDelay: 1, steps: [() => { this._ai.trackPageView({ name: 'pageview', properties: { 'prop1': 'val1' } }); this._ai.trackEvent({ name: 'event', properties: { 'prop2': undefined } }); }].concat(this.asserts(3)).concat(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); for (let i = 0; i < payloadStr.length; i++) { const payload = JSON.parse(payloadStr[i]); const baseType = payload.data.baseType; // Make the appropriate assersion depending on the baseType switch (baseType) { case EventDataType: const eventData = payload.data; Assert.ok(eventData && eventData.baseData && eventData.baseData.properties['prop2']); Assert.equal(eventData.baseData.properties['prop2'], 'test-value'); break; case PageViewDataType: const pageViewData = payload.data; Assert.ok(pageViewData && pageViewData.baseData && pageViewData.baseData.properties['prop1']); Assert.equal(pageViewData.baseData.properties['prop1'], 'val1'); break; default: break; } } }) }); } public addDependencyPluginTests(): void { this.testCaseAsync({ name: "TelemetryContext: trackDependencyData", stepDelay: 1, steps: [ () => { const data: IDependencyTelemetry = { target: 'http://abc', responseCode: 200, type: 'GET', id: 'abc' } this._ai.trackDependencyData(data); } ].concat(this.asserts(1)) }); this.testCaseAsync({ name: "TelemetryContext: auto collection of ajax requests", stepDelay: 1, useFakeServer: true, fakeServerAutoRespond: true, steps: [ () => { const xhr = new XMLHttpRequest(); xhr.open('GET', 'https://localhost:9001/AISKU'); xhr.send(); Assert.ok(true); } ].concat(this.asserts(1)) }); let global = getGlobal(); if (global && global.fetch) { this.testCaseAsync({ name: "DependenciesPlugin: auto collection of outgoing fetch requests " + (this.isFetchPolyfill ? " using polyfill " : ""), stepDelay: 5000, useFakeFetch: true, fakeFetchAutoRespond: true, steps: [ () => { fetch('http://localhost:9001/README.md', { method: 'GET', headers: { 'header': 'value' } }); Assert.ok(true, "fetch monitoring is instrumented"); }, () => { fetch('http://localhost:9001/README.md', { method: 'GET' }); Assert.ok(true, "fetch monitoring is instrumented"); }, () => { fetch('http://localhost:9001/README.md'); Assert.ok(true, "fetch monitoring is instrumented"); } ].concat(this.asserts(3, false, false)) .concat(() => { let args = []; this.trackSpy.args.forEach(call => { let message = call[0].baseData.message || ""; // Ignore the internal SendBrowserInfoOnUserInit message (Only occurs when running tests in a browser) if (message.indexOf("AI (Internal): 72 ") == -1) { args.push(call[0]); } }); let type = "Fetch"; if (this.isFetchPolyfill) { type = "Ajax"; Assert.ok(true, "Using fetch polyfill"); } Assert.equal(3, args.length, "track is called 3 times"); let baseData = args[0].baseData; Assert.equal(type, baseData.type, "request is " + type + " type"); Assert.equal('value', baseData.properties.requestHeaders['header'], "fetch request's user defined request header is stored"); Assert.ok(baseData.properties.responseHeaders, "fetch request's reponse header is stored"); baseData = args[1].baseData; Assert.equal(3, Object.keys(baseData.properties.requestHeaders).length, "two request headers set up when there's no user defined request header"); Assert.ok(baseData.properties.requestHeaders[RequestHeaders.requestIdHeader], "Request-Id header"); Assert.ok(baseData.properties.requestHeaders[RequestHeaders.requestContextHeader], "Request-Context header"); Assert.ok(baseData.properties.requestHeaders[RequestHeaders.traceParentHeader], "traceparent"); Assert.ok(!baseData.properties.requestHeaders[RequestHeaders.traceStateHeader], "traceState should not be present in outbound event"); const id: string = baseData.id; const regex = id.match(/\|.{32}\..{16}\./g); Assert.ok(id.length > 0); Assert.equal(1, regex.length) Assert.equal(id, regex[0]); }) }); } else { this.testCase({ name: "DependenciesPlugin: No crash when fetch not supported", test: () => { Assert.ok(true, "fetch monitoring is correctly not instrumented") } }); } } public addPropertiesPluginTests(): void { this.testCaseAsync({ name: 'Custom Tags: allowed to send custom properties via addTelemetryInitializer', stepDelay: 1, steps: [ () => { this._ai.addTelemetryInitializer((item: ITelemetryItem) => { item.tags[this.tagKeys.cloudName] = "my.custom.cloud.name"; }); this._ai.trackEvent({ name: "Custom event via addTelemetryInitializer" }); } ] .concat(this.asserts(1, false, false)) .concat(PollingAssert.createPollingAssert(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length) { const payload = JSON.parse(payloadStr[0]); Assert.equal(1, payloadStr.length, 'Only 1 track item is sent - ' + payload.name); Assert.ok(payload); if (payload && payload.tags) { const tagResult: string = payload.tags && payload.tags[this.tagKeys.cloudName]; const tagExpect: string = 'my.custom.cloud.name'; Assert.equal(tagResult, tagExpect, 'telemetryinitializer tag override successful'); return true; } return false; } }, 'Set custom tags') as any) }); this.testCaseAsync({ name: 'Custom Tags: allowed to send custom properties via addTelemetryInitializer & shimmed addTelemetryInitializer', stepDelay: 1, steps: [ () => { this._ai.addTelemetryInitializer((item: ITelemetryItem) => { item.tags.push({ [this.tagKeys.cloudName]: "my.shim.cloud.name" }); }); this._ai.trackEvent({ name: "Custom event" }); } ] .concat(this.asserts(1)) .concat(PollingAssert.createPollingAssert(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { Assert.equal(1, payloadStr.length, 'Only 1 track item is sent'); const payload = JSON.parse(payloadStr[0]); Assert.ok(payload); if (payload && payload.tags) { const tagResult: string = payload.tags && payload.tags[this.tagKeys.cloudName]; const tagExpect: string = 'my.shim.cloud.name'; Assert.equal(tagResult, tagExpect, 'telemetryinitializer tag override successful'); return true; } return false; } }, 'Set custom tags') as any) }); this.testCaseAsync({ name: 'Custom Tags: allowed to send custom properties via shimmed addTelemetryInitializer', stepDelay: 1, steps: [ () => { this._ai.addTelemetryInitializer((item: ITelemetryItem) => { item.tags[this.tagKeys.cloudName] = "my.custom.cloud.name"; item.tags[this.tagKeys.locationCity] = "my.custom.location.city"; item.tags.push({ [this.tagKeys.locationCountry]: "my.custom.location.country" }); item.tags.push({ [this.tagKeys.operationId]: "my.custom.operation.id" }); }); this._ai.trackEvent({ name: "Custom event via shimmed addTelemetryInitializer" }); } ] .concat(this.asserts(1)) .concat(PollingAssert.createPollingAssert(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); Assert.equal(1, payloadStr.length, 'Only 1 track item is sent - ' + payload.name); if (payloadStr.length > 1) { this.dumpPayloadMessages(this.successSpy); } Assert.ok(payload); if (payload && payload.tags) { const tagResult1: string = payload.tags && payload.tags[this.tagKeys.cloudName]; const tagExpect1: string = 'my.custom.cloud.name'; Assert.equal(tagResult1, tagExpect1, 'telemetryinitializer tag override successful'); const tagResult2: string = payload.tags && payload.tags[this.tagKeys.locationCity]; const tagExpect2: string = 'my.custom.location.city'; Assert.equal(tagResult2, tagExpect2, 'telemetryinitializer tag override successful'); const tagResult3: string = payload.tags && payload.tags[this.tagKeys.locationCountry]; const tagExpect3: string = 'my.custom.location.country'; Assert.equal(tagResult3, tagExpect3, 'telemetryinitializer tag override successful'); const tagResult4: string = payload.tags && payload.tags[this.tagKeys.operationId]; const tagExpect4: string = 'my.custom.operation.id'; Assert.equal(tagResult4, tagExpect4, 'telemetryinitializer tag override successful'); return true; } return false; } }, 'Set custom tags') as any) }); this.testCaseAsync({ name: 'AuthenticatedUserContext: setAuthenticatedUserContext authId', stepDelay: 1, steps: [ () => { const context = (this._ai.context) as IPropTelemetryContext; context.user.setAuthenticatedUserContext('10001'); this._ai.trackTrace({ message: 'authUserContext test' }); } ] .concat(this.asserts(1)) .concat(PollingAssert.createPollingAssert(() => { let payloadStr = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { let payloadEvents = payloadStr.length; let thePayload: string = payloadStr[0]; if (payloadEvents !== 1) { // Only 1 track should be sent return false; } const payload = JSON.parse(thePayload); if (payload && payload.tags) { const tagName: string = this.tagKeys.userAuthUserId; return '10001' === payload.tags[tagName]; } } return false; }, 'user.authenticatedId') as any) }); this.testCaseAsync({ name: 'AuthenticatedUserContext: setAuthenticatedUserContext authId and accountId', stepDelay: 1, steps: [ () => { const context = (this._ai.context) as IPropTelemetryContext; context.user.setAuthenticatedUserContext('10001', 'account123'); this._ai.trackTrace({ message: 'authUserContext test' }); } ] .concat(this.asserts(1)) .concat(PollingAssert.createPollingAssert(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { if (payloadStr.length !== 1) { // Only 1 track should be sent return false; } const payload = JSON.parse(payloadStr[0]); if (payload && payload.tags) { const authTag: string = this.tagKeys.userAuthUserId; const accountTag: string = this.tagKeys.userAccountId; return '10001' === payload.tags[authTag] /*&& 'account123' === payload.tags[accountTag] */; // bug https://msazure.visualstudio.com/One/_workitems/edit/3508825 } } return false; }, 'user.authenticatedId') as any) }); this.testCaseAsync({ name: 'AuthenticatedUserContext: setAuthenticatedUserContext non-ascii authId and accountId', stepDelay: 1, steps: [ () => { const context = (this._ai.context) as IPropTelemetryContext; context.user.setAuthenticatedUserContext("\u0428", "\u0429"); this._ai.trackTrace({ message: 'authUserContext test' }); } ] .concat(this.asserts(1)) .concat(PollingAssert.createPollingAssert(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { if (payloadStr.length !== 1) { // Only 1 track should be sent return false; } const payload = JSON.parse(payloadStr[0]); if (payload && payload.tags) { const authTag: string = this.tagKeys.userAuthUserId; const accountTag: string = this.tagKeys.userAccountId; return '\u0428' === payload.tags[authTag] /* && '\u0429' === payload.tags[accountTag] */; // bug https://msazure.visualstudio.com/One/_workitems/edit/3508825 } } return false; }, 'user.authenticatedId') as any) }); this.testCaseAsync({ name: 'AuthenticatedUserContext: clearAuthenticatedUserContext', stepDelay: 1, steps: [ () => { const context = (this._ai.context) as IPropTelemetryContext; context.user.setAuthenticatedUserContext('10002', 'account567'); context.user.clearAuthenticatedUserContext(); this._ai.trackTrace({ message: 'authUserContext test' }); } ] .concat(this.asserts(1)) .concat(PollingAssert.createPollingAssert(() => { const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { if (payloadStr.length !== 1) { // Only 1 track should be sent return false; } const payload = JSON.parse(payloadStr[0]); if (payload && payload.tags) { const authTag: string = this.tagKeys.userAuthUserId; const accountTag: string = this.tagKeys.userAccountId; return undefined === payload.tags[authTag] && undefined === payload.tags[accountTag]; } } return false; }, 'user.authenticatedId') as any) }); // This doesn't need to be e2e this.testCase({ name: 'AuthenticatedUserContext: setAuthenticatedUserContext does not set the cookie by default', test: () => { // Setup const context = (this._ai.context) as IPropTelemetryContext; const authSpy: SinonSpy = this.sandbox.spy(context.user, 'setAuthenticatedUserContext'); let cookieMgr = this._ai.getCookieMgr(); const cookieSpy: SinonSpy = this.sandbox.spy(cookieMgr, 'set'); // Act context.user.setAuthenticatedUserContext('10002', 'account567'); // Test Assert.ok(authSpy.calledOnce, 'setAuthenticatedUserContext called'); Assert.equal(false, authSpy.calledWithExactly('10001', 'account567', false), 'Correct default args to setAuthenticatedUserContext'); Assert.ok(cookieSpy.notCalled, 'cookie never set'); } }); this.testCase({ name: 'Sampling: sampleRate is generated as a field in the envelope when it is less than 100', test: () => { this._ai.trackEvent({ name: 'event' }); Assert.ok(this.envelopeConstructorSpy.called); const envelope = this.envelopeConstructorSpy.returnValues[0]; Assert.equal(envelope.sampleRate, 50, "sampleRate is generated"); Assert.equal(envelope.iKey, ApplicationInsightsTests._instrumentationKey, "default config iKey is used"); } }); this.testCase({ name: 'iKey replacement: envelope will use the non-empty iKey defined in track method', test: () => { this._ai.trackEvent({ name: 'event1', properties: { "prop1": "value1" }, measurements: { "measurement1": 200 }, iKey: "1a6933ad-aaaa-aaaa-aaaa-000000000000" }); Assert.ok(this.envelopeConstructorSpy.called); const envelope = this.envelopeConstructorSpy.returnValues[0]; Assert.equal(envelope.iKey, "1a6933ad-aaaa-aaaa-aaaa-000000000000", "trackEvent iKey is replaced"); } }); this.testCase({ name: 'iKey replacement: envelope will use the config iKey if defined ikey in track method is empty', test: () => { this._ai.trackEvent({ name: 'event1', properties: { "prop1": "value1" }, measurements: { "measurement1": 200 }, iKey: "" }); Assert.ok(this.envelopeConstructorSpy.called); const envelope = this.envelopeConstructorSpy.returnValues[0]; Assert.equal(envelope.iKey, ApplicationInsightsTests._instrumentationKey, "trackEvent iKey should not be replaced"); } }); } private boilerPlateAsserts = () => { Assert.ok(this.successSpy.called, "success"); Assert.ok(!this.errorSpy.called, "no error sending"); const isValidCallCount = this.loggingSpy.callCount === 0; Assert.ok(isValidCallCount, "logging spy was called 0 time(s)"); if (!isValidCallCount) { while (this.loggingSpy.args.length) { Assert.ok(false, "[warning thrown]: " + dumpObj(this.loggingSpy.args.pop())); } } } private asserts: any = (expectedCount: number, includeInit: boolean = false, doBoilerPlate: boolean = true) => [ () => { const message = "polling: " + new Date().toISOString(); Assert.ok(true, message); console.log(message); if (doBoilerPlate) { if (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called) { this.boilerPlateAsserts(); } } }, (PollingAssert.createPollingAssert(() => { let argCount = 0; if (this.successSpy.called && this.successSpy.args && this.successSpy.args.length > 0) { this.successSpy.args.forEach(call => { argCount += call[0].length; }); } Assert.ok(true, "* [" + argCount + " of " + expectedCount + "] checking success spy " + new Date().toISOString()); if (argCount >= expectedCount) { let payloadStr = this.getPayloadMessages(this.successSpy, includeInit); if (payloadStr.length > 0) { let currentCount: number = payloadStr.length; console.log('curr: ' + currentCount + ' exp: ' + expectedCount, ' appId: ' + this._ai.context.appId()); if (currentCount === expectedCount && !!this._ai.context.appId()) { const payload = JSON.parse(payloadStr[0]); const baseType = payload.data.baseType; // call the appropriate Validate depending on the baseType switch (baseType) { case EventDataType: return EventValidator.EventValidator.Validate(payload, baseType); case TraceDataType: return TraceValidator.TraceValidator.Validate(payload, baseType); case ExceptionDataType: return ExceptionValidator.ExceptionValidator.Validate(payload, baseType); case MetricDataType: return MetricValidator.MetricValidator.Validate(payload, baseType); case PageViewDataType: return PageViewValidator.PageViewValidator.Validate(payload, baseType); case PageViewPerformanceDataType: return PageViewPerformanceValidator.PageViewPerformanceValidator.Validate(payload, baseType); case RemoteDependencyDataType: return RemoteDepdencyValidator.RemoteDepdencyValidator.Validate(payload, baseType); default: return EventValidator.EventValidator.Validate(payload, baseType); } } } } return false; }, "sender succeeded", 60)) ]; } class CustomTestError extends Error { constructor(message = "") { super(message); this.name = "CustomTestError"; this.message = message + " -- test error."; } } class TestPlugin extends BaseTelemetryPlugin { public identifier: string = "TestPlugin"; public version: string = "0.99.1"; constructor() { super(); } public processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext | undefined): void { itemCtx?.processNext(env); } } ================================================ FILE: AISKU/Tests/Unit/src/sanitizer.e2e.tests.ts ================================================ import { ApplicationInsights, IApplicationInsights, LoggingSeverity, _eInternalMessageId } from '../../../src/applicationinsights-web' import { Sender } from '@microsoft/applicationinsights-channel-js'; import { AITestClass, Assert, PollingAssert } from '@microsoft/ai-test-framework'; import { SinonSpy } from 'sinon'; import { newId } from '@microsoft/applicationinsights-core-js'; import { BreezeChannelIdentifier } from '@microsoft/applicationinsights-core-js'; export class SanitizerE2ETests extends AITestClass { private readonly _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; private _ai: IApplicationInsights; // Sinon private errorSpy: SinonSpy; private successSpy: SinonSpy; private loggingSpy: SinonSpy; private delay = 100; constructor() { super("SanitizerE2ETests"); } public testInitialize() { try { this.useFakeServer = false; const init = new ApplicationInsights({ config: { instrumentationKey: this._instrumentationKey, extensionConfig: { 'AppInsightsChannelPlugin': { maxBatchInterval: 500 } } }, queue: [], version: 2.0 }); this._ai = init.loadAppInsights(); // Setup Sinon stuff const sender: Sender = this._ai.getPlugin(BreezeChannelIdentifier).plugin; this.errorSpy = this.sandbox.spy(sender, '_onError'); this.successSpy = this.sandbox.spy(sender, '_onSuccess'); this.loggingSpy = this.sandbox.stub(this._ai.appInsights.core.logger, 'throwInternal'); } catch (e) { console.error('Failed to initialize'); } } public testFinishedCleanup(): void { if (this._ai && this._ai.unload) { // force unload this._ai.unload(false); } } public registerTests() { this.addAsyncTests(); } private addAsyncTests(): void { const boilerPlateAsserts = () => { Assert.ok(this.successSpy.called, "success"); Assert.ok(!this.errorSpy.called, "no error sending"); } this.testCase({ name: "SanitizerE2ETests: RDD Telemetry sanitizes long names", test: () => { return this._asyncQueue().add(() => { this._ai.trackDependencyData({ id: newId(), name: new Array(1234).join("a"), // exceeds max of 1024 responseCode: 200 }); }) .add(PollingAssert.asyncTaskPollingAssert(() => { Assert.ok(true, "waiting for response " + new Date().toISOString()); return (this.successSpy.called || this.errorSpy.called); }, "Wait for response") as any) .add(() => { boilerPlateAsserts(); }) .add(() => { Assert.ok(this.loggingSpy.called); Assert.equal(LoggingSeverity.WARNING, this.loggingSpy.args[0][0]); Assert.equal(_eInternalMessageId.StringValueTooLong, this.loggingSpy.args[0][1]); }); } }) this.testCase({ name: "Sanitizer2ETests: Data platform accepts sanitized names", test: () => { return this._asyncQueue().add(() => { const properties = { "property1%^~`": "hello", "property2*&#+": "world" }; const measurements = { "measurement@|": 300 }; this._ai.trackMetric({name: "test", average: 5}); }) .add(PollingAssert.asyncTaskPollingAssert(() => { Assert.ok(true, "waiting for response " + new Date().toISOString()); return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); }, "Wait for response") as any) .add(() => { boilerPlateAsserts(); }); } }); this.testCase({ name: "Sanitizer2ETests: Data platform accepts legal charater set names", test: () => { return this._asyncQueue().add(() => { const properties = { "abcdefghijklmnopqrstuvwxyz": "hello", "ABCDEFGHIJKLMNOPQRSTUVWXYZ": "world" }; const measurements = { "(1234567890/ \_-.)": 300 }; this._ai.trackMetric({name: "test", average: 5}); }) .add(PollingAssert.asyncTaskPollingAssert(() => { Assert.ok(true, "waiting for response " + new Date().toISOString()); return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); }, "Wait for response") as any) .add(() => { boilerPlateAsserts(); }); } }); this.testCase({ name: "Sanitizer2ETests: Data platform accepts up to 150 charaters for names", test: () => { return this._asyncQueue().add(() => { const len = 150; const name = new Array(len + 1).join('a'); this._ai.trackMetric({name, average: 5}); }) .add(PollingAssert.asyncTaskPollingAssert(() => { Assert.ok(true, "waiting for response " + new Date().toISOString()); return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); }, "Wait for response") as any) .add(() => { boilerPlateAsserts(); }); } }); this.testCase({ name: "Sanitizer2ETests: Data platform accepts up to 1024 charaters for values", test: () => { return this._asyncQueue().add(() => { const len = 1024; const value = new Array(len + 1).join('a'); const properties = { "testProp": value }; this._ai.trackMetric({name: "test", average: 5}); }) .add(PollingAssert.asyncTaskPollingAssert(() => { Assert.ok(true, "waiting for response " + new Date().toISOString()); return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); }, "Wait for response") as any) .add(() => { boilerPlateAsserts(); }); } }); this.testCase({ name: "Sanitizer2ETests: Data platform accepts up to 2048 characters for url", test: () => { return this._asyncQueue().add(() => { const len = 2048; let url = "http://hello.com/"; url = url + new Array(len - url.length + 1).join('a'); this._ai.trackPageView({name: "test", uri: url}); }) .add(PollingAssert.asyncTaskPollingAssert(() => { Assert.ok(true, "waiting for response " + new Date().toISOString()); return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); }, "Wait for response") as any) .add(() => { boilerPlateAsserts(); }); } }); this.testCase({ name: "Sanitizer2ETests: Data platform accepts up to 32768 characters for messages", test: () => { return this._asyncQueue().add(() => { const len = 32768; const message = new Array(len + 1).join('a'); this._ai.trackTrace({message, severityLevel: 0}); }) .add(PollingAssert.asyncTaskPollingAssert(() => { Assert.ok(true, "waiting for response " + new Date().toISOString()); return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); }, "Wait for response") as any) .add(() => { boilerPlateAsserts(); }); } }); } } ================================================ FILE: AISKU/Tests/Unit/src/sender.e2e.tests.ts ================================================ import { ApplicationInsights, IApplicationInsights } from '../../../src/applicationinsights-web' import { Sender } from '@microsoft/applicationinsights-channel-js'; import { BreezeChannelIdentifier, utlGetSessionStorage, utlRemoveSessionStorage } from '@microsoft/applicationinsights-core-js'; import { ActiveStatus, dumpObj, getJSON, isArray } from '@microsoft/applicationinsights-core-js'; import { SinonSpy } from 'sinon'; import { Assert, AITestClass, PollingAssert} from "@microsoft/ai-test-framework" import { createAsyncResolvedPromise } from '@nevware21/ts-async'; export class SenderE2ETests extends AITestClass { private readonly _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; private readonly _bufferName = 'AI_buffer_1'; private readonly _sentBufferName = 'AI_sentBuffer_1'; private _ai: IApplicationInsights; private _sender: Sender; // Sinon private errorSpy: SinonSpy; private successSpy: SinonSpy; private loggingSpy: SinonSpy; private clearSpy: SinonSpy; private delay = 100; constructor() { super("SenderE2ETests"); } public testInitialize() { try { this.useFakeServer = false; const init = new ApplicationInsights({ config: { instrumentationKey: this._instrumentationKey, loggingLevelConsole: 999, extensionConfig: { 'AppInsightsChannelPlugin': { maxBatchInterval: 2000, maxBatchSizeInBytes: 10*1024*1024 // 10 MB }, ["AppInsightsCfgSyncPlugin"]: { cfgUrl: "" } } }, queue: [], version: 2.0 }); this._ai = init.loadAppInsights(); // Setup Sinon stuff this._sender = this._ai.getPlugin(BreezeChannelIdentifier).plugin; this._sender._buffer.clear(); this.errorSpy = this.sandbox.spy(this._sender, '_onError'); this.successSpy = this.sandbox.spy(this._sender, '_onSuccess'); this.loggingSpy = this.sandbox.stub(this._ai.appInsights.core.logger, 'throwInternal'); this.clearSpy = this.sandbox.spy(this._sender._buffer, 'clearSent'); } catch (e) { console.error('Failed to initialize'); } } public testFinishedCleanup(): void { if (this._ai && this._ai.unload) { this._ai.unload(false); } } public testCleanup() { utlRemoveSessionStorage(null as any, "AI_sentBuffer", ); utlRemoveSessionStorage(null as any, "AI_buffer", ); this.successSpy.restore(); } public registerTests() { this.addAsyncTests(); this.addTrackEndpointTests(); this.addRetryTests(); } private addRetryTests() { let handle; this.testCase({ name: 'Offline: offline telemetry is retried', pollDelay: this.delay, test: () => { handle = setInterval(() => {this._ai.trackTrace({message: 'intermittent message'})}, 500); Assert.ok(true, 'sent event'); return this._asyncQueue() .concat(this.waitForResponse()) .concat(this.boilerPlateAsserts) .concat(PollingAssert.asyncTaskPollingAssert(() => { let currentCount: number = 0; if (this.successSpy.called) { this.successSpy.args.forEach(call => { const acceptedItems = call[1]; currentCount += acceptedItems; // number of accepted items }); console.log('currentCount', currentCount); return currentCount >= 20; } return false; }, 'All items are sent', 600, 1000) as any) .concat(() => { clearInterval(handle); Assert.ok(true, 'handle cleared'); }); } }); } private addAsyncTests(): void { this.testCase({ name: 'SendBuffer: Session storage is cleared after a send', pollDelay: this.delay, timeout: 30000, test: () => { this._ai.trackTrace({message: 'test trace'}); return this._asyncQueue() .concat(this.waitForResponse()) .concat(this.boilerPlateAsserts) .concat(PollingAssert.asyncTaskPollingAssert(() => this.successSpy.called && this.isSessionSentEmpty(), "SentBuffer Session storage is empty", 15, 1000)) .concat(PollingAssert.asyncTaskPollingAssert(() => this.successSpy.called && this.isSessionEmpty(), "Buffer Session storage is empty", 15, 1000)); } }); this.testCase({ name: 'SendBuffer: Session storage is cleared after a send with cs promise', pollDelay: this.delay, test: () => { if (this._ai && this._ai.unload) { this._ai.unload(false); } let csPromise = createAsyncResolvedPromise(`InstrumentationKey=${this._instrumentationKey}`); let init = new ApplicationInsights({ config: { connectionString: csPromise, loggingLevelConsole: 999, extensionConfig: { 'AppInsightsChannelPlugin': { maxBatchInterval: 2000, maxBatchSizeInBytes: 10*1024*1024 // 10 MB }, ["AppInsightsCfgSyncPlugin"]: { cfgUrl: "" } } }, queue: [], version: 2.0 }); this._ai = init.loadAppInsights(); // Setup Sinon stuff this._sender = this._ai.getPlugin(BreezeChannelIdentifier).plugin; this._sender._buffer.clear(); this.errorSpy = this.sandbox.spy(this._sender, '_onError'); this.successSpy = this.sandbox.spy(this._sender, '_onSuccess'); this.loggingSpy = this.sandbox.stub(this._ai.appInsights.core.logger, 'throwInternal'); this.clearSpy = this.sandbox.spy(this._sender._buffer, 'clearSent'); this._ai.trackTrace({message: 'test trace'}); return this._asyncQueue() .concat(PollingAssert.asyncTaskPollingAssert(() => { let core = this._ai.appInsights.core let activeStatus = core.activeStatus && core.activeStatus(); if (activeStatus === ActiveStatus.ACTIVE ) { Assert.equal(this._instrumentationKey, core.config.instrumentationKey, "ikey should be set"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000)) .concat(this.waitForResponse()) .concat(this.boilerPlateAsserts) .concat(PollingAssert.asyncTaskPollingAssert(() => this.successSpy.called && this.isSessionSentEmpty(), "SentBuffer Session storage is empty", 15, 1000)) .concat(PollingAssert.asyncTaskPollingAssert(() => this.successSpy.called && this.isSessionEmpty(), "Buffer Session storage is empty", 15, 1000)); } }); } private addTrackEndpointTests(): void { const SENT_ITEMS: number = 100; const SENT_TYPES: number = 4; this.testCase({ name: 'EndpointTests: telemetry sent to endpoint fills to maxBatchSize', pollDelay: this.delay, test: () => { for (let i = 0; i < SENT_ITEMS; i++) { this._ai.trackException({error: new Error()}); this._ai.trackMetric({name: "test", average: Math.round(100 * Math.random())}); this._ai.trackTrace({message: "test"}); this._ai.trackTrace({message: "test2"}); } // Wait for the response return this._asyncQueue() .concat(this.waitForResponse()) .concat(this.boilerPlateAsserts) .concat(PollingAssert.asyncTaskPollingAssert(() => { let currentCount: number = 0; if (this.successSpy.called) { this.successSpy.args.forEach(call => { const acceptedItems = call[1]; currentCount += acceptedItems; // number of accepted items }); return currentCount === SENT_ITEMS * SENT_TYPES; } return false; }, `Backend accepts ${SENT_ITEMS} items`, 15, 1000)) .concat(PollingAssert.asyncTaskPollingAssert(() => { return this.successSpy.calledOnce; }, "Tracks are sent in ONE batch", 15, 1000)); } }); } private waitForResponse() { // Wait for the successSpy or errorSpy to be called return PollingAssert.asyncTaskPollingAssert(() => { return (this.successSpy.called || this.errorSpy.called); }, "Wait for response" + new Date().toISOString(), 15, 1000); } private boilerPlateAsserts() { Assert.ok(this.successSpy.called, "success"); Assert.ok(!this.errorSpy.called, "no error sending"); Assert.ok(this.clearSpy.called, "clearSent called"); const isValidCallCount = this.loggingSpy.callCount === 0; Assert.ok(isValidCallCount, "logging spy was called 0 time(s)"); if (!isValidCallCount) { while (this.loggingSpy.args.length) { Assert.ok(false, "[warning thrown]: " + dumpObj(this.loggingSpy.args.pop())); } } } private isSessionEmpty(): boolean { const buffer = this._getBuffer(this._bufferName); return buffer.length === 0; } private isSessionSentEmpty(): boolean { const buffer = this._getBuffer(this._sentBufferName); return buffer.length === 0; } private _getBuffer(key: string): string[] { let prefixedKey = key; try { const bufferJson = utlGetSessionStorage(null, key); if (bufferJson) { let buffer: string[] = getJSON().parse(bufferJson); if (buffer && isArray(buffer)) { return buffer; } } } catch (e) { console.error("_getBuffer" + e); } return []; } } ================================================ FILE: AISKU/Tests/Unit/src/testLegacySnippet.ts ================================================ /** * DO NOT FIX BUGS WITH THE OBJECT RETURNED BY THIS HELPER * ------------------------------------------------------- * This is a helper that returns an object that is the same as the legacy snippet, if there is * an issue with the tests because of the object this returns there is probably a bug during * initialization. */ export function createLegacySnippet(aiConfig) { var appInsights: any = { config: aiConfig }; // Assigning these to local variables allows them to be minified to save space: var localDocument = document; var localWindow = window; // var scriptText = "script"; var userContext = "AuthenticatedUserContext"; var start = "start"; var stop = "stop"; var track = "Track"; var trackEvent = track + "Event"; var trackPage = track + "Page"; // Commented out as we don't want to load from the CDN // setTimeout(function () { // var scriptElement = localDocument.createElement(scriptText); // scriptElement.src = aiConfig.url || "CDN_PATH"; // localDocument.getElementsByTagName(scriptText)[0].parentNode.appendChild(scriptElement); // }); // capture initial cookie try { appInsights.cookie = localDocument.cookie; } catch (e) { } appInsights.queue = []; function createLazyMethod(name) { // Define a temporary method that queues-up a the real method call appInsights[name] = function () { // Capture the original arguments passed to the method var originalArguments = arguments; // Queue-up a call to the real method appInsights.queue.push(function () { // Invoke the real method with the captured original arguments appInsights[name].apply(appInsights, originalArguments); }); } }; var methods = ["Event", "Exception", "Metric", "PageView", "Trace", "Dependency"]; while (methods.length) { createLazyMethod("track" + methods.pop()); } createLazyMethod("set" + userContext); createLazyMethod("clear" + userContext); createLazyMethod(start + trackEvent); createLazyMethod(stop + trackEvent); createLazyMethod(start + trackPage); createLazyMethod(stop + trackPage); createLazyMethod("flush"); // collect global errors if (!aiConfig.disableExceptionTracking) { var method = "onerror"; createLazyMethod("_" + method); var originalOnError = localWindow[method]; localWindow[method] = function (message, url, lineNumber, columnNumber, error) { var handled = originalOnError && originalOnError(message, url, lineNumber, columnNumber, error); if (handled !== true) { appInsights["_" + method](message, url, lineNumber, columnNumber, error); } return handled; }; } // if somebody calls the snippet twice, don't report page view again if (appInsights.queue && appInsights.queue.length === 0) { // appInsights.trackPageView(); } return appInsights; } ================================================ FILE: AISKU/Tests/Unit/src/testSnippetV5.ts ================================================ /** * DO NOT FIX BUGS WITH THE OBJECT RETURNED BY THIS HELPER * ------------------------------------------------------- * YOU *SHOULD* CREATE A NEW VERSION FOR EACH SNIPPET VERSION UNLESS CHANGES ARE MINIMAL * ------------------------------------------------------- * This is a helper that returns an object that is the same as the v5 snippet, if there is * an issue with the tests because of the object this returns there is probably a bug during * initialization. */ export function createSnippetV5(snipConfig) { let win = window; let doc = document; var locn = win.location; var helpLink = "https://go.microsoft.com/fwlink/?linkid=2128109"; var scriptText = "script"; var strInstrumentationKey = "instrumentationKey"; var strIngestionendpoint = "ingestionendpoint"; var userOverrideEndpointUrl = "userOverrideEndpointUrl"; var strDisableExceptionTracking = "disableExceptionTracking"; var strAiDevice = "ai.device."; var strAiOperationName = "ai.operation.name"; var strAiSdkVersion = "ai.internal.sdkVersion"; var strToLowerCase = "toLowerCase"; var strEmpty = ""; var strUndefined = "undefined"; var strCrossOrigin = "crossOrigin"; var strPostMethod = "POST"; var sdkInstanceName = "appInsightsSDK"; // required for Initialization to find the current instance var aiName = snipConfig.name || "appInsights"; // provide non default instance name through snipConfig name value if (snipConfig.name || win[sdkInstanceName]) { // Only set if supplied or another name is defined to avoid polluting the global namespace win[sdkInstanceName] = aiName; } var aiSdk = win[aiName] || (function (aiConfig) { var loadFailed = false; var handled = false; var appInsights: any = { initialize: true, // initialize sdk on download queue: [], sv: "5", // Track the actual snippet version for reporting. version: 2.0, // initialization version, if this is not 2.0 the previous scripts fail to initialize config: aiConfig }; function _parseConnectionString() { var fields: any = {}; var connectionString = aiConfig.connectionString; if (connectionString) { var kvPairs = connectionString.split(";"); for (var lp = 0; lp < kvPairs.length; lp++) { var kvParts = kvPairs[lp].split("="); if (kvParts.length === 2) { // only save fields with valid formats fields[kvParts[0][strToLowerCase]()] = kvParts[1]; } } } // apply the default endpoints if (!fields[strIngestionendpoint]) { // use endpoint suffix where overrides are not provided var endpointSuffix = fields.endpointsuffix; // Only fetch the location if a suffix was supplied var fLocation = endpointSuffix ? fields.location : null; fields[strIngestionendpoint] = "https://" + (fLocation ? fLocation + "." : strEmpty) + "dc." + (endpointSuffix || "services.visualstudio.com"); } return fields; } function _sendEvents(evts, endpointUrl) { if (JSON) { var sender = win.fetch; if (sender && !snipConfig.useXhr) { sender(endpointUrl, { method:strPostMethod, body: JSON.stringify(evts), mode:"cors"}); } else if (XMLHttpRequest) { // IE doesn't support fetch and private clouds may only be using IE var xhr = new XMLHttpRequest(); xhr.open(strPostMethod, endpointUrl); xhr.setRequestHeader("Content-type", "application/json"); xhr.send(JSON.stringify(evts)); } } } function _reportFailure(targetSrc) { var conString = _parseConnectionString(); var iKey = conString[strInstrumentationKey] || aiConfig[strInstrumentationKey] || strEmpty; var ingest = conString[strIngestionendpoint]; var endpointUrl = aiConfig[userOverrideEndpointUrl] ? aiConfig[userOverrideEndpointUrl] : (ingest + "/v2/track"); var message = "SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details)"; var evts = []; evts.push(_createException(iKey, message, targetSrc, endpointUrl)); evts.push(_createInternal(iKey, message, targetSrc, endpointUrl)); _sendEvents(evts, endpointUrl); } // Gets the time as an ISO date format, using a function as IE7/8 doesn't support toISOString function _getTime() { var date = new Date(); function pad(num) { var r = strEmpty + num; if (r.length === 1) { r = "0" + r; } return r; } return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } function _createEnvelope(iKey, theType): any { var tags = {}; var type = "Browser"; tags[strAiDevice + "id"] = type[strToLowerCase](); tags[strAiDevice + "type"] = type; tags[strAiOperationName] = locn && locn.pathname || "_unknown_"; tags[strAiSdkVersion] = "javascript:snippet_" + (appInsights.sv || appInsights.version); return { time: _getTime(), iKey: iKey, name: "Microsoft.ApplicationInsights." + iKey.replace(/-/g, strEmpty) + "." + theType, sampleRate: 100, tags: tags, data: { baseData: { ver: 2 } } }; } function _createInternal(iKey, message, targetSrc, endpointUrl) { var envelope = _createEnvelope(iKey, "Message"); var data = envelope.data; data.baseType = "MessageData"; var baseData = data.baseData; baseData.message = "AI (Internal): 99 message:\"" + (message + " (" + targetSrc + ")").replace(/\"/g, strEmpty) + "\""; baseData.properties = { endpoint: endpointUrl }; return envelope; } function _createException(iKey, message, targetSrc, endpointUrl) { var envelope = _createEnvelope(iKey, "Exception"); var data = envelope.data; data.baseType = "ExceptionData"; data.baseData.exceptions = [{ typeName: "SDKLoadFailed", message: message.replace(/\./g, "-"), // Replacing '.' characters as it causes the portal to hide the start of the message in the summary hasFullStack: false, stack: message + "\nSnippet failed to load [" + targetSrc + "] -- Telemetry is disabled\nHelp Link: " + helpLink + "\nHost: " + (locn && locn.pathname || "_unknown_") + "\nEndpoint: " + endpointUrl, parsedStack: [] }]; return envelope; } // Commented out as we don't want to load from the CDN // ------------------------------------------------------------- // Assigning these to local variables allows them to be minified to save space: // var targetSrc = aiConfig.url || snipConfig.src; // if (targetSrc) { // function _handleError(evt) { // loadFailed = true; // appInsights.queue = []; // Clear the queue // if (!handled) { // handled = true; // _reportFailure(targetSrc); // } // } // function _handleLoad(evt, isAbort) { // if (!handled) { // // IE10, Opera calls loaded before the script is processed. // // so delaying to give the script a chance to be processed // setTimeout(function() { // if (isAbort || !appInsights.core) { // _handleError(); // } // }, 500); // } // } // function _createScript() { // var scriptElement = doc.createElement(scriptText); // scriptElement.src = targetSrc; // // Allocate Cross origin only if defined and available // var crossOrigin = snipConfig[strCrossOrigin]; // if ((crossOrigin || crossOrigin === "") && scriptElement[strCrossOrigin] != strUndefined) { // scriptElement[strCrossOrigin] = crossOrigin; // } // scriptElement.onload = _handleLoad; // scriptElement.onerror = _handleError; // // Some browsers support onload while others onreadystatechange and others both // scriptElement.onreadystatechange = function (evt, isAbort) { // if (scriptElement.readyState === "loaded" || scriptElement.readyState === "complete") { // _handleLoad(evt, isAbort); // } // }; // return scriptElement; // } // var theScript = _createScript(); // if (snipConfig.ld < 0) { // // if user wants to append tag to document head, blocking page load // var headNode = doc.getElementsByTagName("head")[0]; // headNode.appendChild(theScript); // } else { // setTimeout(function () { // // Attempts to place the script tag in the same location as the first script on the page // doc.getElementsByTagName(scriptText)[0].parentNode.appendChild(theScript); // }, snipConfig.ld || 0); // } // } // capture initial cookie try { appInsights.cookie = doc.cookie; } catch (e) { } function _createMethods(methods) { while (methods.length) { (function (name) { // Define a temporary method that queues-up a the real method call appInsights[name] = function () { // Capture the original arguments passed to the method var originalArguments = arguments; if (!loadFailed) { // If we have detected that the main script failed to load then stop queuing events that will never be processed // Queue-up a call to the real method appInsights.queue.push(function () { // Invoke the real method with the captured original arguments appInsights[name].apply(appInsights, originalArguments); }); } }; })(methods.pop()); } } var track = "track"; var trackPage = "TrackPage"; var trackEvent = "TrackEvent"; _createMethods([track + "Event", track + "PageView", track + "Exception", track + "Trace", track + "DependencyData", track + "Metric", track + "PageViewPerformance", "start" + trackPage, "stop" + trackPage, "start" + trackEvent, "stop" + trackEvent, "addTelemetryInitializer", "setAuthenticatedUserContext", "clearAuthenticatedUserContext", "flush"]); // expose SeverityLevel enum appInsights['SeverityLevel'] = { Verbose : 0, Information : 1, Warning : 2, Error : 3, Critical : 4 }; // Collect global errors // Note: ApplicationInsightsAnalytics is the extension string identifier for // AppAnalytics. It is defined in ApplicationInsights.ts:ApplicationInsights.identifer var analyticsCfg = ((aiConfig.extensionConfig || {}).ApplicationInsightsAnalytics ||{}); if (!(aiConfig[strDisableExceptionTracking] === true || analyticsCfg[strDisableExceptionTracking] === true)) { var method = "onerror"; _createMethods(["_" + method]); var originalOnError = win[method]; win[method] = function(message, url, lineNumber, columnNumber, error) { var handled = originalOnError && originalOnError(message, url, lineNumber, columnNumber, error); if (handled !== true) { appInsights["_" + method]({ message: message, url: url, lineNumber: lineNumber, columnNumber: columnNumber, error: error }); } return handled; }; aiConfig.autoExceptionInstrumented = true; } return appInsights; })(snipConfig.cfg); function _onInit() { if (snipConfig.onInit) { snipConfig.onInit(aiSdk); } } // if somebody calls the snippet twice, don't report page view again if (aiSdk.queue && aiSdk.queue.length === 0) { aiSdk.queue.push(_onInit); // aiSdk.trackPageView({}); } else { // Already loaded so just call the onInit _onInit(); } return aiSdk; } ================================================ FILE: AISKU/Tests/Unit/src/testSnippetV6.ts ================================================ /** * DO NOT FIX BUGS WITH THE OBJECT RETURNED BY THIS HELPER * ------------------------------------------------------- * YOU *SHOULD* CREATE A NEW VERSION FOR EACH SNIPPET VERSION UNLESS CHANGES ARE MINIMAL * ------------------------------------------------------- * This is a helper that returns an object that is the same as the v6 snippet, if there is * an issue with the tests because of the object this returns there is probably a bug during * initialization. */ export function createSnippetV6(snipConfig) { let win = window; let doc = document; var locn = win.location; var helpLink = "https://go.microsoft.com/fwlink/?linkid=2128109"; var scriptText = "script"; var strInstrumentationKey = "instrumentationKey"; var strIngestionendpoint = "ingestionendpoint"; var userOverrideEndpointUrl = "userOverrideEndpointUrl"; var strDisableExceptionTracking = "disableExceptionTracking"; var strAiDevice = "ai.device."; var strAiOperationName = "ai.operation.name"; var strAiSdkVersion = "ai.internal.sdkVersion"; var strToLowerCase = "toLowerCase"; var strConStringIKey = strInstrumentationKey[strToLowerCase](); var strEmpty = ""; var strUndefined = "undefined"; var strCrossOrigin = "crossOrigin"; var strPostMethod = "POST"; var sdkInstanceName = "appInsightsSDK"; // required for Initialization to find the current instance var aiName = snipConfig.name || "appInsights"; // provide non default instance name through snipConfig name value if (snipConfig.name || win[sdkInstanceName]) { // Only set if supplied or another name is defined to avoid polluting the global namespace win[sdkInstanceName] = aiName; } var aiSdk = win[aiName] || (function (aiConfig) { var loadFailed = false; var handled = false; var appInsights: any = { initialize: true, // initialize sdk on download queue: [], sv: "6", // Track the actual snippet version for reporting. version: 2.0, // initialization version, if this is not 2.0 the previous scripts fail to initialize config: aiConfig }; function _parseConnectionString() { var fields: any = {}; var connectionString = aiConfig.connectionString; if (connectionString) { var kvPairs = connectionString.split(";"); for (var lp = 0; lp < kvPairs.length; lp++) { var kvParts = kvPairs[lp].split("="); if (kvParts.length === 2) { // only save fields with valid formats fields[kvParts[0][strToLowerCase]()] = kvParts[1]; } } } // apply the default endpoints if (!fields[strIngestionendpoint]) { // use endpoint suffix where overrides are not provided var endpointSuffix = fields.endpointsuffix; // Only fetch the location if a suffix was supplied var fLocation = endpointSuffix ? fields.location : null; fields[strIngestionendpoint] = "https://" + (fLocation ? fLocation + "." : strEmpty) + "dc." + (endpointSuffix || "services.visualstudio.com"); } return fields; } function _sendEvents(evts, endpointUrl) { if (JSON) { var sender = win.fetch; if (sender && !snipConfig.useXhr) { sender(endpointUrl, { method:strPostMethod, body: JSON.stringify(evts), mode:"cors"}); } else if (XMLHttpRequest) { // IE doesn't support fetch and private clouds may only be using IE var xhr = new XMLHttpRequest(); xhr.open(strPostMethod, endpointUrl); xhr.setRequestHeader("Content-type", "application/json"); xhr.send(JSON.stringify(evts)); } } } function _reportFailure(targetSrc) { var conString = _parseConnectionString(); var iKey = conString[strConStringIKey] || aiConfig[strInstrumentationKey] || strEmpty; var ingest = conString[strIngestionendpoint]; var endpointUrl = aiConfig[userOverrideEndpointUrl] ? aiConfig[userOverrideEndpointUrl] : (ingest + "/v2/track"); var message = "SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details)"; var evts = []; evts.push(_createException(iKey, message, targetSrc, endpointUrl)); evts.push(_createInternal(iKey, message, targetSrc, endpointUrl)); _sendEvents(evts, endpointUrl); } // Gets the time as an ISO date format, using a function as IE7/8 doesn't support toISOString function _getTime() { var date = new Date(); function pad(num) { var r = strEmpty + num; if (r.length === 1) { r = "0" + r; } return r; } return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } function _createEnvelope(iKey, theType): any { var tags = {}; var type = "Browser"; tags[strAiDevice + "id"] = type[strToLowerCase](); tags[strAiDevice + "type"] = type; tags[strAiOperationName] = locn && locn.pathname || "_unknown_"; tags[strAiSdkVersion] = "javascript:snippet_" + (appInsights.sv || appInsights.version); return { time: _getTime(), iKey: iKey, name: "Microsoft.ApplicationInsights." + iKey.replace(/-/g, strEmpty) + "." + theType, sampleRate: 100, tags: tags, data: { baseData: { ver: 2 } } }; } function _createInternal(iKey, message, targetSrc, endpointUrl) { var envelope = _createEnvelope(iKey, "Message"); var data = envelope.data; data.baseType = "MessageData"; var baseData = data.baseData; baseData.message = "AI (Internal): 99 message:\"" + (message + " (" + targetSrc + ")").replace(/\"/g, strEmpty) + "\""; baseData.properties = { endpoint: endpointUrl }; return envelope; } function _createException(iKey, message, targetSrc, endpointUrl) { var envelope = _createEnvelope(iKey, "Exception"); var data = envelope.data; data.baseType = "ExceptionData"; data.baseData.exceptions = [{ typeName: "SDKLoadFailed", message: message.replace(/\./g, "-"), // Replacing '.' characters as it causes the portal to hide the start of the message in the summary hasFullStack: false, stack: message + "\nSnippet failed to load [" + targetSrc + "] -- Telemetry is disabled\nHelp Link: " + helpLink + "\nHost: " + (locn && locn.pathname || "_unknown_") + "\nEndpoint: " + endpointUrl, parsedStack: [] }]; return envelope; } // Commented out as we don't want to load from the CDN // ------------------------------------------------------------- // Assigning these to local variables allows them to be minified to save space: // var targetSrc = aiConfig.url || snipConfig.src; // if (targetSrc) { // function _handleError(evt) { // loadFailed = true; // appInsights.queue = []; // Clear the queue // if (!handled) { // handled = true; // _reportFailure(targetSrc); // } // } // function _handleLoad(evt, isAbort) { // if (!handled) { // // IE10, Opera calls loaded before the script is processed. // // so delaying to give the script a chance to be processed // setTimeout(function() { // if (isAbort || !appInsights.core) { // _handleError(); // } // }, 500); // } // } // function _createScript() { // var scriptElement = doc.createElement(scriptText); // scriptElement.src = targetSrc; // // Allocate Cross origin only if defined and available // var crossOrigin = snipConfig[strCrossOrigin]; // if ((crossOrigin || crossOrigin === "") && scriptElement[strCrossOrigin] != strUndefined) { // scriptElement[strCrossOrigin] = crossOrigin; // } // scriptElement.onload = _handleLoad; // scriptElement.onerror = _handleError; // // Some browsers support onload while others onreadystatechange and others both // scriptElement.onreadystatechange = function (evt, isAbort) { // if (scriptElement.readyState === "loaded" || scriptElement.readyState === "complete") { // _handleLoad(evt, isAbort); // } // }; // return scriptElement; // } // var theScript = _createScript(); // if (snipConfig.ld < 0) { // // if user wants to append tag to document head, blocking page load // var headNode = doc.getElementsByTagName("head")[0]; // headNode.appendChild(theScript); // } else { // setTimeout(function () { // // Attempts to place the script tag in the same location as the first script on the page // doc.getElementsByTagName(scriptText)[0].parentNode.appendChild(theScript); // }, snipConfig.ld || 0); // } // } // capture initial cookie try { appInsights.cookie = doc.cookie; } catch (e) { } function _createMethods(methods) { while (methods.length) { (function (name) { // Define a temporary method that queues-up a the real method call appInsights[name] = function () { // Capture the original arguments passed to the method var originalArguments = arguments; if (!loadFailed) { // If we have detected that the main script failed to load then stop queuing events that will never be processed // Queue-up a call to the real method appInsights.queue.push(function () { // Invoke the real method with the captured original arguments appInsights[name].apply(appInsights, originalArguments); }); } }; })(methods.pop()); } } var track = "track"; var trackPage = "TrackPage"; var trackEvent = "TrackEvent"; _createMethods([track + "Event", track + "PageView", track + "Exception", track + "Trace", track + "DependencyData", track + "Metric", track + "PageViewPerformance", "start" + trackPage, "stop" + trackPage, "start" + trackEvent, "stop" + trackEvent, "addTelemetryInitializer", "setAuthenticatedUserContext", "clearAuthenticatedUserContext", "flush"]); // expose SeverityLevel enum appInsights['SeverityLevel'] = { Verbose : 0, Information : 1, Warning : 2, Error : 3, Critical : 4 }; // Collect global errors // Note: ApplicationInsightsAnalytics is the extension string identifier for // AppAnalytics. It is defined in ApplicationInsights.ts:ApplicationInsights.identifer var analyticsCfg = ((aiConfig.extensionConfig || {}).ApplicationInsightsAnalytics ||{}); if (!(aiConfig[strDisableExceptionTracking] === true || analyticsCfg[strDisableExceptionTracking] === true)) { var method = "onerror"; _createMethods(["_" + method]); var originalOnError = win[method]; win[method] = function(message, url, lineNumber, columnNumber, error) { var handled = originalOnError && originalOnError(message, url, lineNumber, columnNumber, error); if (handled !== true) { appInsights["_" + method]({ message: message, url: url, lineNumber: lineNumber, columnNumber: columnNumber, error: error, evt: win.event }); } return handled; }; aiConfig.autoExceptionInstrumented = true; } return appInsights; })(snipConfig.cfg); // global instance must be set in this order to mitigate issues in ie8 and lower // win[aiName] = aiSdk; function _onInit() { if (snipConfig.onInit) { snipConfig.onInit(aiSdk); } } // if somebody calls the snippet twice, don't report page view again if (aiSdk.queue && aiSdk.queue.length === 0) { aiSdk.queue.push(_onInit); // aiSdk.trackPageView({}); } else { // Already loaded so just call the onInit _onInit(); } return aiSdk; } ================================================ FILE: AISKU/Tests/Unit/src/validate.e2e.tests.ts ================================================ import { ApplicationInsights, IApplicationInsights } from '../../../src/applicationinsights-web' import { Sender } from '@microsoft/applicationinsights-channel-js'; import { SinonSpy } from 'sinon'; import { AITestClass, Assert, PollingAssert } from '@microsoft/ai-test-framework'; import { dumpObj } from '@microsoft/applicationinsights-core-js'; import { BreezeChannelIdentifier } from '@microsoft/applicationinsights-core-js'; export class ValidateE2ETests extends AITestClass { private readonly _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11'; private _ai: IApplicationInsights; // Sinon private errorSpy: SinonSpy; private successSpy: SinonSpy; private loggingSpy: SinonSpy; private delay = 100; constructor() { super("ValidateE2ETests"); } public testInitialize() { try { this.useFakeServer = false; const init = new ApplicationInsights({ config: { instrumentationKey: this._instrumentationKey, extensionConfig: { 'AppInsightsChannelPlugin': { maxBatchInterval: 500 }, ["AppInsightsCfgSyncPlugin"]: { cfgUrl: "" } } }, queue: [], version: 2.0 }); this._ai = init.loadAppInsights(); // Setup Sinon stuff const sender: Sender = this._ai.appInsights.core.getPlugin(BreezeChannelIdentifier).plugin; this.errorSpy = this.sandbox.spy(sender, '_onError'); this.successSpy = this.sandbox.spy(sender, '_onSuccess'); this.loggingSpy = this.sandbox.stub(this._ai.appInsights.core.logger, 'throwInternal'); } catch (e) { console.error('Failed to initialize'); } } public testFinishedCleanup(): void { if (this._ai) { this._ai.unload(false); this._ai = null; } } public registerTests() { this.addAsyncTests(); } private addAsyncTests(): void { this.testCase({ name: "Validate track event", test: () => { this._ai.trackTrace({message: "test"}); this._ai.trackTrace({message: "test event"}, { p1: "value 1", p2: "value 2", m1: 123, m2: 456.7 }); return this._asyncQueue() .add(this.waitForResponse()) .add(() => { this.boilerPlateAsserts(); const acceptedItems = this.getPayloadMessages(this.successSpy).length; Assert.equal(2, acceptedItems, "backend should accept two events"); if (acceptedItems != 2) { this.dumpPayloadMessages(this.successSpy); } }); } }); this.testCase({ name: 'E2E.GenericTests: trackEvent sends to backend with NaN value could be handled correctly', test: () => { const customeProperties = { nanValue: NaN, } this._ai.trackEvent({ name: 'event', properties: { "prop1": NaN, "prop2": NaN }}, customeProperties); return this._asyncQueue() .add(this.waitForResponse()) .add(() => { this.boilerPlateAsserts(); const acceptedItems = this.getPayloadMessages(this.successSpy).length; Assert.equal(1, acceptedItems, "backend should accept two events"); if (acceptedItems != 1) { this.dumpPayloadMessages(this.successSpy); } const payloadStr: string[] = this.getPayloadMessages(this.successSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data && data.baseData); Assert.equal(null, data.baseData.measurements["nanValue"]); Assert.equal("NaN", data.baseData.properties["prop1"]); } }); } }); this.testCase({ name: "Validate that track event takes all type of characters", test: () => { const s1 = "شلاؤيثبلاهتنمةىخحضقسفعشلاؤيصثبل"; const s2 = "Ինչու՞ նրանք չեն խոսում Հայերեն"; const s3 = "ওরা কন বাংলা বলেত পাের না"; const s4 = "妣 啊 僜刓嘰塡奬〉媆孿 偁偄偙 偁A偄E偆I偊O偍U"; const s5 = "ßüµ€ÄäÖö€ ερτυθιοπαδφγηξκλζχψωβνΔΦΓΗΞΚΛΨΩΘ რატომ"; const s6 = "йцуукенгшщзхъфываполджэс"; const s7 = "\x0000\x0001\x0002\x0003\x0004\x0005\x0006\x0007\x0008\x009F"; // white spaces this._ai.trackTrace({message: " abcd efg "}, { " abc " : "value 1", " " : "value 2" }); // international characters this._ai.trackTrace({message: s1}, { p: s2 }); this._ai.trackTrace({message: s3}, { p: s4 }); this._ai.trackTrace({message: s5}, { p: s6, p2: s7 }); return this._asyncQueue() .add(this.waitForResponse()) .add(() => { this.boilerPlateAsserts(); let acceptedItems = 0; this.successSpy.args.forEach(call => { call[0].forEach(item => { let message = item; if (typeof item !== "string") { message = item.item; } // Ignore the internal SendBrowserInfoOnUserInit message (Only occurs when running tests in a browser) if (message.indexOf("AI (Internal): 72 ") == -1) { acceptedItems ++; } }); }); Assert.equal(4, acceptedItems, "backend should accept all four events"); if (acceptedItems != 4) { this.dumpPayloadMessages(this.successSpy); } }); } }); this.testCase({ name: "Validate that special characters are handled correctly", test: () => { const s1 = "[]{};,.)(*&^%$#@/\\"; this._ai.trackTrace({message: s1}, { p: s1 }); this._ai.trackTrace({message: "a"}, { "[]{};,.)(*&^%$#@/\\": "b" }); return this._asyncQueue() .add(this.waitForResponse()) .add(() => { this.boilerPlateAsserts(); const acceptedItems = this.getPayloadMessages(this.successSpy).length; Assert.equal(2, acceptedItems, "backend should accept the event"); if (acceptedItems != 2) { this.dumpPayloadMessages(this.successSpy); } }); } }); } private waitForResponse() { return PollingAssert.asyncTaskPollingAssert(() => { return (this.successSpy.called || this.errorSpy.called); }, "Wait for response" + new Date().toISOString(), 15, 1000) as any } private boilerPlateAsserts() { Assert.ok(this.successSpy.called, "success"); Assert.ok(!this.errorSpy.called, "no error sending"); const isValidCallCount = this.loggingSpy.callCount === 0; Assert.ok(isValidCallCount, "logging spy was called 0 time(s)"); if (!isValidCallCount) { while (this.loggingSpy.args.length) { Assert.ok(false, "[warning thrown]: " + dumpObj(this.loggingSpy.args.pop())); } } } } ================================================ FILE: AISKU/Tests/UnitTests.html ================================================  Tests for Application Insights JavaScript AISKU
    ================================================ FILE: AISKU/Tests/es6-module-type-check/package.json ================================================ { "name": "@microsoft/applicationinsights-test-module-type-check", "author": "Microsoft Application Insights Team and Contributors", "version": "3.4.1", "description": "Microsoft Application Insights ES6 Module and Type check Example", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "keywords": [ "example" ], "module": "dist-es5/applicationinsights-test-module-type-check.js", "types": "types/applicationinsights-test-module-type-check.d.ts", "scripts": { "clean": "git clean -xdf", "build": "tsc --project tsconfig.json --noEmit", "rebuild": "npm run build", "test": "", "mintest": "", "perftest": "", "ai-min": "", "ai-restore": "" }, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/AISKU/Tests/es6-module-type-check" }, "license": "MIT", "sideEffects": false, "devDependencies": { "typescript": "^4.9.3" }, "peerDependencies": { "tslib": ">= 1.0.0" }, "dependencies": { "@microsoft/applicationinsights-core-js": "3.4.1", "@microsoft/applicationinsights-web": "3.4.1" } } ================================================ FILE: AISKU/Tests/es6-module-type-check/src/main.ts ================================================ import { ContextTagKeys } from "@microsoft/applicationinsights-core-js"; import { ITelemetryItem } from "@microsoft/applicationinsights-web"; ================================================ FILE: AISKU/Tests/es6-module-type-check/tsconfig.json ================================================ { "compilerOptions": { "module": "commonjs", "target": "es6", "lib": ["es2015", "dom"], "outDir": "./dist", "strictNullChecks": true, "experimentalDecorators": true, "paths": { "tslib": ["./node_modules/tslib/tslib.es6.js"], "tsyringe": ["./node_modules/tsyringe/dist/esm2015"] } }, "include": ["./src/**/*.ts"] } ================================================ FILE: AISKU/Tests/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": false, "module": "amd", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "declaration": true }, "files": [] } ================================================ FILE: AISKU/api-extractor.json ================================================ /** * Config file for API Extractor. For more info, please visit: https://api-extractor.com */ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", /** * Optionally specifies another JSON config file that this file extends from. This provides a way for * standard settings to be shared across multiple projects. * * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be * resolved using NodeJS require(). * * SUPPORTED TOKENS: none * DEFAULT VALUE: "" */ // "extends": "./shared/api-extractor-base.json" // "extends": "my-package/include/api-extractor-base.json" /** * Determines the "" token that can be used with other config file settings. The project folder * typically contains the tsconfig.json and package.json config files, but the path is user-defined. * * The path is resolved relative to the folder of the config file that contains the setting. * * The default value for "projectFolder" is the token "", which means the folder is determined by traversing * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error * will be reported. * * SUPPORTED TOKENS: * DEFAULT VALUE: "" */ "projectFolder": ".", /** * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor * analyzes the symbols exported by this module. * * The file extension must be ".d.ts" and not ".ts". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , */ "mainEntryPointFilePath": "/build/types/applicationinsights-web.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. * * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly * imports library2. To avoid this, we can specify: * * "bundledPackages": [ "library2" ], * * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been * local files for library1. */ "bundledPackages": [ ], /** * Determines how the TypeScript compiler engine will be invoked by API Extractor. */ "compiler": { /** * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * Note: This setting will be ignored if "overrideTsconfig" is used. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/tsconfig.json" */ // "tsconfigFilePath": "/tsconfig.json", /** * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. * The object must conform to the TypeScript tsconfig schema: * * http://json.schemastore.org/tsconfig * * If omitted, then the tsconfig.json file will be read from the "projectFolder". * * DEFAULT VALUE: no overrideTsconfig section */ // "overrideTsconfig": { // . . . // } /** * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. * * DEFAULT VALUE: false */ // "skipLibCheck": true, }, /** * Configures how the API report file (*.api.md) will be generated. */ "apiReport": { /** * (REQUIRED) Whether to generate an API report. */ "enabled": true, /** * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce * a full file path. * * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". * * SUPPORTED TOKENS: , * DEFAULT VALUE: ".api.md" */ "reportFileName": ".api.md", /** * Specifies the folder where the API report file is written. The file name portion is determined by * the "reportFileName" setting. * * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, * e.g. for an API review. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/etc/" */ "reportFolder": "/build/dts/", /** * Specifies the folder where the temporary report file is written. The file name portion is determined by * the "reportFileName" setting. * * After the temporary file is written to disk, it is compared with the file in the "reportFolder". * If they are different, a production build will fail. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/" */ // "reportTempFolder": "/temp/" }, /** * Configures how the doc model file (*.api.json) will be generated. */ "docModel": { /** * (REQUIRED) Whether to generate a doc model file. */ "enabled": true, /** * The output path for the doc model file. The file extension should be ".api.json". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/.api.json" */ "apiJsonFilePath": "/build/dts/.api.json" }, /** * Configures how the .d.ts rollup file will be generated. */ "dtsRollup": { /** * (REQUIRED) Whether to generate the .d.ts rollup file. */ "enabled": true, /** * Specifies the output path for a .d.ts rollup file to be generated without any trimming. * This file will include all declarations that are exported by the main entry point. * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/dist/.d.ts" */ "untrimmedFilePath": "/build/dts/.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. * This file will include only declarations that are marked as "@public" or "@beta". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "betaTrimmedFilePath": "/build/dts/-beta.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. * This file will include only declarations that are marked as "@public". * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "publicTrimmedFilePath": "/build/dts/-public.d.ts", /** * When a declaration is trimmed, by default it will be replaced by a code comment such as * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the * declaration completely. * * DEFAULT VALUE: false */ // "omitTrimmingComments": true }, /** * Configures how the tsdoc-metadata.json file will be generated. */ "tsdocMetadata": { /** * Whether to generate the tsdoc-metadata.json file. * * DEFAULT VALUE: true */ "enabled": false, /** * Specifies where the TSDoc metadata file should be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup * falls back to "tsdoc-metadata.json" in the package folder. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ "tsdocMetadataFilePath": "/build/dts/tsdoc-metadata.json" }, /** * Configures how API Extractor reports error and warning messages produced during analysis. * * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. */ "messages": { /** * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing * the input .d.ts files. * * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "compilerMessageReporting": { /** * Configures the default routing for messages that don't match an explicit rule in this table. */ "default": { /** * Specifies whether the message should be written to the the tool's output log. Note that * the "addToApiReportFile" property may supersede this option. * * Possible values: "error", "warning", "none" * * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes * the "--local" option), the warning is displayed but the build will not fail. * * DEFAULT VALUE: "warning" */ "logLevel": "warning", /** * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), * then the message will be written inside that file; otherwise, the message is instead logged according to * the "logLevel" option. * * DEFAULT VALUE: false */ // "addToApiReportFile": false }, // "TS2551": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . }, /** * Configures handling of messages reported by API Extractor during its analysis. * * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" * * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings */ "extractorMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false }, "ae-missing-release-tag": { "logLevel": "none" }, // // . . . }, /** * Configures handling of messages reported by the TSDoc parser when analyzing code comments. * * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "tsdocMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false } // "tsdoc-link-tag-unescaped-text": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . } } } ================================================ FILE: AISKU/dist-history/aisdk.0.0.13.js ================================================ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ "./amd/bundle/Init.js": /*!****************************!*\ !*** ./amd/bundle/Init.js ***! \****************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-analytics-js */ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js"), __webpack_require__(/*! ./Initialization */ "./amd/bundle/Initialization.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_analytics_js_1, Initialization_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; //should be global function that should load as soon as SDK loads try { // E2E sku on load initializes core and pipeline using snippet as input for configuration var aiName; if (typeof window !== "undefined" && typeof JSON !== "undefined") { // get snippet or initialize to an empty object // get sdk instance name should not conflict if page uses existing sdk for a layer of instrumentation aiName = window["appInsightsSDK"]; if (window[aiName] === undefined) { // if no snippet is present, initialize default values applicationinsights_analytics_js_1.ApplicationInsights.appInsightsDefaultConfig = Initialization_1.Initialization.getDefaultConfig(); } else { if (window[aiName].initialize) { // this is the typical case for browser+snippet var snippet = window[aiName] || {}; // overwrite snippet with full appInsights var initialization = new Initialization_1.Initialization(snippet); var appInsightsLocal = initialization.loadAppInsights(); // apply full appInsights to the global instance that was initialized in the snippet for (var field in appInsightsLocal) { snippet[field] = appInsightsLocal[field]; } // Empty queue of all api calls logged prior to sdk download initialization.emptyQueue(); initialization.addHousekeepingBeforeUnload(appInsightsLocal); } } } } catch (e) { // TODO: Find better place to warn to console when SDK initialization fails if (console) { console.warn('Failed to initialize AppInsights JS SDK for instance ' + aiName + e.message); } } }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./amd/bundle/Initialization.js": /*!**************************************!*\ !*** ./amd/bundle/Initialization.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-analytics-js */ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-channel-js */ "./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js"), __webpack_require__(/*! applicationinsights-properties-js */ "./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js"), __webpack_require__(/*! applicationinsights-dependencies-js */ "./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, applicationinsights_analytics_js_1, applicationinsights_common_1, applicationinsights_channel_js_1, applicationinsights_properties_js_1, applicationinsights_dependencies_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; ; var Initialization = /** @class */ (function () { function Initialization(snippet) { // initialize the queue and config in case they are undefined snippet.queue = snippet.queue || []; var config = snippet.config || {}; // ensure instrumentationKey is specified if (config && !config.instrumentationKey) { config = snippet; applicationinsights_analytics_js_1.ApplicationInsights.Version = "2.0.0"; } this.appInsights = new applicationinsights_analytics_js_1.ApplicationInsights(); // set default values using config passed through snippet config = Initialization.getDefaultConfig(config, this.appInsights.identifier); this.properties = new applicationinsights_properties_js_1.PropertiesPlugin(); this.dependencies = new applicationinsights_dependencies_js_1.AjaxPlugin(); this.snippet = snippet; this.config = config; } // Analytics Plugin Initialization.prototype.trackPageView = function (pageView, customProperties) { this.appInsights.trackPageView(pageView, customProperties); }; Initialization.prototype.trackException = function (exception, customProperties) { this.appInsights.trackException(exception, customProperties); }; Initialization.prototype._onerror = function (exception) { this.appInsights._onerror(exception); }; Initialization.prototype.trackTrace = function (trace, customProperties) { this.appInsights.trackTrace(trace, customProperties); }; Initialization.prototype.trackMetric = function (metric, customProperties) { this.appInsights.trackMetric(metric, customProperties); }; Initialization.prototype.startTrackPage = function (name) { this.appInsights.startTrackPage(name); }; Initialization.prototype.stopTrackPage = function (name, url, customProperties) { this.appInsights.stopTrackPage(name, url, customProperties); }; Initialization.prototype.addTelemetryInitializer = function (telemetryInitializer) { return this.appInsights.addTelemetryInitializer(telemetryInitializer); }; // Properties Plugin Initialization.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) { if (storeInCookie === void 0) { storeInCookie = false; } this.properties.user.setAuthenticatedUserContext(authenticatedUserId, accountId, storeInCookie); }; Initialization.prototype.clearAuthenticatedUserContext = function () { this.properties.user.clearAuthenticatedUserContext(); }; // Dependencies Plugin Initialization.prototype.trackDependencyData = function (dependency, customProperties, systemProperties) { this.dependencies.trackDependencyData(dependency, customProperties, systemProperties); }; Initialization.prototype.loadAppInsights = function () { this.core = new applicationinsights_core_js_1.AppInsightsCore(); var extensions = []; var appInsightsChannel = new applicationinsights_channel_js_1.Sender(); extensions.push(appInsightsChannel); extensions.push(this.properties); extensions.push(this.dependencies); extensions.push(this.appInsights); // initialize core this.core.initialize(this.config, extensions); // initialize extensions this.appInsights.initialize(this.config, this.core, extensions); appInsightsChannel.initialize(this.config, this.core, extensions); return this; }; Initialization.prototype.emptyQueue = function () { // call functions that were queued before the main script was loaded try { if (applicationinsights_common_1.Util.isArray(this.snippet.queue)) { // note: do not check length in the for-loop conditional in case something goes wrong and the stub methods are not overridden. var length = this.snippet.queue.length; for (var i = 0; i < length; i++) { var call = this.snippet.queue[i]; call(); } this.snippet.queue = undefined; delete this.snippet.queue; } } catch (exception) { var properties = {}; if (exception && typeof exception.toString === "function") { properties.exception = exception.toString(); } // need from core // Microsoft.ApplicationInsights._InternalLogging.throwInternal( // LoggingSeverity.WARNING, // _InternalMessageId.FailedToSendQueuedTelemetry, // "Failed to send queued telemetry", // properties); } }; Initialization.prototype.pollInteralLogs = function (appInsightsInstance) { // return setInterval(() => { // var queue: Array<_InternalLogMessage> = ApplicationInsights._InternalLogging.queue; // var length = queue.length; // for (var i = 0; i < length; i++) { // appInsightsInstance.trackTrace(queue[i].message); // } // queue.length = 0; // }, this.config.diagnosticLogInterval); }; Initialization.prototype.addHousekeepingBeforeUnload = function (appInsightsInstance) { // Add callback to push events when the user navigates away if (!appInsightsInstance.appInsights.config.disableFlushOnBeforeUnload && ('onbeforeunload' in window)) { var performHousekeeping = function () { // Adds the ability to flush all data before the page unloads. // Note: This approach tries to push an async request with all the pending events onbeforeunload. // Firefox does not respect this.Other browsers DO push out the call with < 100% hit rate. // Telemetry here will help us analyze how effective this approach is. // Another approach would be to make this call sync with a acceptable timeout to reduce the // impact on user experience. //appInsightsInstance.context._sender.triggerSend(); appInsightsInstance.appInsights.core.getTransmissionControls().forEach(function (queues) { queues.forEach(function (channel) { return channel.flush(true); }); }); // Back up the current session to local storage // This lets us close expired sessions after the cookies themselves expire // Todo: move this against interface behavior if (this.core.extensions["AppInsightsPropertiesPlugin"] && this.core.extensions["AppInsightsPropertiesPlugin"]._sessionManager) { this.core.extensions["AppInsightsPropertiesPlugin"]._sessionManager.backup(); } }; if (!applicationinsights_common_1.Util.addEventHandler('beforeunload', performHousekeeping)) { this.core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedToAddHandlerForOnBeforeUnload, 'Could not add handler for beforeunload'); } } }; Initialization.getDefaultConfig = function (configuration, identifier) { if (!configuration) { configuration = {}; } if (configuration) { identifier = identifier ? identifier : "ApplicationInsightsAnalytics"; } var config = configuration.extensions ? configuration.extensions[identifier] : {}; // set default values configuration.endpointUrl = configuration.endpointUrl || "https://dc.services.visualstudio.com/v2/track"; config.sessionRenewalMs = 30 * 60 * 1000; config.sessionExpirationMs = 24 * 60 * 60 * 1000; config.enableDebug = applicationinsights_common_1.Util.stringToBoolOrDefault(config.enableDebug); config.disableExceptionTracking = applicationinsights_common_1.Util.stringToBoolOrDefault(config.disableExceptionTracking); config.consoleLoggingLevel = config.consoleLoggingLevel || 1; // Show only CRITICAL level config.telemetryLoggingLevel = config.telemetryLoggingLevel || 0; // Send nothing config.diagnosticLogInterval = config.diagnosticLogInterval || 10000; config.autoTrackPageVisitTime = applicationinsights_common_1.Util.stringToBoolOrDefault(config.autoTrackPageVisitTime); if (isNaN(config.samplingPercentage) || config.samplingPercentage <= 0 || config.samplingPercentage >= 100) { config.samplingPercentage = 100; } config.disableAjaxTracking = applicationinsights_common_1.Util.stringToBoolOrDefault(config.disableAjaxTracking); config.maxAjaxCallsPerView = !isNaN(config.maxAjaxCallsPerView) ? config.maxAjaxCallsPerView : 500; config.disableCorrelationHeaders = applicationinsights_common_1.Util.stringToBoolOrDefault(config.disableCorrelationHeaders); config.correlationHeaderExcludedDomains = config.correlationHeaderExcludedDomains || [ "*.blob.core.windows.net", "*.blob.core.chinacloudapi.cn", "*.blob.core.cloudapi.de", "*.blob.core.usgovcloudapi.net" ]; config.disableFlushOnBeforeUnload = applicationinsights_common_1.Util.stringToBoolOrDefault(config.disableFlushOnBeforeUnload); config.isCookieUseDisabled = applicationinsights_common_1.Util.stringToBoolOrDefault(config.isCookieUseDisabled); config.isStorageUseDisabled = applicationinsights_common_1.Util.stringToBoolOrDefault(config.isStorageUseDisabled); config.isBrowserLinkTrackingEnabled = applicationinsights_common_1.Util.stringToBoolOrDefault(config.isBrowserLinkTrackingEnabled); config.enableCorsCorrelation = applicationinsights_common_1.Util.stringToBoolOrDefault(config.enableCorsCorrelation); return configuration; }; return Initialization; }()); exports.Initialization = Initialization; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** * ApplicationInsights.ts * @copyright Microsoft 2018 */ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./Telemetry/PageViewManager */ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1, PageViewManager_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; var durationProperty = "duration"; var ApplicationInsights = /** @class */ (function () { function ApplicationInsights() { this.identifier = "ApplicationInsightsAnalytics"; this.priority = 160; // take from reserved priority range 100- 200 this._isInitialized = false; // Counts number of trackAjax invokations. // By default we only monitor X ajax call per view to avoid too much load. // Default value is set in config. // This counter keeps increasing even after the limit is reached. this._trackAjaxAttempts = 0; this.initialize = this._initialize.bind(this); } ApplicationInsights.prototype.processTelemetry = function (env) { var doNotSendItem = false; try { var telemetryInitializersCount = this._telemetryInitializers.length; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = this._telemetryInitializers[i]; if (telemetryInitializer) { if (telemetryInitializer.apply(null, [env]) === false) { doNotSendItem = true; break; } } } } catch (e) { doNotSendItem = true; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryInitializerFailed, "One of telemetry initializers failed, telemetry item will not be sent: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }, true); } if (!doNotSendItem && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(env); } }; ApplicationInsights.prototype.setNextPlugin = function (next) { this._nextPlugin = next; }; /** * @description Log a diagnostic message * @param {ITraceTelemetry} trace * @param {{[key: string]: any}} [customProperties] * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackTrace = function (trace, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(trace, applicationinsights_common_1.Trace.dataType, applicationinsights_common_1.Trace.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TrackTraceFailed, "trackTrace failed, trace will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * @description Log a numeric value that is not associated with a specific event. Typically * used to send regular reports of performance indicators. To send single measurement, just * use the name and average fields of {@link IMetricTelemetry}. If you take measurements * frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements * and sending the resulting average at intervals * @param {IMetricTelemetry} metric input object argument. Only name and average are mandatory. * @param {{[key: string]: any}} customProperties additional data used to filter metrics in the * portal. Defaults to empty. * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackMetric = function (metric, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(metric, applicationinsights_common_1.Metric.dataType, applicationinsights_common_1.Metric.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackMetricFailed, "trackMetric failed, metric will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs that a page or other item was viewed. * @param IPageViewTelemetry The string you used as the name in startTrackPage. Defaults to the document title. * @param customProperties Additional data used to filter events and metrics. Defaults to empty. If a user wants * to provide a custom duration, it'll have to be in customProperties */ ApplicationInsights.prototype.trackPageView = function (pageView, customProperties) { try { this._pageViewManager.trackPageView(pageView, customProperties); if (this.config.autoTrackPageVisitTime) { this._pageVisitTimeManager.trackPreviousPageVisit(pageView.name, pageView.uri); } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackPVFailed, "trackPageView failed, page view will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Create a page view telemetry item and send it to the SDK pipeline through the core.track API * @param pageView Page view item to be sent * @param properties Custom properties (Part C) that a user can add to the telemetry item * @param systemProperties System level properties (Part A) that a user can add to the telemetry item */ ApplicationInsights.prototype.sendPageViewInternal = function (pageView, properties, systemProperties) { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(pageView, applicationinsights_common_1.PageView.dataType, applicationinsights_common_1.PageView.envelopeType, this._logger, properties, systemProperties); // set instrumentation key this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); // reset ajaxes counter this._trackAjaxAttempts = 0; }; ApplicationInsights.prototype.sendPageViewPerformanceInternal = function (pageViewPerformance, properties) { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(pageViewPerformance, applicationinsights_common_1.PageViewPerformance.dataType, applicationinsights_common_1.PageViewPerformance.envelopeType, this._logger, properties); // set instrumentation key this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); }; /** * Starts timing how long the user views a page or other item. Call this when the page opens. * This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes. * @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title. */ ApplicationInsights.prototype.startTrackPage = function (name) { try { if (typeof name !== "string") { name = window.document && window.document.title || ""; } this._pageTracking.start(name); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.StartTrackFailed, "startTrackPage failed, page view may not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs how long a page or other item was visible, after {@link startTrackPage}. Call this when the page closes. * @param name The string you used as the name in startTrackPage. Defaults to the document title. * @param url A relative or absolute URL that identifies the page or other item. Defaults to the window location. * @param properties Additional data used to filter pages and metrics in the portal. Defaults to empty. * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric */ ApplicationInsights.prototype.stopTrackPage = function (name, url, properties) { try { if (typeof name !== "string") { name = window.document && window.document.title || ""; } if (typeof url !== "string") { url = window.location && window.location.href || ""; } this._pageTracking.stop(name, url, properties); if (this.config.autoTrackPageVisitTime) { this._pageVisitTimeManager.trackPreviousPageVisit(name, url); } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.StopTrackFailed, "stopTrackPage failed, page view will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Log an exception you have caught. * * @param {IExceptionTelemetry} exception Object which contains exception to be sent * @param {{[key: string]: any}} customProperties Additional data used to filter pages and metrics in the portal. Defaults to empty. * * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric. * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackException = function (exception, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(exception, applicationinsights_common_1.Exception.dataType, applicationinsights_common_1.Exception.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackExceptionFailed, "trackException failed, exception will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * @description Custom error handler for Application Insights Analytics * @param {IAutoExceptionTelemetry} exception * @memberof ApplicationInsights */ ApplicationInsights.prototype._onerror = function (exception) { try { var properties = { url: (exception && exception.url) || document.URL, lineNumber: exception.lineNumber, columnNumber: exception.columnNumber, message: exception.message }; if (applicationinsights_common_1.Util.isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception.error)) { this._sendCORSException(properties.url); } else { if (!applicationinsights_common_1.Util.isError(exception.error)) { var stack = "window.onerror@" + properties.url + ":" + exception.lineNumber + ":" + (exception.columnNumber || 0); exception.error = new Error(exception.message); exception.error.stack = stack; } this.trackException({ error: exception.error, severityLevel: applicationinsights_common_1.SeverityLevel.Error }, properties); } } catch (e) { var errorString = exception.error ? (exception.error.name + ", " + exception.error.message) : "null"; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ExceptionWhileLoggingError, "_onError threw exception while logging error, error will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e), errorString: errorString }); } }; ApplicationInsights.prototype.addTelemetryInitializer = function (telemetryInitializer) { this._telemetryInitializers.push(telemetryInitializer); }; ApplicationInsights.prototype._initialize = function (config, core, extensions) { var _this = this; if (this._isInitialized) { return; } if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(core)) { throw Error("Error initializing"); } this.core = core; this._logger = core.logger; this._globalconfig = { instrumentationKey: config.instrumentationKey, endpointUrl: config.endpointUrl }; this.config = config.extensionConfig && config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {}; // load default values if specified var defaults = ApplicationInsights.appInsightsDefaultConfig; if (defaults !== undefined) { if (defaults.extensions && defaults.extensions[this.identifier]) { for (var field in defaults.extensions[this.identifier]) { // for each unspecified field, set the default value if (this.config[field] === undefined) { this.config[field] = defaults[field]; } } } if (this._globalconfig) { for (var field in defaults) { if (this._globalconfig[field] === undefined) { this._globalconfig[field] = defaults[field]; } } } } // Todo: move this out of static state if (this.config.isCookieUseDisabled) { applicationinsights_common_1.Util.disableCookies(); } // Todo: move this out of static state if (this.config.isStorageUseDisabled) { applicationinsights_common_1.Util.disableStorage(); } var configGetters = { instrumentationKey: function () { return config.instrumentationKey; }, accountId: function () { return _this.config.accountId; }, sessionRenewalMs: function () { return _this.config.sessionRenewalMs; }, sessionExpirationMs: function () { return _this.config.sessionExpirationMs; }, sampleRate: function () { return _this.config.samplingPercentage; }, cookieDomain: function () { return _this.config.cookieDomain; }, sdkExtension: function () { return _this.config.sdkExtension; }, isBrowserLinkTrackingEnabled: function () { return _this.config.isBrowserLinkTrackingEnabled; }, appId: function () { return _this.config.appId; } }; this._pageViewManager = new PageViewManager_1.PageViewManager(this, this.config.overridePageViewDuration, this.core); this._telemetryInitializers = []; this._addDefaultTelemetryInitializers(configGetters); // initialize page view timing this._pageTracking = new Timing(this._logger, "trackPageView"); this._pageTracking.action = function (name, url, duration, properties) { var pageViewItem = { name: name, uri: url }; // duration must be a custom property in order for the collector to extract it if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(properties)) { properties = {}; } properties[durationProperty] = duration; _this.sendPageViewInternal(pageViewItem, properties); }; if (this.config.disableExceptionTracking === false && !this.config.autoExceptionsInstrumented) { // We want to enable exception auto collection and it has not been done so yet var onerror_1 = "onerror"; var originalOnError_1 = window[onerror_1]; window.onerror = function (message, url, lineNumber, columnNumber, error) { var handled = originalOnError_1 && originalOnError_1(message, url, lineNumber, columnNumber, error); if (handled !== true) { this._onerror({ message: message, url: url, lineNumber: lineNumber, columnNumber: columnNumber, error: error }); } return handled; }; this.config.autoExceptionsInstrumented = true; } this._isInitialized = true; }; ApplicationInsights.prototype._addDefaultTelemetryInitializers = function (configGetters) { if (!configGetters.isBrowserLinkTrackingEnabled()) { var browserLinkPaths_1 = ['/browserLinkSignalR/', '/__browserLink/']; var dropBrowserLinkRequests = function (envelope) { if (envelope.baseType === applicationinsights_common_1.RemoteDependencyData.dataType) { var remoteData = envelope.baseData; if (remoteData) { for (var i = 0; i < browserLinkPaths_1.length; i++) { if (remoteData.absoluteUrl && remoteData.absoluteUrl.indexOf(browserLinkPaths_1[i]) >= 0) { return false; } } } } return true; }; this._addTelemetryInitializer(dropBrowserLinkRequests); } }; ApplicationInsights.prototype._addTelemetryInitializer = function (telemetryInitializer) { this._telemetryInitializers.push(telemetryInitializer); }; ApplicationInsights.prototype._sendCORSException = function (url) { var exception = { message: "Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.", url: url, lineNumber: 0, columnNumber: 0, error: undefined }; var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(exception, applicationinsights_common_1.Exception.dataType, applicationinsights_common_1.Exception.envelopeType, this._logger, { url: url }); this.core.track(telemetryItem); }; // Mutate telemetryItem inplace to add boilerplate iKey & name info ApplicationInsights.prototype._setTelemetryNameAndIKey = function (telemetryItem) { telemetryItem.instrumentationKey = this._globalconfig.instrumentationKey; var iKeyNoDashes = this._globalconfig.instrumentationKey.replace(/-/g, ""); telemetryItem.name = telemetryItem.name.replace("{0}", iKeyNoDashes); }; ApplicationInsights.Version = "2.0.1-beta"; return ApplicationInsights; }()); exports.ApplicationInsights = ApplicationInsights; /** * Used to record timed events and page views. */ var Timing = /** @class */ (function () { function Timing(logger, name) { this._name = name; this._events = {}; this._logger = logger; } Timing.prototype.start = function (name) { if (typeof this._events[name] !== "undefined") { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StartCalledMoreThanOnce, "start was called more than once for this event without calling stop.", { name: this._name, key: name }, true); } this._events[name] = +new Date; }; Timing.prototype.stop = function (name, url, properties) { var start = this._events[name]; if (isNaN(start)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StopCalledWithoutStart, "stop was called without a corresponding start.", { name: this._name, key: name }, true); } else { var end = +new Date; var duration = applicationinsights_common_1.PageViewPerformance.getDuration(start, end); this.action(name, url, duration, properties); } delete this._events[name]; this._events[name] = undefined; }; return Timing; }()); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ApplicationInsights.js.map /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js ***! \*********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Class encapsulates sending page views and page view performance telemetry. */ var PageViewManager = /** @class */ (function () { function PageViewManager(appInsights, overridePageViewDuration, core) { this.pageViewPerformanceSent = false; this.overridePageViewDuration = false; this.overridePageViewDuration = overridePageViewDuration; this.appInsights = appInsights; if (core) { this._channel = function () { return (core.getTransmissionControls()); }; this._logger = core.logger; } } /** * Currently supported cases: * 1) (default case) track page view called with default parameters, overridePageViewDuration = false. Page view is sent with page view performance when navigation timing data is available. * a. If navigation timing is not supported then page view is sent right away with undefined duration. Page view performance is not sent. * 2) overridePageViewDuration = true, custom duration provided. Custom duration is used, page view sends right away. * 3) overridePageViewDuration = true, custom duration NOT provided. Page view is sent right away, duration is time spent from page load till now (or undefined if navigation timing is not supported). * 4) overridePageViewDuration = false, custom duration is provided. Page view is sent right away with custom duration. * * In all cases page view performance is sent once (only for the 1st call of trackPageView), or not sent if navigation timing is not supported. */ PageViewManager.prototype.trackPageView = function (pageView, customProperties) { var _this = this; var name = pageView.name; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(name) || typeof name !== "string") { pageView.name = window.document && window.document.title || ""; } var uri = pageView.uri; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(uri) || typeof uri !== "string") { pageView.uri = window.location && window.location.href || ""; } // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user // do not provide the duration, set duration to undefined // Also this is case 4 if (!applicationinsights_common_1.PageViewPerformance.isPerformanceTimingSupported()) { this.appInsights.sendPageViewInternal(pageView, customProperties); this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing) this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.NavigationTimingNotSupported, "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info."); return; } var pageViewSent = false; var customDuration = undefined; // if the performance timing is supported by the browser, calculate the custom duration var start = applicationinsights_common_1.PageViewPerformance.getPerformanceTiming().navigationStart; customDuration = applicationinsights_common_1.PageViewPerformance.getDuration(start, +new Date); if (!applicationinsights_common_1.PageViewPerformance.shouldCollectDuration(customDuration)) { customDuration = undefined; } // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier var duration = undefined; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties.duration)) { duration = customProperties.duration; } if (this.overridePageViewDuration || !isNaN(duration)) { if (isNaN(duration)) { // case 3 if (!customProperties) { customProperties = {}; } customProperties["duration"] = customDuration; } // case 2 this.appInsights.sendPageViewInternal(pageView, customProperties); this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); pageViewSent = true; } // now try to send the page view performance telemetry var maxDurationLimit = 60000; if (!customProperties) { customProperties = {}; } var handle = setInterval((function () { try { if (applicationinsights_common_1.PageViewPerformance.isPerformanceTimingDataReady()) { clearInterval(handle); var pageViewPerformance = new applicationinsights_common_1.PageViewPerformance(_this._logger, name, uri, null); if (!pageViewPerformance.getIsValid() && !pageViewSent) { // If navigation timing gives invalid numbers, then go back to "override page view duration" mode. // That's the best value we can get that makes sense. customProperties["duration"] = customDuration; _this.appInsights.sendPageViewInternal(pageView, customProperties); _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } else { if (!pageViewSent) { customProperties["duration"] = pageViewPerformance.getDurationMs(); _this.appInsights.sendPageViewInternal(pageView, customProperties); } if (!_this.pageViewPerformanceSent) { _this.appInsights.sendPageViewPerformanceInternal(pageViewPerformance, customProperties); _this.pageViewPerformanceSent = true; } _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } } else if (applicationinsights_common_1.PageViewPerformance.getDuration(start, +new Date) > maxDurationLimit) { // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready clearInterval(handle); if (!pageViewSent) { customProperties["duration"] = maxDurationLimit; _this.appInsights.sendPageViewInternal(pageView, customProperties); _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } } } catch (e) { _this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackPVFailedCalc, "trackPageView failed on page load calculation: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }), 100); }; return PageViewManager; }()); exports.PageViewManager = PageViewManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewManager.js.map /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./JavaScriptSDK/ApplicationInsights */ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, ApplicationInsights_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApplicationInsights = ApplicationInsights_1.ApplicationInsights; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-analytics-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ContextTagKeys = [ "ai.application.ver", "ai.application.build", "ai.application.typeId", "ai.application.applicationId", "ai.application.layer", "ai.device.id", "ai.device.ip", "ai.device.language", "ai.device.locale", "ai.device.model", "ai.device.friendlyName", "ai.device.network", "ai.device.networkName", "ai.device.oemName", "ai.device.os", "ai.device.osVersion", "ai.device.roleInstance", "ai.device.roleName", "ai.device.screenResolution", "ai.device.type", "ai.device.machineName", "ai.device.vmName", "ai.device.browser", "ai.device.browserVersion", "ai.location.ip", "ai.location.country", "ai.location.province", "ai.location.city", "ai.operation.id", "ai.operation.name", "ai.operation.parentId", "ai.operation.rootId", "ai.operation.syntheticSource", "ai.operation.correlationVector", "ai.session.id", "ai.session.isFirst", "ai.session.isNew", "ai.user.accountAcquisitionDate", "ai.user.accountId", "ai.user.userAgent", "ai.user.id", "ai.user.storeRegion", "ai.user.authUserId", "ai.user.anonUserAcquisitionDate", "ai.user.authUserAcquisitionDate", "ai.cloud.name", "ai.cloud.role", "ai.cloud.roleVer", "ai.cloud.roleInstance", "ai.cloud.environment", "ai.cloud.location", "ai.cloud.deploymentUnit", "ai.internal.sdkVersion", "ai.internal.agentVersion", "ai.internal.nodeName", ]; // these two constants are used to filter out properties not needed when trying to extract custom properties and measurements from the incoming payload var baseType = "baseType"; var baseData = "baseData"; var EnvelopeCreator = /** @class */ (function () { function EnvelopeCreator() { } EnvelopeCreator.extractProperties = function (data) { var customProperties = null; for (var key in data) { if (data.hasOwnProperty(key)) { var value = data[key]; if (typeof value !== "number") { if (!customProperties) { customProperties = {}; } customProperties[key] = value; } } } return customProperties; }; EnvelopeCreator.extractPropsAndMeasurements = function (data, properties, measurements) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(data)) { for (var key in data) { if (data.hasOwnProperty(key)) { var value = data[key]; if (typeof value === "number") { measurements[key] = value; } else { properties[key] = value; } } } } }; // TODO: Do we want this to take logger as arg or use this._logger as nonstatic? EnvelopeCreator.createEnvelope = function (logger, envelopeType, telemetryItem, data) { var envelope = new applicationinsights_common_1.Envelope(logger, data, envelopeType); envelope.iKey = telemetryItem.instrumentationKey; var iKeyNoDashes = telemetryItem.instrumentationKey.replace(/-/g, ""); envelope.name = envelope.name.replace("{0}", iKeyNoDashes); // loop through the envelope ctx (Part A) and pick out the ones that should go in outgoing envelope tags for (var key in telemetryItem.ctx) { if (telemetryItem.ctx.hasOwnProperty(key)) { if (exports.ContextTagKeys.indexOf(key) >= 0) { envelope.tags[key] = telemetryItem.ctx[key]; } } } // loop through the envelope tags (extension of Part A) and pick out the ones that should go in outgoing envelope tags telemetryItem.tags.forEach(function (tag) { for (var key in tag) { if (tag.hasOwnProperty(key)) { if (exports.ContextTagKeys.indexOf(key) >= 0) { envelope.tags[key] = tag[key]; } } } }); return envelope; }; return EnvelopeCreator; }()); exports.EnvelopeCreator = EnvelopeCreator; var DependencyEnvelopeCreator = /** @class */ (function (_super) { __extends(DependencyEnvelopeCreator, _super); function DependencyEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } DependencyEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customMeasurements = {}; var customProperties = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var bd = telemetryItem.baseData; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(bd)) { logger.warnToConsole("Invalid input for dependency data"); return null; } var id = bd.id; var absoluteUrl = bd.absoluteUrl; var command = bd.commandName; var duration = bd.duration; var success = bd.success; var resultCode = bd.resultCode; var method = bd.method; var baseData = new applicationinsights_common_1.RemoteDependencyData(logger, id, absoluteUrl, command, duration, success, resultCode, method, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.RemoteDependencyData.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.RemoteDependencyData.envelopeType, telemetryItem, data); }; DependencyEnvelopeCreator.DependencyEnvelopeCreator = new DependencyEnvelopeCreator(); return DependencyEnvelopeCreator; }(EnvelopeCreator)); exports.DependencyEnvelopeCreator = DependencyEnvelopeCreator; var EventEnvelopeCreator = /** @class */ (function (_super) { __extends(EventEnvelopeCreator, _super); function EventEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } EventEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; if (telemetryItem.baseType !== applicationinsights_common_1.Event.dataType) { EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.baseData, customProperties, customMeasurements); } EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var eventName = telemetryItem.baseData.name; var baseData = new applicationinsights_common_1.Event(logger, eventName, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Event.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Event.envelopeType, telemetryItem, data); }; EventEnvelopeCreator.EventEnvelopeCreator = new EventEnvelopeCreator(); return EventEnvelopeCreator; }(EnvelopeCreator)); exports.EventEnvelopeCreator = EventEnvelopeCreator; var ExceptionEnvelopeCreator = /** @class */ (function (_super) { __extends(ExceptionEnvelopeCreator, _super); function ExceptionEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } ExceptionEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var exception = telemetryItem.baseData.error; var severityLevel = telemetryItem.baseData.severityLevel; var baseData = new applicationinsights_common_1.Exception(logger, exception, customProperties, customMeasurements, severityLevel); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Exception.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Exception.envelopeType, telemetryItem, data); }; ExceptionEnvelopeCreator.ExceptionEnvelopeCreator = new ExceptionEnvelopeCreator(); return ExceptionEnvelopeCreator; }(EnvelopeCreator)); exports.ExceptionEnvelopeCreator = ExceptionEnvelopeCreator; var MetricEnvelopeCreator = /** @class */ (function (_super) { __extends(MetricEnvelopeCreator, _super); function MetricEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } MetricEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = EnvelopeCreator.extractProperties(telemetryItem.data); var name = telemetryItem.baseData.name; var average = telemetryItem.baseData.average; var sampleCount = telemetryItem.baseData.sampleCount; var min = telemetryItem.baseData.min; var max = telemetryItem.baseData.max; var baseData = new applicationinsights_common_1.Metric(logger, name, average, sampleCount, min, max, customProperties); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Metric.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Metric.envelopeType, telemetryItem, data); }; MetricEnvelopeCreator.MetricEnvelopeCreator = new MetricEnvelopeCreator(); return MetricEnvelopeCreator; }(EnvelopeCreator)); exports.MetricEnvelopeCreator = MetricEnvelopeCreator; var PageViewEnvelopeCreator = /** @class */ (function (_super) { __extends(PageViewEnvelopeCreator, _super); function PageViewEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } PageViewEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } // Since duration is not part of the domain properties in Common Schema, extract it from part C var duration = undefined; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.data) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.data.duration)) { duration = telemetryItem.data.duration; delete telemetryItem.data.duration; } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var name = telemetryItem.baseData.name; var url = telemetryItem.baseData.uri; // Todo: move IPageViewTelemetry to common as we are missing type checks on baseData here // refUri is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.refUri)) { customProperties["refUri"] = telemetryItem.baseData.refUri; } // pageType is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.pageType)) { customProperties["pageType"] = telemetryItem.baseData.pageType; } // isLoggedIn is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.isLoggedIn)) { customProperties["isLoggedIn"] = telemetryItem.baseData.isLoggedIn; } // pageTags is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.pageTags)) { var pageTags = telemetryItem.baseData.pageTags; for (var key in pageTags) { if (pageTags.hasOwnProperty(key)) { customProperties[key] = pageTags[key]; } } } var baseData = new applicationinsights_common_1.PageView(logger, name, url, duration, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.PageView.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.PageView.envelopeType, telemetryItem, data); }; PageViewEnvelopeCreator.PageViewEnvelopeCreator = new PageViewEnvelopeCreator(); return PageViewEnvelopeCreator; }(EnvelopeCreator)); exports.PageViewEnvelopeCreator = PageViewEnvelopeCreator; var PageViewPerformanceEnvelopeCreator = /** @class */ (function (_super) { __extends(PageViewPerformanceEnvelopeCreator, _super); function PageViewPerformanceEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } PageViewPerformanceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var name = telemetryItem.baseData.name; var url = telemetryItem.baseData.uri; var duration = telemetryItem.baseData.duration; var baseData = new applicationinsights_common_1.PageViewPerformance(logger, name, url, duration, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.PageViewPerformance.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.PageViewPerformance.envelopeType, telemetryItem, data); }; PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator = new PageViewPerformanceEnvelopeCreator(); return PageViewPerformanceEnvelopeCreator; }(EnvelopeCreator)); exports.PageViewPerformanceEnvelopeCreator = PageViewPerformanceEnvelopeCreator; var TraceEnvelopeCreator = /** @class */ (function (_super) { __extends(TraceEnvelopeCreator, _super); function TraceEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } TraceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var message = telemetryItem.baseData.message; var severityLevel = telemetryItem.baseData.severityLevel; var customProperties = EnvelopeCreator.extractProperties(telemetryItem.data); var baseData = new applicationinsights_common_1.Trace(logger, message, customProperties, severityLevel); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Trace.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Trace.envelopeType, telemetryItem, data); }; TraceEnvelopeCreator.TraceEnvelopeCreator = new TraceEnvelopeCreator(); return TraceEnvelopeCreator; }(EnvelopeCreator)); exports.TraceEnvelopeCreator = TraceEnvelopeCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EnvelopeCreator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js": /*!**************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* * An array based send buffer. */ var ArraySendBuffer = /** @class */ (function () { function ArraySendBuffer(config) { this._config = config; this._buffer = []; } ArraySendBuffer.prototype.enqueue = function (payload) { this._buffer.push(payload); }; ArraySendBuffer.prototype.count = function () { return this._buffer.length; }; ArraySendBuffer.prototype.clear = function () { this._buffer.length = 0; }; ArraySendBuffer.prototype.getItems = function () { return this._buffer.slice(0); }; ArraySendBuffer.prototype.batchPayloads = function (payload) { if (payload && payload.length > 0) { var batch = this._config.emitLineDelimitedJson() ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; ArraySendBuffer.prototype.markAsSent = function (payload) { this.clear(); }; ArraySendBuffer.prototype.clearSent = function (payload) { // not supported }; return ArraySendBuffer; }()); exports.ArraySendBuffer = ArraySendBuffer; /* * Session storege buffer holds a copy of all unsent items in the browser session storage. */ var SessionStorageSendBuffer = /** @class */ (function () { function SessionStorageSendBuffer(logger, config) { this._bufferFullMessageSent = false; this._logger = logger; this._config = config; var bufferItems = this.getBuffer(SessionStorageSendBuffer.BUFFER_KEY); var notDeliveredItems = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); this._buffer = bufferItems.concat(notDeliveredItems); // If the buffer has too many items, drop items from the end. if (this._buffer.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { this._buffer.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } // update DataLossAnalyzer with the number of recovered items // Uncomment if you want to use DataLossanalyzer // DataLossAnalyzer.itemsRestoredFromSessionBuffer = this._buffer.length; this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); } SessionStorageSendBuffer.prototype.enqueue = function (payload) { if (this._buffer.length >= SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // sent internal log only once per page view if (!this._bufferFullMessageSent) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SessionStorageBufferFull, "Maximum buffer size reached: " + this._buffer.length, true); this._bufferFullMessageSent = true; } return; } this._buffer.push(payload); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); }; SessionStorageSendBuffer.prototype.count = function () { return this._buffer.length; }; SessionStorageSendBuffer.prototype.clear = function () { this._buffer.length = 0; this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, []); this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); this._bufferFullMessageSent = false; }; SessionStorageSendBuffer.prototype.getItems = function () { return this._buffer.slice(0); }; SessionStorageSendBuffer.prototype.batchPayloads = function (payload) { if (payload && payload.length > 0) { var batch = this._config.emitLineDelimitedJson() ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; SessionStorageSendBuffer.prototype.markAsSent = function (payload) { this._buffer = this.removePayloadsFromBuffer(payload, this._buffer); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); if (sentElements instanceof Array && payload instanceof Array) { sentElements = sentElements.concat(payload); if (sentElements.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // We send telemetry normally. If the SENT_BUFFER is too big we don't add new elements // until we receive a response from the backend and the buffer has free space again (see clearSent method) this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.SessionStorageBufferFull, "Sent buffer reached its maximum size: " + sentElements.length, true); sentElements.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); } }; SessionStorageSendBuffer.prototype.clearSent = function (payload) { var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); sentElements = this.removePayloadsFromBuffer(payload, sentElements); this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); }; SessionStorageSendBuffer.prototype.removePayloadsFromBuffer = function (payloads, buffer) { var remaining = []; for (var i in buffer) { var contains = false; for (var j in payloads) { if (payloads[j] === buffer[i]) { contains = true; break; } } if (!contains) { remaining.push(buffer[i]); } } ; return remaining; }; SessionStorageSendBuffer.prototype.getBuffer = function (key) { try { var bufferJson = applicationinsights_common_1.Util.getSessionStorage(this._logger, key); if (bufferJson) { var buffer = JSON.parse(bufferJson); if (buffer) { return buffer; } } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedToRestoreStorageBuffer, " storage key: " + key + ", " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } return []; }; SessionStorageSendBuffer.prototype.setBuffer = function (key, buffer) { try { var bufferJson = JSON.stringify(buffer); applicationinsights_common_1.Util.setSessionStorage(this._logger, key, bufferJson); } catch (e) { // if there was an error, clear the buffer // telemetry is stored in the _buffer array so we won't loose any items applicationinsights_common_1.Util.setSessionStorage(this._logger, key, JSON.stringify([])); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedToSetStorageBuffer, " storage key: " + key + ", " + applicationinsights_common_1.Util.getExceptionName(e) + ". Buffer cleared", { exception: applicationinsights_common_1.Util.dump(e) }); } }; SessionStorageSendBuffer.BUFFER_KEY = "AI_buffer"; SessionStorageSendBuffer.SENT_BUFFER_KEY = "AI_sentBuffer"; // Maximum number of payloads stored in the buffer. If the buffer is full, new elements will be dropped. SessionStorageSendBuffer.MAX_BUFFER_SIZE = 2000; return SessionStorageSendBuffer; }()); exports.SessionStorageSendBuffer = SessionStorageSendBuffer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SendBuffer.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Sender.js": /*!**********************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Sender.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./SendBuffer */ "./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js"), __webpack_require__(/*! ./EnvelopeCreator */ "./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js"), __webpack_require__(/*! ./TelemetryValidation/EventValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js"), __webpack_require__(/*! ./TelemetryValidation/TraceValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js"), __webpack_require__(/*! ./TelemetryValidation/ExceptionValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js"), __webpack_require__(/*! ./TelemetryValidation/MetricValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js"), __webpack_require__(/*! ./TelemetryValidation/PageViewPerformanceValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js"), __webpack_require__(/*! ./TelemetryValidation/PageViewValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js"), __webpack_require__(/*! ./TelemetryValidation/RemoteDepdencyValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js"), __webpack_require__(/*! ./Serializer */ "./node_modules/applicationinsights-channel-js/bundle/Serializer.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, SendBuffer_1, EnvelopeCreator_1, EventValidator_1, TraceValidator_1, ExceptionValidator_1, MetricValidator_1, PageViewPerformanceValidator_1, PageViewValidator_1, RemoteDepdencyValidator_1, Serializer_1, applicationinsights_common_1, applicationinsights_core_js_1, applicationinsights_core_js_2) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Sender = /** @class */ (function () { function Sender() { this.priority = 201; /** * Whether XMLHttpRequest object is supported. Older version of IE (8,9) do not support it. */ this._XMLHttpRequestSupported = false; } Sender.prototype.pause = function () { throw new Error("Method not implemented."); }; Sender.prototype.resume = function () { throw new Error("Method not implemented."); }; Sender.prototype.flush = function () { try { this.triggerSend(); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FlushFailed, "flush failed, telemetry will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; Sender.prototype.teardown = function () { throw new Error("Method not implemented."); }; Sender.prototype.initialize = function (config, core, extensions) { this.identifier = "AppInsightsChannelPlugin"; this._logger = core.logger; this._serializer = new Serializer_1.Serializer(core.logger); this._consecutiveErrors = 0; this._retryAt = null; this._lastSend = 0; this._config = Sender._getDefaultAppInsightsChannelConfig(config, this.identifier); this._sender = null; this._buffer = (applicationinsights_common_1.Util.canUseSessionStorage() && this._config.enableSessionStorageBuffer) ? new SendBuffer_1.SessionStorageSendBuffer(this._logger, this._config) : new SendBuffer_1.ArraySendBuffer(this._config); if (!this._config.isBeaconApiDisabled() && applicationinsights_common_1.Util.IsBeaconApiSupported()) { this._sender = this._beaconSender; } else { if (typeof XMLHttpRequest != "undefined") { var testXhr = new XMLHttpRequest(); if ("withCredentials" in testXhr) { this._sender = this._xhrSender; this._XMLHttpRequestSupported = true; } else if (typeof XDomainRequest !== "undefined") { this._sender = this._xdrSender; //IE 8 and 9 } } } }; Sender.prototype.processTelemetry = function (telemetryItem) { try { // if master off switch is set, don't send any data if (this._config.disableTelemetry()) { // Do not send/save data return; } // validate input if (!telemetryItem) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSendEmptyTelemetry, "Cannot send empty telemetry"); return; } // ensure a sender was constructed if (!this._sender) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.SenderNotInitialized, "Sender was not initialized"); return; } // first we need to validate that the envelope passed down is valid var isValid = Sender._validate(telemetryItem); if (!isValid) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "Invalid telemetry envelope"); return; } // construct an envelope that Application Insights endpoint can understand var aiEnvelope = this._constructEnvelope(telemetryItem); if (!aiEnvelope) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CreateEnvelopeError, "Unable to create an AppInsights envelope"); return; } // check if the incoming payload is too large, truncate if necessary var payload = this._serializer.serialize(aiEnvelope); // flush if we would exceed the max-size limit by adding this item var bufferPayload = this._buffer.getItems(); var batch = this._buffer.batchPayloads(bufferPayload); if (batch && (batch.length + payload.length > this._config.maxBatchSizeInBytes())) { this.triggerSend(); } // enqueue the payload this._buffer.enqueue(payload); // ensure an invocation timeout is set this._setupTimer(); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedAddingTelemetryToBuffer, "Failed adding telemetry to the sender's buffer, some telemetry will be lost: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } // hand off the telemetry item to the next plugin if (!applicationinsights_core_js_2.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(telemetryItem); } }; Sender.prototype.setNextPlugin = function (next) { this._nextPlugin = next; }; /** * xhr state changes */ Sender.prototype._xhrReadyStateChange = function (xhr, payload, countOfItemsInPayload) { if (xhr.readyState === 4) { var response = null; if (!this._appId) { response = this._parseResponse(xhr.responseText || xhr.response); if (response && response.appId) { this._appId = response.appId; } } if ((xhr.status < 200 || xhr.status >= 300) && xhr.status !== 0) { if (!this._config.isRetryDisabled() && this._isRetriable(xhr.status)) { this._resendPayload(payload); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Response code " + xhr.status + ". Will retry to send " + payload.length + " items."); } else { this._onError(payload, this._formatErrorMessageXhr(xhr)); } } else { if (xhr.status === 206) { if (!response) { response = this._parseResponse(xhr.responseText || xhr.response); } if (response && !this._config.isRetryDisabled()) { this._onPartialSuccess(payload, response); } else { this._onError(payload, this._formatErrorMessageXhr(xhr)); } } else { this._consecutiveErrors = 0; this._onSuccess(payload, countOfItemsInPayload); } } } }; /** * Immediately send buffered data * @param async {boolean} - Indicates if the events should be sent asynchronously */ Sender.prototype.triggerSend = function (async) { if (async === void 0) { async = true; } try { // Send data only if disableTelemetry is false if (!this._config.disableTelemetry()) { if (this._buffer.count() > 0) { var payload = this._buffer.getItems(); // invoke send this._sender(payload, async); } // update lastSend time to enable throttling this._lastSend = +new Date; } else { this._buffer.clear(); } clearTimeout(this._timeoutHandle); this._timeoutHandle = null; this._retryAt = null; } catch (e) { /* Ignore this error for IE under v10 */ if (!applicationinsights_common_1.Util.getIEVersion() || applicationinsights_common_1.Util.getIEVersion() > 9) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, "Telemetry transmission failed, some telemetry will be lost: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } } }; /** * error handler */ Sender.prototype._onError = function (payload, message, event) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.OnError, "Failed to send telemetry.", { message: message }); this._buffer.clearSent(payload); }; /** * partial success handler */ Sender.prototype._onPartialSuccess = function (payload, results) { var failed = []; var retry = []; // Iterate through the reversed array of errors so that splicing doesn't have invalid indexes after the first item. var errors = results.errors.reverse(); for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) { var error = errors_1[_i]; var extracted = payload.splice(error.index, 1)[0]; if (this._isRetriable(error.statusCode)) { retry.push(extracted); } else { // All other errors, including: 402 (Monthly quota exceeded) and 439 (Too many requests and refresh cache). failed.push(extracted); } } if (payload.length > 0) { this._onSuccess(payload, results.itemsAccepted); } if (failed.length > 0) { this._onError(failed, this._formatErrorMessageXhr(null, ['partial success', results.itemsAccepted, 'of', results.itemsReceived].join(' '))); } if (retry.length > 0) { this._resendPayload(retry); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, "Partial success. " + "Delivered: " + payload.length + ", Failed: " + failed.length + ". Will retry to send " + retry.length + " our of " + results.itemsReceived + " items"); } }; /** * success handler */ Sender.prototype._onSuccess = function (payload, countOfItemsInPayload) { this._buffer.clearSent(payload); }; /** * xdr state changes */ Sender.prototype._xdrOnLoad = function (xdr, payload) { if (xdr && (xdr.responseText + "" === "200" || xdr.responseText === "")) { this._consecutiveErrors = 0; this._onSuccess(payload, 0); } else { var results = this._parseResponse(xdr.responseText); if (results && results.itemsReceived && results.itemsReceived > results.itemsAccepted && !this._config.isRetryDisabled()) { this._onPartialSuccess(payload, results); } else { this._onError(payload, this._formatErrorMessageXdr(xdr)); } } }; Sender.prototype._constructEnvelope = function (envelope) { switch (envelope.baseType) { case applicationinsights_common_1.Event.dataType: return EnvelopeCreator_1.EventEnvelopeCreator.EventEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Trace.dataType: return EnvelopeCreator_1.TraceEnvelopeCreator.TraceEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.PageView.dataType: return EnvelopeCreator_1.PageViewEnvelopeCreator.PageViewEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.PageViewPerformance.dataType: return EnvelopeCreator_1.PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Exception.dataType: return EnvelopeCreator_1.ExceptionEnvelopeCreator.ExceptionEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Metric.dataType: return EnvelopeCreator_1.MetricEnvelopeCreator.MetricEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.RemoteDependencyData.dataType: return EnvelopeCreator_1.DependencyEnvelopeCreator.DependencyEnvelopeCreator.Create(this._logger, envelope); default: // default create custom event type return EnvelopeCreator_1.EventEnvelopeCreator.EventEnvelopeCreator.Create(this._logger, envelope); } }; Sender._getDefaultAppInsightsChannelConfig = function (config, identifier) { var resultConfig = {}; var pluginConfig = config.extensionConfig && config.extensionConfig[identifier] ? config.extensionConfig[identifier] : {}; // set default values resultConfig.endpointUrl = function () { return config.endpointUrl || "https://dc.services.visualstudio.com/v2/track"; }; resultConfig.emitLineDelimitedJson = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.emitLineDelimitedJson); }; resultConfig.maxBatchInterval = function () { return !isNaN(pluginConfig.maxBatchInterval) ? pluginConfig.maxBatchInterval : 15000; }; resultConfig.maxBatchSizeInBytes = function () { return pluginConfig.maxBatchSizeInBytes > 0 ? pluginConfig.maxBatchSizeInBytes : 102400; }; // 100kb resultConfig.disableTelemetry = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.disableTelemetry); }; resultConfig.enableSessionStorageBuffer = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.enableSessionStorageBuffer, true); }; resultConfig.isRetryDisabled = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.isRetryDisabled); }; resultConfig.isBeaconApiDisabled = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.isBeaconApiDisabled, true); }; return resultConfig; }; Sender._validate = function (envelope) { // call the appropriate Validate depending on the baseType switch (envelope.baseType) { case applicationinsights_common_1.Event.dataType: return EventValidator_1.EventValidator.EventValidator.Validate(envelope); case applicationinsights_common_1.Trace.dataType: return TraceValidator_1.TraceValidator.TraceValidator.Validate(envelope); case applicationinsights_common_1.Exception.dataType: return ExceptionValidator_1.ExceptionValidator.ExceptionValidator.Validate(envelope); case applicationinsights_common_1.Metric.dataType: return MetricValidator_1.MetricValidator.MetricValidator.Validate(envelope); case applicationinsights_common_1.PageView.dataType: return PageViewValidator_1.PageViewValidator.PageViewValidator.Validate(envelope); case applicationinsights_common_1.PageViewPerformance.dataType: return PageViewPerformanceValidator_1.PageViewPerformanceValidator.PageViewPerformanceValidator.Validate(envelope); case applicationinsights_common_1.RemoteDependencyData.dataType: return RemoteDepdencyValidator_1.RemoteDepdencyValidator.RemoteDepdencyValidator.Validate(envelope); default: return EventValidator_1.EventValidator.EventValidator.Validate(envelope); } }; /** * Send Beacon API request * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - not used * Note: Beacon API does not support custom headers and we are not able to get * appId from the backend for the correct correlation. */ Sender.prototype._beaconSender = function (payload, isAsync) { var url = this._config.endpointUrl(); var batch = this._buffer.batchPayloads(payload); // Chrome only allows CORS-safelisted values for the sendBeacon data argument // see: https://bugs.chromium.org/p/chromium/issues/detail?id=720283 var plainTextBatch = new Blob([batch], { type: 'text/plain;charset=UTF-8' }); // The sendBeacon method returns true if the user agent is able to successfully queue the data for transfer. Otherwise it returns false. var queued = navigator.sendBeacon(url, plainTextBatch); if (queued) { this._buffer.markAsSent(payload); } else { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Failed to send telemetry with Beacon API."); } }; /** * Send XMLHttpRequest * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - Indicates if the request should be sent asynchronously */ Sender.prototype._xhrSender = function (payload, isAsync) { var _this = this; var xhr = new XMLHttpRequest(); xhr[applicationinsights_common_1.DisabledPropertyName] = true; xhr.open("POST", this._config.endpointUrl(), isAsync); xhr.setRequestHeader("Content-type", "application/json"); // append Sdk-Context request header only in case of breeze endpoint if (applicationinsights_common_1.Util.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.sdkContextHeader, applicationinsights_common_1.RequestHeaders.sdkContextHeaderAppIdRequest); } xhr.onreadystatechange = function () { return _this._xhrReadyStateChange(xhr, payload, payload.length); }; xhr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXhr(xhr), event); }; // compose an array of payloads var batch = this._buffer.batchPayloads(payload); xhr.send(batch); this._buffer.markAsSent(payload); }; /** * Parses the response from the backend. * @param response - XMLHttpRequest or XDomainRequest response */ Sender.prototype._parseResponse = function (response) { try { if (response && response !== "") { var result = JSON.parse(response); if (result && result.itemsReceived && result.itemsReceived >= result.itemsAccepted && result.itemsReceived - result.itemsAccepted == result.errors.length) { return result; } } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.InvalidBackendResponse, "Cannot parse the response. " + applicationinsights_common_1.Util.getExceptionName(e), { response: response }); } return null; }; /** * Resend payload. Adds payload back to the send buffer and setup a send timer (with exponential backoff). * @param payload */ Sender.prototype._resendPayload = function (payload) { if (!payload || payload.length === 0) { return; } this._buffer.clearSent(payload); this._consecutiveErrors++; for (var _i = 0, payload_1 = payload; _i < payload_1.length; _i++) { var item = payload_1[_i]; this._buffer.enqueue(item); } // setup timer this._setRetryTime(); this._setupTimer(); }; /** Calculates the time to wait before retrying in case of an error based on * http://en.wikipedia.org/wiki/Exponential_backoff */ Sender.prototype._setRetryTime = function () { var SlotDelayInSeconds = 10; var delayInSeconds; if (this._consecutiveErrors <= 1) { delayInSeconds = SlotDelayInSeconds; } else { var backOffSlot = (Math.pow(2, this._consecutiveErrors) - 1) / 2; var backOffDelay = Math.floor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1; delayInSeconds = Math.max(Math.min(backOffDelay, 3600), SlotDelayInSeconds); } // TODO: Log the backoff time like the C# version does. var retryAfterTimeSpan = Date.now() + (delayInSeconds * 1000); // TODO: Log the retry at time like the C# version does. this._retryAt = retryAfterTimeSpan; }; /** * Sets up the timer which triggers actually sending the data. */ Sender.prototype._setupTimer = function () { var _this = this; if (!this._timeoutHandle) { var retryInterval = this._retryAt ? Math.max(0, this._retryAt - Date.now()) : 0; var timerValue = Math.max(this._config.maxBatchInterval(), retryInterval); this._timeoutHandle = setTimeout(function () { _this.triggerSend(); }, timerValue); } }; /** * Checks if the SDK should resend the payload after receiving this status code from the backend. * @param statusCode */ Sender.prototype._isRetriable = function (statusCode) { return statusCode == 408 // Timeout || statusCode == 429 // Too many requests. || statusCode == 500 // Internal server error. || statusCode == 503; // Service unavailable. }; Sender.prototype._formatErrorMessageXhr = function (xhr, message) { if (xhr) { return "XMLHttpRequest,Status:" + xhr.status + ",Response:" + xhr.responseText || xhr.response || ""; } return message; }; /** * Send XDomainRequest * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - Indicates if the request should be sent asynchronously * * Note: XDomainRequest does not support sync requests. This 'isAsync' parameter is added * to maintain consistency with the xhrSender's contract * Note: XDomainRequest does not support custom headers and we are not able to get * appId from the backend for the correct correlation. */ Sender.prototype._xdrSender = function (payload, isAsync) { var _this = this; var xdr = new XDomainRequest(); xdr.onload = function () { return _this._xdrOnLoad(xdr, payload); }; xdr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXdr(xdr), event); }; // XDomainRequest requires the same protocol as the hosting page. // If the protocol doesn't match, we can't send the telemetry :(. var hostingProtocol = window.location.protocol; if (this._config.endpointUrl().lastIndexOf(hostingProtocol, 0) !== 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."); this._buffer.clear(); return; } var endpointUrl = this._config.endpointUrl().replace(/^(https?:)/, ""); xdr.open('POST', endpointUrl); // compose an array of payloads var batch = this._buffer.batchPayloads(payload); xdr.send(batch); this._buffer.markAsSent(payload); }; Sender.prototype._formatErrorMessageXdr = function (xdr, message) { if (xdr) { return "XDomainRequest,Response:" + xdr.responseText || ""; } return message; }; return Sender; }()); exports.Sender = Sender; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Sender.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Serializer.js": /*!**************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Serializer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Serializer = /** @class */ (function () { function Serializer(logger) { this._logger = logger; } /** * Serializes the current object to a JSON string. */ Serializer.prototype.serialize = function (input) { var output = this._serializeObject(input, "root"); return JSON.stringify(output); }; Serializer.prototype._serializeObject = function (source, name) { var circularReferenceCheck = "__aiCircularRefCheck"; var output = {}; if (!source) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObject, "cannot serialize object because it is null or undefined", { name: name }, true); return output; } if (source[circularReferenceCheck]) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CircularReferenceDetected, "Circular reference detected while serializing object", { name: name }, true); return output; } if (!source.aiDataContract) { // special case for measurements/properties/tags if (name === "measurements") { output = this._serializeStringMap(source, "number", name); } else if (name === "properties") { output = this._serializeStringMap(source, "string", name); } else if (name === "tags") { output = this._serializeStringMap(source, "string", name); } else if (applicationinsights_common_1.Util.isArray(source)) { output = this._serializeArray(source, name); } else { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObjectNonSerializable, "Attempting to serialize an object which does not implement ISerializable", { name: name }, true); try { // verify that the object can be stringified JSON.stringify(source); output = source; } catch (e) { // if serialization fails return an empty string this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObject, (e && typeof e.toString === 'function') ? e.toString() : "Error serializing object", null, true); } } return output; } source[circularReferenceCheck] = true; for (var field in source.aiDataContract) { var contract = source.aiDataContract[field]; var isRequired = (typeof contract === "function") ? (contract() & applicationinsights_common_1.FieldType.Required) : (contract & applicationinsights_common_1.FieldType.Required); var isHidden = (typeof contract === "function") ? (contract() & applicationinsights_common_1.FieldType.Hidden) : (contract & applicationinsights_common_1.FieldType.Hidden); var isArray = contract & applicationinsights_common_1.FieldType.Array; var isPresent = source[field] !== undefined; var isObject = typeof source[field] === "object" && source[field] !== null; if (isRequired && !isPresent && !isArray) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.MissingRequiredFieldSpecification, "Missing required field specification. The field is required but not present on source", { field: field, name: name }); // If not in debug mode, continue and hope the error is permissible continue; } if (isHidden) { // Don't serialize hidden fields continue; } var value; if (isObject) { if (isArray) { // special case; resurse on each object in the source array value = this._serializeArray(source[field], field); } else { // recurse on the source object in this field value = this._serializeObject(source[field], field); } } else { // assign the source field to the output even if undefined or required value = source[field]; } // only emit this field if the value is defined if (value !== undefined) { output[field] = value; } } delete source[circularReferenceCheck]; return output; }; Serializer.prototype._serializeArray = function (sources, name) { var output = undefined; if (!!sources) { if (!applicationinsights_common_1.Util.isArray(sources)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ItemNotInArray, "This field was specified as an array in the contract but the item is not an array.\r\n", { name: name }, true); } else { output = []; for (var i = 0; i < sources.length; i++) { var source = sources[i]; var item = this._serializeObject(source, name + "[" + i + "]"); output.push(item); } } } return output; }; Serializer.prototype._serializeStringMap = function (map, expectedType, name) { var output = undefined; if (map) { output = {}; for (var field in map) { var value = map[field]; if (expectedType === "string") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else if (!value.toString) { output[field] = "invalid field: toString() is not defined."; } else { output[field] = value.toString(); } } else if (expectedType === "number") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else { var num = parseFloat(value); if (isNaN(num)) { output[field] = "NaN"; } else { output[field] = num; } } } else { output[field] = "invalid field: " + name + " is of unknown type."; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, output[field], null, true); } } } return output; }; return Serializer; }()); exports.Serializer = Serializer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Serializer.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var EventValidator = /** @class */ (function () { function EventValidator() { } EventValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["name"]) { return false; } */ return true; }; EventValidator.EventValidator = new EventValidator(); return EventValidator; }()); exports.EventValidator = EventValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var ExceptionValidator = /** @class */ (function () { function ExceptionValidator() { } ExceptionValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["exceptions"] || !ExceptionValidator._validateExceptions(item.domainProperties["exceptions"])) { return false; } */ return true; }; // TODO implement validation of exceptions ExceptionValidator._validateExceptions = function (exceptions) { // typeName // message // parsedStack // stack // hasFullStack return true; }; ExceptionValidator.ExceptionValidator = new ExceptionValidator(); return ExceptionValidator; }()); exports.ExceptionValidator = ExceptionValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var MetricValidator = /** @class */ (function () { function MetricValidator() { } MetricValidator.prototype.Validate = function (event) { return true; }; MetricValidator.MetricValidator = new MetricValidator(); return MetricValidator; }()); exports.MetricValidator = MetricValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MetricValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js": /*!****************************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js ***! \****************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewPerformanceValidator = /** @class */ (function () { function PageViewPerformanceValidator() { } PageViewPerformanceValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["domProcessing"] || !item.domainProperties["duration"] || !item.domainProperties["name"] || !item.domainProperties["networkConnect"] || !item.domainProperties["perfTotal"] || !item.domainProperties["receivedResponse"] || !item.domainProperties["sentRequest"] || !item.domainProperties["url"]) { return false; } */ return true; }; PageViewPerformanceValidator.PageViewPerformanceValidator = new PageViewPerformanceValidator(); return PageViewPerformanceValidator; }()); exports.PageViewPerformanceValidator = PageViewPerformanceValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerformanceValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewValidator = /** @class */ (function () { function PageViewValidator() { } PageViewValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["id"] || !item.domainProperties["name"] || !item.domainProperties["duration"] || !item.domainProperties["url"]) { return false; } */ return true; }; PageViewValidator.PageViewValidator = new PageViewValidator(); return PageViewValidator; }()); exports.PageViewValidator = PageViewValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RemoteDepdencyValidator = /** @class */ (function () { function RemoteDepdencyValidator() { } RemoteDepdencyValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["id"] || !item.domainProperties["name"] || !item.domainProperties["resultCode"] || !item.domainProperties["duration"] || !item.domainProperties["success"] || !item.domainProperties["data"] || !item.domainProperties["target"] || !item.domainProperties["type"]) { return false; } */ return true; }; RemoteDepdencyValidator.RemoteDepdencyValidator = new RemoteDepdencyValidator(); return RemoteDepdencyValidator; }()); exports.RemoteDepdencyValidator = RemoteDepdencyValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDepdencyValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TraceValidator = /** @class */ (function () { function TraceValidator() { } TraceValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["message"] || !item.domainProperties["severityLevel"]) { return false; } */ return true; }; TraceValidator.TraceValidator = new TraceValidator(); return TraceValidator; }()); exports.TraceValidator = TraceValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=TraceValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js": /*!**********************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js ***! \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Sender */ "./node_modules/applicationinsights-channel-js/bundle/Sender.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Sender_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Sender = Sender_1.Sender; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-channel-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Constants.js": /*!*********************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Constants.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Constants.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Enums.js": /*!*****************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Enums.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Type of storage to differentiate between local storage and session storage */ var StorageType; (function (StorageType) { StorageType[StorageType["LocalStorage"] = 0] = "LocalStorage"; StorageType[StorageType["SessionStorage"] = 1] = "SessionStorage"; })(StorageType = exports.StorageType || (exports.StorageType = {})); /** * Enum is used in aiDataContract to describe how fields are serialized. * For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array */ var FieldType; (function (FieldType) { FieldType[FieldType["Default"] = 0] = "Default"; FieldType[FieldType["Required"] = 1] = "Required"; FieldType[FieldType["Array"] = 2] = "Array"; FieldType[FieldType["Hidden"] = 4] = "Hidden"; })(FieldType = exports.FieldType || (exports.FieldType = {})); ; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Enums.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js": /*!***********************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Data struct to contain only C section with custom fields. */ var Base = /** @class */ (function () { function Base() { } return Base; }()); exports.Base = Base; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Base.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js ***! \*********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED var ContextTagKeys = /** @class */ (function () { function ContextTagKeys() { this.applicationVersion = "ai.application.ver"; this.applicationBuild = "ai.application.build"; this.applicationTypeId = "ai.application.typeId"; this.applicationId = "ai.application.applicationId"; this.applicationLayer = "ai.application.layer"; this.deviceId = "ai.device.id"; this.deviceIp = "ai.device.ip"; this.deviceLanguage = "ai.device.language"; this.deviceLocale = "ai.device.locale"; this.deviceModel = "ai.device.model"; this.deviceFriendlyName = "ai.device.friendlyName"; this.deviceNetwork = "ai.device.network"; this.deviceNetworkName = "ai.device.networkName"; this.deviceOEMName = "ai.device.oemName"; this.deviceOS = "ai.device.os"; this.deviceOSVersion = "ai.device.osVersion"; this.deviceRoleInstance = "ai.device.roleInstance"; this.deviceRoleName = "ai.device.roleName"; this.deviceScreenResolution = "ai.device.screenResolution"; this.deviceType = "ai.device.type"; this.deviceMachineName = "ai.device.machineName"; this.deviceVMName = "ai.device.vmName"; this.deviceBrowser = "ai.device.browser"; this.deviceBrowserVersion = "ai.device.browserVersion"; this.locationIp = "ai.location.ip"; this.locationCountry = "ai.location.country"; this.locationProvince = "ai.location.province"; this.locationCity = "ai.location.city"; this.operationId = "ai.operation.id"; this.operationName = "ai.operation.name"; this.operationParentId = "ai.operation.parentId"; this.operationRootId = "ai.operation.rootId"; this.operationSyntheticSource = "ai.operation.syntheticSource"; this.operationCorrelationVector = "ai.operation.correlationVector"; this.sessionId = "ai.session.id"; this.sessionIsFirst = "ai.session.isFirst"; this.sessionIsNew = "ai.session.isNew"; this.userAccountAcquisitionDate = "ai.user.accountAcquisitionDate"; this.userAccountId = "ai.user.accountId"; this.userAgent = "ai.user.userAgent"; this.userId = "ai.user.id"; this.userStoreRegion = "ai.user.storeRegion"; this.userAuthUserId = "ai.user.authUserId"; this.userAnonymousUserAcquisitionDate = "ai.user.anonUserAcquisitionDate"; this.userAuthenticatedUserAcquisitionDate = "ai.user.authUserAcquisitionDate"; this.cloudName = "ai.cloud.name"; this.cloudRole = "ai.cloud.role"; this.cloudRoleVer = "ai.cloud.roleVer"; this.cloudRoleInstance = "ai.cloud.roleInstance"; this.cloudEnvironment = "ai.cloud.environment"; this.cloudLocation = "ai.cloud.location"; this.cloudDeploymentUnit = "ai.cloud.deploymentUnit"; this.internalSdkVersion = "ai.internal.sdkVersion"; this.internalAgentVersion = "ai.internal.agentVersion"; this.internalNodeName = "ai.internal.nodeName"; } return ContextTagKeys; }()); exports.ContextTagKeys = ContextTagKeys; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ContextTagKeys.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js": /*!***********************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Base */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Base_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Data struct to contain both B and C sections. */ var Data = /** @class */ (function (_super) { __extends(Data, _super); function Data() { return _super.call(this) || this; } return Data; }(Base_1.Base)); exports.Data = Data; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Data.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./DataPointType */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataPointType_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Metric data single measurement. */ var DataPoint = /** @class */ (function () { function DataPoint() { this.kind = DataPointType_1.DataPointType.Measurement; } return DataPoint; }()); exports.DataPoint = DataPoint; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPoint.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED /** * Type of the metric data measurement. */ var DataPointType; (function (DataPointType) { DataPointType[DataPointType["Measurement"] = 0] = "Measurement"; DataPointType[DataPointType["Aggregation"] = 1] = "Aggregation"; })(DataPointType = exports.DataPointType || (exports.DataPointType = {})); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPointType.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js": /*!*************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js ***! \*************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * The abstract common base of all domains. */ var Domain = /** @class */ (function () { function Domain() { } return Domain; }()); exports.Domain = Domain; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Domain.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * System variables for a telemetry item. */ var Envelope = /** @class */ (function () { function Envelope() { this.ver = 1; this.sampleRate = 100.0; this.tags = {}; } return Envelope; }()); exports.Envelope = Envelope; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Envelope.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Instances of Event represent structured event records that can be grouped and searched by their properties. Event data item also creates a metric of event count by name. */ var EventData = /** @class */ (function (_super) { __extends(EventData, _super); function EventData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return EventData; }(Domain_1.Domain)); exports.EventData = EventData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of Exception represents a handled or unhandled exception that occurred during execution of the monitored application. */ var ExceptionData = /** @class */ (function (_super) { __extends(ExceptionData, _super); function ExceptionData() { var _this = _super.call(this) || this; _this.ver = 2; _this.exceptions = []; _this.properties = {}; _this.measurements = {}; return _this; } return ExceptionData; }(Domain_1.Domain)); exports.ExceptionData = ExceptionData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Exception details of the exception in a chain. */ var ExceptionDetails = /** @class */ (function () { function ExceptionDetails() { this.hasFullStack = true; this.parsedStack = []; } return ExceptionDetails; }()); exports.ExceptionDetails = ExceptionDetails; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionDetails.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Instances of Message represent printf-like trace statements that are text-searched. Log4Net, NLog and other text-based log file entries are translated into intances of this type. The message does not have measurements. */ var MessageData = /** @class */ (function (_super) { __extends(MessageData, _super); function MessageData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; return _this; } return MessageData; }(Domain_1.Domain)); exports.MessageData = MessageData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MessageData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of the Metric item is a list of measurements (single data points) and/or aggregations. */ var MetricData = /** @class */ (function (_super) { __extends(MetricData, _super); function MetricData() { var _this = _super.call(this) || this; _this.ver = 2; _this.metrics = []; _this.properties = {}; return _this; } return MetricData; }(Domain_1.Domain)); exports.MetricData = MetricData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MetricData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js ***! \*******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./EventData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView. */ var PageViewData = /** @class */ (function (_super) { __extends(PageViewData, _super); function PageViewData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return PageViewData; }(EventData_1.EventData)); exports.PageViewData = PageViewData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of PageViewPerf represents: a page view with no performance data, a page view with performance data, or just the performance data of an earlier page request. */ var PageViewPerfData = /** @class */ (function (_super) { __extends(PageViewPerfData, _super); function PageViewPerfData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return PageViewPerfData; }(PageViewData_1.PageViewData)); exports.PageViewPerfData = PageViewPerfData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerfData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js": /*!***************************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js ***! \***************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of Remote Dependency represents an interaction of the monitored component with a remote component/service like SQL or an HTTP endpoint. */ var RemoteDependencyData = /** @class */ (function (_super) { __extends(RemoteDependencyData, _super); function RemoteDependencyData() { var _this = _super.call(this) || this; _this.ver = 2; _this.success = true; _this.properties = {}; _this.measurements = {}; return _this; } return RemoteDependencyData; }(Domain_1.Domain)); exports.RemoteDependencyData = RemoteDependencyData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDependencyData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Defines the level of severity for the event. */ var SeverityLevel; (function (SeverityLevel) { SeverityLevel[SeverityLevel["Verbose"] = 0] = "Verbose"; SeverityLevel[SeverityLevel["Information"] = 1] = "Information"; SeverityLevel[SeverityLevel["Warning"] = 2] = "Warning"; SeverityLevel[SeverityLevel["Error"] = 3] = "Error"; SeverityLevel[SeverityLevel["Critical"] = 4] = "Critical"; })(SeverityLevel = exports.SeverityLevel || (exports.SeverityLevel = {})); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SeverityLevel.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED /** * Stack frame information. */ var StackFrame = /** @class */ (function () { function StackFrame() { } return StackFrame; }()); exports.StackFrame = StackFrame; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=StackFrame.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js": /*!**********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RequestHeaders = /** @class */ (function () { function RequestHeaders() { } /** * Request-Context header */ RequestHeaders.requestContextHeader = "Request-Context"; /** * Target instrumentation header that is added to the response and retrieved by the * calling application when processing incoming responses. */ RequestHeaders.requestContextTargetKey = "appId"; /** * Request-Context appId format */ RequestHeaders.requestContextAppIdFormat = "appId=cid-v1:"; /** * Request-Id header */ RequestHeaders.requestIdHeader = "Request-Id"; /** * Sdk-Context header * If this header passed with appId in content then appId will be returned back by the backend. */ RequestHeaders.sdkContextHeader = "Sdk-Context"; /** * String to pass in header for requesting appId back from the backend. */ RequestHeaders.sdkContextHeaderAppIdRequest = "appId"; RequestHeaders.requestContextHeaderLowerCase = "request-context"; return RequestHeaders; }()); exports.RequestHeaders = RequestHeaders; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RequestResponseHeaders.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/Data */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Data_1, Enums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Data = /** @class */ (function (_super) { __extends(Data, _super); /** * Constructs a new instance of telemetry data. */ function Data(type, data) { var _this = _super.call(this) || this; /** * The data contract for serializing this object. */ _this.aiDataContract = { baseType: Enums_1.FieldType.Required, baseData: Enums_1.FieldType.Required }; _this.baseType = type; _this.baseData = data; return _this; } return Data; }(Data_1.Data)); exports.Data = Data; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Data.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/DataPoint */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataPoint_1, Enums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DataPoint = /** @class */ (function (_super) { __extends(DataPoint, _super); function DataPoint() { var _this = _super !== null && _super.apply(this, arguments) || this; /** * The data contract for serializing this object. */ _this.aiDataContract = { name: Enums_1.FieldType.Required, kind: Enums_1.FieldType.Default, value: Enums_1.FieldType.Required, count: Enums_1.FieldType.Default, min: Enums_1.FieldType.Default, max: Enums_1.FieldType.Default, stdDev: Enums_1.FieldType.Default }; return _this; } return DataPoint; }(DataPoint_1.DataPoint)); exports.DataPoint = DataPoint; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPoint.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ../../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DataSanitizer = /** @class */ (function () { function DataSanitizer() { } DataSanitizer.sanitizeKeyAndAddUniqueness = function (logger, key, map) { var origLength = key.length; var field = DataSanitizer.sanitizeKey(logger, key); // validation truncated the length. We need to add uniqueness if (field.length !== origLength) { var i = 0; var uniqueField = field; while (map[uniqueField] !== undefined) { i++; uniqueField = field.substring(0, DataSanitizer.MAX_NAME_LENGTH - 3) + DataSanitizer.padNumber(i); } field = uniqueField; } return field; }; DataSanitizer.sanitizeKey = function (logger, name) { if (name) { // Remove any leading or trailing whitepace name = Util_1.Util.trim(name.toString()); // truncate the string to 150 chars if (name.length > DataSanitizer.MAX_NAME_LENGTH) { name = name.substring(0, DataSanitizer.MAX_NAME_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + DataSanitizer.MAX_NAME_LENGTH + " characters.", { name: name }, true); } } return name; }; DataSanitizer.sanitizeString = function (logger, value, maxLength) { if (maxLength === void 0) { maxLength = DataSanitizer.MAX_STRING_LENGTH; } if (value) { maxLength = maxLength ? maxLength : DataSanitizer.MAX_STRING_LENGTH; // in case default parameters dont work value = Util_1.Util.trim(value); if (value.toString().length > maxLength) { value = value.toString().substring(0, maxLength); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true); } } return value; }; DataSanitizer.sanitizeUrl = function (logger, url) { return DataSanitizer.sanitizeInput(logger, url, DataSanitizer.MAX_URL_LENGTH, applicationinsights_core_js_1._InternalMessageId.UrlTooLong); }; DataSanitizer.sanitizeMessage = function (logger, message) { if (message) { if (message.length > DataSanitizer.MAX_MESSAGE_LENGTH) { message = message.substring(0, DataSanitizer.MAX_MESSAGE_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.MessageTruncated, "message is too long, it has been truncated to " + DataSanitizer.MAX_MESSAGE_LENGTH + " characters.", { message: message }, true); } } return message; }; DataSanitizer.sanitizeException = function (logger, exception) { if (exception) { if (exception.length > DataSanitizer.MAX_EXCEPTION_LENGTH) { exception = exception.substring(0, DataSanitizer.MAX_EXCEPTION_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + DataSanitizer.MAX_EXCEPTION_LENGTH + " characters.", { exception: exception }, true); } } return exception; }; DataSanitizer.sanitizeProperties = function (logger, properties) { if (properties) { var tempProps = {}; for (var prop in properties) { var value = DataSanitizer.sanitizeString(logger, properties[prop], DataSanitizer.MAX_PROPERTY_LENGTH); prop = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, prop, tempProps); tempProps[prop] = value; } properties = tempProps; } return properties; }; DataSanitizer.sanitizeMeasurements = function (logger, measurements) { if (measurements) { var tempMeasurements = {}; for (var measure in measurements) { var value = measurements[measure]; measure = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements); tempMeasurements[measure] = value; } measurements = tempMeasurements; } return measurements; }; DataSanitizer.sanitizeId = function (logger, id) { return id ? DataSanitizer.sanitizeInput(logger, id, DataSanitizer.MAX_ID_LENGTH, applicationinsights_core_js_1._InternalMessageId.IdTooLong).toString() : id; }; DataSanitizer.sanitizeInput = function (logger, input, maxLength, _msgId) { if (input) { input = Util_1.Util.trim(input); if (input.length > maxLength) { input = input.substring(0, maxLength); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true); } } return input; }; DataSanitizer.padNumber = function (num) { var s = "00" + num; return s.substr(s.length - 3); }; /** * Max length allowed for custom names. */ DataSanitizer.MAX_NAME_LENGTH = 150; /** * Max length allowed for Id field in page views. */ DataSanitizer.MAX_ID_LENGTH = 128; /** * Max length allowed for custom values. */ DataSanitizer.MAX_PROPERTY_LENGTH = 8192; /** * Max length allowed for names */ DataSanitizer.MAX_STRING_LENGTH = 1024; /** * Max length allowed for url. */ DataSanitizer.MAX_URL_LENGTH = 2048; /** * Max length allowed for messages. */ DataSanitizer.MAX_MESSAGE_LENGTH = 32768; /** * Max length allowed for exceptions. */ DataSanitizer.MAX_EXCEPTION_LENGTH = 32768; return DataSanitizer; }()); exports.DataSanitizer = DataSanitizer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataSanitizer.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js": /*!*************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/Envelope */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js"), __webpack_require__(/*! ./DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Envelope_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Envelope = /** @class */ (function (_super) { __extends(Envelope, _super); /** * Constructs a new instance of telemetry data. */ function Envelope(logger, data, name) { var _this = _super.call(this) || this; _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.data = data; _this.time = Util_1.Util.toISOStringForIE8(new Date()); _this.aiDataContract = { time: Enums_1.FieldType.Required, iKey: Enums_1.FieldType.Required, name: Enums_1.FieldType.Required, sampleRate: function () { return (_this.sampleRate == 100) ? Enums_1.FieldType.Hidden : Enums_1.FieldType.Required; }, tags: Enums_1.FieldType.Required, data: Enums_1.FieldType.Required }; return _this; } return Envelope; }(Envelope_1.Envelope)); exports.Envelope = Envelope; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Envelope.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Event.js": /*!***************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Event.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/EventData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Event = /** @class */ (function (_super) { __extends(Event, _super); /** * Constructs a new instance of the EventTelemetry object */ function Event(logger, name, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Required, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } Event.envelopeType = "Microsoft.ApplicationInsights.{0}.Event"; Event.dataType = "EventData"; return Event; }(EventData_1.EventData)); exports.Event = Event; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Event.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/StackFrame */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/ExceptionData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/ExceptionDetails */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, StackFrame_1, ExceptionData_1, ExceptionDetails_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Exception = /** @class */ (function (_super) { __extends(Exception, _super); /** * Constructs a new isntance of the ExceptionTelemetry object */ function Exception(logger, exception, properties, measurements, severityLevel) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, exceptions: Enums_1.FieldType.Required, severityLevel: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); _this.exceptions = [new _ExceptionDetails(logger, exception)]; if (severityLevel) { _this.severityLevel = severityLevel; } return _this; } /** * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception. */ Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) { return { exceptions: [ { hasFullStack: true, message: message, stack: details, typeName: typeName } ] }; }; Exception.envelopeType = "Microsoft.ApplicationInsights.{0}.Exception"; Exception.dataType = "ExceptionData"; return Exception; }(ExceptionData_1.ExceptionData)); exports.Exception = Exception; var _ExceptionDetails = /** @class */ (function (_super) { __extends(_ExceptionDetails, _super); function _ExceptionDetails(logger, exception) { var _this = _super.call(this) || this; _this.aiDataContract = { id: Enums_1.FieldType.Default, outerId: Enums_1.FieldType.Default, typeName: Enums_1.FieldType.Required, message: Enums_1.FieldType.Required, hasFullStack: Enums_1.FieldType.Default, stack: Enums_1.FieldType.Default, parsedStack: Enums_1.FieldType.Array }; _this.typeName = DataSanitizer_1.DataSanitizer.sanitizeString(logger, exception.name) || Util_1.Util.NotSpecified; _this.message = DataSanitizer_1.DataSanitizer.sanitizeMessage(logger, exception.message) || Util_1.Util.NotSpecified; var stack = exception["stack"]; _this.parsedStack = _this.parseStack(stack); _this.stack = DataSanitizer_1.DataSanitizer.sanitizeException(logger, stack); _this.hasFullStack = Util_1.Util.isArray(_this.parsedStack) && _this.parsedStack.length > 0; return _this; } _ExceptionDetails.prototype.parseStack = function (stack) { var parsedStack = undefined; if (typeof stack === "string") { var frames = stack.split('\n'); parsedStack = []; var level = 0; var totalSizeInBytes = 0; for (var i = 0; i <= frames.length; i++) { var frame = frames[i]; if (_StackFrame.regex.test(frame)) { var parsedFrame = new _StackFrame(frames[i], level++); totalSizeInBytes += parsedFrame.sizeInBytes; parsedStack.push(parsedFrame); } } // DP Constraint - exception parsed stack must be < 32KB // remove frames from the middle to meet the threshold var exceptionParsedStackThreshold = 32 * 1024; if (totalSizeInBytes > exceptionParsedStackThreshold) { var left = 0; var right = parsedStack.length - 1; var size = 0; var acceptedLeft = left; var acceptedRight = right; while (left < right) { // check size var lSize = parsedStack[left].sizeInBytes; var rSize = parsedStack[right].sizeInBytes; size += lSize + rSize; if (size > exceptionParsedStackThreshold) { // remove extra frames from the middle var howMany = acceptedRight - acceptedLeft + 1; parsedStack.splice(acceptedLeft, howMany); break; } // update pointers acceptedLeft = left; acceptedRight = right; left++; right--; } } } return parsedStack; }; return _ExceptionDetails; }(ExceptionDetails_1.ExceptionDetails)); var _StackFrame = /** @class */ (function (_super) { __extends(_StackFrame, _super); function _StackFrame(frame, level) { var _this = _super.call(this) || this; _this.sizeInBytes = 0; _this.aiDataContract = { level: Enums_1.FieldType.Required, method: Enums_1.FieldType.Required, assembly: Enums_1.FieldType.Default, fileName: Enums_1.FieldType.Default, line: Enums_1.FieldType.Default }; _this.level = level; _this.method = ""; _this.assembly = Util_1.Util.trim(frame); var matches = frame.match(_StackFrame.regex); if (matches && matches.length >= 5) { _this.method = Util_1.Util.trim(matches[2]) || _this.method; _this.fileName = Util_1.Util.trim(matches[4]); _this.line = parseInt(matches[5]) || 0; } _this.sizeInBytes += _this.method.length; _this.sizeInBytes += _this.fileName.length; _this.sizeInBytes += _this.assembly.length; // todo: these might need to be removed depending on how the back-end settles on their size calculation _this.sizeInBytes += _StackFrame.baseSize; _this.sizeInBytes += _this.level.toString().length; _this.sizeInBytes += _this.line.toString().length; return _this; } // regex to match stack frames from ie/chrome/ff // methodName=$2, fileName=$4, lineNo=$5, column=$6 _StackFrame.regex = /^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/; _StackFrame.baseSize = 58; //'{"method":"","level":,"assembly":"","fileName":"","line":}'.length return _StackFrame; }(StackFrame_1.StackFrame)); exports._StackFrame = _StackFrame; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Exception.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js": /*!****************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/MetricData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./Common/DataPoint */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, MetricData_1, DataSanitizer_1, Enums_1, DataPoint_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Metric = /** @class */ (function (_super) { __extends(Metric, _super); /** * Constructs a new instance of the MetricTelemetry object */ function Metric(logger, name, value, count, min, max, properties) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, metrics: Enums_1.FieldType.Required, properties: Enums_1.FieldType.Default }; var dataPoint = new DataPoint_1.DataPoint(); dataPoint.count = count > 0 ? count : undefined; dataPoint.max = isNaN(max) || max === null ? undefined : max; dataPoint.min = isNaN(min) || min === null ? undefined : min; dataPoint.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; dataPoint.value = value; _this.metrics = [dataPoint]; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); return _this; } Metric.envelopeType = "Microsoft.ApplicationInsights.{0}.Metric"; Metric.dataType = "MetricData"; return Metric; }(MetricData_1.MetricData)); exports.Metric = Metric; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Metric.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js": /*!******************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageView = /** @class */ (function (_super) { __extends(PageView, _super); /** * Constructs a new instance of the PageEventTelemetry object */ function PageView(logger, name, url, durationMs, properties, measurements, id) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, url: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default, id: Enums_1.FieldType.Default, }; _this.id = DataSanitizer_1.DataSanitizer.sanitizeId(logger, id); _this.url = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, url); _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; if (!isNaN(durationMs)) { _this.duration = Util_1.Util.msToTimeSpan(durationMs); } _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } PageView.envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview"; PageView.dataType = "PageviewData"; return PageView; }(PageViewData_1.PageViewData)); exports.PageView = PageView; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageView.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/PageViewPerfData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewPerfData_1, Enums_1, DataSanitizer_1, Util_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewPerformance = /** @class */ (function (_super) { __extends(PageViewPerformance, _super); /** * Constructs a new instance of the PageEventTelemetry object */ function PageViewPerformance(logger, name, url, unused, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, url: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, perfTotal: Enums_1.FieldType.Default, networkConnect: Enums_1.FieldType.Default, sentRequest: Enums_1.FieldType.Default, receivedResponse: Enums_1.FieldType.Default, domProcessing: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.isValid = false; /* * http://www.w3.org/TR/navigation-timing/#processing-model * |-navigationStart * | |-connectEnd * | ||-requestStart * | || |-responseStart * | || | |-responseEnd * | || | | * | || | | |-loadEventEnd * |---network---||---request---|---response---|---dom---| * |--------------------------total----------------------| */ var timing = PageViewPerformance.getPerformanceTiming(); if (timing) { var total = PageViewPerformance.getDuration(timing.navigationStart, timing.loadEventEnd); var network = PageViewPerformance.getDuration(timing.navigationStart, timing.connectEnd); var request = PageViewPerformance.getDuration(timing.requestStart, timing.responseStart); var response = PageViewPerformance.getDuration(timing.responseStart, timing.responseEnd); var dom = PageViewPerformance.getDuration(timing.responseEnd, timing.loadEventEnd); if (total == 0) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ErrorPVCalc, "error calculating page view performance.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (!PageViewPerformance.shouldCollectDuration(total, network, request, response, dom)) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.InvalidDurationValue, "Invalid page load duration value. Browser perf data won't be sent.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (total < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(dom)) { // some browsers may report individual components incorrectly so that the sum of the parts will be bigger than total PLT // in this case, don't report client performance from this page logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ClientPerformanceMathError, "client performance math error.", { total: total, network: network, request: request, response: response, dom: dom }); } else { _this.durationMs = total; // convert to timespans _this.perfTotal = _this.duration = Util_1.Util.msToTimeSpan(total); _this.networkConnect = Util_1.Util.msToTimeSpan(network); _this.sentRequest = Util_1.Util.msToTimeSpan(request); _this.receivedResponse = Util_1.Util.msToTimeSpan(response); _this.domProcessing = Util_1.Util.msToTimeSpan(dom); _this.isValid = true; } } _this.url = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, url); _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } /** * Indicates whether this instance of PageViewPerformance is valid and should be sent */ PageViewPerformance.prototype.getIsValid = function () { return this.isValid; }; /** * Gets the total duration (PLT) in milliseconds. Check getIsValid() before using this method. */ PageViewPerformance.prototype.getDurationMs = function () { return this.durationMs; }; PageViewPerformance.getPerformanceTiming = function () { if (PageViewPerformance.isPerformanceTimingSupported()) { return window.performance.timing; } return null; }; /** * Returns true is window performance timing API is supported, false otherwise. */ PageViewPerformance.isPerformanceTimingSupported = function () { return typeof window != "undefined" && window.performance && window.performance.timing; }; /** * As page loads different parts of performance timing numbers get set. When all of them are set we can report it. * Returns true if ready, false otherwise. */ PageViewPerformance.isPerformanceTimingDataReady = function () { var timing = window.performance.timing; return timing.domainLookupStart > 0 && timing.navigationStart > 0 && timing.responseStart > 0 && timing.requestStart > 0 && timing.loadEventEnd > 0 && timing.responseEnd > 0 && timing.connectEnd > 0 && timing.domLoading > 0; }; PageViewPerformance.getDuration = function (start, end) { var duration = undefined; if (!(isNaN(start) || isNaN(end))) { duration = Math.max(end - start, 0); } return duration; }; /** * This method tells if given durations should be excluded from collection. */ PageViewPerformance.shouldCollectDuration = function () { var durations = []; for (var _i = 0; _i < arguments.length; _i++) { durations[_i] = arguments[_i]; } // a full list of Google crawlers user agent strings - https://support.google.com/webmasters/answer/1061943?hl=en var botAgentNames = ['googlebot', 'adsbot-google', 'apis-google', 'mediapartners-google']; var userAgent = navigator.userAgent; var isGoogleBot = false; if (userAgent) { for (var i_1 = 0; i_1 < botAgentNames.length; i_1++) { isGoogleBot = isGoogleBot || userAgent.toLowerCase().indexOf(botAgentNames[i_1]) !== -1; } } if (isGoogleBot) { // Don't report durations for GoogleBot, it is returning invalid values in performance.timing API. return false; } else { // for other page views, don't report if it's outside of a reasonable range for (var i = 0; i < durations.length; i++) { if (durations[i] >= PageViewPerformance.MAX_DURATION_ALLOWED) { return false; } } } return true; }; PageViewPerformance.envelopeType = "Microsoft.ApplicationInsights.{0}.PageviewPerformance"; PageViewPerformance.dataType = "PageviewPerformanceData"; PageViewPerformance.MAX_DURATION_ALLOWED = 3600000; // 1h return PageViewPerformance; }(PageViewPerfData_1.PageViewPerfData)); exports.PageViewPerformance = PageViewPerformance; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerformance.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/RemoteDependencyData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataSanitizer_1, Enums_1, Util_1, Util_2, RemoteDependencyData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RemoteDependencyData = /** @class */ (function (_super) { __extends(RemoteDependencyData, _super); /** * Constructs a new instance of the RemoteDependencyData object */ function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { id: Enums_1.FieldType.Required, ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, resultCode: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, success: Enums_1.FieldType.Default, data: Enums_1.FieldType.Default, target: Enums_1.FieldType.Default, type: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default, kind: Enums_1.FieldType.Default, value: Enums_1.FieldType.Default, count: Enums_1.FieldType.Default, min: Enums_1.FieldType.Default, max: Enums_1.FieldType.Default, stdDev: Enums_1.FieldType.Default, dependencyKind: Enums_1.FieldType.Default, dependencySource: Enums_1.FieldType.Default, commandName: Enums_1.FieldType.Default, dependencyTypeName: Enums_1.FieldType.Default, }; _this.id = id; _this.duration = Util_1.Util.msToTimeSpan(value); _this.success = success; _this.resultCode = resultCode + ""; _this.type = "Ajax"; _this.data = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, commandName); var dependencyFields = Util_2.AjaxHelper.ParseDependencyPath(logger, absoluteUrl, method, commandName); _this.target = dependencyFields.target; _this.name = dependencyFields.name; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } RemoteDependencyData.envelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency"; RemoteDependencyData.dataType = "RemoteDependencyData"; return RemoteDependencyData; }(RemoteDependencyData_1.RemoteDependencyData)); exports.RemoteDependencyData = RemoteDependencyData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDependencyData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js": /*!***************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/MessageData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, MessageData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Trace = /** @class */ (function (_super) { __extends(Trace, _super); /** * Constructs a new instance of the TraceTelemetry object */ function Trace(logger, message, properties, severityLevel) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, message: Enums_1.FieldType.Required, severityLevel: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default }; message = message || Util_1.Util.NotSpecified; _this.message = DataSanitizer_1.DataSanitizer.sanitizeMessage(logger, message); _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); if (severityLevel) { _this.severityLevel = severityLevel; } return _this; } Trace.envelopeType = "Microsoft.ApplicationInsights.{0}.Message"; Trace.dataType = "MessageData"; return Trace; }(MessageData_1.MessageData)); exports.Trace = Trace; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Trace.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js": /*!********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Util_1, DataSanitizer_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TelemetryItemCreator = /** @class */ (function () { function TelemetryItemCreator() { } /** * Create a telemetry item that the 1DS channel understands * @param item domain specific properties; part B * @param baseType telemetry item type. ie PageViewData * @param envelopeName name of the envelope. ie Microsoft.ApplicationInsights..PageView * @param customProperties user defined custom properties; part C * @param systemProperties system properties that are added to the context; part A * @returns ITelemetryItem that is sent to channel */ TelemetryItemCreator.create = function (item, baseType, envelopeName, logger, customProperties, systemProperties) { envelopeName = DataSanitizer_1.DataSanitizer.sanitizeString(logger, envelopeName) || Util_1.Util.NotSpecified; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(item) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(baseType) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(envelopeName)) { throw Error("Input doesn't contain all required fields"); } var telemetryItem = { name: envelopeName, timestamp: new Date(), instrumentationKey: "", ctx: systemProperties ? systemProperties : {}, tags: [], data: {}, baseType: baseType, baseData: item }; // Part C if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties)) { for (var prop in customProperties) { if (customProperties.hasOwnProperty(prop)) { telemetryItem.data[prop] = customProperties[prop]; } } } return telemetryItem; }; return TelemetryItemCreator; }()); exports.TelemetryItemCreator = TelemetryItemCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=TelemetryItemCreator.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Util.js": /*!****************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Util.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./RequestResponseHeaders */ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Enums_1, applicationinsights_core_js_1, RequestResponseHeaders_1, DataSanitizer_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Util = /** @class */ (function () { function Util() { } /* * Force the SDK not to use local and session storage */ Util.disableStorage = function () { Util._canUseLocalStorage = false; Util._canUseSessionStorage = false; }; /** * Gets the localStorage object if available * @return {Storage} - Returns the storage object if available else returns null */ Util._getLocalStorageObject = function () { if (Util.canUseLocalStorage()) { return Util._getVerifiedStorageObject(Enums_1.StorageType.LocalStorage); } return null; }; /** * Tests storage object (localStorage or sessionStorage) to verify that it is usable * More details here: https://mathiasbynens.be/notes/localstorage-pattern * @param storageType Type of storage * @return {Storage} Returns storage object verified that it is usable */ Util._getVerifiedStorageObject = function (storageType) { var storage = null; var fail; var uid; try { uid = new Date; storage = storageType === Enums_1.StorageType.LocalStorage ? window.localStorage : window.sessionStorage; storage.setItem(uid, uid); fail = storage.getItem(uid) != uid; storage.removeItem(uid); if (fail) { storage = null; } } catch (exception) { storage = null; } return storage; }; /** * Checks if endpoint URL is application insights internal injestion service URL. * * @param endpointUrl Endpoint URL to check. * @returns {boolean} True if if endpoint URL is application insights internal injestion service URL. */ Util.isInternalApplicationInsightsEndpoint = function (endpointUrl) { return Util._internalEndpoints.indexOf(endpointUrl.toLowerCase()) !== -1; }; /** * Check if the browser supports local storage. * * @returns {boolean} True if local storage is supported. */ Util.canUseLocalStorage = function () { if (Util._canUseLocalStorage === undefined) { Util._canUseLocalStorage = !!Util._getVerifiedStorageObject(Enums_1.StorageType.LocalStorage); } return Util._canUseLocalStorage; }; /** * Get an object from the browser's local storage * * @param {string} name - the name of the object to get from storage * @returns {string} The contents of the storage object with the given name. Null if storage is not supported. */ Util.getStorage = function (logger, name) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return null; }; /** * Set the contents of an object in the browser's local storage * * @param {string} name - the name of the object to set in storage * @param {string} data - the contents of the object to set in storage * @returns {boolean} True if the storage object could be written. */ Util.setStorage = function (logger, name, data) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Remove an object from the browser's local storage * * @param {string} name - the name of the object to remove from storage * @returns {boolean} True if the storage object could be removed. */ Util.removeStorage = function (logger, name) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { storage.removeItem(name); return true; } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Gets the sessionStorage object if available * @return {Storage} - Returns the storage object if available else returns null */ Util._getSessionStorageObject = function () { if (Util.canUseSessionStorage()) { return Util._getVerifiedStorageObject(Enums_1.StorageType.SessionStorage); } return null; }; /** * Check if the browser supports session storage. * * @returns {boolean} True if session storage is supported. */ Util.canUseSessionStorage = function () { if (Util._canUseSessionStorage === undefined) { Util._canUseSessionStorage = !!Util._getVerifiedStorageObject(Enums_1.StorageType.SessionStorage); } return Util._canUseSessionStorage; }; /** * Gets the list of session storage keys * * @returns {string[]} List of session storage keys */ Util.getSessionStorageKeys = function () { var keys = []; if (Util.canUseSessionStorage()) { for (var key in window.sessionStorage) { keys.push(key); } } return keys; }; /** * Get an object from the browser's session storage * * @param {string} name - the name of the object to get from storage * @returns {string} The contents of the storage object with the given name. Null if storage is not supported. */ Util.getSessionStorage = function (logger, name) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return null; }; /** * Set the contents of an object in the browser's session storage * * @param {string} name - the name of the object to set in storage * @param {string} data - the contents of the object to set in storage * @returns {boolean} True if the storage object could be written. */ Util.setSessionStorage = function (logger, name, data) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Remove an object from the browser's session storage * * @param {string} name - the name of the object to remove from storage * @returns {boolean} True if the storage object could be removed. */ Util.removeSessionStorage = function (logger, name) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { storage.removeItem(name); return true; } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /* * Force the SDK not to store and read any data from cookies */ Util.disableCookies = function () { Util._canUseCookies = false; }; /* * helper method to tell if document.cookie object is available */ Util.canUseCookies = function (logger) { if (Util._canUseCookies === undefined) { Util._canUseCookies = false; try { Util._canUseCookies = Util.document.cookie !== undefined; } catch (e) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CannotAccessCookie, "Cannot access document.cookie - " + Util.getExceptionName(e), { exception: Util.dump(e) }); } ; } return Util._canUseCookies; }; /** * helper method to set userId and sessionId cookie */ Util.setCookie = function (logger, name, value, domain) { var domainAttrib = ""; var secureAttrib = ""; if (domain) { domainAttrib = ";domain=" + domain; } if (Util.document.location && Util.document.location.protocol === "https:") { secureAttrib = ";secure"; } if (Util.canUseCookies(logger)) { Util.document.cookie = name + "=" + value + domainAttrib + ";path=/" + secureAttrib; } }; Util.stringToBoolOrDefault = function (str, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } if (str === undefined || str === null) { return defaultValue; } return str.toString().toLowerCase() === "true"; }; /** * helper method to access userId and sessionId cookie */ Util.getCookie = function (logger, name) { if (!Util.canUseCookies(logger)) { return; } var value = ""; if (name && name.length) { var cookieName = name + "="; var cookies = Util.document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; cookie = Util.trim(cookie); if (cookie && cookie.indexOf(cookieName) === 0) { value = cookie.substring(cookieName.length, cookies[i].length); break; } } } return value; }; /** * Deletes a cookie by setting it's expiration time in the past. * @param name - The name of the cookie to delete. */ Util.deleteCookie = function (logger, name) { if (Util.canUseCookies(logger)) { // Setting the expiration date in the past immediately removes the cookie Util.document.cookie = name + "=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;"; } }; /** * helper method to trim strings (IE8 does not implement String.prototype.trim) */ Util.trim = function (str) { if (typeof str !== "string") return str; return str.replace(/^\s+|\s+$/g, ""); }; /** * generate random id string */ Util.newId = function () { var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var result = ""; var random = Math.random() * 1073741824; //5 symbols in base64, almost maxint while (random > 0) { var char = base64chars.charAt(random % 64); result += char; random = Math.floor(random / 64); } return result; }; /** * Check if an object is of type Array */ Util.isArray = function (obj) { return Object.prototype.toString.call(obj) === "[object Array]"; }; /** * Check if an object is of type Error */ Util.isError = function (obj) { return Object.prototype.toString.call(obj) === "[object Error]"; }; /** * Check if an object is of type Date */ Util.isDate = function (obj) { return Object.prototype.toString.call(obj) === "[object Date]"; }; /** * Convert a date to I.S.O. format in IE8 */ Util.toISOStringForIE8 = function (date) { if (Util.isDate(date)) { if (Date.prototype.toISOString) { return date.toISOString(); } else { var pad = function (number) { var r = String(number); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } }; /** * Gets IE version if we are running on IE, or null otherwise */ Util.getIEVersion = function (userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } var myNav = userAgentStr ? userAgentStr.toLowerCase() : navigator.userAgent.toLowerCase(); return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : null; }; /** * Convert ms to c# time span format */ Util.msToTimeSpan = function (totalms) { if (isNaN(totalms) || totalms < 0) { totalms = 0; } totalms = Math.round(totalms); var ms = "" + totalms % 1000; var sec = "" + Math.floor(totalms / 1000) % 60; var min = "" + Math.floor(totalms / (1000 * 60)) % 60; var hour = "" + Math.floor(totalms / (1000 * 60 * 60)) % 24; var days = Math.floor(totalms / (1000 * 60 * 60 * 24)); ms = ms.length === 1 ? "00" + ms : ms.length === 2 ? "0" + ms : ms; sec = sec.length < 2 ? "0" + sec : sec; min = min.length < 2 ? "0" + min : min; hour = hour.length < 2 ? "0" + hour : hour; return (days > 0 ? days + "." : "") + hour + ":" + min + ":" + sec + "." + ms; }; /** * Checks if error has no meaningful data inside. Ususally such errors are received by window.onerror when error * happens in a script from other domain (cross origin, CORS). */ Util.isCrossOriginError = function (message, url, lineNumber, columnNumber, error) { return (message === "Script error." || message === "Script error") && !error; }; /** * Returns string representation of an object suitable for diagnostics logging. */ Util.dump = function (object) { var objectTypeDump = Object.prototype.toString.call(object); var propertyValueDump = JSON.stringify(object); if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } return objectTypeDump + propertyValueDump; }; /** * Returns the name of object if it's an Error. Otherwise, returns empty string. */ Util.getExceptionName = function (object) { var objectTypeDump = Object.prototype.toString.call(object); if (objectTypeDump === "[object Error]") { return object.name; } return ""; }; /** * Adds an event handler for the specified event * @param eventName {string} - The name of the event * @param callback {any} - The callback function that needs to be executed for the given event * @return {boolean} - true if the handler was successfully added */ Util.addEventHandler = function (eventName, callback) { if (!window || typeof eventName !== 'string' || typeof callback !== 'function') { return false; } // Create verb for the event var verbEventName = 'on' + eventName; // check if addEventListener is available if (window.addEventListener) { window.addEventListener(eventName, callback, false); } else if (window["attachEvent"]) { window["attachEvent"](verbEventName, callback); } else { return false; } return true; }; /** * Tells if a browser supports a Beacon API */ Util.IsBeaconApiSupported = function () { return ('sendBeacon' in navigator && navigator.sendBeacon); }; Util.document = typeof document !== "undefined" ? document : {}; Util._canUseCookies = undefined; Util._canUseLocalStorage = undefined; Util._canUseSessionStorage = undefined; // listing only non-geo specific locations Util._internalEndpoints = [ "https://dc.services.visualstudio.com/v2/track", "https://breeze.aimon.applicationinsights.io/v2/track", "https://dc-int.services.visualstudio.com/v2/track" ]; Util.NotSpecified = "not_specified"; return Util; }()); exports.Util = Util; var UrlHelper = /** @class */ (function () { function UrlHelper() { } UrlHelper.parseUrl = function (url) { if (!UrlHelper.htmlAnchorElement) { UrlHelper.htmlAnchorElement = !!UrlHelper.document.createElement ? UrlHelper.document.createElement('a') : {}; } UrlHelper.htmlAnchorElement.href = url; return UrlHelper.htmlAnchorElement; }; UrlHelper.getAbsoluteUrl = function (url) { var result; var a = UrlHelper.parseUrl(url); if (a) { result = a.href; } return result; }; UrlHelper.getPathName = function (url) { var result; var a = UrlHelper.parseUrl(url); if (a) { result = a.pathname; } return result; }; UrlHelper.getCompleteUrl = function (method, absoluteUrl) { if (method) { return method.toUpperCase() + " " + absoluteUrl; } else { return absoluteUrl; } }; UrlHelper.document = typeof document !== "undefined" ? document : {}; return UrlHelper; }()); exports.UrlHelper = UrlHelper; var CorrelationIdHelper = /** @class */ (function () { function CorrelationIdHelper() { } /** * Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers */ CorrelationIdHelper.canIncludeCorrelationHeader = function (config, requestUrl, currentHost) { if (config && config.disableCorrelationHeaders) { return false; } if (!requestUrl) { return false; } var requestHost = UrlHelper.parseUrl(requestUrl).host.toLowerCase(); if ((!config || !config.enableCorsCorrelation) && requestHost !== currentHost) { return false; } var excludedDomains = config && config.correlationHeaderExcludedDomains; if (!excludedDomains || excludedDomains.length == 0) { return true; } for (var i = 0; i < excludedDomains.length; i++) { var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\./g, "\.").replace(/\*/g, ".*")); if (regex.test(requestHost)) { return false; } } return true; }; /** * Combines target appId and target role name from response header. */ CorrelationIdHelper.getCorrelationContext = function (responseHeader) { if (responseHeader) { var correlationId = CorrelationIdHelper.getCorrelationContextValue(responseHeader, RequestResponseHeaders_1.RequestHeaders.requestContextTargetKey); if (correlationId && correlationId !== CorrelationIdHelper.correlationIdPrefix) { return correlationId; } } }; /** * Gets key from correlation response header */ CorrelationIdHelper.getCorrelationContextValue = function (responseHeader, key) { if (responseHeader) { var keyValues = responseHeader.split(","); for (var i = 0; i < keyValues.length; ++i) { var keyValue = keyValues[i].split("="); if (keyValue.length == 2 && keyValue[0] == key) { return keyValue[1]; } } } }; CorrelationIdHelper.correlationIdPrefix = "cid-v1:"; return CorrelationIdHelper; }()); exports.CorrelationIdHelper = CorrelationIdHelper; var AjaxHelper = /** @class */ (function () { function AjaxHelper() { } AjaxHelper.ParseDependencyPath = function (logger, absoluteUrl, method, pathName) { var target, name; if (absoluteUrl && absoluteUrl.length > 0) { var parsedUrl = UrlHelper.parseUrl(absoluteUrl); target = parsedUrl.host; if (parsedUrl.pathname != null) { var pathName = (parsedUrl.pathname.length === 0) ? "/" : parsedUrl.pathname; if (pathName.charAt(0) !== '/') { pathName = "/" + pathName; } name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, method ? method + " " + pathName : pathName); } else { name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, absoluteUrl); } } else { target = pathName; name = pathName; } return { target: target, name: name }; }; return AjaxHelper; }()); exports.AjaxHelper = AjaxHelper; /** * A utility class that helps getting time related parameters */ var DateTimeUtils = /** @class */ (function () { function DateTimeUtils() { } /** * Get the number of milliseconds since 1970/01/01 in local timezone */ DateTimeUtils.Now = (window.performance && window.performance.now && window.performance.timing) ? function () { return window.performance.now() + window.performance.timing.navigationStart; } : function () { return new Date().getTime(); }; /** * Gets duration between two timestamps */ DateTimeUtils.GetDuration = function (start, end) { var result = null; if (start !== 0 && end !== 0 && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(start) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(end)) { result = end - start; } return result; }; return DateTimeUtils; }()); exports.DateTimeUtils = DateTimeUtils; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Util.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/applicationinsights-common.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ./Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./RequestResponseHeaders */ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js"), __webpack_require__(/*! ./Constants */ "./node_modules/applicationinsights-common/bundle/Constants.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/Data */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/Base */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js"), __webpack_require__(/*! ./Telemetry/Common/Envelope */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js"), __webpack_require__(/*! ./Telemetry/Event */ "./node_modules/applicationinsights-common/bundle/Telemetry/Event.js"), __webpack_require__(/*! ./Telemetry/Exception */ "./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js"), __webpack_require__(/*! ./Telemetry/Metric */ "./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js"), __webpack_require__(/*! ./Telemetry/PageView */ "./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js"), __webpack_require__(/*! ./Telemetry/RemoteDependencyData */ "./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js"), __webpack_require__(/*! ./Telemetry/Trace */ "./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js"), __webpack_require__(/*! ./Telemetry/PageViewPerformance */ "./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js"), __webpack_require__(/*! ./Telemetry/Common/Data */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/SeverityLevel */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/ContextTagKeys */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ./TelemetryItemCreator */ "./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Util_1, Enums_1, RequestResponseHeaders_1, Constants_1, Data_1, Base_1, Envelope_1, Event_1, Exception_1, Metric_1, PageView_1, PageViewData_1, RemoteDependencyData_1, Trace_1, PageViewPerformance_1, Data_2, SeverityLevel_1, ContextTagKeys_1, DataSanitizer_1, TelemetryItemCreator_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Util = Util_1.Util; exports.CorrelationIdHelper = Util_1.CorrelationIdHelper; exports.UrlHelper = Util_1.UrlHelper; exports.DateTimeUtils = Util_1.DateTimeUtils; exports.FieldType = Enums_1.FieldType; exports.RequestHeaders = RequestResponseHeaders_1.RequestHeaders; exports.DisabledPropertyName = Constants_1.DisabledPropertyName; exports.AIData = Data_1.Data; exports.AIBase = Base_1.Base; exports.Envelope = Envelope_1.Envelope; exports.Event = Event_1.Event; exports.Exception = Exception_1.Exception; exports.Metric = Metric_1.Metric; exports.PageView = PageView_1.PageView; exports.PageViewData = PageViewData_1.PageViewData; exports.RemoteDependencyData = RemoteDependencyData_1.RemoteDependencyData; exports.Trace = Trace_1.Trace; exports.PageViewPerformance = PageViewPerformance_1.PageViewPerformance; exports.Data = Data_2.Data; exports.SeverityLevel = SeverityLevel_1.SeverityLevel; exports.ContextTagKeys = ContextTagKeys_1.ContextTagKeys; exports.DataSanitizer = DataSanitizer_1.DataSanitizer; exports.TelemetryItemCreator = TelemetryItemCreator_1.TelemetryItemCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-common.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event. */ exports.EventsDiscardedReason = { /** * Unknown. */ Unknown: 0, /** * Status set to non-retryable. */ NonRetryableStatus: 1, /** * The event is invalid. */ InvalidEvent: 2, /** * The size of the event is too large. */ SizeLimitExceeded: 3, /** * The server is not accepting events from this instrumentation key. */ KillSwitch: 4, /** * The event queue is full. */ QueueFull: 5, }; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventsDiscardedReason.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js": /*!*********************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js ***! \*********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var LoggingSeverity; (function (LoggingSeverity) { /** * Error will be sent as internal telemetry */ LoggingSeverity[LoggingSeverity["CRITICAL"] = 1] = "CRITICAL"; /** * Error will NOT be sent as internal telemetry, and will only be shown in browser console */ LoggingSeverity[LoggingSeverity["WARNING"] = 2] = "WARNING"; })(LoggingSeverity = exports.LoggingSeverity || (exports.LoggingSeverity = {})); /** * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered */ ; exports._InternalMessageId = { // Non user actionable BrowserDoesNotSupportLocalStorage: 0, BrowserCannotReadLocalStorage: 1, BrowserCannotReadSessionStorage: 2, BrowserCannotWriteLocalStorage: 3, BrowserCannotWriteSessionStorage: 4, BrowserFailedRemovalFromLocalStorage: 5, BrowserFailedRemovalFromSessionStorage: 6, CannotSendEmptyTelemetry: 7, ClientPerformanceMathError: 8, ErrorParsingAISessionCookie: 9, ErrorPVCalc: 10, ExceptionWhileLoggingError: 11, FailedAddingTelemetryToBuffer: 12, FailedMonitorAjaxAbort: 13, FailedMonitorAjaxDur: 14, FailedMonitorAjaxOpen: 15, FailedMonitorAjaxRSC: 16, FailedMonitorAjaxSend: 17, FailedMonitorAjaxGetCorrelationHeader: 18, FailedToAddHandlerForOnBeforeUnload: 19, FailedToSendQueuedTelemetry: 20, FailedToReportDataLoss: 21, FlushFailed: 22, MessageLimitPerPVExceeded: 23, MissingRequiredFieldSpecification: 24, NavigationTimingNotSupported: 25, OnError: 26, SessionRenewalDateIsZero: 27, SenderNotInitialized: 28, StartTrackEventFailed: 29, StopTrackEventFailed: 30, StartTrackFailed: 31, StopTrackFailed: 32, TelemetrySampledAndNotSent: 33, TrackEventFailed: 34, TrackExceptionFailed: 35, TrackMetricFailed: 36, TrackPVFailed: 37, TrackPVFailedCalc: 38, TrackTraceFailed: 39, TransmissionFailed: 40, FailedToSetStorageBuffer: 41, FailedToRestoreStorageBuffer: 42, InvalidBackendResponse: 43, FailedToFixDepricatedValues: 44, InvalidDurationValue: 45, TelemetryEnvelopeInvalid: 46, CreateEnvelopeError: 47, // User actionable CannotSerializeObject: 48, CannotSerializeObjectNonSerializable: 49, CircularReferenceDetected: 50, ClearAuthContextFailed: 51, ExceptionTruncated: 52, IllegalCharsInName: 53, ItemNotInArray: 54, MaxAjaxPerPVExceeded: 55, MessageTruncated: 56, NameTooLong: 57, SampleRateOutOfRange: 58, SetAuthContextFailed: 59, SetAuthContextFailedAccountName: 60, StringValueTooLong: 61, StartCalledMoreThanOnce: 62, StopCalledWithoutStart: 63, TelemetryInitializerFailed: 64, TrackArgumentsNotSpecified: 65, UrlTooLong: 66, SessionStorageBufferFull: 67, CannotAccessCookie: 68, IdTooLong: 69, }; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=LoggingEnums.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MinChannelPriorty = 100; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=IChannelControls.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../JavaScriptSDK.Enums/EventsDiscardedReason */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js"), __webpack_require__(/*! ./CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js"), __webpack_require__(/*! ./NotificationManager */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js"), __webpack_require__(/*! ./DiagnosticLogger */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventsDiscardedReason_1, CoreUtils_1, NotificationManager_1, DiagnosticLogger_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; var AppInsightsCore = /** @class */ (function () { function AppInsightsCore() { this._isInitialized = false; this._extensions = new Array(); this._channelController = new ChannelController(); } AppInsightsCore.prototype.initialize = function (config, extensions) { var _this = this; // Make sure core is only initialized once if (this._isInitialized) { throw Error("Core should not be initialized more than once"); } if (!config || CoreUtils_1.CoreUtils.isNullOrUndefined(config.instrumentationKey)) { throw Error("Please provide instrumentation key"); } this.config = config; this._notificationManager = new NotificationManager_1.NotificationManager(); this.config.extensions = CoreUtils_1.CoreUtils.isNullOrUndefined(this.config.extensions) ? [] : this.config.extensions; // add notification to the extensions in the config so other plugins can access it this.config.extensionConfig = CoreUtils_1.CoreUtils.isNullOrUndefined(this.config.extensionConfig) ? {} : this.config.extensionConfig; this.config.extensionConfig.NotificationManager = this._notificationManager; this.logger = new DiagnosticLogger_1.DiagnosticLogger(config); // Initial validation extensions.forEach(function (extension) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(extension.initialize)) { throw Error(validationError); } }); if (this.config.extensions.length > 0) { var isValid_1 = true; this.config.extensions.forEach(function (item) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(item)) { isValid_1 = false; } }); if (!isValid_1) { throw Error(validationError); } } // Initial validation complete // Concat all available extensions before sorting by priority (_a = this._extensions).push.apply(_a, [this._channelController].concat(extensions, this.config.extensions)); this._extensions = this._extensions.sort(function (a, b) { var extA = a; var extB = b; var typeExtA = typeof extA.processTelemetry; var typeExtB = typeof extB.processTelemetry; if (typeExtA === 'function' && typeExtB === 'function') { return extA.priority - extB.priority; } if (typeExtA === 'function' && typeExtB !== 'function') { // keep non telemetryplugin specific extensions at start return 1; } if (typeExtA !== 'function' && typeExtB === 'function') { return -1; } }); // sort complete // Check if any two extensions have the same priority, then warn to console var priority = {}; this._extensions.forEach(function (ext) { var t = ext; if (t && t.priority) { if (!CoreUtils_1.CoreUtils.isNullOrUndefined(priority[t.priority])) { _this.logger.warnToConsole("Two extensions have same priority" + priority[t.priority] + ", " + t.identifier); } else { priority[t.priority] = t.identifier; // set a value } } }); // initialize plugins including channel controller this._extensions.forEach(function (ext) { var e = ext; if (e && e.priority <= ChannelControllerPriority) { ext.initialize(_this.config, _this, _this._extensions); // initialize } }); var c = -1; // Set next plugin for all until channel controller for (var idx = 0; idx < this._extensions.length - 1; idx++) { var curr = (this._extensions[idx]); if (curr && typeof curr.processTelemetry !== 'function') { // these are initialized only, allowing an entry point for extensions to be initialized when SDK initializes continue; } if (curr.priority === ChannelControllerPriority) { c = idx + 1; break; // channel controller will set remaining pipeline } this._extensions[idx].setNextPlugin(this._extensions[idx + 1]); // set next plugin } // Remove sender channels from main list if (c < this._extensions.length) { this._extensions.splice(c); } if (this.getTransmissionControls().length === 0) { throw new Error("No channels available"); } this._isInitialized = true; var _a; }; AppInsightsCore.prototype.getTransmissionControls = function () { return this._channelController.ChannelControls; }; AppInsightsCore.prototype.track = function (telemetryItem) { if (telemetryItem === null) { this._notifiyInvalidEvent(telemetryItem); // throw error throw Error("Invalid telemetry item"); } if (telemetryItem.baseData && !telemetryItem.baseType) { this._notifiyInvalidEvent(telemetryItem); throw Error("Provide data.baseType for data.baseData"); } if (!telemetryItem.baseType) { // Hard coded from Common::Event.ts::Event.dataType telemetryItem.baseType = "EventData"; } if (!telemetryItem.instrumentationKey) { // setup default ikey if not passed in telemetryItem.instrumentationKey = this.config.instrumentationKey; } if (!telemetryItem.timestamp) { // add default timestamp if not passed in telemetryItem.timestamp = new Date(); } // do basic validation before sending it through the pipeline this._validateTelmetryItem(telemetryItem); // invoke any common telemetry processors before sending through pipeline var i = 0; while (i < this._extensions.length) { if (this._extensions[i].processTelemetry) { this._extensions[i].processTelemetry(telemetryItem); // pass on to first extension that can support processing break; } i++; } }; /** * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be * called. * @param {INotificationListener} listener - An INotificationListener object. */ AppInsightsCore.prototype.addNotificationListener = function (listener) { this._notificationManager.addNotificationListener(listener); }; /** * Removes all instances of the listener. * @param {INotificationListener} listener - INotificationListener to remove. */ AppInsightsCore.prototype.removeNotificationListener = function (listener) { this._notificationManager.removeNotificationListener(listener); }; /** * Periodically check logger.queue for */ AppInsightsCore.prototype.pollInternalLogs = function () { var _this = this; if (!(this.config.diagnosticLoggingInterval > 0)) { throw Error("config.diagnosticLoggingInterval must be a positive integer"); } return setInterval(function () { var queue = _this.logger.queue; queue.forEach(function (logMessage) { var item = { name: "InternalMessageId: " + logMessage.messageId, instrumentationKey: _this.config.instrumentationKey, timestamp: new Date(), baseType: DiagnosticLogger_1._InternalLogMessage.dataType, baseData: { message: logMessage.message } }; _this.track(item); }); queue.length = 0; }, this.config.diagnosticLoggingInterval); }; AppInsightsCore.prototype._validateTelmetryItem = function (telemetryItem) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.name)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry name required"); } if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.timestamp)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry timestamp required"); } if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.instrumentationKey)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry instrumentationKey required"); } }; AppInsightsCore.prototype._notifiyInvalidEvent = function (telemetryItem) { this._notificationManager.eventsDiscarded([telemetryItem], EventsDiscardedReason_1.EventsDiscardedReason.InvalidEvent); }; return AppInsightsCore; }()); exports.AppInsightsCore = AppInsightsCore; var ChannelController = /** @class */ (function () { function ChannelController() { this.identifier = "ChannelControllerPlugin"; this.priority = ChannelControllerPriority; // in reserved range 100 to 200 } ChannelController.prototype.processTelemetry = function (item) { this.channelQueue.forEach(function (queues) { // pass on to first item in queue if (queues.length > 0) { queues[0].processTelemetry(item); } }); }; Object.defineProperty(ChannelController.prototype, "ChannelControls", { get: function () { return this.channelQueue; }, enumerable: true, configurable: true }); ChannelController.prototype.initialize = function (config, core, extensions) { var _this = this; this.channelQueue = new Array(); if (config.channels) { config.channels.forEach(function (queue) { if (queue && queue.length > 0) { queue = queue.sort(function (a, b) { return a.priority - b.priority; }); // Initialize each plugin queue.forEach(function (queueItem) { return queueItem.initialize(config, core, extensions); }); for (var i = 1; i < queue.length; i++) { queue[i - 1].setNextPlugin(queue[i]); // setup processing chain } _this.channelQueue.push(queue); } }); } else { var arr = new Array(); for (var i = 0; i < extensions.length; i++) { var plugin = extensions[i]; if (plugin.priority > ChannelControllerPriority) { arr.push(plugin); } } if (arr.length > 0) { // sort if not sorted arr = arr.sort(function (a, b) { return a.priority - b.priority; }); // Initialize each plugin arr.forEach(function (queueItem) { return queueItem.initialize(config, core, extensions); }); // setup next plugin for (var i = 1; i < arr.length; i++) { arr[i - 1].setNextPlugin(arr[i]); } this.channelQueue.push(arr); } } }; return ChannelController; }()); var validationError = "Extensions must provide callback to initialize"; var ChannelControllerPriority = 200; var duplicatePriority = "One or more extensions are set at same priority"; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=AppInsightsCore.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js": /*!************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var CoreUtils = /** @class */ (function () { function CoreUtils() { } CoreUtils.isNullOrUndefined = function (input) { return input === null || input === undefined; }; /** * Creates a new GUID. * @return {string} A GUID. */ CoreUtils.newGuid = function () { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, function (c) { var r = (Math.random() * 16 | 0), v = (c === 'x' ? r : r & 0x3 | 0x8); return v.toString(16); }); }; return CoreUtils; }()); exports.CoreUtils = CoreUtils; var GuidRegex = /[xy]/g; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=CoreUtils.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js": /*!*******************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js ***! \*******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../JavaScriptSDK.Enums/LoggingEnums */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js"), __webpack_require__(/*! ./CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, LoggingEnums_1, CoreUtils_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } this.messageId = msgId; this.message = (isUserAct ? _InternalLogMessage.AiUserActionablePrefix : _InternalLogMessage.AiNonUserActionablePrefix) + msgId; var diagnosticText = (msg ? " message:" + _InternalLogMessage.sanitizeDiagnosticText(msg) : "") + (properties ? " props:" + _InternalLogMessage.sanitizeDiagnosticText(JSON.stringify(properties)) : ""); this.message += diagnosticText; } _InternalLogMessage.sanitizeDiagnosticText = function (text) { return "\"" + text.replace(/\"/g, "") + "\""; }; _InternalLogMessage.dataType = "MessageData"; /** * For user non actionable traces use AI Internal prefix. */ _InternalLogMessage.AiNonUserActionablePrefix = "AI (Internal): "; /** * Prefix of the traces in portal. */ _InternalLogMessage.AiUserActionablePrefix = "AI: "; return _InternalLogMessage; }()); exports._InternalLogMessage = _InternalLogMessage; var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { /** * Session storage key for the prefix for the key indicating message type already logged */ this.AIInternalMessagePrefix = "AITR_"; /** * When this is true the SDK will throw exceptions to aid in debugging. */ this.enableDebugExceptions = function () { return false; }; /** * 0: OFF * 1: CRITICAL (default) * 2: >= WARNING */ this.consoleLoggingLevel = function () { return 1; }; /** * 0: OFF (default) * 1: CRITICAL * 2: >= WARNING */ this.telemetryLoggingLevel = function () { return 0; }; /** * The maximum number of internal messages allowed to be sent per page view */ this.maxInternalMessageLimit = function () { return 25; }; /** * The internal logging queue */ this.queue = []; /** * Count of internal messages sent */ this._messageCount = 0; /** * Holds information about what message types were already logged to console or sent to server. */ this._messageLogged = {}; if (CoreUtils_1.CoreUtils.isNullOrUndefined(config)) { // TODO: Use default config // config = AppInsightsCore.defaultConfig; // For now, use defaults specified in DiagnosticLogger members; return; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.loggingLevelConsole)) { this.consoleLoggingLevel = function () { return config.loggingLevelConsole; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.loggingLevelTelemetry)) { this.telemetryLoggingLevel = function () { return config.loggingLevelTelemetry; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.maxMessageLimit)) { this.maxInternalMessageLimit = function () { return config.maxMessageLimit; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.enableDebugExceptions)) { this.enableDebugExceptions = function () { return config.enableDebugExceptions; }; } } /** * This method will throw exceptions in debug mode or attempt to log the error as a console warning. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The log message. */ DiagnosticLogger.prototype.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (this.enableDebugExceptions()) { throw message; } else { if (typeof (message) !== "undefined" && !!message) { if (typeof (message.message) !== "undefined") { if (isUserAct) { // check if this message type was already logged to console for this page view and if so, don't log it again var messageKey = +message.messageId; if (!this._messageLogged[messageKey] || this.consoleLoggingLevel() >= LoggingEnums_1.LoggingSeverity.WARNING) { this.warnToConsole(message.message); this._messageLogged[messageKey] = true; } } else { // don't log internal AI traces in the console, unless the verbose logging is enabled if (this.consoleLoggingLevel() >= LoggingEnums_1.LoggingSeverity.WARNING) { this.warnToConsole(message.message); } } this.logInternalMessage(severity, message); } } } }; /** * This will write a warning to the console if possible * @param message {string} - The warning message */ DiagnosticLogger.prototype.warnToConsole = function (message) { if (typeof console !== "undefined" && !!console) { if (typeof console.warn === "function") { console.warn(message); } else if (typeof console.log === "function") { console.log(message); } } }; /** * Resets the internal message count */ DiagnosticLogger.prototype.resetInternalMessageCount = function () { this._messageCount = 0; this._messageLogged = {}; }; /** * Logs a message to the internal queue. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The message to log. */ DiagnosticLogger.prototype.logInternalMessage = function (severity, message) { if (this._areInternalMessagesThrottled()) { return; } // check if this message type was already logged for this session and if so, don't log it again var logMessage = true; var messageKey = this.AIInternalMessagePrefix + message.messageId; // if the session storage is not available, limit to only one message type per page view if (this._messageLogged[messageKey]) { logMessage = false; } else { this._messageLogged[messageKey] = true; } if (logMessage) { // Push the event in the internal queue if (severity <= this.telemetryLoggingLevel()) { this.queue.push(message); this._messageCount++; } // When throttle limit reached, send a special event if (this._messageCount == this.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(LoggingEnums_1._InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false); this.queue.push(throttleMessage); this.warnToConsole(throttleLimitMessage); } } }; /** * Indicates whether the internal events are throttled */ DiagnosticLogger.prototype._areInternalMessagesThrottled = function () { return this._messageCount >= this.maxInternalMessageLimit(); }; return DiagnosticLogger; }()); exports.DiagnosticLogger = DiagnosticLogger; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DiagnosticLogger.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js": /*!**********************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js ***! \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Class to manage sending notifications to all the listeners. */ var NotificationManager = /** @class */ (function () { function NotificationManager() { this.listeners = []; } /** * Adds a notification listener. * @param {INotificationListener} listener - The notification listener to be added. */ NotificationManager.prototype.addNotificationListener = function (listener) { this.listeners.push(listener); }; /** * Removes all instances of the listener. * @param {INotificationListener} listener - AWTNotificationListener to remove. */ NotificationManager.prototype.removeNotificationListener = function (listener) { var index = this.listeners.indexOf(listener); while (index > -1) { this.listeners.splice(index, 1); index = this.listeners.indexOf(listener); } }; /** * Notification for events sent. * @param {ITelemetryItem[]} events - The array of events that have been sent. */ NotificationManager.prototype.eventsSent = function (events) { var _this = this; var _loop_1 = function (i) { if (this_1.listeners[i].eventsSent) { setTimeout(function () { return _this.listeners[i].eventsSent(events); }, 0); } }; var this_1 = this; for (var i = 0; i < this.listeners.length; ++i) { _loop_1(i); } }; /** * Notification for events being discarded. * @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK. * @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason * constant should be used to check the different values. */ NotificationManager.prototype.eventsDiscarded = function (events, reason) { var _this = this; var _loop_2 = function (i) { if (this_2.listeners[i].eventsDiscarded) { setTimeout(function () { return _this.listeners[i].eventsDiscarded(events, reason); }, 0); } }; var this_2 = this; for (var i = 0; i < this.listeners.length; ++i) { _loop_2(i); } }; return NotificationManager; }()); exports.NotificationManager = NotificationManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=NotificationManager.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js": /*!****************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js ***! \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./JavaScriptSDK.Interfaces/IChannelControls */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js"), __webpack_require__(/*! ./JavaScriptSDK.Enums/EventsDiscardedReason */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js"), __webpack_require__(/*! ./JavaScriptSDK/AppInsightsCore */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js"), __webpack_require__(/*! ./JavaScriptSDK/CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js"), __webpack_require__(/*! ./JavaScriptSDK/NotificationManager */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js"), __webpack_require__(/*! ./JavaScriptSDK/DiagnosticLogger */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js"), __webpack_require__(/*! ./JavaScriptSDK.Enums/LoggingEnums */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, IChannelControls_1, EventsDiscardedReason_1, AppInsightsCore_1, CoreUtils_1, NotificationManager_1, DiagnosticLogger_1, LoggingEnums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MinChannelPriorty = IChannelControls_1.MinChannelPriorty; exports.EventsDiscardedReason = EventsDiscardedReason_1.EventsDiscardedReason; exports.AppInsightsCore = AppInsightsCore_1.AppInsightsCore; exports.CoreUtils = CoreUtils_1.CoreUtils; exports.NotificationManager = NotificationManager_1.NotificationManager; exports.DiagnosticLogger = DiagnosticLogger_1.DiagnosticLogger; exports._InternalLogMessage = DiagnosticLogger_1._InternalLogMessage; exports._InternalMessageId = LoggingEnums_1._InternalMessageId; exports.LoggingSeverity = LoggingEnums_1.LoggingSeverity; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-core-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajax.js": /*!*************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajax.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./ajaxRecord */ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js"), __webpack_require__(/*! ./ajaxUtils */ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1, ajaxRecord_1, ajaxUtils_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var AjaxMonitor = /** @class */ (function () { function AjaxMonitor() { this._trackAjaxAttempts = 0; this.identifier = "AjaxDependencyPlugin"; this.priority = 161; this.currentWindowHost = window && window.location.host && window.location.host.toLowerCase(); this.initialized = false; } ///Verifies that particalar instance of XMLHttpRequest needs to be monitored ///Optional parameter. True if ajaxData must be excluded from verification ///True if instance needs to be monitored, otherwise false AjaxMonitor.prototype.isMonitoredInstance = function (xhr, excludeAjaxDataValidation) { // checking to see that all interested functions on xhr were instrumented return this.initialized // checking on ajaxData to see that it was not removed in user code && (excludeAjaxDataValidation === true || !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData)) // check that this instance is not not used by ajax call performed inside client side monitoring to send data to collector && xhr[applicationinsights_common_1.DisabledPropertyName] !== true; }; ///Determines whether ajax monitoring can be enabled on this document ///True if Ajax monitoring is supported on this page, otherwise false AjaxMonitor.prototype.supportsMonitoring = function () { var result = true; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.open) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.send) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.abort)) { result = false; } // disable in IE8 or older (https://www.w3schools.com/jsref/jsref_trim_string.asp) try { " a ".trim(); } catch (ex) { result = false; } return result; }; AjaxMonitor.prototype.instrumentOpen = function () { var originalOpen = XMLHttpRequest.prototype.open; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.open = function (method, url, async) { try { if (ajaxMonitorInstance.isMonitoredInstance(this, true) && (!this.ajaxData || !this.ajaxData.xhrMonitoringState.openDone)) { ajaxMonitorInstance.openHandler(this, method, url, async); } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxOpen, "Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalOpen.apply(this, arguments); }; }; AjaxMonitor.prototype.openHandler = function (xhr, method, url, async) { /* todo: Disabling the following block of code as CV is not yet supported in 1DS for 3rd Part. // this format corresponds with activity logic on server-side and is required for the correct correlation var id = "|" + this.appInsights.context.operation.id + "." + Util.newId(); */ var id = applicationinsights_common_1.Util.newId(); var ajaxData = new ajaxRecord_1.ajaxRecord(id, this._core._logger); ajaxData.method = method; ajaxData.requestUrl = url; ajaxData.xhrMonitoringState.openDone = true; xhr.ajaxData = ajaxData; this.attachToOnReadyStateChange(xhr); }; AjaxMonitor.getFailedAjaxDiagnosticsMessage = function (xhr) { var result = ""; try { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData.requestUrl)) { result += "(url: '" + xhr.ajaxData.requestUrl + "')"; } } catch (e) { } return result; }; AjaxMonitor.prototype.instrumentSend = function () { var originalSend = XMLHttpRequest.prototype.send; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.send = function (content) { try { if (ajaxMonitorInstance.isMonitoredInstance(this) && !this.ajaxData.xhrMonitoringState.sendDone) { ajaxMonitorInstance.sendHandler(this, content); } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxSend, "Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalSend.apply(this, arguments); }; }; AjaxMonitor.prototype.sendHandler = function (xhr, content) { xhr.ajaxData.requestSentTime = applicationinsights_common_1.DateTimeUtils.Now(); if (this.currentWindowHost && applicationinsights_common_1.CorrelationIdHelper.canIncludeCorrelationHeader(this._config, xhr.ajaxData.getAbsoluteUrl(), this.currentWindowHost)) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.requestIdHeader, xhr.ajaxData.id); var appId = this._config.appId; // Todo: also, get appId from channel as breeze returns it if (appId) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.requestContextHeader, applicationinsights_common_1.RequestHeaders.requestContextAppIdFormat + appId); } } xhr.ajaxData.xhrMonitoringState.sendDone = true; }; AjaxMonitor.prototype.instrumentAbort = function () { var originalAbort = XMLHttpRequest.prototype.abort; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.abort = function () { try { if (ajaxMonitorInstance.isMonitoredInstance(this) && !this.ajaxData.xhrMonitoringState.abortDone) { this.ajaxData.aborted = 1; this.ajaxData.xhrMonitoringState.abortDone = true; } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxAbort, "Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalAbort.apply(this, arguments); }; }; AjaxMonitor.prototype.attachToOnReadyStateChange = function (xhr) { var _this = this; var ajaxMonitorInstance = this; xhr.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached = ajaxUtils_1.EventHelper.AttachEvent(xhr, "readystatechange", function () { try { if (ajaxMonitorInstance.isMonitoredInstance(xhr)) { if (xhr.readyState === 4) { ajaxMonitorInstance.onAjaxComplete(xhr); } } } catch (e) { var exceptionText = applicationinsights_common_1.Util.dump(e); // ignore messages with c00c023f, as this a known IE9 XHR abort issue if (!exceptionText || exceptionText.toLowerCase().indexOf("c00c023f") == -1) { _this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxRSC, "Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), exception: applicationinsights_common_1.Util.dump(e) }); } } }); }; AjaxMonitor.prototype.onAjaxComplete = function (xhr) { xhr.ajaxData.responseFinishedTime = applicationinsights_common_1.DateTimeUtils.Now(); xhr.ajaxData.status = xhr.status; xhr.ajaxData.CalculateMetrics(); if (xhr.ajaxData.ajaxTotalDuration < 0) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxDur, "Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), requestSentTime: xhr.ajaxData.requestSentTime, responseFinishedTime: xhr.ajaxData.responseFinishedTime }); } else { var dependency = { id: xhr.ajaxData.id, absoluteUrl: xhr.ajaxData.getAbsoluteUrl(), commandName: xhr.ajaxData.getPathName(), duration: xhr.ajaxData.ajaxTotalDuration, success: (+(xhr.ajaxData.status)) >= 200 && (+(xhr.ajaxData.status)) < 400, resultCode: +xhr.ajaxData.status, method: xhr.ajaxData.method }; // enrich dependency target with correlation context from the server var correlationContext = this.getCorrelationContext(xhr); if (correlationContext) { dependency.correlationContext = /* dependency.target + " | " + */ correlationContext; } this.trackDependencyData(dependency); xhr.ajaxData = null; } }; AjaxMonitor.prototype.getCorrelationContext = function (xhr) { try { var responseHeadersString = xhr.getAllResponseHeaders(); if (responseHeadersString !== null) { var index = responseHeadersString.toLowerCase().indexOf(applicationinsights_common_1.RequestHeaders.requestContextHeaderLowerCase); if (index !== -1) { var responseHeader = xhr.getResponseHeader(applicationinsights_common_1.RequestHeaders.requestContextHeader); return applicationinsights_common_1.CorrelationIdHelper.getCorrelationContext(responseHeader); } } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxGetCorrelationHeader, "Failed to get Request-Context correlation header as it may be not included in the response or not accessible.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs dependency call * @param dependencyData dependency data object */ AjaxMonitor.prototype.trackDependencyData = function (dependency, properties, systemProperties) { if (this._config.maxAjaxCallsPerView === -1 || this._trackAjaxAttempts < this._config.maxAjaxCallsPerView) { var item = applicationinsights_common_1.TelemetryItemCreator.create(dependency, applicationinsights_common_1.RemoteDependencyData.dataType, applicationinsights_common_1.RemoteDependencyData.envelopeType, this._core._logger, properties, systemProperties); this._core.track(item); } else if (this._trackAjaxAttempts === this._config.maxAjaxCallsPerView) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.MaxAjaxPerPVExceeded, "Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.", true); } ++this._trackAjaxAttempts; }; AjaxMonitor.prototype.processTelemetry = function (item) { if (this._nextPlugin && this._nextPlugin.processTelemetry) { this._nextPlugin.processTelemetry(item); } }; AjaxMonitor.prototype.setNextPlugin = function (next) { if (next) { this._nextPlugin = next; } }; AjaxMonitor.prototype.initialize = function (config, core, extensions) { if (!this.initialized) { this._core = core; config.extensionConfig = config.extensionConfig ? config.extensionConfig : {}; var c = config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {}; this._config = { maxAjaxCallsPerView: !isNaN(c.maxAjaxCallsPerView) ? c.maxAjaxCallsPerView : 500, disableAjaxTracking: applicationinsights_common_1.Util.stringToBoolOrDefault(c.disableAjaxTracking), disableCorrelationHeaders: applicationinsights_common_1.Util.stringToBoolOrDefault(c.disableCorrelationHeaders), correlationHeaderExcludedDomains: c.correlationHeaderExcludedDomains || [ "*.blob.core.windows.net", "*.blob.core.chinacloudapi.cn", "*.blob.core.cloudapi.de", "*.blob.core.usgovcloudapi.net" ], appId: c.appId, enableCorsCorrelation: applicationinsights_common_1.Util.stringToBoolOrDefault(c.enableCorsCorrelation) }; if (this.supportsMonitoring() && !this._config.disableAjaxTracking) { this.instrumentOpen(); this.instrumentSend(); this.instrumentAbort(); this.initialized = true; } } }; return AjaxMonitor; }()); exports.AjaxMonitor = AjaxMonitor; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajax.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var XHRMonitoringState = /** @class */ (function () { function XHRMonitoringState() { this.openDone = false; this.setRequestHeaderDone = false; this.sendDone = false; this.abortDone = false; //True, if onreadyStateChangeCallback function attached to xhr, otherwise false this.onreadystatechangeCallbackAttached = false; } return XHRMonitoringState; }()); exports.XHRMonitoringState = XHRMonitoringState; var ajaxRecord = /** @class */ (function () { function ajaxRecord(id, logger) { this.completed = false; this.requestHeadersSize = null; this.ttfb = null; this.responseReceivingDuration = null; this.callbackDuration = null; this.ajaxTotalDuration = null; this.aborted = null; this.pageUrl = null; this.requestUrl = null; this.requestSize = 0; this.method = null; ///Returns the HTTP status code. this.status = null; //The timestamp when open method was invoked this.requestSentTime = null; //The timestamps when first byte was received this.responseStartedTime = null; //The timestamp when last byte was received this.responseFinishedTime = null; //The timestamp when onreadystatechange callback in readyState 4 finished this.callbackFinishedTime = null; //The timestamp at which ajax was ended this.endTime = null; //The original xhr onreadystatechange event this.originalOnreadystatechage = null; this.xhrMonitoringState = new XHRMonitoringState(); //Determines whether or not JavaScript exception occured in xhr.onreadystatechange code. 1 if occured, otherwise 0. this.clientFailure = 0; this.CalculateMetrics = function () { var self = this; // round to 3 decimal points self.ajaxTotalDuration = Math.round(applicationinsights_common_1.DateTimeUtils.GetDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000; }; this.id = id; this._logger = logger; } ajaxRecord.prototype.getAbsoluteUrl = function () { return this.requestUrl ? applicationinsights_common_1.UrlHelper.getAbsoluteUrl(this.requestUrl) : null; }; ajaxRecord.prototype.getPathName = function () { return this.requestUrl ? applicationinsights_common_1.DataSanitizer.sanitizeUrl(this._logger, applicationinsights_common_1.UrlHelper.getCompleteUrl(this.method, this.requestUrl)) : null; }; return ajaxRecord; }()); exports.ajaxRecord = ajaxRecord; ; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajaxRecord.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js": /*!******************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var stringUtils = /** @class */ (function () { function stringUtils() { } stringUtils.GetLength = function (strObject) { var res = 0; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(strObject)) { var stringified = ""; try { stringified = strObject.toString(); } catch (ex) { // some troubles with complex object } res = stringified.length; res = isNaN(res) ? 0 : res; } return res; }; return stringUtils; }()); exports.stringUtils = stringUtils; var EventHelper = /** @class */ (function () { function EventHelper() { } ///Binds the specified function to an event, so that the function gets called whenever the event fires on the object ///Object to which ///String that specifies any of the standard DHTML Events without "on" prefix ///Pointer that specifies the function to call when event fires ///True if the function was bound successfully to the event, otherwise false EventHelper.AttachEvent = function (obj, eventNameWithoutOn, handlerRef) { var result = false; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj)) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.attachEvent)) { // IE before version 9 obj.attachEvent("on" + eventNameWithoutOn, handlerRef); result = true; } else { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.addEventListener)) { // all browsers except IE before version 9 obj.addEventListener(eventNameWithoutOn, handlerRef, false); result = true; } } } return result; }; EventHelper.DetachEvent = function (obj, eventNameWithoutOn, handlerRef) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj)) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.detachEvent)) { obj.detachEvent("on" + eventNameWithoutOn, handlerRef); } else { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.removeEventListener)) { obj.removeEventListener(eventNameWithoutOn, handlerRef, false); } } } }; return EventHelper; }()); exports.EventHelper = EventHelper; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajaxUtils.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./ajax */ "./node_modules/applicationinsights-dependencies-js/bundle/ajax.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, ajax_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AjaxPlugin = ajax_1.AjaxMonitor; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-dependencies-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Application.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Application.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Application = /** @class */ (function () { function Application() { } return Application; }()); exports.Application = Application; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Application.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Device.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Device.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Device = /** @class */ (function () { /** * Constructs a new instance of the Device class */ function Device() { // don't attempt to fingerprint browsers this.id = "browser"; // Device type is a dimension in our data platform // Setting it to 'Browser' allows to separate client and server dependencies/exceptions this.type = "Browser"; } return Device; }()); exports.Device = Device; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Device.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Version = "2.0.1-beta"; var Internal = /** @class */ (function () { /** * Constructs a new instance of the internal telemetry data class. */ function Internal(config) { this.sdkVersion = (config.sdkExtension && config.sdkExtension() ? config.sdkExtension() + "_" : "") + "javascript:" + Version; } return Internal; }()); exports.Internal = Internal; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Internal.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Location.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Location.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Location = /** @class */ (function () { function Location() { } return Location; }()); exports.Location = Location; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Location.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js": /*!************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Operation = /** @class */ (function () { function Operation() { this.id = applicationinsights_common_1.Util.newId(); if (window && window.location && window.location.pathname) { this.name = window.location.pathname; } } return Operation; }()); exports.Operation = Operation; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Operation.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../SamplingScoreGenerator */ "./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, SamplingScoreGenerator_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Sample = /** @class */ (function () { function Sample(sampleRate, logger) { // We're using 32 bit math, hence max value is (2^31 - 1) this.INT_MAX_VALUE = 2147483647; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(logger)) { this._logger = new applicationinsights_core_js_1.DiagnosticLogger(); } else { this._logger = logger; } if (sampleRate > 100 || sampleRate < 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SampleRateOutOfRange, "Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.", { samplingRate: sampleRate }, true); this.sampleRate = 100; } this.sampleRate = sampleRate; this.samplingScoreGenerator = new SamplingScoreGenerator_1.SamplingScoreGenerator(); } /** * Determines if an envelope is sampled in (i.e. will be sent) or not (i.e. will be dropped). */ Sample.prototype.isSampledIn = function (envelope) { // return true as sampling will move to different extension return true; }; return Sample; }()); exports.Sample = Sample; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Sample.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Session.js": /*!**********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Session.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Session = /** @class */ (function () { function Session() { } return Session; }()); exports.Session = Session; var _SessionManager = /** @class */ (function () { function _SessionManager(config, logger) { if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(logger)) { this._logger = new applicationinsights_core_js_1.DiagnosticLogger(); } else { this._logger = logger; } if (!config) { config = {}; } if (!(typeof config.sessionExpirationMs === "function")) { config.sessionExpirationMs = function () { return _SessionManager.acquisitionSpan; }; } if (!(typeof config.sessionRenewalMs === "function")) { config.sessionRenewalMs = function () { return _SessionManager.renewalSpan; }; } this.config = config; this.automaticSession = new Session(); } _SessionManager.prototype.update = function () { if (!this.automaticSession.id) { this.initializeAutomaticSession(); } var now = applicationinsights_common_1.DateTimeUtils.Now(); var acquisitionExpired = now - this.automaticSession.acquisitionDate > this.config.sessionExpirationMs(); var renewalExpired = now - this.automaticSession.renewalDate > this.config.sessionRenewalMs(); // renew if acquisitionSpan or renewalSpan has ellapsed if (acquisitionExpired || renewalExpired) { // update automaticSession so session state has correct id this.automaticSession.isFirst = undefined; this.renew(); } else { // do not update the cookie more often than cookieUpdateInterval if (!this.cookieUpdatedTimestamp || now - this.cookieUpdatedTimestamp > _SessionManager.cookieUpdateInterval) { this.automaticSession.renewalDate = now; this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); } } }; /** * Record the current state of the automatic session and store it in our cookie string format * into the browser's local storage. This is used to restore the session data when the cookie * expires. */ _SessionManager.prototype.backup = function () { this.setStorage(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); }; /** * Use ai_session cookie data or local storage data (when the cookie is unavailable) to * initialize the automatic session. */ _SessionManager.prototype.initializeAutomaticSession = function () { var cookie = applicationinsights_common_1.Util.getCookie(this._logger, 'ai_session'); if (cookie && typeof cookie.split === "function") { this.initializeAutomaticSessionWithData(cookie); } else { // There's no cookie, but we might have session data in local storage // This can happen if the session expired or the user actively deleted the cookie // We only want to recover data if the cookie is missing from expiry. We should respect the user's wishes if the cookie was deleted actively. // The User class handles this for us and deletes our local storage object if the persistent user cookie was removed. var storage = applicationinsights_common_1.Util.getStorage(this._logger, 'ai_session'); if (storage) { this.initializeAutomaticSessionWithData(storage); } } if (!this.automaticSession.id) { this.automaticSession.isFirst = true; this.renew(); } }; /** * Extract id, aquisitionDate, and renewalDate from an ai_session payload string and * use this data to initialize automaticSession. * * @param {string} sessionData - The string stored in an ai_session cookie or local storage backup */ _SessionManager.prototype.initializeAutomaticSessionWithData = function (sessionData) { var params = sessionData.split("|"); if (params.length > 0) { this.automaticSession.id = params[0]; } try { if (params.length > 1) { var acq = +params[1]; this.automaticSession.acquisitionDate = +new Date(acq); this.automaticSession.acquisitionDate = this.automaticSession.acquisitionDate > 0 ? this.automaticSession.acquisitionDate : 0; } if (params.length > 2) { var renewal = +params[2]; this.automaticSession.renewalDate = +new Date(renewal); this.automaticSession.renewalDate = this.automaticSession.renewalDate > 0 ? this.automaticSession.renewalDate : 0; } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ErrorParsingAISessionCookie, "Error parsing ai_session cookie, session will be reset: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } if (this.automaticSession.renewalDate == 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SessionRenewalDateIsZero, "AI session renewal date is 0, session will be reset."); } }; _SessionManager.prototype.renew = function () { var now = applicationinsights_common_1.DateTimeUtils.Now(); this.automaticSession.id = applicationinsights_common_1.Util.newId(); this.automaticSession.acquisitionDate = now; this.automaticSession.renewalDate = now; this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); // If this browser does not support local storage, fire an internal log to keep track of it at this point if (!applicationinsights_common_1.Util.canUseLocalStorage()) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserDoesNotSupportLocalStorage, "Browser does not support local storage. Session durations will be inaccurate."); } }; _SessionManager.prototype.setCookie = function (guid, acq, renewal) { // Set cookie to expire after the session expiry time passes or the session renewal deadline, whichever is sooner // Expiring the cookie will cause the session to expire even if the user isn't on the page var acquisitionExpiry = acq + this.config.sessionExpirationMs(); var renewalExpiry = renewal + this.config.sessionRenewalMs(); var cookieExpiry = new Date(); var cookie = [guid, acq, renewal]; if (acquisitionExpiry < renewalExpiry) { cookieExpiry.setTime(acquisitionExpiry); } else { cookieExpiry.setTime(renewalExpiry); } var cookieDomnain = this.config.cookieDomain ? this.config.cookieDomain() : null; applicationinsights_common_1.Util.setCookie(this._logger, 'ai_session', cookie.join('|') + ';expires=' + cookieExpiry.toUTCString(), cookieDomnain); this.cookieUpdatedTimestamp = applicationinsights_common_1.DateTimeUtils.Now(); }; _SessionManager.prototype.setStorage = function (guid, acq, renewal) { // Keep data in local storage to retain the last session id, allowing us to cleanly end the session when it expires // Browsers that don't support local storage won't be able to end sessions cleanly from the client // The server will notice this and end the sessions itself, with loss of accurate session duration applicationinsights_common_1.Util.setStorage(this._logger, 'ai_session', [guid, acq, renewal].join('|')); }; _SessionManager.acquisitionSpan = 86400000; // 24 hours in ms _SessionManager.renewalSpan = 1800000; // 30 minutes in ms _SessionManager.cookieUpdateInterval = 60000; // 1 minute in ms return _SessionManager; }()); exports._SessionManager = _SessionManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Session.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/User.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/User.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var User = /** @class */ (function () { function User(config, logger) { this._logger = logger; //get userId or create new one if none exists var cookie = applicationinsights_common_1.Util.getCookie(this._logger, User.userCookieName); if (cookie) { var params = cookie.split(User.cookieSeparator); if (params.length > 0) { this.id = params[0]; } } this.config = config; if (!this.id) { this.id = applicationinsights_common_1.Util.newId(); var date = new Date(); var acqStr = applicationinsights_common_1.Util.toISOStringForIE8(date); this.accountAcquisitionDate = acqStr; // without expiration, cookies expire at the end of the session // set it to 365 days from now // 365 * 24 * 60 * 60 * 1000 = 31536000000 date.setTime(date.getTime() + 31536000000); var newCookie = [this.id, acqStr]; var cookieDomain = this.config.cookieDomain ? this.config.cookieDomain() : undefined; applicationinsights_common_1.Util.setCookie(this._logger, User.userCookieName, newCookie.join(User.cookieSeparator) + ';expires=' + date.toUTCString(), cookieDomain); // If we have an ai_session in local storage this means the user actively removed our cookies. // We should respect their wishes and clear ourselves from local storage applicationinsights_common_1.Util.removeStorage(this._logger, 'ai_session'); } // We still take the account id from the ctor param for backward compatibility. // But if the the customer set the accountId through the newer setAuthenticatedUserContext API, we will override it. this.accountId = config.accountId ? config.accountId() : undefined; // Get the auth user id and account id from the cookie if exists // Cookie is in the pattern: | var authCookie = applicationinsights_common_1.Util.getCookie(this._logger, User.authUserCookieName); if (authCookie) { authCookie = decodeURI(authCookie); var authCookieString = authCookie.split(User.cookieSeparator); if (authCookieString[0]) { this.authenticatedId = authCookieString[0]; } if (authCookieString.length > 1 && authCookieString[1]) { this.accountId = authCookieString[1]; } } } /** * Sets the authenticated user id and the account id in this session. * * @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service. * @param accountId {string} - An optional string to represent the account associated with the authenticated user. */ User.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) { if (storeInCookie === void 0) { storeInCookie = false; } // Validate inputs to ensure no cookie control characters. var isInvalidInput = !this.validateUserInput(authenticatedUserId) || (accountId && !this.validateUserInput(accountId)); if (isInvalidInput) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SetAuthContextFailedAccountName, "Setting auth user context failed. " + "User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.", true); return; } // Create cookie string. this.authenticatedId = authenticatedUserId; var authCookie = this.authenticatedId; if (accountId) { this.accountId = accountId; authCookie = [this.authenticatedId, this.accountId].join(User.cookieSeparator); } if (storeInCookie) { // Set the cookie. No expiration date because this is a session cookie (expires when browser closed). // Encoding the cookie to handle unexpected unicode characters. applicationinsights_common_1.Util.setCookie(this._logger, User.authUserCookieName, encodeURI(authCookie), this.config.cookieDomain()); } }; /** * Clears the authenticated user id and the account id from the user context. * @returns {} */ User.prototype.clearAuthenticatedUserContext = function () { this.authenticatedId = null; this.accountId = null; applicationinsights_common_1.Util.deleteCookie(this._logger, User.authUserCookieName); }; User.prototype.validateUserInput = function (id) { // Validate: // 1. Id is a non-empty string. // 2. It does not contain special characters for cookies. if (typeof id !== 'string' || !id || id.match(/,|;|=| |\|/)) { return false; } return true; }; User.cookieSeparator = '|'; User.userCookieName = 'ai_user'; User.authUserCookieName = 'ai_authUser'; return User; }()); exports.User = User; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=User.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var HashCodeScoreGenerator = /** @class */ (function () { function HashCodeScoreGenerator() { } HashCodeScoreGenerator.prototype.getHashCodeScore = function (key) { var score = this.getHashCode(key) / HashCodeScoreGenerator.INT_MAX_VALUE; return score * 100; }; HashCodeScoreGenerator.prototype.getHashCode = function (input) { if (input == "") { return 0; } while (input.length < HashCodeScoreGenerator.MIN_INPUT_LENGTH) { input = input.concat(input); } // 5381 is a magic number: http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function var hash = 5381; for (var i = 0; i < input.length; ++i) { hash = ((hash << 5) + hash) + input.charCodeAt(i); // 'hash' is of number type which means 53 bit integer (http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types-number-type) // 'hash & hash' will keep it 32 bit integer - just to make it clearer what the result is. hash = hash & hash; } return Math.abs(hash); }; // We're using 32 bit math, hence max value is (2^31 - 1) HashCodeScoreGenerator.INT_MAX_VALUE = 2147483647; // (Magic number) DJB algorithm can't work on shorter strings (results in poor distribution HashCodeScoreGenerator.MIN_INPUT_LENGTH = 8; return HashCodeScoreGenerator; }()); exports.HashCodeScoreGenerator = HashCodeScoreGenerator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=HashCodeScoreGenerator.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** * PropertiesPlugin.ts * @copyright Microsoft 2018 */ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! ./Context/Session */ "./node_modules/applicationinsights-properties-js/bundle/Context/Session.js"), __webpack_require__(/*! ./Context/Application */ "./node_modules/applicationinsights-properties-js/bundle/Context/Application.js"), __webpack_require__(/*! ./Context/Device */ "./node_modules/applicationinsights-properties-js/bundle/Context/Device.js"), __webpack_require__(/*! ./Context/Internal */ "./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js"), __webpack_require__(/*! ./Context/Location */ "./node_modules/applicationinsights-properties-js/bundle/Context/Location.js"), __webpack_require__(/*! ./Context/Operation */ "./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js"), __webpack_require__(/*! ./Context/User */ "./node_modules/applicationinsights-properties-js/bundle/Context/User.js"), __webpack_require__(/*! ./Context/Sample */ "./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, applicationinsights_common_1, Session_1, Application_1, Device_1, Internal_1, Location_1, Operation_1, User_1, Sample_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PropertiesPlugin = /** @class */ (function () { function PropertiesPlugin() { this.priority = 170; this.identifier = "AppInsightsPropertiesPlugin"; } PropertiesPlugin.prototype.initialize = function (config, core, extensions) { var extensionConfig = config.extensions && config.extensions[this.identifier] ? config.extensions[this.identifier] : {}; this._extensionConfig = { instrumentationKey: function () { return extensionConfig.instrumentationKey; }, accountId: function () { return extensionConfig.accountId; }, sessionRenewalMs: function () { return extensionConfig.sessionRenewalMs; }, sampleRate: function () { return extensionConfig.sampleRate; }, sessionExpirationMs: function () { return extensionConfig.sessionExpirationMs; }, cookieDomain: function () { return extensionConfig.cookieDomain; }, sdkExtension: function () { return extensionConfig.sdkExtension; }, isBrowserLinkTrackingEnabled: function () { return extensionConfig.isBrowserLinkTrackingEnabled; }, appId: function () { return extensionConfig.appId; } }; if (typeof window !== 'undefined') { this._sessionManager = new Session_1._SessionManager(this._extensionConfig, core.logger); this.application = new Application_1.Application(); this.device = new Device_1.Device(); this.internal = new Internal_1.Internal(this._extensionConfig); this.location = new Location_1.Location(); this.user = new User_1.User(this._extensionConfig, core.logger); this.operation = new Operation_1.Operation(); this.session = new Session_1.Session(); this.sample = new Sample_1.Sample(this._extensionConfig.sampleRate(), core.logger); } }; /** * Add Part A fields to the event * @param event The event that needs to be processed */ PropertiesPlugin.prototype.processTelemetry = function (event) { if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(event)) { // TODO(barustum): throw an internal event once we have support for internal logging } else { // if the event is not sampled in, do not bother going through the pipeline if (this.sample.isSampledIn(event)) { // If the envelope is PageView, reset the internal message count so that we can send internal telemetry for the new page. if (event.name === applicationinsights_common_1.PageView.envelopeType) { // TODO(barustum): resetInternalMessageCount once we have support for internal logging //_InternalLogging.resetInternalMessageCount(); } if (this.session) { // If customer did not provide custom session id update the session manager if (typeof this.session.id !== "string") { this._sessionManager.update(); } } this._processTelemetryInternal(event); } if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(event); } } }; /** * Sets the next plugin that comes after this plugin * @param nextPlugin The next plugin */ PropertiesPlugin.prototype.setNextPlugin = function (nextPlugin) { this._nextPlugin = nextPlugin; }; PropertiesPlugin.prototype._processTelemetryInternal = function (event) { var tagsItem = {}; if (this.session) { // If customer set id, apply his context; otherwise apply context generated from cookies if (typeof this.session.id === "string") { PropertiesPlugin._applySessionContext(tagsItem, this.session); } else { PropertiesPlugin._applySessionContext(tagsItem, this._sessionManager.automaticSession); } } // set part A fields PropertiesPlugin._applyApplicationContext(tagsItem, this.application); PropertiesPlugin._applyDeviceContext(tagsItem, this.device); PropertiesPlugin._applyInternalContext(tagsItem, this.internal); PropertiesPlugin._applyLocationContext(tagsItem, this.location); PropertiesPlugin._applySampleContext(tagsItem, this.sample); PropertiesPlugin._applyUserContext(tagsItem, this.user); PropertiesPlugin._applyOperationContext(tagsItem, this.operation); event.tags.push(tagsItem); }; PropertiesPlugin._applySessionContext = function (tags, sessionContext) { if (sessionContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof sessionContext.id === "string") { tags[tagKeys.sessionId] = sessionContext.id; } if (typeof sessionContext.isFirst !== "undefined") { tags[tagKeys.sessionIsFirst] = sessionContext.isFirst; } } }; PropertiesPlugin._applyApplicationContext = function (tagsItem, appContext) { if (appContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof appContext.ver === "string") { tagsItem[tagKeys.applicationVersion] = appContext.ver; } if (typeof appContext.build === "string") { tagsItem[tagKeys.applicationBuild] = appContext.build; } } }; PropertiesPlugin._applyDeviceContext = function (tagsItem, deviceContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (deviceContext) { if (typeof deviceContext.id === "string") { tagsItem[tagKeys.deviceId] = deviceContext.id; } if (typeof deviceContext.ip === "string") { tagsItem[tagKeys.deviceIp] = deviceContext.ip; } if (typeof deviceContext.language === "string") { tagsItem[tagKeys.deviceLanguage] = deviceContext.language; } if (typeof deviceContext.locale === "string") { tagsItem[tagKeys.deviceLocale] = deviceContext.locale; } if (typeof deviceContext.model === "string") { tagsItem[tagKeys.deviceModel] = deviceContext.model; } if (typeof deviceContext.network !== "undefined") { tagsItem[tagKeys.deviceNetwork] = deviceContext.network; } if (typeof deviceContext.oemName === "string") { tagsItem[tagKeys.deviceOEMName] = deviceContext.oemName; } if (typeof deviceContext.os === "string") { tagsItem[tagKeys.deviceOS] = deviceContext.os; } if (typeof deviceContext.osversion === "string") { tagsItem[tagKeys.deviceOSVersion] = deviceContext.osversion; } if (typeof deviceContext.resolution === "string") { tagsItem[tagKeys.deviceScreenResolution] = deviceContext.resolution; } if (typeof deviceContext.type === "string") { tagsItem[tagKeys.deviceType] = deviceContext.type; } } }; PropertiesPlugin._applyInternalContext = function (tagsItem, internalContext) { if (internalContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof internalContext.agentVersion === "string") { tagsItem[tagKeys.internalAgentVersion] = internalContext.agentVersion; } if (typeof internalContext.sdkVersion === "string") { tagsItem[tagKeys.internalSdkVersion] = internalContext.sdkVersion; } } }; PropertiesPlugin._applyLocationContext = function (tagsItem, locationContext) { if (locationContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof locationContext.ip === "string") { tagsItem[tagKeys.locationIp] = locationContext.ip; } } }; PropertiesPlugin._applySampleContext = function (tagsItem, sampleContext) { if (sampleContext) { tagsItem.sampleRate = sampleContext.sampleRate; } }; PropertiesPlugin._applyOperationContext = function (tagsItem, operationContext) { if (operationContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof operationContext.id === "string") { tagsItem[tagKeys.operationId] = operationContext.id; } if (typeof operationContext.name === "string") { tagsItem[tagKeys.operationName] = operationContext.name; } if (typeof operationContext.parentId === "string") { tagsItem[tagKeys.operationParentId] = operationContext.parentId; } if (typeof operationContext.rootId === "string") { tagsItem[tagKeys.operationRootId] = operationContext.rootId; } if (typeof operationContext.syntheticSource === "string") { tagsItem[tagKeys.operationSyntheticSource] = operationContext.syntheticSource; } } }; PropertiesPlugin._applyUserContext = function (tagsItem, userContext) { if (userContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof userContext.accountId === "string") { tagsItem[tagKeys.userAccountId] = userContext.accountId; } if (typeof userContext.agent === "string") { tagsItem[tagKeys.userAgent] = userContext.agent; } if (typeof userContext.id === "string") { tagsItem[tagKeys.userId] = userContext.id; } if (typeof userContext.authenticatedId === "string") { tagsItem[tagKeys.userAuthUserId] = userContext.authenticatedId; } if (typeof userContext.storeRegion === "string") { tagsItem[tagKeys.userStoreRegion] = userContext.storeRegion; } } }; return PropertiesPlugin; }()); exports.default = PropertiesPlugin; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PropertiesPlugin.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./HashCodeScoreGenerator */ "./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, HashCodeScoreGenerator_1, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var SamplingScoreGenerator = /** @class */ (function () { function SamplingScoreGenerator() { this.hashCodeGeneragor = new HashCodeScoreGenerator_1.HashCodeScoreGenerator(); } SamplingScoreGenerator.prototype.getSamplingScore = function (envelope) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); var score = 0; if (envelope.tags[tagKeys.userId]) { score = this.hashCodeGeneragor.getHashCodeScore(envelope.tags[tagKeys.userId]); } else if (envelope.tags[tagKeys.operationId]) { score = this.hashCodeGeneragor.getHashCodeScore(envelope.tags[tagKeys.operationId]); } else { score = Math.random(); } return score; }; return SamplingScoreGenerator; }()); exports.SamplingScoreGenerator = SamplingScoreGenerator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SamplingScoreGenerator.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./PropertiesPlugin */ "./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PropertiesPlugin_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PropertiesPlugin = PropertiesPlugin_1.default; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-properties-js.js.map /***/ }), /***/ 0: /*!**********************************!*\ !*** multi ./amd/bundle/Init.js ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(/*! ./amd/bundle/Init.js */"./amd/bundle/Init.js"); /***/ }) /******/ }); }); //# sourceMappingURL=aisdk.0.0.13.js.map ================================================ FILE: AISKU/dist-history/aisdk.0.0.15.js ================================================ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ "./amd/bundle/Init.js": /*!****************************!*\ !*** ./amd/bundle/Init.js ***! \****************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-analytics-js */ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js"), __webpack_require__(/*! ./Initialization */ "./amd/bundle/Initialization.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_analytics_js_1, Initialization_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; //should be global function that should load as soon as SDK loads try { // E2E sku on load initializes core and pipeline using snippet as input for configuration var aiName; if (typeof window !== "undefined" && typeof JSON !== "undefined") { // get snippet or initialize to an empty object // get sdk instance name should not conflict if page uses existing sdk for a layer of instrumentation aiName = window["appInsightsSDK"]; if (window[aiName] === undefined) { // if no snippet is present, initialize default values applicationinsights_analytics_js_1.ApplicationInsights.appInsightsDefaultConfig = Initialization_1.Initialization.getDefaultConfig(); } else { if (window[aiName].initialize) { // this is the typical case for browser+snippet var snippet = window[aiName] || {}; // overwrite snippet with full appInsights var initialization = new Initialization_1.Initialization(snippet); var appInsightsLocal = initialization.loadAppInsights(); // apply full appInsights to the global instance that was initialized in the snippet for (var field in appInsightsLocal) { snippet[field] = appInsightsLocal[field]; } // Empty queue of all api calls logged prior to sdk download initialization.emptyQueue(); initialization.addHousekeepingBeforeUnload(appInsightsLocal); } } } } catch (e) { // TODO: Find better place to warn to console when SDK initialization fails if (console) { console.warn('Failed to initialize AppInsights JS SDK for instance ' + aiName + e.message); } } }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./amd/bundle/Initialization.js": /*!**************************************!*\ !*** ./amd/bundle/Initialization.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-analytics-js */ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-channel-js */ "./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js"), __webpack_require__(/*! applicationinsights-properties-js */ "./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js"), __webpack_require__(/*! applicationinsights-dependencies-js */ "./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, applicationinsights_analytics_js_1, applicationinsights_common_1, applicationinsights_channel_js_1, applicationinsights_properties_js_1, applicationinsights_dependencies_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; ; var Initialization = /** @class */ (function () { function Initialization(snippet) { // initialize the queue and config in case they are undefined snippet.queue = snippet.queue || []; var config = snippet.config || {}; // ensure instrumentationKey is specified if (config && !config.instrumentationKey) { config = snippet; applicationinsights_analytics_js_1.ApplicationInsights.Version = "2.0.0"; } this.appInsights = new applicationinsights_analytics_js_1.ApplicationInsights(); // set default values using config passed through snippet config = Initialization.getDefaultConfig(config, this.appInsights.identifier); this.properties = new applicationinsights_properties_js_1.PropertiesPlugin(); this.dependencies = new applicationinsights_dependencies_js_1.AjaxPlugin(); this.snippet = snippet; this.config = config; } // Analytics Plugin Initialization.prototype.trackPageView = function (pageView, customProperties) { this.appInsights.trackPageView(pageView, customProperties); }; Initialization.prototype.trackException = function (exception, customProperties) { this.appInsights.trackException(exception, customProperties); }; Initialization.prototype._onerror = function (exception) { this.appInsights._onerror(exception); }; Initialization.prototype.trackTrace = function (trace, customProperties) { this.appInsights.trackTrace(trace, customProperties); }; Initialization.prototype.trackMetric = function (metric, customProperties) { this.appInsights.trackMetric(metric, customProperties); }; Initialization.prototype.startTrackPage = function (name) { this.appInsights.startTrackPage(name); }; Initialization.prototype.stopTrackPage = function (name, url, customProperties) { this.appInsights.stopTrackPage(name, url, customProperties); }; Initialization.prototype.addTelemetryInitializer = function (telemetryInitializer) { return this.appInsights.addTelemetryInitializer(telemetryInitializer); }; // Properties Plugin Initialization.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) { if (storeInCookie === void 0) { storeInCookie = false; } this.properties.user.setAuthenticatedUserContext(authenticatedUserId, accountId, storeInCookie); }; Initialization.prototype.clearAuthenticatedUserContext = function () { this.properties.user.clearAuthenticatedUserContext(); }; // Dependencies Plugin Initialization.prototype.trackDependencyData = function (dependency, customProperties, systemProperties) { this.dependencies.trackDependencyData(dependency, customProperties, systemProperties); }; Initialization.prototype.loadAppInsights = function () { this.core = new applicationinsights_core_js_1.AppInsightsCore(); var extensions = []; var appInsightsChannel = new applicationinsights_channel_js_1.Sender(); extensions.push(appInsightsChannel); extensions.push(this.properties); extensions.push(this.dependencies); extensions.push(this.appInsights); // initialize core this.core.initialize(this.config, extensions); return this; }; Initialization.prototype.emptyQueue = function () { // call functions that were queued before the main script was loaded try { if (applicationinsights_common_1.Util.isArray(this.snippet.queue)) { // note: do not check length in the for-loop conditional in case something goes wrong and the stub methods are not overridden. var length = this.snippet.queue.length; for (var i = 0; i < length; i++) { var call = this.snippet.queue[i]; call(); } this.snippet.queue = undefined; delete this.snippet.queue; } } catch (exception) { var properties = {}; if (exception && typeof exception.toString === "function") { properties.exception = exception.toString(); } // need from core // Microsoft.ApplicationInsights._InternalLogging.throwInternal( // LoggingSeverity.WARNING, // _InternalMessageId.FailedToSendQueuedTelemetry, // "Failed to send queued telemetry", // properties); } }; Initialization.prototype.pollInteralLogs = function (appInsightsInstance) { // return setInterval(() => { // var queue: Array<_InternalLogMessage> = ApplicationInsights._InternalLogging.queue; // var length = queue.length; // for (var i = 0; i < length; i++) { // appInsightsInstance.trackTrace(queue[i].message); // } // queue.length = 0; // }, this.config.diagnosticLogInterval); }; Initialization.prototype.addHousekeepingBeforeUnload = function (appInsightsInstance) { // Add callback to push events when the user navigates away if (!appInsightsInstance.appInsights.config.disableFlushOnBeforeUnload && ('onbeforeunload' in window)) { var performHousekeeping = function () { // Adds the ability to flush all data before the page unloads. // Note: This approach tries to push an async request with all the pending events onbeforeunload. // Firefox does not respect this.Other browsers DO push out the call with < 100% hit rate. // Telemetry here will help us analyze how effective this approach is. // Another approach would be to make this call sync with a acceptable timeout to reduce the // impact on user experience. //appInsightsInstance.context._sender.triggerSend(); appInsightsInstance.appInsights.core.getTransmissionControls().forEach(function (queues) { queues.forEach(function (channel) { return channel.flush(true); }); }); // Back up the current session to local storage // This lets us close expired sessions after the cookies themselves expire // Todo: move this against interface behavior if (this.core.extensions["AppInsightsPropertiesPlugin"] && this.core.extensions["AppInsightsPropertiesPlugin"]._sessionManager) { this.core.extensions["AppInsightsPropertiesPlugin"]._sessionManager.backup(); } }; if (!applicationinsights_common_1.Util.addEventHandler('beforeunload', performHousekeeping)) { this.core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedToAddHandlerForOnBeforeUnload, 'Could not add handler for beforeunload'); } } }; Initialization.getDefaultConfig = function (configuration, identifier) { if (!configuration) { configuration = {}; } if (configuration) { identifier = identifier ? identifier : "ApplicationInsightsAnalytics"; } // Undefined checks if (!configuration.extensionConfig) { configuration.extensionConfig = {}; } if (!configuration.extensionConfig[identifier]) { configuration.extensionConfig[identifier] = {}; } var extensionConfig = configuration.extensionConfig[identifier]; // ref to main config // set default values configuration.endpointUrl = configuration.endpointUrl || "https://dc.services.visualstudio.com/v2/track"; extensionConfig.sessionRenewalMs = 30 * 60 * 1000; extensionConfig.sessionExpirationMs = 24 * 60 * 60 * 1000; extensionConfig.enableDebug = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.enableDebug); extensionConfig.disableExceptionTracking = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableExceptionTracking); extensionConfig.consoleLoggingLevel = extensionConfig.consoleLoggingLevel || 1; // Show only CRITICAL level extensionConfig.telemetryLoggingLevel = extensionConfig.telemetryLoggingLevel || 0; // Send nothing extensionConfig.diagnosticLogInterval = extensionConfig.diagnosticLogInterval || 10000; extensionConfig.autoTrackPageVisitTime = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.autoTrackPageVisitTime); if (isNaN(extensionConfig.samplingPercentage) || extensionConfig.samplingPercentage <= 0 || extensionConfig.samplingPercentage >= 100) { extensionConfig.samplingPercentage = 100; } extensionConfig.disableAjaxTracking = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableAjaxTracking); extensionConfig.maxAjaxCallsPerView = !isNaN(extensionConfig.maxAjaxCallsPerView) ? extensionConfig.maxAjaxCallsPerView : 500; extensionConfig.disableCorrelationHeaders = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableCorrelationHeaders); extensionConfig.correlationHeaderExcludedDomains = extensionConfig.correlationHeaderExcludedDomains || [ "*.blob.core.windows.net", "*.blob.core.chinacloudapi.cn", "*.blob.core.cloudapi.de", "*.blob.core.usgovcloudapi.net" ]; extensionConfig.disableFlushOnBeforeUnload = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableFlushOnBeforeUnload); extensionConfig.isCookieUseDisabled = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.isCookieUseDisabled); extensionConfig.isStorageUseDisabled = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.isStorageUseDisabled); extensionConfig.isBrowserLinkTrackingEnabled = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.isBrowserLinkTrackingEnabled); extensionConfig.enableCorsCorrelation = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.enableCorsCorrelation); return configuration; }; return Initialization; }()); exports.Initialization = Initialization; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** * ApplicationInsights.ts * @copyright Microsoft 2018 */ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./Telemetry/PageViewManager */ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1, PageViewManager_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; var durationProperty = "duration"; var ApplicationInsights = /** @class */ (function () { function ApplicationInsights() { this.identifier = "ApplicationInsightsAnalytics"; this.priority = 160; // take from reserved priority range 100- 200 this._isInitialized = false; // Counts number of trackAjax invokations. // By default we only monitor X ajax call per view to avoid too much load. // Default value is set in config. // This counter keeps increasing even after the limit is reached. this._trackAjaxAttempts = 0; this.initialize = this._initialize.bind(this); } ApplicationInsights.prototype.processTelemetry = function (env) { var doNotSendItem = false; try { var telemetryInitializersCount = this._telemetryInitializers.length; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = this._telemetryInitializers[i]; if (telemetryInitializer) { if (telemetryInitializer.apply(null, [env]) === false) { doNotSendItem = true; break; } } } } catch (e) { doNotSendItem = true; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryInitializerFailed, "One of telemetry initializers failed, telemetry item will not be sent: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }, true); } if (!doNotSendItem && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(env); } }; ApplicationInsights.prototype.setNextPlugin = function (next) { this._nextPlugin = next; }; /** * @description Log a diagnostic message * @param {ITraceTelemetry} trace * @param {{[key: string]: any}} [customProperties] * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackTrace = function (trace, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(trace, applicationinsights_common_1.Trace.dataType, applicationinsights_common_1.Trace.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TrackTraceFailed, "trackTrace failed, trace will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * @description Log a numeric value that is not associated with a specific event. Typically * used to send regular reports of performance indicators. To send single measurement, just * use the name and average fields of {@link IMetricTelemetry}. If you take measurements * frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements * and sending the resulting average at intervals * @param {IMetricTelemetry} metric input object argument. Only name and average are mandatory. * @param {{[key: string]: any}} customProperties additional data used to filter metrics in the * portal. Defaults to empty. * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackMetric = function (metric, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(metric, applicationinsights_common_1.Metric.dataType, applicationinsights_common_1.Metric.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackMetricFailed, "trackMetric failed, metric will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs that a page or other item was viewed. * @param IPageViewTelemetry The string you used as the name in startTrackPage. Defaults to the document title. * @param customProperties Additional data used to filter events and metrics. Defaults to empty. If a user wants * to provide a custom duration, it'll have to be in customProperties */ ApplicationInsights.prototype.trackPageView = function (pageView, customProperties) { try { this._pageViewManager.trackPageView(pageView, customProperties); if (this.config.autoTrackPageVisitTime) { this._pageVisitTimeManager.trackPreviousPageVisit(pageView.name, pageView.uri); } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackPVFailed, "trackPageView failed, page view will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Create a page view telemetry item and send it to the SDK pipeline through the core.track API * @param pageView Page view item to be sent * @param properties Custom properties (Part C) that a user can add to the telemetry item * @param systemProperties System level properties (Part A) that a user can add to the telemetry item */ ApplicationInsights.prototype.sendPageViewInternal = function (pageView, properties, systemProperties) { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(pageView, applicationinsights_common_1.PageView.dataType, applicationinsights_common_1.PageView.envelopeType, this._logger, properties, systemProperties); // set instrumentation key this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); // reset ajaxes counter this._trackAjaxAttempts = 0; }; ApplicationInsights.prototype.sendPageViewPerformanceInternal = function (pageViewPerformance, properties) { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(pageViewPerformance, applicationinsights_common_1.PageViewPerformance.dataType, applicationinsights_common_1.PageViewPerformance.envelopeType, this._logger, properties); // set instrumentation key this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); }; /** * Starts timing how long the user views a page or other item. Call this when the page opens. * This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes. * @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title. */ ApplicationInsights.prototype.startTrackPage = function (name) { try { if (typeof name !== "string") { name = window.document && window.document.title || ""; } this._pageTracking.start(name); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.StartTrackFailed, "startTrackPage failed, page view may not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs how long a page or other item was visible, after {@link startTrackPage}. Call this when the page closes. * @param name The string you used as the name in startTrackPage. Defaults to the document title. * @param url A relative or absolute URL that identifies the page or other item. Defaults to the window location. * @param properties Additional data used to filter pages and metrics in the portal. Defaults to empty. * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric */ ApplicationInsights.prototype.stopTrackPage = function (name, url, properties) { try { if (typeof name !== "string") { name = window.document && window.document.title || ""; } if (typeof url !== "string") { url = window.location && window.location.href || ""; } this._pageTracking.stop(name, url, properties); if (this.config.autoTrackPageVisitTime) { this._pageVisitTimeManager.trackPreviousPageVisit(name, url); } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.StopTrackFailed, "stopTrackPage failed, page view will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Log an exception you have caught. * * @param {IExceptionTelemetry} exception Object which contains exception to be sent * @param {{[key: string]: any}} customProperties Additional data used to filter pages and metrics in the portal. Defaults to empty. * * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric. * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackException = function (exception, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(exception, applicationinsights_common_1.Exception.dataType, applicationinsights_common_1.Exception.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackExceptionFailed, "trackException failed, exception will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * @description Custom error handler for Application Insights Analytics * @param {IAutoExceptionTelemetry} exception * @memberof ApplicationInsights */ ApplicationInsights.prototype._onerror = function (exception) { try { var properties = { url: (exception && exception.url) || document.URL, lineNumber: exception.lineNumber, columnNumber: exception.columnNumber, message: exception.message }; if (applicationinsights_common_1.Util.isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception.error)) { this._sendCORSException(properties.url); } else { if (!applicationinsights_common_1.Util.isError(exception.error)) { var stack = "window.onerror@" + properties.url + ":" + exception.lineNumber + ":" + (exception.columnNumber || 0); exception.error = new Error(exception.message); exception.error.stack = stack; } this.trackException({ error: exception.error, severityLevel: applicationinsights_common_1.SeverityLevel.Error }, properties); } } catch (e) { var errorString = exception.error ? (exception.error.name + ", " + exception.error.message) : "null"; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ExceptionWhileLoggingError, "_onError threw exception while logging error, error will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e), errorString: errorString }); } }; ApplicationInsights.prototype.addTelemetryInitializer = function (telemetryInitializer) { this._telemetryInitializers.push(telemetryInitializer); }; ApplicationInsights.prototype._initialize = function (config, core, extensions) { var _this = this; if (this._isInitialized) { return; } if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(core)) { throw Error("Error initializing"); } this.core = core; this._logger = core.logger; this._globalconfig = { instrumentationKey: config.instrumentationKey, endpointUrl: config.endpointUrl }; this.config = config.extensionConfig && config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {}; // load default values if specified var defaults = ApplicationInsights.appInsightsDefaultConfig; if (defaults !== undefined) { if (defaults.extensions && defaults.extensions[this.identifier]) { for (var field in defaults.extensions[this.identifier]) { // for each unspecified field, set the default value if (this.config[field] === undefined) { this.config[field] = defaults[field]; } } } if (this._globalconfig) { for (var field in defaults) { if (this._globalconfig[field] === undefined) { this._globalconfig[field] = defaults[field]; } } } } // Todo: move this out of static state if (this.config.isCookieUseDisabled) { applicationinsights_common_1.Util.disableCookies(); } // Todo: move this out of static state if (this.config.isStorageUseDisabled) { applicationinsights_common_1.Util.disableStorage(); } var configGetters = { instrumentationKey: function () { return config.instrumentationKey; }, accountId: function () { return _this.config.accountId; }, sessionRenewalMs: function () { return _this.config.sessionRenewalMs; }, sessionExpirationMs: function () { return _this.config.sessionExpirationMs; }, sampleRate: function () { return _this.config.samplingPercentage; }, cookieDomain: function () { return _this.config.cookieDomain; }, sdkExtension: function () { return _this.config.sdkExtension; }, isBrowserLinkTrackingEnabled: function () { return _this.config.isBrowserLinkTrackingEnabled; }, appId: function () { return _this.config.appId; } }; this._pageViewManager = new PageViewManager_1.PageViewManager(this, this.config.overridePageViewDuration, this.core); this._telemetryInitializers = []; this._addDefaultTelemetryInitializers(configGetters); // initialize page view timing this._pageTracking = new Timing(this._logger, "trackPageView"); this._pageTracking.action = function (name, url, duration, properties) { var pageViewItem = { name: name, uri: url }; // duration must be a custom property in order for the collector to extract it if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(properties)) { properties = {}; } properties[durationProperty] = duration; _this.sendPageViewInternal(pageViewItem, properties); }; if (this.config.disableExceptionTracking === false && !this.config.autoExceptionInstrumented) { // We want to enable exception auto collection and it has not been done so yet var onerror_1 = "onerror"; var originalOnError_1 = window[onerror_1]; var instance_1 = this; window.onerror = function (message, url, lineNumber, columnNumber, error) { var handled = originalOnError_1 && originalOnError_1(message, url, lineNumber, columnNumber, error); if (handled !== true) { instance_1._onerror({ message: message, url: url, lineNumber: lineNumber, columnNumber: columnNumber, error: error }); } return handled; }; this.config.autoExceptionInstrumented = true; } this._isInitialized = true; }; ApplicationInsights.prototype._addDefaultTelemetryInitializers = function (configGetters) { if (!configGetters.isBrowserLinkTrackingEnabled()) { var browserLinkPaths_1 = ['/browserLinkSignalR/', '/__browserLink/']; var dropBrowserLinkRequests = function (envelope) { if (envelope.baseType === applicationinsights_common_1.RemoteDependencyData.dataType) { var remoteData = envelope.baseData; if (remoteData) { for (var i = 0; i < browserLinkPaths_1.length; i++) { if (remoteData.absoluteUrl && remoteData.absoluteUrl.indexOf(browserLinkPaths_1[i]) >= 0) { return false; } } } } return true; }; this._addTelemetryInitializer(dropBrowserLinkRequests); } }; ApplicationInsights.prototype._addTelemetryInitializer = function (telemetryInitializer) { this._telemetryInitializers.push(telemetryInitializer); }; ApplicationInsights.prototype._sendCORSException = function (url) { var exception = { message: "Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.", url: url, lineNumber: 0, columnNumber: 0, error: undefined }; var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(exception, applicationinsights_common_1.Exception.dataType, applicationinsights_common_1.Exception.envelopeType, this._logger, { url: url }); this.core.track(telemetryItem); }; // Mutate telemetryItem inplace to add boilerplate iKey & name info ApplicationInsights.prototype._setTelemetryNameAndIKey = function (telemetryItem) { telemetryItem.instrumentationKey = this._globalconfig.instrumentationKey; var iKeyNoDashes = this._globalconfig.instrumentationKey.replace(/-/g, ""); telemetryItem.name = telemetryItem.name.replace("{0}", iKeyNoDashes); }; ApplicationInsights.Version = "2.0.1-beta"; return ApplicationInsights; }()); exports.ApplicationInsights = ApplicationInsights; /** * Used to record timed events and page views. */ var Timing = /** @class */ (function () { function Timing(logger, name) { this._name = name; this._events = {}; this._logger = logger; } Timing.prototype.start = function (name) { if (typeof this._events[name] !== "undefined") { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StartCalledMoreThanOnce, "start was called more than once for this event without calling stop.", { name: this._name, key: name }, true); } this._events[name] = +new Date; }; Timing.prototype.stop = function (name, url, properties) { var start = this._events[name]; if (isNaN(start)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StopCalledWithoutStart, "stop was called without a corresponding start.", { name: this._name, key: name }, true); } else { var end = +new Date; var duration = applicationinsights_common_1.PageViewPerformance.getDuration(start, end); this.action(name, url, duration, properties); } delete this._events[name]; this._events[name] = undefined; }; return Timing; }()); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ApplicationInsights.js.map /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js ***! \*********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Class encapsulates sending page views and page view performance telemetry. */ var PageViewManager = /** @class */ (function () { function PageViewManager(appInsights, overridePageViewDuration, core) { this.pageViewPerformanceSent = false; this.overridePageViewDuration = false; this.overridePageViewDuration = overridePageViewDuration; this.appInsights = appInsights; if (core) { this._channel = function () { return (core.getTransmissionControls()); }; this._logger = core.logger; } } /** * Currently supported cases: * 1) (default case) track page view called with default parameters, overridePageViewDuration = false. Page view is sent with page view performance when navigation timing data is available. * a. If navigation timing is not supported then page view is sent right away with undefined duration. Page view performance is not sent. * 2) overridePageViewDuration = true, custom duration provided. Custom duration is used, page view sends right away. * 3) overridePageViewDuration = true, custom duration NOT provided. Page view is sent right away, duration is time spent from page load till now (or undefined if navigation timing is not supported). * 4) overridePageViewDuration = false, custom duration is provided. Page view is sent right away with custom duration. * * In all cases page view performance is sent once (only for the 1st call of trackPageView), or not sent if navigation timing is not supported. */ PageViewManager.prototype.trackPageView = function (pageView, customProperties) { var _this = this; var name = pageView.name; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(name) || typeof name !== "string") { pageView.name = window.document && window.document.title || ""; } var uri = pageView.uri; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(uri) || typeof uri !== "string") { pageView.uri = window.location && window.location.href || ""; } // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user // do not provide the duration, set duration to undefined // Also this is case 4 if (!applicationinsights_common_1.PageViewPerformance.isPerformanceTimingSupported()) { this.appInsights.sendPageViewInternal(pageView, customProperties); this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing) this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.NavigationTimingNotSupported, "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info."); return; } var pageViewSent = false; var customDuration = undefined; // if the performance timing is supported by the browser, calculate the custom duration var start = applicationinsights_common_1.PageViewPerformance.getPerformanceTiming().navigationStart; customDuration = applicationinsights_common_1.PageViewPerformance.getDuration(start, +new Date); if (!applicationinsights_common_1.PageViewPerformance.shouldCollectDuration(customDuration)) { customDuration = undefined; } // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier var duration = undefined; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties.duration)) { duration = customProperties.duration; } if (this.overridePageViewDuration || !isNaN(duration)) { if (isNaN(duration)) { // case 3 if (!customProperties) { customProperties = {}; } customProperties["duration"] = customDuration; } // case 2 this.appInsights.sendPageViewInternal(pageView, customProperties); this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); pageViewSent = true; } // now try to send the page view performance telemetry var maxDurationLimit = 60000; if (!customProperties) { customProperties = {}; } var handle = setInterval((function () { try { if (applicationinsights_common_1.PageViewPerformance.isPerformanceTimingDataReady()) { clearInterval(handle); var pageViewPerformance = new applicationinsights_common_1.PageViewPerformance(_this._logger, name, uri, null); if (!pageViewPerformance.getIsValid() && !pageViewSent) { // If navigation timing gives invalid numbers, then go back to "override page view duration" mode. // That's the best value we can get that makes sense. customProperties["duration"] = customDuration; _this.appInsights.sendPageViewInternal(pageView, customProperties); _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } else { if (!pageViewSent) { customProperties["duration"] = pageViewPerformance.getDurationMs(); _this.appInsights.sendPageViewInternal(pageView, customProperties); } if (!_this.pageViewPerformanceSent) { _this.appInsights.sendPageViewPerformanceInternal(pageViewPerformance, customProperties); _this.pageViewPerformanceSent = true; } _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } } else if (applicationinsights_common_1.PageViewPerformance.getDuration(start, +new Date) > maxDurationLimit) { // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready clearInterval(handle); if (!pageViewSent) { customProperties["duration"] = maxDurationLimit; _this.appInsights.sendPageViewInternal(pageView, customProperties); _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } } } catch (e) { _this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackPVFailedCalc, "trackPageView failed on page load calculation: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }), 100); }; return PageViewManager; }()); exports.PageViewManager = PageViewManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewManager.js.map /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./JavaScriptSDK/ApplicationInsights */ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, ApplicationInsights_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApplicationInsights = ApplicationInsights_1.ApplicationInsights; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-analytics-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ContextTagKeys = [ "ai.application.ver", "ai.application.build", "ai.application.typeId", "ai.application.applicationId", "ai.application.layer", "ai.device.id", "ai.device.ip", "ai.device.language", "ai.device.locale", "ai.device.model", "ai.device.friendlyName", "ai.device.network", "ai.device.networkName", "ai.device.oemName", "ai.device.os", "ai.device.osVersion", "ai.device.roleInstance", "ai.device.roleName", "ai.device.screenResolution", "ai.device.type", "ai.device.machineName", "ai.device.vmName", "ai.device.browser", "ai.device.browserVersion", "ai.location.ip", "ai.location.country", "ai.location.province", "ai.location.city", "ai.operation.id", "ai.operation.name", "ai.operation.parentId", "ai.operation.rootId", "ai.operation.syntheticSource", "ai.operation.correlationVector", "ai.session.id", "ai.session.isFirst", "ai.session.isNew", "ai.user.accountAcquisitionDate", "ai.user.accountId", "ai.user.userAgent", "ai.user.id", "ai.user.storeRegion", "ai.user.authUserId", "ai.user.anonUserAcquisitionDate", "ai.user.authUserAcquisitionDate", "ai.cloud.name", "ai.cloud.role", "ai.cloud.roleVer", "ai.cloud.roleInstance", "ai.cloud.environment", "ai.cloud.location", "ai.cloud.deploymentUnit", "ai.internal.sdkVersion", "ai.internal.agentVersion", "ai.internal.nodeName", ]; // these two constants are used to filter out properties not needed when trying to extract custom properties and measurements from the incoming payload var baseType = "baseType"; var baseData = "baseData"; var EnvelopeCreator = /** @class */ (function () { function EnvelopeCreator() { } EnvelopeCreator.extractProperties = function (data) { var customProperties = null; for (var key in data) { if (data.hasOwnProperty(key)) { var value = data[key]; if (typeof value !== "number") { if (!customProperties) { customProperties = {}; } customProperties[key] = value; } } } return customProperties; }; EnvelopeCreator.extractPropsAndMeasurements = function (data, properties, measurements) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(data)) { for (var key in data) { if (data.hasOwnProperty(key)) { var value = data[key]; if (typeof value === "number") { measurements[key] = value; } else { properties[key] = value; } } } } }; // TODO: Do we want this to take logger as arg or use this._logger as nonstatic? EnvelopeCreator.createEnvelope = function (logger, envelopeType, telemetryItem, data) { var envelope = new applicationinsights_common_1.Envelope(logger, data, envelopeType); envelope.iKey = telemetryItem.instrumentationKey; var iKeyNoDashes = telemetryItem.instrumentationKey.replace(/-/g, ""); envelope.name = envelope.name.replace("{0}", iKeyNoDashes); // loop through the envelope ctx (Part A) and pick out the ones that should go in outgoing envelope tags for (var key in telemetryItem.ctx) { if (telemetryItem.ctx.hasOwnProperty(key)) { if (exports.ContextTagKeys.indexOf(key) >= 0) { envelope.tags[key] = telemetryItem.ctx[key]; } } } // loop through the envelope tags (extension of Part A) and pick out the ones that should go in outgoing envelope tags telemetryItem.tags.forEach(function (tag) { for (var key in tag) { if (tag.hasOwnProperty(key)) { if (exports.ContextTagKeys.indexOf(key) >= 0) { envelope.tags[key] = tag[key]; } } } }); return envelope; }; return EnvelopeCreator; }()); exports.EnvelopeCreator = EnvelopeCreator; var DependencyEnvelopeCreator = /** @class */ (function (_super) { __extends(DependencyEnvelopeCreator, _super); function DependencyEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } DependencyEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customMeasurements = {}; var customProperties = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var bd = telemetryItem.baseData; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(bd)) { logger.warnToConsole("Invalid input for dependency data"); return null; } var id = bd.id; var absoluteUrl = bd.absoluteUrl; var command = bd.commandName; var duration = bd.duration; var success = bd.success; var resultCode = bd.resultCode; var method = bd.method; var baseData = new applicationinsights_common_1.RemoteDependencyData(logger, id, absoluteUrl, command, duration, success, resultCode, method, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.RemoteDependencyData.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.RemoteDependencyData.envelopeType, telemetryItem, data); }; DependencyEnvelopeCreator.DependencyEnvelopeCreator = new DependencyEnvelopeCreator(); return DependencyEnvelopeCreator; }(EnvelopeCreator)); exports.DependencyEnvelopeCreator = DependencyEnvelopeCreator; var EventEnvelopeCreator = /** @class */ (function (_super) { __extends(EventEnvelopeCreator, _super); function EventEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } EventEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; if (telemetryItem.baseType !== applicationinsights_common_1.Event.dataType) { EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.baseData, customProperties, customMeasurements); } EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var eventName = telemetryItem.baseData.name; var baseData = new applicationinsights_common_1.Event(logger, eventName, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Event.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Event.envelopeType, telemetryItem, data); }; EventEnvelopeCreator.EventEnvelopeCreator = new EventEnvelopeCreator(); return EventEnvelopeCreator; }(EnvelopeCreator)); exports.EventEnvelopeCreator = EventEnvelopeCreator; var ExceptionEnvelopeCreator = /** @class */ (function (_super) { __extends(ExceptionEnvelopeCreator, _super); function ExceptionEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } ExceptionEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var exception = telemetryItem.baseData.error; var severityLevel = telemetryItem.baseData.severityLevel; var baseData = new applicationinsights_common_1.Exception(logger, exception, customProperties, customMeasurements, severityLevel); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Exception.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Exception.envelopeType, telemetryItem, data); }; ExceptionEnvelopeCreator.ExceptionEnvelopeCreator = new ExceptionEnvelopeCreator(); return ExceptionEnvelopeCreator; }(EnvelopeCreator)); exports.ExceptionEnvelopeCreator = ExceptionEnvelopeCreator; var MetricEnvelopeCreator = /** @class */ (function (_super) { __extends(MetricEnvelopeCreator, _super); function MetricEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } MetricEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = EnvelopeCreator.extractProperties(telemetryItem.data); var name = telemetryItem.baseData.name; var average = telemetryItem.baseData.average; var sampleCount = telemetryItem.baseData.sampleCount; var min = telemetryItem.baseData.min; var max = telemetryItem.baseData.max; var baseData = new applicationinsights_common_1.Metric(logger, name, average, sampleCount, min, max, customProperties); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Metric.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Metric.envelopeType, telemetryItem, data); }; MetricEnvelopeCreator.MetricEnvelopeCreator = new MetricEnvelopeCreator(); return MetricEnvelopeCreator; }(EnvelopeCreator)); exports.MetricEnvelopeCreator = MetricEnvelopeCreator; var PageViewEnvelopeCreator = /** @class */ (function (_super) { __extends(PageViewEnvelopeCreator, _super); function PageViewEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } PageViewEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } // Since duration is not part of the domain properties in Common Schema, extract it from part C var duration = undefined; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.data) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.data.duration)) { duration = telemetryItem.data.duration; delete telemetryItem.data.duration; } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var name = telemetryItem.baseData.name; var url = telemetryItem.baseData.uri; // Todo: move IPageViewTelemetry to common as we are missing type checks on baseData here // refUri is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.refUri)) { customProperties["refUri"] = telemetryItem.baseData.refUri; } // pageType is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.pageType)) { customProperties["pageType"] = telemetryItem.baseData.pageType; } // isLoggedIn is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.isLoggedIn)) { customProperties["isLoggedIn"] = telemetryItem.baseData.isLoggedIn; } // pageTags is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.pageTags)) { var pageTags = telemetryItem.baseData.pageTags; for (var key in pageTags) { if (pageTags.hasOwnProperty(key)) { customProperties[key] = pageTags[key]; } } } var baseData = new applicationinsights_common_1.PageView(logger, name, url, duration, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.PageView.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.PageView.envelopeType, telemetryItem, data); }; PageViewEnvelopeCreator.PageViewEnvelopeCreator = new PageViewEnvelopeCreator(); return PageViewEnvelopeCreator; }(EnvelopeCreator)); exports.PageViewEnvelopeCreator = PageViewEnvelopeCreator; var PageViewPerformanceEnvelopeCreator = /** @class */ (function (_super) { __extends(PageViewPerformanceEnvelopeCreator, _super); function PageViewPerformanceEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } PageViewPerformanceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var name = telemetryItem.baseData.name; var url = telemetryItem.baseData.uri; var duration = telemetryItem.baseData.duration; var baseData = new applicationinsights_common_1.PageViewPerformance(logger, name, url, duration, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.PageViewPerformance.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.PageViewPerformance.envelopeType, telemetryItem, data); }; PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator = new PageViewPerformanceEnvelopeCreator(); return PageViewPerformanceEnvelopeCreator; }(EnvelopeCreator)); exports.PageViewPerformanceEnvelopeCreator = PageViewPerformanceEnvelopeCreator; var TraceEnvelopeCreator = /** @class */ (function (_super) { __extends(TraceEnvelopeCreator, _super); function TraceEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } TraceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var message = telemetryItem.baseData.message; var severityLevel = telemetryItem.baseData.severityLevel; var customProperties = EnvelopeCreator.extractProperties(telemetryItem.data); var baseData = new applicationinsights_common_1.Trace(logger, message, customProperties, severityLevel); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Trace.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Trace.envelopeType, telemetryItem, data); }; TraceEnvelopeCreator.TraceEnvelopeCreator = new TraceEnvelopeCreator(); return TraceEnvelopeCreator; }(EnvelopeCreator)); exports.TraceEnvelopeCreator = TraceEnvelopeCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EnvelopeCreator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js": /*!**************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* * An array based send buffer. */ var ArraySendBuffer = /** @class */ (function () { function ArraySendBuffer(config) { this._config = config; this._buffer = []; } ArraySendBuffer.prototype.enqueue = function (payload) { this._buffer.push(payload); }; ArraySendBuffer.prototype.count = function () { return this._buffer.length; }; ArraySendBuffer.prototype.clear = function () { this._buffer.length = 0; }; ArraySendBuffer.prototype.getItems = function () { return this._buffer.slice(0); }; ArraySendBuffer.prototype.batchPayloads = function (payload) { if (payload && payload.length > 0) { var batch = this._config.emitLineDelimitedJson() ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; ArraySendBuffer.prototype.markAsSent = function (payload) { this.clear(); }; ArraySendBuffer.prototype.clearSent = function (payload) { // not supported }; return ArraySendBuffer; }()); exports.ArraySendBuffer = ArraySendBuffer; /* * Session storege buffer holds a copy of all unsent items in the browser session storage. */ var SessionStorageSendBuffer = /** @class */ (function () { function SessionStorageSendBuffer(logger, config) { this._bufferFullMessageSent = false; this._logger = logger; this._config = config; var bufferItems = this.getBuffer(SessionStorageSendBuffer.BUFFER_KEY); var notDeliveredItems = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); this._buffer = bufferItems.concat(notDeliveredItems); // If the buffer has too many items, drop items from the end. if (this._buffer.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { this._buffer.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } // update DataLossAnalyzer with the number of recovered items // Uncomment if you want to use DataLossanalyzer // DataLossAnalyzer.itemsRestoredFromSessionBuffer = this._buffer.length; this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); } SessionStorageSendBuffer.prototype.enqueue = function (payload) { if (this._buffer.length >= SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // sent internal log only once per page view if (!this._bufferFullMessageSent) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SessionStorageBufferFull, "Maximum buffer size reached: " + this._buffer.length, true); this._bufferFullMessageSent = true; } return; } this._buffer.push(payload); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); }; SessionStorageSendBuffer.prototype.count = function () { return this._buffer.length; }; SessionStorageSendBuffer.prototype.clear = function () { this._buffer.length = 0; this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, []); this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); this._bufferFullMessageSent = false; }; SessionStorageSendBuffer.prototype.getItems = function () { return this._buffer.slice(0); }; SessionStorageSendBuffer.prototype.batchPayloads = function (payload) { if (payload && payload.length > 0) { var batch = this._config.emitLineDelimitedJson() ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; SessionStorageSendBuffer.prototype.markAsSent = function (payload) { this._buffer = this.removePayloadsFromBuffer(payload, this._buffer); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); if (sentElements instanceof Array && payload instanceof Array) { sentElements = sentElements.concat(payload); if (sentElements.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // We send telemetry normally. If the SENT_BUFFER is too big we don't add new elements // until we receive a response from the backend and the buffer has free space again (see clearSent method) this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.SessionStorageBufferFull, "Sent buffer reached its maximum size: " + sentElements.length, true); sentElements.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); } }; SessionStorageSendBuffer.prototype.clearSent = function (payload) { var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); sentElements = this.removePayloadsFromBuffer(payload, sentElements); this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); }; SessionStorageSendBuffer.prototype.removePayloadsFromBuffer = function (payloads, buffer) { var remaining = []; for (var i in buffer) { var contains = false; for (var j in payloads) { if (payloads[j] === buffer[i]) { contains = true; break; } } if (!contains) { remaining.push(buffer[i]); } } ; return remaining; }; SessionStorageSendBuffer.prototype.getBuffer = function (key) { try { var bufferJson = applicationinsights_common_1.Util.getSessionStorage(this._logger, key); if (bufferJson) { var buffer = JSON.parse(bufferJson); if (buffer) { return buffer; } } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedToRestoreStorageBuffer, " storage key: " + key + ", " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } return []; }; SessionStorageSendBuffer.prototype.setBuffer = function (key, buffer) { try { var bufferJson = JSON.stringify(buffer); applicationinsights_common_1.Util.setSessionStorage(this._logger, key, bufferJson); } catch (e) { // if there was an error, clear the buffer // telemetry is stored in the _buffer array so we won't loose any items applicationinsights_common_1.Util.setSessionStorage(this._logger, key, JSON.stringify([])); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedToSetStorageBuffer, " storage key: " + key + ", " + applicationinsights_common_1.Util.getExceptionName(e) + ". Buffer cleared", { exception: applicationinsights_common_1.Util.dump(e) }); } }; SessionStorageSendBuffer.BUFFER_KEY = "AI_buffer"; SessionStorageSendBuffer.SENT_BUFFER_KEY = "AI_sentBuffer"; // Maximum number of payloads stored in the buffer. If the buffer is full, new elements will be dropped. SessionStorageSendBuffer.MAX_BUFFER_SIZE = 2000; return SessionStorageSendBuffer; }()); exports.SessionStorageSendBuffer = SessionStorageSendBuffer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SendBuffer.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Sender.js": /*!**********************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Sender.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./SendBuffer */ "./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js"), __webpack_require__(/*! ./EnvelopeCreator */ "./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js"), __webpack_require__(/*! ./TelemetryValidation/EventValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js"), __webpack_require__(/*! ./TelemetryValidation/TraceValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js"), __webpack_require__(/*! ./TelemetryValidation/ExceptionValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js"), __webpack_require__(/*! ./TelemetryValidation/MetricValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js"), __webpack_require__(/*! ./TelemetryValidation/PageViewPerformanceValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js"), __webpack_require__(/*! ./TelemetryValidation/PageViewValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js"), __webpack_require__(/*! ./TelemetryValidation/RemoteDepdencyValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js"), __webpack_require__(/*! ./Serializer */ "./node_modules/applicationinsights-channel-js/bundle/Serializer.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, SendBuffer_1, EnvelopeCreator_1, EventValidator_1, TraceValidator_1, ExceptionValidator_1, MetricValidator_1, PageViewPerformanceValidator_1, PageViewValidator_1, RemoteDepdencyValidator_1, Serializer_1, applicationinsights_common_1, applicationinsights_core_js_1, applicationinsights_core_js_2) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Sender = /** @class */ (function () { function Sender() { this.priority = 201; /** * Whether XMLHttpRequest object is supported. Older version of IE (8,9) do not support it. */ this._XMLHttpRequestSupported = false; } Sender.prototype.pause = function () { throw new Error("Method not implemented."); }; Sender.prototype.resume = function () { throw new Error("Method not implemented."); }; Sender.prototype.flush = function () { try { this.triggerSend(); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FlushFailed, "flush failed, telemetry will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; Sender.prototype.teardown = function () { throw new Error("Method not implemented."); }; Sender.prototype.initialize = function (config, core, extensions) { this.identifier = "AppInsightsChannelPlugin"; this._logger = core.logger; this._serializer = new Serializer_1.Serializer(core.logger); this._consecutiveErrors = 0; this._retryAt = null; this._lastSend = 0; this._config = Sender._getDefaultAppInsightsChannelConfig(config, this.identifier); this._sender = null; this._buffer = (applicationinsights_common_1.Util.canUseSessionStorage() && this._config.enableSessionStorageBuffer) ? new SendBuffer_1.SessionStorageSendBuffer(this._logger, this._config) : new SendBuffer_1.ArraySendBuffer(this._config); if (!this._config.isBeaconApiDisabled() && applicationinsights_common_1.Util.IsBeaconApiSupported()) { this._sender = this._beaconSender; } else { if (typeof XMLHttpRequest != "undefined") { var testXhr = new XMLHttpRequest(); if ("withCredentials" in testXhr) { this._sender = this._xhrSender; this._XMLHttpRequestSupported = true; } else if (typeof XDomainRequest !== "undefined") { this._sender = this._xdrSender; //IE 8 and 9 } } } }; Sender.prototype.processTelemetry = function (telemetryItem) { try { // if master off switch is set, don't send any data if (this._config.disableTelemetry()) { // Do not send/save data return; } // validate input if (!telemetryItem) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSendEmptyTelemetry, "Cannot send empty telemetry"); return; } // ensure a sender was constructed if (!this._sender) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.SenderNotInitialized, "Sender was not initialized"); return; } // first we need to validate that the envelope passed down is valid var isValid = Sender._validate(telemetryItem); if (!isValid) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "Invalid telemetry envelope"); return; } // construct an envelope that Application Insights endpoint can understand var aiEnvelope = this._constructEnvelope(telemetryItem); if (!aiEnvelope) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CreateEnvelopeError, "Unable to create an AppInsights envelope"); return; } // check if the incoming payload is too large, truncate if necessary var payload = this._serializer.serialize(aiEnvelope); // flush if we would exceed the max-size limit by adding this item var bufferPayload = this._buffer.getItems(); var batch = this._buffer.batchPayloads(bufferPayload); if (batch && (batch.length + payload.length > this._config.maxBatchSizeInBytes())) { this.triggerSend(); } // enqueue the payload this._buffer.enqueue(payload); // ensure an invocation timeout is set this._setupTimer(); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedAddingTelemetryToBuffer, "Failed adding telemetry to the sender's buffer, some telemetry will be lost: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } // hand off the telemetry item to the next plugin if (!applicationinsights_core_js_2.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(telemetryItem); } }; Sender.prototype.setNextPlugin = function (next) { this._nextPlugin = next; }; /** * xhr state changes */ Sender.prototype._xhrReadyStateChange = function (xhr, payload, countOfItemsInPayload) { if (xhr.readyState === 4) { var response = null; if (!this._appId) { response = this._parseResponse(xhr.responseText || xhr.response); if (response && response.appId) { this._appId = response.appId; } } if ((xhr.status < 200 || xhr.status >= 300) && xhr.status !== 0) { if (!this._config.isRetryDisabled() && this._isRetriable(xhr.status)) { this._resendPayload(payload); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Response code " + xhr.status + ". Will retry to send " + payload.length + " items."); } else { this._onError(payload, this._formatErrorMessageXhr(xhr)); } } else { if (xhr.status === 206) { if (!response) { response = this._parseResponse(xhr.responseText || xhr.response); } if (response && !this._config.isRetryDisabled()) { this._onPartialSuccess(payload, response); } else { this._onError(payload, this._formatErrorMessageXhr(xhr)); } } else { this._consecutiveErrors = 0; this._onSuccess(payload, countOfItemsInPayload); } } } }; /** * Immediately send buffered data * @param async {boolean} - Indicates if the events should be sent asynchronously */ Sender.prototype.triggerSend = function (async) { if (async === void 0) { async = true; } try { // Send data only if disableTelemetry is false if (!this._config.disableTelemetry()) { if (this._buffer.count() > 0) { var payload = this._buffer.getItems(); // invoke send this._sender(payload, async); } // update lastSend time to enable throttling this._lastSend = +new Date; } else { this._buffer.clear(); } clearTimeout(this._timeoutHandle); this._timeoutHandle = null; this._retryAt = null; } catch (e) { /* Ignore this error for IE under v10 */ if (!applicationinsights_common_1.Util.getIEVersion() || applicationinsights_common_1.Util.getIEVersion() > 9) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, "Telemetry transmission failed, some telemetry will be lost: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } } }; /** * error handler */ Sender.prototype._onError = function (payload, message, event) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.OnError, "Failed to send telemetry.", { message: message }); this._buffer.clearSent(payload); }; /** * partial success handler */ Sender.prototype._onPartialSuccess = function (payload, results) { var failed = []; var retry = []; // Iterate through the reversed array of errors so that splicing doesn't have invalid indexes after the first item. var errors = results.errors.reverse(); for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) { var error = errors_1[_i]; var extracted = payload.splice(error.index, 1)[0]; if (this._isRetriable(error.statusCode)) { retry.push(extracted); } else { // All other errors, including: 402 (Monthly quota exceeded) and 439 (Too many requests and refresh cache). failed.push(extracted); } } if (payload.length > 0) { this._onSuccess(payload, results.itemsAccepted); } if (failed.length > 0) { this._onError(failed, this._formatErrorMessageXhr(null, ['partial success', results.itemsAccepted, 'of', results.itemsReceived].join(' '))); } if (retry.length > 0) { this._resendPayload(retry); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, "Partial success. " + "Delivered: " + payload.length + ", Failed: " + failed.length + ". Will retry to send " + retry.length + " our of " + results.itemsReceived + " items"); } }; /** * success handler */ Sender.prototype._onSuccess = function (payload, countOfItemsInPayload) { this._buffer.clearSent(payload); }; /** * xdr state changes */ Sender.prototype._xdrOnLoad = function (xdr, payload) { if (xdr && (xdr.responseText + "" === "200" || xdr.responseText === "")) { this._consecutiveErrors = 0; this._onSuccess(payload, 0); } else { var results = this._parseResponse(xdr.responseText); if (results && results.itemsReceived && results.itemsReceived > results.itemsAccepted && !this._config.isRetryDisabled()) { this._onPartialSuccess(payload, results); } else { this._onError(payload, this._formatErrorMessageXdr(xdr)); } } }; Sender.prototype._constructEnvelope = function (envelope) { switch (envelope.baseType) { case applicationinsights_common_1.Event.dataType: return EnvelopeCreator_1.EventEnvelopeCreator.EventEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Trace.dataType: return EnvelopeCreator_1.TraceEnvelopeCreator.TraceEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.PageView.dataType: return EnvelopeCreator_1.PageViewEnvelopeCreator.PageViewEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.PageViewPerformance.dataType: return EnvelopeCreator_1.PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Exception.dataType: return EnvelopeCreator_1.ExceptionEnvelopeCreator.ExceptionEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Metric.dataType: return EnvelopeCreator_1.MetricEnvelopeCreator.MetricEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.RemoteDependencyData.dataType: return EnvelopeCreator_1.DependencyEnvelopeCreator.DependencyEnvelopeCreator.Create(this._logger, envelope); default: // default create custom event type return EnvelopeCreator_1.EventEnvelopeCreator.EventEnvelopeCreator.Create(this._logger, envelope); } }; Sender._getDefaultAppInsightsChannelConfig = function (config, identifier) { var resultConfig = {}; var pluginConfig = config.extensionConfig && config.extensionConfig[identifier] ? config.extensionConfig[identifier] : {}; // set default values resultConfig.endpointUrl = function () { return config.endpointUrl || "https://dc.services.visualstudio.com/v2/track"; }; resultConfig.emitLineDelimitedJson = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.emitLineDelimitedJson); }; resultConfig.maxBatchInterval = function () { return !isNaN(pluginConfig.maxBatchInterval) ? pluginConfig.maxBatchInterval : 15000; }; resultConfig.maxBatchSizeInBytes = function () { return pluginConfig.maxBatchSizeInBytes > 0 ? pluginConfig.maxBatchSizeInBytes : 102400; }; // 100kb resultConfig.disableTelemetry = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.disableTelemetry); }; resultConfig.enableSessionStorageBuffer = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.enableSessionStorageBuffer, true); }; resultConfig.isRetryDisabled = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.isRetryDisabled); }; resultConfig.isBeaconApiDisabled = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.isBeaconApiDisabled, true); }; return resultConfig; }; Sender._validate = function (envelope) { // call the appropriate Validate depending on the baseType switch (envelope.baseType) { case applicationinsights_common_1.Event.dataType: return EventValidator_1.EventValidator.EventValidator.Validate(envelope); case applicationinsights_common_1.Trace.dataType: return TraceValidator_1.TraceValidator.TraceValidator.Validate(envelope); case applicationinsights_common_1.Exception.dataType: return ExceptionValidator_1.ExceptionValidator.ExceptionValidator.Validate(envelope); case applicationinsights_common_1.Metric.dataType: return MetricValidator_1.MetricValidator.MetricValidator.Validate(envelope); case applicationinsights_common_1.PageView.dataType: return PageViewValidator_1.PageViewValidator.PageViewValidator.Validate(envelope); case applicationinsights_common_1.PageViewPerformance.dataType: return PageViewPerformanceValidator_1.PageViewPerformanceValidator.PageViewPerformanceValidator.Validate(envelope); case applicationinsights_common_1.RemoteDependencyData.dataType: return RemoteDepdencyValidator_1.RemoteDepdencyValidator.RemoteDepdencyValidator.Validate(envelope); default: return EventValidator_1.EventValidator.EventValidator.Validate(envelope); } }; /** * Send Beacon API request * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - not used * Note: Beacon API does not support custom headers and we are not able to get * appId from the backend for the correct correlation. */ Sender.prototype._beaconSender = function (payload, isAsync) { var url = this._config.endpointUrl(); var batch = this._buffer.batchPayloads(payload); // Chrome only allows CORS-safelisted values for the sendBeacon data argument // see: https://bugs.chromium.org/p/chromium/issues/detail?id=720283 var plainTextBatch = new Blob([batch], { type: 'text/plain;charset=UTF-8' }); // The sendBeacon method returns true if the user agent is able to successfully queue the data for transfer. Otherwise it returns false. var queued = navigator.sendBeacon(url, plainTextBatch); if (queued) { this._buffer.markAsSent(payload); } else { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Failed to send telemetry with Beacon API."); } }; /** * Send XMLHttpRequest * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - Indicates if the request should be sent asynchronously */ Sender.prototype._xhrSender = function (payload, isAsync) { var _this = this; var xhr = new XMLHttpRequest(); xhr[applicationinsights_common_1.DisabledPropertyName] = true; xhr.open("POST", this._config.endpointUrl(), isAsync); xhr.setRequestHeader("Content-type", "application/json"); // append Sdk-Context request header only in case of breeze endpoint if (applicationinsights_common_1.Util.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.sdkContextHeader, applicationinsights_common_1.RequestHeaders.sdkContextHeaderAppIdRequest); } xhr.onreadystatechange = function () { return _this._xhrReadyStateChange(xhr, payload, payload.length); }; xhr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXhr(xhr), event); }; // compose an array of payloads var batch = this._buffer.batchPayloads(payload); xhr.send(batch); this._buffer.markAsSent(payload); }; /** * Parses the response from the backend. * @param response - XMLHttpRequest or XDomainRequest response */ Sender.prototype._parseResponse = function (response) { try { if (response && response !== "") { var result = JSON.parse(response); if (result && result.itemsReceived && result.itemsReceived >= result.itemsAccepted && result.itemsReceived - result.itemsAccepted == result.errors.length) { return result; } } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.InvalidBackendResponse, "Cannot parse the response. " + applicationinsights_common_1.Util.getExceptionName(e), { response: response }); } return null; }; /** * Resend payload. Adds payload back to the send buffer and setup a send timer (with exponential backoff). * @param payload */ Sender.prototype._resendPayload = function (payload) { if (!payload || payload.length === 0) { return; } this._buffer.clearSent(payload); this._consecutiveErrors++; for (var _i = 0, payload_1 = payload; _i < payload_1.length; _i++) { var item = payload_1[_i]; this._buffer.enqueue(item); } // setup timer this._setRetryTime(); this._setupTimer(); }; /** Calculates the time to wait before retrying in case of an error based on * http://en.wikipedia.org/wiki/Exponential_backoff */ Sender.prototype._setRetryTime = function () { var SlotDelayInSeconds = 10; var delayInSeconds; if (this._consecutiveErrors <= 1) { delayInSeconds = SlotDelayInSeconds; } else { var backOffSlot = (Math.pow(2, this._consecutiveErrors) - 1) / 2; // tslint:disable-next-line:insecure-random var backOffDelay = Math.floor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1; delayInSeconds = Math.max(Math.min(backOffDelay, 3600), SlotDelayInSeconds); } // TODO: Log the backoff time like the C# version does. var retryAfterTimeSpan = Date.now() + (delayInSeconds * 1000); // TODO: Log the retry at time like the C# version does. this._retryAt = retryAfterTimeSpan; }; /** * Sets up the timer which triggers actually sending the data. */ Sender.prototype._setupTimer = function () { var _this = this; if (!this._timeoutHandle) { var retryInterval = this._retryAt ? Math.max(0, this._retryAt - Date.now()) : 0; var timerValue = Math.max(this._config.maxBatchInterval(), retryInterval); this._timeoutHandle = setTimeout(function () { _this.triggerSend(); }, timerValue); } }; /** * Checks if the SDK should resend the payload after receiving this status code from the backend. * @param statusCode */ Sender.prototype._isRetriable = function (statusCode) { return statusCode == 408 // Timeout || statusCode == 429 // Too many requests. || statusCode == 500 // Internal server error. || statusCode == 503; // Service unavailable. }; Sender.prototype._formatErrorMessageXhr = function (xhr, message) { if (xhr) { return "XMLHttpRequest,Status:" + xhr.status + ",Response:" + xhr.responseText || xhr.response || ""; } return message; }; /** * Send XDomainRequest * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - Indicates if the request should be sent asynchronously * * Note: XDomainRequest does not support sync requests. This 'isAsync' parameter is added * to maintain consistency with the xhrSender's contract * Note: XDomainRequest does not support custom headers and we are not able to get * appId from the backend for the correct correlation. */ Sender.prototype._xdrSender = function (payload, isAsync) { var _this = this; var xdr = new XDomainRequest(); xdr.onload = function () { return _this._xdrOnLoad(xdr, payload); }; xdr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXdr(xdr), event); }; // XDomainRequest requires the same protocol as the hosting page. // If the protocol doesn't match, we can't send the telemetry :(. var hostingProtocol = window.location.protocol; if (this._config.endpointUrl().lastIndexOf(hostingProtocol, 0) !== 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."); this._buffer.clear(); return; } var endpointUrl = this._config.endpointUrl().replace(/^(https?:)/, ""); xdr.open('POST', endpointUrl); // compose an array of payloads var batch = this._buffer.batchPayloads(payload); xdr.send(batch); this._buffer.markAsSent(payload); }; Sender.prototype._formatErrorMessageXdr = function (xdr, message) { if (xdr) { return "XDomainRequest,Response:" + xdr.responseText || ""; } return message; }; return Sender; }()); exports.Sender = Sender; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Sender.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Serializer.js": /*!**************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Serializer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Serializer = /** @class */ (function () { function Serializer(logger) { this._logger = logger; } /** * Serializes the current object to a JSON string. */ Serializer.prototype.serialize = function (input) { var output = this._serializeObject(input, "root"); return JSON.stringify(output); }; Serializer.prototype._serializeObject = function (source, name) { var circularReferenceCheck = "__aiCircularRefCheck"; var output = {}; if (!source) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObject, "cannot serialize object because it is null or undefined", { name: name }, true); return output; } if (source[circularReferenceCheck]) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CircularReferenceDetected, "Circular reference detected while serializing object", { name: name }, true); return output; } if (!source.aiDataContract) { // special case for measurements/properties/tags if (name === "measurements") { output = this._serializeStringMap(source, "number", name); } else if (name === "properties") { output = this._serializeStringMap(source, "string", name); } else if (name === "tags") { output = this._serializeStringMap(source, "string", name); } else if (applicationinsights_common_1.Util.isArray(source)) { output = this._serializeArray(source, name); } else { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObjectNonSerializable, "Attempting to serialize an object which does not implement ISerializable", { name: name }, true); try { // verify that the object can be stringified JSON.stringify(source); output = source; } catch (e) { // if serialization fails return an empty string this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObject, (e && typeof e.toString === 'function') ? e.toString() : "Error serializing object", null, true); } } return output; } source[circularReferenceCheck] = true; for (var field in source.aiDataContract) { var contract = source.aiDataContract[field]; var isRequired = (typeof contract === "function") ? (contract() & applicationinsights_common_1.FieldType.Required) : (contract & applicationinsights_common_1.FieldType.Required); var isHidden = (typeof contract === "function") ? (contract() & applicationinsights_common_1.FieldType.Hidden) : (contract & applicationinsights_common_1.FieldType.Hidden); var isArray = contract & applicationinsights_common_1.FieldType.Array; var isPresent = source[field] !== undefined; var isObject = typeof source[field] === "object" && source[field] !== null; if (isRequired && !isPresent && !isArray) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.MissingRequiredFieldSpecification, "Missing required field specification. The field is required but not present on source", { field: field, name: name }); // If not in debug mode, continue and hope the error is permissible continue; } if (isHidden) { // Don't serialize hidden fields continue; } var value; if (isObject) { if (isArray) { // special case; resurse on each object in the source array value = this._serializeArray(source[field], field); } else { // recurse on the source object in this field value = this._serializeObject(source[field], field); } } else { // assign the source field to the output even if undefined or required value = source[field]; } // only emit this field if the value is defined if (value !== undefined) { output[field] = value; } } delete source[circularReferenceCheck]; return output; }; Serializer.prototype._serializeArray = function (sources, name) { var output = undefined; if (!!sources) { if (!applicationinsights_common_1.Util.isArray(sources)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ItemNotInArray, "This field was specified as an array in the contract but the item is not an array.\r\n", { name: name }, true); } else { output = []; for (var i = 0; i < sources.length; i++) { var source = sources[i]; var item = this._serializeObject(source, name + "[" + i + "]"); output.push(item); } } } return output; }; Serializer.prototype._serializeStringMap = function (map, expectedType, name) { var output = undefined; if (map) { output = {}; for (var field in map) { var value = map[field]; if (expectedType === "string") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else if (!value.toString) { output[field] = "invalid field: toString() is not defined."; } else { output[field] = value.toString(); } } else if (expectedType === "number") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else { var num = parseFloat(value); if (isNaN(num)) { output[field] = "NaN"; } else { output[field] = num; } } } else { output[field] = "invalid field: " + name + " is of unknown type."; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, output[field], null, true); } } } return output; }; return Serializer; }()); exports.Serializer = Serializer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Serializer.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var EventValidator = /** @class */ (function () { function EventValidator() { } EventValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["name"]) { return false; } */ return true; }; EventValidator.EventValidator = new EventValidator(); return EventValidator; }()); exports.EventValidator = EventValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var ExceptionValidator = /** @class */ (function () { function ExceptionValidator() { } ExceptionValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["exceptions"] || !ExceptionValidator._validateExceptions(item.domainProperties["exceptions"])) { return false; } */ return true; }; // TODO implement validation of exceptions ExceptionValidator._validateExceptions = function (exceptions) { // typeName // message // parsedStack // stack // hasFullStack return true; }; ExceptionValidator.ExceptionValidator = new ExceptionValidator(); return ExceptionValidator; }()); exports.ExceptionValidator = ExceptionValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var MetricValidator = /** @class */ (function () { function MetricValidator() { } MetricValidator.prototype.Validate = function (event) { return true; }; MetricValidator.MetricValidator = new MetricValidator(); return MetricValidator; }()); exports.MetricValidator = MetricValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MetricValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js": /*!****************************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js ***! \****************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewPerformanceValidator = /** @class */ (function () { function PageViewPerformanceValidator() { } PageViewPerformanceValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["domProcessing"] || !item.domainProperties["duration"] || !item.domainProperties["name"] || !item.domainProperties["networkConnect"] || !item.domainProperties["perfTotal"] || !item.domainProperties["receivedResponse"] || !item.domainProperties["sentRequest"] || !item.domainProperties["url"]) { return false; } */ return true; }; PageViewPerformanceValidator.PageViewPerformanceValidator = new PageViewPerformanceValidator(); return PageViewPerformanceValidator; }()); exports.PageViewPerformanceValidator = PageViewPerformanceValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerformanceValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewValidator = /** @class */ (function () { function PageViewValidator() { } PageViewValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["id"] || !item.domainProperties["name"] || !item.domainProperties["duration"] || !item.domainProperties["url"]) { return false; } */ return true; }; PageViewValidator.PageViewValidator = new PageViewValidator(); return PageViewValidator; }()); exports.PageViewValidator = PageViewValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RemoteDepdencyValidator = /** @class */ (function () { function RemoteDepdencyValidator() { } RemoteDepdencyValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["id"] || !item.domainProperties["name"] || !item.domainProperties["resultCode"] || !item.domainProperties["duration"] || !item.domainProperties["success"] || !item.domainProperties["data"] || !item.domainProperties["target"] || !item.domainProperties["type"]) { return false; } */ return true; }; RemoteDepdencyValidator.RemoteDepdencyValidator = new RemoteDepdencyValidator(); return RemoteDepdencyValidator; }()); exports.RemoteDepdencyValidator = RemoteDepdencyValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDepdencyValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TraceValidator = /** @class */ (function () { function TraceValidator() { } TraceValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["message"] || !item.domainProperties["severityLevel"]) { return false; } */ return true; }; TraceValidator.TraceValidator = new TraceValidator(); return TraceValidator; }()); exports.TraceValidator = TraceValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=TraceValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js": /*!**********************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js ***! \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Sender */ "./node_modules/applicationinsights-channel-js/bundle/Sender.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Sender_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Sender = Sender_1.Sender; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-channel-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Constants.js": /*!*********************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Constants.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Constants.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Enums.js": /*!*****************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Enums.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Type of storage to differentiate between local storage and session storage */ var StorageType; (function (StorageType) { StorageType[StorageType["LocalStorage"] = 0] = "LocalStorage"; StorageType[StorageType["SessionStorage"] = 1] = "SessionStorage"; })(StorageType = exports.StorageType || (exports.StorageType = {})); /** * Enum is used in aiDataContract to describe how fields are serialized. * For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array */ var FieldType; (function (FieldType) { FieldType[FieldType["Default"] = 0] = "Default"; FieldType[FieldType["Required"] = 1] = "Required"; FieldType[FieldType["Array"] = 2] = "Array"; FieldType[FieldType["Hidden"] = 4] = "Hidden"; })(FieldType = exports.FieldType || (exports.FieldType = {})); ; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Enums.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js": /*!***********************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Data struct to contain only C section with custom fields. */ var Base = /** @class */ (function () { function Base() { } return Base; }()); exports.Base = Base; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Base.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js ***! \*********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED var ContextTagKeys = /** @class */ (function () { function ContextTagKeys() { this.applicationVersion = "ai.application.ver"; this.applicationBuild = "ai.application.build"; this.applicationTypeId = "ai.application.typeId"; this.applicationId = "ai.application.applicationId"; this.applicationLayer = "ai.application.layer"; this.deviceId = "ai.device.id"; this.deviceIp = "ai.device.ip"; this.deviceLanguage = "ai.device.language"; this.deviceLocale = "ai.device.locale"; this.deviceModel = "ai.device.model"; this.deviceFriendlyName = "ai.device.friendlyName"; this.deviceNetwork = "ai.device.network"; this.deviceNetworkName = "ai.device.networkName"; this.deviceOEMName = "ai.device.oemName"; this.deviceOS = "ai.device.os"; this.deviceOSVersion = "ai.device.osVersion"; this.deviceRoleInstance = "ai.device.roleInstance"; this.deviceRoleName = "ai.device.roleName"; this.deviceScreenResolution = "ai.device.screenResolution"; this.deviceType = "ai.device.type"; this.deviceMachineName = "ai.device.machineName"; this.deviceVMName = "ai.device.vmName"; this.deviceBrowser = "ai.device.browser"; this.deviceBrowserVersion = "ai.device.browserVersion"; this.locationIp = "ai.location.ip"; this.locationCountry = "ai.location.country"; this.locationProvince = "ai.location.province"; this.locationCity = "ai.location.city"; this.operationId = "ai.operation.id"; this.operationName = "ai.operation.name"; this.operationParentId = "ai.operation.parentId"; this.operationRootId = "ai.operation.rootId"; this.operationSyntheticSource = "ai.operation.syntheticSource"; this.operationCorrelationVector = "ai.operation.correlationVector"; this.sessionId = "ai.session.id"; this.sessionIsFirst = "ai.session.isFirst"; this.sessionIsNew = "ai.session.isNew"; this.userAccountAcquisitionDate = "ai.user.accountAcquisitionDate"; this.userAccountId = "ai.user.accountId"; this.userAgent = "ai.user.userAgent"; this.userId = "ai.user.id"; this.userStoreRegion = "ai.user.storeRegion"; this.userAuthUserId = "ai.user.authUserId"; this.userAnonymousUserAcquisitionDate = "ai.user.anonUserAcquisitionDate"; this.userAuthenticatedUserAcquisitionDate = "ai.user.authUserAcquisitionDate"; this.cloudName = "ai.cloud.name"; this.cloudRole = "ai.cloud.role"; this.cloudRoleVer = "ai.cloud.roleVer"; this.cloudRoleInstance = "ai.cloud.roleInstance"; this.cloudEnvironment = "ai.cloud.environment"; this.cloudLocation = "ai.cloud.location"; this.cloudDeploymentUnit = "ai.cloud.deploymentUnit"; this.internalSdkVersion = "ai.internal.sdkVersion"; this.internalAgentVersion = "ai.internal.agentVersion"; this.internalNodeName = "ai.internal.nodeName"; } return ContextTagKeys; }()); exports.ContextTagKeys = ContextTagKeys; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ContextTagKeys.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js": /*!***********************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Base */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Base_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Data struct to contain both B and C sections. */ var Data = /** @class */ (function (_super) { __extends(Data, _super); function Data() { return _super.call(this) || this; } return Data; }(Base_1.Base)); exports.Data = Data; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Data.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./DataPointType */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataPointType_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Metric data single measurement. */ var DataPoint = /** @class */ (function () { function DataPoint() { this.kind = DataPointType_1.DataPointType.Measurement; } return DataPoint; }()); exports.DataPoint = DataPoint; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPoint.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED /** * Type of the metric data measurement. */ var DataPointType; (function (DataPointType) { DataPointType[DataPointType["Measurement"] = 0] = "Measurement"; DataPointType[DataPointType["Aggregation"] = 1] = "Aggregation"; })(DataPointType = exports.DataPointType || (exports.DataPointType = {})); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPointType.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js": /*!*************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js ***! \*************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * The abstract common base of all domains. */ var Domain = /** @class */ (function () { function Domain() { } return Domain; }()); exports.Domain = Domain; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Domain.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * System variables for a telemetry item. */ var Envelope = /** @class */ (function () { function Envelope() { this.ver = 1; this.sampleRate = 100.0; this.tags = {}; } return Envelope; }()); exports.Envelope = Envelope; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Envelope.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Instances of Event represent structured event records that can be grouped and searched by their properties. Event data item also creates a metric of event count by name. */ var EventData = /** @class */ (function (_super) { __extends(EventData, _super); function EventData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return EventData; }(Domain_1.Domain)); exports.EventData = EventData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of Exception represents a handled or unhandled exception that occurred during execution of the monitored application. */ var ExceptionData = /** @class */ (function (_super) { __extends(ExceptionData, _super); function ExceptionData() { var _this = _super.call(this) || this; _this.ver = 2; _this.exceptions = []; _this.properties = {}; _this.measurements = {}; return _this; } return ExceptionData; }(Domain_1.Domain)); exports.ExceptionData = ExceptionData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Exception details of the exception in a chain. */ var ExceptionDetails = /** @class */ (function () { function ExceptionDetails() { this.hasFullStack = true; this.parsedStack = []; } return ExceptionDetails; }()); exports.ExceptionDetails = ExceptionDetails; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionDetails.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Instances of Message represent printf-like trace statements that are text-searched. Log4Net, NLog and other text-based log file entries are translated into intances of this type. The message does not have measurements. */ var MessageData = /** @class */ (function (_super) { __extends(MessageData, _super); function MessageData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; return _this; } return MessageData; }(Domain_1.Domain)); exports.MessageData = MessageData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MessageData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of the Metric item is a list of measurements (single data points) and/or aggregations. */ var MetricData = /** @class */ (function (_super) { __extends(MetricData, _super); function MetricData() { var _this = _super.call(this) || this; _this.ver = 2; _this.metrics = []; _this.properties = {}; return _this; } return MetricData; }(Domain_1.Domain)); exports.MetricData = MetricData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MetricData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js ***! \*******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./EventData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView. */ var PageViewData = /** @class */ (function (_super) { __extends(PageViewData, _super); function PageViewData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return PageViewData; }(EventData_1.EventData)); exports.PageViewData = PageViewData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of PageViewPerf represents: a page view with no performance data, a page view with performance data, or just the performance data of an earlier page request. */ var PageViewPerfData = /** @class */ (function (_super) { __extends(PageViewPerfData, _super); function PageViewPerfData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return PageViewPerfData; }(PageViewData_1.PageViewData)); exports.PageViewPerfData = PageViewPerfData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerfData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js": /*!***************************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js ***! \***************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of Remote Dependency represents an interaction of the monitored component with a remote component/service like SQL or an HTTP endpoint. */ var RemoteDependencyData = /** @class */ (function (_super) { __extends(RemoteDependencyData, _super); function RemoteDependencyData() { var _this = _super.call(this) || this; _this.ver = 2; _this.success = true; _this.properties = {}; _this.measurements = {}; return _this; } return RemoteDependencyData; }(Domain_1.Domain)); exports.RemoteDependencyData = RemoteDependencyData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDependencyData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Defines the level of severity for the event. */ var SeverityLevel; (function (SeverityLevel) { SeverityLevel[SeverityLevel["Verbose"] = 0] = "Verbose"; SeverityLevel[SeverityLevel["Information"] = 1] = "Information"; SeverityLevel[SeverityLevel["Warning"] = 2] = "Warning"; SeverityLevel[SeverityLevel["Error"] = 3] = "Error"; SeverityLevel[SeverityLevel["Critical"] = 4] = "Critical"; })(SeverityLevel = exports.SeverityLevel || (exports.SeverityLevel = {})); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SeverityLevel.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED /** * Stack frame information. */ var StackFrame = /** @class */ (function () { function StackFrame() { } return StackFrame; }()); exports.StackFrame = StackFrame; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=StackFrame.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js": /*!**********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RequestHeaders = /** @class */ (function () { function RequestHeaders() { } /** * Request-Context header */ RequestHeaders.requestContextHeader = "Request-Context"; /** * Target instrumentation header that is added to the response and retrieved by the * calling application when processing incoming responses. */ RequestHeaders.requestContextTargetKey = "appId"; /** * Request-Context appId format */ RequestHeaders.requestContextAppIdFormat = "appId=cid-v1:"; /** * Request-Id header */ RequestHeaders.requestIdHeader = "Request-Id"; /** * Sdk-Context header * If this header passed with appId in content then appId will be returned back by the backend. */ RequestHeaders.sdkContextHeader = "Sdk-Context"; /** * String to pass in header for requesting appId back from the backend. */ RequestHeaders.sdkContextHeaderAppIdRequest = "appId"; RequestHeaders.requestContextHeaderLowerCase = "request-context"; return RequestHeaders; }()); exports.RequestHeaders = RequestHeaders; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RequestResponseHeaders.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/Data */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Data_1, Enums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Data = /** @class */ (function (_super) { __extends(Data, _super); /** * Constructs a new instance of telemetry data. */ function Data(baseType, data) { var _this = _super.call(this) || this; /** * The data contract for serializing this object. */ _this.aiDataContract = { baseType: Enums_1.FieldType.Required, baseData: Enums_1.FieldType.Required }; _this.baseType = baseType; _this.baseData = data; return _this; } return Data; }(Data_1.Data)); exports.Data = Data; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Data.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/DataPoint */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataPoint_1, Enums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DataPoint = /** @class */ (function (_super) { __extends(DataPoint, _super); function DataPoint() { var _this = _super !== null && _super.apply(this, arguments) || this; /** * The data contract for serializing this object. */ _this.aiDataContract = { name: Enums_1.FieldType.Required, kind: Enums_1.FieldType.Default, value: Enums_1.FieldType.Required, count: Enums_1.FieldType.Default, min: Enums_1.FieldType.Default, max: Enums_1.FieldType.Default, stdDev: Enums_1.FieldType.Default }; return _this; } return DataPoint; }(DataPoint_1.DataPoint)); exports.DataPoint = DataPoint; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPoint.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ../../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DataSanitizer = /** @class */ (function () { function DataSanitizer() { } DataSanitizer.sanitizeKeyAndAddUniqueness = function (logger, key, map) { var origLength = key.length; var field = DataSanitizer.sanitizeKey(logger, key); // validation truncated the length. We need to add uniqueness if (field.length !== origLength) { var i = 0; var uniqueField = field; while (map[uniqueField] !== undefined) { i++; uniqueField = field.substring(0, DataSanitizer.MAX_NAME_LENGTH - 3) + DataSanitizer.padNumber(i); } field = uniqueField; } return field; }; DataSanitizer.sanitizeKey = function (logger, name) { if (name) { // Remove any leading or trailing whitepace name = Util_1.Util.trim(name.toString()); // truncate the string to 150 chars if (name.length > DataSanitizer.MAX_NAME_LENGTH) { name = name.substring(0, DataSanitizer.MAX_NAME_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + DataSanitizer.MAX_NAME_LENGTH + " characters.", { name: name }, true); } } return name; }; DataSanitizer.sanitizeString = function (logger, value, maxLength) { if (maxLength === void 0) { maxLength = DataSanitizer.MAX_STRING_LENGTH; } if (value) { maxLength = maxLength ? maxLength : DataSanitizer.MAX_STRING_LENGTH; // in case default parameters dont work value = Util_1.Util.trim(value); if (value.toString().length > maxLength) { value = value.toString().substring(0, maxLength); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true); } } return value; }; DataSanitizer.sanitizeUrl = function (logger, url) { return DataSanitizer.sanitizeInput(logger, url, DataSanitizer.MAX_URL_LENGTH, applicationinsights_core_js_1._InternalMessageId.UrlTooLong); }; DataSanitizer.sanitizeMessage = function (logger, message) { if (message) { if (message.length > DataSanitizer.MAX_MESSAGE_LENGTH) { message = message.substring(0, DataSanitizer.MAX_MESSAGE_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.MessageTruncated, "message is too long, it has been truncated to " + DataSanitizer.MAX_MESSAGE_LENGTH + " characters.", { message: message }, true); } } return message; }; DataSanitizer.sanitizeException = function (logger, exception) { if (exception) { if (exception.length > DataSanitizer.MAX_EXCEPTION_LENGTH) { exception = exception.substring(0, DataSanitizer.MAX_EXCEPTION_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + DataSanitizer.MAX_EXCEPTION_LENGTH + " characters.", { exception: exception }, true); } } return exception; }; DataSanitizer.sanitizeProperties = function (logger, properties) { if (properties) { var tempProps = {}; for (var prop in properties) { var value = DataSanitizer.sanitizeString(logger, properties[prop], DataSanitizer.MAX_PROPERTY_LENGTH); prop = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, prop, tempProps); tempProps[prop] = value; } properties = tempProps; } return properties; }; DataSanitizer.sanitizeMeasurements = function (logger, measurements) { if (measurements) { var tempMeasurements = {}; for (var measure in measurements) { var value = measurements[measure]; measure = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements); tempMeasurements[measure] = value; } measurements = tempMeasurements; } return measurements; }; DataSanitizer.sanitizeId = function (logger, id) { return id ? DataSanitizer.sanitizeInput(logger, id, DataSanitizer.MAX_ID_LENGTH, applicationinsights_core_js_1._InternalMessageId.IdTooLong).toString() : id; }; DataSanitizer.sanitizeInput = function (logger, input, maxLength, _msgId) { if (input) { input = Util_1.Util.trim(input); if (input.length > maxLength) { input = input.substring(0, maxLength); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true); } } return input; }; DataSanitizer.padNumber = function (num) { var s = "00" + num; return s.substr(s.length - 3); }; /** * Max length allowed for custom names. */ DataSanitizer.MAX_NAME_LENGTH = 150; /** * Max length allowed for Id field in page views. */ DataSanitizer.MAX_ID_LENGTH = 128; /** * Max length allowed for custom values. */ DataSanitizer.MAX_PROPERTY_LENGTH = 8192; /** * Max length allowed for names */ DataSanitizer.MAX_STRING_LENGTH = 1024; /** * Max length allowed for url. */ DataSanitizer.MAX_URL_LENGTH = 2048; /** * Max length allowed for messages. */ DataSanitizer.MAX_MESSAGE_LENGTH = 32768; /** * Max length allowed for exceptions. */ DataSanitizer.MAX_EXCEPTION_LENGTH = 32768; return DataSanitizer; }()); exports.DataSanitizer = DataSanitizer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataSanitizer.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js": /*!*************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/Envelope */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js"), __webpack_require__(/*! ./DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Envelope_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Envelope = /** @class */ (function (_super) { __extends(Envelope, _super); /** * Constructs a new instance of telemetry data. */ function Envelope(logger, data, name) { var _this = _super.call(this) || this; _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.data = data; _this.time = Util_1.Util.toISOStringForIE8(new Date()); _this.aiDataContract = { time: Enums_1.FieldType.Required, iKey: Enums_1.FieldType.Required, name: Enums_1.FieldType.Required, sampleRate: function () { return (_this.sampleRate == 100) ? Enums_1.FieldType.Hidden : Enums_1.FieldType.Required; }, tags: Enums_1.FieldType.Required, data: Enums_1.FieldType.Required }; return _this; } return Envelope; }(Envelope_1.Envelope)); exports.Envelope = Envelope; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Envelope.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Event.js": /*!***************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Event.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/EventData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Event = /** @class */ (function (_super) { __extends(Event, _super); /** * Constructs a new instance of the EventTelemetry object */ function Event(logger, name, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Required, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } Event.envelopeType = "Microsoft.ApplicationInsights.{0}.Event"; Event.dataType = "EventData"; return Event; }(EventData_1.EventData)); exports.Event = Event; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Event.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/StackFrame */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/ExceptionData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/ExceptionDetails */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, StackFrame_1, ExceptionData_1, ExceptionDetails_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Exception = /** @class */ (function (_super) { __extends(Exception, _super); /** * Constructs a new isntance of the ExceptionTelemetry object */ function Exception(logger, exception, properties, measurements, severityLevel) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, exceptions: Enums_1.FieldType.Required, severityLevel: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); _this.exceptions = [new _ExceptionDetails(logger, exception)]; if (severityLevel) { _this.severityLevel = severityLevel; } return _this; } /** * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception. */ Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) { return { exceptions: [ { hasFullStack: true, message: message, stack: details, typeName: typeName } ] }; }; Exception.envelopeType = "Microsoft.ApplicationInsights.{0}.Exception"; Exception.dataType = "ExceptionData"; return Exception; }(ExceptionData_1.ExceptionData)); exports.Exception = Exception; var _ExceptionDetails = /** @class */ (function (_super) { __extends(_ExceptionDetails, _super); function _ExceptionDetails(logger, exception) { var _this = _super.call(this) || this; _this.aiDataContract = { id: Enums_1.FieldType.Default, outerId: Enums_1.FieldType.Default, typeName: Enums_1.FieldType.Required, message: Enums_1.FieldType.Required, hasFullStack: Enums_1.FieldType.Default, stack: Enums_1.FieldType.Default, parsedStack: Enums_1.FieldType.Array }; _this.typeName = DataSanitizer_1.DataSanitizer.sanitizeString(logger, exception.name) || Util_1.Util.NotSpecified; _this.message = DataSanitizer_1.DataSanitizer.sanitizeMessage(logger, exception.message) || Util_1.Util.NotSpecified; var stack = exception["stack"]; _this.parsedStack = _this.parseStack(stack); _this.stack = DataSanitizer_1.DataSanitizer.sanitizeException(logger, stack); _this.hasFullStack = Util_1.Util.isArray(_this.parsedStack) && _this.parsedStack.length > 0; return _this; } _ExceptionDetails.prototype.parseStack = function (stack) { var parsedStack = undefined; if (typeof stack === "string") { var frames = stack.split('\n'); parsedStack = []; var level = 0; var totalSizeInBytes = 0; for (var i = 0; i <= frames.length; i++) { var frame = frames[i]; if (_StackFrame.regex.test(frame)) { var parsedFrame = new _StackFrame(frames[i], level++); totalSizeInBytes += parsedFrame.sizeInBytes; parsedStack.push(parsedFrame); } } // DP Constraint - exception parsed stack must be < 32KB // remove frames from the middle to meet the threshold var exceptionParsedStackThreshold = 32 * 1024; if (totalSizeInBytes > exceptionParsedStackThreshold) { var left = 0; var right = parsedStack.length - 1; var size = 0; var acceptedLeft = left; var acceptedRight = right; while (left < right) { // check size var lSize = parsedStack[left].sizeInBytes; var rSize = parsedStack[right].sizeInBytes; size += lSize + rSize; if (size > exceptionParsedStackThreshold) { // remove extra frames from the middle var howMany = acceptedRight - acceptedLeft + 1; parsedStack.splice(acceptedLeft, howMany); break; } // update pointers acceptedLeft = left; acceptedRight = right; left++; right--; } } } return parsedStack; }; return _ExceptionDetails; }(ExceptionDetails_1.ExceptionDetails)); var _StackFrame = /** @class */ (function (_super) { __extends(_StackFrame, _super); function _StackFrame(frame, level) { var _this = _super.call(this) || this; _this.sizeInBytes = 0; _this.aiDataContract = { level: Enums_1.FieldType.Required, method: Enums_1.FieldType.Required, assembly: Enums_1.FieldType.Default, fileName: Enums_1.FieldType.Default, line: Enums_1.FieldType.Default }; _this.level = level; _this.method = ""; _this.assembly = Util_1.Util.trim(frame); var matches = frame.match(_StackFrame.regex); if (matches && matches.length >= 5) { _this.method = Util_1.Util.trim(matches[2]) || _this.method; _this.fileName = Util_1.Util.trim(matches[4]); _this.line = parseInt(matches[5]) || 0; } _this.sizeInBytes += _this.method.length; _this.sizeInBytes += _this.fileName.length; _this.sizeInBytes += _this.assembly.length; // todo: these might need to be removed depending on how the back-end settles on their size calculation _this.sizeInBytes += _StackFrame.baseSize; _this.sizeInBytes += _this.level.toString().length; _this.sizeInBytes += _this.line.toString().length; return _this; } // regex to match stack frames from ie/chrome/ff // methodName=$2, fileName=$4, lineNo=$5, column=$6 _StackFrame.regex = /^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/; _StackFrame.baseSize = 58; //'{"method":"","level":,"assembly":"","fileName":"","line":}'.length return _StackFrame; }(StackFrame_1.StackFrame)); exports._StackFrame = _StackFrame; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Exception.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js": /*!****************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/MetricData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./Common/DataPoint */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, MetricData_1, DataSanitizer_1, Enums_1, DataPoint_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Metric = /** @class */ (function (_super) { __extends(Metric, _super); /** * Constructs a new instance of the MetricTelemetry object */ function Metric(logger, name, value, count, min, max, properties) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, metrics: Enums_1.FieldType.Required, properties: Enums_1.FieldType.Default }; var dataPoint = new DataPoint_1.DataPoint(); dataPoint.count = count > 0 ? count : undefined; dataPoint.max = isNaN(max) || max === null ? undefined : max; dataPoint.min = isNaN(min) || min === null ? undefined : min; dataPoint.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; dataPoint.value = value; _this.metrics = [dataPoint]; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); return _this; } Metric.envelopeType = "Microsoft.ApplicationInsights.{0}.Metric"; Metric.dataType = "MetricData"; return Metric; }(MetricData_1.MetricData)); exports.Metric = Metric; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Metric.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js": /*!******************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageView = /** @class */ (function (_super) { __extends(PageView, _super); /** * Constructs a new instance of the PageEventTelemetry object */ function PageView(logger, name, url, durationMs, properties, measurements, id) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, url: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default, id: Enums_1.FieldType.Default, }; _this.id = DataSanitizer_1.DataSanitizer.sanitizeId(logger, id); _this.url = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, url); _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; if (!isNaN(durationMs)) { _this.duration = Util_1.Util.msToTimeSpan(durationMs); } _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } PageView.envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview"; PageView.dataType = "PageviewData"; return PageView; }(PageViewData_1.PageViewData)); exports.PageView = PageView; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageView.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/PageViewPerfData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewPerfData_1, Enums_1, DataSanitizer_1, Util_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewPerformance = /** @class */ (function (_super) { __extends(PageViewPerformance, _super); /** * Constructs a new instance of the PageEventTelemetry object */ function PageViewPerformance(logger, name, url, unused, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, url: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, perfTotal: Enums_1.FieldType.Default, networkConnect: Enums_1.FieldType.Default, sentRequest: Enums_1.FieldType.Default, receivedResponse: Enums_1.FieldType.Default, domProcessing: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.isValid = false; /* * http://www.w3.org/TR/navigation-timing/#processing-model * |-navigationStart * | |-connectEnd * | ||-requestStart * | || |-responseStart * | || | |-responseEnd * | || | | * | || | | |-loadEventEnd * |---network---||---request---|---response---|---dom---| * |--------------------------total----------------------| */ var timing = PageViewPerformance.getPerformanceTiming(); if (timing) { var total = PageViewPerformance.getDuration(timing.navigationStart, timing.loadEventEnd); var network = PageViewPerformance.getDuration(timing.navigationStart, timing.connectEnd); var request = PageViewPerformance.getDuration(timing.requestStart, timing.responseStart); var response = PageViewPerformance.getDuration(timing.responseStart, timing.responseEnd); var dom = PageViewPerformance.getDuration(timing.responseEnd, timing.loadEventEnd); if (total == 0) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ErrorPVCalc, "error calculating page view performance.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (!PageViewPerformance.shouldCollectDuration(total, network, request, response, dom)) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.InvalidDurationValue, "Invalid page load duration value. Browser perf data won't be sent.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (total < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(dom)) { // some browsers may report individual components incorrectly so that the sum of the parts will be bigger than total PLT // in this case, don't report client performance from this page logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ClientPerformanceMathError, "client performance math error.", { total: total, network: network, request: request, response: response, dom: dom }); } else { _this.durationMs = total; // convert to timespans _this.perfTotal = _this.duration = Util_1.Util.msToTimeSpan(total); _this.networkConnect = Util_1.Util.msToTimeSpan(network); _this.sentRequest = Util_1.Util.msToTimeSpan(request); _this.receivedResponse = Util_1.Util.msToTimeSpan(response); _this.domProcessing = Util_1.Util.msToTimeSpan(dom); _this.isValid = true; } } _this.url = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, url); _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } /** * Indicates whether this instance of PageViewPerformance is valid and should be sent */ PageViewPerformance.prototype.getIsValid = function () { return this.isValid; }; /** * Gets the total duration (PLT) in milliseconds. Check getIsValid() before using this method. */ PageViewPerformance.prototype.getDurationMs = function () { return this.durationMs; }; PageViewPerformance.getPerformanceTiming = function () { if (PageViewPerformance.isPerformanceTimingSupported()) { return window.performance.timing; } return null; }; /** * Returns true is window performance timing API is supported, false otherwise. */ PageViewPerformance.isPerformanceTimingSupported = function () { return typeof window != "undefined" && window.performance && window.performance.timing; }; /** * As page loads different parts of performance timing numbers get set. When all of them are set we can report it. * Returns true if ready, false otherwise. */ PageViewPerformance.isPerformanceTimingDataReady = function () { var timing = window.performance.timing; return timing.domainLookupStart > 0 && timing.navigationStart > 0 && timing.responseStart > 0 && timing.requestStart > 0 && timing.loadEventEnd > 0 && timing.responseEnd > 0 && timing.connectEnd > 0 && timing.domLoading > 0; }; PageViewPerformance.getDuration = function (start, end) { var duration = undefined; if (!(isNaN(start) || isNaN(end))) { duration = Math.max(end - start, 0); } return duration; }; /** * This method tells if given durations should be excluded from collection. */ PageViewPerformance.shouldCollectDuration = function () { var durations = []; for (var _i = 0; _i < arguments.length; _i++) { durations[_i] = arguments[_i]; } // a full list of Google crawlers user agent strings - https://support.google.com/webmasters/answer/1061943?hl=en var botAgentNames = ['googlebot', 'adsbot-google', 'apis-google', 'mediapartners-google']; var userAgent = navigator.userAgent; var isGoogleBot = false; if (userAgent) { for (var i_1 = 0; i_1 < botAgentNames.length; i_1++) { isGoogleBot = isGoogleBot || userAgent.toLowerCase().indexOf(botAgentNames[i_1]) !== -1; } } if (isGoogleBot) { // Don't report durations for GoogleBot, it is returning invalid values in performance.timing API. return false; } else { // for other page views, don't report if it's outside of a reasonable range for (var i = 0; i < durations.length; i++) { if (durations[i] >= PageViewPerformance.MAX_DURATION_ALLOWED) { return false; } } } return true; }; PageViewPerformance.envelopeType = "Microsoft.ApplicationInsights.{0}.PageviewPerformance"; PageViewPerformance.dataType = "PageviewPerformanceData"; PageViewPerformance.MAX_DURATION_ALLOWED = 3600000; // 1h return PageViewPerformance; }(PageViewPerfData_1.PageViewPerfData)); exports.PageViewPerformance = PageViewPerformance; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerformance.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/RemoteDependencyData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataSanitizer_1, Enums_1, Util_1, Util_2, RemoteDependencyData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RemoteDependencyData = /** @class */ (function (_super) { __extends(RemoteDependencyData, _super); /** * Constructs a new instance of the RemoteDependencyData object */ function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { id: Enums_1.FieldType.Required, ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, resultCode: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, success: Enums_1.FieldType.Default, data: Enums_1.FieldType.Default, target: Enums_1.FieldType.Default, type: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default, kind: Enums_1.FieldType.Default, value: Enums_1.FieldType.Default, count: Enums_1.FieldType.Default, min: Enums_1.FieldType.Default, max: Enums_1.FieldType.Default, stdDev: Enums_1.FieldType.Default, dependencyKind: Enums_1.FieldType.Default, dependencySource: Enums_1.FieldType.Default, commandName: Enums_1.FieldType.Default, dependencyTypeName: Enums_1.FieldType.Default, }; _this.id = id; _this.duration = Util_1.Util.msToTimeSpan(value); _this.success = success; _this.resultCode = resultCode + ""; _this.type = "Ajax"; _this.data = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, commandName); var dependencyFields = Util_2.AjaxHelper.ParseDependencyPath(logger, absoluteUrl, method, commandName); _this.target = dependencyFields.target; _this.name = dependencyFields.name; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } RemoteDependencyData.envelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency"; RemoteDependencyData.dataType = "RemoteDependencyData"; return RemoteDependencyData; }(RemoteDependencyData_1.RemoteDependencyData)); exports.RemoteDependencyData = RemoteDependencyData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDependencyData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js": /*!***************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/MessageData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, MessageData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Trace = /** @class */ (function (_super) { __extends(Trace, _super); /** * Constructs a new instance of the TraceTelemetry object */ function Trace(logger, message, properties, severityLevel) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, message: Enums_1.FieldType.Required, severityLevel: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default }; message = message || Util_1.Util.NotSpecified; _this.message = DataSanitizer_1.DataSanitizer.sanitizeMessage(logger, message); _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); if (severityLevel) { _this.severityLevel = severityLevel; } return _this; } Trace.envelopeType = "Microsoft.ApplicationInsights.{0}.Message"; Trace.dataType = "MessageData"; return Trace; }(MessageData_1.MessageData)); exports.Trace = Trace; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Trace.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js": /*!********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Util_1, DataSanitizer_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TelemetryItemCreator = /** @class */ (function () { function TelemetryItemCreator() { } /** * Create a telemetry item that the 1DS channel understands * @param item domain specific properties; part B * @param baseType telemetry item type. ie PageViewData * @param envelopeName name of the envelope. ie Microsoft.ApplicationInsights..PageView * @param customProperties user defined custom properties; part C * @param systemProperties system properties that are added to the context; part A * @returns ITelemetryItem that is sent to channel */ TelemetryItemCreator.create = function (item, baseType, envelopeName, logger, customProperties, systemProperties) { envelopeName = DataSanitizer_1.DataSanitizer.sanitizeString(logger, envelopeName) || Util_1.Util.NotSpecified; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(item) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(baseType) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(envelopeName)) { throw Error("Input doesn't contain all required fields"); } var telemetryItem = { name: envelopeName, timestamp: new Date(), instrumentationKey: "", ctx: systemProperties ? systemProperties : {}, tags: [], data: {}, baseType: baseType, baseData: item }; // Part C if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties)) { for (var prop in customProperties) { if (customProperties.hasOwnProperty(prop)) { telemetryItem.data[prop] = customProperties[prop]; } } } return telemetryItem; }; return TelemetryItemCreator; }()); exports.TelemetryItemCreator = TelemetryItemCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=TelemetryItemCreator.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Util.js": /*!****************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Util.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./RequestResponseHeaders */ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Enums_1, applicationinsights_core_js_1, RequestResponseHeaders_1, DataSanitizer_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Util = /** @class */ (function () { function Util() { } /* * Force the SDK not to use local and session storage */ Util.disableStorage = function () { Util._canUseLocalStorage = false; Util._canUseSessionStorage = false; }; /** * Gets the localStorage object if available * @return {Storage} - Returns the storage object if available else returns null */ Util._getLocalStorageObject = function () { if (Util.canUseLocalStorage()) { return Util._getVerifiedStorageObject(Enums_1.StorageType.LocalStorage); } return null; }; /** * Tests storage object (localStorage or sessionStorage) to verify that it is usable * More details here: https://mathiasbynens.be/notes/localstorage-pattern * @param storageType Type of storage * @return {Storage} Returns storage object verified that it is usable */ Util._getVerifiedStorageObject = function (storageType) { var storage = null; var fail; var uid; try { uid = new Date; storage = storageType === Enums_1.StorageType.LocalStorage ? window.localStorage : window.sessionStorage; storage.setItem(uid, uid); fail = storage.getItem(uid) != uid; storage.removeItem(uid); if (fail) { storage = null; } } catch (exception) { storage = null; } return storage; }; /** * Checks if endpoint URL is application insights internal injestion service URL. * * @param endpointUrl Endpoint URL to check. * @returns {boolean} True if if endpoint URL is application insights internal injestion service URL. */ Util.isInternalApplicationInsightsEndpoint = function (endpointUrl) { return Util._internalEndpoints.indexOf(endpointUrl.toLowerCase()) !== -1; }; /** * Check if the browser supports local storage. * * @returns {boolean} True if local storage is supported. */ Util.canUseLocalStorage = function () { if (Util._canUseLocalStorage === undefined) { Util._canUseLocalStorage = !!Util._getVerifiedStorageObject(Enums_1.StorageType.LocalStorage); } return Util._canUseLocalStorage; }; /** * Get an object from the browser's local storage * * @param {string} name - the name of the object to get from storage * @returns {string} The contents of the storage object with the given name. Null if storage is not supported. */ Util.getStorage = function (logger, name) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return null; }; /** * Set the contents of an object in the browser's local storage * * @param {string} name - the name of the object to set in storage * @param {string} data - the contents of the object to set in storage * @returns {boolean} True if the storage object could be written. */ Util.setStorage = function (logger, name, data) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Remove an object from the browser's local storage * * @param {string} name - the name of the object to remove from storage * @returns {boolean} True if the storage object could be removed. */ Util.removeStorage = function (logger, name) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { storage.removeItem(name); return true; } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Gets the sessionStorage object if available * @return {Storage} - Returns the storage object if available else returns null */ Util._getSessionStorageObject = function () { if (Util.canUseSessionStorage()) { return Util._getVerifiedStorageObject(Enums_1.StorageType.SessionStorage); } return null; }; /** * Check if the browser supports session storage. * * @returns {boolean} True if session storage is supported. */ Util.canUseSessionStorage = function () { if (Util._canUseSessionStorage === undefined) { Util._canUseSessionStorage = !!Util._getVerifiedStorageObject(Enums_1.StorageType.SessionStorage); } return Util._canUseSessionStorage; }; /** * Gets the list of session storage keys * * @returns {string[]} List of session storage keys */ Util.getSessionStorageKeys = function () { var keys = []; if (Util.canUseSessionStorage()) { for (var key in window.sessionStorage) { keys.push(key); } } return keys; }; /** * Get an object from the browser's session storage * * @param {string} name - the name of the object to get from storage * @returns {string} The contents of the storage object with the given name. Null if storage is not supported. */ Util.getSessionStorage = function (logger, name) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return null; }; /** * Set the contents of an object in the browser's session storage * * @param {string} name - the name of the object to set in storage * @param {string} data - the contents of the object to set in storage * @returns {boolean} True if the storage object could be written. */ Util.setSessionStorage = function (logger, name, data) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Remove an object from the browser's session storage * * @param {string} name - the name of the object to remove from storage * @returns {boolean} True if the storage object could be removed. */ Util.removeSessionStorage = function (logger, name) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { storage.removeItem(name); return true; } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /* * Force the SDK not to store and read any data from cookies */ Util.disableCookies = function () { Util._canUseCookies = false; }; /* * helper method to tell if document.cookie object is available */ Util.canUseCookies = function (logger) { if (Util._canUseCookies === undefined) { Util._canUseCookies = false; try { Util._canUseCookies = Util.document.cookie !== undefined; } catch (e) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CannotAccessCookie, "Cannot access document.cookie - " + Util.getExceptionName(e), { exception: Util.dump(e) }); } ; } return Util._canUseCookies; }; /** * helper method to set userId and sessionId cookie */ Util.setCookie = function (logger, name, value, domain) { var domainAttrib = ""; var secureAttrib = ""; if (domain) { domainAttrib = ";domain=" + domain; } if (Util.document.location && Util.document.location.protocol === "https:") { secureAttrib = ";secure"; } if (Util.canUseCookies(logger)) { Util.document.cookie = name + "=" + value + domainAttrib + ";path=/" + secureAttrib; } }; Util.stringToBoolOrDefault = function (str, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } if (str === undefined || str === null) { return defaultValue; } return str.toString().toLowerCase() === "true"; }; /** * helper method to access userId and sessionId cookie */ Util.getCookie = function (logger, name) { if (!Util.canUseCookies(logger)) { return; } var value = ""; if (name && name.length) { var cookieName = name + "="; var cookies = Util.document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; cookie = Util.trim(cookie); if (cookie && cookie.indexOf(cookieName) === 0) { value = cookie.substring(cookieName.length, cookies[i].length); break; } } } return value; }; /** * Deletes a cookie by setting it's expiration time in the past. * @param name - The name of the cookie to delete. */ Util.deleteCookie = function (logger, name) { if (Util.canUseCookies(logger)) { // Setting the expiration date in the past immediately removes the cookie Util.document.cookie = name + "=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;"; } }; /** * helper method to trim strings (IE8 does not implement String.prototype.trim) */ Util.trim = function (str) { if (typeof str !== "string") return str; return str.replace(/^\s+|\s+$/g, ""); }; /** * generate random id string */ Util.newId = function () { var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var result = ""; // tslint:disable-next-line:insecure-random var random = Math.random() * 1073741824; //5 symbols in base64, almost maxint while (random > 0) { var char = base64chars.charAt(random % 64); result += char; random = Math.floor(random / 64); } return result; }; /** * Check if an object is of type Array */ Util.isArray = function (obj) { return Object.prototype.toString.call(obj) === "[object Array]"; }; /** * Check if an object is of type Error */ Util.isError = function (obj) { return Object.prototype.toString.call(obj) === "[object Error]"; }; /** * Check if an object is of type Date */ Util.isDate = function (obj) { return Object.prototype.toString.call(obj) === "[object Date]"; }; /** * Convert a date to I.S.O. format in IE8 */ Util.toISOStringForIE8 = function (date) { if (Util.isDate(date)) { if (Date.prototype.toISOString) { return date.toISOString(); } else { var pad = function (num) { var r = String(num); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } }; /** * Gets IE version if we are running on IE, or null otherwise */ Util.getIEVersion = function (userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } var myNav = userAgentStr ? userAgentStr.toLowerCase() : navigator.userAgent.toLowerCase(); return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : null; }; /** * Convert ms to c# time span format */ Util.msToTimeSpan = function (totalms) { if (isNaN(totalms) || totalms < 0) { totalms = 0; } totalms = Math.round(totalms); var ms = "" + totalms % 1000; var sec = "" + Math.floor(totalms / 1000) % 60; var min = "" + Math.floor(totalms / (1000 * 60)) % 60; var hour = "" + Math.floor(totalms / (1000 * 60 * 60)) % 24; var days = Math.floor(totalms / (1000 * 60 * 60 * 24)); ms = ms.length === 1 ? "00" + ms : ms.length === 2 ? "0" + ms : ms; sec = sec.length < 2 ? "0" + sec : sec; min = min.length < 2 ? "0" + min : min; hour = hour.length < 2 ? "0" + hour : hour; return (days > 0 ? days + "." : "") + hour + ":" + min + ":" + sec + "." + ms; }; /** * Checks if error has no meaningful data inside. Ususally such errors are received by window.onerror when error * happens in a script from other domain (cross origin, CORS). */ Util.isCrossOriginError = function (message, url, lineNumber, columnNumber, error) { return (message === "Script error." || message === "Script error") && !error; }; /** * Returns string representation of an object suitable for diagnostics logging. */ Util.dump = function (object) { var objectTypeDump = Object.prototype.toString.call(object); var propertyValueDump = JSON.stringify(object); if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } return objectTypeDump + propertyValueDump; }; /** * Returns the name of object if it's an Error. Otherwise, returns empty string. */ Util.getExceptionName = function (object) { var objectTypeDump = Object.prototype.toString.call(object); if (objectTypeDump === "[object Error]") { return object.name; } return ""; }; /** * Adds an event handler for the specified event * @param eventName {string} - The name of the event * @param callback {any} - The callback function that needs to be executed for the given event * @return {boolean} - true if the handler was successfully added */ Util.addEventHandler = function (eventName, callback) { if (!window || typeof eventName !== 'string' || typeof callback !== 'function') { return false; } // Create verb for the event var verbEventName = 'on' + eventName; // check if addEventListener is available if (window.addEventListener) { window.addEventListener(eventName, callback, false); } else if (window["attachEvent"]) { window["attachEvent"](verbEventName, callback); } else { return false; } return true; }; /** * Tells if a browser supports a Beacon API */ Util.IsBeaconApiSupported = function () { return ('sendBeacon' in navigator && navigator.sendBeacon); }; Util.document = typeof document !== "undefined" ? document : {}; Util._canUseCookies = undefined; Util._canUseLocalStorage = undefined; Util._canUseSessionStorage = undefined; // listing only non-geo specific locations Util._internalEndpoints = [ "https://dc.services.visualstudio.com/v2/track", "https://breeze.aimon.applicationinsights.io/v2/track", "https://dc-int.services.visualstudio.com/v2/track" ]; Util.NotSpecified = "not_specified"; return Util; }()); exports.Util = Util; var UrlHelper = /** @class */ (function () { function UrlHelper() { } UrlHelper.parseUrl = function (url) { if (!UrlHelper.htmlAnchorElement) { UrlHelper.htmlAnchorElement = !!UrlHelper.document.createElement ? UrlHelper.document.createElement('a') : {}; } UrlHelper.htmlAnchorElement.href = url; return UrlHelper.htmlAnchorElement; }; UrlHelper.getAbsoluteUrl = function (url) { var result; var a = UrlHelper.parseUrl(url); if (a) { result = a.href; } return result; }; UrlHelper.getPathName = function (url) { var result; var a = UrlHelper.parseUrl(url); if (a) { result = a.pathname; } return result; }; UrlHelper.getCompleteUrl = function (method, absoluteUrl) { if (method) { return method.toUpperCase() + " " + absoluteUrl; } else { return absoluteUrl; } }; UrlHelper.document = typeof document !== "undefined" ? document : {}; return UrlHelper; }()); exports.UrlHelper = UrlHelper; var CorrelationIdHelper = /** @class */ (function () { function CorrelationIdHelper() { } /** * Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers */ CorrelationIdHelper.canIncludeCorrelationHeader = function (config, requestUrl, currentHost) { if (config && config.disableCorrelationHeaders) { return false; } if (!requestUrl) { return false; } var requestHost = UrlHelper.parseUrl(requestUrl).host.toLowerCase(); if ((!config || !config.enableCorsCorrelation) && requestHost !== currentHost) { return false; } var excludedDomains = config && config.correlationHeaderExcludedDomains; if (!excludedDomains || excludedDomains.length == 0) { return true; } for (var i = 0; i < excludedDomains.length; i++) { var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\./g, "\.").replace(/\*/g, ".*")); if (regex.test(requestHost)) { return false; } } return true; }; /** * Combines target appId and target role name from response header. */ CorrelationIdHelper.getCorrelationContext = function (responseHeader) { if (responseHeader) { var correlationId = CorrelationIdHelper.getCorrelationContextValue(responseHeader, RequestResponseHeaders_1.RequestHeaders.requestContextTargetKey); if (correlationId && correlationId !== CorrelationIdHelper.correlationIdPrefix) { return correlationId; } } }; /** * Gets key from correlation response header */ CorrelationIdHelper.getCorrelationContextValue = function (responseHeader, key) { if (responseHeader) { var keyValues = responseHeader.split(","); for (var i = 0; i < keyValues.length; ++i) { var keyValue = keyValues[i].split("="); if (keyValue.length == 2 && keyValue[0] == key) { return keyValue[1]; } } } }; CorrelationIdHelper.correlationIdPrefix = "cid-v1:"; return CorrelationIdHelper; }()); exports.CorrelationIdHelper = CorrelationIdHelper; var AjaxHelper = /** @class */ (function () { function AjaxHelper() { } AjaxHelper.ParseDependencyPath = function (logger, absoluteUrl, method, pathName) { var target, name; if (absoluteUrl && absoluteUrl.length > 0) { var parsedUrl = UrlHelper.parseUrl(absoluteUrl); target = parsedUrl.host; if (parsedUrl.pathname != null) { var pathName = (parsedUrl.pathname.length === 0) ? "/" : parsedUrl.pathname; if (pathName.charAt(0) !== '/') { pathName = "/" + pathName; } name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, method ? method + " " + pathName : pathName); } else { name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, absoluteUrl); } } else { target = pathName; name = pathName; } return { target: target, name: name }; }; return AjaxHelper; }()); exports.AjaxHelper = AjaxHelper; /** * A utility class that helps getting time related parameters */ var DateTimeUtils = /** @class */ (function () { function DateTimeUtils() { } /** * Get the number of milliseconds since 1970/01/01 in local timezone */ DateTimeUtils.Now = (window.performance && window.performance.now && window.performance.timing) ? function () { return window.performance.now() + window.performance.timing.navigationStart; } : function () { return new Date().getTime(); }; /** * Gets duration between two timestamps */ DateTimeUtils.GetDuration = function (start, end) { var result = null; if (start !== 0 && end !== 0 && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(start) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(end)) { result = end - start; } return result; }; return DateTimeUtils; }()); exports.DateTimeUtils = DateTimeUtils; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Util.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/applicationinsights-common.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ./Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./RequestResponseHeaders */ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js"), __webpack_require__(/*! ./Constants */ "./node_modules/applicationinsights-common/bundle/Constants.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/Data */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/Base */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js"), __webpack_require__(/*! ./Telemetry/Common/Envelope */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js"), __webpack_require__(/*! ./Telemetry/Event */ "./node_modules/applicationinsights-common/bundle/Telemetry/Event.js"), __webpack_require__(/*! ./Telemetry/Exception */ "./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js"), __webpack_require__(/*! ./Telemetry/Metric */ "./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js"), __webpack_require__(/*! ./Telemetry/PageView */ "./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js"), __webpack_require__(/*! ./Telemetry/RemoteDependencyData */ "./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js"), __webpack_require__(/*! ./Telemetry/Trace */ "./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js"), __webpack_require__(/*! ./Telemetry/PageViewPerformance */ "./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js"), __webpack_require__(/*! ./Telemetry/Common/Data */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/SeverityLevel */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/ContextTagKeys */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ./TelemetryItemCreator */ "./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Util_1, Enums_1, RequestResponseHeaders_1, Constants_1, Data_1, Base_1, Envelope_1, Event_1, Exception_1, Metric_1, PageView_1, PageViewData_1, RemoteDependencyData_1, Trace_1, PageViewPerformance_1, Data_2, SeverityLevel_1, ContextTagKeys_1, DataSanitizer_1, TelemetryItemCreator_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Util = Util_1.Util; exports.CorrelationIdHelper = Util_1.CorrelationIdHelper; exports.UrlHelper = Util_1.UrlHelper; exports.DateTimeUtils = Util_1.DateTimeUtils; exports.FieldType = Enums_1.FieldType; exports.RequestHeaders = RequestResponseHeaders_1.RequestHeaders; exports.DisabledPropertyName = Constants_1.DisabledPropertyName; exports.AIData = Data_1.Data; exports.AIBase = Base_1.Base; exports.Envelope = Envelope_1.Envelope; exports.Event = Event_1.Event; exports.Exception = Exception_1.Exception; exports.Metric = Metric_1.Metric; exports.PageView = PageView_1.PageView; exports.PageViewData = PageViewData_1.PageViewData; exports.RemoteDependencyData = RemoteDependencyData_1.RemoteDependencyData; exports.Trace = Trace_1.Trace; exports.PageViewPerformance = PageViewPerformance_1.PageViewPerformance; exports.Data = Data_2.Data; exports.SeverityLevel = SeverityLevel_1.SeverityLevel; exports.ContextTagKeys = ContextTagKeys_1.ContextTagKeys; exports.DataSanitizer = DataSanitizer_1.DataSanitizer; exports.TelemetryItemCreator = TelemetryItemCreator_1.TelemetryItemCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-common.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event. */ exports.EventsDiscardedReason = { /** * Unknown. */ Unknown: 0, /** * Status set to non-retryable. */ NonRetryableStatus: 1, /** * The event is invalid. */ InvalidEvent: 2, /** * The size of the event is too large. */ SizeLimitExceeded: 3, /** * The server is not accepting events from this instrumentation key. */ KillSwitch: 4, /** * The event queue is full. */ QueueFull: 5, }; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventsDiscardedReason.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js": /*!*********************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js ***! \*********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var LoggingSeverity; (function (LoggingSeverity) { /** * Error will be sent as internal telemetry */ LoggingSeverity[LoggingSeverity["CRITICAL"] = 1] = "CRITICAL"; /** * Error will NOT be sent as internal telemetry, and will only be shown in browser console */ LoggingSeverity[LoggingSeverity["WARNING"] = 2] = "WARNING"; })(LoggingSeverity = exports.LoggingSeverity || (exports.LoggingSeverity = {})); /** * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered */ ; exports._InternalMessageId = { // Non user actionable BrowserDoesNotSupportLocalStorage: 0, BrowserCannotReadLocalStorage: 1, BrowserCannotReadSessionStorage: 2, BrowserCannotWriteLocalStorage: 3, BrowserCannotWriteSessionStorage: 4, BrowserFailedRemovalFromLocalStorage: 5, BrowserFailedRemovalFromSessionStorage: 6, CannotSendEmptyTelemetry: 7, ClientPerformanceMathError: 8, ErrorParsingAISessionCookie: 9, ErrorPVCalc: 10, ExceptionWhileLoggingError: 11, FailedAddingTelemetryToBuffer: 12, FailedMonitorAjaxAbort: 13, FailedMonitorAjaxDur: 14, FailedMonitorAjaxOpen: 15, FailedMonitorAjaxRSC: 16, FailedMonitorAjaxSend: 17, FailedMonitorAjaxGetCorrelationHeader: 18, FailedToAddHandlerForOnBeforeUnload: 19, FailedToSendQueuedTelemetry: 20, FailedToReportDataLoss: 21, FlushFailed: 22, MessageLimitPerPVExceeded: 23, MissingRequiredFieldSpecification: 24, NavigationTimingNotSupported: 25, OnError: 26, SessionRenewalDateIsZero: 27, SenderNotInitialized: 28, StartTrackEventFailed: 29, StopTrackEventFailed: 30, StartTrackFailed: 31, StopTrackFailed: 32, TelemetrySampledAndNotSent: 33, TrackEventFailed: 34, TrackExceptionFailed: 35, TrackMetricFailed: 36, TrackPVFailed: 37, TrackPVFailedCalc: 38, TrackTraceFailed: 39, TransmissionFailed: 40, FailedToSetStorageBuffer: 41, FailedToRestoreStorageBuffer: 42, InvalidBackendResponse: 43, FailedToFixDepricatedValues: 44, InvalidDurationValue: 45, TelemetryEnvelopeInvalid: 46, CreateEnvelopeError: 47, // User actionable CannotSerializeObject: 48, CannotSerializeObjectNonSerializable: 49, CircularReferenceDetected: 50, ClearAuthContextFailed: 51, ExceptionTruncated: 52, IllegalCharsInName: 53, ItemNotInArray: 54, MaxAjaxPerPVExceeded: 55, MessageTruncated: 56, NameTooLong: 57, SampleRateOutOfRange: 58, SetAuthContextFailed: 59, SetAuthContextFailedAccountName: 60, StringValueTooLong: 61, StartCalledMoreThanOnce: 62, StopCalledWithoutStart: 63, TelemetryInitializerFailed: 64, TrackArgumentsNotSpecified: 65, UrlTooLong: 66, SessionStorageBufferFull: 67, CannotAccessCookie: 68, IdTooLong: 69, }; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=LoggingEnums.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MinChannelPriorty = 100; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=IChannelControls.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../JavaScriptSDK.Enums/EventsDiscardedReason */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js"), __webpack_require__(/*! ./CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js"), __webpack_require__(/*! ./NotificationManager */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js"), __webpack_require__(/*! ./DiagnosticLogger */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventsDiscardedReason_1, CoreUtils_1, NotificationManager_1, DiagnosticLogger_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; var AppInsightsCore = /** @class */ (function () { function AppInsightsCore() { this._isInitialized = false; this._extensions = new Array(); this._channelController = new ChannelController(); } AppInsightsCore.prototype.initialize = function (config, extensions) { var _this = this; // Make sure core is only initialized once if (this._isInitialized) { throw Error("Core should not be initialized more than once"); } if (!config || CoreUtils_1.CoreUtils.isNullOrUndefined(config.instrumentationKey)) { throw Error("Please provide instrumentation key"); } this.config = config; this._notificationManager = new NotificationManager_1.NotificationManager(); this.config.extensions = CoreUtils_1.CoreUtils.isNullOrUndefined(this.config.extensions) ? [] : this.config.extensions; // add notification to the extensions in the config so other plugins can access it this.config.extensionConfig = CoreUtils_1.CoreUtils.isNullOrUndefined(this.config.extensionConfig) ? {} : this.config.extensionConfig; this.config.extensionConfig.NotificationManager = this._notificationManager; this.logger = new DiagnosticLogger_1.DiagnosticLogger(config); // Initial validation extensions.forEach(function (extension) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(extension.initialize)) { throw Error(validationError); } }); if (this.config.extensions.length > 0) { var isValid_1 = true; this.config.extensions.forEach(function (item) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(item)) { isValid_1 = false; } }); if (!isValid_1) { throw Error(validationError); } } // Initial validation complete // Concat all available extensions before sorting by priority (_a = this._extensions).push.apply(_a, [this._channelController].concat(extensions, this.config.extensions)); this._extensions = this._extensions.sort(function (a, b) { var extA = a; var extB = b; var typeExtA = typeof extA.processTelemetry; var typeExtB = typeof extB.processTelemetry; if (typeExtA === 'function' && typeExtB === 'function') { return extA.priority - extB.priority; } if (typeExtA === 'function' && typeExtB !== 'function') { // keep non telemetryplugin specific extensions at start return 1; } if (typeExtA !== 'function' && typeExtB === 'function') { return -1; } }); // sort complete // Check if any two extensions have the same priority, then warn to console var priority = {}; this._extensions.forEach(function (ext) { var t = ext; if (t && t.priority) { if (!CoreUtils_1.CoreUtils.isNullOrUndefined(priority[t.priority])) { _this.logger.warnToConsole("Two extensions have same priority" + priority[t.priority] + ", " + t.identifier); } else { priority[t.priority] = t.identifier; // set a value } } }); // initialize plugins including channel controller this._extensions.forEach(function (ext) { var e = ext; if (e && e.priority <= ChannelControllerPriority) { ext.initialize(_this.config, _this, _this._extensions); // initialize } }); var c = -1; // Set next plugin for all until channel controller for (var idx = 0; idx < this._extensions.length - 1; idx++) { var curr = (this._extensions[idx]); if (curr && typeof curr.processTelemetry !== 'function') { // these are initialized only, allowing an entry point for extensions to be initialized when SDK initializes continue; } if (curr.priority === ChannelControllerPriority) { c = idx + 1; break; // channel controller will set remaining pipeline } this._extensions[idx].setNextPlugin(this._extensions[idx + 1]); // set next plugin } // Remove sender channels from main list if (c < this._extensions.length) { this._extensions.splice(c); } if (this.getTransmissionControls().length === 0) { throw new Error("No channels available"); } this._isInitialized = true; var _a; }; AppInsightsCore.prototype.getTransmissionControls = function () { return this._channelController.ChannelControls; }; AppInsightsCore.prototype.track = function (telemetryItem) { if (telemetryItem === null) { this._notifiyInvalidEvent(telemetryItem); // throw error throw Error("Invalid telemetry item"); } if (telemetryItem.baseData && !telemetryItem.baseType) { this._notifiyInvalidEvent(telemetryItem); throw Error("Provide data.baseType for data.baseData"); } if (!telemetryItem.baseType) { // Hard coded from Common::Event.ts::Event.dataType telemetryItem.baseType = "EventData"; } if (!telemetryItem.instrumentationKey) { // setup default ikey if not passed in telemetryItem.instrumentationKey = this.config.instrumentationKey; } if (!telemetryItem.timestamp) { // add default timestamp if not passed in telemetryItem.timestamp = new Date(); } // do basic validation before sending it through the pipeline this._validateTelmetryItem(telemetryItem); // invoke any common telemetry processors before sending through pipeline var i = 0; while (i < this._extensions.length) { if (this._extensions[i].processTelemetry) { this._extensions[i].processTelemetry(telemetryItem); // pass on to first extension that can support processing break; } i++; } }; /** * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be * called. * @param {INotificationListener} listener - An INotificationListener object. */ AppInsightsCore.prototype.addNotificationListener = function (listener) { this._notificationManager.addNotificationListener(listener); }; /** * Removes all instances of the listener. * @param {INotificationListener} listener - INotificationListener to remove. */ AppInsightsCore.prototype.removeNotificationListener = function (listener) { this._notificationManager.removeNotificationListener(listener); }; /** * Periodically check logger.queue for */ AppInsightsCore.prototype.pollInternalLogs = function () { var _this = this; if (!(this.config.diagnosticLoggingInterval > 0)) { throw Error("config.diagnosticLoggingInterval must be a positive integer"); } return setInterval(function () { var queue = _this.logger.queue; queue.forEach(function (logMessage) { var item = { name: "InternalMessageId: " + logMessage.messageId, instrumentationKey: _this.config.instrumentationKey, timestamp: new Date(), baseType: DiagnosticLogger_1._InternalLogMessage.dataType, baseData: { message: logMessage.message } }; _this.track(item); }); queue.length = 0; }, this.config.diagnosticLoggingInterval); }; AppInsightsCore.prototype._validateTelmetryItem = function (telemetryItem) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.name)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry name required"); } if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.timestamp)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry timestamp required"); } if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.instrumentationKey)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry instrumentationKey required"); } }; AppInsightsCore.prototype._notifiyInvalidEvent = function (telemetryItem) { this._notificationManager.eventsDiscarded([telemetryItem], EventsDiscardedReason_1.EventsDiscardedReason.InvalidEvent); }; return AppInsightsCore; }()); exports.AppInsightsCore = AppInsightsCore; var ChannelController = /** @class */ (function () { function ChannelController() { this.identifier = "ChannelControllerPlugin"; this.priority = ChannelControllerPriority; // in reserved range 100 to 200 } ChannelController.prototype.processTelemetry = function (item) { this.channelQueue.forEach(function (queues) { // pass on to first item in queue if (queues.length > 0) { queues[0].processTelemetry(item); } }); }; Object.defineProperty(ChannelController.prototype, "ChannelControls", { get: function () { return this.channelQueue; }, enumerable: true, configurable: true }); ChannelController.prototype.initialize = function (config, core, extensions) { var _this = this; this.channelQueue = new Array(); if (config.channels) { config.channels.forEach(function (queue) { if (queue && queue.length > 0) { queue = queue.sort(function (a, b) { return a.priority - b.priority; }); // Initialize each plugin queue.forEach(function (queueItem) { return queueItem.initialize(config, core, extensions); }); for (var i = 1; i < queue.length; i++) { queue[i - 1].setNextPlugin(queue[i]); // setup processing chain } _this.channelQueue.push(queue); } }); } else { var arr = new Array(); for (var i = 0; i < extensions.length; i++) { var plugin = extensions[i]; if (plugin.priority > ChannelControllerPriority) { arr.push(plugin); } } if (arr.length > 0) { // sort if not sorted arr = arr.sort(function (a, b) { return a.priority - b.priority; }); // Initialize each plugin arr.forEach(function (queueItem) { return queueItem.initialize(config, core, extensions); }); // setup next plugin for (var i = 1; i < arr.length; i++) { arr[i - 1].setNextPlugin(arr[i]); } this.channelQueue.push(arr); } } }; return ChannelController; }()); var validationError = "Extensions must provide callback to initialize"; var ChannelControllerPriority = 200; var duplicatePriority = "One or more extensions are set at same priority"; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=AppInsightsCore.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js": /*!************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var CoreUtils = /** @class */ (function () { function CoreUtils() { } CoreUtils.isNullOrUndefined = function (input) { return input === null || input === undefined; }; /** * Creates a new GUID. * @return {string} A GUID. */ CoreUtils.newGuid = function () { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, function (c) { var r = (Math.random() * 16 | 0), v = (c === 'x' ? r : r & 0x3 | 0x8); return v.toString(16); }); }; return CoreUtils; }()); exports.CoreUtils = CoreUtils; var GuidRegex = /[xy]/g; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=CoreUtils.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js": /*!*******************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js ***! \*******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../JavaScriptSDK.Enums/LoggingEnums */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js"), __webpack_require__(/*! ./CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, LoggingEnums_1, CoreUtils_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } this.messageId = msgId; this.message = (isUserAct ? _InternalLogMessage.AiUserActionablePrefix : _InternalLogMessage.AiNonUserActionablePrefix) + msgId; var diagnosticText = (msg ? " message:" + _InternalLogMessage.sanitizeDiagnosticText(msg) : "") + (properties ? " props:" + _InternalLogMessage.sanitizeDiagnosticText(JSON.stringify(properties)) : ""); this.message += diagnosticText; } _InternalLogMessage.sanitizeDiagnosticText = function (text) { return "\"" + text.replace(/\"/g, "") + "\""; }; _InternalLogMessage.dataType = "MessageData"; /** * For user non actionable traces use AI Internal prefix. */ _InternalLogMessage.AiNonUserActionablePrefix = "AI (Internal): "; /** * Prefix of the traces in portal. */ _InternalLogMessage.AiUserActionablePrefix = "AI: "; return _InternalLogMessage; }()); exports._InternalLogMessage = _InternalLogMessage; var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { /** * Session storage key for the prefix for the key indicating message type already logged */ this.AIInternalMessagePrefix = "AITR_"; /** * When this is true the SDK will throw exceptions to aid in debugging. */ this.enableDebugExceptions = function () { return false; }; /** * 0: OFF * 1: CRITICAL (default) * 2: >= WARNING */ this.consoleLoggingLevel = function () { return 1; }; /** * 0: OFF (default) * 1: CRITICAL * 2: >= WARNING */ this.telemetryLoggingLevel = function () { return 0; }; /** * The maximum number of internal messages allowed to be sent per page view */ this.maxInternalMessageLimit = function () { return 25; }; /** * The internal logging queue */ this.queue = []; /** * Count of internal messages sent */ this._messageCount = 0; /** * Holds information about what message types were already logged to console or sent to server. */ this._messageLogged = {}; if (CoreUtils_1.CoreUtils.isNullOrUndefined(config)) { // TODO: Use default config // config = AppInsightsCore.defaultConfig; // For now, use defaults specified in DiagnosticLogger members; return; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.loggingLevelConsole)) { this.consoleLoggingLevel = function () { return config.loggingLevelConsole; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.loggingLevelTelemetry)) { this.telemetryLoggingLevel = function () { return config.loggingLevelTelemetry; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.maxMessageLimit)) { this.maxInternalMessageLimit = function () { return config.maxMessageLimit; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.enableDebugExceptions)) { this.enableDebugExceptions = function () { return config.enableDebugExceptions; }; } } /** * This method will throw exceptions in debug mode or attempt to log the error as a console warning. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The log message. */ DiagnosticLogger.prototype.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (this.enableDebugExceptions()) { throw message; } else { if (typeof (message) !== "undefined" && !!message) { if (typeof (message.message) !== "undefined") { if (isUserAct) { // check if this message type was already logged to console for this page view and if so, don't log it again var messageKey = +message.messageId; if (!this._messageLogged[messageKey] || this.consoleLoggingLevel() >= LoggingEnums_1.LoggingSeverity.WARNING) { this.warnToConsole(message.message); this._messageLogged[messageKey] = true; } } else { // don't log internal AI traces in the console, unless the verbose logging is enabled if (this.consoleLoggingLevel() >= LoggingEnums_1.LoggingSeverity.WARNING) { this.warnToConsole(message.message); } } this.logInternalMessage(severity, message); } } } }; /** * This will write a warning to the console if possible * @param message {string} - The warning message */ DiagnosticLogger.prototype.warnToConsole = function (message) { if (typeof console !== "undefined" && !!console) { if (typeof console.warn === "function") { console.warn(message); } else if (typeof console.log === "function") { console.log(message); } } }; /** * Resets the internal message count */ DiagnosticLogger.prototype.resetInternalMessageCount = function () { this._messageCount = 0; this._messageLogged = {}; }; /** * Logs a message to the internal queue. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The message to log. */ DiagnosticLogger.prototype.logInternalMessage = function (severity, message) { if (this._areInternalMessagesThrottled()) { return; } // check if this message type was already logged for this session and if so, don't log it again var logMessage = true; var messageKey = this.AIInternalMessagePrefix + message.messageId; // if the session storage is not available, limit to only one message type per page view if (this._messageLogged[messageKey]) { logMessage = false; } else { this._messageLogged[messageKey] = true; } if (logMessage) { // Push the event in the internal queue if (severity <= this.telemetryLoggingLevel()) { this.queue.push(message); this._messageCount++; } // When throttle limit reached, send a special event if (this._messageCount == this.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(LoggingEnums_1._InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false); this.queue.push(throttleMessage); this.warnToConsole(throttleLimitMessage); } } }; /** * Indicates whether the internal events are throttled */ DiagnosticLogger.prototype._areInternalMessagesThrottled = function () { return this._messageCount >= this.maxInternalMessageLimit(); }; return DiagnosticLogger; }()); exports.DiagnosticLogger = DiagnosticLogger; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DiagnosticLogger.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js": /*!**********************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js ***! \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Class to manage sending notifications to all the listeners. */ var NotificationManager = /** @class */ (function () { function NotificationManager() { this.listeners = []; } /** * Adds a notification listener. * @param {INotificationListener} listener - The notification listener to be added. */ NotificationManager.prototype.addNotificationListener = function (listener) { this.listeners.push(listener); }; /** * Removes all instances of the listener. * @param {INotificationListener} listener - AWTNotificationListener to remove. */ NotificationManager.prototype.removeNotificationListener = function (listener) { var index = this.listeners.indexOf(listener); while (index > -1) { this.listeners.splice(index, 1); index = this.listeners.indexOf(listener); } }; /** * Notification for events sent. * @param {ITelemetryItem[]} events - The array of events that have been sent. */ NotificationManager.prototype.eventsSent = function (events) { var _this = this; var _loop_1 = function (i) { if (this_1.listeners[i].eventsSent) { setTimeout(function () { return _this.listeners[i].eventsSent(events); }, 0); } }; var this_1 = this; for (var i = 0; i < this.listeners.length; ++i) { _loop_1(i); } }; /** * Notification for events being discarded. * @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK. * @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason * constant should be used to check the different values. */ NotificationManager.prototype.eventsDiscarded = function (events, reason) { var _this = this; var _loop_2 = function (i) { if (this_2.listeners[i].eventsDiscarded) { setTimeout(function () { return _this.listeners[i].eventsDiscarded(events, reason); }, 0); } }; var this_2 = this; for (var i = 0; i < this.listeners.length; ++i) { _loop_2(i); } }; return NotificationManager; }()); exports.NotificationManager = NotificationManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=NotificationManager.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js": /*!****************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js ***! \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./JavaScriptSDK.Interfaces/IChannelControls */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js"), __webpack_require__(/*! ./JavaScriptSDK.Enums/EventsDiscardedReason */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js"), __webpack_require__(/*! ./JavaScriptSDK/AppInsightsCore */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js"), __webpack_require__(/*! ./JavaScriptSDK/CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js"), __webpack_require__(/*! ./JavaScriptSDK/NotificationManager */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js"), __webpack_require__(/*! ./JavaScriptSDK/DiagnosticLogger */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js"), __webpack_require__(/*! ./JavaScriptSDK.Enums/LoggingEnums */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, IChannelControls_1, EventsDiscardedReason_1, AppInsightsCore_1, CoreUtils_1, NotificationManager_1, DiagnosticLogger_1, LoggingEnums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MinChannelPriorty = IChannelControls_1.MinChannelPriorty; exports.EventsDiscardedReason = EventsDiscardedReason_1.EventsDiscardedReason; exports.AppInsightsCore = AppInsightsCore_1.AppInsightsCore; exports.CoreUtils = CoreUtils_1.CoreUtils; exports.NotificationManager = NotificationManager_1.NotificationManager; exports.DiagnosticLogger = DiagnosticLogger_1.DiagnosticLogger; exports._InternalLogMessage = DiagnosticLogger_1._InternalLogMessage; exports._InternalMessageId = LoggingEnums_1._InternalMessageId; exports.LoggingSeverity = LoggingEnums_1.LoggingSeverity; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-core-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajax.js": /*!*************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajax.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./ajaxRecord */ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js"), __webpack_require__(/*! ./ajaxUtils */ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1, ajaxRecord_1, ajaxUtils_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var AjaxMonitor = /** @class */ (function () { function AjaxMonitor() { this._trackAjaxAttempts = 0; this.identifier = "AjaxDependencyPlugin"; this.priority = 161; this.currentWindowHost = window && window.location.host && window.location.host.toLowerCase(); this.initialized = false; } ///Verifies that particalar instance of XMLHttpRequest needs to be monitored ///Optional parameter. True if ajaxData must be excluded from verification ///True if instance needs to be monitored, otherwise false AjaxMonitor.prototype.isMonitoredInstance = function (xhr, excludeAjaxDataValidation) { // checking to see that all interested functions on xhr were instrumented return this.initialized // checking on ajaxData to see that it was not removed in user code && (excludeAjaxDataValidation === true || !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData)) // check that this instance is not not used by ajax call performed inside client side monitoring to send data to collector && xhr[applicationinsights_common_1.DisabledPropertyName] !== true; }; ///Determines whether ajax monitoring can be enabled on this document ///True if Ajax monitoring is supported on this page, otherwise false AjaxMonitor.prototype.supportsMonitoring = function () { var result = true; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.open) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.send) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.abort)) { result = false; } // disable in IE8 or older (https://www.w3schools.com/jsref/jsref_trim_string.asp) try { " a ".trim(); } catch (ex) { result = false; } return result; }; AjaxMonitor.prototype.instrumentOpen = function () { var originalOpen = XMLHttpRequest.prototype.open; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.open = function (method, url, async) { try { if (ajaxMonitorInstance.isMonitoredInstance(this, true) && (!this.ajaxData || !this.ajaxData.xhrMonitoringState.openDone)) { ajaxMonitorInstance.openHandler(this, method, url, async); } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxOpen, "Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalOpen.apply(this, arguments); }; }; AjaxMonitor.prototype.openHandler = function (xhr, method, url, async) { /* todo: Disabling the following block of code as CV is not yet supported in 1DS for 3rd Part. // this format corresponds with activity logic on server-side and is required for the correct correlation var id = "|" + this.appInsights.context.operation.id + "." + Util.newId(); */ var id = applicationinsights_common_1.Util.newId(); var ajaxData = new ajaxRecord_1.ajaxRecord(id, this._core._logger); ajaxData.method = method; ajaxData.requestUrl = url; ajaxData.xhrMonitoringState.openDone = true; xhr.ajaxData = ajaxData; this.attachToOnReadyStateChange(xhr); }; AjaxMonitor.getFailedAjaxDiagnosticsMessage = function (xhr) { var result = ""; try { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData.requestUrl)) { result += "(url: '" + xhr.ajaxData.requestUrl + "')"; } } catch (e) { } return result; }; AjaxMonitor.prototype.instrumentSend = function () { var originalSend = XMLHttpRequest.prototype.send; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.send = function (content) { try { if (ajaxMonitorInstance.isMonitoredInstance(this) && !this.ajaxData.xhrMonitoringState.sendDone) { ajaxMonitorInstance.sendHandler(this, content); } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxSend, "Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalSend.apply(this, arguments); }; }; AjaxMonitor.prototype.sendHandler = function (xhr, content) { xhr.ajaxData.requestSentTime = applicationinsights_common_1.DateTimeUtils.Now(); if (this.currentWindowHost && applicationinsights_common_1.CorrelationIdHelper.canIncludeCorrelationHeader(this._config, xhr.ajaxData.getAbsoluteUrl(), this.currentWindowHost)) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.requestIdHeader, xhr.ajaxData.id); var appId = this._config.appId; // Todo: also, get appId from channel as breeze returns it if (appId) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.requestContextHeader, applicationinsights_common_1.RequestHeaders.requestContextAppIdFormat + appId); } } xhr.ajaxData.xhrMonitoringState.sendDone = true; }; AjaxMonitor.prototype.instrumentAbort = function () { var originalAbort = XMLHttpRequest.prototype.abort; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.abort = function () { try { if (ajaxMonitorInstance.isMonitoredInstance(this) && !this.ajaxData.xhrMonitoringState.abortDone) { this.ajaxData.aborted = 1; this.ajaxData.xhrMonitoringState.abortDone = true; } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxAbort, "Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalAbort.apply(this, arguments); }; }; AjaxMonitor.prototype.attachToOnReadyStateChange = function (xhr) { var _this = this; var ajaxMonitorInstance = this; xhr.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached = ajaxUtils_1.EventHelper.AttachEvent(xhr, "readystatechange", function () { try { if (ajaxMonitorInstance.isMonitoredInstance(xhr)) { if (xhr.readyState === 4) { ajaxMonitorInstance.onAjaxComplete(xhr); } } } catch (e) { var exceptionText = applicationinsights_common_1.Util.dump(e); // ignore messages with c00c023f, as this a known IE9 XHR abort issue if (!exceptionText || exceptionText.toLowerCase().indexOf("c00c023f") == -1) { _this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxRSC, "Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), exception: applicationinsights_common_1.Util.dump(e) }); } } }); }; AjaxMonitor.prototype.onAjaxComplete = function (xhr) { xhr.ajaxData.responseFinishedTime = applicationinsights_common_1.DateTimeUtils.Now(); xhr.ajaxData.status = xhr.status; xhr.ajaxData.CalculateMetrics(); if (xhr.ajaxData.ajaxTotalDuration < 0) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxDur, "Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), requestSentTime: xhr.ajaxData.requestSentTime, responseFinishedTime: xhr.ajaxData.responseFinishedTime }); } else { var dependency = { id: xhr.ajaxData.id, absoluteUrl: xhr.ajaxData.getAbsoluteUrl(), commandName: xhr.ajaxData.getPathName(), duration: xhr.ajaxData.ajaxTotalDuration, success: (+(xhr.ajaxData.status)) >= 200 && (+(xhr.ajaxData.status)) < 400, resultCode: +xhr.ajaxData.status, method: xhr.ajaxData.method }; // enrich dependency target with correlation context from the server var correlationContext = this.getCorrelationContext(xhr); if (correlationContext) { dependency.correlationContext = /* dependency.target + " | " + */ correlationContext; } this.trackDependencyData(dependency); xhr.ajaxData = null; } }; AjaxMonitor.prototype.getCorrelationContext = function (xhr) { try { var responseHeadersString = xhr.getAllResponseHeaders(); if (responseHeadersString !== null) { var index = responseHeadersString.toLowerCase().indexOf(applicationinsights_common_1.RequestHeaders.requestContextHeaderLowerCase); if (index !== -1) { var responseHeader = xhr.getResponseHeader(applicationinsights_common_1.RequestHeaders.requestContextHeader); return applicationinsights_common_1.CorrelationIdHelper.getCorrelationContext(responseHeader); } } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxGetCorrelationHeader, "Failed to get Request-Context correlation header as it may be not included in the response or not accessible.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs dependency call * @param dependencyData dependency data object */ AjaxMonitor.prototype.trackDependencyData = function (dependency, properties, systemProperties) { if (this._config.maxAjaxCallsPerView === -1 || this._trackAjaxAttempts < this._config.maxAjaxCallsPerView) { var item = applicationinsights_common_1.TelemetryItemCreator.create(dependency, applicationinsights_common_1.RemoteDependencyData.dataType, applicationinsights_common_1.RemoteDependencyData.envelopeType, this._core._logger, properties, systemProperties); this._core.track(item); } else if (this._trackAjaxAttempts === this._config.maxAjaxCallsPerView) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.MaxAjaxPerPVExceeded, "Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.", true); } ++this._trackAjaxAttempts; }; AjaxMonitor.prototype.processTelemetry = function (item) { if (this._nextPlugin && this._nextPlugin.processTelemetry) { this._nextPlugin.processTelemetry(item); } }; AjaxMonitor.prototype.setNextPlugin = function (next) { if (next) { this._nextPlugin = next; } }; AjaxMonitor.prototype.initialize = function (config, core, extensions) { if (!this.initialized) { this._core = core; config.extensionConfig = config.extensionConfig ? config.extensionConfig : {}; var c = config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {}; this._config = { maxAjaxCallsPerView: !isNaN(c.maxAjaxCallsPerView) ? c.maxAjaxCallsPerView : 500, disableAjaxTracking: applicationinsights_common_1.Util.stringToBoolOrDefault(c.disableAjaxTracking), disableCorrelationHeaders: applicationinsights_common_1.Util.stringToBoolOrDefault(c.disableCorrelationHeaders), correlationHeaderExcludedDomains: c.correlationHeaderExcludedDomains || [ "*.blob.core.windows.net", "*.blob.core.chinacloudapi.cn", "*.blob.core.cloudapi.de", "*.blob.core.usgovcloudapi.net" ], appId: c.appId, enableCorsCorrelation: applicationinsights_common_1.Util.stringToBoolOrDefault(c.enableCorsCorrelation) }; if (this.supportsMonitoring() && !this._config.disableAjaxTracking) { this.instrumentOpen(); this.instrumentSend(); this.instrumentAbort(); this.initialized = true; } } }; return AjaxMonitor; }()); exports.AjaxMonitor = AjaxMonitor; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajax.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var XHRMonitoringState = /** @class */ (function () { function XHRMonitoringState() { this.openDone = false; this.setRequestHeaderDone = false; this.sendDone = false; this.abortDone = false; //True, if onreadyStateChangeCallback function attached to xhr, otherwise false this.onreadystatechangeCallbackAttached = false; } return XHRMonitoringState; }()); exports.XHRMonitoringState = XHRMonitoringState; var ajaxRecord = /** @class */ (function () { function ajaxRecord(id, logger) { this.completed = false; this.requestHeadersSize = null; this.ttfb = null; this.responseReceivingDuration = null; this.callbackDuration = null; this.ajaxTotalDuration = null; this.aborted = null; this.pageUrl = null; this.requestUrl = null; this.requestSize = 0; this.method = null; ///Returns the HTTP status code. this.status = null; //The timestamp when open method was invoked this.requestSentTime = null; //The timestamps when first byte was received this.responseStartedTime = null; //The timestamp when last byte was received this.responseFinishedTime = null; //The timestamp when onreadystatechange callback in readyState 4 finished this.callbackFinishedTime = null; //The timestamp at which ajax was ended this.endTime = null; //The original xhr onreadystatechange event this.originalOnreadystatechage = null; this.xhrMonitoringState = new XHRMonitoringState(); //Determines whether or not JavaScript exception occured in xhr.onreadystatechange code. 1 if occured, otherwise 0. this.clientFailure = 0; this.CalculateMetrics = function () { var self = this; // round to 3 decimal points self.ajaxTotalDuration = Math.round(applicationinsights_common_1.DateTimeUtils.GetDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000; }; this.id = id; this._logger = logger; } ajaxRecord.prototype.getAbsoluteUrl = function () { return this.requestUrl ? applicationinsights_common_1.UrlHelper.getAbsoluteUrl(this.requestUrl) : null; }; ajaxRecord.prototype.getPathName = function () { return this.requestUrl ? applicationinsights_common_1.DataSanitizer.sanitizeUrl(this._logger, applicationinsights_common_1.UrlHelper.getCompleteUrl(this.method, this.requestUrl)) : null; }; return ajaxRecord; }()); exports.ajaxRecord = ajaxRecord; ; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajaxRecord.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js": /*!******************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var stringUtils = /** @class */ (function () { function stringUtils() { } stringUtils.GetLength = function (strObject) { var res = 0; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(strObject)) { var stringified = ""; try { stringified = strObject.toString(); } catch (ex) { // some troubles with complex object } res = stringified.length; res = isNaN(res) ? 0 : res; } return res; }; return stringUtils; }()); exports.stringUtils = stringUtils; var EventHelper = /** @class */ (function () { function EventHelper() { } ///Binds the specified function to an event, so that the function gets called whenever the event fires on the object ///Object to which ///String that specifies any of the standard DHTML Events without "on" prefix ///Pointer that specifies the function to call when event fires ///True if the function was bound successfully to the event, otherwise false EventHelper.AttachEvent = function (obj, eventNameWithoutOn, handlerRef) { var result = false; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj)) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.attachEvent)) { // IE before version 9 obj.attachEvent("on" + eventNameWithoutOn, handlerRef); result = true; } else { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.addEventListener)) { // all browsers except IE before version 9 obj.addEventListener(eventNameWithoutOn, handlerRef, false); result = true; } } } return result; }; EventHelper.DetachEvent = function (obj, eventNameWithoutOn, handlerRef) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj)) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.detachEvent)) { obj.detachEvent("on" + eventNameWithoutOn, handlerRef); } else { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.removeEventListener)) { obj.removeEventListener(eventNameWithoutOn, handlerRef, false); } } } }; return EventHelper; }()); exports.EventHelper = EventHelper; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajaxUtils.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./ajax */ "./node_modules/applicationinsights-dependencies-js/bundle/ajax.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, ajax_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AjaxPlugin = ajax_1.AjaxMonitor; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-dependencies-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Application.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Application.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Application = /** @class */ (function () { function Application() { } return Application; }()); exports.Application = Application; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Application.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Device.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Device.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Device = /** @class */ (function () { /** * Constructs a new instance of the Device class */ function Device() { // don't attempt to fingerprint browsers this.id = "browser"; // Device type is a dimension in our data platform // Setting it to 'Browser' allows to separate client and server dependencies/exceptions this.type = "Browser"; } return Device; }()); exports.Device = Device; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Device.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Version = "2.0.1-beta"; var Internal = /** @class */ (function () { /** * Constructs a new instance of the internal telemetry data class. */ function Internal(config) { this.sdkVersion = (config.sdkExtension && config.sdkExtension() ? config.sdkExtension() + "_" : "") + "javascript:" + Version; } return Internal; }()); exports.Internal = Internal; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Internal.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Location.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Location.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Location = /** @class */ (function () { function Location() { } return Location; }()); exports.Location = Location; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Location.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js": /*!************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Operation = /** @class */ (function () { function Operation() { this.id = applicationinsights_common_1.Util.newId(); if (window && window.location && window.location.pathname) { this.name = window.location.pathname; } } return Operation; }()); exports.Operation = Operation; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Operation.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../SamplingScoreGenerator */ "./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, SamplingScoreGenerator_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Sample = /** @class */ (function () { function Sample(sampleRate, logger) { // We're using 32 bit math, hence max value is (2^31 - 1) this.INT_MAX_VALUE = 2147483647; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(logger)) { this._logger = new applicationinsights_core_js_1.DiagnosticLogger(); } else { this._logger = logger; } if (sampleRate > 100 || sampleRate < 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SampleRateOutOfRange, "Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.", { samplingRate: sampleRate }, true); this.sampleRate = 100; } this.sampleRate = sampleRate; this.samplingScoreGenerator = new SamplingScoreGenerator_1.SamplingScoreGenerator(); } /** * Determines if an envelope is sampled in (i.e. will be sent) or not (i.e. will be dropped). */ Sample.prototype.isSampledIn = function (envelope) { // return true as sampling will move to different extension return true; }; return Sample; }()); exports.Sample = Sample; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Sample.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Session.js": /*!**********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Session.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Session = /** @class */ (function () { function Session() { } return Session; }()); exports.Session = Session; var _SessionManager = /** @class */ (function () { function _SessionManager(config, logger) { if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(logger)) { this._logger = new applicationinsights_core_js_1.DiagnosticLogger(); } else { this._logger = logger; } if (!config) { config = {}; } if (!(typeof config.sessionExpirationMs === "function")) { config.sessionExpirationMs = function () { return _SessionManager.acquisitionSpan; }; } if (!(typeof config.sessionRenewalMs === "function")) { config.sessionRenewalMs = function () { return _SessionManager.renewalSpan; }; } this.config = config; this.automaticSession = new Session(); } _SessionManager.prototype.update = function () { if (!this.automaticSession.id) { this.initializeAutomaticSession(); } var now = applicationinsights_common_1.DateTimeUtils.Now(); var acquisitionExpired = now - this.automaticSession.acquisitionDate > this.config.sessionExpirationMs(); var renewalExpired = now - this.automaticSession.renewalDate > this.config.sessionRenewalMs(); // renew if acquisitionSpan or renewalSpan has ellapsed if (acquisitionExpired || renewalExpired) { // update automaticSession so session state has correct id this.automaticSession.isFirst = undefined; this.renew(); } else { // do not update the cookie more often than cookieUpdateInterval if (!this.cookieUpdatedTimestamp || now - this.cookieUpdatedTimestamp > _SessionManager.cookieUpdateInterval) { this.automaticSession.renewalDate = now; this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); } } }; /** * Record the current state of the automatic session and store it in our cookie string format * into the browser's local storage. This is used to restore the session data when the cookie * expires. */ _SessionManager.prototype.backup = function () { this.setStorage(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); }; /** * Use ai_session cookie data or local storage data (when the cookie is unavailable) to * initialize the automatic session. */ _SessionManager.prototype.initializeAutomaticSession = function () { var cookie = applicationinsights_common_1.Util.getCookie(this._logger, 'ai_session'); if (cookie && typeof cookie.split === "function") { this.initializeAutomaticSessionWithData(cookie); } else { // There's no cookie, but we might have session data in local storage // This can happen if the session expired or the user actively deleted the cookie // We only want to recover data if the cookie is missing from expiry. We should respect the user's wishes if the cookie was deleted actively. // The User class handles this for us and deletes our local storage object if the persistent user cookie was removed. var storage = applicationinsights_common_1.Util.getStorage(this._logger, 'ai_session'); if (storage) { this.initializeAutomaticSessionWithData(storage); } } if (!this.automaticSession.id) { this.automaticSession.isFirst = true; this.renew(); } }; /** * Extract id, aquisitionDate, and renewalDate from an ai_session payload string and * use this data to initialize automaticSession. * * @param {string} sessionData - The string stored in an ai_session cookie or local storage backup */ _SessionManager.prototype.initializeAutomaticSessionWithData = function (sessionData) { var params = sessionData.split("|"); if (params.length > 0) { this.automaticSession.id = params[0]; } try { if (params.length > 1) { var acq = +params[1]; this.automaticSession.acquisitionDate = +new Date(acq); this.automaticSession.acquisitionDate = this.automaticSession.acquisitionDate > 0 ? this.automaticSession.acquisitionDate : 0; } if (params.length > 2) { var renewal = +params[2]; this.automaticSession.renewalDate = +new Date(renewal); this.automaticSession.renewalDate = this.automaticSession.renewalDate > 0 ? this.automaticSession.renewalDate : 0; } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ErrorParsingAISessionCookie, "Error parsing ai_session cookie, session will be reset: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } if (this.automaticSession.renewalDate == 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SessionRenewalDateIsZero, "AI session renewal date is 0, session will be reset."); } }; _SessionManager.prototype.renew = function () { var now = applicationinsights_common_1.DateTimeUtils.Now(); this.automaticSession.id = applicationinsights_common_1.Util.newId(); this.automaticSession.acquisitionDate = now; this.automaticSession.renewalDate = now; this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); // If this browser does not support local storage, fire an internal log to keep track of it at this point if (!applicationinsights_common_1.Util.canUseLocalStorage()) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserDoesNotSupportLocalStorage, "Browser does not support local storage. Session durations will be inaccurate."); } }; _SessionManager.prototype.setCookie = function (guid, acq, renewal) { // Set cookie to expire after the session expiry time passes or the session renewal deadline, whichever is sooner // Expiring the cookie will cause the session to expire even if the user isn't on the page var acquisitionExpiry = acq + this.config.sessionExpirationMs(); var renewalExpiry = renewal + this.config.sessionRenewalMs(); var cookieExpiry = new Date(); var cookie = [guid, acq, renewal]; if (acquisitionExpiry < renewalExpiry) { cookieExpiry.setTime(acquisitionExpiry); } else { cookieExpiry.setTime(renewalExpiry); } var cookieDomnain = this.config.cookieDomain ? this.config.cookieDomain() : null; applicationinsights_common_1.Util.setCookie(this._logger, 'ai_session', cookie.join('|') + ';expires=' + cookieExpiry.toUTCString(), cookieDomnain); this.cookieUpdatedTimestamp = applicationinsights_common_1.DateTimeUtils.Now(); }; _SessionManager.prototype.setStorage = function (guid, acq, renewal) { // Keep data in local storage to retain the last session id, allowing us to cleanly end the session when it expires // Browsers that don't support local storage won't be able to end sessions cleanly from the client // The server will notice this and end the sessions itself, with loss of accurate session duration applicationinsights_common_1.Util.setStorage(this._logger, 'ai_session', [guid, acq, renewal].join('|')); }; _SessionManager.acquisitionSpan = 86400000; // 24 hours in ms _SessionManager.renewalSpan = 1800000; // 30 minutes in ms _SessionManager.cookieUpdateInterval = 60000; // 1 minute in ms return _SessionManager; }()); exports._SessionManager = _SessionManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Session.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/User.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/User.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var User = /** @class */ (function () { function User(config, logger) { this._logger = logger; //get userId or create new one if none exists var cookie = applicationinsights_common_1.Util.getCookie(this._logger, User.userCookieName); if (cookie) { var params = cookie.split(User.cookieSeparator); if (params.length > 0) { this.id = params[0]; } } this.config = config; if (!this.id) { this.id = applicationinsights_common_1.Util.newId(); var date = new Date(); var acqStr = applicationinsights_common_1.Util.toISOStringForIE8(date); this.accountAcquisitionDate = acqStr; // without expiration, cookies expire at the end of the session // set it to 365 days from now // 365 * 24 * 60 * 60 * 1000 = 31536000000 date.setTime(date.getTime() + 31536000000); var newCookie = [this.id, acqStr]; var cookieDomain = this.config.cookieDomain ? this.config.cookieDomain() : undefined; applicationinsights_common_1.Util.setCookie(this._logger, User.userCookieName, newCookie.join(User.cookieSeparator) + ';expires=' + date.toUTCString(), cookieDomain); // If we have an ai_session in local storage this means the user actively removed our cookies. // We should respect their wishes and clear ourselves from local storage applicationinsights_common_1.Util.removeStorage(this._logger, 'ai_session'); } // We still take the account id from the ctor param for backward compatibility. // But if the the customer set the accountId through the newer setAuthenticatedUserContext API, we will override it. this.accountId = config.accountId ? config.accountId() : undefined; // Get the auth user id and account id from the cookie if exists // Cookie is in the pattern: | var authCookie = applicationinsights_common_1.Util.getCookie(this._logger, User.authUserCookieName); if (authCookie) { authCookie = decodeURI(authCookie); var authCookieString = authCookie.split(User.cookieSeparator); if (authCookieString[0]) { this.authenticatedId = authCookieString[0]; } if (authCookieString.length > 1 && authCookieString[1]) { this.accountId = authCookieString[1]; } } } /** * Sets the authenticated user id and the account id in this session. * * @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service. * @param accountId {string} - An optional string to represent the account associated with the authenticated user. */ User.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) { if (storeInCookie === void 0) { storeInCookie = false; } // Validate inputs to ensure no cookie control characters. var isInvalidInput = !this.validateUserInput(authenticatedUserId) || (accountId && !this.validateUserInput(accountId)); if (isInvalidInput) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SetAuthContextFailedAccountName, "Setting auth user context failed. " + "User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.", true); return; } // Create cookie string. this.authenticatedId = authenticatedUserId; var authCookie = this.authenticatedId; if (accountId) { this.accountId = accountId; authCookie = [this.authenticatedId, this.accountId].join(User.cookieSeparator); } if (storeInCookie) { // Set the cookie. No expiration date because this is a session cookie (expires when browser closed). // Encoding the cookie to handle unexpected unicode characters. applicationinsights_common_1.Util.setCookie(this._logger, User.authUserCookieName, encodeURI(authCookie), this.config.cookieDomain()); } }; /** * Clears the authenticated user id and the account id from the user context. * @returns {} */ User.prototype.clearAuthenticatedUserContext = function () { this.authenticatedId = null; this.accountId = null; applicationinsights_common_1.Util.deleteCookie(this._logger, User.authUserCookieName); }; User.prototype.validateUserInput = function (id) { // Validate: // 1. Id is a non-empty string. // 2. It does not contain special characters for cookies. if (typeof id !== 'string' || !id || id.match(/,|;|=| |\|/)) { return false; } return true; }; User.cookieSeparator = '|'; User.userCookieName = 'ai_user'; User.authUserCookieName = 'ai_authUser'; return User; }()); exports.User = User; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=User.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var HashCodeScoreGenerator = /** @class */ (function () { function HashCodeScoreGenerator() { } HashCodeScoreGenerator.prototype.getHashCodeScore = function (key) { var score = this.getHashCode(key) / HashCodeScoreGenerator.INT_MAX_VALUE; return score * 100; }; HashCodeScoreGenerator.prototype.getHashCode = function (input) { if (input == "") { return 0; } while (input.length < HashCodeScoreGenerator.MIN_INPUT_LENGTH) { input = input.concat(input); } // 5381 is a magic number: http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function var hash = 5381; for (var i = 0; i < input.length; ++i) { hash = ((hash << 5) + hash) + input.charCodeAt(i); // 'hash' is of number type which means 53 bit integer (http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types-number-type) // 'hash & hash' will keep it 32 bit integer - just to make it clearer what the result is. hash = hash & hash; } return Math.abs(hash); }; // We're using 32 bit math, hence max value is (2^31 - 1) HashCodeScoreGenerator.INT_MAX_VALUE = 2147483647; // (Magic number) DJB algorithm can't work on shorter strings (results in poor distribution HashCodeScoreGenerator.MIN_INPUT_LENGTH = 8; return HashCodeScoreGenerator; }()); exports.HashCodeScoreGenerator = HashCodeScoreGenerator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=HashCodeScoreGenerator.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** * PropertiesPlugin.ts * @copyright Microsoft 2018 */ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! ./Context/Session */ "./node_modules/applicationinsights-properties-js/bundle/Context/Session.js"), __webpack_require__(/*! ./Context/Application */ "./node_modules/applicationinsights-properties-js/bundle/Context/Application.js"), __webpack_require__(/*! ./Context/Device */ "./node_modules/applicationinsights-properties-js/bundle/Context/Device.js"), __webpack_require__(/*! ./Context/Internal */ "./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js"), __webpack_require__(/*! ./Context/Location */ "./node_modules/applicationinsights-properties-js/bundle/Context/Location.js"), __webpack_require__(/*! ./Context/Operation */ "./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js"), __webpack_require__(/*! ./Context/User */ "./node_modules/applicationinsights-properties-js/bundle/Context/User.js"), __webpack_require__(/*! ./Context/Sample */ "./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, applicationinsights_common_1, Session_1, Application_1, Device_1, Internal_1, Location_1, Operation_1, User_1, Sample_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PropertiesPlugin = /** @class */ (function () { function PropertiesPlugin() { this.priority = 170; this.identifier = "AppInsightsPropertiesPlugin"; } PropertiesPlugin.prototype.initialize = function (config, core, extensions) { var extensionConfig = config.extensions && config.extensions[this.identifier] ? config.extensions[this.identifier] : {}; this._extensionConfig = { instrumentationKey: function () { return extensionConfig.instrumentationKey; }, accountId: function () { return extensionConfig.accountId; }, sessionRenewalMs: function () { return extensionConfig.sessionRenewalMs; }, sampleRate: function () { return extensionConfig.sampleRate; }, sessionExpirationMs: function () { return extensionConfig.sessionExpirationMs; }, cookieDomain: function () { return extensionConfig.cookieDomain; }, sdkExtension: function () { return extensionConfig.sdkExtension; }, isBrowserLinkTrackingEnabled: function () { return extensionConfig.isBrowserLinkTrackingEnabled; }, appId: function () { return extensionConfig.appId; } }; if (typeof window !== 'undefined') { this._sessionManager = new Session_1._SessionManager(this._extensionConfig, core.logger); this.application = new Application_1.Application(); this.device = new Device_1.Device(); this.internal = new Internal_1.Internal(this._extensionConfig); this.location = new Location_1.Location(); this.user = new User_1.User(this._extensionConfig, core.logger); this.operation = new Operation_1.Operation(); this.session = new Session_1.Session(); this.sample = new Sample_1.Sample(this._extensionConfig.sampleRate(), core.logger); } }; /** * Add Part A fields to the event * @param event The event that needs to be processed */ PropertiesPlugin.prototype.processTelemetry = function (event) { if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(event)) { // TODO(barustum): throw an internal event once we have support for internal logging } else { // if the event is not sampled in, do not bother going through the pipeline if (this.sample.isSampledIn(event)) { // If the envelope is PageView, reset the internal message count so that we can send internal telemetry for the new page. if (event.name === applicationinsights_common_1.PageView.envelopeType) { // TODO(barustum): resetInternalMessageCount once we have support for internal logging //_InternalLogging.resetInternalMessageCount(); } if (this.session) { // If customer did not provide custom session id update the session manager if (typeof this.session.id !== "string") { this._sessionManager.update(); } } this._processTelemetryInternal(event); } if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(event); } } }; /** * Sets the next plugin that comes after this plugin * @param nextPlugin The next plugin */ PropertiesPlugin.prototype.setNextPlugin = function (nextPlugin) { this._nextPlugin = nextPlugin; }; PropertiesPlugin.prototype._processTelemetryInternal = function (event) { var tagsItem = {}; if (this.session) { // If customer set id, apply his context; otherwise apply context generated from cookies if (typeof this.session.id === "string") { PropertiesPlugin._applySessionContext(tagsItem, this.session); } else { PropertiesPlugin._applySessionContext(tagsItem, this._sessionManager.automaticSession); } } // set part A fields PropertiesPlugin._applyApplicationContext(tagsItem, this.application); PropertiesPlugin._applyDeviceContext(tagsItem, this.device); PropertiesPlugin._applyInternalContext(tagsItem, this.internal); PropertiesPlugin._applyLocationContext(tagsItem, this.location); PropertiesPlugin._applySampleContext(tagsItem, this.sample); PropertiesPlugin._applyUserContext(tagsItem, this.user); PropertiesPlugin._applyOperationContext(tagsItem, this.operation); event.tags.push(tagsItem); }; PropertiesPlugin._applySessionContext = function (tags, sessionContext) { if (sessionContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof sessionContext.id === "string") { tags[tagKeys.sessionId] = sessionContext.id; } if (typeof sessionContext.isFirst !== "undefined") { tags[tagKeys.sessionIsFirst] = sessionContext.isFirst; } } }; PropertiesPlugin._applyApplicationContext = function (tagsItem, appContext) { if (appContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof appContext.ver === "string") { tagsItem[tagKeys.applicationVersion] = appContext.ver; } if (typeof appContext.build === "string") { tagsItem[tagKeys.applicationBuild] = appContext.build; } } }; PropertiesPlugin._applyDeviceContext = function (tagsItem, deviceContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (deviceContext) { if (typeof deviceContext.id === "string") { tagsItem[tagKeys.deviceId] = deviceContext.id; } if (typeof deviceContext.ip === "string") { tagsItem[tagKeys.deviceIp] = deviceContext.ip; } if (typeof deviceContext.language === "string") { tagsItem[tagKeys.deviceLanguage] = deviceContext.language; } if (typeof deviceContext.locale === "string") { tagsItem[tagKeys.deviceLocale] = deviceContext.locale; } if (typeof deviceContext.model === "string") { tagsItem[tagKeys.deviceModel] = deviceContext.model; } if (typeof deviceContext.network !== "undefined") { tagsItem[tagKeys.deviceNetwork] = deviceContext.network; } if (typeof deviceContext.oemName === "string") { tagsItem[tagKeys.deviceOEMName] = deviceContext.oemName; } if (typeof deviceContext.os === "string") { tagsItem[tagKeys.deviceOS] = deviceContext.os; } if (typeof deviceContext.osversion === "string") { tagsItem[tagKeys.deviceOSVersion] = deviceContext.osversion; } if (typeof deviceContext.resolution === "string") { tagsItem[tagKeys.deviceScreenResolution] = deviceContext.resolution; } if (typeof deviceContext.type === "string") { tagsItem[tagKeys.deviceType] = deviceContext.type; } } }; PropertiesPlugin._applyInternalContext = function (tagsItem, internalContext) { if (internalContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof internalContext.agentVersion === "string") { tagsItem[tagKeys.internalAgentVersion] = internalContext.agentVersion; } if (typeof internalContext.sdkVersion === "string") { tagsItem[tagKeys.internalSdkVersion] = internalContext.sdkVersion; } } }; PropertiesPlugin._applyLocationContext = function (tagsItem, locationContext) { if (locationContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof locationContext.ip === "string") { tagsItem[tagKeys.locationIp] = locationContext.ip; } } }; PropertiesPlugin._applySampleContext = function (tagsItem, sampleContext) { if (sampleContext) { tagsItem.sampleRate = sampleContext.sampleRate; } }; PropertiesPlugin._applyOperationContext = function (tagsItem, operationContext) { if (operationContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof operationContext.id === "string") { tagsItem[tagKeys.operationId] = operationContext.id; } if (typeof operationContext.name === "string") { tagsItem[tagKeys.operationName] = operationContext.name; } if (typeof operationContext.parentId === "string") { tagsItem[tagKeys.operationParentId] = operationContext.parentId; } if (typeof operationContext.rootId === "string") { tagsItem[tagKeys.operationRootId] = operationContext.rootId; } if (typeof operationContext.syntheticSource === "string") { tagsItem[tagKeys.operationSyntheticSource] = operationContext.syntheticSource; } } }; PropertiesPlugin._applyUserContext = function (tagsItem, userContext) { if (userContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof userContext.accountId === "string") { tagsItem[tagKeys.userAccountId] = userContext.accountId; } if (typeof userContext.agent === "string") { tagsItem[tagKeys.userAgent] = userContext.agent; } if (typeof userContext.id === "string") { tagsItem[tagKeys.userId] = userContext.id; } if (typeof userContext.authenticatedId === "string") { tagsItem[tagKeys.userAuthUserId] = userContext.authenticatedId; } if (typeof userContext.storeRegion === "string") { tagsItem[tagKeys.userStoreRegion] = userContext.storeRegion; } } }; return PropertiesPlugin; }()); exports.default = PropertiesPlugin; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PropertiesPlugin.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./HashCodeScoreGenerator */ "./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, HashCodeScoreGenerator_1, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var SamplingScoreGenerator = /** @class */ (function () { function SamplingScoreGenerator() { this.hashCodeGeneragor = new HashCodeScoreGenerator_1.HashCodeScoreGenerator(); } SamplingScoreGenerator.prototype.getSamplingScore = function (envelope) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); var score = 0; if (envelope.tags[tagKeys.userId]) { score = this.hashCodeGeneragor.getHashCodeScore(envelope.tags[tagKeys.userId]); } else if (envelope.tags[tagKeys.operationId]) { score = this.hashCodeGeneragor.getHashCodeScore(envelope.tags[tagKeys.operationId]); } else { // tslint:disable-next-line:insecure-random score = Math.random(); } return score; }; return SamplingScoreGenerator; }()); exports.SamplingScoreGenerator = SamplingScoreGenerator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SamplingScoreGenerator.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./PropertiesPlugin */ "./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PropertiesPlugin_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PropertiesPlugin = PropertiesPlugin_1.default; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-properties-js.js.map /***/ }), /***/ 0: /*!**********************************!*\ !*** multi ./amd/bundle/Init.js ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(/*! ./amd/bundle/Init.js */"./amd/bundle/Init.js"); /***/ }) /******/ }); }); //# sourceMappingURL=aisdk.0.0.15.js.map ================================================ FILE: AISKU/dist-history/aisdk.0.0.17.js ================================================ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ "./amd/bundle/Init.js": /*!****************************!*\ !*** ./amd/bundle/Init.js ***! \****************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-analytics-js */ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js"), __webpack_require__(/*! ./Initialization */ "./amd/bundle/Initialization.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_analytics_js_1, Initialization_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; //should be global function that should load as soon as SDK loads try { // E2E sku on load initializes core and pipeline using snippet as input for configuration var aiName; if (typeof window !== "undefined" && typeof JSON !== "undefined") { // get snippet or initialize to an empty object // get sdk instance name should not conflict if page uses existing sdk for a layer of instrumentation aiName = window["appInsightsSDK"]; if (window[aiName] === undefined) { // if no snippet is present, initialize default values applicationinsights_analytics_js_1.ApplicationInsights.appInsightsDefaultConfig = Initialization_1.Initialization.getDefaultConfig(); } else { if (window[aiName].initialize) { // this is the typical case for browser+snippet var snippet = window[aiName] || {}; // overwrite snippet with full appInsights var initialization = new Initialization_1.Initialization(snippet); var appInsightsLocal = initialization.loadAppInsights(); // apply full appInsights to the global instance that was initialized in the snippet for (var field in appInsightsLocal) { snippet[field] = appInsightsLocal[field]; } // Empty queue of all api calls logged prior to sdk download initialization.emptyQueue(); initialization.addHousekeepingBeforeUnload(appInsightsLocal); } } } } catch (e) { // TODO: Find better place to warn to console when SDK initialization fails if (console) { console.warn('Failed to initialize AppInsights JS SDK for instance ' + aiName + e.message); } } }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./amd/bundle/Initialization.js": /*!**************************************!*\ !*** ./amd/bundle/Initialization.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-analytics-js */ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-channel-js */ "./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js"), __webpack_require__(/*! applicationinsights-properties-js */ "./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js"), __webpack_require__(/*! applicationinsights-dependencies-js */ "./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, applicationinsights_analytics_js_1, applicationinsights_common_1, applicationinsights_channel_js_1, applicationinsights_properties_js_1, applicationinsights_dependencies_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; ; var Initialization = /** @class */ (function () { function Initialization(snippet) { // initialize the queue and config in case they are undefined snippet.queue = snippet.queue || []; var config = snippet.config || {}; // ensure instrumentationKey is specified if (config && !config.instrumentationKey) { config = snippet; applicationinsights_analytics_js_1.ApplicationInsights.Version = "2.0.0"; } this.appInsights = new applicationinsights_analytics_js_1.ApplicationInsights(); // set default values using config passed through snippet config = Initialization.getDefaultConfig(config, this.appInsights.identifier); this.properties = new applicationinsights_properties_js_1.PropertiesPlugin(); this.dependencies = new applicationinsights_dependencies_js_1.AjaxPlugin(); this.snippet = snippet; this.config = config; } // Analytics Plugin Initialization.prototype.trackPageView = function (pageView, customProperties) { this.appInsights.trackPageView(pageView, customProperties); }; Initialization.prototype.trackException = function (exception, customProperties) { this.appInsights.trackException(exception, customProperties); }; Initialization.prototype._onerror = function (exception) { this.appInsights._onerror(exception); }; Initialization.prototype.trackTrace = function (trace, customProperties) { this.appInsights.trackTrace(trace, customProperties); }; Initialization.prototype.trackMetric = function (metric, customProperties) { this.appInsights.trackMetric(metric, customProperties); }; Initialization.prototype.startTrackPage = function (name) { this.appInsights.startTrackPage(name); }; Initialization.prototype.stopTrackPage = function (name, url, customProperties) { this.appInsights.stopTrackPage(name, url, customProperties); }; Initialization.prototype.addTelemetryInitializer = function (telemetryInitializer) { return this.appInsights.addTelemetryInitializer(telemetryInitializer); }; // Properties Plugin Initialization.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) { if (storeInCookie === void 0) { storeInCookie = false; } this.properties.user.setAuthenticatedUserContext(authenticatedUserId, accountId, storeInCookie); }; Initialization.prototype.clearAuthenticatedUserContext = function () { this.properties.user.clearAuthenticatedUserContext(); }; // Dependencies Plugin Initialization.prototype.trackDependencyData = function (dependency, customProperties, systemProperties) { this.dependencies.trackDependencyData(dependency, customProperties, systemProperties); }; Initialization.prototype.loadAppInsights = function () { this.core = new applicationinsights_core_js_1.AppInsightsCore(); var extensions = []; var appInsightsChannel = new applicationinsights_channel_js_1.Sender(); extensions.push(appInsightsChannel); extensions.push(this.properties); extensions.push(this.dependencies); extensions.push(this.appInsights); // initialize core this.core.initialize(this.config, extensions); return this; }; Initialization.prototype.emptyQueue = function () { // call functions that were queued before the main script was loaded try { if (applicationinsights_common_1.Util.isArray(this.snippet.queue)) { // note: do not check length in the for-loop conditional in case something goes wrong and the stub methods are not overridden. var length = this.snippet.queue.length; for (var i = 0; i < length; i++) { var call = this.snippet.queue[i]; call(); } this.snippet.queue = undefined; delete this.snippet.queue; } } catch (exception) { var properties = {}; if (exception && typeof exception.toString === "function") { properties.exception = exception.toString(); } // need from core // Microsoft.ApplicationInsights._InternalLogging.throwInternal( // LoggingSeverity.WARNING, // _InternalMessageId.FailedToSendQueuedTelemetry, // "Failed to send queued telemetry", // properties); } }; Initialization.prototype.pollInteralLogs = function (appInsightsInstance) { // return setInterval(() => { // var queue: Array<_InternalLogMessage> = ApplicationInsights._InternalLogging.queue; // var length = queue.length; // for (var i = 0; i < length; i++) { // appInsightsInstance.trackTrace(queue[i].message); // } // queue.length = 0; // }, this.config.diagnosticLogInterval); }; Initialization.prototype.addHousekeepingBeforeUnload = function (appInsightsInstance) { // Add callback to push events when the user navigates away if (!appInsightsInstance.appInsights.config.disableFlushOnBeforeUnload && ('onbeforeunload' in window)) { var performHousekeeping = function () { // Adds the ability to flush all data before the page unloads. // Note: This approach tries to push an async request with all the pending events onbeforeunload. // Firefox does not respect this.Other browsers DO push out the call with < 100% hit rate. // Telemetry here will help us analyze how effective this approach is. // Another approach would be to make this call sync with a acceptable timeout to reduce the // impact on user experience. //appInsightsInstance.context._sender.triggerSend(); appInsightsInstance.appInsights.core.getTransmissionControls().forEach(function (queues) { queues.forEach(function (channel) { return channel.flush(true); }); }); // Back up the current session to local storage // This lets us close expired sessions after the cookies themselves expire // Todo: move this against interface behavior if (this.core.extensions["AppInsightsPropertiesPlugin"] && this.core.extensions["AppInsightsPropertiesPlugin"]._sessionManager) { this.core.extensions["AppInsightsPropertiesPlugin"]._sessionManager.backup(); } }; if (!applicationinsights_common_1.Util.addEventHandler('beforeunload', performHousekeeping)) { this.core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedToAddHandlerForOnBeforeUnload, 'Could not add handler for beforeunload'); } } }; Initialization.getDefaultConfig = function (configuration, identifier) { if (!configuration) { configuration = {}; } if (configuration) { identifier = identifier ? identifier : "ApplicationInsightsAnalytics"; } // Undefined checks if (!configuration.extensionConfig) { configuration.extensionConfig = {}; } if (!configuration.extensionConfig[identifier]) { configuration.extensionConfig[identifier] = {}; } var extensionConfig = configuration.extensionConfig[identifier]; // ref to main config // set default values configuration.endpointUrl = configuration.endpointUrl || "https://dc.services.visualstudio.com/v2/track"; extensionConfig.sessionRenewalMs = 30 * 60 * 1000; extensionConfig.sessionExpirationMs = 24 * 60 * 60 * 1000; extensionConfig.enableDebug = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.enableDebug); extensionConfig.disableExceptionTracking = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableExceptionTracking); extensionConfig.consoleLoggingLevel = extensionConfig.consoleLoggingLevel || 1; // Show only CRITICAL level extensionConfig.telemetryLoggingLevel = extensionConfig.telemetryLoggingLevel || 0; // Send nothing extensionConfig.diagnosticLogInterval = extensionConfig.diagnosticLogInterval || 10000; extensionConfig.autoTrackPageVisitTime = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.autoTrackPageVisitTime); if (isNaN(extensionConfig.samplingPercentage) || extensionConfig.samplingPercentage <= 0 || extensionConfig.samplingPercentage >= 100) { extensionConfig.samplingPercentage = 100; } extensionConfig.disableAjaxTracking = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableAjaxTracking); extensionConfig.maxAjaxCallsPerView = !isNaN(extensionConfig.maxAjaxCallsPerView) ? extensionConfig.maxAjaxCallsPerView : 500; extensionConfig.disableCorrelationHeaders = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableCorrelationHeaders); extensionConfig.correlationHeaderExcludedDomains = extensionConfig.correlationHeaderExcludedDomains || [ "*.blob.core.windows.net", "*.blob.core.chinacloudapi.cn", "*.blob.core.cloudapi.de", "*.blob.core.usgovcloudapi.net" ]; extensionConfig.disableFlushOnBeforeUnload = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableFlushOnBeforeUnload); extensionConfig.isCookieUseDisabled = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.isCookieUseDisabled); extensionConfig.isStorageUseDisabled = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.isStorageUseDisabled); extensionConfig.isBrowserLinkTrackingEnabled = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.isBrowserLinkTrackingEnabled); extensionConfig.enableCorsCorrelation = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.enableCorsCorrelation); return configuration; }; return Initialization; }()); exports.Initialization = Initialization; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** * ApplicationInsights.ts * @copyright Microsoft 2018 */ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./Telemetry/PageViewManager */ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1, PageViewManager_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; var durationProperty = "duration"; var ApplicationInsights = /** @class */ (function () { function ApplicationInsights() { this.identifier = "ApplicationInsightsAnalytics"; this.priority = 160; // take from reserved priority range 100- 200 this._isInitialized = false; // Counts number of trackAjax invokations. // By default we only monitor X ajax call per view to avoid too much load. // Default value is set in config. // This counter keeps increasing even after the limit is reached. this._trackAjaxAttempts = 0; this.initialize = this._initialize.bind(this); } ApplicationInsights.prototype.processTelemetry = function (env) { var doNotSendItem = false; try { var telemetryInitializersCount = this._telemetryInitializers.length; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = this._telemetryInitializers[i]; if (telemetryInitializer) { if (telemetryInitializer.apply(null, [env]) === false) { doNotSendItem = true; break; } } } } catch (e) { doNotSendItem = true; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryInitializerFailed, "One of telemetry initializers failed, telemetry item will not be sent: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }, true); } if (!doNotSendItem && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(env); } }; ApplicationInsights.prototype.setNextPlugin = function (next) { this._nextPlugin = next; }; /** * @description Log a diagnostic message * @param {ITraceTelemetry} trace * @param {{[key: string]: any}} [customProperties] * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackTrace = function (trace, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(trace, applicationinsights_common_1.Trace.dataType, applicationinsights_common_1.Trace.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TrackTraceFailed, "trackTrace failed, trace will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * @description Log a numeric value that is not associated with a specific event. Typically * used to send regular reports of performance indicators. To send single measurement, just * use the name and average fields of {@link IMetricTelemetry}. If you take measurements * frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements * and sending the resulting average at intervals * @param {IMetricTelemetry} metric input object argument. Only name and average are mandatory. * @param {{[key: string]: any}} customProperties additional data used to filter metrics in the * portal. Defaults to empty. * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackMetric = function (metric, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(metric, applicationinsights_common_1.Metric.dataType, applicationinsights_common_1.Metric.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackMetricFailed, "trackMetric failed, metric will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs that a page or other item was viewed. * @param IPageViewTelemetry The string you used as the name in startTrackPage. Defaults to the document title. * @param customProperties Additional data used to filter events and metrics. Defaults to empty. If a user wants * to provide a custom duration, it'll have to be in customProperties */ ApplicationInsights.prototype.trackPageView = function (pageView, customProperties) { try { this._pageViewManager.trackPageView(pageView, customProperties); if (this.config.autoTrackPageVisitTime) { this._pageVisitTimeManager.trackPreviousPageVisit(pageView.name, pageView.uri); } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackPVFailed, "trackPageView failed, page view will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Create a page view telemetry item and send it to the SDK pipeline through the core.track API * @param pageView Page view item to be sent * @param properties Custom properties (Part C) that a user can add to the telemetry item * @param systemProperties System level properties (Part A) that a user can add to the telemetry item */ ApplicationInsights.prototype.sendPageViewInternal = function (pageView, properties, systemProperties) { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(pageView, applicationinsights_common_1.PageView.dataType, applicationinsights_common_1.PageView.envelopeType, this._logger, properties, systemProperties); // set instrumentation key this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); // reset ajaxes counter this._trackAjaxAttempts = 0; }; ApplicationInsights.prototype.sendPageViewPerformanceInternal = function (pageViewPerformance, properties) { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(pageViewPerformance, applicationinsights_common_1.PageViewPerformance.dataType, applicationinsights_common_1.PageViewPerformance.envelopeType, this._logger, properties); // set instrumentation key this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); }; /** * Starts timing how long the user views a page or other item. Call this when the page opens. * This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes. * @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title. */ ApplicationInsights.prototype.startTrackPage = function (name) { try { if (typeof name !== "string") { name = window.document && window.document.title || ""; } this._pageTracking.start(name); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.StartTrackFailed, "startTrackPage failed, page view may not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs how long a page or other item was visible, after {@link startTrackPage}. Call this when the page closes. * @param name The string you used as the name in startTrackPage. Defaults to the document title. * @param url A relative or absolute URL that identifies the page or other item. Defaults to the window location. * @param properties Additional data used to filter pages and metrics in the portal. Defaults to empty. * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric */ ApplicationInsights.prototype.stopTrackPage = function (name, url, properties) { try { if (typeof name !== "string") { name = window.document && window.document.title || ""; } if (typeof url !== "string") { url = window.location && window.location.href || ""; } this._pageTracking.stop(name, url, properties); if (this.config.autoTrackPageVisitTime) { this._pageVisitTimeManager.trackPreviousPageVisit(name, url); } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.StopTrackFailed, "stopTrackPage failed, page view will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Log an exception you have caught. * * @param {IExceptionTelemetry} exception Object which contains exception to be sent * @param {{[key: string]: any}} customProperties Additional data used to filter pages and metrics in the portal. Defaults to empty. * * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric. * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackException = function (exception, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(exception, applicationinsights_common_1.Exception.dataType, applicationinsights_common_1.Exception.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackExceptionFailed, "trackException failed, exception will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * @description Custom error handler for Application Insights Analytics * @param {IAutoExceptionTelemetry} exception * @memberof ApplicationInsights */ ApplicationInsights.prototype._onerror = function (exception) { try { var properties = { url: (exception && exception.url) || document.URL, lineNumber: exception.lineNumber, columnNumber: exception.columnNumber, message: exception.message }; if (applicationinsights_common_1.Util.isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception.error)) { this._sendCORSException(properties.url); } else { if (!applicationinsights_common_1.Util.isError(exception.error)) { var stack = "window.onerror@" + properties.url + ":" + exception.lineNumber + ":" + (exception.columnNumber || 0); exception.error = new Error(exception.message); exception.error.stack = stack; } this.trackException({ error: exception.error, severityLevel: applicationinsights_common_1.SeverityLevel.Error }, properties); } } catch (e) { var errorString = exception.error ? (exception.error.name + ", " + exception.error.message) : "null"; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ExceptionWhileLoggingError, "_onError threw exception while logging error, error will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e), errorString: errorString }); } }; ApplicationInsights.prototype.addTelemetryInitializer = function (telemetryInitializer) { this._telemetryInitializers.push(telemetryInitializer); }; ApplicationInsights.prototype._initialize = function (config, core, extensions) { var _this = this; if (this._isInitialized) { return; } if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(core)) { throw Error("Error initializing"); } this.core = core; this._logger = core.logger; this._globalconfig = { instrumentationKey: config.instrumentationKey, endpointUrl: config.endpointUrl }; this.config = config.extensionConfig && config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {}; // load default values if specified var defaults = ApplicationInsights.appInsightsDefaultConfig; if (defaults !== undefined) { if (defaults.extensions && defaults.extensions[this.identifier]) { for (var field in defaults.extensions[this.identifier]) { // for each unspecified field, set the default value if (this.config[field] === undefined) { this.config[field] = defaults[field]; } } } if (this._globalconfig) { for (var field in defaults) { if (this._globalconfig[field] === undefined) { this._globalconfig[field] = defaults[field]; } } } } // Todo: move this out of static state if (this.config.isCookieUseDisabled) { applicationinsights_common_1.Util.disableCookies(); } // Todo: move this out of static state if (this.config.isStorageUseDisabled) { applicationinsights_common_1.Util.disableStorage(); } var configGetters = { instrumentationKey: function () { return config.instrumentationKey; }, accountId: function () { return _this.config.accountId; }, sessionRenewalMs: function () { return _this.config.sessionRenewalMs; }, sessionExpirationMs: function () { return _this.config.sessionExpirationMs; }, sampleRate: function () { return _this.config.samplingPercentage; }, cookieDomain: function () { return _this.config.cookieDomain; }, sdkExtension: function () { return _this.config.sdkExtension; }, isBrowserLinkTrackingEnabled: function () { return _this.config.isBrowserLinkTrackingEnabled; }, appId: function () { return _this.config.appId; } }; this._pageViewManager = new PageViewManager_1.PageViewManager(this, this.config.overridePageViewDuration, this.core); this._telemetryInitializers = []; this._addDefaultTelemetryInitializers(configGetters); // initialize page view timing this._pageTracking = new Timing(this._logger, "trackPageView"); this._pageTracking.action = function (name, url, duration, properties) { var pageViewItem = { name: name, uri: url }; // duration must be a custom property in order for the collector to extract it if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(properties)) { properties = {}; } properties[durationProperty] = duration; _this.sendPageViewInternal(pageViewItem, properties); }; if (this.config.disableExceptionTracking === false && !this.config.autoExceptionInstrumented) { // We want to enable exception auto collection and it has not been done so yet var onerror_1 = "onerror"; var originalOnError_1 = window[onerror_1]; var instance_1 = this; window.onerror = function (message, url, lineNumber, columnNumber, error) { var handled = originalOnError_1 && originalOnError_1(message, url, lineNumber, columnNumber, error); if (handled !== true) { instance_1._onerror({ message: message, url: url, lineNumber: lineNumber, columnNumber: columnNumber, error: error }); } return handled; }; this.config.autoExceptionInstrumented = true; } this._isInitialized = true; }; ApplicationInsights.prototype._addDefaultTelemetryInitializers = function (configGetters) { if (!configGetters.isBrowserLinkTrackingEnabled()) { var browserLinkPaths_1 = ['/browserLinkSignalR/', '/__browserLink/']; var dropBrowserLinkRequests = function (envelope) { if (envelope.baseType === applicationinsights_common_1.RemoteDependencyData.dataType) { var remoteData = envelope.baseData; if (remoteData) { for (var i = 0; i < browserLinkPaths_1.length; i++) { if (remoteData.absoluteUrl && remoteData.absoluteUrl.indexOf(browserLinkPaths_1[i]) >= 0) { return false; } } } } return true; }; this._addTelemetryInitializer(dropBrowserLinkRequests); } }; ApplicationInsights.prototype._addTelemetryInitializer = function (telemetryInitializer) { this._telemetryInitializers.push(telemetryInitializer); }; ApplicationInsights.prototype._sendCORSException = function (url) { var exception = { message: "Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.", url: url, lineNumber: 0, columnNumber: 0, error: undefined }; var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(exception, applicationinsights_common_1.Exception.dataType, applicationinsights_common_1.Exception.envelopeType, this._logger, { url: url }); this.core.track(telemetryItem); }; // Mutate telemetryItem inplace to add boilerplate iKey & name info ApplicationInsights.prototype._setTelemetryNameAndIKey = function (telemetryItem) { telemetryItem.instrumentationKey = this._globalconfig.instrumentationKey; var iKeyNoDashes = this._globalconfig.instrumentationKey.replace(/-/g, ""); telemetryItem.name = telemetryItem.name.replace("{0}", iKeyNoDashes); }; ApplicationInsights.Version = "2.0.1-beta"; return ApplicationInsights; }()); exports.ApplicationInsights = ApplicationInsights; /** * Used to record timed events and page views. */ var Timing = /** @class */ (function () { function Timing(logger, name) { this._name = name; this._events = {}; this._logger = logger; } Timing.prototype.start = function (name) { if (typeof this._events[name] !== "undefined") { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StartCalledMoreThanOnce, "start was called more than once for this event without calling stop.", { name: this._name, key: name }, true); } this._events[name] = +new Date; }; Timing.prototype.stop = function (name, url, properties) { var start = this._events[name]; if (isNaN(start)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StopCalledWithoutStart, "stop was called without a corresponding start.", { name: this._name, key: name }, true); } else { var end = +new Date; var duration = applicationinsights_common_1.PageViewPerformance.getDuration(start, end); this.action(name, url, duration, properties); } delete this._events[name]; this._events[name] = undefined; }; return Timing; }()); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ApplicationInsights.js.map /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js ***! \*********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Class encapsulates sending page views and page view performance telemetry. */ var PageViewManager = /** @class */ (function () { function PageViewManager(appInsights, overridePageViewDuration, core) { this.pageViewPerformanceSent = false; this.overridePageViewDuration = false; this.overridePageViewDuration = overridePageViewDuration; this.appInsights = appInsights; if (core) { this._channel = function () { return (core.getTransmissionControls()); }; this._logger = core.logger; } } /** * Currently supported cases: * 1) (default case) track page view called with default parameters, overridePageViewDuration = false. Page view is sent with page view performance when navigation timing data is available. * a. If navigation timing is not supported then page view is sent right away with undefined duration. Page view performance is not sent. * 2) overridePageViewDuration = true, custom duration provided. Custom duration is used, page view sends right away. * 3) overridePageViewDuration = true, custom duration NOT provided. Page view is sent right away, duration is time spent from page load till now (or undefined if navigation timing is not supported). * 4) overridePageViewDuration = false, custom duration is provided. Page view is sent right away with custom duration. * * In all cases page view performance is sent once (only for the 1st call of trackPageView), or not sent if navigation timing is not supported. */ PageViewManager.prototype.trackPageView = function (pageView, customProperties) { var _this = this; var name = pageView.name; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(name) || typeof name !== "string") { pageView.name = window.document && window.document.title || ""; } var uri = pageView.uri; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(uri) || typeof uri !== "string") { pageView.uri = window.location && window.location.href || ""; } // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user // do not provide the duration, set duration to undefined // Also this is case 4 if (!applicationinsights_common_1.PageViewPerformance.isPerformanceTimingSupported()) { this.appInsights.sendPageViewInternal(pageView, customProperties); this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing) this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.NavigationTimingNotSupported, "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info."); return; } var pageViewSent = false; var customDuration = undefined; // if the performance timing is supported by the browser, calculate the custom duration var start = applicationinsights_common_1.PageViewPerformance.getPerformanceTiming().navigationStart; customDuration = applicationinsights_common_1.PageViewPerformance.getDuration(start, +new Date); if (!applicationinsights_common_1.PageViewPerformance.shouldCollectDuration(customDuration)) { customDuration = undefined; } // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier var duration = undefined; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties.duration)) { duration = customProperties.duration; } if (this.overridePageViewDuration || !isNaN(duration)) { if (isNaN(duration)) { // case 3 if (!customProperties) { customProperties = {}; } customProperties["duration"] = customDuration; } // case 2 this.appInsights.sendPageViewInternal(pageView, customProperties); this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); pageViewSent = true; } // now try to send the page view performance telemetry var maxDurationLimit = 60000; if (!customProperties) { customProperties = {}; } var handle = setInterval((function () { try { if (applicationinsights_common_1.PageViewPerformance.isPerformanceTimingDataReady()) { clearInterval(handle); var pageViewPerformance = new applicationinsights_common_1.PageViewPerformance(_this._logger, name, uri, null); if (!pageViewPerformance.getIsValid() && !pageViewSent) { // If navigation timing gives invalid numbers, then go back to "override page view duration" mode. // That's the best value we can get that makes sense. customProperties["duration"] = customDuration; _this.appInsights.sendPageViewInternal(pageView, customProperties); _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } else { if (!pageViewSent) { customProperties["duration"] = pageViewPerformance.getDurationMs(); _this.appInsights.sendPageViewInternal(pageView, customProperties); } if (!_this.pageViewPerformanceSent) { _this.appInsights.sendPageViewPerformanceInternal(pageViewPerformance, customProperties); _this.pageViewPerformanceSent = true; } _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } } else if (applicationinsights_common_1.PageViewPerformance.getDuration(start, +new Date) > maxDurationLimit) { // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready clearInterval(handle); if (!pageViewSent) { customProperties["duration"] = maxDurationLimit; _this.appInsights.sendPageViewInternal(pageView, customProperties); _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } } } catch (e) { _this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackPVFailedCalc, "trackPageView failed on page load calculation: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }), 100); }; return PageViewManager; }()); exports.PageViewManager = PageViewManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewManager.js.map /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./JavaScriptSDK/ApplicationInsights */ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, ApplicationInsights_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApplicationInsights = ApplicationInsights_1.ApplicationInsights; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-analytics-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ContextTagKeys = [ "ai.application.ver", "ai.application.build", "ai.application.typeId", "ai.application.applicationId", "ai.application.layer", "ai.device.id", "ai.device.ip", "ai.device.language", "ai.device.locale", "ai.device.model", "ai.device.friendlyName", "ai.device.network", "ai.device.networkName", "ai.device.oemName", "ai.device.os", "ai.device.osVersion", "ai.device.roleInstance", "ai.device.roleName", "ai.device.screenResolution", "ai.device.type", "ai.device.machineName", "ai.device.vmName", "ai.device.browser", "ai.device.browserVersion", "ai.location.ip", "ai.location.country", "ai.location.province", "ai.location.city", "ai.operation.id", "ai.operation.name", "ai.operation.parentId", "ai.operation.rootId", "ai.operation.syntheticSource", "ai.operation.correlationVector", "ai.session.id", "ai.session.isFirst", "ai.session.isNew", "ai.user.accountAcquisitionDate", "ai.user.accountId", "ai.user.userAgent", "ai.user.id", "ai.user.storeRegion", "ai.user.authUserId", "ai.user.anonUserAcquisitionDate", "ai.user.authUserAcquisitionDate", "ai.cloud.name", "ai.cloud.role", "ai.cloud.roleVer", "ai.cloud.roleInstance", "ai.cloud.environment", "ai.cloud.location", "ai.cloud.deploymentUnit", "ai.internal.sdkVersion", "ai.internal.agentVersion", "ai.internal.nodeName", ]; // these two constants are used to filter out properties not needed when trying to extract custom properties and measurements from the incoming payload var baseType = "baseType"; var baseData = "baseData"; var EnvelopeCreator = /** @class */ (function () { function EnvelopeCreator() { } EnvelopeCreator.extractProperties = function (data) { var customProperties = null; for (var key in data) { if (data.hasOwnProperty(key)) { var value = data[key]; if (typeof value !== "number") { if (!customProperties) { customProperties = {}; } customProperties[key] = value; } } } return customProperties; }; EnvelopeCreator.extractPropsAndMeasurements = function (data, properties, measurements) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(data)) { for (var key in data) { if (data.hasOwnProperty(key)) { var value = data[key]; if (typeof value === "number") { measurements[key] = value; } else { properties[key] = value; } } } } }; // TODO: Do we want this to take logger as arg or use this._logger as nonstatic? EnvelopeCreator.createEnvelope = function (logger, envelopeType, telemetryItem, data) { var envelope = new applicationinsights_common_1.Envelope(logger, data, envelopeType); envelope.iKey = telemetryItem.instrumentationKey; var iKeyNoDashes = telemetryItem.instrumentationKey.replace(/-/g, ""); envelope.name = envelope.name.replace("{0}", iKeyNoDashes); // loop through the envelope ctx (Part A) and pick out the ones that should go in outgoing envelope tags for (var key in telemetryItem.ctx) { if (telemetryItem.ctx.hasOwnProperty(key)) { if (exports.ContextTagKeys.indexOf(key) >= 0) { envelope.tags[key] = telemetryItem.ctx[key]; } } } // loop through the envelope tags (extension of Part A) and pick out the ones that should go in outgoing envelope tags telemetryItem.tags.forEach(function (tag) { for (var key in tag) { if (tag.hasOwnProperty(key)) { if (exports.ContextTagKeys.indexOf(key) >= 0) { envelope.tags[key] = tag[key]; } } } }); return envelope; }; return EnvelopeCreator; }()); exports.EnvelopeCreator = EnvelopeCreator; var DependencyEnvelopeCreator = /** @class */ (function (_super) { __extends(DependencyEnvelopeCreator, _super); function DependencyEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } DependencyEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customMeasurements = {}; var customProperties = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var bd = telemetryItem.baseData; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(bd)) { logger.warnToConsole("Invalid input for dependency data"); return null; } var id = bd.id; var absoluteUrl = bd.absoluteUrl; var command = bd.commandName; var duration = bd.duration; var success = bd.success; var resultCode = bd.resultCode; var method = bd.method; var baseData = new applicationinsights_common_1.RemoteDependencyData(logger, id, absoluteUrl, command, duration, success, resultCode, method, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.RemoteDependencyData.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.RemoteDependencyData.envelopeType, telemetryItem, data); }; DependencyEnvelopeCreator.DependencyEnvelopeCreator = new DependencyEnvelopeCreator(); return DependencyEnvelopeCreator; }(EnvelopeCreator)); exports.DependencyEnvelopeCreator = DependencyEnvelopeCreator; var EventEnvelopeCreator = /** @class */ (function (_super) { __extends(EventEnvelopeCreator, _super); function EventEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } EventEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; if (telemetryItem.baseType !== applicationinsights_common_1.Event.dataType) { EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.baseData, customProperties, customMeasurements); } EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var eventName = telemetryItem.baseData.name; var baseData = new applicationinsights_common_1.Event(logger, eventName, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Event.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Event.envelopeType, telemetryItem, data); }; EventEnvelopeCreator.EventEnvelopeCreator = new EventEnvelopeCreator(); return EventEnvelopeCreator; }(EnvelopeCreator)); exports.EventEnvelopeCreator = EventEnvelopeCreator; var ExceptionEnvelopeCreator = /** @class */ (function (_super) { __extends(ExceptionEnvelopeCreator, _super); function ExceptionEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } ExceptionEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var exception = telemetryItem.baseData.error; var severityLevel = telemetryItem.baseData.severityLevel; var baseData = new applicationinsights_common_1.Exception(logger, exception, customProperties, customMeasurements, severityLevel); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Exception.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Exception.envelopeType, telemetryItem, data); }; ExceptionEnvelopeCreator.ExceptionEnvelopeCreator = new ExceptionEnvelopeCreator(); return ExceptionEnvelopeCreator; }(EnvelopeCreator)); exports.ExceptionEnvelopeCreator = ExceptionEnvelopeCreator; var MetricEnvelopeCreator = /** @class */ (function (_super) { __extends(MetricEnvelopeCreator, _super); function MetricEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } MetricEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = EnvelopeCreator.extractProperties(telemetryItem.data); var name = telemetryItem.baseData.name; var average = telemetryItem.baseData.average; var sampleCount = telemetryItem.baseData.sampleCount; var min = telemetryItem.baseData.min; var max = telemetryItem.baseData.max; var baseData = new applicationinsights_common_1.Metric(logger, name, average, sampleCount, min, max, customProperties); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Metric.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Metric.envelopeType, telemetryItem, data); }; MetricEnvelopeCreator.MetricEnvelopeCreator = new MetricEnvelopeCreator(); return MetricEnvelopeCreator; }(EnvelopeCreator)); exports.MetricEnvelopeCreator = MetricEnvelopeCreator; var PageViewEnvelopeCreator = /** @class */ (function (_super) { __extends(PageViewEnvelopeCreator, _super); function PageViewEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } PageViewEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } // Since duration is not part of the domain properties in Common Schema, extract it from part C var duration = undefined; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.data) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.data.duration)) { duration = telemetryItem.data.duration; delete telemetryItem.data.duration; } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var name = telemetryItem.baseData.name; var url = telemetryItem.baseData.uri; // Todo: move IPageViewTelemetry to common as we are missing type checks on baseData here // refUri is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.refUri)) { customProperties["refUri"] = telemetryItem.baseData.refUri; } // pageType is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.pageType)) { customProperties["pageType"] = telemetryItem.baseData.pageType; } // isLoggedIn is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.isLoggedIn)) { customProperties["isLoggedIn"] = telemetryItem.baseData.isLoggedIn; } // pageTags is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.pageTags)) { var pageTags = telemetryItem.baseData.pageTags; for (var key in pageTags) { if (pageTags.hasOwnProperty(key)) { customProperties[key] = pageTags[key]; } } } var baseData = new applicationinsights_common_1.PageView(logger, name, url, duration, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.PageView.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.PageView.envelopeType, telemetryItem, data); }; PageViewEnvelopeCreator.PageViewEnvelopeCreator = new PageViewEnvelopeCreator(); return PageViewEnvelopeCreator; }(EnvelopeCreator)); exports.PageViewEnvelopeCreator = PageViewEnvelopeCreator; var PageViewPerformanceEnvelopeCreator = /** @class */ (function (_super) { __extends(PageViewPerformanceEnvelopeCreator, _super); function PageViewPerformanceEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } PageViewPerformanceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var name = telemetryItem.baseData.name; var url = telemetryItem.baseData.uri; var duration = telemetryItem.baseData.duration; var baseData = new applicationinsights_common_1.PageViewPerformance(logger, name, url, duration, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.PageViewPerformance.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.PageViewPerformance.envelopeType, telemetryItem, data); }; PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator = new PageViewPerformanceEnvelopeCreator(); return PageViewPerformanceEnvelopeCreator; }(EnvelopeCreator)); exports.PageViewPerformanceEnvelopeCreator = PageViewPerformanceEnvelopeCreator; var TraceEnvelopeCreator = /** @class */ (function (_super) { __extends(TraceEnvelopeCreator, _super); function TraceEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } TraceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var message = telemetryItem.baseData.message; var severityLevel = telemetryItem.baseData.severityLevel; var customProperties = EnvelopeCreator.extractProperties(telemetryItem.data); var baseData = new applicationinsights_common_1.Trace(logger, message, customProperties, severityLevel); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Trace.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Trace.envelopeType, telemetryItem, data); }; TraceEnvelopeCreator.TraceEnvelopeCreator = new TraceEnvelopeCreator(); return TraceEnvelopeCreator; }(EnvelopeCreator)); exports.TraceEnvelopeCreator = TraceEnvelopeCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EnvelopeCreator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Offline.js": /*!***********************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Offline.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @description Monitors browser for offline events * @export default - Offline: Static instance of OfflineListener * @class OfflineListener */ var OfflineListener = /** @class */ (function () { function OfflineListener() { this._onlineStatus = true; if (window && window.addEventListener) { window.addEventListener('online', this._setOnline.bind(this), false); window.addEventListener('offline', this._setOffline.bind(this), false); this.isListening = true; } else if (document && document.body) { document.body.ononline = this._setOnline.bind(this); document.body.onoffline = this._setOffline.bind(this); this.isListening = true; } else if (document) { document.ononline = this._setOnline.bind(this); document.onoffline = this._setOffline.bind(this); this.isListening = true; } else { // Could not find a place to add event listener this.isListening = false; } } OfflineListener.prototype._setOnline = function () { this._onlineStatus = true; }; OfflineListener.prototype._setOffline = function () { this._onlineStatus = false; }; OfflineListener.prototype.isOnline = function () { if (this.isListening) { return this._onlineStatus; } else if (navigator) { return navigator.onLine; } else { // Cannot determine online status - report as online return true; } }; OfflineListener.prototype.isOffline = function () { return !this.isOnline(); }; OfflineListener.Offline = new OfflineListener; return OfflineListener; }()); exports.OfflineListener = OfflineListener; exports.Offline = OfflineListener.Offline; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Offline.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js": /*!**************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* * An array based send buffer. */ var ArraySendBuffer = /** @class */ (function () { function ArraySendBuffer(config) { this._config = config; this._buffer = []; } ArraySendBuffer.prototype.enqueue = function (payload) { this._buffer.push(payload); }; ArraySendBuffer.prototype.count = function () { return this._buffer.length; }; ArraySendBuffer.prototype.clear = function () { this._buffer.length = 0; }; ArraySendBuffer.prototype.getItems = function () { return this._buffer.slice(0); }; ArraySendBuffer.prototype.batchPayloads = function (payload) { if (payload && payload.length > 0) { var batch = this._config.emitLineDelimitedJson() ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; ArraySendBuffer.prototype.markAsSent = function (payload) { this.clear(); }; ArraySendBuffer.prototype.clearSent = function (payload) { // not supported }; return ArraySendBuffer; }()); exports.ArraySendBuffer = ArraySendBuffer; /* * Session storege buffer holds a copy of all unsent items in the browser session storage. */ var SessionStorageSendBuffer = /** @class */ (function () { function SessionStorageSendBuffer(logger, config) { this._bufferFullMessageSent = false; this._logger = logger; this._config = config; var bufferItems = this.getBuffer(SessionStorageSendBuffer.BUFFER_KEY); var notDeliveredItems = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); this._buffer = bufferItems.concat(notDeliveredItems); // If the buffer has too many items, drop items from the end. if (this._buffer.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { this._buffer.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } // update DataLossAnalyzer with the number of recovered items // Uncomment if you want to use DataLossanalyzer // DataLossAnalyzer.itemsRestoredFromSessionBuffer = this._buffer.length; this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); } SessionStorageSendBuffer.prototype.enqueue = function (payload) { if (this._buffer.length >= SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // sent internal log only once per page view if (!this._bufferFullMessageSent) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SessionStorageBufferFull, "Maximum buffer size reached: " + this._buffer.length, true); this._bufferFullMessageSent = true; } return; } this._buffer.push(payload); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); }; SessionStorageSendBuffer.prototype.count = function () { return this._buffer.length; }; SessionStorageSendBuffer.prototype.clear = function () { this._buffer.length = 0; this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, []); this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); this._bufferFullMessageSent = false; }; SessionStorageSendBuffer.prototype.getItems = function () { return this._buffer.slice(0); }; SessionStorageSendBuffer.prototype.batchPayloads = function (payload) { if (payload && payload.length > 0) { var batch = this._config.emitLineDelimitedJson() ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; SessionStorageSendBuffer.prototype.markAsSent = function (payload) { this._buffer = this.removePayloadsFromBuffer(payload, this._buffer); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); if (sentElements instanceof Array && payload instanceof Array) { sentElements = sentElements.concat(payload); if (sentElements.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // We send telemetry normally. If the SENT_BUFFER is too big we don't add new elements // until we receive a response from the backend and the buffer has free space again (see clearSent method) this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.SessionStorageBufferFull, "Sent buffer reached its maximum size: " + sentElements.length, true); sentElements.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); } }; SessionStorageSendBuffer.prototype.clearSent = function (payload) { var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); sentElements = this.removePayloadsFromBuffer(payload, sentElements); this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); }; SessionStorageSendBuffer.prototype.removePayloadsFromBuffer = function (payloads, buffer) { var remaining = []; for (var i in buffer) { var contains = false; for (var j in payloads) { if (payloads[j] === buffer[i]) { contains = true; break; } } if (!contains) { remaining.push(buffer[i]); } } ; return remaining; }; SessionStorageSendBuffer.prototype.getBuffer = function (key) { try { var bufferJson = applicationinsights_common_1.Util.getSessionStorage(this._logger, key); if (bufferJson) { var buffer = JSON.parse(bufferJson); if (buffer) { return buffer; } } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedToRestoreStorageBuffer, " storage key: " + key + ", " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } return []; }; SessionStorageSendBuffer.prototype.setBuffer = function (key, buffer) { try { var bufferJson = JSON.stringify(buffer); applicationinsights_common_1.Util.setSessionStorage(this._logger, key, bufferJson); } catch (e) { // if there was an error, clear the buffer // telemetry is stored in the _buffer array so we won't loose any items applicationinsights_common_1.Util.setSessionStorage(this._logger, key, JSON.stringify([])); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedToSetStorageBuffer, " storage key: " + key + ", " + applicationinsights_common_1.Util.getExceptionName(e) + ". Buffer cleared", { exception: applicationinsights_common_1.Util.dump(e) }); } }; SessionStorageSendBuffer.BUFFER_KEY = "AI_buffer"; SessionStorageSendBuffer.SENT_BUFFER_KEY = "AI_sentBuffer"; // Maximum number of payloads stored in the buffer. If the buffer is full, new elements will be dropped. SessionStorageSendBuffer.MAX_BUFFER_SIZE = 2000; return SessionStorageSendBuffer; }()); exports.SessionStorageSendBuffer = SessionStorageSendBuffer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SendBuffer.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Sender.js": /*!**********************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Sender.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./SendBuffer */ "./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js"), __webpack_require__(/*! ./EnvelopeCreator */ "./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js"), __webpack_require__(/*! ./TelemetryValidation/EventValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js"), __webpack_require__(/*! ./TelemetryValidation/TraceValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js"), __webpack_require__(/*! ./TelemetryValidation/ExceptionValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js"), __webpack_require__(/*! ./TelemetryValidation/MetricValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js"), __webpack_require__(/*! ./TelemetryValidation/PageViewPerformanceValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js"), __webpack_require__(/*! ./TelemetryValidation/PageViewValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js"), __webpack_require__(/*! ./TelemetryValidation/RemoteDepdencyValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js"), __webpack_require__(/*! ./Serializer */ "./node_modules/applicationinsights-channel-js/bundle/Serializer.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./Offline */ "./node_modules/applicationinsights-channel-js/bundle/Offline.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, SendBuffer_1, EnvelopeCreator_1, EventValidator_1, TraceValidator_1, ExceptionValidator_1, MetricValidator_1, PageViewPerformanceValidator_1, PageViewValidator_1, RemoteDepdencyValidator_1, Serializer_1, applicationinsights_common_1, applicationinsights_core_js_1, applicationinsights_core_js_2, Offline_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Sender = /** @class */ (function () { function Sender() { this.priority = 201; /** * Whether XMLHttpRequest object is supported. Older version of IE (8,9) do not support it. */ this._XMLHttpRequestSupported = false; } Sender.prototype.pause = function () { throw new Error("Method not implemented."); }; Sender.prototype.resume = function () { throw new Error("Method not implemented."); }; Sender.prototype.flush = function () { try { this.triggerSend(); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FlushFailed, "flush failed, telemetry will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; Sender.prototype.teardown = function () { throw new Error("Method not implemented."); }; Sender.prototype.initialize = function (config, core, extensions) { this.identifier = "AppInsightsChannelPlugin"; this._logger = core.logger; this._serializer = new Serializer_1.Serializer(core.logger); this._consecutiveErrors = 0; this._retryAt = null; this._lastSend = 0; this._config = Sender._getDefaultAppInsightsChannelConfig(config, this.identifier); this._sender = null; this._buffer = (applicationinsights_common_1.Util.canUseSessionStorage() && this._config.enableSessionStorageBuffer) ? new SendBuffer_1.SessionStorageSendBuffer(this._logger, this._config) : new SendBuffer_1.ArraySendBuffer(this._config); if (!this._config.isBeaconApiDisabled() && applicationinsights_common_1.Util.IsBeaconApiSupported()) { this._sender = this._beaconSender; } else { if (typeof XMLHttpRequest != "undefined") { var testXhr = new XMLHttpRequest(); if ("withCredentials" in testXhr) { this._sender = this._xhrSender; this._XMLHttpRequestSupported = true; } else if (typeof XDomainRequest !== "undefined") { this._sender = this._xdrSender; //IE 8 and 9 } } } }; Sender.prototype.processTelemetry = function (telemetryItem) { try { // if master off switch is set, don't send any data if (this._config.disableTelemetry()) { // Do not send/save data return; } // validate input if (!telemetryItem) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSendEmptyTelemetry, "Cannot send empty telemetry"); return; } // ensure a sender was constructed if (!this._sender) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.SenderNotInitialized, "Sender was not initialized"); return; } // first we need to validate that the envelope passed down is valid var isValid = Sender._validate(telemetryItem); if (!isValid) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "Invalid telemetry envelope"); return; } // construct an envelope that Application Insights endpoint can understand var aiEnvelope = this._constructEnvelope(telemetryItem); if (!aiEnvelope) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CreateEnvelopeError, "Unable to create an AppInsights envelope"); return; } // check if the incoming payload is too large, truncate if necessary var payload = this._serializer.serialize(aiEnvelope); // flush if we would exceed the max-size limit by adding this item var bufferPayload = this._buffer.getItems(); var batch = this._buffer.batchPayloads(bufferPayload); if (batch && (batch.length + payload.length > this._config.maxBatchSizeInBytes())) { this.triggerSend(); } // enqueue the payload this._buffer.enqueue(payload); // ensure an invocation timeout is set this._setupTimer(); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedAddingTelemetryToBuffer, "Failed adding telemetry to the sender's buffer, some telemetry will be lost: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } // hand off the telemetry item to the next plugin if (!applicationinsights_core_js_2.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(telemetryItem); } }; Sender.prototype.setNextPlugin = function (next) { this._nextPlugin = next; }; /** * xhr state changes */ Sender.prototype._xhrReadyStateChange = function (xhr, payload, countOfItemsInPayload) { if (xhr.readyState === 4) { var response = null; if (!this._appId) { response = this._parseResponse(xhr.responseText || xhr.response); if (response && response.appId) { this._appId = response.appId; } } if ((xhr.status < 200 || xhr.status >= 300) && xhr.status !== 0) { if (!this._config.isRetryDisabled() && this._isRetriable(xhr.status)) { this._resendPayload(payload); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Response code " + xhr.status + ". Will retry to send " + payload.length + " items."); } else { this._onError(payload, this._formatErrorMessageXhr(xhr)); } } else if (xhr.status === 0 || Offline_1.Offline.isOffline()) { if (!this._config.isRetryDisabled()) { var offlineBackOffMultiplier = 10; // arbritrary number this._resendPayload(payload, offlineBackOffMultiplier); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". Offline - Response Code: " + xhr.status + ". Offline status: " + Offline_1.Offline.isOffline() + ". Will retry to send " + payload.length + " items."); } } else { if (xhr.status === 206) { if (!response) { response = this._parseResponse(xhr.responseText || xhr.response); } if (response && !this._config.isRetryDisabled()) { this._onPartialSuccess(payload, response); } else { this._onError(payload, this._formatErrorMessageXhr(xhr)); } } else { this._consecutiveErrors = 0; this._onSuccess(payload, countOfItemsInPayload); } } } }; /** * Immediately send buffered data * @param async {boolean} - Indicates if the events should be sent asynchronously */ Sender.prototype.triggerSend = function (async) { if (async === void 0) { async = true; } try { // Send data only if disableTelemetry is false if (!this._config.disableTelemetry()) { if (this._buffer.count() > 0) { var payload = this._buffer.getItems(); // invoke send this._sender(payload, async); } // update lastSend time to enable throttling this._lastSend = +new Date; } else { this._buffer.clear(); } clearTimeout(this._timeoutHandle); this._timeoutHandle = null; this._retryAt = null; } catch (e) { /* Ignore this error for IE under v10 */ if (!applicationinsights_common_1.Util.getIEVersion() || applicationinsights_common_1.Util.getIEVersion() > 9) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, "Telemetry transmission failed, some telemetry will be lost: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } } }; /** * error handler */ Sender.prototype._onError = function (payload, message, event) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.OnError, "Failed to send telemetry.", { message: message }); this._buffer.clearSent(payload); }; /** * partial success handler */ Sender.prototype._onPartialSuccess = function (payload, results) { var failed = []; var retry = []; // Iterate through the reversed array of errors so that splicing doesn't have invalid indexes after the first item. var errors = results.errors.reverse(); for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) { var error = errors_1[_i]; var extracted = payload.splice(error.index, 1)[0]; if (this._isRetriable(error.statusCode)) { retry.push(extracted); } else { // All other errors, including: 402 (Monthly quota exceeded) and 439 (Too many requests and refresh cache). failed.push(extracted); } } if (payload.length > 0) { this._onSuccess(payload, results.itemsAccepted); } if (failed.length > 0) { this._onError(failed, this._formatErrorMessageXhr(null, ['partial success', results.itemsAccepted, 'of', results.itemsReceived].join(' '))); } if (retry.length > 0) { this._resendPayload(retry); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, "Partial success. " + "Delivered: " + payload.length + ", Failed: " + failed.length + ". Will retry to send " + retry.length + " our of " + results.itemsReceived + " items"); } }; /** * success handler */ Sender.prototype._onSuccess = function (payload, countOfItemsInPayload) { this._buffer.clearSent(payload); }; /** * xdr state changes */ Sender.prototype._xdrOnLoad = function (xdr, payload) { if (xdr && (xdr.responseText + "" === "200" || xdr.responseText === "")) { this._consecutiveErrors = 0; this._onSuccess(payload, 0); } else { var results = this._parseResponse(xdr.responseText); if (results && results.itemsReceived && results.itemsReceived > results.itemsAccepted && !this._config.isRetryDisabled()) { this._onPartialSuccess(payload, results); } else { this._onError(payload, this._formatErrorMessageXdr(xdr)); } } }; Sender.prototype._constructEnvelope = function (envelope) { switch (envelope.baseType) { case applicationinsights_common_1.Event.dataType: return EnvelopeCreator_1.EventEnvelopeCreator.EventEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Trace.dataType: return EnvelopeCreator_1.TraceEnvelopeCreator.TraceEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.PageView.dataType: return EnvelopeCreator_1.PageViewEnvelopeCreator.PageViewEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.PageViewPerformance.dataType: return EnvelopeCreator_1.PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Exception.dataType: return EnvelopeCreator_1.ExceptionEnvelopeCreator.ExceptionEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Metric.dataType: return EnvelopeCreator_1.MetricEnvelopeCreator.MetricEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.RemoteDependencyData.dataType: return EnvelopeCreator_1.DependencyEnvelopeCreator.DependencyEnvelopeCreator.Create(this._logger, envelope); default: // default create custom event type return EnvelopeCreator_1.EventEnvelopeCreator.EventEnvelopeCreator.Create(this._logger, envelope); } }; Sender._getDefaultAppInsightsChannelConfig = function (config, identifier) { var resultConfig = {}; var pluginConfig = config.extensionConfig && config.extensionConfig[identifier] ? config.extensionConfig[identifier] : {}; // set default values resultConfig.endpointUrl = function () { return config.endpointUrl || "https://dc.services.visualstudio.com/v2/track"; }; resultConfig.emitLineDelimitedJson = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.emitLineDelimitedJson); }; resultConfig.maxBatchInterval = function () { return !isNaN(pluginConfig.maxBatchInterval) ? pluginConfig.maxBatchInterval : 15000; }; resultConfig.maxBatchSizeInBytes = function () { return pluginConfig.maxBatchSizeInBytes > 0 ? pluginConfig.maxBatchSizeInBytes : 102400; }; // 100kb resultConfig.disableTelemetry = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.disableTelemetry); }; resultConfig.enableSessionStorageBuffer = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.enableSessionStorageBuffer, true); }; resultConfig.isRetryDisabled = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.isRetryDisabled); }; resultConfig.isBeaconApiDisabled = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.isBeaconApiDisabled, true); }; return resultConfig; }; Sender._validate = function (envelope) { // call the appropriate Validate depending on the baseType switch (envelope.baseType) { case applicationinsights_common_1.Event.dataType: return EventValidator_1.EventValidator.EventValidator.Validate(envelope); case applicationinsights_common_1.Trace.dataType: return TraceValidator_1.TraceValidator.TraceValidator.Validate(envelope); case applicationinsights_common_1.Exception.dataType: return ExceptionValidator_1.ExceptionValidator.ExceptionValidator.Validate(envelope); case applicationinsights_common_1.Metric.dataType: return MetricValidator_1.MetricValidator.MetricValidator.Validate(envelope); case applicationinsights_common_1.PageView.dataType: return PageViewValidator_1.PageViewValidator.PageViewValidator.Validate(envelope); case applicationinsights_common_1.PageViewPerformance.dataType: return PageViewPerformanceValidator_1.PageViewPerformanceValidator.PageViewPerformanceValidator.Validate(envelope); case applicationinsights_common_1.RemoteDependencyData.dataType: return RemoteDepdencyValidator_1.RemoteDepdencyValidator.RemoteDepdencyValidator.Validate(envelope); default: return EventValidator_1.EventValidator.EventValidator.Validate(envelope); } }; /** * Send Beacon API request * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - not used * Note: Beacon API does not support custom headers and we are not able to get * appId from the backend for the correct correlation. */ Sender.prototype._beaconSender = function (payload, isAsync) { var url = this._config.endpointUrl(); var batch = this._buffer.batchPayloads(payload); // Chrome only allows CORS-safelisted values for the sendBeacon data argument // see: https://bugs.chromium.org/p/chromium/issues/detail?id=720283 var plainTextBatch = new Blob([batch], { type: 'text/plain;charset=UTF-8' }); // The sendBeacon method returns true if the user agent is able to successfully queue the data for transfer. Otherwise it returns false. var queued = navigator.sendBeacon(url, plainTextBatch); if (queued) { this._buffer.markAsSent(payload); } else { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Failed to send telemetry with Beacon API."); } }; /** * Send XMLHttpRequest * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - Indicates if the request should be sent asynchronously */ Sender.prototype._xhrSender = function (payload, isAsync) { var _this = this; var xhr = new XMLHttpRequest(); xhr[applicationinsights_common_1.DisabledPropertyName] = true; xhr.open("POST", this._config.endpointUrl(), isAsync); xhr.setRequestHeader("Content-type", "application/json"); // append Sdk-Context request header only in case of breeze endpoint if (applicationinsights_common_1.Util.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.sdkContextHeader, applicationinsights_common_1.RequestHeaders.sdkContextHeaderAppIdRequest); } xhr.onreadystatechange = function () { return _this._xhrReadyStateChange(xhr, payload, payload.length); }; xhr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXhr(xhr), event); }; // compose an array of payloads var batch = this._buffer.batchPayloads(payload); xhr.send(batch); this._buffer.markAsSent(payload); }; /** * Parses the response from the backend. * @param response - XMLHttpRequest or XDomainRequest response */ Sender.prototype._parseResponse = function (response) { try { if (response && response !== "") { var result = JSON.parse(response); if (result && result.itemsReceived && result.itemsReceived >= result.itemsAccepted && result.itemsReceived - result.itemsAccepted == result.errors.length) { return result; } } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.InvalidBackendResponse, "Cannot parse the response. " + applicationinsights_common_1.Util.getExceptionName(e), { response: response }); } return null; }; /** * Resend payload. Adds payload back to the send buffer and setup a send timer (with exponential backoff). * @param payload */ Sender.prototype._resendPayload = function (payload, linearFactor) { if (linearFactor === void 0) { linearFactor = 1; } if (!payload || payload.length === 0) { return; } this._buffer.clearSent(payload); this._consecutiveErrors++; for (var _i = 0, payload_1 = payload; _i < payload_1.length; _i++) { var item = payload_1[_i]; this._buffer.enqueue(item); } // setup timer this._setRetryTime(linearFactor); this._setupTimer(); }; /** Calculates the time to wait before retrying in case of an error based on * http://en.wikipedia.org/wiki/Exponential_backoff */ Sender.prototype._setRetryTime = function (linearFactor) { var SlotDelayInSeconds = 10; var delayInSeconds; if (this._consecutiveErrors <= 1) { delayInSeconds = SlotDelayInSeconds; } else { var backOffSlot = (Math.pow(2, this._consecutiveErrors) - 1) / 2; // tslint:disable-next-line:insecure-random var backOffDelay = Math.floor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1; backOffDelay = linearFactor * backOffDelay; delayInSeconds = Math.max(Math.min(backOffDelay, 3600), SlotDelayInSeconds); } // TODO: Log the backoff time like the C# version does. var retryAfterTimeSpan = Date.now() + (delayInSeconds * 1000); // TODO: Log the retry at time like the C# version does. this._retryAt = retryAfterTimeSpan; }; /** * Sets up the timer which triggers actually sending the data. */ Sender.prototype._setupTimer = function () { var _this = this; if (!this._timeoutHandle) { var retryInterval = this._retryAt ? Math.max(0, this._retryAt - Date.now()) : 0; var timerValue = Math.max(this._config.maxBatchInterval(), retryInterval); this._timeoutHandle = setTimeout(function () { _this.triggerSend(); }, timerValue); } }; /** * Checks if the SDK should resend the payload after receiving this status code from the backend. * @param statusCode */ Sender.prototype._isRetriable = function (statusCode) { return statusCode == 408 // Timeout || statusCode == 429 // Too many requests. || statusCode == 500 // Internal server error. || statusCode == 503; // Service unavailable. }; Sender.prototype._formatErrorMessageXhr = function (xhr, message) { if (xhr) { return "XMLHttpRequest,Status:" + xhr.status + ",Response:" + xhr.responseText || xhr.response || ""; } return message; }; /** * Send XDomainRequest * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - Indicates if the request should be sent asynchronously * * Note: XDomainRequest does not support sync requests. This 'isAsync' parameter is added * to maintain consistency with the xhrSender's contract * Note: XDomainRequest does not support custom headers and we are not able to get * appId from the backend for the correct correlation. */ Sender.prototype._xdrSender = function (payload, isAsync) { var _this = this; var xdr = new XDomainRequest(); xdr.onload = function () { return _this._xdrOnLoad(xdr, payload); }; xdr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXdr(xdr), event); }; // XDomainRequest requires the same protocol as the hosting page. // If the protocol doesn't match, we can't send the telemetry :(. var hostingProtocol = window.location.protocol; if (this._config.endpointUrl().lastIndexOf(hostingProtocol, 0) !== 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."); this._buffer.clear(); return; } var endpointUrl = this._config.endpointUrl().replace(/^(https?:)/, ""); xdr.open('POST', endpointUrl); // compose an array of payloads var batch = this._buffer.batchPayloads(payload); xdr.send(batch); this._buffer.markAsSent(payload); }; Sender.prototype._formatErrorMessageXdr = function (xdr, message) { if (xdr) { return "XDomainRequest,Response:" + xdr.responseText || ""; } return message; }; return Sender; }()); exports.Sender = Sender; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Sender.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Serializer.js": /*!**************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Serializer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Serializer = /** @class */ (function () { function Serializer(logger) { this._logger = logger; } /** * Serializes the current object to a JSON string. */ Serializer.prototype.serialize = function (input) { var output = this._serializeObject(input, "root"); return JSON.stringify(output); }; Serializer.prototype._serializeObject = function (source, name) { var circularReferenceCheck = "__aiCircularRefCheck"; var output = {}; if (!source) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObject, "cannot serialize object because it is null or undefined", { name: name }, true); return output; } if (source[circularReferenceCheck]) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CircularReferenceDetected, "Circular reference detected while serializing object", { name: name }, true); return output; } if (!source.aiDataContract) { // special case for measurements/properties/tags if (name === "measurements") { output = this._serializeStringMap(source, "number", name); } else if (name === "properties") { output = this._serializeStringMap(source, "string", name); } else if (name === "tags") { output = this._serializeStringMap(source, "string", name); } else if (applicationinsights_common_1.Util.isArray(source)) { output = this._serializeArray(source, name); } else { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObjectNonSerializable, "Attempting to serialize an object which does not implement ISerializable", { name: name }, true); try { // verify that the object can be stringified JSON.stringify(source); output = source; } catch (e) { // if serialization fails return an empty string this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObject, (e && typeof e.toString === 'function') ? e.toString() : "Error serializing object", null, true); } } return output; } source[circularReferenceCheck] = true; for (var field in source.aiDataContract) { var contract = source.aiDataContract[field]; var isRequired = (typeof contract === "function") ? (contract() & applicationinsights_common_1.FieldType.Required) : (contract & applicationinsights_common_1.FieldType.Required); var isHidden = (typeof contract === "function") ? (contract() & applicationinsights_common_1.FieldType.Hidden) : (contract & applicationinsights_common_1.FieldType.Hidden); var isArray = contract & applicationinsights_common_1.FieldType.Array; var isPresent = source[field] !== undefined; var isObject = typeof source[field] === "object" && source[field] !== null; if (isRequired && !isPresent && !isArray) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.MissingRequiredFieldSpecification, "Missing required field specification. The field is required but not present on source", { field: field, name: name }); // If not in debug mode, continue and hope the error is permissible continue; } if (isHidden) { // Don't serialize hidden fields continue; } var value; if (isObject) { if (isArray) { // special case; resurse on each object in the source array value = this._serializeArray(source[field], field); } else { // recurse on the source object in this field value = this._serializeObject(source[field], field); } } else { // assign the source field to the output even if undefined or required value = source[field]; } // only emit this field if the value is defined if (value !== undefined) { output[field] = value; } } delete source[circularReferenceCheck]; return output; }; Serializer.prototype._serializeArray = function (sources, name) { var output = undefined; if (!!sources) { if (!applicationinsights_common_1.Util.isArray(sources)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ItemNotInArray, "This field was specified as an array in the contract but the item is not an array.\r\n", { name: name }, true); } else { output = []; for (var i = 0; i < sources.length; i++) { var source = sources[i]; var item = this._serializeObject(source, name + "[" + i + "]"); output.push(item); } } } return output; }; Serializer.prototype._serializeStringMap = function (map, expectedType, name) { var output = undefined; if (map) { output = {}; for (var field in map) { var value = map[field]; if (expectedType === "string") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else if (!value.toString) { output[field] = "invalid field: toString() is not defined."; } else { output[field] = value.toString(); } } else if (expectedType === "number") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else { var num = parseFloat(value); if (isNaN(num)) { output[field] = "NaN"; } else { output[field] = num; } } } else { output[field] = "invalid field: " + name + " is of unknown type."; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, output[field], null, true); } } } return output; }; return Serializer; }()); exports.Serializer = Serializer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Serializer.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var EventValidator = /** @class */ (function () { function EventValidator() { } EventValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["name"]) { return false; } */ return true; }; EventValidator.EventValidator = new EventValidator(); return EventValidator; }()); exports.EventValidator = EventValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var ExceptionValidator = /** @class */ (function () { function ExceptionValidator() { } ExceptionValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["exceptions"] || !ExceptionValidator._validateExceptions(item.domainProperties["exceptions"])) { return false; } */ return true; }; // TODO implement validation of exceptions ExceptionValidator._validateExceptions = function (exceptions) { // typeName // message // parsedStack // stack // hasFullStack return true; }; ExceptionValidator.ExceptionValidator = new ExceptionValidator(); return ExceptionValidator; }()); exports.ExceptionValidator = ExceptionValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var MetricValidator = /** @class */ (function () { function MetricValidator() { } MetricValidator.prototype.Validate = function (event) { return true; }; MetricValidator.MetricValidator = new MetricValidator(); return MetricValidator; }()); exports.MetricValidator = MetricValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MetricValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js": /*!****************************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js ***! \****************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewPerformanceValidator = /** @class */ (function () { function PageViewPerformanceValidator() { } PageViewPerformanceValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["domProcessing"] || !item.domainProperties["duration"] || !item.domainProperties["name"] || !item.domainProperties["networkConnect"] || !item.domainProperties["perfTotal"] || !item.domainProperties["receivedResponse"] || !item.domainProperties["sentRequest"] || !item.domainProperties["url"]) { return false; } */ return true; }; PageViewPerformanceValidator.PageViewPerformanceValidator = new PageViewPerformanceValidator(); return PageViewPerformanceValidator; }()); exports.PageViewPerformanceValidator = PageViewPerformanceValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerformanceValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewValidator = /** @class */ (function () { function PageViewValidator() { } PageViewValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["id"] || !item.domainProperties["name"] || !item.domainProperties["duration"] || !item.domainProperties["url"]) { return false; } */ return true; }; PageViewValidator.PageViewValidator = new PageViewValidator(); return PageViewValidator; }()); exports.PageViewValidator = PageViewValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RemoteDepdencyValidator = /** @class */ (function () { function RemoteDepdencyValidator() { } RemoteDepdencyValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["id"] || !item.domainProperties["name"] || !item.domainProperties["resultCode"] || !item.domainProperties["duration"] || !item.domainProperties["success"] || !item.domainProperties["data"] || !item.domainProperties["target"] || !item.domainProperties["type"]) { return false; } */ return true; }; RemoteDepdencyValidator.RemoteDepdencyValidator = new RemoteDepdencyValidator(); return RemoteDepdencyValidator; }()); exports.RemoteDepdencyValidator = RemoteDepdencyValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDepdencyValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TraceValidator = /** @class */ (function () { function TraceValidator() { } TraceValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["message"] || !item.domainProperties["severityLevel"]) { return false; } */ return true; }; TraceValidator.TraceValidator = new TraceValidator(); return TraceValidator; }()); exports.TraceValidator = TraceValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=TraceValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js": /*!**********************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js ***! \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Sender */ "./node_modules/applicationinsights-channel-js/bundle/Sender.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Sender_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Sender = Sender_1.Sender; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-channel-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Constants.js": /*!*********************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Constants.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Constants.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Enums.js": /*!*****************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Enums.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Type of storage to differentiate between local storage and session storage */ var StorageType; (function (StorageType) { StorageType[StorageType["LocalStorage"] = 0] = "LocalStorage"; StorageType[StorageType["SessionStorage"] = 1] = "SessionStorage"; })(StorageType = exports.StorageType || (exports.StorageType = {})); /** * Enum is used in aiDataContract to describe how fields are serialized. * For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array */ var FieldType; (function (FieldType) { FieldType[FieldType["Default"] = 0] = "Default"; FieldType[FieldType["Required"] = 1] = "Required"; FieldType[FieldType["Array"] = 2] = "Array"; FieldType[FieldType["Hidden"] = 4] = "Hidden"; })(FieldType = exports.FieldType || (exports.FieldType = {})); ; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Enums.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js": /*!***********************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Data struct to contain only C section with custom fields. */ var Base = /** @class */ (function () { function Base() { } return Base; }()); exports.Base = Base; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Base.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js ***! \*********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED var ContextTagKeys = /** @class */ (function () { function ContextTagKeys() { this.applicationVersion = "ai.application.ver"; this.applicationBuild = "ai.application.build"; this.applicationTypeId = "ai.application.typeId"; this.applicationId = "ai.application.applicationId"; this.applicationLayer = "ai.application.layer"; this.deviceId = "ai.device.id"; this.deviceIp = "ai.device.ip"; this.deviceLanguage = "ai.device.language"; this.deviceLocale = "ai.device.locale"; this.deviceModel = "ai.device.model"; this.deviceFriendlyName = "ai.device.friendlyName"; this.deviceNetwork = "ai.device.network"; this.deviceNetworkName = "ai.device.networkName"; this.deviceOEMName = "ai.device.oemName"; this.deviceOS = "ai.device.os"; this.deviceOSVersion = "ai.device.osVersion"; this.deviceRoleInstance = "ai.device.roleInstance"; this.deviceRoleName = "ai.device.roleName"; this.deviceScreenResolution = "ai.device.screenResolution"; this.deviceType = "ai.device.type"; this.deviceMachineName = "ai.device.machineName"; this.deviceVMName = "ai.device.vmName"; this.deviceBrowser = "ai.device.browser"; this.deviceBrowserVersion = "ai.device.browserVersion"; this.locationIp = "ai.location.ip"; this.locationCountry = "ai.location.country"; this.locationProvince = "ai.location.province"; this.locationCity = "ai.location.city"; this.operationId = "ai.operation.id"; this.operationName = "ai.operation.name"; this.operationParentId = "ai.operation.parentId"; this.operationRootId = "ai.operation.rootId"; this.operationSyntheticSource = "ai.operation.syntheticSource"; this.operationCorrelationVector = "ai.operation.correlationVector"; this.sessionId = "ai.session.id"; this.sessionIsFirst = "ai.session.isFirst"; this.sessionIsNew = "ai.session.isNew"; this.userAccountAcquisitionDate = "ai.user.accountAcquisitionDate"; this.userAccountId = "ai.user.accountId"; this.userAgent = "ai.user.userAgent"; this.userId = "ai.user.id"; this.userStoreRegion = "ai.user.storeRegion"; this.userAuthUserId = "ai.user.authUserId"; this.userAnonymousUserAcquisitionDate = "ai.user.anonUserAcquisitionDate"; this.userAuthenticatedUserAcquisitionDate = "ai.user.authUserAcquisitionDate"; this.cloudName = "ai.cloud.name"; this.cloudRole = "ai.cloud.role"; this.cloudRoleVer = "ai.cloud.roleVer"; this.cloudRoleInstance = "ai.cloud.roleInstance"; this.cloudEnvironment = "ai.cloud.environment"; this.cloudLocation = "ai.cloud.location"; this.cloudDeploymentUnit = "ai.cloud.deploymentUnit"; this.internalSdkVersion = "ai.internal.sdkVersion"; this.internalAgentVersion = "ai.internal.agentVersion"; this.internalNodeName = "ai.internal.nodeName"; } return ContextTagKeys; }()); exports.ContextTagKeys = ContextTagKeys; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ContextTagKeys.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js": /*!***********************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Base */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Base_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Data struct to contain both B and C sections. */ var Data = /** @class */ (function (_super) { __extends(Data, _super); function Data() { return _super.call(this) || this; } return Data; }(Base_1.Base)); exports.Data = Data; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Data.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./DataPointType */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataPointType_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Metric data single measurement. */ var DataPoint = /** @class */ (function () { function DataPoint() { this.kind = DataPointType_1.DataPointType.Measurement; } return DataPoint; }()); exports.DataPoint = DataPoint; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPoint.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED /** * Type of the metric data measurement. */ var DataPointType; (function (DataPointType) { DataPointType[DataPointType["Measurement"] = 0] = "Measurement"; DataPointType[DataPointType["Aggregation"] = 1] = "Aggregation"; })(DataPointType = exports.DataPointType || (exports.DataPointType = {})); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPointType.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js": /*!*************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js ***! \*************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * The abstract common base of all domains. */ var Domain = /** @class */ (function () { function Domain() { } return Domain; }()); exports.Domain = Domain; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Domain.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * System variables for a telemetry item. */ var Envelope = /** @class */ (function () { function Envelope() { this.ver = 1; this.sampleRate = 100.0; this.tags = {}; } return Envelope; }()); exports.Envelope = Envelope; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Envelope.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Instances of Event represent structured event records that can be grouped and searched by their properties. Event data item also creates a metric of event count by name. */ var EventData = /** @class */ (function (_super) { __extends(EventData, _super); function EventData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return EventData; }(Domain_1.Domain)); exports.EventData = EventData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of Exception represents a handled or unhandled exception that occurred during execution of the monitored application. */ var ExceptionData = /** @class */ (function (_super) { __extends(ExceptionData, _super); function ExceptionData() { var _this = _super.call(this) || this; _this.ver = 2; _this.exceptions = []; _this.properties = {}; _this.measurements = {}; return _this; } return ExceptionData; }(Domain_1.Domain)); exports.ExceptionData = ExceptionData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Exception details of the exception in a chain. */ var ExceptionDetails = /** @class */ (function () { function ExceptionDetails() { this.hasFullStack = true; this.parsedStack = []; } return ExceptionDetails; }()); exports.ExceptionDetails = ExceptionDetails; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionDetails.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Instances of Message represent printf-like trace statements that are text-searched. Log4Net, NLog and other text-based log file entries are translated into intances of this type. The message does not have measurements. */ var MessageData = /** @class */ (function (_super) { __extends(MessageData, _super); function MessageData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; return _this; } return MessageData; }(Domain_1.Domain)); exports.MessageData = MessageData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MessageData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of the Metric item is a list of measurements (single data points) and/or aggregations. */ var MetricData = /** @class */ (function (_super) { __extends(MetricData, _super); function MetricData() { var _this = _super.call(this) || this; _this.ver = 2; _this.metrics = []; _this.properties = {}; return _this; } return MetricData; }(Domain_1.Domain)); exports.MetricData = MetricData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MetricData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js ***! \*******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./EventData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView. */ var PageViewData = /** @class */ (function (_super) { __extends(PageViewData, _super); function PageViewData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return PageViewData; }(EventData_1.EventData)); exports.PageViewData = PageViewData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of PageViewPerf represents: a page view with no performance data, a page view with performance data, or just the performance data of an earlier page request. */ var PageViewPerfData = /** @class */ (function (_super) { __extends(PageViewPerfData, _super); function PageViewPerfData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return PageViewPerfData; }(PageViewData_1.PageViewData)); exports.PageViewPerfData = PageViewPerfData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerfData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js": /*!***************************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js ***! \***************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of Remote Dependency represents an interaction of the monitored component with a remote component/service like SQL or an HTTP endpoint. */ var RemoteDependencyData = /** @class */ (function (_super) { __extends(RemoteDependencyData, _super); function RemoteDependencyData() { var _this = _super.call(this) || this; _this.ver = 2; _this.success = true; _this.properties = {}; _this.measurements = {}; return _this; } return RemoteDependencyData; }(Domain_1.Domain)); exports.RemoteDependencyData = RemoteDependencyData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDependencyData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Defines the level of severity for the event. */ var SeverityLevel; (function (SeverityLevel) { SeverityLevel[SeverityLevel["Verbose"] = 0] = "Verbose"; SeverityLevel[SeverityLevel["Information"] = 1] = "Information"; SeverityLevel[SeverityLevel["Warning"] = 2] = "Warning"; SeverityLevel[SeverityLevel["Error"] = 3] = "Error"; SeverityLevel[SeverityLevel["Critical"] = 4] = "Critical"; })(SeverityLevel = exports.SeverityLevel || (exports.SeverityLevel = {})); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SeverityLevel.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED /** * Stack frame information. */ var StackFrame = /** @class */ (function () { function StackFrame() { } return StackFrame; }()); exports.StackFrame = StackFrame; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=StackFrame.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js": /*!**********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RequestHeaders = /** @class */ (function () { function RequestHeaders() { } /** * Request-Context header */ RequestHeaders.requestContextHeader = "Request-Context"; /** * Target instrumentation header that is added to the response and retrieved by the * calling application when processing incoming responses. */ RequestHeaders.requestContextTargetKey = "appId"; /** * Request-Context appId format */ RequestHeaders.requestContextAppIdFormat = "appId=cid-v1:"; /** * Request-Id header */ RequestHeaders.requestIdHeader = "Request-Id"; /** * Sdk-Context header * If this header passed with appId in content then appId will be returned back by the backend. */ RequestHeaders.sdkContextHeader = "Sdk-Context"; /** * String to pass in header for requesting appId back from the backend. */ RequestHeaders.sdkContextHeaderAppIdRequest = "appId"; RequestHeaders.requestContextHeaderLowerCase = "request-context"; return RequestHeaders; }()); exports.RequestHeaders = RequestHeaders; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RequestResponseHeaders.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/Data */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Data_1, Enums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Data = /** @class */ (function (_super) { __extends(Data, _super); /** * Constructs a new instance of telemetry data. */ function Data(baseType, data) { var _this = _super.call(this) || this; /** * The data contract for serializing this object. */ _this.aiDataContract = { baseType: Enums_1.FieldType.Required, baseData: Enums_1.FieldType.Required }; _this.baseType = baseType; _this.baseData = data; return _this; } return Data; }(Data_1.Data)); exports.Data = Data; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Data.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/DataPoint */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataPoint_1, Enums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DataPoint = /** @class */ (function (_super) { __extends(DataPoint, _super); function DataPoint() { var _this = _super !== null && _super.apply(this, arguments) || this; /** * The data contract for serializing this object. */ _this.aiDataContract = { name: Enums_1.FieldType.Required, kind: Enums_1.FieldType.Default, value: Enums_1.FieldType.Required, count: Enums_1.FieldType.Default, min: Enums_1.FieldType.Default, max: Enums_1.FieldType.Default, stdDev: Enums_1.FieldType.Default }; return _this; } return DataPoint; }(DataPoint_1.DataPoint)); exports.DataPoint = DataPoint; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPoint.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ../../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DataSanitizer = /** @class */ (function () { function DataSanitizer() { } DataSanitizer.sanitizeKeyAndAddUniqueness = function (logger, key, map) { var origLength = key.length; var field = DataSanitizer.sanitizeKey(logger, key); // validation truncated the length. We need to add uniqueness if (field.length !== origLength) { var i = 0; var uniqueField = field; while (map[uniqueField] !== undefined) { i++; uniqueField = field.substring(0, DataSanitizer.MAX_NAME_LENGTH - 3) + DataSanitizer.padNumber(i); } field = uniqueField; } return field; }; DataSanitizer.sanitizeKey = function (logger, name) { if (name) { // Remove any leading or trailing whitepace name = Util_1.Util.trim(name.toString()); // truncate the string to 150 chars if (name.length > DataSanitizer.MAX_NAME_LENGTH) { name = name.substring(0, DataSanitizer.MAX_NAME_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + DataSanitizer.MAX_NAME_LENGTH + " characters.", { name: name }, true); } } return name; }; DataSanitizer.sanitizeString = function (logger, value, maxLength) { if (maxLength === void 0) { maxLength = DataSanitizer.MAX_STRING_LENGTH; } if (value) { maxLength = maxLength ? maxLength : DataSanitizer.MAX_STRING_LENGTH; // in case default parameters dont work value = Util_1.Util.trim(value); if (value.toString().length > maxLength) { value = value.toString().substring(0, maxLength); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true); } } return value; }; DataSanitizer.sanitizeUrl = function (logger, url) { return DataSanitizer.sanitizeInput(logger, url, DataSanitizer.MAX_URL_LENGTH, applicationinsights_core_js_1._InternalMessageId.UrlTooLong); }; DataSanitizer.sanitizeMessage = function (logger, message) { if (message) { if (message.length > DataSanitizer.MAX_MESSAGE_LENGTH) { message = message.substring(0, DataSanitizer.MAX_MESSAGE_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.MessageTruncated, "message is too long, it has been truncated to " + DataSanitizer.MAX_MESSAGE_LENGTH + " characters.", { message: message }, true); } } return message; }; DataSanitizer.sanitizeException = function (logger, exception) { if (exception) { if (exception.length > DataSanitizer.MAX_EXCEPTION_LENGTH) { exception = exception.substring(0, DataSanitizer.MAX_EXCEPTION_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + DataSanitizer.MAX_EXCEPTION_LENGTH + " characters.", { exception: exception }, true); } } return exception; }; DataSanitizer.sanitizeProperties = function (logger, properties) { if (properties) { var tempProps = {}; for (var prop in properties) { var value = DataSanitizer.sanitizeString(logger, properties[prop], DataSanitizer.MAX_PROPERTY_LENGTH); prop = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, prop, tempProps); tempProps[prop] = value; } properties = tempProps; } return properties; }; DataSanitizer.sanitizeMeasurements = function (logger, measurements) { if (measurements) { var tempMeasurements = {}; for (var measure in measurements) { var value = measurements[measure]; measure = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements); tempMeasurements[measure] = value; } measurements = tempMeasurements; } return measurements; }; DataSanitizer.sanitizeId = function (logger, id) { return id ? DataSanitizer.sanitizeInput(logger, id, DataSanitizer.MAX_ID_LENGTH, applicationinsights_core_js_1._InternalMessageId.IdTooLong).toString() : id; }; DataSanitizer.sanitizeInput = function (logger, input, maxLength, _msgId) { if (input) { input = Util_1.Util.trim(input); if (input.length > maxLength) { input = input.substring(0, maxLength); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true); } } return input; }; DataSanitizer.padNumber = function (num) { var s = "00" + num; return s.substr(s.length - 3); }; /** * Max length allowed for custom names. */ DataSanitizer.MAX_NAME_LENGTH = 150; /** * Max length allowed for Id field in page views. */ DataSanitizer.MAX_ID_LENGTH = 128; /** * Max length allowed for custom values. */ DataSanitizer.MAX_PROPERTY_LENGTH = 8192; /** * Max length allowed for names */ DataSanitizer.MAX_STRING_LENGTH = 1024; /** * Max length allowed for url. */ DataSanitizer.MAX_URL_LENGTH = 2048; /** * Max length allowed for messages. */ DataSanitizer.MAX_MESSAGE_LENGTH = 32768; /** * Max length allowed for exceptions. */ DataSanitizer.MAX_EXCEPTION_LENGTH = 32768; return DataSanitizer; }()); exports.DataSanitizer = DataSanitizer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataSanitizer.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js": /*!*************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/Envelope */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js"), __webpack_require__(/*! ./DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Envelope_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Envelope = /** @class */ (function (_super) { __extends(Envelope, _super); /** * Constructs a new instance of telemetry data. */ function Envelope(logger, data, name) { var _this = _super.call(this) || this; _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.data = data; _this.time = Util_1.Util.toISOStringForIE8(new Date()); _this.aiDataContract = { time: Enums_1.FieldType.Required, iKey: Enums_1.FieldType.Required, name: Enums_1.FieldType.Required, sampleRate: function () { return (_this.sampleRate == 100) ? Enums_1.FieldType.Hidden : Enums_1.FieldType.Required; }, tags: Enums_1.FieldType.Required, data: Enums_1.FieldType.Required }; return _this; } return Envelope; }(Envelope_1.Envelope)); exports.Envelope = Envelope; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Envelope.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Event.js": /*!***************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Event.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/EventData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Event = /** @class */ (function (_super) { __extends(Event, _super); /** * Constructs a new instance of the EventTelemetry object */ function Event(logger, name, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Required, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } Event.envelopeType = "Microsoft.ApplicationInsights.{0}.Event"; Event.dataType = "EventData"; return Event; }(EventData_1.EventData)); exports.Event = Event; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Event.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/StackFrame */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/ExceptionData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/ExceptionDetails */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, StackFrame_1, ExceptionData_1, ExceptionDetails_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Exception = /** @class */ (function (_super) { __extends(Exception, _super); /** * Constructs a new isntance of the ExceptionTelemetry object */ function Exception(logger, exception, properties, measurements, severityLevel) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, exceptions: Enums_1.FieldType.Required, severityLevel: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); _this.exceptions = [new _ExceptionDetails(logger, exception)]; if (severityLevel) { _this.severityLevel = severityLevel; } return _this; } /** * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception. */ Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) { return { exceptions: [ { hasFullStack: true, message: message, stack: details, typeName: typeName } ] }; }; Exception.envelopeType = "Microsoft.ApplicationInsights.{0}.Exception"; Exception.dataType = "ExceptionData"; return Exception; }(ExceptionData_1.ExceptionData)); exports.Exception = Exception; var _ExceptionDetails = /** @class */ (function (_super) { __extends(_ExceptionDetails, _super); function _ExceptionDetails(logger, exception) { var _this = _super.call(this) || this; _this.aiDataContract = { id: Enums_1.FieldType.Default, outerId: Enums_1.FieldType.Default, typeName: Enums_1.FieldType.Required, message: Enums_1.FieldType.Required, hasFullStack: Enums_1.FieldType.Default, stack: Enums_1.FieldType.Default, parsedStack: Enums_1.FieldType.Array }; _this.typeName = DataSanitizer_1.DataSanitizer.sanitizeString(logger, exception.name) || Util_1.Util.NotSpecified; _this.message = DataSanitizer_1.DataSanitizer.sanitizeMessage(logger, exception.message) || Util_1.Util.NotSpecified; var stack = exception["stack"]; _this.parsedStack = _this.parseStack(stack); _this.stack = DataSanitizer_1.DataSanitizer.sanitizeException(logger, stack); _this.hasFullStack = Util_1.Util.isArray(_this.parsedStack) && _this.parsedStack.length > 0; return _this; } _ExceptionDetails.prototype.parseStack = function (stack) { var parsedStack = undefined; if (typeof stack === "string") { var frames = stack.split('\n'); parsedStack = []; var level = 0; var totalSizeInBytes = 0; for (var i = 0; i <= frames.length; i++) { var frame = frames[i]; if (_StackFrame.regex.test(frame)) { var parsedFrame = new _StackFrame(frames[i], level++); totalSizeInBytes += parsedFrame.sizeInBytes; parsedStack.push(parsedFrame); } } // DP Constraint - exception parsed stack must be < 32KB // remove frames from the middle to meet the threshold var exceptionParsedStackThreshold = 32 * 1024; if (totalSizeInBytes > exceptionParsedStackThreshold) { var left = 0; var right = parsedStack.length - 1; var size = 0; var acceptedLeft = left; var acceptedRight = right; while (left < right) { // check size var lSize = parsedStack[left].sizeInBytes; var rSize = parsedStack[right].sizeInBytes; size += lSize + rSize; if (size > exceptionParsedStackThreshold) { // remove extra frames from the middle var howMany = acceptedRight - acceptedLeft + 1; parsedStack.splice(acceptedLeft, howMany); break; } // update pointers acceptedLeft = left; acceptedRight = right; left++; right--; } } } return parsedStack; }; return _ExceptionDetails; }(ExceptionDetails_1.ExceptionDetails)); var _StackFrame = /** @class */ (function (_super) { __extends(_StackFrame, _super); function _StackFrame(frame, level) { var _this = _super.call(this) || this; _this.sizeInBytes = 0; _this.aiDataContract = { level: Enums_1.FieldType.Required, method: Enums_1.FieldType.Required, assembly: Enums_1.FieldType.Default, fileName: Enums_1.FieldType.Default, line: Enums_1.FieldType.Default }; _this.level = level; _this.method = ""; _this.assembly = Util_1.Util.trim(frame); var matches = frame.match(_StackFrame.regex); if (matches && matches.length >= 5) { _this.method = Util_1.Util.trim(matches[2]) || _this.method; _this.fileName = Util_1.Util.trim(matches[4]); _this.line = parseInt(matches[5]) || 0; } _this.sizeInBytes += _this.method.length; _this.sizeInBytes += _this.fileName.length; _this.sizeInBytes += _this.assembly.length; // todo: these might need to be removed depending on how the back-end settles on their size calculation _this.sizeInBytes += _StackFrame.baseSize; _this.sizeInBytes += _this.level.toString().length; _this.sizeInBytes += _this.line.toString().length; return _this; } // regex to match stack frames from ie/chrome/ff // methodName=$2, fileName=$4, lineNo=$5, column=$6 _StackFrame.regex = /^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/; _StackFrame.baseSize = 58; //'{"method":"","level":,"assembly":"","fileName":"","line":}'.length return _StackFrame; }(StackFrame_1.StackFrame)); exports._StackFrame = _StackFrame; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Exception.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js": /*!****************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/MetricData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./Common/DataPoint */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, MetricData_1, DataSanitizer_1, Enums_1, DataPoint_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Metric = /** @class */ (function (_super) { __extends(Metric, _super); /** * Constructs a new instance of the MetricTelemetry object */ function Metric(logger, name, value, count, min, max, properties) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, metrics: Enums_1.FieldType.Required, properties: Enums_1.FieldType.Default }; var dataPoint = new DataPoint_1.DataPoint(); dataPoint.count = count > 0 ? count : undefined; dataPoint.max = isNaN(max) || max === null ? undefined : max; dataPoint.min = isNaN(min) || min === null ? undefined : min; dataPoint.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; dataPoint.value = value; _this.metrics = [dataPoint]; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); return _this; } Metric.envelopeType = "Microsoft.ApplicationInsights.{0}.Metric"; Metric.dataType = "MetricData"; return Metric; }(MetricData_1.MetricData)); exports.Metric = Metric; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Metric.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js": /*!******************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageView = /** @class */ (function (_super) { __extends(PageView, _super); /** * Constructs a new instance of the PageEventTelemetry object */ function PageView(logger, name, url, durationMs, properties, measurements, id) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, url: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default, id: Enums_1.FieldType.Default, }; _this.id = DataSanitizer_1.DataSanitizer.sanitizeId(logger, id); _this.url = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, url); _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; if (!isNaN(durationMs)) { _this.duration = Util_1.Util.msToTimeSpan(durationMs); } _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } PageView.envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview"; PageView.dataType = "PageviewData"; return PageView; }(PageViewData_1.PageViewData)); exports.PageView = PageView; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageView.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/PageViewPerfData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewPerfData_1, Enums_1, DataSanitizer_1, Util_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewPerformance = /** @class */ (function (_super) { __extends(PageViewPerformance, _super); /** * Constructs a new instance of the PageEventTelemetry object */ function PageViewPerformance(logger, name, url, unused, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, url: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, perfTotal: Enums_1.FieldType.Default, networkConnect: Enums_1.FieldType.Default, sentRequest: Enums_1.FieldType.Default, receivedResponse: Enums_1.FieldType.Default, domProcessing: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.isValid = false; /* * http://www.w3.org/TR/navigation-timing/#processing-model * |-navigationStart * | |-connectEnd * | ||-requestStart * | || |-responseStart * | || | |-responseEnd * | || | | * | || | | |-loadEventEnd * |---network---||---request---|---response---|---dom---| * |--------------------------total----------------------| */ var timing = PageViewPerformance.getPerformanceTiming(); if (timing) { var total = PageViewPerformance.getDuration(timing.navigationStart, timing.loadEventEnd); var network = PageViewPerformance.getDuration(timing.navigationStart, timing.connectEnd); var request = PageViewPerformance.getDuration(timing.requestStart, timing.responseStart); var response = PageViewPerformance.getDuration(timing.responseStart, timing.responseEnd); var dom = PageViewPerformance.getDuration(timing.responseEnd, timing.loadEventEnd); if (total == 0) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ErrorPVCalc, "error calculating page view performance.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (!PageViewPerformance.shouldCollectDuration(total, network, request, response, dom)) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.InvalidDurationValue, "Invalid page load duration value. Browser perf data won't be sent.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (total < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(dom)) { // some browsers may report individual components incorrectly so that the sum of the parts will be bigger than total PLT // in this case, don't report client performance from this page logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ClientPerformanceMathError, "client performance math error.", { total: total, network: network, request: request, response: response, dom: dom }); } else { _this.durationMs = total; // convert to timespans _this.perfTotal = _this.duration = Util_1.Util.msToTimeSpan(total); _this.networkConnect = Util_1.Util.msToTimeSpan(network); _this.sentRequest = Util_1.Util.msToTimeSpan(request); _this.receivedResponse = Util_1.Util.msToTimeSpan(response); _this.domProcessing = Util_1.Util.msToTimeSpan(dom); _this.isValid = true; } } _this.url = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, url); _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } /** * Indicates whether this instance of PageViewPerformance is valid and should be sent */ PageViewPerformance.prototype.getIsValid = function () { return this.isValid; }; /** * Gets the total duration (PLT) in milliseconds. Check getIsValid() before using this method. */ PageViewPerformance.prototype.getDurationMs = function () { return this.durationMs; }; PageViewPerformance.getPerformanceTiming = function () { if (PageViewPerformance.isPerformanceTimingSupported()) { return window.performance.timing; } return null; }; /** * Returns true is window performance timing API is supported, false otherwise. */ PageViewPerformance.isPerformanceTimingSupported = function () { return typeof window != "undefined" && window.performance && window.performance.timing; }; /** * As page loads different parts of performance timing numbers get set. When all of them are set we can report it. * Returns true if ready, false otherwise. */ PageViewPerformance.isPerformanceTimingDataReady = function () { var timing = window.performance.timing; return timing.domainLookupStart > 0 && timing.navigationStart > 0 && timing.responseStart > 0 && timing.requestStart > 0 && timing.loadEventEnd > 0 && timing.responseEnd > 0 && timing.connectEnd > 0 && timing.domLoading > 0; }; PageViewPerformance.getDuration = function (start, end) { var duration = undefined; if (!(isNaN(start) || isNaN(end))) { duration = Math.max(end - start, 0); } return duration; }; /** * This method tells if given durations should be excluded from collection. */ PageViewPerformance.shouldCollectDuration = function () { var durations = []; for (var _i = 0; _i < arguments.length; _i++) { durations[_i] = arguments[_i]; } // a full list of Google crawlers user agent strings - https://support.google.com/webmasters/answer/1061943?hl=en var botAgentNames = ['googlebot', 'adsbot-google', 'apis-google', 'mediapartners-google']; var userAgent = navigator.userAgent; var isGoogleBot = false; if (userAgent) { for (var i_1 = 0; i_1 < botAgentNames.length; i_1++) { isGoogleBot = isGoogleBot || userAgent.toLowerCase().indexOf(botAgentNames[i_1]) !== -1; } } if (isGoogleBot) { // Don't report durations for GoogleBot, it is returning invalid values in performance.timing API. return false; } else { // for other page views, don't report if it's outside of a reasonable range for (var i = 0; i < durations.length; i++) { if (durations[i] >= PageViewPerformance.MAX_DURATION_ALLOWED) { return false; } } } return true; }; PageViewPerformance.envelopeType = "Microsoft.ApplicationInsights.{0}.PageviewPerformance"; PageViewPerformance.dataType = "PageviewPerformanceData"; PageViewPerformance.MAX_DURATION_ALLOWED = 3600000; // 1h return PageViewPerformance; }(PageViewPerfData_1.PageViewPerfData)); exports.PageViewPerformance = PageViewPerformance; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerformance.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/RemoteDependencyData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataSanitizer_1, Enums_1, Util_1, Util_2, RemoteDependencyData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RemoteDependencyData = /** @class */ (function (_super) { __extends(RemoteDependencyData, _super); /** * Constructs a new instance of the RemoteDependencyData object */ function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { id: Enums_1.FieldType.Required, ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, resultCode: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, success: Enums_1.FieldType.Default, data: Enums_1.FieldType.Default, target: Enums_1.FieldType.Default, type: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default, kind: Enums_1.FieldType.Default, value: Enums_1.FieldType.Default, count: Enums_1.FieldType.Default, min: Enums_1.FieldType.Default, max: Enums_1.FieldType.Default, stdDev: Enums_1.FieldType.Default, dependencyKind: Enums_1.FieldType.Default, dependencySource: Enums_1.FieldType.Default, commandName: Enums_1.FieldType.Default, dependencyTypeName: Enums_1.FieldType.Default, }; _this.id = id; _this.duration = Util_1.Util.msToTimeSpan(value); _this.success = success; _this.resultCode = resultCode + ""; _this.type = "Ajax"; _this.data = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, commandName); var dependencyFields = Util_2.AjaxHelper.ParseDependencyPath(logger, absoluteUrl, method, commandName); _this.target = dependencyFields.target; _this.name = dependencyFields.name; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } RemoteDependencyData.envelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency"; RemoteDependencyData.dataType = "RemoteDependencyData"; return RemoteDependencyData; }(RemoteDependencyData_1.RemoteDependencyData)); exports.RemoteDependencyData = RemoteDependencyData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDependencyData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js": /*!***************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/MessageData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, MessageData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Trace = /** @class */ (function (_super) { __extends(Trace, _super); /** * Constructs a new instance of the TraceTelemetry object */ function Trace(logger, message, properties, severityLevel) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, message: Enums_1.FieldType.Required, severityLevel: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default }; message = message || Util_1.Util.NotSpecified; _this.message = DataSanitizer_1.DataSanitizer.sanitizeMessage(logger, message); _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); if (severityLevel) { _this.severityLevel = severityLevel; } return _this; } Trace.envelopeType = "Microsoft.ApplicationInsights.{0}.Message"; Trace.dataType = "MessageData"; return Trace; }(MessageData_1.MessageData)); exports.Trace = Trace; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Trace.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js": /*!********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Util_1, DataSanitizer_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TelemetryItemCreator = /** @class */ (function () { function TelemetryItemCreator() { } /** * Create a telemetry item that the 1DS channel understands * @param item domain specific properties; part B * @param baseType telemetry item type. ie PageViewData * @param envelopeName name of the envelope. ie Microsoft.ApplicationInsights..PageView * @param customProperties user defined custom properties; part C * @param systemProperties system properties that are added to the context; part A * @returns ITelemetryItem that is sent to channel */ TelemetryItemCreator.create = function (item, baseType, envelopeName, logger, customProperties, systemProperties) { envelopeName = DataSanitizer_1.DataSanitizer.sanitizeString(logger, envelopeName) || Util_1.Util.NotSpecified; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(item) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(baseType) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(envelopeName)) { throw Error("Input doesn't contain all required fields"); } var telemetryItem = { name: envelopeName, timestamp: new Date(), instrumentationKey: "", ctx: systemProperties ? systemProperties : {}, tags: [], data: {}, baseType: baseType, baseData: item }; // Part C if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties)) { for (var prop in customProperties) { if (customProperties.hasOwnProperty(prop)) { telemetryItem.data[prop] = customProperties[prop]; } } } return telemetryItem; }; return TelemetryItemCreator; }()); exports.TelemetryItemCreator = TelemetryItemCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=TelemetryItemCreator.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Util.js": /*!****************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Util.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./RequestResponseHeaders */ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Enums_1, applicationinsights_core_js_1, RequestResponseHeaders_1, DataSanitizer_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Util = /** @class */ (function () { function Util() { } /* * Force the SDK not to use local and session storage */ Util.disableStorage = function () { Util._canUseLocalStorage = false; Util._canUseSessionStorage = false; }; /** * Gets the localStorage object if available * @return {Storage} - Returns the storage object if available else returns null */ Util._getLocalStorageObject = function () { if (Util.canUseLocalStorage()) { return Util._getVerifiedStorageObject(Enums_1.StorageType.LocalStorage); } return null; }; /** * Tests storage object (localStorage or sessionStorage) to verify that it is usable * More details here: https://mathiasbynens.be/notes/localstorage-pattern * @param storageType Type of storage * @return {Storage} Returns storage object verified that it is usable */ Util._getVerifiedStorageObject = function (storageType) { var storage = null; var fail; var uid; try { uid = new Date; storage = storageType === Enums_1.StorageType.LocalStorage ? window.localStorage : window.sessionStorage; storage.setItem(uid, uid); fail = storage.getItem(uid) != uid; storage.removeItem(uid); if (fail) { storage = null; } } catch (exception) { storage = null; } return storage; }; /** * Checks if endpoint URL is application insights internal injestion service URL. * * @param endpointUrl Endpoint URL to check. * @returns {boolean} True if if endpoint URL is application insights internal injestion service URL. */ Util.isInternalApplicationInsightsEndpoint = function (endpointUrl) { return Util._internalEndpoints.indexOf(endpointUrl.toLowerCase()) !== -1; }; /** * Check if the browser supports local storage. * * @returns {boolean} True if local storage is supported. */ Util.canUseLocalStorage = function () { if (Util._canUseLocalStorage === undefined) { Util._canUseLocalStorage = !!Util._getVerifiedStorageObject(Enums_1.StorageType.LocalStorage); } return Util._canUseLocalStorage; }; /** * Get an object from the browser's local storage * * @param {string} name - the name of the object to get from storage * @returns {string} The contents of the storage object with the given name. Null if storage is not supported. */ Util.getStorage = function (logger, name) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return null; }; /** * Set the contents of an object in the browser's local storage * * @param {string} name - the name of the object to set in storage * @param {string} data - the contents of the object to set in storage * @returns {boolean} True if the storage object could be written. */ Util.setStorage = function (logger, name, data) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Remove an object from the browser's local storage * * @param {string} name - the name of the object to remove from storage * @returns {boolean} True if the storage object could be removed. */ Util.removeStorage = function (logger, name) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { storage.removeItem(name); return true; } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Gets the sessionStorage object if available * @return {Storage} - Returns the storage object if available else returns null */ Util._getSessionStorageObject = function () { if (Util.canUseSessionStorage()) { return Util._getVerifiedStorageObject(Enums_1.StorageType.SessionStorage); } return null; }; /** * Check if the browser supports session storage. * * @returns {boolean} True if session storage is supported. */ Util.canUseSessionStorage = function () { if (Util._canUseSessionStorage === undefined) { Util._canUseSessionStorage = !!Util._getVerifiedStorageObject(Enums_1.StorageType.SessionStorage); } return Util._canUseSessionStorage; }; /** * Gets the list of session storage keys * * @returns {string[]} List of session storage keys */ Util.getSessionStorageKeys = function () { var keys = []; if (Util.canUseSessionStorage()) { for (var key in window.sessionStorage) { keys.push(key); } } return keys; }; /** * Get an object from the browser's session storage * * @param {string} name - the name of the object to get from storage * @returns {string} The contents of the storage object with the given name. Null if storage is not supported. */ Util.getSessionStorage = function (logger, name) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return null; }; /** * Set the contents of an object in the browser's session storage * * @param {string} name - the name of the object to set in storage * @param {string} data - the contents of the object to set in storage * @returns {boolean} True if the storage object could be written. */ Util.setSessionStorage = function (logger, name, data) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Remove an object from the browser's session storage * * @param {string} name - the name of the object to remove from storage * @returns {boolean} True if the storage object could be removed. */ Util.removeSessionStorage = function (logger, name) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { storage.removeItem(name); return true; } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /* * Force the SDK not to store and read any data from cookies */ Util.disableCookies = function () { Util._canUseCookies = false; }; /* * helper method to tell if document.cookie object is available */ Util.canUseCookies = function (logger) { if (Util._canUseCookies === undefined) { Util._canUseCookies = false; try { Util._canUseCookies = Util.document.cookie !== undefined; } catch (e) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CannotAccessCookie, "Cannot access document.cookie - " + Util.getExceptionName(e), { exception: Util.dump(e) }); } ; } return Util._canUseCookies; }; /** * helper method to set userId and sessionId cookie */ Util.setCookie = function (logger, name, value, domain) { var domainAttrib = ""; var secureAttrib = ""; if (domain) { domainAttrib = ";domain=" + domain; } if (Util.document.location && Util.document.location.protocol === "https:") { secureAttrib = ";secure"; } if (Util.canUseCookies(logger)) { Util.document.cookie = name + "=" + value + domainAttrib + ";path=/" + secureAttrib; } }; Util.stringToBoolOrDefault = function (str, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } if (str === undefined || str === null) { return defaultValue; } return str.toString().toLowerCase() === "true"; }; /** * helper method to access userId and sessionId cookie */ Util.getCookie = function (logger, name) { if (!Util.canUseCookies(logger)) { return; } var value = ""; if (name && name.length) { var cookieName = name + "="; var cookies = Util.document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; cookie = Util.trim(cookie); if (cookie && cookie.indexOf(cookieName) === 0) { value = cookie.substring(cookieName.length, cookies[i].length); break; } } } return value; }; /** * Deletes a cookie by setting it's expiration time in the past. * @param name - The name of the cookie to delete. */ Util.deleteCookie = function (logger, name) { if (Util.canUseCookies(logger)) { // Setting the expiration date in the past immediately removes the cookie Util.document.cookie = name + "=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;"; } }; /** * helper method to trim strings (IE8 does not implement String.prototype.trim) */ Util.trim = function (str) { if (typeof str !== "string") return str; return str.replace(/^\s+|\s+$/g, ""); }; /** * generate random id string */ Util.newId = function () { var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var result = ""; // tslint:disable-next-line:insecure-random var random = Math.random() * 1073741824; //5 symbols in base64, almost maxint while (random > 0) { var char = base64chars.charAt(random % 64); result += char; random = Math.floor(random / 64); } return result; }; /** * Check if an object is of type Array */ Util.isArray = function (obj) { return Object.prototype.toString.call(obj) === "[object Array]"; }; /** * Check if an object is of type Error */ Util.isError = function (obj) { return Object.prototype.toString.call(obj) === "[object Error]"; }; /** * Check if an object is of type Date */ Util.isDate = function (obj) { return Object.prototype.toString.call(obj) === "[object Date]"; }; /** * Convert a date to I.S.O. format in IE8 */ Util.toISOStringForIE8 = function (date) { if (Util.isDate(date)) { if (Date.prototype.toISOString) { return date.toISOString(); } else { var pad = function (num) { var r = String(num); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } }; /** * Gets IE version if we are running on IE, or null otherwise */ Util.getIEVersion = function (userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } var myNav = userAgentStr ? userAgentStr.toLowerCase() : navigator.userAgent.toLowerCase(); return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : null; }; /** * Convert ms to c# time span format */ Util.msToTimeSpan = function (totalms) { if (isNaN(totalms) || totalms < 0) { totalms = 0; } totalms = Math.round(totalms); var ms = "" + totalms % 1000; var sec = "" + Math.floor(totalms / 1000) % 60; var min = "" + Math.floor(totalms / (1000 * 60)) % 60; var hour = "" + Math.floor(totalms / (1000 * 60 * 60)) % 24; var days = Math.floor(totalms / (1000 * 60 * 60 * 24)); ms = ms.length === 1 ? "00" + ms : ms.length === 2 ? "0" + ms : ms; sec = sec.length < 2 ? "0" + sec : sec; min = min.length < 2 ? "0" + min : min; hour = hour.length < 2 ? "0" + hour : hour; return (days > 0 ? days + "." : "") + hour + ":" + min + ":" + sec + "." + ms; }; /** * Checks if error has no meaningful data inside. Ususally such errors are received by window.onerror when error * happens in a script from other domain (cross origin, CORS). */ Util.isCrossOriginError = function (message, url, lineNumber, columnNumber, error) { return (message === "Script error." || message === "Script error") && !error; }; /** * Returns string representation of an object suitable for diagnostics logging. */ Util.dump = function (object) { var objectTypeDump = Object.prototype.toString.call(object); var propertyValueDump = JSON.stringify(object); if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } return objectTypeDump + propertyValueDump; }; /** * Returns the name of object if it's an Error. Otherwise, returns empty string. */ Util.getExceptionName = function (object) { var objectTypeDump = Object.prototype.toString.call(object); if (objectTypeDump === "[object Error]") { return object.name; } return ""; }; /** * Adds an event handler for the specified event * @param eventName {string} - The name of the event * @param callback {any} - The callback function that needs to be executed for the given event * @return {boolean} - true if the handler was successfully added */ Util.addEventHandler = function (eventName, callback) { if (!window || typeof eventName !== 'string' || typeof callback !== 'function') { return false; } // Create verb for the event var verbEventName = 'on' + eventName; // check if addEventListener is available if (window.addEventListener) { window.addEventListener(eventName, callback, false); } else if (window["attachEvent"]) { window["attachEvent"](verbEventName, callback); } else { return false; } return true; }; /** * Tells if a browser supports a Beacon API */ Util.IsBeaconApiSupported = function () { return ('sendBeacon' in navigator && navigator.sendBeacon); }; Util.document = typeof document !== "undefined" ? document : {}; Util._canUseCookies = undefined; Util._canUseLocalStorage = undefined; Util._canUseSessionStorage = undefined; // listing only non-geo specific locations Util._internalEndpoints = [ "https://dc.services.visualstudio.com/v2/track", "https://breeze.aimon.applicationinsights.io/v2/track", "https://dc-int.services.visualstudio.com/v2/track" ]; Util.NotSpecified = "not_specified"; return Util; }()); exports.Util = Util; var UrlHelper = /** @class */ (function () { function UrlHelper() { } UrlHelper.parseUrl = function (url) { if (!UrlHelper.htmlAnchorElement) { UrlHelper.htmlAnchorElement = !!UrlHelper.document.createElement ? UrlHelper.document.createElement('a') : {}; } UrlHelper.htmlAnchorElement.href = url; return UrlHelper.htmlAnchorElement; }; UrlHelper.getAbsoluteUrl = function (url) { var result; var a = UrlHelper.parseUrl(url); if (a) { result = a.href; } return result; }; UrlHelper.getPathName = function (url) { var result; var a = UrlHelper.parseUrl(url); if (a) { result = a.pathname; } return result; }; UrlHelper.getCompleteUrl = function (method, absoluteUrl) { if (method) { return method.toUpperCase() + " " + absoluteUrl; } else { return absoluteUrl; } }; UrlHelper.document = typeof document !== "undefined" ? document : {}; return UrlHelper; }()); exports.UrlHelper = UrlHelper; var CorrelationIdHelper = /** @class */ (function () { function CorrelationIdHelper() { } /** * Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers */ CorrelationIdHelper.canIncludeCorrelationHeader = function (config, requestUrl, currentHost) { if (config && config.disableCorrelationHeaders) { return false; } if (!requestUrl) { return false; } var requestHost = UrlHelper.parseUrl(requestUrl).host.toLowerCase(); if ((!config || !config.enableCorsCorrelation) && requestHost !== currentHost) { return false; } var excludedDomains = config && config.correlationHeaderExcludedDomains; if (!excludedDomains || excludedDomains.length == 0) { return true; } for (var i = 0; i < excludedDomains.length; i++) { var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\./g, "\.").replace(/\*/g, ".*")); if (regex.test(requestHost)) { return false; } } return true; }; /** * Combines target appId and target role name from response header. */ CorrelationIdHelper.getCorrelationContext = function (responseHeader) { if (responseHeader) { var correlationId = CorrelationIdHelper.getCorrelationContextValue(responseHeader, RequestResponseHeaders_1.RequestHeaders.requestContextTargetKey); if (correlationId && correlationId !== CorrelationIdHelper.correlationIdPrefix) { return correlationId; } } }; /** * Gets key from correlation response header */ CorrelationIdHelper.getCorrelationContextValue = function (responseHeader, key) { if (responseHeader) { var keyValues = responseHeader.split(","); for (var i = 0; i < keyValues.length; ++i) { var keyValue = keyValues[i].split("="); if (keyValue.length == 2 && keyValue[0] == key) { return keyValue[1]; } } } }; CorrelationIdHelper.correlationIdPrefix = "cid-v1:"; return CorrelationIdHelper; }()); exports.CorrelationIdHelper = CorrelationIdHelper; var AjaxHelper = /** @class */ (function () { function AjaxHelper() { } AjaxHelper.ParseDependencyPath = function (logger, absoluteUrl, method, pathName) { var target, name; if (absoluteUrl && absoluteUrl.length > 0) { var parsedUrl = UrlHelper.parseUrl(absoluteUrl); target = parsedUrl.host; if (parsedUrl.pathname != null) { var pathName = (parsedUrl.pathname.length === 0) ? "/" : parsedUrl.pathname; if (pathName.charAt(0) !== '/') { pathName = "/" + pathName; } name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, method ? method + " " + pathName : pathName); } else { name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, absoluteUrl); } } else { target = pathName; name = pathName; } return { target: target, name: name }; }; return AjaxHelper; }()); exports.AjaxHelper = AjaxHelper; /** * A utility class that helps getting time related parameters */ var DateTimeUtils = /** @class */ (function () { function DateTimeUtils() { } /** * Get the number of milliseconds since 1970/01/01 in local timezone */ DateTimeUtils.Now = (window.performance && window.performance.now && window.performance.timing) ? function () { return window.performance.now() + window.performance.timing.navigationStart; } : function () { return new Date().getTime(); }; /** * Gets duration between two timestamps */ DateTimeUtils.GetDuration = function (start, end) { var result = null; if (start !== 0 && end !== 0 && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(start) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(end)) { result = end - start; } return result; }; return DateTimeUtils; }()); exports.DateTimeUtils = DateTimeUtils; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Util.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/applicationinsights-common.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ./Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./RequestResponseHeaders */ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js"), __webpack_require__(/*! ./Constants */ "./node_modules/applicationinsights-common/bundle/Constants.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/Data */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/Base */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js"), __webpack_require__(/*! ./Telemetry/Common/Envelope */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js"), __webpack_require__(/*! ./Telemetry/Event */ "./node_modules/applicationinsights-common/bundle/Telemetry/Event.js"), __webpack_require__(/*! ./Telemetry/Exception */ "./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js"), __webpack_require__(/*! ./Telemetry/Metric */ "./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js"), __webpack_require__(/*! ./Telemetry/PageView */ "./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js"), __webpack_require__(/*! ./Telemetry/RemoteDependencyData */ "./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js"), __webpack_require__(/*! ./Telemetry/Trace */ "./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js"), __webpack_require__(/*! ./Telemetry/PageViewPerformance */ "./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js"), __webpack_require__(/*! ./Telemetry/Common/Data */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/SeverityLevel */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/ContextTagKeys */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ./TelemetryItemCreator */ "./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Util_1, Enums_1, RequestResponseHeaders_1, Constants_1, Data_1, Base_1, Envelope_1, Event_1, Exception_1, Metric_1, PageView_1, PageViewData_1, RemoteDependencyData_1, Trace_1, PageViewPerformance_1, Data_2, SeverityLevel_1, ContextTagKeys_1, DataSanitizer_1, TelemetryItemCreator_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Util = Util_1.Util; exports.CorrelationIdHelper = Util_1.CorrelationIdHelper; exports.UrlHelper = Util_1.UrlHelper; exports.DateTimeUtils = Util_1.DateTimeUtils; exports.FieldType = Enums_1.FieldType; exports.RequestHeaders = RequestResponseHeaders_1.RequestHeaders; exports.DisabledPropertyName = Constants_1.DisabledPropertyName; exports.AIData = Data_1.Data; exports.AIBase = Base_1.Base; exports.Envelope = Envelope_1.Envelope; exports.Event = Event_1.Event; exports.Exception = Exception_1.Exception; exports.Metric = Metric_1.Metric; exports.PageView = PageView_1.PageView; exports.PageViewData = PageViewData_1.PageViewData; exports.RemoteDependencyData = RemoteDependencyData_1.RemoteDependencyData; exports.Trace = Trace_1.Trace; exports.PageViewPerformance = PageViewPerformance_1.PageViewPerformance; exports.Data = Data_2.Data; exports.SeverityLevel = SeverityLevel_1.SeverityLevel; exports.ContextTagKeys = ContextTagKeys_1.ContextTagKeys; exports.DataSanitizer = DataSanitizer_1.DataSanitizer; exports.TelemetryItemCreator = TelemetryItemCreator_1.TelemetryItemCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-common.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event. */ exports.EventsDiscardedReason = { /** * Unknown. */ Unknown: 0, /** * Status set to non-retryable. */ NonRetryableStatus: 1, /** * The event is invalid. */ InvalidEvent: 2, /** * The size of the event is too large. */ SizeLimitExceeded: 3, /** * The server is not accepting events from this instrumentation key. */ KillSwitch: 4, /** * The event queue is full. */ QueueFull: 5, }; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventsDiscardedReason.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js": /*!*********************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js ***! \*********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var LoggingSeverity; (function (LoggingSeverity) { /** * Error will be sent as internal telemetry */ LoggingSeverity[LoggingSeverity["CRITICAL"] = 1] = "CRITICAL"; /** * Error will NOT be sent as internal telemetry, and will only be shown in browser console */ LoggingSeverity[LoggingSeverity["WARNING"] = 2] = "WARNING"; })(LoggingSeverity = exports.LoggingSeverity || (exports.LoggingSeverity = {})); /** * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered */ ; exports._InternalMessageId = { // Non user actionable BrowserDoesNotSupportLocalStorage: 0, BrowserCannotReadLocalStorage: 1, BrowserCannotReadSessionStorage: 2, BrowserCannotWriteLocalStorage: 3, BrowserCannotWriteSessionStorage: 4, BrowserFailedRemovalFromLocalStorage: 5, BrowserFailedRemovalFromSessionStorage: 6, CannotSendEmptyTelemetry: 7, ClientPerformanceMathError: 8, ErrorParsingAISessionCookie: 9, ErrorPVCalc: 10, ExceptionWhileLoggingError: 11, FailedAddingTelemetryToBuffer: 12, FailedMonitorAjaxAbort: 13, FailedMonitorAjaxDur: 14, FailedMonitorAjaxOpen: 15, FailedMonitorAjaxRSC: 16, FailedMonitorAjaxSend: 17, FailedMonitorAjaxGetCorrelationHeader: 18, FailedToAddHandlerForOnBeforeUnload: 19, FailedToSendQueuedTelemetry: 20, FailedToReportDataLoss: 21, FlushFailed: 22, MessageLimitPerPVExceeded: 23, MissingRequiredFieldSpecification: 24, NavigationTimingNotSupported: 25, OnError: 26, SessionRenewalDateIsZero: 27, SenderNotInitialized: 28, StartTrackEventFailed: 29, StopTrackEventFailed: 30, StartTrackFailed: 31, StopTrackFailed: 32, TelemetrySampledAndNotSent: 33, TrackEventFailed: 34, TrackExceptionFailed: 35, TrackMetricFailed: 36, TrackPVFailed: 37, TrackPVFailedCalc: 38, TrackTraceFailed: 39, TransmissionFailed: 40, FailedToSetStorageBuffer: 41, FailedToRestoreStorageBuffer: 42, InvalidBackendResponse: 43, FailedToFixDepricatedValues: 44, InvalidDurationValue: 45, TelemetryEnvelopeInvalid: 46, CreateEnvelopeError: 47, // User actionable CannotSerializeObject: 48, CannotSerializeObjectNonSerializable: 49, CircularReferenceDetected: 50, ClearAuthContextFailed: 51, ExceptionTruncated: 52, IllegalCharsInName: 53, ItemNotInArray: 54, MaxAjaxPerPVExceeded: 55, MessageTruncated: 56, NameTooLong: 57, SampleRateOutOfRange: 58, SetAuthContextFailed: 59, SetAuthContextFailedAccountName: 60, StringValueTooLong: 61, StartCalledMoreThanOnce: 62, StopCalledWithoutStart: 63, TelemetryInitializerFailed: 64, TrackArgumentsNotSpecified: 65, UrlTooLong: 66, SessionStorageBufferFull: 67, CannotAccessCookie: 68, IdTooLong: 69, }; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=LoggingEnums.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MinChannelPriorty = 100; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=IChannelControls.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../JavaScriptSDK.Enums/EventsDiscardedReason */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js"), __webpack_require__(/*! ./CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js"), __webpack_require__(/*! ./NotificationManager */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js"), __webpack_require__(/*! ./DiagnosticLogger */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventsDiscardedReason_1, CoreUtils_1, NotificationManager_1, DiagnosticLogger_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; var AppInsightsCore = /** @class */ (function () { function AppInsightsCore() { this._isInitialized = false; this._extensions = new Array(); this._channelController = new ChannelController(); } AppInsightsCore.prototype.initialize = function (config, extensions) { var _this = this; // Make sure core is only initialized once if (this._isInitialized) { throw Error("Core should not be initialized more than once"); } if (!config || CoreUtils_1.CoreUtils.isNullOrUndefined(config.instrumentationKey)) { throw Error("Please provide instrumentation key"); } this.config = config; this._notificationManager = new NotificationManager_1.NotificationManager(); this.config.extensions = CoreUtils_1.CoreUtils.isNullOrUndefined(this.config.extensions) ? [] : this.config.extensions; // add notification to the extensions in the config so other plugins can access it this.config.extensionConfig = CoreUtils_1.CoreUtils.isNullOrUndefined(this.config.extensionConfig) ? {} : this.config.extensionConfig; this.config.extensionConfig.NotificationManager = this._notificationManager; this.logger = new DiagnosticLogger_1.DiagnosticLogger(config); // Initial validation extensions.forEach(function (extension) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(extension.initialize)) { throw Error(validationError); } }); if (this.config.extensions.length > 0) { var isValid_1 = true; this.config.extensions.forEach(function (item) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(item)) { isValid_1 = false; } }); if (!isValid_1) { throw Error(validationError); } } // Initial validation complete // Concat all available extensions before sorting by priority (_a = this._extensions).push.apply(_a, [this._channelController].concat(extensions, this.config.extensions)); this._extensions = this._extensions.sort(function (a, b) { var extA = a; var extB = b; var typeExtA = typeof extA.processTelemetry; var typeExtB = typeof extB.processTelemetry; if (typeExtA === 'function' && typeExtB === 'function') { return extA.priority - extB.priority; } if (typeExtA === 'function' && typeExtB !== 'function') { // keep non telemetryplugin specific extensions at start return 1; } if (typeExtA !== 'function' && typeExtB === 'function') { return -1; } }); // sort complete // Check if any two extensions have the same priority, then warn to console var priority = {}; this._extensions.forEach(function (ext) { var t = ext; if (t && t.priority) { if (!CoreUtils_1.CoreUtils.isNullOrUndefined(priority[t.priority])) { _this.logger.warnToConsole("Two extensions have same priority" + priority[t.priority] + ", " + t.identifier); } else { priority[t.priority] = t.identifier; // set a value } } }); // initialize plugins including channel controller this._extensions.forEach(function (ext) { var e = ext; if (e && e.priority <= ChannelControllerPriority) { ext.initialize(_this.config, _this, _this._extensions); // initialize } }); var c = -1; // Set next plugin for all until channel controller for (var idx = 0; idx < this._extensions.length - 1; idx++) { var curr = (this._extensions[idx]); if (curr && typeof curr.processTelemetry !== 'function') { // these are initialized only, allowing an entry point for extensions to be initialized when SDK initializes continue; } if (curr.priority === ChannelControllerPriority) { c = idx + 1; break; // channel controller will set remaining pipeline } this._extensions[idx].setNextPlugin(this._extensions[idx + 1]); // set next plugin } // Remove sender channels from main list if (c < this._extensions.length) { this._extensions.splice(c); } if (this.getTransmissionControls().length === 0) { throw new Error("No channels available"); } this._isInitialized = true; var _a; }; AppInsightsCore.prototype.getTransmissionControls = function () { return this._channelController.ChannelControls; }; AppInsightsCore.prototype.track = function (telemetryItem) { if (telemetryItem === null) { this._notifiyInvalidEvent(telemetryItem); // throw error throw Error("Invalid telemetry item"); } if (telemetryItem.baseData && !telemetryItem.baseType) { this._notifiyInvalidEvent(telemetryItem); throw Error("Provide data.baseType for data.baseData"); } if (!telemetryItem.baseType) { // Hard coded from Common::Event.ts::Event.dataType telemetryItem.baseType = "EventData"; } if (!telemetryItem.instrumentationKey) { // setup default ikey if not passed in telemetryItem.instrumentationKey = this.config.instrumentationKey; } if (!telemetryItem.timestamp) { // add default timestamp if not passed in telemetryItem.timestamp = new Date(); } // do basic validation before sending it through the pipeline this._validateTelmetryItem(telemetryItem); // invoke any common telemetry processors before sending through pipeline var i = 0; while (i < this._extensions.length) { if (this._extensions[i].processTelemetry) { this._extensions[i].processTelemetry(telemetryItem); // pass on to first extension that can support processing break; } i++; } }; /** * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be * called. * @param {INotificationListener} listener - An INotificationListener object. */ AppInsightsCore.prototype.addNotificationListener = function (listener) { this._notificationManager.addNotificationListener(listener); }; /** * Removes all instances of the listener. * @param {INotificationListener} listener - INotificationListener to remove. */ AppInsightsCore.prototype.removeNotificationListener = function (listener) { this._notificationManager.removeNotificationListener(listener); }; /** * Periodically check logger.queue for */ AppInsightsCore.prototype.pollInternalLogs = function () { var _this = this; if (!(this.config.diagnosticLoggingInterval > 0)) { throw Error("config.diagnosticLoggingInterval must be a positive integer"); } return setInterval(function () { var queue = _this.logger.queue; queue.forEach(function (logMessage) { var item = { name: "InternalMessageId: " + logMessage.messageId, instrumentationKey: _this.config.instrumentationKey, timestamp: new Date(), baseType: DiagnosticLogger_1._InternalLogMessage.dataType, baseData: { message: logMessage.message } }; _this.track(item); }); queue.length = 0; }, this.config.diagnosticLoggingInterval); }; AppInsightsCore.prototype._validateTelmetryItem = function (telemetryItem) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.name)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry name required"); } if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.timestamp)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry timestamp required"); } if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.instrumentationKey)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry instrumentationKey required"); } }; AppInsightsCore.prototype._notifiyInvalidEvent = function (telemetryItem) { this._notificationManager.eventsDiscarded([telemetryItem], EventsDiscardedReason_1.EventsDiscardedReason.InvalidEvent); }; return AppInsightsCore; }()); exports.AppInsightsCore = AppInsightsCore; var ChannelController = /** @class */ (function () { function ChannelController() { this.identifier = "ChannelControllerPlugin"; this.priority = ChannelControllerPriority; // in reserved range 100 to 200 } ChannelController.prototype.processTelemetry = function (item) { this.channelQueue.forEach(function (queues) { // pass on to first item in queue if (queues.length > 0) { queues[0].processTelemetry(item); } }); }; Object.defineProperty(ChannelController.prototype, "ChannelControls", { get: function () { return this.channelQueue; }, enumerable: true, configurable: true }); ChannelController.prototype.initialize = function (config, core, extensions) { var _this = this; this.channelQueue = new Array(); if (config.channels) { config.channels.forEach(function (queue) { if (queue && queue.length > 0) { queue = queue.sort(function (a, b) { return a.priority - b.priority; }); // Initialize each plugin queue.forEach(function (queueItem) { return queueItem.initialize(config, core, extensions); }); for (var i = 1; i < queue.length; i++) { queue[i - 1].setNextPlugin(queue[i]); // setup processing chain } _this.channelQueue.push(queue); } }); } else { var arr = new Array(); for (var i = 0; i < extensions.length; i++) { var plugin = extensions[i]; if (plugin.priority > ChannelControllerPriority) { arr.push(plugin); } } if (arr.length > 0) { // sort if not sorted arr = arr.sort(function (a, b) { return a.priority - b.priority; }); // Initialize each plugin arr.forEach(function (queueItem) { return queueItem.initialize(config, core, extensions); }); // setup next plugin for (var i = 1; i < arr.length; i++) { arr[i - 1].setNextPlugin(arr[i]); } this.channelQueue.push(arr); } } }; return ChannelController; }()); var validationError = "Extensions must provide callback to initialize"; var ChannelControllerPriority = 200; var duplicatePriority = "One or more extensions are set at same priority"; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=AppInsightsCore.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js": /*!************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var CoreUtils = /** @class */ (function () { function CoreUtils() { } CoreUtils.isNullOrUndefined = function (input) { return input === null || input === undefined; }; /** * Creates a new GUID. * @return {string} A GUID. */ CoreUtils.newGuid = function () { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, function (c) { var r = (Math.random() * 16 | 0), v = (c === 'x' ? r : r & 0x3 | 0x8); return v.toString(16); }); }; return CoreUtils; }()); exports.CoreUtils = CoreUtils; var GuidRegex = /[xy]/g; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=CoreUtils.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js": /*!*******************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js ***! \*******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../JavaScriptSDK.Enums/LoggingEnums */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js"), __webpack_require__(/*! ./CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, LoggingEnums_1, CoreUtils_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } this.messageId = msgId; this.message = (isUserAct ? _InternalLogMessage.AiUserActionablePrefix : _InternalLogMessage.AiNonUserActionablePrefix) + msgId; var diagnosticText = (msg ? " message:" + _InternalLogMessage.sanitizeDiagnosticText(msg) : "") + (properties ? " props:" + _InternalLogMessage.sanitizeDiagnosticText(JSON.stringify(properties)) : ""); this.message += diagnosticText; } _InternalLogMessage.sanitizeDiagnosticText = function (text) { return "\"" + text.replace(/\"/g, "") + "\""; }; _InternalLogMessage.dataType = "MessageData"; /** * For user non actionable traces use AI Internal prefix. */ _InternalLogMessage.AiNonUserActionablePrefix = "AI (Internal): "; /** * Prefix of the traces in portal. */ _InternalLogMessage.AiUserActionablePrefix = "AI: "; return _InternalLogMessage; }()); exports._InternalLogMessage = _InternalLogMessage; var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { /** * Session storage key for the prefix for the key indicating message type already logged */ this.AIInternalMessagePrefix = "AITR_"; /** * When this is true the SDK will throw exceptions to aid in debugging. */ this.enableDebugExceptions = function () { return false; }; /** * 0: OFF * 1: CRITICAL (default) * 2: >= WARNING */ this.consoleLoggingLevel = function () { return 1; }; /** * 0: OFF (default) * 1: CRITICAL * 2: >= WARNING */ this.telemetryLoggingLevel = function () { return 0; }; /** * The maximum number of internal messages allowed to be sent per page view */ this.maxInternalMessageLimit = function () { return 25; }; /** * The internal logging queue */ this.queue = []; /** * Count of internal messages sent */ this._messageCount = 0; /** * Holds information about what message types were already logged to console or sent to server. */ this._messageLogged = {}; if (CoreUtils_1.CoreUtils.isNullOrUndefined(config)) { // TODO: Use default config // config = AppInsightsCore.defaultConfig; // For now, use defaults specified in DiagnosticLogger members; return; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.loggingLevelConsole)) { this.consoleLoggingLevel = function () { return config.loggingLevelConsole; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.loggingLevelTelemetry)) { this.telemetryLoggingLevel = function () { return config.loggingLevelTelemetry; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.maxMessageLimit)) { this.maxInternalMessageLimit = function () { return config.maxMessageLimit; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.enableDebugExceptions)) { this.enableDebugExceptions = function () { return config.enableDebugExceptions; }; } } /** * This method will throw exceptions in debug mode or attempt to log the error as a console warning. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The log message. */ DiagnosticLogger.prototype.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (this.enableDebugExceptions()) { throw message; } else { if (typeof (message) !== "undefined" && !!message) { if (typeof (message.message) !== "undefined") { if (isUserAct) { // check if this message type was already logged to console for this page view and if so, don't log it again var messageKey = +message.messageId; if (!this._messageLogged[messageKey] || this.consoleLoggingLevel() >= LoggingEnums_1.LoggingSeverity.WARNING) { this.warnToConsole(message.message); this._messageLogged[messageKey] = true; } } else { // don't log internal AI traces in the console, unless the verbose logging is enabled if (this.consoleLoggingLevel() >= LoggingEnums_1.LoggingSeverity.WARNING) { this.warnToConsole(message.message); } } this.logInternalMessage(severity, message); } } } }; /** * This will write a warning to the console if possible * @param message {string} - The warning message */ DiagnosticLogger.prototype.warnToConsole = function (message) { if (typeof console !== "undefined" && !!console) { if (typeof console.warn === "function") { console.warn(message); } else if (typeof console.log === "function") { console.log(message); } } }; /** * Resets the internal message count */ DiagnosticLogger.prototype.resetInternalMessageCount = function () { this._messageCount = 0; this._messageLogged = {}; }; /** * Logs a message to the internal queue. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The message to log. */ DiagnosticLogger.prototype.logInternalMessage = function (severity, message) { if (this._areInternalMessagesThrottled()) { return; } // check if this message type was already logged for this session and if so, don't log it again var logMessage = true; var messageKey = this.AIInternalMessagePrefix + message.messageId; // if the session storage is not available, limit to only one message type per page view if (this._messageLogged[messageKey]) { logMessage = false; } else { this._messageLogged[messageKey] = true; } if (logMessage) { // Push the event in the internal queue if (severity <= this.telemetryLoggingLevel()) { this.queue.push(message); this._messageCount++; } // When throttle limit reached, send a special event if (this._messageCount == this.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(LoggingEnums_1._InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false); this.queue.push(throttleMessage); this.warnToConsole(throttleLimitMessage); } } }; /** * Indicates whether the internal events are throttled */ DiagnosticLogger.prototype._areInternalMessagesThrottled = function () { return this._messageCount >= this.maxInternalMessageLimit(); }; return DiagnosticLogger; }()); exports.DiagnosticLogger = DiagnosticLogger; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DiagnosticLogger.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js": /*!**********************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js ***! \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Class to manage sending notifications to all the listeners. */ var NotificationManager = /** @class */ (function () { function NotificationManager() { this.listeners = []; } /** * Adds a notification listener. * @param {INotificationListener} listener - The notification listener to be added. */ NotificationManager.prototype.addNotificationListener = function (listener) { this.listeners.push(listener); }; /** * Removes all instances of the listener. * @param {INotificationListener} listener - AWTNotificationListener to remove. */ NotificationManager.prototype.removeNotificationListener = function (listener) { var index = this.listeners.indexOf(listener); while (index > -1) { this.listeners.splice(index, 1); index = this.listeners.indexOf(listener); } }; /** * Notification for events sent. * @param {ITelemetryItem[]} events - The array of events that have been sent. */ NotificationManager.prototype.eventsSent = function (events) { var _this = this; var _loop_1 = function (i) { if (this_1.listeners[i].eventsSent) { setTimeout(function () { return _this.listeners[i].eventsSent(events); }, 0); } }; var this_1 = this; for (var i = 0; i < this.listeners.length; ++i) { _loop_1(i); } }; /** * Notification for events being discarded. * @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK. * @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason * constant should be used to check the different values. */ NotificationManager.prototype.eventsDiscarded = function (events, reason) { var _this = this; var _loop_2 = function (i) { if (this_2.listeners[i].eventsDiscarded) { setTimeout(function () { return _this.listeners[i].eventsDiscarded(events, reason); }, 0); } }; var this_2 = this; for (var i = 0; i < this.listeners.length; ++i) { _loop_2(i); } }; return NotificationManager; }()); exports.NotificationManager = NotificationManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=NotificationManager.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js": /*!****************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js ***! \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./JavaScriptSDK.Interfaces/IChannelControls */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js"), __webpack_require__(/*! ./JavaScriptSDK.Enums/EventsDiscardedReason */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js"), __webpack_require__(/*! ./JavaScriptSDK/AppInsightsCore */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js"), __webpack_require__(/*! ./JavaScriptSDK/CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js"), __webpack_require__(/*! ./JavaScriptSDK/NotificationManager */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js"), __webpack_require__(/*! ./JavaScriptSDK/DiagnosticLogger */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js"), __webpack_require__(/*! ./JavaScriptSDK.Enums/LoggingEnums */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, IChannelControls_1, EventsDiscardedReason_1, AppInsightsCore_1, CoreUtils_1, NotificationManager_1, DiagnosticLogger_1, LoggingEnums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MinChannelPriorty = IChannelControls_1.MinChannelPriorty; exports.EventsDiscardedReason = EventsDiscardedReason_1.EventsDiscardedReason; exports.AppInsightsCore = AppInsightsCore_1.AppInsightsCore; exports.CoreUtils = CoreUtils_1.CoreUtils; exports.NotificationManager = NotificationManager_1.NotificationManager; exports.DiagnosticLogger = DiagnosticLogger_1.DiagnosticLogger; exports._InternalLogMessage = DiagnosticLogger_1._InternalLogMessage; exports._InternalMessageId = LoggingEnums_1._InternalMessageId; exports.LoggingSeverity = LoggingEnums_1.LoggingSeverity; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-core-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajax.js": /*!*************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajax.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./ajaxRecord */ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js"), __webpack_require__(/*! ./ajaxUtils */ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1, ajaxRecord_1, ajaxUtils_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var AjaxMonitor = /** @class */ (function () { function AjaxMonitor() { this._trackAjaxAttempts = 0; this.identifier = "AjaxDependencyPlugin"; this.priority = 161; this.currentWindowHost = window && window.location.host && window.location.host.toLowerCase(); this.initialized = false; } ///Verifies that particalar instance of XMLHttpRequest needs to be monitored ///Optional parameter. True if ajaxData must be excluded from verification ///True if instance needs to be monitored, otherwise false AjaxMonitor.prototype.isMonitoredInstance = function (xhr, excludeAjaxDataValidation) { // checking to see that all interested functions on xhr were instrumented return this.initialized // checking on ajaxData to see that it was not removed in user code && (excludeAjaxDataValidation === true || !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData)) // check that this instance is not not used by ajax call performed inside client side monitoring to send data to collector && xhr[applicationinsights_common_1.DisabledPropertyName] !== true; }; ///Determines whether ajax monitoring can be enabled on this document ///True if Ajax monitoring is supported on this page, otherwise false AjaxMonitor.prototype.supportsMonitoring = function () { var result = true; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.open) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.send) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.abort)) { result = false; } // disable in IE8 or older (https://www.w3schools.com/jsref/jsref_trim_string.asp) try { " a ".trim(); } catch (ex) { result = false; } return result; }; AjaxMonitor.prototype.instrumentOpen = function () { var originalOpen = XMLHttpRequest.prototype.open; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.open = function (method, url, async) { try { if (ajaxMonitorInstance.isMonitoredInstance(this, true) && (!this.ajaxData || !this.ajaxData.xhrMonitoringState.openDone)) { ajaxMonitorInstance.openHandler(this, method, url, async); } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxOpen, "Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalOpen.apply(this, arguments); }; }; AjaxMonitor.prototype.openHandler = function (xhr, method, url, async) { /* todo: Disabling the following block of code as CV is not yet supported in 1DS for 3rd Part. // this format corresponds with activity logic on server-side and is required for the correct correlation var id = "|" + this.appInsights.context.operation.id + "." + Util.newId(); */ var id = applicationinsights_common_1.Util.newId(); var ajaxData = new ajaxRecord_1.ajaxRecord(id, this._core._logger); ajaxData.method = method; ajaxData.requestUrl = url; ajaxData.xhrMonitoringState.openDone = true; xhr.ajaxData = ajaxData; this.attachToOnReadyStateChange(xhr); }; AjaxMonitor.getFailedAjaxDiagnosticsMessage = function (xhr) { var result = ""; try { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData.requestUrl)) { result += "(url: '" + xhr.ajaxData.requestUrl + "')"; } } catch (e) { } return result; }; AjaxMonitor.prototype.instrumentSend = function () { var originalSend = XMLHttpRequest.prototype.send; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.send = function (content) { try { if (ajaxMonitorInstance.isMonitoredInstance(this) && !this.ajaxData.xhrMonitoringState.sendDone) { ajaxMonitorInstance.sendHandler(this, content); } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxSend, "Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalSend.apply(this, arguments); }; }; AjaxMonitor.prototype.sendHandler = function (xhr, content) { xhr.ajaxData.requestSentTime = applicationinsights_common_1.DateTimeUtils.Now(); if (this.currentWindowHost && applicationinsights_common_1.CorrelationIdHelper.canIncludeCorrelationHeader(this._config, xhr.ajaxData.getAbsoluteUrl(), this.currentWindowHost)) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.requestIdHeader, xhr.ajaxData.id); var appId = this._config.appId; // Todo: also, get appId from channel as breeze returns it if (appId) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.requestContextHeader, applicationinsights_common_1.RequestHeaders.requestContextAppIdFormat + appId); } } xhr.ajaxData.xhrMonitoringState.sendDone = true; }; AjaxMonitor.prototype.instrumentAbort = function () { var originalAbort = XMLHttpRequest.prototype.abort; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.abort = function () { try { if (ajaxMonitorInstance.isMonitoredInstance(this) && !this.ajaxData.xhrMonitoringState.abortDone) { this.ajaxData.aborted = 1; this.ajaxData.xhrMonitoringState.abortDone = true; } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxAbort, "Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalAbort.apply(this, arguments); }; }; AjaxMonitor.prototype.attachToOnReadyStateChange = function (xhr) { var _this = this; var ajaxMonitorInstance = this; xhr.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached = ajaxUtils_1.EventHelper.AttachEvent(xhr, "readystatechange", function () { try { if (ajaxMonitorInstance.isMonitoredInstance(xhr)) { if (xhr.readyState === 4) { ajaxMonitorInstance.onAjaxComplete(xhr); } } } catch (e) { var exceptionText = applicationinsights_common_1.Util.dump(e); // ignore messages with c00c023f, as this a known IE9 XHR abort issue if (!exceptionText || exceptionText.toLowerCase().indexOf("c00c023f") == -1) { _this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxRSC, "Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), exception: applicationinsights_common_1.Util.dump(e) }); } } }); }; AjaxMonitor.prototype.onAjaxComplete = function (xhr) { xhr.ajaxData.responseFinishedTime = applicationinsights_common_1.DateTimeUtils.Now(); xhr.ajaxData.status = xhr.status; xhr.ajaxData.CalculateMetrics(); if (xhr.ajaxData.ajaxTotalDuration < 0) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxDur, "Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), requestSentTime: xhr.ajaxData.requestSentTime, responseFinishedTime: xhr.ajaxData.responseFinishedTime }); } else { var dependency = { id: xhr.ajaxData.id, absoluteUrl: xhr.ajaxData.getAbsoluteUrl(), commandName: xhr.ajaxData.getPathName(), duration: xhr.ajaxData.ajaxTotalDuration, success: (+(xhr.ajaxData.status)) >= 200 && (+(xhr.ajaxData.status)) < 400, resultCode: +xhr.ajaxData.status, method: xhr.ajaxData.method }; // enrich dependency target with correlation context from the server var correlationContext = this.getCorrelationContext(xhr); if (correlationContext) { dependency.correlationContext = /* dependency.target + " | " + */ correlationContext; } this.trackDependencyData(dependency); xhr.ajaxData = null; } }; AjaxMonitor.prototype.getCorrelationContext = function (xhr) { try { var responseHeadersString = xhr.getAllResponseHeaders(); if (responseHeadersString !== null) { var index = responseHeadersString.toLowerCase().indexOf(applicationinsights_common_1.RequestHeaders.requestContextHeaderLowerCase); if (index !== -1) { var responseHeader = xhr.getResponseHeader(applicationinsights_common_1.RequestHeaders.requestContextHeader); return applicationinsights_common_1.CorrelationIdHelper.getCorrelationContext(responseHeader); } } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxGetCorrelationHeader, "Failed to get Request-Context correlation header as it may be not included in the response or not accessible.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs dependency call * @param dependencyData dependency data object */ AjaxMonitor.prototype.trackDependencyData = function (dependency, properties, systemProperties) { if (this._config.maxAjaxCallsPerView === -1 || this._trackAjaxAttempts < this._config.maxAjaxCallsPerView) { var item = applicationinsights_common_1.TelemetryItemCreator.create(dependency, applicationinsights_common_1.RemoteDependencyData.dataType, applicationinsights_common_1.RemoteDependencyData.envelopeType, this._core._logger, properties, systemProperties); this._core.track(item); } else if (this._trackAjaxAttempts === this._config.maxAjaxCallsPerView) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.MaxAjaxPerPVExceeded, "Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.", true); } ++this._trackAjaxAttempts; }; AjaxMonitor.prototype.processTelemetry = function (item) { if (this._nextPlugin && this._nextPlugin.processTelemetry) { this._nextPlugin.processTelemetry(item); } }; AjaxMonitor.prototype.setNextPlugin = function (next) { if (next) { this._nextPlugin = next; } }; AjaxMonitor.prototype.initialize = function (config, core, extensions) { if (!this.initialized) { this._core = core; config.extensionConfig = config.extensionConfig ? config.extensionConfig : {}; var c = config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {}; this._config = { maxAjaxCallsPerView: !isNaN(c.maxAjaxCallsPerView) ? c.maxAjaxCallsPerView : 500, disableAjaxTracking: applicationinsights_common_1.Util.stringToBoolOrDefault(c.disableAjaxTracking), disableCorrelationHeaders: applicationinsights_common_1.Util.stringToBoolOrDefault(c.disableCorrelationHeaders), correlationHeaderExcludedDomains: c.correlationHeaderExcludedDomains || [ "*.blob.core.windows.net", "*.blob.core.chinacloudapi.cn", "*.blob.core.cloudapi.de", "*.blob.core.usgovcloudapi.net" ], appId: c.appId, enableCorsCorrelation: applicationinsights_common_1.Util.stringToBoolOrDefault(c.enableCorsCorrelation) }; if (this.supportsMonitoring() && !this._config.disableAjaxTracking) { this.instrumentOpen(); this.instrumentSend(); this.instrumentAbort(); this.initialized = true; } } }; return AjaxMonitor; }()); exports.AjaxMonitor = AjaxMonitor; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajax.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var XHRMonitoringState = /** @class */ (function () { function XHRMonitoringState() { this.openDone = false; this.setRequestHeaderDone = false; this.sendDone = false; this.abortDone = false; //True, if onreadyStateChangeCallback function attached to xhr, otherwise false this.onreadystatechangeCallbackAttached = false; } return XHRMonitoringState; }()); exports.XHRMonitoringState = XHRMonitoringState; var ajaxRecord = /** @class */ (function () { function ajaxRecord(id, logger) { this.completed = false; this.requestHeadersSize = null; this.ttfb = null; this.responseReceivingDuration = null; this.callbackDuration = null; this.ajaxTotalDuration = null; this.aborted = null; this.pageUrl = null; this.requestUrl = null; this.requestSize = 0; this.method = null; ///Returns the HTTP status code. this.status = null; //The timestamp when open method was invoked this.requestSentTime = null; //The timestamps when first byte was received this.responseStartedTime = null; //The timestamp when last byte was received this.responseFinishedTime = null; //The timestamp when onreadystatechange callback in readyState 4 finished this.callbackFinishedTime = null; //The timestamp at which ajax was ended this.endTime = null; //The original xhr onreadystatechange event this.originalOnreadystatechage = null; this.xhrMonitoringState = new XHRMonitoringState(); //Determines whether or not JavaScript exception occured in xhr.onreadystatechange code. 1 if occured, otherwise 0. this.clientFailure = 0; this.CalculateMetrics = function () { var self = this; // round to 3 decimal points self.ajaxTotalDuration = Math.round(applicationinsights_common_1.DateTimeUtils.GetDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000; }; this.id = id; this._logger = logger; } ajaxRecord.prototype.getAbsoluteUrl = function () { return this.requestUrl ? applicationinsights_common_1.UrlHelper.getAbsoluteUrl(this.requestUrl) : null; }; ajaxRecord.prototype.getPathName = function () { return this.requestUrl ? applicationinsights_common_1.DataSanitizer.sanitizeUrl(this._logger, applicationinsights_common_1.UrlHelper.getCompleteUrl(this.method, this.requestUrl)) : null; }; return ajaxRecord; }()); exports.ajaxRecord = ajaxRecord; ; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajaxRecord.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js": /*!******************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var stringUtils = /** @class */ (function () { function stringUtils() { } stringUtils.GetLength = function (strObject) { var res = 0; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(strObject)) { var stringified = ""; try { stringified = strObject.toString(); } catch (ex) { // some troubles with complex object } res = stringified.length; res = isNaN(res) ? 0 : res; } return res; }; return stringUtils; }()); exports.stringUtils = stringUtils; var EventHelper = /** @class */ (function () { function EventHelper() { } ///Binds the specified function to an event, so that the function gets called whenever the event fires on the object ///Object to which ///String that specifies any of the standard DHTML Events without "on" prefix ///Pointer that specifies the function to call when event fires ///True if the function was bound successfully to the event, otherwise false EventHelper.AttachEvent = function (obj, eventNameWithoutOn, handlerRef) { var result = false; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj)) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.attachEvent)) { // IE before version 9 obj.attachEvent("on" + eventNameWithoutOn, handlerRef); result = true; } else { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.addEventListener)) { // all browsers except IE before version 9 obj.addEventListener(eventNameWithoutOn, handlerRef, false); result = true; } } } return result; }; EventHelper.DetachEvent = function (obj, eventNameWithoutOn, handlerRef) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj)) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.detachEvent)) { obj.detachEvent("on" + eventNameWithoutOn, handlerRef); } else { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.removeEventListener)) { obj.removeEventListener(eventNameWithoutOn, handlerRef, false); } } } }; return EventHelper; }()); exports.EventHelper = EventHelper; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajaxUtils.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./ajax */ "./node_modules/applicationinsights-dependencies-js/bundle/ajax.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, ajax_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AjaxPlugin = ajax_1.AjaxMonitor; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-dependencies-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Application.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Application.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Application = /** @class */ (function () { function Application() { } return Application; }()); exports.Application = Application; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Application.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Device.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Device.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Device = /** @class */ (function () { /** * Constructs a new instance of the Device class */ function Device() { // don't attempt to fingerprint browsers this.id = "browser"; // Device type is a dimension in our data platform // Setting it to 'Browser' allows to separate client and server dependencies/exceptions this.type = "Browser"; } return Device; }()); exports.Device = Device; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Device.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Version = "2.0.1-beta"; var Internal = /** @class */ (function () { /** * Constructs a new instance of the internal telemetry data class. */ function Internal(config) { this.sdkVersion = (config.sdkExtension && config.sdkExtension() ? config.sdkExtension() + "_" : "") + "javascript:" + Version; } return Internal; }()); exports.Internal = Internal; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Internal.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Location.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Location.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Location = /** @class */ (function () { function Location() { } return Location; }()); exports.Location = Location; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Location.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js": /*!************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Operation = /** @class */ (function () { function Operation() { this.id = applicationinsights_common_1.Util.newId(); if (window && window.location && window.location.pathname) { this.name = window.location.pathname; } } return Operation; }()); exports.Operation = Operation; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Operation.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../SamplingScoreGenerator */ "./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, SamplingScoreGenerator_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Sample = /** @class */ (function () { function Sample(sampleRate, logger) { // We're using 32 bit math, hence max value is (2^31 - 1) this.INT_MAX_VALUE = 2147483647; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(logger)) { this._logger = new applicationinsights_core_js_1.DiagnosticLogger(); } else { this._logger = logger; } if (sampleRate > 100 || sampleRate < 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SampleRateOutOfRange, "Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.", { samplingRate: sampleRate }, true); this.sampleRate = 100; } this.sampleRate = sampleRate; this.samplingScoreGenerator = new SamplingScoreGenerator_1.SamplingScoreGenerator(); } /** * Determines if an envelope is sampled in (i.e. will be sent) or not (i.e. will be dropped). */ Sample.prototype.isSampledIn = function (envelope) { // return true as sampling will move to different extension return true; }; return Sample; }()); exports.Sample = Sample; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Sample.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Session.js": /*!**********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Session.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Session = /** @class */ (function () { function Session() { } return Session; }()); exports.Session = Session; var _SessionManager = /** @class */ (function () { function _SessionManager(config, logger) { if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(logger)) { this._logger = new applicationinsights_core_js_1.DiagnosticLogger(); } else { this._logger = logger; } if (!config) { config = {}; } if (!(typeof config.sessionExpirationMs === "function")) { config.sessionExpirationMs = function () { return _SessionManager.acquisitionSpan; }; } if (!(typeof config.sessionRenewalMs === "function")) { config.sessionRenewalMs = function () { return _SessionManager.renewalSpan; }; } this.config = config; this.automaticSession = new Session(); } _SessionManager.prototype.update = function () { if (!this.automaticSession.id) { this.initializeAutomaticSession(); } var now = applicationinsights_common_1.DateTimeUtils.Now(); var acquisitionExpired = now - this.automaticSession.acquisitionDate > this.config.sessionExpirationMs(); var renewalExpired = now - this.automaticSession.renewalDate > this.config.sessionRenewalMs(); // renew if acquisitionSpan or renewalSpan has ellapsed if (acquisitionExpired || renewalExpired) { // update automaticSession so session state has correct id this.automaticSession.isFirst = undefined; this.renew(); } else { // do not update the cookie more often than cookieUpdateInterval if (!this.cookieUpdatedTimestamp || now - this.cookieUpdatedTimestamp > _SessionManager.cookieUpdateInterval) { this.automaticSession.renewalDate = now; this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); } } }; /** * Record the current state of the automatic session and store it in our cookie string format * into the browser's local storage. This is used to restore the session data when the cookie * expires. */ _SessionManager.prototype.backup = function () { this.setStorage(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); }; /** * Use ai_session cookie data or local storage data (when the cookie is unavailable) to * initialize the automatic session. */ _SessionManager.prototype.initializeAutomaticSession = function () { var cookie = applicationinsights_common_1.Util.getCookie(this._logger, 'ai_session'); if (cookie && typeof cookie.split === "function") { this.initializeAutomaticSessionWithData(cookie); } else { // There's no cookie, but we might have session data in local storage // This can happen if the session expired or the user actively deleted the cookie // We only want to recover data if the cookie is missing from expiry. We should respect the user's wishes if the cookie was deleted actively. // The User class handles this for us and deletes our local storage object if the persistent user cookie was removed. var storage = applicationinsights_common_1.Util.getStorage(this._logger, 'ai_session'); if (storage) { this.initializeAutomaticSessionWithData(storage); } } if (!this.automaticSession.id) { this.automaticSession.isFirst = true; this.renew(); } }; /** * Extract id, aquisitionDate, and renewalDate from an ai_session payload string and * use this data to initialize automaticSession. * * @param {string} sessionData - The string stored in an ai_session cookie or local storage backup */ _SessionManager.prototype.initializeAutomaticSessionWithData = function (sessionData) { var params = sessionData.split("|"); if (params.length > 0) { this.automaticSession.id = params[0]; } try { if (params.length > 1) { var acq = +params[1]; this.automaticSession.acquisitionDate = +new Date(acq); this.automaticSession.acquisitionDate = this.automaticSession.acquisitionDate > 0 ? this.automaticSession.acquisitionDate : 0; } if (params.length > 2) { var renewal = +params[2]; this.automaticSession.renewalDate = +new Date(renewal); this.automaticSession.renewalDate = this.automaticSession.renewalDate > 0 ? this.automaticSession.renewalDate : 0; } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ErrorParsingAISessionCookie, "Error parsing ai_session cookie, session will be reset: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } if (this.automaticSession.renewalDate == 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SessionRenewalDateIsZero, "AI session renewal date is 0, session will be reset."); } }; _SessionManager.prototype.renew = function () { var now = applicationinsights_common_1.DateTimeUtils.Now(); this.automaticSession.id = applicationinsights_common_1.Util.newId(); this.automaticSession.acquisitionDate = now; this.automaticSession.renewalDate = now; this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); // If this browser does not support local storage, fire an internal log to keep track of it at this point if (!applicationinsights_common_1.Util.canUseLocalStorage()) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserDoesNotSupportLocalStorage, "Browser does not support local storage. Session durations will be inaccurate."); } }; _SessionManager.prototype.setCookie = function (guid, acq, renewal) { // Set cookie to expire after the session expiry time passes or the session renewal deadline, whichever is sooner // Expiring the cookie will cause the session to expire even if the user isn't on the page var acquisitionExpiry = acq + this.config.sessionExpirationMs(); var renewalExpiry = renewal + this.config.sessionRenewalMs(); var cookieExpiry = new Date(); var cookie = [guid, acq, renewal]; if (acquisitionExpiry < renewalExpiry) { cookieExpiry.setTime(acquisitionExpiry); } else { cookieExpiry.setTime(renewalExpiry); } var cookieDomnain = this.config.cookieDomain ? this.config.cookieDomain() : null; applicationinsights_common_1.Util.setCookie(this._logger, 'ai_session', cookie.join('|') + ';expires=' + cookieExpiry.toUTCString(), cookieDomnain); this.cookieUpdatedTimestamp = applicationinsights_common_1.DateTimeUtils.Now(); }; _SessionManager.prototype.setStorage = function (guid, acq, renewal) { // Keep data in local storage to retain the last session id, allowing us to cleanly end the session when it expires // Browsers that don't support local storage won't be able to end sessions cleanly from the client // The server will notice this and end the sessions itself, with loss of accurate session duration applicationinsights_common_1.Util.setStorage(this._logger, 'ai_session', [guid, acq, renewal].join('|')); }; _SessionManager.acquisitionSpan = 86400000; // 24 hours in ms _SessionManager.renewalSpan = 1800000; // 30 minutes in ms _SessionManager.cookieUpdateInterval = 60000; // 1 minute in ms return _SessionManager; }()); exports._SessionManager = _SessionManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Session.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/User.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/User.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var User = /** @class */ (function () { function User(config, logger) { this._logger = logger; //get userId or create new one if none exists var cookie = applicationinsights_common_1.Util.getCookie(this._logger, User.userCookieName); if (cookie) { var params = cookie.split(User.cookieSeparator); if (params.length > 0) { this.id = params[0]; } } this.config = config; if (!this.id) { this.id = applicationinsights_common_1.Util.newId(); var date = new Date(); var acqStr = applicationinsights_common_1.Util.toISOStringForIE8(date); this.accountAcquisitionDate = acqStr; // without expiration, cookies expire at the end of the session // set it to 365 days from now // 365 * 24 * 60 * 60 * 1000 = 31536000000 date.setTime(date.getTime() + 31536000000); var newCookie = [this.id, acqStr]; var cookieDomain = this.config.cookieDomain ? this.config.cookieDomain() : undefined; applicationinsights_common_1.Util.setCookie(this._logger, User.userCookieName, newCookie.join(User.cookieSeparator) + ';expires=' + date.toUTCString(), cookieDomain); // If we have an ai_session in local storage this means the user actively removed our cookies. // We should respect their wishes and clear ourselves from local storage applicationinsights_common_1.Util.removeStorage(this._logger, 'ai_session'); } // We still take the account id from the ctor param for backward compatibility. // But if the the customer set the accountId through the newer setAuthenticatedUserContext API, we will override it. this.accountId = config.accountId ? config.accountId() : undefined; // Get the auth user id and account id from the cookie if exists // Cookie is in the pattern: | var authCookie = applicationinsights_common_1.Util.getCookie(this._logger, User.authUserCookieName); if (authCookie) { authCookie = decodeURI(authCookie); var authCookieString = authCookie.split(User.cookieSeparator); if (authCookieString[0]) { this.authenticatedId = authCookieString[0]; } if (authCookieString.length > 1 && authCookieString[1]) { this.accountId = authCookieString[1]; } } } /** * Sets the authenticated user id and the account id in this session. * * @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service. * @param accountId {string} - An optional string to represent the account associated with the authenticated user. */ User.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) { if (storeInCookie === void 0) { storeInCookie = false; } // Validate inputs to ensure no cookie control characters. var isInvalidInput = !this.validateUserInput(authenticatedUserId) || (accountId && !this.validateUserInput(accountId)); if (isInvalidInput) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SetAuthContextFailedAccountName, "Setting auth user context failed. " + "User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.", true); return; } // Create cookie string. this.authenticatedId = authenticatedUserId; var authCookie = this.authenticatedId; if (accountId) { this.accountId = accountId; authCookie = [this.authenticatedId, this.accountId].join(User.cookieSeparator); } if (storeInCookie) { // Set the cookie. No expiration date because this is a session cookie (expires when browser closed). // Encoding the cookie to handle unexpected unicode characters. applicationinsights_common_1.Util.setCookie(this._logger, User.authUserCookieName, encodeURI(authCookie), this.config.cookieDomain()); } }; /** * Clears the authenticated user id and the account id from the user context. * @returns {} */ User.prototype.clearAuthenticatedUserContext = function () { this.authenticatedId = null; this.accountId = null; applicationinsights_common_1.Util.deleteCookie(this._logger, User.authUserCookieName); }; User.prototype.validateUserInput = function (id) { // Validate: // 1. Id is a non-empty string. // 2. It does not contain special characters for cookies. if (typeof id !== 'string' || !id || id.match(/,|;|=| |\|/)) { return false; } return true; }; User.cookieSeparator = '|'; User.userCookieName = 'ai_user'; User.authUserCookieName = 'ai_authUser'; return User; }()); exports.User = User; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=User.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var HashCodeScoreGenerator = /** @class */ (function () { function HashCodeScoreGenerator() { } HashCodeScoreGenerator.prototype.getHashCodeScore = function (key) { var score = this.getHashCode(key) / HashCodeScoreGenerator.INT_MAX_VALUE; return score * 100; }; HashCodeScoreGenerator.prototype.getHashCode = function (input) { if (input == "") { return 0; } while (input.length < HashCodeScoreGenerator.MIN_INPUT_LENGTH) { input = input.concat(input); } // 5381 is a magic number: http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function var hash = 5381; for (var i = 0; i < input.length; ++i) { hash = ((hash << 5) + hash) + input.charCodeAt(i); // 'hash' is of number type which means 53 bit integer (http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types-number-type) // 'hash & hash' will keep it 32 bit integer - just to make it clearer what the result is. hash = hash & hash; } return Math.abs(hash); }; // We're using 32 bit math, hence max value is (2^31 - 1) HashCodeScoreGenerator.INT_MAX_VALUE = 2147483647; // (Magic number) DJB algorithm can't work on shorter strings (results in poor distribution HashCodeScoreGenerator.MIN_INPUT_LENGTH = 8; return HashCodeScoreGenerator; }()); exports.HashCodeScoreGenerator = HashCodeScoreGenerator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=HashCodeScoreGenerator.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** * PropertiesPlugin.ts * @copyright Microsoft 2018 */ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! ./Context/Session */ "./node_modules/applicationinsights-properties-js/bundle/Context/Session.js"), __webpack_require__(/*! ./Context/Application */ "./node_modules/applicationinsights-properties-js/bundle/Context/Application.js"), __webpack_require__(/*! ./Context/Device */ "./node_modules/applicationinsights-properties-js/bundle/Context/Device.js"), __webpack_require__(/*! ./Context/Internal */ "./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js"), __webpack_require__(/*! ./Context/Location */ "./node_modules/applicationinsights-properties-js/bundle/Context/Location.js"), __webpack_require__(/*! ./Context/Operation */ "./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js"), __webpack_require__(/*! ./Context/User */ "./node_modules/applicationinsights-properties-js/bundle/Context/User.js"), __webpack_require__(/*! ./Context/Sample */ "./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, applicationinsights_common_1, Session_1, Application_1, Device_1, Internal_1, Location_1, Operation_1, User_1, Sample_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PropertiesPlugin = /** @class */ (function () { function PropertiesPlugin() { this.priority = 170; this.identifier = "AppInsightsPropertiesPlugin"; } PropertiesPlugin.prototype.initialize = function (config, core, extensions) { var extensionConfig = config.extensions && config.extensions[this.identifier] ? config.extensions[this.identifier] : {}; this._extensionConfig = { instrumentationKey: function () { return extensionConfig.instrumentationKey; }, accountId: function () { return extensionConfig.accountId; }, sessionRenewalMs: function () { return extensionConfig.sessionRenewalMs; }, sampleRate: function () { return extensionConfig.sampleRate; }, sessionExpirationMs: function () { return extensionConfig.sessionExpirationMs; }, cookieDomain: function () { return extensionConfig.cookieDomain; }, sdkExtension: function () { return extensionConfig.sdkExtension; }, isBrowserLinkTrackingEnabled: function () { return extensionConfig.isBrowserLinkTrackingEnabled; }, appId: function () { return extensionConfig.appId; } }; if (typeof window !== 'undefined') { this._sessionManager = new Session_1._SessionManager(this._extensionConfig, core.logger); this.application = new Application_1.Application(); this.device = new Device_1.Device(); this.internal = new Internal_1.Internal(this._extensionConfig); this.location = new Location_1.Location(); this.user = new User_1.User(this._extensionConfig, core.logger); this.operation = new Operation_1.Operation(); this.session = new Session_1.Session(); this.sample = new Sample_1.Sample(this._extensionConfig.sampleRate(), core.logger); } }; /** * Add Part A fields to the event * @param event The event that needs to be processed */ PropertiesPlugin.prototype.processTelemetry = function (event) { if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(event)) { // TODO(barustum): throw an internal event once we have support for internal logging } else { // if the event is not sampled in, do not bother going through the pipeline if (this.sample.isSampledIn(event)) { // If the envelope is PageView, reset the internal message count so that we can send internal telemetry for the new page. if (event.name === applicationinsights_common_1.PageView.envelopeType) { // TODO(barustum): resetInternalMessageCount once we have support for internal logging //_InternalLogging.resetInternalMessageCount(); } if (this.session) { // If customer did not provide custom session id update the session manager if (typeof this.session.id !== "string") { this._sessionManager.update(); } } this._processTelemetryInternal(event); } if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(event); } } }; /** * Sets the next plugin that comes after this plugin * @param nextPlugin The next plugin */ PropertiesPlugin.prototype.setNextPlugin = function (nextPlugin) { this._nextPlugin = nextPlugin; }; PropertiesPlugin.prototype._processTelemetryInternal = function (event) { var tagsItem = {}; if (this.session) { // If customer set id, apply his context; otherwise apply context generated from cookies if (typeof this.session.id === "string") { PropertiesPlugin._applySessionContext(tagsItem, this.session); } else { PropertiesPlugin._applySessionContext(tagsItem, this._sessionManager.automaticSession); } } // set part A fields PropertiesPlugin._applyApplicationContext(tagsItem, this.application); PropertiesPlugin._applyDeviceContext(tagsItem, this.device); PropertiesPlugin._applyInternalContext(tagsItem, this.internal); PropertiesPlugin._applyLocationContext(tagsItem, this.location); PropertiesPlugin._applySampleContext(tagsItem, this.sample); PropertiesPlugin._applyUserContext(tagsItem, this.user); PropertiesPlugin._applyOperationContext(tagsItem, this.operation); event.tags.push(tagsItem); }; PropertiesPlugin._applySessionContext = function (tags, sessionContext) { if (sessionContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof sessionContext.id === "string") { tags[tagKeys.sessionId] = sessionContext.id; } if (typeof sessionContext.isFirst !== "undefined") { tags[tagKeys.sessionIsFirst] = sessionContext.isFirst; } } }; PropertiesPlugin._applyApplicationContext = function (tagsItem, appContext) { if (appContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof appContext.ver === "string") { tagsItem[tagKeys.applicationVersion] = appContext.ver; } if (typeof appContext.build === "string") { tagsItem[tagKeys.applicationBuild] = appContext.build; } } }; PropertiesPlugin._applyDeviceContext = function (tagsItem, deviceContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (deviceContext) { if (typeof deviceContext.id === "string") { tagsItem[tagKeys.deviceId] = deviceContext.id; } if (typeof deviceContext.ip === "string") { tagsItem[tagKeys.deviceIp] = deviceContext.ip; } if (typeof deviceContext.language === "string") { tagsItem[tagKeys.deviceLanguage] = deviceContext.language; } if (typeof deviceContext.locale === "string") { tagsItem[tagKeys.deviceLocale] = deviceContext.locale; } if (typeof deviceContext.model === "string") { tagsItem[tagKeys.deviceModel] = deviceContext.model; } if (typeof deviceContext.network !== "undefined") { tagsItem[tagKeys.deviceNetwork] = deviceContext.network; } if (typeof deviceContext.oemName === "string") { tagsItem[tagKeys.deviceOEMName] = deviceContext.oemName; } if (typeof deviceContext.os === "string") { tagsItem[tagKeys.deviceOS] = deviceContext.os; } if (typeof deviceContext.osversion === "string") { tagsItem[tagKeys.deviceOSVersion] = deviceContext.osversion; } if (typeof deviceContext.resolution === "string") { tagsItem[tagKeys.deviceScreenResolution] = deviceContext.resolution; } if (typeof deviceContext.type === "string") { tagsItem[tagKeys.deviceType] = deviceContext.type; } } }; PropertiesPlugin._applyInternalContext = function (tagsItem, internalContext) { if (internalContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof internalContext.agentVersion === "string") { tagsItem[tagKeys.internalAgentVersion] = internalContext.agentVersion; } if (typeof internalContext.sdkVersion === "string") { tagsItem[tagKeys.internalSdkVersion] = internalContext.sdkVersion; } } }; PropertiesPlugin._applyLocationContext = function (tagsItem, locationContext) { if (locationContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof locationContext.ip === "string") { tagsItem[tagKeys.locationIp] = locationContext.ip; } } }; PropertiesPlugin._applySampleContext = function (tagsItem, sampleContext) { if (sampleContext) { tagsItem.sampleRate = sampleContext.sampleRate; } }; PropertiesPlugin._applyOperationContext = function (tagsItem, operationContext) { if (operationContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof operationContext.id === "string") { tagsItem[tagKeys.operationId] = operationContext.id; } if (typeof operationContext.name === "string") { tagsItem[tagKeys.operationName] = operationContext.name; } if (typeof operationContext.parentId === "string") { tagsItem[tagKeys.operationParentId] = operationContext.parentId; } if (typeof operationContext.rootId === "string") { tagsItem[tagKeys.operationRootId] = operationContext.rootId; } if (typeof operationContext.syntheticSource === "string") { tagsItem[tagKeys.operationSyntheticSource] = operationContext.syntheticSource; } } }; PropertiesPlugin._applyUserContext = function (tagsItem, userContext) { if (userContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof userContext.accountId === "string") { tagsItem[tagKeys.userAccountId] = userContext.accountId; } if (typeof userContext.agent === "string") { tagsItem[tagKeys.userAgent] = userContext.agent; } if (typeof userContext.id === "string") { tagsItem[tagKeys.userId] = userContext.id; } if (typeof userContext.authenticatedId === "string") { tagsItem[tagKeys.userAuthUserId] = userContext.authenticatedId; } if (typeof userContext.storeRegion === "string") { tagsItem[tagKeys.userStoreRegion] = userContext.storeRegion; } } }; return PropertiesPlugin; }()); exports.default = PropertiesPlugin; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PropertiesPlugin.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./HashCodeScoreGenerator */ "./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, HashCodeScoreGenerator_1, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var SamplingScoreGenerator = /** @class */ (function () { function SamplingScoreGenerator() { this.hashCodeGeneragor = new HashCodeScoreGenerator_1.HashCodeScoreGenerator(); } SamplingScoreGenerator.prototype.getSamplingScore = function (envelope) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); var score = 0; if (envelope.tags[tagKeys.userId]) { score = this.hashCodeGeneragor.getHashCodeScore(envelope.tags[tagKeys.userId]); } else if (envelope.tags[tagKeys.operationId]) { score = this.hashCodeGeneragor.getHashCodeScore(envelope.tags[tagKeys.operationId]); } else { // tslint:disable-next-line:insecure-random score = Math.random(); } return score; }; return SamplingScoreGenerator; }()); exports.SamplingScoreGenerator = SamplingScoreGenerator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SamplingScoreGenerator.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./PropertiesPlugin */ "./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PropertiesPlugin_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PropertiesPlugin = PropertiesPlugin_1.default; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-properties-js.js.map /***/ }), /***/ 0: /*!**********************************!*\ !*** multi ./amd/bundle/Init.js ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(/*! ./amd/bundle/Init.js */"./amd/bundle/Init.js"); /***/ }) /******/ }); }); //# sourceMappingURL=aisdk.0.0.17.js.map ================================================ FILE: AISKU/dist-history/aisdk.0.0.18.js ================================================ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ "./amd/bundle/Init.js": /*!****************************!*\ !*** ./amd/bundle/Init.js ***! \****************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-analytics-js */ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js"), __webpack_require__(/*! ./Initialization */ "./amd/bundle/Initialization.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_analytics_js_1, Initialization_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; //should be global function that should load as soon as SDK loads try { // E2E sku on load initializes core and pipeline using snippet as input for configuration var aiName; if (typeof window !== "undefined" && typeof JSON !== "undefined") { // get snippet or initialize to an empty object // get sdk instance name should not conflict if page uses existing sdk for a layer of instrumentation aiName = window["appInsightsSDK"]; if (window[aiName] === undefined) { // if no snippet is present, initialize default values applicationinsights_analytics_js_1.ApplicationInsights.appInsightsDefaultConfig = Initialization_1.Initialization.getDefaultConfig(); } else { if (window[aiName].initialize) { // this is the typical case for browser+snippet var snippet = window[aiName] || {}; // overwrite snippet with full appInsights var initialization = new Initialization_1.Initialization(snippet); var appInsightsLocal = initialization.loadAppInsights(); // apply full appInsights to the global instance that was initialized in the snippet for (var field in appInsightsLocal) { snippet[field] = appInsightsLocal[field]; } // Empty queue of all api calls logged prior to sdk download initialization.emptyQueue(); initialization.addHousekeepingBeforeUnload(appInsightsLocal); } } } } catch (e) { // TODO: Find better place to warn to console when SDK initialization fails if (console) { console.warn('Failed to initialize AppInsights JS SDK for instance ' + aiName + e.message); } } }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./amd/bundle/Initialization.js": /*!**************************************!*\ !*** ./amd/bundle/Initialization.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-analytics-js */ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-channel-js */ "./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js"), __webpack_require__(/*! applicationinsights-properties-js */ "./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js"), __webpack_require__(/*! applicationinsights-dependencies-js */ "./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, applicationinsights_analytics_js_1, applicationinsights_common_1, applicationinsights_channel_js_1, applicationinsights_properties_js_1, applicationinsights_dependencies_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; ; var Initialization = /** @class */ (function () { function Initialization(snippet) { // initialize the queue and config in case they are undefined snippet.queue = snippet.queue || []; var config = snippet.config || {}; // ensure instrumentationKey is specified if (config && !config.instrumentationKey) { config = snippet; applicationinsights_analytics_js_1.ApplicationInsights.Version = "2.0.0"; } this.appInsights = new applicationinsights_analytics_js_1.ApplicationInsights(); // set default values using config passed through snippet config = Initialization.getDefaultConfig(config, this.appInsights.identifier); this.properties = new applicationinsights_properties_js_1.PropertiesPlugin(); this.dependencies = new applicationinsights_dependencies_js_1.AjaxPlugin(); this.snippet = snippet; this.config = config; } // Analytics Plugin Initialization.prototype.trackPageView = function (pageView, customProperties) { this.appInsights.trackPageView(pageView, customProperties); }; Initialization.prototype.trackPageViewPerformance = function (pageViewPerformance, customProperties) { var item = new applicationinsights_common_1.PageViewPerformance(this.core.logger, pageViewPerformance.name, pageViewPerformance.url, undefined, customProperties); this.appInsights.sendPageViewPerformanceInternal(item, customProperties); }; Initialization.prototype.trackException = function (exception, customProperties) { this.appInsights.trackException(exception, customProperties); }; Initialization.prototype._onerror = function (exception) { this.appInsights._onerror(exception); }; Initialization.prototype.trackTrace = function (trace, customProperties) { this.appInsights.trackTrace(trace, customProperties); }; Initialization.prototype.trackMetric = function (metric, customProperties) { this.appInsights.trackMetric(metric, customProperties); }; Initialization.prototype.startTrackPage = function (name) { this.appInsights.startTrackPage(name); }; Initialization.prototype.stopTrackPage = function (name, url, customProperties) { this.appInsights.stopTrackPage(name, url, customProperties); }; Initialization.prototype.addTelemetryInitializer = function (telemetryInitializer) { return this.appInsights.addTelemetryInitializer(telemetryInitializer); }; // Properties Plugin Initialization.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) { if (storeInCookie === void 0) { storeInCookie = false; } this.properties.user.setAuthenticatedUserContext(authenticatedUserId, accountId, storeInCookie); }; Initialization.prototype.clearAuthenticatedUserContext = function () { this.properties.user.clearAuthenticatedUserContext(); }; // Dependencies Plugin Initialization.prototype.trackDependencyData = function (dependency, customProperties, systemProperties) { this.dependencies.trackDependencyData(dependency, customProperties, systemProperties); }; Initialization.prototype.loadAppInsights = function () { this.core = new applicationinsights_core_js_1.AppInsightsCore(); var extensions = []; var appInsightsChannel = new applicationinsights_channel_js_1.Sender(); extensions.push(appInsightsChannel); extensions.push(this.properties); extensions.push(this.dependencies); extensions.push(this.appInsights); // initialize core this.core.initialize(this.config, extensions); return this; }; Initialization.prototype.emptyQueue = function () { // call functions that were queued before the main script was loaded try { if (applicationinsights_common_1.Util.isArray(this.snippet.queue)) { // note: do not check length in the for-loop conditional in case something goes wrong and the stub methods are not overridden. var length = this.snippet.queue.length; for (var i = 0; i < length; i++) { var call = this.snippet.queue[i]; call(); } this.snippet.queue = undefined; delete this.snippet.queue; } } catch (exception) { var properties = {}; if (exception && typeof exception.toString === "function") { properties.exception = exception.toString(); } // need from core // Microsoft.ApplicationInsights._InternalLogging.throwInternal( // LoggingSeverity.WARNING, // _InternalMessageId.FailedToSendQueuedTelemetry, // "Failed to send queued telemetry", // properties); } }; Initialization.prototype.pollInteralLogs = function (appInsightsInstance) { // return setInterval(() => { // var queue: Array<_InternalLogMessage> = ApplicationInsights._InternalLogging.queue; // var length = queue.length; // for (var i = 0; i < length; i++) { // appInsightsInstance.trackTrace(queue[i].message); // } // queue.length = 0; // }, this.config.diagnosticLogInterval); }; Initialization.prototype.addHousekeepingBeforeUnload = function (appInsightsInstance) { // Add callback to push events when the user navigates away if (!appInsightsInstance.appInsights.config.disableFlushOnBeforeUnload && ('onbeforeunload' in window)) { var performHousekeeping = function () { // Adds the ability to flush all data before the page unloads. // Note: This approach tries to push an async request with all the pending events onbeforeunload. // Firefox does not respect this.Other browsers DO push out the call with < 100% hit rate. // Telemetry here will help us analyze how effective this approach is. // Another approach would be to make this call sync with a acceptable timeout to reduce the // impact on user experience. //appInsightsInstance.context._sender.triggerSend(); appInsightsInstance.appInsights.core.getTransmissionControls().forEach(function (queues) { queues.forEach(function (channel) { return channel.flush(true); }); }); // Back up the current session to local storage // This lets us close expired sessions after the cookies themselves expire // Todo: move this against interface behavior if (this.core.extensions["AppInsightsPropertiesPlugin"] && this.core.extensions["AppInsightsPropertiesPlugin"]._sessionManager) { this.core.extensions["AppInsightsPropertiesPlugin"]._sessionManager.backup(); } }; if (!applicationinsights_common_1.Util.addEventHandler('beforeunload', performHousekeeping)) { this.core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedToAddHandlerForOnBeforeUnload, 'Could not add handler for beforeunload'); } } }; Initialization.getDefaultConfig = function (configuration, identifier) { if (!configuration) { configuration = {}; } if (configuration) { identifier = identifier ? identifier : "ApplicationInsightsAnalytics"; } // Undefined checks if (!configuration.extensionConfig) { configuration.extensionConfig = {}; } if (!configuration.extensionConfig[identifier]) { configuration.extensionConfig[identifier] = {}; } var extensionConfig = configuration.extensionConfig[identifier]; // ref to main config // set default values configuration.endpointUrl = configuration.endpointUrl || "https://dc.services.visualstudio.com/v2/track"; extensionConfig.sessionRenewalMs = 30 * 60 * 1000; extensionConfig.sessionExpirationMs = 24 * 60 * 60 * 1000; extensionConfig.enableDebug = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.enableDebug); extensionConfig.disableExceptionTracking = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableExceptionTracking); extensionConfig.consoleLoggingLevel = extensionConfig.consoleLoggingLevel || 1; // Show only CRITICAL level extensionConfig.telemetryLoggingLevel = extensionConfig.telemetryLoggingLevel || 0; // Send nothing extensionConfig.diagnosticLogInterval = extensionConfig.diagnosticLogInterval || 10000; extensionConfig.autoTrackPageVisitTime = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.autoTrackPageVisitTime); if (isNaN(extensionConfig.samplingPercentage) || extensionConfig.samplingPercentage <= 0 || extensionConfig.samplingPercentage >= 100) { extensionConfig.samplingPercentage = 100; } extensionConfig.disableAjaxTracking = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableAjaxTracking); extensionConfig.maxAjaxCallsPerView = !isNaN(extensionConfig.maxAjaxCallsPerView) ? extensionConfig.maxAjaxCallsPerView : 500; extensionConfig.disableCorrelationHeaders = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableCorrelationHeaders); extensionConfig.correlationHeaderExcludedDomains = extensionConfig.correlationHeaderExcludedDomains || [ "*.blob.core.windows.net", "*.blob.core.chinacloudapi.cn", "*.blob.core.cloudapi.de", "*.blob.core.usgovcloudapi.net" ]; extensionConfig.disableFlushOnBeforeUnload = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableFlushOnBeforeUnload); extensionConfig.isCookieUseDisabled = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.isCookieUseDisabled); extensionConfig.isStorageUseDisabled = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.isStorageUseDisabled); extensionConfig.isBrowserLinkTrackingEnabled = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.isBrowserLinkTrackingEnabled); extensionConfig.enableCorsCorrelation = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.enableCorsCorrelation); return configuration; }; return Initialization; }()); exports.Initialization = Initialization; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** * ApplicationInsights.ts * @copyright Microsoft 2018 */ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./Telemetry/PageViewManager */ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1, PageViewManager_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; var durationProperty = "duration"; var ApplicationInsights = /** @class */ (function () { function ApplicationInsights() { this.identifier = "ApplicationInsightsAnalytics"; this.priority = 160; // take from reserved priority range 100- 200 this._isInitialized = false; // Counts number of trackAjax invokations. // By default we only monitor X ajax call per view to avoid too much load. // Default value is set in config. // This counter keeps increasing even after the limit is reached. this._trackAjaxAttempts = 0; this.initialize = this._initialize.bind(this); } ApplicationInsights.prototype.processTelemetry = function (env) { var doNotSendItem = false; try { var telemetryInitializersCount = this._telemetryInitializers.length; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = this._telemetryInitializers[i]; if (telemetryInitializer) { if (telemetryInitializer.apply(null, [env]) === false) { doNotSendItem = true; break; } } } } catch (e) { doNotSendItem = true; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryInitializerFailed, "One of telemetry initializers failed, telemetry item will not be sent: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }, true); } if (!doNotSendItem && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(env); } }; ApplicationInsights.prototype.setNextPlugin = function (next) { this._nextPlugin = next; }; /** * @description Log a diagnostic message * @param {ITraceTelemetry} trace * @param {{[key: string]: any}} [customProperties] * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackTrace = function (trace, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(trace, applicationinsights_common_1.Trace.dataType, applicationinsights_common_1.Trace.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TrackTraceFailed, "trackTrace failed, trace will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * @description Log a numeric value that is not associated with a specific event. Typically * used to send regular reports of performance indicators. To send single measurement, just * use the name and average fields of {@link IMetricTelemetry}. If you take measurements * frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements * and sending the resulting average at intervals * @param {IMetricTelemetry} metric input object argument. Only name and average are mandatory. * @param {{[key: string]: any}} customProperties additional data used to filter metrics in the * portal. Defaults to empty. * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackMetric = function (metric, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(metric, applicationinsights_common_1.Metric.dataType, applicationinsights_common_1.Metric.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackMetricFailed, "trackMetric failed, metric will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs that a page or other item was viewed. * @param IPageViewTelemetry The string you used as the name in startTrackPage. Defaults to the document title. * @param customProperties Additional data used to filter events and metrics. Defaults to empty. If a user wants * to provide a custom duration, it'll have to be in customProperties */ ApplicationInsights.prototype.trackPageView = function (pageView, customProperties) { try { this._pageViewManager.trackPageView(pageView, customProperties); if (this.config.autoTrackPageVisitTime) { this._pageVisitTimeManager.trackPreviousPageVisit(pageView.name, pageView.uri); } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackPVFailed, "trackPageView failed, page view will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Create a page view telemetry item and send it to the SDK pipeline through the core.track API * @param pageView Page view item to be sent * @param properties Custom properties (Part C) that a user can add to the telemetry item * @param systemProperties System level properties (Part A) that a user can add to the telemetry item */ ApplicationInsights.prototype.sendPageViewInternal = function (pageView, properties, systemProperties) { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(pageView, applicationinsights_common_1.PageView.dataType, applicationinsights_common_1.PageView.envelopeType, this._logger, properties, systemProperties); // set instrumentation key this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); // reset ajaxes counter this._trackAjaxAttempts = 0; }; ApplicationInsights.prototype.sendPageViewPerformanceInternal = function (pageViewPerformance, properties) { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(pageViewPerformance, applicationinsights_common_1.PageViewPerformance.dataType, applicationinsights_common_1.PageViewPerformance.envelopeType, this._logger, properties); // set instrumentation key this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); }; /** * Starts timing how long the user views a page or other item. Call this when the page opens. * This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes. * @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title. */ ApplicationInsights.prototype.startTrackPage = function (name) { try { if (typeof name !== "string") { name = window.document && window.document.title || ""; } this._pageTracking.start(name); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.StartTrackFailed, "startTrackPage failed, page view may not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs how long a page or other item was visible, after {@link startTrackPage}. Call this when the page closes. * @param name The string you used as the name in startTrackPage. Defaults to the document title. * @param url A relative or absolute URL that identifies the page or other item. Defaults to the window location. * @param properties Additional data used to filter pages and metrics in the portal. Defaults to empty. * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric */ ApplicationInsights.prototype.stopTrackPage = function (name, url, properties) { try { if (typeof name !== "string") { name = window.document && window.document.title || ""; } if (typeof url !== "string") { url = window.location && window.location.href || ""; } this._pageTracking.stop(name, url, properties); if (this.config.autoTrackPageVisitTime) { this._pageVisitTimeManager.trackPreviousPageVisit(name, url); } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.StopTrackFailed, "stopTrackPage failed, page view will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Log an exception you have caught. * * @param {IExceptionTelemetry} exception Object which contains exception to be sent * @param {{[key: string]: any}} customProperties Additional data used to filter pages and metrics in the portal. Defaults to empty. * * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric. * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackException = function (exception, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(exception, applicationinsights_common_1.Exception.dataType, applicationinsights_common_1.Exception.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackExceptionFailed, "trackException failed, exception will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * @description Custom error handler for Application Insights Analytics * @param {IAutoExceptionTelemetry} exception * @memberof ApplicationInsights */ ApplicationInsights.prototype._onerror = function (exception) { try { var properties = { url: (exception && exception.url) || document.URL, lineNumber: exception.lineNumber, columnNumber: exception.columnNumber, message: exception.message }; if (applicationinsights_common_1.Util.isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception.error)) { this._sendCORSException(properties.url); } else { if (!applicationinsights_common_1.Util.isError(exception.error)) { var stack = "window.onerror@" + properties.url + ":" + exception.lineNumber + ":" + (exception.columnNumber || 0); exception.error = new Error(exception.message); exception.error.stack = stack; } this.trackException({ error: exception.error, severityLevel: applicationinsights_common_1.SeverityLevel.Error }, properties); } } catch (e) { var errorString = exception.error ? (exception.error.name + ", " + exception.error.message) : "null"; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ExceptionWhileLoggingError, "_onError threw exception while logging error, error will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e), errorString: errorString }); } }; ApplicationInsights.prototype.addTelemetryInitializer = function (telemetryInitializer) { this._telemetryInitializers.push(telemetryInitializer); }; ApplicationInsights.prototype._initialize = function (config, core, extensions) { var _this = this; if (this._isInitialized) { return; } if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(core)) { throw Error("Error initializing"); } this.core = core; this._logger = core.logger; this._globalconfig = { instrumentationKey: config.instrumentationKey, endpointUrl: config.endpointUrl }; this.config = config.extensionConfig && config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {}; // load default values if specified var defaults = ApplicationInsights.appInsightsDefaultConfig; if (defaults !== undefined) { if (defaults.extensions && defaults.extensions[this.identifier]) { for (var field in defaults.extensions[this.identifier]) { // for each unspecified field, set the default value if (this.config[field] === undefined) { this.config[field] = defaults[field]; } } } if (this._globalconfig) { for (var field in defaults) { if (this._globalconfig[field] === undefined) { this._globalconfig[field] = defaults[field]; } } } } // Todo: move this out of static state if (this.config.isCookieUseDisabled) { applicationinsights_common_1.Util.disableCookies(); } // Todo: move this out of static state if (this.config.isStorageUseDisabled) { applicationinsights_common_1.Util.disableStorage(); } var configGetters = { instrumentationKey: function () { return config.instrumentationKey; }, accountId: function () { return _this.config.accountId; }, sessionRenewalMs: function () { return _this.config.sessionRenewalMs; }, sessionExpirationMs: function () { return _this.config.sessionExpirationMs; }, sampleRate: function () { return _this.config.samplingPercentage; }, cookieDomain: function () { return _this.config.cookieDomain; }, sdkExtension: function () { return _this.config.sdkExtension; }, isBrowserLinkTrackingEnabled: function () { return _this.config.isBrowserLinkTrackingEnabled; }, appId: function () { return _this.config.appId; } }; this._pageViewManager = new PageViewManager_1.PageViewManager(this, this.config.overridePageViewDuration, this.core); this._telemetryInitializers = []; this._addDefaultTelemetryInitializers(configGetters); // initialize page view timing this._pageTracking = new Timing(this._logger, "trackPageView"); this._pageTracking.action = function (name, url, duration, properties) { var pageViewItem = { name: name, uri: url }; // duration must be a custom property in order for the collector to extract it if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(properties)) { properties = {}; } properties[durationProperty] = duration; _this.sendPageViewInternal(pageViewItem, properties); }; if (this.config.disableExceptionTracking === false && !this.config.autoExceptionInstrumented) { // We want to enable exception auto collection and it has not been done so yet var onerror_1 = "onerror"; var originalOnError_1 = window[onerror_1]; var instance_1 = this; window.onerror = function (message, url, lineNumber, columnNumber, error) { var handled = originalOnError_1 && originalOnError_1(message, url, lineNumber, columnNumber, error); if (handled !== true) { instance_1._onerror({ message: message, url: url, lineNumber: lineNumber, columnNumber: columnNumber, error: error }); } return handled; }; this.config.autoExceptionInstrumented = true; } this._isInitialized = true; }; ApplicationInsights.prototype._addDefaultTelemetryInitializers = function (configGetters) { if (!configGetters.isBrowserLinkTrackingEnabled()) { var browserLinkPaths_1 = ['/browserLinkSignalR/', '/__browserLink/']; var dropBrowserLinkRequests = function (envelope) { if (envelope.baseType === applicationinsights_common_1.RemoteDependencyData.dataType) { var remoteData = envelope.baseData; if (remoteData) { for (var i = 0; i < browserLinkPaths_1.length; i++) { if (remoteData.absoluteUrl && remoteData.absoluteUrl.indexOf(browserLinkPaths_1[i]) >= 0) { return false; } } } } return true; }; this._addTelemetryInitializer(dropBrowserLinkRequests); } }; ApplicationInsights.prototype._addTelemetryInitializer = function (telemetryInitializer) { this._telemetryInitializers.push(telemetryInitializer); }; ApplicationInsights.prototype._sendCORSException = function (url) { var exception = { message: "Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.", url: url, lineNumber: 0, columnNumber: 0, error: undefined }; var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(exception, applicationinsights_common_1.Exception.dataType, applicationinsights_common_1.Exception.envelopeType, this._logger, { url: url }); this.core.track(telemetryItem); }; // Mutate telemetryItem inplace to add boilerplate iKey & name info ApplicationInsights.prototype._setTelemetryNameAndIKey = function (telemetryItem) { telemetryItem.instrumentationKey = this._globalconfig.instrumentationKey; var iKeyNoDashes = this._globalconfig.instrumentationKey.replace(/-/g, ""); telemetryItem.name = telemetryItem.name.replace("{0}", iKeyNoDashes); }; ApplicationInsights.Version = "2.0.1-beta"; return ApplicationInsights; }()); exports.ApplicationInsights = ApplicationInsights; /** * Used to record timed events and page views. */ var Timing = /** @class */ (function () { function Timing(logger, name) { this._name = name; this._events = {}; this._logger = logger; } Timing.prototype.start = function (name) { if (typeof this._events[name] !== "undefined") { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StartCalledMoreThanOnce, "start was called more than once for this event without calling stop.", { name: this._name, key: name }, true); } this._events[name] = +new Date; }; Timing.prototype.stop = function (name, url, properties) { var start = this._events[name]; if (isNaN(start)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StopCalledWithoutStart, "stop was called without a corresponding start.", { name: this._name, key: name }, true); } else { var end = +new Date; var duration = applicationinsights_common_1.PageViewPerformance.getDuration(start, end); this.action(name, url, duration, properties); } delete this._events[name]; this._events[name] = undefined; }; return Timing; }()); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ApplicationInsights.js.map /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js ***! \*********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Class encapsulates sending page views and page view performance telemetry. */ var PageViewManager = /** @class */ (function () { function PageViewManager(appInsights, overridePageViewDuration, core) { this.pageViewPerformanceSent = false; this.overridePageViewDuration = false; this.overridePageViewDuration = overridePageViewDuration; this.appInsights = appInsights; if (core) { this._channel = function () { return (core.getTransmissionControls()); }; this._logger = core.logger; } } /** * Currently supported cases: * 1) (default case) track page view called with default parameters, overridePageViewDuration = false. Page view is sent with page view performance when navigation timing data is available. * a. If navigation timing is not supported then page view is sent right away with undefined duration. Page view performance is not sent. * 2) overridePageViewDuration = true, custom duration provided. Custom duration is used, page view sends right away. * 3) overridePageViewDuration = true, custom duration NOT provided. Page view is sent right away, duration is time spent from page load till now (or undefined if navigation timing is not supported). * 4) overridePageViewDuration = false, custom duration is provided. Page view is sent right away with custom duration. * * In all cases page view performance is sent once (only for the 1st call of trackPageView), or not sent if navigation timing is not supported. */ PageViewManager.prototype.trackPageView = function (pageView, customProperties) { var _this = this; var name = pageView.name; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(name) || typeof name !== "string") { pageView.name = window.document && window.document.title || ""; } var uri = pageView.uri; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(uri) || typeof uri !== "string") { pageView.uri = window.location && window.location.href || ""; } // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user // do not provide the duration, set duration to undefined // Also this is case 4 if (!applicationinsights_common_1.PageViewPerformance.isPerformanceTimingSupported()) { this.appInsights.sendPageViewInternal(pageView, customProperties); this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing) this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.NavigationTimingNotSupported, "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info."); return; } var pageViewSent = false; var customDuration = undefined; // if the performance timing is supported by the browser, calculate the custom duration var start = applicationinsights_common_1.PageViewPerformance.getPerformanceTiming().navigationStart; customDuration = applicationinsights_common_1.PageViewPerformance.getDuration(start, +new Date); if (!applicationinsights_common_1.PageViewPerformance.shouldCollectDuration(customDuration)) { customDuration = undefined; } // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier var duration = undefined; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties.duration)) { duration = customProperties.duration; } if (this.overridePageViewDuration || !isNaN(duration)) { if (isNaN(duration)) { // case 3 if (!customProperties) { customProperties = {}; } customProperties["duration"] = customDuration; } // case 2 this.appInsights.sendPageViewInternal(pageView, customProperties); this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); pageViewSent = true; } // now try to send the page view performance telemetry var maxDurationLimit = 60000; if (!customProperties) { customProperties = {}; } var handle = setInterval((function () { try { if (applicationinsights_common_1.PageViewPerformance.isPerformanceTimingDataReady()) { clearInterval(handle); var pageViewPerformance = new applicationinsights_common_1.PageViewPerformance(_this._logger, name, uri, null); if (!pageViewPerformance.getIsValid() && !pageViewSent) { // If navigation timing gives invalid numbers, then go back to "override page view duration" mode. // That's the best value we can get that makes sense. customProperties["duration"] = customDuration; _this.appInsights.sendPageViewInternal(pageView, customProperties); _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } else { if (!pageViewSent) { customProperties["duration"] = pageViewPerformance.getDurationMs(); _this.appInsights.sendPageViewInternal(pageView, customProperties); } if (!_this.pageViewPerformanceSent) { _this.appInsights.sendPageViewPerformanceInternal(pageViewPerformance, customProperties); _this.pageViewPerformanceSent = true; } _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } } else if (applicationinsights_common_1.PageViewPerformance.getDuration(start, +new Date) > maxDurationLimit) { // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready clearInterval(handle); if (!pageViewSent) { customProperties["duration"] = maxDurationLimit; _this.appInsights.sendPageViewInternal(pageView, customProperties); _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } } } catch (e) { _this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackPVFailedCalc, "trackPageView failed on page load calculation: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }), 100); }; return PageViewManager; }()); exports.PageViewManager = PageViewManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewManager.js.map /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./JavaScriptSDK/ApplicationInsights */ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, ApplicationInsights_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApplicationInsights = ApplicationInsights_1.ApplicationInsights; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-analytics-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ContextTagKeys = [ "ai.application.ver", "ai.application.build", "ai.application.typeId", "ai.application.applicationId", "ai.application.layer", "ai.device.id", "ai.device.ip", "ai.device.language", "ai.device.locale", "ai.device.model", "ai.device.friendlyName", "ai.device.network", "ai.device.networkName", "ai.device.oemName", "ai.device.os", "ai.device.osVersion", "ai.device.roleInstance", "ai.device.roleName", "ai.device.screenResolution", "ai.device.type", "ai.device.machineName", "ai.device.vmName", "ai.device.browser", "ai.device.browserVersion", "ai.location.ip", "ai.location.country", "ai.location.province", "ai.location.city", "ai.operation.id", "ai.operation.name", "ai.operation.parentId", "ai.operation.rootId", "ai.operation.syntheticSource", "ai.operation.correlationVector", "ai.session.id", "ai.session.isFirst", "ai.session.isNew", "ai.user.accountAcquisitionDate", "ai.user.accountId", "ai.user.userAgent", "ai.user.id", "ai.user.storeRegion", "ai.user.authUserId", "ai.user.anonUserAcquisitionDate", "ai.user.authUserAcquisitionDate", "ai.cloud.name", "ai.cloud.role", "ai.cloud.roleVer", "ai.cloud.roleInstance", "ai.cloud.environment", "ai.cloud.location", "ai.cloud.deploymentUnit", "ai.internal.sdkVersion", "ai.internal.agentVersion", "ai.internal.nodeName", ]; // these two constants are used to filter out properties not needed when trying to extract custom properties and measurements from the incoming payload var baseType = "baseType"; var baseData = "baseData"; var EnvelopeCreator = /** @class */ (function () { function EnvelopeCreator() { } EnvelopeCreator.extractProperties = function (data) { var customProperties = null; for (var key in data) { if (data.hasOwnProperty(key)) { var value = data[key]; if (typeof value !== "number") { if (!customProperties) { customProperties = {}; } customProperties[key] = value; } } } return customProperties; }; EnvelopeCreator.extractPropsAndMeasurements = function (data, properties, measurements) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(data)) { for (var key in data) { if (data.hasOwnProperty(key)) { var value = data[key]; if (typeof value === "number") { measurements[key] = value; } else { properties[key] = value; } } } } }; // TODO: Do we want this to take logger as arg or use this._logger as nonstatic? EnvelopeCreator.createEnvelope = function (logger, envelopeType, telemetryItem, data) { var envelope = new applicationinsights_common_1.Envelope(logger, data, envelopeType); envelope.iKey = telemetryItem.instrumentationKey; var iKeyNoDashes = telemetryItem.instrumentationKey.replace(/-/g, ""); envelope.name = envelope.name.replace("{0}", iKeyNoDashes); // loop through the envelope ctx (Part A) and pick out the ones that should go in outgoing envelope tags for (var key in telemetryItem.ctx) { if (telemetryItem.ctx.hasOwnProperty(key)) { if (exports.ContextTagKeys.indexOf(key) >= 0) { envelope.tags[key] = telemetryItem.ctx[key]; } } } // loop through the envelope tags (extension of Part A) and pick out the ones that should go in outgoing envelope tags telemetryItem.tags.forEach(function (tag) { for (var key in tag) { if (tag.hasOwnProperty(key)) { if (exports.ContextTagKeys.indexOf(key) >= 0) { envelope.tags[key] = tag[key]; } } } }); return envelope; }; return EnvelopeCreator; }()); exports.EnvelopeCreator = EnvelopeCreator; var DependencyEnvelopeCreator = /** @class */ (function (_super) { __extends(DependencyEnvelopeCreator, _super); function DependencyEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } DependencyEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customMeasurements = {}; var customProperties = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var bd = telemetryItem.baseData; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(bd)) { logger.warnToConsole("Invalid input for dependency data"); return null; } var id = bd.id; var absoluteUrl = bd.absoluteUrl; var command = bd.commandName; var duration = bd.duration; var success = bd.success; var resultCode = bd.resultCode; var method = bd.method; var baseData = new applicationinsights_common_1.RemoteDependencyData(logger, id, absoluteUrl, command, duration, success, resultCode, method, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.RemoteDependencyData.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.RemoteDependencyData.envelopeType, telemetryItem, data); }; DependencyEnvelopeCreator.DependencyEnvelopeCreator = new DependencyEnvelopeCreator(); return DependencyEnvelopeCreator; }(EnvelopeCreator)); exports.DependencyEnvelopeCreator = DependencyEnvelopeCreator; var EventEnvelopeCreator = /** @class */ (function (_super) { __extends(EventEnvelopeCreator, _super); function EventEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } EventEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; if (telemetryItem.baseType !== applicationinsights_common_1.Event.dataType) { EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.baseData, customProperties, customMeasurements); } EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var eventName = telemetryItem.baseData.name; var baseData = new applicationinsights_common_1.Event(logger, eventName, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Event.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Event.envelopeType, telemetryItem, data); }; EventEnvelopeCreator.EventEnvelopeCreator = new EventEnvelopeCreator(); return EventEnvelopeCreator; }(EnvelopeCreator)); exports.EventEnvelopeCreator = EventEnvelopeCreator; var ExceptionEnvelopeCreator = /** @class */ (function (_super) { __extends(ExceptionEnvelopeCreator, _super); function ExceptionEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } ExceptionEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var exception = telemetryItem.baseData.error; var severityLevel = telemetryItem.baseData.severityLevel; var baseData = new applicationinsights_common_1.Exception(logger, exception, customProperties, customMeasurements, severityLevel); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Exception.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Exception.envelopeType, telemetryItem, data); }; ExceptionEnvelopeCreator.ExceptionEnvelopeCreator = new ExceptionEnvelopeCreator(); return ExceptionEnvelopeCreator; }(EnvelopeCreator)); exports.ExceptionEnvelopeCreator = ExceptionEnvelopeCreator; var MetricEnvelopeCreator = /** @class */ (function (_super) { __extends(MetricEnvelopeCreator, _super); function MetricEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } MetricEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = EnvelopeCreator.extractProperties(telemetryItem.data); var name = telemetryItem.baseData.name; var average = telemetryItem.baseData.average; var sampleCount = telemetryItem.baseData.sampleCount; var min = telemetryItem.baseData.min; var max = telemetryItem.baseData.max; var baseData = new applicationinsights_common_1.Metric(logger, name, average, sampleCount, min, max, customProperties); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Metric.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Metric.envelopeType, telemetryItem, data); }; MetricEnvelopeCreator.MetricEnvelopeCreator = new MetricEnvelopeCreator(); return MetricEnvelopeCreator; }(EnvelopeCreator)); exports.MetricEnvelopeCreator = MetricEnvelopeCreator; var PageViewEnvelopeCreator = /** @class */ (function (_super) { __extends(PageViewEnvelopeCreator, _super); function PageViewEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } PageViewEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } // Since duration is not part of the domain properties in Common Schema, extract it from part C var duration = undefined; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.data) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.data.duration)) { duration = telemetryItem.data.duration; delete telemetryItem.data.duration; } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var name = telemetryItem.baseData.name; var url = telemetryItem.baseData.uri; // Todo: move IPageViewTelemetry to common as we are missing type checks on baseData here // refUri is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.refUri)) { customProperties["refUri"] = telemetryItem.baseData.refUri; } // pageType is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.pageType)) { customProperties["pageType"] = telemetryItem.baseData.pageType; } // isLoggedIn is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.isLoggedIn)) { customProperties["isLoggedIn"] = telemetryItem.baseData.isLoggedIn; } // pageTags is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.pageTags)) { var pageTags = telemetryItem.baseData.pageTags; for (var key in pageTags) { if (pageTags.hasOwnProperty(key)) { customProperties[key] = pageTags[key]; } } } var baseData = new applicationinsights_common_1.PageView(logger, name, url, duration, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.PageView.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.PageView.envelopeType, telemetryItem, data); }; PageViewEnvelopeCreator.PageViewEnvelopeCreator = new PageViewEnvelopeCreator(); return PageViewEnvelopeCreator; }(EnvelopeCreator)); exports.PageViewEnvelopeCreator = PageViewEnvelopeCreator; var PageViewPerformanceEnvelopeCreator = /** @class */ (function (_super) { __extends(PageViewPerformanceEnvelopeCreator, _super); function PageViewPerformanceEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } PageViewPerformanceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var name = telemetryItem.baseData.name; var url = telemetryItem.baseData.uri; var duration = telemetryItem.baseData.duration; var baseData = new applicationinsights_common_1.PageViewPerformance(logger, name, url, duration, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.PageViewPerformance.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.PageViewPerformance.envelopeType, telemetryItem, data); }; PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator = new PageViewPerformanceEnvelopeCreator(); return PageViewPerformanceEnvelopeCreator; }(EnvelopeCreator)); exports.PageViewPerformanceEnvelopeCreator = PageViewPerformanceEnvelopeCreator; var TraceEnvelopeCreator = /** @class */ (function (_super) { __extends(TraceEnvelopeCreator, _super); function TraceEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } TraceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var message = telemetryItem.baseData.message; var severityLevel = telemetryItem.baseData.severityLevel; var customProperties = EnvelopeCreator.extractProperties(telemetryItem.data); var baseData = new applicationinsights_common_1.Trace(logger, message, customProperties, severityLevel); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Trace.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Trace.envelopeType, telemetryItem, data); }; TraceEnvelopeCreator.TraceEnvelopeCreator = new TraceEnvelopeCreator(); return TraceEnvelopeCreator; }(EnvelopeCreator)); exports.TraceEnvelopeCreator = TraceEnvelopeCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EnvelopeCreator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Offline.js": /*!***********************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Offline.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @description Monitors browser for offline events * @export default - Offline: Static instance of OfflineListener * @class OfflineListener */ var OfflineListener = /** @class */ (function () { function OfflineListener() { this._onlineStatus = true; if (window && window.addEventListener) { window.addEventListener('online', this._setOnline.bind(this), false); window.addEventListener('offline', this._setOffline.bind(this), false); this.isListening = true; } else if (document && document.body) { document.body.ononline = this._setOnline.bind(this); document.body.onoffline = this._setOffline.bind(this); this.isListening = true; } else if (document) { document.ononline = this._setOnline.bind(this); document.onoffline = this._setOffline.bind(this); this.isListening = true; } else { // Could not find a place to add event listener this.isListening = false; } } OfflineListener.prototype._setOnline = function () { this._onlineStatus = true; }; OfflineListener.prototype._setOffline = function () { this._onlineStatus = false; }; OfflineListener.prototype.isOnline = function () { if (this.isListening) { return this._onlineStatus; } else if (navigator) { return navigator.onLine; } else { // Cannot determine online status - report as online return true; } }; OfflineListener.prototype.isOffline = function () { return !this.isOnline(); }; OfflineListener.Offline = new OfflineListener; return OfflineListener; }()); exports.OfflineListener = OfflineListener; exports.Offline = OfflineListener.Offline; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Offline.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js": /*!**************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* * An array based send buffer. */ var ArraySendBuffer = /** @class */ (function () { function ArraySendBuffer(config) { this._config = config; this._buffer = []; } ArraySendBuffer.prototype.enqueue = function (payload) { this._buffer.push(payload); }; ArraySendBuffer.prototype.count = function () { return this._buffer.length; }; ArraySendBuffer.prototype.clear = function () { this._buffer.length = 0; }; ArraySendBuffer.prototype.getItems = function () { return this._buffer.slice(0); }; ArraySendBuffer.prototype.batchPayloads = function (payload) { if (payload && payload.length > 0) { var batch = this._config.emitLineDelimitedJson() ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; ArraySendBuffer.prototype.markAsSent = function (payload) { this.clear(); }; ArraySendBuffer.prototype.clearSent = function (payload) { // not supported }; return ArraySendBuffer; }()); exports.ArraySendBuffer = ArraySendBuffer; /* * Session storege buffer holds a copy of all unsent items in the browser session storage. */ var SessionStorageSendBuffer = /** @class */ (function () { function SessionStorageSendBuffer(logger, config) { this._bufferFullMessageSent = false; this._logger = logger; this._config = config; var bufferItems = this.getBuffer(SessionStorageSendBuffer.BUFFER_KEY); var notDeliveredItems = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); this._buffer = bufferItems.concat(notDeliveredItems); // If the buffer has too many items, drop items from the end. if (this._buffer.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { this._buffer.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } // update DataLossAnalyzer with the number of recovered items // Uncomment if you want to use DataLossanalyzer // DataLossAnalyzer.itemsRestoredFromSessionBuffer = this._buffer.length; this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); } SessionStorageSendBuffer.prototype.enqueue = function (payload) { if (this._buffer.length >= SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // sent internal log only once per page view if (!this._bufferFullMessageSent) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SessionStorageBufferFull, "Maximum buffer size reached: " + this._buffer.length, true); this._bufferFullMessageSent = true; } return; } this._buffer.push(payload); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); }; SessionStorageSendBuffer.prototype.count = function () { return this._buffer.length; }; SessionStorageSendBuffer.prototype.clear = function () { this._buffer.length = 0; this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, []); this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); this._bufferFullMessageSent = false; }; SessionStorageSendBuffer.prototype.getItems = function () { return this._buffer.slice(0); }; SessionStorageSendBuffer.prototype.batchPayloads = function (payload) { if (payload && payload.length > 0) { var batch = this._config.emitLineDelimitedJson() ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; SessionStorageSendBuffer.prototype.markAsSent = function (payload) { this._buffer = this.removePayloadsFromBuffer(payload, this._buffer); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); if (sentElements instanceof Array && payload instanceof Array) { sentElements = sentElements.concat(payload); if (sentElements.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // We send telemetry normally. If the SENT_BUFFER is too big we don't add new elements // until we receive a response from the backend and the buffer has free space again (see clearSent method) this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.SessionStorageBufferFull, "Sent buffer reached its maximum size: " + sentElements.length, true); sentElements.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); } }; SessionStorageSendBuffer.prototype.clearSent = function (payload) { var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); sentElements = this.removePayloadsFromBuffer(payload, sentElements); this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); }; SessionStorageSendBuffer.prototype.removePayloadsFromBuffer = function (payloads, buffer) { var remaining = []; for (var i in buffer) { var contains = false; for (var j in payloads) { if (payloads[j] === buffer[i]) { contains = true; break; } } if (!contains) { remaining.push(buffer[i]); } } ; return remaining; }; SessionStorageSendBuffer.prototype.getBuffer = function (key) { try { var bufferJson = applicationinsights_common_1.Util.getSessionStorage(this._logger, key); if (bufferJson) { var buffer = JSON.parse(bufferJson); if (buffer) { return buffer; } } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedToRestoreStorageBuffer, " storage key: " + key + ", " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } return []; }; SessionStorageSendBuffer.prototype.setBuffer = function (key, buffer) { try { var bufferJson = JSON.stringify(buffer); applicationinsights_common_1.Util.setSessionStorage(this._logger, key, bufferJson); } catch (e) { // if there was an error, clear the buffer // telemetry is stored in the _buffer array so we won't loose any items applicationinsights_common_1.Util.setSessionStorage(this._logger, key, JSON.stringify([])); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedToSetStorageBuffer, " storage key: " + key + ", " + applicationinsights_common_1.Util.getExceptionName(e) + ". Buffer cleared", { exception: applicationinsights_common_1.Util.dump(e) }); } }; SessionStorageSendBuffer.BUFFER_KEY = "AI_buffer"; SessionStorageSendBuffer.SENT_BUFFER_KEY = "AI_sentBuffer"; // Maximum number of payloads stored in the buffer. If the buffer is full, new elements will be dropped. SessionStorageSendBuffer.MAX_BUFFER_SIZE = 2000; return SessionStorageSendBuffer; }()); exports.SessionStorageSendBuffer = SessionStorageSendBuffer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SendBuffer.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Sender.js": /*!**********************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Sender.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./SendBuffer */ "./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js"), __webpack_require__(/*! ./EnvelopeCreator */ "./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js"), __webpack_require__(/*! ./TelemetryValidation/EventValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js"), __webpack_require__(/*! ./TelemetryValidation/TraceValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js"), __webpack_require__(/*! ./TelemetryValidation/ExceptionValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js"), __webpack_require__(/*! ./TelemetryValidation/MetricValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js"), __webpack_require__(/*! ./TelemetryValidation/PageViewPerformanceValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js"), __webpack_require__(/*! ./TelemetryValidation/PageViewValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js"), __webpack_require__(/*! ./TelemetryValidation/RemoteDepdencyValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js"), __webpack_require__(/*! ./Serializer */ "./node_modules/applicationinsights-channel-js/bundle/Serializer.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./Offline */ "./node_modules/applicationinsights-channel-js/bundle/Offline.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, SendBuffer_1, EnvelopeCreator_1, EventValidator_1, TraceValidator_1, ExceptionValidator_1, MetricValidator_1, PageViewPerformanceValidator_1, PageViewValidator_1, RemoteDepdencyValidator_1, Serializer_1, applicationinsights_common_1, applicationinsights_core_js_1, applicationinsights_core_js_2, Offline_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Sender = /** @class */ (function () { function Sender() { this.priority = 201; /** * Whether XMLHttpRequest object is supported. Older version of IE (8,9) do not support it. */ this._XMLHttpRequestSupported = false; } Sender.prototype.pause = function () { throw new Error("Method not implemented."); }; Sender.prototype.resume = function () { throw new Error("Method not implemented."); }; Sender.prototype.flush = function () { try { this.triggerSend(); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FlushFailed, "flush failed, telemetry will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; Sender.prototype.teardown = function () { throw new Error("Method not implemented."); }; Sender.prototype.initialize = function (config, core, extensions) { this.identifier = "AppInsightsChannelPlugin"; this._logger = core.logger; this._serializer = new Serializer_1.Serializer(core.logger); this._consecutiveErrors = 0; this._retryAt = null; this._lastSend = 0; this._config = Sender._getDefaultAppInsightsChannelConfig(config, this.identifier); this._sender = null; this._buffer = (applicationinsights_common_1.Util.canUseSessionStorage() && this._config.enableSessionStorageBuffer) ? new SendBuffer_1.SessionStorageSendBuffer(this._logger, this._config) : new SendBuffer_1.ArraySendBuffer(this._config); if (!this._config.isBeaconApiDisabled() && applicationinsights_common_1.Util.IsBeaconApiSupported()) { this._sender = this._beaconSender; } else { if (typeof XMLHttpRequest != "undefined") { var testXhr = new XMLHttpRequest(); if ("withCredentials" in testXhr) { this._sender = this._xhrSender; this._XMLHttpRequestSupported = true; } else if (typeof XDomainRequest !== "undefined") { this._sender = this._xdrSender; //IE 8 and 9 } } } }; Sender.prototype.processTelemetry = function (telemetryItem) { try { // if master off switch is set, don't send any data if (this._config.disableTelemetry()) { // Do not send/save data return; } // validate input if (!telemetryItem) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSendEmptyTelemetry, "Cannot send empty telemetry"); return; } // ensure a sender was constructed if (!this._sender) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.SenderNotInitialized, "Sender was not initialized"); return; } // first we need to validate that the envelope passed down is valid var isValid = Sender._validate(telemetryItem); if (!isValid) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "Invalid telemetry envelope"); return; } // construct an envelope that Application Insights endpoint can understand var aiEnvelope = this._constructEnvelope(telemetryItem); if (!aiEnvelope) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CreateEnvelopeError, "Unable to create an AppInsights envelope"); return; } // check if the incoming payload is too large, truncate if necessary var payload = this._serializer.serialize(aiEnvelope); // flush if we would exceed the max-size limit by adding this item var bufferPayload = this._buffer.getItems(); var batch = this._buffer.batchPayloads(bufferPayload); if (batch && (batch.length + payload.length > this._config.maxBatchSizeInBytes())) { this.triggerSend(); } // enqueue the payload this._buffer.enqueue(payload); // ensure an invocation timeout is set this._setupTimer(); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedAddingTelemetryToBuffer, "Failed adding telemetry to the sender's buffer, some telemetry will be lost: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } // hand off the telemetry item to the next plugin if (!applicationinsights_core_js_2.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(telemetryItem); } }; Sender.prototype.setNextPlugin = function (next) { this._nextPlugin = next; }; /** * xhr state changes */ Sender.prototype._xhrReadyStateChange = function (xhr, payload, countOfItemsInPayload) { if (xhr.readyState === 4) { var response = null; if (!this._appId) { response = this._parseResponse(xhr.responseText || xhr.response); if (response && response.appId) { this._appId = response.appId; } } if ((xhr.status < 200 || xhr.status >= 300) && xhr.status !== 0) { if (!this._config.isRetryDisabled() && this._isRetriable(xhr.status)) { this._resendPayload(payload); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Response code " + xhr.status + ". Will retry to send " + payload.length + " items."); } else { this._onError(payload, this._formatErrorMessageXhr(xhr)); } } else if (xhr.status === 0 || Offline_1.Offline.isOffline()) { if (!this._config.isRetryDisabled()) { var offlineBackOffMultiplier = 10; // arbritrary number this._resendPayload(payload, offlineBackOffMultiplier); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". Offline - Response Code: " + xhr.status + ". Offline status: " + Offline_1.Offline.isOffline() + ". Will retry to send " + payload.length + " items."); } } else { if (xhr.status === 206) { if (!response) { response = this._parseResponse(xhr.responseText || xhr.response); } if (response && !this._config.isRetryDisabled()) { this._onPartialSuccess(payload, response); } else { this._onError(payload, this._formatErrorMessageXhr(xhr)); } } else { this._consecutiveErrors = 0; this._onSuccess(payload, countOfItemsInPayload); } } } }; /** * Immediately send buffered data * @param async {boolean} - Indicates if the events should be sent asynchronously */ Sender.prototype.triggerSend = function (async) { if (async === void 0) { async = true; } try { // Send data only if disableTelemetry is false if (!this._config.disableTelemetry()) { if (this._buffer.count() > 0) { var payload = this._buffer.getItems(); // invoke send this._sender(payload, async); } // update lastSend time to enable throttling this._lastSend = +new Date; } else { this._buffer.clear(); } clearTimeout(this._timeoutHandle); this._timeoutHandle = null; this._retryAt = null; } catch (e) { /* Ignore this error for IE under v10 */ if (!applicationinsights_common_1.Util.getIEVersion() || applicationinsights_common_1.Util.getIEVersion() > 9) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, "Telemetry transmission failed, some telemetry will be lost: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } } }; /** * error handler */ Sender.prototype._onError = function (payload, message, event) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.OnError, "Failed to send telemetry.", { message: message }); this._buffer.clearSent(payload); }; /** * partial success handler */ Sender.prototype._onPartialSuccess = function (payload, results) { var failed = []; var retry = []; // Iterate through the reversed array of errors so that splicing doesn't have invalid indexes after the first item. var errors = results.errors.reverse(); for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) { var error = errors_1[_i]; var extracted = payload.splice(error.index, 1)[0]; if (this._isRetriable(error.statusCode)) { retry.push(extracted); } else { // All other errors, including: 402 (Monthly quota exceeded) and 439 (Too many requests and refresh cache). failed.push(extracted); } } if (payload.length > 0) { this._onSuccess(payload, results.itemsAccepted); } if (failed.length > 0) { this._onError(failed, this._formatErrorMessageXhr(null, ['partial success', results.itemsAccepted, 'of', results.itemsReceived].join(' '))); } if (retry.length > 0) { this._resendPayload(retry); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, "Partial success. " + "Delivered: " + payload.length + ", Failed: " + failed.length + ". Will retry to send " + retry.length + " our of " + results.itemsReceived + " items"); } }; /** * success handler */ Sender.prototype._onSuccess = function (payload, countOfItemsInPayload) { this._buffer.clearSent(payload); }; /** * xdr state changes */ Sender.prototype._xdrOnLoad = function (xdr, payload) { if (xdr && (xdr.responseText + "" === "200" || xdr.responseText === "")) { this._consecutiveErrors = 0; this._onSuccess(payload, 0); } else { var results = this._parseResponse(xdr.responseText); if (results && results.itemsReceived && results.itemsReceived > results.itemsAccepted && !this._config.isRetryDisabled()) { this._onPartialSuccess(payload, results); } else { this._onError(payload, this._formatErrorMessageXdr(xdr)); } } }; Sender.prototype._constructEnvelope = function (envelope) { switch (envelope.baseType) { case applicationinsights_common_1.Event.dataType: return EnvelopeCreator_1.EventEnvelopeCreator.EventEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Trace.dataType: return EnvelopeCreator_1.TraceEnvelopeCreator.TraceEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.PageView.dataType: return EnvelopeCreator_1.PageViewEnvelopeCreator.PageViewEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.PageViewPerformance.dataType: return EnvelopeCreator_1.PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Exception.dataType: return EnvelopeCreator_1.ExceptionEnvelopeCreator.ExceptionEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Metric.dataType: return EnvelopeCreator_1.MetricEnvelopeCreator.MetricEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.RemoteDependencyData.dataType: return EnvelopeCreator_1.DependencyEnvelopeCreator.DependencyEnvelopeCreator.Create(this._logger, envelope); default: // default create custom event type return EnvelopeCreator_1.EventEnvelopeCreator.EventEnvelopeCreator.Create(this._logger, envelope); } }; Sender._getDefaultAppInsightsChannelConfig = function (config, identifier) { var resultConfig = {}; var pluginConfig = config.extensionConfig && config.extensionConfig[identifier] ? config.extensionConfig[identifier] : {}; // set default values resultConfig.endpointUrl = function () { return config.endpointUrl || "https://dc.services.visualstudio.com/v2/track"; }; resultConfig.emitLineDelimitedJson = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.emitLineDelimitedJson); }; resultConfig.maxBatchInterval = function () { return !isNaN(pluginConfig.maxBatchInterval) ? pluginConfig.maxBatchInterval : 15000; }; resultConfig.maxBatchSizeInBytes = function () { return pluginConfig.maxBatchSizeInBytes > 0 ? pluginConfig.maxBatchSizeInBytes : 102400; }; // 100kb resultConfig.disableTelemetry = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.disableTelemetry); }; resultConfig.enableSessionStorageBuffer = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.enableSessionStorageBuffer, true); }; resultConfig.isRetryDisabled = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.isRetryDisabled); }; resultConfig.isBeaconApiDisabled = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.isBeaconApiDisabled, true); }; return resultConfig; }; Sender._validate = function (envelope) { // call the appropriate Validate depending on the baseType switch (envelope.baseType) { case applicationinsights_common_1.Event.dataType: return EventValidator_1.EventValidator.EventValidator.Validate(envelope); case applicationinsights_common_1.Trace.dataType: return TraceValidator_1.TraceValidator.TraceValidator.Validate(envelope); case applicationinsights_common_1.Exception.dataType: return ExceptionValidator_1.ExceptionValidator.ExceptionValidator.Validate(envelope); case applicationinsights_common_1.Metric.dataType: return MetricValidator_1.MetricValidator.MetricValidator.Validate(envelope); case applicationinsights_common_1.PageView.dataType: return PageViewValidator_1.PageViewValidator.PageViewValidator.Validate(envelope); case applicationinsights_common_1.PageViewPerformance.dataType: return PageViewPerformanceValidator_1.PageViewPerformanceValidator.PageViewPerformanceValidator.Validate(envelope); case applicationinsights_common_1.RemoteDependencyData.dataType: return RemoteDepdencyValidator_1.RemoteDepdencyValidator.RemoteDepdencyValidator.Validate(envelope); default: return EventValidator_1.EventValidator.EventValidator.Validate(envelope); } }; /** * Send Beacon API request * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - not used * Note: Beacon API does not support custom headers and we are not able to get * appId from the backend for the correct correlation. */ Sender.prototype._beaconSender = function (payload, isAsync) { var url = this._config.endpointUrl(); var batch = this._buffer.batchPayloads(payload); // Chrome only allows CORS-safelisted values for the sendBeacon data argument // see: https://bugs.chromium.org/p/chromium/issues/detail?id=720283 var plainTextBatch = new Blob([batch], { type: 'text/plain;charset=UTF-8' }); // The sendBeacon method returns true if the user agent is able to successfully queue the data for transfer. Otherwise it returns false. var queued = navigator.sendBeacon(url, plainTextBatch); if (queued) { this._buffer.markAsSent(payload); } else { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Failed to send telemetry with Beacon API."); } }; /** * Send XMLHttpRequest * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - Indicates if the request should be sent asynchronously */ Sender.prototype._xhrSender = function (payload, isAsync) { var _this = this; var xhr = new XMLHttpRequest(); xhr[applicationinsights_common_1.DisabledPropertyName] = true; xhr.open("POST", this._config.endpointUrl(), isAsync); xhr.setRequestHeader("Content-type", "application/json"); // append Sdk-Context request header only in case of breeze endpoint if (applicationinsights_common_1.Util.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.sdkContextHeader, applicationinsights_common_1.RequestHeaders.sdkContextHeaderAppIdRequest); } xhr.onreadystatechange = function () { return _this._xhrReadyStateChange(xhr, payload, payload.length); }; xhr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXhr(xhr), event); }; // compose an array of payloads var batch = this._buffer.batchPayloads(payload); xhr.send(batch); this._buffer.markAsSent(payload); }; /** * Parses the response from the backend. * @param response - XMLHttpRequest or XDomainRequest response */ Sender.prototype._parseResponse = function (response) { try { if (response && response !== "") { var result = JSON.parse(response); if (result && result.itemsReceived && result.itemsReceived >= result.itemsAccepted && result.itemsReceived - result.itemsAccepted == result.errors.length) { return result; } } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.InvalidBackendResponse, "Cannot parse the response. " + applicationinsights_common_1.Util.getExceptionName(e), { response: response }); } return null; }; /** * Resend payload. Adds payload back to the send buffer and setup a send timer (with exponential backoff). * @param payload */ Sender.prototype._resendPayload = function (payload, linearFactor) { if (linearFactor === void 0) { linearFactor = 1; } if (!payload || payload.length === 0) { return; } this._buffer.clearSent(payload); this._consecutiveErrors++; for (var _i = 0, payload_1 = payload; _i < payload_1.length; _i++) { var item = payload_1[_i]; this._buffer.enqueue(item); } // setup timer this._setRetryTime(linearFactor); this._setupTimer(); }; /** Calculates the time to wait before retrying in case of an error based on * http://en.wikipedia.org/wiki/Exponential_backoff */ Sender.prototype._setRetryTime = function (linearFactor) { var SlotDelayInSeconds = 10; var delayInSeconds; if (this._consecutiveErrors <= 1) { delayInSeconds = SlotDelayInSeconds; } else { var backOffSlot = (Math.pow(2, this._consecutiveErrors) - 1) / 2; // tslint:disable-next-line:insecure-random var backOffDelay = Math.floor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1; backOffDelay = linearFactor * backOffDelay; delayInSeconds = Math.max(Math.min(backOffDelay, 3600), SlotDelayInSeconds); } // TODO: Log the backoff time like the C# version does. var retryAfterTimeSpan = Date.now() + (delayInSeconds * 1000); // TODO: Log the retry at time like the C# version does. this._retryAt = retryAfterTimeSpan; }; /** * Sets up the timer which triggers actually sending the data. */ Sender.prototype._setupTimer = function () { var _this = this; if (!this._timeoutHandle) { var retryInterval = this._retryAt ? Math.max(0, this._retryAt - Date.now()) : 0; var timerValue = Math.max(this._config.maxBatchInterval(), retryInterval); this._timeoutHandle = setTimeout(function () { _this.triggerSend(); }, timerValue); } }; /** * Checks if the SDK should resend the payload after receiving this status code from the backend. * @param statusCode */ Sender.prototype._isRetriable = function (statusCode) { return statusCode == 408 // Timeout || statusCode == 429 // Too many requests. || statusCode == 500 // Internal server error. || statusCode == 503; // Service unavailable. }; Sender.prototype._formatErrorMessageXhr = function (xhr, message) { if (xhr) { return "XMLHttpRequest,Status:" + xhr.status + ",Response:" + xhr.responseText || xhr.response || ""; } return message; }; /** * Send XDomainRequest * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - Indicates if the request should be sent asynchronously * * Note: XDomainRequest does not support sync requests. This 'isAsync' parameter is added * to maintain consistency with the xhrSender's contract * Note: XDomainRequest does not support custom headers and we are not able to get * appId from the backend for the correct correlation. */ Sender.prototype._xdrSender = function (payload, isAsync) { var _this = this; var xdr = new XDomainRequest(); xdr.onload = function () { return _this._xdrOnLoad(xdr, payload); }; xdr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXdr(xdr), event); }; // XDomainRequest requires the same protocol as the hosting page. // If the protocol doesn't match, we can't send the telemetry :(. var hostingProtocol = window.location.protocol; if (this._config.endpointUrl().lastIndexOf(hostingProtocol, 0) !== 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."); this._buffer.clear(); return; } var endpointUrl = this._config.endpointUrl().replace(/^(https?:)/, ""); xdr.open('POST', endpointUrl); // compose an array of payloads var batch = this._buffer.batchPayloads(payload); xdr.send(batch); this._buffer.markAsSent(payload); }; Sender.prototype._formatErrorMessageXdr = function (xdr, message) { if (xdr) { return "XDomainRequest,Response:" + xdr.responseText || ""; } return message; }; return Sender; }()); exports.Sender = Sender; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Sender.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Serializer.js": /*!**************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Serializer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Serializer = /** @class */ (function () { function Serializer(logger) { this._logger = logger; } /** * Serializes the current object to a JSON string. */ Serializer.prototype.serialize = function (input) { var output = this._serializeObject(input, "root"); return JSON.stringify(output); }; Serializer.prototype._serializeObject = function (source, name) { var circularReferenceCheck = "__aiCircularRefCheck"; var output = {}; if (!source) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObject, "cannot serialize object because it is null or undefined", { name: name }, true); return output; } if (source[circularReferenceCheck]) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CircularReferenceDetected, "Circular reference detected while serializing object", { name: name }, true); return output; } if (!source.aiDataContract) { // special case for measurements/properties/tags if (name === "measurements") { output = this._serializeStringMap(source, "number", name); } else if (name === "properties") { output = this._serializeStringMap(source, "string", name); } else if (name === "tags") { output = this._serializeStringMap(source, "string", name); } else if (applicationinsights_common_1.Util.isArray(source)) { output = this._serializeArray(source, name); } else { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObjectNonSerializable, "Attempting to serialize an object which does not implement ISerializable", { name: name }, true); try { // verify that the object can be stringified JSON.stringify(source); output = source; } catch (e) { // if serialization fails return an empty string this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObject, (e && typeof e.toString === 'function') ? e.toString() : "Error serializing object", null, true); } } return output; } source[circularReferenceCheck] = true; for (var field in source.aiDataContract) { var contract = source.aiDataContract[field]; var isRequired = (typeof contract === "function") ? (contract() & applicationinsights_common_1.FieldType.Required) : (contract & applicationinsights_common_1.FieldType.Required); var isHidden = (typeof contract === "function") ? (contract() & applicationinsights_common_1.FieldType.Hidden) : (contract & applicationinsights_common_1.FieldType.Hidden); var isArray = contract & applicationinsights_common_1.FieldType.Array; var isPresent = source[field] !== undefined; var isObject = typeof source[field] === "object" && source[field] !== null; if (isRequired && !isPresent && !isArray) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.MissingRequiredFieldSpecification, "Missing required field specification. The field is required but not present on source", { field: field, name: name }); // If not in debug mode, continue and hope the error is permissible continue; } if (isHidden) { // Don't serialize hidden fields continue; } var value; if (isObject) { if (isArray) { // special case; resurse on each object in the source array value = this._serializeArray(source[field], field); } else { // recurse on the source object in this field value = this._serializeObject(source[field], field); } } else { // assign the source field to the output even if undefined or required value = source[field]; } // only emit this field if the value is defined if (value !== undefined) { output[field] = value; } } delete source[circularReferenceCheck]; return output; }; Serializer.prototype._serializeArray = function (sources, name) { var output = undefined; if (!!sources) { if (!applicationinsights_common_1.Util.isArray(sources)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ItemNotInArray, "This field was specified as an array in the contract but the item is not an array.\r\n", { name: name }, true); } else { output = []; for (var i = 0; i < sources.length; i++) { var source = sources[i]; var item = this._serializeObject(source, name + "[" + i + "]"); output.push(item); } } } return output; }; Serializer.prototype._serializeStringMap = function (map, expectedType, name) { var output = undefined; if (map) { output = {}; for (var field in map) { var value = map[field]; if (expectedType === "string") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else if (!value.toString) { output[field] = "invalid field: toString() is not defined."; } else { output[field] = value.toString(); } } else if (expectedType === "number") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else { var num = parseFloat(value); if (isNaN(num)) { output[field] = "NaN"; } else { output[field] = num; } } } else { output[field] = "invalid field: " + name + " is of unknown type."; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, output[field], null, true); } } } return output; }; return Serializer; }()); exports.Serializer = Serializer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Serializer.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var EventValidator = /** @class */ (function () { function EventValidator() { } EventValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["name"]) { return false; } */ return true; }; EventValidator.EventValidator = new EventValidator(); return EventValidator; }()); exports.EventValidator = EventValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var ExceptionValidator = /** @class */ (function () { function ExceptionValidator() { } ExceptionValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["exceptions"] || !ExceptionValidator._validateExceptions(item.domainProperties["exceptions"])) { return false; } */ return true; }; // TODO implement validation of exceptions ExceptionValidator._validateExceptions = function (exceptions) { // typeName // message // parsedStack // stack // hasFullStack return true; }; ExceptionValidator.ExceptionValidator = new ExceptionValidator(); return ExceptionValidator; }()); exports.ExceptionValidator = ExceptionValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var MetricValidator = /** @class */ (function () { function MetricValidator() { } MetricValidator.prototype.Validate = function (event) { return true; }; MetricValidator.MetricValidator = new MetricValidator(); return MetricValidator; }()); exports.MetricValidator = MetricValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MetricValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js": /*!****************************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js ***! \****************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewPerformanceValidator = /** @class */ (function () { function PageViewPerformanceValidator() { } PageViewPerformanceValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["domProcessing"] || !item.domainProperties["duration"] || !item.domainProperties["name"] || !item.domainProperties["networkConnect"] || !item.domainProperties["perfTotal"] || !item.domainProperties["receivedResponse"] || !item.domainProperties["sentRequest"] || !item.domainProperties["url"]) { return false; } */ return true; }; PageViewPerformanceValidator.PageViewPerformanceValidator = new PageViewPerformanceValidator(); return PageViewPerformanceValidator; }()); exports.PageViewPerformanceValidator = PageViewPerformanceValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerformanceValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewValidator = /** @class */ (function () { function PageViewValidator() { } PageViewValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["id"] || !item.domainProperties["name"] || !item.domainProperties["duration"] || !item.domainProperties["url"]) { return false; } */ return true; }; PageViewValidator.PageViewValidator = new PageViewValidator(); return PageViewValidator; }()); exports.PageViewValidator = PageViewValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RemoteDepdencyValidator = /** @class */ (function () { function RemoteDepdencyValidator() { } RemoteDepdencyValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["id"] || !item.domainProperties["name"] || !item.domainProperties["resultCode"] || !item.domainProperties["duration"] || !item.domainProperties["success"] || !item.domainProperties["data"] || !item.domainProperties["target"] || !item.domainProperties["type"]) { return false; } */ return true; }; RemoteDepdencyValidator.RemoteDepdencyValidator = new RemoteDepdencyValidator(); return RemoteDepdencyValidator; }()); exports.RemoteDepdencyValidator = RemoteDepdencyValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDepdencyValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TraceValidator = /** @class */ (function () { function TraceValidator() { } TraceValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["message"] || !item.domainProperties["severityLevel"]) { return false; } */ return true; }; TraceValidator.TraceValidator = new TraceValidator(); return TraceValidator; }()); exports.TraceValidator = TraceValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=TraceValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js": /*!**********************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js ***! \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Sender */ "./node_modules/applicationinsights-channel-js/bundle/Sender.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Sender_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Sender = Sender_1.Sender; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-channel-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Constants.js": /*!*********************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Constants.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Constants.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Enums.js": /*!*****************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Enums.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Type of storage to differentiate between local storage and session storage */ var StorageType; (function (StorageType) { StorageType[StorageType["LocalStorage"] = 0] = "LocalStorage"; StorageType[StorageType["SessionStorage"] = 1] = "SessionStorage"; })(StorageType = exports.StorageType || (exports.StorageType = {})); /** * Enum is used in aiDataContract to describe how fields are serialized. * For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array */ var FieldType; (function (FieldType) { FieldType[FieldType["Default"] = 0] = "Default"; FieldType[FieldType["Required"] = 1] = "Required"; FieldType[FieldType["Array"] = 2] = "Array"; FieldType[FieldType["Hidden"] = 4] = "Hidden"; })(FieldType = exports.FieldType || (exports.FieldType = {})); ; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Enums.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js": /*!***********************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Data struct to contain only C section with custom fields. */ var Base = /** @class */ (function () { function Base() { } return Base; }()); exports.Base = Base; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Base.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js ***! \*********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED var ContextTagKeys = /** @class */ (function () { function ContextTagKeys() { this.applicationVersion = "ai.application.ver"; this.applicationBuild = "ai.application.build"; this.applicationTypeId = "ai.application.typeId"; this.applicationId = "ai.application.applicationId"; this.applicationLayer = "ai.application.layer"; this.deviceId = "ai.device.id"; this.deviceIp = "ai.device.ip"; this.deviceLanguage = "ai.device.language"; this.deviceLocale = "ai.device.locale"; this.deviceModel = "ai.device.model"; this.deviceFriendlyName = "ai.device.friendlyName"; this.deviceNetwork = "ai.device.network"; this.deviceNetworkName = "ai.device.networkName"; this.deviceOEMName = "ai.device.oemName"; this.deviceOS = "ai.device.os"; this.deviceOSVersion = "ai.device.osVersion"; this.deviceRoleInstance = "ai.device.roleInstance"; this.deviceRoleName = "ai.device.roleName"; this.deviceScreenResolution = "ai.device.screenResolution"; this.deviceType = "ai.device.type"; this.deviceMachineName = "ai.device.machineName"; this.deviceVMName = "ai.device.vmName"; this.deviceBrowser = "ai.device.browser"; this.deviceBrowserVersion = "ai.device.browserVersion"; this.locationIp = "ai.location.ip"; this.locationCountry = "ai.location.country"; this.locationProvince = "ai.location.province"; this.locationCity = "ai.location.city"; this.operationId = "ai.operation.id"; this.operationName = "ai.operation.name"; this.operationParentId = "ai.operation.parentId"; this.operationRootId = "ai.operation.rootId"; this.operationSyntheticSource = "ai.operation.syntheticSource"; this.operationCorrelationVector = "ai.operation.correlationVector"; this.sessionId = "ai.session.id"; this.sessionIsFirst = "ai.session.isFirst"; this.sessionIsNew = "ai.session.isNew"; this.userAccountAcquisitionDate = "ai.user.accountAcquisitionDate"; this.userAccountId = "ai.user.accountId"; this.userAgent = "ai.user.userAgent"; this.userId = "ai.user.id"; this.userStoreRegion = "ai.user.storeRegion"; this.userAuthUserId = "ai.user.authUserId"; this.userAnonymousUserAcquisitionDate = "ai.user.anonUserAcquisitionDate"; this.userAuthenticatedUserAcquisitionDate = "ai.user.authUserAcquisitionDate"; this.cloudName = "ai.cloud.name"; this.cloudRole = "ai.cloud.role"; this.cloudRoleVer = "ai.cloud.roleVer"; this.cloudRoleInstance = "ai.cloud.roleInstance"; this.cloudEnvironment = "ai.cloud.environment"; this.cloudLocation = "ai.cloud.location"; this.cloudDeploymentUnit = "ai.cloud.deploymentUnit"; this.internalSdkVersion = "ai.internal.sdkVersion"; this.internalAgentVersion = "ai.internal.agentVersion"; this.internalNodeName = "ai.internal.nodeName"; } return ContextTagKeys; }()); exports.ContextTagKeys = ContextTagKeys; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ContextTagKeys.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js": /*!***********************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Base */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Base_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Data struct to contain both B and C sections. */ var Data = /** @class */ (function (_super) { __extends(Data, _super); function Data() { return _super.call(this) || this; } return Data; }(Base_1.Base)); exports.Data = Data; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Data.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./DataPointType */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataPointType_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Metric data single measurement. */ var DataPoint = /** @class */ (function () { function DataPoint() { this.kind = DataPointType_1.DataPointType.Measurement; } return DataPoint; }()); exports.DataPoint = DataPoint; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPoint.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED /** * Type of the metric data measurement. */ var DataPointType; (function (DataPointType) { DataPointType[DataPointType["Measurement"] = 0] = "Measurement"; DataPointType[DataPointType["Aggregation"] = 1] = "Aggregation"; })(DataPointType = exports.DataPointType || (exports.DataPointType = {})); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPointType.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js": /*!*************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js ***! \*************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * The abstract common base of all domains. */ var Domain = /** @class */ (function () { function Domain() { } return Domain; }()); exports.Domain = Domain; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Domain.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * System variables for a telemetry item. */ var Envelope = /** @class */ (function () { function Envelope() { this.ver = 1; this.sampleRate = 100.0; this.tags = {}; } return Envelope; }()); exports.Envelope = Envelope; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Envelope.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Instances of Event represent structured event records that can be grouped and searched by their properties. Event data item also creates a metric of event count by name. */ var EventData = /** @class */ (function (_super) { __extends(EventData, _super); function EventData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return EventData; }(Domain_1.Domain)); exports.EventData = EventData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of Exception represents a handled or unhandled exception that occurred during execution of the monitored application. */ var ExceptionData = /** @class */ (function (_super) { __extends(ExceptionData, _super); function ExceptionData() { var _this = _super.call(this) || this; _this.ver = 2; _this.exceptions = []; _this.properties = {}; _this.measurements = {}; return _this; } return ExceptionData; }(Domain_1.Domain)); exports.ExceptionData = ExceptionData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Exception details of the exception in a chain. */ var ExceptionDetails = /** @class */ (function () { function ExceptionDetails() { this.hasFullStack = true; this.parsedStack = []; } return ExceptionDetails; }()); exports.ExceptionDetails = ExceptionDetails; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionDetails.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Instances of Message represent printf-like trace statements that are text-searched. Log4Net, NLog and other text-based log file entries are translated into intances of this type. The message does not have measurements. */ var MessageData = /** @class */ (function (_super) { __extends(MessageData, _super); function MessageData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; return _this; } return MessageData; }(Domain_1.Domain)); exports.MessageData = MessageData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MessageData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of the Metric item is a list of measurements (single data points) and/or aggregations. */ var MetricData = /** @class */ (function (_super) { __extends(MetricData, _super); function MetricData() { var _this = _super.call(this) || this; _this.ver = 2; _this.metrics = []; _this.properties = {}; return _this; } return MetricData; }(Domain_1.Domain)); exports.MetricData = MetricData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MetricData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js ***! \*******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./EventData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView. */ var PageViewData = /** @class */ (function (_super) { __extends(PageViewData, _super); function PageViewData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return PageViewData; }(EventData_1.EventData)); exports.PageViewData = PageViewData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of PageViewPerf represents: a page view with no performance data, a page view with performance data, or just the performance data of an earlier page request. */ var PageViewPerfData = /** @class */ (function (_super) { __extends(PageViewPerfData, _super); function PageViewPerfData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return PageViewPerfData; }(PageViewData_1.PageViewData)); exports.PageViewPerfData = PageViewPerfData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerfData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js": /*!***************************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js ***! \***************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of Remote Dependency represents an interaction of the monitored component with a remote component/service like SQL or an HTTP endpoint. */ var RemoteDependencyData = /** @class */ (function (_super) { __extends(RemoteDependencyData, _super); function RemoteDependencyData() { var _this = _super.call(this) || this; _this.ver = 2; _this.success = true; _this.properties = {}; _this.measurements = {}; return _this; } return RemoteDependencyData; }(Domain_1.Domain)); exports.RemoteDependencyData = RemoteDependencyData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDependencyData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Defines the level of severity for the event. */ var SeverityLevel; (function (SeverityLevel) { SeverityLevel[SeverityLevel["Verbose"] = 0] = "Verbose"; SeverityLevel[SeverityLevel["Information"] = 1] = "Information"; SeverityLevel[SeverityLevel["Warning"] = 2] = "Warning"; SeverityLevel[SeverityLevel["Error"] = 3] = "Error"; SeverityLevel[SeverityLevel["Critical"] = 4] = "Critical"; })(SeverityLevel = exports.SeverityLevel || (exports.SeverityLevel = {})); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SeverityLevel.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED /** * Stack frame information. */ var StackFrame = /** @class */ (function () { function StackFrame() { } return StackFrame; }()); exports.StackFrame = StackFrame; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=StackFrame.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js": /*!**********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RequestHeaders = /** @class */ (function () { function RequestHeaders() { } /** * Request-Context header */ RequestHeaders.requestContextHeader = "Request-Context"; /** * Target instrumentation header that is added to the response and retrieved by the * calling application when processing incoming responses. */ RequestHeaders.requestContextTargetKey = "appId"; /** * Request-Context appId format */ RequestHeaders.requestContextAppIdFormat = "appId=cid-v1:"; /** * Request-Id header */ RequestHeaders.requestIdHeader = "Request-Id"; /** * Sdk-Context header * If this header passed with appId in content then appId will be returned back by the backend. */ RequestHeaders.sdkContextHeader = "Sdk-Context"; /** * String to pass in header for requesting appId back from the backend. */ RequestHeaders.sdkContextHeaderAppIdRequest = "appId"; RequestHeaders.requestContextHeaderLowerCase = "request-context"; return RequestHeaders; }()); exports.RequestHeaders = RequestHeaders; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RequestResponseHeaders.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/Data */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Data_1, Enums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Data = /** @class */ (function (_super) { __extends(Data, _super); /** * Constructs a new instance of telemetry data. */ function Data(baseType, data) { var _this = _super.call(this) || this; /** * The data contract for serializing this object. */ _this.aiDataContract = { baseType: Enums_1.FieldType.Required, baseData: Enums_1.FieldType.Required }; _this.baseType = baseType; _this.baseData = data; return _this; } return Data; }(Data_1.Data)); exports.Data = Data; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Data.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/DataPoint */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataPoint_1, Enums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DataPoint = /** @class */ (function (_super) { __extends(DataPoint, _super); function DataPoint() { var _this = _super !== null && _super.apply(this, arguments) || this; /** * The data contract for serializing this object. */ _this.aiDataContract = { name: Enums_1.FieldType.Required, kind: Enums_1.FieldType.Default, value: Enums_1.FieldType.Required, count: Enums_1.FieldType.Default, min: Enums_1.FieldType.Default, max: Enums_1.FieldType.Default, stdDev: Enums_1.FieldType.Default }; return _this; } return DataPoint; }(DataPoint_1.DataPoint)); exports.DataPoint = DataPoint; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPoint.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ../../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DataSanitizer = /** @class */ (function () { function DataSanitizer() { } DataSanitizer.sanitizeKeyAndAddUniqueness = function (logger, key, map) { var origLength = key.length; var field = DataSanitizer.sanitizeKey(logger, key); // validation truncated the length. We need to add uniqueness if (field.length !== origLength) { var i = 0; var uniqueField = field; while (map[uniqueField] !== undefined) { i++; uniqueField = field.substring(0, DataSanitizer.MAX_NAME_LENGTH - 3) + DataSanitizer.padNumber(i); } field = uniqueField; } return field; }; DataSanitizer.sanitizeKey = function (logger, name) { if (name) { // Remove any leading or trailing whitepace name = Util_1.Util.trim(name.toString()); // truncate the string to 150 chars if (name.length > DataSanitizer.MAX_NAME_LENGTH) { name = name.substring(0, DataSanitizer.MAX_NAME_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + DataSanitizer.MAX_NAME_LENGTH + " characters.", { name: name }, true); } } return name; }; DataSanitizer.sanitizeString = function (logger, value, maxLength) { if (maxLength === void 0) { maxLength = DataSanitizer.MAX_STRING_LENGTH; } if (value) { maxLength = maxLength ? maxLength : DataSanitizer.MAX_STRING_LENGTH; // in case default parameters dont work value = Util_1.Util.trim(value); if (value.toString().length > maxLength) { value = value.toString().substring(0, maxLength); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true); } } return value; }; DataSanitizer.sanitizeUrl = function (logger, url) { return DataSanitizer.sanitizeInput(logger, url, DataSanitizer.MAX_URL_LENGTH, applicationinsights_core_js_1._InternalMessageId.UrlTooLong); }; DataSanitizer.sanitizeMessage = function (logger, message) { if (message) { if (message.length > DataSanitizer.MAX_MESSAGE_LENGTH) { message = message.substring(0, DataSanitizer.MAX_MESSAGE_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.MessageTruncated, "message is too long, it has been truncated to " + DataSanitizer.MAX_MESSAGE_LENGTH + " characters.", { message: message }, true); } } return message; }; DataSanitizer.sanitizeException = function (logger, exception) { if (exception) { if (exception.length > DataSanitizer.MAX_EXCEPTION_LENGTH) { exception = exception.substring(0, DataSanitizer.MAX_EXCEPTION_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + DataSanitizer.MAX_EXCEPTION_LENGTH + " characters.", { exception: exception }, true); } } return exception; }; DataSanitizer.sanitizeProperties = function (logger, properties) { if (properties) { var tempProps = {}; for (var prop in properties) { var value = DataSanitizer.sanitizeString(logger, properties[prop], DataSanitizer.MAX_PROPERTY_LENGTH); prop = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, prop, tempProps); tempProps[prop] = value; } properties = tempProps; } return properties; }; DataSanitizer.sanitizeMeasurements = function (logger, measurements) { if (measurements) { var tempMeasurements = {}; for (var measure in measurements) { var value = measurements[measure]; measure = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements); tempMeasurements[measure] = value; } measurements = tempMeasurements; } return measurements; }; DataSanitizer.sanitizeId = function (logger, id) { return id ? DataSanitizer.sanitizeInput(logger, id, DataSanitizer.MAX_ID_LENGTH, applicationinsights_core_js_1._InternalMessageId.IdTooLong).toString() : id; }; DataSanitizer.sanitizeInput = function (logger, input, maxLength, _msgId) { if (input) { input = Util_1.Util.trim(input); if (input.length > maxLength) { input = input.substring(0, maxLength); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true); } } return input; }; DataSanitizer.padNumber = function (num) { var s = "00" + num; return s.substr(s.length - 3); }; /** * Max length allowed for custom names. */ DataSanitizer.MAX_NAME_LENGTH = 150; /** * Max length allowed for Id field in page views. */ DataSanitizer.MAX_ID_LENGTH = 128; /** * Max length allowed for custom values. */ DataSanitizer.MAX_PROPERTY_LENGTH = 8192; /** * Max length allowed for names */ DataSanitizer.MAX_STRING_LENGTH = 1024; /** * Max length allowed for url. */ DataSanitizer.MAX_URL_LENGTH = 2048; /** * Max length allowed for messages. */ DataSanitizer.MAX_MESSAGE_LENGTH = 32768; /** * Max length allowed for exceptions. */ DataSanitizer.MAX_EXCEPTION_LENGTH = 32768; return DataSanitizer; }()); exports.DataSanitizer = DataSanitizer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataSanitizer.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js": /*!*************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/Envelope */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js"), __webpack_require__(/*! ./DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Envelope_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Envelope = /** @class */ (function (_super) { __extends(Envelope, _super); /** * Constructs a new instance of telemetry data. */ function Envelope(logger, data, name) { var _this = _super.call(this) || this; _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.data = data; _this.time = Util_1.Util.toISOStringForIE8(new Date()); _this.aiDataContract = { time: Enums_1.FieldType.Required, iKey: Enums_1.FieldType.Required, name: Enums_1.FieldType.Required, sampleRate: function () { return (_this.sampleRate == 100) ? Enums_1.FieldType.Hidden : Enums_1.FieldType.Required; }, tags: Enums_1.FieldType.Required, data: Enums_1.FieldType.Required }; return _this; } return Envelope; }(Envelope_1.Envelope)); exports.Envelope = Envelope; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Envelope.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Event.js": /*!***************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Event.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/EventData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Event = /** @class */ (function (_super) { __extends(Event, _super); /** * Constructs a new instance of the EventTelemetry object */ function Event(logger, name, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Required, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } Event.envelopeType = "Microsoft.ApplicationInsights.{0}.Event"; Event.dataType = "EventData"; return Event; }(EventData_1.EventData)); exports.Event = Event; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Event.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/StackFrame */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/ExceptionData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/ExceptionDetails */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, StackFrame_1, ExceptionData_1, ExceptionDetails_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Exception = /** @class */ (function (_super) { __extends(Exception, _super); /** * Constructs a new isntance of the ExceptionTelemetry object */ function Exception(logger, exception, properties, measurements, severityLevel) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, exceptions: Enums_1.FieldType.Required, severityLevel: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); _this.exceptions = [new _ExceptionDetails(logger, exception)]; if (severityLevel) { _this.severityLevel = severityLevel; } return _this; } /** * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception. */ Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) { return { exceptions: [ { hasFullStack: true, message: message, stack: details, typeName: typeName } ] }; }; Exception.envelopeType = "Microsoft.ApplicationInsights.{0}.Exception"; Exception.dataType = "ExceptionData"; return Exception; }(ExceptionData_1.ExceptionData)); exports.Exception = Exception; var _ExceptionDetails = /** @class */ (function (_super) { __extends(_ExceptionDetails, _super); function _ExceptionDetails(logger, exception) { var _this = _super.call(this) || this; _this.aiDataContract = { id: Enums_1.FieldType.Default, outerId: Enums_1.FieldType.Default, typeName: Enums_1.FieldType.Required, message: Enums_1.FieldType.Required, hasFullStack: Enums_1.FieldType.Default, stack: Enums_1.FieldType.Default, parsedStack: Enums_1.FieldType.Array }; _this.typeName = DataSanitizer_1.DataSanitizer.sanitizeString(logger, exception.name) || Util_1.Util.NotSpecified; _this.message = DataSanitizer_1.DataSanitizer.sanitizeMessage(logger, exception.message) || Util_1.Util.NotSpecified; var stack = exception["stack"]; _this.parsedStack = _this.parseStack(stack); _this.stack = DataSanitizer_1.DataSanitizer.sanitizeException(logger, stack); _this.hasFullStack = Util_1.Util.isArray(_this.parsedStack) && _this.parsedStack.length > 0; return _this; } _ExceptionDetails.prototype.parseStack = function (stack) { var parsedStack = undefined; if (typeof stack === "string") { var frames = stack.split('\n'); parsedStack = []; var level = 0; var totalSizeInBytes = 0; for (var i = 0; i <= frames.length; i++) { var frame = frames[i]; if (_StackFrame.regex.test(frame)) { var parsedFrame = new _StackFrame(frames[i], level++); totalSizeInBytes += parsedFrame.sizeInBytes; parsedStack.push(parsedFrame); } } // DP Constraint - exception parsed stack must be < 32KB // remove frames from the middle to meet the threshold var exceptionParsedStackThreshold = 32 * 1024; if (totalSizeInBytes > exceptionParsedStackThreshold) { var left = 0; var right = parsedStack.length - 1; var size = 0; var acceptedLeft = left; var acceptedRight = right; while (left < right) { // check size var lSize = parsedStack[left].sizeInBytes; var rSize = parsedStack[right].sizeInBytes; size += lSize + rSize; if (size > exceptionParsedStackThreshold) { // remove extra frames from the middle var howMany = acceptedRight - acceptedLeft + 1; parsedStack.splice(acceptedLeft, howMany); break; } // update pointers acceptedLeft = left; acceptedRight = right; left++; right--; } } } return parsedStack; }; return _ExceptionDetails; }(ExceptionDetails_1.ExceptionDetails)); var _StackFrame = /** @class */ (function (_super) { __extends(_StackFrame, _super); function _StackFrame(frame, level) { var _this = _super.call(this) || this; _this.sizeInBytes = 0; _this.aiDataContract = { level: Enums_1.FieldType.Required, method: Enums_1.FieldType.Required, assembly: Enums_1.FieldType.Default, fileName: Enums_1.FieldType.Default, line: Enums_1.FieldType.Default }; _this.level = level; _this.method = ""; _this.assembly = Util_1.Util.trim(frame); var matches = frame.match(_StackFrame.regex); if (matches && matches.length >= 5) { _this.method = Util_1.Util.trim(matches[2]) || _this.method; _this.fileName = Util_1.Util.trim(matches[4]); _this.line = parseInt(matches[5]) || 0; } _this.sizeInBytes += _this.method.length; _this.sizeInBytes += _this.fileName.length; _this.sizeInBytes += _this.assembly.length; // todo: these might need to be removed depending on how the back-end settles on their size calculation _this.sizeInBytes += _StackFrame.baseSize; _this.sizeInBytes += _this.level.toString().length; _this.sizeInBytes += _this.line.toString().length; return _this; } // regex to match stack frames from ie/chrome/ff // methodName=$2, fileName=$4, lineNo=$5, column=$6 _StackFrame.regex = /^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/; _StackFrame.baseSize = 58; //'{"method":"","level":,"assembly":"","fileName":"","line":}'.length return _StackFrame; }(StackFrame_1.StackFrame)); exports._StackFrame = _StackFrame; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Exception.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js": /*!****************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/MetricData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./Common/DataPoint */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, MetricData_1, DataSanitizer_1, Enums_1, DataPoint_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Metric = /** @class */ (function (_super) { __extends(Metric, _super); /** * Constructs a new instance of the MetricTelemetry object */ function Metric(logger, name, value, count, min, max, properties) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, metrics: Enums_1.FieldType.Required, properties: Enums_1.FieldType.Default }; var dataPoint = new DataPoint_1.DataPoint(); dataPoint.count = count > 0 ? count : undefined; dataPoint.max = isNaN(max) || max === null ? undefined : max; dataPoint.min = isNaN(min) || min === null ? undefined : min; dataPoint.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; dataPoint.value = value; _this.metrics = [dataPoint]; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); return _this; } Metric.envelopeType = "Microsoft.ApplicationInsights.{0}.Metric"; Metric.dataType = "MetricData"; return Metric; }(MetricData_1.MetricData)); exports.Metric = Metric; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Metric.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js": /*!******************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageView = /** @class */ (function (_super) { __extends(PageView, _super); /** * Constructs a new instance of the PageEventTelemetry object */ function PageView(logger, name, url, durationMs, properties, measurements, id) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, url: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default, id: Enums_1.FieldType.Default, }; _this.id = DataSanitizer_1.DataSanitizer.sanitizeId(logger, id); _this.url = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, url); _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; if (!isNaN(durationMs)) { _this.duration = Util_1.Util.msToTimeSpan(durationMs); } _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } PageView.envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview"; PageView.dataType = "PageviewData"; return PageView; }(PageViewData_1.PageViewData)); exports.PageView = PageView; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageView.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/PageViewPerfData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewPerfData_1, Enums_1, DataSanitizer_1, Util_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewPerformance = /** @class */ (function (_super) { __extends(PageViewPerformance, _super); /** * Constructs a new instance of the PageEventTelemetry object */ function PageViewPerformance(logger, name, url, unused, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, url: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, perfTotal: Enums_1.FieldType.Default, networkConnect: Enums_1.FieldType.Default, sentRequest: Enums_1.FieldType.Default, receivedResponse: Enums_1.FieldType.Default, domProcessing: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.isValid = false; /* * http://www.w3.org/TR/navigation-timing/#processing-model * |-navigationStart * | |-connectEnd * | ||-requestStart * | || |-responseStart * | || | |-responseEnd * | || | | * | || | | |-loadEventEnd * |---network---||---request---|---response---|---dom---| * |--------------------------total----------------------| */ var timing = PageViewPerformance.getPerformanceTiming(); if (timing) { var total = PageViewPerformance.getDuration(timing.navigationStart, timing.loadEventEnd); var network = PageViewPerformance.getDuration(timing.navigationStart, timing.connectEnd); var request = PageViewPerformance.getDuration(timing.requestStart, timing.responseStart); var response = PageViewPerformance.getDuration(timing.responseStart, timing.responseEnd); var dom = PageViewPerformance.getDuration(timing.responseEnd, timing.loadEventEnd); if (total == 0) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ErrorPVCalc, "error calculating page view performance.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (!PageViewPerformance.shouldCollectDuration(total, network, request, response, dom)) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.InvalidDurationValue, "Invalid page load duration value. Browser perf data won't be sent.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (total < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(dom)) { // some browsers may report individual components incorrectly so that the sum of the parts will be bigger than total PLT // in this case, don't report client performance from this page logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ClientPerformanceMathError, "client performance math error.", { total: total, network: network, request: request, response: response, dom: dom }); } else { _this.durationMs = total; // convert to timespans _this.perfTotal = _this.duration = Util_1.Util.msToTimeSpan(total); _this.networkConnect = Util_1.Util.msToTimeSpan(network); _this.sentRequest = Util_1.Util.msToTimeSpan(request); _this.receivedResponse = Util_1.Util.msToTimeSpan(response); _this.domProcessing = Util_1.Util.msToTimeSpan(dom); _this.isValid = true; } } _this.url = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, url); _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } /** * Indicates whether this instance of PageViewPerformance is valid and should be sent */ PageViewPerformance.prototype.getIsValid = function () { return this.isValid; }; /** * Gets the total duration (PLT) in milliseconds. Check getIsValid() before using this method. */ PageViewPerformance.prototype.getDurationMs = function () { return this.durationMs; }; PageViewPerformance.getPerformanceTiming = function () { if (PageViewPerformance.isPerformanceTimingSupported()) { return window.performance.timing; } return null; }; /** * Returns true is window performance timing API is supported, false otherwise. */ PageViewPerformance.isPerformanceTimingSupported = function () { return typeof window != "undefined" && window.performance && window.performance.timing; }; /** * As page loads different parts of performance timing numbers get set. When all of them are set we can report it. * Returns true if ready, false otherwise. */ PageViewPerformance.isPerformanceTimingDataReady = function () { var timing = window.performance.timing; return timing.domainLookupStart > 0 && timing.navigationStart > 0 && timing.responseStart > 0 && timing.requestStart > 0 && timing.loadEventEnd > 0 && timing.responseEnd > 0 && timing.connectEnd > 0 && timing.domLoading > 0; }; PageViewPerformance.getDuration = function (start, end) { var duration = undefined; if (!(isNaN(start) || isNaN(end))) { duration = Math.max(end - start, 0); } return duration; }; /** * This method tells if given durations should be excluded from collection. */ PageViewPerformance.shouldCollectDuration = function () { var durations = []; for (var _i = 0; _i < arguments.length; _i++) { durations[_i] = arguments[_i]; } // a full list of Google crawlers user agent strings - https://support.google.com/webmasters/answer/1061943?hl=en var botAgentNames = ['googlebot', 'adsbot-google', 'apis-google', 'mediapartners-google']; var userAgent = navigator.userAgent; var isGoogleBot = false; if (userAgent) { for (var i_1 = 0; i_1 < botAgentNames.length; i_1++) { isGoogleBot = isGoogleBot || userAgent.toLowerCase().indexOf(botAgentNames[i_1]) !== -1; } } if (isGoogleBot) { // Don't report durations for GoogleBot, it is returning invalid values in performance.timing API. return false; } else { // for other page views, don't report if it's outside of a reasonable range for (var i = 0; i < durations.length; i++) { if (durations[i] >= PageViewPerformance.MAX_DURATION_ALLOWED) { return false; } } } return true; }; PageViewPerformance.envelopeType = "Microsoft.ApplicationInsights.{0}.PageviewPerformance"; PageViewPerformance.dataType = "PageviewPerformanceData"; PageViewPerformance.MAX_DURATION_ALLOWED = 3600000; // 1h return PageViewPerformance; }(PageViewPerfData_1.PageViewPerfData)); exports.PageViewPerformance = PageViewPerformance; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerformance.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/RemoteDependencyData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataSanitizer_1, Enums_1, Util_1, Util_2, RemoteDependencyData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RemoteDependencyData = /** @class */ (function (_super) { __extends(RemoteDependencyData, _super); /** * Constructs a new instance of the RemoteDependencyData object */ function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { id: Enums_1.FieldType.Required, ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, resultCode: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, success: Enums_1.FieldType.Default, data: Enums_1.FieldType.Default, target: Enums_1.FieldType.Default, type: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default, kind: Enums_1.FieldType.Default, value: Enums_1.FieldType.Default, count: Enums_1.FieldType.Default, min: Enums_1.FieldType.Default, max: Enums_1.FieldType.Default, stdDev: Enums_1.FieldType.Default, dependencyKind: Enums_1.FieldType.Default, dependencySource: Enums_1.FieldType.Default, commandName: Enums_1.FieldType.Default, dependencyTypeName: Enums_1.FieldType.Default, }; _this.id = id; _this.duration = Util_1.Util.msToTimeSpan(value); _this.success = success; _this.resultCode = resultCode + ""; _this.type = "Ajax"; _this.data = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, commandName); var dependencyFields = Util_2.AjaxHelper.ParseDependencyPath(logger, absoluteUrl, method, commandName); _this.target = dependencyFields.target; _this.name = dependencyFields.name; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } RemoteDependencyData.envelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency"; RemoteDependencyData.dataType = "RemoteDependencyData"; return RemoteDependencyData; }(RemoteDependencyData_1.RemoteDependencyData)); exports.RemoteDependencyData = RemoteDependencyData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDependencyData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js": /*!***************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/MessageData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, MessageData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Trace = /** @class */ (function (_super) { __extends(Trace, _super); /** * Constructs a new instance of the TraceTelemetry object */ function Trace(logger, message, properties, severityLevel) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, message: Enums_1.FieldType.Required, severityLevel: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default }; message = message || Util_1.Util.NotSpecified; _this.message = DataSanitizer_1.DataSanitizer.sanitizeMessage(logger, message); _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); if (severityLevel) { _this.severityLevel = severityLevel; } return _this; } Trace.envelopeType = "Microsoft.ApplicationInsights.{0}.Message"; Trace.dataType = "MessageData"; return Trace; }(MessageData_1.MessageData)); exports.Trace = Trace; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Trace.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js": /*!********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Util_1, DataSanitizer_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TelemetryItemCreator = /** @class */ (function () { function TelemetryItemCreator() { } /** * Create a telemetry item that the 1DS channel understands * @param item domain specific properties; part B * @param baseType telemetry item type. ie PageViewData * @param envelopeName name of the envelope. ie Microsoft.ApplicationInsights..PageView * @param customProperties user defined custom properties; part C * @param systemProperties system properties that are added to the context; part A * @returns ITelemetryItem that is sent to channel */ TelemetryItemCreator.create = function (item, baseType, envelopeName, logger, customProperties, systemProperties) { envelopeName = DataSanitizer_1.DataSanitizer.sanitizeString(logger, envelopeName) || Util_1.Util.NotSpecified; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(item) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(baseType) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(envelopeName)) { throw Error("Input doesn't contain all required fields"); } var telemetryItem = { name: envelopeName, timestamp: new Date(), instrumentationKey: "", ctx: systemProperties ? systemProperties : {}, tags: [], data: {}, baseType: baseType, baseData: item }; // Part C if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties)) { for (var prop in customProperties) { if (customProperties.hasOwnProperty(prop)) { telemetryItem.data[prop] = customProperties[prop]; } } } return telemetryItem; }; return TelemetryItemCreator; }()); exports.TelemetryItemCreator = TelemetryItemCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=TelemetryItemCreator.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Util.js": /*!****************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Util.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./RequestResponseHeaders */ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Enums_1, applicationinsights_core_js_1, RequestResponseHeaders_1, DataSanitizer_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Util = /** @class */ (function () { function Util() { } /* * Force the SDK not to use local and session storage */ Util.disableStorage = function () { Util._canUseLocalStorage = false; Util._canUseSessionStorage = false; }; /** * Gets the localStorage object if available * @return {Storage} - Returns the storage object if available else returns null */ Util._getLocalStorageObject = function () { if (Util.canUseLocalStorage()) { return Util._getVerifiedStorageObject(Enums_1.StorageType.LocalStorage); } return null; }; /** * Tests storage object (localStorage or sessionStorage) to verify that it is usable * More details here: https://mathiasbynens.be/notes/localstorage-pattern * @param storageType Type of storage * @return {Storage} Returns storage object verified that it is usable */ Util._getVerifiedStorageObject = function (storageType) { var storage = null; var fail; var uid; try { uid = new Date; storage = storageType === Enums_1.StorageType.LocalStorage ? window.localStorage : window.sessionStorage; storage.setItem(uid, uid); fail = storage.getItem(uid) != uid; storage.removeItem(uid); if (fail) { storage = null; } } catch (exception) { storage = null; } return storage; }; /** * Checks if endpoint URL is application insights internal injestion service URL. * * @param endpointUrl Endpoint URL to check. * @returns {boolean} True if if endpoint URL is application insights internal injestion service URL. */ Util.isInternalApplicationInsightsEndpoint = function (endpointUrl) { return Util._internalEndpoints.indexOf(endpointUrl.toLowerCase()) !== -1; }; /** * Check if the browser supports local storage. * * @returns {boolean} True if local storage is supported. */ Util.canUseLocalStorage = function () { if (Util._canUseLocalStorage === undefined) { Util._canUseLocalStorage = !!Util._getVerifiedStorageObject(Enums_1.StorageType.LocalStorage); } return Util._canUseLocalStorage; }; /** * Get an object from the browser's local storage * * @param {string} name - the name of the object to get from storage * @returns {string} The contents of the storage object with the given name. Null if storage is not supported. */ Util.getStorage = function (logger, name) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return null; }; /** * Set the contents of an object in the browser's local storage * * @param {string} name - the name of the object to set in storage * @param {string} data - the contents of the object to set in storage * @returns {boolean} True if the storage object could be written. */ Util.setStorage = function (logger, name, data) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Remove an object from the browser's local storage * * @param {string} name - the name of the object to remove from storage * @returns {boolean} True if the storage object could be removed. */ Util.removeStorage = function (logger, name) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { storage.removeItem(name); return true; } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Gets the sessionStorage object if available * @return {Storage} - Returns the storage object if available else returns null */ Util._getSessionStorageObject = function () { if (Util.canUseSessionStorage()) { return Util._getVerifiedStorageObject(Enums_1.StorageType.SessionStorage); } return null; }; /** * Check if the browser supports session storage. * * @returns {boolean} True if session storage is supported. */ Util.canUseSessionStorage = function () { if (Util._canUseSessionStorage === undefined) { Util._canUseSessionStorage = !!Util._getVerifiedStorageObject(Enums_1.StorageType.SessionStorage); } return Util._canUseSessionStorage; }; /** * Gets the list of session storage keys * * @returns {string[]} List of session storage keys */ Util.getSessionStorageKeys = function () { var keys = []; if (Util.canUseSessionStorage()) { for (var key in window.sessionStorage) { keys.push(key); } } return keys; }; /** * Get an object from the browser's session storage * * @param {string} name - the name of the object to get from storage * @returns {string} The contents of the storage object with the given name. Null if storage is not supported. */ Util.getSessionStorage = function (logger, name) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return null; }; /** * Set the contents of an object in the browser's session storage * * @param {string} name - the name of the object to set in storage * @param {string} data - the contents of the object to set in storage * @returns {boolean} True if the storage object could be written. */ Util.setSessionStorage = function (logger, name, data) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Remove an object from the browser's session storage * * @param {string} name - the name of the object to remove from storage * @returns {boolean} True if the storage object could be removed. */ Util.removeSessionStorage = function (logger, name) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { storage.removeItem(name); return true; } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /* * Force the SDK not to store and read any data from cookies */ Util.disableCookies = function () { Util._canUseCookies = false; }; /* * helper method to tell if document.cookie object is available */ Util.canUseCookies = function (logger) { if (Util._canUseCookies === undefined) { Util._canUseCookies = false; try { Util._canUseCookies = Util.document.cookie !== undefined; } catch (e) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CannotAccessCookie, "Cannot access document.cookie - " + Util.getExceptionName(e), { exception: Util.dump(e) }); } ; } return Util._canUseCookies; }; /** * helper method to set userId and sessionId cookie */ Util.setCookie = function (logger, name, value, domain) { var domainAttrib = ""; var secureAttrib = ""; if (domain) { domainAttrib = ";domain=" + domain; } if (Util.document.location && Util.document.location.protocol === "https:") { secureAttrib = ";secure"; } if (Util.canUseCookies(logger)) { Util.document.cookie = name + "=" + value + domainAttrib + ";path=/" + secureAttrib; } }; Util.stringToBoolOrDefault = function (str, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } if (str === undefined || str === null) { return defaultValue; } return str.toString().toLowerCase() === "true"; }; /** * helper method to access userId and sessionId cookie */ Util.getCookie = function (logger, name) { if (!Util.canUseCookies(logger)) { return; } var value = ""; if (name && name.length) { var cookieName = name + "="; var cookies = Util.document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; cookie = Util.trim(cookie); if (cookie && cookie.indexOf(cookieName) === 0) { value = cookie.substring(cookieName.length, cookies[i].length); break; } } } return value; }; /** * Deletes a cookie by setting it's expiration time in the past. * @param name - The name of the cookie to delete. */ Util.deleteCookie = function (logger, name) { if (Util.canUseCookies(logger)) { // Setting the expiration date in the past immediately removes the cookie Util.document.cookie = name + "=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;"; } }; /** * helper method to trim strings (IE8 does not implement String.prototype.trim) */ Util.trim = function (str) { if (typeof str !== "string") return str; return str.replace(/^\s+|\s+$/g, ""); }; /** * generate random id string */ Util.newId = function () { var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var result = ""; // tslint:disable-next-line:insecure-random var random = Math.random() * 1073741824; //5 symbols in base64, almost maxint while (random > 0) { var char = base64chars.charAt(random % 64); result += char; random = Math.floor(random / 64); } return result; }; /** * Check if an object is of type Array */ Util.isArray = function (obj) { return Object.prototype.toString.call(obj) === "[object Array]"; }; /** * Check if an object is of type Error */ Util.isError = function (obj) { return Object.prototype.toString.call(obj) === "[object Error]"; }; /** * Check if an object is of type Date */ Util.isDate = function (obj) { return Object.prototype.toString.call(obj) === "[object Date]"; }; /** * Convert a date to I.S.O. format in IE8 */ Util.toISOStringForIE8 = function (date) { if (Util.isDate(date)) { if (Date.prototype.toISOString) { return date.toISOString(); } else { var pad = function (num) { var r = String(num); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } }; /** * Gets IE version if we are running on IE, or null otherwise */ Util.getIEVersion = function (userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } var myNav = userAgentStr ? userAgentStr.toLowerCase() : navigator.userAgent.toLowerCase(); return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : null; }; /** * Convert ms to c# time span format */ Util.msToTimeSpan = function (totalms) { if (isNaN(totalms) || totalms < 0) { totalms = 0; } totalms = Math.round(totalms); var ms = "" + totalms % 1000; var sec = "" + Math.floor(totalms / 1000) % 60; var min = "" + Math.floor(totalms / (1000 * 60)) % 60; var hour = "" + Math.floor(totalms / (1000 * 60 * 60)) % 24; var days = Math.floor(totalms / (1000 * 60 * 60 * 24)); ms = ms.length === 1 ? "00" + ms : ms.length === 2 ? "0" + ms : ms; sec = sec.length < 2 ? "0" + sec : sec; min = min.length < 2 ? "0" + min : min; hour = hour.length < 2 ? "0" + hour : hour; return (days > 0 ? days + "." : "") + hour + ":" + min + ":" + sec + "." + ms; }; /** * Checks if error has no meaningful data inside. Ususally such errors are received by window.onerror when error * happens in a script from other domain (cross origin, CORS). */ Util.isCrossOriginError = function (message, url, lineNumber, columnNumber, error) { return (message === "Script error." || message === "Script error") && !error; }; /** * Returns string representation of an object suitable for diagnostics logging. */ Util.dump = function (object) { var objectTypeDump = Object.prototype.toString.call(object); var propertyValueDump = JSON.stringify(object); if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } return objectTypeDump + propertyValueDump; }; /** * Returns the name of object if it's an Error. Otherwise, returns empty string. */ Util.getExceptionName = function (object) { var objectTypeDump = Object.prototype.toString.call(object); if (objectTypeDump === "[object Error]") { return object.name; } return ""; }; /** * Adds an event handler for the specified event * @param eventName {string} - The name of the event * @param callback {any} - The callback function that needs to be executed for the given event * @return {boolean} - true if the handler was successfully added */ Util.addEventHandler = function (eventName, callback) { if (!window || typeof eventName !== 'string' || typeof callback !== 'function') { return false; } // Create verb for the event var verbEventName = 'on' + eventName; // check if addEventListener is available if (window.addEventListener) { window.addEventListener(eventName, callback, false); } else if (window["attachEvent"]) { window["attachEvent"](verbEventName, callback); } else { return false; } return true; }; /** * Tells if a browser supports a Beacon API */ Util.IsBeaconApiSupported = function () { return ('sendBeacon' in navigator && navigator.sendBeacon); }; Util.document = typeof document !== "undefined" ? document : {}; Util._canUseCookies = undefined; Util._canUseLocalStorage = undefined; Util._canUseSessionStorage = undefined; // listing only non-geo specific locations Util._internalEndpoints = [ "https://dc.services.visualstudio.com/v2/track", "https://breeze.aimon.applicationinsights.io/v2/track", "https://dc-int.services.visualstudio.com/v2/track" ]; Util.NotSpecified = "not_specified"; return Util; }()); exports.Util = Util; var UrlHelper = /** @class */ (function () { function UrlHelper() { } UrlHelper.parseUrl = function (url) { if (!UrlHelper.htmlAnchorElement) { UrlHelper.htmlAnchorElement = !!UrlHelper.document.createElement ? UrlHelper.document.createElement('a') : {}; } UrlHelper.htmlAnchorElement.href = url; return UrlHelper.htmlAnchorElement; }; UrlHelper.getAbsoluteUrl = function (url) { var result; var a = UrlHelper.parseUrl(url); if (a) { result = a.href; } return result; }; UrlHelper.getPathName = function (url) { var result; var a = UrlHelper.parseUrl(url); if (a) { result = a.pathname; } return result; }; UrlHelper.getCompleteUrl = function (method, absoluteUrl) { if (method) { return method.toUpperCase() + " " + absoluteUrl; } else { return absoluteUrl; } }; UrlHelper.document = typeof document !== "undefined" ? document : {}; return UrlHelper; }()); exports.UrlHelper = UrlHelper; var CorrelationIdHelper = /** @class */ (function () { function CorrelationIdHelper() { } /** * Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers */ CorrelationIdHelper.canIncludeCorrelationHeader = function (config, requestUrl, currentHost) { if (config && config.disableCorrelationHeaders) { return false; } if (!requestUrl) { return false; } var requestHost = UrlHelper.parseUrl(requestUrl).host.toLowerCase(); if ((!config || !config.enableCorsCorrelation) && requestHost !== currentHost) { return false; } var excludedDomains = config && config.correlationHeaderExcludedDomains; if (!excludedDomains || excludedDomains.length == 0) { return true; } for (var i = 0; i < excludedDomains.length; i++) { var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\./g, "\.").replace(/\*/g, ".*")); if (regex.test(requestHost)) { return false; } } return true; }; /** * Combines target appId and target role name from response header. */ CorrelationIdHelper.getCorrelationContext = function (responseHeader) { if (responseHeader) { var correlationId = CorrelationIdHelper.getCorrelationContextValue(responseHeader, RequestResponseHeaders_1.RequestHeaders.requestContextTargetKey); if (correlationId && correlationId !== CorrelationIdHelper.correlationIdPrefix) { return correlationId; } } }; /** * Gets key from correlation response header */ CorrelationIdHelper.getCorrelationContextValue = function (responseHeader, key) { if (responseHeader) { var keyValues = responseHeader.split(","); for (var i = 0; i < keyValues.length; ++i) { var keyValue = keyValues[i].split("="); if (keyValue.length == 2 && keyValue[0] == key) { return keyValue[1]; } } } }; CorrelationIdHelper.correlationIdPrefix = "cid-v1:"; return CorrelationIdHelper; }()); exports.CorrelationIdHelper = CorrelationIdHelper; var AjaxHelper = /** @class */ (function () { function AjaxHelper() { } AjaxHelper.ParseDependencyPath = function (logger, absoluteUrl, method, pathName) { var target, name; if (absoluteUrl && absoluteUrl.length > 0) { var parsedUrl = UrlHelper.parseUrl(absoluteUrl); target = parsedUrl.host; if (parsedUrl.pathname != null) { var pathName = (parsedUrl.pathname.length === 0) ? "/" : parsedUrl.pathname; if (pathName.charAt(0) !== '/') { pathName = "/" + pathName; } name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, method ? method + " " + pathName : pathName); } else { name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, absoluteUrl); } } else { target = pathName; name = pathName; } return { target: target, name: name }; }; return AjaxHelper; }()); exports.AjaxHelper = AjaxHelper; /** * A utility class that helps getting time related parameters */ var DateTimeUtils = /** @class */ (function () { function DateTimeUtils() { } /** * Get the number of milliseconds since 1970/01/01 in local timezone */ DateTimeUtils.Now = (window.performance && window.performance.now && window.performance.timing) ? function () { return window.performance.now() + window.performance.timing.navigationStart; } : function () { return new Date().getTime(); }; /** * Gets duration between two timestamps */ DateTimeUtils.GetDuration = function (start, end) { var result = null; if (start !== 0 && end !== 0 && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(start) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(end)) { result = end - start; } return result; }; return DateTimeUtils; }()); exports.DateTimeUtils = DateTimeUtils; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Util.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/applicationinsights-common.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ./Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./RequestResponseHeaders */ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js"), __webpack_require__(/*! ./Constants */ "./node_modules/applicationinsights-common/bundle/Constants.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/Data */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/Base */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js"), __webpack_require__(/*! ./Telemetry/Common/Envelope */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js"), __webpack_require__(/*! ./Telemetry/Event */ "./node_modules/applicationinsights-common/bundle/Telemetry/Event.js"), __webpack_require__(/*! ./Telemetry/Exception */ "./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js"), __webpack_require__(/*! ./Telemetry/Metric */ "./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js"), __webpack_require__(/*! ./Telemetry/PageView */ "./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js"), __webpack_require__(/*! ./Telemetry/RemoteDependencyData */ "./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js"), __webpack_require__(/*! ./Telemetry/Trace */ "./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js"), __webpack_require__(/*! ./Telemetry/PageViewPerformance */ "./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js"), __webpack_require__(/*! ./Telemetry/Common/Data */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/SeverityLevel */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/ContextTagKeys */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ./TelemetryItemCreator */ "./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Util_1, Enums_1, RequestResponseHeaders_1, Constants_1, Data_1, Base_1, Envelope_1, Event_1, Exception_1, Metric_1, PageView_1, PageViewData_1, RemoteDependencyData_1, Trace_1, PageViewPerformance_1, Data_2, SeverityLevel_1, ContextTagKeys_1, DataSanitizer_1, TelemetryItemCreator_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Util = Util_1.Util; exports.CorrelationIdHelper = Util_1.CorrelationIdHelper; exports.UrlHelper = Util_1.UrlHelper; exports.DateTimeUtils = Util_1.DateTimeUtils; exports.FieldType = Enums_1.FieldType; exports.RequestHeaders = RequestResponseHeaders_1.RequestHeaders; exports.DisabledPropertyName = Constants_1.DisabledPropertyName; exports.AIData = Data_1.Data; exports.AIBase = Base_1.Base; exports.Envelope = Envelope_1.Envelope; exports.Event = Event_1.Event; exports.Exception = Exception_1.Exception; exports.Metric = Metric_1.Metric; exports.PageView = PageView_1.PageView; exports.PageViewData = PageViewData_1.PageViewData; exports.RemoteDependencyData = RemoteDependencyData_1.RemoteDependencyData; exports.Trace = Trace_1.Trace; exports.PageViewPerformance = PageViewPerformance_1.PageViewPerformance; exports.Data = Data_2.Data; exports.SeverityLevel = SeverityLevel_1.SeverityLevel; exports.ContextTagKeys = ContextTagKeys_1.ContextTagKeys; exports.DataSanitizer = DataSanitizer_1.DataSanitizer; exports.TelemetryItemCreator = TelemetryItemCreator_1.TelemetryItemCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-common.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event. */ exports.EventsDiscardedReason = { /** * Unknown. */ Unknown: 0, /** * Status set to non-retryable. */ NonRetryableStatus: 1, /** * The event is invalid. */ InvalidEvent: 2, /** * The size of the event is too large. */ SizeLimitExceeded: 3, /** * The server is not accepting events from this instrumentation key. */ KillSwitch: 4, /** * The event queue is full. */ QueueFull: 5, }; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventsDiscardedReason.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js": /*!*********************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js ***! \*********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var LoggingSeverity; (function (LoggingSeverity) { /** * Error will be sent as internal telemetry */ LoggingSeverity[LoggingSeverity["CRITICAL"] = 1] = "CRITICAL"; /** * Error will NOT be sent as internal telemetry, and will only be shown in browser console */ LoggingSeverity[LoggingSeverity["WARNING"] = 2] = "WARNING"; })(LoggingSeverity = exports.LoggingSeverity || (exports.LoggingSeverity = {})); /** * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered */ ; exports._InternalMessageId = { // Non user actionable BrowserDoesNotSupportLocalStorage: 0, BrowserCannotReadLocalStorage: 1, BrowserCannotReadSessionStorage: 2, BrowserCannotWriteLocalStorage: 3, BrowserCannotWriteSessionStorage: 4, BrowserFailedRemovalFromLocalStorage: 5, BrowserFailedRemovalFromSessionStorage: 6, CannotSendEmptyTelemetry: 7, ClientPerformanceMathError: 8, ErrorParsingAISessionCookie: 9, ErrorPVCalc: 10, ExceptionWhileLoggingError: 11, FailedAddingTelemetryToBuffer: 12, FailedMonitorAjaxAbort: 13, FailedMonitorAjaxDur: 14, FailedMonitorAjaxOpen: 15, FailedMonitorAjaxRSC: 16, FailedMonitorAjaxSend: 17, FailedMonitorAjaxGetCorrelationHeader: 18, FailedToAddHandlerForOnBeforeUnload: 19, FailedToSendQueuedTelemetry: 20, FailedToReportDataLoss: 21, FlushFailed: 22, MessageLimitPerPVExceeded: 23, MissingRequiredFieldSpecification: 24, NavigationTimingNotSupported: 25, OnError: 26, SessionRenewalDateIsZero: 27, SenderNotInitialized: 28, StartTrackEventFailed: 29, StopTrackEventFailed: 30, StartTrackFailed: 31, StopTrackFailed: 32, TelemetrySampledAndNotSent: 33, TrackEventFailed: 34, TrackExceptionFailed: 35, TrackMetricFailed: 36, TrackPVFailed: 37, TrackPVFailedCalc: 38, TrackTraceFailed: 39, TransmissionFailed: 40, FailedToSetStorageBuffer: 41, FailedToRestoreStorageBuffer: 42, InvalidBackendResponse: 43, FailedToFixDepricatedValues: 44, InvalidDurationValue: 45, TelemetryEnvelopeInvalid: 46, CreateEnvelopeError: 47, // User actionable CannotSerializeObject: 48, CannotSerializeObjectNonSerializable: 49, CircularReferenceDetected: 50, ClearAuthContextFailed: 51, ExceptionTruncated: 52, IllegalCharsInName: 53, ItemNotInArray: 54, MaxAjaxPerPVExceeded: 55, MessageTruncated: 56, NameTooLong: 57, SampleRateOutOfRange: 58, SetAuthContextFailed: 59, SetAuthContextFailedAccountName: 60, StringValueTooLong: 61, StartCalledMoreThanOnce: 62, StopCalledWithoutStart: 63, TelemetryInitializerFailed: 64, TrackArgumentsNotSpecified: 65, UrlTooLong: 66, SessionStorageBufferFull: 67, CannotAccessCookie: 68, IdTooLong: 69, }; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=LoggingEnums.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MinChannelPriorty = 100; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=IChannelControls.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../JavaScriptSDK.Enums/EventsDiscardedReason */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js"), __webpack_require__(/*! ./CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js"), __webpack_require__(/*! ./NotificationManager */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js"), __webpack_require__(/*! ./DiagnosticLogger */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventsDiscardedReason_1, CoreUtils_1, NotificationManager_1, DiagnosticLogger_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; var AppInsightsCore = /** @class */ (function () { function AppInsightsCore() { this._isInitialized = false; this._extensions = new Array(); this._channelController = new ChannelController(); } AppInsightsCore.prototype.initialize = function (config, extensions) { var _this = this; // Make sure core is only initialized once if (this._isInitialized) { throw Error("Core should not be initialized more than once"); } if (!config || CoreUtils_1.CoreUtils.isNullOrUndefined(config.instrumentationKey)) { throw Error("Please provide instrumentation key"); } this.config = config; this._notificationManager = new NotificationManager_1.NotificationManager(); this.config.extensions = CoreUtils_1.CoreUtils.isNullOrUndefined(this.config.extensions) ? [] : this.config.extensions; // add notification to the extensions in the config so other plugins can access it this.config.extensionConfig = CoreUtils_1.CoreUtils.isNullOrUndefined(this.config.extensionConfig) ? {} : this.config.extensionConfig; this.config.extensionConfig.NotificationManager = this._notificationManager; this.logger = new DiagnosticLogger_1.DiagnosticLogger(config); // Initial validation extensions.forEach(function (extension) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(extension.initialize)) { throw Error(validationError); } }); if (this.config.extensions.length > 0) { var isValid_1 = true; this.config.extensions.forEach(function (item) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(item)) { isValid_1 = false; } }); if (!isValid_1) { throw Error(validationError); } } // Initial validation complete // Concat all available extensions before sorting by priority (_a = this._extensions).push.apply(_a, [this._channelController].concat(extensions, this.config.extensions)); this._extensions = this._extensions.sort(function (a, b) { var extA = a; var extB = b; var typeExtA = typeof extA.processTelemetry; var typeExtB = typeof extB.processTelemetry; if (typeExtA === 'function' && typeExtB === 'function') { return extA.priority - extB.priority; } if (typeExtA === 'function' && typeExtB !== 'function') { // keep non telemetryplugin specific extensions at start return 1; } if (typeExtA !== 'function' && typeExtB === 'function') { return -1; } }); // sort complete // Check if any two extensions have the same priority, then warn to console var priority = {}; this._extensions.forEach(function (ext) { var t = ext; if (t && t.priority) { if (!CoreUtils_1.CoreUtils.isNullOrUndefined(priority[t.priority])) { _this.logger.warnToConsole("Two extensions have same priority" + priority[t.priority] + ", " + t.identifier); } else { priority[t.priority] = t.identifier; // set a value } } }); var c = -1; // Set next plugin for all until channel controller for (var idx = 0; idx < this._extensions.length - 1; idx++) { var curr = (this._extensions[idx]); if (curr && typeof curr.processTelemetry !== 'function') { // these are initialized only, allowing an entry point for extensions to be initialized when SDK initializes continue; } if (curr.priority === ChannelControllerPriority) { c = idx + 1; break; // channel controller will set remaining pipeline } this._extensions[idx].setNextPlugin(this._extensions[idx + 1]); // set next plugin } // initialize channel controller first, this will initialize all channel plugins this._channelController.initialize(this.config, this, this._extensions); // initialize remaining regular plugins this._extensions.forEach(function (ext) { var e = ext; if (e && e.priority < ChannelControllerPriority) { ext.initialize(_this.config, _this, _this._extensions); // initialize } }); // Remove sender channels from main list if (c < this._extensions.length) { this._extensions.splice(c); } if (this.getTransmissionControls().length === 0) { throw new Error("No channels available"); } this._isInitialized = true; var _a; }; AppInsightsCore.prototype.getTransmissionControls = function () { return this._channelController.ChannelControls; }; AppInsightsCore.prototype.track = function (telemetryItem) { if (telemetryItem === null) { this._notifiyInvalidEvent(telemetryItem); // throw error throw Error("Invalid telemetry item"); } if (telemetryItem.baseData && !telemetryItem.baseType) { this._notifiyInvalidEvent(telemetryItem); throw Error("Provide data.baseType for data.baseData"); } if (!telemetryItem.baseType) { // Hard coded from Common::Event.ts::Event.dataType telemetryItem.baseType = "EventData"; } if (!telemetryItem.instrumentationKey) { // setup default ikey if not passed in telemetryItem.instrumentationKey = this.config.instrumentationKey; } if (!telemetryItem.timestamp) { // add default timestamp if not passed in telemetryItem.timestamp = new Date(); } // do basic validation before sending it through the pipeline this._validateTelmetryItem(telemetryItem); // invoke any common telemetry processors before sending through pipeline var i = 0; while (i < this._extensions.length) { if (this._extensions[i].processTelemetry) { this._extensions[i].processTelemetry(telemetryItem); // pass on to first extension that can support processing break; } i++; } }; /** * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be * called. * @param {INotificationListener} listener - An INotificationListener object. */ AppInsightsCore.prototype.addNotificationListener = function (listener) { this._notificationManager.addNotificationListener(listener); }; /** * Removes all instances of the listener. * @param {INotificationListener} listener - INotificationListener to remove. */ AppInsightsCore.prototype.removeNotificationListener = function (listener) { this._notificationManager.removeNotificationListener(listener); }; /** * Periodically check logger.queue for */ AppInsightsCore.prototype.pollInternalLogs = function () { var _this = this; if (!(this.config.diagnosticLoggingInterval > 0)) { throw Error("config.diagnosticLoggingInterval must be a positive integer"); } return setInterval(function () { var queue = _this.logger.queue; queue.forEach(function (logMessage) { var item = { name: "InternalMessageId: " + logMessage.messageId, instrumentationKey: _this.config.instrumentationKey, timestamp: new Date(), baseType: DiagnosticLogger_1._InternalLogMessage.dataType, baseData: { message: logMessage.message } }; _this.track(item); }); queue.length = 0; }, this.config.diagnosticLoggingInterval); }; AppInsightsCore.prototype._validateTelmetryItem = function (telemetryItem) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.name)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry name required"); } if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.timestamp)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry timestamp required"); } if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.instrumentationKey)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry instrumentationKey required"); } }; AppInsightsCore.prototype._notifiyInvalidEvent = function (telemetryItem) { this._notificationManager.eventsDiscarded([telemetryItem], EventsDiscardedReason_1.EventsDiscardedReason.InvalidEvent); }; return AppInsightsCore; }()); exports.AppInsightsCore = AppInsightsCore; var ChannelController = /** @class */ (function () { function ChannelController() { this.identifier = "ChannelControllerPlugin"; this.priority = ChannelControllerPriority; // in reserved range 100 to 200 } ChannelController.prototype.processTelemetry = function (item) { this.channelQueue.forEach(function (queues) { // pass on to first item in queue if (queues.length > 0) { queues[0].processTelemetry(item); } }); }; Object.defineProperty(ChannelController.prototype, "ChannelControls", { get: function () { return this.channelQueue; }, enumerable: true, configurable: true }); ChannelController.prototype.initialize = function (config, core, extensions) { var _this = this; this.channelQueue = new Array(); if (config.channels) { config.channels.forEach(function (queue) { if (queue && queue.length > 0) { queue = queue.sort(function (a, b) { return a.priority - b.priority; }); // Initialize each plugin queue.forEach(function (queueItem) { return queueItem.initialize(config, core, extensions); }); for (var i = 1; i < queue.length; i++) { queue[i - 1].setNextPlugin(queue[i]); // setup processing chain } _this.channelQueue.push(queue); } }); } else { var arr = new Array(); for (var i = 0; i < extensions.length; i++) { var plugin = extensions[i]; if (plugin.priority > ChannelControllerPriority) { arr.push(plugin); } } if (arr.length > 0) { // sort if not sorted arr = arr.sort(function (a, b) { return a.priority - b.priority; }); // Initialize each plugin arr.forEach(function (queueItem) { return queueItem.initialize(config, core, extensions); }); // setup next plugin for (var i = 1; i < arr.length; i++) { arr[i - 1].setNextPlugin(arr[i]); } this.channelQueue.push(arr); } } }; return ChannelController; }()); var validationError = "Extensions must provide callback to initialize"; var ChannelControllerPriority = 200; var duplicatePriority = "One or more extensions are set at same priority"; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=AppInsightsCore.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js": /*!************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var CoreUtils = /** @class */ (function () { function CoreUtils() { } CoreUtils.isNullOrUndefined = function (input) { return input === null || input === undefined; }; /** * Creates a new GUID. * @return {string} A GUID. */ CoreUtils.newGuid = function () { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, function (c) { // tslint:disable-next-line:insecure-random var r = (Math.random() * 16 | 0), v = (c === 'x' ? r : r & 0x3 | 0x8); return v.toString(16); }); }; return CoreUtils; }()); exports.CoreUtils = CoreUtils; var GuidRegex = /[xy]/g; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=CoreUtils.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js": /*!*******************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js ***! \*******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../JavaScriptSDK.Enums/LoggingEnums */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js"), __webpack_require__(/*! ./CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, LoggingEnums_1, CoreUtils_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } this.messageId = msgId; this.message = (isUserAct ? _InternalLogMessage.AiUserActionablePrefix : _InternalLogMessage.AiNonUserActionablePrefix) + msgId; var diagnosticText = (msg ? " message:" + _InternalLogMessage.sanitizeDiagnosticText(msg) : "") + (properties ? " props:" + _InternalLogMessage.sanitizeDiagnosticText(JSON.stringify(properties)) : ""); this.message += diagnosticText; } _InternalLogMessage.sanitizeDiagnosticText = function (text) { return "\"" + text.replace(/\"/g, "") + "\""; }; _InternalLogMessage.dataType = "MessageData"; /** * For user non actionable traces use AI Internal prefix. */ _InternalLogMessage.AiNonUserActionablePrefix = "AI (Internal): "; /** * Prefix of the traces in portal. */ _InternalLogMessage.AiUserActionablePrefix = "AI: "; return _InternalLogMessage; }()); exports._InternalLogMessage = _InternalLogMessage; var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { /** * Session storage key for the prefix for the key indicating message type already logged */ this.AIInternalMessagePrefix = "AITR_"; /** * When this is true the SDK will throw exceptions to aid in debugging. */ this.enableDebugExceptions = function () { return false; }; /** * 0: OFF * 1: CRITICAL (default) * 2: >= WARNING */ this.consoleLoggingLevel = function () { return 1; }; /** * 0: OFF (default) * 1: CRITICAL * 2: >= WARNING */ this.telemetryLoggingLevel = function () { return 0; }; /** * The maximum number of internal messages allowed to be sent per page view */ this.maxInternalMessageLimit = function () { return 25; }; /** * The internal logging queue */ this.queue = []; /** * Count of internal messages sent */ this._messageCount = 0; /** * Holds information about what message types were already logged to console or sent to server. */ this._messageLogged = {}; if (CoreUtils_1.CoreUtils.isNullOrUndefined(config)) { // TODO: Use default config // config = AppInsightsCore.defaultConfig; // For now, use defaults specified in DiagnosticLogger members; return; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.loggingLevelConsole)) { this.consoleLoggingLevel = function () { return config.loggingLevelConsole; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.loggingLevelTelemetry)) { this.telemetryLoggingLevel = function () { return config.loggingLevelTelemetry; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.maxMessageLimit)) { this.maxInternalMessageLimit = function () { return config.maxMessageLimit; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.enableDebugExceptions)) { this.enableDebugExceptions = function () { return config.enableDebugExceptions; }; } } /** * This method will throw exceptions in debug mode or attempt to log the error as a console warning. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The log message. */ DiagnosticLogger.prototype.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (this.enableDebugExceptions()) { throw message; } else { if (typeof (message) !== "undefined" && !!message) { if (typeof (message.message) !== "undefined") { if (isUserAct) { // check if this message type was already logged to console for this page view and if so, don't log it again var messageKey = +message.messageId; if (!this._messageLogged[messageKey] || this.consoleLoggingLevel() >= LoggingEnums_1.LoggingSeverity.WARNING) { this.warnToConsole(message.message); this._messageLogged[messageKey] = true; } } else { // don't log internal AI traces in the console, unless the verbose logging is enabled if (this.consoleLoggingLevel() >= LoggingEnums_1.LoggingSeverity.WARNING) { this.warnToConsole(message.message); } } this.logInternalMessage(severity, message); } } } }; /** * This will write a warning to the console if possible * @param message {string} - The warning message */ DiagnosticLogger.prototype.warnToConsole = function (message) { if (typeof console !== "undefined" && !!console) { if (typeof console.warn === "function") { console.warn(message); } else if (typeof console.log === "function") { console.log(message); } } }; /** * Resets the internal message count */ DiagnosticLogger.prototype.resetInternalMessageCount = function () { this._messageCount = 0; this._messageLogged = {}; }; /** * Logs a message to the internal queue. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The message to log. */ DiagnosticLogger.prototype.logInternalMessage = function (severity, message) { if (this._areInternalMessagesThrottled()) { return; } // check if this message type was already logged for this session and if so, don't log it again var logMessage = true; var messageKey = this.AIInternalMessagePrefix + message.messageId; // if the session storage is not available, limit to only one message type per page view if (this._messageLogged[messageKey]) { logMessage = false; } else { this._messageLogged[messageKey] = true; } if (logMessage) { // Push the event in the internal queue if (severity <= this.telemetryLoggingLevel()) { this.queue.push(message); this._messageCount++; } // When throttle limit reached, send a special event if (this._messageCount == this.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(LoggingEnums_1._InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false); this.queue.push(throttleMessage); this.warnToConsole(throttleLimitMessage); } } }; /** * Indicates whether the internal events are throttled */ DiagnosticLogger.prototype._areInternalMessagesThrottled = function () { return this._messageCount >= this.maxInternalMessageLimit(); }; return DiagnosticLogger; }()); exports.DiagnosticLogger = DiagnosticLogger; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DiagnosticLogger.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js": /*!**********************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js ***! \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Class to manage sending notifications to all the listeners. */ var NotificationManager = /** @class */ (function () { function NotificationManager() { this.listeners = []; } /** * Adds a notification listener. * @param {INotificationListener} listener - The notification listener to be added. */ NotificationManager.prototype.addNotificationListener = function (listener) { this.listeners.push(listener); }; /** * Removes all instances of the listener. * @param {INotificationListener} listener - AWTNotificationListener to remove. */ NotificationManager.prototype.removeNotificationListener = function (listener) { var index = this.listeners.indexOf(listener); while (index > -1) { this.listeners.splice(index, 1); index = this.listeners.indexOf(listener); } }; /** * Notification for events sent. * @param {ITelemetryItem[]} events - The array of events that have been sent. */ NotificationManager.prototype.eventsSent = function (events) { var _this = this; var _loop_1 = function (i) { if (this_1.listeners[i].eventsSent) { setTimeout(function () { return _this.listeners[i].eventsSent(events); }, 0); } }; var this_1 = this; for (var i = 0; i < this.listeners.length; ++i) { _loop_1(i); } }; /** * Notification for events being discarded. * @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK. * @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason * constant should be used to check the different values. */ NotificationManager.prototype.eventsDiscarded = function (events, reason) { var _this = this; var _loop_2 = function (i) { if (this_2.listeners[i].eventsDiscarded) { setTimeout(function () { return _this.listeners[i].eventsDiscarded(events, reason); }, 0); } }; var this_2 = this; for (var i = 0; i < this.listeners.length; ++i) { _loop_2(i); } }; return NotificationManager; }()); exports.NotificationManager = NotificationManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=NotificationManager.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js": /*!****************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js ***! \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./JavaScriptSDK.Interfaces/IChannelControls */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js"), __webpack_require__(/*! ./JavaScriptSDK.Enums/EventsDiscardedReason */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js"), __webpack_require__(/*! ./JavaScriptSDK/AppInsightsCore */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js"), __webpack_require__(/*! ./JavaScriptSDK/CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js"), __webpack_require__(/*! ./JavaScriptSDK/NotificationManager */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js"), __webpack_require__(/*! ./JavaScriptSDK/DiagnosticLogger */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js"), __webpack_require__(/*! ./JavaScriptSDK.Enums/LoggingEnums */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, IChannelControls_1, EventsDiscardedReason_1, AppInsightsCore_1, CoreUtils_1, NotificationManager_1, DiagnosticLogger_1, LoggingEnums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MinChannelPriorty = IChannelControls_1.MinChannelPriorty; exports.EventsDiscardedReason = EventsDiscardedReason_1.EventsDiscardedReason; exports.AppInsightsCore = AppInsightsCore_1.AppInsightsCore; exports.CoreUtils = CoreUtils_1.CoreUtils; exports.NotificationManager = NotificationManager_1.NotificationManager; exports.DiagnosticLogger = DiagnosticLogger_1.DiagnosticLogger; exports._InternalLogMessage = DiagnosticLogger_1._InternalLogMessage; exports._InternalMessageId = LoggingEnums_1._InternalMessageId; exports.LoggingSeverity = LoggingEnums_1.LoggingSeverity; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-core-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajax.js": /*!*************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajax.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./ajaxRecord */ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js"), __webpack_require__(/*! ./ajaxUtils */ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1, ajaxRecord_1, ajaxUtils_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var AjaxMonitor = /** @class */ (function () { function AjaxMonitor() { this._trackAjaxAttempts = 0; this.identifier = "AjaxDependencyPlugin"; this.priority = 161; this.currentWindowHost = window && window.location.host && window.location.host.toLowerCase(); this.initialized = false; } ///Verifies that particalar instance of XMLHttpRequest needs to be monitored ///Optional parameter. True if ajaxData must be excluded from verification ///True if instance needs to be monitored, otherwise false AjaxMonitor.prototype.isMonitoredInstance = function (xhr, excludeAjaxDataValidation) { // checking to see that all interested functions on xhr were instrumented return this.initialized // checking on ajaxData to see that it was not removed in user code && (excludeAjaxDataValidation === true || !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData)) // check that this instance is not not used by ajax call performed inside client side monitoring to send data to collector && xhr[applicationinsights_common_1.DisabledPropertyName] !== true; }; ///Determines whether ajax monitoring can be enabled on this document ///True if Ajax monitoring is supported on this page, otherwise false AjaxMonitor.prototype.supportsMonitoring = function () { var result = true; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.open) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.send) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.abort)) { result = false; } // disable in IE8 or older (https://www.w3schools.com/jsref/jsref_trim_string.asp) try { " a ".trim(); } catch (ex) { result = false; } return result; }; AjaxMonitor.prototype.instrumentOpen = function () { var originalOpen = XMLHttpRequest.prototype.open; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.open = function (method, url, async) { try { if (ajaxMonitorInstance.isMonitoredInstance(this, true) && (!this.ajaxData || !this.ajaxData.xhrMonitoringState.openDone)) { ajaxMonitorInstance.openHandler(this, method, url, async); } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxOpen, "Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalOpen.apply(this, arguments); }; }; AjaxMonitor.prototype.openHandler = function (xhr, method, url, async) { /* todo: Disabling the following block of code as CV is not yet supported in 1DS for 3rd Part. // this format corresponds with activity logic on server-side and is required for the correct correlation var id = "|" + this.appInsights.context.operation.id + "." + Util.newId(); */ var id = applicationinsights_common_1.Util.newId(); var ajaxData = new ajaxRecord_1.ajaxRecord(id, this._core._logger); ajaxData.method = method; ajaxData.requestUrl = url; ajaxData.xhrMonitoringState.openDone = true; xhr.ajaxData = ajaxData; this.attachToOnReadyStateChange(xhr); }; AjaxMonitor.getFailedAjaxDiagnosticsMessage = function (xhr) { var result = ""; try { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData.requestUrl)) { result += "(url: '" + xhr.ajaxData.requestUrl + "')"; } } catch (e) { } return result; }; AjaxMonitor.prototype.instrumentSend = function () { var originalSend = XMLHttpRequest.prototype.send; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.send = function (content) { try { if (ajaxMonitorInstance.isMonitoredInstance(this) && !this.ajaxData.xhrMonitoringState.sendDone) { ajaxMonitorInstance.sendHandler(this, content); } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxSend, "Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalSend.apply(this, arguments); }; }; AjaxMonitor.prototype.sendHandler = function (xhr, content) { xhr.ajaxData.requestSentTime = applicationinsights_common_1.DateTimeUtils.Now(); if (this.currentWindowHost && applicationinsights_common_1.CorrelationIdHelper.canIncludeCorrelationHeader(this._config, xhr.ajaxData.getAbsoluteUrl(), this.currentWindowHost)) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.requestIdHeader, xhr.ajaxData.id); var appId = this._config.appId; // Todo: also, get appId from channel as breeze returns it if (appId) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.requestContextHeader, applicationinsights_common_1.RequestHeaders.requestContextAppIdFormat + appId); } } xhr.ajaxData.xhrMonitoringState.sendDone = true; }; AjaxMonitor.prototype.instrumentAbort = function () { var originalAbort = XMLHttpRequest.prototype.abort; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.abort = function () { try { if (ajaxMonitorInstance.isMonitoredInstance(this) && !this.ajaxData.xhrMonitoringState.abortDone) { this.ajaxData.aborted = 1; this.ajaxData.xhrMonitoringState.abortDone = true; } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxAbort, "Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalAbort.apply(this, arguments); }; }; AjaxMonitor.prototype.attachToOnReadyStateChange = function (xhr) { var _this = this; var ajaxMonitorInstance = this; xhr.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached = ajaxUtils_1.EventHelper.AttachEvent(xhr, "readystatechange", function () { try { if (ajaxMonitorInstance.isMonitoredInstance(xhr)) { if (xhr.readyState === 4) { ajaxMonitorInstance.onAjaxComplete(xhr); } } } catch (e) { var exceptionText = applicationinsights_common_1.Util.dump(e); // ignore messages with c00c023f, as this a known IE9 XHR abort issue if (!exceptionText || exceptionText.toLowerCase().indexOf("c00c023f") == -1) { _this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxRSC, "Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), exception: applicationinsights_common_1.Util.dump(e) }); } } }); }; AjaxMonitor.prototype.onAjaxComplete = function (xhr) { xhr.ajaxData.responseFinishedTime = applicationinsights_common_1.DateTimeUtils.Now(); xhr.ajaxData.status = xhr.status; xhr.ajaxData.CalculateMetrics(); if (xhr.ajaxData.ajaxTotalDuration < 0) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxDur, "Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), requestSentTime: xhr.ajaxData.requestSentTime, responseFinishedTime: xhr.ajaxData.responseFinishedTime }); } else { var dependency = { id: xhr.ajaxData.id, absoluteUrl: xhr.ajaxData.getAbsoluteUrl(), commandName: xhr.ajaxData.getPathName(), duration: xhr.ajaxData.ajaxTotalDuration, success: (+(xhr.ajaxData.status)) >= 200 && (+(xhr.ajaxData.status)) < 400, resultCode: +xhr.ajaxData.status, method: xhr.ajaxData.method }; // enrich dependency target with correlation context from the server var correlationContext = this.getCorrelationContext(xhr); if (correlationContext) { dependency.correlationContext = /* dependency.target + " | " + */ correlationContext; } this.trackDependencyData(dependency); xhr.ajaxData = null; } }; AjaxMonitor.prototype.getCorrelationContext = function (xhr) { try { var responseHeadersString = xhr.getAllResponseHeaders(); if (responseHeadersString !== null) { var index = responseHeadersString.toLowerCase().indexOf(applicationinsights_common_1.RequestHeaders.requestContextHeaderLowerCase); if (index !== -1) { var responseHeader = xhr.getResponseHeader(applicationinsights_common_1.RequestHeaders.requestContextHeader); return applicationinsights_common_1.CorrelationIdHelper.getCorrelationContext(responseHeader); } } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxGetCorrelationHeader, "Failed to get Request-Context correlation header as it may be not included in the response or not accessible.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs dependency call * @param dependencyData dependency data object */ AjaxMonitor.prototype.trackDependencyData = function (dependency, properties, systemProperties) { if (this._config.maxAjaxCallsPerView === -1 || this._trackAjaxAttempts < this._config.maxAjaxCallsPerView) { var item = applicationinsights_common_1.TelemetryItemCreator.create(dependency, applicationinsights_common_1.RemoteDependencyData.dataType, applicationinsights_common_1.RemoteDependencyData.envelopeType, this._core._logger, properties, systemProperties); this._core.track(item); } else if (this._trackAjaxAttempts === this._config.maxAjaxCallsPerView) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.MaxAjaxPerPVExceeded, "Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.", true); } ++this._trackAjaxAttempts; }; AjaxMonitor.prototype.processTelemetry = function (item) { if (this._nextPlugin && this._nextPlugin.processTelemetry) { this._nextPlugin.processTelemetry(item); } }; AjaxMonitor.prototype.setNextPlugin = function (next) { if (next) { this._nextPlugin = next; } }; AjaxMonitor.prototype.initialize = function (config, core, extensions) { if (!this.initialized) { this._core = core; config.extensionConfig = config.extensionConfig ? config.extensionConfig : {}; var c = config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {}; this._config = { maxAjaxCallsPerView: !isNaN(c.maxAjaxCallsPerView) ? c.maxAjaxCallsPerView : 500, disableAjaxTracking: applicationinsights_common_1.Util.stringToBoolOrDefault(c.disableAjaxTracking), disableCorrelationHeaders: applicationinsights_common_1.Util.stringToBoolOrDefault(c.disableCorrelationHeaders), correlationHeaderExcludedDomains: c.correlationHeaderExcludedDomains || [ "*.blob.core.windows.net", "*.blob.core.chinacloudapi.cn", "*.blob.core.cloudapi.de", "*.blob.core.usgovcloudapi.net" ], appId: c.appId, enableCorsCorrelation: applicationinsights_common_1.Util.stringToBoolOrDefault(c.enableCorsCorrelation) }; if (this.supportsMonitoring() && !this._config.disableAjaxTracking) { this.instrumentOpen(); this.instrumentSend(); this.instrumentAbort(); this.initialized = true; } } }; return AjaxMonitor; }()); exports.AjaxMonitor = AjaxMonitor; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajax.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var XHRMonitoringState = /** @class */ (function () { function XHRMonitoringState() { this.openDone = false; this.setRequestHeaderDone = false; this.sendDone = false; this.abortDone = false; //True, if onreadyStateChangeCallback function attached to xhr, otherwise false this.onreadystatechangeCallbackAttached = false; } return XHRMonitoringState; }()); exports.XHRMonitoringState = XHRMonitoringState; var ajaxRecord = /** @class */ (function () { function ajaxRecord(id, logger) { this.completed = false; this.requestHeadersSize = null; this.ttfb = null; this.responseReceivingDuration = null; this.callbackDuration = null; this.ajaxTotalDuration = null; this.aborted = null; this.pageUrl = null; this.requestUrl = null; this.requestSize = 0; this.method = null; ///Returns the HTTP status code. this.status = null; //The timestamp when open method was invoked this.requestSentTime = null; //The timestamps when first byte was received this.responseStartedTime = null; //The timestamp when last byte was received this.responseFinishedTime = null; //The timestamp when onreadystatechange callback in readyState 4 finished this.callbackFinishedTime = null; //The timestamp at which ajax was ended this.endTime = null; //The original xhr onreadystatechange event this.originalOnreadystatechage = null; this.xhrMonitoringState = new XHRMonitoringState(); //Determines whether or not JavaScript exception occured in xhr.onreadystatechange code. 1 if occured, otherwise 0. this.clientFailure = 0; this.CalculateMetrics = function () { var self = this; // round to 3 decimal points self.ajaxTotalDuration = Math.round(applicationinsights_common_1.DateTimeUtils.GetDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000; }; this.id = id; this._logger = logger; } ajaxRecord.prototype.getAbsoluteUrl = function () { return this.requestUrl ? applicationinsights_common_1.UrlHelper.getAbsoluteUrl(this.requestUrl) : null; }; ajaxRecord.prototype.getPathName = function () { return this.requestUrl ? applicationinsights_common_1.DataSanitizer.sanitizeUrl(this._logger, applicationinsights_common_1.UrlHelper.getCompleteUrl(this.method, this.requestUrl)) : null; }; return ajaxRecord; }()); exports.ajaxRecord = ajaxRecord; ; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajaxRecord.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js": /*!******************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var stringUtils = /** @class */ (function () { function stringUtils() { } stringUtils.GetLength = function (strObject) { var res = 0; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(strObject)) { var stringified = ""; try { stringified = strObject.toString(); } catch (ex) { // some troubles with complex object } res = stringified.length; res = isNaN(res) ? 0 : res; } return res; }; return stringUtils; }()); exports.stringUtils = stringUtils; var EventHelper = /** @class */ (function () { function EventHelper() { } ///Binds the specified function to an event, so that the function gets called whenever the event fires on the object ///Object to which ///String that specifies any of the standard DHTML Events without "on" prefix ///Pointer that specifies the function to call when event fires ///True if the function was bound successfully to the event, otherwise false EventHelper.AttachEvent = function (obj, eventNameWithoutOn, handlerRef) { var result = false; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj)) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.attachEvent)) { // IE before version 9 obj.attachEvent("on" + eventNameWithoutOn, handlerRef); result = true; } else { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.addEventListener)) { // all browsers except IE before version 9 obj.addEventListener(eventNameWithoutOn, handlerRef, false); result = true; } } } return result; }; EventHelper.DetachEvent = function (obj, eventNameWithoutOn, handlerRef) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj)) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.detachEvent)) { obj.detachEvent("on" + eventNameWithoutOn, handlerRef); } else { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.removeEventListener)) { obj.removeEventListener(eventNameWithoutOn, handlerRef, false); } } } }; return EventHelper; }()); exports.EventHelper = EventHelper; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajaxUtils.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./ajax */ "./node_modules/applicationinsights-dependencies-js/bundle/ajax.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, ajax_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AjaxPlugin = ajax_1.AjaxMonitor; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-dependencies-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Application.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Application.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Application = /** @class */ (function () { function Application() { } return Application; }()); exports.Application = Application; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Application.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Device.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Device.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Device = /** @class */ (function () { /** * Constructs a new instance of the Device class */ function Device() { // don't attempt to fingerprint browsers this.id = "browser"; // Device type is a dimension in our data platform // Setting it to 'Browser' allows to separate client and server dependencies/exceptions this.type = "Browser"; } return Device; }()); exports.Device = Device; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Device.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Version = "2.0.1-beta"; var Internal = /** @class */ (function () { /** * Constructs a new instance of the internal telemetry data class. */ function Internal(config) { this.sdkVersion = (config.sdkExtension && config.sdkExtension() ? config.sdkExtension() + "_" : "") + "javascript:" + Version; } return Internal; }()); exports.Internal = Internal; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Internal.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Location.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Location.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Location = /** @class */ (function () { function Location() { } return Location; }()); exports.Location = Location; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Location.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js": /*!************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Operation = /** @class */ (function () { function Operation() { this.id = applicationinsights_common_1.Util.newId(); if (window && window.location && window.location.pathname) { this.name = window.location.pathname; } } return Operation; }()); exports.Operation = Operation; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Operation.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../SamplingScoreGenerator */ "./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, SamplingScoreGenerator_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Sample = /** @class */ (function () { function Sample(sampleRate, logger) { // We're using 32 bit math, hence max value is (2^31 - 1) this.INT_MAX_VALUE = 2147483647; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(logger)) { this._logger = new applicationinsights_core_js_1.DiagnosticLogger(); } else { this._logger = logger; } if (sampleRate > 100 || sampleRate < 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SampleRateOutOfRange, "Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.", { samplingRate: sampleRate }, true); this.sampleRate = 100; } this.sampleRate = sampleRate; this.samplingScoreGenerator = new SamplingScoreGenerator_1.SamplingScoreGenerator(); } /** * Determines if an envelope is sampled in (i.e. will be sent) or not (i.e. will be dropped). */ Sample.prototype.isSampledIn = function (envelope) { // return true as sampling will move to different extension return true; }; return Sample; }()); exports.Sample = Sample; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Sample.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Session.js": /*!**********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Session.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Session = /** @class */ (function () { function Session() { } return Session; }()); exports.Session = Session; var _SessionManager = /** @class */ (function () { function _SessionManager(config, logger) { if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(logger)) { this._logger = new applicationinsights_core_js_1.DiagnosticLogger(); } else { this._logger = logger; } if (!config) { config = {}; } if (!(typeof config.sessionExpirationMs === "function")) { config.sessionExpirationMs = function () { return _SessionManager.acquisitionSpan; }; } if (!(typeof config.sessionRenewalMs === "function")) { config.sessionRenewalMs = function () { return _SessionManager.renewalSpan; }; } this.config = config; this.automaticSession = new Session(); } _SessionManager.prototype.update = function () { if (!this.automaticSession.id) { this.initializeAutomaticSession(); } var now = applicationinsights_common_1.DateTimeUtils.Now(); var acquisitionExpired = now - this.automaticSession.acquisitionDate > this.config.sessionExpirationMs(); var renewalExpired = now - this.automaticSession.renewalDate > this.config.sessionRenewalMs(); // renew if acquisitionSpan or renewalSpan has ellapsed if (acquisitionExpired || renewalExpired) { // update automaticSession so session state has correct id this.automaticSession.isFirst = undefined; this.renew(); } else { // do not update the cookie more often than cookieUpdateInterval if (!this.cookieUpdatedTimestamp || now - this.cookieUpdatedTimestamp > _SessionManager.cookieUpdateInterval) { this.automaticSession.renewalDate = now; this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); } } }; /** * Record the current state of the automatic session and store it in our cookie string format * into the browser's local storage. This is used to restore the session data when the cookie * expires. */ _SessionManager.prototype.backup = function () { this.setStorage(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); }; /** * Use ai_session cookie data or local storage data (when the cookie is unavailable) to * initialize the automatic session. */ _SessionManager.prototype.initializeAutomaticSession = function () { var cookie = applicationinsights_common_1.Util.getCookie(this._logger, 'ai_session'); if (cookie && typeof cookie.split === "function") { this.initializeAutomaticSessionWithData(cookie); } else { // There's no cookie, but we might have session data in local storage // This can happen if the session expired or the user actively deleted the cookie // We only want to recover data if the cookie is missing from expiry. We should respect the user's wishes if the cookie was deleted actively. // The User class handles this for us and deletes our local storage object if the persistent user cookie was removed. var storage = applicationinsights_common_1.Util.getStorage(this._logger, 'ai_session'); if (storage) { this.initializeAutomaticSessionWithData(storage); } } if (!this.automaticSession.id) { this.automaticSession.isFirst = true; this.renew(); } }; /** * Extract id, aquisitionDate, and renewalDate from an ai_session payload string and * use this data to initialize automaticSession. * * @param {string} sessionData - The string stored in an ai_session cookie or local storage backup */ _SessionManager.prototype.initializeAutomaticSessionWithData = function (sessionData) { var params = sessionData.split("|"); if (params.length > 0) { this.automaticSession.id = params[0]; } try { if (params.length > 1) { var acq = +params[1]; this.automaticSession.acquisitionDate = +new Date(acq); this.automaticSession.acquisitionDate = this.automaticSession.acquisitionDate > 0 ? this.automaticSession.acquisitionDate : 0; } if (params.length > 2) { var renewal = +params[2]; this.automaticSession.renewalDate = +new Date(renewal); this.automaticSession.renewalDate = this.automaticSession.renewalDate > 0 ? this.automaticSession.renewalDate : 0; } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ErrorParsingAISessionCookie, "Error parsing ai_session cookie, session will be reset: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } if (this.automaticSession.renewalDate == 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SessionRenewalDateIsZero, "AI session renewal date is 0, session will be reset."); } }; _SessionManager.prototype.renew = function () { var now = applicationinsights_common_1.DateTimeUtils.Now(); this.automaticSession.id = applicationinsights_common_1.Util.newId(); this.automaticSession.acquisitionDate = now; this.automaticSession.renewalDate = now; this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); // If this browser does not support local storage, fire an internal log to keep track of it at this point if (!applicationinsights_common_1.Util.canUseLocalStorage()) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserDoesNotSupportLocalStorage, "Browser does not support local storage. Session durations will be inaccurate."); } }; _SessionManager.prototype.setCookie = function (guid, acq, renewal) { // Set cookie to expire after the session expiry time passes or the session renewal deadline, whichever is sooner // Expiring the cookie will cause the session to expire even if the user isn't on the page var acquisitionExpiry = acq + this.config.sessionExpirationMs(); var renewalExpiry = renewal + this.config.sessionRenewalMs(); var cookieExpiry = new Date(); var cookie = [guid, acq, renewal]; if (acquisitionExpiry < renewalExpiry) { cookieExpiry.setTime(acquisitionExpiry); } else { cookieExpiry.setTime(renewalExpiry); } var cookieDomnain = this.config.cookieDomain ? this.config.cookieDomain() : null; applicationinsights_common_1.Util.setCookie(this._logger, 'ai_session', cookie.join('|') + ';expires=' + cookieExpiry.toUTCString(), cookieDomnain); this.cookieUpdatedTimestamp = applicationinsights_common_1.DateTimeUtils.Now(); }; _SessionManager.prototype.setStorage = function (guid, acq, renewal) { // Keep data in local storage to retain the last session id, allowing us to cleanly end the session when it expires // Browsers that don't support local storage won't be able to end sessions cleanly from the client // The server will notice this and end the sessions itself, with loss of accurate session duration applicationinsights_common_1.Util.setStorage(this._logger, 'ai_session', [guid, acq, renewal].join('|')); }; _SessionManager.acquisitionSpan = 86400000; // 24 hours in ms _SessionManager.renewalSpan = 1800000; // 30 minutes in ms _SessionManager.cookieUpdateInterval = 60000; // 1 minute in ms return _SessionManager; }()); exports._SessionManager = _SessionManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Session.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/User.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/User.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var User = /** @class */ (function () { function User(config, logger) { this._logger = logger; //get userId or create new one if none exists var cookie = applicationinsights_common_1.Util.getCookie(this._logger, User.userCookieName); if (cookie) { var params = cookie.split(User.cookieSeparator); if (params.length > 0) { this.id = params[0]; } } this.config = config; if (!this.id) { this.id = applicationinsights_common_1.Util.newId(); var date = new Date(); var acqStr = applicationinsights_common_1.Util.toISOStringForIE8(date); this.accountAcquisitionDate = acqStr; // without expiration, cookies expire at the end of the session // set it to 365 days from now // 365 * 24 * 60 * 60 * 1000 = 31536000000 date.setTime(date.getTime() + 31536000000); var newCookie = [this.id, acqStr]; var cookieDomain = this.config.cookieDomain ? this.config.cookieDomain() : undefined; applicationinsights_common_1.Util.setCookie(this._logger, User.userCookieName, newCookie.join(User.cookieSeparator) + ';expires=' + date.toUTCString(), cookieDomain); // If we have an ai_session in local storage this means the user actively removed our cookies. // We should respect their wishes and clear ourselves from local storage applicationinsights_common_1.Util.removeStorage(this._logger, 'ai_session'); } // We still take the account id from the ctor param for backward compatibility. // But if the the customer set the accountId through the newer setAuthenticatedUserContext API, we will override it. this.accountId = config.accountId ? config.accountId() : undefined; // Get the auth user id and account id from the cookie if exists // Cookie is in the pattern: | var authCookie = applicationinsights_common_1.Util.getCookie(this._logger, User.authUserCookieName); if (authCookie) { authCookie = decodeURI(authCookie); var authCookieString = authCookie.split(User.cookieSeparator); if (authCookieString[0]) { this.authenticatedId = authCookieString[0]; } if (authCookieString.length > 1 && authCookieString[1]) { this.accountId = authCookieString[1]; } } } /** * Sets the authenticated user id and the account id in this session. * * @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service. * @param accountId {string} - An optional string to represent the account associated with the authenticated user. */ User.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) { if (storeInCookie === void 0) { storeInCookie = false; } // Validate inputs to ensure no cookie control characters. var isInvalidInput = !this.validateUserInput(authenticatedUserId) || (accountId && !this.validateUserInput(accountId)); if (isInvalidInput) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SetAuthContextFailedAccountName, "Setting auth user context failed. " + "User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.", true); return; } // Create cookie string. this.authenticatedId = authenticatedUserId; var authCookie = this.authenticatedId; if (accountId) { this.accountId = accountId; authCookie = [this.authenticatedId, this.accountId].join(User.cookieSeparator); } if (storeInCookie) { // Set the cookie. No expiration date because this is a session cookie (expires when browser closed). // Encoding the cookie to handle unexpected unicode characters. applicationinsights_common_1.Util.setCookie(this._logger, User.authUserCookieName, encodeURI(authCookie), this.config.cookieDomain()); } }; /** * Clears the authenticated user id and the account id from the user context. * @returns {} */ User.prototype.clearAuthenticatedUserContext = function () { this.authenticatedId = null; this.accountId = null; applicationinsights_common_1.Util.deleteCookie(this._logger, User.authUserCookieName); }; User.prototype.validateUserInput = function (id) { // Validate: // 1. Id is a non-empty string. // 2. It does not contain special characters for cookies. if (typeof id !== 'string' || !id || id.match(/,|;|=| |\|/)) { return false; } return true; }; User.cookieSeparator = '|'; User.userCookieName = 'ai_user'; User.authUserCookieName = 'ai_authUser'; return User; }()); exports.User = User; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=User.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var HashCodeScoreGenerator = /** @class */ (function () { function HashCodeScoreGenerator() { } HashCodeScoreGenerator.prototype.getHashCodeScore = function (key) { var score = this.getHashCode(key) / HashCodeScoreGenerator.INT_MAX_VALUE; return score * 100; }; HashCodeScoreGenerator.prototype.getHashCode = function (input) { if (input == "") { return 0; } while (input.length < HashCodeScoreGenerator.MIN_INPUT_LENGTH) { input = input.concat(input); } // 5381 is a magic number: http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function var hash = 5381; for (var i = 0; i < input.length; ++i) { hash = ((hash << 5) + hash) + input.charCodeAt(i); // 'hash' is of number type which means 53 bit integer (http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types-number-type) // 'hash & hash' will keep it 32 bit integer - just to make it clearer what the result is. hash = hash & hash; } return Math.abs(hash); }; // We're using 32 bit math, hence max value is (2^31 - 1) HashCodeScoreGenerator.INT_MAX_VALUE = 2147483647; // (Magic number) DJB algorithm can't work on shorter strings (results in poor distribution HashCodeScoreGenerator.MIN_INPUT_LENGTH = 8; return HashCodeScoreGenerator; }()); exports.HashCodeScoreGenerator = HashCodeScoreGenerator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=HashCodeScoreGenerator.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** * PropertiesPlugin.ts * @copyright Microsoft 2018 */ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! ./Context/Session */ "./node_modules/applicationinsights-properties-js/bundle/Context/Session.js"), __webpack_require__(/*! ./Context/Application */ "./node_modules/applicationinsights-properties-js/bundle/Context/Application.js"), __webpack_require__(/*! ./Context/Device */ "./node_modules/applicationinsights-properties-js/bundle/Context/Device.js"), __webpack_require__(/*! ./Context/Internal */ "./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js"), __webpack_require__(/*! ./Context/Location */ "./node_modules/applicationinsights-properties-js/bundle/Context/Location.js"), __webpack_require__(/*! ./Context/Operation */ "./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js"), __webpack_require__(/*! ./Context/User */ "./node_modules/applicationinsights-properties-js/bundle/Context/User.js"), __webpack_require__(/*! ./Context/Sample */ "./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, applicationinsights_common_1, Session_1, Application_1, Device_1, Internal_1, Location_1, Operation_1, User_1, Sample_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PropertiesPlugin = /** @class */ (function () { function PropertiesPlugin() { this.priority = 170; this.identifier = "AppInsightsPropertiesPlugin"; } PropertiesPlugin.prototype.initialize = function (config, core, extensions) { var extensionConfig = config.extensionConfig && config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {}; this._extensionConfig = { instrumentationKey: function () { return extensionConfig.instrumentationKey; }, accountId: function () { return extensionConfig.accountId; }, sessionRenewalMs: function () { return extensionConfig.sessionRenewalMs; }, sampleRate: function () { return extensionConfig.sampleRate; }, sessionExpirationMs: function () { return extensionConfig.sessionExpirationMs; }, cookieDomain: function () { return extensionConfig.cookieDomain; }, sdkExtension: function () { return extensionConfig.sdkExtension; }, isBrowserLinkTrackingEnabled: function () { return extensionConfig.isBrowserLinkTrackingEnabled; }, appId: function () { return extensionConfig.appId; } }; if (typeof window !== 'undefined') { this._sessionManager = new Session_1._SessionManager(this._extensionConfig, core.logger); this.application = new Application_1.Application(); this.device = new Device_1.Device(); this.internal = new Internal_1.Internal(this._extensionConfig); this.location = new Location_1.Location(); this.user = new User_1.User(this._extensionConfig, core.logger); this.operation = new Operation_1.Operation(); this.session = new Session_1.Session(); this.sample = new Sample_1.Sample(this._extensionConfig.sampleRate(), core.logger); } }; /** * Add Part A fields to the event * @param event The event that needs to be processed */ PropertiesPlugin.prototype.processTelemetry = function (event) { if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(event)) { // TODO(barustum): throw an internal event once we have support for internal logging } else { // if the event is not sampled in, do not bother going through the pipeline if (this.sample.isSampledIn(event)) { // If the envelope is PageView, reset the internal message count so that we can send internal telemetry for the new page. if (event.name === applicationinsights_common_1.PageView.envelopeType) { // TODO(barustum): resetInternalMessageCount once we have support for internal logging //_InternalLogging.resetInternalMessageCount(); } if (this.session) { // If customer did not provide custom session id update the session manager if (typeof this.session.id !== "string") { this._sessionManager.update(); } } this._processTelemetryInternal(event); } if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(event); } } }; /** * Sets the next plugin that comes after this plugin * @param nextPlugin The next plugin */ PropertiesPlugin.prototype.setNextPlugin = function (nextPlugin) { this._nextPlugin = nextPlugin; }; PropertiesPlugin.prototype._processTelemetryInternal = function (event) { var tagsItem = {}; if (this.session) { // If customer set id, apply his context; otherwise apply context generated from cookies if (typeof this.session.id === "string") { PropertiesPlugin._applySessionContext(tagsItem, this.session); } else { PropertiesPlugin._applySessionContext(tagsItem, this._sessionManager.automaticSession); } } // set part A fields PropertiesPlugin._applyApplicationContext(tagsItem, this.application); PropertiesPlugin._applyDeviceContext(tagsItem, this.device); PropertiesPlugin._applyInternalContext(tagsItem, this.internal); PropertiesPlugin._applyLocationContext(tagsItem, this.location); PropertiesPlugin._applySampleContext(tagsItem, this.sample); PropertiesPlugin._applyUserContext(tagsItem, this.user); PropertiesPlugin._applyOperationContext(tagsItem, this.operation); event.tags.push(tagsItem); }; PropertiesPlugin._applySessionContext = function (tags, sessionContext) { if (sessionContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof sessionContext.id === "string") { tags[tagKeys.sessionId] = sessionContext.id; } if (typeof sessionContext.isFirst !== "undefined") { tags[tagKeys.sessionIsFirst] = sessionContext.isFirst; } } }; PropertiesPlugin._applyApplicationContext = function (tagsItem, appContext) { if (appContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof appContext.ver === "string") { tagsItem[tagKeys.applicationVersion] = appContext.ver; } if (typeof appContext.build === "string") { tagsItem[tagKeys.applicationBuild] = appContext.build; } } }; PropertiesPlugin._applyDeviceContext = function (tagsItem, deviceContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (deviceContext) { if (typeof deviceContext.id === "string") { tagsItem[tagKeys.deviceId] = deviceContext.id; } if (typeof deviceContext.ip === "string") { tagsItem[tagKeys.deviceIp] = deviceContext.ip; } if (typeof deviceContext.language === "string") { tagsItem[tagKeys.deviceLanguage] = deviceContext.language; } if (typeof deviceContext.locale === "string") { tagsItem[tagKeys.deviceLocale] = deviceContext.locale; } if (typeof deviceContext.model === "string") { tagsItem[tagKeys.deviceModel] = deviceContext.model; } if (typeof deviceContext.network !== "undefined") { tagsItem[tagKeys.deviceNetwork] = deviceContext.network; } if (typeof deviceContext.oemName === "string") { tagsItem[tagKeys.deviceOEMName] = deviceContext.oemName; } if (typeof deviceContext.os === "string") { tagsItem[tagKeys.deviceOS] = deviceContext.os; } if (typeof deviceContext.osversion === "string") { tagsItem[tagKeys.deviceOSVersion] = deviceContext.osversion; } if (typeof deviceContext.resolution === "string") { tagsItem[tagKeys.deviceScreenResolution] = deviceContext.resolution; } if (typeof deviceContext.type === "string") { tagsItem[tagKeys.deviceType] = deviceContext.type; } } }; PropertiesPlugin._applyInternalContext = function (tagsItem, internalContext) { if (internalContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof internalContext.agentVersion === "string") { tagsItem[tagKeys.internalAgentVersion] = internalContext.agentVersion; } if (typeof internalContext.sdkVersion === "string") { tagsItem[tagKeys.internalSdkVersion] = internalContext.sdkVersion; } } }; PropertiesPlugin._applyLocationContext = function (tagsItem, locationContext) { if (locationContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof locationContext.ip === "string") { tagsItem[tagKeys.locationIp] = locationContext.ip; } } }; PropertiesPlugin._applySampleContext = function (tagsItem, sampleContext) { if (sampleContext) { tagsItem.sampleRate = sampleContext.sampleRate; } }; PropertiesPlugin._applyOperationContext = function (tagsItem, operationContext) { if (operationContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof operationContext.id === "string") { tagsItem[tagKeys.operationId] = operationContext.id; } if (typeof operationContext.name === "string") { tagsItem[tagKeys.operationName] = operationContext.name; } if (typeof operationContext.parentId === "string") { tagsItem[tagKeys.operationParentId] = operationContext.parentId; } if (typeof operationContext.rootId === "string") { tagsItem[tagKeys.operationRootId] = operationContext.rootId; } if (typeof operationContext.syntheticSource === "string") { tagsItem[tagKeys.operationSyntheticSource] = operationContext.syntheticSource; } } }; PropertiesPlugin._applyUserContext = function (tagsItem, userContext) { if (userContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof userContext.accountId === "string") { tagsItem[tagKeys.userAccountId] = userContext.accountId; } if (typeof userContext.agent === "string") { tagsItem[tagKeys.userAgent] = userContext.agent; } if (typeof userContext.id === "string") { tagsItem[tagKeys.userId] = userContext.id; } if (typeof userContext.authenticatedId === "string") { tagsItem[tagKeys.userAuthUserId] = userContext.authenticatedId; } if (typeof userContext.storeRegion === "string") { tagsItem[tagKeys.userStoreRegion] = userContext.storeRegion; } } }; return PropertiesPlugin; }()); exports.default = PropertiesPlugin; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PropertiesPlugin.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./HashCodeScoreGenerator */ "./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, HashCodeScoreGenerator_1, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var SamplingScoreGenerator = /** @class */ (function () { function SamplingScoreGenerator() { this.hashCodeGeneragor = new HashCodeScoreGenerator_1.HashCodeScoreGenerator(); } SamplingScoreGenerator.prototype.getSamplingScore = function (envelope) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); var score = 0; if (envelope.tags[tagKeys.userId]) { score = this.hashCodeGeneragor.getHashCodeScore(envelope.tags[tagKeys.userId]); } else if (envelope.tags[tagKeys.operationId]) { score = this.hashCodeGeneragor.getHashCodeScore(envelope.tags[tagKeys.operationId]); } else { // tslint:disable-next-line:insecure-random score = Math.random(); } return score; }; return SamplingScoreGenerator; }()); exports.SamplingScoreGenerator = SamplingScoreGenerator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SamplingScoreGenerator.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./PropertiesPlugin */ "./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PropertiesPlugin_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PropertiesPlugin = PropertiesPlugin_1.default; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-properties-js.js.map /***/ }), /***/ 0: /*!**********************************!*\ !*** multi ./amd/bundle/Init.js ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(/*! ./amd/bundle/Init.js */"./amd/bundle/Init.js"); /***/ }) /******/ }); }); //# sourceMappingURL=aisdk.0.0.18.js.map ================================================ FILE: AISKU/dist-history/aisdk.0.0.19.js ================================================ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ "./amd/bundle/Init.js": /*!****************************!*\ !*** ./amd/bundle/Init.js ***! \****************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-analytics-js */ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js"), __webpack_require__(/*! ./Initialization */ "./amd/bundle/Initialization.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_analytics_js_1, Initialization_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; //should be global function that should load as soon as SDK loads try { // E2E sku on load initializes core and pipeline using snippet as input for configuration var aiName; if (typeof window !== "undefined" && typeof JSON !== "undefined") { // get snippet or initialize to an empty object // get sdk instance name should not conflict if page uses existing sdk for a layer of instrumentation aiName = window["appInsightsSDK"]; if (window[aiName] === undefined) { // if no snippet is present, initialize default values applicationinsights_analytics_js_1.ApplicationInsights.appInsightsDefaultConfig = Initialization_1.Initialization.getDefaultConfig(); } else { if (window[aiName].initialize) { // this is the typical case for browser+snippet var snippet = window[aiName] || {}; // overwrite snippet with full appInsights var initialization = new Initialization_1.Initialization(snippet); var appInsightsLocal = initialization.loadAppInsights(); // apply full appInsights to the global instance that was initialized in the snippet for (var field in appInsightsLocal) { snippet[field] = appInsightsLocal[field]; } // Empty queue of all api calls logged prior to sdk download initialization.emptyQueue(); initialization.addHousekeepingBeforeUnload(appInsightsLocal); } } } } catch (e) { // TODO: Find better place to warn to console when SDK initialization fails if (console) { console.warn('Failed to initialize AppInsights JS SDK for instance ' + aiName + e.message); } } }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./amd/bundle/Initialization.js": /*!**************************************!*\ !*** ./amd/bundle/Initialization.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-analytics-js */ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-channel-js */ "./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js"), __webpack_require__(/*! applicationinsights-properties-js */ "./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js"), __webpack_require__(/*! applicationinsights-dependencies-js */ "./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, applicationinsights_analytics_js_1, applicationinsights_common_1, applicationinsights_channel_js_1, applicationinsights_properties_js_1, applicationinsights_dependencies_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; ; var Initialization = /** @class */ (function () { function Initialization(snippet) { // initialize the queue and config in case they are undefined snippet.queue = snippet.queue || []; var config = snippet.config || {}; // ensure instrumentationKey is specified if (config && !config.instrumentationKey) { config = snippet; applicationinsights_analytics_js_1.ApplicationInsights.Version = "2.0.0"; } this.appInsights = new applicationinsights_analytics_js_1.ApplicationInsights(); // set default values using config passed through snippet config = Initialization.getDefaultConfig(config, this.appInsights.identifier); this.properties = new applicationinsights_properties_js_1.PropertiesPlugin(); this.dependencies = new applicationinsights_dependencies_js_1.AjaxPlugin(); this.snippet = snippet; this.config = config; } // Analytics Plugin Initialization.prototype.trackPageView = function (pageView, customProperties) { this.appInsights.trackPageView(pageView, customProperties); }; Initialization.prototype.trackPageViewPerformance = function (pageViewPerformance, customProperties) { this.appInsights.trackPageViewPerformance(pageViewPerformance, customProperties); }; Initialization.prototype.trackException = function (exception, customProperties) { this.appInsights.trackException(exception, customProperties); }; Initialization.prototype._onerror = function (exception) { this.appInsights._onerror(exception); }; Initialization.prototype.trackTrace = function (trace, customProperties) { this.appInsights.trackTrace(trace, customProperties); }; Initialization.prototype.trackMetric = function (metric, customProperties) { this.appInsights.trackMetric(metric, customProperties); }; Initialization.prototype.startTrackPage = function (name) { this.appInsights.startTrackPage(name); }; Initialization.prototype.stopTrackPage = function (name, url, customProperties) { this.appInsights.stopTrackPage(name, url, customProperties); }; Initialization.prototype.addTelemetryInitializer = function (telemetryInitializer) { return this.appInsights.addTelemetryInitializer(telemetryInitializer); }; // Properties Plugin Initialization.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) { if (storeInCookie === void 0) { storeInCookie = false; } this.properties.user.setAuthenticatedUserContext(authenticatedUserId, accountId, storeInCookie); }; Initialization.prototype.clearAuthenticatedUserContext = function () { this.properties.user.clearAuthenticatedUserContext(); }; // Dependencies Plugin Initialization.prototype.trackDependencyData = function (dependency, customProperties, systemProperties) { this.dependencies.trackDependencyData(dependency, customProperties, systemProperties); }; Initialization.prototype.loadAppInsights = function () { this.core = new applicationinsights_core_js_1.AppInsightsCore(); var extensions = []; var appInsightsChannel = new applicationinsights_channel_js_1.Sender(); extensions.push(appInsightsChannel); extensions.push(this.properties); extensions.push(this.dependencies); extensions.push(this.appInsights); // initialize core this.core.initialize(this.config, extensions); return this; }; Initialization.prototype.emptyQueue = function () { // call functions that were queued before the main script was loaded try { if (applicationinsights_common_1.Util.isArray(this.snippet.queue)) { // note: do not check length in the for-loop conditional in case something goes wrong and the stub methods are not overridden. var length = this.snippet.queue.length; for (var i = 0; i < length; i++) { var call = this.snippet.queue[i]; call(); } this.snippet.queue = undefined; delete this.snippet.queue; } } catch (exception) { var properties = {}; if (exception && typeof exception.toString === "function") { properties.exception = exception.toString(); } // need from core // Microsoft.ApplicationInsights._InternalLogging.throwInternal( // LoggingSeverity.WARNING, // _InternalMessageId.FailedToSendQueuedTelemetry, // "Failed to send queued telemetry", // properties); } }; Initialization.prototype.pollInteralLogs = function (appInsightsInstance) { // return setInterval(() => { // var queue: Array<_InternalLogMessage> = ApplicationInsights._InternalLogging.queue; // var length = queue.length; // for (var i = 0; i < length; i++) { // appInsightsInstance.trackTrace(queue[i].message); // } // queue.length = 0; // }, this.config.diagnosticLogInterval); }; Initialization.prototype.addHousekeepingBeforeUnload = function (appInsightsInstance) { // Add callback to push events when the user navigates away if (!appInsightsInstance.appInsights.config.disableFlushOnBeforeUnload && ('onbeforeunload' in window)) { var performHousekeeping = function () { // Adds the ability to flush all data before the page unloads. // Note: This approach tries to push an async request with all the pending events onbeforeunload. // Firefox does not respect this.Other browsers DO push out the call with < 100% hit rate. // Telemetry here will help us analyze how effective this approach is. // Another approach would be to make this call sync with a acceptable timeout to reduce the // impact on user experience. //appInsightsInstance.context._sender.triggerSend(); appInsightsInstance.appInsights.core.getTransmissionControls().forEach(function (queues) { queues.forEach(function (channel) { return channel.flush(true); }); }); // Back up the current session to local storage // This lets us close expired sessions after the cookies themselves expire // Todo: move this against interface behavior if (this.core.extensions["AppInsightsPropertiesPlugin"] && this.core.extensions["AppInsightsPropertiesPlugin"]._sessionManager) { this.core.extensions["AppInsightsPropertiesPlugin"]._sessionManager.backup(); } }; if (!applicationinsights_common_1.Util.addEventHandler('beforeunload', performHousekeeping)) { this.core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedToAddHandlerForOnBeforeUnload, 'Could not add handler for beforeunload'); } } }; Initialization.getDefaultConfig = function (configuration, identifier) { if (!configuration) { configuration = {}; } if (configuration) { identifier = identifier ? identifier : "ApplicationInsightsAnalytics"; } // Undefined checks if (!configuration.extensionConfig) { configuration.extensionConfig = {}; } if (!configuration.extensionConfig[identifier]) { configuration.extensionConfig[identifier] = {}; } var extensionConfig = configuration.extensionConfig[identifier]; // ref to main config // set default values configuration.endpointUrl = configuration.endpointUrl || "https://dc.services.visualstudio.com/v2/track"; extensionConfig.sessionRenewalMs = 30 * 60 * 1000; extensionConfig.sessionExpirationMs = 24 * 60 * 60 * 1000; extensionConfig.enableDebug = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.enableDebug); extensionConfig.disableExceptionTracking = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableExceptionTracking); extensionConfig.consoleLoggingLevel = extensionConfig.consoleLoggingLevel || 1; // Show only CRITICAL level extensionConfig.telemetryLoggingLevel = extensionConfig.telemetryLoggingLevel || 0; // Send nothing extensionConfig.diagnosticLogInterval = extensionConfig.diagnosticLogInterval || 10000; extensionConfig.autoTrackPageVisitTime = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.autoTrackPageVisitTime); if (isNaN(extensionConfig.samplingPercentage) || extensionConfig.samplingPercentage <= 0 || extensionConfig.samplingPercentage >= 100) { extensionConfig.samplingPercentage = 100; } extensionConfig.disableAjaxTracking = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableAjaxTracking); extensionConfig.maxAjaxCallsPerView = !isNaN(extensionConfig.maxAjaxCallsPerView) ? extensionConfig.maxAjaxCallsPerView : 500; extensionConfig.disableCorrelationHeaders = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableCorrelationHeaders); extensionConfig.correlationHeaderExcludedDomains = extensionConfig.correlationHeaderExcludedDomains || [ "*.blob.core.windows.net", "*.blob.core.chinacloudapi.cn", "*.blob.core.cloudapi.de", "*.blob.core.usgovcloudapi.net" ]; extensionConfig.disableFlushOnBeforeUnload = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.disableFlushOnBeforeUnload); extensionConfig.isCookieUseDisabled = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.isCookieUseDisabled); extensionConfig.isStorageUseDisabled = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.isStorageUseDisabled); extensionConfig.isBrowserLinkTrackingEnabled = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.isBrowserLinkTrackingEnabled); extensionConfig.enableCorsCorrelation = applicationinsights_common_1.Util.stringToBoolOrDefault(extensionConfig.enableCorsCorrelation); return configuration; }; return Initialization; }()); exports.Initialization = Initialization; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** * ApplicationInsights.ts * @copyright Microsoft 2018 */ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./Telemetry/PageViewManager */ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1, PageViewManager_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; var durationProperty = "duration"; var ApplicationInsights = /** @class */ (function () { function ApplicationInsights() { this.identifier = "ApplicationInsightsAnalytics"; this.priority = 160; // take from reserved priority range 100- 200 this._isInitialized = false; // Counts number of trackAjax invokations. // By default we only monitor X ajax call per view to avoid too much load. // Default value is set in config. // This counter keeps increasing even after the limit is reached. this._trackAjaxAttempts = 0; this.initialize = this._initialize.bind(this); } ApplicationInsights.prototype.processTelemetry = function (env) { var doNotSendItem = false; try { var telemetryInitializersCount = this._telemetryInitializers.length; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = this._telemetryInitializers[i]; if (telemetryInitializer) { if (telemetryInitializer.apply(null, [env]) === false) { doNotSendItem = true; break; } } } } catch (e) { doNotSendItem = true; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryInitializerFailed, "One of telemetry initializers failed, telemetry item will not be sent: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }, true); } if (!doNotSendItem && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(env); } }; ApplicationInsights.prototype.setNextPlugin = function (next) { this._nextPlugin = next; }; /** * @description Log a diagnostic message * @param {ITraceTelemetry} trace * @param {{[key: string]: any}} [customProperties] * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackTrace = function (trace, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(trace, applicationinsights_common_1.Trace.dataType, applicationinsights_common_1.Trace.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TrackTraceFailed, "trackTrace failed, trace will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * @description Log a numeric value that is not associated with a specific event. Typically * used to send regular reports of performance indicators. To send single measurement, just * use the name and average fields of {@link IMetricTelemetry}. If you take measurements * frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements * and sending the resulting average at intervals * @param {IMetricTelemetry} metric input object argument. Only name and average are mandatory. * @param {{[key: string]: any}} customProperties additional data used to filter metrics in the * portal. Defaults to empty. * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackMetric = function (metric, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(metric, applicationinsights_common_1.Metric.dataType, applicationinsights_common_1.Metric.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackMetricFailed, "trackMetric failed, metric will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs that a page or other item was viewed. * @param IPageViewTelemetry The string you used as the name in startTrackPage. Defaults to the document title. * @param customProperties Additional data used to filter events and metrics. Defaults to empty. If a user wants * to provide a custom duration, it'll have to be in customProperties */ ApplicationInsights.prototype.trackPageView = function (pageView, customProperties) { try { this._pageViewManager.trackPageView(pageView, customProperties); if (this.config.autoTrackPageVisitTime) { this._pageVisitTimeManager.trackPreviousPageVisit(pageView.name, pageView.uri); } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackPVFailed, "trackPageView failed, page view will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Create a page view telemetry item and send it to the SDK pipeline through the core.track API * @param pageView Page view item to be sent * @param properties Custom properties (Part C) that a user can add to the telemetry item * @param systemProperties System level properties (Part A) that a user can add to the telemetry item */ ApplicationInsights.prototype.sendPageViewInternal = function (pageView, properties, systemProperties) { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(pageView, applicationinsights_common_1.PageView.dataType, applicationinsights_common_1.PageView.envelopeType, this._logger, properties, systemProperties); // set instrumentation key this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); // reset ajaxes counter this._trackAjaxAttempts = 0; }; ApplicationInsights.prototype.sendPageViewPerformanceInternal = function (pageViewPerformance, properties) { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(pageViewPerformance, applicationinsights_common_1.PageViewPerformance.dataType, applicationinsights_common_1.PageViewPerformance.envelopeType, this._logger, properties); // set instrumentation key this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); }; ApplicationInsights.prototype.trackPageViewPerformance = function (pageViewPerformance, customProperties) { var item = new applicationinsights_common_1.PageViewPerformance(this.core.logger, pageViewPerformance.name, pageViewPerformance.url, undefined, customProperties); this.sendPageViewPerformanceInternal(item, customProperties); }; /** * Starts timing how long the user views a page or other item. Call this when the page opens. * This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes. * @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title. */ ApplicationInsights.prototype.startTrackPage = function (name) { try { if (typeof name !== "string") { name = window.document && window.document.title || ""; } this._pageTracking.start(name); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.StartTrackFailed, "startTrackPage failed, page view may not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs how long a page or other item was visible, after {@link startTrackPage}. Call this when the page closes. * @param name The string you used as the name in startTrackPage. Defaults to the document title. * @param url A relative or absolute URL that identifies the page or other item. Defaults to the window location. * @param properties Additional data used to filter pages and metrics in the portal. Defaults to empty. * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric */ ApplicationInsights.prototype.stopTrackPage = function (name, url, properties) { try { if (typeof name !== "string") { name = window.document && window.document.title || ""; } if (typeof url !== "string") { url = window.location && window.location.href || ""; } this._pageTracking.stop(name, url, properties); if (this.config.autoTrackPageVisitTime) { this._pageVisitTimeManager.trackPreviousPageVisit(name, url); } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.StopTrackFailed, "stopTrackPage failed, page view will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Log an exception you have caught. * * @param {IExceptionTelemetry} exception Object which contains exception to be sent * @param {{[key: string]: any}} customProperties Additional data used to filter pages and metrics in the portal. Defaults to empty. * * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric. * @memberof ApplicationInsights */ ApplicationInsights.prototype.trackException = function (exception, customProperties) { try { var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(exception, applicationinsights_common_1.Exception.dataType, applicationinsights_common_1.Exception.envelopeType, this._logger, customProperties); this._setTelemetryNameAndIKey(telemetryItem); this.core.track(telemetryItem); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackExceptionFailed, "trackException failed, exception will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * @description Custom error handler for Application Insights Analytics * @param {IAutoExceptionTelemetry} exception * @memberof ApplicationInsights */ ApplicationInsights.prototype._onerror = function (exception) { try { var properties = { url: (exception && exception.url) || document.URL, lineNumber: exception.lineNumber, columnNumber: exception.columnNumber, message: exception.message }; if (applicationinsights_common_1.Util.isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception.error)) { this._sendCORSException(properties.url); } else { if (!applicationinsights_common_1.Util.isError(exception.error)) { var stack = "window.onerror@" + properties.url + ":" + exception.lineNumber + ":" + (exception.columnNumber || 0); exception.error = new Error(exception.message); exception.error.stack = stack; } this.trackException({ error: exception.error, severityLevel: applicationinsights_common_1.SeverityLevel.Error }, properties); } } catch (e) { var errorString = exception.error ? (exception.error.name + ", " + exception.error.message) : "null"; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ExceptionWhileLoggingError, "_onError threw exception while logging error, error will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e), errorString: errorString }); } }; ApplicationInsights.prototype.addTelemetryInitializer = function (telemetryInitializer) { this._telemetryInitializers.push(telemetryInitializer); }; ApplicationInsights.prototype._initialize = function (config, core, extensions) { var _this = this; if (this._isInitialized) { return; } if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(core)) { throw Error("Error initializing"); } this.core = core; this._logger = core.logger; this._globalconfig = { instrumentationKey: config.instrumentationKey, endpointUrl: config.endpointUrl }; this.config = config.extensionConfig && config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {}; // load default values if specified var defaults = ApplicationInsights.appInsightsDefaultConfig; if (defaults !== undefined) { if (defaults.extensions && defaults.extensions[this.identifier]) { for (var field in defaults.extensions[this.identifier]) { // for each unspecified field, set the default value if (this.config[field] === undefined) { this.config[field] = defaults[field]; } } } if (this._globalconfig) { for (var field in defaults) { if (this._globalconfig[field] === undefined) { this._globalconfig[field] = defaults[field]; } } } } // Todo: move this out of static state if (this.config.isCookieUseDisabled) { applicationinsights_common_1.Util.disableCookies(); } // Todo: move this out of static state if (this.config.isStorageUseDisabled) { applicationinsights_common_1.Util.disableStorage(); } var configGetters = { instrumentationKey: function () { return config.instrumentationKey; }, accountId: function () { return _this.config.accountId; }, sessionRenewalMs: function () { return _this.config.sessionRenewalMs; }, sessionExpirationMs: function () { return _this.config.sessionExpirationMs; }, sampleRate: function () { return _this.config.samplingPercentage; }, cookieDomain: function () { return _this.config.cookieDomain; }, sdkExtension: function () { return _this.config.sdkExtension; }, isBrowserLinkTrackingEnabled: function () { return _this.config.isBrowserLinkTrackingEnabled; }, appId: function () { return _this.config.appId; } }; this._pageViewManager = new PageViewManager_1.PageViewManager(this, this.config.overridePageViewDuration, this.core); this._telemetryInitializers = []; this._addDefaultTelemetryInitializers(configGetters); // initialize page view timing this._pageTracking = new Timing(this._logger, "trackPageView"); this._pageTracking.action = function (name, url, duration, properties) { var pageViewItem = { name: name, uri: url }; // duration must be a custom property in order for the collector to extract it if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(properties)) { properties = {}; } properties[durationProperty] = duration; _this.sendPageViewInternal(pageViewItem, properties); }; if (this.config.disableExceptionTracking === false && !this.config.autoExceptionInstrumented) { // We want to enable exception auto collection and it has not been done so yet var onerror_1 = "onerror"; var originalOnError_1 = window[onerror_1]; var instance_1 = this; window.onerror = function (message, url, lineNumber, columnNumber, error) { var handled = originalOnError_1 && originalOnError_1(message, url, lineNumber, columnNumber, error); if (handled !== true) { instance_1._onerror({ message: message, url: url, lineNumber: lineNumber, columnNumber: columnNumber, error: error }); } return handled; }; this.config.autoExceptionInstrumented = true; } this._isInitialized = true; }; ApplicationInsights.prototype._addDefaultTelemetryInitializers = function (configGetters) { if (!configGetters.isBrowserLinkTrackingEnabled()) { var browserLinkPaths_1 = ['/browserLinkSignalR/', '/__browserLink/']; var dropBrowserLinkRequests = function (envelope) { if (envelope.baseType === applicationinsights_common_1.RemoteDependencyData.dataType) { var remoteData = envelope.baseData; if (remoteData) { for (var i = 0; i < browserLinkPaths_1.length; i++) { if (remoteData.absoluteUrl && remoteData.absoluteUrl.indexOf(browserLinkPaths_1[i]) >= 0) { return false; } } } } return true; }; this._addTelemetryInitializer(dropBrowserLinkRequests); } }; ApplicationInsights.prototype._addTelemetryInitializer = function (telemetryInitializer) { this._telemetryInitializers.push(telemetryInitializer); }; ApplicationInsights.prototype._sendCORSException = function (url) { var exception = { message: "Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.", url: url, lineNumber: 0, columnNumber: 0, error: undefined }; var telemetryItem = applicationinsights_common_1.TelemetryItemCreator.create(exception, applicationinsights_common_1.Exception.dataType, applicationinsights_common_1.Exception.envelopeType, this._logger, { url: url }); this.core.track(telemetryItem); }; // Mutate telemetryItem inplace to add boilerplate iKey & name info ApplicationInsights.prototype._setTelemetryNameAndIKey = function (telemetryItem) { telemetryItem.instrumentationKey = this._globalconfig.instrumentationKey; var iKeyNoDashes = this._globalconfig.instrumentationKey.replace(/-/g, ""); telemetryItem.name = telemetryItem.name.replace("{0}", iKeyNoDashes); }; ApplicationInsights.Version = "2.0.1-beta"; return ApplicationInsights; }()); exports.ApplicationInsights = ApplicationInsights; /** * Used to record timed events and page views. */ var Timing = /** @class */ (function () { function Timing(logger, name) { this._name = name; this._events = {}; this._logger = logger; } Timing.prototype.start = function (name) { if (typeof this._events[name] !== "undefined") { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StartCalledMoreThanOnce, "start was called more than once for this event without calling stop.", { name: this._name, key: name }, true); } this._events[name] = +new Date; }; Timing.prototype.stop = function (name, url, properties) { var start = this._events[name]; if (isNaN(start)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StopCalledWithoutStart, "stop was called without a corresponding start.", { name: this._name, key: name }, true); } else { var end = +new Date; var duration = applicationinsights_common_1.PageViewPerformance.getDuration(start, end); this.action(name, url, duration, properties); } delete this._events[name]; this._events[name] = undefined; }; return Timing; }()); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ApplicationInsights.js.map /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/Telemetry/PageViewManager.js ***! \*********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Class encapsulates sending page views and page view performance telemetry. */ var PageViewManager = /** @class */ (function () { function PageViewManager(appInsights, overridePageViewDuration, core) { this.pageViewPerformanceSent = false; this.overridePageViewDuration = false; this.overridePageViewDuration = overridePageViewDuration; this.appInsights = appInsights; if (core) { this._channel = function () { return (core.getTransmissionControls()); }; this._logger = core.logger; } } /** * Currently supported cases: * 1) (default case) track page view called with default parameters, overridePageViewDuration = false. Page view is sent with page view performance when navigation timing data is available. * a. If navigation timing is not supported then page view is sent right away with undefined duration. Page view performance is not sent. * 2) overridePageViewDuration = true, custom duration provided. Custom duration is used, page view sends right away. * 3) overridePageViewDuration = true, custom duration NOT provided. Page view is sent right away, duration is time spent from page load till now (or undefined if navigation timing is not supported). * 4) overridePageViewDuration = false, custom duration is provided. Page view is sent right away with custom duration. * * In all cases page view performance is sent once (only for the 1st call of trackPageView), or not sent if navigation timing is not supported. */ PageViewManager.prototype.trackPageView = function (pageView, customProperties) { var _this = this; var name = pageView.name; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(name) || typeof name !== "string") { pageView.name = window.document && window.document.title || ""; } var uri = pageView.uri; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(uri) || typeof uri !== "string") { pageView.uri = window.location && window.location.href || ""; } // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user // do not provide the duration, set duration to undefined // Also this is case 4 if (!applicationinsights_common_1.PageViewPerformance.isPerformanceTimingSupported()) { this.appInsights.sendPageViewInternal(pageView, customProperties); this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing) this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.NavigationTimingNotSupported, "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info."); return; } var pageViewSent = false; var customDuration = undefined; // if the performance timing is supported by the browser, calculate the custom duration var start = applicationinsights_common_1.PageViewPerformance.getPerformanceTiming().navigationStart; customDuration = applicationinsights_common_1.PageViewPerformance.getDuration(start, +new Date); if (!applicationinsights_common_1.PageViewPerformance.shouldCollectDuration(customDuration)) { customDuration = undefined; } // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier var duration = undefined; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties.duration)) { duration = customProperties.duration; } if (this.overridePageViewDuration || !isNaN(duration)) { if (isNaN(duration)) { // case 3 if (!customProperties) { customProperties = {}; } customProperties["duration"] = customDuration; } // case 2 this.appInsights.sendPageViewInternal(pageView, customProperties); this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); pageViewSent = true; } // now try to send the page view performance telemetry var maxDurationLimit = 60000; if (!customProperties) { customProperties = {}; } var handle = setInterval((function () { try { if (applicationinsights_common_1.PageViewPerformance.isPerformanceTimingDataReady()) { clearInterval(handle); var pageViewPerformance = new applicationinsights_common_1.PageViewPerformance(_this._logger, name, uri, null); if (!pageViewPerformance.getIsValid() && !pageViewSent) { // If navigation timing gives invalid numbers, then go back to "override page view duration" mode. // That's the best value we can get that makes sense. customProperties["duration"] = customDuration; _this.appInsights.sendPageViewInternal(pageView, customProperties); _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } else { if (!pageViewSent) { customProperties["duration"] = pageViewPerformance.getDurationMs(); _this.appInsights.sendPageViewInternal(pageView, customProperties); } if (!_this.pageViewPerformanceSent) { _this.appInsights.sendPageViewPerformanceInternal(pageViewPerformance, customProperties); _this.pageViewPerformanceSent = true; } _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } } else if (applicationinsights_common_1.PageViewPerformance.getDuration(start, +new Date) > maxDurationLimit) { // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready clearInterval(handle); if (!pageViewSent) { customProperties["duration"] = maxDurationLimit; _this.appInsights.sendPageViewInternal(pageView, customProperties); _this._channel().forEach(function (queues) { queues.forEach(function (q) { return q.flush(true); }); }); } } } catch (e) { _this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TrackPVFailedCalc, "trackPageView failed on page load calculation: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }), 100); }; return PageViewManager; }()); exports.PageViewManager = PageViewManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewManager.js.map /***/ }), /***/ "./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-analytics-js/bundle/applicationinsights-analytics-js.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./JavaScriptSDK/ApplicationInsights */ "./node_modules/applicationinsights-analytics-js/bundle/JavaScriptSDK/ApplicationInsights.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, ApplicationInsights_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApplicationInsights = ApplicationInsights_1.ApplicationInsights; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-analytics-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ContextTagKeys = [ "ai.application.ver", "ai.application.build", "ai.application.typeId", "ai.application.applicationId", "ai.application.layer", "ai.device.id", "ai.device.ip", "ai.device.language", "ai.device.locale", "ai.device.model", "ai.device.friendlyName", "ai.device.network", "ai.device.networkName", "ai.device.oemName", "ai.device.os", "ai.device.osVersion", "ai.device.roleInstance", "ai.device.roleName", "ai.device.screenResolution", "ai.device.type", "ai.device.machineName", "ai.device.vmName", "ai.device.browser", "ai.device.browserVersion", "ai.location.ip", "ai.location.country", "ai.location.province", "ai.location.city", "ai.operation.id", "ai.operation.name", "ai.operation.parentId", "ai.operation.rootId", "ai.operation.syntheticSource", "ai.operation.correlationVector", "ai.session.id", "ai.session.isFirst", "ai.session.isNew", "ai.user.accountAcquisitionDate", "ai.user.accountId", "ai.user.userAgent", "ai.user.id", "ai.user.storeRegion", "ai.user.authUserId", "ai.user.anonUserAcquisitionDate", "ai.user.authUserAcquisitionDate", "ai.cloud.name", "ai.cloud.role", "ai.cloud.roleVer", "ai.cloud.roleInstance", "ai.cloud.environment", "ai.cloud.location", "ai.cloud.deploymentUnit", "ai.internal.sdkVersion", "ai.internal.agentVersion", "ai.internal.nodeName", ]; // these two constants are used to filter out properties not needed when trying to extract custom properties and measurements from the incoming payload var baseType = "baseType"; var baseData = "baseData"; var EnvelopeCreator = /** @class */ (function () { function EnvelopeCreator() { } EnvelopeCreator.extractProperties = function (data) { var customProperties = null; for (var key in data) { if (data.hasOwnProperty(key)) { var value = data[key]; if (typeof value !== "number") { if (!customProperties) { customProperties = {}; } customProperties[key] = value; } } } return customProperties; }; EnvelopeCreator.extractPropsAndMeasurements = function (data, properties, measurements) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(data)) { for (var key in data) { if (data.hasOwnProperty(key)) { var value = data[key]; if (typeof value === "number") { measurements[key] = value; } else { properties[key] = value; } } } } }; // TODO: Do we want this to take logger as arg or use this._logger as nonstatic? EnvelopeCreator.createEnvelope = function (logger, envelopeType, telemetryItem, data) { var envelope = new applicationinsights_common_1.Envelope(logger, data, envelopeType); envelope.iKey = telemetryItem.instrumentationKey; var iKeyNoDashes = telemetryItem.instrumentationKey.replace(/-/g, ""); envelope.name = envelope.name.replace("{0}", iKeyNoDashes); // loop through the envelope ctx (Part A) and pick out the ones that should go in outgoing envelope tags for (var key in telemetryItem.ctx) { if (telemetryItem.ctx.hasOwnProperty(key)) { if (exports.ContextTagKeys.indexOf(key) >= 0) { envelope.tags[key] = telemetryItem.ctx[key]; } } } // loop through the envelope tags (extension of Part A) and pick out the ones that should go in outgoing envelope tags telemetryItem.tags.forEach(function (tag) { for (var key in tag) { if (tag.hasOwnProperty(key)) { if (exports.ContextTagKeys.indexOf(key) >= 0) { envelope.tags[key] = tag[key]; } } } }); return envelope; }; return EnvelopeCreator; }()); exports.EnvelopeCreator = EnvelopeCreator; var DependencyEnvelopeCreator = /** @class */ (function (_super) { __extends(DependencyEnvelopeCreator, _super); function DependencyEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } DependencyEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customMeasurements = {}; var customProperties = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var bd = telemetryItem.baseData; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(bd)) { logger.warnToConsole("Invalid input for dependency data"); return null; } var id = bd.id; var absoluteUrl = bd.absoluteUrl; var command = bd.commandName; var duration = bd.duration; var success = bd.success; var resultCode = bd.resultCode; var method = bd.method; var baseData = new applicationinsights_common_1.RemoteDependencyData(logger, id, absoluteUrl, command, duration, success, resultCode, method, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.RemoteDependencyData.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.RemoteDependencyData.envelopeType, telemetryItem, data); }; DependencyEnvelopeCreator.DependencyEnvelopeCreator = new DependencyEnvelopeCreator(); return DependencyEnvelopeCreator; }(EnvelopeCreator)); exports.DependencyEnvelopeCreator = DependencyEnvelopeCreator; var EventEnvelopeCreator = /** @class */ (function (_super) { __extends(EventEnvelopeCreator, _super); function EventEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } EventEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; if (telemetryItem.baseType !== applicationinsights_common_1.Event.dataType) { EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.baseData, customProperties, customMeasurements); } EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var eventName = telemetryItem.baseData.name; var baseData = new applicationinsights_common_1.Event(logger, eventName, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Event.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Event.envelopeType, telemetryItem, data); }; EventEnvelopeCreator.EventEnvelopeCreator = new EventEnvelopeCreator(); return EventEnvelopeCreator; }(EnvelopeCreator)); exports.EventEnvelopeCreator = EventEnvelopeCreator; var ExceptionEnvelopeCreator = /** @class */ (function (_super) { __extends(ExceptionEnvelopeCreator, _super); function ExceptionEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } ExceptionEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var exception = telemetryItem.baseData.error; var severityLevel = telemetryItem.baseData.severityLevel; var baseData = new applicationinsights_common_1.Exception(logger, exception, customProperties, customMeasurements, severityLevel); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Exception.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Exception.envelopeType, telemetryItem, data); }; ExceptionEnvelopeCreator.ExceptionEnvelopeCreator = new ExceptionEnvelopeCreator(); return ExceptionEnvelopeCreator; }(EnvelopeCreator)); exports.ExceptionEnvelopeCreator = ExceptionEnvelopeCreator; var MetricEnvelopeCreator = /** @class */ (function (_super) { __extends(MetricEnvelopeCreator, _super); function MetricEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } MetricEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = EnvelopeCreator.extractProperties(telemetryItem.data); var name = telemetryItem.baseData.name; var average = telemetryItem.baseData.average; var sampleCount = telemetryItem.baseData.sampleCount; var min = telemetryItem.baseData.min; var max = telemetryItem.baseData.max; var baseData = new applicationinsights_common_1.Metric(logger, name, average, sampleCount, min, max, customProperties); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Metric.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Metric.envelopeType, telemetryItem, data); }; MetricEnvelopeCreator.MetricEnvelopeCreator = new MetricEnvelopeCreator(); return MetricEnvelopeCreator; }(EnvelopeCreator)); exports.MetricEnvelopeCreator = MetricEnvelopeCreator; var PageViewEnvelopeCreator = /** @class */ (function (_super) { __extends(PageViewEnvelopeCreator, _super); function PageViewEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } PageViewEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } // Since duration is not part of the domain properties in Common Schema, extract it from part C var duration = undefined; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.data) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.data.duration)) { duration = telemetryItem.data.duration; delete telemetryItem.data.duration; } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var name = telemetryItem.baseData.name; var url = telemetryItem.baseData.uri; // Todo: move IPageViewTelemetry to common as we are missing type checks on baseData here // refUri is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.refUri)) { customProperties["refUri"] = telemetryItem.baseData.refUri; } // pageType is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.pageType)) { customProperties["pageType"] = telemetryItem.baseData.pageType; } // isLoggedIn is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.isLoggedIn)) { customProperties["isLoggedIn"] = telemetryItem.baseData.isLoggedIn; } // pageTags is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.pageTags)) { var pageTags = telemetryItem.baseData.pageTags; for (var key in pageTags) { if (pageTags.hasOwnProperty(key)) { customProperties[key] = pageTags[key]; } } } var baseData = new applicationinsights_common_1.PageView(logger, name, url, duration, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.PageView.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.PageView.envelopeType, telemetryItem, data); }; PageViewEnvelopeCreator.PageViewEnvelopeCreator = new PageViewEnvelopeCreator(); return PageViewEnvelopeCreator; }(EnvelopeCreator)); exports.PageViewEnvelopeCreator = PageViewEnvelopeCreator; var PageViewPerformanceEnvelopeCreator = /** @class */ (function (_super) { __extends(PageViewPerformanceEnvelopeCreator, _super); function PageViewPerformanceEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } PageViewPerformanceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var name = telemetryItem.baseData.name; var url = telemetryItem.baseData.uri; var duration = telemetryItem.baseData.duration; var baseData = new applicationinsights_common_1.PageViewPerformance(logger, name, url, duration, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.PageViewPerformance.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.PageViewPerformance.envelopeType, telemetryItem, data); }; PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator = new PageViewPerformanceEnvelopeCreator(); return PageViewPerformanceEnvelopeCreator; }(EnvelopeCreator)); exports.PageViewPerformanceEnvelopeCreator = PageViewPerformanceEnvelopeCreator; var TraceEnvelopeCreator = /** @class */ (function (_super) { __extends(TraceEnvelopeCreator, _super); function TraceEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } TraceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var message = telemetryItem.baseData.message; var severityLevel = telemetryItem.baseData.severityLevel; var customProperties = EnvelopeCreator.extractProperties(telemetryItem.data); var baseData = new applicationinsights_common_1.Trace(logger, message, customProperties, severityLevel); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Trace.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Trace.envelopeType, telemetryItem, data); }; TraceEnvelopeCreator.TraceEnvelopeCreator = new TraceEnvelopeCreator(); return TraceEnvelopeCreator; }(EnvelopeCreator)); exports.TraceEnvelopeCreator = TraceEnvelopeCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EnvelopeCreator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Offline.js": /*!***********************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Offline.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @description Monitors browser for offline events * @export default - Offline: Static instance of OfflineListener * @class OfflineListener */ var OfflineListener = /** @class */ (function () { function OfflineListener() { this._onlineStatus = true; if (window && window.addEventListener) { window.addEventListener('online', this._setOnline.bind(this), false); window.addEventListener('offline', this._setOffline.bind(this), false); this.isListening = true; } else if (document && document.body) { document.body.ononline = this._setOnline.bind(this); document.body.onoffline = this._setOffline.bind(this); this.isListening = true; } else if (document) { document.ononline = this._setOnline.bind(this); document.onoffline = this._setOffline.bind(this); this.isListening = true; } else { // Could not find a place to add event listener this.isListening = false; } } OfflineListener.prototype._setOnline = function () { this._onlineStatus = true; }; OfflineListener.prototype._setOffline = function () { this._onlineStatus = false; }; OfflineListener.prototype.isOnline = function () { if (this.isListening) { return this._onlineStatus; } else if (navigator) { return navigator.onLine; } else { // Cannot determine online status - report as online return true; } }; OfflineListener.prototype.isOffline = function () { return !this.isOnline(); }; OfflineListener.Offline = new OfflineListener; return OfflineListener; }()); exports.OfflineListener = OfflineListener; exports.Offline = OfflineListener.Offline; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Offline.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js": /*!**************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* * An array based send buffer. */ var ArraySendBuffer = /** @class */ (function () { function ArraySendBuffer(config) { this._config = config; this._buffer = []; } ArraySendBuffer.prototype.enqueue = function (payload) { this._buffer.push(payload); }; ArraySendBuffer.prototype.count = function () { return this._buffer.length; }; ArraySendBuffer.prototype.clear = function () { this._buffer.length = 0; }; ArraySendBuffer.prototype.getItems = function () { return this._buffer.slice(0); }; ArraySendBuffer.prototype.batchPayloads = function (payload) { if (payload && payload.length > 0) { var batch = this._config.emitLineDelimitedJson() ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; ArraySendBuffer.prototype.markAsSent = function (payload) { this.clear(); }; ArraySendBuffer.prototype.clearSent = function (payload) { // not supported }; return ArraySendBuffer; }()); exports.ArraySendBuffer = ArraySendBuffer; /* * Session storege buffer holds a copy of all unsent items in the browser session storage. */ var SessionStorageSendBuffer = /** @class */ (function () { function SessionStorageSendBuffer(logger, config) { this._bufferFullMessageSent = false; this._logger = logger; this._config = config; var bufferItems = this.getBuffer(SessionStorageSendBuffer.BUFFER_KEY); var notDeliveredItems = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); this._buffer = bufferItems.concat(notDeliveredItems); // If the buffer has too many items, drop items from the end. if (this._buffer.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { this._buffer.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } // update DataLossAnalyzer with the number of recovered items // Uncomment if you want to use DataLossanalyzer // DataLossAnalyzer.itemsRestoredFromSessionBuffer = this._buffer.length; this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); } SessionStorageSendBuffer.prototype.enqueue = function (payload) { if (this._buffer.length >= SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // sent internal log only once per page view if (!this._bufferFullMessageSent) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SessionStorageBufferFull, "Maximum buffer size reached: " + this._buffer.length, true); this._bufferFullMessageSent = true; } return; } this._buffer.push(payload); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); }; SessionStorageSendBuffer.prototype.count = function () { return this._buffer.length; }; SessionStorageSendBuffer.prototype.clear = function () { this._buffer.length = 0; this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, []); this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); this._bufferFullMessageSent = false; }; SessionStorageSendBuffer.prototype.getItems = function () { return this._buffer.slice(0); }; SessionStorageSendBuffer.prototype.batchPayloads = function (payload) { if (payload && payload.length > 0) { var batch = this._config.emitLineDelimitedJson() ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; SessionStorageSendBuffer.prototype.markAsSent = function (payload) { this._buffer = this.removePayloadsFromBuffer(payload, this._buffer); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); if (sentElements instanceof Array && payload instanceof Array) { sentElements = sentElements.concat(payload); if (sentElements.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // We send telemetry normally. If the SENT_BUFFER is too big we don't add new elements // until we receive a response from the backend and the buffer has free space again (see clearSent method) this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.SessionStorageBufferFull, "Sent buffer reached its maximum size: " + sentElements.length, true); sentElements.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); } }; SessionStorageSendBuffer.prototype.clearSent = function (payload) { var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); sentElements = this.removePayloadsFromBuffer(payload, sentElements); this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); }; SessionStorageSendBuffer.prototype.removePayloadsFromBuffer = function (payloads, buffer) { var remaining = []; for (var i in buffer) { var contains = false; for (var j in payloads) { if (payloads[j] === buffer[i]) { contains = true; break; } } if (!contains) { remaining.push(buffer[i]); } } ; return remaining; }; SessionStorageSendBuffer.prototype.getBuffer = function (key) { try { var bufferJson = applicationinsights_common_1.Util.getSessionStorage(this._logger, key); if (bufferJson) { var buffer = JSON.parse(bufferJson); if (buffer) { return buffer; } } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedToRestoreStorageBuffer, " storage key: " + key + ", " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } return []; }; SessionStorageSendBuffer.prototype.setBuffer = function (key, buffer) { try { var bufferJson = JSON.stringify(buffer); applicationinsights_common_1.Util.setSessionStorage(this._logger, key, bufferJson); } catch (e) { // if there was an error, clear the buffer // telemetry is stored in the _buffer array so we won't loose any items applicationinsights_common_1.Util.setSessionStorage(this._logger, key, JSON.stringify([])); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedToSetStorageBuffer, " storage key: " + key + ", " + applicationinsights_common_1.Util.getExceptionName(e) + ". Buffer cleared", { exception: applicationinsights_common_1.Util.dump(e) }); } }; SessionStorageSendBuffer.BUFFER_KEY = "AI_buffer"; SessionStorageSendBuffer.SENT_BUFFER_KEY = "AI_sentBuffer"; // Maximum number of payloads stored in the buffer. If the buffer is full, new elements will be dropped. SessionStorageSendBuffer.MAX_BUFFER_SIZE = 2000; return SessionStorageSendBuffer; }()); exports.SessionStorageSendBuffer = SessionStorageSendBuffer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SendBuffer.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Sender.js": /*!**********************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Sender.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./SendBuffer */ "./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js"), __webpack_require__(/*! ./EnvelopeCreator */ "./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js"), __webpack_require__(/*! ./TelemetryValidation/EventValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js"), __webpack_require__(/*! ./TelemetryValidation/TraceValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js"), __webpack_require__(/*! ./TelemetryValidation/ExceptionValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js"), __webpack_require__(/*! ./TelemetryValidation/MetricValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js"), __webpack_require__(/*! ./TelemetryValidation/PageViewPerformanceValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js"), __webpack_require__(/*! ./TelemetryValidation/PageViewValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js"), __webpack_require__(/*! ./TelemetryValidation/RemoteDepdencyValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js"), __webpack_require__(/*! ./Serializer */ "./node_modules/applicationinsights-channel-js/bundle/Serializer.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./Offline */ "./node_modules/applicationinsights-channel-js/bundle/Offline.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, SendBuffer_1, EnvelopeCreator_1, EventValidator_1, TraceValidator_1, ExceptionValidator_1, MetricValidator_1, PageViewPerformanceValidator_1, PageViewValidator_1, RemoteDepdencyValidator_1, Serializer_1, applicationinsights_common_1, applicationinsights_core_js_1, applicationinsights_core_js_2, Offline_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Sender = /** @class */ (function () { function Sender() { this.priority = 201; /** * Whether XMLHttpRequest object is supported. Older version of IE (8,9) do not support it. */ this._XMLHttpRequestSupported = false; } Sender.prototype.pause = function () { throw new Error("Method not implemented."); }; Sender.prototype.resume = function () { throw new Error("Method not implemented."); }; Sender.prototype.flush = function () { try { this.triggerSend(); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FlushFailed, "flush failed, telemetry will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; Sender.prototype.teardown = function () { throw new Error("Method not implemented."); }; Sender.prototype.initialize = function (config, core, extensions) { this.identifier = "AppInsightsChannelPlugin"; this._logger = core.logger; this._serializer = new Serializer_1.Serializer(core.logger); this._consecutiveErrors = 0; this._retryAt = null; this._lastSend = 0; this._config = Sender._getDefaultAppInsightsChannelConfig(config, this.identifier); this._sender = null; this._buffer = (applicationinsights_common_1.Util.canUseSessionStorage() && this._config.enableSessionStorageBuffer) ? new SendBuffer_1.SessionStorageSendBuffer(this._logger, this._config) : new SendBuffer_1.ArraySendBuffer(this._config); if (!this._config.isBeaconApiDisabled() && applicationinsights_common_1.Util.IsBeaconApiSupported()) { this._sender = this._beaconSender; } else { if (typeof XMLHttpRequest != "undefined") { var testXhr = new XMLHttpRequest(); if ("withCredentials" in testXhr) { this._sender = this._xhrSender; this._XMLHttpRequestSupported = true; } else if (typeof XDomainRequest !== "undefined") { this._sender = this._xdrSender; //IE 8 and 9 } } } }; Sender.prototype.processTelemetry = function (telemetryItem) { try { // if master off switch is set, don't send any data if (this._config.disableTelemetry()) { // Do not send/save data return; } // validate input if (!telemetryItem) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSendEmptyTelemetry, "Cannot send empty telemetry"); return; } // ensure a sender was constructed if (!this._sender) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.SenderNotInitialized, "Sender was not initialized"); return; } // first we need to validate that the envelope passed down is valid var isValid = Sender._validate(telemetryItem); if (!isValid) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "Invalid telemetry envelope"); return; } // construct an envelope that Application Insights endpoint can understand var aiEnvelope = this._constructEnvelope(telemetryItem); if (!aiEnvelope) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CreateEnvelopeError, "Unable to create an AppInsights envelope"); return; } // check if the incoming payload is too large, truncate if necessary var payload = this._serializer.serialize(aiEnvelope); // flush if we would exceed the max-size limit by adding this item var bufferPayload = this._buffer.getItems(); var batch = this._buffer.batchPayloads(bufferPayload); if (batch && (batch.length + payload.length > this._config.maxBatchSizeInBytes())) { this.triggerSend(); } // enqueue the payload this._buffer.enqueue(payload); // ensure an invocation timeout is set this._setupTimer(); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedAddingTelemetryToBuffer, "Failed adding telemetry to the sender's buffer, some telemetry will be lost: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } // hand off the telemetry item to the next plugin if (!applicationinsights_core_js_2.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(telemetryItem); } }; Sender.prototype.setNextPlugin = function (next) { this._nextPlugin = next; }; /** * xhr state changes */ Sender.prototype._xhrReadyStateChange = function (xhr, payload, countOfItemsInPayload) { if (xhr.readyState === 4) { var response = null; if (!this._appId) { response = this._parseResponse(xhr.responseText || xhr.response); if (response && response.appId) { this._appId = response.appId; } } if ((xhr.status < 200 || xhr.status >= 300) && xhr.status !== 0) { if (!this._config.isRetryDisabled() && this._isRetriable(xhr.status)) { this._resendPayload(payload); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Response code " + xhr.status + ". Will retry to send " + payload.length + " items."); } else { this._onError(payload, this._formatErrorMessageXhr(xhr)); } } else if (xhr.status === 0 || Offline_1.Offline.isOffline()) { if (!this._config.isRetryDisabled()) { var offlineBackOffMultiplier = 10; // arbritrary number this._resendPayload(payload, offlineBackOffMultiplier); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". Offline - Response Code: " + xhr.status + ". Offline status: " + Offline_1.Offline.isOffline() + ". Will retry to send " + payload.length + " items."); } } else { if (xhr.status === 206) { if (!response) { response = this._parseResponse(xhr.responseText || xhr.response); } if (response && !this._config.isRetryDisabled()) { this._onPartialSuccess(payload, response); } else { this._onError(payload, this._formatErrorMessageXhr(xhr)); } } else { this._consecutiveErrors = 0; this._onSuccess(payload, countOfItemsInPayload); } } } }; /** * Immediately send buffered data * @param async {boolean} - Indicates if the events should be sent asynchronously */ Sender.prototype.triggerSend = function (async) { if (async === void 0) { async = true; } try { // Send data only if disableTelemetry is false if (!this._config.disableTelemetry()) { if (this._buffer.count() > 0) { var payload = this._buffer.getItems(); // invoke send this._sender(payload, async); } // update lastSend time to enable throttling this._lastSend = +new Date; } else { this._buffer.clear(); } clearTimeout(this._timeoutHandle); this._timeoutHandle = null; this._retryAt = null; } catch (e) { /* Ignore this error for IE under v10 */ if (!applicationinsights_common_1.Util.getIEVersion() || applicationinsights_common_1.Util.getIEVersion() > 9) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, "Telemetry transmission failed, some telemetry will be lost: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } } }; /** * error handler */ Sender.prototype._onError = function (payload, message, event) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.OnError, "Failed to send telemetry.", { message: message }); this._buffer.clearSent(payload); }; /** * partial success handler */ Sender.prototype._onPartialSuccess = function (payload, results) { var failed = []; var retry = []; // Iterate through the reversed array of errors so that splicing doesn't have invalid indexes after the first item. var errors = results.errors.reverse(); for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) { var error = errors_1[_i]; var extracted = payload.splice(error.index, 1)[0]; if (this._isRetriable(error.statusCode)) { retry.push(extracted); } else { // All other errors, including: 402 (Monthly quota exceeded) and 439 (Too many requests and refresh cache). failed.push(extracted); } } if (payload.length > 0) { this._onSuccess(payload, results.itemsAccepted); } if (failed.length > 0) { this._onError(failed, this._formatErrorMessageXhr(null, ['partial success', results.itemsAccepted, 'of', results.itemsReceived].join(' '))); } if (retry.length > 0) { this._resendPayload(retry); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, "Partial success. " + "Delivered: " + payload.length + ", Failed: " + failed.length + ". Will retry to send " + retry.length + " our of " + results.itemsReceived + " items"); } }; /** * success handler */ Sender.prototype._onSuccess = function (payload, countOfItemsInPayload) { this._buffer.clearSent(payload); }; /** * xdr state changes */ Sender.prototype._xdrOnLoad = function (xdr, payload) { if (xdr && (xdr.responseText + "" === "200" || xdr.responseText === "")) { this._consecutiveErrors = 0; this._onSuccess(payload, 0); } else { var results = this._parseResponse(xdr.responseText); if (results && results.itemsReceived && results.itemsReceived > results.itemsAccepted && !this._config.isRetryDisabled()) { this._onPartialSuccess(payload, results); } else { this._onError(payload, this._formatErrorMessageXdr(xdr)); } } }; Sender.prototype._constructEnvelope = function (envelope) { switch (envelope.baseType) { case applicationinsights_common_1.Event.dataType: return EnvelopeCreator_1.EventEnvelopeCreator.EventEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Trace.dataType: return EnvelopeCreator_1.TraceEnvelopeCreator.TraceEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.PageView.dataType: return EnvelopeCreator_1.PageViewEnvelopeCreator.PageViewEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.PageViewPerformance.dataType: return EnvelopeCreator_1.PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Exception.dataType: return EnvelopeCreator_1.ExceptionEnvelopeCreator.ExceptionEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Metric.dataType: return EnvelopeCreator_1.MetricEnvelopeCreator.MetricEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.RemoteDependencyData.dataType: return EnvelopeCreator_1.DependencyEnvelopeCreator.DependencyEnvelopeCreator.Create(this._logger, envelope); default: // default create custom event type return EnvelopeCreator_1.EventEnvelopeCreator.EventEnvelopeCreator.Create(this._logger, envelope); } }; Sender._getDefaultAppInsightsChannelConfig = function (config, identifier) { var resultConfig = {}; var pluginConfig = config.extensionConfig && config.extensionConfig[identifier] ? config.extensionConfig[identifier] : {}; // set default values resultConfig.endpointUrl = function () { return config.endpointUrl || "https://dc.services.visualstudio.com/v2/track"; }; resultConfig.emitLineDelimitedJson = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.emitLineDelimitedJson); }; resultConfig.maxBatchInterval = function () { return !isNaN(pluginConfig.maxBatchInterval) ? pluginConfig.maxBatchInterval : 15000; }; resultConfig.maxBatchSizeInBytes = function () { return pluginConfig.maxBatchSizeInBytes > 0 ? pluginConfig.maxBatchSizeInBytes : 102400; }; // 100kb resultConfig.disableTelemetry = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.disableTelemetry); }; resultConfig.enableSessionStorageBuffer = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.enableSessionStorageBuffer, true); }; resultConfig.isRetryDisabled = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.isRetryDisabled); }; resultConfig.isBeaconApiDisabled = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.isBeaconApiDisabled, true); }; return resultConfig; }; Sender._validate = function (envelope) { // call the appropriate Validate depending on the baseType switch (envelope.baseType) { case applicationinsights_common_1.Event.dataType: return EventValidator_1.EventValidator.EventValidator.Validate(envelope); case applicationinsights_common_1.Trace.dataType: return TraceValidator_1.TraceValidator.TraceValidator.Validate(envelope); case applicationinsights_common_1.Exception.dataType: return ExceptionValidator_1.ExceptionValidator.ExceptionValidator.Validate(envelope); case applicationinsights_common_1.Metric.dataType: return MetricValidator_1.MetricValidator.MetricValidator.Validate(envelope); case applicationinsights_common_1.PageView.dataType: return PageViewValidator_1.PageViewValidator.PageViewValidator.Validate(envelope); case applicationinsights_common_1.PageViewPerformance.dataType: return PageViewPerformanceValidator_1.PageViewPerformanceValidator.PageViewPerformanceValidator.Validate(envelope); case applicationinsights_common_1.RemoteDependencyData.dataType: return RemoteDepdencyValidator_1.RemoteDepdencyValidator.RemoteDepdencyValidator.Validate(envelope); default: return EventValidator_1.EventValidator.EventValidator.Validate(envelope); } }; /** * Send Beacon API request * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - not used * Note: Beacon API does not support custom headers and we are not able to get * appId from the backend for the correct correlation. */ Sender.prototype._beaconSender = function (payload, isAsync) { var url = this._config.endpointUrl(); var batch = this._buffer.batchPayloads(payload); // Chrome only allows CORS-safelisted values for the sendBeacon data argument // see: https://bugs.chromium.org/p/chromium/issues/detail?id=720283 var plainTextBatch = new Blob([batch], { type: 'text/plain;charset=UTF-8' }); // The sendBeacon method returns true if the user agent is able to successfully queue the data for transfer. Otherwise it returns false. var queued = navigator.sendBeacon(url, plainTextBatch); if (queued) { this._buffer.markAsSent(payload); } else { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Failed to send telemetry with Beacon API."); } }; /** * Send XMLHttpRequest * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - Indicates if the request should be sent asynchronously */ Sender.prototype._xhrSender = function (payload, isAsync) { var _this = this; var xhr = new XMLHttpRequest(); xhr[applicationinsights_common_1.DisabledPropertyName] = true; xhr.open("POST", this._config.endpointUrl(), isAsync); xhr.setRequestHeader("Content-type", "application/json"); // append Sdk-Context request header only in case of breeze endpoint if (applicationinsights_common_1.Util.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.sdkContextHeader, applicationinsights_common_1.RequestHeaders.sdkContextHeaderAppIdRequest); } xhr.onreadystatechange = function () { return _this._xhrReadyStateChange(xhr, payload, payload.length); }; xhr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXhr(xhr), event); }; // compose an array of payloads var batch = this._buffer.batchPayloads(payload); xhr.send(batch); this._buffer.markAsSent(payload); }; /** * Parses the response from the backend. * @param response - XMLHttpRequest or XDomainRequest response */ Sender.prototype._parseResponse = function (response) { try { if (response && response !== "") { var result = JSON.parse(response); if (result && result.itemsReceived && result.itemsReceived >= result.itemsAccepted && result.itemsReceived - result.itemsAccepted == result.errors.length) { return result; } } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.InvalidBackendResponse, "Cannot parse the response. " + applicationinsights_common_1.Util.getExceptionName(e), { response: response }); } return null; }; /** * Resend payload. Adds payload back to the send buffer and setup a send timer (with exponential backoff). * @param payload */ Sender.prototype._resendPayload = function (payload, linearFactor) { if (linearFactor === void 0) { linearFactor = 1; } if (!payload || payload.length === 0) { return; } this._buffer.clearSent(payload); this._consecutiveErrors++; for (var _i = 0, payload_1 = payload; _i < payload_1.length; _i++) { var item = payload_1[_i]; this._buffer.enqueue(item); } // setup timer this._setRetryTime(linearFactor); this._setupTimer(); }; /** Calculates the time to wait before retrying in case of an error based on * http://en.wikipedia.org/wiki/Exponential_backoff */ Sender.prototype._setRetryTime = function (linearFactor) { var SlotDelayInSeconds = 10; var delayInSeconds; if (this._consecutiveErrors <= 1) { delayInSeconds = SlotDelayInSeconds; } else { var backOffSlot = (Math.pow(2, this._consecutiveErrors) - 1) / 2; // tslint:disable-next-line:insecure-random var backOffDelay = Math.floor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1; backOffDelay = linearFactor * backOffDelay; delayInSeconds = Math.max(Math.min(backOffDelay, 3600), SlotDelayInSeconds); } // TODO: Log the backoff time like the C# version does. var retryAfterTimeSpan = Date.now() + (delayInSeconds * 1000); // TODO: Log the retry at time like the C# version does. this._retryAt = retryAfterTimeSpan; }; /** * Sets up the timer which triggers actually sending the data. */ Sender.prototype._setupTimer = function () { var _this = this; if (!this._timeoutHandle) { var retryInterval = this._retryAt ? Math.max(0, this._retryAt - Date.now()) : 0; var timerValue = Math.max(this._config.maxBatchInterval(), retryInterval); this._timeoutHandle = setTimeout(function () { _this.triggerSend(); }, timerValue); } }; /** * Checks if the SDK should resend the payload after receiving this status code from the backend. * @param statusCode */ Sender.prototype._isRetriable = function (statusCode) { return statusCode == 408 // Timeout || statusCode == 429 // Too many requests. || statusCode == 500 // Internal server error. || statusCode == 503; // Service unavailable. }; Sender.prototype._formatErrorMessageXhr = function (xhr, message) { if (xhr) { return "XMLHttpRequest,Status:" + xhr.status + ",Response:" + xhr.responseText || xhr.response || ""; } return message; }; /** * Send XDomainRequest * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - Indicates if the request should be sent asynchronously * * Note: XDomainRequest does not support sync requests. This 'isAsync' parameter is added * to maintain consistency with the xhrSender's contract * Note: XDomainRequest does not support custom headers and we are not able to get * appId from the backend for the correct correlation. */ Sender.prototype._xdrSender = function (payload, isAsync) { var _this = this; var xdr = new XDomainRequest(); xdr.onload = function () { return _this._xdrOnLoad(xdr, payload); }; xdr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXdr(xdr), event); }; // XDomainRequest requires the same protocol as the hosting page. // If the protocol doesn't match, we can't send the telemetry :(. var hostingProtocol = window.location.protocol; if (this._config.endpointUrl().lastIndexOf(hostingProtocol, 0) !== 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."); this._buffer.clear(); return; } var endpointUrl = this._config.endpointUrl().replace(/^(https?:)/, ""); xdr.open('POST', endpointUrl); // compose an array of payloads var batch = this._buffer.batchPayloads(payload); xdr.send(batch); this._buffer.markAsSent(payload); }; Sender.prototype._formatErrorMessageXdr = function (xdr, message) { if (xdr) { return "XDomainRequest,Response:" + xdr.responseText || ""; } return message; }; return Sender; }()); exports.Sender = Sender; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Sender.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Serializer.js": /*!**************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Serializer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Serializer = /** @class */ (function () { function Serializer(logger) { this._logger = logger; } /** * Serializes the current object to a JSON string. */ Serializer.prototype.serialize = function (input) { var output = this._serializeObject(input, "root"); return JSON.stringify(output); }; Serializer.prototype._serializeObject = function (source, name) { var circularReferenceCheck = "__aiCircularRefCheck"; var output = {}; if (!source) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObject, "cannot serialize object because it is null or undefined", { name: name }, true); return output; } if (source[circularReferenceCheck]) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CircularReferenceDetected, "Circular reference detected while serializing object", { name: name }, true); return output; } if (!source.aiDataContract) { // special case for measurements/properties/tags if (name === "measurements") { output = this._serializeStringMap(source, "number", name); } else if (name === "properties") { output = this._serializeStringMap(source, "string", name); } else if (name === "tags") { output = this._serializeStringMap(source, "string", name); } else if (applicationinsights_common_1.Util.isArray(source)) { output = this._serializeArray(source, name); } else { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObjectNonSerializable, "Attempting to serialize an object which does not implement ISerializable", { name: name }, true); try { // verify that the object can be stringified JSON.stringify(source); output = source; } catch (e) { // if serialization fails return an empty string this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObject, (e && typeof e.toString === 'function') ? e.toString() : "Error serializing object", null, true); } } return output; } source[circularReferenceCheck] = true; for (var field in source.aiDataContract) { var contract = source.aiDataContract[field]; var isRequired = (typeof contract === "function") ? (contract() & applicationinsights_common_1.FieldType.Required) : (contract & applicationinsights_common_1.FieldType.Required); var isHidden = (typeof contract === "function") ? (contract() & applicationinsights_common_1.FieldType.Hidden) : (contract & applicationinsights_common_1.FieldType.Hidden); var isArray = contract & applicationinsights_common_1.FieldType.Array; var isPresent = source[field] !== undefined; var isObject = typeof source[field] === "object" && source[field] !== null; if (isRequired && !isPresent && !isArray) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.MissingRequiredFieldSpecification, "Missing required field specification. The field is required but not present on source", { field: field, name: name }); // If not in debug mode, continue and hope the error is permissible continue; } if (isHidden) { // Don't serialize hidden fields continue; } var value; if (isObject) { if (isArray) { // special case; resurse on each object in the source array value = this._serializeArray(source[field], field); } else { // recurse on the source object in this field value = this._serializeObject(source[field], field); } } else { // assign the source field to the output even if undefined or required value = source[field]; } // only emit this field if the value is defined if (value !== undefined) { output[field] = value; } } delete source[circularReferenceCheck]; return output; }; Serializer.prototype._serializeArray = function (sources, name) { var output = undefined; if (!!sources) { if (!applicationinsights_common_1.Util.isArray(sources)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ItemNotInArray, "This field was specified as an array in the contract but the item is not an array.\r\n", { name: name }, true); } else { output = []; for (var i = 0; i < sources.length; i++) { var source = sources[i]; var item = this._serializeObject(source, name + "[" + i + "]"); output.push(item); } } } return output; }; Serializer.prototype._serializeStringMap = function (map, expectedType, name) { var output = undefined; if (map) { output = {}; for (var field in map) { var value = map[field]; if (expectedType === "string") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else if (!value.toString) { output[field] = "invalid field: toString() is not defined."; } else { output[field] = value.toString(); } } else if (expectedType === "number") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else { var num = parseFloat(value); if (isNaN(num)) { output[field] = "NaN"; } else { output[field] = num; } } } else { output[field] = "invalid field: " + name + " is of unknown type."; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, output[field], null, true); } } } return output; }; return Serializer; }()); exports.Serializer = Serializer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Serializer.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var EventValidator = /** @class */ (function () { function EventValidator() { } EventValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["name"]) { return false; } */ return true; }; EventValidator.EventValidator = new EventValidator(); return EventValidator; }()); exports.EventValidator = EventValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var ExceptionValidator = /** @class */ (function () { function ExceptionValidator() { } ExceptionValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["exceptions"] || !ExceptionValidator._validateExceptions(item.domainProperties["exceptions"])) { return false; } */ return true; }; // TODO implement validation of exceptions ExceptionValidator._validateExceptions = function (exceptions) { // typeName // message // parsedStack // stack // hasFullStack return true; }; ExceptionValidator.ExceptionValidator = new ExceptionValidator(); return ExceptionValidator; }()); exports.ExceptionValidator = ExceptionValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var MetricValidator = /** @class */ (function () { function MetricValidator() { } MetricValidator.prototype.Validate = function (event) { return true; }; MetricValidator.MetricValidator = new MetricValidator(); return MetricValidator; }()); exports.MetricValidator = MetricValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MetricValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js": /*!****************************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js ***! \****************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewPerformanceValidator = /** @class */ (function () { function PageViewPerformanceValidator() { } PageViewPerformanceValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["domProcessing"] || !item.domainProperties["duration"] || !item.domainProperties["name"] || !item.domainProperties["networkConnect"] || !item.domainProperties["perfTotal"] || !item.domainProperties["receivedResponse"] || !item.domainProperties["sentRequest"] || !item.domainProperties["url"]) { return false; } */ return true; }; PageViewPerformanceValidator.PageViewPerformanceValidator = new PageViewPerformanceValidator(); return PageViewPerformanceValidator; }()); exports.PageViewPerformanceValidator = PageViewPerformanceValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerformanceValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewValidator = /** @class */ (function () { function PageViewValidator() { } PageViewValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["id"] || !item.domainProperties["name"] || !item.domainProperties["duration"] || !item.domainProperties["url"]) { return false; } */ return true; }; PageViewValidator.PageViewValidator = new PageViewValidator(); return PageViewValidator; }()); exports.PageViewValidator = PageViewValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RemoteDepdencyValidator = /** @class */ (function () { function RemoteDepdencyValidator() { } RemoteDepdencyValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["id"] || !item.domainProperties["name"] || !item.domainProperties["resultCode"] || !item.domainProperties["duration"] || !item.domainProperties["success"] || !item.domainProperties["data"] || !item.domainProperties["target"] || !item.domainProperties["type"]) { return false; } */ return true; }; RemoteDepdencyValidator.RemoteDepdencyValidator = new RemoteDepdencyValidator(); return RemoteDepdencyValidator; }()); exports.RemoteDepdencyValidator = RemoteDepdencyValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDepdencyValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TraceValidator = /** @class */ (function () { function TraceValidator() { } TraceValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["message"] || !item.domainProperties["severityLevel"]) { return false; } */ return true; }; TraceValidator.TraceValidator = new TraceValidator(); return TraceValidator; }()); exports.TraceValidator = TraceValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=TraceValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js": /*!**********************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js ***! \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Sender */ "./node_modules/applicationinsights-channel-js/bundle/Sender.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Sender_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Sender = Sender_1.Sender; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-channel-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Constants.js": /*!*********************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Constants.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Constants.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Enums.js": /*!*****************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Enums.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Type of storage to differentiate between local storage and session storage */ var StorageType; (function (StorageType) { StorageType[StorageType["LocalStorage"] = 0] = "LocalStorage"; StorageType[StorageType["SessionStorage"] = 1] = "SessionStorage"; })(StorageType = exports.StorageType || (exports.StorageType = {})); /** * Enum is used in aiDataContract to describe how fields are serialized. * For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array */ var FieldType; (function (FieldType) { FieldType[FieldType["Default"] = 0] = "Default"; FieldType[FieldType["Required"] = 1] = "Required"; FieldType[FieldType["Array"] = 2] = "Array"; FieldType[FieldType["Hidden"] = 4] = "Hidden"; })(FieldType = exports.FieldType || (exports.FieldType = {})); ; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Enums.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js": /*!***********************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Data struct to contain only C section with custom fields. */ var Base = /** @class */ (function () { function Base() { } return Base; }()); exports.Base = Base; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Base.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js ***! \*********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED var ContextTagKeys = /** @class */ (function () { function ContextTagKeys() { this.applicationVersion = "ai.application.ver"; this.applicationBuild = "ai.application.build"; this.applicationTypeId = "ai.application.typeId"; this.applicationId = "ai.application.applicationId"; this.applicationLayer = "ai.application.layer"; this.deviceId = "ai.device.id"; this.deviceIp = "ai.device.ip"; this.deviceLanguage = "ai.device.language"; this.deviceLocale = "ai.device.locale"; this.deviceModel = "ai.device.model"; this.deviceFriendlyName = "ai.device.friendlyName"; this.deviceNetwork = "ai.device.network"; this.deviceNetworkName = "ai.device.networkName"; this.deviceOEMName = "ai.device.oemName"; this.deviceOS = "ai.device.os"; this.deviceOSVersion = "ai.device.osVersion"; this.deviceRoleInstance = "ai.device.roleInstance"; this.deviceRoleName = "ai.device.roleName"; this.deviceScreenResolution = "ai.device.screenResolution"; this.deviceType = "ai.device.type"; this.deviceMachineName = "ai.device.machineName"; this.deviceVMName = "ai.device.vmName"; this.deviceBrowser = "ai.device.browser"; this.deviceBrowserVersion = "ai.device.browserVersion"; this.locationIp = "ai.location.ip"; this.locationCountry = "ai.location.country"; this.locationProvince = "ai.location.province"; this.locationCity = "ai.location.city"; this.operationId = "ai.operation.id"; this.operationName = "ai.operation.name"; this.operationParentId = "ai.operation.parentId"; this.operationRootId = "ai.operation.rootId"; this.operationSyntheticSource = "ai.operation.syntheticSource"; this.operationCorrelationVector = "ai.operation.correlationVector"; this.sessionId = "ai.session.id"; this.sessionIsFirst = "ai.session.isFirst"; this.sessionIsNew = "ai.session.isNew"; this.userAccountAcquisitionDate = "ai.user.accountAcquisitionDate"; this.userAccountId = "ai.user.accountId"; this.userAgent = "ai.user.userAgent"; this.userId = "ai.user.id"; this.userStoreRegion = "ai.user.storeRegion"; this.userAuthUserId = "ai.user.authUserId"; this.userAnonymousUserAcquisitionDate = "ai.user.anonUserAcquisitionDate"; this.userAuthenticatedUserAcquisitionDate = "ai.user.authUserAcquisitionDate"; this.cloudName = "ai.cloud.name"; this.cloudRole = "ai.cloud.role"; this.cloudRoleVer = "ai.cloud.roleVer"; this.cloudRoleInstance = "ai.cloud.roleInstance"; this.cloudEnvironment = "ai.cloud.environment"; this.cloudLocation = "ai.cloud.location"; this.cloudDeploymentUnit = "ai.cloud.deploymentUnit"; this.internalSdkVersion = "ai.internal.sdkVersion"; this.internalAgentVersion = "ai.internal.agentVersion"; this.internalNodeName = "ai.internal.nodeName"; } return ContextTagKeys; }()); exports.ContextTagKeys = ContextTagKeys; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ContextTagKeys.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js": /*!***********************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Base */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Base_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Data struct to contain both B and C sections. */ var Data = /** @class */ (function (_super) { __extends(Data, _super); function Data() { return _super.call(this) || this; } return Data; }(Base_1.Base)); exports.Data = Data; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Data.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./DataPointType */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataPointType_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Metric data single measurement. */ var DataPoint = /** @class */ (function () { function DataPoint() { this.kind = DataPointType_1.DataPointType.Measurement; } return DataPoint; }()); exports.DataPoint = DataPoint; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPoint.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED /** * Type of the metric data measurement. */ var DataPointType; (function (DataPointType) { DataPointType[DataPointType["Measurement"] = 0] = "Measurement"; DataPointType[DataPointType["Aggregation"] = 1] = "Aggregation"; })(DataPointType = exports.DataPointType || (exports.DataPointType = {})); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPointType.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js": /*!*************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js ***! \*************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * The abstract common base of all domains. */ var Domain = /** @class */ (function () { function Domain() { } return Domain; }()); exports.Domain = Domain; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Domain.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * System variables for a telemetry item. */ var Envelope = /** @class */ (function () { function Envelope() { this.ver = 1; this.sampleRate = 100.0; this.tags = {}; } return Envelope; }()); exports.Envelope = Envelope; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Envelope.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Instances of Event represent structured event records that can be grouped and searched by their properties. Event data item also creates a metric of event count by name. */ var EventData = /** @class */ (function (_super) { __extends(EventData, _super); function EventData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return EventData; }(Domain_1.Domain)); exports.EventData = EventData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of Exception represents a handled or unhandled exception that occurred during execution of the monitored application. */ var ExceptionData = /** @class */ (function (_super) { __extends(ExceptionData, _super); function ExceptionData() { var _this = _super.call(this) || this; _this.ver = 2; _this.exceptions = []; _this.properties = {}; _this.measurements = {}; return _this; } return ExceptionData; }(Domain_1.Domain)); exports.ExceptionData = ExceptionData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Exception details of the exception in a chain. */ var ExceptionDetails = /** @class */ (function () { function ExceptionDetails() { this.hasFullStack = true; this.parsedStack = []; } return ExceptionDetails; }()); exports.ExceptionDetails = ExceptionDetails; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionDetails.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Instances of Message represent printf-like trace statements that are text-searched. Log4Net, NLog and other text-based log file entries are translated into intances of this type. The message does not have measurements. */ var MessageData = /** @class */ (function (_super) { __extends(MessageData, _super); function MessageData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; return _this; } return MessageData; }(Domain_1.Domain)); exports.MessageData = MessageData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MessageData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of the Metric item is a list of measurements (single data points) and/or aggregations. */ var MetricData = /** @class */ (function (_super) { __extends(MetricData, _super); function MetricData() { var _this = _super.call(this) || this; _this.ver = 2; _this.metrics = []; _this.properties = {}; return _this; } return MetricData; }(Domain_1.Domain)); exports.MetricData = MetricData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MetricData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js ***! \*******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./EventData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView. */ var PageViewData = /** @class */ (function (_super) { __extends(PageViewData, _super); function PageViewData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return PageViewData; }(EventData_1.EventData)); exports.PageViewData = PageViewData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of PageViewPerf represents: a page view with no performance data, a page view with performance data, or just the performance data of an earlier page request. */ var PageViewPerfData = /** @class */ (function (_super) { __extends(PageViewPerfData, _super); function PageViewPerfData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return PageViewPerfData; }(PageViewData_1.PageViewData)); exports.PageViewPerfData = PageViewPerfData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerfData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js": /*!***************************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js ***! \***************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of Remote Dependency represents an interaction of the monitored component with a remote component/service like SQL or an HTTP endpoint. */ var RemoteDependencyData = /** @class */ (function (_super) { __extends(RemoteDependencyData, _super); function RemoteDependencyData() { var _this = _super.call(this) || this; _this.ver = 2; _this.success = true; _this.properties = {}; _this.measurements = {}; return _this; } return RemoteDependencyData; }(Domain_1.Domain)); exports.RemoteDependencyData = RemoteDependencyData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDependencyData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Defines the level of severity for the event. */ var SeverityLevel; (function (SeverityLevel) { SeverityLevel[SeverityLevel["Verbose"] = 0] = "Verbose"; SeverityLevel[SeverityLevel["Information"] = 1] = "Information"; SeverityLevel[SeverityLevel["Warning"] = 2] = "Warning"; SeverityLevel[SeverityLevel["Error"] = 3] = "Error"; SeverityLevel[SeverityLevel["Critical"] = 4] = "Critical"; })(SeverityLevel = exports.SeverityLevel || (exports.SeverityLevel = {})); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SeverityLevel.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED /** * Stack frame information. */ var StackFrame = /** @class */ (function () { function StackFrame() { } return StackFrame; }()); exports.StackFrame = StackFrame; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=StackFrame.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js": /*!**********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RequestHeaders = /** @class */ (function () { function RequestHeaders() { } /** * Request-Context header */ RequestHeaders.requestContextHeader = "Request-Context"; /** * Target instrumentation header that is added to the response and retrieved by the * calling application when processing incoming responses. */ RequestHeaders.requestContextTargetKey = "appId"; /** * Request-Context appId format */ RequestHeaders.requestContextAppIdFormat = "appId=cid-v1:"; /** * Request-Id header */ RequestHeaders.requestIdHeader = "Request-Id"; /** * Sdk-Context header * If this header passed with appId in content then appId will be returned back by the backend. */ RequestHeaders.sdkContextHeader = "Sdk-Context"; /** * String to pass in header for requesting appId back from the backend. */ RequestHeaders.sdkContextHeaderAppIdRequest = "appId"; RequestHeaders.requestContextHeaderLowerCase = "request-context"; return RequestHeaders; }()); exports.RequestHeaders = RequestHeaders; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RequestResponseHeaders.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/Data */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Data_1, Enums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Data = /** @class */ (function (_super) { __extends(Data, _super); /** * Constructs a new instance of telemetry data. */ function Data(baseType, data) { var _this = _super.call(this) || this; /** * The data contract for serializing this object. */ _this.aiDataContract = { baseType: Enums_1.FieldType.Required, baseData: Enums_1.FieldType.Required }; _this.baseType = baseType; _this.baseData = data; return _this; } return Data; }(Data_1.Data)); exports.Data = Data; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Data.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/DataPoint */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataPoint_1, Enums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DataPoint = /** @class */ (function (_super) { __extends(DataPoint, _super); function DataPoint() { var _this = _super !== null && _super.apply(this, arguments) || this; /** * The data contract for serializing this object. */ _this.aiDataContract = { name: Enums_1.FieldType.Required, kind: Enums_1.FieldType.Default, value: Enums_1.FieldType.Required, count: Enums_1.FieldType.Default, min: Enums_1.FieldType.Default, max: Enums_1.FieldType.Default, stdDev: Enums_1.FieldType.Default }; return _this; } return DataPoint; }(DataPoint_1.DataPoint)); exports.DataPoint = DataPoint; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPoint.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ../../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DataSanitizer = /** @class */ (function () { function DataSanitizer() { } DataSanitizer.sanitizeKeyAndAddUniqueness = function (logger, key, map) { var origLength = key.length; var field = DataSanitizer.sanitizeKey(logger, key); // validation truncated the length. We need to add uniqueness if (field.length !== origLength) { var i = 0; var uniqueField = field; while (map[uniqueField] !== undefined) { i++; uniqueField = field.substring(0, DataSanitizer.MAX_NAME_LENGTH - 3) + DataSanitizer.padNumber(i); } field = uniqueField; } return field; }; DataSanitizer.sanitizeKey = function (logger, name) { if (name) { // Remove any leading or trailing whitepace name = Util_1.Util.trim(name.toString()); // truncate the string to 150 chars if (name.length > DataSanitizer.MAX_NAME_LENGTH) { name = name.substring(0, DataSanitizer.MAX_NAME_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + DataSanitizer.MAX_NAME_LENGTH + " characters.", { name: name }, true); } } return name; }; DataSanitizer.sanitizeString = function (logger, value, maxLength) { if (maxLength === void 0) { maxLength = DataSanitizer.MAX_STRING_LENGTH; } if (value) { maxLength = maxLength ? maxLength : DataSanitizer.MAX_STRING_LENGTH; // in case default parameters dont work value = Util_1.Util.trim(value); if (value.toString().length > maxLength) { value = value.toString().substring(0, maxLength); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true); } } return value; }; DataSanitizer.sanitizeUrl = function (logger, url) { return DataSanitizer.sanitizeInput(logger, url, DataSanitizer.MAX_URL_LENGTH, applicationinsights_core_js_1._InternalMessageId.UrlTooLong); }; DataSanitizer.sanitizeMessage = function (logger, message) { if (message) { if (message.length > DataSanitizer.MAX_MESSAGE_LENGTH) { message = message.substring(0, DataSanitizer.MAX_MESSAGE_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.MessageTruncated, "message is too long, it has been truncated to " + DataSanitizer.MAX_MESSAGE_LENGTH + " characters.", { message: message }, true); } } return message; }; DataSanitizer.sanitizeException = function (logger, exception) { if (exception) { if (exception.length > DataSanitizer.MAX_EXCEPTION_LENGTH) { exception = exception.substring(0, DataSanitizer.MAX_EXCEPTION_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + DataSanitizer.MAX_EXCEPTION_LENGTH + " characters.", { exception: exception }, true); } } return exception; }; DataSanitizer.sanitizeProperties = function (logger, properties) { if (properties) { var tempProps = {}; for (var prop in properties) { var value = DataSanitizer.sanitizeString(logger, properties[prop], DataSanitizer.MAX_PROPERTY_LENGTH); prop = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, prop, tempProps); tempProps[prop] = value; } properties = tempProps; } return properties; }; DataSanitizer.sanitizeMeasurements = function (logger, measurements) { if (measurements) { var tempMeasurements = {}; for (var measure in measurements) { var value = measurements[measure]; measure = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements); tempMeasurements[measure] = value; } measurements = tempMeasurements; } return measurements; }; DataSanitizer.sanitizeId = function (logger, id) { return id ? DataSanitizer.sanitizeInput(logger, id, DataSanitizer.MAX_ID_LENGTH, applicationinsights_core_js_1._InternalMessageId.IdTooLong).toString() : id; }; DataSanitizer.sanitizeInput = function (logger, input, maxLength, _msgId) { if (input) { input = Util_1.Util.trim(input); if (input.length > maxLength) { input = input.substring(0, maxLength); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true); } } return input; }; DataSanitizer.padNumber = function (num) { var s = "00" + num; return s.substr(s.length - 3); }; /** * Max length allowed for custom names. */ DataSanitizer.MAX_NAME_LENGTH = 150; /** * Max length allowed for Id field in page views. */ DataSanitizer.MAX_ID_LENGTH = 128; /** * Max length allowed for custom values. */ DataSanitizer.MAX_PROPERTY_LENGTH = 8192; /** * Max length allowed for names */ DataSanitizer.MAX_STRING_LENGTH = 1024; /** * Max length allowed for url. */ DataSanitizer.MAX_URL_LENGTH = 2048; /** * Max length allowed for messages. */ DataSanitizer.MAX_MESSAGE_LENGTH = 32768; /** * Max length allowed for exceptions. */ DataSanitizer.MAX_EXCEPTION_LENGTH = 32768; return DataSanitizer; }()); exports.DataSanitizer = DataSanitizer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataSanitizer.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js": /*!*************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/Envelope */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js"), __webpack_require__(/*! ./DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Envelope_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Envelope = /** @class */ (function (_super) { __extends(Envelope, _super); /** * Constructs a new instance of telemetry data. */ function Envelope(logger, data, name) { var _this = _super.call(this) || this; _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.data = data; _this.time = Util_1.Util.toISOStringForIE8(new Date()); _this.aiDataContract = { time: Enums_1.FieldType.Required, iKey: Enums_1.FieldType.Required, name: Enums_1.FieldType.Required, sampleRate: function () { return (_this.sampleRate == 100) ? Enums_1.FieldType.Hidden : Enums_1.FieldType.Required; }, tags: Enums_1.FieldType.Required, data: Enums_1.FieldType.Required }; return _this; } return Envelope; }(Envelope_1.Envelope)); exports.Envelope = Envelope; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Envelope.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Event.js": /*!***************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Event.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/EventData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Event = /** @class */ (function (_super) { __extends(Event, _super); /** * Constructs a new instance of the EventTelemetry object */ function Event(logger, name, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Required, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } Event.envelopeType = "Microsoft.ApplicationInsights.{0}.Event"; Event.dataType = "EventData"; return Event; }(EventData_1.EventData)); exports.Event = Event; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Event.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/StackFrame */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/ExceptionData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/ExceptionDetails */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, StackFrame_1, ExceptionData_1, ExceptionDetails_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Exception = /** @class */ (function (_super) { __extends(Exception, _super); /** * Constructs a new isntance of the ExceptionTelemetry object */ function Exception(logger, exception, properties, measurements, severityLevel) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, exceptions: Enums_1.FieldType.Required, severityLevel: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); _this.exceptions = [new _ExceptionDetails(logger, exception)]; if (severityLevel) { _this.severityLevel = severityLevel; } return _this; } /** * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception. */ Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) { return { exceptions: [ { hasFullStack: true, message: message, stack: details, typeName: typeName } ] }; }; Exception.envelopeType = "Microsoft.ApplicationInsights.{0}.Exception"; Exception.dataType = "ExceptionData"; return Exception; }(ExceptionData_1.ExceptionData)); exports.Exception = Exception; var _ExceptionDetails = /** @class */ (function (_super) { __extends(_ExceptionDetails, _super); function _ExceptionDetails(logger, exception) { var _this = _super.call(this) || this; _this.aiDataContract = { id: Enums_1.FieldType.Default, outerId: Enums_1.FieldType.Default, typeName: Enums_1.FieldType.Required, message: Enums_1.FieldType.Required, hasFullStack: Enums_1.FieldType.Default, stack: Enums_1.FieldType.Default, parsedStack: Enums_1.FieldType.Array }; _this.typeName = DataSanitizer_1.DataSanitizer.sanitizeString(logger, exception.name) || Util_1.Util.NotSpecified; _this.message = DataSanitizer_1.DataSanitizer.sanitizeMessage(logger, exception.message) || Util_1.Util.NotSpecified; var stack = exception["stack"]; _this.parsedStack = _this.parseStack(stack); _this.stack = DataSanitizer_1.DataSanitizer.sanitizeException(logger, stack); _this.hasFullStack = Util_1.Util.isArray(_this.parsedStack) && _this.parsedStack.length > 0; return _this; } _ExceptionDetails.prototype.parseStack = function (stack) { var parsedStack = undefined; if (typeof stack === "string") { var frames = stack.split('\n'); parsedStack = []; var level = 0; var totalSizeInBytes = 0; for (var i = 0; i <= frames.length; i++) { var frame = frames[i]; if (_StackFrame.regex.test(frame)) { var parsedFrame = new _StackFrame(frames[i], level++); totalSizeInBytes += parsedFrame.sizeInBytes; parsedStack.push(parsedFrame); } } // DP Constraint - exception parsed stack must be < 32KB // remove frames from the middle to meet the threshold var exceptionParsedStackThreshold = 32 * 1024; if (totalSizeInBytes > exceptionParsedStackThreshold) { var left = 0; var right = parsedStack.length - 1; var size = 0; var acceptedLeft = left; var acceptedRight = right; while (left < right) { // check size var lSize = parsedStack[left].sizeInBytes; var rSize = parsedStack[right].sizeInBytes; size += lSize + rSize; if (size > exceptionParsedStackThreshold) { // remove extra frames from the middle var howMany = acceptedRight - acceptedLeft + 1; parsedStack.splice(acceptedLeft, howMany); break; } // update pointers acceptedLeft = left; acceptedRight = right; left++; right--; } } } return parsedStack; }; return _ExceptionDetails; }(ExceptionDetails_1.ExceptionDetails)); var _StackFrame = /** @class */ (function (_super) { __extends(_StackFrame, _super); function _StackFrame(frame, level) { var _this = _super.call(this) || this; _this.sizeInBytes = 0; _this.aiDataContract = { level: Enums_1.FieldType.Required, method: Enums_1.FieldType.Required, assembly: Enums_1.FieldType.Default, fileName: Enums_1.FieldType.Default, line: Enums_1.FieldType.Default }; _this.level = level; _this.method = ""; _this.assembly = Util_1.Util.trim(frame); var matches = frame.match(_StackFrame.regex); if (matches && matches.length >= 5) { _this.method = Util_1.Util.trim(matches[2]) || _this.method; _this.fileName = Util_1.Util.trim(matches[4]); _this.line = parseInt(matches[5]) || 0; } _this.sizeInBytes += _this.method.length; _this.sizeInBytes += _this.fileName.length; _this.sizeInBytes += _this.assembly.length; // todo: these might need to be removed depending on how the back-end settles on their size calculation _this.sizeInBytes += _StackFrame.baseSize; _this.sizeInBytes += _this.level.toString().length; _this.sizeInBytes += _this.line.toString().length; return _this; } // regex to match stack frames from ie/chrome/ff // methodName=$2, fileName=$4, lineNo=$5, column=$6 _StackFrame.regex = /^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/; _StackFrame.baseSize = 58; //'{"method":"","level":,"assembly":"","fileName":"","line":}'.length return _StackFrame; }(StackFrame_1.StackFrame)); exports._StackFrame = _StackFrame; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Exception.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js": /*!****************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/MetricData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./Common/DataPoint */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, MetricData_1, DataSanitizer_1, Enums_1, DataPoint_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Metric = /** @class */ (function (_super) { __extends(Metric, _super); /** * Constructs a new instance of the MetricTelemetry object */ function Metric(logger, name, value, count, min, max, properties) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, metrics: Enums_1.FieldType.Required, properties: Enums_1.FieldType.Default }; var dataPoint = new DataPoint_1.DataPoint(); dataPoint.count = count > 0 ? count : undefined; dataPoint.max = isNaN(max) || max === null ? undefined : max; dataPoint.min = isNaN(min) || min === null ? undefined : min; dataPoint.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; dataPoint.value = value; _this.metrics = [dataPoint]; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); return _this; } Metric.envelopeType = "Microsoft.ApplicationInsights.{0}.Metric"; Metric.dataType = "MetricData"; return Metric; }(MetricData_1.MetricData)); exports.Metric = Metric; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Metric.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js": /*!******************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageView = /** @class */ (function (_super) { __extends(PageView, _super); /** * Constructs a new instance of the PageEventTelemetry object */ function PageView(logger, name, url, durationMs, properties, measurements, id) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, url: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default, id: Enums_1.FieldType.Default, }; _this.id = DataSanitizer_1.DataSanitizer.sanitizeId(logger, id); _this.url = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, url); _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; if (!isNaN(durationMs)) { _this.duration = Util_1.Util.msToTimeSpan(durationMs); } _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } PageView.envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview"; PageView.dataType = "PageviewData"; return PageView; }(PageViewData_1.PageViewData)); exports.PageView = PageView; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageView.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/PageViewPerfData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewPerfData_1, Enums_1, DataSanitizer_1, Util_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewPerformance = /** @class */ (function (_super) { __extends(PageViewPerformance, _super); /** * Constructs a new instance of the PageEventTelemetry object */ function PageViewPerformance(logger, name, url, unused, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, url: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, perfTotal: Enums_1.FieldType.Default, networkConnect: Enums_1.FieldType.Default, sentRequest: Enums_1.FieldType.Default, receivedResponse: Enums_1.FieldType.Default, domProcessing: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.isValid = false; /* * http://www.w3.org/TR/navigation-timing/#processing-model * |-navigationStart * | |-connectEnd * | ||-requestStart * | || |-responseStart * | || | |-responseEnd * | || | | * | || | | |-loadEventEnd * |---network---||---request---|---response---|---dom---| * |--------------------------total----------------------| */ var timing = PageViewPerformance.getPerformanceTiming(); if (timing) { var total = PageViewPerformance.getDuration(timing.navigationStart, timing.loadEventEnd); var network = PageViewPerformance.getDuration(timing.navigationStart, timing.connectEnd); var request = PageViewPerformance.getDuration(timing.requestStart, timing.responseStart); var response = PageViewPerformance.getDuration(timing.responseStart, timing.responseEnd); var dom = PageViewPerformance.getDuration(timing.responseEnd, timing.loadEventEnd); if (total == 0) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ErrorPVCalc, "error calculating page view performance.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (!PageViewPerformance.shouldCollectDuration(total, network, request, response, dom)) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.InvalidDurationValue, "Invalid page load duration value. Browser perf data won't be sent.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (total < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(dom)) { // some browsers may report individual components incorrectly so that the sum of the parts will be bigger than total PLT // in this case, don't report client performance from this page logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ClientPerformanceMathError, "client performance math error.", { total: total, network: network, request: request, response: response, dom: dom }); } else { _this.durationMs = total; // convert to timespans _this.perfTotal = _this.duration = Util_1.Util.msToTimeSpan(total); _this.networkConnect = Util_1.Util.msToTimeSpan(network); _this.sentRequest = Util_1.Util.msToTimeSpan(request); _this.receivedResponse = Util_1.Util.msToTimeSpan(response); _this.domProcessing = Util_1.Util.msToTimeSpan(dom); _this.isValid = true; } } _this.url = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, url); _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } /** * Indicates whether this instance of PageViewPerformance is valid and should be sent */ PageViewPerformance.prototype.getIsValid = function () { return this.isValid; }; /** * Gets the total duration (PLT) in milliseconds. Check getIsValid() before using this method. */ PageViewPerformance.prototype.getDurationMs = function () { return this.durationMs; }; PageViewPerformance.getPerformanceTiming = function () { if (PageViewPerformance.isPerformanceTimingSupported()) { return window.performance.timing; } return null; }; /** * Returns true is window performance timing API is supported, false otherwise. */ PageViewPerformance.isPerformanceTimingSupported = function () { return typeof window != "undefined" && window.performance && window.performance.timing; }; /** * As page loads different parts of performance timing numbers get set. When all of them are set we can report it. * Returns true if ready, false otherwise. */ PageViewPerformance.isPerformanceTimingDataReady = function () { var timing = window.performance.timing; return timing.domainLookupStart > 0 && timing.navigationStart > 0 && timing.responseStart > 0 && timing.requestStart > 0 && timing.loadEventEnd > 0 && timing.responseEnd > 0 && timing.connectEnd > 0 && timing.domLoading > 0; }; PageViewPerformance.getDuration = function (start, end) { var duration = undefined; if (!(isNaN(start) || isNaN(end))) { duration = Math.max(end - start, 0); } return duration; }; /** * This method tells if given durations should be excluded from collection. */ PageViewPerformance.shouldCollectDuration = function () { var durations = []; for (var _i = 0; _i < arguments.length; _i++) { durations[_i] = arguments[_i]; } // a full list of Google crawlers user agent strings - https://support.google.com/webmasters/answer/1061943?hl=en var botAgentNames = ['googlebot', 'adsbot-google', 'apis-google', 'mediapartners-google']; var userAgent = navigator.userAgent; var isGoogleBot = false; if (userAgent) { for (var i_1 = 0; i_1 < botAgentNames.length; i_1++) { isGoogleBot = isGoogleBot || userAgent.toLowerCase().indexOf(botAgentNames[i_1]) !== -1; } } if (isGoogleBot) { // Don't report durations for GoogleBot, it is returning invalid values in performance.timing API. return false; } else { // for other page views, don't report if it's outside of a reasonable range for (var i = 0; i < durations.length; i++) { if (durations[i] >= PageViewPerformance.MAX_DURATION_ALLOWED) { return false; } } } return true; }; PageViewPerformance.envelopeType = "Microsoft.ApplicationInsights.{0}.PageviewPerformance"; PageViewPerformance.dataType = "PageviewPerformanceData"; PageViewPerformance.MAX_DURATION_ALLOWED = 3600000; // 1h return PageViewPerformance; }(PageViewPerfData_1.PageViewPerfData)); exports.PageViewPerformance = PageViewPerformance; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerformance.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/RemoteDependencyData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataSanitizer_1, Enums_1, Util_1, Util_2, RemoteDependencyData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RemoteDependencyData = /** @class */ (function (_super) { __extends(RemoteDependencyData, _super); /** * Constructs a new instance of the RemoteDependencyData object */ function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { id: Enums_1.FieldType.Required, ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, resultCode: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, success: Enums_1.FieldType.Default, data: Enums_1.FieldType.Default, target: Enums_1.FieldType.Default, type: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default, kind: Enums_1.FieldType.Default, value: Enums_1.FieldType.Default, count: Enums_1.FieldType.Default, min: Enums_1.FieldType.Default, max: Enums_1.FieldType.Default, stdDev: Enums_1.FieldType.Default, dependencyKind: Enums_1.FieldType.Default, dependencySource: Enums_1.FieldType.Default, commandName: Enums_1.FieldType.Default, dependencyTypeName: Enums_1.FieldType.Default, }; _this.id = id; _this.duration = Util_1.Util.msToTimeSpan(value); _this.success = success; _this.resultCode = resultCode + ""; _this.type = "Ajax"; _this.data = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, commandName); var dependencyFields = Util_2.AjaxHelper.ParseDependencyPath(logger, absoluteUrl, method, commandName); _this.target = dependencyFields.target; _this.name = dependencyFields.name; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } RemoteDependencyData.envelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency"; RemoteDependencyData.dataType = "RemoteDependencyData"; return RemoteDependencyData; }(RemoteDependencyData_1.RemoteDependencyData)); exports.RemoteDependencyData = RemoteDependencyData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDependencyData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js": /*!***************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/MessageData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, MessageData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Trace = /** @class */ (function (_super) { __extends(Trace, _super); /** * Constructs a new instance of the TraceTelemetry object */ function Trace(logger, message, properties, severityLevel) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, message: Enums_1.FieldType.Required, severityLevel: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default }; message = message || Util_1.Util.NotSpecified; _this.message = DataSanitizer_1.DataSanitizer.sanitizeMessage(logger, message); _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); if (severityLevel) { _this.severityLevel = severityLevel; } return _this; } Trace.envelopeType = "Microsoft.ApplicationInsights.{0}.Message"; Trace.dataType = "MessageData"; return Trace; }(MessageData_1.MessageData)); exports.Trace = Trace; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Trace.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js": /*!********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Util_1, DataSanitizer_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TelemetryItemCreator = /** @class */ (function () { function TelemetryItemCreator() { } /** * Create a telemetry item that the 1DS channel understands * @param item domain specific properties; part B * @param baseType telemetry item type. ie PageViewData * @param envelopeName name of the envelope. ie Microsoft.ApplicationInsights..PageView * @param customProperties user defined custom properties; part C * @param systemProperties system properties that are added to the context; part A * @returns ITelemetryItem that is sent to channel */ TelemetryItemCreator.create = function (item, baseType, envelopeName, logger, customProperties, systemProperties) { envelopeName = DataSanitizer_1.DataSanitizer.sanitizeString(logger, envelopeName) || Util_1.Util.NotSpecified; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(item) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(baseType) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(envelopeName)) { throw Error("Input doesn't contain all required fields"); } var telemetryItem = { name: envelopeName, timestamp: new Date(), instrumentationKey: "", ctx: systemProperties ? systemProperties : {}, tags: [], data: {}, baseType: baseType, baseData: item }; // Part C if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties)) { for (var prop in customProperties) { if (customProperties.hasOwnProperty(prop)) { telemetryItem.data[prop] = customProperties[prop]; } } } return telemetryItem; }; return TelemetryItemCreator; }()); exports.TelemetryItemCreator = TelemetryItemCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=TelemetryItemCreator.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Util.js": /*!****************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Util.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./RequestResponseHeaders */ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Enums_1, applicationinsights_core_js_1, RequestResponseHeaders_1, DataSanitizer_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Util = /** @class */ (function () { function Util() { } /* * Force the SDK not to use local and session storage */ Util.disableStorage = function () { Util._canUseLocalStorage = false; Util._canUseSessionStorage = false; }; /** * Gets the localStorage object if available * @return {Storage} - Returns the storage object if available else returns null */ Util._getLocalStorageObject = function () { if (Util.canUseLocalStorage()) { return Util._getVerifiedStorageObject(Enums_1.StorageType.LocalStorage); } return null; }; /** * Tests storage object (localStorage or sessionStorage) to verify that it is usable * More details here: https://mathiasbynens.be/notes/localstorage-pattern * @param storageType Type of storage * @return {Storage} Returns storage object verified that it is usable */ Util._getVerifiedStorageObject = function (storageType) { var storage = null; var fail; var uid; try { uid = new Date; storage = storageType === Enums_1.StorageType.LocalStorage ? window.localStorage : window.sessionStorage; storage.setItem(uid, uid); fail = storage.getItem(uid) != uid; storage.removeItem(uid); if (fail) { storage = null; } } catch (exception) { storage = null; } return storage; }; /** * Checks if endpoint URL is application insights internal injestion service URL. * * @param endpointUrl Endpoint URL to check. * @returns {boolean} True if if endpoint URL is application insights internal injestion service URL. */ Util.isInternalApplicationInsightsEndpoint = function (endpointUrl) { return Util._internalEndpoints.indexOf(endpointUrl.toLowerCase()) !== -1; }; /** * Check if the browser supports local storage. * * @returns {boolean} True if local storage is supported. */ Util.canUseLocalStorage = function () { if (Util._canUseLocalStorage === undefined) { Util._canUseLocalStorage = !!Util._getVerifiedStorageObject(Enums_1.StorageType.LocalStorage); } return Util._canUseLocalStorage; }; /** * Get an object from the browser's local storage * * @param {string} name - the name of the object to get from storage * @returns {string} The contents of the storage object with the given name. Null if storage is not supported. */ Util.getStorage = function (logger, name) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return null; }; /** * Set the contents of an object in the browser's local storage * * @param {string} name - the name of the object to set in storage * @param {string} data - the contents of the object to set in storage * @returns {boolean} True if the storage object could be written. */ Util.setStorage = function (logger, name, data) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Remove an object from the browser's local storage * * @param {string} name - the name of the object to remove from storage * @returns {boolean} True if the storage object could be removed. */ Util.removeStorage = function (logger, name) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { storage.removeItem(name); return true; } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Gets the sessionStorage object if available * @return {Storage} - Returns the storage object if available else returns null */ Util._getSessionStorageObject = function () { if (Util.canUseSessionStorage()) { return Util._getVerifiedStorageObject(Enums_1.StorageType.SessionStorage); } return null; }; /** * Check if the browser supports session storage. * * @returns {boolean} True if session storage is supported. */ Util.canUseSessionStorage = function () { if (Util._canUseSessionStorage === undefined) { Util._canUseSessionStorage = !!Util._getVerifiedStorageObject(Enums_1.StorageType.SessionStorage); } return Util._canUseSessionStorage; }; /** * Gets the list of session storage keys * * @returns {string[]} List of session storage keys */ Util.getSessionStorageKeys = function () { var keys = []; if (Util.canUseSessionStorage()) { for (var key in window.sessionStorage) { keys.push(key); } } return keys; }; /** * Get an object from the browser's session storage * * @param {string} name - the name of the object to get from storage * @returns {string} The contents of the storage object with the given name. Null if storage is not supported. */ Util.getSessionStorage = function (logger, name) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return null; }; /** * Set the contents of an object in the browser's session storage * * @param {string} name - the name of the object to set in storage * @param {string} data - the contents of the object to set in storage * @returns {boolean} True if the storage object could be written. */ Util.setSessionStorage = function (logger, name, data) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Remove an object from the browser's session storage * * @param {string} name - the name of the object to remove from storage * @returns {boolean} True if the storage object could be removed. */ Util.removeSessionStorage = function (logger, name) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { storage.removeItem(name); return true; } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /* * Force the SDK not to store and read any data from cookies */ Util.disableCookies = function () { Util._canUseCookies = false; }; /* * helper method to tell if document.cookie object is available */ Util.canUseCookies = function (logger) { if (Util._canUseCookies === undefined) { Util._canUseCookies = false; try { Util._canUseCookies = Util.document.cookie !== undefined; } catch (e) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CannotAccessCookie, "Cannot access document.cookie - " + Util.getExceptionName(e), { exception: Util.dump(e) }); } ; } return Util._canUseCookies; }; /** * helper method to set userId and sessionId cookie */ Util.setCookie = function (logger, name, value, domain) { var domainAttrib = ""; var secureAttrib = ""; if (domain) { domainAttrib = ";domain=" + domain; } if (Util.document.location && Util.document.location.protocol === "https:") { secureAttrib = ";secure"; } if (Util.canUseCookies(logger)) { Util.document.cookie = name + "=" + value + domainAttrib + ";path=/" + secureAttrib; } }; Util.stringToBoolOrDefault = function (str, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } if (str === undefined || str === null) { return defaultValue; } return str.toString().toLowerCase() === "true"; }; /** * helper method to access userId and sessionId cookie */ Util.getCookie = function (logger, name) { if (!Util.canUseCookies(logger)) { return; } var value = ""; if (name && name.length) { var cookieName = name + "="; var cookies = Util.document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; cookie = Util.trim(cookie); if (cookie && cookie.indexOf(cookieName) === 0) { value = cookie.substring(cookieName.length, cookies[i].length); break; } } } return value; }; /** * Deletes a cookie by setting it's expiration time in the past. * @param name - The name of the cookie to delete. */ Util.deleteCookie = function (logger, name) { if (Util.canUseCookies(logger)) { // Setting the expiration date in the past immediately removes the cookie Util.document.cookie = name + "=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;"; } }; /** * helper method to trim strings (IE8 does not implement String.prototype.trim) */ Util.trim = function (str) { if (typeof str !== "string") return str; return str.replace(/^\s+|\s+$/g, ""); }; /** * generate random id string */ Util.newId = function () { var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var result = ""; // tslint:disable-next-line:insecure-random var random = Math.random() * 1073741824; //5 symbols in base64, almost maxint while (random > 0) { var char = base64chars.charAt(random % 64); result += char; random = Math.floor(random / 64); } return result; }; /** * Check if an object is of type Array */ Util.isArray = function (obj) { return Object.prototype.toString.call(obj) === "[object Array]"; }; /** * Check if an object is of type Error */ Util.isError = function (obj) { return Object.prototype.toString.call(obj) === "[object Error]"; }; /** * Check if an object is of type Date */ Util.isDate = function (obj) { return Object.prototype.toString.call(obj) === "[object Date]"; }; /** * Convert a date to I.S.O. format in IE8 */ Util.toISOStringForIE8 = function (date) { if (Util.isDate(date)) { if (Date.prototype.toISOString) { return date.toISOString(); } else { var pad = function (num) { var r = String(num); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } }; /** * Gets IE version if we are running on IE, or null otherwise */ Util.getIEVersion = function (userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } var myNav = userAgentStr ? userAgentStr.toLowerCase() : navigator.userAgent.toLowerCase(); return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : null; }; /** * Convert ms to c# time span format */ Util.msToTimeSpan = function (totalms) { if (isNaN(totalms) || totalms < 0) { totalms = 0; } totalms = Math.round(totalms); var ms = "" + totalms % 1000; var sec = "" + Math.floor(totalms / 1000) % 60; var min = "" + Math.floor(totalms / (1000 * 60)) % 60; var hour = "" + Math.floor(totalms / (1000 * 60 * 60)) % 24; var days = Math.floor(totalms / (1000 * 60 * 60 * 24)); ms = ms.length === 1 ? "00" + ms : ms.length === 2 ? "0" + ms : ms; sec = sec.length < 2 ? "0" + sec : sec; min = min.length < 2 ? "0" + min : min; hour = hour.length < 2 ? "0" + hour : hour; return (days > 0 ? days + "." : "") + hour + ":" + min + ":" + sec + "." + ms; }; /** * Checks if error has no meaningful data inside. Ususally such errors are received by window.onerror when error * happens in a script from other domain (cross origin, CORS). */ Util.isCrossOriginError = function (message, url, lineNumber, columnNumber, error) { return (message === "Script error." || message === "Script error") && !error; }; /** * Returns string representation of an object suitable for diagnostics logging. */ Util.dump = function (object) { var objectTypeDump = Object.prototype.toString.call(object); var propertyValueDump = JSON.stringify(object); if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } return objectTypeDump + propertyValueDump; }; /** * Returns the name of object if it's an Error. Otherwise, returns empty string. */ Util.getExceptionName = function (object) { var objectTypeDump = Object.prototype.toString.call(object); if (objectTypeDump === "[object Error]") { return object.name; } return ""; }; /** * Adds an event handler for the specified event * @param eventName {string} - The name of the event * @param callback {any} - The callback function that needs to be executed for the given event * @return {boolean} - true if the handler was successfully added */ Util.addEventHandler = function (eventName, callback) { if (!window || typeof eventName !== 'string' || typeof callback !== 'function') { return false; } // Create verb for the event var verbEventName = 'on' + eventName; // check if addEventListener is available if (window.addEventListener) { window.addEventListener(eventName, callback, false); } else if (window["attachEvent"]) { window["attachEvent"](verbEventName, callback); } else { return false; } return true; }; /** * Tells if a browser supports a Beacon API */ Util.IsBeaconApiSupported = function () { return ('sendBeacon' in navigator && navigator.sendBeacon); }; Util.document = typeof document !== "undefined" ? document : {}; Util._canUseCookies = undefined; Util._canUseLocalStorage = undefined; Util._canUseSessionStorage = undefined; // listing only non-geo specific locations Util._internalEndpoints = [ "https://dc.services.visualstudio.com/v2/track", "https://breeze.aimon.applicationinsights.io/v2/track", "https://dc-int.services.visualstudio.com/v2/track" ]; Util.NotSpecified = "not_specified"; return Util; }()); exports.Util = Util; var UrlHelper = /** @class */ (function () { function UrlHelper() { } UrlHelper.parseUrl = function (url) { if (!UrlHelper.htmlAnchorElement) { UrlHelper.htmlAnchorElement = !!UrlHelper.document.createElement ? UrlHelper.document.createElement('a') : {}; } UrlHelper.htmlAnchorElement.href = url; return UrlHelper.htmlAnchorElement; }; UrlHelper.getAbsoluteUrl = function (url) { var result; var a = UrlHelper.parseUrl(url); if (a) { result = a.href; } return result; }; UrlHelper.getPathName = function (url) { var result; var a = UrlHelper.parseUrl(url); if (a) { result = a.pathname; } return result; }; UrlHelper.getCompleteUrl = function (method, absoluteUrl) { if (method) { return method.toUpperCase() + " " + absoluteUrl; } else { return absoluteUrl; } }; UrlHelper.document = typeof document !== "undefined" ? document : {}; return UrlHelper; }()); exports.UrlHelper = UrlHelper; var CorrelationIdHelper = /** @class */ (function () { function CorrelationIdHelper() { } /** * Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers */ CorrelationIdHelper.canIncludeCorrelationHeader = function (config, requestUrl, currentHost) { if (config && config.disableCorrelationHeaders) { return false; } if (!requestUrl) { return false; } var requestHost = UrlHelper.parseUrl(requestUrl).host.toLowerCase(); if ((!config || !config.enableCorsCorrelation) && requestHost !== currentHost) { return false; } var excludedDomains = config && config.correlationHeaderExcludedDomains; if (!excludedDomains || excludedDomains.length == 0) { return true; } for (var i = 0; i < excludedDomains.length; i++) { var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\./g, "\.").replace(/\*/g, ".*")); if (regex.test(requestHost)) { return false; } } return true; }; /** * Combines target appId and target role name from response header. */ CorrelationIdHelper.getCorrelationContext = function (responseHeader) { if (responseHeader) { var correlationId = CorrelationIdHelper.getCorrelationContextValue(responseHeader, RequestResponseHeaders_1.RequestHeaders.requestContextTargetKey); if (correlationId && correlationId !== CorrelationIdHelper.correlationIdPrefix) { return correlationId; } } }; /** * Gets key from correlation response header */ CorrelationIdHelper.getCorrelationContextValue = function (responseHeader, key) { if (responseHeader) { var keyValues = responseHeader.split(","); for (var i = 0; i < keyValues.length; ++i) { var keyValue = keyValues[i].split("="); if (keyValue.length == 2 && keyValue[0] == key) { return keyValue[1]; } } } }; CorrelationIdHelper.correlationIdPrefix = "cid-v1:"; return CorrelationIdHelper; }()); exports.CorrelationIdHelper = CorrelationIdHelper; var AjaxHelper = /** @class */ (function () { function AjaxHelper() { } AjaxHelper.ParseDependencyPath = function (logger, absoluteUrl, method, pathName) { var target, name; if (absoluteUrl && absoluteUrl.length > 0) { var parsedUrl = UrlHelper.parseUrl(absoluteUrl); target = parsedUrl.host; if (parsedUrl.pathname != null) { var pathName = (parsedUrl.pathname.length === 0) ? "/" : parsedUrl.pathname; if (pathName.charAt(0) !== '/') { pathName = "/" + pathName; } name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, method ? method + " " + pathName : pathName); } else { name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, absoluteUrl); } } else { target = pathName; name = pathName; } return { target: target, name: name }; }; return AjaxHelper; }()); exports.AjaxHelper = AjaxHelper; /** * A utility class that helps getting time related parameters */ var DateTimeUtils = /** @class */ (function () { function DateTimeUtils() { } /** * Get the number of milliseconds since 1970/01/01 in local timezone */ DateTimeUtils.Now = (window.performance && window.performance.now && window.performance.timing) ? function () { return window.performance.now() + window.performance.timing.navigationStart; } : function () { return new Date().getTime(); }; /** * Gets duration between two timestamps */ DateTimeUtils.GetDuration = function (start, end) { var result = null; if (start !== 0 && end !== 0 && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(start) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(end)) { result = end - start; } return result; }; return DateTimeUtils; }()); exports.DateTimeUtils = DateTimeUtils; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Util.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/applicationinsights-common.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ./Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./RequestResponseHeaders */ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js"), __webpack_require__(/*! ./Constants */ "./node_modules/applicationinsights-common/bundle/Constants.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/Data */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/Base */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js"), __webpack_require__(/*! ./Telemetry/Common/Envelope */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js"), __webpack_require__(/*! ./Telemetry/Event */ "./node_modules/applicationinsights-common/bundle/Telemetry/Event.js"), __webpack_require__(/*! ./Telemetry/Exception */ "./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js"), __webpack_require__(/*! ./Telemetry/Metric */ "./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js"), __webpack_require__(/*! ./Telemetry/PageView */ "./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js"), __webpack_require__(/*! ./Telemetry/RemoteDependencyData */ "./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js"), __webpack_require__(/*! ./Telemetry/Trace */ "./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js"), __webpack_require__(/*! ./Telemetry/PageViewPerformance */ "./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js"), __webpack_require__(/*! ./Telemetry/Common/Data */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/SeverityLevel */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/ContextTagKeys */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ./TelemetryItemCreator */ "./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Util_1, Enums_1, RequestResponseHeaders_1, Constants_1, Data_1, Base_1, Envelope_1, Event_1, Exception_1, Metric_1, PageView_1, PageViewData_1, RemoteDependencyData_1, Trace_1, PageViewPerformance_1, Data_2, SeverityLevel_1, ContextTagKeys_1, DataSanitizer_1, TelemetryItemCreator_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Util = Util_1.Util; exports.CorrelationIdHelper = Util_1.CorrelationIdHelper; exports.UrlHelper = Util_1.UrlHelper; exports.DateTimeUtils = Util_1.DateTimeUtils; exports.FieldType = Enums_1.FieldType; exports.RequestHeaders = RequestResponseHeaders_1.RequestHeaders; exports.DisabledPropertyName = Constants_1.DisabledPropertyName; exports.AIData = Data_1.Data; exports.AIBase = Base_1.Base; exports.Envelope = Envelope_1.Envelope; exports.Event = Event_1.Event; exports.Exception = Exception_1.Exception; exports.Metric = Metric_1.Metric; exports.PageView = PageView_1.PageView; exports.PageViewData = PageViewData_1.PageViewData; exports.RemoteDependencyData = RemoteDependencyData_1.RemoteDependencyData; exports.Trace = Trace_1.Trace; exports.PageViewPerformance = PageViewPerformance_1.PageViewPerformance; exports.Data = Data_2.Data; exports.SeverityLevel = SeverityLevel_1.SeverityLevel; exports.ContextTagKeys = ContextTagKeys_1.ContextTagKeys; exports.DataSanitizer = DataSanitizer_1.DataSanitizer; exports.TelemetryItemCreator = TelemetryItemCreator_1.TelemetryItemCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-common.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event. */ exports.EventsDiscardedReason = { /** * Unknown. */ Unknown: 0, /** * Status set to non-retryable. */ NonRetryableStatus: 1, /** * The event is invalid. */ InvalidEvent: 2, /** * The size of the event is too large. */ SizeLimitExceeded: 3, /** * The server is not accepting events from this instrumentation key. */ KillSwitch: 4, /** * The event queue is full. */ QueueFull: 5, }; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventsDiscardedReason.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js": /*!*********************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js ***! \*********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var LoggingSeverity; (function (LoggingSeverity) { /** * Error will be sent as internal telemetry */ LoggingSeverity[LoggingSeverity["CRITICAL"] = 1] = "CRITICAL"; /** * Error will NOT be sent as internal telemetry, and will only be shown in browser console */ LoggingSeverity[LoggingSeverity["WARNING"] = 2] = "WARNING"; })(LoggingSeverity = exports.LoggingSeverity || (exports.LoggingSeverity = {})); /** * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered */ ; exports._InternalMessageId = { // Non user actionable BrowserDoesNotSupportLocalStorage: 0, BrowserCannotReadLocalStorage: 1, BrowserCannotReadSessionStorage: 2, BrowserCannotWriteLocalStorage: 3, BrowserCannotWriteSessionStorage: 4, BrowserFailedRemovalFromLocalStorage: 5, BrowserFailedRemovalFromSessionStorage: 6, CannotSendEmptyTelemetry: 7, ClientPerformanceMathError: 8, ErrorParsingAISessionCookie: 9, ErrorPVCalc: 10, ExceptionWhileLoggingError: 11, FailedAddingTelemetryToBuffer: 12, FailedMonitorAjaxAbort: 13, FailedMonitorAjaxDur: 14, FailedMonitorAjaxOpen: 15, FailedMonitorAjaxRSC: 16, FailedMonitorAjaxSend: 17, FailedMonitorAjaxGetCorrelationHeader: 18, FailedToAddHandlerForOnBeforeUnload: 19, FailedToSendQueuedTelemetry: 20, FailedToReportDataLoss: 21, FlushFailed: 22, MessageLimitPerPVExceeded: 23, MissingRequiredFieldSpecification: 24, NavigationTimingNotSupported: 25, OnError: 26, SessionRenewalDateIsZero: 27, SenderNotInitialized: 28, StartTrackEventFailed: 29, StopTrackEventFailed: 30, StartTrackFailed: 31, StopTrackFailed: 32, TelemetrySampledAndNotSent: 33, TrackEventFailed: 34, TrackExceptionFailed: 35, TrackMetricFailed: 36, TrackPVFailed: 37, TrackPVFailedCalc: 38, TrackTraceFailed: 39, TransmissionFailed: 40, FailedToSetStorageBuffer: 41, FailedToRestoreStorageBuffer: 42, InvalidBackendResponse: 43, FailedToFixDepricatedValues: 44, InvalidDurationValue: 45, TelemetryEnvelopeInvalid: 46, CreateEnvelopeError: 47, // User actionable CannotSerializeObject: 48, CannotSerializeObjectNonSerializable: 49, CircularReferenceDetected: 50, ClearAuthContextFailed: 51, ExceptionTruncated: 52, IllegalCharsInName: 53, ItemNotInArray: 54, MaxAjaxPerPVExceeded: 55, MessageTruncated: 56, NameTooLong: 57, SampleRateOutOfRange: 58, SetAuthContextFailed: 59, SetAuthContextFailedAccountName: 60, StringValueTooLong: 61, StartCalledMoreThanOnce: 62, StopCalledWithoutStart: 63, TelemetryInitializerFailed: 64, TrackArgumentsNotSpecified: 65, UrlTooLong: 66, SessionStorageBufferFull: 67, CannotAccessCookie: 68, IdTooLong: 69, }; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=LoggingEnums.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MinChannelPriorty = 100; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=IChannelControls.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../JavaScriptSDK.Enums/EventsDiscardedReason */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js"), __webpack_require__(/*! ./CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js"), __webpack_require__(/*! ./NotificationManager */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js"), __webpack_require__(/*! ./DiagnosticLogger */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventsDiscardedReason_1, CoreUtils_1, NotificationManager_1, DiagnosticLogger_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; var AppInsightsCore = /** @class */ (function () { function AppInsightsCore() { this._isInitialized = false; this._extensions = new Array(); this._channelController = new ChannelController(); } AppInsightsCore.prototype.initialize = function (config, extensions) { var _this = this; // Make sure core is only initialized once if (this._isInitialized) { throw Error("Core should not be initialized more than once"); } if (!config || CoreUtils_1.CoreUtils.isNullOrUndefined(config.instrumentationKey)) { throw Error("Please provide instrumentation key"); } this.config = config; this._notificationManager = new NotificationManager_1.NotificationManager(); this.config.extensions = CoreUtils_1.CoreUtils.isNullOrUndefined(this.config.extensions) ? [] : this.config.extensions; // add notification to the extensions in the config so other plugins can access it this.config.extensionConfig = CoreUtils_1.CoreUtils.isNullOrUndefined(this.config.extensionConfig) ? {} : this.config.extensionConfig; this.config.extensionConfig.NotificationManager = this._notificationManager; this.logger = new DiagnosticLogger_1.DiagnosticLogger(config); // Initial validation extensions.forEach(function (extension) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(extension.initialize)) { throw Error(validationError); } }); if (this.config.extensions.length > 0) { var isValid_1 = true; this.config.extensions.forEach(function (item) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(item)) { isValid_1 = false; } }); if (!isValid_1) { throw Error(validationError); } } // Initial validation complete // Concat all available extensions before sorting by priority (_a = this._extensions).push.apply(_a, [this._channelController].concat(extensions, this.config.extensions)); this._extensions = this._extensions.sort(function (a, b) { var extA = a; var extB = b; var typeExtA = typeof extA.processTelemetry; var typeExtB = typeof extB.processTelemetry; if (typeExtA === 'function' && typeExtB === 'function') { return extA.priority - extB.priority; } if (typeExtA === 'function' && typeExtB !== 'function') { // keep non telemetryplugin specific extensions at start return 1; } if (typeExtA !== 'function' && typeExtB === 'function') { return -1; } }); // sort complete // Check if any two extensions have the same priority, then warn to console var priority = {}; this._extensions.forEach(function (ext) { var t = ext; if (t && t.priority) { if (!CoreUtils_1.CoreUtils.isNullOrUndefined(priority[t.priority])) { _this.logger.warnToConsole("Two extensions have same priority" + priority[t.priority] + ", " + t.identifier); } else { priority[t.priority] = t.identifier; // set a value } } }); var c = -1; // Set next plugin for all until channel controller for (var idx = 0; idx < this._extensions.length - 1; idx++) { var curr = (this._extensions[idx]); if (curr && typeof curr.processTelemetry !== 'function') { // these are initialized only, allowing an entry point for extensions to be initialized when SDK initializes continue; } if (curr.priority === ChannelControllerPriority) { c = idx + 1; break; // channel controller will set remaining pipeline } this._extensions[idx].setNextPlugin(this._extensions[idx + 1]); // set next plugin } // initialize channel controller first, this will initialize all channel plugins this._channelController.initialize(this.config, this, this._extensions); // initialize remaining regular plugins this._extensions.forEach(function (ext) { var e = ext; if (e && e.priority < ChannelControllerPriority) { ext.initialize(_this.config, _this, _this._extensions); // initialize } }); // Remove sender channels from main list if (c < this._extensions.length) { this._extensions.splice(c); } if (this.getTransmissionControls().length === 0) { throw new Error("No channels available"); } this._isInitialized = true; var _a; }; AppInsightsCore.prototype.getTransmissionControls = function () { return this._channelController.ChannelControls; }; AppInsightsCore.prototype.track = function (telemetryItem) { if (telemetryItem === null) { this._notifiyInvalidEvent(telemetryItem); // throw error throw Error("Invalid telemetry item"); } if (telemetryItem.baseData && !telemetryItem.baseType) { this._notifiyInvalidEvent(telemetryItem); throw Error("Provide data.baseType for data.baseData"); } if (!telemetryItem.baseType) { // Hard coded from Common::Event.ts::Event.dataType telemetryItem.baseType = "EventData"; } if (!telemetryItem.instrumentationKey) { // setup default ikey if not passed in telemetryItem.instrumentationKey = this.config.instrumentationKey; } if (!telemetryItem.timestamp) { // add default timestamp if not passed in telemetryItem.timestamp = new Date(); } // do basic validation before sending it through the pipeline this._validateTelmetryItem(telemetryItem); // invoke any common telemetry processors before sending through pipeline var i = 0; while (i < this._extensions.length) { if (this._extensions[i].processTelemetry) { this._extensions[i].processTelemetry(telemetryItem); // pass on to first extension that can support processing break; } i++; } }; /** * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be * called. * @param {INotificationListener} listener - An INotificationListener object. */ AppInsightsCore.prototype.addNotificationListener = function (listener) { this._notificationManager.addNotificationListener(listener); }; /** * Removes all instances of the listener. * @param {INotificationListener} listener - INotificationListener to remove. */ AppInsightsCore.prototype.removeNotificationListener = function (listener) { this._notificationManager.removeNotificationListener(listener); }; /** * Periodically check logger.queue for */ AppInsightsCore.prototype.pollInternalLogs = function () { var _this = this; if (!(this.config.diagnosticLoggingInterval > 0)) { throw Error("config.diagnosticLoggingInterval must be a positive integer"); } return setInterval(function () { var queue = _this.logger.queue; queue.forEach(function (logMessage) { var item = { name: "InternalMessageId: " + logMessage.messageId, instrumentationKey: _this.config.instrumentationKey, timestamp: new Date(), baseType: DiagnosticLogger_1._InternalLogMessage.dataType, baseData: { message: logMessage.message } }; _this.track(item); }); queue.length = 0; }, this.config.diagnosticLoggingInterval); }; AppInsightsCore.prototype._validateTelmetryItem = function (telemetryItem) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.name)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry name required"); } if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.timestamp)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry timestamp required"); } if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.instrumentationKey)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry instrumentationKey required"); } }; AppInsightsCore.prototype._notifiyInvalidEvent = function (telemetryItem) { this._notificationManager.eventsDiscarded([telemetryItem], EventsDiscardedReason_1.EventsDiscardedReason.InvalidEvent); }; return AppInsightsCore; }()); exports.AppInsightsCore = AppInsightsCore; var ChannelController = /** @class */ (function () { function ChannelController() { this.identifier = "ChannelControllerPlugin"; this.priority = ChannelControllerPriority; // in reserved range 100 to 200 } ChannelController.prototype.processTelemetry = function (item) { this.channelQueue.forEach(function (queues) { // pass on to first item in queue if (queues.length > 0) { queues[0].processTelemetry(item); } }); }; Object.defineProperty(ChannelController.prototype, "ChannelControls", { get: function () { return this.channelQueue; }, enumerable: true, configurable: true }); ChannelController.prototype.initialize = function (config, core, extensions) { var _this = this; this.channelQueue = new Array(); if (config.channels) { config.channels.forEach(function (queue) { if (queue && queue.length > 0) { queue = queue.sort(function (a, b) { return a.priority - b.priority; }); // Initialize each plugin queue.forEach(function (queueItem) { return queueItem.initialize(config, core, extensions); }); for (var i = 1; i < queue.length; i++) { queue[i - 1].setNextPlugin(queue[i]); // setup processing chain } _this.channelQueue.push(queue); } }); } else { var arr = new Array(); for (var i = 0; i < extensions.length; i++) { var plugin = extensions[i]; if (plugin.priority > ChannelControllerPriority) { arr.push(plugin); } } if (arr.length > 0) { // sort if not sorted arr = arr.sort(function (a, b) { return a.priority - b.priority; }); // Initialize each plugin arr.forEach(function (queueItem) { return queueItem.initialize(config, core, extensions); }); // setup next plugin for (var i = 1; i < arr.length; i++) { arr[i - 1].setNextPlugin(arr[i]); } this.channelQueue.push(arr); } } }; return ChannelController; }()); var validationError = "Extensions must provide callback to initialize"; var ChannelControllerPriority = 200; var duplicatePriority = "One or more extensions are set at same priority"; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=AppInsightsCore.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js": /*!************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var CoreUtils = /** @class */ (function () { function CoreUtils() { } CoreUtils.isNullOrUndefined = function (input) { return input === null || input === undefined; }; /** * Creates a new GUID. * @return {string} A GUID. */ CoreUtils.newGuid = function () { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, function (c) { // tslint:disable-next-line:insecure-random var r = (Math.random() * 16 | 0), v = (c === 'x' ? r : r & 0x3 | 0x8); return v.toString(16); }); }; return CoreUtils; }()); exports.CoreUtils = CoreUtils; var GuidRegex = /[xy]/g; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=CoreUtils.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js": /*!*******************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js ***! \*******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../JavaScriptSDK.Enums/LoggingEnums */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js"), __webpack_require__(/*! ./CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, LoggingEnums_1, CoreUtils_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } this.messageId = msgId; this.message = (isUserAct ? _InternalLogMessage.AiUserActionablePrefix : _InternalLogMessage.AiNonUserActionablePrefix) + msgId; var diagnosticText = (msg ? " message:" + _InternalLogMessage.sanitizeDiagnosticText(msg) : "") + (properties ? " props:" + _InternalLogMessage.sanitizeDiagnosticText(JSON.stringify(properties)) : ""); this.message += diagnosticText; } _InternalLogMessage.sanitizeDiagnosticText = function (text) { return "\"" + text.replace(/\"/g, "") + "\""; }; _InternalLogMessage.dataType = "MessageData"; /** * For user non actionable traces use AI Internal prefix. */ _InternalLogMessage.AiNonUserActionablePrefix = "AI (Internal): "; /** * Prefix of the traces in portal. */ _InternalLogMessage.AiUserActionablePrefix = "AI: "; return _InternalLogMessage; }()); exports._InternalLogMessage = _InternalLogMessage; var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { /** * Session storage key for the prefix for the key indicating message type already logged */ this.AIInternalMessagePrefix = "AITR_"; /** * When this is true the SDK will throw exceptions to aid in debugging. */ this.enableDebugExceptions = function () { return false; }; /** * 0: OFF * 1: CRITICAL (default) * 2: >= WARNING */ this.consoleLoggingLevel = function () { return 1; }; /** * 0: OFF (default) * 1: CRITICAL * 2: >= WARNING */ this.telemetryLoggingLevel = function () { return 0; }; /** * The maximum number of internal messages allowed to be sent per page view */ this.maxInternalMessageLimit = function () { return 25; }; /** * The internal logging queue */ this.queue = []; /** * Count of internal messages sent */ this._messageCount = 0; /** * Holds information about what message types were already logged to console or sent to server. */ this._messageLogged = {}; if (CoreUtils_1.CoreUtils.isNullOrUndefined(config)) { // TODO: Use default config // config = AppInsightsCore.defaultConfig; // For now, use defaults specified in DiagnosticLogger members; return; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.loggingLevelConsole)) { this.consoleLoggingLevel = function () { return config.loggingLevelConsole; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.loggingLevelTelemetry)) { this.telemetryLoggingLevel = function () { return config.loggingLevelTelemetry; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.maxMessageLimit)) { this.maxInternalMessageLimit = function () { return config.maxMessageLimit; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.enableDebugExceptions)) { this.enableDebugExceptions = function () { return config.enableDebugExceptions; }; } } /** * This method will throw exceptions in debug mode or attempt to log the error as a console warning. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The log message. */ DiagnosticLogger.prototype.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (this.enableDebugExceptions()) { throw message; } else { if (typeof (message) !== "undefined" && !!message) { if (typeof (message.message) !== "undefined") { if (isUserAct) { // check if this message type was already logged to console for this page view and if so, don't log it again var messageKey = +message.messageId; if (!this._messageLogged[messageKey] || this.consoleLoggingLevel() >= LoggingEnums_1.LoggingSeverity.WARNING) { this.warnToConsole(message.message); this._messageLogged[messageKey] = true; } } else { // don't log internal AI traces in the console, unless the verbose logging is enabled if (this.consoleLoggingLevel() >= LoggingEnums_1.LoggingSeverity.WARNING) { this.warnToConsole(message.message); } } this.logInternalMessage(severity, message); } } } }; /** * This will write a warning to the console if possible * @param message {string} - The warning message */ DiagnosticLogger.prototype.warnToConsole = function (message) { if (typeof console !== "undefined" && !!console) { if (typeof console.warn === "function") { console.warn(message); } else if (typeof console.log === "function") { console.log(message); } } }; /** * Resets the internal message count */ DiagnosticLogger.prototype.resetInternalMessageCount = function () { this._messageCount = 0; this._messageLogged = {}; }; /** * Logs a message to the internal queue. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The message to log. */ DiagnosticLogger.prototype.logInternalMessage = function (severity, message) { if (this._areInternalMessagesThrottled()) { return; } // check if this message type was already logged for this session and if so, don't log it again var logMessage = true; var messageKey = this.AIInternalMessagePrefix + message.messageId; // if the session storage is not available, limit to only one message type per page view if (this._messageLogged[messageKey]) { logMessage = false; } else { this._messageLogged[messageKey] = true; } if (logMessage) { // Push the event in the internal queue if (severity <= this.telemetryLoggingLevel()) { this.queue.push(message); this._messageCount++; } // When throttle limit reached, send a special event if (this._messageCount == this.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(LoggingEnums_1._InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false); this.queue.push(throttleMessage); this.warnToConsole(throttleLimitMessage); } } }; /** * Indicates whether the internal events are throttled */ DiagnosticLogger.prototype._areInternalMessagesThrottled = function () { return this._messageCount >= this.maxInternalMessageLimit(); }; return DiagnosticLogger; }()); exports.DiagnosticLogger = DiagnosticLogger; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DiagnosticLogger.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js": /*!**********************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js ***! \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Class to manage sending notifications to all the listeners. */ var NotificationManager = /** @class */ (function () { function NotificationManager() { this.listeners = []; } /** * Adds a notification listener. * @param {INotificationListener} listener - The notification listener to be added. */ NotificationManager.prototype.addNotificationListener = function (listener) { this.listeners.push(listener); }; /** * Removes all instances of the listener. * @param {INotificationListener} listener - AWTNotificationListener to remove. */ NotificationManager.prototype.removeNotificationListener = function (listener) { var index = this.listeners.indexOf(listener); while (index > -1) { this.listeners.splice(index, 1); index = this.listeners.indexOf(listener); } }; /** * Notification for events sent. * @param {ITelemetryItem[]} events - The array of events that have been sent. */ NotificationManager.prototype.eventsSent = function (events) { var _this = this; var _loop_1 = function (i) { if (this_1.listeners[i].eventsSent) { setTimeout(function () { return _this.listeners[i].eventsSent(events); }, 0); } }; var this_1 = this; for (var i = 0; i < this.listeners.length; ++i) { _loop_1(i); } }; /** * Notification for events being discarded. * @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK. * @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason * constant should be used to check the different values. */ NotificationManager.prototype.eventsDiscarded = function (events, reason) { var _this = this; var _loop_2 = function (i) { if (this_2.listeners[i].eventsDiscarded) { setTimeout(function () { return _this.listeners[i].eventsDiscarded(events, reason); }, 0); } }; var this_2 = this; for (var i = 0; i < this.listeners.length; ++i) { _loop_2(i); } }; return NotificationManager; }()); exports.NotificationManager = NotificationManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=NotificationManager.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js": /*!****************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js ***! \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./JavaScriptSDK.Interfaces/IChannelControls */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js"), __webpack_require__(/*! ./JavaScriptSDK.Enums/EventsDiscardedReason */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js"), __webpack_require__(/*! ./JavaScriptSDK/AppInsightsCore */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js"), __webpack_require__(/*! ./JavaScriptSDK/CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js"), __webpack_require__(/*! ./JavaScriptSDK/NotificationManager */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js"), __webpack_require__(/*! ./JavaScriptSDK/DiagnosticLogger */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js"), __webpack_require__(/*! ./JavaScriptSDK.Enums/LoggingEnums */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, IChannelControls_1, EventsDiscardedReason_1, AppInsightsCore_1, CoreUtils_1, NotificationManager_1, DiagnosticLogger_1, LoggingEnums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MinChannelPriorty = IChannelControls_1.MinChannelPriorty; exports.EventsDiscardedReason = EventsDiscardedReason_1.EventsDiscardedReason; exports.AppInsightsCore = AppInsightsCore_1.AppInsightsCore; exports.CoreUtils = CoreUtils_1.CoreUtils; exports.NotificationManager = NotificationManager_1.NotificationManager; exports.DiagnosticLogger = DiagnosticLogger_1.DiagnosticLogger; exports._InternalLogMessage = DiagnosticLogger_1._InternalLogMessage; exports._InternalMessageId = LoggingEnums_1._InternalMessageId; exports.LoggingSeverity = LoggingEnums_1.LoggingSeverity; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-core-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajax.js": /*!*************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajax.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./ajaxRecord */ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js"), __webpack_require__(/*! ./ajaxUtils */ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1, ajaxRecord_1, ajaxUtils_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var AjaxMonitor = /** @class */ (function () { function AjaxMonitor() { this._trackAjaxAttempts = 0; this.identifier = "AjaxDependencyPlugin"; this.priority = 161; this.currentWindowHost = window && window.location.host && window.location.host.toLowerCase(); this.initialized = false; } ///Verifies that particalar instance of XMLHttpRequest needs to be monitored ///Optional parameter. True if ajaxData must be excluded from verification ///True if instance needs to be monitored, otherwise false AjaxMonitor.prototype.isMonitoredInstance = function (xhr, excludeAjaxDataValidation) { // checking to see that all interested functions on xhr were instrumented return this.initialized // checking on ajaxData to see that it was not removed in user code && (excludeAjaxDataValidation === true || !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData)) // check that this instance is not not used by ajax call performed inside client side monitoring to send data to collector && xhr[applicationinsights_common_1.DisabledPropertyName] !== true; }; ///Determines whether ajax monitoring can be enabled on this document ///True if Ajax monitoring is supported on this page, otherwise false AjaxMonitor.prototype.supportsMonitoring = function () { var result = true; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.open) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.send) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(XMLHttpRequest.prototype.abort)) { result = false; } // disable in IE8 or older (https://www.w3schools.com/jsref/jsref_trim_string.asp) try { " a ".trim(); } catch (ex) { result = false; } return result; }; AjaxMonitor.prototype.instrumentOpen = function () { var originalOpen = XMLHttpRequest.prototype.open; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.open = function (method, url, async) { try { if (ajaxMonitorInstance.isMonitoredInstance(this, true) && (!this.ajaxData || !this.ajaxData.xhrMonitoringState.openDone)) { ajaxMonitorInstance.openHandler(this, method, url, async); } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxOpen, "Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalOpen.apply(this, arguments); }; }; AjaxMonitor.prototype.openHandler = function (xhr, method, url, async) { /* todo: Disabling the following block of code as CV is not yet supported in 1DS for 3rd Part. // this format corresponds with activity logic on server-side and is required for the correct correlation var id = "|" + this.appInsights.context.operation.id + "." + Util.newId(); */ var id = applicationinsights_common_1.Util.newId(); var ajaxData = new ajaxRecord_1.ajaxRecord(id, this._core._logger); ajaxData.method = method; ajaxData.requestUrl = url; ajaxData.xhrMonitoringState.openDone = true; xhr.ajaxData = ajaxData; this.attachToOnReadyStateChange(xhr); }; AjaxMonitor.getFailedAjaxDiagnosticsMessage = function (xhr) { var result = ""; try { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(xhr.ajaxData.requestUrl)) { result += "(url: '" + xhr.ajaxData.requestUrl + "')"; } } catch (e) { } return result; }; AjaxMonitor.prototype.instrumentSend = function () { var originalSend = XMLHttpRequest.prototype.send; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.send = function (content) { try { if (ajaxMonitorInstance.isMonitoredInstance(this) && !this.ajaxData.xhrMonitoringState.sendDone) { ajaxMonitorInstance.sendHandler(this, content); } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxSend, "Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalSend.apply(this, arguments); }; }; AjaxMonitor.prototype.sendHandler = function (xhr, content) { xhr.ajaxData.requestSentTime = applicationinsights_common_1.DateTimeUtils.Now(); if (this.currentWindowHost && applicationinsights_common_1.CorrelationIdHelper.canIncludeCorrelationHeader(this._config, xhr.ajaxData.getAbsoluteUrl(), this.currentWindowHost)) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.requestIdHeader, xhr.ajaxData.id); var appId = this._config.appId; // Todo: also, get appId from channel as breeze returns it if (appId) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.requestContextHeader, applicationinsights_common_1.RequestHeaders.requestContextAppIdFormat + appId); } } xhr.ajaxData.xhrMonitoringState.sendDone = true; }; AjaxMonitor.prototype.instrumentAbort = function () { var originalAbort = XMLHttpRequest.prototype.abort; var ajaxMonitorInstance = this; XMLHttpRequest.prototype.abort = function () { try { if (ajaxMonitorInstance.isMonitoredInstance(this) && !this.ajaxData.xhrMonitoringState.abortDone) { this.ajaxData.aborted = 1; this.ajaxData.xhrMonitoringState.abortDone = true; } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxAbort, "Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), exception: applicationinsights_common_1.Util.dump(e) }); } return originalAbort.apply(this, arguments); }; }; AjaxMonitor.prototype.attachToOnReadyStateChange = function (xhr) { var _this = this; var ajaxMonitorInstance = this; xhr.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached = ajaxUtils_1.EventHelper.AttachEvent(xhr, "readystatechange", function () { try { if (ajaxMonitorInstance.isMonitoredInstance(xhr)) { if (xhr.readyState === 4) { ajaxMonitorInstance.onAjaxComplete(xhr); } } } catch (e) { var exceptionText = applicationinsights_common_1.Util.dump(e); // ignore messages with c00c023f, as this a known IE9 XHR abort issue if (!exceptionText || exceptionText.toLowerCase().indexOf("c00c023f") == -1) { _this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxRSC, "Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), exception: applicationinsights_common_1.Util.dump(e) }); } } }); }; AjaxMonitor.prototype.onAjaxComplete = function (xhr) { xhr.ajaxData.responseFinishedTime = applicationinsights_common_1.DateTimeUtils.Now(); xhr.ajaxData.status = xhr.status; xhr.ajaxData.CalculateMetrics(); if (xhr.ajaxData.ajaxTotalDuration < 0) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxDur, "Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), requestSentTime: xhr.ajaxData.requestSentTime, responseFinishedTime: xhr.ajaxData.responseFinishedTime }); } else { var dependency = { id: xhr.ajaxData.id, absoluteUrl: xhr.ajaxData.getAbsoluteUrl(), commandName: xhr.ajaxData.getPathName(), duration: xhr.ajaxData.ajaxTotalDuration, success: (+(xhr.ajaxData.status)) >= 200 && (+(xhr.ajaxData.status)) < 400, resultCode: +xhr.ajaxData.status, method: xhr.ajaxData.method }; // enrich dependency target with correlation context from the server var correlationContext = this.getCorrelationContext(xhr); if (correlationContext) { dependency.correlationContext = /* dependency.target + " | " + */ correlationContext; } this.trackDependencyData(dependency); xhr.ajaxData = null; } }; AjaxMonitor.prototype.getCorrelationContext = function (xhr) { try { var responseHeadersString = xhr.getAllResponseHeaders(); if (responseHeadersString !== null) { var index = responseHeadersString.toLowerCase().indexOf(applicationinsights_common_1.RequestHeaders.requestContextHeaderLowerCase); if (index !== -1) { var responseHeader = xhr.getResponseHeader(applicationinsights_common_1.RequestHeaders.requestContextHeader); return applicationinsights_common_1.CorrelationIdHelper.getCorrelationContext(responseHeader); } } } catch (e) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedMonitorAjaxGetCorrelationHeader, "Failed to get Request-Context correlation header as it may be not included in the response or not accessible.", { ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), exception: applicationinsights_common_1.Util.dump(e) }); } }; /** * Logs dependency call * @param dependencyData dependency data object */ AjaxMonitor.prototype.trackDependencyData = function (dependency, properties, systemProperties) { if (this._config.maxAjaxCallsPerView === -1 || this._trackAjaxAttempts < this._config.maxAjaxCallsPerView) { var item = applicationinsights_common_1.TelemetryItemCreator.create(dependency, applicationinsights_common_1.RemoteDependencyData.dataType, applicationinsights_common_1.RemoteDependencyData.envelopeType, this._core._logger, properties, systemProperties); this._core.track(item); } else if (this._trackAjaxAttempts === this._config.maxAjaxCallsPerView) { this._core.logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.MaxAjaxPerPVExceeded, "Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.", true); } ++this._trackAjaxAttempts; }; AjaxMonitor.prototype.processTelemetry = function (item) { if (this._nextPlugin && this._nextPlugin.processTelemetry) { this._nextPlugin.processTelemetry(item); } }; AjaxMonitor.prototype.setNextPlugin = function (next) { if (next) { this._nextPlugin = next; } }; AjaxMonitor.prototype.initialize = function (config, core, extensions) { if (!this.initialized) { this._core = core; config.extensionConfig = config.extensionConfig ? config.extensionConfig : {}; var c = config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {}; this._config = { maxAjaxCallsPerView: !isNaN(c.maxAjaxCallsPerView) ? c.maxAjaxCallsPerView : 500, disableAjaxTracking: applicationinsights_common_1.Util.stringToBoolOrDefault(c.disableAjaxTracking), disableCorrelationHeaders: applicationinsights_common_1.Util.stringToBoolOrDefault(c.disableCorrelationHeaders), correlationHeaderExcludedDomains: c.correlationHeaderExcludedDomains || [ "*.blob.core.windows.net", "*.blob.core.chinacloudapi.cn", "*.blob.core.cloudapi.de", "*.blob.core.usgovcloudapi.net" ], appId: c.appId, enableCorsCorrelation: applicationinsights_common_1.Util.stringToBoolOrDefault(c.enableCorsCorrelation) }; if (this.supportsMonitoring() && !this._config.disableAjaxTracking) { this.instrumentOpen(); this.instrumentSend(); this.instrumentAbort(); this.initialized = true; } } }; return AjaxMonitor; }()); exports.AjaxMonitor = AjaxMonitor; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajax.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajaxRecord.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var XHRMonitoringState = /** @class */ (function () { function XHRMonitoringState() { this.openDone = false; this.setRequestHeaderDone = false; this.sendDone = false; this.abortDone = false; //True, if onreadyStateChangeCallback function attached to xhr, otherwise false this.onreadystatechangeCallbackAttached = false; } return XHRMonitoringState; }()); exports.XHRMonitoringState = XHRMonitoringState; var ajaxRecord = /** @class */ (function () { function ajaxRecord(id, logger) { this.completed = false; this.requestHeadersSize = null; this.ttfb = null; this.responseReceivingDuration = null; this.callbackDuration = null; this.ajaxTotalDuration = null; this.aborted = null; this.pageUrl = null; this.requestUrl = null; this.requestSize = 0; this.method = null; ///Returns the HTTP status code. this.status = null; //The timestamp when open method was invoked this.requestSentTime = null; //The timestamps when first byte was received this.responseStartedTime = null; //The timestamp when last byte was received this.responseFinishedTime = null; //The timestamp when onreadystatechange callback in readyState 4 finished this.callbackFinishedTime = null; //The timestamp at which ajax was ended this.endTime = null; //The original xhr onreadystatechange event this.originalOnreadystatechage = null; this.xhrMonitoringState = new XHRMonitoringState(); //Determines whether or not JavaScript exception occured in xhr.onreadystatechange code. 1 if occured, otherwise 0. this.clientFailure = 0; this.CalculateMetrics = function () { var self = this; // round to 3 decimal points self.ajaxTotalDuration = Math.round(applicationinsights_common_1.DateTimeUtils.GetDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000; }; this.id = id; this._logger = logger; } ajaxRecord.prototype.getAbsoluteUrl = function () { return this.requestUrl ? applicationinsights_common_1.UrlHelper.getAbsoluteUrl(this.requestUrl) : null; }; ajaxRecord.prototype.getPathName = function () { return this.requestUrl ? applicationinsights_common_1.DataSanitizer.sanitizeUrl(this._logger, applicationinsights_common_1.UrlHelper.getCompleteUrl(this.method, this.requestUrl)) : null; }; return ajaxRecord; }()); exports.ajaxRecord = ajaxRecord; ; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajaxRecord.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js": /*!******************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/ajaxUtils.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var stringUtils = /** @class */ (function () { function stringUtils() { } stringUtils.GetLength = function (strObject) { var res = 0; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(strObject)) { var stringified = ""; try { stringified = strObject.toString(); } catch (ex) { // some troubles with complex object } res = stringified.length; res = isNaN(res) ? 0 : res; } return res; }; return stringUtils; }()); exports.stringUtils = stringUtils; var EventHelper = /** @class */ (function () { function EventHelper() { } ///Binds the specified function to an event, so that the function gets called whenever the event fires on the object ///Object to which ///String that specifies any of the standard DHTML Events without "on" prefix ///Pointer that specifies the function to call when event fires ///True if the function was bound successfully to the event, otherwise false EventHelper.AttachEvent = function (obj, eventNameWithoutOn, handlerRef) { var result = false; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj)) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.attachEvent)) { // IE before version 9 obj.attachEvent("on" + eventNameWithoutOn, handlerRef); result = true; } else { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.addEventListener)) { // all browsers except IE before version 9 obj.addEventListener(eventNameWithoutOn, handlerRef, false); result = true; } } } return result; }; EventHelper.DetachEvent = function (obj, eventNameWithoutOn, handlerRef) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj)) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.detachEvent)) { obj.detachEvent("on" + eventNameWithoutOn, handlerRef); } else { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(obj.removeEventListener)) { obj.removeEventListener(eventNameWithoutOn, handlerRef, false); } } } }; return EventHelper; }()); exports.EventHelper = EventHelper; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ajaxUtils.js.map /***/ }), /***/ "./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-dependencies-js/bundle/applicationinsights-dependencies-js.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./ajax */ "./node_modules/applicationinsights-dependencies-js/bundle/ajax.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, ajax_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AjaxPlugin = ajax_1.AjaxMonitor; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-dependencies-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Application.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Application.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Application = /** @class */ (function () { function Application() { } return Application; }()); exports.Application = Application; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Application.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Device.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Device.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Device = /** @class */ (function () { /** * Constructs a new instance of the Device class */ function Device() { // don't attempt to fingerprint browsers this.id = "browser"; // Device type is a dimension in our data platform // Setting it to 'Browser' allows to separate client and server dependencies/exceptions this.type = "Browser"; } return Device; }()); exports.Device = Device; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Device.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Version = "2.0.1-beta"; var Internal = /** @class */ (function () { /** * Constructs a new instance of the internal telemetry data class. */ function Internal(config) { this.sdkVersion = (config.sdkExtension && config.sdkExtension() ? config.sdkExtension() + "_" : "") + "javascript:" + Version; } return Internal; }()); exports.Internal = Internal; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Internal.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Location.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Location.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Location = /** @class */ (function () { function Location() { } return Location; }()); exports.Location = Location; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Location.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js": /*!************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Operation = /** @class */ (function () { function Operation() { this.id = applicationinsights_common_1.Util.newId(); if (window && window.location && window.location.pathname) { this.name = window.location.pathname; } } return Operation; }()); exports.Operation = Operation; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Operation.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../SamplingScoreGenerator */ "./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, SamplingScoreGenerator_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Sample = /** @class */ (function () { function Sample(sampleRate, logger) { // We're using 32 bit math, hence max value is (2^31 - 1) this.INT_MAX_VALUE = 2147483647; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(logger)) { this._logger = new applicationinsights_core_js_1.DiagnosticLogger(); } else { this._logger = logger; } if (sampleRate > 100 || sampleRate < 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SampleRateOutOfRange, "Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.", { samplingRate: sampleRate }, true); this.sampleRate = 100; } this.sampleRate = sampleRate; this.samplingScoreGenerator = new SamplingScoreGenerator_1.SamplingScoreGenerator(); } /** * Determines if an envelope is sampled in (i.e. will be sent) or not (i.e. will be dropped). */ Sample.prototype.isSampledIn = function (envelope) { // return true as sampling will move to different extension return true; }; return Sample; }()); exports.Sample = Sample; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Sample.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/Session.js": /*!**********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/Session.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Session = /** @class */ (function () { function Session() { } return Session; }()); exports.Session = Session; var _SessionManager = /** @class */ (function () { function _SessionManager(config, logger) { if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(logger)) { this._logger = new applicationinsights_core_js_1.DiagnosticLogger(); } else { this._logger = logger; } if (!config) { config = {}; } if (!(typeof config.sessionExpirationMs === "function")) { config.sessionExpirationMs = function () { return _SessionManager.acquisitionSpan; }; } if (!(typeof config.sessionRenewalMs === "function")) { config.sessionRenewalMs = function () { return _SessionManager.renewalSpan; }; } this.config = config; this.automaticSession = new Session(); } _SessionManager.prototype.update = function () { if (!this.automaticSession.id) { this.initializeAutomaticSession(); } var now = applicationinsights_common_1.DateTimeUtils.Now(); var acquisitionExpired = now - this.automaticSession.acquisitionDate > this.config.sessionExpirationMs(); var renewalExpired = now - this.automaticSession.renewalDate > this.config.sessionRenewalMs(); // renew if acquisitionSpan or renewalSpan has ellapsed if (acquisitionExpired || renewalExpired) { // update automaticSession so session state has correct id this.automaticSession.isFirst = undefined; this.renew(); } else { // do not update the cookie more often than cookieUpdateInterval if (!this.cookieUpdatedTimestamp || now - this.cookieUpdatedTimestamp > _SessionManager.cookieUpdateInterval) { this.automaticSession.renewalDate = now; this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); } } }; /** * Record the current state of the automatic session and store it in our cookie string format * into the browser's local storage. This is used to restore the session data when the cookie * expires. */ _SessionManager.prototype.backup = function () { this.setStorage(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); }; /** * Use ai_session cookie data or local storage data (when the cookie is unavailable) to * initialize the automatic session. */ _SessionManager.prototype.initializeAutomaticSession = function () { var cookie = applicationinsights_common_1.Util.getCookie(this._logger, 'ai_session'); if (cookie && typeof cookie.split === "function") { this.initializeAutomaticSessionWithData(cookie); } else { // There's no cookie, but we might have session data in local storage // This can happen if the session expired or the user actively deleted the cookie // We only want to recover data if the cookie is missing from expiry. We should respect the user's wishes if the cookie was deleted actively. // The User class handles this for us and deletes our local storage object if the persistent user cookie was removed. var storage = applicationinsights_common_1.Util.getStorage(this._logger, 'ai_session'); if (storage) { this.initializeAutomaticSessionWithData(storage); } } if (!this.automaticSession.id) { this.automaticSession.isFirst = true; this.renew(); } }; /** * Extract id, aquisitionDate, and renewalDate from an ai_session payload string and * use this data to initialize automaticSession. * * @param {string} sessionData - The string stored in an ai_session cookie or local storage backup */ _SessionManager.prototype.initializeAutomaticSessionWithData = function (sessionData) { var params = sessionData.split("|"); if (params.length > 0) { this.automaticSession.id = params[0]; } try { if (params.length > 1) { var acq = +params[1]; this.automaticSession.acquisitionDate = +new Date(acq); this.automaticSession.acquisitionDate = this.automaticSession.acquisitionDate > 0 ? this.automaticSession.acquisitionDate : 0; } if (params.length > 2) { var renewal = +params[2]; this.automaticSession.renewalDate = +new Date(renewal); this.automaticSession.renewalDate = this.automaticSession.renewalDate > 0 ? this.automaticSession.renewalDate : 0; } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ErrorParsingAISessionCookie, "Error parsing ai_session cookie, session will be reset: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } if (this.automaticSession.renewalDate == 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SessionRenewalDateIsZero, "AI session renewal date is 0, session will be reset."); } }; _SessionManager.prototype.renew = function () { var now = applicationinsights_common_1.DateTimeUtils.Now(); this.automaticSession.id = applicationinsights_common_1.Util.newId(); this.automaticSession.acquisitionDate = now; this.automaticSession.renewalDate = now; this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate); // If this browser does not support local storage, fire an internal log to keep track of it at this point if (!applicationinsights_common_1.Util.canUseLocalStorage()) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserDoesNotSupportLocalStorage, "Browser does not support local storage. Session durations will be inaccurate."); } }; _SessionManager.prototype.setCookie = function (guid, acq, renewal) { // Set cookie to expire after the session expiry time passes or the session renewal deadline, whichever is sooner // Expiring the cookie will cause the session to expire even if the user isn't on the page var acquisitionExpiry = acq + this.config.sessionExpirationMs(); var renewalExpiry = renewal + this.config.sessionRenewalMs(); var cookieExpiry = new Date(); var cookie = [guid, acq, renewal]; if (acquisitionExpiry < renewalExpiry) { cookieExpiry.setTime(acquisitionExpiry); } else { cookieExpiry.setTime(renewalExpiry); } var cookieDomnain = this.config.cookieDomain ? this.config.cookieDomain() : null; applicationinsights_common_1.Util.setCookie(this._logger, 'ai_session', cookie.join('|') + ';expires=' + cookieExpiry.toUTCString(), cookieDomnain); this.cookieUpdatedTimestamp = applicationinsights_common_1.DateTimeUtils.Now(); }; _SessionManager.prototype.setStorage = function (guid, acq, renewal) { // Keep data in local storage to retain the last session id, allowing us to cleanly end the session when it expires // Browsers that don't support local storage won't be able to end sessions cleanly from the client // The server will notice this and end the sessions itself, with loss of accurate session duration applicationinsights_common_1.Util.setStorage(this._logger, 'ai_session', [guid, acq, renewal].join('|')); }; _SessionManager.acquisitionSpan = 86400000; // 24 hours in ms _SessionManager.renewalSpan = 1800000; // 30 minutes in ms _SessionManager.cookieUpdateInterval = 60000; // 1 minute in ms return _SessionManager; }()); exports._SessionManager = _SessionManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Session.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/Context/User.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/Context/User.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var User = /** @class */ (function () { function User(config, logger) { this._logger = logger; //get userId or create new one if none exists var cookie = applicationinsights_common_1.Util.getCookie(this._logger, User.userCookieName); if (cookie) { var params = cookie.split(User.cookieSeparator); if (params.length > 0) { this.id = params[0]; } } this.config = config; if (!this.id) { this.id = applicationinsights_common_1.Util.newId(); var date = new Date(); var acqStr = applicationinsights_common_1.Util.toISOStringForIE8(date); this.accountAcquisitionDate = acqStr; // without expiration, cookies expire at the end of the session // set it to 365 days from now // 365 * 24 * 60 * 60 * 1000 = 31536000000 date.setTime(date.getTime() + 31536000000); var newCookie = [this.id, acqStr]; var cookieDomain = this.config.cookieDomain ? this.config.cookieDomain() : undefined; applicationinsights_common_1.Util.setCookie(this._logger, User.userCookieName, newCookie.join(User.cookieSeparator) + ';expires=' + date.toUTCString(), cookieDomain); // If we have an ai_session in local storage this means the user actively removed our cookies. // We should respect their wishes and clear ourselves from local storage applicationinsights_common_1.Util.removeStorage(this._logger, 'ai_session'); } // We still take the account id from the ctor param for backward compatibility. // But if the the customer set the accountId through the newer setAuthenticatedUserContext API, we will override it. this.accountId = config.accountId ? config.accountId() : undefined; // Get the auth user id and account id from the cookie if exists // Cookie is in the pattern: | var authCookie = applicationinsights_common_1.Util.getCookie(this._logger, User.authUserCookieName); if (authCookie) { authCookie = decodeURI(authCookie); var authCookieString = authCookie.split(User.cookieSeparator); if (authCookieString[0]) { this.authenticatedId = authCookieString[0]; } if (authCookieString.length > 1 && authCookieString[1]) { this.accountId = authCookieString[1]; } } } /** * Sets the authenticated user id and the account id in this session. * * @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service. * @param accountId {string} - An optional string to represent the account associated with the authenticated user. */ User.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) { if (storeInCookie === void 0) { storeInCookie = false; } // Validate inputs to ensure no cookie control characters. var isInvalidInput = !this.validateUserInput(authenticatedUserId) || (accountId && !this.validateUserInput(accountId)); if (isInvalidInput) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SetAuthContextFailedAccountName, "Setting auth user context failed. " + "User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.", true); return; } // Create cookie string. this.authenticatedId = authenticatedUserId; var authCookie = this.authenticatedId; if (accountId) { this.accountId = accountId; authCookie = [this.authenticatedId, this.accountId].join(User.cookieSeparator); } if (storeInCookie) { // Set the cookie. No expiration date because this is a session cookie (expires when browser closed). // Encoding the cookie to handle unexpected unicode characters. applicationinsights_common_1.Util.setCookie(this._logger, User.authUserCookieName, encodeURI(authCookie), this.config.cookieDomain()); } }; /** * Clears the authenticated user id and the account id from the user context. * @returns {} */ User.prototype.clearAuthenticatedUserContext = function () { this.authenticatedId = null; this.accountId = null; applicationinsights_common_1.Util.deleteCookie(this._logger, User.authUserCookieName); }; User.prototype.validateUserInput = function (id) { // Validate: // 1. Id is a non-empty string. // 2. It does not contain special characters for cookies. if (typeof id !== 'string' || !id || id.match(/,|;|=| |\|/)) { return false; } return true; }; User.cookieSeparator = '|'; User.userCookieName = 'ai_user'; User.authUserCookieName = 'ai_authUser'; return User; }()); exports.User = User; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=User.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var HashCodeScoreGenerator = /** @class */ (function () { function HashCodeScoreGenerator() { } HashCodeScoreGenerator.prototype.getHashCodeScore = function (key) { var score = this.getHashCode(key) / HashCodeScoreGenerator.INT_MAX_VALUE; return score * 100; }; HashCodeScoreGenerator.prototype.getHashCode = function (input) { if (input == "") { return 0; } while (input.length < HashCodeScoreGenerator.MIN_INPUT_LENGTH) { input = input.concat(input); } // 5381 is a magic number: http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function var hash = 5381; for (var i = 0; i < input.length; ++i) { hash = ((hash << 5) + hash) + input.charCodeAt(i); // 'hash' is of number type which means 53 bit integer (http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types-number-type) // 'hash & hash' will keep it 32 bit integer - just to make it clearer what the result is. hash = hash & hash; } return Math.abs(hash); }; // We're using 32 bit math, hence max value is (2^31 - 1) HashCodeScoreGenerator.INT_MAX_VALUE = 2147483647; // (Magic number) DJB algorithm can't work on shorter strings (results in poor distribution HashCodeScoreGenerator.MIN_INPUT_LENGTH = 8; return HashCodeScoreGenerator; }()); exports.HashCodeScoreGenerator = HashCodeScoreGenerator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=HashCodeScoreGenerator.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js": /*!***********************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** * PropertiesPlugin.ts * @copyright Microsoft 2018 */ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! ./Context/Session */ "./node_modules/applicationinsights-properties-js/bundle/Context/Session.js"), __webpack_require__(/*! ./Context/Application */ "./node_modules/applicationinsights-properties-js/bundle/Context/Application.js"), __webpack_require__(/*! ./Context/Device */ "./node_modules/applicationinsights-properties-js/bundle/Context/Device.js"), __webpack_require__(/*! ./Context/Internal */ "./node_modules/applicationinsights-properties-js/bundle/Context/Internal.js"), __webpack_require__(/*! ./Context/Location */ "./node_modules/applicationinsights-properties-js/bundle/Context/Location.js"), __webpack_require__(/*! ./Context/Operation */ "./node_modules/applicationinsights-properties-js/bundle/Context/Operation.js"), __webpack_require__(/*! ./Context/User */ "./node_modules/applicationinsights-properties-js/bundle/Context/User.js"), __webpack_require__(/*! ./Context/Sample */ "./node_modules/applicationinsights-properties-js/bundle/Context/Sample.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, applicationinsights_common_1, Session_1, Application_1, Device_1, Internal_1, Location_1, Operation_1, User_1, Sample_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PropertiesPlugin = /** @class */ (function () { function PropertiesPlugin() { this.priority = 170; this.identifier = "AppInsightsPropertiesPlugin"; } PropertiesPlugin.prototype.initialize = function (config, core, extensions) { var extensionConfig = config.extensionConfig && config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {}; this._extensionConfig = { instrumentationKey: function () { return extensionConfig.instrumentationKey; }, accountId: function () { return extensionConfig.accountId; }, sessionRenewalMs: function () { return extensionConfig.sessionRenewalMs; }, sampleRate: function () { return extensionConfig.sampleRate; }, sessionExpirationMs: function () { return extensionConfig.sessionExpirationMs; }, cookieDomain: function () { return extensionConfig.cookieDomain; }, sdkExtension: function () { return extensionConfig.sdkExtension; }, isBrowserLinkTrackingEnabled: function () { return extensionConfig.isBrowserLinkTrackingEnabled; }, appId: function () { return extensionConfig.appId; } }; if (typeof window !== 'undefined') { this._sessionManager = new Session_1._SessionManager(this._extensionConfig, core.logger); this.application = new Application_1.Application(); this.device = new Device_1.Device(); this.internal = new Internal_1.Internal(this._extensionConfig); this.location = new Location_1.Location(); this.user = new User_1.User(this._extensionConfig, core.logger); this.operation = new Operation_1.Operation(); this.session = new Session_1.Session(); this.sample = new Sample_1.Sample(this._extensionConfig.sampleRate(), core.logger); } }; /** * Add Part A fields to the event * @param event The event that needs to be processed */ PropertiesPlugin.prototype.processTelemetry = function (event) { if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(event)) { // TODO(barustum): throw an internal event once we have support for internal logging } else { // if the event is not sampled in, do not bother going through the pipeline if (this.sample.isSampledIn(event)) { // If the envelope is PageView, reset the internal message count so that we can send internal telemetry for the new page. if (event.name === applicationinsights_common_1.PageView.envelopeType) { // TODO(barustum): resetInternalMessageCount once we have support for internal logging //_InternalLogging.resetInternalMessageCount(); } if (this.session) { // If customer did not provide custom session id update the session manager if (typeof this.session.id !== "string") { this._sessionManager.update(); } } this._processTelemetryInternal(event); } if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(event); } } }; /** * Sets the next plugin that comes after this plugin * @param nextPlugin The next plugin */ PropertiesPlugin.prototype.setNextPlugin = function (nextPlugin) { this._nextPlugin = nextPlugin; }; PropertiesPlugin.prototype._processTelemetryInternal = function (event) { var tagsItem = {}; if (this.session) { // If customer set id, apply his context; otherwise apply context generated from cookies if (typeof this.session.id === "string") { PropertiesPlugin._applySessionContext(tagsItem, this.session); } else { PropertiesPlugin._applySessionContext(tagsItem, this._sessionManager.automaticSession); } } // set part A fields PropertiesPlugin._applyApplicationContext(tagsItem, this.application); PropertiesPlugin._applyDeviceContext(tagsItem, this.device); PropertiesPlugin._applyInternalContext(tagsItem, this.internal); PropertiesPlugin._applyLocationContext(tagsItem, this.location); PropertiesPlugin._applySampleContext(tagsItem, this.sample); PropertiesPlugin._applyUserContext(tagsItem, this.user); PropertiesPlugin._applyOperationContext(tagsItem, this.operation); event.tags.push(tagsItem); }; PropertiesPlugin._applySessionContext = function (tags, sessionContext) { if (sessionContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof sessionContext.id === "string") { tags[tagKeys.sessionId] = sessionContext.id; } if (typeof sessionContext.isFirst !== "undefined") { tags[tagKeys.sessionIsFirst] = sessionContext.isFirst; } } }; PropertiesPlugin._applyApplicationContext = function (tagsItem, appContext) { if (appContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof appContext.ver === "string") { tagsItem[tagKeys.applicationVersion] = appContext.ver; } if (typeof appContext.build === "string") { tagsItem[tagKeys.applicationBuild] = appContext.build; } } }; PropertiesPlugin._applyDeviceContext = function (tagsItem, deviceContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (deviceContext) { if (typeof deviceContext.id === "string") { tagsItem[tagKeys.deviceId] = deviceContext.id; } if (typeof deviceContext.ip === "string") { tagsItem[tagKeys.deviceIp] = deviceContext.ip; } if (typeof deviceContext.language === "string") { tagsItem[tagKeys.deviceLanguage] = deviceContext.language; } if (typeof deviceContext.locale === "string") { tagsItem[tagKeys.deviceLocale] = deviceContext.locale; } if (typeof deviceContext.model === "string") { tagsItem[tagKeys.deviceModel] = deviceContext.model; } if (typeof deviceContext.network !== "undefined") { tagsItem[tagKeys.deviceNetwork] = deviceContext.network; } if (typeof deviceContext.oemName === "string") { tagsItem[tagKeys.deviceOEMName] = deviceContext.oemName; } if (typeof deviceContext.os === "string") { tagsItem[tagKeys.deviceOS] = deviceContext.os; } if (typeof deviceContext.osversion === "string") { tagsItem[tagKeys.deviceOSVersion] = deviceContext.osversion; } if (typeof deviceContext.resolution === "string") { tagsItem[tagKeys.deviceScreenResolution] = deviceContext.resolution; } if (typeof deviceContext.type === "string") { tagsItem[tagKeys.deviceType] = deviceContext.type; } } }; PropertiesPlugin._applyInternalContext = function (tagsItem, internalContext) { if (internalContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof internalContext.agentVersion === "string") { tagsItem[tagKeys.internalAgentVersion] = internalContext.agentVersion; } if (typeof internalContext.sdkVersion === "string") { tagsItem[tagKeys.internalSdkVersion] = internalContext.sdkVersion; } } }; PropertiesPlugin._applyLocationContext = function (tagsItem, locationContext) { if (locationContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof locationContext.ip === "string") { tagsItem[tagKeys.locationIp] = locationContext.ip; } } }; PropertiesPlugin._applySampleContext = function (tagsItem, sampleContext) { if (sampleContext) { tagsItem.sampleRate = sampleContext.sampleRate; } }; PropertiesPlugin._applyOperationContext = function (tagsItem, operationContext) { if (operationContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof operationContext.id === "string") { tagsItem[tagKeys.operationId] = operationContext.id; } if (typeof operationContext.name === "string") { tagsItem[tagKeys.operationName] = operationContext.name; } if (typeof operationContext.parentId === "string") { tagsItem[tagKeys.operationParentId] = operationContext.parentId; } if (typeof operationContext.rootId === "string") { tagsItem[tagKeys.operationRootId] = operationContext.rootId; } if (typeof operationContext.syntheticSource === "string") { tagsItem[tagKeys.operationSyntheticSource] = operationContext.syntheticSource; } } }; PropertiesPlugin._applyUserContext = function (tagsItem, userContext) { if (userContext) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); if (typeof userContext.accountId === "string") { tagsItem[tagKeys.userAccountId] = userContext.accountId; } if (typeof userContext.agent === "string") { tagsItem[tagKeys.userAgent] = userContext.agent; } if (typeof userContext.id === "string") { tagsItem[tagKeys.userId] = userContext.id; } if (typeof userContext.authenticatedId === "string") { tagsItem[tagKeys.userAuthUserId] = userContext.authenticatedId; } if (typeof userContext.storeRegion === "string") { tagsItem[tagKeys.userStoreRegion] = userContext.storeRegion; } } }; return PropertiesPlugin; }()); exports.default = PropertiesPlugin; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PropertiesPlugin.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/SamplingScoreGenerator.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./HashCodeScoreGenerator */ "./node_modules/applicationinsights-properties-js/bundle/HashCodeScoreGenerator.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, HashCodeScoreGenerator_1, applicationinsights_common_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var SamplingScoreGenerator = /** @class */ (function () { function SamplingScoreGenerator() { this.hashCodeGeneragor = new HashCodeScoreGenerator_1.HashCodeScoreGenerator(); } SamplingScoreGenerator.prototype.getSamplingScore = function (envelope) { var tagKeys = new applicationinsights_common_1.ContextTagKeys(); var score = 0; if (envelope.tags[tagKeys.userId]) { score = this.hashCodeGeneragor.getHashCodeScore(envelope.tags[tagKeys.userId]); } else if (envelope.tags[tagKeys.operationId]) { score = this.hashCodeGeneragor.getHashCodeScore(envelope.tags[tagKeys.operationId]); } else { // tslint:disable-next-line:insecure-random score = Math.random(); } return score; }; return SamplingScoreGenerator; }()); exports.SamplingScoreGenerator = SamplingScoreGenerator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SamplingScoreGenerator.js.map /***/ }), /***/ "./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-properties-js/bundle/applicationinsights-properties-js.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./PropertiesPlugin */ "./node_modules/applicationinsights-properties-js/bundle/PropertiesPlugin.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PropertiesPlugin_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PropertiesPlugin = PropertiesPlugin_1.default; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-properties-js.js.map /***/ }), /***/ 0: /*!**********************************!*\ !*** multi ./amd/bundle/Init.js ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(/*! ./amd/bundle/Init.js */"./amd/bundle/Init.js"); /***/ }) /******/ }); }); //# sourceMappingURL=aisdk.0.0.19.js.map ================================================ FILE: AISKU/dist-history/aisdk.0.0.8.js ================================================ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(window,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=19)}([function(e,t,n){var i,r;i=[n,t,n(2),n(1),n(6),n(8),n(25),n(9),n(10),n(26),n(28),n(21),n(29),n(34),n(7),n(35),n(37),n(39),n(41),n(42),n(43),n(3)],void 0===(r=function(e,t,n,i,r,o,a,s,l,c,u,p,d,f,g,h,v,y,_,m,I,S){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=n.Util,t.CorrelationIdHelper=n.CorrelationIdHelper,t.UrlHelper=n.UrlHelper,t._InternalMessageId=i._InternalMessageId,t.LoggingSeverity=i.LoggingSeverity,t.FieldType=i.FieldType,t._InternalLogging=r._InternalLogging,t._InternalLogMessage=r._InternalLogMessage,t.RequestHeaders=o.RequestHeaders,t.DisabledPropertyName=a.DisabledPropertyName,t.AIData=s.Data,t.AIBase=l.Base,t.Envelope=c.Envelope,t.Event=u.Event,t.Exception=p.Exception,t.Metric=d.Metric,t.PageView=f.PageView,t.PageViewData=g.PageViewData,t.RemoteDependencyData=h.RemoteDependencyData,t.Trace=v.Trace,t.PageViewPerformance=y.PageViewPerformance,t.Data=_.Data,t.SeverityLevel=m.SeverityLevel,t.ContextTagKeys=I.ContextTagKeys,t.DataSanitizer=S.DataSanitizer}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.CRITICAL=0]="CRITICAL",e[e.WARNING=1]="WARNING"}(t.LoggingSeverity||(t.LoggingSeverity={})),function(e){e[e.BrowserDoesNotSupportLocalStorage=0]="BrowserDoesNotSupportLocalStorage",e[e.BrowserCannotReadLocalStorage=1]="BrowserCannotReadLocalStorage",e[e.BrowserCannotReadSessionStorage=2]="BrowserCannotReadSessionStorage",e[e.BrowserCannotWriteLocalStorage=3]="BrowserCannotWriteLocalStorage",e[e.BrowserCannotWriteSessionStorage=4]="BrowserCannotWriteSessionStorage",e[e.BrowserFailedRemovalFromLocalStorage=5]="BrowserFailedRemovalFromLocalStorage",e[e.BrowserFailedRemovalFromSessionStorage=6]="BrowserFailedRemovalFromSessionStorage",e[e.CannotSendEmptyTelemetry=7]="CannotSendEmptyTelemetry",e[e.ClientPerformanceMathError=8]="ClientPerformanceMathError",e[e.ErrorParsingAISessionCookie=9]="ErrorParsingAISessionCookie",e[e.ErrorPVCalc=10]="ErrorPVCalc",e[e.ExceptionWhileLoggingError=11]="ExceptionWhileLoggingError",e[e.FailedAddingTelemetryToBuffer=12]="FailedAddingTelemetryToBuffer",e[e.FailedMonitorAjaxAbort=13]="FailedMonitorAjaxAbort",e[e.FailedMonitorAjaxDur=14]="FailedMonitorAjaxDur",e[e.FailedMonitorAjaxOpen=15]="FailedMonitorAjaxOpen",e[e.FailedMonitorAjaxRSC=16]="FailedMonitorAjaxRSC",e[e.FailedMonitorAjaxSend=17]="FailedMonitorAjaxSend",e[e.FailedMonitorAjaxGetCorrelationHeader=18]="FailedMonitorAjaxGetCorrelationHeader",e[e.FailedToAddHandlerForOnBeforeUnload=19]="FailedToAddHandlerForOnBeforeUnload",e[e.FailedToSendQueuedTelemetry=20]="FailedToSendQueuedTelemetry",e[e.FailedToReportDataLoss=21]="FailedToReportDataLoss",e[e.FlushFailed=22]="FlushFailed",e[e.MessageLimitPerPVExceeded=23]="MessageLimitPerPVExceeded",e[e.MissingRequiredFieldSpecification=24]="MissingRequiredFieldSpecification",e[e.NavigationTimingNotSupported=25]="NavigationTimingNotSupported",e[e.OnError=26]="OnError",e[e.SessionRenewalDateIsZero=27]="SessionRenewalDateIsZero",e[e.SenderNotInitialized=28]="SenderNotInitialized",e[e.StartTrackEventFailed=29]="StartTrackEventFailed",e[e.StopTrackEventFailed=30]="StopTrackEventFailed",e[e.StartTrackFailed=31]="StartTrackFailed",e[e.StopTrackFailed=32]="StopTrackFailed",e[e.TelemetrySampledAndNotSent=33]="TelemetrySampledAndNotSent",e[e.TrackEventFailed=34]="TrackEventFailed",e[e.TrackExceptionFailed=35]="TrackExceptionFailed",e[e.TrackMetricFailed=36]="TrackMetricFailed",e[e.TrackPVFailed=37]="TrackPVFailed",e[e.TrackPVFailedCalc=38]="TrackPVFailedCalc",e[e.TrackTraceFailed=39]="TrackTraceFailed",e[e.TransmissionFailed=40]="TransmissionFailed",e[e.FailedToSetStorageBuffer=41]="FailedToSetStorageBuffer",e[e.FailedToRestoreStorageBuffer=42]="FailedToRestoreStorageBuffer",e[e.InvalidBackendResponse=43]="InvalidBackendResponse",e[e.FailedToFixDepricatedValues=44]="FailedToFixDepricatedValues",e[e.InvalidDurationValue=45]="InvalidDurationValue",e[e.TelemetryEnvelopeInvalid=46]="TelemetryEnvelopeInvalid",e[e.CreateEnvelopeError=47]="CreateEnvelopeError",e[e.CannotSerializeObject=48]="CannotSerializeObject",e[e.CannotSerializeObjectNonSerializable=49]="CannotSerializeObjectNonSerializable",e[e.CircularReferenceDetected=50]="CircularReferenceDetected",e[e.ClearAuthContextFailed=51]="ClearAuthContextFailed",e[e.ExceptionTruncated=52]="ExceptionTruncated",e[e.IllegalCharsInName=53]="IllegalCharsInName",e[e.ItemNotInArray=54]="ItemNotInArray",e[e.MaxAjaxPerPVExceeded=55]="MaxAjaxPerPVExceeded",e[e.MessageTruncated=56]="MessageTruncated",e[e.NameTooLong=57]="NameTooLong",e[e.SampleRateOutOfRange=58]="SampleRateOutOfRange",e[e.SetAuthContextFailed=59]="SetAuthContextFailed",e[e.SetAuthContextFailedAccountName=60]="SetAuthContextFailedAccountName",e[e.StringValueTooLong=61]="StringValueTooLong",e[e.StartCalledMoreThanOnce=62]="StartCalledMoreThanOnce",e[e.StopCalledWithoutStart=63]="StopCalledWithoutStart",e[e.TelemetryInitializerFailed=64]="TelemetryInitializerFailed",e[e.TrackArgumentsNotSpecified=65]="TrackArgumentsNotSpecified",e[e.UrlTooLong=66]="UrlTooLong",e[e.SessionStorageBufferFull=67]="SessionStorageBufferFull",e[e.CannotAccessCookie=68]="CannotAccessCookie",e[e.IdTooLong=69]="IdTooLong"}(t._InternalMessageId||(t._InternalMessageId={})),function(e){e[e.LocalStorage=0]="LocalStorage",e[e.SessionStorage=1]="SessionStorage"}(t.StorageType||(t.StorageType={})),function(e){e[e.Default=0]="Default",e[e.Required=1]="Required",e[e.Array=2]="Array",e[e.Hidden=4]="Hidden"}(t.FieldType||(t.FieldType={}))}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r;i=[n,t,n(1),n(6),n(8),n(3)],void 0===(r=function(e,t,n,i,r,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){}return e.disableStorage=function(){e._canUseLocalStorage=!1,e._canUseSessionStorage=!1},e._getLocalStorageObject=function(){return e.canUseLocalStorage()?e._getVerifiedStorageObject(n.StorageType.LocalStorage):null},e._getVerifiedStorageObject=function(e){var t,i,r=null;try{i=new Date,(r=e===n.StorageType.LocalStorage?window.localStorage:window.sessionStorage).setItem(i,i),t=r.getItem(i)!=i,r.removeItem(i),t&&(r=null)}catch(e){r=null}return r},e.isInternalApplicationInsightsEndpoint=function(t){return-1!==e._internalEndpoints.indexOf(t.toLowerCase())},e.canUseLocalStorage=function(){return void 0===e._canUseLocalStorage&&(e._canUseLocalStorage=!!e._getVerifiedStorageObject(n.StorageType.LocalStorage)),e._canUseLocalStorage},e.getStorage=function(t){var r=e._getLocalStorageObject();if(null!==r)try{return r.getItem(t)}catch(t){e._canUseLocalStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserCannotReadLocalStorage,"Browser failed read of local storage. "+e.getExceptionName(t),{exception:e.dump(t)})}return null},e.setStorage=function(t,r){var o=e._getLocalStorageObject();if(null!==o)try{return o.setItem(t,r),!0}catch(t){e._canUseLocalStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserCannotWriteLocalStorage,"Browser failed write to local storage. "+e.getExceptionName(t),{exception:e.dump(t)})}return!1},e.removeStorage=function(t){var r=e._getLocalStorageObject();if(null!==r)try{return r.removeItem(t),!0}catch(t){e._canUseLocalStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserFailedRemovalFromLocalStorage,"Browser failed removal of local storage item. "+e.getExceptionName(t),{exception:e.dump(t)})}return!1},e._getSessionStorageObject=function(){return e.canUseSessionStorage()?e._getVerifiedStorageObject(n.StorageType.SessionStorage):null},e.canUseSessionStorage=function(){return void 0===e._canUseSessionStorage&&(e._canUseSessionStorage=!!e._getVerifiedStorageObject(n.StorageType.SessionStorage)),e._canUseSessionStorage},e.getSessionStorageKeys=function(){var t=[];if(e.canUseSessionStorage())for(var n in window.sessionStorage)t.push(n);return t},e.getSessionStorage=function(t){var r=e._getSessionStorageObject();if(null!==r)try{return r.getItem(t)}catch(t){e._canUseSessionStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserCannotReadSessionStorage,"Browser failed read of session storage. "+e.getExceptionName(t),{exception:e.dump(t)})}return null},e.setSessionStorage=function(t,r){var o=e._getSessionStorageObject();if(null!==o)try{return o.setItem(t,r),!0}catch(t){e._canUseSessionStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserCannotWriteSessionStorage,"Browser failed write to session storage. "+e.getExceptionName(t),{exception:e.dump(t)})}return!1},e.removeSessionStorage=function(t){var r=e._getSessionStorageObject();if(null!==r)try{return r.removeItem(t),!0}catch(t){e._canUseSessionStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserFailedRemovalFromSessionStorage,"Browser failed removal of session storage item. "+e.getExceptionName(t),{exception:e.dump(t)})}return!1},e.disableCookies=function(){e._canUseCookies=!1},e.canUseCookies=function(){if(void 0===e._canUseCookies){e._canUseCookies=!1;try{e._canUseCookies=void 0!==e.document.cookie}catch(t){i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.CannotAccessCookie,"Cannot access document.cookie - "+e.getExceptionName(t),{exception:e.dump(t)})}}return e._canUseCookies},e.setCookie=function(t,n,i){var r="",o="";i&&(r=";domain="+i),e.document.location&&"https:"===e.document.location.protocol&&(o=";secure"),e.canUseCookies()&&(e.document.cookie=t+"="+n+r+";path=/"+o)},e.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),void 0===e||null===e?t:"true"===e.toString().toLowerCase()},e.getCookie=function(t){if(e.canUseCookies()){var n="";if(t&&t.length)for(var i=t+"=",r=e.document.cookie.split(";"),o=0;o0;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},e.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},e.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},e.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},e.toISOStringForIE8=function(t){if(e.isDate(t)){if(Date.prototype.toISOString)return t.toISOString();var n=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return t.getUTCFullYear()+"-"+n(t.getUTCMonth()+1)+"-"+n(t.getUTCDate())+"T"+n(t.getUTCHours())+":"+n(t.getUTCMinutes())+":"+n(t.getUTCSeconds())+"."+String((t.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},e.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},e.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,o=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,r=r.length<2?"0"+r:r,(o>0?o+".":"")+r+":"+i+":"+n+"."+t},e.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},e.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},e.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},e.addEventHandler=function(e,t){if(!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},e.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},e.document="undefined"!=typeof document?document:{},e._canUseCookies=void 0,e._canUseLocalStorage=void 0,e._canUseSessionStorage=void 0,e._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],e.NotSpecified="not_specified",e}();t.Util=a;var s=function(){function e(){}return e.parseUrl=function(t){return e.htmlAnchorElement||(e.htmlAnchorElement=e.document.createElement?e.document.createElement("a"):{}),e.htmlAnchorElement.href=t,e.htmlAnchorElement},e.getAbsoluteUrl=function(t){var n,i=e.parseUrl(t);return i&&(n=i.href),n},e.getPathName=function(t){var n,i=e.parseUrl(t);return i&&(n=i.pathname),n},e.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},e.document="undefined"!=typeof document?document:{},e}();t.UrlHelper=s;var l=function(){function e(){}return e.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=s.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var r=e&&e.correlationHeaderExcludedDomains;if(!r||0==r.length)return!0;for(var o=0;o0){var a=s.parseUrl(e);if(i=a.host,null!=a.pathname)"/"!==(n=0===a.pathname.length?"/":a.pathname).charAt(0)&&(n="/"+n),r=o.DataSanitizer.sanitizeString(t?t+" "+n:n);else r=o.DataSanitizer.sanitizeString(e)}else i=n,r=n;return{target:i,name:r}},e}();t.AjaxHelper=c}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(6),n(2),n(1)],void 0===(r=function(e,t,n,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.sanitizeKeyAndAddUniqueness=function(t,n){var i=t.length,r=e.sanitizeKey(t);if(r.length!==i){for(var o=0,a=r;void 0!==n[a];)o++,a=r.substring(0,e.MAX_NAME_LENGTH-3)+e.padNumber(o);r=a}return r},e.sanitizeKey=function(t){return t&&(t=i.Util.trim(t.toString())).length>e.MAX_NAME_LENGTH&&(t=t.substring(0,e.MAX_NAME_LENGTH),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,r._InternalMessageId.NameTooLong,"name is too long. It has been truncated to "+e.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},e.sanitizeString=function(t,o){return void 0===o&&(o=e.MAX_STRING_LENGTH),t&&(o=o||e.MAX_STRING_LENGTH,(t=i.Util.trim(t)).toString().length>o&&(t=t.toString().substring(0,o),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,r._InternalMessageId.StringValueTooLong,"string value is too long. It has been truncated to "+o+" characters.",{value:t},!0))),t},e.sanitizeUrl=function(t){return e.sanitizeInput(t,e.MAX_URL_LENGTH,r._InternalMessageId.UrlTooLong)},e.sanitizeMessage=function(t){return t&&t.length>e.MAX_MESSAGE_LENGTH&&(t=t.substring(0,e.MAX_MESSAGE_LENGTH),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,r._InternalMessageId.MessageTruncated,"message is too long, it has been truncated to "+e.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},e.sanitizeException=function(t){return t&&t.length>e.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,e.MAX_EXCEPTION_LENGTH),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,r._InternalMessageId.ExceptionTruncated,"exception is too long, it has been truncated to "+e.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},e.sanitizeProperties=function(t){if(t){var n={};for(var i in t){var r=e.sanitizeString(t[i],e.MAX_PROPERTY_LENGTH);n[i=e.sanitizeKeyAndAddUniqueness(i,n)]=r}t=n}return t},e.sanitizeMeasurements=function(t){if(t){var n={};for(var i in t){var r=t[i];n[i=e.sanitizeKeyAndAddUniqueness(i,n)]=r}t=n}return t},e.sanitizeId=function(t){return t?e.sanitizeInput(t,e.MAX_ID_LENGTH,r._InternalMessageId.IdTooLong).toString():t},e.sanitizeInput=function(e,t,o){return e&&(e=i.Util.trim(e)).length>t&&(e=e.substring(0,t),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,o,"input is too long, it has been truncated to "+t+" characters.",{data:e},!0)),e},e.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},e.MAX_NAME_LENGTH=150,e.MAX_ID_LENGTH=128,e.MAX_PROPERTY_LENGTH=8192,e.MAX_STRING_LENGTH=1024,e.MAX_URL_LENGTH=2048,e.MAX_MESSAGE_LENGTH=32768,e.MAX_EXCEPTION_LENGTH=32768,e}();t.DataSanitizer=o}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(12),n(13),n(44),n(14),n(15)],void 0===(r=function(e,t,n,i,r,o,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MinChannelPriorty=n.MinChannelPriorty,t.EventsDiscardedReason=i.EventsDiscardedReason,t.AppInsightsCore=r.AppInsightsCore,t.CoreUtils=o.CoreUtils,t.NotificationManager=a.NotificationManager}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){}}();t.Domain=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r;i=[n,t,n(1),n(2)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(t,i,r,o){void 0===r&&(r=!1),this.messageId=t,this.message=(r?e.AiUserActionablePrefix:e.AiNonUserActionablePrefix)+n._InternalMessageId[t].toString();var a=(i?" message:"+e.sanitizeDiagnosticText(i):"")+(o?" props:"+e.sanitizeDiagnosticText(JSON.stringify(o)):"");this.message+=a}return e.sanitizeDiagnosticText=function(e){return'"'+e.replace(/\"/g,"")+'"'},e.AiNonUserActionablePrefix="AI (Internal): ",e.AiUserActionablePrefix="AI: ",e}();t._InternalLogMessage=r;var o=function(){function e(){}return e.throwInternal=function(e,t,i,o,a){void 0===a&&(a=!1);var s=new r(t,i,a,o);if(this.enableDebugExceptions())throw s;if(void 0!==s&&s&&void 0!==s.message){if(a){var l=n._InternalMessageId[s.messageId];this._messageLogged[l]&&!this.verboseLogging()||(this.warnToConsole(s.message),this._messageLogged[l]=!0)}else this.verboseLogging()&&this.warnToConsole(s.message);this.logInternalMessage(e,s)}},e.warnToConsole=function(e){"undefined"!=typeof console&&console&&("function"==typeof console.warn?console.warn(e):"function"==typeof console.log&&console.log(e))},e.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},e.clearInternalMessageLoggedTypes=function(){if(i.Util.canUseSessionStorage())for(var t=i.Util.getSessionStorageKeys(),n=0;n=this.MAX_INTERNAL_MESSAGE_LIMIT},e.AIInternalMessagePrefix="AITR_",e.enableDebugExceptions=function(){return!1},e.verboseLogging=function(){return!1},e.queue=[],e.MAX_INTERNAL_MESSAGE_LIMIT=25,e._messageCount=0,e._messageLogged={},e}();t._InternalLogging=o}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(11)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return o(t,e),t}(n.EventData);t.PageViewData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}();t.RequestHeaders=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(10)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return e.call(this)||this}return o(t,e),t}(n.Base);t.Data=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){}}();t.Base=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return o(t,e),t}(n.Domain);t.EventData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MinChannelPriorty=100}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventsDiscardedReason={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5}}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.isNullOrUndefined=function(e){return null===e||void 0===e},e}();t.CoreUtils=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.listeners=[]}return e.prototype.addNotificationListener=function(e){this.listeners.push(e)},e.prototype.removeNotificationListener=function(e){for(var t=this.listeners.indexOf(e);t>-1;)this.listeners.splice(t,1),t=this.listeners.indexOf(e)},e.prototype.eventsSent=function(e){for(var t=this,n=function(n){i.listeners[n].eventsSent&&setTimeout(function(){return t.listeners[n].eventsSent(e)},0)},i=this,r=0;r0,n}return o(t,e),t.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,o=0;o<=n.length;o++){var a=n[o];if(p.regex.test(a)){var s=new p(n[o],i++);r+=s.sizeInBytes,t.push(s)}}if(r>32768)for(var l=0,c=t.length-1,u=0,d=l,f=c;l32768){var g=f-d+1;t.splice(d,g);break}d=l,f=c,l++,c--}}return t},t}(r.ExceptionDetails),p=function(e){function t(n,i){var r=e.call(this)||this;r.sizeInBytes=0,r.aiDataContract={level:s.FieldType.Required,method:s.FieldType.Required,assembly:s.FieldType.Default,fileName:s.FieldType.Default,line:s.FieldType.Default},r.level=i,r.method="",r.assembly=l.Util.trim(n);var o=n.match(t.regex);return o&&o.length>=5&&(r.method=l.Util.trim(o[2])||r.method,r.fileName=l.Util.trim(o[4]),r.line=parseInt(o[5])||0),r.sizeInBytes+=r.method.length,r.sizeInBytes+=r.fileName.length,r.sizeInBytes+=r.assembly.length,r.sizeInBytes+=t.baseSize,r.sizeInBytes+=r.level.toString().length,r.sizeInBytes+=r.line.toString().length,r}return o(t,e),t.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,t.baseSize=58,t}(n.StackFrame);t._StackFrame=p}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){}}();t.StackFrame=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.exceptions=[],t.properties={},t.measurements={},t}return o(t,e),t}(n.Domain);t.ExceptionData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){this.hasFullStack=!0,this.parsedStack=[]}}();t.ExceptionDetails=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DisabledPropertyName="Microsoft_ApplicationInsights_BypassAjaxInstrumentation"}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(27),n(3),n(1),n(2)],void 0===(r=function(e,t,n,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t,n){var o=e.call(this)||this;return o.name=i.DataSanitizer.sanitizeString(n)||a.Util.NotSpecified,o.data=t,o.time=a.Util.toISOStringForIE8(new Date),o.aiDataContract={time:r.FieldType.Required,iKey:r.FieldType.Required,name:r.FieldType.Required,sampleRate:function(){return 100==o.sampleRate?r.FieldType.Hidden:r.FieldType.Required},tags:r.FieldType.Required,data:r.FieldType.Required},o}return o(t,e),t}(n.Envelope);t.Envelope=s}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){this.ver=1,this.sampleRate=100,this.tags={}}}();t.Envelope=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(11),n(3),n(1),n(2)],void 0===(r=function(e,t,n,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t,n,o){var s=e.call(this)||this;return s.aiDataContract={ver:r.FieldType.Required,name:r.FieldType.Required,properties:r.FieldType.Default,measurements:r.FieldType.Default},s.name=i.DataSanitizer.sanitizeString(t)||a.Util.NotSpecified,s.properties=i.DataSanitizer.sanitizeProperties(n),s.measurements=i.DataSanitizer.sanitizeMeasurements(o),s}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t}(n.EventData);t.Event=s}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(30),n(3),n(1),n(31),n(2)],void 0===(r=function(e,t,n,i,r,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(t,n,o,l,c,u){var p=e.call(this)||this;p.aiDataContract={ver:r.FieldType.Required,metrics:r.FieldType.Required,properties:r.FieldType.Default};var d=new a.DataPoint;return d.count=o>0?o:void 0,d.max=isNaN(c)||null===c?void 0:c,d.min=isNaN(l)||null===l?void 0:l,d.name=i.DataSanitizer.sanitizeString(t)||s.Util.NotSpecified,d.value=n,p.metrics=[d],p.properties=i.DataSanitizer.sanitizeProperties(u),p}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t}(n.MetricData);t.Metric=l}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.metrics=[],t.properties={},t}return o(t,e),t}(n.Domain);t.MetricData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(32),n(1)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.aiDataContract={name:i.FieldType.Required,kind:i.FieldType.Default,value:i.FieldType.Required,count:i.FieldType.Default,min:i.FieldType.Default,max:i.FieldType.Default,stdDev:i.FieldType.Default},t}return o(t,e),t}(n.DataPoint);t.DataPoint=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(33)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(){this.kind=n.DataPointType.Measurement}}();t.DataPoint=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Measurement=0]="Measurement",e[e.Aggregation=1]="Aggregation"}(t.DataPointType||(t.DataPointType={}))}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(7),n(3),n(1),n(2)],void 0===(r=function(e,t,n,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t,n,o,s,l,c){var u=e.call(this)||this;return u.aiDataContract={ver:r.FieldType.Required,name:r.FieldType.Default,url:r.FieldType.Default,duration:r.FieldType.Default,properties:r.FieldType.Default,measurements:r.FieldType.Default,id:r.FieldType.Default},u.id=i.DataSanitizer.sanitizeId(c),u.url=i.DataSanitizer.sanitizeUrl(n),u.name=i.DataSanitizer.sanitizeString(t)||a.Util.NotSpecified,isNaN(o)||(u.duration=a.Util.msToTimeSpan(o)),u.properties=i.DataSanitizer.sanitizeProperties(s),u.measurements=i.DataSanitizer.sanitizeMeasurements(l),u}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t}(n.PageViewData);t.PageView=s}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(3),n(1),n(2),n(2),n(36)],void 0===(r=function(e,t,n,i,r,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(t,o,s,l,c,u,p,d,f){var g=e.call(this)||this;g.aiDataContract={id:i.FieldType.Required,ver:i.FieldType.Required,name:i.FieldType.Default,resultCode:i.FieldType.Default,duration:i.FieldType.Default,success:i.FieldType.Default,data:i.FieldType.Default,target:i.FieldType.Default,type:i.FieldType.Default,properties:i.FieldType.Default,measurements:i.FieldType.Default,kind:i.FieldType.Default,value:i.FieldType.Default,count:i.FieldType.Default,min:i.FieldType.Default,max:i.FieldType.Default,stdDev:i.FieldType.Default,dependencyKind:i.FieldType.Default,dependencySource:i.FieldType.Default,commandName:i.FieldType.Default,dependencyTypeName:i.FieldType.Default},g.id=t,g.duration=r.Util.msToTimeSpan(l),g.success=c,g.resultCode=u+"",g.type="Ajax",g.data=n.DataSanitizer.sanitizeUrl(s);var h=a.AjaxHelper.ParseDependencyPath(o,p,s);return g.target=h.target,g.name=h.name,g.properties=n.DataSanitizer.sanitizeProperties(d),g.measurements=n.DataSanitizer.sanitizeMeasurements(f),g}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t}(s.RemoteDependencyData);t.RemoteDependencyData=l}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.success=!0,t.properties={},t.measurements={},t}return o(t,e),t}(n.Domain);t.RemoteDependencyData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(38),n(3),n(1),n(2)],void 0===(r=function(e,t,n,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t,n,o){var s=e.call(this)||this;return s.aiDataContract={ver:r.FieldType.Required,message:r.FieldType.Required,severityLevel:r.FieldType.Default,properties:r.FieldType.Default},t=t||a.Util.NotSpecified,s.message=i.DataSanitizer.sanitizeMessage(t),s.properties=i.DataSanitizer.sanitizeProperties(n),o&&(s.severityLevel=o),s}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t}(n.MessageData);t.Trace=s}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t}return o(t,e),t}(n.Domain);t.MessageData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(40),n(1),n(3),n(2),n(6)],void 0===(r=function(e,t,n,i,r,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(n,o,l,c,u){var p=e.call(this)||this;p.aiDataContract={ver:i.FieldType.Required,name:i.FieldType.Default,url:i.FieldType.Default,duration:i.FieldType.Default,perfTotal:i.FieldType.Default,networkConnect:i.FieldType.Default,sentRequest:i.FieldType.Default,receivedResponse:i.FieldType.Default,domProcessing:i.FieldType.Default,properties:i.FieldType.Default,measurements:i.FieldType.Default},p.isValid=!1;var d=t.getPerformanceTiming();if(d){var f=t.getDuration(d.navigationStart,d.loadEventEnd),g=t.getDuration(d.navigationStart,d.connectEnd),h=t.getDuration(d.requestStart,d.responseStart),v=t.getDuration(d.responseStart,d.responseEnd),y=t.getDuration(d.responseEnd,d.loadEventEnd);0==f?s._InternalLogging.throwInternal(i.LoggingSeverity.WARNING,i._InternalMessageId.ErrorPVCalc,"error calculating page view performance.",{total:f,network:g,request:h,response:v,dom:y}):t.shouldCollectDuration(f,g,h,v,y)?f0&&e.navigationStart>0&&e.responseStart>0&&e.requestStart>0&&e.loadEventEnd>0&&e.responseEnd>0&&e.connectEnd>0&&e.domLoading>0},t.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},t.shouldCollectDuration=function(){for(var e=[],n=0;n=t.MAX_DURATION_ALLOWED)return!1;return!0},t.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",t.dataType="PageviewPerformanceData",t.MAX_DURATION_ALLOWED=36e5,t}(n.PageViewPerfData);t.PageViewPerformance=l}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(7)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return o(t,e),t}(n.PageViewData);t.PageViewPerfData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(9),n(1)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function t(t,n){var r=e.call(this)||this;return r.aiDataContract={baseType:i.FieldType.Required,baseData:i.FieldType.Required},r.baseType=t,r.baseData=n,r}return o(t,e),t}(n.Data);t.Data=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Verbose=0]="Verbose",e[e.Information=1]="Information",e[e.Warning=2]="Warning",e[e.Error=3]="Error",e[e.Critical=4]="Critical"}(t.SeverityLevel||(t.SeverityLevel={}))}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"}}();t.ContextTagKeys=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r;i=[n,t,n(12),n(13),n(14),n(15)],void 0===(r=function(e,t,n,i,r,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){this._extensions=new Array}return e.prototype.initialize=function(e,t){var n=this;if(!t||0===t.length)throw Error("At least one extension channel is required");if(!e||r.CoreUtils.isNullOrUndefined(e.instrumentationKey))throw Error("Please provide instrumentation key");this.config=e,this._notificationManager=new o.NotificationManager,this.config.extensions=this.config.extensions?this.config.extensions:{},this.config.extensions.NotificationManager=this._notificationManager,t.forEach(function(e){if(r.CoreUtils.isNullOrUndefined(e.initialize))throw Error("Extensions must provide callback to initialize")}),this._extensions=t.sort(function(e,t){var n=e,i=t,r=typeof n.processTelemetry,o=typeof i.processTelemetry;return"function"===r&&"function"===o?n.priority>i.priority?1:-1:"function"===r&&"function"!==o?1:"function"!==r&&"function"===o?-1:void 0});for(var i=0;i=n.MinChannelPriorty)return this._extensions[e]}throw new Error("No channel extension found")},e.prototype.track=function(e){if(null===e)throw this._notifiyInvalidEvent(e),Error("Invalid telemetry item");if(e.baseData&&!e.baseType)throw this._notifiyInvalidEvent(e),Error("Provide data.baseType for data.baseData");this._validateTelmetryItem(e),e.instrumentationKey||(e.instrumentationKey=this.config.instrumentationKey);for(var t=0;tthis._config.maxBatchSizeInBytes()&&this.triggerSend(),this._buffer.enqueue(i),this._setupTimer()}catch(e){d._InternalLogging.throwInternal(d.LoggingSeverity.WARNING,d._InternalMessageId.FailedAddingTelemetryToBuffer,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+d.Util.getExceptionName(e),{exception:d.Util.dump(e)})}f.CoreUtils.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(t)},e.prototype.setNextPlugin=function(e){this._nextPlugin=e},e.prototype._xhrReadyStateChange=function(e,t,n){if(4===e.readyState){var i=null;this._appId||(i=this._parseResponse(e.responseText||e.response))&&i.appId&&(this._appId=i.appId),(e.status<200||e.status>=300)&&0!==e.status?!this._config.isRetryDisabled()&&this._isRetriable(e.status)?(this._resendPayload(t),d._InternalLogging.throwInternal(d.LoggingSeverity.WARNING,d._InternalMessageId.TransmissionFailed,". Response code "+e.status+". Will retry to send "+t.length+" items.")):this._onError(t,this._formatErrorMessageXhr(e)):206===e.status?(i||(i=this._parseResponse(e.responseText||e.response)),i&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,i):this._onError(t,this._formatErrorMessageXhr(e))):(this._consecutiveErrors=0,this._onSuccess(t,n))}},e.prototype.triggerSend=function(e){void 0===e&&(e=!0);try{if(this._config.disableTelemetry())this._buffer.clear();else{if(this._buffer.count()>0){var t=this._buffer.getItems();this._sender(t,e)}this._lastSend=+new Date}clearTimeout(this._timeoutHandle),this._timeoutHandle=null,this._retryAt=null}catch(e){(!d.Util.getIEVersion()||d.Util.getIEVersion()>9)&&d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.TransmissionFailed,"Telemetry transmission failed, some telemetry will be lost: "+d.Util.getExceptionName(e),{exception:d.Util.dump(e)})}},e.prototype._onError=function(e,t,n){d._InternalLogging.throwInternal(d.LoggingSeverity.WARNING,d._InternalMessageId.OnError,"Failed to send telemetry.",{message:t}),this._buffer.clearSent(e)},e.prototype._onPartialSuccess=function(e,t){for(var n=[],i=[],r=0,o=t.errors.reverse();r0&&this._onSuccess(e,t.itemsAccepted),n.length>0&&this._onError(n,this._formatErrorMessageXhr(null,["partial success",t.itemsAccepted,"of",t.itemsReceived].join(" "))),i.length>0&&(this._resendPayload(i),d._InternalLogging.throwInternal(d.LoggingSeverity.WARNING,d._InternalMessageId.TransmissionFailed,"Partial success. Delivered: "+e.length+", Failed: "+n.length+". Will retry to send "+i.length+" our of "+t.itemsReceived+" items"))},e.prototype._onSuccess=function(e,t){this._buffer.clearSent(e)},e.prototype._xdrOnLoad=function(e,t){if(!e||e.responseText+""!="200"&&""!==e.responseText){var n=this._parseResponse(e.responseText);n&&n.itemsReceived&&n.itemsReceived>n.itemsAccepted&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,n):this._onError(t,this._formatErrorMessageXdr(e))}else this._consecutiveErrors=0,this._onSuccess(t,0)},e._constructEnvelope=function(e){switch(e.baseType){case d.Event.dataType:return i.EventEnvelopeCreator.EventEnvelopeCreator.Create(e);case d.Trace.dataType:return i.TraceEnvelopeCreator.TraceEnvelopeCreator.Create(e);case d.PageView.dataType:return i.PageViewEnvelopeCreator.PageViewEnvelopeCreator.Create(e);case d.PageViewPerformance.dataType:return i.PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator.Create(e);case d.Exception.dataType:return i.ExceptionEnvelopeCreator.ExceptionEnvelopeCreator.Create(e);case d.Metric.dataType:return i.MetricEnvelopeCreator.MetricEnvelopeCreator.Create(e);case d.RemoteDependencyData.dataType:return i.DependencyEnvelopeCreator.DependencyEnvelopeCreator.Create(e);default:return null}},e._getDefaultAppInsightsChannelConfig=function(e,t){var n={},i=e.extensions&&e.extensions[t]?e.extensions[t]:{};return n.endpointUrl=function(){return e.endpointUrl||"https://dc.services.visualstudio.com/v2/track"},n.emitLineDelimitedJson=function(){return d.Util.stringToBoolOrDefault(i.emitLineDelimitedJson)},n.maxBatchInterval=function(){return isNaN(i.maxBatchInterval)?15e3:i.maxBatchInterval},n.maxBatchSizeInBytes=function(){return i.maxBatchSizeInBytes>0?i.maxBatchSizeInBytes:102400},n.disableTelemetry=function(){return d.Util.stringToBoolOrDefault(i.disableTelemetry)},n.enableSessionStorageBuffer=function(){return d.Util.stringToBoolOrDefault(i.enableSessionStorageBuffer,!0)},n.isRetryDisabled=function(){return d.Util.stringToBoolOrDefault(i.isRetryDisabled)},n.isBeaconApiDisabled=function(){return d.Util.stringToBoolOrDefault(i.isBeaconApiDisabled,!0)},n},e._validate=function(e){switch(e.baseType){case d.Event.dataType:return r.EventValidator.EventValidator.Validate(e);case d.Trace.dataType:return o.TraceValidator.TraceValidator.Validate(e);case d.Exception.dataType:return a.ExceptionValidator.ExceptionValidator.Validate(e);case d.Metric.dataType:return s.MetricValidator.MetricValidator.Validate(e);case d.PageView.dataType:return c.PageViewValidator.PageViewValidator.Validate(e);case d.PageViewPerformance.dataType:return l.PageViewPerformanceValidator.PageViewPerformanceValidator.Validate(e);case d.RemoteDependencyData.dataType:return u.RemoteDepdencyValidator.RemoteDepdencyValidator.Validate(e)}return!1},e.prototype._beaconSender=function(e,t){var n=this._config.endpointUrl(),i=this._buffer.batchPayloads(e),r=new Blob([i],{type:"text/plain;charset=UTF-8"});navigator.sendBeacon(n,r)?this._buffer.markAsSent(e):d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.TransmissionFailed,". Failed to send telemetry with Beacon API.")},e.prototype._xhrSender=function(e,t){var n=this,i=new XMLHttpRequest;i[d.DisabledPropertyName]=!0,i.open("POST",this._config.endpointUrl(),t),i.setRequestHeader("Content-type","application/json"),d.Util.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())&&i.setRequestHeader(d.RequestHeaders.sdkContextHeader,d.RequestHeaders.sdkContextHeaderAppIdRequest),i.onreadystatechange=function(){return n._xhrReadyStateChange(i,e,e.length)},i.onerror=function(t){return n._onError(e,n._formatErrorMessageXhr(i),t)};var r=this._buffer.batchPayloads(e);i.send(r),this._buffer.markAsSent(e)},e.prototype._parseResponse=function(e){try{if(e&&""!==e){var t=JSON.parse(e);if(t&&t.itemsReceived&&t.itemsReceived>=t.itemsAccepted&&t.itemsReceived-t.itemsAccepted==t.errors.length)return t}}catch(t){d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.InvalidBackendResponse,"Cannot parse the response. "+d.Util.getExceptionName(t),{response:e})}return null},e.prototype._resendPayload=function(e){if(e&&0!==e.length){this._buffer.clearSent(e),this._consecutiveErrors++;for(var t=0,n=e;t0?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},e.prototype.markAsSent=function(e){this.clear()},e.prototype.clearSent=function(e){},e}();t.ArraySendBuffer=i;var r=function(){function e(t){this._bufferFullMessageSent=!1,this._config=t;var n=this.getBuffer(e.BUFFER_KEY),i=this.getBuffer(e.SENT_BUFFER_KEY);this._buffer=n.concat(i),this._buffer.length>e.MAX_BUFFER_SIZE&&(this._buffer.length=e.MAX_BUFFER_SIZE),this.setBuffer(e.SENT_BUFFER_KEY,[]),this.setBuffer(e.BUFFER_KEY,this._buffer)}return e.prototype.enqueue=function(t){this._buffer.length>=e.MAX_BUFFER_SIZE?this._bufferFullMessageSent||(n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.SessionStorageBufferFull,"Maximum buffer size reached: "+this._buffer.length,!0),this._bufferFullMessageSent=!0):(this._buffer.push(t),this.setBuffer(e.BUFFER_KEY,this._buffer))},e.prototype.count=function(){return this._buffer.length},e.prototype.clear=function(){this._buffer.length=0,this.setBuffer(e.BUFFER_KEY,[]),this.setBuffer(e.SENT_BUFFER_KEY,[]),this._bufferFullMessageSent=!1},e.prototype.getItems=function(){return this._buffer.slice(0)},e.prototype.batchPayloads=function(e){return e&&e.length>0?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},e.prototype.markAsSent=function(t){this._buffer=this.removePayloadsFromBuffer(t,this._buffer),this.setBuffer(e.BUFFER_KEY,this._buffer);var i=this.getBuffer(e.SENT_BUFFER_KEY);i instanceof Array&&t instanceof Array&&((i=i.concat(t)).length>e.MAX_BUFFER_SIZE&&(n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.SessionStorageBufferFull,"Sent buffer reached its maximum size: "+i.length,!0),i.length=e.MAX_BUFFER_SIZE),this.setBuffer(e.SENT_BUFFER_KEY,i))},e.prototype.clearSent=function(t){var n=this.getBuffer(e.SENT_BUFFER_KEY);n=this.removePayloadsFromBuffer(t,n),this.setBuffer(e.SENT_BUFFER_KEY,n)},e.prototype.removePayloadsFromBuffer=function(e,t){var n=[];for(var i in t){var r=!1;for(var o in e)if(e[o]===t[i]){r=!0;break}r||n.push(t[i])}return n},e.prototype.getBuffer=function(e){try{var t=n.Util.getSessionStorage(e);if(t){var i=JSON.parse(t);if(i)return i}}catch(t){n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.FailedToRestoreStorageBuffer," storage key: "+e+", "+n.Util.getExceptionName(t),{exception:n.Util.dump(t)})}return[]},e.prototype.setBuffer=function(e,t){try{var i=JSON.stringify(t);n.Util.setSessionStorage(e,i)}catch(t){n.Util.setSessionStorage(e,JSON.stringify([])),n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.FailedToSetStorageBuffer," storage key: "+e+", "+n.Util.getExceptionName(t)+". Buffer cleared",{exception:n.Util.dump(t)})}},e.BUFFER_KEY="AI_buffer",e.SENT_BUFFER_KEY="AI_sentBuffer",e.MAX_BUFFER_SIZE=2e3,e}();t.SessionStorageSendBuffer=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(0),n(4)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextTagKeys=["ai.application.ver","ai.application.build","ai.application.typeId","ai.application.applicationId","ai.application.layer","ai.device.id","ai.device.ip","ai.device.language","ai.device.locale","ai.device.model","ai.device.friendlyName","ai.device.network","ai.device.networkName","ai.device.oemName","ai.device.os","ai.device.osVersion","ai.device.roleInstance","ai.device.roleName","ai.device.screenResolution","ai.device.type","ai.device.machineName","ai.device.vmName","ai.device.browser","ai.device.browserVersion","ai.location.ip","ai.location.country","ai.location.province","ai.location.city","ai.operation.id","ai.operation.name","ai.operation.parentId","ai.operation.rootId","ai.operation.syntheticSource","ai.operation.correlationVector","ai.session.id","ai.session.isFirst","ai.session.isNew","ai.user.accountAcquisitionDate","ai.user.accountId","ai.user.userAgent","ai.user.id","ai.user.storeRegion","ai.user.authUserId","ai.user.anonUserAcquisitionDate","ai.user.authUserAcquisitionDate","ai.cloud.name","ai.cloud.role","ai.cloud.roleVer","ai.cloud.roleInstance","ai.cloud.environment","ai.cloud.location","ai.cloud.deploymentUnit","ai.internal.sdkVersion","ai.internal.agentVersion","ai.internal.nodeName"];var r=function(){function e(){}return e.extractProperties=function(e){var t=null;for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];"number"!=typeof i&&(t||(t={}),t[n]=i)}return t},e.extractPropsAndMeasurements=function(e,t,n){if(!i.CoreUtils.isNullOrUndefined(e))for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];"number"==typeof o?n[r]=o:t[r]=o}},e.createEnvelope=function(e,i,r){var o=new n.Envelope(r,e);o.iKey=i.instrumentationKey;var a=i.instrumentationKey.replace(/-/g,"");for(var s in o.name=o.name.replace("{0}",a),i.ctx)i.ctx.hasOwnProperty(s)&&t.ContextTagKeys.indexOf(s)>=0&&(o.tags[s]=i.ctx[s]);return i.tags.forEach(function(e){for(var n in e)e.hasOwnProperty(n)&&t.ContextTagKeys.indexOf(n)>=0&&(o.tags[n]=e[n])}),o},e}();t.EnvelopeCreator=r;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,o,t);var a=e.baseData.id,s=e.baseData.absoluteUrl,l=e.baseData.command,c=e.baseData.totalTime,u=e.baseData.success,p=e.baseData.resultCode,d=e.baseData.method,f=new n.RemoteDependencyData(a,s,l,c,u,p,d,o,t),g=new n.Data(n.RemoteDependencyData.dataType,f);return r.createEnvelope(n.RemoteDependencyData.envelopeType,e,g)},t.DependencyEnvelopeCreator=new t,t}(r);t.DependencyEnvelopeCreator=a;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,t,o);var a=e.baseData.name,s=new n.Event(a,t,o),l=new n.Data(n.Event.dataType,s);return r.createEnvelope(n.Event.envelopeType,e,l)},t.EventEnvelopeCreator=new t,t}(r);t.EventEnvelopeCreator=s;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,t,o);var a=e.baseData.exception,s=e.baseData.severityLevel,l=new n.Exception(a,t,o,s),c=new n.Data(n.Exception.dataType,l);return r.createEnvelope(n.Exception.envelopeType,e,c)},t.ExceptionEnvelopeCreator=new t,t}(r);t.ExceptionEnvelopeCreator=l;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t=r.extractProperties(e.data),o=e.baseData.name,a=e.baseData.average,s=e.baseData.sampleCount,l=e.baseData.min,c=e.baseData.max,u=new n.Metric(o,a,s,l,c,t),p=new n.Data(n.Metric.dataType,u);return r.createEnvelope(n.Metric.envelopeType,e,p)},t.MetricEnvelopeCreator=new t,t}(r);t.MetricEnvelopeCreator=c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,t,o);var a=e.baseData.name,s=e.baseData.uri,l=e.baseData.duration;if(i.CoreUtils.isNullOrUndefined(e.baseData.refUri)||(t.refUri=e.baseData.refUri),i.CoreUtils.isNullOrUndefined(e.baseData.pageType)||(t.pageType=e.baseData.pageType),i.CoreUtils.isNullOrUndefined(e.baseData.isLoggedIn)||(t.isLoggedIn=e.baseData.isLoggedIn),!i.CoreUtils.isNullOrUndefined(e.baseData.pageTags)){var c=e.baseData.pageTags;for(var u in c)c.hasOwnProperty(u)&&(t[u]=c[u])}var p=new n.PageView(a,s,l,t,o),d=new n.Data(n.PageView.dataType,p);return r.createEnvelope(n.PageView.envelopeType,e,d)},t.PageViewEnvelopeCreator=new t,t}(r);t.PageViewEnvelopeCreator=u;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,t,o);var a=e.baseData.name,s=e.baseData.uri,l=e.baseData.duration,c=new n.PageViewPerformance(a,s,l,t,o),u=new n.Data(n.PageViewPerformance.dataType,c);return r.createEnvelope(n.PageViewPerformance.envelopeType,e,u)},t.PageViewPerformanceEnvelopeCreator=new t,t}(r);t.PageViewPerformanceEnvelopeCreator=p;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t=e.baseData.message,o=e.baseData.severityLevel,a=r.extractProperties(e.data),s=new n.Trace(t,a,o),l=new n.Data(n.Trace.dataType,s);return r.createEnvelope(n.Trace.envelopeType,e,l)},t.TraceEnvelopeCreator=new t,t}(r);t.TraceEnvelopeCreator=d}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.EventValidator=new e,e}();t.EventValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.TraceValidator=new e,e}();t.TraceValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e._validateExceptions=function(e){return!0},e.ExceptionValidator=new e,e}();t.ExceptionValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.PageViewPerformanceValidator=new e,e}();t.PageViewPerformanceValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.PageViewValidator=new e,e}();t.PageViewValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.RemoteDepdencyValidator=new e,e}();t.RemoteDepdencyValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r;i=[n,t,n(0)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.serialize=function(t){var n=e._serializeObject(t,"root");return JSON.stringify(n)},e._serializeObject=function(t,i){var r={};if(!t)return n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.CannotSerializeObject,"cannot serialize object because it is null or undefined",{name:i},!0),r;if(t.__aiCircularRefCheck)return n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.CircularReferenceDetected,"Circular reference detected while serializing object",{name:i},!0),r;if(!t.aiDataContract){if("measurements"===i)r=e._serializeStringMap(t,"number",i);else if("properties"===i)r=e._serializeStringMap(t,"string",i);else if("tags"===i)r=e._serializeStringMap(t,"string",i);else if(n.Util.isArray(t))r=e._serializeArray(t,i);else{n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.CannotSerializeObjectNonSerializable,"Attempting to serialize an object which does not implement ISerializable",{name:i},!0);try{JSON.stringify(t),r=t}catch(e){n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.CannotSerializeObject,e&&"function"==typeof e.toString?e.toString():"Error serializing object",null,!0)}}return r}for(var o in t.__aiCircularRefCheck=!0,t.aiDataContract){var a,s=t.aiDataContract[o],l="function"==typeof s?s()&n.FieldType.Required:s&n.FieldType.Required,c="function"==typeof s?s()&n.FieldType.Hidden:s&n.FieldType.Hidden,u=s&n.FieldType.Array,p=void 0!==t[o],d="object"==typeof t[o]&&null!==t[o];if(!l||p||u){if(!c)void 0!==(a=d?u?e._serializeArray(t[o],o):e._serializeObject(t[o],o):t[o])&&(r[o]=a)}else n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.MissingRequiredFieldSpecification,"Missing required field specification. The field is required but not present on source",{field:o,name:i})}return delete t.__aiCircularRefCheck,r},e._serializeArray=function(t,i){var r=void 0;if(t)if(n.Util.isArray(t)){r=[];for(var o=0;o6e4&&(clearInterval(p),s||(e.duration=6e4,r.appInsights.sendPageViewInternal(e,t),r._channel.flush()))}catch(e){n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TrackPVFailedCalc,"trackPageView failed on page load calculation: "+n.Util.getExceptionName(e),{exception:n.Util.dump(e)})}},100)},e}();t.PageViewManager=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(0),n(59),n(60),n(61),n(58),n(62),n(63),n(66),n(67),n(4)],void 0===(r=function(e,t,n,i,r,o,a,s,l,c,u,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var d=function(){function e(e,t){this._config=e,this._core=t,this._telemetryInitializers=[],"undefined"!=typeof window&&(this._sessionManager=new u._SessionManager(e),this.application=new i.Application,this.device=new r.Device,this.internal=new o.Internal(e),this.location=new a.Location,this.user=new c.User(e),this.operation=new s.Operation,this.session=new u.Session,this.sample=new l.Sample(e.sampleRate())),this._addDefaultTelemetryInitializers()}return e.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},e.prototype.track=function(e){return p.CoreUtils.isNullOrUndefined(e)?n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TrackArgumentsNotSpecified,"cannot call .track() with a null or undefined argument",null,!0):(e.name===n.PageView.envelopeType&&n._InternalLogging.resetInternalMessageCount(),this.session&&"string"!=typeof this.session.id&&this._sessionManager.update(),this._track(e)),e},e.prototype._addDefaultTelemetryInitializers=function(){if(!this._config.isBrowserLinkTrackingEnabled()){var e=["/browserLinkSignalR/","/__browserLink/"];this.addTelemetryInitializer(function(t){if(t.name===n.RemoteDependencyData.envelopeType){var i=t.data;if(i&&i.baseData)for(var r=0;r=0)return!1}return!0})}},e.prototype._track=function(e){var t={};this.session&&("string"==typeof this.session.id?this._applySessionContext(t,this.session):this._applySessionContext(t,this._sessionManager.automaticSession)),this._applyApplicationContext(t,this.application),this._applyDeviceContext(t,this.device),this._applyInternalContext(t,this.internal),this._applyLocationContext(t,this.location),this._applySampleContext(t,this.sample),this._applyUserContext(t,this.user),this._applyOperationContext(t,this.operation),e.tags.push(t),e.instrumentationKey=this._config.instrumentationKey();var i=!1;try{for(var r=this._telemetryInitializers.length,o=0;o100||e<0)&&(i._InternalLogging.throwInternal(i.LoggingSeverity.WARNING,i._InternalMessageId.SampleRateOutOfRange,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),this.sampleRate=100),this.sampleRate=e,this.samplingScoreGenerator=new n.SamplingScoreGenerator}return e.prototype.isSampledIn=function(e){return!0},e}();t.Sample=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(65),n(0)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.hashCodeGeneragor=new n.HashCodeScoreGenerator}return e.prototype.getSamplingScore=function(e){var t=new i.ContextTagKeys;return e.tags[t.userId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[t.userId]):e.tags[t.operationId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[t.operationId]):Math.random()},e}();t.SamplingScoreGenerator=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.getHashCodeScore=function(t){return 100*(this.getHashCode(t)/e.INT_MAX_VALUE)},e.prototype.getHashCode=function(t){if(""==t)return 0;for(;t.length0&&(this.id=r[0])}if(this.config=t,!this.id){this.id=n.Util.newId();var o=new Date,a=n.Util.toISOStringForIE8(o);this.accountAcquisitionDate=a,o.setTime(o.getTime()+31536e6);var s=[this.id,a],l=this.config.cookieDomain?this.config.cookieDomain():void 0;n.Util.setCookie(e.userCookieName,s.join(e.cookieSeparator)+";expires="+o.toUTCString(),l),n.Util.removeStorage("ai_session")}this.accountId=t.accountId?t.accountId():void 0;var c=n.Util.getCookie(e.authUserCookieName);if(c){var u=(c=decodeURI(c)).split(e.cookieSeparator);u[0]&&(this.authenticatedId=u[0]),u.length>1&&u[1]&&(this.accountId=u[1])}}return e.prototype.setAuthenticatedUserContext=function(t,i,r){if(void 0===r&&(r=!1),!this.validateUserInput(t)||i&&!this.validateUserInput(i))n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.SetAuthContextFailedAccountName,"Setting auth user context failed. User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.",!0);else{this.authenticatedId=t;var o=this.authenticatedId;i&&(this.accountId=i,o=[this.authenticatedId,this.accountId].join(e.cookieSeparator)),r&&n.Util.setCookie(e.authUserCookieName,encodeURI(o),this.config.cookieDomain())}},e.prototype.clearAuthenticatedUserContext=function(){this.authenticatedId=null,this.accountId=null,n.Util.deleteCookie(e.authUserCookieName)},e.prototype.validateUserInput=function(e){return!("string"!=typeof e||!e||e.match(/,|;|=| |\|/))},e.cookieSeparator="|",e.userCookieName="ai_user",e.authUserCookieName="ai_authUser",e}();t.User=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(0),n(68)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(){}}();t.Session=r;var o=function(){function e(t){t||(t={}),"function"!=typeof t.sessionExpirationMs&&(t.sessionExpirationMs=function(){return e.acquisitionSpan}),"function"!=typeof t.sessionRenewalMs&&(t.sessionRenewalMs=function(){return e.renewalSpan}),this.config=t,this.automaticSession=new r}return e.prototype.update=function(){this.automaticSession.id||this.initializeAutomaticSession();var t=i.dateTime.Now(),n=t-this.automaticSession.acquisitionDate>this.config.sessionExpirationMs(),r=t-this.automaticSession.renewalDate>this.config.sessionRenewalMs();n||r?(this.automaticSession.isFirst=void 0,this.renew()):(!this.cookieUpdatedTimestamp||t-this.cookieUpdatedTimestamp>e.cookieUpdateInterval)&&(this.automaticSession.renewalDate=t,this.setCookie(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate))},e.prototype.backup=function(){this.setStorage(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate)},e.prototype.initializeAutomaticSession=function(){var e=n.Util.getCookie("ai_session");if(e&&"function"==typeof e.split)this.initializeAutomaticSessionWithData(e);else{var t=n.Util.getStorage("ai_session");t&&this.initializeAutomaticSessionWithData(t)}this.automaticSession.id||(this.automaticSession.isFirst=!0,this.renew())},e.prototype.initializeAutomaticSessionWithData=function(e){var t=e.split("|");t.length>0&&(this.automaticSession.id=t[0]);try{if(t.length>1){var i=+t[1];this.automaticSession.acquisitionDate=+new Date(i),this.automaticSession.acquisitionDate=this.automaticSession.acquisitionDate>0?this.automaticSession.acquisitionDate:0}if(t.length>2){var r=+t[2];this.automaticSession.renewalDate=+new Date(r),this.automaticSession.renewalDate=this.automaticSession.renewalDate>0?this.automaticSession.renewalDate:0}}catch(e){n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.ErrorParsingAISessionCookie,"Error parsing ai_session cookie, session will be reset: "+n.Util.getExceptionName(e),{exception:n.Util.dump(e)})}0==this.automaticSession.renewalDate&&n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.SessionRenewalDateIsZero,"AI session renewal date is 0, session will be reset.")},e.prototype.renew=function(){var e=i.dateTime.Now();this.automaticSession.id=n.Util.newId(),this.automaticSession.acquisitionDate=e,this.automaticSession.renewalDate=e,this.setCookie(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate),n.Util.canUseLocalStorage()||n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserDoesNotSupportLocalStorage,"Browser does not support local storage. Session durations will be inaccurate.")},e.prototype.setCookie=function(e,t,r){var o=t+this.config.sessionExpirationMs(),a=r+this.config.sessionRenewalMs(),s=new Date,l=[e,t,r];o=100)&&(n.samplingPercentage=100),n.disableAjaxTracking=r.Util.stringToBoolOrDefault(n.disableAjaxTracking),n.maxAjaxCallsPerView=isNaN(n.maxAjaxCallsPerView)?500:n.maxAjaxCallsPerView,n.disableCorrelationHeaders=r.Util.stringToBoolOrDefault(n.disableCorrelationHeaders),n.correlationHeaderExcludedDomains=n.correlationHeaderExcludedDomains||["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],n.disableFlushOnBeforeUnload=r.Util.stringToBoolOrDefault(n.disableFlushOnBeforeUnload),n.isCookieUseDisabled=r.Util.stringToBoolOrDefault(n.isCookieUseDisabled),n.isStorageUseDisabled=r.Util.stringToBoolOrDefault(n.isStorageUseDisabled),n.isBrowserLinkTrackingEnabled=r.Util.stringToBoolOrDefault(n.isBrowserLinkTrackingEnabled),n.enableCorsCorrelation=r.Util.stringToBoolOrDefault(n.enableCorsCorrelation),e},e}();t.Initialization=a}.apply(t,i))||(e.exports=r)}])}); //# sourceMappingURL=aisdk.0.0.8.js.map ================================================ FILE: AISKU/dist-history/aisdk.min.0.0.8.js ================================================ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(window,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=19)}([function(e,t,n){var i,r;i=[n,t,n(2),n(1),n(6),n(8),n(25),n(9),n(10),n(26),n(28),n(21),n(29),n(34),n(7),n(35),n(37),n(39),n(41),n(42),n(43),n(3)],void 0===(r=function(e,t,n,i,r,o,a,s,l,c,u,p,d,f,g,h,v,y,_,m,I,S){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=n.Util,t.CorrelationIdHelper=n.CorrelationIdHelper,t.UrlHelper=n.UrlHelper,t._InternalMessageId=i._InternalMessageId,t.LoggingSeverity=i.LoggingSeverity,t.FieldType=i.FieldType,t._InternalLogging=r._InternalLogging,t._InternalLogMessage=r._InternalLogMessage,t.RequestHeaders=o.RequestHeaders,t.DisabledPropertyName=a.DisabledPropertyName,t.AIData=s.Data,t.AIBase=l.Base,t.Envelope=c.Envelope,t.Event=u.Event,t.Exception=p.Exception,t.Metric=d.Metric,t.PageView=f.PageView,t.PageViewData=g.PageViewData,t.RemoteDependencyData=h.RemoteDependencyData,t.Trace=v.Trace,t.PageViewPerformance=y.PageViewPerformance,t.Data=_.Data,t.SeverityLevel=m.SeverityLevel,t.ContextTagKeys=I.ContextTagKeys,t.DataSanitizer=S.DataSanitizer}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.CRITICAL=0]="CRITICAL",e[e.WARNING=1]="WARNING"}(t.LoggingSeverity||(t.LoggingSeverity={})),function(e){e[e.BrowserDoesNotSupportLocalStorage=0]="BrowserDoesNotSupportLocalStorage",e[e.BrowserCannotReadLocalStorage=1]="BrowserCannotReadLocalStorage",e[e.BrowserCannotReadSessionStorage=2]="BrowserCannotReadSessionStorage",e[e.BrowserCannotWriteLocalStorage=3]="BrowserCannotWriteLocalStorage",e[e.BrowserCannotWriteSessionStorage=4]="BrowserCannotWriteSessionStorage",e[e.BrowserFailedRemovalFromLocalStorage=5]="BrowserFailedRemovalFromLocalStorage",e[e.BrowserFailedRemovalFromSessionStorage=6]="BrowserFailedRemovalFromSessionStorage",e[e.CannotSendEmptyTelemetry=7]="CannotSendEmptyTelemetry",e[e.ClientPerformanceMathError=8]="ClientPerformanceMathError",e[e.ErrorParsingAISessionCookie=9]="ErrorParsingAISessionCookie",e[e.ErrorPVCalc=10]="ErrorPVCalc",e[e.ExceptionWhileLoggingError=11]="ExceptionWhileLoggingError",e[e.FailedAddingTelemetryToBuffer=12]="FailedAddingTelemetryToBuffer",e[e.FailedMonitorAjaxAbort=13]="FailedMonitorAjaxAbort",e[e.FailedMonitorAjaxDur=14]="FailedMonitorAjaxDur",e[e.FailedMonitorAjaxOpen=15]="FailedMonitorAjaxOpen",e[e.FailedMonitorAjaxRSC=16]="FailedMonitorAjaxRSC",e[e.FailedMonitorAjaxSend=17]="FailedMonitorAjaxSend",e[e.FailedMonitorAjaxGetCorrelationHeader=18]="FailedMonitorAjaxGetCorrelationHeader",e[e.FailedToAddHandlerForOnBeforeUnload=19]="FailedToAddHandlerForOnBeforeUnload",e[e.FailedToSendQueuedTelemetry=20]="FailedToSendQueuedTelemetry",e[e.FailedToReportDataLoss=21]="FailedToReportDataLoss",e[e.FlushFailed=22]="FlushFailed",e[e.MessageLimitPerPVExceeded=23]="MessageLimitPerPVExceeded",e[e.MissingRequiredFieldSpecification=24]="MissingRequiredFieldSpecification",e[e.NavigationTimingNotSupported=25]="NavigationTimingNotSupported",e[e.OnError=26]="OnError",e[e.SessionRenewalDateIsZero=27]="SessionRenewalDateIsZero",e[e.SenderNotInitialized=28]="SenderNotInitialized",e[e.StartTrackEventFailed=29]="StartTrackEventFailed",e[e.StopTrackEventFailed=30]="StopTrackEventFailed",e[e.StartTrackFailed=31]="StartTrackFailed",e[e.StopTrackFailed=32]="StopTrackFailed",e[e.TelemetrySampledAndNotSent=33]="TelemetrySampledAndNotSent",e[e.TrackEventFailed=34]="TrackEventFailed",e[e.TrackExceptionFailed=35]="TrackExceptionFailed",e[e.TrackMetricFailed=36]="TrackMetricFailed",e[e.TrackPVFailed=37]="TrackPVFailed",e[e.TrackPVFailedCalc=38]="TrackPVFailedCalc",e[e.TrackTraceFailed=39]="TrackTraceFailed",e[e.TransmissionFailed=40]="TransmissionFailed",e[e.FailedToSetStorageBuffer=41]="FailedToSetStorageBuffer",e[e.FailedToRestoreStorageBuffer=42]="FailedToRestoreStorageBuffer",e[e.InvalidBackendResponse=43]="InvalidBackendResponse",e[e.FailedToFixDepricatedValues=44]="FailedToFixDepricatedValues",e[e.InvalidDurationValue=45]="InvalidDurationValue",e[e.TelemetryEnvelopeInvalid=46]="TelemetryEnvelopeInvalid",e[e.CreateEnvelopeError=47]="CreateEnvelopeError",e[e.CannotSerializeObject=48]="CannotSerializeObject",e[e.CannotSerializeObjectNonSerializable=49]="CannotSerializeObjectNonSerializable",e[e.CircularReferenceDetected=50]="CircularReferenceDetected",e[e.ClearAuthContextFailed=51]="ClearAuthContextFailed",e[e.ExceptionTruncated=52]="ExceptionTruncated",e[e.IllegalCharsInName=53]="IllegalCharsInName",e[e.ItemNotInArray=54]="ItemNotInArray",e[e.MaxAjaxPerPVExceeded=55]="MaxAjaxPerPVExceeded",e[e.MessageTruncated=56]="MessageTruncated",e[e.NameTooLong=57]="NameTooLong",e[e.SampleRateOutOfRange=58]="SampleRateOutOfRange",e[e.SetAuthContextFailed=59]="SetAuthContextFailed",e[e.SetAuthContextFailedAccountName=60]="SetAuthContextFailedAccountName",e[e.StringValueTooLong=61]="StringValueTooLong",e[e.StartCalledMoreThanOnce=62]="StartCalledMoreThanOnce",e[e.StopCalledWithoutStart=63]="StopCalledWithoutStart",e[e.TelemetryInitializerFailed=64]="TelemetryInitializerFailed",e[e.TrackArgumentsNotSpecified=65]="TrackArgumentsNotSpecified",e[e.UrlTooLong=66]="UrlTooLong",e[e.SessionStorageBufferFull=67]="SessionStorageBufferFull",e[e.CannotAccessCookie=68]="CannotAccessCookie",e[e.IdTooLong=69]="IdTooLong"}(t._InternalMessageId||(t._InternalMessageId={})),function(e){e[e.LocalStorage=0]="LocalStorage",e[e.SessionStorage=1]="SessionStorage"}(t.StorageType||(t.StorageType={})),function(e){e[e.Default=0]="Default",e[e.Required=1]="Required",e[e.Array=2]="Array",e[e.Hidden=4]="Hidden"}(t.FieldType||(t.FieldType={}))}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r;i=[n,t,n(1),n(6),n(8),n(3)],void 0===(r=function(e,t,n,i,r,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){}return e.disableStorage=function(){e._canUseLocalStorage=!1,e._canUseSessionStorage=!1},e._getLocalStorageObject=function(){return e.canUseLocalStorage()?e._getVerifiedStorageObject(n.StorageType.LocalStorage):null},e._getVerifiedStorageObject=function(e){var t,i,r=null;try{i=new Date,(r=e===n.StorageType.LocalStorage?window.localStorage:window.sessionStorage).setItem(i,i),t=r.getItem(i)!=i,r.removeItem(i),t&&(r=null)}catch(e){r=null}return r},e.isInternalApplicationInsightsEndpoint=function(t){return-1!==e._internalEndpoints.indexOf(t.toLowerCase())},e.canUseLocalStorage=function(){return void 0===e._canUseLocalStorage&&(e._canUseLocalStorage=!!e._getVerifiedStorageObject(n.StorageType.LocalStorage)),e._canUseLocalStorage},e.getStorage=function(t){var r=e._getLocalStorageObject();if(null!==r)try{return r.getItem(t)}catch(t){e._canUseLocalStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserCannotReadLocalStorage,"Browser failed read of local storage. "+e.getExceptionName(t),{exception:e.dump(t)})}return null},e.setStorage=function(t,r){var o=e._getLocalStorageObject();if(null!==o)try{return o.setItem(t,r),!0}catch(t){e._canUseLocalStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserCannotWriteLocalStorage,"Browser failed write to local storage. "+e.getExceptionName(t),{exception:e.dump(t)})}return!1},e.removeStorage=function(t){var r=e._getLocalStorageObject();if(null!==r)try{return r.removeItem(t),!0}catch(t){e._canUseLocalStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserFailedRemovalFromLocalStorage,"Browser failed removal of local storage item. "+e.getExceptionName(t),{exception:e.dump(t)})}return!1},e._getSessionStorageObject=function(){return e.canUseSessionStorage()?e._getVerifiedStorageObject(n.StorageType.SessionStorage):null},e.canUseSessionStorage=function(){return void 0===e._canUseSessionStorage&&(e._canUseSessionStorage=!!e._getVerifiedStorageObject(n.StorageType.SessionStorage)),e._canUseSessionStorage},e.getSessionStorageKeys=function(){var t=[];if(e.canUseSessionStorage())for(var n in window.sessionStorage)t.push(n);return t},e.getSessionStorage=function(t){var r=e._getSessionStorageObject();if(null!==r)try{return r.getItem(t)}catch(t){e._canUseSessionStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserCannotReadSessionStorage,"Browser failed read of session storage. "+e.getExceptionName(t),{exception:e.dump(t)})}return null},e.setSessionStorage=function(t,r){var o=e._getSessionStorageObject();if(null!==o)try{return o.setItem(t,r),!0}catch(t){e._canUseSessionStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserCannotWriteSessionStorage,"Browser failed write to session storage. "+e.getExceptionName(t),{exception:e.dump(t)})}return!1},e.removeSessionStorage=function(t){var r=e._getSessionStorageObject();if(null!==r)try{return r.removeItem(t),!0}catch(t){e._canUseSessionStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserFailedRemovalFromSessionStorage,"Browser failed removal of session storage item. "+e.getExceptionName(t),{exception:e.dump(t)})}return!1},e.disableCookies=function(){e._canUseCookies=!1},e.canUseCookies=function(){if(void 0===e._canUseCookies){e._canUseCookies=!1;try{e._canUseCookies=void 0!==e.document.cookie}catch(t){i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.CannotAccessCookie,"Cannot access document.cookie - "+e.getExceptionName(t),{exception:e.dump(t)})}}return e._canUseCookies},e.setCookie=function(t,n,i){var r="",o="";i&&(r=";domain="+i),e.document.location&&"https:"===e.document.location.protocol&&(o=";secure"),e.canUseCookies()&&(e.document.cookie=t+"="+n+r+";path=/"+o)},e.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),void 0===e||null===e?t:"true"===e.toString().toLowerCase()},e.getCookie=function(t){if(e.canUseCookies()){var n="";if(t&&t.length)for(var i=t+"=",r=e.document.cookie.split(";"),o=0;o0;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},e.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},e.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},e.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},e.toISOStringForIE8=function(t){if(e.isDate(t)){if(Date.prototype.toISOString)return t.toISOString();var n=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return t.getUTCFullYear()+"-"+n(t.getUTCMonth()+1)+"-"+n(t.getUTCDate())+"T"+n(t.getUTCHours())+":"+n(t.getUTCMinutes())+":"+n(t.getUTCSeconds())+"."+String((t.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},e.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},e.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,o=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,r=r.length<2?"0"+r:r,(o>0?o+".":"")+r+":"+i+":"+n+"."+t},e.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},e.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},e.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},e.addEventHandler=function(e,t){if(!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},e.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},e.document="undefined"!=typeof document?document:{},e._canUseCookies=void 0,e._canUseLocalStorage=void 0,e._canUseSessionStorage=void 0,e._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],e.NotSpecified="not_specified",e}();t.Util=a;var s=function(){function e(){}return e.parseUrl=function(t){return e.htmlAnchorElement||(e.htmlAnchorElement=e.document.createElement?e.document.createElement("a"):{}),e.htmlAnchorElement.href=t,e.htmlAnchorElement},e.getAbsoluteUrl=function(t){var n,i=e.parseUrl(t);return i&&(n=i.href),n},e.getPathName=function(t){var n,i=e.parseUrl(t);return i&&(n=i.pathname),n},e.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},e.document="undefined"!=typeof document?document:{},e}();t.UrlHelper=s;var l=function(){function e(){}return e.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=s.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var r=e&&e.correlationHeaderExcludedDomains;if(!r||0==r.length)return!0;for(var o=0;o0){var a=s.parseUrl(e);if(i=a.host,null!=a.pathname)"/"!==(n=0===a.pathname.length?"/":a.pathname).charAt(0)&&(n="/"+n),r=o.DataSanitizer.sanitizeString(t?t+" "+n:n);else r=o.DataSanitizer.sanitizeString(e)}else i=n,r=n;return{target:i,name:r}},e}();t.AjaxHelper=c}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(6),n(2),n(1)],void 0===(r=function(e,t,n,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.sanitizeKeyAndAddUniqueness=function(t,n){var i=t.length,r=e.sanitizeKey(t);if(r.length!==i){for(var o=0,a=r;void 0!==n[a];)o++,a=r.substring(0,e.MAX_NAME_LENGTH-3)+e.padNumber(o);r=a}return r},e.sanitizeKey=function(t){return t&&(t=i.Util.trim(t.toString())).length>e.MAX_NAME_LENGTH&&(t=t.substring(0,e.MAX_NAME_LENGTH),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,r._InternalMessageId.NameTooLong,"name is too long. It has been truncated to "+e.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},e.sanitizeString=function(t,o){return void 0===o&&(o=e.MAX_STRING_LENGTH),t&&(o=o||e.MAX_STRING_LENGTH,(t=i.Util.trim(t)).toString().length>o&&(t=t.toString().substring(0,o),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,r._InternalMessageId.StringValueTooLong,"string value is too long. It has been truncated to "+o+" characters.",{value:t},!0))),t},e.sanitizeUrl=function(t){return e.sanitizeInput(t,e.MAX_URL_LENGTH,r._InternalMessageId.UrlTooLong)},e.sanitizeMessage=function(t){return t&&t.length>e.MAX_MESSAGE_LENGTH&&(t=t.substring(0,e.MAX_MESSAGE_LENGTH),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,r._InternalMessageId.MessageTruncated,"message is too long, it has been truncated to "+e.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},e.sanitizeException=function(t){return t&&t.length>e.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,e.MAX_EXCEPTION_LENGTH),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,r._InternalMessageId.ExceptionTruncated,"exception is too long, it has been truncated to "+e.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},e.sanitizeProperties=function(t){if(t){var n={};for(var i in t){var r=e.sanitizeString(t[i],e.MAX_PROPERTY_LENGTH);n[i=e.sanitizeKeyAndAddUniqueness(i,n)]=r}t=n}return t},e.sanitizeMeasurements=function(t){if(t){var n={};for(var i in t){var r=t[i];n[i=e.sanitizeKeyAndAddUniqueness(i,n)]=r}t=n}return t},e.sanitizeId=function(t){return t?e.sanitizeInput(t,e.MAX_ID_LENGTH,r._InternalMessageId.IdTooLong).toString():t},e.sanitizeInput=function(e,t,o){return e&&(e=i.Util.trim(e)).length>t&&(e=e.substring(0,t),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,o,"input is too long, it has been truncated to "+t+" characters.",{data:e},!0)),e},e.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},e.MAX_NAME_LENGTH=150,e.MAX_ID_LENGTH=128,e.MAX_PROPERTY_LENGTH=8192,e.MAX_STRING_LENGTH=1024,e.MAX_URL_LENGTH=2048,e.MAX_MESSAGE_LENGTH=32768,e.MAX_EXCEPTION_LENGTH=32768,e}();t.DataSanitizer=o}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(12),n(13),n(44),n(14),n(15)],void 0===(r=function(e,t,n,i,r,o,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MinChannelPriorty=n.MinChannelPriorty,t.EventsDiscardedReason=i.EventsDiscardedReason,t.AppInsightsCore=r.AppInsightsCore,t.CoreUtils=o.CoreUtils,t.NotificationManager=a.NotificationManager}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){}}();t.Domain=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r;i=[n,t,n(1),n(2)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(t,i,r,o){void 0===r&&(r=!1),this.messageId=t,this.message=(r?e.AiUserActionablePrefix:e.AiNonUserActionablePrefix)+n._InternalMessageId[t].toString();var a=(i?" message:"+e.sanitizeDiagnosticText(i):"")+(o?" props:"+e.sanitizeDiagnosticText(JSON.stringify(o)):"");this.message+=a}return e.sanitizeDiagnosticText=function(e){return'"'+e.replace(/\"/g,"")+'"'},e.AiNonUserActionablePrefix="AI (Internal): ",e.AiUserActionablePrefix="AI: ",e}();t._InternalLogMessage=r;var o=function(){function e(){}return e.throwInternal=function(e,t,i,o,a){void 0===a&&(a=!1);var s=new r(t,i,a,o);if(this.enableDebugExceptions())throw s;if(void 0!==s&&s&&void 0!==s.message){if(a){var l=n._InternalMessageId[s.messageId];this._messageLogged[l]&&!this.verboseLogging()||(this.warnToConsole(s.message),this._messageLogged[l]=!0)}else this.verboseLogging()&&this.warnToConsole(s.message);this.logInternalMessage(e,s)}},e.warnToConsole=function(e){"undefined"!=typeof console&&console&&("function"==typeof console.warn?console.warn(e):"function"==typeof console.log&&console.log(e))},e.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},e.clearInternalMessageLoggedTypes=function(){if(i.Util.canUseSessionStorage())for(var t=i.Util.getSessionStorageKeys(),n=0;n=this.MAX_INTERNAL_MESSAGE_LIMIT},e.AIInternalMessagePrefix="AITR_",e.enableDebugExceptions=function(){return!1},e.verboseLogging=function(){return!1},e.queue=[],e.MAX_INTERNAL_MESSAGE_LIMIT=25,e._messageCount=0,e._messageLogged={},e}();t._InternalLogging=o}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(11)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return o(t,e),t}(n.EventData);t.PageViewData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}();t.RequestHeaders=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(10)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return e.call(this)||this}return o(t,e),t}(n.Base);t.Data=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){}}();t.Base=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return o(t,e),t}(n.Domain);t.EventData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MinChannelPriorty=100}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventsDiscardedReason={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5}}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.isNullOrUndefined=function(e){return null===e||void 0===e},e}();t.CoreUtils=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.listeners=[]}return e.prototype.addNotificationListener=function(e){this.listeners.push(e)},e.prototype.removeNotificationListener=function(e){for(var t=this.listeners.indexOf(e);t>-1;)this.listeners.splice(t,1),t=this.listeners.indexOf(e)},e.prototype.eventsSent=function(e){for(var t=this,n=function(n){i.listeners[n].eventsSent&&setTimeout(function(){return t.listeners[n].eventsSent(e)},0)},i=this,r=0;r0,n}return o(t,e),t.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,o=0;o<=n.length;o++){var a=n[o];if(p.regex.test(a)){var s=new p(n[o],i++);r+=s.sizeInBytes,t.push(s)}}if(r>32768)for(var l=0,c=t.length-1,u=0,d=l,f=c;l32768){var g=f-d+1;t.splice(d,g);break}d=l,f=c,l++,c--}}return t},t}(r.ExceptionDetails),p=function(e){function t(n,i){var r=e.call(this)||this;r.sizeInBytes=0,r.aiDataContract={level:s.FieldType.Required,method:s.FieldType.Required,assembly:s.FieldType.Default,fileName:s.FieldType.Default,line:s.FieldType.Default},r.level=i,r.method="",r.assembly=l.Util.trim(n);var o=n.match(t.regex);return o&&o.length>=5&&(r.method=l.Util.trim(o[2])||r.method,r.fileName=l.Util.trim(o[4]),r.line=parseInt(o[5])||0),r.sizeInBytes+=r.method.length,r.sizeInBytes+=r.fileName.length,r.sizeInBytes+=r.assembly.length,r.sizeInBytes+=t.baseSize,r.sizeInBytes+=r.level.toString().length,r.sizeInBytes+=r.line.toString().length,r}return o(t,e),t.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,t.baseSize=58,t}(n.StackFrame);t._StackFrame=p}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){}}();t.StackFrame=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.exceptions=[],t.properties={},t.measurements={},t}return o(t,e),t}(n.Domain);t.ExceptionData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){this.hasFullStack=!0,this.parsedStack=[]}}();t.ExceptionDetails=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DisabledPropertyName="Microsoft_ApplicationInsights_BypassAjaxInstrumentation"}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(27),n(3),n(1),n(2)],void 0===(r=function(e,t,n,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t,n){var o=e.call(this)||this;return o.name=i.DataSanitizer.sanitizeString(n)||a.Util.NotSpecified,o.data=t,o.time=a.Util.toISOStringForIE8(new Date),o.aiDataContract={time:r.FieldType.Required,iKey:r.FieldType.Required,name:r.FieldType.Required,sampleRate:function(){return 100==o.sampleRate?r.FieldType.Hidden:r.FieldType.Required},tags:r.FieldType.Required,data:r.FieldType.Required},o}return o(t,e),t}(n.Envelope);t.Envelope=s}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){this.ver=1,this.sampleRate=100,this.tags={}}}();t.Envelope=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(11),n(3),n(1),n(2)],void 0===(r=function(e,t,n,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t,n,o){var s=e.call(this)||this;return s.aiDataContract={ver:r.FieldType.Required,name:r.FieldType.Required,properties:r.FieldType.Default,measurements:r.FieldType.Default},s.name=i.DataSanitizer.sanitizeString(t)||a.Util.NotSpecified,s.properties=i.DataSanitizer.sanitizeProperties(n),s.measurements=i.DataSanitizer.sanitizeMeasurements(o),s}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t}(n.EventData);t.Event=s}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(30),n(3),n(1),n(31),n(2)],void 0===(r=function(e,t,n,i,r,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(t,n,o,l,c,u){var p=e.call(this)||this;p.aiDataContract={ver:r.FieldType.Required,metrics:r.FieldType.Required,properties:r.FieldType.Default};var d=new a.DataPoint;return d.count=o>0?o:void 0,d.max=isNaN(c)||null===c?void 0:c,d.min=isNaN(l)||null===l?void 0:l,d.name=i.DataSanitizer.sanitizeString(t)||s.Util.NotSpecified,d.value=n,p.metrics=[d],p.properties=i.DataSanitizer.sanitizeProperties(u),p}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t}(n.MetricData);t.Metric=l}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.metrics=[],t.properties={},t}return o(t,e),t}(n.Domain);t.MetricData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(32),n(1)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.aiDataContract={name:i.FieldType.Required,kind:i.FieldType.Default,value:i.FieldType.Required,count:i.FieldType.Default,min:i.FieldType.Default,max:i.FieldType.Default,stdDev:i.FieldType.Default},t}return o(t,e),t}(n.DataPoint);t.DataPoint=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(33)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(){this.kind=n.DataPointType.Measurement}}();t.DataPoint=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Measurement=0]="Measurement",e[e.Aggregation=1]="Aggregation"}(t.DataPointType||(t.DataPointType={}))}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(7),n(3),n(1),n(2)],void 0===(r=function(e,t,n,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t,n,o,s,l,c){var u=e.call(this)||this;return u.aiDataContract={ver:r.FieldType.Required,name:r.FieldType.Default,url:r.FieldType.Default,duration:r.FieldType.Default,properties:r.FieldType.Default,measurements:r.FieldType.Default,id:r.FieldType.Default},u.id=i.DataSanitizer.sanitizeId(c),u.url=i.DataSanitizer.sanitizeUrl(n),u.name=i.DataSanitizer.sanitizeString(t)||a.Util.NotSpecified,isNaN(o)||(u.duration=a.Util.msToTimeSpan(o)),u.properties=i.DataSanitizer.sanitizeProperties(s),u.measurements=i.DataSanitizer.sanitizeMeasurements(l),u}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t}(n.PageViewData);t.PageView=s}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(3),n(1),n(2),n(2),n(36)],void 0===(r=function(e,t,n,i,r,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(t,o,s,l,c,u,p,d,f){var g=e.call(this)||this;g.aiDataContract={id:i.FieldType.Required,ver:i.FieldType.Required,name:i.FieldType.Default,resultCode:i.FieldType.Default,duration:i.FieldType.Default,success:i.FieldType.Default,data:i.FieldType.Default,target:i.FieldType.Default,type:i.FieldType.Default,properties:i.FieldType.Default,measurements:i.FieldType.Default,kind:i.FieldType.Default,value:i.FieldType.Default,count:i.FieldType.Default,min:i.FieldType.Default,max:i.FieldType.Default,stdDev:i.FieldType.Default,dependencyKind:i.FieldType.Default,dependencySource:i.FieldType.Default,commandName:i.FieldType.Default,dependencyTypeName:i.FieldType.Default},g.id=t,g.duration=r.Util.msToTimeSpan(l),g.success=c,g.resultCode=u+"",g.type="Ajax",g.data=n.DataSanitizer.sanitizeUrl(s);var h=a.AjaxHelper.ParseDependencyPath(o,p,s);return g.target=h.target,g.name=h.name,g.properties=n.DataSanitizer.sanitizeProperties(d),g.measurements=n.DataSanitizer.sanitizeMeasurements(f),g}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t}(s.RemoteDependencyData);t.RemoteDependencyData=l}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.success=!0,t.properties={},t.measurements={},t}return o(t,e),t}(n.Domain);t.RemoteDependencyData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(38),n(3),n(1),n(2)],void 0===(r=function(e,t,n,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t,n,o){var s=e.call(this)||this;return s.aiDataContract={ver:r.FieldType.Required,message:r.FieldType.Required,severityLevel:r.FieldType.Default,properties:r.FieldType.Default},t=t||a.Util.NotSpecified,s.message=i.DataSanitizer.sanitizeMessage(t),s.properties=i.DataSanitizer.sanitizeProperties(n),o&&(s.severityLevel=o),s}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t}(n.MessageData);t.Trace=s}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t}return o(t,e),t}(n.Domain);t.MessageData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(40),n(1),n(3),n(2),n(6)],void 0===(r=function(e,t,n,i,r,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(n,o,l,c,u){var p=e.call(this)||this;p.aiDataContract={ver:i.FieldType.Required,name:i.FieldType.Default,url:i.FieldType.Default,duration:i.FieldType.Default,perfTotal:i.FieldType.Default,networkConnect:i.FieldType.Default,sentRequest:i.FieldType.Default,receivedResponse:i.FieldType.Default,domProcessing:i.FieldType.Default,properties:i.FieldType.Default,measurements:i.FieldType.Default},p.isValid=!1;var d=t.getPerformanceTiming();if(d){var f=t.getDuration(d.navigationStart,d.loadEventEnd),g=t.getDuration(d.navigationStart,d.connectEnd),h=t.getDuration(d.requestStart,d.responseStart),v=t.getDuration(d.responseStart,d.responseEnd),y=t.getDuration(d.responseEnd,d.loadEventEnd);0==f?s._InternalLogging.throwInternal(i.LoggingSeverity.WARNING,i._InternalMessageId.ErrorPVCalc,"error calculating page view performance.",{total:f,network:g,request:h,response:v,dom:y}):t.shouldCollectDuration(f,g,h,v,y)?f0&&e.navigationStart>0&&e.responseStart>0&&e.requestStart>0&&e.loadEventEnd>0&&e.responseEnd>0&&e.connectEnd>0&&e.domLoading>0},t.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},t.shouldCollectDuration=function(){for(var e=[],n=0;n=t.MAX_DURATION_ALLOWED)return!1;return!0},t.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",t.dataType="PageviewPerformanceData",t.MAX_DURATION_ALLOWED=36e5,t}(n.PageViewPerfData);t.PageViewPerformance=l}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(7)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return o(t,e),t}(n.PageViewData);t.PageViewPerfData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(9),n(1)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function t(t,n){var r=e.call(this)||this;return r.aiDataContract={baseType:i.FieldType.Required,baseData:i.FieldType.Required},r.baseType=t,r.baseData=n,r}return o(t,e),t}(n.Data);t.Data=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Verbose=0]="Verbose",e[e.Information=1]="Information",e[e.Warning=2]="Warning",e[e.Error=3]="Error",e[e.Critical=4]="Critical"}(t.SeverityLevel||(t.SeverityLevel={}))}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"}}();t.ContextTagKeys=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r;i=[n,t,n(12),n(13),n(14),n(15)],void 0===(r=function(e,t,n,i,r,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){this._extensions=new Array}return e.prototype.initialize=function(e,t){var n=this;if(!t||0===t.length)throw Error("At least one extension channel is required");if(!e||r.CoreUtils.isNullOrUndefined(e.instrumentationKey))throw Error("Please provide instrumentation key");this.config=e,this._notificationManager=new o.NotificationManager,this.config.extensions=this.config.extensions?this.config.extensions:{},this.config.extensions.NotificationManager=this._notificationManager,t.forEach(function(e){if(r.CoreUtils.isNullOrUndefined(e.initialize))throw Error("Extensions must provide callback to initialize")}),this._extensions=t.sort(function(e,t){var n=e,i=t,r=typeof n.processTelemetry,o=typeof i.processTelemetry;return"function"===r&&"function"===o?n.priority>i.priority?1:-1:"function"===r&&"function"!==o?1:"function"!==r&&"function"===o?-1:void 0});for(var i=0;i=n.MinChannelPriorty)return this._extensions[e]}throw new Error("No channel extension found")},e.prototype.track=function(e){if(null===e)throw this._notifiyInvalidEvent(e),Error("Invalid telemetry item");if(e.baseData&&!e.baseType)throw this._notifiyInvalidEvent(e),Error("Provide data.baseType for data.baseData");this._validateTelmetryItem(e),e.instrumentationKey||(e.instrumentationKey=this.config.instrumentationKey);for(var t=0;tthis._config.maxBatchSizeInBytes()&&this.triggerSend(),this._buffer.enqueue(i),this._setupTimer()}catch(e){d._InternalLogging.throwInternal(d.LoggingSeverity.WARNING,d._InternalMessageId.FailedAddingTelemetryToBuffer,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+d.Util.getExceptionName(e),{exception:d.Util.dump(e)})}f.CoreUtils.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(t)},e.prototype.setNextPlugin=function(e){this._nextPlugin=e},e.prototype._xhrReadyStateChange=function(e,t,n){if(4===e.readyState){var i=null;this._appId||(i=this._parseResponse(e.responseText||e.response))&&i.appId&&(this._appId=i.appId),(e.status<200||e.status>=300)&&0!==e.status?!this._config.isRetryDisabled()&&this._isRetriable(e.status)?(this._resendPayload(t),d._InternalLogging.throwInternal(d.LoggingSeverity.WARNING,d._InternalMessageId.TransmissionFailed,". Response code "+e.status+". Will retry to send "+t.length+" items.")):this._onError(t,this._formatErrorMessageXhr(e)):206===e.status?(i||(i=this._parseResponse(e.responseText||e.response)),i&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,i):this._onError(t,this._formatErrorMessageXhr(e))):(this._consecutiveErrors=0,this._onSuccess(t,n))}},e.prototype.triggerSend=function(e){void 0===e&&(e=!0);try{if(this._config.disableTelemetry())this._buffer.clear();else{if(this._buffer.count()>0){var t=this._buffer.getItems();this._sender(t,e)}this._lastSend=+new Date}clearTimeout(this._timeoutHandle),this._timeoutHandle=null,this._retryAt=null}catch(e){(!d.Util.getIEVersion()||d.Util.getIEVersion()>9)&&d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.TransmissionFailed,"Telemetry transmission failed, some telemetry will be lost: "+d.Util.getExceptionName(e),{exception:d.Util.dump(e)})}},e.prototype._onError=function(e,t,n){d._InternalLogging.throwInternal(d.LoggingSeverity.WARNING,d._InternalMessageId.OnError,"Failed to send telemetry.",{message:t}),this._buffer.clearSent(e)},e.prototype._onPartialSuccess=function(e,t){for(var n=[],i=[],r=0,o=t.errors.reverse();r0&&this._onSuccess(e,t.itemsAccepted),n.length>0&&this._onError(n,this._formatErrorMessageXhr(null,["partial success",t.itemsAccepted,"of",t.itemsReceived].join(" "))),i.length>0&&(this._resendPayload(i),d._InternalLogging.throwInternal(d.LoggingSeverity.WARNING,d._InternalMessageId.TransmissionFailed,"Partial success. Delivered: "+e.length+", Failed: "+n.length+". Will retry to send "+i.length+" our of "+t.itemsReceived+" items"))},e.prototype._onSuccess=function(e,t){this._buffer.clearSent(e)},e.prototype._xdrOnLoad=function(e,t){if(!e||e.responseText+""!="200"&&""!==e.responseText){var n=this._parseResponse(e.responseText);n&&n.itemsReceived&&n.itemsReceived>n.itemsAccepted&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,n):this._onError(t,this._formatErrorMessageXdr(e))}else this._consecutiveErrors=0,this._onSuccess(t,0)},e._constructEnvelope=function(e){switch(e.baseType){case d.Event.dataType:return i.EventEnvelopeCreator.EventEnvelopeCreator.Create(e);case d.Trace.dataType:return i.TraceEnvelopeCreator.TraceEnvelopeCreator.Create(e);case d.PageView.dataType:return i.PageViewEnvelopeCreator.PageViewEnvelopeCreator.Create(e);case d.PageViewPerformance.dataType:return i.PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator.Create(e);case d.Exception.dataType:return i.ExceptionEnvelopeCreator.ExceptionEnvelopeCreator.Create(e);case d.Metric.dataType:return i.MetricEnvelopeCreator.MetricEnvelopeCreator.Create(e);case d.RemoteDependencyData.dataType:return i.DependencyEnvelopeCreator.DependencyEnvelopeCreator.Create(e);default:return null}},e._getDefaultAppInsightsChannelConfig=function(e,t){var n={},i=e.extensions&&e.extensions[t]?e.extensions[t]:{};return n.endpointUrl=function(){return e.endpointUrl||"https://dc.services.visualstudio.com/v2/track"},n.emitLineDelimitedJson=function(){return d.Util.stringToBoolOrDefault(i.emitLineDelimitedJson)},n.maxBatchInterval=function(){return isNaN(i.maxBatchInterval)?15e3:i.maxBatchInterval},n.maxBatchSizeInBytes=function(){return i.maxBatchSizeInBytes>0?i.maxBatchSizeInBytes:102400},n.disableTelemetry=function(){return d.Util.stringToBoolOrDefault(i.disableTelemetry)},n.enableSessionStorageBuffer=function(){return d.Util.stringToBoolOrDefault(i.enableSessionStorageBuffer,!0)},n.isRetryDisabled=function(){return d.Util.stringToBoolOrDefault(i.isRetryDisabled)},n.isBeaconApiDisabled=function(){return d.Util.stringToBoolOrDefault(i.isBeaconApiDisabled,!0)},n},e._validate=function(e){switch(e.baseType){case d.Event.dataType:return r.EventValidator.EventValidator.Validate(e);case d.Trace.dataType:return o.TraceValidator.TraceValidator.Validate(e);case d.Exception.dataType:return a.ExceptionValidator.ExceptionValidator.Validate(e);case d.Metric.dataType:return s.MetricValidator.MetricValidator.Validate(e);case d.PageView.dataType:return c.PageViewValidator.PageViewValidator.Validate(e);case d.PageViewPerformance.dataType:return l.PageViewPerformanceValidator.PageViewPerformanceValidator.Validate(e);case d.RemoteDependencyData.dataType:return u.RemoteDepdencyValidator.RemoteDepdencyValidator.Validate(e)}return!1},e.prototype._beaconSender=function(e,t){var n=this._config.endpointUrl(),i=this._buffer.batchPayloads(e),r=new Blob([i],{type:"text/plain;charset=UTF-8"});navigator.sendBeacon(n,r)?this._buffer.markAsSent(e):d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.TransmissionFailed,". Failed to send telemetry with Beacon API.")},e.prototype._xhrSender=function(e,t){var n=this,i=new XMLHttpRequest;i[d.DisabledPropertyName]=!0,i.open("POST",this._config.endpointUrl(),t),i.setRequestHeader("Content-type","application/json"),d.Util.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())&&i.setRequestHeader(d.RequestHeaders.sdkContextHeader,d.RequestHeaders.sdkContextHeaderAppIdRequest),i.onreadystatechange=function(){return n._xhrReadyStateChange(i,e,e.length)},i.onerror=function(t){return n._onError(e,n._formatErrorMessageXhr(i),t)};var r=this._buffer.batchPayloads(e);i.send(r),this._buffer.markAsSent(e)},e.prototype._parseResponse=function(e){try{if(e&&""!==e){var t=JSON.parse(e);if(t&&t.itemsReceived&&t.itemsReceived>=t.itemsAccepted&&t.itemsReceived-t.itemsAccepted==t.errors.length)return t}}catch(t){d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.InvalidBackendResponse,"Cannot parse the response. "+d.Util.getExceptionName(t),{response:e})}return null},e.prototype._resendPayload=function(e){if(e&&0!==e.length){this._buffer.clearSent(e),this._consecutiveErrors++;for(var t=0,n=e;t0?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},e.prototype.markAsSent=function(e){this.clear()},e.prototype.clearSent=function(e){},e}();t.ArraySendBuffer=i;var r=function(){function e(t){this._bufferFullMessageSent=!1,this._config=t;var n=this.getBuffer(e.BUFFER_KEY),i=this.getBuffer(e.SENT_BUFFER_KEY);this._buffer=n.concat(i),this._buffer.length>e.MAX_BUFFER_SIZE&&(this._buffer.length=e.MAX_BUFFER_SIZE),this.setBuffer(e.SENT_BUFFER_KEY,[]),this.setBuffer(e.BUFFER_KEY,this._buffer)}return e.prototype.enqueue=function(t){this._buffer.length>=e.MAX_BUFFER_SIZE?this._bufferFullMessageSent||(n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.SessionStorageBufferFull,"Maximum buffer size reached: "+this._buffer.length,!0),this._bufferFullMessageSent=!0):(this._buffer.push(t),this.setBuffer(e.BUFFER_KEY,this._buffer))},e.prototype.count=function(){return this._buffer.length},e.prototype.clear=function(){this._buffer.length=0,this.setBuffer(e.BUFFER_KEY,[]),this.setBuffer(e.SENT_BUFFER_KEY,[]),this._bufferFullMessageSent=!1},e.prototype.getItems=function(){return this._buffer.slice(0)},e.prototype.batchPayloads=function(e){return e&&e.length>0?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},e.prototype.markAsSent=function(t){this._buffer=this.removePayloadsFromBuffer(t,this._buffer),this.setBuffer(e.BUFFER_KEY,this._buffer);var i=this.getBuffer(e.SENT_BUFFER_KEY);i instanceof Array&&t instanceof Array&&((i=i.concat(t)).length>e.MAX_BUFFER_SIZE&&(n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.SessionStorageBufferFull,"Sent buffer reached its maximum size: "+i.length,!0),i.length=e.MAX_BUFFER_SIZE),this.setBuffer(e.SENT_BUFFER_KEY,i))},e.prototype.clearSent=function(t){var n=this.getBuffer(e.SENT_BUFFER_KEY);n=this.removePayloadsFromBuffer(t,n),this.setBuffer(e.SENT_BUFFER_KEY,n)},e.prototype.removePayloadsFromBuffer=function(e,t){var n=[];for(var i in t){var r=!1;for(var o in e)if(e[o]===t[i]){r=!0;break}r||n.push(t[i])}return n},e.prototype.getBuffer=function(e){try{var t=n.Util.getSessionStorage(e);if(t){var i=JSON.parse(t);if(i)return i}}catch(t){n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.FailedToRestoreStorageBuffer," storage key: "+e+", "+n.Util.getExceptionName(t),{exception:n.Util.dump(t)})}return[]},e.prototype.setBuffer=function(e,t){try{var i=JSON.stringify(t);n.Util.setSessionStorage(e,i)}catch(t){n.Util.setSessionStorage(e,JSON.stringify([])),n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.FailedToSetStorageBuffer," storage key: "+e+", "+n.Util.getExceptionName(t)+". Buffer cleared",{exception:n.Util.dump(t)})}},e.BUFFER_KEY="AI_buffer",e.SENT_BUFFER_KEY="AI_sentBuffer",e.MAX_BUFFER_SIZE=2e3,e}();t.SessionStorageSendBuffer=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(0),n(4)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextTagKeys=["ai.application.ver","ai.application.build","ai.application.typeId","ai.application.applicationId","ai.application.layer","ai.device.id","ai.device.ip","ai.device.language","ai.device.locale","ai.device.model","ai.device.friendlyName","ai.device.network","ai.device.networkName","ai.device.oemName","ai.device.os","ai.device.osVersion","ai.device.roleInstance","ai.device.roleName","ai.device.screenResolution","ai.device.type","ai.device.machineName","ai.device.vmName","ai.device.browser","ai.device.browserVersion","ai.location.ip","ai.location.country","ai.location.province","ai.location.city","ai.operation.id","ai.operation.name","ai.operation.parentId","ai.operation.rootId","ai.operation.syntheticSource","ai.operation.correlationVector","ai.session.id","ai.session.isFirst","ai.session.isNew","ai.user.accountAcquisitionDate","ai.user.accountId","ai.user.userAgent","ai.user.id","ai.user.storeRegion","ai.user.authUserId","ai.user.anonUserAcquisitionDate","ai.user.authUserAcquisitionDate","ai.cloud.name","ai.cloud.role","ai.cloud.roleVer","ai.cloud.roleInstance","ai.cloud.environment","ai.cloud.location","ai.cloud.deploymentUnit","ai.internal.sdkVersion","ai.internal.agentVersion","ai.internal.nodeName"];var r=function(){function e(){}return e.extractProperties=function(e){var t=null;for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];"number"!=typeof i&&(t||(t={}),t[n]=i)}return t},e.extractPropsAndMeasurements=function(e,t,n){if(!i.CoreUtils.isNullOrUndefined(e))for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];"number"==typeof o?n[r]=o:t[r]=o}},e.createEnvelope=function(e,i,r){var o=new n.Envelope(r,e);o.iKey=i.instrumentationKey;var a=i.instrumentationKey.replace(/-/g,"");for(var s in o.name=o.name.replace("{0}",a),i.ctx)i.ctx.hasOwnProperty(s)&&t.ContextTagKeys.indexOf(s)>=0&&(o.tags[s]=i.ctx[s]);return i.tags.forEach(function(e){for(var n in e)e.hasOwnProperty(n)&&t.ContextTagKeys.indexOf(n)>=0&&(o.tags[n]=e[n])}),o},e}();t.EnvelopeCreator=r;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,o,t);var a=e.baseData.id,s=e.baseData.absoluteUrl,l=e.baseData.command,c=e.baseData.totalTime,u=e.baseData.success,p=e.baseData.resultCode,d=e.baseData.method,f=new n.RemoteDependencyData(a,s,l,c,u,p,d,o,t),g=new n.Data(n.RemoteDependencyData.dataType,f);return r.createEnvelope(n.RemoteDependencyData.envelopeType,e,g)},t.DependencyEnvelopeCreator=new t,t}(r);t.DependencyEnvelopeCreator=a;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,t,o);var a=e.baseData.name,s=new n.Event(a,t,o),l=new n.Data(n.Event.dataType,s);return r.createEnvelope(n.Event.envelopeType,e,l)},t.EventEnvelopeCreator=new t,t}(r);t.EventEnvelopeCreator=s;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,t,o);var a=e.baseData.exception,s=e.baseData.severityLevel,l=new n.Exception(a,t,o,s),c=new n.Data(n.Exception.dataType,l);return r.createEnvelope(n.Exception.envelopeType,e,c)},t.ExceptionEnvelopeCreator=new t,t}(r);t.ExceptionEnvelopeCreator=l;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t=r.extractProperties(e.data),o=e.baseData.name,a=e.baseData.average,s=e.baseData.sampleCount,l=e.baseData.min,c=e.baseData.max,u=new n.Metric(o,a,s,l,c,t),p=new n.Data(n.Metric.dataType,u);return r.createEnvelope(n.Metric.envelopeType,e,p)},t.MetricEnvelopeCreator=new t,t}(r);t.MetricEnvelopeCreator=c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,t,o);var a=e.baseData.name,s=e.baseData.uri,l=e.baseData.duration;if(i.CoreUtils.isNullOrUndefined(e.baseData.refUri)||(t.refUri=e.baseData.refUri),i.CoreUtils.isNullOrUndefined(e.baseData.pageType)||(t.pageType=e.baseData.pageType),i.CoreUtils.isNullOrUndefined(e.baseData.isLoggedIn)||(t.isLoggedIn=e.baseData.isLoggedIn),!i.CoreUtils.isNullOrUndefined(e.baseData.pageTags)){var c=e.baseData.pageTags;for(var u in c)c.hasOwnProperty(u)&&(t[u]=c[u])}var p=new n.PageView(a,s,l,t,o),d=new n.Data(n.PageView.dataType,p);return r.createEnvelope(n.PageView.envelopeType,e,d)},t.PageViewEnvelopeCreator=new t,t}(r);t.PageViewEnvelopeCreator=u;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,t,o);var a=e.baseData.name,s=e.baseData.uri,l=e.baseData.duration,c=new n.PageViewPerformance(a,s,l,t,o),u=new n.Data(n.PageViewPerformance.dataType,c);return r.createEnvelope(n.PageViewPerformance.envelopeType,e,u)},t.PageViewPerformanceEnvelopeCreator=new t,t}(r);t.PageViewPerformanceEnvelopeCreator=p;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t=e.baseData.message,o=e.baseData.severityLevel,a=r.extractProperties(e.data),s=new n.Trace(t,a,o),l=new n.Data(n.Trace.dataType,s);return r.createEnvelope(n.Trace.envelopeType,e,l)},t.TraceEnvelopeCreator=new t,t}(r);t.TraceEnvelopeCreator=d}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.EventValidator=new e,e}();t.EventValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.TraceValidator=new e,e}();t.TraceValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e._validateExceptions=function(e){return!0},e.ExceptionValidator=new e,e}();t.ExceptionValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.PageViewPerformanceValidator=new e,e}();t.PageViewPerformanceValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.PageViewValidator=new e,e}();t.PageViewValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.RemoteDepdencyValidator=new e,e}();t.RemoteDepdencyValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r;i=[n,t,n(0)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.serialize=function(t){var n=e._serializeObject(t,"root");return JSON.stringify(n)},e._serializeObject=function(t,i){var r={};if(!t)return n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.CannotSerializeObject,"cannot serialize object because it is null or undefined",{name:i},!0),r;if(t.__aiCircularRefCheck)return n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.CircularReferenceDetected,"Circular reference detected while serializing object",{name:i},!0),r;if(!t.aiDataContract){if("measurements"===i)r=e._serializeStringMap(t,"number",i);else if("properties"===i)r=e._serializeStringMap(t,"string",i);else if("tags"===i)r=e._serializeStringMap(t,"string",i);else if(n.Util.isArray(t))r=e._serializeArray(t,i);else{n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.CannotSerializeObjectNonSerializable,"Attempting to serialize an object which does not implement ISerializable",{name:i},!0);try{JSON.stringify(t),r=t}catch(e){n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.CannotSerializeObject,e&&"function"==typeof e.toString?e.toString():"Error serializing object",null,!0)}}return r}for(var o in t.__aiCircularRefCheck=!0,t.aiDataContract){var a,s=t.aiDataContract[o],l="function"==typeof s?s()&n.FieldType.Required:s&n.FieldType.Required,c="function"==typeof s?s()&n.FieldType.Hidden:s&n.FieldType.Hidden,u=s&n.FieldType.Array,p=void 0!==t[o],d="object"==typeof t[o]&&null!==t[o];if(!l||p||u){if(!c)void 0!==(a=d?u?e._serializeArray(t[o],o):e._serializeObject(t[o],o):t[o])&&(r[o]=a)}else n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.MissingRequiredFieldSpecification,"Missing required field specification. The field is required but not present on source",{field:o,name:i})}return delete t.__aiCircularRefCheck,r},e._serializeArray=function(t,i){var r=void 0;if(t)if(n.Util.isArray(t)){r=[];for(var o=0;o6e4&&(clearInterval(p),s||(e.duration=6e4,r.appInsights.sendPageViewInternal(e,t),r._channel.flush()))}catch(e){n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TrackPVFailedCalc,"trackPageView failed on page load calculation: "+n.Util.getExceptionName(e),{exception:n.Util.dump(e)})}},100)},e}();t.PageViewManager=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(0),n(59),n(60),n(61),n(58),n(62),n(63),n(66),n(67),n(4)],void 0===(r=function(e,t,n,i,r,o,a,s,l,c,u,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var d=function(){function e(e,t){this._config=e,this._core=t,this._telemetryInitializers=[],"undefined"!=typeof window&&(this._sessionManager=new u._SessionManager(e),this.application=new i.Application,this.device=new r.Device,this.internal=new o.Internal(e),this.location=new a.Location,this.user=new c.User(e),this.operation=new s.Operation,this.session=new u.Session,this.sample=new l.Sample(e.sampleRate())),this._addDefaultTelemetryInitializers()}return e.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},e.prototype.track=function(e){return p.CoreUtils.isNullOrUndefined(e)?n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TrackArgumentsNotSpecified,"cannot call .track() with a null or undefined argument",null,!0):(e.name===n.PageView.envelopeType&&n._InternalLogging.resetInternalMessageCount(),this.session&&"string"!=typeof this.session.id&&this._sessionManager.update(),this._track(e)),e},e.prototype._addDefaultTelemetryInitializers=function(){if(!this._config.isBrowserLinkTrackingEnabled()){var e=["/browserLinkSignalR/","/__browserLink/"];this.addTelemetryInitializer(function(t){if(t.name===n.RemoteDependencyData.envelopeType){var i=t.data;if(i&&i.baseData)for(var r=0;r=0)return!1}return!0})}},e.prototype._track=function(e){var t={};this.session&&("string"==typeof this.session.id?this._applySessionContext(t,this.session):this._applySessionContext(t,this._sessionManager.automaticSession)),this._applyApplicationContext(t,this.application),this._applyDeviceContext(t,this.device),this._applyInternalContext(t,this.internal),this._applyLocationContext(t,this.location),this._applySampleContext(t,this.sample),this._applyUserContext(t,this.user),this._applyOperationContext(t,this.operation),e.tags.push(t),e.instrumentationKey=this._config.instrumentationKey();var i=!1;try{for(var r=this._telemetryInitializers.length,o=0;o100||e<0)&&(i._InternalLogging.throwInternal(i.LoggingSeverity.WARNING,i._InternalMessageId.SampleRateOutOfRange,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),this.sampleRate=100),this.sampleRate=e,this.samplingScoreGenerator=new n.SamplingScoreGenerator}return e.prototype.isSampledIn=function(e){return!0},e}();t.Sample=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(65),n(0)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.hashCodeGeneragor=new n.HashCodeScoreGenerator}return e.prototype.getSamplingScore=function(e){var t=new i.ContextTagKeys;return e.tags[t.userId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[t.userId]):e.tags[t.operationId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[t.operationId]):Math.random()},e}();t.SamplingScoreGenerator=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.getHashCodeScore=function(t){return 100*(this.getHashCode(t)/e.INT_MAX_VALUE)},e.prototype.getHashCode=function(t){if(""==t)return 0;for(;t.length0&&(this.id=r[0])}if(this.config=t,!this.id){this.id=n.Util.newId();var o=new Date,a=n.Util.toISOStringForIE8(o);this.accountAcquisitionDate=a,o.setTime(o.getTime()+31536e6);var s=[this.id,a],l=this.config.cookieDomain?this.config.cookieDomain():void 0;n.Util.setCookie(e.userCookieName,s.join(e.cookieSeparator)+";expires="+o.toUTCString(),l),n.Util.removeStorage("ai_session")}this.accountId=t.accountId?t.accountId():void 0;var c=n.Util.getCookie(e.authUserCookieName);if(c){var u=(c=decodeURI(c)).split(e.cookieSeparator);u[0]&&(this.authenticatedId=u[0]),u.length>1&&u[1]&&(this.accountId=u[1])}}return e.prototype.setAuthenticatedUserContext=function(t,i,r){if(void 0===r&&(r=!1),!this.validateUserInput(t)||i&&!this.validateUserInput(i))n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.SetAuthContextFailedAccountName,"Setting auth user context failed. User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.",!0);else{this.authenticatedId=t;var o=this.authenticatedId;i&&(this.accountId=i,o=[this.authenticatedId,this.accountId].join(e.cookieSeparator)),r&&n.Util.setCookie(e.authUserCookieName,encodeURI(o),this.config.cookieDomain())}},e.prototype.clearAuthenticatedUserContext=function(){this.authenticatedId=null,this.accountId=null,n.Util.deleteCookie(e.authUserCookieName)},e.prototype.validateUserInput=function(e){return!("string"!=typeof e||!e||e.match(/,|;|=| |\|/))},e.cookieSeparator="|",e.userCookieName="ai_user",e.authUserCookieName="ai_authUser",e}();t.User=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(0),n(68)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(){}}();t.Session=r;var o=function(){function e(t){t||(t={}),"function"!=typeof t.sessionExpirationMs&&(t.sessionExpirationMs=function(){return e.acquisitionSpan}),"function"!=typeof t.sessionRenewalMs&&(t.sessionRenewalMs=function(){return e.renewalSpan}),this.config=t,this.automaticSession=new r}return e.prototype.update=function(){this.automaticSession.id||this.initializeAutomaticSession();var t=i.dateTime.Now(),n=t-this.automaticSession.acquisitionDate>this.config.sessionExpirationMs(),r=t-this.automaticSession.renewalDate>this.config.sessionRenewalMs();n||r?(this.automaticSession.isFirst=void 0,this.renew()):(!this.cookieUpdatedTimestamp||t-this.cookieUpdatedTimestamp>e.cookieUpdateInterval)&&(this.automaticSession.renewalDate=t,this.setCookie(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate))},e.prototype.backup=function(){this.setStorage(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate)},e.prototype.initializeAutomaticSession=function(){var e=n.Util.getCookie("ai_session");if(e&&"function"==typeof e.split)this.initializeAutomaticSessionWithData(e);else{var t=n.Util.getStorage("ai_session");t&&this.initializeAutomaticSessionWithData(t)}this.automaticSession.id||(this.automaticSession.isFirst=!0,this.renew())},e.prototype.initializeAutomaticSessionWithData=function(e){var t=e.split("|");t.length>0&&(this.automaticSession.id=t[0]);try{if(t.length>1){var i=+t[1];this.automaticSession.acquisitionDate=+new Date(i),this.automaticSession.acquisitionDate=this.automaticSession.acquisitionDate>0?this.automaticSession.acquisitionDate:0}if(t.length>2){var r=+t[2];this.automaticSession.renewalDate=+new Date(r),this.automaticSession.renewalDate=this.automaticSession.renewalDate>0?this.automaticSession.renewalDate:0}}catch(e){n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.ErrorParsingAISessionCookie,"Error parsing ai_session cookie, session will be reset: "+n.Util.getExceptionName(e),{exception:n.Util.dump(e)})}0==this.automaticSession.renewalDate&&n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.SessionRenewalDateIsZero,"AI session renewal date is 0, session will be reset.")},e.prototype.renew=function(){var e=i.dateTime.Now();this.automaticSession.id=n.Util.newId(),this.automaticSession.acquisitionDate=e,this.automaticSession.renewalDate=e,this.setCookie(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate),n.Util.canUseLocalStorage()||n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserDoesNotSupportLocalStorage,"Browser does not support local storage. Session durations will be inaccurate.")},e.prototype.setCookie=function(e,t,r){var o=t+this.config.sessionExpirationMs(),a=r+this.config.sessionRenewalMs(),s=new Date,l=[e,t,r];o=100)&&(n.samplingPercentage=100),n.disableAjaxTracking=r.Util.stringToBoolOrDefault(n.disableAjaxTracking),n.maxAjaxCallsPerView=isNaN(n.maxAjaxCallsPerView)?500:n.maxAjaxCallsPerView,n.disableCorrelationHeaders=r.Util.stringToBoolOrDefault(n.disableCorrelationHeaders),n.correlationHeaderExcludedDomains=n.correlationHeaderExcludedDomains||["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],n.disableFlushOnBeforeUnload=r.Util.stringToBoolOrDefault(n.disableFlushOnBeforeUnload),n.isCookieUseDisabled=r.Util.stringToBoolOrDefault(n.isCookieUseDisabled),n.isStorageUseDisabled=r.Util.stringToBoolOrDefault(n.isStorageUseDisabled),n.isBrowserLinkTrackingEnabled=r.Util.stringToBoolOrDefault(n.isBrowserLinkTrackingEnabled),n.enableCorsCorrelation=r.Util.stringToBoolOrDefault(n.enableCorsCorrelation),e},e}();t.Initialization=a}.apply(t,i))||(e.exports=r)}])}); //# sourceMappingURL=aisdk0.0.8.js.map ================================================ FILE: AISKU/dist-history/aisdk.min.0.0.9.js ================================================ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(window,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=18)}([function(e,t,n){var i,r;i=[n,t,n(2),n(1),n(6),n(8),n(24),n(9),n(10),n(25),n(27),n(20),n(28),n(33),n(7),n(34),n(36),n(38),n(40),n(41),n(42),n(3)],void 0===(r=function(e,t,n,i,r,o,a,s,l,c,u,p,d,f,g,h,v,y,_,m,I,S){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=n.Util,t.CorrelationIdHelper=n.CorrelationIdHelper,t.UrlHelper=n.UrlHelper,t._InternalMessageId=i._InternalMessageId,t.LoggingSeverity=i.LoggingSeverity,t.FieldType=i.FieldType,t._InternalLogging=r._InternalLogging,t._InternalLogMessage=r._InternalLogMessage,t.RequestHeaders=o.RequestHeaders,t.DisabledPropertyName=a.DisabledPropertyName,t.AIData=s.Data,t.AIBase=l.Base,t.Envelope=c.Envelope,t.Event=u.Event,t.Exception=p.Exception,t.Metric=d.Metric,t.PageView=f.PageView,t.PageViewData=g.PageViewData,t.RemoteDependencyData=h.RemoteDependencyData,t.Trace=v.Trace,t.PageViewPerformance=y.PageViewPerformance,t.Data=_.Data,t.SeverityLevel=m.SeverityLevel,t.ContextTagKeys=I.ContextTagKeys,t.DataSanitizer=S.DataSanitizer}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.CRITICAL=0]="CRITICAL",e[e.WARNING=1]="WARNING"}(t.LoggingSeverity||(t.LoggingSeverity={})),function(e){e[e.BrowserDoesNotSupportLocalStorage=0]="BrowserDoesNotSupportLocalStorage",e[e.BrowserCannotReadLocalStorage=1]="BrowserCannotReadLocalStorage",e[e.BrowserCannotReadSessionStorage=2]="BrowserCannotReadSessionStorage",e[e.BrowserCannotWriteLocalStorage=3]="BrowserCannotWriteLocalStorage",e[e.BrowserCannotWriteSessionStorage=4]="BrowserCannotWriteSessionStorage",e[e.BrowserFailedRemovalFromLocalStorage=5]="BrowserFailedRemovalFromLocalStorage",e[e.BrowserFailedRemovalFromSessionStorage=6]="BrowserFailedRemovalFromSessionStorage",e[e.CannotSendEmptyTelemetry=7]="CannotSendEmptyTelemetry",e[e.ClientPerformanceMathError=8]="ClientPerformanceMathError",e[e.ErrorParsingAISessionCookie=9]="ErrorParsingAISessionCookie",e[e.ErrorPVCalc=10]="ErrorPVCalc",e[e.ExceptionWhileLoggingError=11]="ExceptionWhileLoggingError",e[e.FailedAddingTelemetryToBuffer=12]="FailedAddingTelemetryToBuffer",e[e.FailedMonitorAjaxAbort=13]="FailedMonitorAjaxAbort",e[e.FailedMonitorAjaxDur=14]="FailedMonitorAjaxDur",e[e.FailedMonitorAjaxOpen=15]="FailedMonitorAjaxOpen",e[e.FailedMonitorAjaxRSC=16]="FailedMonitorAjaxRSC",e[e.FailedMonitorAjaxSend=17]="FailedMonitorAjaxSend",e[e.FailedMonitorAjaxGetCorrelationHeader=18]="FailedMonitorAjaxGetCorrelationHeader",e[e.FailedToAddHandlerForOnBeforeUnload=19]="FailedToAddHandlerForOnBeforeUnload",e[e.FailedToSendQueuedTelemetry=20]="FailedToSendQueuedTelemetry",e[e.FailedToReportDataLoss=21]="FailedToReportDataLoss",e[e.FlushFailed=22]="FlushFailed",e[e.MessageLimitPerPVExceeded=23]="MessageLimitPerPVExceeded",e[e.MissingRequiredFieldSpecification=24]="MissingRequiredFieldSpecification",e[e.NavigationTimingNotSupported=25]="NavigationTimingNotSupported",e[e.OnError=26]="OnError",e[e.SessionRenewalDateIsZero=27]="SessionRenewalDateIsZero",e[e.SenderNotInitialized=28]="SenderNotInitialized",e[e.StartTrackEventFailed=29]="StartTrackEventFailed",e[e.StopTrackEventFailed=30]="StopTrackEventFailed",e[e.StartTrackFailed=31]="StartTrackFailed",e[e.StopTrackFailed=32]="StopTrackFailed",e[e.TelemetrySampledAndNotSent=33]="TelemetrySampledAndNotSent",e[e.TrackEventFailed=34]="TrackEventFailed",e[e.TrackExceptionFailed=35]="TrackExceptionFailed",e[e.TrackMetricFailed=36]="TrackMetricFailed",e[e.TrackPVFailed=37]="TrackPVFailed",e[e.TrackPVFailedCalc=38]="TrackPVFailedCalc",e[e.TrackTraceFailed=39]="TrackTraceFailed",e[e.TransmissionFailed=40]="TransmissionFailed",e[e.FailedToSetStorageBuffer=41]="FailedToSetStorageBuffer",e[e.FailedToRestoreStorageBuffer=42]="FailedToRestoreStorageBuffer",e[e.InvalidBackendResponse=43]="InvalidBackendResponse",e[e.FailedToFixDepricatedValues=44]="FailedToFixDepricatedValues",e[e.InvalidDurationValue=45]="InvalidDurationValue",e[e.TelemetryEnvelopeInvalid=46]="TelemetryEnvelopeInvalid",e[e.CreateEnvelopeError=47]="CreateEnvelopeError",e[e.CannotSerializeObject=48]="CannotSerializeObject",e[e.CannotSerializeObjectNonSerializable=49]="CannotSerializeObjectNonSerializable",e[e.CircularReferenceDetected=50]="CircularReferenceDetected",e[e.ClearAuthContextFailed=51]="ClearAuthContextFailed",e[e.ExceptionTruncated=52]="ExceptionTruncated",e[e.IllegalCharsInName=53]="IllegalCharsInName",e[e.ItemNotInArray=54]="ItemNotInArray",e[e.MaxAjaxPerPVExceeded=55]="MaxAjaxPerPVExceeded",e[e.MessageTruncated=56]="MessageTruncated",e[e.NameTooLong=57]="NameTooLong",e[e.SampleRateOutOfRange=58]="SampleRateOutOfRange",e[e.SetAuthContextFailed=59]="SetAuthContextFailed",e[e.SetAuthContextFailedAccountName=60]="SetAuthContextFailedAccountName",e[e.StringValueTooLong=61]="StringValueTooLong",e[e.StartCalledMoreThanOnce=62]="StartCalledMoreThanOnce",e[e.StopCalledWithoutStart=63]="StopCalledWithoutStart",e[e.TelemetryInitializerFailed=64]="TelemetryInitializerFailed",e[e.TrackArgumentsNotSpecified=65]="TrackArgumentsNotSpecified",e[e.UrlTooLong=66]="UrlTooLong",e[e.SessionStorageBufferFull=67]="SessionStorageBufferFull",e[e.CannotAccessCookie=68]="CannotAccessCookie",e[e.IdTooLong=69]="IdTooLong"}(t._InternalMessageId||(t._InternalMessageId={})),function(e){e[e.LocalStorage=0]="LocalStorage",e[e.SessionStorage=1]="SessionStorage"}(t.StorageType||(t.StorageType={})),function(e){e[e.Default=0]="Default",e[e.Required=1]="Required",e[e.Array=2]="Array",e[e.Hidden=4]="Hidden"}(t.FieldType||(t.FieldType={}))}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r;i=[n,t,n(1),n(6),n(8),n(3)],void 0===(r=function(e,t,n,i,r,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){}return e.disableStorage=function(){e._canUseLocalStorage=!1,e._canUseSessionStorage=!1},e._getLocalStorageObject=function(){return e.canUseLocalStorage()?e._getVerifiedStorageObject(n.StorageType.LocalStorage):null},e._getVerifiedStorageObject=function(e){var t,i,r=null;try{i=new Date,(r=e===n.StorageType.LocalStorage?window.localStorage:window.sessionStorage).setItem(i,i),t=r.getItem(i)!=i,r.removeItem(i),t&&(r=null)}catch(e){r=null}return r},e.isInternalApplicationInsightsEndpoint=function(t){return-1!==e._internalEndpoints.indexOf(t.toLowerCase())},e.canUseLocalStorage=function(){return void 0===e._canUseLocalStorage&&(e._canUseLocalStorage=!!e._getVerifiedStorageObject(n.StorageType.LocalStorage)),e._canUseLocalStorage},e.getStorage=function(t){var r=e._getLocalStorageObject();if(null!==r)try{return r.getItem(t)}catch(t){e._canUseLocalStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserCannotReadLocalStorage,"Browser failed read of local storage. "+e.getExceptionName(t),{exception:e.dump(t)})}return null},e.setStorage=function(t,r){var o=e._getLocalStorageObject();if(null!==o)try{return o.setItem(t,r),!0}catch(t){e._canUseLocalStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserCannotWriteLocalStorage,"Browser failed write to local storage. "+e.getExceptionName(t),{exception:e.dump(t)})}return!1},e.removeStorage=function(t){var r=e._getLocalStorageObject();if(null!==r)try{return r.removeItem(t),!0}catch(t){e._canUseLocalStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserFailedRemovalFromLocalStorage,"Browser failed removal of local storage item. "+e.getExceptionName(t),{exception:e.dump(t)})}return!1},e._getSessionStorageObject=function(){return e.canUseSessionStorage()?e._getVerifiedStorageObject(n.StorageType.SessionStorage):null},e.canUseSessionStorage=function(){return void 0===e._canUseSessionStorage&&(e._canUseSessionStorage=!!e._getVerifiedStorageObject(n.StorageType.SessionStorage)),e._canUseSessionStorage},e.getSessionStorageKeys=function(){var t=[];if(e.canUseSessionStorage())for(var n in window.sessionStorage)t.push(n);return t},e.getSessionStorage=function(t){var r=e._getSessionStorageObject();if(null!==r)try{return r.getItem(t)}catch(t){e._canUseSessionStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserCannotReadSessionStorage,"Browser failed read of session storage. "+e.getExceptionName(t),{exception:e.dump(t)})}return null},e.setSessionStorage=function(t,r){var o=e._getSessionStorageObject();if(null!==o)try{return o.setItem(t,r),!0}catch(t){e._canUseSessionStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserCannotWriteSessionStorage,"Browser failed write to session storage. "+e.getExceptionName(t),{exception:e.dump(t)})}return!1},e.removeSessionStorage=function(t){var r=e._getSessionStorageObject();if(null!==r)try{return r.removeItem(t),!0}catch(t){e._canUseSessionStorage=!1,i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserFailedRemovalFromSessionStorage,"Browser failed removal of session storage item. "+e.getExceptionName(t),{exception:e.dump(t)})}return!1},e.disableCookies=function(){e._canUseCookies=!1},e.canUseCookies=function(){if(void 0===e._canUseCookies){e._canUseCookies=!1;try{e._canUseCookies=void 0!==e.document.cookie}catch(t){i._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.CannotAccessCookie,"Cannot access document.cookie - "+e.getExceptionName(t),{exception:e.dump(t)})}}return e._canUseCookies},e.setCookie=function(t,n,i){var r="",o="";i&&(r=";domain="+i),e.document.location&&"https:"===e.document.location.protocol&&(o=";secure"),e.canUseCookies()&&(e.document.cookie=t+"="+n+r+";path=/"+o)},e.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),void 0===e||null===e?t:"true"===e.toString().toLowerCase()},e.getCookie=function(t){if(e.canUseCookies()){var n="";if(t&&t.length)for(var i=t+"=",r=e.document.cookie.split(";"),o=0;o0;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},e.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},e.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},e.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},e.toISOStringForIE8=function(t){if(e.isDate(t)){if(Date.prototype.toISOString)return t.toISOString();var n=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return t.getUTCFullYear()+"-"+n(t.getUTCMonth()+1)+"-"+n(t.getUTCDate())+"T"+n(t.getUTCHours())+":"+n(t.getUTCMinutes())+":"+n(t.getUTCSeconds())+"."+String((t.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},e.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},e.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,o=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,r=r.length<2?"0"+r:r,(o>0?o+".":"")+r+":"+i+":"+n+"."+t},e.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},e.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},e.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},e.addEventHandler=function(e,t){if(!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},e.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},e.document="undefined"!=typeof document?document:{},e._canUseCookies=void 0,e._canUseLocalStorage=void 0,e._canUseSessionStorage=void 0,e._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],e.NotSpecified="not_specified",e}();t.Util=a;var s=function(){function e(){}return e.parseUrl=function(t){return e.htmlAnchorElement||(e.htmlAnchorElement=e.document.createElement?e.document.createElement("a"):{}),e.htmlAnchorElement.href=t,e.htmlAnchorElement},e.getAbsoluteUrl=function(t){var n,i=e.parseUrl(t);return i&&(n=i.href),n},e.getPathName=function(t){var n,i=e.parseUrl(t);return i&&(n=i.pathname),n},e.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},e.document="undefined"!=typeof document?document:{},e}();t.UrlHelper=s;var l=function(){function e(){}return e.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=s.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var r=e&&e.correlationHeaderExcludedDomains;if(!r||0==r.length)return!0;for(var o=0;o0){var a=s.parseUrl(e);if(i=a.host,null!=a.pathname)"/"!==(n=0===a.pathname.length?"/":a.pathname).charAt(0)&&(n="/"+n),r=o.DataSanitizer.sanitizeString(t?t+" "+n:n);else r=o.DataSanitizer.sanitizeString(e)}else i=n,r=n;return{target:i,name:r}},e}();t.AjaxHelper=c}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(6),n(2),n(1)],void 0===(r=function(e,t,n,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.sanitizeKeyAndAddUniqueness=function(t,n){var i=t.length,r=e.sanitizeKey(t);if(r.length!==i){for(var o=0,a=r;void 0!==n[a];)o++,a=r.substring(0,e.MAX_NAME_LENGTH-3)+e.padNumber(o);r=a}return r},e.sanitizeKey=function(t){return t&&(t=i.Util.trim(t.toString())).length>e.MAX_NAME_LENGTH&&(t=t.substring(0,e.MAX_NAME_LENGTH),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,r._InternalMessageId.NameTooLong,"name is too long. It has been truncated to "+e.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},e.sanitizeString=function(t,o){return void 0===o&&(o=e.MAX_STRING_LENGTH),t&&(o=o||e.MAX_STRING_LENGTH,(t=i.Util.trim(t)).toString().length>o&&(t=t.toString().substring(0,o),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,r._InternalMessageId.StringValueTooLong,"string value is too long. It has been truncated to "+o+" characters.",{value:t},!0))),t},e.sanitizeUrl=function(t){return e.sanitizeInput(t,e.MAX_URL_LENGTH,r._InternalMessageId.UrlTooLong)},e.sanitizeMessage=function(t){return t&&t.length>e.MAX_MESSAGE_LENGTH&&(t=t.substring(0,e.MAX_MESSAGE_LENGTH),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,r._InternalMessageId.MessageTruncated,"message is too long, it has been truncated to "+e.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},e.sanitizeException=function(t){return t&&t.length>e.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,e.MAX_EXCEPTION_LENGTH),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,r._InternalMessageId.ExceptionTruncated,"exception is too long, it has been truncated to "+e.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},e.sanitizeProperties=function(t){if(t){var n={};for(var i in t){var r=e.sanitizeString(t[i],e.MAX_PROPERTY_LENGTH);n[i=e.sanitizeKeyAndAddUniqueness(i,n)]=r}t=n}return t},e.sanitizeMeasurements=function(t){if(t){var n={};for(var i in t){var r=t[i];n[i=e.sanitizeKeyAndAddUniqueness(i,n)]=r}t=n}return t},e.sanitizeId=function(t){return t?e.sanitizeInput(t,e.MAX_ID_LENGTH,r._InternalMessageId.IdTooLong).toString():t},e.sanitizeInput=function(e,t,o){return e&&(e=i.Util.trim(e)).length>t&&(e=e.substring(0,t),n._InternalLogging.throwInternal(r.LoggingSeverity.WARNING,o,"input is too long, it has been truncated to "+t+" characters.",{data:e},!0)),e},e.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},e.MAX_NAME_LENGTH=150,e.MAX_ID_LENGTH=128,e.MAX_PROPERTY_LENGTH=8192,e.MAX_STRING_LENGTH=1024,e.MAX_URL_LENGTH=2048,e.MAX_MESSAGE_LENGTH=32768,e.MAX_EXCEPTION_LENGTH=32768,e}();t.DataSanitizer=o}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(14),n(15),n(44),n(16),n(17)],void 0===(r=function(e,t,n,i,r,o,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MinChannelPriorty=n.MinChannelPriorty,t.EventsDiscardedReason=i.EventsDiscardedReason,t.AppInsightsCore=r.AppInsightsCore,t.CoreUtils=o.CoreUtils,t.NotificationManager=a.NotificationManager}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){}}();t.Domain=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r;i=[n,t,n(1),n(2)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(t,i,r,o){void 0===r&&(r=!1),this.messageId=t,this.message=(r?e.AiUserActionablePrefix:e.AiNonUserActionablePrefix)+n._InternalMessageId[t].toString();var a=(i?" message:"+e.sanitizeDiagnosticText(i):"")+(o?" props:"+e.sanitizeDiagnosticText(JSON.stringify(o)):"");this.message+=a}return e.sanitizeDiagnosticText=function(e){return'"'+e.replace(/\"/g,"")+'"'},e.AiNonUserActionablePrefix="AI (Internal): ",e.AiUserActionablePrefix="AI: ",e}();t._InternalLogMessage=r;var o=function(){function e(){}return e.throwInternal=function(e,t,i,o,a){void 0===a&&(a=!1);var s=new r(t,i,a,o);if(this.enableDebugExceptions())throw s;if(void 0!==s&&s&&void 0!==s.message){if(a){var l=n._InternalMessageId[s.messageId];this._messageLogged[l]&&!this.verboseLogging()||(this.warnToConsole(s.message),this._messageLogged[l]=!0)}else this.verboseLogging()&&this.warnToConsole(s.message);this.logInternalMessage(e,s)}},e.warnToConsole=function(e){"undefined"!=typeof console&&console&&("function"==typeof console.warn?console.warn(e):"function"==typeof console.log&&console.log(e))},e.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},e.clearInternalMessageLoggedTypes=function(){if(i.Util.canUseSessionStorage())for(var t=i.Util.getSessionStorageKeys(),n=0;n=this.MAX_INTERNAL_MESSAGE_LIMIT},e.AIInternalMessagePrefix="AITR_",e.enableDebugExceptions=function(){return!1},e.verboseLogging=function(){return!1},e.queue=[],e.MAX_INTERNAL_MESSAGE_LIMIT=25,e._messageCount=0,e._messageLogged={},e}();t._InternalLogging=o}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(11)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return o(t,e),t}(n.EventData);t.PageViewData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}();t.RequestHeaders=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(10)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return e.call(this)||this}return o(t,e),t}(n.Base);t.Data=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){}}();t.Base=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return o(t,e),t}(n.Domain);t.EventData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(13)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApplicationInsights=n.ApplicationInsights}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(0),n(43),n(4),n(45),n(57)],void 0===(r=function(e,t,n,i,r,o,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(){this._trackAjaxAttempts=0,this.identifier=e.defaultIdentifier,this.initialize=this._initialize.bind(this)}return e.prototype.processTelemetry=function(e){r.CoreUtils.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},e.prototype.setNextPlugin=function(e){this._nextPlugin=e},e.prototype.trackPageView=function(e,t){try{this._pageViewManager.trackPageView(e,t),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e.name,e.uri)}catch(e){n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TrackPVFailed,"trackPageView failed, page view will not be collected: "+n.Util.getExceptionName(e),{exception:n.Util.dump(e)})}},e.prototype.sendPageViewInternal=function(e,t,i){var r=a.TelemetryItemCreator.createItem(e,n.PageView.dataType,n.PageView.envelopeType,t,i);this.context.track(r),this._trackAjaxAttempts=0},e.prototype.sendPageViewPerformanceInternal=function(e){},e.prototype._initialize=function(t,a,s){var l=this;if(r.CoreUtils.isNullOrUndefined(a))throw Error("Error initializing");this.core=a,this._globalconfig={instrumentationKey:t.instrumentationKey,endpointUrl:t.endpointUrl},this.config=t.extensions&&t.extensions[this.identifier]?t.extensions[this.identifier]:{};var c=e.appInsightsDefaultConfig;if(void 0!==c){if(c.extensions&&c.extensions[this.identifier])for(var u in c.extensions[this.identifier])void 0===this.config[u]&&(this.config[u]=c[u]);if(this._globalconfig)for(var u in c)void 0===this._globalconfig[u]&&(this._globalconfig[u]=c[u])}n._InternalLogging.verboseLogging=function(){return l.config.verboseLogging},n._InternalLogging.enableDebugExceptions=function(){return l.config.enableDebug},this.config.isCookieUseDisabled&&n.Util.disableCookies(),this.config.isStorageUseDisabled&&n.Util.disableStorage();var p={instrumentationKey:function(){return t.instrumentationKey},accountId:function(){return l.config.accountId},sessionRenewalMs:function(){return l.config.sessionRenewalMs},sessionExpirationMs:function(){return l.config.sessionExpirationMs},sampleRate:function(){return l.config.samplingPercentage},cookieDomain:function(){return l.config.cookieDomain},sdkExtension:function(){return l.config.sdkExtension},isBrowserLinkTrackingEnabled:function(){return l.config.isBrowserLinkTrackingEnabled},appId:function(){return l.config.appId}};this.context=new o.TelemetryContext(p,this.core),this._pageViewManager=new i.PageViewManager(this,this.config.overridePageViewDuration,this.core)},e.defaultIdentifier="ApplicationInsightsAnalytics",e.Version="0.0.1",e}();t.ApplicationInsights=s;!function(){function e(e){this._name=e,this._events={}}e.prototype.start=function(e){void 0!==this._events[e]&&n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.StartCalledMoreThanOnce,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},e.prototype.stop=function(e,t,i,r){var o=this._events[e];if(isNaN(o))n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.StopCalledWithoutStart,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var a=+new Date,s=n.PageViewPerformance.getDuration(o,a);this.action(e,t,s,i,r)}delete this._events[e],this._events[e]=void 0}}()}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MinChannelPriorty=100}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventsDiscardedReason={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5}}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.isNullOrUndefined=function(e){return null===e||void 0===e},e}();t.CoreUtils=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.listeners=[]}return e.prototype.addNotificationListener=function(e){this.listeners.push(e)},e.prototype.removeNotificationListener=function(e){for(var t=this.listeners.indexOf(e);t>-1;)this.listeners.splice(t,1),t=this.listeners.indexOf(e)},e.prototype.eventsSent=function(e){for(var t=this,n=function(n){i.listeners[n].eventsSent&&setTimeout(function(){return t.listeners[n].eventsSent(e)},0)},i=this,r=0;r0,n}return o(t,e),t.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,o=0;o<=n.length;o++){var a=n[o];if(p.regex.test(a)){var s=new p(n[o],i++);r+=s.sizeInBytes,t.push(s)}}if(r>32768)for(var l=0,c=t.length-1,u=0,d=l,f=c;l32768){var g=f-d+1;t.splice(d,g);break}d=l,f=c,l++,c--}}return t},t}(r.ExceptionDetails),p=function(e){function t(n,i){var r=e.call(this)||this;r.sizeInBytes=0,r.aiDataContract={level:s.FieldType.Required,method:s.FieldType.Required,assembly:s.FieldType.Default,fileName:s.FieldType.Default,line:s.FieldType.Default},r.level=i,r.method="",r.assembly=l.Util.trim(n);var o=n.match(t.regex);return o&&o.length>=5&&(r.method=l.Util.trim(o[2])||r.method,r.fileName=l.Util.trim(o[4]),r.line=parseInt(o[5])||0),r.sizeInBytes+=r.method.length,r.sizeInBytes+=r.fileName.length,r.sizeInBytes+=r.assembly.length,r.sizeInBytes+=t.baseSize,r.sizeInBytes+=r.level.toString().length,r.sizeInBytes+=r.line.toString().length,r}return o(t,e),t.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,t.baseSize=58,t}(n.StackFrame);t._StackFrame=p}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){}}();t.StackFrame=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.exceptions=[],t.properties={},t.measurements={},t}return o(t,e),t}(n.Domain);t.ExceptionData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){this.hasFullStack=!0,this.parsedStack=[]}}();t.ExceptionDetails=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DisabledPropertyName="Microsoft_ApplicationInsights_BypassAjaxInstrumentation"}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(26),n(3),n(1),n(2)],void 0===(r=function(e,t,n,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t,n){var o=e.call(this)||this;return o.name=i.DataSanitizer.sanitizeString(n)||a.Util.NotSpecified,o.data=t,o.time=a.Util.toISOStringForIE8(new Date),o.aiDataContract={time:r.FieldType.Required,iKey:r.FieldType.Required,name:r.FieldType.Required,sampleRate:function(){return 100==o.sampleRate?r.FieldType.Hidden:r.FieldType.Required},tags:r.FieldType.Required,data:r.FieldType.Required},o}return o(t,e),t}(n.Envelope);t.Envelope=s}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){this.ver=1,this.sampleRate=100,this.tags={}}}();t.Envelope=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(11),n(3),n(1),n(2)],void 0===(r=function(e,t,n,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t,n,o){var s=e.call(this)||this;return s.aiDataContract={ver:r.FieldType.Required,name:r.FieldType.Required,properties:r.FieldType.Default,measurements:r.FieldType.Default},s.name=i.DataSanitizer.sanitizeString(t)||a.Util.NotSpecified,s.properties=i.DataSanitizer.sanitizeProperties(n),s.measurements=i.DataSanitizer.sanitizeMeasurements(o),s}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t}(n.EventData);t.Event=s}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(29),n(3),n(1),n(30),n(2)],void 0===(r=function(e,t,n,i,r,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(t,n,o,l,c,u){var p=e.call(this)||this;p.aiDataContract={ver:r.FieldType.Required,metrics:r.FieldType.Required,properties:r.FieldType.Default};var d=new a.DataPoint;return d.count=o>0?o:void 0,d.max=isNaN(c)||null===c?void 0:c,d.min=isNaN(l)||null===l?void 0:l,d.name=i.DataSanitizer.sanitizeString(t)||s.Util.NotSpecified,d.value=n,p.metrics=[d],p.properties=i.DataSanitizer.sanitizeProperties(u),p}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t}(n.MetricData);t.Metric=l}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.metrics=[],t.properties={},t}return o(t,e),t}(n.Domain);t.MetricData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(31),n(1)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.aiDataContract={name:i.FieldType.Required,kind:i.FieldType.Default,value:i.FieldType.Required,count:i.FieldType.Default,min:i.FieldType.Default,max:i.FieldType.Default,stdDev:i.FieldType.Default},t}return o(t,e),t}(n.DataPoint);t.DataPoint=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(32)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(){this.kind=n.DataPointType.Measurement}}();t.DataPoint=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Measurement=0]="Measurement",e[e.Aggregation=1]="Aggregation"}(t.DataPointType||(t.DataPointType={}))}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(7),n(3),n(1),n(2)],void 0===(r=function(e,t,n,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t,n,o,s,l,c){var u=e.call(this)||this;return u.aiDataContract={ver:r.FieldType.Required,name:r.FieldType.Default,url:r.FieldType.Default,duration:r.FieldType.Default,properties:r.FieldType.Default,measurements:r.FieldType.Default,id:r.FieldType.Default},u.id=i.DataSanitizer.sanitizeId(c),u.url=i.DataSanitizer.sanitizeUrl(n),u.name=i.DataSanitizer.sanitizeString(t)||a.Util.NotSpecified,isNaN(o)||(u.duration=a.Util.msToTimeSpan(o)),u.properties=i.DataSanitizer.sanitizeProperties(s),u.measurements=i.DataSanitizer.sanitizeMeasurements(l),u}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t}(n.PageViewData);t.PageView=s}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(3),n(1),n(2),n(2),n(35)],void 0===(r=function(e,t,n,i,r,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(t,o,s,l,c,u,p,d,f){var g=e.call(this)||this;g.aiDataContract={id:i.FieldType.Required,ver:i.FieldType.Required,name:i.FieldType.Default,resultCode:i.FieldType.Default,duration:i.FieldType.Default,success:i.FieldType.Default,data:i.FieldType.Default,target:i.FieldType.Default,type:i.FieldType.Default,properties:i.FieldType.Default,measurements:i.FieldType.Default,kind:i.FieldType.Default,value:i.FieldType.Default,count:i.FieldType.Default,min:i.FieldType.Default,max:i.FieldType.Default,stdDev:i.FieldType.Default,dependencyKind:i.FieldType.Default,dependencySource:i.FieldType.Default,commandName:i.FieldType.Default,dependencyTypeName:i.FieldType.Default},g.id=t,g.duration=r.Util.msToTimeSpan(l),g.success=c,g.resultCode=u+"",g.type="Ajax",g.data=n.DataSanitizer.sanitizeUrl(s);var h=a.AjaxHelper.ParseDependencyPath(o,p,s);return g.target=h.target,g.name=h.name,g.properties=n.DataSanitizer.sanitizeProperties(d),g.measurements=n.DataSanitizer.sanitizeMeasurements(f),g}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t}(s.RemoteDependencyData);t.RemoteDependencyData=l}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.success=!0,t.properties={},t.measurements={},t}return o(t,e),t}(n.Domain);t.RemoteDependencyData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(37),n(3),n(1),n(2)],void 0===(r=function(e,t,n,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t,n,o){var s=e.call(this)||this;return s.aiDataContract={ver:r.FieldType.Required,message:r.FieldType.Required,severityLevel:r.FieldType.Default,properties:r.FieldType.Default},t=t||a.Util.NotSpecified,s.message=i.DataSanitizer.sanitizeMessage(t),s.properties=i.DataSanitizer.sanitizeProperties(n),o&&(s.severityLevel=o),s}return o(t,e),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t}(n.MessageData);t.Trace=s}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(5)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t}return o(t,e),t}(n.Domain);t.MessageData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(39),n(1),n(3),n(2),n(6)],void 0===(r=function(e,t,n,i,r,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(n,o,l,c,u){var p=e.call(this)||this;p.aiDataContract={ver:i.FieldType.Required,name:i.FieldType.Default,url:i.FieldType.Default,duration:i.FieldType.Default,perfTotal:i.FieldType.Default,networkConnect:i.FieldType.Default,sentRequest:i.FieldType.Default,receivedResponse:i.FieldType.Default,domProcessing:i.FieldType.Default,properties:i.FieldType.Default,measurements:i.FieldType.Default},p.isValid=!1;var d=t.getPerformanceTiming();if(d){var f=t.getDuration(d.navigationStart,d.loadEventEnd),g=t.getDuration(d.navigationStart,d.connectEnd),h=t.getDuration(d.requestStart,d.responseStart),v=t.getDuration(d.responseStart,d.responseEnd),y=t.getDuration(d.responseEnd,d.loadEventEnd);0==f?s._InternalLogging.throwInternal(i.LoggingSeverity.WARNING,i._InternalMessageId.ErrorPVCalc,"error calculating page view performance.",{total:f,network:g,request:h,response:v,dom:y}):t.shouldCollectDuration(f,g,h,v,y)?f0&&e.navigationStart>0&&e.responseStart>0&&e.requestStart>0&&e.loadEventEnd>0&&e.responseEnd>0&&e.connectEnd>0&&e.domLoading>0},t.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},t.shouldCollectDuration=function(){for(var e=[],n=0;n=t.MAX_DURATION_ALLOWED)return!1;return!0},t.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",t.dataType="PageviewPerformanceData",t.MAX_DURATION_ALLOWED=36e5,t}(n.PageViewPerfData);t.PageViewPerformance=l}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(7)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return o(t,e),t}(n.PageViewData);t.PageViewPerfData=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(9),n(1)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function t(t,n){var r=e.call(this)||this;return r.aiDataContract={baseType:i.FieldType.Required,baseData:i.FieldType.Required},r.baseType=t,r.baseData=n,r}return o(t,e),t}(n.Data);t.Data=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Verbose=0]="Verbose",e[e.Information=1]="Information",e[e.Warning=2]="Warning",e[e.Error=3]="Error",e[e.Critical=4]="Critical"}(t.SeverityLevel||(t.SeverityLevel={}))}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"}}();t.ContextTagKeys=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r;i=[n,t,n(0),n(4)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t,n){this.pageViewPerformanceSent=!1,this.overridePageViewDuration=!1,this.overridePageViewDuration=t,this.appInsights=e,n&&(this._channel=n.getTransmissionControl())}return e.prototype.trackPageView=function(e,t){var r=this,o=e.name;(i.CoreUtils.isNullOrUndefined(o)||"string"!=typeof o)&&(e.name=window.document&&window.document.title||"");var a=e.uri;if((i.CoreUtils.isNullOrUndefined(a)||"string"!=typeof a)&&(e.uri=window.location&&window.location.href||""),!n.PageViewPerformance.isPerformanceTimingSupported())return this.appInsights.sendPageViewInternal(e,t),this._channel.flush(),void n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.NavigationTimingNotSupported,"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");var s=!1,l=void 0,c=n.PageViewPerformance.getPerformanceTiming().navigationStart;l=n.PageViewPerformance.getDuration(c,+new Date),n.PageViewPerformance.shouldCollectDuration(l)||(l=void 0);var u=e.duration;!this.overridePageViewDuration&&isNaN(u)||(isNaN(u)&&(e.duration=l),this.appInsights.sendPageViewInternal(e,t),this._channel.flush(),s=!0);var p=setInterval(function(){try{if(n.PageViewPerformance.isPerformanceTimingDataReady()){clearInterval(p);var i=new n.PageViewPerformance(o,a,null,t,void 0);i.getIsValid()||s?(s||(e.duration=i.getDurationMs(),r.appInsights.sendPageViewInternal(e,t)),r.pageViewPerformanceSent||(r.appInsights.sendPageViewPerformanceInternal(i),r.pageViewPerformanceSent=!0),r._channel.flush()):(e.duration=l,r.appInsights.sendPageViewInternal(e,t),r._channel.flush())}else n.PageViewPerformance.getDuration(c,+new Date)>6e4&&(clearInterval(p),s||(e.duration=6e4,r.appInsights.sendPageViewInternal(e,t),r._channel.flush()))}catch(e){n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TrackPVFailedCalc,"trackPageView failed on page load calculation: "+n.Util.getExceptionName(e),{exception:n.Util.dump(e)})}},100)},e}();t.PageViewManager=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(14),n(15),n(16),n(17)],void 0===(r=function(e,t,n,i,r,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){this._extensions=new Array}return e.prototype.initialize=function(e,t){var n=this;if(!t||0===t.length)throw Error("At least one extension channel is required");if(!e||r.CoreUtils.isNullOrUndefined(e.instrumentationKey))throw Error("Please provide instrumentation key");this.config=e,this._notificationManager=new o.NotificationManager,this.config.extensions=this.config.extensions?this.config.extensions:{},this.config.extensions.NotificationManager=this._notificationManager,t.forEach(function(e){if(r.CoreUtils.isNullOrUndefined(e.initialize))throw Error("Extensions must provide callback to initialize")}),this._extensions=t.sort(function(e,t){var n=e,i=t,r=typeof n.processTelemetry,o=typeof i.processTelemetry;return"function"===r&&"function"===o?n.priority>i.priority?1:-1:"function"===r&&"function"!==o?1:"function"!==r&&"function"===o?-1:void 0});for(var i=0;i=n.MinChannelPriorty)return this._extensions[e]}throw new Error("No channel extension found")},e.prototype.track=function(e){if(null===e)throw this._notifiyInvalidEvent(e),Error("Invalid telemetry item");if(e.baseData&&!e.baseType)throw this._notifiyInvalidEvent(e),Error("Provide data.baseType for data.baseData");this._validateTelmetryItem(e),e.instrumentationKey||(e.instrumentationKey=this.config.instrumentationKey);for(var t=0;t=0)return!1}return!0})}},e.prototype._track=function(e){var t={};this.session&&("string"==typeof this.session.id?this._applySessionContext(t,this.session):this._applySessionContext(t,this._sessionManager.automaticSession)),this._applyApplicationContext(t,this.application),this._applyDeviceContext(t,this.device),this._applyInternalContext(t,this.internal),this._applyLocationContext(t,this.location),this._applySampleContext(t,this.sample),this._applyUserContext(t,this.user),this._applyOperationContext(t,this.operation),e.tags.push(t),e.instrumentationKey=this._config.instrumentationKey();var i=!1;try{for(var r=this._telemetryInitializers.length,o=0;o100||e<0)&&(i._InternalLogging.throwInternal(i.LoggingSeverity.WARNING,i._InternalMessageId.SampleRateOutOfRange,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),this.sampleRate=100),this.sampleRate=e,this.samplingScoreGenerator=new n.SamplingScoreGenerator}return e.prototype.isSampledIn=function(e){return!0},e}();t.Sample=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(53),n(0)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.hashCodeGeneragor=new n.HashCodeScoreGenerator}return e.prototype.getSamplingScore=function(e){var t=new i.ContextTagKeys;return e.tags[t.userId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[t.userId]):e.tags[t.operationId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[t.operationId]):Math.random()},e}();t.SamplingScoreGenerator=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.getHashCodeScore=function(t){return 100*(this.getHashCode(t)/e.INT_MAX_VALUE)},e.prototype.getHashCode=function(t){if(""==t)return 0;for(;t.length0&&(this.id=r[0])}if(this.config=t,!this.id){this.id=n.Util.newId();var o=new Date,a=n.Util.toISOStringForIE8(o);this.accountAcquisitionDate=a,o.setTime(o.getTime()+31536e6);var s=[this.id,a],l=this.config.cookieDomain?this.config.cookieDomain():void 0;n.Util.setCookie(e.userCookieName,s.join(e.cookieSeparator)+";expires="+o.toUTCString(),l),n.Util.removeStorage("ai_session")}this.accountId=t.accountId?t.accountId():void 0;var c=n.Util.getCookie(e.authUserCookieName);if(c){var u=(c=decodeURI(c)).split(e.cookieSeparator);u[0]&&(this.authenticatedId=u[0]),u.length>1&&u[1]&&(this.accountId=u[1])}}return e.prototype.setAuthenticatedUserContext=function(t,i,r){if(void 0===r&&(r=!1),!this.validateUserInput(t)||i&&!this.validateUserInput(i))n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.SetAuthContextFailedAccountName,"Setting auth user context failed. User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.",!0);else{this.authenticatedId=t;var o=this.authenticatedId;i&&(this.accountId=i,o=[this.authenticatedId,this.accountId].join(e.cookieSeparator)),r&&n.Util.setCookie(e.authUserCookieName,encodeURI(o),this.config.cookieDomain())}},e.prototype.clearAuthenticatedUserContext=function(){this.authenticatedId=null,this.accountId=null,n.Util.deleteCookie(e.authUserCookieName)},e.prototype.validateUserInput=function(e){return!("string"!=typeof e||!e||e.match(/,|;|=| |\|/))},e.cookieSeparator="|",e.userCookieName="ai_user",e.authUserCookieName="ai_authUser",e}();t.User=i}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(0),n(56)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(){}}();t.Session=r;var o=function(){function e(t){t||(t={}),"function"!=typeof t.sessionExpirationMs&&(t.sessionExpirationMs=function(){return e.acquisitionSpan}),"function"!=typeof t.sessionRenewalMs&&(t.sessionRenewalMs=function(){return e.renewalSpan}),this.config=t,this.automaticSession=new r}return e.prototype.update=function(){this.automaticSession.id||this.initializeAutomaticSession();var t=i.dateTime.Now(),n=t-this.automaticSession.acquisitionDate>this.config.sessionExpirationMs(),r=t-this.automaticSession.renewalDate>this.config.sessionRenewalMs();n||r?(this.automaticSession.isFirst=void 0,this.renew()):(!this.cookieUpdatedTimestamp||t-this.cookieUpdatedTimestamp>e.cookieUpdateInterval)&&(this.automaticSession.renewalDate=t,this.setCookie(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate))},e.prototype.backup=function(){this.setStorage(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate)},e.prototype.initializeAutomaticSession=function(){var e=n.Util.getCookie("ai_session");if(e&&"function"==typeof e.split)this.initializeAutomaticSessionWithData(e);else{var t=n.Util.getStorage("ai_session");t&&this.initializeAutomaticSessionWithData(t)}this.automaticSession.id||(this.automaticSession.isFirst=!0,this.renew())},e.prototype.initializeAutomaticSessionWithData=function(e){var t=e.split("|");t.length>0&&(this.automaticSession.id=t[0]);try{if(t.length>1){var i=+t[1];this.automaticSession.acquisitionDate=+new Date(i),this.automaticSession.acquisitionDate=this.automaticSession.acquisitionDate>0?this.automaticSession.acquisitionDate:0}if(t.length>2){var r=+t[2];this.automaticSession.renewalDate=+new Date(r),this.automaticSession.renewalDate=this.automaticSession.renewalDate>0?this.automaticSession.renewalDate:0}}catch(e){n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.ErrorParsingAISessionCookie,"Error parsing ai_session cookie, session will be reset: "+n.Util.getExceptionName(e),{exception:n.Util.dump(e)})}0==this.automaticSession.renewalDate&&n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.SessionRenewalDateIsZero,"AI session renewal date is 0, session will be reset.")},e.prototype.renew=function(){var e=i.dateTime.Now();this.automaticSession.id=n.Util.newId(),this.automaticSession.acquisitionDate=e,this.automaticSession.renewalDate=e,this.setCookie(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate),n.Util.canUseLocalStorage()||n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.BrowserDoesNotSupportLocalStorage,"Browser does not support local storage. Session durations will be inaccurate.")},e.prototype.setCookie=function(e,t,r){var o=t+this.config.sessionExpirationMs(),a=r+this.config.sessionRenewalMs(),s=new Date,l=[e,t,r];o=100)&&(n.samplingPercentage=100),n.disableAjaxTracking=r.Util.stringToBoolOrDefault(n.disableAjaxTracking),n.maxAjaxCallsPerView=isNaN(n.maxAjaxCallsPerView)?500:n.maxAjaxCallsPerView,n.disableCorrelationHeaders=r.Util.stringToBoolOrDefault(n.disableCorrelationHeaders),n.correlationHeaderExcludedDomains=n.correlationHeaderExcludedDomains||["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],n.disableFlushOnBeforeUnload=r.Util.stringToBoolOrDefault(n.disableFlushOnBeforeUnload),n.isCookieUseDisabled=r.Util.stringToBoolOrDefault(n.isCookieUseDisabled),n.isStorageUseDisabled=r.Util.stringToBoolOrDefault(n.isStorageUseDisabled),n.isBrowserLinkTrackingEnabled=r.Util.stringToBoolOrDefault(n.isBrowserLinkTrackingEnabled),n.enableCorsCorrelation=r.Util.stringToBoolOrDefault(n.enableCorsCorrelation),e},e}();t.Initialization=a}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(60)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sender=n.Sender}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(62),n(63),n(64),n(65),n(66),n(61),n(67),n(68),n(69),n(70),n(0),n(4)],void 0===(r=function(e,t,n,i,r,o,a,s,l,c,u,p,d,f){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var g=function(){function e(){this.priority=200,this._XMLHttpRequestSupported=!1}return e.prototype.pause=function(){throw new Error("Method not implemented.")},e.prototype.resume=function(){throw new Error("Method not implemented.")},e.prototype.flush=function(){try{this.triggerSend()}catch(e){d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.FlushFailed,"flush failed, telemetry will not be collected: "+d.Util.getExceptionName(e),{exception:d.Util.dump(e)})}},e.prototype.teardown=function(){throw new Error("Method not implemented.")},e.prototype.initialize=function(t){(this.identifier="AppInsightsChannelPlugin",this._consecutiveErrors=0,this._retryAt=null,this._lastSend=0,this._config=e._getDefaultAppInsightsChannelConfig(t,this.identifier),this._sender=null,this._buffer=d.Util.canUseSessionStorage()&&this._config.enableSessionStorageBuffer?new n.SessionStorageSendBuffer(this._config):new n.ArraySendBuffer(this._config),!this._config.isBeaconApiDisabled()&&d.Util.IsBeaconApiSupported())?this._sender=this._beaconSender:"undefined"!=typeof XMLHttpRequest&&("withCredentials"in new XMLHttpRequest?(this._sender=this._xhrSender,this._XMLHttpRequestSupported=!0):"undefined"!=typeof XDomainRequest&&(this._sender=this._xdrSender))},e.prototype.processTelemetry=function(t){try{if(this._config.disableTelemetry())return;if(!t)return void d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.CannotSendEmptyTelemetry,"Cannot send empty telemetry");if(!this._sender)return void d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.SenderNotInitialized,"Sender was not initialized");if(!e._validate(t))return void d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.TelemetryEnvelopeInvalid,"Invalid telemetry envelope");var n=e._constructEnvelope(t);if(!n)return void d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.CreateEnvelopeError,"Unable to create an AppInsights envelope");var i=p.Serializer.serialize(n),r=this._buffer.getItems(),o=this._buffer.batchPayloads(r);o&&o.length+i.length>this._config.maxBatchSizeInBytes()&&this.triggerSend(),this._buffer.enqueue(i),this._setupTimer()}catch(e){d._InternalLogging.throwInternal(d.LoggingSeverity.WARNING,d._InternalMessageId.FailedAddingTelemetryToBuffer,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+d.Util.getExceptionName(e),{exception:d.Util.dump(e)})}f.CoreUtils.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(t)},e.prototype.setNextPlugin=function(e){this._nextPlugin=e},e.prototype._xhrReadyStateChange=function(e,t,n){if(4===e.readyState){var i=null;this._appId||(i=this._parseResponse(e.responseText||e.response))&&i.appId&&(this._appId=i.appId),(e.status<200||e.status>=300)&&0!==e.status?!this._config.isRetryDisabled()&&this._isRetriable(e.status)?(this._resendPayload(t),d._InternalLogging.throwInternal(d.LoggingSeverity.WARNING,d._InternalMessageId.TransmissionFailed,". Response code "+e.status+". Will retry to send "+t.length+" items.")):this._onError(t,this._formatErrorMessageXhr(e)):206===e.status?(i||(i=this._parseResponse(e.responseText||e.response)),i&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,i):this._onError(t,this._formatErrorMessageXhr(e))):(this._consecutiveErrors=0,this._onSuccess(t,n))}},e.prototype.triggerSend=function(e){void 0===e&&(e=!0);try{if(this._config.disableTelemetry())this._buffer.clear();else{if(this._buffer.count()>0){var t=this._buffer.getItems();this._sender(t,e)}this._lastSend=+new Date}clearTimeout(this._timeoutHandle),this._timeoutHandle=null,this._retryAt=null}catch(e){(!d.Util.getIEVersion()||d.Util.getIEVersion()>9)&&d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.TransmissionFailed,"Telemetry transmission failed, some telemetry will be lost: "+d.Util.getExceptionName(e),{exception:d.Util.dump(e)})}},e.prototype._onError=function(e,t,n){d._InternalLogging.throwInternal(d.LoggingSeverity.WARNING,d._InternalMessageId.OnError,"Failed to send telemetry.",{message:t}),this._buffer.clearSent(e)},e.prototype._onPartialSuccess=function(e,t){for(var n=[],i=[],r=0,o=t.errors.reverse();r0&&this._onSuccess(e,t.itemsAccepted),n.length>0&&this._onError(n,this._formatErrorMessageXhr(null,["partial success",t.itemsAccepted,"of",t.itemsReceived].join(" "))),i.length>0&&(this._resendPayload(i),d._InternalLogging.throwInternal(d.LoggingSeverity.WARNING,d._InternalMessageId.TransmissionFailed,"Partial success. Delivered: "+e.length+", Failed: "+n.length+". Will retry to send "+i.length+" our of "+t.itemsReceived+" items"))},e.prototype._onSuccess=function(e,t){this._buffer.clearSent(e)},e.prototype._xdrOnLoad=function(e,t){if(!e||e.responseText+""!="200"&&""!==e.responseText){var n=this._parseResponse(e.responseText);n&&n.itemsReceived&&n.itemsReceived>n.itemsAccepted&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,n):this._onError(t,this._formatErrorMessageXdr(e))}else this._consecutiveErrors=0,this._onSuccess(t,0)},e._constructEnvelope=function(e){switch(e.baseType){case d.Event.dataType:return i.EventEnvelopeCreator.EventEnvelopeCreator.Create(e);case d.Trace.dataType:return i.TraceEnvelopeCreator.TraceEnvelopeCreator.Create(e);case d.PageView.dataType:return i.PageViewEnvelopeCreator.PageViewEnvelopeCreator.Create(e);case d.PageViewPerformance.dataType:return i.PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator.Create(e);case d.Exception.dataType:return i.ExceptionEnvelopeCreator.ExceptionEnvelopeCreator.Create(e);case d.Metric.dataType:return i.MetricEnvelopeCreator.MetricEnvelopeCreator.Create(e);case d.RemoteDependencyData.dataType:return i.DependencyEnvelopeCreator.DependencyEnvelopeCreator.Create(e);default:return null}},e._getDefaultAppInsightsChannelConfig=function(e,t){var n={},i=e.extensions&&e.extensions[t]?e.extensions[t]:{};return n.endpointUrl=function(){return e.endpointUrl||"https://dc.services.visualstudio.com/v2/track"},n.emitLineDelimitedJson=function(){return d.Util.stringToBoolOrDefault(i.emitLineDelimitedJson)},n.maxBatchInterval=function(){return isNaN(i.maxBatchInterval)?15e3:i.maxBatchInterval},n.maxBatchSizeInBytes=function(){return i.maxBatchSizeInBytes>0?i.maxBatchSizeInBytes:102400},n.disableTelemetry=function(){return d.Util.stringToBoolOrDefault(i.disableTelemetry)},n.enableSessionStorageBuffer=function(){return d.Util.stringToBoolOrDefault(i.enableSessionStorageBuffer,!0)},n.isRetryDisabled=function(){return d.Util.stringToBoolOrDefault(i.isRetryDisabled)},n.isBeaconApiDisabled=function(){return d.Util.stringToBoolOrDefault(i.isBeaconApiDisabled,!0)},n},e._validate=function(e){switch(e.baseType){case d.Event.dataType:return r.EventValidator.EventValidator.Validate(e);case d.Trace.dataType:return o.TraceValidator.TraceValidator.Validate(e);case d.Exception.dataType:return a.ExceptionValidator.ExceptionValidator.Validate(e);case d.Metric.dataType:return s.MetricValidator.MetricValidator.Validate(e);case d.PageView.dataType:return c.PageViewValidator.PageViewValidator.Validate(e);case d.PageViewPerformance.dataType:return l.PageViewPerformanceValidator.PageViewPerformanceValidator.Validate(e);case d.RemoteDependencyData.dataType:return u.RemoteDepdencyValidator.RemoteDepdencyValidator.Validate(e)}return!1},e.prototype._beaconSender=function(e,t){var n=this._config.endpointUrl(),i=this._buffer.batchPayloads(e),r=new Blob([i],{type:"text/plain;charset=UTF-8"});navigator.sendBeacon(n,r)?this._buffer.markAsSent(e):d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.TransmissionFailed,". Failed to send telemetry with Beacon API.")},e.prototype._xhrSender=function(e,t){var n=this,i=new XMLHttpRequest;i[d.DisabledPropertyName]=!0,i.open("POST",this._config.endpointUrl(),t),i.setRequestHeader("Content-type","application/json"),d.Util.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())&&i.setRequestHeader(d.RequestHeaders.sdkContextHeader,d.RequestHeaders.sdkContextHeaderAppIdRequest),i.onreadystatechange=function(){return n._xhrReadyStateChange(i,e,e.length)},i.onerror=function(t){return n._onError(e,n._formatErrorMessageXhr(i),t)};var r=this._buffer.batchPayloads(e);i.send(r),this._buffer.markAsSent(e)},e.prototype._parseResponse=function(e){try{if(e&&""!==e){var t=JSON.parse(e);if(t&&t.itemsReceived&&t.itemsReceived>=t.itemsAccepted&&t.itemsReceived-t.itemsAccepted==t.errors.length)return t}}catch(t){d._InternalLogging.throwInternal(d.LoggingSeverity.CRITICAL,d._InternalMessageId.InvalidBackendResponse,"Cannot parse the response. "+d.Util.getExceptionName(t),{response:e})}return null},e.prototype._resendPayload=function(e){if(e&&0!==e.length){this._buffer.clearSent(e),this._consecutiveErrors++;for(var t=0,n=e;t0?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},e.prototype.markAsSent=function(e){this.clear()},e.prototype.clearSent=function(e){},e}();t.ArraySendBuffer=i;var r=function(){function e(t){this._bufferFullMessageSent=!1,this._config=t;var n=this.getBuffer(e.BUFFER_KEY),i=this.getBuffer(e.SENT_BUFFER_KEY);this._buffer=n.concat(i),this._buffer.length>e.MAX_BUFFER_SIZE&&(this._buffer.length=e.MAX_BUFFER_SIZE),this.setBuffer(e.SENT_BUFFER_KEY,[]),this.setBuffer(e.BUFFER_KEY,this._buffer)}return e.prototype.enqueue=function(t){this._buffer.length>=e.MAX_BUFFER_SIZE?this._bufferFullMessageSent||(n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.SessionStorageBufferFull,"Maximum buffer size reached: "+this._buffer.length,!0),this._bufferFullMessageSent=!0):(this._buffer.push(t),this.setBuffer(e.BUFFER_KEY,this._buffer))},e.prototype.count=function(){return this._buffer.length},e.prototype.clear=function(){this._buffer.length=0,this.setBuffer(e.BUFFER_KEY,[]),this.setBuffer(e.SENT_BUFFER_KEY,[]),this._bufferFullMessageSent=!1},e.prototype.getItems=function(){return this._buffer.slice(0)},e.prototype.batchPayloads=function(e){return e&&e.length>0?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},e.prototype.markAsSent=function(t){this._buffer=this.removePayloadsFromBuffer(t,this._buffer),this.setBuffer(e.BUFFER_KEY,this._buffer);var i=this.getBuffer(e.SENT_BUFFER_KEY);i instanceof Array&&t instanceof Array&&((i=i.concat(t)).length>e.MAX_BUFFER_SIZE&&(n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.SessionStorageBufferFull,"Sent buffer reached its maximum size: "+i.length,!0),i.length=e.MAX_BUFFER_SIZE),this.setBuffer(e.SENT_BUFFER_KEY,i))},e.prototype.clearSent=function(t){var n=this.getBuffer(e.SENT_BUFFER_KEY);n=this.removePayloadsFromBuffer(t,n),this.setBuffer(e.SENT_BUFFER_KEY,n)},e.prototype.removePayloadsFromBuffer=function(e,t){var n=[];for(var i in t){var r=!1;for(var o in e)if(e[o]===t[i]){r=!0;break}r||n.push(t[i])}return n},e.prototype.getBuffer=function(e){try{var t=n.Util.getSessionStorage(e);if(t){var i=JSON.parse(t);if(i)return i}}catch(t){n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.FailedToRestoreStorageBuffer," storage key: "+e+", "+n.Util.getExceptionName(t),{exception:n.Util.dump(t)})}return[]},e.prototype.setBuffer=function(e,t){try{var i=JSON.stringify(t);n.Util.setSessionStorage(e,i)}catch(t){n.Util.setSessionStorage(e,JSON.stringify([])),n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.FailedToSetStorageBuffer," storage key: "+e+", "+n.Util.getExceptionName(t)+". Buffer cleared",{exception:n.Util.dump(t)})}},e.BUFFER_KEY="AI_buffer",e.SENT_BUFFER_KEY="AI_sentBuffer",e.MAX_BUFFER_SIZE=2e3,e}();t.SessionStorageSendBuffer=r}.apply(t,i))||(e.exports=r)},function(e,t,n){var i,r,o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();i=[n,t,n(0),n(4)],void 0===(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextTagKeys=["ai.application.ver","ai.application.build","ai.application.typeId","ai.application.applicationId","ai.application.layer","ai.device.id","ai.device.ip","ai.device.language","ai.device.locale","ai.device.model","ai.device.friendlyName","ai.device.network","ai.device.networkName","ai.device.oemName","ai.device.os","ai.device.osVersion","ai.device.roleInstance","ai.device.roleName","ai.device.screenResolution","ai.device.type","ai.device.machineName","ai.device.vmName","ai.device.browser","ai.device.browserVersion","ai.location.ip","ai.location.country","ai.location.province","ai.location.city","ai.operation.id","ai.operation.name","ai.operation.parentId","ai.operation.rootId","ai.operation.syntheticSource","ai.operation.correlationVector","ai.session.id","ai.session.isFirst","ai.session.isNew","ai.user.accountAcquisitionDate","ai.user.accountId","ai.user.userAgent","ai.user.id","ai.user.storeRegion","ai.user.authUserId","ai.user.anonUserAcquisitionDate","ai.user.authUserAcquisitionDate","ai.cloud.name","ai.cloud.role","ai.cloud.roleVer","ai.cloud.roleInstance","ai.cloud.environment","ai.cloud.location","ai.cloud.deploymentUnit","ai.internal.sdkVersion","ai.internal.agentVersion","ai.internal.nodeName"];var r=function(){function e(){}return e.extractProperties=function(e){var t=null;for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];"number"!=typeof i&&(t||(t={}),t[n]=i)}return t},e.extractPropsAndMeasurements=function(e,t,n){if(!i.CoreUtils.isNullOrUndefined(e))for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];"number"==typeof o?n[r]=o:t[r]=o}},e.createEnvelope=function(e,i,r){var o=new n.Envelope(r,e);o.iKey=i.instrumentationKey;var a=i.instrumentationKey.replace(/-/g,"");for(var s in o.name=o.name.replace("{0}",a),i.ctx)i.ctx.hasOwnProperty(s)&&t.ContextTagKeys.indexOf(s)>=0&&(o.tags[s]=i.ctx[s]);return i.tags.forEach(function(e){for(var n in e)e.hasOwnProperty(n)&&t.ContextTagKeys.indexOf(n)>=0&&(o.tags[n]=e[n])}),o},e}();t.EnvelopeCreator=r;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,o,t);var a=e.baseData.id,s=e.baseData.absoluteUrl,l=e.baseData.command,c=e.baseData.totalTime,u=e.baseData.success,p=e.baseData.resultCode,d=e.baseData.method,f=new n.RemoteDependencyData(a,s,l,c,u,p,d,o,t),g=new n.Data(n.RemoteDependencyData.dataType,f);return r.createEnvelope(n.RemoteDependencyData.envelopeType,e,g)},t.DependencyEnvelopeCreator=new t,t}(r);t.DependencyEnvelopeCreator=a;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,t,o);var a=e.baseData.name,s=new n.Event(a,t,o),l=new n.Data(n.Event.dataType,s);return r.createEnvelope(n.Event.envelopeType,e,l)},t.EventEnvelopeCreator=new t,t}(r);t.EventEnvelopeCreator=s;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,t,o);var a=e.baseData.exception,s=e.baseData.severityLevel,l=new n.Exception(a,t,o,s),c=new n.Data(n.Exception.dataType,l);return r.createEnvelope(n.Exception.envelopeType,e,c)},t.ExceptionEnvelopeCreator=new t,t}(r);t.ExceptionEnvelopeCreator=l;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t=r.extractProperties(e.data),o=e.baseData.name,a=e.baseData.average,s=e.baseData.sampleCount,l=e.baseData.min,c=e.baseData.max,u=new n.Metric(o,a,s,l,c,t),p=new n.Data(n.Metric.dataType,u);return r.createEnvelope(n.Metric.envelopeType,e,p)},t.MetricEnvelopeCreator=new t,t}(r);t.MetricEnvelopeCreator=c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,t,o);var a=e.baseData.name,s=e.baseData.uri,l=e.baseData.duration;if(i.CoreUtils.isNullOrUndefined(e.baseData.refUri)||(t.refUri=e.baseData.refUri),i.CoreUtils.isNullOrUndefined(e.baseData.pageType)||(t.pageType=e.baseData.pageType),i.CoreUtils.isNullOrUndefined(e.baseData.isLoggedIn)||(t.isLoggedIn=e.baseData.isLoggedIn),!i.CoreUtils.isNullOrUndefined(e.baseData.pageTags)){var c=e.baseData.pageTags;for(var u in c)c.hasOwnProperty(u)&&(t[u]=c[u])}var p=new n.PageView(a,s,l,t,o),d=new n.Data(n.PageView.dataType,p);return r.createEnvelope(n.PageView.envelopeType,e,d)},t.PageViewEnvelopeCreator=new t,t}(r);t.PageViewEnvelopeCreator=u;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t={},o={};r.extractPropsAndMeasurements(e.data,t,o);var a=e.baseData.name,s=e.baseData.uri,l=e.baseData.duration,c=new n.PageViewPerformance(a,s,l,t,o),u=new n.Data(n.PageViewPerformance.dataType,c);return r.createEnvelope(n.PageViewPerformance.envelopeType,e,u)},t.PageViewPerformanceEnvelopeCreator=new t,t}(r);t.PageViewPerformanceEnvelopeCreator=p;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.Create=function(e){i.CoreUtils.isNullOrUndefined(e.baseData)&&n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.");var t=e.baseData.message,o=e.baseData.severityLevel,a=r.extractProperties(e.data),s=new n.Trace(t,a,o),l=new n.Data(n.Trace.dataType,s);return r.createEnvelope(n.Trace.envelopeType,e,l)},t.TraceEnvelopeCreator=new t,t}(r);t.TraceEnvelopeCreator=d}.apply(t,i))||(e.exports=r)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.EventValidator=new e,e}();t.EventValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.TraceValidator=new e,e}();t.TraceValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e._validateExceptions=function(e){return!0},e.ExceptionValidator=new e,e}();t.ExceptionValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.PageViewPerformanceValidator=new e,e}();t.PageViewPerformanceValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.PageViewValidator=new e,e}();t.PageViewValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i;void 0===(i=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.RemoteDepdencyValidator=new e,e}();t.RemoteDepdencyValidator=n}.apply(t,[n,t]))||(e.exports=i)},function(e,t,n){var i,r;i=[n,t,n(0)],void 0===(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.serialize=function(t){var n=e._serializeObject(t,"root");return JSON.stringify(n)},e._serializeObject=function(t,i){var r={};if(!t)return n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.CannotSerializeObject,"cannot serialize object because it is null or undefined",{name:i},!0),r;if(t.__aiCircularRefCheck)return n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.CircularReferenceDetected,"Circular reference detected while serializing object",{name:i},!0),r;if(!t.aiDataContract){if("measurements"===i)r=e._serializeStringMap(t,"number",i);else if("properties"===i)r=e._serializeStringMap(t,"string",i);else if("tags"===i)r=e._serializeStringMap(t,"string",i);else if(n.Util.isArray(t))r=e._serializeArray(t,i);else{n._InternalLogging.throwInternal(n.LoggingSeverity.WARNING,n._InternalMessageId.CannotSerializeObjectNonSerializable,"Attempting to serialize an object which does not implement ISerializable",{name:i},!0);try{JSON.stringify(t),r=t}catch(e){n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.CannotSerializeObject,e&&"function"==typeof e.toString?e.toString():"Error serializing object",null,!0)}}return r}for(var o in t.__aiCircularRefCheck=!0,t.aiDataContract){var a,s=t.aiDataContract[o],l="function"==typeof s?s()&n.FieldType.Required:s&n.FieldType.Required,c="function"==typeof s?s()&n.FieldType.Hidden:s&n.FieldType.Hidden,u=s&n.FieldType.Array,p=void 0!==t[o],d="object"==typeof t[o]&&null!==t[o];if(!l||p||u){if(!c)void 0!==(a=d?u?e._serializeArray(t[o],o):e._serializeObject(t[o],o):t[o])&&(r[o]=a)}else n._InternalLogging.throwInternal(n.LoggingSeverity.CRITICAL,n._InternalMessageId.MissingRequiredFieldSpecification,"Missing required field specification. The field is required but not present on source",{field:o,name:i})}return delete t.__aiCircularRefCheck,r},e._serializeArray=function(t,i){var r=void 0;if(t)if(n.Util.isArray(t)){r=[];for(var o=0;o= 1.0.0" }, "dependencies": { "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/applicationinsights-analytics-js": "3.4.1", "@microsoft/applicationinsights-channel-js": "3.4.1", "@microsoft/applicationinsights-cfgsync-js": "3.4.1", "@microsoft/applicationinsights-core-js": "3.4.1", "@microsoft/applicationinsights-dependencies-js": "3.4.1", "@microsoft/applicationinsights-properties-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x", "@nevware21/ts-async": ">= 0.5.5 < 2.x" }, "license": "MIT" } ================================================ FILE: AISKU/rollup.config.js ================================================ import { createConfig } from "../rollup.base.config"; import { updateDistEsmFiles } from "../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const browserEntryPointName = "Init"; const browserOutputName = "ai"; const entryPointName = "applicationinsights-web"; const outputName = "applicationinsights-web"; const banner = [ "/*!", ` * Application Insights JavaScript SDK - Web, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the MIT License.": "" }; updateDistEsmFiles(replaceValues, banner, true, true, "dist-es5"); export default createConfig(banner, { namespace: "Microsoft.ApplicationInsights", version: version, node: { entryPoint: entryPointName, outputName: outputName }, browser: { entryPoint: browserEntryPointName, outputName: browserOutputName } }, [ "applicationinsights-web" ]); ================================================ FILE: AISKU/samples/HelloWorld/index-snippet.html ================================================ Hello World!

    Hello World!

    trackException manual tests ================================================ FILE: AISKU/scripts/README.md ================================================ # Application Insights JavaScript SDK deployment scripts ## Deployment Scripts This folder contains PowerShell scripts to assist with the deployment of releases. The scripts require that the user (or automated runner) has the required access for the specified Azure Storage Account. If you don't have access to the requested account / subscription the scripts will fail with an error message. Each script will create a log file in the specified logs folder (defaults to :\Logs if not otherwise specified), this can be changed by passing ``-logPath ""`` command-line argument to each script. The Scripts and examples are included below, but as a summary they are | Script Name | Description |-------------|------------ | ./publishAzReleaseToCdn.ps1 | Publish (Copy) the created resource files from the `browser/` folder to the Azure Storage account used as the source for the CDN. | ./setAzActiveCdnVersion.ps1 | Set the available version of the major (ai.2.min.js) and minor (ai.2.#.min.js) to the previously deployed target version. | ./listAzCdnVersions.ps1 | List the versions of the resources that are deployed to the Azure Storage account, identifying the associated properties and metadata. Optionally, listing the individual files. ### ./publishAzReleaseToCdn.ps1 This script has been created to automate the deployment of the CDN resources at the same time as publishing of the NPM packages. This script will publish the full version (v2.#.#) of the current build to all staging folders (beta, next and public) of the source storage account, it does NOT change the major (ai.2.min.js) or minor (ai.2.#.min.js) release versions __Command line arguments__ | Name | Type | Description |------|------|---------------- | releaseFrom | string | [Optional] Identifies the location of the `package.json` and `browser/` folders are located as these are the source locations of the release. The version number of read from the `package.json` file and then the named version files are read from the `browser/` folder. Defaults to the parent folder of where the script is running from. | cdnStorePath | string | [Optional] Identifies the target Azure Storage account (by name) where the files will be uploaded to. As you may have access to multiple subscriptions, resource groups, and storage accounts (which can slow the automatic validation / identification process) you can optionally include the a partial subscription id and resource group name with the storage account name. So you can specify the target using any of the following 3 forms :-
    - <Full storage account name>
    - <partial or full subscription id>::<Full storage account name>
    - <partial or full subscription id>::<Full resource group name>::<Full storage account name>
    The subscription id is used to match against the collection of subscription id's that the user/runner has access to, it uses the PowerShell -like matching by wrapping the value in '*'
    When a resource group name is supplied it will further limit the collection of storage accounts that are scanned / checked for the storage account name.
    Example: `"65b2f83e::tstcdnstore"` | sasToken | string | [Optional] For automated deployments, it is recommended that you pass in a pre-generated Shared Access Signature (SAS) Token to avoid the script attempting to login the user which could cause a blocking UI to be displayed. When supplied the script bypasses the automated scan / checks and will just used the identified storage account name from the `cdnStorePath` argument. If this value is not specified the script will ensure that the user is logged into azure (displaying a login UI), enumerate all of the subscription Id's for the user to find full location of the storage account identified by the `cdnStorePath` argument, once identified it will then Generate a new SAS token for the script (as long as the user has permissions) for the target subscription. | logPath | string | [Optional] Identifies the location where the automatic log file will be written. Defaults to :\Logs | overwrite | switch | By default the script will NOT overwrite any existing Blob with the same name in each container as it sets the CacheControl period to 1yr. As such this flag is provided primarily for testing and validation purposes, passing this switch will include the "-Force" switch for the Azure RM PowerShell functions to cause any existing blob to be overwritten. | testOnly | switch | [Optional] By default the script will upload to the production containers (beta, next and scripts), for testing this switch will effectively cause the files to be uploaded to the "tst" container with and the normal container names will instead be prepended (simulating folders) to the name. ([tst] scripts/b/ai.2.min.js) | useConnectedAccount | switch | [Optional] By default the script will use the current logged in user to authenticate with Azure using SAS tokens, if you have disabled SAS token support for the storage account then you will need to use this switch and grant the user "Storage Blob Data Contributor" role. #### Example Usage and output From the <repo>/AISKU/scripts folder in a powershell environment ~~~~ PS D:\git\ApplicationInsights-JS\AISKU\scripts> .\publishAzReleaseToCdn.ps1 -cdnStorePath "65b2f83e::tstcdnstore" [06/29/20 16:34:45] Store Path: 65b2f83e::tstcdnstore [06/29/20 16:34:45] Overwrite : False [06/29/20 16:34:45] Test Mode : False [06/29/20 16:34:45] SourcePath: D:\git\ApplicationInsights-JS\AISKU [06/29/20 16:34:45] Log Path : C:\Logs [06/29/20 16:34:45] Mode : Manual [06/29/20 16:34:45] Importing Module AzureRM.Profile for Login-AzureRMAccount [06/29/20 16:34:45] Importing Module AzureRM.Storage for Get-AzureRmStorageAccount [06/29/20 16:34:45] ---------------------------------------------------------------------- [06/29/20 16:34:45] Subscription: 65b2f83e [06/29/20 16:34:45] StoreName : tstcdnstore [06/29/20 16:34:45] ---------------------------------------------------------------------- [06/29/20 16:34:45] ********************************************************************** [06/29/20 16:34:45] Generating SAS token for user [06/29/20 16:34:45] ********************************************************************** [06/29/20 16:34:45] Checking Logged in status. [06/29/20 16:34:46] Finding Subscriptions [06/29/20 16:34:49] Finding Storage Account [06/29/20 16:34:49] Checking Subscription 65b2f83e-7af2-4bc3-0123-456789abcfef [06/29/20 16:34:55] - Found Candidate Subscription 65b2f83e-7af2-4bc3-0123-456789abcfef [06/29/20 16:34:55] Generating SAS Token for [06/29/20 16:34:55] Subscription: 65b2f83e-7af2-4bc3-0123-456789abcfef [06/29/20 16:34:55] Group : test [06/29/20 16:34:55] StoreName : tstcdnstore [06/29/20 16:34:56] ====================================================================== [06/29/20 16:34:56] Releasing from : D:\git\ApplicationInsights-JS\AISKU [06/29/20 16:34:56] Version : 2.4.1 [06/29/20 16:34:56] Adding files [06/29/20 16:34:56] - D:\git\ApplicationInsights-JS\AISKU\browser\ai.2.4.1.js [06/29/20 16:34:56] - D:\git\ApplicationInsights-JS\AISKU\browser\ai.2.4.1.js.map [06/29/20 16:34:56] - D:\git\ApplicationInsights-JS\AISKU\browser\ai.2.4.1.min.js [06/29/20 16:34:56] - D:\git\ApplicationInsights-JS\AISKU\browser\ai.2.4.1.min.js.map [06/29/20 16:34:56] Release Files : 4 [06/29/20 16:34:56] ---------------------------------------------------------------------- [06/29/20 16:34:56] Container : beta Prefix: [06/29/20 16:34:56] Using Cache Control: public, max-age=31536000, immutable [06/29/20 16:34:56] [WRN] ai.2.4.1.js is already present [06/29/20 16:34:56] [WRN] ai.2.4.1.js.map is already present [06/29/20 16:34:56] [WRN] ai.2.4.1.min.js is already present [06/29/20 16:34:56] [WRN] ai.2.4.1.min.js.map is already present [06/29/20 16:34:56] Container : next Prefix: [06/29/20 16:34:56] Using Cache Control: public, max-age=31536000, immutable [06/29/20 16:34:56] [WRN] ai.2.4.1.js is already present [06/29/20 16:34:56] [WRN] ai.2.4.1.js.map is already present [06/29/20 16:34:56] [WRN] ai.2.4.1.min.js is already present [06/29/20 16:34:56] [WRN] ai.2.4.1.min.js.map is already present [06/29/20 16:34:56] Container : scripts Prefix: b/ [06/29/20 16:34:56] Using Cache Control: public, max-age=31536000, immutable [06/29/20 16:34:57] [WRN] b/ai.2.4.1.js is already present [06/29/20 16:34:57] [WRN] b/ai.2.4.1.js.map is already present [06/29/20 16:34:57] [WRN] b/ai.2.4.1.min.js is already present [06/29/20 16:34:57] [WRN] b/ai.2.4.1.min.js.map is already present [06/29/20 16:34:57] ====================================================================== ~~~~ ### ./setAzActiveCdnVersion.ps1 This script will set the active release for the specified release folder (beta, next, public) to the requested full version (2.x.x) number. By default it will set both the major (ai.2.min.js) and minor (ai.2.x.min.js) versions to the requested full version, you can optionally only update the minor version. > :bulb: **Note** > > Note: The script does NOT use any local files to upload as the active versions, the full version MUST have already been deployed to the requested folder within the storage account. The script will validate and fail if the requested version is not available. __Command line arguments__ | Name | Type | Description |------|------|---------------- | container | string | __[Required]__ Identifies the target container to update (beta, next, public) | activeVersion | string | __[Required]__ Identifies the source full version number to copy and make the active released version fro the specified container. This MUST be the full version number in the form "a.b.c". The new active versions will be created (or overwritten) as the major version (ai.[a].min.js) and minor version (ai.[a].[b].min.js). | cdnStorePath | string | [Optional] Identifies the target Azure Storage account (by name) where the files will be uploaded to. As you may have access to multiple subscriptions, resource groups, and storage accounts (which can slow the automatic validation / identification process) you can optionally include the a partial subscription id and resource group name with the storage account name. So you can specify the target using any of the following 3 forms :-
    - <Full storage account name>
    - <partial or full subscription id>::<Full storage account name>
    - <partial or full subscription id>::<Full resource group name>::<Full storage account name>
    The subscription id is used to match against the collection of subscription id's that the user/runner has access to, it uses the PowerShell -like matching by wrapping the value in '*'
    When a resource group name is supplied it will further limit the collection of storage accounts that are scanned / checked for the storage account name.
    Example: `"65b2f83e::tstcdnstore"` | sasToken | string | [Optional] For automated deployments, it is recommended that you pass in a pre-generated Shared Access Signature (SAS) Token to avoid the script attempting to login the user which could cause a blocking UI to be displayed. When supplied the script bypasses the automated scan / checks and will just used the identified storage account name from the `cdnStorePath` argument. If this value is not specified the script will ensure that the user is logged into azure (displaying a login UI), enumerate all of the subscription Id's for the user to find full location of the storage account identified by the `cdnStorePath` argument, once identified it will then Generate a new SAS token for the script (as long as the user has permissions) for the target subscription. | logPath | string | [Optional] Identifies the location where the automatic log file will be written. Defaults to :\Logs | minorOnly | switch | By default the script will update both the major (ai.2.min.js) and minor (ai.2.#.min.js) available versions of the script. If this switch is set it will only update the minor version (ai.2.#.min.js) and the major version (ai.2.min.js) will be unaffected. | testOnly | switch | [Optional] By default the script will update the production containers (beta, next and scripts), for testing this switch will effectively only update the "tst" container versions with and the normal container names will instead be prepended (simulating folders) to the name. ([tst] scripts/b/ai.2.min.js) | useConnectedAccount | switch | [Optional] By default the script will use the current logged in user to authenticate with Azure using SAS tokens, if you have disabled SAS token support for the storage account then you will need to use this switch and grant the user "Storage Blob Data Contributor" role. #### Example Usage and output From the <repo>/AISKU/scripts folder in a powershell environment ~~~~ PS D:\git\ApplicationInsights-JS\AISKU\scripts> .\setAzActiveCdnVersion.ps1 public 2.4.1 -cdnStorePath "65b2f83e::tstcdnstore" [06/29/20 17:49:20] Container : public [06/29/20 17:49:20] Version : 2.4.1 [06/29/20 17:49:20] Store Path: 65b2f83e::tstcdnstore [06/29/20 17:49:20] Test Mode : False [06/29/20 17:49:20] Log Path : C:\Logs [06/29/20 17:49:20] Mode : Manual [06/29/20 17:49:20] Importing Module AzureRM.Profile for Login-AzureRMAccount [06/29/20 17:49:20] Importing Module AzureRM.Storage for Get-AzureRmStorageAccount [06/29/20 17:49:20] ---------------------------------------------------------------------- [06/29/20 17:49:20] Subscription: 65b2f83e [06/29/20 17:49:20] StoreName : tstcdnstore [06/29/20 17:49:20] ---------------------------------------------------------------------- [06/29/20 17:49:20] ********************************************************************** [06/29/20 17:49:20] Generating SAS token for user [06/29/20 17:49:20] ********************************************************************** [06/29/20 17:49:20] Checking Logged in status. [06/29/20 17:49:28] Finding Subscriptions [06/29/20 17:49:33] Finding Storage Account [06/29/20 17:49:33] Checking Subscription 65b2f83e-7af2-4bc3-0123-456789abcfef [06/29/20 17:49:37] - Found Candidate Subscription 65b2f83e-7af2-4bc3-0123-456789abcfef [06/29/20 17:49:37] Generating SAS Token for [06/29/20 17:49:37] Subscription: 65b2f83e-7af2-4bc3-0123-456789abcfef [06/29/20 17:49:37] Group : test [06/29/20 17:49:37] StoreName : tstcdnstore [06/29/20 17:49:37] ====================================================================== [06/29/20 17:49:37] Container : scripts Prefix: b/ [06/29/20 17:49:39] - scripts/b/ai.2.4.1.js 445.0 Kb 2020-06-29 21:52:17 [06/29/20 17:49:39] - scripts/b/ai.2.4.1.js.map 761.4 Kb 2020-06-29 21:52:17 [06/29/20 17:49:39] - scripts/b/ai.2.4.1.min.js 126.9 Kb 2020-06-29 21:52:17 [06/29/20 17:49:39] - scripts/b/ai.2.4.1.min.js.map 621.8 Kb 2020-06-29 21:52:17 [06/29/20 17:49:39] Container : scripts Prefix: b/ [06/29/20 17:49:39] Storage Path : scripts/b [06/29/20 17:49:39] Container : scripts [06/29/20 17:49:39] BlobPrefix: b/ [06/29/20 17:49:39] Copying: scripts/b/ai.2.4.1.js 445.0 Kb 2020-06-29 21:52:17 [06/29/20 17:49:39] - b/ai.2.4.1.js ==> b/ai.2.4.js.stage [06/29/20 17:49:39] - b/ai.2.4.js.stage ==> b/ai.2.4.js [06/29/20 17:49:40] - b/ai.2.4.js.stage ==> b/ai.2.js [06/29/20 17:49:40] Copying: scripts/b/ai.2.4.1.js.map 761.4 Kb 2020-06-29 21:52:17 [06/29/20 17:49:40] - b/ai.2.4.1.js.map ==> b/ai.2.4.js.map.stage [06/29/20 17:49:41] - b/ai.2.4.js.map.stage ==> b/ai.2.4.js.map [06/29/20 17:49:42] - b/ai.2.4.js.map.stage ==> b/ai.2.js.map [06/29/20 17:49:42] Copying: scripts/b/ai.2.4.1.min.js 126.9 Kb 2020-06-29 21:52:17 [06/29/20 17:49:42] - b/ai.2.4.1.min.js ==> b/ai.2.4.min.js.stage [06/29/20 17:49:43] - b/ai.2.4.min.js.stage ==> b/ai.2.4.min.js [06/29/20 17:49:44] - b/ai.2.4.min.js.stage ==> b/ai.2.min.js [06/29/20 17:49:44] Copying: scripts/b/ai.2.4.1.min.js.map 621.8 Kb 2020-06-29 21:52:17 [06/29/20 17:49:44] - b/ai.2.4.1.min.js.map ==> b/ai.2.4.min.js.map.stage [06/29/20 17:49:45] - b/ai.2.4.min.js.map.stage ==> b/ai.2.4.min.js.map [06/29/20 17:49:46] - b/ai.2.4.min.js.map.stage ==> b/ai.2.min.js.map [06/29/20 17:49:47] ====================================================================== ~~~~ ### ./listAzCdnVersions.ps1 This script will list all of the currently deployed application insights versions that are available via the CDN, this script does not change any of the deployed or active versions. > :bulb: **Note** > > Note: No deployed files are modified by this script, it only enumerates the files that have already been deployed to the storage account. __Command line arguments__ | Name | Type | Description |------|------|---------------- | container | string | __[Optional]__ Identifies the single target container to list the available versions for (beta, next, public). If not specified all containers will be enumerated. | cdnStorePath | string | [Optional] Identifies the target Azure Storage account (by name) where the files will be uploaded to. As you may have access to multiple subscriptions, resource groups, and storage accounts (which can slow the automatic validation / identification process) you can optionally include the a partial subscription id and resource group name with the storage account name. So you can specify the target using any of the following 3 forms :-
    - <Full storage account name>
    - <partial or full subscription id>::<Full storage account name>
    - <partial or full subscription id>::<Full resource group name>::<Full storage account name>
    The subscription id is used to match against the collection of subscription id's that the user/runner has access to, it uses the PowerShell -like matching by wrapping the value in '*'
    When a resource group name is supplied it will further limit the collection of storage accounts that are scanned / checked for the storage account name.
    Example: `"65b2f83e::tstcdnstore"` | sasToken | string | [Optional] For automated deployments, it is recommended that you pass in a pre-generated Shared Access Signature (SAS) Token to avoid the script attempting to login the user which could cause a blocking UI to be displayed. When supplied the script bypasses the automated scan / checks and will just used the identified storage account name from the `cdnStorePath` argument. If this value is not specified the script will ensure that the user is logged into azure (displaying a login UI), enumerate all of the subscription Id's for the user to find full location of the storage account identified by the `cdnStorePath` argument, once identified it will then Generate a new SAS token for the script (as long as the user has permissions) for the target subscription. | logPath | string | [Optional] Identifies the location where the automatic log file will be written. Defaults to :\Logs | showFiles | switch | [Optional] Identifies whether the details of each located blob should be listed, this includes the CacheControl and metadata for each file | testOnly | switch | [Optional] By default the script will update the production containers (beta, next and scripts), for testing this switch will effectively only update the "tst" container versions with and the normal container names will instead be prepended (simulating folders) to the name. ([tst] scripts/b/ai.2.min.js) | useConnectedAccount | switch | [Optional] By default the script will use the current logged in user to authenticate with Azure using SAS tokens, if you have disabled SAS token support for the storage account then you will need to use this switch and grant the user "Storage Blob Data Contributor" role. #### Example Usages and output From the <repo>/AISKU/scripts folder in a powershell environment ~~~~ PS D:\git\ApplicationInsights-JS\AISKU\scripts> .\listAzCdnVersions.ps1 -cdnStorePath "65b2f83e::tstcdnstore" [06/29/20 18:29:15] Container : [06/29/20 18:29:15] Store Path: 65b2f83e::tstcdnstore [06/29/20 18:29:15] Log Path : C:\Logs [06/29/20 18:29:15] Show Files: False [06/29/20 18:29:15] Test Mode : False [06/29/20 18:29:15] Mode : Manual [06/29/20 18:29:15] Importing Module AzureRM.Profile for Login-AzureRMAccount [06/29/20 18:29:15] Importing Module AzureRM.Storage for Get-AzureRmStorageAccount [06/29/20 18:29:15] ---------------------------------------------------------------------- [06/29/20 18:29:15] Subscription: 65b2f83e [06/29/20 18:29:15] StoreName : tstcdnstore [06/29/20 18:29:15] ---------------------------------------------------------------------- [06/29/20 18:29:15] ********************************************************************** [06/29/20 18:29:15] Generating SAS token for user [06/29/20 18:29:15] ********************************************************************** [06/29/20 18:29:15] Checking Logged in status. [06/29/20 18:29:16] Finding Subscriptions [06/29/20 18:29:37] Finding Storage Account [06/29/20 18:29:37] Checking Subscription 65b2f83e-7af2-4bc3-0123-456789abcfef [06/29/20 18:29:59] - Found Candidate Subscription 65b2f83e-7af2-4bc3-0123-456789abcfef [06/29/20 18:29:59] Generating SAS Token for [06/29/20 18:29:59] Subscription: 65b2f83e-7af2-4bc3-0123-456789abcfef [06/29/20 18:29:59] Group : test [06/29/20 18:29:59] StoreName : tstcdnstore [06/29/20 18:30:00] ====================================================================== [06/29/20 18:30:00] Container : beta Prefix: [06/29/20 18:30:01] Container : next Prefix: [06/29/20 18:30:03] Container : scripts Prefix: b/ [06/29/20 18:30:03] v2 (12) - [beta]/ai.2.5.3.js [next]/ai.2.5.5.js [scripts]/b/ai.2.4.1.js [06/29/20 18:30:03] v2.4 (12) - [beta]/ai.2.4.2.js [next]/ai.2.4.1.js [scripts]/b/ai.2.4.1.js [06/29/20 18:30:03] v2.4.1 (12) - beta/ next/ scripts/b/ [06/29/20 18:30:03] v2.4.2 (12) - beta/ next/ scripts/b/ [06/29/20 18:30:03] v2.5 ( 8) - [beta]/ai.2.5.3.js [next]/ai.2.5.5.js [06/29/20 18:30:03] v2.5.0 (12) - beta/ next/ scripts/b/ [06/29/20 18:30:03] v2.5.1 (12) - beta/ next/ scripts/b/ [06/29/20 18:30:03] v2.5.2 (12) - beta/ next/ scripts/b/ [06/29/20 18:30:03] v2.5.3 (12) - beta/ next/ scripts/b/ [06/29/20 18:30:03] v2.5.4 ( 2) - beta/ scripts/b/ [06/29/20 18:30:03] v2.5.5 ( 8) - next/ scripts/b/ [06/29/20 18:30:03] ====================================================================== ~~~~ And listing the individual the files ~~~~ PS D:\git\ApplicationInsights-JS\AISKU\scripts> .\listAzCdnVersions.ps1 public -showFiles -cdnStorePath "65b2f83e::tstcdnstore" [06/29/20 18:31:24] Container : public [06/29/20 18:31:24] Store Path: 65b2f83e::tstcdnstore [06/29/20 18:31:24] Log Path : C:\Logs [06/29/20 18:31:24] Show Files: True [06/29/20 18:31:24] Test Mode : False [06/29/20 18:31:24] Mode : Manual [06/29/20 18:31:24] Importing Module AzureRM.Profile for Login-AzureRMAccount [06/29/20 18:31:24] Importing Module AzureRM.Storage for Get-AzureRmStorageAccount [06/29/20 18:31:24] ---------------------------------------------------------------------- [06/29/20 18:31:24] Subscription: 65b2f83e [06/29/20 18:31:24] StoreName : tstcdnstore [06/29/20 18:31:24] ---------------------------------------------------------------------- [06/29/20 18:31:24] ********************************************************************** [06/29/20 18:31:24] Generating SAS token for user [06/29/20 18:31:24] ********************************************************************** [06/29/20 18:31:24] Checking Logged in status. [06/29/20 18:31:26] Finding Subscriptions WARNING: Unable to acquire token for tenant '1309900a-b9a9-46b6-975d-d3d85f87aa28' [06/29/20 18:31:47] Finding Storage Account [06/29/20 18:31:47] Checking Subscription 65b2f83e-7af2-4bc3-0123-456789abcfef [06/29/20 18:32:10] - Found Candidate Subscription 65b2f83e-7af2-4bc3-0123-456789abcfef [06/29/20 18:32:10] Generating SAS Token for [06/29/20 18:32:10] Subscription: 65b2f83e-7af2-4bc3-0123-456789abcfef [06/29/20 18:32:10] Group : test [06/29/20 18:32:10] StoreName : tstcdnstore [06/29/20 18:32:10] ====================================================================== [06/29/20 18:32:10] Container : scripts Prefix: b/ [06/29/20 18:32:12] v2 ( 4) [06/29/20 18:32:12] - scripts/b/ai.2.js v2.4.1 445.0 Kb 2020-06-30 00:49:40 pub 30m im aijssdksrc=[scripts]/b/ai.2.4.1.js; [06/29/20 18:32:12] - scripts/b/ai.2.js.map v2.4.1 761.4 Kb 2020-06-30 00:49:42 pub 30m im aijssdksrc=[scripts]/b/ai.2.4.1.js.map; [06/29/20 18:32:12] - scripts/b/ai.2.min.js v2.4.1 126.9 Kb 2020-06-30 00:49:44 pub 30m im aijssdksrc=[scripts]/b/ai.2.4.1.min.js; [06/29/20 18:32:12] - scripts/b/ai.2.min.js.map v2.4.1 621.8 Kb 2020-06-30 00:49:47 pub 30m im aijssdksrc=[scripts]/b/ai.2.4.1.min.js.map; [06/29/20 18:32:12] v2.4 ( 4) [06/29/20 18:32:13] - scripts/b/ai.2.4.js v2.4.1 445.0 Kb 2020-06-30 00:49:40 pub 30m im aijssdksrc=[scripts]/b/ai.2.4.1.js; [06/29/20 18:32:13] - scripts/b/ai.2.4.js.map v2.4.1 761.4 Kb 2020-06-30 00:49:42 pub 30m im aijssdksrc=[scripts]/b/ai.2.4.1.js.map; [06/29/20 18:32:13] - scripts/b/ai.2.4.min.js v2.4.1 126.9 Kb 2020-06-30 00:49:44 pub 30m im aijssdksrc=[scripts]/b/ai.2.4.1.min.js; [06/29/20 18:32:13] - scripts/b/ai.2.4.min.js.map v2.4.1 621.8 Kb 2020-06-30 00:49:46 pub 30m im aijssdksrc=[scripts]/b/ai.2.4.1.min.js.map; [06/29/20 18:32:13] v2.4.1 ( 4) [06/29/20 18:32:13] - scripts/b/ai.2.4.1.js v2.4.1 445.0 Kb 2020-06-29 21:52:17 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.4.1.js.map v2.4.1 761.4 Kb 2020-06-29 21:52:17 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.4.1.min.js v2.4.1 126.9 Kb 2020-06-29 21:52:17 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.4.1.min.js.map v2.4.1 621.8 Kb 2020-06-29 21:52:17 pub 1yr im [06/29/20 18:32:13] v2.4.2 ( 4) [06/29/20 18:32:13] - scripts/b/ai.2.4.2.js v2.4.2 445.0 Kb 2020-06-29 20:18:47 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.4.2.js.map v2.4.2 761.4 Kb 2020-06-29 20:18:47 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.4.2.min.js v2.4.2 126.9 Kb 2020-06-29 20:18:48 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.4.2.min.js.map v2.4.2 621.8 Kb 2020-06-29 20:18:48 pub 1yr im [06/29/20 18:32:13] v2.5.0 ( 4) [06/29/20 18:32:13] - scripts/b/ai.2.5.0.js v2.5.0 445.0 Kb 2020-06-29 19:56:15 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.0.js.map v2.5.0 761.4 Kb 2020-06-29 19:56:15 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.0.min.js v2.5.0 126.9 Kb 2020-06-29 19:56:16 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.0.min.js.map v2.5.0 621.8 Kb 2020-06-29 19:56:16 pub 1yr im [06/29/20 18:32:13] v2.5.1 ( 4) [06/29/20 18:32:13] - scripts/b/ai.2.5.1.js v2.5.1 445.0 Kb 2020-06-29 19:51:49 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.1.js.map v2.5.1 761.4 Kb 2020-06-29 19:51:50 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.1.min.js v2.5.1 126.9 Kb 2020-06-29 19:51:50 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.1.min.js.map v2.5.1 621.8 Kb 2020-06-29 19:51:50 pub 1yr im [06/29/20 18:32:13] v2.5.2 ( 4) [06/29/20 18:32:13] - scripts/b/ai.2.5.2.js v2.5.2 445.0 Kb 2020-06-29 20:07:06 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.2.js.map v2.5.2 761.4 Kb 2020-06-29 20:07:06 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.2.min.js v2.5.2 126.9 Kb 2020-06-29 20:07:06 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.2.min.js.map v2.5.2 621.8 Kb 2020-06-29 20:07:07 pub 1yr im [06/29/20 18:32:13] v2.5.3 ( 4) [06/29/20 18:32:13] - scripts/b/ai.2.5.3.js v2.5.3 445.0 Kb 2020-06-29 20:12:50 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.3.js.map v2.5.3 761.4 Kb 2020-06-29 20:12:50 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.3.min.js v2.5.3 126.9 Kb 2020-06-29 20:12:51 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.3.min.js.map v2.5.3 621.8 Kb 2020-06-29 20:12:51 pub 1yr im [06/29/20 18:32:13] v2.5.4 ( 1) [06/29/20 18:32:13] - scripts/b/ai.2.5.4.js --- 445.0 Kb 2020-06-25 00:14:26 pub 1yr im [06/29/20 18:32:13] v2.5.5 ( 4) [06/29/20 18:32:13] - scripts/b/ai.2.5.5.js v2.5.5 445.0 Kb 2020-06-29 19:28:29 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.5.js.map v2.5.5 761.4 Kb 2020-06-29 19:28:29 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.5.min.js v2.5.5 126.9 Kb 2020-06-29 19:28:29 pub 1yr im [06/29/20 18:32:13] - scripts/b/ai.2.5.5.min.js.map v2.5.5 621.8 Kb 2020-06-29 19:28:30 pub 1yr im [06/29/20 18:32:13] ====================================================================== ~~~~ Refer to [our GitHub page](https://github.com/microsoft/applicationinsights-js) for more details on using Application Insights JS SDK. ================================================ FILE: AISKU/scripts/listAzCdnVersions.ps1 ================================================ param ( [string] $container = $null, # Identify the container that you want to check blank == all [string] $storeContainer = "cdn", # Identifies the destination storage account container [string] $cdnStorePath = "cdnstoragename", # Identifies the target Azure Storage account (by name) [string] $subscriptionId = $null, # Identifies the target Azure Subscription Id (if not encoded in the cdnStorePath) [string] $resourceGroup = $null, # Identifies the target Azure Subscription Resource Group (if not encoded in the cdnStorePath) [string] $sasToken = $null, # The SAS Token to use rather than using or attempting to login [string] $logPath = $null, # The location where logs should be written [switch] $showFiles = $false, # Show the individual files with details as well [switch] $inclExt = $false, # Include the extensions [switch] $activeOnly = $false, # Only show the active (deployed) versions [switch] $testOnly = $false, # Uploads to a "tst" test container on the storage account [switch] $cdn = $false, # (No longer used -- kept for now for backward compatibility) [switch] $useConnectedAccount = $false # Use Entra Id to connect to Azure ) Import-Module -Force -Name "../../common/publish/Logging" Import-Module -Force -Name "../../common/publish/AzStorageHelper" [hashtable]$global:connectDetails = @{} $global:connectDetails.storeContainer = $storeContainer $global:connectDetails.cdnStorePath = $cdnStorePath $global:connectDetails.resourceGroup = $resourceGroup $global:connectDetails.storeName = $null # The endpoint needs to the base name of the endpoint, not the full URL (eg. “my-cdn” rather than “my-cdn.azureedge.net”) $global:connectDetails.subscriptionId = $subscriptionId $global:connectDetails.sasToken = $sasToken $global:connectDetails.storageContext = $null $global:connectDetails.testOnly = $testOnly $global:connectDetails.useConnectedAccount = $useConnectedAccount Function Write-LogParams { $logDir = Get-LogPath Write-Log "Container : $container" Write-Log "Storage Container : $storeContainer" Write-Log "Store Path : $cdnStorePath" Write-Log "Write-LogPath : $logDir" Write-Log "Show Files : $showFiles" Write-Log "Test Mode : $testOnly" Write-Log "Use Connected Acct: $useConnectedAccount" if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "Mode : User-Credentials" } else { Write-Log "Mode : Sas-Token" } } Function Validate-Params { # Validate parameters if ([string]::IsNullOrWhiteSpace($container) -ne $true -and "beta","next","public", "dev", "nightly" -NotContains $container) { Write-LogFailure "[$($container)] is not a valid value, must be beta, next or public" } } Function Get-AllVersionFiles( [system.collections.generic.dictionary[string, system.collections.generic.list[hashtable]]] $files, [string] $storagePath ) { Get-VersionFiles $files $storagePath "ai." $null if ($inclExt -eq $true) { Get-VersionFiles $files "$storagePath/ext" "ai.*" $null } } $Error.Clear() #----------------------------------------------------------------------------- # Start of Script #----------------------------------------------------------------------------- Set-LogPath $logPath "listCdnVersionsLog" Write-LogParams Validate-Params # Don't try and list anything if any errors have been logged if (Get-HasErrors -eq $true) { exit 2 } # You will need to at least have the Az modules installed InstallRequiredModules $global:connectDetails = ParseCdnStorePath $global:connectDetails if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "**********************************************************************" Write-Log "Validating user access" Write-Log "**********************************************************************" $global:connectDetails = ValidateAccess $global:connectDetails } Write-Log "======================================================================" # List the files for each container $files = New-Object 'system.collections.generic.dictionary[string, system.collections.generic.list[hashtable]]' # Get the public files (scripts/b) if ([string]::IsNullOrWhiteSpace($container) -eq $true) { Get-AllVersionFiles $files "scripts/b" Get-AllVersionFiles $files "beta" Get-AllVersionFiles $files "next" Get-AllVersionFiles $files "dev" Get-AllVersionFiles $files "nightly" } if ([string]::IsNullOrWhiteSpace($container) -ne $true) { if ($container -eq "public") { Get-AllVersionFiles $files "scripts/b" } elseif ($container -eq "beta" -or $container -eq "next" -or $container -eq "dev" -or $container -eq "nightly") { Get-AllVersionFiles $files "$container" } else { $global:connectDetails.testOnly = $true $global:connectDetails.storeContainer = "tst" Get-AllVersionFiles $files "$container" } } ListVersions $files $activeOnly $showFiles Write-Log "======================================================================" ================================================ FILE: AISKU/scripts/publishAzImgToCdn.ps1 ================================================ param ( [string] $releaseFrom = $null, # The root path for where to find the files to be released [string] $storeContainer = "cdn", # Identifies the destination storage account container [string] $cdnStorePath = "cdnstoragename", # Identifies the target Azure Storage account (by name) [string] $subscriptionId = $null, # Identifies the target Azure Subscription Id (if not encoded in the cdnStorePath) [string] $resourceGroup = $null, # Identifies the target Azure Subscription Resource Group (if not encoded in the cdnStorePath) [string] $sasToken = $null, # The SAS Token to use rather than using or attempting to login [string] $logPath = $null, # The location where logs should be written [switch] $overwrite = $false, # Overwrite any existing files [switch] $testOnly = $false, # Uploads to a "tst" test container on the storage account [switch] $cdn = $false, # (No longer used -- kept for now for backward compatibility) [switch] $cacheTest = $false, # Uploads the images with a shorter cache time [switch] $useConnectedAccount = $false # Use Entra Id to connect to Azure ) Import-Module -Force -Name "../../common/publish/Logging" Import-Module -Force -Name "../../common/publish/AzStorageHelper" [hashtable]$global:connectDetails = @{} $global:connectDetails.storeContainer = $storeContainer $global:connectDetails.cdnStorePath = $cdnStorePath $global:connectDetails.resourceGroup = $resourceGroup $global:connectDetails.storeName = $null # The endpoint needs to the base name of the endpoint, not the full URL (eg. “my-cdn” rather than “my-cdn.azureedge.net”) $global:connectDetails.subscriptionId = $subscriptionId $global:connectDetails.sasToken = $sasToken $global:connectDetails.storageContext = $null $global:connectDetails.testOnly = $testOnly $global:connectDetails.useConnectedAccount = $useConnectedAccount $global:cacheValue = $null Function Write-LogParams { $logDir = Get-LogPath Write-Log "Storage Container : $storeContainer" Write-Log "Store Path : $($global:connectDetails.cdnStorePath)" Write-Log "Overwrite : $overwrite" Write-Log "Test Mode : $testOnly" Write-Log "SourcePath : $jsSdkDir" Write-Log "Log Path : $logDir" Write-Log "Use Connected Acct: $useConnectedAccount" if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "Mode : User-Credentials" } else { Write-Log "Mode : Sas-Token" } } Function GetReleaseFiles { Write-Log "Folder : $jsSdkDir" # check if the img dir exists $parentDir = Split-Path -Path $jsSdkDir -Parent $imgSrcDir = Join-Path -Path $parentDir -ChildPath "./AISKU/.cdn/img" Write-Log "Image Folder : $imgSrcDir" if (-Not (Test-Path $imgSrcDir)) { Write-LogWarning "'$imgSrcDir' directory doesn't exist. Generate IMG first."; exit } $files = New-Object 'system.collections.generic.dictionary[string,string]' # Get all files in the imgSrcDir directory $imgFiles = Get-ChildItem -Path $imgSrcDir -File Write-Log "Adding files"; # Iterate over each file foreach ($file in $imgFiles) { # Call AddReleaseFile for the current file AddReleaseFile $files $imgSrcDir $file.Name } return $files } #----------------------------------------------------------------------------- # Start of Script #----------------------------------------------------------------------------- Set-LogPath $logPath "publishReleaseCdnLog" $jsSdkDir = $releaseFrom if ([string]::IsNullOrWhiteSpace($jsSdkDir) -eq $true) { $jsSdkDir = Split-Path (Split-Path $MyInvocation.MyCommand.Path) -Parent } $cacheControl = "public, max-age=31536000, immutable, no-transform"; if ($cacheTest -eq $true) { $cacheControl = "public, max-age=86400, immutable, no-transform"; } $contentType = "image/svg+xml;"; Write-LogParams # You will need to at least have the AzureRM module installed InstallRequiredModules $global:connectDetails = ParseCdnStorePath $global:connectDetails if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "**********************************************************************" Write-Log "Validating user access" Write-Log "**********************************************************************" $global:connectDetails = ValidateAccess $global:connectDetails } Write-Log "======================================================================" $releaseFiles = GetReleaseFiles if ($null -eq $releaseFiles -or $releaseFiles.Count -eq 0) { Write-LogFailure "Unable to find any release files" } Write-Log "Release Files : $($releaseFiles.Count)" Write-Log "----------------------------------------------------------------------" $contentDisposition = "inline" # Publish the img to the folder that is same to the script folder. PublishFiles $releaseFiles "scripts/b" $cacheControl $contentType $overwrite $contentDisposition Write-Log "======================================================================" ================================================ FILE: AISKU/scripts/publishAzReleaseToCdn.ps1 ================================================ param ( [string] $releaseFrom = $null, # The root path for where to find the files to be released [string] $storeContainer = "cdn", # Identifies the destination storage account container [string] $cdnStorePath = "cdnstoragename", # Identifies the target Azure Storage account (by name) [string] $subscriptionId = $null, # Identifies the target Azure Subscription Id (if not encoded in the cdnStorePath) [string] $resourceGroup = $null, # Identifies the target Azure Subscription Resource Group (if not encoded in the cdnStorePath) [string] $sasToken = $null, # The SAS Token to use rather than using or attempting to login [string] $logPath = $null, # The location where logs should be written [switch] $overwrite = $false, # Overwrite any existing files [switch] $testOnly = $false, # Uploads to a "tst" test container on the storage account [switch] $cdn = $false, # (No longer used -- kept for now for backward compatibility) [switch] $useConnectedAccount = $false # Use Entra Id to connect to Azure ) Import-Module -Force -Name "../../common/publish/Logging" Import-Module -Force -Name "../../common/publish/AzStorageHelper" [hashtable]$global:connectDetails = @{} $global:connectDetails.storeContainer = $storeContainer $global:connectDetails.cdnStorePath = $cdnStorePath $global:connectDetails.resourceGroup = $resourceGroup $global:connectDetails.storeName = $null # The endpoint needs to the base name of the endpoint, not the full URL (eg. “my-cdn” rather than “my-cdn.azureedge.net”) $global:connectDetails.subscriptionId = $subscriptionId $global:connectDetails.sasToken = $sasToken $global:connectDetails.storageContext = $null $global:connectDetails.testOnly = $testOnly $global:connectDetails.useConnectedAccount = $useConnectedAccount $global:cacheValue = $null Function Write-LogParams { $logDir = Get-LogPath Write-Log "Storage Container : $storeContainer" Write-Log "Store Path : $($global:connectDetails.cdnStorePath)" Write-Log "Overwrite : $overwrite" Write-Log "Test Mode : $testOnly" Write-Log "SourcePath : $jsSdkDir" Write-Log "Log Path : $logDir" Write-Log "Use Connected Acct: $useConnectedAccount" if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "Mode : User-Credentials" } else { Write-Log "Mode : Sas-Token" } } Function GetReleaseFiles ( [hashtable] $verDetails ) { $version = $verDetails.full Write-Log "Version : $($verDetails.full)" Write-Log " Number : $($verDetails.ver)" Write-Log " Type : $($verDetails.type)" Write-Log " BldNum : $($verDetails.bldNum)" # check if the minified dir exists $jsSdkSrcDir = Join-Path $jssdkDir -ChildPath "browser\es5\"; if (-Not (Test-Path $jsSdkSrcDir)) { Write-LogWarning "'$jsSdkSrcDir' directory doesn't exist. Compile JSSDK first."; exit } $files = New-Object 'system.collections.generic.dictionary[string,string]' Write-Log "Adding files"; AddReleaseFile $files $jsSdkSrcDir "ai.$version.integrity.json" $true AddReleaseFile $files $jsSdkSrcDir "ai.$version.js" AddReleaseFile $files $jsSdkSrcDir "ai.$version.js.map" AddReleaseFile $files $jsSdkSrcDir "ai.$version.min.js" AddReleaseFile $files $jsSdkSrcDir "ai.$version.min.js.map" AddReleaseFile $files $jsSdkSrcDir "ai.$version.cjs.js" AddReleaseFile $files $jsSdkSrcDir "ai.$version.cjs.js.map" AddReleaseFile $files $jsSdkSrcDir "ai.$version.cjs.min.js" AddReleaseFile $files $jsSdkSrcDir "ai.$version.cjs.min.js.map" AddReleaseFile $files $jsSdkSrcDir "ai.$version.gbl.js" AddReleaseFile $files $jsSdkSrcDir "ai.$version.gbl.js.map" AddReleaseFile $files $jsSdkSrcDir "ai.$version.gbl.min.js" AddReleaseFile $files $jsSdkSrcDir "ai.$version.gbl.min.js.map" return $files } #----------------------------------------------------------------------------- # Start of Script #----------------------------------------------------------------------------- Set-LogPath $logPath "publishReleaseCdnLog" $jsSdkDir = $releaseFrom if ([string]::IsNullOrWhiteSpace($jsSdkDir) -eq $true) { $jsSdkDir = Split-Path (Split-Path $MyInvocation.MyCommand.Path) -Parent } $cacheControl1Year = "public, max-age=31536000, immutable, no-transform"; $contentType = "text/javascript; charset=utf-8"; Write-LogParams # You will need to at least have the Az modules installed InstallRequiredModules $global:connectDetails = ParseCdnStorePath $global:connectDetails if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "**********************************************************************" Write-Log "Validating user access" Write-Log "**********************************************************************" $global:connectDetails = ValidateAccess $global:connectDetails } Write-Log "======================================================================" $version = GetPackageVersion $jsSdkDir $releaseFiles = GetReleaseFiles $version # Get the versioned files only if ($null -eq $releaseFiles -or $releaseFiles.Count -eq 0) { Write-LogFailure "Unable to find any release files" } Write-Log "Release Files : $($releaseFiles.Count)" Write-Log "----------------------------------------------------------------------" # Publish the full versioned files to all release folders if ($version.type -eq "release") { # Normal publishing deployment PublishFiles $releaseFiles "beta" $cacheControl1Year $contentType $overwrite PublishFiles $releaseFiles "next" $cacheControl1Year $contentType $overwrite PublishFiles $releaseFiles "scripts/b" $cacheControl1Year $contentType $overwrite } elseif ($version.type -eq "rc") { PublishFiles $releaseFiles "beta" $cacheControl1Year $contentType $overwrite PublishFiles $releaseFiles "next" $cacheControl1Year $contentType $overwrite } elseif ($version.type -eq "dev" -or $version.type -eq "beta") { # Publish to release type folder folder PublishFiles $releaseFiles "$($version.type)" $cacheControl1Year $contentType $overwrite } elseif ($version.type -like "nightly*") { # Publish to release nightly folder folder PublishFiles $releaseFiles "nightly" $cacheControl1Year $contentType $overwrite } else { # Upload to the test container rather than the supplied one $global:connectDetails.testOnly = $true $global:connectDetails.storeContainer = "tst" PublishFiles $releaseFiles "$($version.type)" $cacheControl1Year $contentType $overwrite } Write-Log "======================================================================" ================================================ FILE: AISKU/scripts/setAzActiveCdnVersion.ps1 ================================================ [CmdletBinding()] param ( [string] $container = "", # The container to update [string] $activeVersion = "", # The version to copy as the active version [string] $storeContainer = "cdn", # Identifies the destination storage account container [string] $cdnStorePath = "cdnstoragename", # Identifies the target Azure Storage account (by name) [string] $subscriptionId = $null, # Identifies the target Azure Subscription Id (if not encoded in the cdnStorePath) [string] $resourceGroup = $null, # Identifies the target Azure Subscription Resource Group (if not encoded in the cdnStorePath) [string] $sasToken = $null, # The SAS Token to use rather than using or attempting to login [string] $logPath = $null, # The location where logs should be written [switch] $minorOnly = $false, # Only set the active minor version (v2.x) and not the major version (v2) [switch] $testOnly = $false, # Uploads to a "tst" test container on the storage account [switch] $cdn = $false, # (No longer used -- kept for now for backward compatibility) [switch] $useConnectedAccount = $false # Use Entra Id to connect to Azure ) Import-Module -Force -Name "../../common/publish/Logging" Import-Module -Force -Name "../../common/publish/AzStorageHelper" [hashtable]$global:connectDetails = @{} $global:connectDetails.storeContainer = $storeContainer $global:connectDetails.cdnStorePath = $cdnStorePath $global:connectDetails.resourceGroup = $resourceGroup $global:connectDetails.storeName = $null # The endpoint needs to the base name of the endpoint, not the full URL (eg. “my-cdn” rather than “my-cdn.azureedge.net”) $global:connectDetails.subscriptionId = $subscriptionId $global:connectDetails.sasToken = $sasToken $global:connectDetails.storageContext = $null $global:connectDetails.testOnly = $testOnly $global:connectDetails.useConnectedAccount = $useConnectedAccount Function Write-LogParams { Write-Log "Container : $container" Write-Log "Version : $activeVersion" Write-Log "Storage Container : $storeContainer" Write-Log "Store Path : $($global:connectDetails.cdnStorePath)" Write-Log "Test Mode : $testOnly" Write-Log "Log Path : $logDir" Write-Log "Use Connected Acct: $useConnectedAccount" if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "Mode : User-Credentials" } else { Write-Log "Mode : Sas-Token" } } Function Validate-Params { if ([string]::IsNullOrWhiteSpace($activeVersion) -eq $true) { Write-LogFailure "The Active version is not specified" exit } $version = Get-VersionDetails $activeVersion if ([string]::IsNullOrWhiteSpace($version.type) -eq $true) { Write-LogFailure "Unknown release type" } $versionParts = $version.ver.Split(".") if ($versionParts.Length -ne 3) { Write-LogFailure "Active Version [$activeVersion] is not a valid version number" } foreach ($verNum in $versionParts) { [int]$value = 0 if ([int32]::TryParse($verNum, [ref]$value) -ne $true) { Write-LogFailure "[$($verNum)] is not a valid number within the version[$activeVersion]" } } # Publish the full versioned files to all release folders if ($version.type -eq "release") { # Normal publishing deployment if ("beta","next","public" -NotContains $container) { Write-LogFailure "Container [$container] is not valid for version type [$($version.type)]" } } elseif ($version.type -eq "rc") { if ("beta","next" -NotContains $container) { Write-LogFailure "Container [$container] is not valid for version type [$($version.type)]" } } elseif ($version.type -eq "dev" -or $version.type -eq "beta") { if ($version.type -ne $container) { Write-LogFailure "Container [$container] is not valid for version type [$($version.type)]" } } elseif ($version.type -like "nightly*") { if ("nightly" -ne $container) { Write-LogFailure "Container [$container] is not valid for version type [$($version.type)]" } } else { # Upload to the test container rather than the supplied one $global:connectDetails.testOnly = $true if ($version.type -ne $container) { Write-LogFailure "Container [$container] is not valid for version type [$($version.type)]" } else { Write-LogWarning "Non-Standard release type using tst/$container as the destination" } } return $version; } $Error.Clear() #----------------------------------------------------------------------------- # Start of Script #----------------------------------------------------------------------------- Set-LogPath $logPath "setActiveCdnVersionLog" Write-LogParams $version = Validate-Params # Don't try and publish anything if any errors have been logged if (Get-HasErrors -eq $true) { exit 2 } # You will need to at least have the Az modules installed InstallRequiredModules $global:connectDetails = ParseCdnStorePath $global:connectDetails if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "**********************************************************************" Write-Log "Validating user access" Write-Log "**********************************************************************" $global:connectDetails = ValidateAccess $global:connectDetails } Write-Log "======================================================================" # List the files for each container $files = New-Object 'system.collections.generic.dictionary[string, system.collections.generic.list[hashtable]]' $storePath = "$container" if ($container -eq "public") { $storePath = "scripts/b" } elseif ($container -ne "beta" -and $container -ne "next" -and $container -ne "dev" -and $container -ne "nightly") { $global:connectDetails.testOnly = $true $global:connectDetails.storeContainer = "tst" } Get-VersionFiles $files $storePath "ai." $activeVersion if ($files.ContainsKey($activeVersion) -ne $true) { Write-LogFailure "Version [$activeVersion] does not appear to be deployed to [$container]" } elseif ($files[$activeVersion].Count -ne 4 -and # Prior to 2.5.8 $files[$activeVersion].Count -ne 8 -and # Since 2.5.8 $files[$activeVersion].Count -ne 9 -and # Since 2.6.5 $files[$activeVersion].Count -ne 12 -and # Since 2.5.8 $files[$activeVersion].Count -ne 13) { # Since 2.6.5 Write-LogFailure "Version [$activeVersion] does not fully deployed to [$container] -- only found [$($files[$activeVersion].Count)] file(s)" } # Don't try and publish anything if any errors have been logged if (Get-HasErrors -eq $true) { exit 2 } SetActiveVersion $files[$activeVersion] $storePath $minorOnly Write-Log "======================================================================" ================================================ FILE: AISKU/snippet/README.md ================================================ # Microsoft Application Insights JavaScript SDK - Snippet Injection ## How to push Application Insights JS snippet changes consumed by Application Insights dotnet package. 1. Fork Application Insights dotnet [Repo](https://github.com/microsoft/ApplicationInsights-dotnet). 2. Get the latest copy of JS snippet and make changes in `NETCORE\src\Microsoft.ApplicationInsights.AspNetCore\Resources.resx` file. ### Build/Test Changes: 1. Open `Everything.sln` file. Run build and Tests on AspNetCore project ### Test Changes Locally: 1. Create a dot net [SampleWebApp](https://docs.microsoft.com/en-us/visualstudio/ide/quickstart-aspnet-core?view=vs-2019). 2. Open your SampleWebApp and enable client side telemetry. More details on how to do this [here](https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core#enable-client-side-telemetry-for-web-applications) 3. In `SampleWebApp\Startup.cs` configure ikey 4. In `SampleWebApp\WebApplication1.csproj` Refer the package `Microsoft.ApplicationInsights.AspNetCore` you just built from the build output folder: `\your visual studio workspace\bin\Debug\NuGet`. ## How to inject Javascript with Sharepoint Framework Extensions through [Snippet Setup](https://github.com/microsoft/ApplicationInsights-JS/tree/master/SPO#snippet-setup-ignore-if-using-npm-setup) Due to security concerns, you can't directly add the script that's described in [this](https://docs.microsoft.com/en-us/azure/azure-monitor/app/sharepoint) article to your webpages in the SharePoint modern UX. As an alternative, you can use [SharePoint Framework (SPFx)](/sharepoint/dev/spfx/extensions/overview-extensions) to build a custom extension that you can use to install Application Insights on your SharePoint sites. There are two ways to add Application Insights to your extension solution, either install via NPM setup or drop a script tag on the extension head. If you choose the second option, [view the sample](https://github.com/pnp/sp-dev-fx-extensions/tree/master/samples/js-application-appinsights). - Snippet for SPO (Sharepoint online) modern UX scenario: ```js `!function(v,y,T){var S=v.location,k="script",D="instrumentationKey",C="ingestionendpoint",I="disableExceptionTracking",E="ai.device.",b="toLowerCase",w=(D[b](),"crossOrigin"),N="POST",e="appInsightsSDK",t=T.name||"appInsights",n=((T.name||v[e])&&(v[e]=t),v[t]||function(l){var u=!1,d=!1,g={initialize:!0,queue:[],sv:"6",version:2,config:l};function m(e,t){var n={},a="Browser";return n[E+"id"]=a[b](),n[E+"type"]=a,n["ai.operation.name"]=S&&S.pathname||"_unknown_",n["ai.internal.sdkVersion"]="javascript:snippet_"+(g.sv||g.version),{time:(a=new Date).getUTCFullYear()+"-"+i(1+a.getUTCMonth())+"-"+i(a.getUTCDate())+"T"+i(a.getUTCHours())+":"+i(a.getUTCMinutes())+":"+i(a.getUTCSeconds())+"."+(a.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z",iKey:e,name:"Microsoft.ApplicationInsights."+e.replace(/-/g,"")+"."+t,sampleRate:100,tags:n,data:{baseData:{ver:2}}};function i(e){e=""+e;return 1===e.length?"0"+e:e}}var e,n,f=l.url||T.src;function a(e){var t,n,a,i,o,s,r,c,p;u=!0,g.queue=[],d||(d=!0,i=f,r=(c=function(){var e,t={},n=l.connectionString;if(n)for(var a=n.split(";"),i=0;i(default_limit), interval: cfgDfMerge(default_interval) } as IThrottleMgrConfig; // We need to include all properties that we only reference that we want to be dynamically updatable here // So they are converted even when not specified in the passed configuration const defaultConfigValues: IConfigDefaults = { connectionString: UNDEFINED_VALUE, endpointUrl: UNDEFINED_VALUE, instrumentationKey: UNDEFINED_VALUE, userOverrideEndpointUrl: UNDEFINED_VALUE, diagnosticLogInterval: cfgDfValidate(_chkDiagLevel, 10000), featureOptIn:{ [IKEY_USAGE]: {mode: FeatureOptInMode.enable}, //for versions after 3.1.2 (>= 3.2.0) [CDN_USAGE]: {mode: FeatureOptInMode.disable}, [SDK_LOADER_VER]: {mode: FeatureOptInMode.disable}, [ZIP_PAYLOAD]: {mode: FeatureOptInMode.none} }, throttleMgrCfg: cfgDfMerge<{[key:number]: IThrottleMgrConfig}>( { [_eInternalMessageId.DefaultThrottleMsgKey]:cfgDfMerge(default_throttle_config), [_eInternalMessageId.InstrumentationKeyDeprecation]:cfgDfMerge(default_throttle_config), [_eInternalMessageId.SdkLdrUpdate]:cfgDfMerge(default_throttle_config), [_eInternalMessageId.CdnDeprecation]:cfgDfMerge(default_throttle_config) } ), extensionConfig: cfgDfMerge<{[key: string]: any}>({ ["AppInsightsCfgSyncPlugin"]: cfgDfMerge({ cfgUrl: CONFIG_ENDPOINT_URL, syncMode: ICfgSyncMode.Receive }) }) }; function _chkDiagLevel(value: number) { // Make sure we have a value > 0 return value && value > 0; } function _parseCs(config: IConfiguration & IConfig, configCs: string | IPromise) { return createSyncPromise((resolve, reject) => { doAwaitResponse(configCs, (res) => { let curCs = res && res.value; let parsedCs = null; if (!res.rejected && curCs) { // replace cs with resolved values in case of circular promises config.connectionString = curCs; parsedCs = parseConnectionString(curCs); } // if can't resolve cs promise, null will be returned resolve(parsedCs); }); }); } function _initOTel(sku: AppInsightsSku, traceName: string, onEnd: (span: IReadableSpan) => void, onException?: (span: IReadableSpan, exception: any, time?: OTelTimeInput) => void): ICachedValue { let otelApi: ICachedValue = getDeferred(createOTelApi, [{ host: sku }]); // Create the initial default traceProvider sku.core.setTraceProvider(getDeferred(() => { return createTraceProvider(sku, traceName, otelApi.v, onEnd, onException); })); return otelApi; } /** * Application Insights API * @group Entrypoint * @group Classes */ export class AppInsightsSku implements IApplicationInsights { public snippet: Snippet; /** * Access to the Dynamic Configuration for the current instance */ public readonly config: IConfiguration & IConfig; public readonly appInsights: ApplicationInsights; public readonly core: IAppInsightsCore; public readonly context: Common_ITelemetryContext; /** * An array of the installed plugins that provide a version */ public readonly pluginVersionStringArr: string[]; /** * The formatted string of the installed plugins that contain a version number */ public readonly pluginVersionString: string; public readonly trace: ITraceApi; public readonly otelApi: IOTelApi; constructor(snippet: Snippet) { // NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown() let dependencies: DependenciesPlugin; let properties: PropertiesPlugin; let _sender: Sender; let _snippetVersion: string; let _evtNamespace: string; let _houseKeepingNamespace: string | string[]; let _core: IAppInsightsCore; let _config: IConfiguration & IConfig; let _analyticsPlugin: AnalyticsPlugin; let _cfgSyncPlugin: CfgSyncPlugin; let _throttleMgr: ThrottleMgr; let _iKeySentMessage: boolean; let _cdnSentMessage: boolean; let _sdkVerSentMessage: boolean; let _otelApi: ICachedValue; dynamicProto(AppInsightsSku, this, (_self) => { _initDefaults(); objDefine(_self, "config", { g: function() { return _config; } }); arrForEach(["pluginVersionStringArr", "pluginVersionString"], (key: keyof AppInsightsSku) => { objDefine(_self, key, { g: () => { if (_core) { return (_core as any)[key]; } return null; } }); }); // initialize the queue and config in case they are undefined _snippetVersion = "" + (snippet.sv || snippet.version || ""); snippet.queue = snippet.queue || []; snippet.version = snippet.version || 2.0; // Default to new version let cfgHandler: IDynamicConfigHandler = createDynamicConfig(snippet.config || ({} as any), defaultConfigValues); _config = cfgHandler.cfg; _analyticsPlugin = new AnalyticsPlugin(); objDefine(_self, "appInsights", { g: () => { return _analyticsPlugin; } }); properties = new PropertiesPlugin(); dependencies = new DependenciesPlugin(); _sender = new Sender(); _core = new AppInsightsCore(); objDefine(_self, "core", { g: () => { return _core; } }); objDefine(_self, "otelApi", { g: function() { return _otelApi ? _otelApi.v : null; } }); objDefine(_self, "trace", { g: function() { return _otelApi ? _otelApi.v.trace : null; } }); // Will get recalled if any referenced values are changed _addUnloadHook(onConfigChange(cfgHandler, () => { let configCs = _config.connectionString; if (isPromiseLike(configCs)) { let ikeyPromise = createSyncPromise((resolve, reject) => { doAwaitResponse(_parseCs(_config, configCs), (rsp) => { if (!rsp.rejected) { let ikey = _config.instrumentationKey; let cs = rsp.value; ikey = cs && cs.instrumentationkey || ikey; resolve(ikey); } else { // parseCs will always resolve(unless timeout) // return null in case any error happens resolve(null); } }); }); let url: IPromise | string = _config.userOverrideEndpointUrl; if (isNullOrUndefined(url)) { url = createSyncPromise((resolve, reject) => { doAwaitResponse(_parseCs(_config, configCs), (rsp) => { if (!rsp.rejected) { let url = _config.endpointUrl; let cs = rsp.value; let ingest = cs && cs.ingestionendpoint; url = ingest? ingest + DEFAULT_BREEZE_PATH : url; resolve(url); } else { // parseCs will always resolve(unless timeout) // return null in case any error happens resolve(null); } }); }); } _config.instrumentationKey = ikeyPromise; _config.endpointUrl = url; } if (isString(configCs) && configCs) { // confirm if promiselike function present // handle cs promise here // add cases to oneNote const cs = parseConnectionString(configCs); const ingest = cs.ingestionendpoint; _config.endpointUrl = _config.userOverrideEndpointUrl ? _config.userOverrideEndpointUrl : ingest + DEFAULT_BREEZE_PATH; // add /v2/track _config.instrumentationKey = cs.instrumentationkey || _config.instrumentationKey; } // userOverrideEndpointUrl have the highest priority _config.endpointUrl = _config.userOverrideEndpointUrl ? _config.userOverrideEndpointUrl : _config.endpointUrl; })); _self.snippet = snippet; _self.flush = (isAsync: boolean = true, callBack?: () => void) => { let result: void | IPromise; doPerf(_core, () => "AISKU.flush", () => { if (isAsync && !callBack) { result = createPromise((resolve) => { callBack = resolve; }); } let waiting = 1; const flushDone = () => { waiting --; if (waiting === 0) { callBack(); } }; arrForEach(_core.getChannels(), channel => { if (channel) { waiting++; channel.flush(isAsync, flushDone); } }); // decrement the initial "waiting" flushDone(); }, null, isAsync); return result; }; _self.onunloadFlush = (isAsync: boolean = true) => { arrForEach(_core.getChannels(), (channel: IChannelControls & Sender) => { if (channel.onunloadFlush) { channel.onunloadFlush(); } else { channel.flush(isAsync); } }); }; _self.loadAppInsights = (legacyMode: boolean = false, logger?: IDiagnosticLogger, notificationManager?: INotificationManager): IApplicationInsights => { if (legacyMode) { throwUnsupported("Legacy Mode is no longer supported") } function _updateSnippetProperties(snippet: Snippet) { if (snippet) { let snippetVer = ""; if (!isNullOrUndefined(_snippetVersion)) { snippetVer += _snippetVersion; } if (_self.context && _self.context.internal) { _self.context.internal.snippetVer = snippetVer || "-"; } // apply updated properties to the global instance (snippet) objForEachKey(_self, (field, value) => { if (isString(field) && !isFunction(value) && field && field[0] !== "_" && // Don't copy "internal" values arrIndexOf(_ignoreUpdateSnippetProperties, field) === -1) { if ((snippet as any)[field] !== value) { (snippet as any)[field as string] = value; } } }); } } doPerf(_self.core, () => "AISKU.loadAppInsights", () => { // initialize core _core.initialize(_config, [ _sender, properties, dependencies, _analyticsPlugin, _cfgSyncPlugin], logger, notificationManager); // Initialize the initial OTel API _otelApi = _initOTel(_self, "aisku", _onEnd, _onException); objDefine(_self, "context", { g: () => properties.context }); if (!_throttleMgr){ _throttleMgr = new ThrottleMgr(_core); } let sdkSrc = _findSdkSourceFile(); if (sdkSrc && _self.context) { _self.context.internal.sdkSrc = sdkSrc; } _updateSnippetProperties(_self.snippet); // Empty queue of all api calls logged prior to sdk download _self.emptyQueue(); _self.pollInternalLogs(); _self.addHousekeepingBeforeUnload(_self); _addUnloadHook(onConfigChange(cfgHandler, () => { var defaultEnable = false; if (_config.throttleMgrCfg[_eInternalMessageId.DefaultThrottleMsgKey]){ defaultEnable = !_config.throttleMgrCfg[_eInternalMessageId.DefaultThrottleMsgKey].disabled; } if (!_throttleMgr.isReady() && _config.extensionConfig && _config.extensionConfig[_cfgSyncPlugin.identifier] && defaultEnable) { // set ready state to true will automatically trigger flush() _throttleMgr.onReadyState(true); } if (!_iKeySentMessage && !_config.connectionString && isFeatureEnabled(IKEY_USAGE, _config, true)) { _throttleMgr.sendMessage( _eInternalMessageId.InstrumentationKeyDeprecation, "See Instrumentation key support at aka.ms/IkeyMigrate"); _iKeySentMessage = true; } if (!_cdnSentMessage && _self.context.internal.sdkSrc && _self.context.internal.sdkSrc.indexOf("az416426") != -1 && isFeatureEnabled(CDN_USAGE, _config, true)) { _throttleMgr.sendMessage( _eInternalMessageId.CdnDeprecation, "See Cdn support notice at aka.ms/JsActiveCdn"); _cdnSentMessage = true; } if (!_sdkVerSentMessage && parseInt(_snippetVersion) < 6 && isFeatureEnabled(SDK_LOADER_VER, _config, true)) { _throttleMgr.sendMessage( _eInternalMessageId.SdkLdrUpdate, "An updated Sdk Loader is available, see aka.ms/SnippetVer"); _sdkVerSentMessage = true; } })); }); return _self; }; _self.updateSnippetDefinitions = (snippet: Snippet) => { // apply full appInsights to the global instance // Note: This must be called before loadAppInsights is called proxyAssign(snippet, _self, (name: string) => { // Not excluding names prefixed with "_" as we need to proxy some functions like _onError return name && arrIndexOf(_ignoreProxyAssignProperties, name) === -1; }); }; _self.emptyQueue = () => { // call functions that were queued before the main script was loaded try { if (isArray(_self.snippet.queue)) { // note: do not check length in the for-loop conditional in case something goes wrong and the stub methods are not overridden. const length = _self.snippet.queue.length; for (let i = 0; i < length; i++) { const call = _self.snippet.queue[i]; call(); } _self.snippet.queue = undefined; delete _self.snippet.queue; } } catch (exception) { const properties: any = {}; if (exception && isFunction(exception.toString)) { properties.exception = exception.toString(); } // need from core // Microsoft.ApplicationInsights._InternalLogging.throwInternal( // eLoggingSeverity.WARNING, // _eInternalMessageId.FailedToSendQueuedTelemetry, // "Failed to send queued telemetry", // properties); } }; _self.addHousekeepingBeforeUnload = (appInsightsInstance: IApplicationInsights): void => { // Add callback to push events when the user navigates away if (hasWindow() || hasDocument()) { const performHousekeeping = () => { // Adds the ability to flush all data before the page unloads. // Note: This approach tries to push a sync request with all the pending events onbeforeunload. // Firefox does not respect this.Other browsers DO push out the call with < 100% hit rate. // Telemetry here will help us analyze how effective this approach is. // Another approach would be to make this call sync with a acceptable timeout to reduce the // impact on user experience. // appInsightsInstance.context._sender.triggerSend(); appInsightsInstance.onunloadFlush(false); // Back up the current session to local storage // This lets us close expired sessions after the cookies themselves expire if (isFunction(_self.core.getPlugin)) { let loadedPlugin = this.core.getPlugin(PropertiesPluginIdentifier); if (loadedPlugin) { let propertiesPlugin: any = loadedPlugin.plugin; if (propertiesPlugin && propertiesPlugin.context && propertiesPlugin.context._sessionManager) { propertiesPlugin.context._sessionManager.backup(); } } } }; let added = false; if (!_houseKeepingNamespace) { _houseKeepingNamespace = mergeEvtNamespace(_evtNamespace, _core.evtNamespace && _core.evtNamespace()); } // Will be recalled if any referenced config properties change _addUnloadHook(onConfigChange(_config, (details) => { let coreConfig = details.cfg; let analyticsPlugin = appInsightsInstance.appInsights; let ctx = createProcessTelemetryContext(null, coreConfig, analyticsPlugin.core); let extConfig = ctx.getExtCfg(analyticsPlugin.identifier || AnalyticsPluginIdentifier); // As we could get recalled, remove any previously registered event handlers first _removePageEventHandlers(); let excludePageUnloadEvents = coreConfig.disablePageUnloadEvents; if (!extConfig.disableFlushOnBeforeUnload) { // Hook the unload event for the document, window and body to ensure that the client events are flushed to the server // As just hooking the window does not always fire (on chrome) for page navigation's. if (addPageUnloadEventListener(performHousekeeping, excludePageUnloadEvents, _houseKeepingNamespace)) { added = true; } // We also need to hook the pagehide and visibilitychange events as not all versions of Safari support load/unload events. if (addPageHideEventListener(performHousekeeping, excludePageUnloadEvents, _houseKeepingNamespace)) { added = true; } // A reactNative app may not have a window and therefore the beforeunload/pagehide events -- so don't // log the failure in this case if (!added && !isReactNative()) { _throwInternal(_core.logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.FailedToAddHandlerForOnBeforeUnload, "Could not add handler for beforeunload and pagehide"); } } if (!added && !extConfig.disableFlushOnUnload) { // If we didn't add the normal set then attempt to add the pagehide and visibilitychange only addPageHideEventListener(performHousekeeping, excludePageUnloadEvents, _houseKeepingNamespace); } })); } }; _self.getSender = (): Sender => { return _sender; }; _self.unload = (isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void | IPromise => { let unloadDone = false; let result: IPromise; if (isAsync !== false && !unloadComplete) { result = createPromise((resolve) => { // Set the callback to the promise resolve callback unloadComplete = resolve; }); } function _unloadCallback(unloadState: ITelemetryUnloadState) { if (!unloadDone) { unloadDone = true; // Reset OTel API to clean up all trace state before unloading core if (_core) { // Clear the trace provider to stop any active spans _core.setTraceProvider(null); // Reset the OTel API instances - this will be recreated on next init if (_otelApi) { _otelApi.v.shutdown(); } _otelApi = null; } _initDefaults(); unloadComplete && unloadComplete(unloadState); } } _self.onunloadFlush(isAsync); _removePageEventHandlers(); _core.unload && _core.unload(isAsync, _unloadCallback, cbTimeout); return result; }; proxyFunctions(_self, _analyticsPlugin, [ STR_GET_COOKIE_MGR, STR_TRACK_EVENT, STR_TRACK_PAGE_VIEW, "trackPageViewPerformance", STR_TRACK_EXCEPTION, "_onerror", STR_TRACK_TRACE, STR_TRACK_METRIC, STR_START_TRACK_PAGE, STR_STOP_TRACK_PAGE, STR_START_TRACK_EVENT, STR_STOP_TRACK_EVENT ]); proxyFunctions(_self, _getCurrentDependencies, [ STR_TRACK_DEPENDENCY_DATA, "addDependencyListener", "addDependencyInitializer" ]); proxyFunctions(_self, _core, [ STR_ADD_TELEMETRY_INITIALIZER, STR_POLL_INTERNAL_LOGS, "stopPollingInternalLogs", STR_GET_PLUGIN, "addPlugin", STR_EVT_NAMESPACE, "addUnloadCb", "updateCfg", "onCfgChange", // ITraceHost Proxy "getTraceCtx", "setTraceCtx", "startSpan", "getActiveSpan", "setActiveSpan", "setTraceProvider", "getTraceProvider" ]); proxyFunctions(_self, () => { let context = properties.context; return context ? context.user : null; }, [ STR_SET_AUTHENTICATED_USER_CONTEXT, STR_CLEAR_AUTHENTICATED_USER_CONTEXT ]); // Handle span end event - create telemetry from span data function _onEnd(span: IReadableSpan) { if (_otelApi && span && span.isRecording() && !_otelApi.v.cfg.traceCfg.suppressTracing) { // Flip this span to be the "current" span during processing, so any telemetry created during the span processing // is associated with this span useSpan(_core, span, () => { try { // Create trace telemetry for the span let telemetryItem: ITelemetryItem = createTelemetryItemFromSpan(_core, span); if (telemetryItem) { _self.core.track(telemetryItem); } } catch (error) { // Log any errors during trace processing but don't let them break the span lifecycle _throwInternal(_core.logger, eLoggingSeverity.WARNING, _eInternalMessageId.TelemetryInitializerFailed, "Error processing span - " + dumpObj(error)); } }); } } function _onException(span: IReadableSpan, exception: any, time?: OTelTimeInput) { if (_otelApi) { // Flip this span to be the "current" span during processing, so any telemetry created during the span processing useSpan(_core, span, () => { try { _self.trackException({ exception: exception, properties: { time: time } }); } catch (error) { // Log any errors during exception processing but don't let them break the span lifecycle _throwInternal(_core.logger, eLoggingSeverity.WARNING, _eInternalMessageId.TelemetryInitializerFailed, "Error processing exception - " + dumpObj(error)); } }); } } // Using a function to support the dynamic adding / removal of plugins, so this will always return the current value function _getCurrentDependencies() { return dependencies; } function _initDefaults() { _evtNamespace = createUniqueNamespace("AISKU"); _houseKeepingNamespace = null; dependencies = null; properties = null; _sender = null; _snippetVersion = null; _throttleMgr = null; _iKeySentMessage = false; _cdnSentMessage = false; _sdkVerSentMessage = false; _cfgSyncPlugin = new CfgSyncPlugin(); } function _removePageEventHandlers() { // Remove any registered event handlers if (_houseKeepingNamespace) { removePageUnloadEventListener(null, _houseKeepingNamespace); removePageHideEventListener(null, _houseKeepingNamespace); } } function _addUnloadHook(hooks: IUnloadHook | IUnloadHook[] | Iterator) { _core.addUnloadHook(hooks); } }); } // Analytics Plugin /** * Get the current cookie manager for this instance */ public getCookieMgr(): ICookieMgr { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Log a user action or other occurrence. * @param event - event to be sent * @param customProperties - properties that would be included as part of the event */ public trackEvent(event: IEventTelemetry, customProperties?: ICustomProperties) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Logs that a page, or similar container was displayed to the user. * @param pageView - page view to be sent */ public trackPageView(pageView?: IPageViewTelemetry) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Log a bag of performance information via the customProperties field. * @param pageViewPerformance - performance information to be sent */ public trackPageViewPerformance(pageViewPerformance: IPageViewPerformanceTelemetry): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Log an exception that you have caught. * @param exception - exception to be sent * @param customProperties - Additional data used to filter pages and metrics in the portal. Defaults to empty. */ public trackException(exception: IExceptionTelemetry, customProperties?: ICustomProperties): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Manually send uncaught exception telemetry. This method is automatically triggered * on a window.onerror event. * @param exception - The exception to be sent. */ public _onerror(exception: IAutoExceptionTelemetry): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Log a diagnostic scenario such entering or leaving a function. * @param trace - trace to be sent * @param customProperties - Additional custom properties to include in the event. */ public trackTrace(trace: ITraceTelemetry, customProperties?: ICustomProperties): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Log a numeric value that is not associated with a specific event. Typically used * to send regular reports of performance indicators. * * To send a single measurement, just use the `name` and `average` fields * of {@link IMetricTelemetry}. * * If you take measurements frequently, you can reduce the telemetry bandwidth by * aggregating multiple measurements and sending the resulting average and modifying * the `sampleCount` field of {@link IMetricTelemetry}. * @param metric - input object argument. Only `name` and `average` are mandatory. * @param customProperties - Additional custom properties to include in the event. */ public trackMetric(metric: IMetricTelemetry, customProperties?: ICustomProperties): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops, * but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view * and send the event. * @param name - A string that idenfities this item, unique within this HTML document. Defaults to the document title. */ public startTrackPage(name?: string): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements. * The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`. * @param name - The string you used as the name in startTrackPage. Defaults to the document title. * @param url - a relative or absolute URL that identifies the page or other item. Defaults to the window location. * @param properties - additional data used to filter pages and metrics in the portal. Defaults to empty. * @param measurements - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty. */ public stopTrackPage(name?: string, url?: string, properties?: { [key: string]: string }, measurements?: { [key: string]: number }) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public startTrackEvent(name?: string): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Log an extended event that you started timing with `startTrackEvent`. * @param name - The string you used to identify this event in `startTrackEvent`. * @param properties - map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. * @param measurements - map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. */ public stopTrackEvent(name: string, properties?: { [key: string]: string }, measurements?: { [key: string]: number }) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): ITelemetryInitializerHandler { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } // Properties Plugin /** * Set the authenticated user id and the account id. Used for identifying a specific signed-in user. Parameters must not contain whitespace or ,;=| * * The method will only set the `authenticatedUserId` and `accountId` in the current page view. To set them for the whole session, you should set `storeInCookie = true` * @param authenticatedUserId - The account ID to set * @param accountId - The account ID to set * @param storeInCookie - Whether the values should be set for the whole session */ public setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string, storeInCookie = false): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Clears the authenticated user id and account id. The associated cookie is cleared, if present. */ public clearAuthenticatedUserContext(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } // Dependencies Plugin /** * Log a dependency call (e.g. ajax) * @param dependencyData - dependency data object */ public trackDependencyData(dependency: IDependencyTelemetry): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } // Misc /** * Attempt to flush data immediately; If executing asynchronously (the default) and * you DO NOT pass a callback function then a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * will be returned which will resolve once the flush is complete. The actual implementation of the `IPromise` * will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async) * @param async - send data asynchronously when true * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. * If the caller doesn't return true the caller should assume that it may never be called. * @returns - If a callback is provided `true` to indicate that callback will be called after the flush is complete otherwise the caller * should assume that any provided callback will never be called, Nothing or if occurring asynchronously a * [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) which will be resolved once the unload is complete, * the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) will only be returned when no callback is provided * and async is true. */ public flush(async?: boolean, callBack?: () => void): void | IPromise { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender. * Fall back to xhr sender if beacon is not supported. * @param async - send data asynchronously when true, default is true */ public onunloadFlush(async: boolean = true) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Initialize this instance of ApplicationInsights * @param legacyMode - MUST always be false, it is no longer supported from v3.x onwards * @returns The initialized {@link IApplicationInsights} instance */ public loadAppInsights(legacyMode: boolean = false, logger?: IDiagnosticLogger, notificationManager?: INotificationManager): IApplicationInsights { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Overwrite the lazy loaded fields of global window snippet to contain the * actual initialized API methods * @param snippet - The global snippet */ public updateSnippetDefinitions(snippet: Snippet) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Call any functions that were queued before the main script was loaded */ public emptyQueue() { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public pollInternalLogs(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public stopPollingInternalLogs(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public addHousekeepingBeforeUnload(appInsightsInstance: IApplicationInsights): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public getSender(): Sender { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered * to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous * unload call return `true` stating that all plugins reported that they also unloaded, the recommended * approach is to create a new instance and initialize that instance. * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable * to successfully remove any global references or they may just be completing the unload process asynchronously. * If you pass isAsync as true and do not provide * If you pass isAsync as `true` (also the default) and DO NOT pass a callback function then an [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * will be returned which will resolve once the unload is complete. The actual implementation of the `IPromise` * will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async) * @param isAsync - Can the unload be performed asynchronously (default) * @param unloadComplete - An optional callback that will be called once the unload has completed * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the * unload. Defaults to 5 seconds. * @returns Nothing or if occurring asynchronously a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * which will be resolved once the unload is complete, the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * will only be returned when no callback is provided and isAsync is true */ public unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void | IPromise { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } public getPlugin(pluginIdentifier: string): ILoadedPlugin { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Add a new plugin to the installation * @param plugin - The new plugin to add * @param replaceExisting - should any existing plugin be replaced, default is false * @param doAsync - Should the add be performed asynchronously * @param addCb - [Optional] callback to call after the plugin has been added */ public addPlugin(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Update the configuration used and broadcast the changes to all loaded plugins * @param newConfig - The new configuration is apply * @param mergeExisting - Should the new configuration merge with the existing or just replace it. Default is to merge. */ public updateCfg(newConfig: T, mergeExisting?: boolean): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Returns the unique event namespace that should be used */ public evtNamespace(): string { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Add an unload handler that will be called when the SDK is being unloaded * @param handler - the handler */ public addUnloadCb(handler: UnloadHandler): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Add an ajax listener which is called just prior to the request being sent and before the correlation headers are added, to allow you * to access the headers and modify the values used to generate the distributed tracing correlation headers. (added in v2.8.4) * @param dependencyListener - The Telemetry Initializer function * @returns - A IDependencyListenerHandler to enable the initializer to be removed */ public addDependencyListener(dependencyListener: DependencyListenerFunction): IDependencyListenerHandler { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Add an dependency telemetry initializer callback function to allow populating additional properties or drop the request. * It is called after the dependency call has completed and any available performance details are available. A dependency * initializer is similar to the TelemetryInitializer function but it allows you to block the reporting of the dependency * request so that it doesn't count against the `maxAjaxCallsPerView`. * @param dependencyInitializer - The Dependency Telemetry Initializer function * @returns - A IDependencyInitializerHandler to enable the initializer to be removed */ public addDependencyInitializer(dependencyInitializer: DependencyInitializerFunction): IDependencyInitializerHandler { return null; } /** * Gets the current distributed trace context for this instance if available */ public getTraceCtx(): IDistributedTraceContext | null { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Sets the current distributed trace context for this instance if available */ public setTraceCtx(newTraceCtx: IDistributedTraceContext | null | undefined): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Watches and tracks changes for accesses to the current config, and if the accessed config changes the * handler will be recalled. * @param handler - The handler to call when the config changes * @returns A watcher handler instance that can be used to remove itself when being unloaded */ public onCfgChange(handler: WatcherFunction): IUnloadHook { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Start a new span with the given name and optional parent context. * * Note: This method only creates and returns the span. It does not automatically * set the span as the active trace context. Context management should be handled * separately using setTraceCtx() if needed. * * @param name - The name of the span * @param options - Options for creating the span (kind, attributes, startTime) * @param parent - Optional parent context. If not provided, uses the current active trace context * @returns A new span instance, or null if no trace provider is available * @since 3.4.0 */ public startSpan(name: string, options?: IOTelSpanOptions, parent?: IDistributedTraceContext): IReadableSpan | null { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Return the current active span, if no trace provider is available null will be returned * but when a trace provider is available a span instance will always be returned, even if * there is no active span (in which case a non-recording span will be returned). * @param createNew - Optional flag to create a non-recording span if no active span exists, defaults to true. * When false, returns the existing active span or null without creating a non-recording span. * @returns The current active span or null if no trace provider is available or if createNew is false and no active span exists * @since 3.4.0 */ public getActiveSpan(createNew?: boolean): IReadableSpan | null { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Set the current Active Span, if no trace provider is available the span will be not be set as the active span. * @param span - The span to set as the active span * @returns An ISpanScope instance that provides the current scope, the span will always be the span passed in * even when no trace provider is available * @since 3.4.0 */ public setActiveSpan(span: IReadableSpan): ISpanScope { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Set the trace provider for creating spans. * This allows different SKUs to provide their own span implementations. * * @param provider - The trace provider to use for span creation * @since 3.4.0 */ public setTraceProvider(provider: ICachedValue): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Get the current trace provider. * * @returns The current trace provider, or null if none is set * @since 3.4.0 */ public getTraceProvider(): ITraceProvider | null { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } } // tslint:disable-next-line export function _findSdkSourceFile() { if (_internalSdkSrc) { // Use the cached value return _internalSdkSrc; } let sdkSrc = null; let isModule = false; let cdns: string[] = [ "://js.monitor.azure.com/", "://az416426.vo.msecnd.net/" ]; try { // Try and determine whether the sdk is being loaded from the CDN // currentScript is only valid during initial processing let scrpt = (document || {} as any).currentScript; if (scrpt) { sdkSrc = scrpt.src; // } else { // // We need to update to at least typescript 2.9 for this to work :-( // // Leaving as a stub for now so after we upgrade this breadcrumb is available // let meta = import.meta; // sdkSrc = (meta || {}).url; // isModule = true; } } catch (e) { // eslint-disable-next-line no-empty } if (sdkSrc) { try { let url = sdkSrc.toLowerCase(); if (url) { let src = ""; arrForEach(cdns, (value, idx) => { if (strIndexOf(url, value) !== -1) { src = "cdn" + (idx + 1); if (strIndexOf(url, "/scripts/") === -1) { if (strIndexOf(url, "/next/") !== -1) { src += "-next"; } else if (strIndexOf(url, "/beta/") !== -1) { src += "-beta"; } } _internalSdkSrc = src + (isModule ? ".mod" : ""); return -1; } }); } } catch (e) { // eslint-disable-next-line no-empty } // Cache the found value so we don't have to look it up again _internalSdkSrc = sdkSrc; } return _internalSdkSrc; } ================================================ FILE: AISKU/src/ApplicationInsightsContainer.ts ================================================ import { throwUnsupported } from "@nevware21/ts-utils"; import { AppInsightsSku } from "./AISku"; import { IApplicationInsights } from "./IApplicationInsights"; import { Snippet } from "./Snippet"; export class ApplicationInsightsContainer { public static getAppInsights(snippet: Snippet, version: number) : IApplicationInsights { const theSku = new AppInsightsSku(snippet); // Two target scenarios: // Removed: 1. Customer runs v1 snippet + runtime. If customer updates just cdn location to new SDK, it will run in compat mode so old apis work // 2. Customer updates to new snippet (that uses cdn location to new SDK. This is same as a new customer onboarding // and all api signatures are expected to map to new SDK. Note new snippet specifies version if (version >= 2.0) { theSku.updateSnippetDefinitions(snippet); theSku.loadAppInsights(false); return theSku; // default behavior with new snippet } throwUnsupported("V1 API compatibility is no longer supported"); } } ================================================ FILE: AISKU/src/IApplicationInsights.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { AnalyticsPlugin } from "@microsoft/applicationinsights-analytics-js"; import { Sender } from "@microsoft/applicationinsights-channel-js"; import { IAppInsights, IConfiguration, ILoadedPlugin, IOTelApi, IPlugin, IPropertiesPlugin, IRequestHeaders, ITelemetryPlugin, ITelemetryUnloadState, ITraceApi, ITraceHost, UnloadHandler } from "@microsoft/applicationinsights-core-js"; import { IDependenciesPlugin } from "@microsoft/applicationinsights-dependencies-js"; import { IPromise } from "@nevware21/ts-async"; export { IRequestHeaders }; export interface IApplicationInsights extends IAppInsights, IDependenciesPlugin, IPropertiesPlugin, ITraceHost { appInsights: AnalyticsPlugin; /** * The OpenTelemetry API instance associated with this instance * Unlike OpenTelemetry, this API does not return a No-Op implementation and returns null if the SDK has been torn * down or not yet initialized. */ readonly otelApi: IOTelApi | null; /** * OpenTelemetry trace API for creating spans. * Unlike OpenTelemetry, this API does not return a No-Op implementation and returns null if the SDK has been torn * down or not yet initialized. */ readonly trace: ITraceApi | null; /** * Attempt to flush data immediately; If executing asynchronously (the default) and * you DO NOT pass a callback function then a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * will be returned which will resolve once the flush is complete. The actual implementation of the `IPromise` * will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async) * @param async - send data asynchronously when true * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. * If the caller doesn't return true the caller should assume that it may never be called. * @returns - If a callback is provided `true` to indicate that callback will be called after the flush is complete otherwise the caller * should assume that any provided callback will never be called, Nothing or if occurring asynchronously a * [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) which will be resolved once the unload is complete, * the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) will only be returned when no callback is provided * and async is true. */ flush: (async?: boolean, callBack?: () => void) => void | IPromise; onunloadFlush: (async?: boolean) => void; getSender: () => Sender; setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string, storeInCookie?: boolean): void; clearAuthenticatedUserContext(): void; /** * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered * to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous * unload call return `true` stating that all plugins reported that they also unloaded, the recommended * approach is to create a new instance and initialize that instance. * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable * to successfully remove any global references or they may just be completing the unload process asynchronously. * If you pass isAsync as `true` (also the default) and DO NOT pass a callback function then an [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * will be returned which will resolve once the unload is complete. The actual implementation of the `IPromise` * will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async) * @param isAsync - Can the unload be performed asynchronously (default) * @param unloadComplete - An optional callback that will be called once the unload has completed * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the * unload. Defaults to 5 seconds. * @returns Nothing or if occurring asynchronously a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * which will be resolved once the unload is complete, the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * will only be returned when no callback is provided and isAsync is true */ unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void | IPromise; /** * Find and return the (first) plugin with the specified identifier if present * @param pluginIdentifier - The identifier of the plugin to find */ getPlugin(pluginIdentifier: string): ILoadedPlugin; /** * Add a new plugin to the installation * @param plugin - The new plugin to add * @param replaceExisting - should any existing plugin be replaced * @param doAsync - Should the add be performed asynchronously */ addPlugin(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void; /** * Update the configuration used and broadcast the changes to all loaded plugins, this does NOT support updating, adding or removing * any the plugins. It will notify (if supported) that the configuration has changed but it will not remove or add any new plugins * @param newConfig - The new configuration is apply * @param mergeExisting - Should the new configuration merge with the existing or just replace it. Default is to merge. */ updateCfg(newConfig: T, mergeExisting?: boolean): void; /** * Returns the unique event namespace that should be used when registering events */ evtNamespace(): string; /** * Add a handler that will be called when the SDK is being unloaded * @param handler - the handler */ addUnloadCb(handler: UnloadHandler): void; } ================================================ FILE: AISKU/src/Init.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { strUndefined } from "@microsoft/applicationinsights-core-js"; import { getInst } from "@nevware21/ts-utils"; import { ApplicationInsightsContainer } from "./ApplicationInsightsContainer"; import { Snippet } from "./Snippet"; // ---------------------------------------------------------------------------------------------------- // Exports available from the Cdn bundles // ---------------------------------------------------------------------------------------------------- export { AppInsightsSku as ApplicationInsights } from "./AISku"; export { IApplicationInsights } from "./IApplicationInsights"; export { Snippet }; export { LoggingSeverity, PerfEvent, PerfManager, doPerf, newId, newGuid, random32, randomValue, generateW3CId, findW3cTraceParent, findMetaTag, mergeEvtNamespace, eventOn, eventOff, addEventHandler, removeEventHandler, isBeaconsSupported } from "@microsoft/applicationinsights-core-js"; export { RequestHeaders, DisabledPropertyName, DEFAULT_BREEZE_ENDPOINT, SeverityLevel, DistributedTracingModes, PropertiesPluginIdentifier, BreezeChannelIdentifier, AnalyticsPluginIdentifier } from "@microsoft/applicationinsights-core-js"; // ---------------------------------------------------------------------------------------------------- // End of Exports available from the Cdn bundles // ---------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------- // Additional exports available from applicationinsights-web.ts (interfaces and enums for typedoc) // ---------------------------------------------------------------------------------------------------- export { IConfiguration, IAppInsightsCore, eLoggingSeverity, ITelemetryItem, ITelemetryPlugin, IPerfEvent, IPerfManager, IPerfManagerProvider, INotificationListener, IPlugin, IDiagnosticLogger, ITelemetryPluginChain, ICustomProperties, INotificationManager, IProcessTelemetryContext, ILoadedPlugin } from "@microsoft/applicationinsights-core-js"; export { IConfig, IDependencyTelemetry, IPageViewPerformanceTelemetry, IPageViewTelemetry, IExceptionTelemetry, IAutoExceptionTelemetry, ITraceTelemetry, IMetricTelemetry, IEventTelemetry, IRequestTelemetry, IAppInsights, eSeverityLevel, IRequestHeaders, EventPersistence } from "@microsoft/applicationinsights-core-js"; export { ISenderConfig } from "@microsoft/applicationinsights-channel-js"; export { IAppInsightsInternal } from "@microsoft/applicationinsights-analytics-js"; export { IDependenciesPlugin, DependencyListenerFunction, DependencyInitializerFunction, IDependencyInitializerHandler, IDependencyListenerHandler } from "@microsoft/applicationinsights-dependencies-js"; export { ICfgSyncPlugin, ICfgSyncConfig, ICfgSyncEvent, ICfgSyncMode, NonOverrideCfg, OnCompleteCallback, SendGetFunction } from "@microsoft/applicationinsights-cfgsync-js"; // ---------------------------------------------------------------------------------------------------- // End of Additional exports // ---------------------------------------------------------------------------------------------------- function _logWarn(aiName:string, message:string) { // TODO: Find better place to warn to console when SDK initialization fails var _console = getInst("console"); if (_console && _console.warn) { _console.warn("Failed to initialize AppInsights JS SDK for instance " + (aiName || "") + " - " + message); } } // should be global function that should load as soon as SDK loads try { // E2E sku on load initializes core and pipeline using snippet as input for configuration // tslint:disable-next-line: no-var-keyword var aiName; if (typeof window !== strUndefined) { var _window = window; aiName = _window["appInsightsSDK"] || "appInsights"; if (document.currentScript) { aiName = document.currentScript.getAttribute("data-ai-name") || aiName; } if (typeof JSON !== strUndefined) { // get snippet or initialize to an empty object if (_window[aiName] !== undefined) { // this is the typical case for browser+snippet const snippet: Snippet = _window[aiName] || ({ version: 2.0 } as any); // overwrite snippet with full appInsights // only initiaize if required and detected snippet version is >= 2 or not defined if ((snippet.version >= 2 && (_window[aiName] as any).initialize) || snippet.version === undefined ) { ApplicationInsightsContainer.getAppInsights(snippet, snippet.version); } } } else { _logWarn(aiName, "Missing JSON - you must supply a JSON polyfill!"); } } else { _logWarn(aiName, "Missing window"); } // Hack: If legacy SDK exists, skip this step (Microsoft.ApplicationInsights exists). // else write what was there for v2 SDK prior to rollup bundle output name change. // e.g Microsoft.ApplicationInsights.ApplicationInsights, Microsoft.ApplicationInsights.Telemetry // @todo uncomment once integration tests for this can be added // if (typeof window !== strUndefined && window && ((window as any).Microsoft && !(window as any).Microsoft.ApplicationInsights)) { // (window as any).Microsoft = (window as any).Microsoft || {}; // (window as any).Microsoft.ApplicationInsights = { // ApplicationInsights, Telemetry // }; // } } catch (e) { _logWarn(aiName, e.message); } ================================================ FILE: AISKU/src/InternalConstants.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // ################################################################################################################################################### // Note: DON'T Export these const from the package as we are still targeting IE/ES5 this will export a mutable variables that someone could change ### // ################################################################################################################################################### // Generally you should only put values that are used more than 2 times and then only if not already exposed as a constant (such as SdkCoreNames) // as when using "short" named values from here they will be will be minified smaller than the SdkCoreNames[eSdkCoreNames.xxxx] value. const _AUTHENTICATED_USER_CONTEXT = "AuthenticatedUserContext"; const _TRACK = "track"; export const UNDEFINED_VALUE: undefined = undefined; export const STR_EMPTY = ""; export const STR_SNIPPET = "snippet"; export const STR_GET_COOKIE_MGR = "getCookieMgr"; export const STR_START_TRACK_PAGE = "startTrackPage"; export const STR_STOP_TRACK_PAGE = "stopTrackPage"; export const STR_FLUSH = "flush"; export const STR_START_TRACK_EVENT = "startTrackEvent"; export const STR_STOP_TRACK_EVENT = "stopTrackEvent"; export const STR_ADD_TELEMETRY_INITIALIZER = "addTelemetryInitializer"; export const STR_ADD_TELEMETRY_INITIALIZERS = STR_ADD_TELEMETRY_INITIALIZER + "s" as "addTelemetryInitializers"; export const STR_POLL_INTERNAL_LOGS = "pollInternalLogs"; export const STR_GET_PLUGIN = "getPlugin"; export const STR_EVT_NAMESPACE = "evtNamespace"; export const STR_TRACK_EVENT = _TRACK + "Event" as "trackEvent"; export const STR_TRACK_TRACE = _TRACK + "Trace" as "trackTrace"; export const STR_TRACK_METRIC = _TRACK + "Metric" as "trackMetric"; export const STR_TRACK_PAGE_VIEW = _TRACK + "PageView" as "trackPageView"; export const STR_TRACK_EXCEPTION = _TRACK + "Exception" as "trackException"; export const STR_TRACK_DEPENDENCY_DATA = _TRACK + "DependencyData" as "trackDependencyData"; export const STR_SET_AUTHENTICATED_USER_CONTEXT = "set" + _AUTHENTICATED_USER_CONTEXT as "setAuthenticatedUserContext"; export const STR_CLEAR_AUTHENTICATED_USER_CONTEXT = "clear" + _AUTHENTICATED_USER_CONTEXT as "clearAuthenticatedUserContext"; export const CONFIG_ENDPOINT_URL = "https://js.monitor.azure.com/scripts/b/ai.config.1.cfg.json"; ================================================ FILE: AISKU/src/Snippet.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. "use strict"; import { IConfig, IConfiguration } from "@microsoft/applicationinsights-core-js"; /** * * @export * @interface Snippet */ export interface Snippet { config: IConfiguration & IConfig; queue?: Array<() => void>; sv?: string; version?: number; } ================================================ FILE: AISKU/src/applicationinsights-web.ts ================================================ export { Snippet } from "./Snippet"; export { IApplicationInsights } from "./IApplicationInsights"; export { AppInsightsSku as ApplicationInsights } from "./AISku"; export { ApplicationInsightsContainer } from "./ApplicationInsightsContainer"; // OpenTelemetry trace API exports (public interfaces only) export { IOTelTracerProvider, IOTelTracer, IAttributeContainer, IOTelAttributes, IReadableSpan } from "@microsoft/applicationinsights-core-js"; // Re-exports export { IConfiguration, AppInsightsCore, IAppInsightsCore, LoggingSeverity, eLoggingSeverity, _eInternalMessageId, ITelemetryItem, ITelemetryPlugin, IPerfEvent, IPerfManager, IPerfManagerProvider, PerfEvent, PerfManager, doPerf, INotificationListener, NotificationManager, IPlugin, IDiagnosticLogger, BaseTelemetryPlugin, ITelemetryPluginChain, ICustomProperties, INotificationManager, IProcessTelemetryContext, Tags, ILoadedPlugin, IOTelSpan, eOTelSpanKind, OTelSpanKind, IOTelSpanOptions } from "@microsoft/applicationinsights-core-js"; export { IConfig, IDependencyTelemetry, IPageViewPerformanceTelemetry, IPageViewTelemetry, IExceptionTelemetry, IAutoExceptionTelemetry, ITraceTelemetry, IMetricTelemetry, IEventTelemetry, IAppInsights, SeverityLevel, eSeverityLevel, Event, Exception, Metric, PageView, PageViewPerformance, Trace, DistributedTracingModes, IRequestHeaders, EventPersistence } from "@microsoft/applicationinsights-core-js"; export { Sender, ISenderConfig } from "@microsoft/applicationinsights-channel-js"; export { ApplicationInsights as ApplicationAnalytics, IAppInsightsInternal, IAnalyticsConfig } from "@microsoft/applicationinsights-analytics-js"; export { PropertiesPlugin } from "@microsoft/applicationinsights-properties-js"; export { AjaxPlugin as DependenciesPlugin, IDependenciesPlugin, DependencyListenerFunction, DependencyInitializerFunction, IDependencyInitializerHandler, IDependencyListenerHandler } from "@microsoft/applicationinsights-dependencies-js"; export { CfgSyncPlugin, ICfgSyncPlugin, ICfgSyncConfig, ICfgSyncEvent, ICfgSyncMode, NonOverrideCfg, OnCompleteCallback, SendGetFunction } from "@microsoft/applicationinsights-cfgsync-js"; ================================================ FILE: AISKU/src/internal/trace/spanUtils.ts ================================================ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { ATTR_CLIENT_ADDRESS, ATTR_CLIENT_PORT, ATTR_ENDUSER_ID, ATTR_ENDUSER_PSEUDO_ID, ATTR_ERROR_TYPE, ATTR_EXCEPTION_MESSAGE, ATTR_EXCEPTION_STACKTRACE, ATTR_EXCEPTION_TYPE, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_NETWORK_LOCAL_ADDRESS, ATTR_NETWORK_LOCAL_PORT, ATTR_NETWORK_PEER_ADDRESS, ATTR_NETWORK_PEER_PORT, ATTR_NETWORK_PROTOCOL_NAME, ATTR_NETWORK_PROTOCOL_VERSION, ATTR_NETWORK_TRANSPORT, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_URL_FULL, ATTR_URL_PATH, ATTR_URL_QUERY, ATTR_URL_SCHEME, ATTR_USER_AGENT_ORIGINAL, CtxTagKeys, DBSYSTEMVALUES_MONGODB, DBSYSTEMVALUES_MYSQL, DBSYSTEMVALUES_POSTGRESQL, DBSYSTEMVALUES_REDIS, EXP_ATTR_ENDUSER_ID, EXP_ATTR_ENDUSER_PSEUDO_ID, EXP_ATTR_SYNTHETIC_TYPE, IAppInsightsCore, IAttributeContainer, IConfiguration, IContextTagKeys, IDependencyTelemetry, IReadableSpan, IRequestTelemetry, ITelemetryItem, MicrosoftClientIp, OTelAttributeValue, RemoteDependencyDataType, RemoteDependencyEnvelopeType, RequestDataType, RequestEnvelopeType, SEMATTRS_DB_NAME, SEMATTRS_DB_OPERATION, SEMATTRS_DB_STATEMENT, SEMATTRS_DB_SYSTEM, SEMATTRS_ENDUSER_ID, SEMATTRS_EXCEPTION_MESSAGE, SEMATTRS_EXCEPTION_STACKTRACE, SEMATTRS_EXCEPTION_TYPE, SEMATTRS_HTTP_CLIENT_IP, SEMATTRS_HTTP_FLAVOR, SEMATTRS_HTTP_HOST, SEMATTRS_HTTP_METHOD, SEMATTRS_HTTP_ROUTE, SEMATTRS_HTTP_SCHEME, SEMATTRS_HTTP_STATUS_CODE, SEMATTRS_HTTP_TARGET, SEMATTRS_HTTP_URL, SEMATTRS_HTTP_USER_AGENT, SEMATTRS_NET_HOST_IP, SEMATTRS_NET_HOST_NAME, SEMATTRS_NET_HOST_PORT, SEMATTRS_NET_PEER_IP, SEMATTRS_NET_PEER_NAME, SEMATTRS_NET_PEER_PORT, SEMATTRS_NET_TRANSPORT, SEMATTRS_PEER_SERVICE, SEMATTRS_RPC_GRPC_STATUS_CODE, SEMATTRS_RPC_SYSTEM, Tags, createAttributeContainer, createTelemetryItem, eDependencyTypes, eOTelSpanKind, eOTelSpanStatusCode, fieldRedaction, getDependencyTarget, getHttpMethod, getHttpStatusCode, getHttpUrl, getLocationIp, getUrl, getUserAgent, hrTimeToMilliseconds, isSqlDB, isSyntheticSource, urlGetPathName } from "@microsoft/applicationinsights-core-js"; import { ILazyValue, arrIncludes, asString, getLazy, isNullOrUndefined, strLower, strStartsWith } from "@nevware21/ts-utils"; import { STR_EMPTY, UNDEFINED_VALUE } from "../../InternalConstants"; /** * Azure SDK namespace. * @internal */ const AzNamespace = "az.namespace"; const AzResourceNamespace = "azure.resource_provider.namespace"; /** * Azure SDK Eventhub. * @internal */ const MicrosoftEventHub = "Microsoft.EventHub"; /** * Azure SDK message bus destination. * @internal */ const MessageBusDestination = "message_bus.destination"; /** * AI time since enqueued attribute. * @internal */ const TIME_SINCE_ENQUEUED = "timeSinceEnqueued"; const PORT_REGEX: ILazyValue = (/*#__PURE__*/ getLazy(() => new RegExp(/(https?)(:\/\/.*)(:\d+)(\S*)/))); const HTTP_DOT = (/*#__PURE__*/ "http."); const _MS_PROCESSED_BY_METRICS_EXTRACTORS = (/* #__PURE__*/"_MS.ProcessedByMetricExtractors"); /** * Legacy HTTP semantic convention values * @internal */ const _ignoreSemanticValues: ILazyValue = (/* #__PURE__*/ getLazy(_initIgnoreSemanticValues)); /* #__NO_SIDE_EFFECTS__ */ function _initIgnoreSemanticValues(): string[] { return [ // Internal Microsoft attributes _MS_PROCESSED_BY_METRICS_EXTRACTORS, // Legacy HTTP semantic values SEMATTRS_NET_PEER_IP, SEMATTRS_NET_PEER_NAME, SEMATTRS_NET_HOST_IP, SEMATTRS_PEER_SERVICE, SEMATTRS_HTTP_USER_AGENT, SEMATTRS_HTTP_METHOD, SEMATTRS_HTTP_URL, SEMATTRS_HTTP_STATUS_CODE, SEMATTRS_HTTP_ROUTE, SEMATTRS_HTTP_HOST, SEMATTRS_DB_SYSTEM, SEMATTRS_DB_STATEMENT, SEMATTRS_DB_OPERATION, SEMATTRS_DB_NAME, SEMATTRS_RPC_SYSTEM, SEMATTRS_RPC_GRPC_STATUS_CODE, SEMATTRS_EXCEPTION_TYPE, SEMATTRS_EXCEPTION_MESSAGE, SEMATTRS_EXCEPTION_STACKTRACE, SEMATTRS_HTTP_SCHEME, SEMATTRS_HTTP_TARGET, SEMATTRS_HTTP_FLAVOR, SEMATTRS_NET_TRANSPORT, SEMATTRS_NET_HOST_NAME, SEMATTRS_NET_HOST_PORT, SEMATTRS_NET_PEER_PORT, SEMATTRS_HTTP_CLIENT_IP, SEMATTRS_ENDUSER_ID, HTTP_DOT + "status_text", // http Semabtic conventions ATTR_CLIENT_ADDRESS, ATTR_CLIENT_PORT, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_URL_FULL, ATTR_URL_PATH, ATTR_URL_QUERY, ATTR_URL_SCHEME, ATTR_ERROR_TYPE, ATTR_NETWORK_LOCAL_ADDRESS, ATTR_NETWORK_LOCAL_PORT, ATTR_NETWORK_PROTOCOL_NAME, ATTR_NETWORK_PEER_ADDRESS, ATTR_NETWORK_PEER_PORT, ATTR_NETWORK_PROTOCOL_VERSION, ATTR_NETWORK_TRANSPORT, ATTR_USER_AGENT_ORIGINAL, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_EXCEPTION_TYPE, ATTR_EXCEPTION_MESSAGE, ATTR_EXCEPTION_STACKTRACE, EXP_ATTR_ENDUSER_ID, EXP_ATTR_ENDUSER_PSEUDO_ID, EXP_ATTR_SYNTHETIC_TYPE ]; } function _populateTagsFromSpan(telemetryItem: ITelemetryItem, span: IReadableSpan, contextKeys: IContextTagKeys, config: IConfiguration): void { let tags: Tags = telemetryItem.tags = (telemetryItem.tags || [] as Tags); let container = span.attribContainer || createAttributeContainer(span.attributes); tags[contextKeys.operationId] = span.spanContext().traceId; if ((span.parentSpanContext || {}).spanId) { tags[contextKeys.operationParentId] = span.parentSpanContext.spanId; } // Map OpenTelemetry enduser attributes to Application Insights user attributes const endUserId = container.get(ATTR_ENDUSER_ID); if (endUserId) { tags[contextKeys.userAuthUserId] = asString(endUserId); } const endUserPseudoId = container.get(ATTR_ENDUSER_PSEUDO_ID); if (endUserPseudoId) { tags[contextKeys.userId] = asString(endUserPseudoId); } const httpUserAgent = getUserAgent(container); if (httpUserAgent) { tags["ai.user.userAgent"] = String(httpUserAgent); } if (isSyntheticSource(container)) { tags[contextKeys.operationSyntheticSource] = "True"; } // Check for microsoft.client.ip first - this takes precedence over all other IP logic const microsoftClientIp = container.get(MicrosoftClientIp); if (microsoftClientIp) { tags[contextKeys.locationIp] = asString(microsoftClientIp); } if (span.kind === eOTelSpanKind.SERVER) { const httpMethod = getHttpMethod(container); // Only use the fallback IP logic for server spans if microsoft.client.ip is not set if (!microsoftClientIp) { tags[contextKeys.locationIp] = getLocationIp(container); } if (httpMethod) { const httpRoute = container.get(ATTR_HTTP_ROUTE); const httpUrl = getHttpUrl(container); tags[contextKeys.operationName] = span.name; // Default if (httpRoute) { // AiOperationName max length is 1024 // https://github.com/MohanGsk/ApplicationInsights-Home/blob/master/EndpointSpecs/Schemas/Bond/ContextTagKeys.bond tags[contextKeys.operationName] = httpMethod + " " + fieldRedaction(asString(httpRoute), config); } else if (httpUrl) { try { const urlPathName = fieldRedaction(urlGetPathName(asString(httpUrl)), config); tags[contextKeys.operationName] = httpMethod + " " + urlPathName; } catch { /* no-op */ } } } else { tags[contextKeys.operationName] = span.name; } } else { let opName = container.get(contextKeys.operationName); if (opName) { tags[contextKeys.operationName] = opName as string; } } // TODO: Location IP TBD for non server spans } /** * Check to see if the key is in the list of known properties to ignore (exclude) * from the properties collection * @param key - the property key to check * @param contextKeys - The current context keys * @returns true if the key should be ignored, false otherwise */ function _isIgnorePropertiesKey(key: string, contextKeys: IContextTagKeys): boolean { let result = false; if (arrIncludes(_ignoreSemanticValues.v, key)) { // The key is in set of known keys to ignore result = true; } else if (strStartsWith(key, "microsoft.")) { // Ignoring all ALL keys starting with "microsoft." result = true; } else if (key === contextKeys.operationName) { // Ignoring the key if it is the operation name context tag result = true; } return result; } function _populatePropertiesFromAttributes(item: ITelemetryItem, contextKeys: IContextTagKeys, container: IAttributeContainer): void { if (container) { let baseData = item.baseData = (item.baseData || {}); let properties: { [propertyName: string]: any } = baseData.properties = (baseData.properties || {}); container.forEach((key: string, value) => { // Avoid duplication ignoring fields already mapped. if (!_isIgnorePropertiesKey(key, contextKeys)) { properties[key] = value; } }); } } function _populateHttpDependencyProperties(dependencyTelemetry: IDependencyTelemetry, container: IAttributeContainer, httpMethod: OTelAttributeValue | undefined, config: IConfiguration): boolean { if (httpMethod) { // HTTP Dependency const httpUrl = getHttpUrl(container); if (httpUrl) { try { const pathName = urlGetPathName(asString(httpUrl)); if (pathName) { dependencyTelemetry.name = httpMethod + " " + fieldRedaction(pathName, config); } } catch { /* no-op */ } } dependencyTelemetry.type = eDependencyTypes.Http; dependencyTelemetry.data = fieldRedaction(getUrl(container), config); const httpStatusCode = getHttpStatusCode(container); if (httpStatusCode) { dependencyTelemetry.responseCode = +httpStatusCode; } let target = getDependencyTarget(container); if (target) { try { // Remove default port const res = PORT_REGEX.v.exec(target); if (res !== null) { const protocol = res[1]; const port = res[3]; if ( (protocol === "https" && port === ":443") || (protocol === "http" && port === ":80") ) { // Drop port target = res[1] + res[2] + res[4]; } } } catch { /* no-op */ } dependencyTelemetry.target = target; } } return !!httpMethod; } function _populateDbDependencyProperties(dependencyTelemetry: IDependencyTelemetry, container: IAttributeContainer, dbSystem: OTelAttributeValue | undefined): boolean { if (dbSystem) { // TODO: Remove special logic when Azure UX supports OpenTelemetry dbSystem if (String(dbSystem) === DBSYSTEMVALUES_MYSQL) { dependencyTelemetry.type = "mysql"; } else if (String(dbSystem) === DBSYSTEMVALUES_POSTGRESQL) { dependencyTelemetry.type = "postgresql"; } else if (String(dbSystem) === DBSYSTEMVALUES_MONGODB) { dependencyTelemetry.type = "mongodb"; } else if (String(dbSystem) === DBSYSTEMVALUES_REDIS) { dependencyTelemetry.type = "redis"; } else if (isSqlDB(String(dbSystem))) { dependencyTelemetry.type = "SQL"; } else { dependencyTelemetry.type = String(dbSystem); } const dbStatement = container.get(SEMATTRS_DB_STATEMENT); const dbOperation = container.get(SEMATTRS_DB_OPERATION); if (dbStatement) { dependencyTelemetry.data = String(dbStatement); } else if (dbOperation) { dependencyTelemetry.data = String(dbOperation); } const target = getDependencyTarget(container); const dbName = container.get(SEMATTRS_DB_NAME); if (target) { dependencyTelemetry.target = dbName ? target + "|" + asString(dbName) : target; } else { dependencyTelemetry.target = dbName ? asString(dbName) : asString(dbSystem); } } return !!dbSystem; } function _populateRpcDependencyProperties(dependencyTelemetry: IDependencyTelemetry, container: IAttributeContainer, rpcSystem: OTelAttributeValue | undefined): boolean { if (rpcSystem) { if (strLower(rpcSystem) === "wcf") { dependencyTelemetry.type = eDependencyTypes.Wcf; } else { dependencyTelemetry.type = eDependencyTypes.Grpc; } const grpcStatusCode = container.get(SEMATTRS_RPC_GRPC_STATUS_CODE); if (!isNullOrUndefined(grpcStatusCode)) { dependencyTelemetry.responseCode = +grpcStatusCode; } const target = getDependencyTarget(container); if (target) { dependencyTelemetry.target = asString(target); } else { dependencyTelemetry.target = String(rpcSystem); } } return !!rpcSystem; } function createDependencyTelemetryItem(core: IAppInsightsCore, span: IReadableSpan, contextKeys: IContextTagKeys): ITelemetryItem { let container = span.attribContainer || createAttributeContainer(span.attributes); let dependencyType = "Dependency"; if (span.kind === eOTelSpanKind.PRODUCER) { dependencyType = eDependencyTypes.QueueMessage; } else if (span.kind === eOTelSpanKind.INTERNAL && span.parentSpanContext) { dependencyType = eDependencyTypes.InProc; } let spanCtx = span.spanContext(); let dependencyTelemetry: IDependencyTelemetry = { name: span.name, // Default id: spanCtx.spanId || core.getTraceCtx().spanId, success: (span.status || {}).code !== eOTelSpanStatusCode.ERROR, responseCode: 0, type: dependencyType, duration: hrTimeToMilliseconds(span.duration), data: STR_EMPTY, target: STR_EMPTY, properties: UNDEFINED_VALUE, measurements: UNDEFINED_VALUE }; // Check for HTTP Dependency if (!_populateHttpDependencyProperties(dependencyTelemetry, container, getHttpMethod(container), core.config)) { // Check for DB Dependency if (!_populateDbDependencyProperties(dependencyTelemetry, container, container.get(SEMATTRS_DB_SYSTEM))) { // Check for Rpc Dependency _populateRpcDependencyProperties(dependencyTelemetry, container, container.get(SEMATTRS_RPC_SYSTEM)); } } return createTelemetryItem(dependencyTelemetry, RemoteDependencyDataType, RemoteDependencyEnvelopeType.replace("{0}.", ""), core.logger); } function createRequestTelemetryItem(core: IAppInsightsCore, span: IReadableSpan, contextKeys: IContextTagKeys): ITelemetryItem { let container = span.attribContainer || createAttributeContainer(span.attributes); let spanCtx = span.spanContext(); const requestData: IRequestTelemetry = { name: span.name, // Default id: spanCtx.spanId || core.getTraceCtx().spanId, success: span.status.code !== eOTelSpanStatusCode.UNSET ? span.status.code === eOTelSpanStatusCode.OK : (Number(getHttpStatusCode(container)) || 0) < 400, responseCode: 0, duration: hrTimeToMilliseconds(span.duration), source: undefined }; const httpMethod = getHttpMethod(container); const grpcStatusCode = container.get(SEMATTRS_RPC_GRPC_STATUS_CODE); if (httpMethod) { requestData.url = fieldRedaction(getUrl(container), core.config); const httpStatusCode = getHttpStatusCode(container); if (httpStatusCode) { requestData.responseCode = +httpStatusCode; } } else if (grpcStatusCode) { requestData.responseCode = +grpcStatusCode; } return createTelemetryItem(requestData, RequestDataType, RequestEnvelopeType.replace("{0}.", ""), core.logger); } export function createTelemetryItemFromSpan(core: IAppInsightsCore, span: IReadableSpan): ITelemetryItem | null { let telemetryItem: ITelemetryItem = null; let container = span.attribContainer || createAttributeContainer(span.attributes); let contextKeys: IContextTagKeys = CtxTagKeys; let kind = span.kind; if (kind == eOTelSpanKind.SERVER || kind == eOTelSpanKind.CONSUMER) { // Request telemetryItem = createRequestTelemetryItem(core, span, contextKeys); } else if (kind == eOTelSpanKind.CLIENT || kind == eOTelSpanKind.PRODUCER || kind == eOTelSpanKind.INTERNAL) { // RemoteDependency telemetryItem = createDependencyTelemetryItem(core, span, contextKeys); } else { //diag.error(`Unsupported span kind ${span.kind}`); } if (telemetryItem) { // Set start time for the telemetry item from the event, not the time it is being processed (the default) // The channel envelope creator uses this value when creating the envelope only when defined, otherwise it // uses the time when the item is being processed let baseData = telemetryItem.baseData = telemetryItem.baseData || {}; baseData.startTime = new Date(hrTimeToMilliseconds(span.startTime)); // Add dt extension to the telemetry item let ext = telemetryItem.ext = telemetryItem.ext || {}; let dt = ext["dt"] = ext["dt"] || {}; // Don't overwrite any existing values dt.spanId = dt.spanId || span.spanContext().spanId; dt.traceId = dt.traceId || span.spanContext().traceId; let traceFlags = span.spanContext().traceFlags; if (!isNullOrUndefined(traceFlags)) { dt.traceFlags = dt.traceFlags || traceFlags; } _populateTagsFromSpan(telemetryItem, span, contextKeys, core.config); _populatePropertiesFromAttributes(telemetryItem, contextKeys, container); let sampleRate = container.get("microsoft.sample_rate"); if (!isNullOrUndefined(sampleRate)) { (telemetryItem as any).sampleRate = Number(sampleRate); } // Azure SDK let azNamespace = container.get(AzResourceNamespace) || container.get(AzNamespace); if (azNamespace) { if (span.kind === eOTelSpanKind.INTERNAL) { baseData.type = eDependencyTypes.InProc + " | " + azNamespace; } if (azNamespace === MicrosoftEventHub) { _parseEventHubSpan(telemetryItem, span); } } } return telemetryItem; } /** * Implementation of Mapping to Azure Monitor * * https://gist.github.com/lmolkova/e4215c0f44a49ef824983382762e6b92#mapping-to-azure-monitor-application-insights-telemetry * @internal */ function _parseEventHubSpan(telemetryItem: ITelemetryItem, span: IReadableSpan): void { let baseData = telemetryItem.baseData = telemetryItem.baseData || {}; let container = span.attribContainer || createAttributeContainer(span.attributes); const namespace = container.get(AzResourceNamespace) || container.get(AzNamespace); const peerAddress = asString(container.get(SEMATTRS_NET_PEER_NAME) || container.get("peer.address") || "unknown").replace(/\/$/g, ""); // remove trailing "/" const messageBusDestination = (container.get(MessageBusDestination) || "unknown") as string; let baseType = baseData.type || ""; let kind = span.kind; if (kind === eOTelSpanKind.CLIENT) { baseType = namespace; baseData.target = peerAddress + "/" + messageBusDestination; } else if (kind === eOTelSpanKind.PRODUCER) { baseType = "Queue Message | " + namespace; baseData.target = peerAddress + "/" + messageBusDestination; } else if (kind === eOTelSpanKind.CONSUMER) { baseType = "Queue Message | " + namespace; (baseData as any).source = peerAddress + "/" + messageBusDestination; let measurements = baseData.measurements = (baseData.measurements || {}); let timeSinceEnqueued = container.get("timeSinceEnqueued"); if (timeSinceEnqueued) { measurements[TIME_SINCE_ENQUEUED] = Number(timeSinceEnqueued); } else { let enqueuedTime = parseFloat(asString(container.get("enqueuedTime"))); if (isNaN(enqueuedTime)) { enqueuedTime = 0; } measurements[TIME_SINCE_ENQUEUED] = hrTimeToMilliseconds(span.startTime) - enqueuedTime; } } baseData.type = baseType; } ================================================ FILE: AISKU/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": true, "module": "es6", "target": "es5", "moduleResolution": "Node", "alwaysStrict": true, "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "importHelpers": true, "noEmitHelpers": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "declaration": true, "declarationDir": "build/types", "outDir": "dist-es5", "rootDir": "./src", "removeComments": false }, "include": [ "./src/**/*.ts" ], "exclude": [ "node_modules" ] } ================================================ FILE: AISKU/tsdoc.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", "extends": ["../tsdoc.json"] } ================================================ FILE: AISKU/tslint.json ================================================ { "extends": [ "../tslint-base.json" ] } ================================================ FILE: AISKU/typedoc.json ================================================ { "$schema": "https://typedoc.org/schema.json", "entryPoints": [ "./src/Init.ts" ], "exclude": [ "**/internal/**/*.ts", "node_modules/**" ], "externalPattern": [ "**/node_modules/**", "node_modules/**" ], "sort": [ "alphabetical", "kind", "instance-first" ], "basePath": "./src", "sourceLinkTemplate": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/{path}#L{line}", "cleanOutputDir": true, "excludeExternals": false, "excludeInternal": true, "excludePrivate": true, "includeVersion": true, "groupOrder": [ "Entrypoint", "Modules", "Namespaces", "Enumerations", "Enumeration Members", "Classes", "Interfaces", "Type Aliases", "Constructors", "Properties", "Variables", "Functions", "Accessors", "Methods", "References", "*" ], "tsconfig": "./tsconfig.json", "out": "../docs/webSdk/applicationinsights-web", "readme": "none", "githubPages": true, "gitRevision": "main", "compilerOptions": { "stripInternal": true }, "sidebarLinks": { "Changelog": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/RELEASES.md", "Examples": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/examples/README.md", "Readme": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/AISKU/README.md" }, "navigationLinks": { "GitHub": "https://github.com/Microsoft/ApplicationInsights-JS", "npm": "https://www.npmjs.com/package/@microsoft/applicationinsights-web" }, "visibilityFilters": { "protected": false, "private": false, "inherited": true, "external": true } } ================================================ FILE: AISKULight/.npmignore ================================================ # NPM Ignore # ignore everything * # ... but these files !package.json !tsconfig.json !/CODE_OF_CONDUCT.md !/CONTRIBUTING.md !/README.md !/SECURITY.md !/SUPPORT.md !/NOTICE !/PRIVACY !/LICENSE !/LICENSE.TXT !dist-es*/** !dist/** !browser/** !types/** ================================================ FILE: AISKULight/LICENSE ================================================ The MIT License (MIT) Copyright (c) Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: AISKULight/NOTICE ================================================ NOTICES AND INFORMATION Do Not Translate or Localize This software incorporates material from third parties. Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, or you may send a check or money order for US $5.00, including the product name, the open source component name, and version number, to: Source Code Compliance Team Microsoft Corporation One Microsoft Way Redmond, WA 98052 USA Notwithstanding any other terms, you may reverse engineer this software to the extent required to debug changes to any libraries licensed under the GNU Lesser General Public License. ================================================ FILE: AISKULight/PRIVACY ================================================ # Data Collection The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ================================================ FILE: AISKULight/README.md ================================================ # Microsoft Application Insights JavaScript SDK - Web Basic [![GitHub Workflow Status (main)](https://img.shields.io/github/actions/workflow/status/microsoft/ApplicationInsights-JS/ci.yml?branch=main)](https://github.com/microsoft/ApplicationInsights-JS/tree/main) [![Build Status](https://dev.azure.com/mseng/AppInsights/_apis/build/status/AppInsights%20-%20DevTools/1DS%20JavaScript%20SDK%20web%20SKU%20vNext?branchName=main)](https://dev.azure.com/mseng/AppInsights/_build/latest?definitionId=8184&branchName=main) [![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-web-basic.svg)](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-web-basic) Application Insights - Web Basic SDK Application Insights AI SKU Light is a package that combines minimum required packages for Web scenarios. Refer to [ApplicationInsights-JS](../README.md) for more details on getting started. ## V3.x Release Breaking changes - Removed ES3 / IE8 Support - Removed V1 API Backward Compatibility (Upgrading V1 -> V3) See [Breaking Changes](https://microsoft.github.io/ApplicationInsights-JS/upgrade/v3_BreakingChanges.html) ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. ## License [MIT](LICENSE) ================================================ FILE: AISKULight/Tests/Unit/src/AISKULightSize.Tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { dumpObj } from '@nevware21/ts-utils'; import { createPromise, doAwait, IPromise } from '@nevware21/ts-async'; import * as pako from "pako"; const PACKAGE_JSON = "../package.json"; function removeTrailingComma(text) { return text.replace(/,(\s*[}\],])/g, "$1"); } function _loadPackageJson(cb:(isNightly: boolean, packageJson: any) => IPromise): IPromise { return createPromise((testCompleted, testFailed) => { function _handleCallback(packageJson: any) { let version = packageJson.version || "unknown"; let isNightly = version.includes("nightly") || version.includes("dev"); doAwait(cb(isNightly, packageJson), () => { testCompleted(); }, (error) => { Assert.ok(false, `checkIsNightlyBuild error: ${error}`); testFailed(error); }); } fetch(PACKAGE_JSON).then((response) => { if (!response.ok) { Assert.ok(false, `fetch package.json error: ${dumpObj(response)}`); _handleCallback(false); } else { return response.text().then((content) => { let json = JSON.parse(removeTrailingComma(content)); _handleCallback(json); }, (error) => { Assert.ok(false, `fetch package.json error: ${error}`); _handleCallback({}); }); } }, (error) => { Assert.ok(false, `fetch package.json error: ${error}`); _handleCallback({}); }); }); } function _checkSize(checkType: string, maxSize: number, size: number, isNightly: boolean): void { if (isNightly) { maxSize += .5; } Assert.ok(size <= maxSize, `exceed ${maxSize} KB, current ${checkType} size is: ${size} KB`); } export class AISKULightSizeCheck extends AITestClass { private readonly MAX_RAW_SIZE = 102; private readonly MAX_BUNDLE_SIZE = 102; private readonly MAX_RAW_DEFLATE_SIZE = 42; private readonly MAX_BUNDLE_DEFLATE_SIZE = 42; private readonly rawFilePath = "../dist/es5/applicationinsights-web-basic.min.js"; private readonly currentVer = "3.4.1"; private readonly prodFilePath = `../browser/es5/aib.${this.currentVer[0]}.min.js`; public testInitialize() { } public testCleanup() { } public registerTests() { this.addRawFileSizeCheck(); this.addProdFileSizeCheck(); } constructor() { super("AISKULightSizeCheck"); } private addRawFileSizeCheck(): void { this._checkFileSize(false); } private addProdFileSizeCheck(): void { this._checkFileSize(true); } private _checkFileSize(isProd: boolean): void { let _filePath = isProd? this.prodFilePath : this.rawFilePath; let _maxFullSize = isProd ? this.MAX_BUNDLE_SIZE : this.MAX_RAW_SIZE; let _maxDeflateSize = isProd ? this.MAX_BUNDLE_DEFLATE_SIZE : this.MAX_RAW_DEFLATE_SIZE; let postfix = isProd? " (prod)" : " (dist)"; let fileName = _filePath.split("..")[2]; this.testCase({ name: `Test AISKULight${postfix} deflate size`, test: () => { Assert.ok(true, `test file: ${fileName}`); return _loadPackageJson((isNightly, packageJson) => { Assert.ok(true, ` checking : ${packageJson.name || "??"} v${packageJson.version || "unknown"}`); let request = new Request(_filePath, {method:"GET"}); return fetch(request).then((response) => { if (!response.ok) { Assert.ok(false, `fetch AISKULight${postfix} error: ${response.statusText}`); return; } else { return response.text().then(text => { let size = Math.ceil((text.length/1024) * 100) / 100.0; _checkSize("bundle", _maxFullSize, size, isNightly); let deflateSize = Math.ceil((pako.deflate(text).length/1024) * 100) / 100.0; _checkSize("deflate", _maxDeflateSize, deflateSize, isNightly); }).catch((error: Error) => { Assert.ok(false, `AISKULight${postfix} response error: ${error}`); }); } }).catch((error: Error) => { Assert.ok(false, `AISKULight${postfix} deflate size error: ${error}`); }); }); } }); } } ================================================ FILE: AISKULight/Tests/Unit/src/GlobalTestHooks.Test.ts ================================================ import { Assert } from "@microsoft/ai-test-framework"; import { _testHookMaxUnloadHooksCb } from "@microsoft/applicationinsights-core-js"; import { dumpObj } from "@nevware21/ts-utils"; export class GlobalTestHooks { public registerTests() { // Set a global maximum _testHookMaxUnloadHooksCb(20, (state: string, hooks: Array) => { Assert.ok(false, "Max unload hooks exceeded [" + hooks.length + "] - " + state + " - " + dumpObj(hooks)); }); } } ================================================ FILE: AISKULight/Tests/Unit/src/aiskuliteunittests.ts ================================================ import { AISKULightSizeCheck } from "./AISKULightSize.Tests"; import { ApplicationInsightsDynamicConfigTests } from "./dynamicconfig.tests"; import { ApplicationInsightsConfigTests } from "./config.tests"; import { GlobalTestHooks } from "./GlobalTestHooks.Test"; import { AISKULightOTelNegativeTests } from "./otelNegative.tests"; export function runTests() { new GlobalTestHooks().registerTests(); new AISKULightSizeCheck().registerTests(); new ApplicationInsightsDynamicConfigTests().registerTests(); new ApplicationInsightsConfigTests().registerTests(); new AISKULightOTelNegativeTests().registerTests(); } ================================================ FILE: AISKULight/Tests/Unit/src/config.tests.ts ================================================ import { AITestClass, Assert, PollingAssert } from "@microsoft/ai-test-framework"; import { ITelemetryItem, newId } from "@microsoft/applicationinsights-core-js"; import { ApplicationInsights} from "../../../src/index"; import { BreezeChannelIdentifier, ContextTagKeys, utlRemoveSessionStorage } from "@microsoft/applicationinsights-core-js"; import { Sender } from "@microsoft/applicationinsights-channel-js"; export class ApplicationInsightsConfigTests extends AITestClass { private readonly _instrumentationKey = "b7170927-2d1c-44f1-acec-59f4e1751c11"; private readonly _endpoint = "endpoint" private readonly _connectionString = `InstrumentationKey=${this._instrumentationKey};ingestionendpoint=${this._endpoint}`; private readonly _iKey = "testKey"; private _sessionPrefix: string = newId(); static registerTests: any; private static readonly _expectedTrackMethods = [ "flush", "pollInternalLogs", "stopPollingInternalLogs", "unload", "getPlugin", "addPlugin", "evtNamespace", "addUnloadCb", "onCfgChange", "getTraceCtx", "updateCfg", "addTelemetryInitializer" ]; constructor(testName?: string) { super(testName || "ApplicationInsightsAISKULightTests"); } protected _getTestConfig(sessionPrefix: string, ikey?: boolean, cs?: boolean) { return { instrumentationKey: ikey? this._iKey : undefined, connectionString: cs? this._connectionString : undefined, namePrefix: sessionPrefix }; } public testInitialize() { super.testInitialize(); } public testCleanup() { utlRemoveSessionStorage(null as any, "AI_sentBuffer", ); utlRemoveSessionStorage(null as any, "AI_buffer", ); utlRemoveSessionStorage(null as any, this._sessionPrefix + "_AI_sentBuffer", ); utlRemoveSessionStorage(null as any, this._sessionPrefix + "_AI_buffer", ); super.testCleanup(); } public testFinishedCleanup(): void { console.log("* testCleanup(" + (AITestClass.currentTestInfo ? AITestClass.currentTestInfo.name : "") + ")"); } public registerTests() { this.addConfigTests(); this.addApiTests(); } private addConfigTests(): void { this.testCase({ name: "ConfigTests: ApplicationInsights config should set default endpoint", test: () => { let expectedConnectionString = `InstrumentationKey=${this._instrumentationKey}` let _config = { connectionString: expectedConnectionString, namePrefix:this._sessionPrefix }; Assert.ok(_config) let ai = new ApplicationInsights(_config); this.onDone(() =>{ ai.unload(false); }); Assert.ok(ai, "ApplicationInsights light Instance is initialized"); let config = ai.config; let expectedIkey = this._instrumentationKey; let expectedEndpointUrl = "https://dc.services.visualstudio.com/v2/track"; let expectedLoggingLevel = 10000; Assert.ok(config, "ApplicationInsights Light config exists"); Assert.equal(expectedConnectionString, config.connectionString, "connection string is set"); Assert.equal(expectedIkey, config.instrumentationKey, "ikey is set"); Assert.equal(expectedLoggingLevel, config.diagnosticLogInterval, "diagnosticLogInterval is set to 1000 by default"); Assert.equal(expectedEndpointUrl, config.endpointUrl, "endpoint url is set from connection string"); } }); this.testCase({ name: "ConfigTests: ApplicationInsights config works correctly with connection string", test: () => { let _config = this._getTestConfig(this._sessionPrefix, false, true); Assert.ok(_config) let ai = new ApplicationInsights(_config); this.onDone(() =>{ ai.unload(false); }); Assert.ok(ai, "ApplicationInsights light Instance is initialized"); let config = ai.config; let expectedIkey = this._instrumentationKey; let expectedConnectionString = this._connectionString; let expectedEndpointUrl = `${this._endpoint}/v2/track`; let expectedLoggingLevel = 10000; Assert.ok(config, "ApplicationInsights Light config exists"); Assert.equal(expectedConnectionString, config.connectionString, "connection string is set"); Assert.equal(expectedIkey, config.instrumentationKey, "ikey is set"); Assert.equal(expectedLoggingLevel, config.diagnosticLogInterval, "diagnosticLogInterval is set to 1000 by default"); Assert.equal(expectedEndpointUrl, config.endpointUrl, "endpoint url is set from connection string"); } }); this.testCase({ name: "ConfigTests: ApplicationInsights config works correctly with connection string and Ikey", useFakeTimers: true, test: () => { let _config = this._getTestConfig(this._sessionPrefix, true, true); Assert.ok(_config) let ai = new ApplicationInsights(_config); this.onDone(() =>{ ai.unload(false); }); Assert.ok(ai, "ApplicationInsights light Instance is initialized"); Assert.ok(ai); let config = ai.config; let expectedIkey = this._instrumentationKey; let expectedConnectionString = this._connectionString; let expectedEndpointUrl = `${this._endpoint}/v2/track`; let expectedLoggingLevel = 10000; Assert.ok(config, "ApplicationInsights Light config exists"); Assert.equal(expectedConnectionString, config.connectionString, "connection string is set"); Assert.equal(expectedIkey, config.instrumentationKey, "ikey is set from connection string"); Assert.equal(expectedLoggingLevel, config.diagnosticLogInterval, "diagnosticLogInterval is set to 1000 by default"); Assert.equal(expectedEndpointUrl, config.endpointUrl, "endpoint url is set from connection string"); } }); this.testCase({ name: "ConfigTests: ApplicationInsights config works correctly with ikey", useFakeTimers: true, test: () => { let _config = this._getTestConfig(this._sessionPrefix, true, false); Assert.ok(_config) let ai = new ApplicationInsights(_config); this.onDone(() =>{ ai.unload(false); }); Assert.ok(ai, "ApplicationInsights light Instance is initialized"); Assert.ok(ai); let config = ai.config; let expectedIkey = this._iKey; let expectedLoggingLevel = 10000; Assert.ok(config, "ApplicationInsights Light config exists"); Assert.ok(!config.connectionString, "connection string shoud not set"); Assert.equal(expectedIkey, config.instrumentationKey, "ikey is set"); Assert.equal(expectedLoggingLevel, config.diagnosticLogInterval, "diagnosticLogInterval is set to 1000 by default"); Assert.ok(!config.endpointUrl, "endpoint url should not set from ikey"); } }); this.testCase({ name: "ConfigTests: ApplicationInsights sholuld throw error when no ikey and connection string provided", useFakeTimers: true, test: () => { try { let _config = this._getTestConfig(this._sessionPrefix, false, false); Assert.ok(_config) let ai = new ApplicationInsights(_config); this.onDone(() =>{ ai.unload(false); }); Assert.ok(false, "ApplicationInsights light Instance should not be initialized"); Assert.ok(ai); } catch(e) { Assert.ok(true, "error should be thrown"); } } }); } public addApiTests(): void { this.testCase({ name: "DynamicConfigTests: Public Members exist", test: () => { let _config = this._getTestConfig(this._sessionPrefix, true, false); Assert.ok(_config) let ai = new ApplicationInsights(_config); this.onDone(() =>{ ai.unload(false); }); Assert.ok(ai, "ApplicationInsights light Instance is initialized"); let trackMethod = "track"; let flushMethod = "flush"; Assert.ok(ai[trackMethod], `${trackMethod} method exists`); Assert.equal("function", typeof ai["track"], `${trackMethod} is a function`); Assert.ok(ai[flushMethod], `${flushMethod} method exists`); Assert.equal("function", typeof ai[flushMethod], `${flushMethod} is a function`); } }); this.testCase({ name: 'Proxy function exist', test: () => { this.onDone(() =>{ ai.unload(false); }); let _config = this._getTestConfig(this._sessionPrefix, true, false); let ai = new ApplicationInsights(_config); ApplicationInsightsConfigTests._expectedTrackMethods.forEach(method => { Assert.ok(ai[method], `${method} exists`); Assert.equal('function', typeof ai[method], `${method} is a function`); }); } }); this.testCase({ name: "TrackTests: BaseData and baseType should exist", test: () => { let _config = this._getTestConfig(this._sessionPrefix, true, false); Assert.ok(_config) let ai = new ApplicationInsights(_config); this.onDone(() =>{ ai.unload(false); }); Assert.ok(ai, "ApplicationInsights light Instance is initialized"); let trackMethod = "track"; Assert.ok(ai[trackMethod], `${trackMethod} method exists`); Assert.equal("function", typeof ai["track"], `${trackMethod} is a function`); let sender: Sender = ai.getPlugin(BreezeChannelIdentifier).plugin; Assert.ok(sender && sender.processTelemetry, "sender exists"); let senderSpy = this.sandbox.spy(sender, "processTelemetry"); // Case1: no baseData and no baseType ai.track({name: "test"}); Assert.ok(senderSpy.calledOnce, "sender should be called"); let item = senderSpy.args[0][0]; Assert.equal(item.name, "test", "name exists"); Assert.deepEqual(item.baseData, {}, "baseData exists"); Assert.equal(item.baseType, "EventData", "baseType exists"); // Case2: baseData and no baseType ai.track({name: "test1", baseData:{a: "test1"}}); Assert.equal(senderSpy.callCount, 2, "sender should be called again test1"); item = senderSpy.args[1][0]; Assert.equal(item.name, "test1", "name exists test1"); Assert.deepEqual(item.baseData, {a: "test1"}, "baseData exists test1"); Assert.equal(item.baseType, "EventData", "baseType existstest1"); // Case3: baseData and baseType ai.track({name: "test2", baseData:{a: "test2"}, baseType: "test2"}); Assert.equal(senderSpy.callCount, 3, "sender should be called again test2"); item = senderSpy.args[2][0]; Assert.equal(item.name, "test2", "name exists test2"); Assert.deepEqual(item.baseData, {a: "test2"}, "baseData exists test2"); Assert.equal(item.baseType, "test2", "baseType exists test2"); } }); this.testCase({ name: 'Proxy function exist', test: () => { this.onDone(() =>{ ai.unload(false); }); let _config = this._getTestConfig(this._sessionPrefix, true, false); let ai = new ApplicationInsights(_config); ApplicationInsightsConfigTests._expectedTrackMethods.forEach(method => { Assert.ok(ai[method], `${method} exists`); Assert.equal('function', typeof ai[method], `${method} is a function`); }); } }); this.testCase({ name: 'test proxy function (telemetry initializer) works', useFakeTimers: true, test: () => { this.onDone(() =>{ ai.unload(false); }); let _config = this._getTestConfig(this._sessionPrefix, true, false); let ai = new ApplicationInsights(_config); const telemetryInitializer = { initializer: (envelope) => { } } const spy = this.sandbox.spy(telemetryInitializer, "initializer"); // act ai.addTelemetryInitializer(telemetryInitializer.initializer); ai.track({name: 'test event'}); this.clock.tick(1); // verify Assert.ok(spy.calledOnce, 'telemetryInitializer was called'); } }); } } ================================================ FILE: AISKULight/Tests/Unit/src/dynamicconfig.tests.ts ================================================ import { AITestClass, Assert, PollingAssert } from "@microsoft/ai-test-framework"; import { IConfig } from "@microsoft/applicationinsights-core-js"; import { IConfiguration, IPayloadData, isString, ITelemetryItem, IXHROverride, newId } from "@microsoft/applicationinsights-core-js"; import { ApplicationInsights, ISenderConfig } from "../../../src/index"; import { createAsyncResolvedPromise } from "@nevware21/ts-async"; import { SinonSpy } from 'sinon'; export class ApplicationInsightsDynamicConfigTests extends AITestClass { private static readonly _instrumentationKey = "b7170927-2d1c-44f1-acec-59f4e1751c11"; private static readonly _connectionString = `InstrumentationKey=${ApplicationInsightsDynamicConfigTests._instrumentationKey}`; private _ai: ApplicationInsights; private _sessionPrefix: string = newId(); private _config: IConfiguration & IConfig; static registerTests: any; private genericSpy: SinonSpy; private _ctx: any; private xhrOverride: IXHROverride; constructor(testName?: string) { super(testName || "AISKU Dynamic Config"); } protected _getTestConfig(sessionPrefix: string) { return { connectionString: ApplicationInsightsDynamicConfigTests._connectionString, namePrefix: sessionPrefix }; } public testInitialize() { try { this._config = this._getTestConfig(this._sessionPrefix); this._ai = new ApplicationInsights(this._config); this._ctx = {}; this.xhrOverride = new AutoCompleteXhrOverride(); } catch (e) { console.error("Failed to initialize", e); } } public testFinishedCleanup(): void { if (this._ai && this._ai.unload) { // force unload this._ai.unload(false); } this._ctx = null; console.log("* testCleanup(" + (AITestClass.currentTestInfo ? AITestClass.currentTestInfo.name : "") + ")"); } public registerTests() { this.addDynamicConfigTests(); this.addApiTests(); } private addDynamicConfigTests(): void { this.testCase({ name: "DynamicConfigTests: ApplicationInsights dynamic config works correctly", useFakeTimers: true, test: () => { Assert.ok(this._ai); let config = this._ai.config; let expectedIkey = ApplicationInsightsDynamicConfigTests._instrumentationKey; let expectedConnectionString = ApplicationInsightsDynamicConfigTests._connectionString; let expectedEndpointUrl = "https://dc.services.visualstudio.com/v2/track"; let expectedLoggingLevel = 10000; Assert.ok(config, "ApplicationInsights Light config exists"); Assert.equal(expectedConnectionString, config.connectionString, "connection string is set"); Assert.equal(expectedIkey, config.instrumentationKey, "ikey is set"); Assert.equal(expectedLoggingLevel, config.diagnosticLogInterval, "diagnosticLogInterval is set to 1000 by default"); Assert.equal(expectedEndpointUrl, config.endpointUrl, "endpoint url is set from connection string"); let onChangeCalled = 0; let handler = this._ai.onCfgChange((details) => { onChangeCalled ++; Assert.ok(details.cfg); Assert.equal(expectedIkey, details.cfg.instrumentationKey, "Expect the iKey to be set"); Assert.equal(expectedEndpointUrl, details.cfg.endpointUrl, "Expect the endpoint to be set"); Assert.equal(expectedLoggingLevel, details.cfg.diagnosticLogInterval, "Expect the diagnosticLogInterval to be set"); }); Assert.equal(1, onChangeCalled, "OnCfgChange was called once"); expectedIkey = "newIkey"; expectedConnectionString = `InstrumentationKey=${expectedIkey}`; config.connectionString = expectedConnectionString; Assert.equal(1, onChangeCalled, "OnCfgChange was called"); this.clock.tick(1); Assert.equal(3, onChangeCalled, "OnCfgChange was called again"); Assert.equal("newIkey", config.instrumentationKey); //Remove the handler handler.rm(); } }); this.testCase({ name: "Init: init with cs promise", useFakeTimers: true, test: () => { // unload previous one first let oriInst = this._ai; if (oriInst && oriInst.unload) { // force unload oriInst.unload(false); } this._config = this._getTestConfig(this._sessionPrefix); let csPromise = createAsyncResolvedPromise("InstrumentationKey=testIkey;ingestionendpoint=testUrl"); this._config.connectionString = csPromise; this._config.initTimeOut= 80000; this._ctx.csPromise = csPromise; let init = new ApplicationInsights(this._config); this._ai = init; let config = this._ai.config; return this._asyncQueue() .add(PollingAssert.asyncTaskPollingAssert(() => { let csPromise = this._ctx.csPromise; let config = this._ai.config; let ikey = config.instrumentationKey; if (csPromise.state === "resolved" && isString(ikey)) { return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000)) .add(() => { let config = this._ai.config; Assert.equal("testIkey", config.instrumentationKey, "ikey should be set"); Assert.equal("testUrl/v2/track", config.endpointUrl ,"endpoint shoule be set"); let sender = this._ai.getPlugin("AppInsightsChannelPlugin").plugin; let senderConfig = sender["_senderConfig"] as ISenderConfig; let senderIkey = senderConfig.instrumentationKey; Assert.equal("testIkey", senderIkey, "sender ikey is set from connection string"); let senderUrl = senderConfig.endpointUrl; Assert.equal("testUrl/v2/track", senderUrl, "sender endpoint url is set from connection string"); }); } }); this.testCase({ name: "zip test: gzip encode is working and content-encode header is set (feature opt-in)", useFakeTimers: true, useFakeServer: true, test: () => { this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); this._ai.config.featureOptIn["zipPayload"] = { mode: 3 }; this._ai.config.extensionConfig["AppInsightsChannelPlugin"] = { httpXHROverride: this.xhrOverride, alwaysUseXhrOverride: true } this.clock.tick(10); const telemetryItem: ITelemetryItem = { name: 'fake item with some really long name to take up space quickly', iKey: 'iKey', baseType: 'some type', baseData: {} }; return this._asyncQueue().add(() => { this._ai.track(telemetryItem); this._ai.flush(); this.clock.tick(10); }) .add(PollingAssert.asyncTaskPollingAssert(() => { if (this.genericSpy && this.genericSpy.called) { let argCount = 0; this.genericSpy.args.forEach(call => { argCount += call.length; }); return argCount >= 1; } return false; }, "Wait for exception calls: 1 " + new Date().toISOString(), 15, 1000)) .add(() => { let request = this.genericSpy.getCall(0).args[0]; let gzipData = request.data; QUnit.assert.ok(gzipData, "data should be set"); QUnit.assert.equal(true, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should be gzip encoded"); QUnit.assert.equal(request.headers["Content-Encoding"], "gzip", "telemetry should be gzip encoded"); }); } }); this.testCase({ name: "zip test: gzip encode will not working (feature opt-in is not set)", useFakeTimers: true, useFakeServer: true, test: () => { this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); this._ai.config.extensionConfig["AppInsightsChannelPlugin"] = { httpXHROverride: this.xhrOverride, alwaysUseXhrOverride: true } this.clock.tick(10); const telemetryItem: ITelemetryItem = { name: 'fake item with some really long name to take up space quickly', iKey: 'iKey', baseType: 'some type', baseData: {} }; return this._asyncQueue().add(() => { this._ai.track(telemetryItem); this._ai.flush(); this.clock.tick(10); }) .add(PollingAssert.asyncTaskPollingAssert(() => { if (this.genericSpy && this.genericSpy.called) { let argCount = 0; this.genericSpy.args.forEach(call => { argCount += call.length; }); return argCount >= 1; } return false; }, "Wait for exception calls: 1 " + new Date().toISOString(), 15, 1000)) .add(() => { let request = this.genericSpy.getCall(0).args[0]; let gzipData = request.data; QUnit.assert.ok(gzipData, "data should be set"); QUnit.assert.equal(false, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should not be gzip encoded"); QUnit.assert.equal(request.headers["Content-Encoding"], undefined, "telemetry should not be gzip encoded"); }); } }); } public addApiTests(): void { this.testCase({ name: "DynamicConfigTests: Public Members exist", test: () => { let trackMethod = "track"; let flushMethod = "flush"; Assert.ok(this._ai[trackMethod], `${trackMethod} method exists`); Assert.equal("function", typeof this._ai["track"], `${trackMethod} is a function`); Assert.ok(this._ai[flushMethod], `${flushMethod} method exists`); Assert.equal("function", typeof this._ai[flushMethod], `${flushMethod} is a function`); } }); } } class AutoCompleteXhrOverride { public sendPOST(payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) { console.log("AutoCompleteXhrOverride.sendPOST called with payload: ", payload); oncomplete(200, null); } } ================================================ FILE: AISKULight/Tests/Unit/src/otelNegative.tests.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { ApplicationInsights } from "../../../src/index"; import { utlRemoveSessionStorage } from "@microsoft/applicationinsights-core-js"; import { isNullOrUndefined, newId } from "@microsoft/applicationinsights-core-js"; /** * Negative tests for OpenTelemetry usage in AISKU Light * These tests ensure that no exceptions are thrown and helpers behave correctly * when there is no trace provider or OTel support instances */ export class AISKULightOTelNegativeTests extends AITestClass { private readonly _instrumentationKey = "testIkey-1234-5678-9012-3456789012"; private _sessionPrefix: string; public testInitialize() { super.testInitialize(); this._sessionPrefix = newId(); } public testCleanup() { utlRemoveSessionStorage(null as any, "AI_sentBuffer"); utlRemoveSessionStorage(null as any, "AI_buffer"); utlRemoveSessionStorage(null as any, this._sessionPrefix + "_AI_sentBuffer"); utlRemoveSessionStorage(null as any, this._sessionPrefix + "_AI_buffer"); super.testCleanup(); } public registerTests() { this.addTraceContextWithoutProviderTests(); this.addUnloadWithoutProviderTests(); this.addConfigurationChangesWithoutProviderTests(); } private addTraceContextWithoutProviderTests(): void { this.testCase({ name: "AISKULight.getTraceCtx: should return valid context without trace provider", test: () => { // Arrange const config = { instrumentationKey: this._instrumentationKey, namePrefix: this._sessionPrefix }; const ai = new ApplicationInsights(config); this.onDone(() => { ai.unload(false); }); // Act - no trace provider is set by default in AISKU Light const ctx = ai.getTraceCtx(); // Assert - should return a valid context without throwing Assert.ok(ctx !== undefined, "Should return a context (can be null)"); // If it returns a context, it should be valid Assert.ok(!isNullOrUndefined(ctx?.traceId), "Context should have traceId"); Assert.ok(!isNullOrUndefined(ctx?.spanId), "Context should have spanId"); Assert.equal("", ctx?.spanId, "SpanId should be empty string without provider"); } }); this.testCase({ name: "AISKULight.getTraceCtx: should not throw when called multiple times", test: () => { // Arrange const config = { instrumentationKey: this._instrumentationKey, namePrefix: this._sessionPrefix }; const ai = new ApplicationInsights(config); this.onDone(() => { ai.unload(false); }); // Act & Assert Assert.doesNotThrow(() => { // eslint-disable-next-line @typescript-eslint/no-unused-vars const _ctx1 = ai.getTraceCtx(); // eslint-disable-next-line @typescript-eslint/no-unused-vars const _ctx2 = ai.getTraceCtx(); // eslint-disable-next-line @typescript-eslint/no-unused-vars const _ctx3 = ai.getTraceCtx(); // Multiple calls should work without issues Assert.ok(true, "Multiple getTraceCtx calls should not throw"); Assert.equal(_ctx1, _ctx2, "Multiple calls should return same context instance"); Assert.equal(_ctx2, _ctx3, "Multiple calls should return same context instance"); Assert.equal(_ctx1?.traceId, _ctx2?.traceId, "TraceId should be consistent across calls"); Assert.equal(_ctx2?.traceId, _ctx3?.traceId, "TraceId should be consistent across calls"); Assert.equal(_ctx1?.spanId, _ctx2?.spanId, "SpanId should be consistent across calls"); Assert.equal(_ctx2?.spanId, _ctx3?.spanId, "SpanId should be consistent across calls"); }, "Multiple getTraceCtx calls should be safe"); } }); this.testCase({ name: "AISKULight: getTraceCtx should work after unload", test: () => { // Arrange const config = { instrumentationKey: this._instrumentationKey, namePrefix: this._sessionPrefix }; const ai = new ApplicationInsights(config); // Act - unload first ai.unload(false); // Assert - should not throw even after unload Assert.doesNotThrow(() => { // eslint-disable-next-line @typescript-eslint/no-unused-vars const _ctx = ai.getTraceCtx(); // Context might be null after unload, which is fine }, "getTraceCtx should not throw after unload"); } }); } private addUnloadWithoutProviderTests(): void { this.testCase({ name: "AISKULight: unload should work gracefully without trace provider", test: () => { // Arrange const config = { instrumentationKey: this._instrumentationKey, namePrefix: this._sessionPrefix }; const ai = new ApplicationInsights(config); // Act & Assert Assert.doesNotThrow(() => { ai.unload(false); }, "Unload should work without trace provider"); // Verify we can still access config after unload Assert.ok(ai.config, "Config should still be accessible after unload"); } }); this.testCase({ name: "AISKULight: unload with async flag should work without provider", test: () => { // Arrange const config = { instrumentationKey: this._instrumentationKey, namePrefix: this._sessionPrefix }; const ai = new ApplicationInsights(config); // Act & Assert Assert.doesNotThrow(() => { ai.unload(true); }, "Async unload should work without trace provider"); } }); } private addConfigurationChangesWithoutProviderTests(): void { this.testCase({ name: "AISKULight: should handle traceCfg in config without trace provider", test: () => { // Arrange const config = { instrumentationKey: this._instrumentationKey, namePrefix: this._sessionPrefix, traceCfg: { suppressTracing: false } }; // Act & Assert Assert.doesNotThrow(() => { const ai = new ApplicationInsights(config); // Verify traceCfg is present Assert.ok(ai.config.traceCfg, "traceCfg should be accessible"); this.onDone(() => { ai.unload(false); }); }, "Should handle traceCfg without trace provider"); } }); } } ================================================ FILE: AISKULight/Tests/UnitTests.html ================================================ Tests for Application Insights JavaScript AISKU Light
    ================================================ FILE: AISKULight/Tests/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": false, "module": "amd", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "declaration": true }, "files": [] } ================================================ FILE: AISKULight/api-extractor.json ================================================ /** * Config file for API Extractor. For more info, please visit: https://api-extractor.com */ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", /** * Optionally specifies another JSON config file that this file extends from. This provides a way for * standard settings to be shared across multiple projects. * * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be * resolved using NodeJS require(). * * SUPPORTED TOKENS: none * DEFAULT VALUE: "" */ // "extends": "./shared/api-extractor-base.json" // "extends": "my-package/include/api-extractor-base.json" /** * Determines the "" token that can be used with other config file settings. The project folder * typically contains the tsconfig.json and package.json config files, but the path is user-defined. * * The path is resolved relative to the folder of the config file that contains the setting. * * The default value for "projectFolder" is the token "", which means the folder is determined by traversing * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error * will be reported. * * SUPPORTED TOKENS: * DEFAULT VALUE: "" */ "projectFolder": ".", /** * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor * analyzes the symbols exported by this module. * * The file extension must be ".d.ts" and not ".ts". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , */ "mainEntryPointFilePath": "/build/types/index.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. * * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly * imports library2. To avoid this, we can specify: * * "bundledPackages": [ "library2" ], * * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been * local files for library1. */ "bundledPackages": [ ], /** * Determines how the TypeScript compiler engine will be invoked by API Extractor. */ "compiler": { /** * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * Note: This setting will be ignored if "overrideTsconfig" is used. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/tsconfig.json" */ // "tsconfigFilePath": "/tsconfig.json", /** * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. * The object must conform to the TypeScript tsconfig schema: * * http://json.schemastore.org/tsconfig * * If omitted, then the tsconfig.json file will be read from the "projectFolder". * * DEFAULT VALUE: no overrideTsconfig section */ // "overrideTsconfig": { // . . . // } /** * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. * * DEFAULT VALUE: false */ // "skipLibCheck": true, }, /** * Configures how the API report file (*.api.md) will be generated. */ "apiReport": { /** * (REQUIRED) Whether to generate an API report. */ "enabled": true, /** * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce * a full file path. * * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". * * SUPPORTED TOKENS: , * DEFAULT VALUE: ".api.md" */ "reportFileName": ".api.md", /** * Specifies the folder where the API report file is written. The file name portion is determined by * the "reportFileName" setting. * * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, * e.g. for an API review. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/etc/" */ "reportFolder": "/build/dts/", /** * Specifies the folder where the temporary report file is written. The file name portion is determined by * the "reportFileName" setting. * * After the temporary file is written to disk, it is compared with the file in the "reportFolder". * If they are different, a production build will fail. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/" */ // "reportTempFolder": "/temp/" }, /** * Configures how the doc model file (*.api.json) will be generated. */ "docModel": { /** * (REQUIRED) Whether to generate a doc model file. */ "enabled": true, /** * The output path for the doc model file. The file extension should be ".api.json". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/.api.json" */ "apiJsonFilePath": "/build/dts/.api.json" }, /** * Configures how the .d.ts rollup file will be generated. */ "dtsRollup": { /** * (REQUIRED) Whether to generate the .d.ts rollup file. */ "enabled": true, /** * Specifies the output path for a .d.ts rollup file to be generated without any trimming. * This file will include all declarations that are exported by the main entry point. * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/dist/.d.ts" */ "untrimmedFilePath": "/build/dts/.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. * This file will include only declarations that are marked as "@public" or "@beta". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "betaTrimmedFilePath": "/build/dts/-beta.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. * This file will include only declarations that are marked as "@public". * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "publicTrimmedFilePath": "/build/dts/-public.d.ts", /** * When a declaration is trimmed, by default it will be replaced by a code comment such as * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the * declaration completely. * * DEFAULT VALUE: false */ // "omitTrimmingComments": true }, /** * Configures how the tsdoc-metadata.json file will be generated. */ "tsdocMetadata": { /** * Whether to generate the tsdoc-metadata.json file. * * DEFAULT VALUE: true */ "enabled": false, /** * Specifies where the TSDoc metadata file should be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup * falls back to "tsdoc-metadata.json" in the package folder. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ "tsdocMetadataFilePath": "/build/dts/tsdoc-metadata.json" }, /** * Configures how API Extractor reports error and warning messages produced during analysis. * * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. */ "messages": { /** * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing * the input .d.ts files. * * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "compilerMessageReporting": { /** * Configures the default routing for messages that don't match an explicit rule in this table. */ "default": { /** * Specifies whether the message should be written to the the tool's output log. Note that * the "addToApiReportFile" property may supersede this option. * * Possible values: "error", "warning", "none" * * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes * the "--local" option), the warning is displayed but the build will not fail. * * DEFAULT VALUE: "warning" */ "logLevel": "warning", /** * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), * then the message will be written inside that file; otherwise, the message is instead logged according to * the "logLevel" option. * * DEFAULT VALUE: false */ // "addToApiReportFile": false }, // "TS2551": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . }, /** * Configures handling of messages reported by API Extractor during its analysis. * * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" * * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings */ "extractorMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false }, "ae-missing-release-tag": { "logLevel": "none" }, // // . . . }, /** * Configures handling of messages reported by the TSDoc parser when analyzing code comments. * * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "tsdocMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false } // "tsdoc-link-tag-unescaped-text": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . } } } ================================================ FILE: AISKULight/build.cmd ================================================ REM rd /s /q node_modules REM del package-lock.json REM echo "starting build" REM npm install REM rd /s /q amd\bundle REM call grunt aiskulite && echo "copy files" xcopy "node_modules/applicationinsights-channel-js/bundle" "bundle" /S /E /I xcopy "node_modules/applicationinsights-common/bundle" "bundle" /S /E /I xcopy "node_modules/applicationinsights-core-js/bundle" "bundle" /S /E /I ================================================ FILE: AISKULight/dist-history/aisdklight.js ================================================ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory() : typeof define === 'function' && define.amd ? define(factory) : (factory()); }(this, (function () { 'use strict'; (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define(["require", "exports", "applicationinsights-core-js", "applicationinsights-channel-js"], factory); } })(function (require, exports) { Object.defineProperty(exports, "__esModule", { value: true }); var applicationinsights_core_js_1 = require("applicationinsights-core-js"); var applicationinsights_channel_js_1 = require("applicationinsights-channel-js"); var ApplicationInsights = /** @class */ (function () { function ApplicationInsights(config) { // initialize the queue and config in case they are undefined if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(config) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(config.instrumentationKey)) { throw new Error("Invalid input configuration"); } this.initialize(); } ApplicationInsights.prototype.initialize = function () { this.core = new applicationinsights_core_js_1.AppInsightsCore(); var extensions = []; var appInsightsChannel = new applicationinsights_channel_js_1.Sender(); extensions.push(appInsightsChannel); // initialize core this.core.initialize(this.config, extensions); // initialize extensions appInsightsChannel.initialize(this.config, this.core, extensions); }; ApplicationInsights.prototype.track = function (item) { this.core.track(item); }; return ApplicationInsights; }()); exports.ApplicationInsights = ApplicationInsights; }); }))); //# sourceMappingURL=aisdklight.js.map ================================================ FILE: AISKULight/dist-history/aisdklite.0.0.3.js ================================================ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ "./bundle sync recursive": /*!*********************!*\ !*** ./bundle sync ***! \*********************/ /*! no static exports found */ /***/ (function(module, exports) { function webpackEmptyContext(req) { var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; } webpackEmptyContext.keys = function() { return []; }; webpackEmptyContext.resolve = webpackEmptyContext; module.exports = webpackEmptyContext; webpackEmptyContext.id = "./bundle sync recursive"; /***/ }), /***/ "./bundle/index.js": /*!*************************!*\ !*** ./bundle/index.js ***! \*************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(__webpack_require__("./bundle sync recursive"), exports); if (v !== undefined) module.exports = v; } else if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-channel-js */ "./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var applicationinsights_core_js_1 = require("applicationinsights-core-js"); var applicationinsights_channel_js_1 = require("applicationinsights-channel-js"); "use strict"; var ApplicationInsights = /** @class */ (function () { function ApplicationInsights(config) { // initialize the queue and config in case they are undefined if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(config) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(config.instrumentationKey)) { throw new Error("Invalid input configuration"); } this.initialize(); } ApplicationInsights.prototype.initialize = function () { this.core = new applicationinsights_core_js_1.AppInsightsCore(); var extensions = []; var appInsightsChannel = new applicationinsights_channel_js_1.Sender(); extensions.push(appInsightsChannel); // initialize core this.core.initialize(this.config, extensions); // initialize extensions appInsightsChannel.initialize(this.config, this.core, extensions); }; ApplicationInsights.prototype.track = function (item) { this.core.track(item); }; return ApplicationInsights; }()); exports.ApplicationInsights = ApplicationInsights; }); /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ContextTagKeys = [ "ai.application.ver", "ai.application.build", "ai.application.typeId", "ai.application.applicationId", "ai.application.layer", "ai.device.id", "ai.device.ip", "ai.device.language", "ai.device.locale", "ai.device.model", "ai.device.friendlyName", "ai.device.network", "ai.device.networkName", "ai.device.oemName", "ai.device.os", "ai.device.osVersion", "ai.device.roleInstance", "ai.device.roleName", "ai.device.screenResolution", "ai.device.type", "ai.device.machineName", "ai.device.vmName", "ai.device.browser", "ai.device.browserVersion", "ai.location.ip", "ai.location.country", "ai.location.province", "ai.location.city", "ai.operation.id", "ai.operation.name", "ai.operation.parentId", "ai.operation.rootId", "ai.operation.syntheticSource", "ai.operation.correlationVector", "ai.session.id", "ai.session.isFirst", "ai.session.isNew", "ai.user.accountAcquisitionDate", "ai.user.accountId", "ai.user.userAgent", "ai.user.id", "ai.user.storeRegion", "ai.user.authUserId", "ai.user.anonUserAcquisitionDate", "ai.user.authUserAcquisitionDate", "ai.cloud.name", "ai.cloud.role", "ai.cloud.roleVer", "ai.cloud.roleInstance", "ai.cloud.environment", "ai.cloud.location", "ai.cloud.deploymentUnit", "ai.internal.sdkVersion", "ai.internal.agentVersion", "ai.internal.nodeName", ]; // these two constants are used to filter out properties not needed when trying to extract custom properties and measurements from the incoming payload var baseType = "baseType"; var baseData = "baseData"; var EnvelopeCreator = /** @class */ (function () { function EnvelopeCreator() { } EnvelopeCreator.extractProperties = function (data) { var customProperties = null; for (var key in data) { if (data.hasOwnProperty(key)) { var value = data[key]; if (typeof value !== "number") { if (!customProperties) { customProperties = {}; } customProperties[key] = value; } } } return customProperties; }; EnvelopeCreator.extractPropsAndMeasurements = function (data, properties, measurements) { if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(data)) { for (var key in data) { if (data.hasOwnProperty(key)) { var value = data[key]; if (typeof value === "number") { measurements[key] = value; } else { properties[key] = value; } } } } }; // TODO: Do we want this to take logger as arg or use this._logger as nonstatic? EnvelopeCreator.createEnvelope = function (logger, envelopeType, telemetryItem, data) { var envelope = new applicationinsights_common_1.Envelope(logger, data, envelopeType); envelope.iKey = telemetryItem.instrumentationKey; var iKeyNoDashes = telemetryItem.instrumentationKey.replace(/-/g, ""); envelope.name = envelope.name.replace("{0}", iKeyNoDashes); // loop through the envelope ctx (Part A) and pick out the ones that should go in outgoing envelope tags for (var key in telemetryItem.ctx) { if (telemetryItem.ctx.hasOwnProperty(key)) { if (exports.ContextTagKeys.indexOf(key) >= 0) { envelope.tags[key] = telemetryItem.ctx[key]; } } } // loop through the envelope tags (extension of Part A) and pick out the ones that should go in outgoing envelope tags telemetryItem.tags.forEach(function (tag) { for (var key in tag) { if (tag.hasOwnProperty(key)) { if (exports.ContextTagKeys.indexOf(key) >= 0) { envelope.tags[key] = tag[key]; } } } }); return envelope; }; return EnvelopeCreator; }()); exports.EnvelopeCreator = EnvelopeCreator; var DependencyEnvelopeCreator = /** @class */ (function (_super) { __extends(DependencyEnvelopeCreator, _super); function DependencyEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } DependencyEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customMeasurements = {}; var customProperties = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var bd = telemetryItem.baseData; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(bd)) { logger.warnToConsole("Invalid input for dependency data"); return null; } var id = bd.id; var absoluteUrl = bd.absoluteUrl; var command = bd.commandName; var duration = bd.duration; var success = bd.success; var resultCode = bd.resultCode; var method = bd.method; var baseData = new applicationinsights_common_1.RemoteDependencyData(logger, id, absoluteUrl, command, duration, success, resultCode, method, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.RemoteDependencyData.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.RemoteDependencyData.envelopeType, telemetryItem, data); }; DependencyEnvelopeCreator.DependencyEnvelopeCreator = new DependencyEnvelopeCreator(); return DependencyEnvelopeCreator; }(EnvelopeCreator)); exports.DependencyEnvelopeCreator = DependencyEnvelopeCreator; var EventEnvelopeCreator = /** @class */ (function (_super) { __extends(EventEnvelopeCreator, _super); function EventEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } EventEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; if (telemetryItem.baseType !== applicationinsights_common_1.Event.dataType) { EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.baseData, customProperties, customMeasurements); } EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var eventName = telemetryItem.baseData.name; var baseData = new applicationinsights_common_1.Event(logger, eventName, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Event.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Event.envelopeType, telemetryItem, data); }; EventEnvelopeCreator.EventEnvelopeCreator = new EventEnvelopeCreator(); return EventEnvelopeCreator; }(EnvelopeCreator)); exports.EventEnvelopeCreator = EventEnvelopeCreator; var ExceptionEnvelopeCreator = /** @class */ (function (_super) { __extends(ExceptionEnvelopeCreator, _super); function ExceptionEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } ExceptionEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var exception = telemetryItem.baseData.error; var severityLevel = telemetryItem.baseData.severityLevel; var baseData = new applicationinsights_common_1.Exception(logger, exception, customProperties, customMeasurements, severityLevel); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Exception.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Exception.envelopeType, telemetryItem, data); }; ExceptionEnvelopeCreator.ExceptionEnvelopeCreator = new ExceptionEnvelopeCreator(); return ExceptionEnvelopeCreator; }(EnvelopeCreator)); exports.ExceptionEnvelopeCreator = ExceptionEnvelopeCreator; var MetricEnvelopeCreator = /** @class */ (function (_super) { __extends(MetricEnvelopeCreator, _super); function MetricEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } MetricEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = EnvelopeCreator.extractProperties(telemetryItem.data); var name = telemetryItem.baseData.name; var average = telemetryItem.baseData.average; var sampleCount = telemetryItem.baseData.sampleCount; var min = telemetryItem.baseData.min; var max = telemetryItem.baseData.max; var baseData = new applicationinsights_common_1.Metric(logger, name, average, sampleCount, min, max, customProperties); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Metric.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Metric.envelopeType, telemetryItem, data); }; MetricEnvelopeCreator.MetricEnvelopeCreator = new MetricEnvelopeCreator(); return MetricEnvelopeCreator; }(EnvelopeCreator)); exports.MetricEnvelopeCreator = MetricEnvelopeCreator; var PageViewEnvelopeCreator = /** @class */ (function (_super) { __extends(PageViewEnvelopeCreator, _super); function PageViewEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } PageViewEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } // Since duration is not part of the domain properties in Common Schema, extract it from part C var duration = undefined; if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.data) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.data.duration)) { duration = telemetryItem.data.duration; delete telemetryItem.data.duration; } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var name = telemetryItem.baseData.name; var url = telemetryItem.baseData.uri; // Todo: move IPageViewTelemetry to common as we are missing type checks on baseData here // refUri is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.refUri)) { customProperties["refUri"] = telemetryItem.baseData.refUri; } // pageType is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.pageType)) { customProperties["pageType"] = telemetryItem.baseData.pageType; } // isLoggedIn is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.isLoggedIn)) { customProperties["isLoggedIn"] = telemetryItem.baseData.isLoggedIn; } // pageTags is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData.pageTags)) { var pageTags = telemetryItem.baseData.pageTags; for (var key in pageTags) { if (pageTags.hasOwnProperty(key)) { customProperties[key] = pageTags[key]; } } } var baseData = new applicationinsights_common_1.PageView(logger, name, url, duration, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.PageView.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.PageView.envelopeType, telemetryItem, data); }; PageViewEnvelopeCreator.PageViewEnvelopeCreator = new PageViewEnvelopeCreator(); return PageViewEnvelopeCreator; }(EnvelopeCreator)); exports.PageViewEnvelopeCreator = PageViewEnvelopeCreator; var PageViewPerformanceEnvelopeCreator = /** @class */ (function (_super) { __extends(PageViewPerformanceEnvelopeCreator, _super); function PageViewPerformanceEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } PageViewPerformanceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var customProperties = {}; var customMeasurements = {}; EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); var name = telemetryItem.baseData.name; var url = telemetryItem.baseData.uri; var duration = telemetryItem.baseData.duration; var baseData = new applicationinsights_common_1.PageViewPerformance(logger, name, url, duration, customProperties, customMeasurements); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.PageViewPerformance.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.PageViewPerformance.envelopeType, telemetryItem, data); }; PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator = new PageViewPerformanceEnvelopeCreator(); return PageViewPerformanceEnvelopeCreator; }(EnvelopeCreator)); exports.PageViewPerformanceEnvelopeCreator = PageViewPerformanceEnvelopeCreator; var TraceEnvelopeCreator = /** @class */ (function (_super) { __extends(TraceEnvelopeCreator, _super); function TraceEnvelopeCreator() { return _super !== null && _super.apply(this, arguments) || this; } TraceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) { this._logger = logger; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(telemetryItem.baseData)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } var message = telemetryItem.baseData.message; var severityLevel = telemetryItem.baseData.severityLevel; var customProperties = EnvelopeCreator.extractProperties(telemetryItem.data); var baseData = new applicationinsights_common_1.Trace(logger, message, customProperties, severityLevel); var data = new applicationinsights_common_1.Data(applicationinsights_common_1.Trace.dataType, baseData); return EnvelopeCreator.createEnvelope(logger, applicationinsights_common_1.Trace.envelopeType, telemetryItem, data); }; TraceEnvelopeCreator.TraceEnvelopeCreator = new TraceEnvelopeCreator(); return TraceEnvelopeCreator; }(EnvelopeCreator)); exports.TraceEnvelopeCreator = TraceEnvelopeCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EnvelopeCreator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Offline.js": /*!***********************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Offline.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @description Monitors browser for offline events * @export default - Offline: Static instance of OfflineListener * @class OfflineListener */ var OfflineListener = /** @class */ (function () { function OfflineListener() { this._onlineStatus = true; if (window && window.addEventListener) { window.addEventListener('online', this._setOnline.bind(this), false); window.addEventListener('offline', this._setOffline.bind(this), false); this.isListening = true; } else if (document && document.body) { document.body.ononline = this._setOnline.bind(this); document.body.onoffline = this._setOffline.bind(this); this.isListening = true; } else if (document) { document.ononline = this._setOnline.bind(this); document.onoffline = this._setOffline.bind(this); this.isListening = true; } else { // Could not find a place to add event listener this.isListening = false; } } OfflineListener.prototype._setOnline = function () { this._onlineStatus = true; }; OfflineListener.prototype._setOffline = function () { this._onlineStatus = false; }; OfflineListener.prototype.isOnline = function () { if (this.isListening) { return this._onlineStatus; } else if (navigator) { return navigator.onLine; } else { // Cannot determine online status - report as online return true; } }; OfflineListener.prototype.isOffline = function () { return !this.isOnline(); }; OfflineListener.Offline = new OfflineListener; return OfflineListener; }()); exports.OfflineListener = OfflineListener; exports.Offline = OfflineListener.Offline; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Offline.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js": /*!**************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* * An array based send buffer. */ var ArraySendBuffer = /** @class */ (function () { function ArraySendBuffer(config) { this._config = config; this._buffer = []; } ArraySendBuffer.prototype.enqueue = function (payload) { this._buffer.push(payload); }; ArraySendBuffer.prototype.count = function () { return this._buffer.length; }; ArraySendBuffer.prototype.clear = function () { this._buffer.length = 0; }; ArraySendBuffer.prototype.getItems = function () { return this._buffer.slice(0); }; ArraySendBuffer.prototype.batchPayloads = function (payload) { if (payload && payload.length > 0) { var batch = this._config.emitLineDelimitedJson() ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; ArraySendBuffer.prototype.markAsSent = function (payload) { this.clear(); }; ArraySendBuffer.prototype.clearSent = function (payload) { // not supported }; return ArraySendBuffer; }()); exports.ArraySendBuffer = ArraySendBuffer; /* * Session storege buffer holds a copy of all unsent items in the browser session storage. */ var SessionStorageSendBuffer = /** @class */ (function () { function SessionStorageSendBuffer(logger, config) { this._bufferFullMessageSent = false; this._logger = logger; this._config = config; var bufferItems = this.getBuffer(SessionStorageSendBuffer.BUFFER_KEY); var notDeliveredItems = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); this._buffer = bufferItems.concat(notDeliveredItems); // If the buffer has too many items, drop items from the end. if (this._buffer.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { this._buffer.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } // update DataLossAnalyzer with the number of recovered items // Uncomment if you want to use DataLossanalyzer // DataLossAnalyzer.itemsRestoredFromSessionBuffer = this._buffer.length; this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); } SessionStorageSendBuffer.prototype.enqueue = function (payload) { if (this._buffer.length >= SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // sent internal log only once per page view if (!this._bufferFullMessageSent) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.SessionStorageBufferFull, "Maximum buffer size reached: " + this._buffer.length, true); this._bufferFullMessageSent = true; } return; } this._buffer.push(payload); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); }; SessionStorageSendBuffer.prototype.count = function () { return this._buffer.length; }; SessionStorageSendBuffer.prototype.clear = function () { this._buffer.length = 0; this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, []); this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); this._bufferFullMessageSent = false; }; SessionStorageSendBuffer.prototype.getItems = function () { return this._buffer.slice(0); }; SessionStorageSendBuffer.prototype.batchPayloads = function (payload) { if (payload && payload.length > 0) { var batch = this._config.emitLineDelimitedJson() ? payload.join("\n") : "[" + payload.join(",") + "]"; return batch; } return null; }; SessionStorageSendBuffer.prototype.markAsSent = function (payload) { this._buffer = this.removePayloadsFromBuffer(payload, this._buffer); this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer); var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); if (sentElements instanceof Array && payload instanceof Array) { sentElements = sentElements.concat(payload); if (sentElements.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // We send telemetry normally. If the SENT_BUFFER is too big we don't add new elements // until we receive a response from the backend and the buffer has free space again (see clearSent method) this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.SessionStorageBufferFull, "Sent buffer reached its maximum size: " + sentElements.length, true); sentElements.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); } }; SessionStorageSendBuffer.prototype.clearSent = function (payload) { var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); sentElements = this.removePayloadsFromBuffer(payload, sentElements); this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); }; SessionStorageSendBuffer.prototype.removePayloadsFromBuffer = function (payloads, buffer) { var remaining = []; for (var i in buffer) { var contains = false; for (var j in payloads) { if (payloads[j] === buffer[i]) { contains = true; break; } } if (!contains) { remaining.push(buffer[i]); } } ; return remaining; }; SessionStorageSendBuffer.prototype.getBuffer = function (key) { try { var bufferJson = applicationinsights_common_1.Util.getSessionStorage(this._logger, key); if (bufferJson) { var buffer = JSON.parse(bufferJson); if (buffer) { return buffer; } } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FailedToRestoreStorageBuffer, " storage key: " + key + ", " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } return []; }; SessionStorageSendBuffer.prototype.setBuffer = function (key, buffer) { try { var bufferJson = JSON.stringify(buffer); applicationinsights_common_1.Util.setSessionStorage(this._logger, key, bufferJson); } catch (e) { // if there was an error, clear the buffer // telemetry is stored in the _buffer array so we won't loose any items applicationinsights_common_1.Util.setSessionStorage(this._logger, key, JSON.stringify([])); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedToSetStorageBuffer, " storage key: " + key + ", " + applicationinsights_common_1.Util.getExceptionName(e) + ". Buffer cleared", { exception: applicationinsights_common_1.Util.dump(e) }); } }; SessionStorageSendBuffer.BUFFER_KEY = "AI_buffer"; SessionStorageSendBuffer.SENT_BUFFER_KEY = "AI_sentBuffer"; // Maximum number of payloads stored in the buffer. If the buffer is full, new elements will be dropped. SessionStorageSendBuffer.MAX_BUFFER_SIZE = 2000; return SessionStorageSendBuffer; }()); exports.SessionStorageSendBuffer = SessionStorageSendBuffer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SendBuffer.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Sender.js": /*!**********************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Sender.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./SendBuffer */ "./node_modules/applicationinsights-channel-js/bundle/SendBuffer.js"), __webpack_require__(/*! ./EnvelopeCreator */ "./node_modules/applicationinsights-channel-js/bundle/EnvelopeCreator.js"), __webpack_require__(/*! ./TelemetryValidation/EventValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js"), __webpack_require__(/*! ./TelemetryValidation/TraceValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js"), __webpack_require__(/*! ./TelemetryValidation/ExceptionValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js"), __webpack_require__(/*! ./TelemetryValidation/MetricValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js"), __webpack_require__(/*! ./TelemetryValidation/PageViewPerformanceValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js"), __webpack_require__(/*! ./TelemetryValidation/PageViewValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js"), __webpack_require__(/*! ./TelemetryValidation/RemoteDepdencyValidator */ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js"), __webpack_require__(/*! ./Serializer */ "./node_modules/applicationinsights-channel-js/bundle/Serializer.js"), __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./Offline */ "./node_modules/applicationinsights-channel-js/bundle/Offline.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, SendBuffer_1, EnvelopeCreator_1, EventValidator_1, TraceValidator_1, ExceptionValidator_1, MetricValidator_1, PageViewPerformanceValidator_1, PageViewValidator_1, RemoteDepdencyValidator_1, Serializer_1, applicationinsights_common_1, applicationinsights_core_js_1, applicationinsights_core_js_2, Offline_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Sender = /** @class */ (function () { function Sender() { this.priority = 201; /** * Whether XMLHttpRequest object is supported. Older version of IE (8,9) do not support it. */ this._XMLHttpRequestSupported = false; } Sender.prototype.pause = function () { throw new Error("Method not implemented."); }; Sender.prototype.resume = function () { throw new Error("Method not implemented."); }; Sender.prototype.flush = function () { try { this.triggerSend(); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.FlushFailed, "flush failed, telemetry will not be collected: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } }; Sender.prototype.teardown = function () { throw new Error("Method not implemented."); }; Sender.prototype.initialize = function (config, core, extensions) { this.identifier = "AppInsightsChannelPlugin"; this._logger = core.logger; this._serializer = new Serializer_1.Serializer(core.logger); this._consecutiveErrors = 0; this._retryAt = null; this._lastSend = 0; this._config = Sender._getDefaultAppInsightsChannelConfig(config, this.identifier); this._sender = null; this._buffer = (applicationinsights_common_1.Util.canUseSessionStorage() && this._config.enableSessionStorageBuffer) ? new SendBuffer_1.SessionStorageSendBuffer(this._logger, this._config) : new SendBuffer_1.ArraySendBuffer(this._config); if (!this._config.isBeaconApiDisabled() && applicationinsights_common_1.Util.IsBeaconApiSupported()) { this._sender = this._beaconSender; } else { if (typeof XMLHttpRequest != "undefined") { var testXhr = new XMLHttpRequest(); if ("withCredentials" in testXhr) { this._sender = this._xhrSender; this._XMLHttpRequestSupported = true; } else if (typeof XDomainRequest !== "undefined") { this._sender = this._xdrSender; //IE 8 and 9 } } } }; Sender.prototype.processTelemetry = function (telemetryItem) { try { // if master off switch is set, don't send any data if (this._config.disableTelemetry()) { // Do not send/save data return; } // validate input if (!telemetryItem) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSendEmptyTelemetry, "Cannot send empty telemetry"); return; } // ensure a sender was constructed if (!this._sender) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.SenderNotInitialized, "Sender was not initialized"); return; } // first we need to validate that the envelope passed down is valid var isValid = Sender._validate(telemetryItem); if (!isValid) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TelemetryEnvelopeInvalid, "Invalid telemetry envelope"); return; } // construct an envelope that Application Insights endpoint can understand var aiEnvelope = this._constructEnvelope(telemetryItem); if (!aiEnvelope) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CreateEnvelopeError, "Unable to create an AppInsights envelope"); return; } // check if the incoming payload is too large, truncate if necessary var payload = this._serializer.serialize(aiEnvelope); // flush if we would exceed the max-size limit by adding this item var bufferPayload = this._buffer.getItems(); var batch = this._buffer.batchPayloads(bufferPayload); if (batch && (batch.length + payload.length > this._config.maxBatchSizeInBytes())) { this.triggerSend(); } // enqueue the payload this._buffer.enqueue(payload); // ensure an invocation timeout is set this._setupTimer(); } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.FailedAddingTelemetryToBuffer, "Failed adding telemetry to the sender's buffer, some telemetry will be lost: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } // hand off the telemetry item to the next plugin if (!applicationinsights_core_js_2.CoreUtils.isNullOrUndefined(this._nextPlugin)) { this._nextPlugin.processTelemetry(telemetryItem); } }; Sender.prototype.setNextPlugin = function (next) { this._nextPlugin = next; }; /** * xhr state changes */ Sender.prototype._xhrReadyStateChange = function (xhr, payload, countOfItemsInPayload) { if (xhr.readyState === 4) { var response = null; if (!this._appId) { response = this._parseResponse(xhr.responseText || xhr.response); if (response && response.appId) { this._appId = response.appId; } } if ((xhr.status < 200 || xhr.status >= 300) && xhr.status !== 0) { if (!this._config.isRetryDisabled() && this._isRetriable(xhr.status)) { this._resendPayload(payload); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Response code " + xhr.status + ". Will retry to send " + payload.length + " items."); } else { this._onError(payload, this._formatErrorMessageXhr(xhr)); } } else if (xhr.status === 0 || Offline_1.Offline.isOffline()) { if (!this._config.isRetryDisabled()) { var offlineBackOffMultiplier = 10; // arbritrary number this._resendPayload(payload, offlineBackOffMultiplier); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". Offline - Response Code: " + xhr.status + ". Offline status: " + Offline_1.Offline.isOffline() + ". Will retry to send " + payload.length + " items."); } } else { if (xhr.status === 206) { if (!response) { response = this._parseResponse(xhr.responseText || xhr.response); } if (response && !this._config.isRetryDisabled()) { this._onPartialSuccess(payload, response); } else { this._onError(payload, this._formatErrorMessageXhr(xhr)); } } else { this._consecutiveErrors = 0; this._onSuccess(payload, countOfItemsInPayload); } } } }; /** * Immediately send buffered data * @param async {boolean} - Indicates if the events should be sent asynchronously */ Sender.prototype.triggerSend = function (async) { if (async === void 0) { async = true; } try { // Send data only if disableTelemetry is false if (!this._config.disableTelemetry()) { if (this._buffer.count() > 0) { var payload = this._buffer.getItems(); // invoke send this._sender(payload, async); } // update lastSend time to enable throttling this._lastSend = +new Date; } else { this._buffer.clear(); } clearTimeout(this._timeoutHandle); this._timeoutHandle = null; this._retryAt = null; } catch (e) { /* Ignore this error for IE under v10 */ if (!applicationinsights_common_1.Util.getIEVersion() || applicationinsights_common_1.Util.getIEVersion() > 9) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, "Telemetry transmission failed, some telemetry will be lost: " + applicationinsights_common_1.Util.getExceptionName(e), { exception: applicationinsights_common_1.Util.dump(e) }); } } }; /** * error handler */ Sender.prototype._onError = function (payload, message, event) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.OnError, "Failed to send telemetry.", { message: message }); this._buffer.clearSent(payload); }; /** * partial success handler */ Sender.prototype._onPartialSuccess = function (payload, results) { var failed = []; var retry = []; // Iterate through the reversed array of errors so that splicing doesn't have invalid indexes after the first item. var errors = results.errors.reverse(); for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) { var error = errors_1[_i]; var extracted = payload.splice(error.index, 1)[0]; if (this._isRetriable(error.statusCode)) { retry.push(extracted); } else { // All other errors, including: 402 (Monthly quota exceeded) and 439 (Too many requests and refresh cache). failed.push(extracted); } } if (payload.length > 0) { this._onSuccess(payload, results.itemsAccepted); } if (failed.length > 0) { this._onError(failed, this._formatErrorMessageXhr(null, ['partial success', results.itemsAccepted, 'of', results.itemsReceived].join(' '))); } if (retry.length > 0) { this._resendPayload(retry); this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, "Partial success. " + "Delivered: " + payload.length + ", Failed: " + failed.length + ". Will retry to send " + retry.length + " our of " + results.itemsReceived + " items"); } }; /** * success handler */ Sender.prototype._onSuccess = function (payload, countOfItemsInPayload) { this._buffer.clearSent(payload); }; /** * xdr state changes */ Sender.prototype._xdrOnLoad = function (xdr, payload) { if (xdr && (xdr.responseText + "" === "200" || xdr.responseText === "")) { this._consecutiveErrors = 0; this._onSuccess(payload, 0); } else { var results = this._parseResponse(xdr.responseText); if (results && results.itemsReceived && results.itemsReceived > results.itemsAccepted && !this._config.isRetryDisabled()) { this._onPartialSuccess(payload, results); } else { this._onError(payload, this._formatErrorMessageXdr(xdr)); } } }; Sender.prototype._constructEnvelope = function (envelope) { switch (envelope.baseType) { case applicationinsights_common_1.Event.dataType: return EnvelopeCreator_1.EventEnvelopeCreator.EventEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Trace.dataType: return EnvelopeCreator_1.TraceEnvelopeCreator.TraceEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.PageView.dataType: return EnvelopeCreator_1.PageViewEnvelopeCreator.PageViewEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.PageViewPerformance.dataType: return EnvelopeCreator_1.PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Exception.dataType: return EnvelopeCreator_1.ExceptionEnvelopeCreator.ExceptionEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.Metric.dataType: return EnvelopeCreator_1.MetricEnvelopeCreator.MetricEnvelopeCreator.Create(this._logger, envelope); case applicationinsights_common_1.RemoteDependencyData.dataType: return EnvelopeCreator_1.DependencyEnvelopeCreator.DependencyEnvelopeCreator.Create(this._logger, envelope); default: // default create custom event type return EnvelopeCreator_1.EventEnvelopeCreator.EventEnvelopeCreator.Create(this._logger, envelope); } }; Sender._getDefaultAppInsightsChannelConfig = function (config, identifier) { var resultConfig = {}; var pluginConfig = config.extensionConfig && config.extensionConfig[identifier] ? config.extensionConfig[identifier] : {}; // set default values resultConfig.endpointUrl = function () { return config.endpointUrl || "https://dc.services.visualstudio.com/v2/track"; }; resultConfig.emitLineDelimitedJson = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.emitLineDelimitedJson); }; resultConfig.maxBatchInterval = function () { return !isNaN(pluginConfig.maxBatchInterval) ? pluginConfig.maxBatchInterval : 15000; }; resultConfig.maxBatchSizeInBytes = function () { return pluginConfig.maxBatchSizeInBytes > 0 ? pluginConfig.maxBatchSizeInBytes : 102400; }; // 100kb resultConfig.disableTelemetry = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.disableTelemetry); }; resultConfig.enableSessionStorageBuffer = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.enableSessionStorageBuffer, true); }; resultConfig.isRetryDisabled = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.isRetryDisabled); }; resultConfig.isBeaconApiDisabled = function () { return applicationinsights_common_1.Util.stringToBoolOrDefault(pluginConfig.isBeaconApiDisabled, true); }; return resultConfig; }; Sender._validate = function (envelope) { // call the appropriate Validate depending on the baseType switch (envelope.baseType) { case applicationinsights_common_1.Event.dataType: return EventValidator_1.EventValidator.EventValidator.Validate(envelope); case applicationinsights_common_1.Trace.dataType: return TraceValidator_1.TraceValidator.TraceValidator.Validate(envelope); case applicationinsights_common_1.Exception.dataType: return ExceptionValidator_1.ExceptionValidator.ExceptionValidator.Validate(envelope); case applicationinsights_common_1.Metric.dataType: return MetricValidator_1.MetricValidator.MetricValidator.Validate(envelope); case applicationinsights_common_1.PageView.dataType: return PageViewValidator_1.PageViewValidator.PageViewValidator.Validate(envelope); case applicationinsights_common_1.PageViewPerformance.dataType: return PageViewPerformanceValidator_1.PageViewPerformanceValidator.PageViewPerformanceValidator.Validate(envelope); case applicationinsights_common_1.RemoteDependencyData.dataType: return RemoteDepdencyValidator_1.RemoteDepdencyValidator.RemoteDepdencyValidator.Validate(envelope); default: return EventValidator_1.EventValidator.EventValidator.Validate(envelope); } }; /** * Send Beacon API request * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - not used * Note: Beacon API does not support custom headers and we are not able to get * appId from the backend for the correct correlation. */ Sender.prototype._beaconSender = function (payload, isAsync) { var url = this._config.endpointUrl(); var batch = this._buffer.batchPayloads(payload); // Chrome only allows CORS-safelisted values for the sendBeacon data argument // see: https://bugs.chromium.org/p/chromium/issues/detail?id=720283 var plainTextBatch = new Blob([batch], { type: 'text/plain;charset=UTF-8' }); // The sendBeacon method returns true if the user agent is able to successfully queue the data for transfer. Otherwise it returns false. var queued = navigator.sendBeacon(url, plainTextBatch); if (queued) { this._buffer.markAsSent(payload); } else { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Failed to send telemetry with Beacon API."); } }; /** * Send XMLHttpRequest * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - Indicates if the request should be sent asynchronously */ Sender.prototype._xhrSender = function (payload, isAsync) { var _this = this; var xhr = new XMLHttpRequest(); xhr[applicationinsights_common_1.DisabledPropertyName] = true; xhr.open("POST", this._config.endpointUrl(), isAsync); xhr.setRequestHeader("Content-type", "application/json"); // append Sdk-Context request header only in case of breeze endpoint if (applicationinsights_common_1.Util.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())) { xhr.setRequestHeader(applicationinsights_common_1.RequestHeaders.sdkContextHeader, applicationinsights_common_1.RequestHeaders.sdkContextHeaderAppIdRequest); } xhr.onreadystatechange = function () { return _this._xhrReadyStateChange(xhr, payload, payload.length); }; xhr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXhr(xhr), event); }; // compose an array of payloads var batch = this._buffer.batchPayloads(payload); xhr.send(batch); this._buffer.markAsSent(payload); }; /** * Parses the response from the backend. * @param response - XMLHttpRequest or XDomainRequest response */ Sender.prototype._parseResponse = function (response) { try { if (response && response !== "") { var result = JSON.parse(response); if (result && result.itemsReceived && result.itemsReceived >= result.itemsAccepted && result.itemsReceived - result.itemsAccepted == result.errors.length) { return result; } } } catch (e) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.InvalidBackendResponse, "Cannot parse the response. " + applicationinsights_common_1.Util.getExceptionName(e), { response: response }); } return null; }; /** * Resend payload. Adds payload back to the send buffer and setup a send timer (with exponential backoff). * @param payload */ Sender.prototype._resendPayload = function (payload, linearFactor) { if (linearFactor === void 0) { linearFactor = 1; } if (!payload || payload.length === 0) { return; } this._buffer.clearSent(payload); this._consecutiveErrors++; for (var _i = 0, payload_1 = payload; _i < payload_1.length; _i++) { var item = payload_1[_i]; this._buffer.enqueue(item); } // setup timer this._setRetryTime(linearFactor); this._setupTimer(); }; /** Calculates the time to wait before retrying in case of an error based on * http://en.wikipedia.org/wiki/Exponential_backoff */ Sender.prototype._setRetryTime = function (linearFactor) { var SlotDelayInSeconds = 10; var delayInSeconds; if (this._consecutiveErrors <= 1) { delayInSeconds = SlotDelayInSeconds; } else { var backOffSlot = (Math.pow(2, this._consecutiveErrors) - 1) / 2; // tslint:disable-next-line:insecure-random var backOffDelay = Math.floor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1; backOffDelay = linearFactor * backOffDelay; delayInSeconds = Math.max(Math.min(backOffDelay, 3600), SlotDelayInSeconds); } // TODO: Log the backoff time like the C# version does. var retryAfterTimeSpan = Date.now() + (delayInSeconds * 1000); // TODO: Log the retry at time like the C# version does. this._retryAt = retryAfterTimeSpan; }; /** * Sets up the timer which triggers actually sending the data. */ Sender.prototype._setupTimer = function () { var _this = this; if (!this._timeoutHandle) { var retryInterval = this._retryAt ? Math.max(0, this._retryAt - Date.now()) : 0; var timerValue = Math.max(this._config.maxBatchInterval(), retryInterval); this._timeoutHandle = setTimeout(function () { _this.triggerSend(); }, timerValue); } }; /** * Checks if the SDK should resend the payload after receiving this status code from the backend. * @param statusCode */ Sender.prototype._isRetriable = function (statusCode) { return statusCode == 408 // Timeout || statusCode == 429 // Too many requests. || statusCode == 500 // Internal server error. || statusCode == 503; // Service unavailable. }; Sender.prototype._formatErrorMessageXhr = function (xhr, message) { if (xhr) { return "XMLHttpRequest,Status:" + xhr.status + ",Response:" + xhr.responseText || xhr.response || ""; } return message; }; /** * Send XDomainRequest * @param payload {string} - The data payload to be sent. * @param isAsync {boolean} - Indicates if the request should be sent asynchronously * * Note: XDomainRequest does not support sync requests. This 'isAsync' parameter is added * to maintain consistency with the xhrSender's contract * Note: XDomainRequest does not support custom headers and we are not able to get * appId from the backend for the correct correlation. */ Sender.prototype._xdrSender = function (payload, isAsync) { var _this = this; var xdr = new XDomainRequest(); xdr.onload = function () { return _this._xdrOnLoad(xdr, payload); }; xdr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXdr(xdr), event); }; // XDomainRequest requires the same protocol as the hosting page. // If the protocol doesn't match, we can't send the telemetry :(. var hostingProtocol = window.location.protocol; if (this._config.endpointUrl().lastIndexOf(hostingProtocol, 0) !== 0) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.TransmissionFailed, ". " + "Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."); this._buffer.clear(); return; } var endpointUrl = this._config.endpointUrl().replace(/^(https?:)/, ""); xdr.open('POST', endpointUrl); // compose an array of payloads var batch = this._buffer.batchPayloads(payload); xdr.send(batch); this._buffer.markAsSent(payload); }; Sender.prototype._formatErrorMessageXdr = function (xdr, message) { if (xdr) { return "XDomainRequest,Response:" + xdr.responseText || ""; } return message; }; return Sender; }()); exports.Sender = Sender; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Sender.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/Serializer.js": /*!**************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/Serializer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-common */ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_common_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Serializer = /** @class */ (function () { function Serializer(logger) { this._logger = logger; } /** * Serializes the current object to a JSON string. */ Serializer.prototype.serialize = function (input) { var output = this._serializeObject(input, "root"); return JSON.stringify(output); }; Serializer.prototype._serializeObject = function (source, name) { var circularReferenceCheck = "__aiCircularRefCheck"; var output = {}; if (!source) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObject, "cannot serialize object because it is null or undefined", { name: name }, true); return output; } if (source[circularReferenceCheck]) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CircularReferenceDetected, "Circular reference detected while serializing object", { name: name }, true); return output; } if (!source.aiDataContract) { // special case for measurements/properties/tags if (name === "measurements") { output = this._serializeStringMap(source, "number", name); } else if (name === "properties") { output = this._serializeStringMap(source, "string", name); } else if (name === "tags") { output = this._serializeStringMap(source, "string", name); } else if (applicationinsights_common_1.Util.isArray(source)) { output = this._serializeArray(source, name); } else { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObjectNonSerializable, "Attempting to serialize an object which does not implement ISerializable", { name: name }, true); try { // verify that the object can be stringified JSON.stringify(source); output = source; } catch (e) { // if serialization fails return an empty string this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.CannotSerializeObject, (e && typeof e.toString === 'function') ? e.toString() : "Error serializing object", null, true); } } return output; } source[circularReferenceCheck] = true; for (var field in source.aiDataContract) { var contract = source.aiDataContract[field]; var isRequired = (typeof contract === "function") ? (contract() & applicationinsights_common_1.FieldType.Required) : (contract & applicationinsights_common_1.FieldType.Required); var isHidden = (typeof contract === "function") ? (contract() & applicationinsights_common_1.FieldType.Hidden) : (contract & applicationinsights_common_1.FieldType.Hidden); var isArray = contract & applicationinsights_common_1.FieldType.Array; var isPresent = source[field] !== undefined; var isObject = typeof source[field] === "object" && source[field] !== null; if (isRequired && !isPresent && !isArray) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.MissingRequiredFieldSpecification, "Missing required field specification. The field is required but not present on source", { field: field, name: name }); // If not in debug mode, continue and hope the error is permissible continue; } if (isHidden) { // Don't serialize hidden fields continue; } var value; if (isObject) { if (isArray) { // special case; resurse on each object in the source array value = this._serializeArray(source[field], field); } else { // recurse on the source object in this field value = this._serializeObject(source[field], field); } } else { // assign the source field to the output even if undefined or required value = source[field]; } // only emit this field if the value is defined if (value !== undefined) { output[field] = value; } } delete source[circularReferenceCheck]; return output; }; Serializer.prototype._serializeArray = function (sources, name) { var output = undefined; if (!!sources) { if (!applicationinsights_common_1.Util.isArray(sources)) { this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, applicationinsights_core_js_1._InternalMessageId.ItemNotInArray, "This field was specified as an array in the contract but the item is not an array.\r\n", { name: name }, true); } else { output = []; for (var i = 0; i < sources.length; i++) { var source = sources[i]; var item = this._serializeObject(source, name + "[" + i + "]"); output.push(item); } } } return output; }; Serializer.prototype._serializeStringMap = function (map, expectedType, name) { var output = undefined; if (map) { output = {}; for (var field in map) { var value = map[field]; if (expectedType === "string") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else if (!value.toString) { output[field] = "invalid field: toString() is not defined."; } else { output[field] = value.toString(); } } else if (expectedType === "number") { if (value === undefined) { output[field] = "undefined"; } else if (value === null) { output[field] = "null"; } else { var num = parseFloat(value); if (isNaN(num)) { output[field] = "NaN"; } else { output[field] = num; } } } else { output[field] = "invalid field: " + name + " is of unknown type."; this._logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.CRITICAL, output[field], null, true); } } } return output; }; return Serializer; }()); exports.Serializer = Serializer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Serializer.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/EventValidator.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var EventValidator = /** @class */ (function () { function EventValidator() { } EventValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["name"]) { return false; } */ return true; }; EventValidator.EventValidator = new EventValidator(); return EventValidator; }()); exports.EventValidator = EventValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/ExceptionValidator.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var ExceptionValidator = /** @class */ (function () { function ExceptionValidator() { } ExceptionValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["exceptions"] || !ExceptionValidator._validateExceptions(item.domainProperties["exceptions"])) { return false; } */ return true; }; // TODO implement validation of exceptions ExceptionValidator._validateExceptions = function (exceptions) { // typeName // message // parsedStack // stack // hasFullStack return true; }; ExceptionValidator.ExceptionValidator = new ExceptionValidator(); return ExceptionValidator; }()); exports.ExceptionValidator = ExceptionValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/MetricValidator.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var MetricValidator = /** @class */ (function () { function MetricValidator() { } MetricValidator.prototype.Validate = function (event) { return true; }; MetricValidator.MetricValidator = new MetricValidator(); return MetricValidator; }()); exports.MetricValidator = MetricValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MetricValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js": /*!****************************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewPerformanceValidator.js ***! \****************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewPerformanceValidator = /** @class */ (function () { function PageViewPerformanceValidator() { } PageViewPerformanceValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["domProcessing"] || !item.domainProperties["duration"] || !item.domainProperties["name"] || !item.domainProperties["networkConnect"] || !item.domainProperties["perfTotal"] || !item.domainProperties["receivedResponse"] || !item.domainProperties["sentRequest"] || !item.domainProperties["url"]) { return false; } */ return true; }; PageViewPerformanceValidator.PageViewPerformanceValidator = new PageViewPerformanceValidator(); return PageViewPerformanceValidator; }()); exports.PageViewPerformanceValidator = PageViewPerformanceValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerformanceValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/PageViewValidator.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewValidator = /** @class */ (function () { function PageViewValidator() { } PageViewValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["id"] || !item.domainProperties["name"] || !item.domainProperties["duration"] || !item.domainProperties["url"]) { return false; } */ return true; }; PageViewValidator.PageViewValidator = new PageViewValidator(); return PageViewValidator; }()); exports.PageViewValidator = PageViewValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/RemoteDepdencyValidator.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RemoteDepdencyValidator = /** @class */ (function () { function RemoteDepdencyValidator() { } RemoteDepdencyValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["id"] || !item.domainProperties["name"] || !item.domainProperties["resultCode"] || !item.domainProperties["duration"] || !item.domainProperties["success"] || !item.domainProperties["data"] || !item.domainProperties["target"] || !item.domainProperties["type"]) { return false; } */ return true; }; RemoteDepdencyValidator.RemoteDepdencyValidator = new RemoteDepdencyValidator(); return RemoteDepdencyValidator; }()); exports.RemoteDepdencyValidator = RemoteDepdencyValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDepdencyValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js": /*!**************************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/TelemetryValidation/TraceValidator.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TraceValidator = /** @class */ (function () { function TraceValidator() { } TraceValidator.prototype.Validate = function (item) { /* TODO re-enable once design of iTelemetryItem is finalized. Task used to track this: https://mseng.visualstudio.com/AppInsights/_workitems/edit/1310871 // verify system properties has a ver field if (!item.sytemProperties || !item.sytemProperties["ver"]) { return false; } if (!item.domainProperties || !item.domainProperties["message"] || !item.domainProperties["severityLevel"]) { return false; } */ return true; }; TraceValidator.TraceValidator = new TraceValidator(); return TraceValidator; }()); exports.TraceValidator = TraceValidator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=TraceValidator.js.map /***/ }), /***/ "./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js": /*!**********************************************************************************************!*\ !*** ./node_modules/applicationinsights-channel-js/bundle/applicationinsights-channel-js.js ***! \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Sender */ "./node_modules/applicationinsights-channel-js/bundle/Sender.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Sender_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Sender = Sender_1.Sender; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-channel-js.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Constants.js": /*!*********************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Constants.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Constants.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Enums.js": /*!*****************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Enums.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Type of storage to differentiate between local storage and session storage */ var StorageType; (function (StorageType) { StorageType[StorageType["LocalStorage"] = 0] = "LocalStorage"; StorageType[StorageType["SessionStorage"] = 1] = "SessionStorage"; })(StorageType = exports.StorageType || (exports.StorageType = {})); /** * Enum is used in aiDataContract to describe how fields are serialized. * For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array */ var FieldType; (function (FieldType) { FieldType[FieldType["Default"] = 0] = "Default"; FieldType[FieldType["Required"] = 1] = "Required"; FieldType[FieldType["Array"] = 2] = "Array"; FieldType[FieldType["Hidden"] = 4] = "Hidden"; })(FieldType = exports.FieldType || (exports.FieldType = {})); ; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Enums.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js": /*!***********************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Data struct to contain only C section with custom fields. */ var Base = /** @class */ (function () { function Base() { } return Base; }()); exports.Base = Base; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Base.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js ***! \*********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED var ContextTagKeys = /** @class */ (function () { function ContextTagKeys() { this.applicationVersion = "ai.application.ver"; this.applicationBuild = "ai.application.build"; this.applicationTypeId = "ai.application.typeId"; this.applicationId = "ai.application.applicationId"; this.applicationLayer = "ai.application.layer"; this.deviceId = "ai.device.id"; this.deviceIp = "ai.device.ip"; this.deviceLanguage = "ai.device.language"; this.deviceLocale = "ai.device.locale"; this.deviceModel = "ai.device.model"; this.deviceFriendlyName = "ai.device.friendlyName"; this.deviceNetwork = "ai.device.network"; this.deviceNetworkName = "ai.device.networkName"; this.deviceOEMName = "ai.device.oemName"; this.deviceOS = "ai.device.os"; this.deviceOSVersion = "ai.device.osVersion"; this.deviceRoleInstance = "ai.device.roleInstance"; this.deviceRoleName = "ai.device.roleName"; this.deviceScreenResolution = "ai.device.screenResolution"; this.deviceType = "ai.device.type"; this.deviceMachineName = "ai.device.machineName"; this.deviceVMName = "ai.device.vmName"; this.deviceBrowser = "ai.device.browser"; this.deviceBrowserVersion = "ai.device.browserVersion"; this.locationIp = "ai.location.ip"; this.locationCountry = "ai.location.country"; this.locationProvince = "ai.location.province"; this.locationCity = "ai.location.city"; this.operationId = "ai.operation.id"; this.operationName = "ai.operation.name"; this.operationParentId = "ai.operation.parentId"; this.operationRootId = "ai.operation.rootId"; this.operationSyntheticSource = "ai.operation.syntheticSource"; this.operationCorrelationVector = "ai.operation.correlationVector"; this.sessionId = "ai.session.id"; this.sessionIsFirst = "ai.session.isFirst"; this.sessionIsNew = "ai.session.isNew"; this.userAccountAcquisitionDate = "ai.user.accountAcquisitionDate"; this.userAccountId = "ai.user.accountId"; this.userAgent = "ai.user.userAgent"; this.userId = "ai.user.id"; this.userStoreRegion = "ai.user.storeRegion"; this.userAuthUserId = "ai.user.authUserId"; this.userAnonymousUserAcquisitionDate = "ai.user.anonUserAcquisitionDate"; this.userAuthenticatedUserAcquisitionDate = "ai.user.authUserAcquisitionDate"; this.cloudName = "ai.cloud.name"; this.cloudRole = "ai.cloud.role"; this.cloudRoleVer = "ai.cloud.roleVer"; this.cloudRoleInstance = "ai.cloud.roleInstance"; this.cloudEnvironment = "ai.cloud.environment"; this.cloudLocation = "ai.cloud.location"; this.cloudDeploymentUnit = "ai.cloud.deploymentUnit"; this.internalSdkVersion = "ai.internal.sdkVersion"; this.internalAgentVersion = "ai.internal.agentVersion"; this.internalNodeName = "ai.internal.nodeName"; } return ContextTagKeys; }()); exports.ContextTagKeys = ContextTagKeys; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ContextTagKeys.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js": /*!***********************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Base */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Base_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Data struct to contain both B and C sections. */ var Data = /** @class */ (function (_super) { __extends(Data, _super); function Data() { return _super.call(this) || this; } return Data; }(Base_1.Base)); exports.Data = Data; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Data.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./DataPointType */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataPointType_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Metric data single measurement. */ var DataPoint = /** @class */ (function () { function DataPoint() { this.kind = DataPointType_1.DataPointType.Measurement; } return DataPoint; }()); exports.DataPoint = DataPoint; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPoint.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPointType.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED /** * Type of the metric data measurement. */ var DataPointType; (function (DataPointType) { DataPointType[DataPointType["Measurement"] = 0] = "Measurement"; DataPointType[DataPointType["Aggregation"] = 1] = "Aggregation"; })(DataPointType = exports.DataPointType || (exports.DataPointType = {})); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPointType.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js": /*!*************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js ***! \*************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * The abstract common base of all domains. */ var Domain = /** @class */ (function () { function Domain() { } return Domain; }()); exports.Domain = Domain; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Domain.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js": /*!***************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * System variables for a telemetry item. */ var Envelope = /** @class */ (function () { function Envelope() { this.ver = 1; this.sampleRate = 100.0; this.tags = {}; } return Envelope; }()); exports.Envelope = Envelope; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Envelope.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js": /*!****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Instances of Event represent structured event records that can be grouped and searched by their properties. Event data item also creates a metric of event count by name. */ var EventData = /** @class */ (function (_super) { __extends(EventData, _super); function EventData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return EventData; }(Domain_1.Domain)); exports.EventData = EventData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of Exception represents a handled or unhandled exception that occurred during execution of the monitored application. */ var ExceptionData = /** @class */ (function (_super) { __extends(ExceptionData, _super); function ExceptionData() { var _this = _super.call(this) || this; _this.ver = 2; _this.exceptions = []; _this.properties = {}; _this.measurements = {}; return _this; } return ExceptionData; }(Domain_1.Domain)); exports.ExceptionData = ExceptionData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Exception details of the exception in a chain. */ var ExceptionDetails = /** @class */ (function () { function ExceptionDetails() { this.hasFullStack = true; this.parsedStack = []; } return ExceptionDetails; }()); exports.ExceptionDetails = ExceptionDetails; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=ExceptionDetails.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Instances of Message represent printf-like trace statements that are text-searched. Log4Net, NLog and other text-based log file entries are translated into intances of this type. The message does not have measurements. */ var MessageData = /** @class */ (function (_super) { __extends(MessageData, _super); function MessageData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; return _this; } return MessageData; }(Domain_1.Domain)); exports.MessageData = MessageData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MessageData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of the Metric item is a list of measurements (single data points) and/or aggregations. */ var MetricData = /** @class */ (function (_super) { __extends(MetricData, _super); function MetricData() { var _this = _super.call(this) || this; _this.ver = 2; _this.metrics = []; _this.properties = {}; return _this; } return MetricData; }(Domain_1.Domain)); exports.MetricData = MetricData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=MetricData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js ***! \*******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./EventData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView. */ var PageViewData = /** @class */ (function (_super) { __extends(PageViewData, _super); function PageViewData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return PageViewData; }(EventData_1.EventData)); exports.PageViewData = PageViewData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js ***! \***********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of PageViewPerf represents: a page view with no performance data, a page view with performance data, or just the performance data of an earlier page request. */ var PageViewPerfData = /** @class */ (function (_super) { __extends(PageViewPerfData, _super); function PageViewPerfData() { var _this = _super.call(this) || this; _this.ver = 2; _this.properties = {}; _this.measurements = {}; return _this; } return PageViewPerfData; }(PageViewData_1.PageViewData)); exports.PageViewPerfData = PageViewPerfData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerfData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js": /*!***************************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js ***! \***************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Domain */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Domain.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Domain_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * An instance of Remote Dependency represents an interaction of the monitored component with a remote component/service like SQL or an HTTP endpoint. */ var RemoteDependencyData = /** @class */ (function (_super) { __extends(RemoteDependencyData, _super); function RemoteDependencyData() { var _this = _super.call(this) || this; _this.ver = 2; _this.success = true; _this.properties = {}; _this.measurements = {}; return _this; } return RemoteDependencyData; }(Domain_1.Domain)); exports.RemoteDependencyData = RemoteDependencyData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDependencyData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js": /*!********************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js ***! \********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// THIS FILE WAS AUTOGENERATED !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Defines the level of severity for the event. */ var SeverityLevel; (function (SeverityLevel) { SeverityLevel[SeverityLevel["Verbose"] = 0] = "Verbose"; SeverityLevel[SeverityLevel["Information"] = 1] = "Information"; SeverityLevel[SeverityLevel["Warning"] = 2] = "Warning"; SeverityLevel[SeverityLevel["Error"] = 3] = "Error"; SeverityLevel[SeverityLevel["Critical"] = 4] = "Critical"; })(SeverityLevel = exports.SeverityLevel || (exports.SeverityLevel = {})); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=SeverityLevel.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // THIS FILE WAS AUTOGENERATED /** * Stack frame information. */ var StackFrame = /** @class */ (function () { function StackFrame() { } return StackFrame; }()); exports.StackFrame = StackFrame; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=StackFrame.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js": /*!**********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RequestHeaders = /** @class */ (function () { function RequestHeaders() { } /** * Request-Context header */ RequestHeaders.requestContextHeader = "Request-Context"; /** * Target instrumentation header that is added to the response and retrieved by the * calling application when processing incoming responses. */ RequestHeaders.requestContextTargetKey = "appId"; /** * Request-Context appId format */ RequestHeaders.requestContextAppIdFormat = "appId=cid-v1:"; /** * Request-Id header */ RequestHeaders.requestIdHeader = "Request-Id"; /** * Sdk-Context header * If this header passed with appId in content then appId will be returned back by the backend. */ RequestHeaders.sdkContextHeader = "Sdk-Context"; /** * String to pass in header for requesting appId back from the backend. */ RequestHeaders.sdkContextHeaderAppIdRequest = "appId"; RequestHeaders.requestContextHeaderLowerCase = "request-context"; return RequestHeaders; }()); exports.RequestHeaders = RequestHeaders; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RequestResponseHeaders.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js": /*!*********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/Data */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Data_1, Enums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Data = /** @class */ (function (_super) { __extends(Data, _super); /** * Constructs a new instance of telemetry data. */ function Data(baseType, data) { var _this = _super.call(this) || this; /** * The data contract for serializing this object. */ _this.aiDataContract = { baseType: Enums_1.FieldType.Required, baseData: Enums_1.FieldType.Required }; _this.baseType = baseType; _this.baseData = data; return _this; } return Data; }(Data_1.Data)); exports.Data = Data; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Data.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/DataPoint */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/DataPoint.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataPoint_1, Enums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DataPoint = /** @class */ (function (_super) { __extends(DataPoint, _super); function DataPoint() { var _this = _super !== null && _super.apply(this, arguments) || this; /** * The data contract for serializing this object. */ _this.aiDataContract = { name: Enums_1.FieldType.Required, kind: Enums_1.FieldType.Default, value: Enums_1.FieldType.Required, count: Enums_1.FieldType.Default, min: Enums_1.FieldType.Default, max: Enums_1.FieldType.Default, stdDev: Enums_1.FieldType.Default }; return _this; } return DataPoint; }(DataPoint_1.DataPoint)); exports.DataPoint = DataPoint; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataPoint.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ../../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, applicationinsights_core_js_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DataSanitizer = /** @class */ (function () { function DataSanitizer() { } DataSanitizer.sanitizeKeyAndAddUniqueness = function (logger, key, map) { var origLength = key.length; var field = DataSanitizer.sanitizeKey(logger, key); // validation truncated the length. We need to add uniqueness if (field.length !== origLength) { var i = 0; var uniqueField = field; while (map[uniqueField] !== undefined) { i++; uniqueField = field.substring(0, DataSanitizer.MAX_NAME_LENGTH - 3) + DataSanitizer.padNumber(i); } field = uniqueField; } return field; }; DataSanitizer.sanitizeKey = function (logger, name) { if (name) { // Remove any leading or trailing whitepace name = Util_1.Util.trim(name.toString()); // truncate the string to 150 chars if (name.length > DataSanitizer.MAX_NAME_LENGTH) { name = name.substring(0, DataSanitizer.MAX_NAME_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + DataSanitizer.MAX_NAME_LENGTH + " characters.", { name: name }, true); } } return name; }; DataSanitizer.sanitizeString = function (logger, value, maxLength) { if (maxLength === void 0) { maxLength = DataSanitizer.MAX_STRING_LENGTH; } if (value) { maxLength = maxLength ? maxLength : DataSanitizer.MAX_STRING_LENGTH; // in case default parameters dont work value = Util_1.Util.trim(value); if (value.toString().length > maxLength) { value = value.toString().substring(0, maxLength); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true); } } return value; }; DataSanitizer.sanitizeUrl = function (logger, url) { return DataSanitizer.sanitizeInput(logger, url, DataSanitizer.MAX_URL_LENGTH, applicationinsights_core_js_1._InternalMessageId.UrlTooLong); }; DataSanitizer.sanitizeMessage = function (logger, message) { if (message) { if (message.length > DataSanitizer.MAX_MESSAGE_LENGTH) { message = message.substring(0, DataSanitizer.MAX_MESSAGE_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.MessageTruncated, "message is too long, it has been truncated to " + DataSanitizer.MAX_MESSAGE_LENGTH + " characters.", { message: message }, true); } } return message; }; DataSanitizer.sanitizeException = function (logger, exception) { if (exception) { if (exception.length > DataSanitizer.MAX_EXCEPTION_LENGTH) { exception = exception.substring(0, DataSanitizer.MAX_EXCEPTION_LENGTH); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + DataSanitizer.MAX_EXCEPTION_LENGTH + " characters.", { exception: exception }, true); } } return exception; }; DataSanitizer.sanitizeProperties = function (logger, properties) { if (properties) { var tempProps = {}; for (var prop in properties) { var value = DataSanitizer.sanitizeString(logger, properties[prop], DataSanitizer.MAX_PROPERTY_LENGTH); prop = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, prop, tempProps); tempProps[prop] = value; } properties = tempProps; } return properties; }; DataSanitizer.sanitizeMeasurements = function (logger, measurements) { if (measurements) { var tempMeasurements = {}; for (var measure in measurements) { var value = measurements[measure]; measure = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements); tempMeasurements[measure] = value; } measurements = tempMeasurements; } return measurements; }; DataSanitizer.sanitizeId = function (logger, id) { return id ? DataSanitizer.sanitizeInput(logger, id, DataSanitizer.MAX_ID_LENGTH, applicationinsights_core_js_1._InternalMessageId.IdTooLong).toString() : id; }; DataSanitizer.sanitizeInput = function (logger, input, maxLength, _msgId) { if (input) { input = Util_1.Util.trim(input); if (input.length > maxLength) { input = input.substring(0, maxLength); logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true); } } return input; }; DataSanitizer.padNumber = function (num) { var s = "00" + num; return s.substr(s.length - 3); }; /** * Max length allowed for custom names. */ DataSanitizer.MAX_NAME_LENGTH = 150; /** * Max length allowed for Id field in page views. */ DataSanitizer.MAX_ID_LENGTH = 128; /** * Max length allowed for custom values. */ DataSanitizer.MAX_PROPERTY_LENGTH = 8192; /** * Max length allowed for names */ DataSanitizer.MAX_STRING_LENGTH = 1024; /** * Max length allowed for url. */ DataSanitizer.MAX_URL_LENGTH = 2048; /** * Max length allowed for messages. */ DataSanitizer.MAX_MESSAGE_LENGTH = 32768; /** * Max length allowed for exceptions. */ DataSanitizer.MAX_EXCEPTION_LENGTH = 32768; return DataSanitizer; }()); exports.DataSanitizer = DataSanitizer; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DataSanitizer.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js": /*!*************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../../Interfaces/Contracts/Generated/Envelope */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Envelope.js"), __webpack_require__(/*! ./DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Envelope_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Envelope = /** @class */ (function (_super) { __extends(Envelope, _super); /** * Constructs a new instance of telemetry data. */ function Envelope(logger, data, name) { var _this = _super.call(this) || this; _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.data = data; _this.time = Util_1.Util.toISOStringForIE8(new Date()); _this.aiDataContract = { time: Enums_1.FieldType.Required, iKey: Enums_1.FieldType.Required, name: Enums_1.FieldType.Required, sampleRate: function () { return (_this.sampleRate == 100) ? Enums_1.FieldType.Hidden : Enums_1.FieldType.Required; }, tags: Enums_1.FieldType.Required, data: Enums_1.FieldType.Required }; return _this; } return Envelope; }(Envelope_1.Envelope)); exports.Envelope = Envelope; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Envelope.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Event.js": /*!***************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Event.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/EventData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/EventData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Event = /** @class */ (function (_super) { __extends(Event, _super); /** * Constructs a new instance of the EventTelemetry object */ function Event(logger, name, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Required, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } Event.envelopeType = "Microsoft.ApplicationInsights.{0}.Event"; Event.dataType = "EventData"; return Event; }(EventData_1.EventData)); exports.Event = Event; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Event.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js": /*!*******************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/StackFrame */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/StackFrame.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/ExceptionData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionData.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/ExceptionDetails */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ExceptionDetails.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, StackFrame_1, ExceptionData_1, ExceptionDetails_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Exception = /** @class */ (function (_super) { __extends(Exception, _super); /** * Constructs a new isntance of the ExceptionTelemetry object */ function Exception(logger, exception, properties, measurements, severityLevel) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, exceptions: Enums_1.FieldType.Required, severityLevel: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); _this.exceptions = [new _ExceptionDetails(logger, exception)]; if (severityLevel) { _this.severityLevel = severityLevel; } return _this; } /** * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception. */ Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) { return { exceptions: [ { hasFullStack: true, message: message, stack: details, typeName: typeName } ] }; }; Exception.envelopeType = "Microsoft.ApplicationInsights.{0}.Exception"; Exception.dataType = "ExceptionData"; return Exception; }(ExceptionData_1.ExceptionData)); exports.Exception = Exception; var _ExceptionDetails = /** @class */ (function (_super) { __extends(_ExceptionDetails, _super); function _ExceptionDetails(logger, exception) { var _this = _super.call(this) || this; _this.aiDataContract = { id: Enums_1.FieldType.Default, outerId: Enums_1.FieldType.Default, typeName: Enums_1.FieldType.Required, message: Enums_1.FieldType.Required, hasFullStack: Enums_1.FieldType.Default, stack: Enums_1.FieldType.Default, parsedStack: Enums_1.FieldType.Array }; _this.typeName = DataSanitizer_1.DataSanitizer.sanitizeString(logger, exception.name) || Util_1.Util.NotSpecified; _this.message = DataSanitizer_1.DataSanitizer.sanitizeMessage(logger, exception.message) || Util_1.Util.NotSpecified; var stack = exception["stack"]; _this.parsedStack = _this.parseStack(stack); _this.stack = DataSanitizer_1.DataSanitizer.sanitizeException(logger, stack); _this.hasFullStack = Util_1.Util.isArray(_this.parsedStack) && _this.parsedStack.length > 0; return _this; } _ExceptionDetails.prototype.parseStack = function (stack) { var parsedStack = undefined; if (typeof stack === "string") { var frames = stack.split('\n'); parsedStack = []; var level = 0; var totalSizeInBytes = 0; for (var i = 0; i <= frames.length; i++) { var frame = frames[i]; if (_StackFrame.regex.test(frame)) { var parsedFrame = new _StackFrame(frames[i], level++); totalSizeInBytes += parsedFrame.sizeInBytes; parsedStack.push(parsedFrame); } } // DP Constraint - exception parsed stack must be < 32KB // remove frames from the middle to meet the threshold var exceptionParsedStackThreshold = 32 * 1024; if (totalSizeInBytes > exceptionParsedStackThreshold) { var left = 0; var right = parsedStack.length - 1; var size = 0; var acceptedLeft = left; var acceptedRight = right; while (left < right) { // check size var lSize = parsedStack[left].sizeInBytes; var rSize = parsedStack[right].sizeInBytes; size += lSize + rSize; if (size > exceptionParsedStackThreshold) { // remove extra frames from the middle var howMany = acceptedRight - acceptedLeft + 1; parsedStack.splice(acceptedLeft, howMany); break; } // update pointers acceptedLeft = left; acceptedRight = right; left++; right--; } } } return parsedStack; }; return _ExceptionDetails; }(ExceptionDetails_1.ExceptionDetails)); var _StackFrame = /** @class */ (function (_super) { __extends(_StackFrame, _super); function _StackFrame(frame, level) { var _this = _super.call(this) || this; _this.sizeInBytes = 0; _this.aiDataContract = { level: Enums_1.FieldType.Required, method: Enums_1.FieldType.Required, assembly: Enums_1.FieldType.Default, fileName: Enums_1.FieldType.Default, line: Enums_1.FieldType.Default }; _this.level = level; _this.method = ""; _this.assembly = Util_1.Util.trim(frame); var matches = frame.match(_StackFrame.regex); if (matches && matches.length >= 5) { _this.method = Util_1.Util.trim(matches[2]) || _this.method; _this.fileName = Util_1.Util.trim(matches[4]); _this.line = parseInt(matches[5]) || 0; } _this.sizeInBytes += _this.method.length; _this.sizeInBytes += _this.fileName.length; _this.sizeInBytes += _this.assembly.length; // todo: these might need to be removed depending on how the back-end settles on their size calculation _this.sizeInBytes += _StackFrame.baseSize; _this.sizeInBytes += _this.level.toString().length; _this.sizeInBytes += _this.line.toString().length; return _this; } // regex to match stack frames from ie/chrome/ff // methodName=$2, fileName=$4, lineNo=$5, column=$6 _StackFrame.regex = /^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/; _StackFrame.baseSize = 58; //'{"method":"","level":,"assembly":"","fileName":"","line":}'.length return _StackFrame; }(StackFrame_1.StackFrame)); exports._StackFrame = _StackFrame; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Exception.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js": /*!****************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/MetricData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MetricData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./Common/DataPoint */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataPoint.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, MetricData_1, DataSanitizer_1, Enums_1, DataPoint_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Metric = /** @class */ (function (_super) { __extends(Metric, _super); /** * Constructs a new instance of the MetricTelemetry object */ function Metric(logger, name, value, count, min, max, properties) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, metrics: Enums_1.FieldType.Required, properties: Enums_1.FieldType.Default }; var dataPoint = new DataPoint_1.DataPoint(); dataPoint.count = count > 0 ? count : undefined; dataPoint.max = isNaN(max) || max === null ? undefined : max; dataPoint.min = isNaN(min) || min === null ? undefined : min; dataPoint.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; dataPoint.value = value; _this.metrics = [dataPoint]; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); return _this; } Metric.envelopeType = "Microsoft.ApplicationInsights.{0}.Metric"; Metric.dataType = "MetricData"; return Metric; }(MetricData_1.MetricData)); exports.Metric = Metric; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Metric.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js": /*!******************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageView = /** @class */ (function (_super) { __extends(PageView, _super); /** * Constructs a new instance of the PageEventTelemetry object */ function PageView(logger, name, url, durationMs, properties, measurements, id) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, url: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default, id: Enums_1.FieldType.Default, }; _this.id = DataSanitizer_1.DataSanitizer.sanitizeId(logger, id); _this.url = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, url); _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; if (!isNaN(durationMs)) { _this.duration = Util_1.Util.msToTimeSpan(durationMs); } _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } PageView.envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview"; PageView.dataType = "PageviewData"; return PageView; }(PageViewData_1.PageViewData)); exports.PageView = PageView; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageView.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js": /*!*****************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/PageViewPerfData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewPerfData.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, PageViewPerfData_1, Enums_1, DataSanitizer_1, Util_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PageViewPerformance = /** @class */ (function (_super) { __extends(PageViewPerformance, _super); /** * Constructs a new instance of the PageEventTelemetry object */ function PageViewPerformance(logger, name, url, unused, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, url: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, perfTotal: Enums_1.FieldType.Default, networkConnect: Enums_1.FieldType.Default, sentRequest: Enums_1.FieldType.Default, receivedResponse: Enums_1.FieldType.Default, domProcessing: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default }; _this.isValid = false; /* * http://www.w3.org/TR/navigation-timing/#processing-model * |-navigationStart * | |-connectEnd * | ||-requestStart * | || |-responseStart * | || | |-responseEnd * | || | | * | || | | |-loadEventEnd * |---network---||---request---|---response---|---dom---| * |--------------------------total----------------------| */ var timing = PageViewPerformance.getPerformanceTiming(); if (timing) { var total = PageViewPerformance.getDuration(timing.navigationStart, timing.loadEventEnd); var network = PageViewPerformance.getDuration(timing.navigationStart, timing.connectEnd); var request = PageViewPerformance.getDuration(timing.requestStart, timing.responseStart); var response = PageViewPerformance.getDuration(timing.responseStart, timing.responseEnd); var dom = PageViewPerformance.getDuration(timing.responseEnd, timing.loadEventEnd); if (total == 0) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ErrorPVCalc, "error calculating page view performance.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (!PageViewPerformance.shouldCollectDuration(total, network, request, response, dom)) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.InvalidDurationValue, "Invalid page load duration value. Browser perf data won't be sent.", { total: total, network: network, request: request, response: response, dom: dom }); } else if (total < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(dom)) { // some browsers may report individual components incorrectly so that the sum of the parts will be bigger than total PLT // in this case, don't report client performance from this page logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.ClientPerformanceMathError, "client performance math error.", { total: total, network: network, request: request, response: response, dom: dom }); } else { _this.durationMs = total; // convert to timespans _this.perfTotal = _this.duration = Util_1.Util.msToTimeSpan(total); _this.networkConnect = Util_1.Util.msToTimeSpan(network); _this.sentRequest = Util_1.Util.msToTimeSpan(request); _this.receivedResponse = Util_1.Util.msToTimeSpan(response); _this.domProcessing = Util_1.Util.msToTimeSpan(dom); _this.isValid = true; } } _this.url = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, url); _this.name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, name) || Util_1.Util.NotSpecified; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } /** * Indicates whether this instance of PageViewPerformance is valid and should be sent */ PageViewPerformance.prototype.getIsValid = function () { return this.isValid; }; /** * Gets the total duration (PLT) in milliseconds. Check getIsValid() before using this method. */ PageViewPerformance.prototype.getDurationMs = function () { return this.durationMs; }; PageViewPerformance.getPerformanceTiming = function () { if (PageViewPerformance.isPerformanceTimingSupported()) { return window.performance.timing; } return null; }; /** * Returns true is window performance timing API is supported, false otherwise. */ PageViewPerformance.isPerformanceTimingSupported = function () { return typeof window != "undefined" && window.performance && window.performance.timing; }; /** * As page loads different parts of performance timing numbers get set. When all of them are set we can report it. * Returns true if ready, false otherwise. */ PageViewPerformance.isPerformanceTimingDataReady = function () { var timing = window.performance.timing; return timing.domainLookupStart > 0 && timing.navigationStart > 0 && timing.responseStart > 0 && timing.requestStart > 0 && timing.loadEventEnd > 0 && timing.responseEnd > 0 && timing.connectEnd > 0 && timing.domLoading > 0; }; PageViewPerformance.getDuration = function (start, end) { var duration = undefined; if (!(isNaN(start) || isNaN(end))) { duration = Math.max(end - start, 0); } return duration; }; /** * This method tells if given durations should be excluded from collection. */ PageViewPerformance.shouldCollectDuration = function () { var durations = []; for (var _i = 0; _i < arguments.length; _i++) { durations[_i] = arguments[_i]; } // a full list of Google crawlers user agent strings - https://support.google.com/webmasters/answer/1061943?hl=en var botAgentNames = ['googlebot', 'adsbot-google', 'apis-google', 'mediapartners-google']; var userAgent = navigator.userAgent; var isGoogleBot = false; if (userAgent) { for (var i_1 = 0; i_1 < botAgentNames.length; i_1++) { isGoogleBot = isGoogleBot || userAgent.toLowerCase().indexOf(botAgentNames[i_1]) !== -1; } } if (isGoogleBot) { // Don't report durations for GoogleBot, it is returning invalid values in performance.timing API. return false; } else { // for other page views, don't report if it's outside of a reasonable range for (var i = 0; i < durations.length; i++) { if (durations[i] >= PageViewPerformance.MAX_DURATION_ALLOWED) { return false; } } } return true; }; PageViewPerformance.envelopeType = "Microsoft.ApplicationInsights.{0}.PageviewPerformance"; PageViewPerformance.dataType = "PageviewPerformanceData"; PageViewPerformance.MAX_DURATION_ALLOWED = 3600000; // 1h return PageViewPerformance; }(PageViewPerfData_1.PageViewPerfData)); exports.PageViewPerformance = PageViewPerformance; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=PageViewPerformance.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ../Interfaces/Contracts/Generated/RemoteDependencyData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/RemoteDependencyData.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, DataSanitizer_1, Enums_1, Util_1, Util_2, RemoteDependencyData_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RemoteDependencyData = /** @class */ (function (_super) { __extends(RemoteDependencyData, _super); /** * Constructs a new instance of the RemoteDependencyData object */ function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, properties, measurements) { var _this = _super.call(this) || this; _this.aiDataContract = { id: Enums_1.FieldType.Required, ver: Enums_1.FieldType.Required, name: Enums_1.FieldType.Default, resultCode: Enums_1.FieldType.Default, duration: Enums_1.FieldType.Default, success: Enums_1.FieldType.Default, data: Enums_1.FieldType.Default, target: Enums_1.FieldType.Default, type: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default, measurements: Enums_1.FieldType.Default, kind: Enums_1.FieldType.Default, value: Enums_1.FieldType.Default, count: Enums_1.FieldType.Default, min: Enums_1.FieldType.Default, max: Enums_1.FieldType.Default, stdDev: Enums_1.FieldType.Default, dependencyKind: Enums_1.FieldType.Default, dependencySource: Enums_1.FieldType.Default, commandName: Enums_1.FieldType.Default, dependencyTypeName: Enums_1.FieldType.Default, }; _this.id = id; _this.duration = Util_1.Util.msToTimeSpan(value); _this.success = success; _this.resultCode = resultCode + ""; _this.type = "Ajax"; _this.data = DataSanitizer_1.DataSanitizer.sanitizeUrl(logger, commandName); var dependencyFields = Util_2.AjaxHelper.ParseDependencyPath(logger, absoluteUrl, method, commandName); _this.target = dependencyFields.target; _this.name = dependencyFields.name; _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); _this.measurements = DataSanitizer_1.DataSanitizer.sanitizeMeasurements(logger, measurements); return _this; } RemoteDependencyData.envelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency"; RemoteDependencyData.dataType = "RemoteDependencyData"; return RemoteDependencyData; }(RemoteDependencyData_1.RemoteDependencyData)); exports.RemoteDependencyData = RemoteDependencyData; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=RemoteDependencyData.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js": /*!***************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../Interfaces/Contracts/Generated/MessageData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/MessageData.js"), __webpack_require__(/*! ./Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ../Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ../Util */ "./node_modules/applicationinsights-common/bundle/Util.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, MessageData_1, DataSanitizer_1, Enums_1, Util_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Trace = /** @class */ (function (_super) { __extends(Trace, _super); /** * Constructs a new instance of the TraceTelemetry object */ function Trace(logger, message, properties, severityLevel) { var _this = _super.call(this) || this; _this.aiDataContract = { ver: Enums_1.FieldType.Required, message: Enums_1.FieldType.Required, severityLevel: Enums_1.FieldType.Default, properties: Enums_1.FieldType.Default }; message = message || Util_1.Util.NotSpecified; _this.message = DataSanitizer_1.DataSanitizer.sanitizeMessage(logger, message); _this.properties = DataSanitizer_1.DataSanitizer.sanitizeProperties(logger, properties); if (severityLevel) { _this.severityLevel = severityLevel; } return _this; } Trace.envelopeType = "Microsoft.ApplicationInsights.{0}.Message"; Trace.dataType = "MessageData"; return Trace; }(MessageData_1.MessageData)); exports.Trace = Trace; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Trace.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js": /*!********************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Util_1, DataSanitizer_1, applicationinsights_core_js_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TelemetryItemCreator = /** @class */ (function () { function TelemetryItemCreator() { } /** * Create a telemetry item that the 1DS channel understands * @param item domain specific properties; part B * @param baseType telemetry item type. ie PageViewData * @param envelopeName name of the envelope. ie Microsoft.ApplicationInsights..PageView * @param customProperties user defined custom properties; part C * @param systemProperties system properties that are added to the context; part A * @returns ITelemetryItem that is sent to channel */ TelemetryItemCreator.create = function (item, baseType, envelopeName, logger, customProperties, systemProperties) { envelopeName = DataSanitizer_1.DataSanitizer.sanitizeString(logger, envelopeName) || Util_1.Util.NotSpecified; if (applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(item) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(baseType) || applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(envelopeName)) { throw Error("Input doesn't contain all required fields"); } var telemetryItem = { name: envelopeName, timestamp: new Date(), instrumentationKey: "", ctx: systemProperties ? systemProperties : {}, tags: [], data: {}, baseType: baseType, baseData: item }; // Part C if (!applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(customProperties)) { for (var prop in customProperties) { if (customProperties.hasOwnProperty(prop)) { telemetryItem.data[prop] = customProperties[prop]; } } } return telemetryItem; }; return TelemetryItemCreator; }()); exports.TelemetryItemCreator = TelemetryItemCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=TelemetryItemCreator.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/Util.js": /*!****************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/Util.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! applicationinsights-core-js */ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js"), __webpack_require__(/*! ./RequestResponseHeaders */ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Enums_1, applicationinsights_core_js_1, RequestResponseHeaders_1, DataSanitizer_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Util = /** @class */ (function () { function Util() { } /* * Force the SDK not to use local and session storage */ Util.disableStorage = function () { Util._canUseLocalStorage = false; Util._canUseSessionStorage = false; }; /** * Gets the localStorage object if available * @return {Storage} - Returns the storage object if available else returns null */ Util._getLocalStorageObject = function () { if (Util.canUseLocalStorage()) { return Util._getVerifiedStorageObject(Enums_1.StorageType.LocalStorage); } return null; }; /** * Tests storage object (localStorage or sessionStorage) to verify that it is usable * More details here: https://mathiasbynens.be/notes/localstorage-pattern * @param storageType Type of storage * @return {Storage} Returns storage object verified that it is usable */ Util._getVerifiedStorageObject = function (storageType) { var storage = null; var fail; var uid; try { uid = new Date; storage = storageType === Enums_1.StorageType.LocalStorage ? window.localStorage : window.sessionStorage; storage.setItem(uid, uid); fail = storage.getItem(uid) != uid; storage.removeItem(uid); if (fail) { storage = null; } } catch (exception) { storage = null; } return storage; }; /** * Checks if endpoint URL is application insights internal injestion service URL. * * @param endpointUrl Endpoint URL to check. * @returns {boolean} True if if endpoint URL is application insights internal injestion service URL. */ Util.isInternalApplicationInsightsEndpoint = function (endpointUrl) { return Util._internalEndpoints.indexOf(endpointUrl.toLowerCase()) !== -1; }; /** * Check if the browser supports local storage. * * @returns {boolean} True if local storage is supported. */ Util.canUseLocalStorage = function () { if (Util._canUseLocalStorage === undefined) { Util._canUseLocalStorage = !!Util._getVerifiedStorageObject(Enums_1.StorageType.LocalStorage); } return Util._canUseLocalStorage; }; /** * Get an object from the browser's local storage * * @param {string} name - the name of the object to get from storage * @returns {string} The contents of the storage object with the given name. Null if storage is not supported. */ Util.getStorage = function (logger, name) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return null; }; /** * Set the contents of an object in the browser's local storage * * @param {string} name - the name of the object to set in storage * @param {string} data - the contents of the object to set in storage * @returns {boolean} True if the storage object could be written. */ Util.setStorage = function (logger, name, data) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Remove an object from the browser's local storage * * @param {string} name - the name of the object to remove from storage * @returns {boolean} True if the storage object could be removed. */ Util.removeStorage = function (logger, name) { var storage = Util._getLocalStorageObject(); if (storage !== null) { try { storage.removeItem(name); return true; } catch (e) { Util._canUseLocalStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Gets the sessionStorage object if available * @return {Storage} - Returns the storage object if available else returns null */ Util._getSessionStorageObject = function () { if (Util.canUseSessionStorage()) { return Util._getVerifiedStorageObject(Enums_1.StorageType.SessionStorage); } return null; }; /** * Check if the browser supports session storage. * * @returns {boolean} True if session storage is supported. */ Util.canUseSessionStorage = function () { if (Util._canUseSessionStorage === undefined) { Util._canUseSessionStorage = !!Util._getVerifiedStorageObject(Enums_1.StorageType.SessionStorage); } return Util._canUseSessionStorage; }; /** * Gets the list of session storage keys * * @returns {string[]} List of session storage keys */ Util.getSessionStorageKeys = function () { var keys = []; if (Util.canUseSessionStorage()) { for (var key in window.sessionStorage) { keys.push(key); } } return keys; }; /** * Get an object from the browser's session storage * * @param {string} name - the name of the object to get from storage * @returns {string} The contents of the storage object with the given name. Null if storage is not supported. */ Util.getSessionStorage = function (logger, name) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { return storage.getItem(name); } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return null; }; /** * Set the contents of an object in the browser's session storage * * @param {string} name - the name of the object to set in storage * @param {string} data - the contents of the object to set in storage * @returns {boolean} True if the storage object could be written. */ Util.setSessionStorage = function (logger, name, data) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { storage.setItem(name, data); return true; } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /** * Remove an object from the browser's session storage * * @param {string} name - the name of the object to remove from storage * @returns {boolean} True if the storage object could be removed. */ Util.removeSessionStorage = function (logger, name) { var storage = Util._getSessionStorageObject(); if (storage !== null) { try { storage.removeItem(name); return true; } catch (e) { Util._canUseSessionStorage = false; logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + Util.getExceptionName(e), { exception: Util.dump(e) }); } } return false; }; /* * Force the SDK not to store and read any data from cookies */ Util.disableCookies = function () { Util._canUseCookies = false; }; /* * helper method to tell if document.cookie object is available */ Util.canUseCookies = function (logger) { if (Util._canUseCookies === undefined) { Util._canUseCookies = false; try { Util._canUseCookies = Util.document.cookie !== undefined; } catch (e) { logger.throwInternal(applicationinsights_core_js_1.LoggingSeverity.WARNING, applicationinsights_core_js_1._InternalMessageId.CannotAccessCookie, "Cannot access document.cookie - " + Util.getExceptionName(e), { exception: Util.dump(e) }); } ; } return Util._canUseCookies; }; /** * helper method to set userId and sessionId cookie */ Util.setCookie = function (logger, name, value, domain) { var domainAttrib = ""; var secureAttrib = ""; if (domain) { domainAttrib = ";domain=" + domain; } if (Util.document.location && Util.document.location.protocol === "https:") { secureAttrib = ";secure"; } if (Util.canUseCookies(logger)) { Util.document.cookie = name + "=" + value + domainAttrib + ";path=/" + secureAttrib; } }; Util.stringToBoolOrDefault = function (str, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } if (str === undefined || str === null) { return defaultValue; } return str.toString().toLowerCase() === "true"; }; /** * helper method to access userId and sessionId cookie */ Util.getCookie = function (logger, name) { if (!Util.canUseCookies(logger)) { return; } var value = ""; if (name && name.length) { var cookieName = name + "="; var cookies = Util.document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; cookie = Util.trim(cookie); if (cookie && cookie.indexOf(cookieName) === 0) { value = cookie.substring(cookieName.length, cookies[i].length); break; } } } return value; }; /** * Deletes a cookie by setting it's expiration time in the past. * @param name - The name of the cookie to delete. */ Util.deleteCookie = function (logger, name) { if (Util.canUseCookies(logger)) { // Setting the expiration date in the past immediately removes the cookie Util.document.cookie = name + "=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;"; } }; /** * helper method to trim strings (IE8 does not implement String.prototype.trim) */ Util.trim = function (str) { if (typeof str !== "string") return str; return str.replace(/^\s+|\s+$/g, ""); }; /** * generate random id string */ Util.newId = function () { var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var result = ""; // tslint:disable-next-line:insecure-random var random = Math.random() * 1073741824; //5 symbols in base64, almost maxint while (random > 0) { var char = base64chars.charAt(random % 64); result += char; random = Math.floor(random / 64); } return result; }; /** * Check if an object is of type Array */ Util.isArray = function (obj) { return Object.prototype.toString.call(obj) === "[object Array]"; }; /** * Check if an object is of type Error */ Util.isError = function (obj) { return Object.prototype.toString.call(obj) === "[object Error]"; }; /** * Check if an object is of type Date */ Util.isDate = function (obj) { return Object.prototype.toString.call(obj) === "[object Date]"; }; /** * Convert a date to I.S.O. format in IE8 */ Util.toISOStringForIE8 = function (date) { if (Util.isDate(date)) { if (Date.prototype.toISOString) { return date.toISOString(); } else { var pad = function (num) { var r = String(num); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } }; /** * Gets IE version if we are running on IE, or null otherwise */ Util.getIEVersion = function (userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } var myNav = userAgentStr ? userAgentStr.toLowerCase() : navigator.userAgent.toLowerCase(); return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : null; }; /** * Convert ms to c# time span format */ Util.msToTimeSpan = function (totalms) { if (isNaN(totalms) || totalms < 0) { totalms = 0; } totalms = Math.round(totalms); var ms = "" + totalms % 1000; var sec = "" + Math.floor(totalms / 1000) % 60; var min = "" + Math.floor(totalms / (1000 * 60)) % 60; var hour = "" + Math.floor(totalms / (1000 * 60 * 60)) % 24; var days = Math.floor(totalms / (1000 * 60 * 60 * 24)); ms = ms.length === 1 ? "00" + ms : ms.length === 2 ? "0" + ms : ms; sec = sec.length < 2 ? "0" + sec : sec; min = min.length < 2 ? "0" + min : min; hour = hour.length < 2 ? "0" + hour : hour; return (days > 0 ? days + "." : "") + hour + ":" + min + ":" + sec + "." + ms; }; /** * Checks if error has no meaningful data inside. Ususally such errors are received by window.onerror when error * happens in a script from other domain (cross origin, CORS). */ Util.isCrossOriginError = function (message, url, lineNumber, columnNumber, error) { return (message === "Script error." || message === "Script error") && !error; }; /** * Returns string representation of an object suitable for diagnostics logging. */ Util.dump = function (object) { var objectTypeDump = Object.prototype.toString.call(object); var propertyValueDump = JSON.stringify(object); if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } return objectTypeDump + propertyValueDump; }; /** * Returns the name of object if it's an Error. Otherwise, returns empty string. */ Util.getExceptionName = function (object) { var objectTypeDump = Object.prototype.toString.call(object); if (objectTypeDump === "[object Error]") { return object.name; } return ""; }; /** * Adds an event handler for the specified event * @param eventName {string} - The name of the event * @param callback {any} - The callback function that needs to be executed for the given event * @return {boolean} - true if the handler was successfully added */ Util.addEventHandler = function (eventName, callback) { if (!window || typeof eventName !== 'string' || typeof callback !== 'function') { return false; } // Create verb for the event var verbEventName = 'on' + eventName; // check if addEventListener is available if (window.addEventListener) { window.addEventListener(eventName, callback, false); } else if (window["attachEvent"]) { window["attachEvent"](verbEventName, callback); } else { return false; } return true; }; /** * Tells if a browser supports a Beacon API */ Util.IsBeaconApiSupported = function () { return ('sendBeacon' in navigator && navigator.sendBeacon); }; Util.document = typeof document !== "undefined" ? document : {}; Util._canUseCookies = undefined; Util._canUseLocalStorage = undefined; Util._canUseSessionStorage = undefined; // listing only non-geo specific locations Util._internalEndpoints = [ "https://dc.services.visualstudio.com/v2/track", "https://breeze.aimon.applicationinsights.io/v2/track", "https://dc-int.services.visualstudio.com/v2/track" ]; Util.NotSpecified = "not_specified"; return Util; }()); exports.Util = Util; var UrlHelper = /** @class */ (function () { function UrlHelper() { } UrlHelper.parseUrl = function (url) { if (!UrlHelper.htmlAnchorElement) { UrlHelper.htmlAnchorElement = !!UrlHelper.document.createElement ? UrlHelper.document.createElement('a') : {}; } UrlHelper.htmlAnchorElement.href = url; return UrlHelper.htmlAnchorElement; }; UrlHelper.getAbsoluteUrl = function (url) { var result; var a = UrlHelper.parseUrl(url); if (a) { result = a.href; } return result; }; UrlHelper.getPathName = function (url) { var result; var a = UrlHelper.parseUrl(url); if (a) { result = a.pathname; } return result; }; UrlHelper.getCompleteUrl = function (method, absoluteUrl) { if (method) { return method.toUpperCase() + " " + absoluteUrl; } else { return absoluteUrl; } }; UrlHelper.document = typeof document !== "undefined" ? document : {}; return UrlHelper; }()); exports.UrlHelper = UrlHelper; var CorrelationIdHelper = /** @class */ (function () { function CorrelationIdHelper() { } /** * Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers */ CorrelationIdHelper.canIncludeCorrelationHeader = function (config, requestUrl, currentHost) { if (config && config.disableCorrelationHeaders) { return false; } if (!requestUrl) { return false; } var requestHost = UrlHelper.parseUrl(requestUrl).host.toLowerCase(); if ((!config || !config.enableCorsCorrelation) && requestHost !== currentHost) { return false; } var excludedDomains = config && config.correlationHeaderExcludedDomains; if (!excludedDomains || excludedDomains.length == 0) { return true; } for (var i = 0; i < excludedDomains.length; i++) { var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\./g, "\.").replace(/\*/g, ".*")); if (regex.test(requestHost)) { return false; } } return true; }; /** * Combines target appId and target role name from response header. */ CorrelationIdHelper.getCorrelationContext = function (responseHeader) { if (responseHeader) { var correlationId = CorrelationIdHelper.getCorrelationContextValue(responseHeader, RequestResponseHeaders_1.RequestHeaders.requestContextTargetKey); if (correlationId && correlationId !== CorrelationIdHelper.correlationIdPrefix) { return correlationId; } } }; /** * Gets key from correlation response header */ CorrelationIdHelper.getCorrelationContextValue = function (responseHeader, key) { if (responseHeader) { var keyValues = responseHeader.split(","); for (var i = 0; i < keyValues.length; ++i) { var keyValue = keyValues[i].split("="); if (keyValue.length == 2 && keyValue[0] == key) { return keyValue[1]; } } } }; CorrelationIdHelper.correlationIdPrefix = "cid-v1:"; return CorrelationIdHelper; }()); exports.CorrelationIdHelper = CorrelationIdHelper; var AjaxHelper = /** @class */ (function () { function AjaxHelper() { } AjaxHelper.ParseDependencyPath = function (logger, absoluteUrl, method, pathName) { var target, name; if (absoluteUrl && absoluteUrl.length > 0) { var parsedUrl = UrlHelper.parseUrl(absoluteUrl); target = parsedUrl.host; if (parsedUrl.pathname != null) { var pathName = (parsedUrl.pathname.length === 0) ? "/" : parsedUrl.pathname; if (pathName.charAt(0) !== '/') { pathName = "/" + pathName; } name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, method ? method + " " + pathName : pathName); } else { name = DataSanitizer_1.DataSanitizer.sanitizeString(logger, absoluteUrl); } } else { target = pathName; name = pathName; } return { target: target, name: name }; }; return AjaxHelper; }()); exports.AjaxHelper = AjaxHelper; /** * A utility class that helps getting time related parameters */ var DateTimeUtils = /** @class */ (function () { function DateTimeUtils() { } /** * Get the number of milliseconds since 1970/01/01 in local timezone */ DateTimeUtils.Now = (window.performance && window.performance.now && window.performance.timing) ? function () { return window.performance.now() + window.performance.timing.navigationStart; } : function () { return new Date().getTime(); }; /** * Gets duration between two timestamps */ DateTimeUtils.GetDuration = function (start, end) { var result = null; if (start !== 0 && end !== 0 && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(start) && !applicationinsights_core_js_1.CoreUtils.isNullOrUndefined(end)) { result = end - start; } return result; }; return DateTimeUtils; }()); exports.DateTimeUtils = DateTimeUtils; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=Util.js.map /***/ }), /***/ "./node_modules/applicationinsights-common/bundle/applicationinsights-common.js": /*!**************************************************************************************!*\ !*** ./node_modules/applicationinsights-common/bundle/applicationinsights-common.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./Util */ "./node_modules/applicationinsights-common/bundle/Util.js"), __webpack_require__(/*! ./Enums */ "./node_modules/applicationinsights-common/bundle/Enums.js"), __webpack_require__(/*! ./RequestResponseHeaders */ "./node_modules/applicationinsights-common/bundle/RequestResponseHeaders.js"), __webpack_require__(/*! ./Constants */ "./node_modules/applicationinsights-common/bundle/Constants.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/Data */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Data.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/Base */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/Base.js"), __webpack_require__(/*! ./Telemetry/Common/Envelope */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Envelope.js"), __webpack_require__(/*! ./Telemetry/Event */ "./node_modules/applicationinsights-common/bundle/Telemetry/Event.js"), __webpack_require__(/*! ./Telemetry/Exception */ "./node_modules/applicationinsights-common/bundle/Telemetry/Exception.js"), __webpack_require__(/*! ./Telemetry/Metric */ "./node_modules/applicationinsights-common/bundle/Telemetry/Metric.js"), __webpack_require__(/*! ./Telemetry/PageView */ "./node_modules/applicationinsights-common/bundle/Telemetry/PageView.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/PageViewData */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/PageViewData.js"), __webpack_require__(/*! ./Telemetry/RemoteDependencyData */ "./node_modules/applicationinsights-common/bundle/Telemetry/RemoteDependencyData.js"), __webpack_require__(/*! ./Telemetry/Trace */ "./node_modules/applicationinsights-common/bundle/Telemetry/Trace.js"), __webpack_require__(/*! ./Telemetry/PageViewPerformance */ "./node_modules/applicationinsights-common/bundle/Telemetry/PageViewPerformance.js"), __webpack_require__(/*! ./Telemetry/Common/Data */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/Data.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/SeverityLevel */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/SeverityLevel.js"), __webpack_require__(/*! ./Interfaces/Contracts/Generated/ContextTagKeys */ "./node_modules/applicationinsights-common/bundle/Interfaces/Contracts/Generated/ContextTagKeys.js"), __webpack_require__(/*! ./Telemetry/Common/DataSanitizer */ "./node_modules/applicationinsights-common/bundle/Telemetry/Common/DataSanitizer.js"), __webpack_require__(/*! ./TelemetryItemCreator */ "./node_modules/applicationinsights-common/bundle/TelemetryItemCreator.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, Util_1, Enums_1, RequestResponseHeaders_1, Constants_1, Data_1, Base_1, Envelope_1, Event_1, Exception_1, Metric_1, PageView_1, PageViewData_1, RemoteDependencyData_1, Trace_1, PageViewPerformance_1, Data_2, SeverityLevel_1, ContextTagKeys_1, DataSanitizer_1, TelemetryItemCreator_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Util = Util_1.Util; exports.CorrelationIdHelper = Util_1.CorrelationIdHelper; exports.UrlHelper = Util_1.UrlHelper; exports.DateTimeUtils = Util_1.DateTimeUtils; exports.FieldType = Enums_1.FieldType; exports.RequestHeaders = RequestResponseHeaders_1.RequestHeaders; exports.DisabledPropertyName = Constants_1.DisabledPropertyName; exports.AIData = Data_1.Data; exports.AIBase = Base_1.Base; exports.Envelope = Envelope_1.Envelope; exports.Event = Event_1.Event; exports.Exception = Exception_1.Exception; exports.Metric = Metric_1.Metric; exports.PageView = PageView_1.PageView; exports.PageViewData = PageViewData_1.PageViewData; exports.RemoteDependencyData = RemoteDependencyData_1.RemoteDependencyData; exports.Trace = Trace_1.Trace; exports.PageViewPerformance = PageViewPerformance_1.PageViewPerformance; exports.Data = Data_2.Data; exports.SeverityLevel = SeverityLevel_1.SeverityLevel; exports.ContextTagKeys = ContextTagKeys_1.ContextTagKeys; exports.DataSanitizer = DataSanitizer_1.DataSanitizer; exports.TelemetryItemCreator = TelemetryItemCreator_1.TelemetryItemCreator; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-common.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event. */ exports.EventsDiscardedReason = { /** * Unknown. */ Unknown: 0, /** * Status set to non-retryable. */ NonRetryableStatus: 1, /** * The event is invalid. */ InvalidEvent: 2, /** * The size of the event is too large. */ SizeLimitExceeded: 3, /** * The server is not accepting events from this instrumentation key. */ KillSwitch: 4, /** * The event queue is full. */ QueueFull: 5, }; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=EventsDiscardedReason.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js": /*!*********************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js ***! \*********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var LoggingSeverity; (function (LoggingSeverity) { /** * Error will be sent as internal telemetry */ LoggingSeverity[LoggingSeverity["CRITICAL"] = 1] = "CRITICAL"; /** * Error will NOT be sent as internal telemetry, and will only be shown in browser console */ LoggingSeverity[LoggingSeverity["WARNING"] = 2] = "WARNING"; })(LoggingSeverity = exports.LoggingSeverity || (exports.LoggingSeverity = {})); /** * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered */ ; exports._InternalMessageId = { // Non user actionable BrowserDoesNotSupportLocalStorage: 0, BrowserCannotReadLocalStorage: 1, BrowserCannotReadSessionStorage: 2, BrowserCannotWriteLocalStorage: 3, BrowserCannotWriteSessionStorage: 4, BrowserFailedRemovalFromLocalStorage: 5, BrowserFailedRemovalFromSessionStorage: 6, CannotSendEmptyTelemetry: 7, ClientPerformanceMathError: 8, ErrorParsingAISessionCookie: 9, ErrorPVCalc: 10, ExceptionWhileLoggingError: 11, FailedAddingTelemetryToBuffer: 12, FailedMonitorAjaxAbort: 13, FailedMonitorAjaxDur: 14, FailedMonitorAjaxOpen: 15, FailedMonitorAjaxRSC: 16, FailedMonitorAjaxSend: 17, FailedMonitorAjaxGetCorrelationHeader: 18, FailedToAddHandlerForOnBeforeUnload: 19, FailedToSendQueuedTelemetry: 20, FailedToReportDataLoss: 21, FlushFailed: 22, MessageLimitPerPVExceeded: 23, MissingRequiredFieldSpecification: 24, NavigationTimingNotSupported: 25, OnError: 26, SessionRenewalDateIsZero: 27, SenderNotInitialized: 28, StartTrackEventFailed: 29, StopTrackEventFailed: 30, StartTrackFailed: 31, StopTrackFailed: 32, TelemetrySampledAndNotSent: 33, TrackEventFailed: 34, TrackExceptionFailed: 35, TrackMetricFailed: 36, TrackPVFailed: 37, TrackPVFailedCalc: 38, TrackTraceFailed: 39, TransmissionFailed: 40, FailedToSetStorageBuffer: 41, FailedToRestoreStorageBuffer: 42, InvalidBackendResponse: 43, FailedToFixDepricatedValues: 44, InvalidDurationValue: 45, TelemetryEnvelopeInvalid: 46, CreateEnvelopeError: 47, // User actionable CannotSerializeObject: 48, CannotSerializeObjectNonSerializable: 49, CircularReferenceDetected: 50, ClearAuthContextFailed: 51, ExceptionTruncated: 52, IllegalCharsInName: 53, ItemNotInArray: 54, MaxAjaxPerPVExceeded: 55, MessageTruncated: 56, NameTooLong: 57, SampleRateOutOfRange: 58, SetAuthContextFailed: 59, SetAuthContextFailedAccountName: 60, StringValueTooLong: 61, StartCalledMoreThanOnce: 62, StopCalledWithoutStart: 63, TelemetryInitializerFailed: 64, TrackArgumentsNotSpecified: 65, UrlTooLong: 66, SessionStorageBufferFull: 67, CannotAccessCookie: 68, IdTooLong: 69, }; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=LoggingEnums.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js": /*!******************************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js ***! \******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MinChannelPriorty = 100; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=IChannelControls.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js": /*!******************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../JavaScriptSDK.Enums/EventsDiscardedReason */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js"), __webpack_require__(/*! ./CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js"), __webpack_require__(/*! ./NotificationManager */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js"), __webpack_require__(/*! ./DiagnosticLogger */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, EventsDiscardedReason_1, CoreUtils_1, NotificationManager_1, DiagnosticLogger_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); "use strict"; var AppInsightsCore = /** @class */ (function () { function AppInsightsCore() { this._isInitialized = false; this._extensions = new Array(); this._channelController = new ChannelController(); } AppInsightsCore.prototype.initialize = function (config, extensions) { var _this = this; // Make sure core is only initialized once if (this._isInitialized) { throw Error("Core should not be initialized more than once"); } if (!config || CoreUtils_1.CoreUtils.isNullOrUndefined(config.instrumentationKey)) { throw Error("Please provide instrumentation key"); } this.config = config; this._notificationManager = new NotificationManager_1.NotificationManager(); this.config.extensions = CoreUtils_1.CoreUtils.isNullOrUndefined(this.config.extensions) ? [] : this.config.extensions; // add notification to the extensions in the config so other plugins can access it this.config.extensionConfig = CoreUtils_1.CoreUtils.isNullOrUndefined(this.config.extensionConfig) ? {} : this.config.extensionConfig; this.config.extensionConfig.NotificationManager = this._notificationManager; this.logger = new DiagnosticLogger_1.DiagnosticLogger(config); // Initial validation extensions.forEach(function (extension) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(extension.initialize)) { throw Error(validationError); } }); if (this.config.extensions.length > 0) { var isValid_1 = true; this.config.extensions.forEach(function (item) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(item)) { isValid_1 = false; } }); if (!isValid_1) { throw Error(validationError); } } // Initial validation complete // Concat all available extensions before sorting by priority (_a = this._extensions).push.apply(_a, [this._channelController].concat(extensions, this.config.extensions)); this._extensions = this._extensions.sort(function (a, b) { var extA = a; var extB = b; var typeExtA = typeof extA.processTelemetry; var typeExtB = typeof extB.processTelemetry; if (typeExtA === 'function' && typeExtB === 'function') { return extA.priority - extB.priority; } if (typeExtA === 'function' && typeExtB !== 'function') { // keep non telemetryplugin specific extensions at start return 1; } if (typeExtA !== 'function' && typeExtB === 'function') { return -1; } }); // sort complete // Check if any two extensions have the same priority, then warn to console var priority = {}; this._extensions.forEach(function (ext) { var t = ext; if (t && t.priority) { if (!CoreUtils_1.CoreUtils.isNullOrUndefined(priority[t.priority])) { _this.logger.warnToConsole("Two extensions have same priority" + priority[t.priority] + ", " + t.identifier); } else { priority[t.priority] = t.identifier; // set a value } } }); var c = -1; // Set next plugin for all until channel controller for (var idx = 0; idx < this._extensions.length - 1; idx++) { var curr = (this._extensions[idx]); if (curr && typeof curr.processTelemetry !== 'function') { // these are initialized only, allowing an entry point for extensions to be initialized when SDK initializes continue; } if (curr.priority === ChannelControllerPriority) { c = idx + 1; break; // channel controller will set remaining pipeline } this._extensions[idx].setNextPlugin(this._extensions[idx + 1]); // set next plugin } // initialize channel controller first, this will initialize all channel plugins this._channelController.initialize(this.config, this, this._extensions); // initialize remaining regular plugins this._extensions.forEach(function (ext) { var e = ext; if (e && e.priority < ChannelControllerPriority) { ext.initialize(_this.config, _this, _this._extensions); // initialize } }); // Remove sender channels from main list if (c < this._extensions.length) { this._extensions.splice(c); } if (this.getTransmissionControls().length === 0) { throw new Error("No channels available"); } this._isInitialized = true; var _a; }; AppInsightsCore.prototype.getTransmissionControls = function () { return this._channelController.ChannelControls; }; AppInsightsCore.prototype.track = function (telemetryItem) { if (telemetryItem === null) { this._notifiyInvalidEvent(telemetryItem); // throw error throw Error("Invalid telemetry item"); } if (telemetryItem.baseData && !telemetryItem.baseType) { this._notifiyInvalidEvent(telemetryItem); throw Error("Provide data.baseType for data.baseData"); } if (!telemetryItem.baseType) { // Hard coded from Common::Event.ts::Event.dataType telemetryItem.baseType = "EventData"; } if (!telemetryItem.instrumentationKey) { // setup default ikey if not passed in telemetryItem.instrumentationKey = this.config.instrumentationKey; } if (!telemetryItem.timestamp) { // add default timestamp if not passed in telemetryItem.timestamp = new Date(); } // do basic validation before sending it through the pipeline this._validateTelmetryItem(telemetryItem); // invoke any common telemetry processors before sending through pipeline var i = 0; while (i < this._extensions.length) { if (this._extensions[i].processTelemetry) { this._extensions[i].processTelemetry(telemetryItem); // pass on to first extension that can support processing break; } i++; } }; /** * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be * called. * @param {INotificationListener} listener - An INotificationListener object. */ AppInsightsCore.prototype.addNotificationListener = function (listener) { this._notificationManager.addNotificationListener(listener); }; /** * Removes all instances of the listener. * @param {INotificationListener} listener - INotificationListener to remove. */ AppInsightsCore.prototype.removeNotificationListener = function (listener) { this._notificationManager.removeNotificationListener(listener); }; /** * Periodically check logger.queue for */ AppInsightsCore.prototype.pollInternalLogs = function () { var _this = this; if (!(this.config.diagnosticLoggingInterval > 0)) { throw Error("config.diagnosticLoggingInterval must be a positive integer"); } return setInterval(function () { var queue = _this.logger.queue; queue.forEach(function (logMessage) { var item = { name: "InternalMessageId: " + logMessage.messageId, instrumentationKey: _this.config.instrumentationKey, timestamp: new Date(), baseType: DiagnosticLogger_1._InternalLogMessage.dataType, baseData: { message: logMessage.message } }; _this.track(item); }); queue.length = 0; }, this.config.diagnosticLoggingInterval); }; AppInsightsCore.prototype._validateTelmetryItem = function (telemetryItem) { if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.name)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry name required"); } if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.timestamp)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry timestamp required"); } if (CoreUtils_1.CoreUtils.isNullOrUndefined(telemetryItem.instrumentationKey)) { this._notifiyInvalidEvent(telemetryItem); throw Error("telemetry instrumentationKey required"); } }; AppInsightsCore.prototype._notifiyInvalidEvent = function (telemetryItem) { this._notificationManager.eventsDiscarded([telemetryItem], EventsDiscardedReason_1.EventsDiscardedReason.InvalidEvent); }; return AppInsightsCore; }()); exports.AppInsightsCore = AppInsightsCore; var ChannelController = /** @class */ (function () { function ChannelController() { this.identifier = "ChannelControllerPlugin"; this.priority = ChannelControllerPriority; // in reserved range 100 to 200 } ChannelController.prototype.processTelemetry = function (item) { this.channelQueue.forEach(function (queues) { // pass on to first item in queue if (queues.length > 0) { queues[0].processTelemetry(item); } }); }; Object.defineProperty(ChannelController.prototype, "ChannelControls", { get: function () { return this.channelQueue; }, enumerable: true, configurable: true }); ChannelController.prototype.initialize = function (config, core, extensions) { var _this = this; this.channelQueue = new Array(); if (config.channels) { config.channels.forEach(function (queue) { if (queue && queue.length > 0) { queue = queue.sort(function (a, b) { return a.priority - b.priority; }); // Initialize each plugin queue.forEach(function (queueItem) { return queueItem.initialize(config, core, extensions); }); for (var i = 1; i < queue.length; i++) { queue[i - 1].setNextPlugin(queue[i]); // setup processing chain } _this.channelQueue.push(queue); } }); } else { var arr = new Array(); for (var i = 0; i < extensions.length; i++) { var plugin = extensions[i]; if (plugin.priority > ChannelControllerPriority) { arr.push(plugin); } } if (arr.length > 0) { // sort if not sorted arr = arr.sort(function (a, b) { return a.priority - b.priority; }); // Initialize each plugin arr.forEach(function (queueItem) { return queueItem.initialize(config, core, extensions); }); // setup next plugin for (var i = 1; i < arr.length; i++) { arr[i - 1].setNextPlugin(arr[i]); } this.channelQueue.push(arr); } } }; return ChannelController; }()); var validationError = "Extensions must provide callback to initialize"; var ChannelControllerPriority = 200; var duplicatePriority = "One or more extensions are set at same priority"; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=AppInsightsCore.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js": /*!************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var CoreUtils = /** @class */ (function () { function CoreUtils() { } CoreUtils.isNullOrUndefined = function (input) { return input === null || input === undefined; }; /** * Creates a new GUID. * @return {string} A GUID. */ CoreUtils.newGuid = function () { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, function (c) { var r = (Math.random() * 16 | 0), v = (c === 'x' ? r : r & 0x3 | 0x8); return v.toString(16); }); }; return CoreUtils; }()); exports.CoreUtils = CoreUtils; var GuidRegex = /[xy]/g; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=CoreUtils.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js": /*!*******************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js ***! \*******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ../JavaScriptSDK.Enums/LoggingEnums */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js"), __webpack_require__(/*! ./CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, LoggingEnums_1, CoreUtils_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } this.messageId = msgId; this.message = (isUserAct ? _InternalLogMessage.AiUserActionablePrefix : _InternalLogMessage.AiNonUserActionablePrefix) + msgId; var diagnosticText = (msg ? " message:" + _InternalLogMessage.sanitizeDiagnosticText(msg) : "") + (properties ? " props:" + _InternalLogMessage.sanitizeDiagnosticText(JSON.stringify(properties)) : ""); this.message += diagnosticText; } _InternalLogMessage.sanitizeDiagnosticText = function (text) { return "\"" + text.replace(/\"/g, "") + "\""; }; _InternalLogMessage.dataType = "MessageData"; /** * For user non actionable traces use AI Internal prefix. */ _InternalLogMessage.AiNonUserActionablePrefix = "AI (Internal): "; /** * Prefix of the traces in portal. */ _InternalLogMessage.AiUserActionablePrefix = "AI: "; return _InternalLogMessage; }()); exports._InternalLogMessage = _InternalLogMessage; var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { /** * Session storage key for the prefix for the key indicating message type already logged */ this.AIInternalMessagePrefix = "AITR_"; /** * When this is true the SDK will throw exceptions to aid in debugging. */ this.enableDebugExceptions = function () { return false; }; /** * 0: OFF * 1: CRITICAL (default) * 2: >= WARNING */ this.consoleLoggingLevel = function () { return 1; }; /** * 0: OFF (default) * 1: CRITICAL * 2: >= WARNING */ this.telemetryLoggingLevel = function () { return 0; }; /** * The maximum number of internal messages allowed to be sent per page view */ this.maxInternalMessageLimit = function () { return 25; }; /** * The internal logging queue */ this.queue = []; /** * Count of internal messages sent */ this._messageCount = 0; /** * Holds information about what message types were already logged to console or sent to server. */ this._messageLogged = {}; if (CoreUtils_1.CoreUtils.isNullOrUndefined(config)) { // TODO: Use default config // config = AppInsightsCore.defaultConfig; // For now, use defaults specified in DiagnosticLogger members; return; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.loggingLevelConsole)) { this.consoleLoggingLevel = function () { return config.loggingLevelConsole; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.loggingLevelTelemetry)) { this.telemetryLoggingLevel = function () { return config.loggingLevelTelemetry; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.maxMessageLimit)) { this.maxInternalMessageLimit = function () { return config.maxMessageLimit; }; } if (!CoreUtils_1.CoreUtils.isNullOrUndefined(config.enableDebugExceptions)) { this.enableDebugExceptions = function () { return config.enableDebugExceptions; }; } } /** * This method will throw exceptions in debug mode or attempt to log the error as a console warning. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The log message. */ DiagnosticLogger.prototype.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (this.enableDebugExceptions()) { throw message; } else { if (typeof (message) !== "undefined" && !!message) { if (typeof (message.message) !== "undefined") { if (isUserAct) { // check if this message type was already logged to console for this page view and if so, don't log it again var messageKey = +message.messageId; if (!this._messageLogged[messageKey] || this.consoleLoggingLevel() >= LoggingEnums_1.LoggingSeverity.WARNING) { this.warnToConsole(message.message); this._messageLogged[messageKey] = true; } } else { // don't log internal AI traces in the console, unless the verbose logging is enabled if (this.consoleLoggingLevel() >= LoggingEnums_1.LoggingSeverity.WARNING) { this.warnToConsole(message.message); } } this.logInternalMessage(severity, message); } } } }; /** * This will write a warning to the console if possible * @param message {string} - The warning message */ DiagnosticLogger.prototype.warnToConsole = function (message) { if (typeof console !== "undefined" && !!console) { if (typeof console.warn === "function") { console.warn(message); } else if (typeof console.log === "function") { console.log(message); } } }; /** * Resets the internal message count */ DiagnosticLogger.prototype.resetInternalMessageCount = function () { this._messageCount = 0; this._messageLogged = {}; }; /** * Logs a message to the internal queue. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The message to log. */ DiagnosticLogger.prototype.logInternalMessage = function (severity, message) { if (this._areInternalMessagesThrottled()) { return; } // check if this message type was already logged for this session and if so, don't log it again var logMessage = true; var messageKey = this.AIInternalMessagePrefix + message.messageId; // if the session storage is not available, limit to only one message type per page view if (this._messageLogged[messageKey]) { logMessage = false; } else { this._messageLogged[messageKey] = true; } if (logMessage) { // Push the event in the internal queue if (severity <= this.telemetryLoggingLevel()) { this.queue.push(message); this._messageCount++; } // When throttle limit reached, send a special event if (this._messageCount == this.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(LoggingEnums_1._InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false); this.queue.push(throttleMessage); this.warnToConsole(throttleLimitMessage); } } }; /** * Indicates whether the internal events are throttled */ DiagnosticLogger.prototype._areInternalMessagesThrottled = function () { return this._messageCount >= this.maxInternalMessageLimit(); }; return DiagnosticLogger; }()); exports.DiagnosticLogger = DiagnosticLogger; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=DiagnosticLogger.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js": /*!**********************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js ***! \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Class to manage sending notifications to all the listeners. */ var NotificationManager = /** @class */ (function () { function NotificationManager() { this.listeners = []; } /** * Adds a notification listener. * @param {INotificationListener} listener - The notification listener to be added. */ NotificationManager.prototype.addNotificationListener = function (listener) { this.listeners.push(listener); }; /** * Removes all instances of the listener. * @param {INotificationListener} listener - AWTNotificationListener to remove. */ NotificationManager.prototype.removeNotificationListener = function (listener) { var index = this.listeners.indexOf(listener); while (index > -1) { this.listeners.splice(index, 1); index = this.listeners.indexOf(listener); } }; /** * Notification for events sent. * @param {ITelemetryItem[]} events - The array of events that have been sent. */ NotificationManager.prototype.eventsSent = function (events) { var _this = this; var _loop_1 = function (i) { if (this_1.listeners[i].eventsSent) { setTimeout(function () { return _this.listeners[i].eventsSent(events); }, 0); } }; var this_1 = this; for (var i = 0; i < this.listeners.length; ++i) { _loop_1(i); } }; /** * Notification for events being discarded. * @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK. * @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason * constant should be used to check the different values. */ NotificationManager.prototype.eventsDiscarded = function (events, reason) { var _this = this; var _loop_2 = function (i) { if (this_2.listeners[i].eventsDiscarded) { setTimeout(function () { return _this.listeners[i].eventsDiscarded(events, reason); }, 0); } }; var this_2 = this; for (var i = 0; i < this.listeners.length; ++i) { _loop_2(i); } }; return NotificationManager; }()); exports.NotificationManager = NotificationManager; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=NotificationManager.js.map /***/ }), /***/ "./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js": /*!****************************************************************************************!*\ !*** ./node_modules/applicationinsights-core-js/bundle/applicationinsights-core-js.js ***! \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports, __webpack_require__(/*! ./JavaScriptSDK.Interfaces/IChannelControls */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Interfaces/IChannelControls.js"), __webpack_require__(/*! ./JavaScriptSDK.Enums/EventsDiscardedReason */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/EventsDiscardedReason.js"), __webpack_require__(/*! ./JavaScriptSDK/AppInsightsCore */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/AppInsightsCore.js"), __webpack_require__(/*! ./JavaScriptSDK/CoreUtils */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/CoreUtils.js"), __webpack_require__(/*! ./JavaScriptSDK/NotificationManager */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/NotificationManager.js"), __webpack_require__(/*! ./JavaScriptSDK/DiagnosticLogger */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK/DiagnosticLogger.js"), __webpack_require__(/*! ./JavaScriptSDK.Enums/LoggingEnums */ "./node_modules/applicationinsights-core-js/bundle/JavaScriptSDK.Enums/LoggingEnums.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (require, exports, IChannelControls_1, EventsDiscardedReason_1, AppInsightsCore_1, CoreUtils_1, NotificationManager_1, DiagnosticLogger_1, LoggingEnums_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MinChannelPriorty = IChannelControls_1.MinChannelPriorty; exports.EventsDiscardedReason = EventsDiscardedReason_1.EventsDiscardedReason; exports.AppInsightsCore = AppInsightsCore_1.AppInsightsCore; exports.CoreUtils = CoreUtils_1.CoreUtils; exports.NotificationManager = NotificationManager_1.NotificationManager; exports.DiagnosticLogger = DiagnosticLogger_1.DiagnosticLogger; exports._InternalLogMessage = DiagnosticLogger_1._InternalLogMessage; exports._InternalMessageId = LoggingEnums_1._InternalMessageId; exports.LoggingSeverity = LoggingEnums_1.LoggingSeverity; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); //# sourceMappingURL=applicationinsights-core-js.js.map /***/ }), /***/ 0: /*!*******************************!*\ !*** multi ./bundle/index.js ***! \*******************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(/*! ./bundle/index.js */"./bundle/index.js"); /***/ }) /******/ }); }); //# sourceMappingURL=aisdklite.0.0.3.js.map ================================================ FILE: AISKULight/package.json ================================================ { "name": "@microsoft/applicationinsights-web-basic", "version": "3.4.1", "description": "Microsoft Application Insights JavaScript SDK - Web Basic", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "author": "Microsoft Application Insights Team", "main": "dist/es5/applicationinsights-web-basic.js", "module": "dist-es5/index.js", "types": "types/applicationinsights-web-basic.d.ts", "sideEffects": false, "scripts": { "clean": "git clean -xdf", "build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen", "build:esm": "grunt aiskulite", "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs", "rebuild": "npm run build", "test": "grunt aiskuliteunittests", "mintest": "grunt aiskulite-mintests", "lint": "tslint -p tsconfig.json", "dtsgen": "api-extractor run --local && node ../scripts/dtsgen.js 'Microsoft.ApplicationInsights'", "sri": "node ../tools/subResourceIntegrity/generateIntegrityFile.js", "ai-min": "grunt aiskulite-min", "ai-restore": "grunt aiskulite-restore", "npm-pack": "npm pack", "api-docs": "typedoc" }, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/AISKULight", "directory": "AISKULight" }, "devDependencies": { "@microsoft/ai-test-framework": "0.0.1", "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es5": "1.0.2", "@microsoft/api-extractor": "^7.40.0", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "@nevware21/grunt-ts-plugin": "^0.5.2", "@nevware21/grunt-eslint-ts": "^0.5.2", "globby": "^11.0.0", "magic-string": "^0.25.7", "pako": "^2.0.3", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "rollup": "^3.20.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "^4.9.3", "typedoc": "^0.26.6", "tslib": "^2.0.0", "sinon": "^7.3.1" }, "peerDependencies": { "tslib": ">= 1.0.0" }, "dependencies": { "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/applicationinsights-channel-js": "3.4.1", "@microsoft/applicationinsights-core-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x", "@nevware21/ts-async": ">= 0.5.5 < 2.x" }, "license": "MIT" } ================================================ FILE: AISKULight/rollup.config.js ================================================ import { createConfig } from "../rollup.base.config"; import { updateDistEsmFiles } from "../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const browserEntryPointName = "index"; const browserOutputName = "aib"; const entryPointName = "index"; const outputName = "applicationinsights-web-basic"; const banner = [ "/*!", ` * Application Insights JavaScript Web SDK - Basic, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the MIT License.": "" }; updateDistEsmFiles(replaceValues, banner, true, true, "dist-es5"); export default createConfig(banner, { namespace: "Microsoft.ApplicationInsights", version: version, node: { entryPoint: entryPointName, outputName: outputName }, browser: { entryPoint: browserEntryPointName, outputName: browserOutputName } }, [ "index" ]); ================================================ FILE: AISKULight/src/index.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import dynamicProto from "@microsoft/dynamicproto-js"; import { Sender } from "@microsoft/applicationinsights-channel-js"; import { AppInsightsCore, DEFAULT_BREEZE_PATH, FeatureOptInMode, IConfig, IConfigDefaults, IConfiguration, IDistributedTraceContext, IDynamicConfigHandler, ILoadedPlugin, IPlugin, ITelemetryInitializerHandler, ITelemetryItem, ITelemetryPlugin, ITelemetryUnloadState, IUnloadHook, UnloadHandler, WatcherFunction, cfgDfValidate, createDynamicConfig, onConfigChange, parseConnectionString, proxyFunctions } from "@microsoft/applicationinsights-core-js"; import { IPromise, createSyncPromise, doAwaitResponse } from "@nevware21/ts-async"; import { isNullOrUndefined, isPromiseLike, isString, objDefine, throwError } from "@nevware21/ts-utils"; const UNDEFINED_VALUE: undefined = undefined; const defaultConfigValues: IConfigDefaults = { diagnosticLogInterval: cfgDfValidate(_chkDiagLevel, 10000), connectionString: UNDEFINED_VALUE, endpointUrl: UNDEFINED_VALUE, instrumentationKey: UNDEFINED_VALUE, featureOptIn:{ ["zipPayload"]: {mode: FeatureOptInMode.none} }, extensionConfig: {} }; function _chkDiagLevel(value: number) { // Make sure we have a value > 0 return value && value > 0; } /** * @export */ export class ApplicationInsights { public readonly config: IConfiguration & IConfig; /** * Creates an instance of ApplicationInsights. * @param config - The configuration to use for this ApplicationInsights instance */ constructor(config: IConfiguration & IConfig) { let core = new AppInsightsCore(); let _config: IConfiguration & IConfig; // initialize the queue and config in case they are undefined if ( isNullOrUndefined(config) || (isNullOrUndefined(config.instrumentationKey) && isNullOrUndefined(config.connectionString)) ) { throwError("Invalid input configuration"); } dynamicProto(ApplicationInsights, this, (_self) => { // Define _self.config objDefine(_self, "config", { g: () => _config }); _initialize(); _self.initialize = _initialize; _self.track = _track; proxyFunctions(_self, core, [ "flush", "pollInternalLogs", "stopPollingInternalLogs", "unload", "getPlugin", "addPlugin", "evtNamespace", "addUnloadCb", "onCfgChange", "getTraceCtx", "updateCfg", "addTelemetryInitializer" ]); function _initialize(): void { let cfgHandler: IDynamicConfigHandler = createDynamicConfig(config || ({} as any), defaultConfigValues); _config = cfgHandler.cfg; core.addUnloadHook(onConfigChange(cfgHandler, () => { let configCs = _config.connectionString; if (isPromiseLike(configCs)) { let ikeyPromise = createSyncPromise((resolve, reject) => { doAwaitResponse(configCs, (res) => { let curCs = res.value; let ikey = _config.instrumentationKey; if (!res.rejected && curCs) { // replace cs with resolved values in case of circular promises _config.connectionString = curCs; let resolvedCs = parseConnectionString(curCs); ikey = resolvedCs.instrumentationkey || ikey; } resolve(ikey); }); }); let urlPromise = createSyncPromise((resolve, reject) => { doAwaitResponse(configCs, (res) => { let curCs = res.value; let url = _config.endpointUrl; if (!res.rejected && curCs) { let resolvedCs = parseConnectionString(curCs); let ingest = resolvedCs.ingestionendpoint; url = ingest? ingest + DEFAULT_BREEZE_PATH : url; } resolve(url); }); }); _config.instrumentationKey = ikeyPromise; _config.endpointUrl = _config.userOverrideEndpointUrl || urlPromise; } if (isString(configCs)) { const cs = parseConnectionString(configCs); const ingest = cs.ingestionendpoint; _config.endpointUrl = _config.userOverrideEndpointUrl ? _config.userOverrideEndpointUrl : (ingest + DEFAULT_BREEZE_PATH); // only add /v2/track when from connectionstring _config.instrumentationKey = cs.instrumentationkey || _config.instrumentationKey; } // userOverrideEndpointUrl have the highest priority _config.endpointUrl = _config.userOverrideEndpointUrl ? _config.userOverrideEndpointUrl : _config.endpointUrl; })); // initialize core core.initialize(_config, [new Sender()]); } }); function _track(item: ITelemetryItem) { if (item) { // to pass sender.processTelemetry() item.baseData = item.baseData || {}; item.baseType = item.baseType || "EventData"; } core.track(item); } } /** * Initialize this instance of ApplicationInsights * */ public initialize(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Send a manually constructed custom event * @param item - The custom event to send */ public track(item: ITelemetryItem) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Immediately send all batched telemetry * @param isAsync - Should the flush be performed asynchronously */ public flush(isAsync: boolean = true) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public pollInternalLogs(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public stopPollingInternalLogs(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered * to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous * unload call return `true` stating that all plugins reported that they also unloaded, the recommended * approach is to create a new instance and initialize that instance. * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable * to successfully remove any global references or they may just be completing the unload process asynchronously. * @param isAsync - Can the unload be performed asynchronously (default) * @param unloadComplete - An optional callback that will be called once the unload has completed * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the * unload. Defaults to 5 seconds. * @returns Nothing or if occurring asynchronously a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * which will be resolved once the unload is complete, the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * will only be returned when no callback is provided and isAsync is true */ public unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void | IPromise { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Find and return the (first) plugin with the specified identifier if present * @param pluginIdentifier - The identifier of the plugin to search for */ public getPlugin(pluginIdentifier: string): ILoadedPlugin { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Add a new plugin to the installation * @param plugin - The new plugin to add * @param replaceExisting - should any existing plugin be replaced * @param doAsync - Should the add be performed asynchronously */ public addPlugin(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Returns the unique event namespace that should be used */ public evtNamespace(): string { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Add an unload handler that will be called when the SDK is being unloaded * @param handler - the handler */ public addUnloadCb(handler: UnloadHandler): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Gets the current distributed trace context for this instance if available */ public getTraceCtx(): IDistributedTraceContext | null { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } public addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): ITelemetryInitializerHandler { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Update the configuration used and broadcast the changes to all loaded plugins * @param newConfig - The new configuration is apply * @param mergeExisting - Should the new configuration merge with the existing or just replace it. Default is to merge. */ public updateCfg(newConfig: T, mergeExisting?: boolean): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Watches and tracks changes for accesses to the current config, and if the accessed config changes the * handler will be recalled. * @param handler - The handler to call when the configuration changes * @returns A watcher handler instance that can be used to remove itself when being unloaded */ public onCfgChange(handler: WatcherFunction): IUnloadHook { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } } export { IConfiguration, AppInsightsCore, IAppInsightsCore, ITelemetryItem, ILoadedPlugin, arrForEach, SendRequestReason, _eInternalMessageId, isNullOrUndefined, throwError, proxyFunctions, IPlugin, ITelemetryPlugin } from "@microsoft/applicationinsights-core-js"; export { SeverityLevel, eSeverityLevel, IPageViewTelemetry, IDependencyTelemetry, IAutoExceptionTelemetry, IEventTelemetry, IMetricTelemetry, IPageViewPerformanceTelemetry, ITraceTelemetry, IRequestTelemetry } from "@microsoft/applicationinsights-core-js"; export { Sender, ISenderConfig } from "@microsoft/applicationinsights-channel-js"; ================================================ FILE: AISKULight/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": true, "module": "es6", "target": "es5", "moduleResolution": "Node", "alwaysStrict": true, "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "importHelpers": true, "noEmitHelpers": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "declaration": true, "declarationDir": "build/types", "outDir": "dist-es5", "rootDir": "./src", "removeComments": false }, "include": [ "./src/**/*" ], "exclude": [ "node_modules" ] } ================================================ FILE: AISKULight/tsdoc.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", "extends": ["../tsdoc.json"] } ================================================ FILE: AISKULight/tslint.json ================================================ { "extends": [ "../tslint-base.json" ] } ================================================ FILE: AISKULight/typedoc.json ================================================ { "$schema": "https://typedoc.org/schema.json", "entryPoints": [ "./src/index.ts" ], "exclude": [ "**/internal/**/*.ts", "node_modules/**" ], "externalPattern": [ "**/node_modules/**", "node_modules/**" ], "sort": [ "alphabetical", "kind", "instance-first" ], "basePath": "./src", "sourceLinkTemplate": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/{path}#L{line}", "cleanOutputDir": true, "excludeExternals": false, "excludeInternal": true, "excludePrivate": true, "includeVersion": true, "groupOrder": [ "Entrypoint", "Modules", "Namespaces", "Enumerations", "Enumeration Members", "Classes", "Interfaces", "Type Aliases", "Constructors", "Properties", "Variables", "Functions", "Accessors", "Methods", "References", "*" ], "tsconfig": "./tsconfig.json", "out": "../docs/webSdk/applicationinsights-web-basic", "readme": "none", "githubPages": true, "gitRevision": "main", "compilerOptions": { "stripInternal": true }, "sidebarLinks": { "Changelog": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/RELEASES.md", "Examples": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/examples/README.md", "Readme": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/AISKULight/README.md" }, "navigationLinks": { "GitHub": "https://github.com/Microsoft/ApplicationInsights-JS", "npm": "https://www.npmjs.com/package/@microsoft/applicationinsights-web-basic" }, "visibilityFilters": { "protected": false, "private": false, "inherited": true, "external": true } } ================================================ FILE: API-reference.md ================================================ # API Reference This documentation has been moved to the [GitHub Pages documentation site](https://microsoft.github.io/ApplicationInsights-JS/API-reference). ================================================ FILE: CODEOWNERS ================================================ * @microsoft/ApplicationInsights-JS-owners * @microsoft/ApplicationInsights-JS-CodeOwners ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Microsoft Open Source Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). Resources: - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns ================================================ FILE: CONTRIBUTING.md ================================================ # Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Welcome Welcome and thank you for your interest in contributing to ApplicationInsights-JS. We strongly welcome and encourage contributions to this project. Please read the [contributor's guide][ContribGuide] located in the ApplicationInsights-Home repository. If making a large change we request that you open an [issue][GitHubIssue] first. We follow the [Git Flow][GitFlow] approach to branching. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. [ContribGuide]: https://github.com/microsoft/ApplicationInsights-Home/blob/main/CONTRIBUTING.md [GitFlow]: http://nvie.com/posts/a-successful-git-branching-model/ [GitHubIssue]: https://github.com/microsoft/ApplicationInsights-JS/issues ## Clone and setup 1. Clone the repository and create a new branch 2. Install all dependencies ``` npm install npm install -g @microsoft/rush ``` 3. Navigate to the root folder and update rush dependencies ``` rush update ``` 4. Build and test ``` rush build npm run test ``` ## Build and test The root folder contains 8 packages that are components of this next version of the SDK. When making changes in multiple packages, you can build using the following commands in root folder: 1. rush rebuild --verbose This will build all packages in order of dependencies. If there are build errors, verbose options is required to view error details. 2. rush test --verbose This will run tests in all packages in parallel. If you are changing package versions or adding/removing any package dependencies, run> **rush update --purge --recheck --full** before building. Please check-in any files that change under common\ folder. ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: NOTICE ================================================ NOTICES AND INFORMATION Do Not Translate or Localize This software incorporates material from third parties. Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, or you may send a check or money order for US $5.00, including the product name, the open source component name, and version number, to: Source Code Compliance Team Microsoft Corporation One Microsoft Way Redmond, WA 98052 USA Notwithstanding any other terms, you may reverse engineer this software to the extent required to debug changes to any libraries licensed under the GNU Lesser General Public License. ================================================ FILE: PRIVACY ================================================ # Data Collection The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ================================================ FILE: README.md ================================================ # Application Insights JavaScript SDK [![GitHub Workflow Status (main)](https://img.shields.io/github/actions/workflow/status/microsoft/ApplicationInsights-JS/ci.yml?branch=main)](https://github.com/microsoft/ApplicationInsights-JS/tree/main) [![Build Status](https://dev.azure.com/mseng/AppInsights/_apis/build/status%2FAppInsights%20-%20DevTools%2F1DS%20JavaScript%20SDK%20web%20SKU%20(main%3B%20master)?branchName=main)](https://dev.azure.com/mseng/AppInsights/_build/latest?definitionId=8184&branchName=main) [![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-web.svg)](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-web) [![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.min.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.min.js) [![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.min.js.gzip.svg)](https://js.monitor.azure.com/scripts/b/ai.3.min.js) # Menu - [Before Getting Started](#before-getting-started) - [Release Versions](#release-versions) - [Getting Started](#getting-started) - [Basic Usage](#basic-usage) - [Configuration](#configuration) -
    More - [Cookie Handling](#cookie-handling) - [OpenTelemetry Tracing API](#opentelemetry-tracing-api) - [Tree-Shaking Support and Enhancements](#tree-shaking-support-and-enhancements) - [Service Notification](#service-notification) - [Single Page Applications](#single-page-applications) - [Source Map Support](#source-map-support) - [Using Azure API Management as a proxy for Application Insights Telemetry](https://techcommunity.microsoft.com/blog/azureobservabilityblog/using-azure-api-management-as-a-proxy-for-application-insights-telemetry/4422236) - [Examples](#examples) - [Application Insights Web Basic](#application-insights-web-basic) - [Available Extensions for the SDK](#available-extensions-for-the-sdk) - [Build a New Extension for the SDK](#build-a-new-extension-for-the-sdk) - [Build & Test This Repo](#build-and-test-this-repo) - [Performance](#performance) - [Module Formats](#module-formats) - [Nightly Builds](#nightly-builds) - [Release Notes](#release-notes) - [Browser Support](#browser-support) - [Contributing](#contributing) - [Data Collection](#data-collection) - [Trademarks](#trademarks) - [License](#license)
    > # URGENT ACTION: Stop using az416426.vo.msecnd.net > > To avoid any global OUTAGE you MUST change ALL of your CDN usage from “https://az416426.vo.msecnd.net/scripts/..” to our primary CDN endpoint https://js.monitor.azure.com/scripts/... > > See/follow [Issue #2457](https://github.com/microsoft/ApplicationInsights-JS/issues/2457) for updated details > > We are currently investigating the available options on how we can avoid / migrate / mitigate this situation, but at this point it is **HIGHLY** likely that there will be either a temporary or permanent outage of this domain. As we currently have no known way to “migrate” this domain to a different CDN. ## Before Getting Started This SDK is intended for browser environments and is not suitable for other environments, like Node.js applications. For instrumenting a Node.js app, the recommended SDK is the [ApplicationInsights-node.js repository](https://github.com/microsoft/ApplicationInsights-node.js). ES3 support has been removed from the latest version (v3.x), if required [see for ES3/IE8 Support](https://microsoft.github.io/ApplicationInsights-JS/es3_Support.html ) ## Release Versions | Version | Details |---------|-------------------------- | [3.x](https://github.com/microsoft/ApplicationInsights-JS/tree/main)
    (main)
    | Current supported release from April '2023.
    Supports dynamic configuration changes/updates after initialization. Supports all features of v2 except with the known [Breaking changes from previous versions](https://microsoft.github.io/ApplicationInsights-JS/upgrade/v3_BreakingChanges.html) and does NOT support the previous v1.x compatible API proxy layer, it also removes support for ES3 / IE8. Minimum supported Runtime is now ES5 (IE9+). | [2.x](https://github.com/microsoft/ApplicationInsights-JS/tree/master)
    (master) | Feature freeze from March '2023. Will only receive critical bug fixes when no workaround exists — no new features or back-porting from later versions.
    Supports adding / removing extensions and full unloading/removal of the SDK after initialization. Last version to support ES3 (IE8+), also provides a v1.x compatible API proxy layer for upgrading from V1.x. | [1.0.x](https://github.com/microsoft/ApplicationInsights-JS/tree/legacy-v1)
    (legacy-v1) | No longer actively maintained -- please Upgrade. The documentation for `applicationinsights-js@1.0.x` has moved [here](https://github.com/microsoft/ApplicationInsights-JS/tree/master/legacy/README.md). If you are looking to upgrade to the new version of the SDK, please see the [Upgrade Guide](https://microsoft.github.io/ApplicationInsights-JS/upgrade/v2_UpgradeGuide.html). | Not actively maintained, please upgrade. > :bulb: **Note** > When multiple instances of Application Insights with different major version are active within a single session, errors may arise. For further details, please refer to the [version conflict doc](./versionConflict.md). ## Getting Started 1. Create an Application Insights resource in Azure by following [these instructions](https://docs.microsoft.com/en-us/azure/application-insights/app-insights-javascript?toc=/azure/azure-monitor/toc.json). 2. Grab the _Connection String_ from the resource you created in step 1. Later, you'll add it to the `connectionString` setting of the Application Insights JavaScript SDK. 3. Add Application Insights to your app. **There are 2 ways to do this.** - Install via NPM. Then, [set up an instance of Application Insights in your app.](#npm-setup-ignore-if-using-snippet-setup) > *Note:* **Typings are included with this package**, so you do **not** need to install a separate typings package. ```sh npm i --save @microsoft/applicationinsights-web ``` - [Pasting a script snippet at the beginning of every `` tag for each page you want to monitor.](#snippet-setup-ignore-if-using-npm-setup) ## Basic Usage ### NPM Setup (ignore if using Snippet Setup) ```js import { ApplicationInsights } from '@microsoft/applicationinsights-web' const appInsights = new ApplicationInsights({ config: { connectionString: 'YOUR_CONNECTION_STRING_GOES_HERE' /* ...Other Configuration Options... */ } }); appInsights.loadAppInsights(); appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview ``` ### Snippet Setup (Ignore if using NPM Setup) If your app does not use NPM, you can directly instrument your webpages with Application Insights by pasting this snippet at the top of each your pages. Preferably, it should be the first script in your `` section so that it can monitor any potential issues with all of your dependencies. The current version of the snippet is version 8, the version is identified by the "sv:" in the script. ```html ``` > :bulb: **Note** > > 1. For readability and to reduce possible JavaScript errors, all of the possible configuration options are listed on a new line in snippet code above, if you don't want to change the value of a commented line it can be removed. > > 2. ConnectionString format should follow "InstrumentationKey=xxxx;...." If the string provided does not meet this format, the sdk load process would fail #### Reporting Script load exceptions This version of the snippet detects and reports an exception when loading the SDK from the CDN fails, this exception is reported to the Azure Monitor portal (under the failures > exceptions > browser), and provides visibility into failures of this type so that you are aware your application is not reporting telemetry (or other exceptions) as expected. This signal is an important measurement in understanding that you have lost telemetry because the SDK did not load or initialize, this provides clarity that you are missing the following telemetry: - Under-reporting of how users are using (or trying to use) your site; - Missing telemetry on how your end users are using your site; - Missing JavaScript errors that could potentially be blocking your end users from successfully using your site. For details on this exception see [SDK Load Failure](https://microsoft.github.io/ApplicationInsights-JS/SdkLoadFailure) page. Reporting of this failure as an exception to the portal does not use the configuration option ```disableExceptionTracking``` from the application insights configuration and therefore if this failure occurs it will always be reported by the snippet, even when the window.onerror support is disabled. Reporting of SDK load exceptions is specifically NOT supported on IE 8 (or less). This assists with reducing the minified size of the snippet by assuming that most environments are not exclusively IE 8 or less. If you have this requirement and you wish to receive these exceptions, you will need to either include a fetch poly fill or create you own snippet version that uses ```XDomainRequest``` instead of ```XMLHttpRequest```, it is recommended that you use the [provided snippet source code](https://github.com/microsoft/ApplicationInsights-JS/blob/main/AISKU/snippet/snippet.js) as a starting point. > :bulb: **Note** > > If you are using a previous version of the snippet, it is highly recommended that you update to the latest version so that you will receive these previously unreported issues. #### [Snippet configuration options](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html) All configuration options have now been move towards the end of the script to help avoid accidentally introducing JavaScript errors that would not just cause the SDK to fail to load, but also it would disable the reporting of the failure. Each configuration option is shown above on a new line, if you don't wish to override the default value of an item listed as [optional] you can remove that line to minimize the resulting size of your returned page. The available configuration options are: - | Name | Type | Description |------|------|---------------- | [src](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#src) | string **[required]** | The full URL for where to load the SDK from. This value is used for the "src" attribute of a dynamically added <script /> tag. You can use the public CDN location or your own privately hosted one. | [name](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#name) | string *[optional]* | The global name for the initialized SDK, defaults to appInsights. So ```window.appInsights``` will be a reference to the initialized instance. Note: if you provide a name value or a previous instance appears to be assigned (via the global name appInsightsSDK) then this name value will also be defined in the global namespace as ```window.appInsightsSDK=```, this is required by the SDK initialization code to ensure it's initializing and updating the correct snippet skeleton and proxy methods. | [ld](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#ld) | number in ms *[optional]* | Defines the load delay to wait before attempting to load the SDK. Default value is 0ms and any negative value will immediately add a script tag to the <head> region of the page, which will then block the page load event until to script is loaded (or fails). | [useXhr](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#useXhr) | boolean *[optional]* | This setting is used only for reporting SDK load failures. Reporting will first attempt to use fetch() if available and then fallback to XHR, setting this value to true just bypasses the fetch check. Use of this value is only be required if your application is being used in an environment where fetch would fail to send the failure events. | [crossOrigin](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#crossOrigin) | string *[optional]* | By including this setting, the script tag added to download the SDK will include the crossOrigin attribute with this string value. When not defined (the default) no crossOrigin attribute is added. Recommended values are not defined (the default); ""; or "anonymous" (For all valid values see [HTML attribute: crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) documentation) | [onInit](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#onInit) | function(aiSdk) { ... } *[optional]* | This callback function which is called after the main SDK script has been successfully loaded and initialized from the CDN (based on the src value), it is passed a reference to the sdk instance that it is being called for and it is also called _before_ the first initial page view. If the SDK has already been loaded and initialized this callback will still be called. NOTE: As this callback is called during the processing of the sdk.queue array you CANNOT add any additional items to the queue as they will be ignored and dropped. (Added as part of snippet version 5 -- the sv:"#" value within the snippet script, the current version is 7) | [cfg](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#cfg) | object **[required]** | The [IConfiguration](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html) passed to the Application Insights SDK during initialization. | [cr](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#cr) | boolean *[optional]* | Controls CDN fallback retry behavior. By default (`true`), if the SDK fails to load from the configured `src` URL, the snippet automatically attempts to load from multiple supported CDN domains in case one or more of them is temporarily unavailable. Set to `false` to disable this fallback and only attempt the single configured `src` URL. | [sri](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#sri) | boolean *[optional]* | Custom optional value to specify whether to fetch the snippet from an integrity file and perform an integrity check. When this option is used, the integrity file is loaded first, affecting the load order and script execution. Hence the ld option will be ignored. Additionally, if the page navigates away before the integrity file is loaded, some events may be lost. | [dle](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#dle) | boolean *[optional]* | When set to `true`, prevents the SDK from reporting load failure telemetry. | [pl](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#pl) | boolean *[optional]* | Custom optional value to specify whether to enable the Trusted Type policy check on the snippet. | [pn](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#pn) | string *[optional]* | Custom optional value to specify the name of the Trusted Type policy that would be implemented on the snippet, default is 'aiPolicy'. | [ttp](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#ttp) | TrustedTypePolicy *[optional]* | Custom optional value to specify the Trusted Type policy that would be applied on the snippet src. | [nt](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web-snippet/interfaces/ISnippetConfig.html#nt) | string *[optional]* | Custom optional value to specify the nonce attribute value that will be applied to the script tag when it is added to the page. #### Internet Explorer: Automatic Version Fallback > **Important**: When the SDK Loader (snippet) detects that the page is being loaded by Internet Explorer (via the `msie` or `trident/` user agent strings), it will **automatically** rewrite the `src` URL to load the v2.x version of the SDK instead of v3.x. For example, `ai.3.gbl.min.js` will be changed to `ai.2.gbl.min.js`. > > This means that if your application uses the SDK Loader with a v3.x CDN URL and any of your users visit the page with Internet Explorer, they will receive the 2.x version of the SDK. As a result, **any APIs or features that are only available in v3.x or later — including the new OpenTelemetry-based APIs — will not exist** on the SDK instance for those users. Your code should account for this by checking for the existence of newer APIs before calling them, or by using only APIs that are available in both v2.x and v3.x. > > This fallback does **not** apply when using the NPM package directly, as NPM installations always load the specific version you have installed. #### Example using the snippet onInit callback ```html ``` #### Active Public CDN endpoints > ## URGENT ACTION: Stop using az416426.vo.msecnd.net > > To avoid any global OUTAGE you MUST change ALL of your CDN usage from “https://az416426.vo.msecnd.net/scripts/..” to our primary CDN endpoint https://js.monitor.azure.com/scripts/... > > See/follow [Issue #2457](https://github.com/microsoft/ApplicationInsights-JS/issues/2457) for updated details > > We are currently investigating the available options on how we can avoid / migrate / mitigate this situation, but at this point it is **HIGHLY** likely that there will be either a temporary or permanent outage of this domain. As we currently have no known way to “migrate” this domain to a different CDN. To help with global resiliency, we have added and updated our primary CDN endpoint (source URL) so that if required we can address any outages without the need for everyone to update the URL used by the Application Insights snippet within their application. ~~All active CDN endpoints contain all of the previous (and future) versions of the SDK and there is currently no plans to stop or block accessing the snippet from the previous (legacy/backup) URL.~~ Due to [Issue #2457](https://github.com/microsoft/ApplicationInsights-JS/issues/2457) we are now declaring that you MUST always use `js.monitor.azure.com` domain. | State | CDN Endpoint | Description |-------|--------------|-------------------- | Primary | https://js.monitor.azure.com/scripts/b/ai.3.gbl.min.js | Provides additional resiliency, allowing us to redirect to a different CDN provider should there be an unexpected issue (if required). | ~~Legacy/Backup~~
    :exclamation: ~~Deprecated~~ DO NOT USE | ~~https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js~~ | ~~Due to the legacy nature of this URL / Domain, __if there is an unexpected issue (outage) with this domain, your application will need to be updated and deployed to use the new URL__.
    :exclamation: Due to #1813 this URL is now being classified as Deprecated and we will be actively making changes to the SDK to warnings in your telemetry if we detect this domain being used.~~
    Due to [Issue #2457](https://github.com/microsoft/ApplicationInsights-JS/issues/2457) we are now declaring that you MUST always use `js.monitor.azure.com` domain. ### Connection String Setup For either the NPM or Snippet setup, you can also configure your instance of Application Insights using a Connection String. Simply replace the `instrumentationKey` field with the `connectionString` field. ```js import { ApplicationInsights } from '@microsoft/applicationinsights-web' const appInsights = new ApplicationInsights({ config: { connectionString: 'YOUR_CONNECTION_STRING_GOES_HERE' /* ...Other Configuration Options... */ } }); appInsights.loadAppInsights(); appInsights.trackPageView(); ``` #### (Alternative Setup Method) Include AI JS SDK script and initialize statically Use this approach if you would like to host AI JS SDK script on your endpoint or bundle it with other scripts. ```html ``` After JS script has loaded, include the following snippet to initialize Application Insights: ```html ``` ### Sending Telemetry to the Azure Portal If initialized using the snippet, your Application Insights instance is located by default at `window.appInsights` ```js appInsights.trackEvent({name: 'some event'}); appInsights.trackPageView({name: 'some page'}); appInsights.trackPageViewPerformance({name : 'some page', url: 'some url'}); appInsights.trackException({exception: new Error('some error')}); appInsights.trackTrace({message: 'some trace'}); appInsights.trackMetric({name: 'some metric', average: 42}); appInsights.trackDependencyData({absoluteUrl: 'some url', responseCode: 200, method: 'GET', id: 'some id'}); appInsights.startTrackPage("pageName"); appInsights.stopTrackPage("pageName", null, {customePropertiesName: "some value"}, {customerMeasurementsName: 144}); appInsights.startTrackEvent("event"); appInsights.stopTrackEvent("event", null, {customePropertiesName: "some value"}, {customerMeasurementsName: 150}); appInsights.flush(); ``` Custom properties can be included in your telemetry through the `properties` named argument. This can be done with *any* of the Track APIs except stopTrackPage and stopTrackEvent. ```js appInsights.trackEvent({ name: 'some event', properties: { // accepts any type prop1: 'string', prop2: 123.45, prop3: { nested: 'objects are okay too' } } }); ``` When using stopTrackPage and stopTrackEvent, you can pass in data categorized by types: Strings: These should be included under the properties field. Numbers: Add these under the measurements field. Remember, the order of the properties and measurements should not be altered. You can achieve this using the following code structure: ```js appInsights.startTrackEvent("event name"); appInsights.stopTrackEvent("event name", { stringProp1: 'string', stringProp2: {nested: "objects are okay too", key: "value"} // In this example, stringProp2 will be sent as: "stringProp2": "{\"nested\":\"objects are okay too\",\"key\":\"value\"}". }, {numProp1: 3.15, numProp2: 90000} ) ``` ### OpenTelemetry Tracing API The Application Insights JavaScript SDK includes an **OpenTelemetry-compatible tracing API** that allows you to use familiar OpenTelemetry patterns for distributed tracing while automatically sending telemetry to Azure Application Insights. **Key Features:** - Use OpenTelemetry-like tracing APIs following industry-standard patterns - Automatic telemetry creation with full distributed tracing support - Parent-child span relationships for nested operations - Compatible with OpenTelemetry API specifications (tracing only) **Learn More:** For comprehensive documentation on the OpenTelemetry tracing API, including tracer management, span utilities, helper functions, and detailed examples, see: - **[OpenTelemetry Tracing Documentation](https://microsoft.github.io/ApplicationInsights-JS/OTel/)** - Complete guide to OpenTelemetry-compatible tracing - **[startActiveSpan Helper](https://microsoft.github.io/ApplicationInsights-JS/OTel/startActiveSpan)** - Recommended method for creating spans with automatic lifecycle management - **[withSpan Helper](https://microsoft.github.io/ApplicationInsights-JS/OTel/withSpan)** - Execute code with existing span as active context - **[Trace API Reference](https://microsoft.github.io/ApplicationInsights-JS/OTel/traceApi)** - Tracer management and span utilities - **[Examples Guide](https://microsoft.github.io/ApplicationInsights-JS/OTel/examples)** - Comprehensive usage examples and patterns **Note:** This is an OpenTelemetry-compatible tracing API implementation, not a full OpenTelemetry SDK. Only tracing APIs are supported (metrics and logs APIs are not included). ### Setting Up Autocollection All autocollection is ON by default. The full version of the Application Insights Javascript SDK auto collects: - **Uncaught exceptions** in your app, including information on - Stack trace - Exception details and message accompanying the error - Line & column number of error - URL where error was raised - **Network Dependency Requests** made by your app **XHR** and **Fetch** (fetch collection is enabled by default) requests, include information on - Url of dependency source - Command & Method used to request the dependency - Duration of the request - Result code and success status of the request - ID (if any) of user making the request - Correlation context (if any) where request is made - **User information** (e.g. Location, network, IP) - **Device information** (e.g. Browser, OS, version, language, model) - **Session information** ### Telemetry Initializers Telemetry initializers are used to modify the contents of collected telemetry before being sent from the user's browser. They can also be used to prevent certain telemetry from being sent, by returning `false`. Multiple telemetry initializers can be added to your Application Insights instance, and they are executed in order of adding them. The input argument to `addTelemetryInitializer` is a callback that takes a [`ITelemetryItem`](https://microsoft.github.io/ApplicationInsights-JS/API-reference#addTelemetryInitializer) as an argument and returns a `boolean` or `void`. If returning `false`, the telemetry item is not sent, else it proceeds to the next telemetry initializer, if any, or is sent to the telemetry collection endpoint. #### Example: [Setting Cloud Role Name](https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-map#set-cloud-role-name) ```js var telemetryInitializer = (envelope) => { envelope.tags["ai.cloud.role"] = "your role name"; envelope.tags["ai.cloud.roleInstance"] = "your role instance"; } appInsights.addTelemetryInitializer(telemetryInitializer); ``` #### Example: Filtering ```js var telemetryInitializer = (envelope) => { envelope.data.someField = 'This item passed through my telemetry initializer'; }; appInsights.addTelemetryInitializer(telemetryInitializer); appInsights.trackTrace({message: 'This message will use a telemetry initializer'}); appInsights.addTelemetryInitializer(() => false); // Nothing is sent after this is executed appInsights.trackTrace({message: 'this message will not be sent'}); // Not sent ``` ### Dependency Listeners A [dependency listener is a callback function](https://microsoft.github.io/ApplicationInsights-JS/API-reference#addDependencyListener) that allows you to perform additional manipulation of the request details before the request is performed. This includes :- - Complete access to either the XMLHttpRequest instance or the fetch API `input` and `init` arguments. - Ability to get/set the properties used to generate the W3C `traceparent` header (`traceId`, `spanId, `traceFlags) - Set values in the object context container for other listeners called after the current one, as well as this context object is also made available to all dependency initializers. ### Dependency Initializers A [Dependency Initializer is very similar](https://microsoft.github.io/ApplicationInsights-JS/API-reference#addDependencyInitializer) to a [Telemetry Initializer](https://github.com/Microsoft/ApplicationInsights-JS#telemetry-initializers) in that it allows you modify the contents of collected telemetry before being sent from the user's browser. And you can also returning `false` to cause the event to not be emitted. The differences between a telemetry initializer and a dependency initializer are :- - A Dependency Initializer is called "before" the event is processed by the pipeline, as such it will NOT (yet) contain the automatically populated properties that are applied later; - When a dependency initializer returns `false` to drop the event the event does NOT count against the `maxAjaxCallsPerView` as this blocks the event call from being tracked, and while returning `false` from a [Telemetry Initializer](https://github.com/Microsoft/ApplicationInsights-JS#telemetry-initializers) will also stop the event from being reported because this is further down the processing pipeline the dependency event IS counted against the `maxAjaxCallsPerView` limit. - It has access to an optional "context" `{ [key: string]: any }` object that is also available to the Dependency Listeners. This allows a listener to add additional details to the context (before the XHR/fetch request is sent), and the initializer will be called after the request has completed. ### Advanced Setting Using Config/Extensions - [How to add more details in my Exception Telemetry?](https://microsoft.github.io/ApplicationInsights-JS/exceptionTelemetry) ## [Configuration](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html) Most configuration fields are named such that they can be defaulted to falsey. All fields are optional except for `instrumentationKey` or a `connectionString` containing the instrumentation key. | Name | Type | Default | Description | |------|------|---------|-------------| | [instrumentationKey](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#instrumentationKey) | string
    [**Required if `connectionString` not supplied**]| null | Instrumentation key that you obtained from the Azure Portal. | | [connectionString](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#connectionString) | string
    [**Require if `instrumentationKey` not supplied**] | null | The Connection string that you obtained from the Azure portal | | [accountId](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#accountId) | string | null | An optional account id, if your app groups users into accounts. No spaces, commas, semicolons, equals, or vertical bars | | [sessionRenewalMs](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#sessionRenewalMs) | numeric | 1800000 | A session is logged if the user is inactive for this amount of time in milliseconds. Default is 30 minutes | | [sessionExpirationMs](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#sessionExpirationMs) | numeric | 86400000 | A session is logged if it has continued for this amount of time in milliseconds. Default is 24 hours | | [maxBatchSizeInBytes](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#maxBatchSizeInBytes) | numberic | 10000 | Max size of telemetry batch. If a batch exceeds this limit, it is immediately sent and a new batch is started | | [maxBatchInterval](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#maxBatchInterval) | numeric | 15000 | How long to batch telemetry for before sending (milliseconds) | | [disableExceptionTracking](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#disableExceptionTracking) | boolean || false | If true, exceptions are not autocollected. Default is false. | | [disableTelemetry](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#disableTelemetry) | boolean | false | If true, telemetry is not collected or sent. Default is false. | | [enableDebug](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#enableDebug) | boolean | false | If true, **internal** debugging data is thrown as an exception **instead** of being logged, regardless of SDK logging settings. Default is false.
    ***Note:*** Enabling this setting will result in dropped telemetry whenever an internal error occurs. This can be useful for quickly identifying issues with your configuration or usage of the SDK. If you do not want to lose telemetry while debugging, consider using `loggingLevelConsole` or `loggingLevelTelemetry` instead of `enableDebug`. | enableDebugExceptions | boolean | false | Removed from v3.x, Prior to v2.8.12 this was the only supported value and the documented `enableDebug` was incorrect, since v2.8.12 both `enableDebug` and `enableDebugExceptions` is supported. | [loggingLevelConsole](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#loggingLevelConsole) | numeric | 0 | Logs **internal** Application Insights errors to console.
    0: off,
    1: Critical errors only,
    2: Everything (errors & warnings) | | [loggingLevelTelemetry](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#loggingLevelTelemetry) | numeric | 1 | Sends **internal** Application Insights errors as telemetry.
    0: off,
    1: Critical errors only,
    2: Everything (errors & warnings) | | [diagnosticLogInterval](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#diagnosticLogInterval) | numeric | 10000 | (internal) Polling interval (in ms) for internal logging queue | | [samplingPercentage](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#samplingPercentage) | numeric | 100 | Percentage of events that will be sent. Default is 100, meaning all events are sent. Set this if you wish to preserve your datacap for large-scale applications. | | [autoTrackPageVisitTime](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#autoTrackPageVisitTime) | boolean | false | If true, on a pageview, the _previous_ instrumented page's view time is tracked and sent as telemetry and a new timer is started for the current pageview. It is sent as a custom metric named `PageVisitTime` in `milliseconds` and is calculated via the Date [now()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now) function (if available) and falls back to (new Date()).[getTime()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) if now() is unavailable (IE8 or less). Default is false. | | [disableAjaxTracking](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#disableAjaxTracking) | boolean | false | If true, Ajax calls are not autocollected. Default is false. | | [disableFetchTracking](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#disableFetchTracking) | boolean | false | If true, Fetch requests are not autocollected. Default is false (Since v2.8.0, previously true) | | [excludeRequestFromAutoTrackingPatterns](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#excludeRequestFromAutoTrackingPatterns) | string[] \| RegExp[] | undefined | Provide a way to exclude specific route from automatic tracking for XMLHttpRequest or Fetch request. If defined, for an ajax / fetch request that the request url matches with the regex patterns, auto tracking is turned off. Default is undefined. | | [addRequestContext](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#addRequestContext) | (requestContext: IRequestionContext) => {[key: string]: any} | undefined | Provide a way to enrich dependencies logs with context at the beginning of api call. Default is undefined. You will need to check if `xhr` exists if you configure `xhr` related conetext. You will need to check if `fetch request` and `fetch response` exist if you configure `fetch` related context. Otherwise you may not get the data you need. | | [overridePageViewDuration](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#overridePageViewDuration) | boolean | false | If true, default behavior of trackPageView is changed to record end of page view duration interval when trackPageView is called. If false and no custom duration is provided to trackPageView, the page view performance is calculated using the navigation timing API. Default is false. | | [maxAjaxCallsPerView](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#maxAjaxCallsPerView) | numeric | 500 | Default 500 - controls how many ajax calls will be monitored per page view. Set to -1 to monitor all (unlimited) ajax calls on the page. | | [disableDataLossAnalysis](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#disableDataLossAnalysis) | boolean | true | If false, internal telemetry sender buffers will be checked at startup for items not yet sent. | | [disableCorrelationHeaders](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#disableCorrelationHeaders) | boolean | false | If false, the SDK will add two headers ('Request-Id' and 'Request-Context') to all dependency requests to correlate them with corresponding requests on the server side. Default is false. | | [correlationHeaderExcludedDomains](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#correlationHeaderExcludedDomains) | string[] | undefined | Disable correlation headers for specific domains | | [correlationHeaderExcludePatterns](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#correlationHeaderExcludePatterns) | regex[] | undefined | Disable correlation headers using regular expressions | | [correlationHeaderDomains](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#correlationHeaderDomains) | string[] | undefined | Enable correlation headers for specific domains | | [disableFlushOnBeforeUnload](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#disableFlushOnBeforeUnload) | boolean | false | Default false. If true, flush method will not be called when onBeforeUnload event triggers | | [enableSessionStorageBuffer](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#enableSessionStorageBuffer) | boolean | true | Default true. If true, the buffer with all unsent telemetry is stored in session storage. The buffer is restored on page load | | [cookieCfg](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#cookieCfg) | [ICookieCfgConfig](#ICookieMgrConfig)
    [Optional]
    (Since 2.6.0) | undefined | Defaults to cookie usage enabled see [ICookieCfgConfig](#ICookieMgrConfig) settings for full defaults. | | [~~isCookieUseDisabled~~
    disableCookiesUsage](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#disableCookiesUsage) | alias for [`cookieCfg.enabled`](#ICookieMgrConfig)
    [Optional] | false | Default false. A boolean that indicates whether to disable the use of cookies by the SDK. If true, the SDK will not store or read any data from cookies. isCookieUseDisable is deprecated in favor of disableCookiesUsage, when both are provided disableCookiesUsage take precedence.
    (Since v2.6.0) If `cookieCfg.enabled` is defined it will take precedence over these values, Cookie usage can be re-enabled after initialization via the core.getCookieMgr().setEnabled(true). | | [cookieDomain](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#cookieDomain) | alias for [`cookieCfg.domain`](#ICookieMgrConfig)
    [Optional] | null | Custom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains.
    (Since v2.6.0) If `cookieCfg.domain` is defined it will take precedence over this value. | | [cookiePath](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#cookiePath) | alias for [`cookieCfg.path`](#ICookieMgrConfig)
    [Optional]
    (Since 2.6.0) | null | Custom cookie path. This is helpful if you want to share Application Insights cookies behind an application gateway.
    If `cookieCfg.path` is defined it will take precedence over this value. | | [isRetryDisabled](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#isRetryDisabled) | boolean | false | Default false. If false, retry on 206 (partial success), 408 (timeout), 429 (too many requests), 500 (internal server error), 503 (service unavailable), and 0 (offline, only if detected) | | [isStorageUseDisabled](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#isStorageUseDisabled) | boolean | false | If true, the SDK will not store or read any data from local and session storage. Default is false. | | [isBeaconApiDisabled](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#isBeaconApiDisabled) | boolean | true | If false, the SDK will send all telemetry using the [Beacon API](https://www.w3.org/TR/beacon) | | [disableXhr](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#disableXhr) | boolean | false | Don't use XMLHttpRequest or XDomainRequest (for IE < 9) by default instead attempt to use fetch() or sendBeacon. If no other transport is available it will still use XMLHttpRequest | | [onunloadDisableBeacon](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#onunloadDisableBeacon) | boolean | false | Default false. when tab is closed, the SDK will send all remaining telemetry using the [Beacon API](https://www.w3.org/TR/beacon) | | [onunloadDisableFetch](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#onunloadDisableFetch) | boolean | false | If fetch keepalive is supported do not use it for sending events during unload, it may still fallback to fetch() without keepalive | | [sdkExtension](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#sdkExtension) | string | null | Sets the sdk extension name. Only alphabetic characters are allowed. The extension name is added as a prefix to the 'ai.internal.sdkVersion' tag (e.g. 'ext_javascript:2.0.0'). Default is null. | | [isBrowserLinkTrackingEnabled](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#isBrowserLinkTrackingEnabled) | boolean | false | Default is false. If true, the SDK will track all [Browser Link](https://docs.microsoft.com/en-us/aspnet/core/client-side/using-browserlink) requests. | | [appId](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#appId) | string | null | AppId is used for the correlation between AJAX dependencies happening on the client-side with the server-side requests. When Beacon API is enabled, it cannot be used automatically, but can be set manually in the configuration. Default is null | | [enableCorsCorrelation](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#enableCorsCorrelation) | boolean | false | If true, the SDK will add two headers ('Request-Id' and 'Request-Context') to all CORS requests to correlate outgoing AJAX dependencies with corresponding requests on the server side. Default is false | | [namePrefix](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#namePrefix) | string | undefined | An optional value that will be used as name postfix for localStorage and session cookie name. | [sessionCookiePostfix](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#sessionCookiePostfix) | string | undefined | An optional value that will be used as name postfix for session cookie name. If undefined, namePrefix is used as name postfix for session cookie name. | [userCookiePostfix](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#userCookiePostfix) | string | undefined | An optional value that will be used as name postfix for user cookie name. If undefined, no postfix is added on user cookie name. | [enableAutoRouteTracking](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#enableAutoRouteTracking) | boolean | false | Automatically track route changes in Single Page Applications (SPA). If true, each route change will send a new Pageview to Application Insights. Hash route changes changes (`example.com/foo#bar`) are also recorded as new page views. | [enableRequestHeaderTracking](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#enableRequestHeaderTracking) | boolean | false | If true, AJAX & Fetch request headers is tracked, default is false. If ignoreHeaders is not configured, Authorization and X-API-Key headers are not logged. | [enableResponseHeaderTracking](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#enableResponseHeaderTracking) | boolean | false | If true, AJAX & Fetch request's response headers is tracked, default is false. If ignoreHeaders is not configured, WWW-Authenticate header is not logged. | [enableAjaxErrorStatusText](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#enableAjaxErrorStatusText) | boolean | false | Default false. If true, include response error data text | boolean in dependency event on failed AJAX requests. | [enableAjaxPerfTracking](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#enableAjaxPerfTracking) | boolean | false | Default false. Flag to enable looking up and including additional browser window.performance timings in the reported ajax (XHR and fetch) reported metrics. | [maxAjaxPerfLookupAttempts](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#maxAjaxPerfLookupAttempts) | numeric | 3 | Defaults to 3. The maximum number of times to look for the window.performance timings (if available), this is required as not all browsers populate the window.performance before reporting the end of the XHR request and for fetch requests this is added after its complete. | [ajaxPerfLookupDelay](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#ajaxPerfLookupDelay) | numeric | 25 | Defaults to 25ms. The amount of time to wait before re-attempting to find the windows.performance timings for an ajax request, time is in milliseconds and is passed directly to setTimeout(). | [distributedTracingMode](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#distributedTracingMode) | numeric or `DistributedTracingModes` | `DistributedTracingModes.AI_AND_W3C` | Sets the distributed tracing mode. If AI_AND_W3C mode or W3C mode is set, W3C trace context headers (traceparent/tracestate) will be generated and included in all outgoing requests. AI_AND_W3C is provided for back-compatibility with any legacy Application Insights instrumented services. | [enableUnhandledPromiseRejectionTracking](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#enableUnhandledPromiseRejectionTracking) | boolean | false | If true, unhandled promise rejections will be autocollected and reported as a javascript error. When disableExceptionTracking is true (dont track exceptions) the config value will be ignored and unhandled promise rejections will not be reported. | [disableInstrumentationKeyValidation](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#disableInstrumentationKeyValidation) | boolean | false | If true, instrumentation key validation check is bypassed. Default value is false. | [enablePerfMgr](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#enablePerfMgr) | boolean | false | [Optional] When enabled (true) this will create local perfEvents for code that has been instrumented to emit perfEvents (via the doPerf() helper). This can be used to identify performance issues within the SDK based on your usage or optionally within your own instrumented code. [More details are available by the basic documentation](https://microsoft.github.io/ApplicationInsights-JS/PerformanceMonitoring). Since v2.5.7 | [perfEvtsSendAll](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#perfEvtsSendAll) | boolean | false | [Optional] When _enablePerfMgr_ is enabled and the [IPerfManager](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IPerfManager.html) fires a [INotificationManager](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/INotificationManager.html).perfEvent() this flag determines whether an event is fired (and sent to all listeners) for all events (true) or only for 'parent' events (false <default>).
    A parent [IPerfEvent](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IPerfEvent.html) is an event where no other IPerfEvent is still running at the point of this event being created and it's _parent_ property is not null or undefined. Since v2.5.7 | [createPerfMgr](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#createPerfMgr) | (core: IAppInsightsCore, notificationManager: INotificationManager) => IPerfManager | undefined | Callback function that will be called to create a the IPerfManager instance when required and ```enablePerfMgr``` is enabled, this enables you to override the default creation of a PerfManager() without needing to ```setPerfMgr()``` after initialization. | [idLength](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#idLength) | numeric | 22 | [Optional] Identifies the default length used to generate new random session and user id's. Defaults to 22, previous default value was 5 (v2.5.8 or less), if you need to keep the previous maximum length you should set this value to 5. | [customHeaders](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#customHeaders) | `[{header: string, value: string}]` | undefined | [Optional] The ability for the user to provide extra headers when using a custom endpoint. customHeaders will not be added on browser shutdown moment when beacon sender is used. And adding custom headers is not supported on IE9 or earlier. | [convertUndefined](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#convertUndefined) | `any` | undefined | [Optional] Provide user an option to convert undefined field to user defined value. | [eventsLimitInMem](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#eventsLimitInMem) | number | 10000 | [Optional] The number of events that can be kept in memory before the SDK starts to drop events when not using Session Storage (the default). | [disableIkeyDeprecationMessage](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#disableIkeyDeprecationMessage) | boolean | true | [Optional] Disable instrumentation Key deprecation error message. If true, error message will NOT be sent. **Note: instrumentation key support will end soon**, see aka.ms/IkeyMigrate for more details. | [bufferOverride](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#bufferOverride)
    since 2.8.12 | IStorageBuffer | undefined | [Optional] Identifies a simple interface to allow you to override the storage mechanism used for tracking unsent and unacknowledged events, when not provided defaults to using SessionStorage interface. You MUST supply both the `getItem` and `setItem` functions when defined. | [storagePrefix](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#storagePrefix) | string[] | undefined | [Optional] An optional value that will be added as name prefix for storage name. | | [featureOptIn](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#featureOptIn) (#feature)
    since 3.0.3 | IFeatureOptIn | undefined | [Optional] Set Feature opt in details. | | [throttleMgrCfg](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfig.html#throttleMgrCfg)
    since 3.0.3 | `{[key: number]: IThrottleMgrConfig}` | undefined | [Optional] Set throttle mgr configuration by key. | | retryCodes | number[] | undefined | Identifies the status codes that will cause event batches to be resent, when `null` or `undefined` the SDK will use it's defaults `[401, 408, 429, 500, 502, 503, 504]`. `403` was removed in version 3.1.1. | | [disablePageUnloadEvents](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#disablePageUnloadEvents) | string[] | undefined | [Optional] An array of the page unload events that you would like to be ignored. [See detailed documentation](https://microsoft.github.io/ApplicationInsights-JS/PageUnloadEvents.html). Unload events include "beforeunload", "unload", "visibilitychange" (with 'hidden' state) and "pagehide". This can be used to avoid jQuery 3.7.1+ deprecation warnings by configuring as `disablePageUnloadEvents: ["unload"]`. | | [disablePageShowEvents](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#disablePageShowEvents) | string[] | undefined | [Optional] An array of page show events that you would like to be ignored. [See detailed documentation](https://microsoft.github.io/ApplicationInsights-JS/PageUnloadEvents.html). Page Show events include "pageshow" and "visibilitychange" (with 'visible' state). | | [expCfg](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#expCfg)
    since 3.3.1| [`IExceptionConfig`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IExceptionConfig.html) | undefined | Set additional configuration for exceptions, such as more scripts to include in the exception telemetry. | | [redactQueryParams](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#redactQueryParams) | string[] | `["sig", "Signature", "AWSAccessKeyId", "X-Goog-Signature"]` | [Optional] Extends the list of query parameter names that are automatically replaced with `"REDACTED"` when `redactUrls` is enabled. Use this to mask application-specific tokens such as `auth_token` or `api_key`. | | [redactUrls](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IConfiguration.html#redactUrls) | boolean | true | [Optional] Controls whether URL fields processed by the SDK have credentials and sensitive query-string values removed via the built-in field redaction helper. Set to `false` only if you explicitly want to send the original URL without masking. | ### Page Unload and Visibility Event Handling Application Insights SDK uses page lifecycle events to reliably send telemetry data before your page closes or navigates away. These events are essential for ensuring no telemetry data is lost during navigation, page refreshes, or tab/browser closures. **What these configurations do:** - Control which browser events the SDK uses to detect when the browser is about to unload, navigate away, become unresponsive, or get hibernated (especially on mobile) - Ensure all batched events are sent and not lost due to the browser closing or the user navigating away - Affect ALL telemetry types (page views, events, dependencies, exceptions, etc.) - Allow you to avoid deprecated event warnings (from jQuery 3.7.1+ or Chrome) while maintaining functionality **About visibility state:** When a browser tab becomes hidden (switching to another tab) or visible (returning to the tab), the browser fires "visibilitychange" events with document.visibilityState changing to "hidden" or "visible". The SDK uses these events to optimize telemetry sending. ```js const appInsights = new ApplicationInsights({ config: { connectionString: 'YOUR_CONNECTION_STRING_GOES_HERE', // Disable the deprecated 'unload' event to avoid jQuery 3.7.1+ deprecation warnings // This also prevents Chrome's warnings about the unload event disablePageUnloadEvents: ["unload"], /* ...Other Configuration Options... */ } }); appInsights.loadAppInsights(); appInsights.trackPageView(); ``` For more detailed information about browser compatibility and configuration options, see the [Page Unload Events documentation](https://microsoft.github.io/ApplicationInsights-JS/PageUnloadEvents.html). ### Feature You can use the `featureOptIn` configuration to enable or customize specific SDK features. #### Available Feature Flags | Name | Default | Description | Note | |-------------|---------|----------------------------------------------|------------| | `zipPayload` | `none`*(version 3.3.7) | Enables compression using the Compression API to zip telemetry payloads. |If this feature is turned on and the CompressionStream API is available, the payload will be compressed using the CompressionStream API. Compression will only occur if the event is asynchronous. For events like unloads, compression will not be applied. Note: if user set payloadPreprocessor, this zip compression will not be applied.| * A default value of none means the SDK may automatically enable this feature in the future. To explicitly prevent this, set the feature to disable using FeatureOptInMode.disable. #### How to Enable a Feature To enable a feature such as `zipPayload`, set the `featureOptIn` property in the SDK configuration as shown below: ```javascript const appInsights = new ApplicationInsights({ config: { connectionString: "YOUR_CONNECTION_STRING", // Other configuration options... featureOptIn: { zipPayload: { mode: FeatureOptInMode.enable, // Set the opt-in status for the feature blockCdnCfg: false, // Define whether to block changes from CDN config } as IFeatureOptInDetails } } }); ``` See [feature opt-in status](https://microsoft.github.io/ApplicationInsights-JS/WebConfig) for more details. ### ExtensionConfig `extensionConfig` should be initialized under the specific extension rather than being defined in the root configuration. This allows for more granular configuration tailored to each extension's needs. For instance, to configure the dependencies plugin, you would initialize it as follows: ```js const appInsights = new ApplicationInsights({ config: { connectionString: 'InstrumentationKey=YOUR_INSTRUMENTATION_KEY_GOES_HERE', extensionConfig: { [DependenciesPlugin.identifier]: { ignoreHeaders: [] } } } }); ``` | Name | Type | Default | Extenstion | Description | |------|------|---------|---------|-------------| | [ignoreHeaders](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/IDependenciesPluginConfig.html#ignoreHeaders) | string[] | ["Authorization", "X-API-Key", "WWW-Authenticate"] | DependenciesPlugin | AJAX & Fetch request and response headers to be ignored in log data. To override or discard the default, add an array with all headers to be excluded or an empty array to the configuration. Need to be defined in depenedency plugin extension config, see more [here](./extensions/applicationinsights-dependencies-js/README.md) ### [ICookieMgrConfig](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/ICookieMgrConfig.html) Cookie Configuration for instance based cookie management added in version 2.6.0. | Name | Type | Default | Description | |------|------|---------|-------------| | [enabled](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/ICookieMgrConfig.html#enabled) | boolean | true | A boolean that indicates whether the use of cookies by the SDK is enabled by the current instance. If false, the instance of the SDK initialized by this configuration will not store or read any data from cookies | | [domain](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/ICookieMgrConfig.html#domain) | string | null | Custom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains. If not provided uses the value from root `cookieDomain` value. | | [path](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/ICookieMgrConfig.html#path) | string | / | Specifies the path to use for the cookie, if not provided it will use any value from the root `cookiePath` value. | | [ignoreCookies](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/ICookieMgrConfig.html#ignoreCookies) | string[] | undefined | Specify the cookie name(s) to be ignored, this will cause any matching cookie name to never be read or written. They may still be explicitly purged or deleted. You do not need to repeat the name in the `blockedCookies` configuration.(Since v2.8.8) | [blockedCookies](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/ICookieMgrConfig.html#blockedCookies) | string[] | undefined | Specify the cookie name(s) to never be written, this will cause any cookie name to never be created or updated, they will still be read unless also included in the ignoreCookies and may still be explicitly purged or deleted. If not provided defaults to the same list provided in ignoreCookies. (Since v2.8.8) | [getCookie](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/ICookieMgrConfig.html#getCookie) | `(name: string) => string` | null | Function to fetch the named cookie value, if not provided it will use the internal cookie parsing / caching. | | [setCookie](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/ICookieMgrConfig.html#setCookie) | `(name: string, value: string) => void` | null | Function to set the named cookie with the specified value, only called when adding or updating a cookie. | | [delCookie](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-web/interfaces/ICookieMgrConfig.html#delCookie) | `(name: string, value: string) => void` | null | Function to delete the named cookie with the specified value, separated from setCookie to avoid the need to parse the value to determine whether the cookie is being added or removed.if not provided it will use the internal cookie parsing / caching. | ## Cookie Handling From version 2.6.0, cookie management is now available directly from the instance and can be disabled and re-enabled after initialization. If disabled during initialization via the `disableCookiesUsage` or `cookieCfg.enabled` configurations, you can now re-enable via the [ICookieMgr](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ICookieMgr.html) `setEnabled` function. The instance based cookie management also replaces the previous CoreUtils global functions of `disableCookies()`, `setCookie(...)`, `getCookie(...)` and `deleteCookie(...)`. And to benefit from the tree-shaking enhancements also introduced as part of version 2.6.0 you should no longer uses the global functions. ### Simplified Usage of new instance Cookie Manager **General Guidance** When calling `getCookieMgr()` before the SDK has successfully initialized will return a temporary `ICookieMgr` instance that will have cookie support fully enabled, thus allowing the getting, setting and deleting of cookies. So unless you know that your configuration WILL ALLOW cookie usage you should delay accessing or using the cookie manager until after initialization. - appInsights.[getCookieMgr()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ICookieMgr.html).setEnabled(true/false) - appInsights.[getCookieMgr()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ICookieMgr.html).set("MyCookie", "thevalue"); - appInsights.[getCookieMgr()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ICookieMgr.html).get("MyCookie"); - appInsights.[getCookieMgr()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ICookieMgr.html).del("MyCookie"); > In v2.6.0 the `getCookieMgr()` is not directly available on the main entry points documented above for the snippet, NPM (`ApplicationInsights`) or React Plugin usages. As a workaround for this version you will need to access it via the `core` or `appInsights` properties as below (the `getCookieMgr()` will be available in later versions) > >- appInsights.**core.**[getCookieMgr()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ICookieMgr.html).xxxxx >- appInsights.**appInsights.**[getCookieMgr()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ICookieMgr.html).xxxxx **Snippet usage notes** The `getCookieMgr()` method, `core` and `appInsights` properties are only available AFTER the SDK has been successfully loaded and initialized. So you will need to only call or access the manager from within the onInit() callback function (available in snippet (v5) or above) or after you know that the SDK has been loaded and initialized, otherwise you will cause an exception, unless you also perform an existence check of the property or function. >**Additional Legacy snippet users for v2.6.0** > >If you are using a legacy snippet for your application (it is suggested that you upgrade), you will need to use the following options > >- appInsights.**core.**[getCookieMgr()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ICookieMgr.html).xxxxx >- appInsights.**appInsights.core.**[getCookieMgr()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ICookieMgr.html).xxxxx >- appInsights.**appInsightsNew.**[getCookieMgr()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ICookieMgr.html).xxxxx ## Tree-Shaking Support and enhancements As part of changes being introduced in version 2.6.0 we are deprecating and removing the *internal* usages of the static helper classes `CoreUtils`, `EventHelper`, `Util`, `UrlHelper`, `DateTimeUtils` and `ConnectionStringParser` to provide better support for tree-shaking algorithms so that unused code can be safely dropped when using NPM packages. [See Tree-Shaking Recommendations](TreeShakingRecommendations.md) ## Service Notification As part of changes being introduced in version 3.0.3, we are intergrating [cfgSync plugin](https://github.com/microsoft/ApplicationInsights-JS/tree/main/extensions/applicationinsights-cfgsync-js) and [throttle manager](https://microsoft.github.io/ApplicationInsights-JS/ThrottleMgr) to AISKU. For versions before 3.1.2, these components are disabled by default. For versions after 3.1.2, these components are **turned on by default**. See [feature opt-in status](https://microsoft.github.io/ApplicationInsights-JS/WebConfig) for more details. For users behind a firewall, see [how to disable fetching from default CfgSync CDN](https://microsoft.github.io/ApplicationInsights-JS/WebConfig#basic-usage). ## Single Page Applications By default, this SDK will **not** handle state based route changing that occurs in single page applications. To enable automatic route change tracking for your single page application, you can add `enableAutoRouteTracking: true` to your setup configuration. Currently, we support a separate [React plugin](#available-extensions-for-the-sdk) which you can initialize with this SDK. It will also accomplish route change tracking for you, as well as collect [other React specific telemetry](https://github.com/microsoft/applicationinsights-react-js). ## Source Map Support The minified callstack of your exception telemetry can be unminified in the Azure Portal. All existing integrations on the Exception Details panel will work with the newly unminified callstack. Drag and drop source map unminifying supports all existing and future JS SDKs (+Node.JS), so you do not need to upgrade your SDK version. To view your unminified callstack, 1. Select an Exception Telemetry item in the Azure Portal to view its "End-to-end transaction details" 2. Identify which source maps correspond to this call stack. The source map must match a stack frame's source file, but suffixed with `.map` 3. Drag and drop the source maps onto the call stack in the Azure Portal ![](https://i.imgur.com/Efue9nU.gif) ## Examples For runnable examples, see [Application Insights Javascript SDK Samples](https://github.com/topics/applicationinsights-js-demo) ## Application Insights Web Basic For a lightweight experience, you can instead install the basic version of Application Insights ``` npm i --save @microsoft/applicationinsights-web-basic ``` This version comes with the bare minimum amount of features and functionalities and relies on you to build it up as you see fit. For example, it performs no auto-collection (uncaught exceptions, ajax, etc). The APIs to send certain telemetry types, like `trackTrace`, `trackException`, etc, are not included in this version, so you will need to provide your own wrapper. The only api that is available is `track`. A [sample](https://github.com/Azure-Samples/applicationinsights-web-sample1/blob/master/testlightsku.html) is located here. ## Available extensions for the SDK | Extensions | NPM Version |---------------|------------- | [Angular](https://github.com/microsoft/applicationinsights-angularplugin-js) | [![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-angularplugin-js.svg)](https://www.npmjs.com/package/@microsoft/applicationinsights-angularplugin-js) | [React](https://github.com/microsoft/applicationinsights-react-js) | [![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-react-js.svg)](https://www.npmjs.com/package/@microsoft/applicationinsights-react-js) | [React Native](https://github.com/microsoft/applicationinsights-react-native) | [![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-react-native.svg)](https://www.npmjs.com/package/@microsoft/applicationinsights-react-native) Click here for a [Type Error Fixed Guideline](https://microsoft.github.io/ApplicationInsights-JS/ExtensionErrorSteps) ## Notification ### Error Handler The SDK's error handler will send the error stack trace **without encryption**. This provides full visibility into errors for diagnostics and troubleshooting, but be aware that sensitive information might be included in error messages or stack traces. ## Build a new extension for the SDK The SDK supports the ability to include multiple extensions at runtime. In order to create a new extension, please implement the following interface: [ITelemetryPlugin](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITelemetryPlugin.html) On initialization, config.extensions accepts an array of ITelemetryPlugin objects. These are hooked up and ITelemetryPlugin.processTelemetry() is chained based on priority of these plugins. Please note that higher the priority, the later your processing code will be invoked. The SDK supports a plugin model and channels can also be plugged in similarly (advanced scenario). Target scenarios for creating a brand new extension is to share a usage scenario that benefits multiple customers. Please follow guidelines Here is the priority ranges available: - Regular extension priority can be between 201 to 499. - Priorty range < 201 is reserved. - Priority range > 1000 is for channels (advanced scenario) [BaseTelemetryPlugin](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/classes/BaseTelemetryPlugin.html) To help with the creation of new extensions there is now a supported base class which can be used, this not only provides the common (boilerplate) implementations of common functions it will enable future plugins to automatically receive functional updates with the need to recode the plugins. it provides implementations for :- * [ITelemetryPlugin.setNextPlugin()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITelemetryPlugin.html) implementation to continuing supporting existing (non-shared) execution of plugins, however, new plugins should use the new [IProcessTelemetryContext.processNext()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IProcessTelemetryContext.html) moving forward as this support the creation of shared (singleton) plugins; * New [ITelemetryPlugin.isInitialized()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITelemetryPlugin.html) implementation * And several helper methods. * [processNext()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/classes/BaseTelemetryPlugin.html), - to call the next plugin using the context or the _nextPlugin value * [diagLog()](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/classes/BaseTelemetryPlugin.html): - to access the current [IDiagnosticLogger](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDiagnosticLogger.html) instance. If you are creating new extensions it is recommended that you extend from this base class so that your extension will automatically inherit any future enhancements that are added to the ITelemetryPlugin interface without it requiring updates. Usage: ```ts const customPluginInstance = new YourCustomPlugin() const appInsights = new ApplicationInsights({ config: { connectionString: 'YOUR_CONNECTION_STRING_GOES_HERE', extensions: [customPluginInstance] // Other Configuration Options... }}); appInsights.loadAppInsights(); ``` [ITelemetryPlugin](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITelemetryPlugin.html) has a simpler base type [IPlugin](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IPlugin.html) that you can instantiate for initialization purposes when SDK loads. ## Build & Test this repo 1. Install all dependencies ```sh npm install npm install -g @microsoft/rush ``` 2. Navigate to the root folder and update rush dependencies ```sh rush update ``` 3. Build and test ```sh rush build npm run test ``` ## Performance Application Insights JS adds a negligible amount of load time to your website. By using the snippet, minimal components of the library are quickly loaded. In the meantime, the full script is downloaded in the background. While the script downloads from the CDN, all tracking of your page is queued. Once the downloaded script finishes asynchronously initializing, all events that were queued are tracked. As a result, you will not lose any telemetry during the entire life cycle of your page. This setup process provides your page with a seamless analytics system, invisible to your users. > Summary: > > - ![current npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-web.svg) > - ![gzip compressed size](https://js.monitor.azure.com/scripts/b/ai.3.min.js.gzip.svg) > - **~15 ms** overall initialization time > - **Zero** tracking missed during life cycle of page ## Module Formats As part of packaging we produce [umd (Universal Module Definition)](https://github.com/umdjs/umd) modules using [rollupjs](https://www.rollupjs.org/guide/en/) which creates a wrapper that works for most users as it supports module loading and initialization with or without [RequireJS](https://requirejs.org/). However, there are some cases where your code doesn't directly use [RequireJS](https://requirejs.org/) but it is loaded into the runtime environment before your code and the 1DS SDK, in these cases the [rollupjs](https://www.rollupjs.org/guide/en/) wrapper registers (defines) but does not initialize (execute) the SDK and instead waits for the first to call "require()" before the module is executed eg. ```var aiSdk = require("@microsoft/applicationinsights-web");``` This situation can also occur when the scripts are loaded lazily, late or dynamically (__and__ RequireJs is present) as this can cause a race condition between the SDK and RequireJS, which will cause the same issue if RequireJS is loaded first. If users load Application Insights from the CDN via a script tag with require js running by other scripts, errors may occur. A typical error could be "Error: Mismatched anonymous define() module". The root reason is explained [here](https://requirejs.org/docs/errors.html#mismatch). To support this usage pattern we also produce and publish to the CDN endpoints an [iife (Immediately Invoked Function Expression)](https://www.codeproject.com/Articles/5265230/Understanding-all-JavaScript-Module-Formats-and-To#iife-module-javascript-module-pattern) module so that the SDK is always executed and initialized. To use these modules instead of using the default script name simply add ```.gbl``` before the ```.min.js``` eg. use ```.gbl.min.js``` instead of ```.min.js``` at the end of the script name. (Note: Since version 7, the gbl modules is set as default module to solve the potential [problem](#module-formats) caused by require.js) These modules are also included in the NPM packages within the ```bundle``` folder. Example (not complete) CDN paths for the current major version. | Module | Default Module (Supports loading via requireJs) | IIFE Module |--------|----------------|-------------- | [AISku
    (Main Sdk)](https://github.com/microsoft/ApplicationInsights-JS/tree/main/AISKU) | http://js.monitor.azure.com/scripts/b/ai.3.min.js
    http://js.monitor.azure.com/scripts/b/ai.2.min.js | http://js.monitor.azure.com/scripts/b/ai.3.gbl.min.js
    http://js.monitor.azure.com/scripts/b/ai.2.gbl.min.js | [Click Analytics Extension](https://github.com/microsoft/ApplicationInsights-JS/tree/main/extensions/applicationinsights-clickanalytics-js) | http://js.monitor.azure.com/scripts/b/ext/ai.clck.3.min.js
    http://js.monitor.azure.com/scripts/b/ext/ai.clck.2.min.js | http://js.monitor.azure.com/scripts/b/ext/ai.clck.3.gbl.min.js
    http://js.monitor.azure.com/scripts/b/ext/ai.clck.2.gbl.min.js | [Debug Plugin Extension](https://github.com/microsoft/ApplicationInsights-JS/tree/main/extensions/applicationinsights-debugplugin-js) | http://js.monitor.azure.com/scripts/b/ext/ai.dbg.3.min.js
    http://js.monitor.azure.com/scripts/b/ext/ai.dbg.2.min.js | http://js.monitor.azure.com/scripts/b/ext/ai.dbg.3.gbl.min.js
    http://js.monitor.azure.com/scripts/b/ext/ai.dbg.2.gbl.min.js | [Perf Mark/Measure Manager Extension](https://github.com/microsoft/ApplicationInsights-JS/tree/main/extensions/applicationinsights-perfmarkmeasure-js) | http://js.monitor.azure.com/scripts/b/ext/ai.prfmm-mgr.3.min.js
    http://js.monitor.azure.com/scripts/b/ext/ai.prfmm-mgr.2.min.js | http://js.monitor.azure.com/scripts/b/ext/ai.prfmm-mgr.3.gbl.min.js
    http://js.monitor.azure.com/scripts/b/ext/ai.prfmm-mgr.2.gbl.min.js As part of the CDN deployment and promoting new versions as the default we also provide both minor and explicit versions of all modules, so each published module will also include the following versions and formats. The example names are assuming version 3 as the current major version and 3.1 and the current minor. | Major | Minor | Patch (Explicit) | Description |------|--------|------------------|----------------- | ```ai.3.min.js```
    ```ai.2.min.js``` | ```ai.3.0.min.js```
    ```ai.2.8.min.js``` | ```ai.3.0.2.min.js```
    ```ai.2.8.16.min.js``` | Minified UMD version | ```ai.3.gbl.min.js```
    ```ai.2.gbl.min.js``` | ```ai.3.0.gbl.min.js```
    ```ai.2.8.gbl.min.js``` | ```ai.3.0.2.gbl.min.js```
    ```ai.2.8.16.gbl.min.js``` | Minified IIFE version
    (Recommended for v3.x) And the process of Promoting (or rolling back) a deployed version is simply a case of replacing the major and minor version of the script with the current explicit version ### CDN Debugging support We support 2 basic approaches for debugging the SDK via the CDN hosted scripts - Every Module includes a ```//# sourceMappingURL=xxxx``` at the end of the file and has the referenced map file uploaded to the CDN. - We also publish unminified versions of every module, just drop the ```.min``` from the script name (eg. ```https://js.monitor.azure.com/scripts/b/ai.3.gbl.js```) | Major | Minor | Patch (Explicit) | Description |------|--------|------------------|----------------- | ```ai.3.min.js.map```
    ```ai.2.min.js.map``` | ```ai.3.0.min.js.map```
    ```ai.2.8.min.js.map``` | ```ai.3.0.2.min.js.map```
    ```ai.2.8.16.min.js.map``` | Map file for the UMD versions | ```ai.3.gbl.min.js.map```
    ```ai.2.gbl.min.js.map``` | ```ai.3.0.gbl.min.js.map```
    ```ai.2.8.gbl.min.js.map``` | ```ai.3.0.2.gbl.min.js.map```
    ```ai.2.8.16.gbl.min.js.map``` | Map file for the IIFE versions | ```ai.3.js```
    ```ai.2.js``` | ```ai.3.0.js```
    ```ai.2.8.js``` | ```ai.3.0.2.js```
    ```ai.2.8.16.js``` | Unminified UMD versions | ```ai.3.gbl.js```
    ```ai.2.gbl.js``` | ```ai.3.0.gbl.js```
    ```ai.2.8.gbl.js``` | ```ai.3.0.2.gbl.js```
    ```ai.2.8.16.gbl.js``` | Unminified IIFE versions ## Nightly Builds To aid with testing and validation we also produce and publish nightly builds whenever there is a change from the previous build. These builds are published to the [NpmJs registry](https://www.npmjs.com/package/@microsoft/applicationinsights-web) and to the CDN automatically on a successful build / test pass. This process also [tags the source code](https://github.com/microsoft/ApplicationInsights-JS/tags) so that we can track the specific changes included using a nightly build specific version number which is the format "nightly-yymm-##" eg. ```nightly-2112-08``` These nightly builds will not be retained indefinitely and should only be used for __pre-production__ testing and/or validation of any changes that have not yet been released. ### NPM The NPM builds are tagged as "nightly" and can by downloaded using this as the version number ```npm install @microsoft/applicationinsights-web@nightly``` or using the nightly specific version number which is "nightly.yyyymm-###" (```npm install @microsoft/applicationinsights-web@2.7.3-nightly.2112-08```) where ## is the specific build number for the month (Note, slightly different version from the source code tag due to compatibility issues between the different systems). ### CDN These nightly builds are also uploaded to a different path on the CDN and explicitly have the ```-nightly``` added to the module name eg. ```/nightly/ai.2-nightly.min.js```, each nightly build is re-numbered assuming the next release will be a patch release. So if the last release was 2.7.2, then all nightly builds will be numbered 2.7.3-nightly. So to access simply update the URL used when downloading the required module. | Module | Nightly Build |--------|---------------- | [AISku (Main Sdk)](https://github.com/microsoft/ApplicationInsights-JS/tree/main/AISKU) | http://js.monitor.azure.com/nightly/ai.2-nightly.min.js | [Click Analytics Extension](https://github.com/microsoft/ApplicationInsights-JS/tree/main/extensions/applicationinsights-clickanalytics-js) | http://js.monitor.azure.com/nightly/ext/ai.clck.2-nightly.min.js | [Debug Plugin Extension](https://github.com/microsoft/ApplicationInsights-JS/tree/main/extensions/applicationinsights-debugplugin-js) | http://js.monitor.azure.com/nightly/ext/ai.dbg.2-nightly.min.js | [Perf Mark/Measure Manager Extension](https://github.com/microsoft/ApplicationInsights-JS/tree/main/extensions/applicationinsights-perfmarkmeasure-js) | http://js.monitor.azure.com/nightly/ext/ai.prfmm-mgr.2-nightly.min.js As with the normal release process the nightly builds also include major, minor, explicit, IIFE (```.gbl```), *.map and unminified versions, these are primarily available for validating changes between builds. | Module | CDN Path |--------|---------------- | Major | http://js.monitor.azure.com/nightly/ai.2-nightly.min.js
    http://js.monitor.azure.com/nightly/ai.2-nightly.gbl.min.js
    http://js.monitor.azure.com/nightly/ai.2-nightly.js
    http://js.monitor.azure.com/nightly/ai.2-nightly.gbl.js | Minor | http://js.monitor.azure.com/nightly/ai.2.7-nightly.min.js
    http://js.monitor.azure.com/nightly/ai.2.7-nightly.gbl.min.js
    http://js.monitor.azure.com/nightly/ai.2.7-nightly.js
    http://js.monitor.azure.com/nightly/ai.2.7-nightly.gbl.js | Explicit | http://js.monitor.azure.com/nightly/ai.2.7.3-nightly.2112-08.min.js
    http://js.monitor.azure.com/nightly/ai.2.7.3-nightly.2112-08.gbl.min.js
    http://js.monitor.azure.com/nightly/ai.2.7.3-nightly.2112-08.js
    http://js.monitor.azure.com/nightly/ai.2.7.3-nightly.2112-08.gbl.js ### Deployment process and alternate CDN endpoints When a new release is deployed the following occurs as part of the release - NPM packages are created and published to [NpmJs](https://www.npmjs.com/package/@microsoft/applicationinsights-web) - The new explicit versioned files (eg. `ai.2.7.2.js`; `ai.2.7.2.min.js`; `ai.2.7.2.gbl.min.js`; `ai.2.7.2.min.js.map`; etc) are uploaded to all cdn endpoints URL's (public, next and beta - details below) - We then go through a deployment process of "promoting" the new version to the "Major" (`ai.3.gbl.min.js`) and "Minor" (`ai.3.x.gbl.min.js`) release URL's to upgrade everyone to the newly released version based on the schedule listed below | Endpoint | Url | Schedule |----------|-------------|-------- | Beta | https://js.monitor.azure.com/beta/ai.3.gbl.min.js | Same day as the NPM release | Next | https://js.monitor.azure.com/next/ai.3.gbl.min.js | One additional work day after the `beta` URL promotion. | Public | https://js.monitor.azure.com/scripts/b/ai.3.gbl.min.js | Another One additional work day after the `next` URL promotion, (so 2 work days after initial release) unless this falls on the last work day of the week (eg. Friday) in which case it will be delayed until the first work day of the next work week. The milestones for each release should include both the deployment plan (as it's about to be released) or the final release times as with [v2.7.2](https://github.com/microsoft/ApplicationInsights-JS/milestone/58) It is expected that most users will be using the `Public` URL, however, it is also recommended that if you have a test or canary environment that you should use either the `beta` or `next` URL's so that you would be alerted first before any production users are impacted. If any issues are detected with the `beta` or `next` URL's as a new release is being deployed please raise a new [Issue](https://github.com/microsoft/ApplicationInsights-JS/issues) as soon as this is confirmed. ## Release Notes - [Releases](https://github.com/microsoft/ApplicationInsights-JS/releases) - [Changelist Notes](./RELEASES.md) ## Browser Support - ES5 Compliant browsers ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![IE](https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![Opera](https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png) --- | --- | --- | --- | --- | Latest ✔ | Latest ✔ | 9+ Full ✔ | Latest ✔ | Latest ✔ | > v3.x removed ES3 / IE8, if you need to retain ES3 (IE8) compatibility you will need to remain on the v2.x versions of the SDK, which is available on the old [master branch](https://github.com/Microsoft/ApplicationInsights-JS/tree/master). The 2.x branch will only receive critical bug fixes when no workaround exists — no new features or back-porting from later versions. ### Submitting a Change to this Project ```zsh <...added some code...> rush change <...enter details> git add <...your changes and rush change file...> git commit -m "info about your change" git push ``` ## Contributing Read our [contributing guide](./CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Application Insights. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. ## License [MIT](LICENSE) ================================================ FILE: RELEASES.md ================================================ # Releases > Note: ES3/IE8 compatibility will be removed in the future v3.x.x releases (scheduled for mid-late 2022), so if you need to retain ES3 compatibility you will need to remain on the 2.x.x versions of the SDK or your runtime will need install polyfill's to your ES3 environment before loading / initializing the SDK. ## 3.4.1 (April 7th, 2026) This is the first full supported release of the 3.4.x version line. While a 3.4.0-beta was previously released for early testing and validation, version 3.4.0 was not released as a standard supported version — 3.4.1 is the first production-ready release in this series. The `@microsoft/1ds-post-js` channel is numbered 4.4.1 and requires v3.4.1. ### Significant Changes (since 3.3.11) > The following are the significant changes since the previous full release (3.3.11). Some of these changes were previously included in the 3.4.0-beta release. - **W3C Trace State Support**: Added full support for managing W3C Trace State and sending headers in distributed tracing, including new distributed tracing modes `AI_AND_W3C_TRACE` and `W3C_TRACE` that enable the [`tracestate`](https://www.w3.org/TR/trace-context/#tracestate-header) header to be sent with requests when trace state information is available, the existing states will continue to not send the header. - **New Distributed Tracing Modes**: Added new `eDistributedTracingModes` enum values: - `AI_AND_W3C_TRACE` (17): Sends Application Insights headers + W3C `traceparent` + W3C `tracestate` headers (if state value is present) - `W3C_TRACE` (18): Sends only W3C `traceparent` + W3C `tracestate` headers (if state value is present) - **Enhanced Distributed Tracing**: Refactored the distributed tracing implementation to provide better support for the W3C Trace Context specification and prepare for future OpenTelemetry Span-style API integration. - **New W3C TraceState API**: Introduced the `IW3cTraceState` interface that provides a mutable, ordered list of key/value pairs for trace state information with proper parent-child relationships. - **OpenTelemetry Integration Preparation**: Added foundational OpenTelemetry interfaces (`IOTelSpanContext`, `IOTelTraceState`) to provide OpenTelemetry API compatibility. - **Additional Configuration**: Added new configuration properties for W3C trace state support: - `traceHdrMode`: Controls if the SDK should look for the `traceparent` and/or `tracestate` values from service timing headers or meta tags from the initial page load (in `IConfiguration`) - Enhanced `distributedTracingMode` property to support the new W3C trace state modes (in `ICorrelationConfig`) - **Dependencies Extension**: The dependency tracking extension now includes additional logic for W3C trace state handling, which may affect custom dependency listeners or initializers. The following interfaces and functions have been enhanced with W3C trace state support: - `IDependencyListenerDetails` interface now also includes a readonly `traceState` along with the previous `traceId`, `spanId`, `traceFlags` properties - `addDependencyListener()` function now provides access to W3C trace state information through the enhanced details object - `addDependencyInitializer()` function continues to work with existing dependency telemetry processing - Custom dependency listeners can now access and modify W3C trace state information before requests are sent - **Enhanced Cookie Management**: Cookie values are now cached in memory when cookies are disabled instead of being lost, enabling support for consent banner workflows where cookies must be temporarily disabled until user approval. Automatic flushing occurs when cookies are re-enabled. - **OsPlugin Reliability Improvements**: Improved OsPlugin with proactive OS retrieval, unload handling, and session caching for more reliable OS detection. - **URL Redaction Enhancements**: Made URL redaction more dynamic for improved flexibility in field redaction scenarios. ### Package Deprecation The following packages have been merged into `@microsoft/applicationinsights-core-js` and are now **deprecated**. They continue to be published as backward-compatible shims (re-exporting from Core) so existing code will not break, but they are no longer used as dependencies by the main SDK packages. You should stop importing from these packages and migrate to `@microsoft/applicationinsights-core-js` directly. - **`@microsoft/applicationinsights-common`** — All exports have been merged into `@microsoft/applicationinsights-core-js`. The package is now a compatibility shim that re-exports from Core. See the [Migration Guide](https://github.com/microsoft/ApplicationInsights-JS/blob/main/docs/upgrade/MergeCommonToCore.md) for details on updating your imports. This package will be removed in a future major release (4.0.0). - **`@microsoft/1ds-core-js`** — All exports have been merged into `@microsoft/applicationinsights-core-js`. The package is now a compatibility shim that re-exports from Core. See the [1DS Core Migration Guide](https://github.com/microsoft/ApplicationInsights-JS/blob/main/shared/1ds-core-js/README.md) for class/import name changes and migration steps. Consumers should update their imports to reference `@microsoft/applicationinsights-core-js` directly. This package will be removed in a future major release (4.0.0). ### Breaking Changes The following is a list of known breaking changes for anyone attempting to implement the interfaces, for end-users / consumers of the existing interface this is considered to be only a potential breaking change as the existing functions are still provided and provide the same level of functionality. The breaking nature of these changes is for anyone attempting to provide their own implementation of these changes. #### Interface Changes - The `IDistributedTraceContext` interface has been significantly expanded to include W3C trace state management capabilities, which may affect custom telemetry processors that interact with distributed tracing context. - Added additional "required" property accessors which update ONLY the current trace context instance and DO NOT update any parent context instances (`pageName`, `traceId`, `spanId` and `traceFlags`). - The previous set functions continue to also update (replace) any parent context values for existing backward compatability, but have been marked as depracted and will be removed in a future release due to their side-effects of overwriting the parent values. ### Potential Breaking Changes - **Class Removal**: The `TelemetryTrace` class has been removed and is no longer exported as part of the distributed tracing refactoring, with its functionality integrated into the new W3C trace state implementation. - The properties `telemetryTrace` is now a complete adpater to the existing `core.getTraceCtx()` value and as such is now marked as deprecated and will be removed in a future release. - The value of the `appInsights.context.telemetryTrace` is no longer an instance of this removed class. - **Trace Context Initialization**: Due to the distributed tracing refactoring, the core instance and SDK will now always have a valid `traceId` available through `core.getTraceCtx()`. The `traceId` will be either a newly generated random value or inherited from any detected parent trace context. This ensures consistent trace context availability but may affect applications that previously relied on the absence of a `traceId` to determine if distributed tracing was active. - **Dependencies Extension - ajaxRecord Class Removal**: The internal `ajaxRecord` class has been removed and is no longer exported from the dependencies extension (`@microsoft/applicationinsights-dependencies-js`). The internal implementation now implements the new [`IAjaxRecordData`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-dependencies-js/interfaces/IAjaxRecordData.html) interface. This class was previously used internally for AJAX request tracking and was referenced in the `IInstrumentationRequirements.includeCorrelationHeaders()` function signature. **Important**: The previous exporting of the `ajaxRecord` class was unintentional and was never meant to be part of the public API - it was an internal implementation detail that inadvertently became accessible to external code. - **Previous Signature**: `includeCorrelationHeaders(ajaxData: ajaxRecord, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented): any` - **New Signature**: `includeCorrelationHeaders(ajaxData: IAjaxRecordData, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented): any` - **New Interface**: The [`IAjaxRecordData`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-dependencies-js/interfaces/IAjaxRecordData.html) interface has been introduced to replace the `ajaxRecord` class in public API signatures and provides access to essential AJAX request properties: - `getAbsoluteUrl(): string | null` - Gets the absolute URL for the request - `getPathName(): string | null` - Gets the sanitized path name for the request URL - `traceCtx: IDistributedTraceContext` - The distributed trace context for the request - `requestHeaders: { [key: string]: string }` - Object containing request headers - `aborted?: number` - Indicates whether the request was aborted - `context?: { [key: string]: any }` - Optional context object for dependency listeners - **Impact**: This change only affects custom implementations that directly referenced the `ajaxRecord` class or implemented the `IInstrumentationRequirements` interface. Standard SDK usage and most custom dependency listeners/initializers are unaffected. - **Migration**: If your code previously referenced `ajaxRecord` or implemented `IInstrumentationRequirements`, update it to use the new [`IAjaxRecordData`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-dependencies-js/interfaces/IAjaxRecordData.html) interface, which provides the same essential properties with proper TypeScript definitions and comprehensive JSDoc documentation. - **Need Help?**: If you discover that your code depends on other functions or properties from the dependencies extension that are no longer exported and you believe should be part of the public API, please [raise an issue](https://github.com/microsoft/ApplicationInsights-JS/issues) with details about your use case so we can review and potentially provide a proper public API alternative. - **Flush Method Signature Change**: Renamed `flush` method parameter from `async` to `isAsync` in `IChannelControls` interface to avoid potential keyword conflicts (only affects code that relies on named parameters). - Fixed return type of `flush` method to properly include `boolean` when callbacks complete synchronously ### Potential behavioral changes This release enhances the cookie management behavior when cookies are disabled. Previously, when cookies were disabled, calls to `cookieMgr.set()` would return `false` and cookie values would be lost. Now, these operations are cached in memory and automatically applied when cookies are re-enabled to allow for cookie compliance banners and delayed approval. **Behavior changes:** - `cookieMgr.set()` now returns `true` when cookies are disabled (because values are cached), instead of `false` - `cookieMgr.get()` now returns cached values when cookies are disabled, instead of empty strings - `cookieMgr.del()` operations are now cached and applied when cookies are re-enabled - Applications can now recover cookie state after temporary cookie blocking scenarios **These changes improve data persistence and are considered enhancements rather than breaking changes.** If your application logic depends on the previous behavior of `set()` returning `false` when cookies are disabled, you may need to check `cookieMgr.isEnabled()` instead, or configure `disableCookieCache: true` in your `cookieCfg` to maintain the previous behavior. ### Known Limitations - **SDK Loader (Snippet) automatically downgrades to v2.x on Internet Explorer**: When the SDK Loader detects that Internet Explorer is being used (via the `msie` or `trident/` user agent strings), it automatically rewrites the CDN URL to load the v2.x SDK instead of v3.x (e.g. `ai.3.gbl.min.js` becomes `ai.2.gbl.min.js`). This means any v3.x-only APIs — including the new OpenTelemetry-based APIs — will not be available for users on Internet Explorer. If your code uses these newer APIs, you should check for their existence before calling them. This fallback does not apply when using the NPM package directly. ### Changelog - #2719 Improve OsPlugin reliability: proactive OS retrieval, unload handling, and session caching - #2718 Address issue with the AppInsightsExtCore using the wrong version number - #2716 Make URL Redaction more dynamic - #2712 [Main] Merge 1ds-core-js into applicationinsights-core-js - #2710 [Main] Merge Trace API Features from Beta - #2628 Fix flush method root cause - handle async callbacks in _doSend with proper error handling - **Potential breaking change**: Renamed `flush` method parameter from `async` to `isAsync` in `IChannelControls` interface to avoid potential keyword conflicts (only affects code that relies on named parameters) - Fixed return type of `flush` method to properly include `boolean` when callbacks complete synchronously - Fixed root cause where `_doSend()` couldn't handle asynchronous callbacks from `preparePayload()` when compression is enabled - `await applicationInsights.flush()` now works correctly with compression enabled - Added proper error handling and promise rejection propagation through async callback chains - Improved handling of both synchronous and asynchronous callback execution patterns - No polling overhead - uses direct callback invocation for better performance - #2631 [Feature] Update the ICookieMgr implementation to write cookies after being enabled - **Enhancement**: Cookie values are now cached in memory when cookies are disabled instead of being lost, enabling support for consent banner workflows where cookies must be temporarily disabled until user approval - **Enhancement**: Automatic flushing occurs when cookies are re-enabled via `setEnabled(true)` or dynamic configuration changes - **Enhancement**: Added `disableCookieDefer` configuration option to maintain backward compatibility with previous behavior (defaults to false) - **Behavior change**: `cookieMgr.set()` now returns `true` when disabled (cached) instead of `false` - **Behavior change**: `cookieMgr.get()` now returns cached values when disabled instead of empty strings - [Beta] Add W3c Trace State support / handling and refactor distributed trace handling to prepare for OpenTelemetry Span style API / management **Full Changelog**: https://github.com/microsoft/ApplicationInsights-JS/compare/3.3.11...3.4.1 ## 3.4.0-beta (February 23rd, 2026) ### Significant Changes - **AppInsightsCommon Merged into AppInsightsCore**: The `@microsoft/applicationinsights-common` package has been merged into `@microsoft/applicationinsights-core-js` to simplify dependency management and improve tree-shaking capabilities. - All exports previously in `applicationinsights-common` are now available from `applicationinsights-core-js` - The `applicationinsights-common` package continues to work as a compatibility layer (re-exports from Core) - No breaking changes to existing APIs - See the [Migration Guide](docs/upgrade/MergeCommonToCore.md) for details on updating your imports - **Timeline**: The Common package will be deprecated and eventually removed in version 4.0.0 - **W3C Trace State Support**: Added full support for managing W3C Trace State and sending headers in distributed tracing, including new distributed tracing modes `AI_AND_W3C_TRACE` and `W3C_TRACE` that enable the [`tracestate`](https://www.w3.org/TR/trace-context/#tracestate-header) header to be sent with requests when trace state information is available, the existing states will continue to not send the header. - **New Distributed Tracing Modes**: Added new `eDistributedTracingModes` enum values: - `AI_AND_W3C_TRACE` (17): Sends Application Insights headers + W3C `traceparent` + W3C `tracestate` headers (if state value is present) - `W3C_TRACE` (18): Sends only W3C `traceparent` + W3C `tracestate` headers (if state value is present) - **Enhanced Distributed Tracing**: Refactored the distributed tracing implementation to provide better support for the W3C Trace Context specification and prepare for future OpenTelemetry Span-style API integration. - **New W3C TraceState API**: Introduced the `IW3cTraceState` interface that provides a mutable, ordered list of key/value pairs for trace state information with proper parent-child relationships. - **OpenTelemetry Integration Preparation**: Added foundational OpenTelemetry interfaces (`IOTelSpanContext`, `IOTelTraceState`) to provide OpenTelemetry API compatibility. - **Additional Configuration**: Added new configuration properties for W3C trace state support: - `traceHdrMode`: Controls if the SDK should look for the `traceparent` and/or `tracestate` values from service timing headers or meta tags from the initial page load (in `IConfiguration`) - Enhanced `distributedTracingMode` property to support the new W3C trace state modes (in `ICorrelationConfig`) - **Dependencies Extension**: The dependency tracking extension now includes additional logic for W3C trace state handling, which may affect custom dependency listeners or initializers. The following interfaces and functions have been enhanced with W3C trace state support: - `IDependencyListenerDetails` interface now also includes a readonly `traceState` along with the previous `traceId`, `spanId`, `traceFlags` properties - `addDependencyListener()` function now provides access to W3C trace state information through the enhanced details object - `addDependencyInitializer()` function continues to work with existing dependency telemetry processing - Custom dependency listeners can now access and modify W3C trace state information before requests are sent ### Breaking Changes The following is a list of known breaking changes for anyone attempting to implement the interfaces, for end-users / consumers of the existing interface this is considered to be only a potential breaking change as the existing functions are still provided and provide the same level of functionality. The breaking nature of these changes is for anyone attempting to provide their own implementation of these changes. #### Interface Changes - The `IDistributedTraceContext` interface has been significantly expanded to include W3C trace state management capabilities, which may affect custom telemetry processors that interact with distributed tracing context. - Added additional "required" property accessors which update ONLY the current trace context instance and DO NOT update any parent context instances (`pageName`, `traceId`, `spanId` and `traceFlags`). - The previous set functions continue to also update (replace) any parent context values for existing backward compatability, but have been marked as depracted and will be removed in a future release due to their side-effects of overwriting the parent values. ### Potential Breaking Changes - **Class Removal**: The `TelemetryTrace` class has been removed and is no longer exported as part of the distributed tracing refactoring, with its functionality integrated into the new W3C trace state implementation. - The properties `telemetryTrace` is now a complete adapter to the existing `core.getTraceCtx()` value and as such is now marked as deprecated and will be removed in a future release. - The value of the `appInsights.context.telemetryTrace` is no longer an instance of this removed class. - **Trace Context Initialization**: Due to the distributed tracing refactoring, the core instance and SDK will now always have a valid `traceId` available through `core.getTraceCtx()`. The `traceId` will be either a newly generated random value or inherited from any detected parent trace context. This ensures consistent trace context availability but may affect applications that previously relied on the absence of a `traceId` to determine if distributed tracing was active. - **Dependencies Extension - ajaxRecord Class Removal**: The internal `ajaxRecord` class has been removed and is no longer exported from the dependencies extension (`@microsoft/applicationinsights-dependencies-js`). The internal implementation now implements the new [`IAjaxRecordData`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-dependencies-js/interfaces/IAjaxRecordData.html) interface. This class was previously used internally for AJAX request tracking and was referenced in the `IInstrumentationRequirements.includeCorrelationHeaders()` function signature. **Important**: The previous exporting of the `ajaxRecord` class was unintentional and was never meant to be part of the public API - it was an internal implementation detail that inadvertently became accessible to external code. - **Previous Signature**: `includeCorrelationHeaders(ajaxData: ajaxRecord, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented): any` - **New Signature**: `includeCorrelationHeaders(ajaxData: IAjaxRecordData, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented): any` - **New Interface**: The [`IAjaxRecordData`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-dependencies-js/interfaces/IAjaxRecordData.html) interface has been introduced to replace the `ajaxRecord` class in public API signatures and provides access to essential AJAX request properties: - `getAbsoluteUrl(): string | null` - Gets the absolute URL for the request - `getPathName(): string | null` - Gets the sanitized path name for the request URL - `traceCtx: IDistributedTraceContext` - The distributed trace context for the request - `requestHeaders: { [key: string]: string }` - Object containing request headers - `aborted?: number` - Indicates whether the request was aborted - `context?: { [key: string]: any }` - Optional context object for dependency listeners - **Impact**: This change only affects custom implementations that directly referenced the `ajaxRecord` class or implemented the `IInstrumentationRequirements` interface. Standard SDK usage and most custom dependency listeners/initializers are unaffected. - **Migration**: If your code previously referenced `ajaxRecord` or implemented `IInstrumentationRequirements`, update it to use the new [`IAjaxRecordData`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-dependencies-js/interfaces/IAjaxRecordData.html) interface, which provides the same essential properties with proper TypeScript definitions and comprehensive JSDoc documentation. - **Need Help?**: If you discover that your code depends on other functions or properties from the dependencies extension that are no longer exported and you believe should be part of the public API, please [raise an issue](https://github.com/microsoft/ApplicationInsights-JS/issues) with details about your use case so we can review and potentially provide a proper public API alternative. ### Changelog - [Beta] Add W3c Trace State support / handling and refactor distributed trace handling to prepare for OpenTelemetry Span style API / management ## 3.3.11 (January 12th, 2026) ### Changelog - #2642 Separate BeaconSendFailure and BeaconSendFailure from SizeLimitExceeded - #2675 Fix offline channel recovery for Offline -> Online (#2674) - #2666 Fix unload() to return promise when called without parameters - #2667 Add a check to prevent non-string URLs from being passed to fieldRedaction method #### Infrastructure changes - #2684 Fix minor issue with E2E test - #2681 Add redact URL configuration in readme - #2676 Fix Flakey Ajax test which has race condition - #2670 Fix static web CDN test assertion (Fixes failing CI tests) ### Web snippet 1.2.3 (November 10, 2025) - #2659 [Web-Snippet] [BUG] @microsoft/applicationinsights-web-snippet Fix Snippet Loader Error ## 3.3.10 (Sept 22nd, 2025) ### Changelog - #2649 [Main][Task] 27922617: Provide Custom Provider Under Web Worker for Offline Channel - #2638 [Main][Task] 34470593: Update Async Tests Under Dependencies Extension To Use the Modern AsyncQueue Pattern - #2637 [Main][Task] 34470593: Update AISKU Async Tests To Use the Modern AsyncQueue Pattern - #2636 Fix TypeError in Click Analytics Data Collector - #2633 Fix flush method root cause - handle async callbacks in _doSend with proper error handling - #2632 [Feature] Implement cookie caching when disabled and automatic flushing when enabled with backward compatibility option - #2625 Add Azure API Management proxy documentation to FAQ sections - #2607 Update Async Tests Under AISKULight to Use the Modern AsyncQueue Pattern - #2597 Fix TypeScript compatibility issue with ITelemetryPlugin interface - #2595 Fix trackPageView not resetting maxAjaxCallsPerView counter - #2583 Create IAnalyticsConfig interface to properly define AnalyticsPlugin configuration subset - #2625 Add Azure API Management proxy documentation to FAQ sections - #2627 Add weekly GitHub action to delete closed and merged branches - #2635 Fix issue #2634 moving the conditional check for filtering - #2549 Redacting urls before sending to telemetry data - #2622 Suppressed credentials inline to avoid credscan false positive ### Potential breaking changes Renamed `flush` method parameter from `async` to `isAsync` in `IChannelControls` interface to avoid potential keyword conflicts (only affects code that relies on named parameters) - Fixed return type of `flush` method to properly include `boolean` when callbacks complete synchronously - Fixed root cause where `_doSend()` couldn't handle asynchronous callbacks from `preparePayload()` when compression is enabled - `await applicationInsights.flush()` now works correctly with compression enabled - Added proper error handling and promise rejection propagation through async callback chains - Improved handling of both synchronous and asynchronous callback execution patterns - No polling overhead - uses direct callback invocation for better performance **Interfaces change:** ```typescript // Before: flush(async: boolean = true, callBack?: (flushComplete?: boolean) => void): void | IPromise; // After: flush(isAsync: boolean = true, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void | IPromise; ``` **This is only a breaking change if you rely on named parameters.** If you have custom channels or plugins that implement the `IChannelControls` interface directly and rely on passing named parameters, you will need to update the parameter name from `async` to `isAsync` in your implementation. This release also includes: - Support for custom providers for Offline Channel which has added `customProvider` and `customUnloadProvider` interfaces to the `IOfflineChannelConfiguration`. - `IAnalyticsConfig` is exported for Analytics extension. - `redactUrls` and `redactQueryParams` are added to `IConfiguration` to support URL redaction. ### Potential behavioral changes This release enhances the cookie management behavior when cookies are disabled. Previously, when cookies were disabled, calls to `cookieMgr.set()` would return `false` and cookie values would be lost. Now, these operations are cached in memory and automatically applied when cookies are re-enabled to allow for cookie compliance banners and delayed approval. **Behavior changes:** - `cookieMgr.set()` now returns `true` when cookies are disabled (because values are cached), instead of `false` - `cookieMgr.get()` now returns cached values when cookies are disabled, instead of empty strings - `cookieMgr.del()` operations are now cached and applied when cookies are re-enabled - Applications can now recover cookie state after temporary cookie blocking scenarios **These changes improve data persistence and are considered enhancements rather than breaking changes.** If your application logic depends on the previous behavior of `set()` returning `false` when cookies are disabled, you may need to check `cookieMgr.isEnabled()` instead, or configure `disableCookieCache: true` in your `cookieCfg` to maintain the previous behavior. ## 3.3.9 (June 25th, 2025) This release contains an important fix for a change introduced in v3.3.7 that caused the `autoCaptureHandler` to incorrectly evaluate elements within `trackElementsType`, resulting in some click events not being auto-captured. See more details [here](https://github.com/microsoft/ApplicationInsights-JS/issues/2589). ### Changelog - #2556 Update SDK Loader to rename the snippet postfix file to avoid CodeQL scanning issues - #2586 [AI][Task] 33246973: Update Readme on Error Handler - #2581 Export ICorrelationConfig interface from dependencies extension - #2587 Click Analytics - Fix capturning of HTML events ## Web Snippet Release 1.2.2 (June 2nd, 2025) This release adds support for Trusted Types in the Application Insights JavaScript SDK snippet loader. See more details [here](https://github.com/microsoft/ApplicationInsights-JS/blob/main/tools/applicationinsights-web-snippet/trustedTypeSupport.md). ### Changelog - #2407 Custom Trusted Type Policy Support for Snippet Script Injection ## 3.3.8 (May 22nd, 2025) This release contains an important fix for a change introduced in v3.3.7 that caused a ReferenceError exception to be thrown when running in strict mode. See more details [here](https://github.com/microsoft/ApplicationInsights-JS/issues/2529). ### Changelog - #2524 Update Components to address governance issues - #2536 Fix ReferenceError in Click Analytics v3.3.7 by reordering variable declaration - #2530 Add negative isArray check to _isConfigDefaults ## 3.3.7 (May 7th, 2025) ### Potential breaking change This release contains a potential breaking change due to the new compress api feature added. If you are using a Proxy to redirect your telemetry to your own endpoint or are relying on the events to be uncompressed (this feature is initially disabled and it is intended to be enabled by the service in the near future), it is recommended to either update collection endpoint to support GZip or to explicitly disable the feature. See more details [here](https://github.com/Microsoft/ApplicationInsights-JS?tab=readme-ov-file#feature). ### Changelog - #2518 Remove Generated docs from the repo - #2514 Address issues with isFeatureEnabled changes - #2517 Update Components to address governance issues - #2501 [Main][Task]31233527:Change Default RequestSizeLimitBytes - #2507 [main] Handle race condition during unload - #2513 [Main][Task]32698211: Add a Config to Allow Users to Change Max Number of Events Per Batch - **Note**: New Config `maxEvtPerBatch` is added to the post channel `IChannelConfiguration`. - #2511 [Main][Task]31233527: Add a Config to Allow Users to Change RequestSizeLimitBytes - **Note**: New Config `requestLimit` is added to the post channel `IChannelConfiguration`. - #2506 Drop correlation header to be passed on the dependency - **Note**: Option to drop the enrichment of correlation header during dependency processing is added to `DependencyListenerFunction` - #2504 [main] [Click analytics] not logging no native html input elements - **Note**: `trackElementTypes` is added to `IClickAnalyticsConfiguration` to allow additional, configurable HTML element types to be tracked in addition to the default set - #2451 [main] enable compress api in 1ds-post-channel and applicationinsights-channel - **Note**: Using compress api feature is added through feature flag `zipPayload` and is currently disabled by default. See [how to enable this feature](https://github.com/Microsoft/ApplicationInsights-JS?tab=readme-ov-file#feature) and [more details](https://github.com/microsoft/ApplicationInsights-JS/blob/123ba4cd38f1478e91547d36c41668599834c734/shared/AppInsightsCore/src/JavaScriptSDK.Interfaces/IConfiguration.ts#L192). - #2489 [main][stats beat] implement stats beat in application insights ## 3.3.6 (March 4th, 2025) ### Changelog - #2481 [Main][Task]31338239: Add Config to allow excluding the configuration endpoints from being reported - #2486 Minification improvements ## 3.3.5 (Feb 3rd, 2025) ### Changelog #### Issues - #2430 [BUG] Type signature for stopTrackEvent is incorrect - #2442 [BUG] [Snippet] Unhandled exceptions are reported twice - #2470 [BUG] @microsoft/applicationinsights-channel-js lacks a proper repository URL - #2467 [BUG] The regex used to parse the stack trace appears to be skipping anonymous lines - This fixes the portal missing stack frames which are from anonymous functions due to missed parsing of stack frames with unexpected formatting. #### Commits - #2428 [main] [snippet] Integrate 1DS with AI Snippet Generation - #2443 Update Stale Issue action - #2445 [main] snippet generation fix for pr #2428 - #2446 [main] eliminate warning raised by tsdoc - #2447 [main] [debug plugin] upgrade manifast to v3 - #2450 [main][doc] Type signature for stopTrackEvent is incorrect #2430 - #2448 [main] fix tsdoc error for param and type tag - #2452 [main][fix] rush fix - #2459 [Main][Task]30499129: Turn on CDN Deprecation Message with Sampling Rate with 10% Each Day - #2458 URGENT ACTION: Stop using az416426.vo.msecnd.net - #2460 [ThrottleMgr] Turn on Test CDN Deprecation Message with Sampling Rate with 100% Each Day - #2461 Update config version to 1.0.1 - #2463 [main][cfgsync] update test based on new config setting - #2462 [main][debug tool] fix the way of calling chrome storage and add new url - #2464 Update Code Owners - #2465 [main][debug tool] enable check compressed data - #2468 [Main][Task]31041354: Increase CDN Deprecation Message Sampling Rate to 20% - #2471 [Main][Task]31111291: Fix Repo links in package.json - #2455 [main] fix rush warning message - #2473 Update rush version ## 3.3.4 (Oct 30th 2024) ### Changelog - #2426 [Main][Task]29626594: PerfManager Should be Created without Customized CreatePerfMgr Function - #2421 [Main]: Make file size checks flexible for nightly/dev builds - #2434 [Main][Task]29884493: Add a Function to Export Offline Listener From Sender - #2437 [Main][Task]29519727: Better Handle Sender Dynamic Changes - #2438 [Main][Task]29445623: Update CfgSync Config Readme - #2439 [BUG] Sourcemap load errors in debugger from dependencies - #2429 Readme - Remove double negative ## 3.3.3 (Sep 23rd 2024) ### Changelog - #2401 [Main][Task]28966399: Separate critical events and non-critical events for Offline Support - **Note**: New Config `splitEvts` is added to Offline Channel Config. By enabling it, offline events will be batched and saved separately based on persistence level - #2413 [Main][Task] 29445638: Fix Promise Initialization Sender Config Issue - **Note**: the issue [ApplicationInsights Channel (Sender) endpoint Url Promise is Always Pending](https://github.com/microsoft/ApplicationInsights-JS/issues/2414) is resolved - #2416 [Main][Task]29519574: Update AISKU Light to better handle Init Promise - #2418 [Main][Task]29465842: Update Promise Initialization Post Channel - #2404 [main] fix expCfg to be optional - #2407 [main] Custom Trusted Type Policy Support for Snippet Script Injection - #2409 [main] Trusted Type Policy Support for nounce tag ## 3.3.2 (Sep 3rd, 2024) ### Changelog - #2396 [Main] Update generated typedoc documentation - #2397[Main] Change tslib peerDependency from "*" to open range - #2391 [Main] enhance exception telemetry with customer log Information - Note: Config `expCfg` is moved from `IConfig` to `IConfiguration`(this change is going to cause the TypeScript type error). ## 3.3.1 (Aug 7th, 2024) ### Changelog - #2379 [Main][Task]28644993: Update Online Sender Status Code Check with Offline Mode - #2380 [Main][Task]28751664: Fix Offline Circular Dependency - #2386 [Main][Task]28846327: Fix Offline Default Max in Storage Time to 7 Days - #2387 [Main][Task]27760339: Typedoc is not including ILoadedPlugin - #2381 [Main] [CDN Publishing] Cleanup AzureRM scripts from AI and 1DS - #2377 Fix Nightly Size Tests - #2389 [main] fix AI Basic Sku by exporting proxy function - #2373 add withCredentials config - #2388 [main] enhance exception telemetry with optional script Information - !! **New config `expCfg`** is available to provide more details of exception telemetry. See more details [here](https://microsoft.github.io/ApplicationInsights-JS/exceptionTelemetry) ### Web snippet additional update to 1.2.1 (July 10th, 2024) This release includes fix for dependency problem in version 1.2.0, check [#2369](https://github.com/microsoft/ApplicationInsights-JS/issues/2369) for more detail. ### Changelog - #2374 [main][snippet] remove the snippet dependency on web package ### Web snippet additional update to 1.2.0 (June 21st, 2024) This release includes support for multiple snippet loading. Snippets with different names (passed in by the user via configuration; check [##2355](https://github.com/microsoft/ApplicationInsights-JS/issues/2355) and README for more details) can now run simultaneously. Additionally, users can pass in a customized configuration with getSdkLoaderScript to get a ready-to-use snippet. Users can also enable Integrity Check and minimize snippet loading time by setting sri to true. ### Changelog - #2365 [main][snippet] prepare new snippet release, add support for more config - #2360 [main] set script attribut to avoid race condition when multiple sdks are inited #2355 - #2339 [main] create snippet mini loader ## 3.3.0 (July 1st, 2024) ### Potential breaking change This release contains a potential break change due to enhancing the definition of the [IConfiguration](https://github.com/microsoft/ApplicationInsights-JS/blob/main/shared/AppInsightsCore/src/JavaScriptSDK.Interfaces/IConfiguration.ts) to support Promise types for the connectionString, instrumentationKey and endpointURL; any extension that relies on these base interfaces will VERY likely cause TypeScript to fail with potential warnings about the types being different. ### Changelog - #2371 Bump @microsoft/rush from 5.97.1 to 5.129.6 - #2340 [Main][Task]27939476: Initialization with iKey and endpoint to be promises !! potential breaking changes. IConfiguration support Promise types for the connectionString, instrumentationKey and endpointURL - #2366 [Sdk Loader] Increase version to 1.2.0 - #2367 [main] update the way to generate ajax perforamance mark prefix ## 3.2.2 (June 11th, 2024) ### Changelog - #2356 [Main][Task]27488189: Modify offline support enums for isolated mode - #2357 [Main][Task]28050373: Expose Offline Support SendNextBatch function - #2358 [Main][Task]27080650: Initialization Should Handle Offline Support Dependency - #2362 [Main]Publishing: Add support for Az Modules instead of AzureRM Modules - #2360 set script attribut to avoid race condition when multiple sdks are inited ## 3.2.1 (May 9th, 2024) ### Changelog - #2333 [Main][Task]27749889: Change AISKU Sync Mode to Receive - #2335 [Main][Task]27681441: Fix async tests for MsAzure Migration - #2338 [Main][Task]27923018: Post Channel getOfflineSupport should set correct headers and url based on payload data - #2342 [Main][Task]27923018: 1ds post getOffline support url fix ## 3.2.0 (Apr 23rd, 2024) !! CfgSync plugin is turned on. Throttling Ikey depreciation message is enabled with sampling rate 0.0001% [##2317](https://github.com/microsoft/ApplicationInsights-JS/pull/2317) !! Sender has breaking changes. The key used for session storage is changed and items stored in the storage now contain retry counts. [##2324](https://github.com/microsoft/ApplicationInsights-JS/pull/2324) ### Changelog - #2371 [Main][Task]27365739 Turn on Ikey depreciation message with sampling rate 0.0001% - #2319 [Main] Fix config release script overwrite flag and cache time - #2321 [Main] Default request headers content-type for 1ds should be x-json-stream only ing - #2324 [Main][Task]27079894 Add a max retry count for Sender - #2325 [Main][Task]25716927: Change default CfgSync values to turn on the ikey deprecation message - #2331 [Main] Resetting the DataCacheHelper version number back to current version (from 3.0.5) - #2332 [Main][Task]27742145: Change nonOverrideCfgs to be added only during initialization - #2333 [Main][Task]27749889: Change AISKU Sync Mode to Receive ## 3.1.2 (Mar 21st, 2024) !! Critical Bug fix for Memoery Leak !! [#2311](https://github.com/microsoft/ApplicationInsights-JS/issues/2311) It also contains a packaging fix for webpack [#2307](https://github.com/microsoft/ApplicationInsights-JS/issues/2307) (caused by [#2306]](https://github.com/microsoft/ApplicationInsights-JS/issues/2306) ) and ### Changelog - #2307 ApplicationInsights-JS latest version 3.1.1 giving TypeError: Cannot read properties of undefined (reading 'getCrypto') - #2306 [BUG] Circular dependencies - #2311 [BUG] Excessive memory usage for SPA where unload hooks keep accumulating - #2299 [Main][Task]27156360: Add json config cdn details to tool folder - #2308 [Main][Task]27221819: Remove node 14 (from ci.yml) ## 3.1.1 (Mar 12th, 2024) ### Changelog - #2296 [BUG] remove 403 as a “retriable” error code - #2276 Update api-docs (typedoc) with the current 3.1.0 release details - #2281 [Main][Task]26681188: Handle endpoint url change for offline channel and add notification mgr - #2282 Addng two new PII Kind values for IPv6 scrubbing and dropping data. - #2285 [Main][Task]25693679: Extract common sendPost implementation for online and offline sender - #2197 [main] [BUG] using EndPointUrl (and IngestionEndpoint) results in Telemetry sent to incorrect urls - #2288 [Main][Task]27064950: Add doc on adding offline support channel - #2295 [Main][Task]27064983: Update post channel to use sender post common interfaces from core - #2290 chore: remove extraneous console log from debug plugin ### Web snippet additional update to 1.1.2 (March 1st, 2024) Refer to #2284 [Web-Snippet] [BUG] @microsoft/applicationinsights-web-snippet version 1.1.1 type problem ### Web snippet additional update to 1.1.1 (Feb 16th, 2024) Refer to #2277 [Web-Snippet] dependency chain issues ## 3.1.0 (Feb 14th, 2024) ### Interface changes / Breaking changes This release includes support for a new Offline Channel which has changed the `IChannelsControls` interface to include additional support for the new `offline` channel. This change is to support the new `offline` channel and is a breaking change for any custom channels that implement the `IChannelsControls` interface. If you have a custom channel that implements the `IChannelsControls` interface you will need to update your implementation to include the new `offline` channel. ### Configuration default changes As this is a minor version bump we have also change some default values for the following configuration options: - `disableUserInitMessage` is now `true` by default to disable the user init message. ### Potential breaking change This release contains a potential break change with 'tags' type [change](https://github.com/microsoft/ApplicationInsights-JS/pull/2269) While the interface changes are breaking changes, the changes are not expected to affect the majority of users as when the code attempted to serialize the `tags` property it would have failed due to the `Tags[]` type being used instead of the correct `Tags` type. #### Old ```ts tags?: Tags & Tags[]; ``` #### New ```ts tags?: Tags; ``` #### New Offline Channel This release also includes the new `offline` channel which is a new channel that is designed to support offline scenarios. The `offline` channel is designed to store telemetry items in local storage and then send them when the user comes back online. To take full advantage of the initial version you will need to implement your own IOfflineListener to handle situations where you may have "network" connectivity but not internet access. As the `navigator.onLine` property if available will only tell you if you have network connectivity and not internet access. ### Changelog - #2186 [main] offlineListener preparation - #2241 [Main][Task]26451789: Add Offline Support - #2259 [Main][Task]26694421: Add Offline Support Publish Group - #2267 [Main][Task]26681220: Better handle timers in offline channel - #2028 [BUG] AI (Internal): 72 tracking - Sets the default value for the `disableUserInitMessage` to `true` (was previously false since adding) - #2193 [main] Add extra config in sender to let users define transports type - #2200 [main] [doc] Highlight an issue with the default UMD module format when loading from the CDN into an environment that may have require.js - #2208 [Main][Task]26079397: Add disableBeaconSplit sender config and fix potential duplicated events during unload/fallback sender - #2236 [Main][Task]26396663: Set default disableBeaconSplit to true - #2204 [BUG] Beacon sender reports error for success when diagnostics are enabled - #2214 [main] Merge Release-3.0 to main - #2221 [main] Fixup the ci.yml to address internal hash changes between different node versions - #2216 [Main][Task]26138416: Fix FetchKeepAliveSender send duplicated events during unload - #2228 [main] minor release preparation - #2229 [main] [doc] add requireJs problem in SdkLoadFailure.md - #2132 [BUG] Submitting NaN via trackEvent results in HTTP 400 Error Code - #2238 [Main] Merge release-3.0 to main - #2244 Internal Task: Update npm pack sequence - #2249 [main][1ds] Enhance Retry Policy Testing for Alignment with Collector Policy - #2245 [main] [snippet update] add functions to set configs of snippet - #2250 [main] [doc] minor comment update for avoidOptions - #2251 [Main][1DS][Post] Add support for the ext.metadata to NOT be included - #2253 [Main] Update Tests to support upcoming change in nevware21/tsutils dumpObj to better support JSON stringify and handle PURE comments - #2255 [main] #2225 pass customer exception id into telemetry - #2247 [main] [1ds-post] export add header func for auth-plugin to consume - #2209 [BUG] stopTrackEvent requires property values to be strings - #2268 [main] Add example of how to use stopTrackEvent #2209 - #2270 [main] correct types define for stopTrackEvent and stopTrackPage for #2209 - #2258 [BUG] ITelemetryItem uses intersection type instead of union type for tags property - #2269 [main] **[Possible Break]** Removed Tags[] from ITelemetryItem as this was breaking later versions of TypeScript by using the intersection type instead of union type for tags property - #2272 [release 3.0.8] Fix channel test - #2271 Cherry-pick from release-3.0 branch - [Release-3.0] [Release] Increase version to 3.0.8 ([Release-3.0] [Release] Increase version to 3.0.8 #2264) - [Release-3.0] Update namespaced types (DTS) generation to include referenced bundles ## 3.0.8 (Feb, 7th, 2024) This release changes the new beacon splitting code (added in 3.0.4) to be `disabled` by default. This change is to address the issue where the SDK was splitting the payload into multiple requests when the payload size exceeded the maximum allowed size for a single request. This issue was introduced in the 3.0.4 release and only affects the `sendBeacon` usage during page unload, it does not affect the `fetch` usage during page unload. This change is to address the issue where the SDK was splitting the payload into multiple requests when the payload size exceeded the maximum allowed size for a single request. This issue was introduced in the 3.0.4 release and only affects the `sendBeacon` usage during page unload, it does not affect the `fetch` usage during page unload. ### Changelog - #2235 [BUG] - CRITICAL - Application runs out of memory - #2236 [release-3.0] Cherry-Pick: [Main][Task]26396663: Set default disableBeaconSplit to true - #2242 [release-3.0] Update components - Update @microsoft/dynamicProto-js to address possible prototype pollution issue - #2254 [Release3.0] Update Tests to support upcoming change in nevware21/tsutils dumpObj to better support JSON stringify and handle PURE comments - [Release 3.0] Update components for release #2261 - Update @nevware21/ts-utils version for better minification support ## 3.0.7 (Dec 14th, 2023) ### Changelog This release is a hotfix for issue #2216, which is simular to the issue fixed in `3.0.6` but for the `fetch` (with the keep-alive flag). ### Changelog - #2216 [release-3.0] Cherrypick (main): fix fetchkeepalive - #2221 [release-3.0] Cherrypick (main): Fixup the ci.yml to address internal hash changes between different node versions ## 3.0.6 (Dec 7th, 2023) This release fixes an issue with the `sendBeacon` usage during page unload, where the SDK was not correctly splitting the payload into multiple requests when the payload size exceeded the maximum allowed size for a single request. This issue was introduced in the 3.0.4 release and only affects the `sendBeacon` usage during page unload, it does not affect the `fetch` usage during page unload. ### Changelog - #2195 [BUG] Beacon sender causes flood of thousands of requests on page unload - #2201 [BUG] applicationinsights.azure.com/v2/track making hundreds of thousands of requests when third party cookies are disabled - #2205 [BUG] Duplicate customEvent entries - #2204 [BUG] Beacon sender reports error for success when diagnostics are enabled ## 3.0.5 (Nov 1st, 2023) ### Changelog - #2184 [main] deactive send beacon when local storage is available - #2185 [main] retrieve reponseText when fetch in HttpManager - #2188 [main] generate typedoc - #2190 [Main][Task]25648004: Export ISenderConfig from Sender - #2191 [Main][Task]25649658: Update AISKU Light to add default baseType and baseData when calling track function ## 3.0.4 (Oct 16th, 2023) ### Changelog - #2162 [BUG] window is not defined at _getStackFromErrorObj - #2163 [BUG] Using App Insights connection string leads to double slash - #2164 [BUG] Fetch with empty string as first parameter does not include traceparent and does not successfully save dependency to Application Insights - #2165 [main] use proper URL for tracking when fetch is passed an empty string - #2180 [BUG] Same timestamp on multiple pageView-events after upgrade to 3.0.3 - CfgSyncPlugin improvment - #2166 [main] correct throttle configdefault setting in aisku - #2168 [Main][Task]24499167: add cfgSync plugin doc - #2171 [main] test aisku config could correctly merge new config fetch from cdn - #2175 [main] Update Service Notifications to not send message twice - #2177 [Main]Set CfgSync version to 3.0.3 - #2160 [Main] Include Config sync in publish group - Documentation update - #2169 [Main][Task]24499172: add throttle manager doc - #2170 [Main][Task]24499174: Add service notification doc - Github workflow improvement - #2173 Add Issue state reporting script - Sender Update - #2113 [Main][Task]16238553: Provide an override option for the Sender ## 3.0.3 (Sep 20th, 2023) ### Changelog - #2157 [Main] Bug New minified bundles are corrupting global scope - #2120 Missing traceparent header when running multiple SDK instances - #2144 [Main][Part 2] Missing traceparent header when running multiple SDK instances #2120 - #2141 [Main][Bug] Missing traceparent header when running multiple SDK instances #2120 - #2149 [BUG] Fetch with empty string as first parameter ignores second parameter when fetch tracking is enabled - #2152 [main] allow empty string as first parameter to fetch - #2127 [Main] Add automated ability to reset the npm latest tag to a specific build - #2106 Consider export IClickAnalyticsConfiguration from the click plugin? - #2086 [BUG] Field 'fileName' on type 'StackFrame' is too long. Expected: 1024 characters - #2118 [Main] [BUG] Field 'fileName' on type 'StackFrame' is too long. Expected: 1024 characters #2086 - #2094 _getVerifiedStorageObject - contentious sessionStorage element - #2110 [main] add prefix before storage name when setting it - #2137 [Main] Fix: edge case where the navigation entry is not present - #2135 Update @nevware21 base versions - #2104 [main] Use the navigation entry timeing for page load event start time - #2116 [Main] Fixup setVersion to support automated nightly release - #2097 disablePageUnloadEvents lost somewhere #2097 - Internal Task 15757413: [VSCode] [1DS] Move 1DS Core and 1DS Post to GitHub #2102 - #2089 [BUG] The v3.x exporting of the TelemetryContext does not export the sessionManager "type" - [BUG] Readme Issue for perfmarkmeasure @microsoft/applicationinsights-applicationinsights-perfmarkmeasure-js@ #2150 - #2139 V3 Public CDN URL - #2093 Update project clean to make faster - Add support for service level notifications (disabled by default in this release, will be enabled by default in a future release) - #2147 [main] throttle manager in aisku sending message - #2133 [Main][Task]24841107: Refactor throttleMgr to support multiple message keys - #2090 [Main][Task]17874465:Support Config sync across instances - #2125 [Main][Task]24677395:add configurations for CDN to enable specific users opt-in implementation - #2115 [Main][Task]24662146: cfgSync plugin improvement: timer handling for fetch/xhr - SDK Loader Updates (version 7 - will be published after this release is deployed to the CDN) - #2091 rework web snippet (Convert to TypeScript) - #2099 change loader src when detect IE - #2098 Extend the config part in Min - #2131 [main] Adding round robin retry for snippet script src loading ## 3.0.2 (May 23rd, 2023) ### Changelog - #2068 [BUG] SDK fails to initialize when the config includes objects with properties that are not configurable - #2075 [BUG] ClickAnalytics throwing errors in console - #2065 Type 'T' does not satisfy the constraint 'IConfiguration' - #2079 [BUG] The SDK is not limiting the sdkVersion length, which causes the night builds to cause an error - #2061 [BUG] hasDocument should be invoked as function - #2064 [Main] Task 20788238: [AI] Add ApplicationInsights namespace and workaround to support v2 and v3 loaded from the CDN - #2070 [Main] Update Minify script to always sort imports ## 3.0.1 (May 2nd, 2023) ### Changelog - #2057 [Main] Add ability to disable the pollInternalLogs via config and change to stop using setInterval #2055 - #2051 [Main] Fix Perf Tests - #2053 [Main] [BUG] Typing issue with generated types causing Type X is not assignable to type Y #2052 - #2058 [Bug] Fix issues related to dynamic config listeners during unloading - Add Promise support during unloading ## 3.0.0 (Apr 12th, 2023) #### Major release with breaking changes from v2.x see [v3.x Breaking Changes](https://microsoft.github.io/ApplicationInsights-JS/upgrade/v3_BreakingChanges.html) for details. Maintained from the `main` branch, v2.x is in maintenance mode on the `master` branch ### Changelog - All code from 2.8.12 has been merged into the `main` branch and therefore this release #### Major Changes - Removed ES3 (IE8) Support - Enabled dynamic config changes after initialization - #1427 Dynamically updating config (for extensions in my case) - Too many individual commits to include as most revolve around the breaking changes and enabling dynamic configuration support for each extension - All Extensions now **share** the same configuration object `core.config` in previous releases each component maintained their own copy with their own default values, now all defaults and configuration values are exposed on the shared config. - By default the config object passed in during initialization is NOT the same object as that used as the shared config. Any previous assumptions around this being the same object will now be broken as this was a previously unsupported scenario. - All properties of the config object are now using get/set functions (via Object.defineProperty) to allow listeners to be registered (`core.onCfgChange` and internally `onConfigChange`) so that the callback function will be called if any referenced config property is changed. Yes, this means you can register your own configuration listener via `core.onCfgChange` see the [AISku Manual Test](./AISKU/Tests/Manual//HelloWorld.html) for an example. - All properties present during initialization are converted into dynamic properties and may be monitored, properties added "after" creation (initialization) are not. This is to continue to support IE which does not support `Proxy` implementation which also means we are not using the `Proxy` class. - Extensions are now responsible for listening and responding to the configuration changes that they want to support - Updating the config `extensions` and `channels` is NOT supported, you must use the individual plugin add / remove functions if you want to dynamically add / remove extensions / channels - Support for parallel channels was removed from the Core and SKU's and extracted to the new `TeeChannel`, if you require this support you will need to use npm and include this module. - v2.x Extension support. - While the basic API and support for Backward compatibility for the v2.x extension (plugin) API was maintained, due to the breaking changes (specifically the removal of the namespaced helpers) this will only support self contained components (without recompiling). Any npm module that attempts to import and use a removed helper function will potentially break and will need to be updated to use the newer or replacement helper functions (see the v3.x Breaking Changes for details), if you find an issue and are not able to work around please [raise an issue](https://github.com/microsoft/ApplicationInsights-JS/issues). ## 2.8.13 (May 1st, 2023) ### Changelog - #2052 [BUG] Typing issue with generated types causing Type X is not assignable to type Y - #2055 Add ability to disable the pollInternalLogs via config and change to stop using setInterval - #2049 [Master] Fix Perf Tests ## 2.8.12 (Apr, 11th, 2023) ### Changelog - #2014 [BUG] The documentation for enableDebug is incorrect, it should reference enableDebugExceptions - #2027 [BUG] SDK LOAD Failure reporting not working - #2034 [BUG] Failed XHR request after ever tracked item when gathered logs exceed maxBatchSizeInBytes while offline - #2037 [Master] Add local storage-based implementation #1419 - Add support for user provided storage option for Sender - #2029 [Master] Add npm-pack and npm-publish tasks - #2026 [Master] Fix examples, Throttle tests and export dependency types from Sku ## 2.8.11 (Mar 8th, 2023) ### Changelog - #1996 [BUG] SharedWorker does not Instrument fetch correctly - #1995 [BUG] App Insights not auto-capturing from a Web Worker - Stops logging that workers can emit the PageView Performance event - #1792 [BUG] Documentation should clarify that node apps should use applicationinsights, not this package - #1794 [BUG] link on AISKULight goes to not found page - #1990 Field 'assembly' on type 'StackFrame' is too long. Expected: 1024 characters [BUG] - Update documentation and tests to replace `instrumentationKey` usage with `connectionString` - #1997 Change Readme - #1999 Add snippet connection string tests - #1991 Internal Task 17133116: Add Policheck exclusion file - #1989 [AI][Task]17099792: Add sample and doc to dependency plugin ## 2.8.10 (Feb 6th, 2023) ### Changelog - #1940 [BUG] Application Insights reports 'not_specified' to Azure when tracking unhandled browser exception - #1979 [BUG][ThrottleMgr] Incorrectly fires based on the number of days past - #1970 Add the Aborted flag to the dependency initializer / listeners - #1981 [AI][Task]16961420: fix throttleMgr incorrectly fires based on the number of days past - #1956 [AI Light][Task]14130466: Instrumentation key API is being deprecated - need to add support - #1962 Add --no-sandbox to test runs ## 2.8.9 (Oct 25th, 2022) - Updates Chrome Debug Extension to 0.3.9 ### Changelog - #1920 Update to DynamicProto v1.1.7 - #1935 Update to @microsoft/applicationinsights-shims: 2.0.2 - #1911 Uncaught ReferenceError: global is not defined - #1912 Update PerfTests to use the latest version - #1916 [Bug] Fix randomly failing tests - #1915 Fix CodeQL Identified potential Issues - #1906 [Task]14569737: add throttle cdn config - #1930 Remove the source-map-loader from the package.json as we don't use it. ## Shims 2.0.2 (Oct 24th, 2022) ## Changelog - #1911 Uncaught ReferenceError: global is not defined ## 2.8.8 (Oct 3rd, 2022) - Updates Chrome Debug Extension to 0.3.8 ### Changelog - #1679 [BUG] enableUnhandledPromiseRejectionTracking shows no error trace - #1900 [Task]15465575: add getErrorstackObj from reason.stack - #1901 [Feature] Add option to block the creation and usage of the cookies by name - #1904 Fixed release notes, previously used a deprecated file. ## 2.8.7 (Sept 7th, 2022) - Updates Chrome Debug Extension to 0.3.7 ### Changelog - #1863 [BUG]urlCollectQuery not work for applicationinsights-clickanalytics-js - #1874 Add clickanalytics plugin url config back - #1875 [BUG] error thrown using basic version + NPM setup - fix(AISKULight): call getSKUDefaults after it's defined, change this - #1878 [JS SDK] Update Retry logic to handle additional response codes - #1890 [BUG] Behavior difference for an empty endpointUrl when upgrading from v1 to v2 - #1895 Fix incorrect disableFetchTracking documentation - #1887 maxAjaxCallsPerView doesn't account for filtering by TelemetryInitializer - adds addDependencyInitializer() ## 2.8.6 (Aug 2nd, 2022) - React plugin is now located and released from [it's own repo](https://github.com/microsoft/applicationinsights-react-js) - React Native plugin is now located and released from [it's own repo](https://github.com/microsoft/applicationinsights-react-native) - Updates Chrome Debug Extension to 0.3.6 ### Changelog - #1862 [BUG] Remote Dependency requests don't "always" have the correct ai.operation.id tag (page view race condition) - #1870 [BUG] Performance improvements when calling newGuid multiple times (like 10,000) - #1865 Update and add legal compliance notices and license terms - #1866 Remove React-JS and React-Native code from this repo ## 2.8.5 (Jul 6th, 2022) - Updates React Plugin to v3.3.5 (with v2.8.5 as dependency) -- using React 17 - Updates React Native Plugin to 2.5.5 (with v2.8.5 as dependency) - Updates Chrome Debug Extension to 0.3.5 ### Changelog - #1636 [BUG] measurements not being sent when using stopTrackEvent(name, properties, measurements); - #1857 [BUG] CDN Packaging is not exposing the internal tools (CoreUtils / Telemetry / etc) - This was caused by the updated tree-shaking component that we used, fixing this has increased the CDN payload but it provides backward compatibility again - #1852 [BUG] Snippet initialization with IE8 fails with minified code (works with un-minified code) - This was specific to IE8 usages - #1076 Refactor code to provide better tree shaking and minification of generated code - Final stage which provides automatic name crunching, however, because of the fix for #1857 the CDN package size does not show the full effect of this improvement - #1860 Address Component Governance issues ## 2.8.4 (Jun 1st, 2022) - Updates React Plugin to v3.3.4 (with v2.8.4 as dependency) -- using React 17 - Updates React Native Plugin to 2.5.4 (with v2.8.4 as dependency) - Updates Chrome Debug Extension to 0.3.4 ### Changelog - #198 Run-time Telemetry initializers for Ajax requests - #176 Single Page Application Page View Tracking - #1776 How to modify traceflag in traceparent header? - #1846 Task 7496325: Add Distributed tracing population for the properties for the core - #1838 [master] Task 14447552: Fix Component Governance vulnerabilities - #1841 Adding Microsoft SECURITY.MD - #1845 add readme for ikey error messge - #1840 add disableIkeyMessage config ## 2.8.3 (May 3rd, 2022) - Updates React Plugin to v3.3.3 (with v2.8.3 as dependency) -- using React 17 - Updates React Native Plugin to 2.5.3 (with v2.8.3 as dependency) - Updates Chrome Debug Extension to 0.3.3 This release has been manually validated to work with IE8 both directly and by extending the provided classes. While the previous version 2.8.2 also fully supported IE8 it did not handle classes extending the all of Core classes correctly in multiple cases. If you need to support IE8 it is strongly advised that you upgrade to, validate and use this version. ### Changelog - #1831 Updates to dynamicProto() v1.1.6 which provides a final edge case fix for IE8 - [#50](https://github.com/microsoft/DynamicProto-JS/issues/50) [IE8] Fix in 1.1.5 only handles 2 levels of dynamically nested classes - #1828 Update README.md to redirect to Node.JS - #1829 Extracting HOC tracked component class base for re-use - #1804 [BUG] Error type in AppInsightsErrorBoundary after upgrading to react 18 ## 2.8.2 (May 2nd, 2022) - Updates React Plugin to v3.3.2 (with v2.8.2 as dependency) -- using React 17 - Updates React Native Plugin to 2.5.2 (with v2.8.2 as dependency) - Updates Chrome Debug Extension to 0.3.2 This patch release restores complete ES3 support (broken in 2.8.0) and IE8 support (broken eariler via dynamicProto()) for the Sdk. ### Changelog - #1822 [BUG] v2.8.1 with a Hosted IE environment fails to initialize for a hosted instance of IE #1822 (#1824) - #1823 [BUG] IE8 Support was broken by several components #1823 - Also updates to dynamicProto() v1.1.5 to restore IE8 support ## 2.8.1 (Apr 22nd, 2022) - Updates React Plugin to v3.3.1 (with v2.8.1 as dependency) -- using React 17 - Updates React Native Plugin to 2.5.1 (with v2.8.1 as dependency) - Updates Chrome Debug Extension to 0.3.1 This patch release restores TypeScript 3.x support for the Sdk. ### Changelog - #1807 [BUG] Angular project doesn't build after install latest version v.2.8.0 - #1810 v2.8.0 has incompatible TypeScript 3.x type declaration - #1812 [BUG] Browser exceptions are no longer automatically tracked after 2.8.0 - #1814 [BUG]SPFx React project doesn't build after latest version of @microsoft/application-insights-core-js v.2.8.0 got published ## 2.8.0 (Apr 16th, 2022) - Updates React Plugin to v3.3.0 (with v2.8.0 as dependency) -- using React 17 - Updates React Native Plugin to 2.5.0 (with v2.8.0 as dependency) - Updates Chrome Debug Extension to 0.3.0 ### Potential Breaking Change - `fetch` Ajax tracking was also been change to be on by default from this version moving forward, if you are running in an environment without `fetch` support and you are using an incompatible polyfill (that doesn't identify itself as a polyfill) or the SDK you start seeing recursive or duplicate (`fetch` and `XHR` requests) being reported you WILL need to add `disableFetchTracking` with a value of `true` to your configuration to disable this functionality. - TypeScript 4.x required for some typings from the core EnumHelperFuncs.d.ts (Fixed in v2.8.1) ### Significant changes This release adds support for the SDK to - TelemetryInitializers have been moved to `BaseCore` so they are now available as part of all Sku's and not just those using the `analytics` plugin (@microsoft/applicationinsights-analytics-js) using the `appInsights.addTelemetryInitializer(...)` - Web Events (addEventHandler) now support "event namespaces" (similar to jQuery) to enable the removing of events by just specifying the namespace and new specific `eventOn(...)` and `eventOff(...)` API's. - Fully unload, removing all internal event handlers (may be re-initialized) via the `appInsights.unload(...)` function. - Dynamically add a plugin to an already initialized SDK (optionally replacing an existing) via new `appInsights.addPlugin(...)` function - New helper to get any plugin from an initialized SDK via `appInsights.getPlugin("...identifier...")` - Dynamically remove a plugin via the `appInsights.getPlugin("...identifier..").remove()` - Enable / Disable any plugin (even if the plugin doesn't support disabling itself) via `appInsights.getPlugin("...identifier...").setEnabled(true/false)` - The standard name fro the `analytics` plugin @microsoft/applicationinsights-analytics-js has been renamed and is now exported as `AnalyticsPlugin`, for backward compatibility it is also exported as it's previous name `ApplicationInsights`, if you are using it directly it is recommended that you update to use the new exported name. While this release contains a substantial amount of additional functionality and code, there has also been significant minification efforts (which also drove some of the SDK naming) to keep the minified code around the same size. We intend to keep working on additional improvements to attempt to bring the size changes down further. However, the minification improvements do generally cause a lower level of GZip compression most because of the removal of duplicate names. The main readme for the [AISKU](https://github.com/microsoft/ApplicationInsights-JS/tree/master/AISKU) has a table of the CDN base SKU sizes, as the CDN version includes all public API's (older versions for backward compatibility and newer smaller versions) when using NPM you should see smaller sizes than those shown. > Note: > Due to the above changes required to support the above, there may be some minor TypeScript Type compatibility warnings when you attempt to use components from v2.8.0 with older SDK's (forward compatibility), backward compatibility, using Core v2.8.0 with older components is supported and v2.8.0 is completely backward compatible. This is due to some API's now support both older (for back compat) and new enhanced arguments, we have attempted to keep these changes to a minimum. > If you are getting typing errors such as "Argument of type 'XXXXX' os not assignable to parameter of type 'YYYY'", please ensure that you are using all v2.8.0 components and raise an issue if this does not resolve you issue. As a work around casting to work around this warning should not cause any issues. > Due the the size of this change, the above date is the NPM release date and CDN deployment will be over an extended period. ### Changelog - Task 13064945: Enable the option to remove all "added" SDK event listeners as part of calling teardown() - Partial, foundational support for #1427 Dynamically updating config (for extensions in my case) - #1773 [BUG] IConfig and IConfiguration define different configuration "names" for the cookie manager config - #1779 Allow including custom properties in useTrackMetric - #1791 Merge remote-tracking branch `upstream/beta` into `master` * Update version update script to support default "next" release version (major/minor) not just patch (#1756) * Additional Performance enhancements to use provided functions rather than internal polyfill's (#1758) * Enable GitHub Actions on [beta] branch * Beta Part 1: Part of Mega Dynamic Load/Unload support (#1766) - Refactor TelemetryPluginChain ready to start supporting load/unload - Move TelemetryInitializer to BaseCore - add getPlugin (will be used for remove) - Address Channel flush issue * Additional Performance enhancements to use provided functions rather than internal polyfill's (#1758) * Beta Part 2: Part of Mega Dynamic Load/Unload support (#1768) - Add Event Namespace support - Minification of constant values - Add part of the unload functionality (required for unified `teardown()` functionality) * Beta Part 3: Part of Mega Dynamic Load/Unload support (#1780) - Add Core SDK Unload support * Fix telemetry chain for null and undefined * Beta Part 4: Part of Mega Dynamic Load/Unload support (#1781) - Fix function typing issues - Update Analytics Extension to start supporting teardown / unload (more tests required) - Adds namespace option to instrumentation hooks (for debugging teardown issues) - Update AITest Class to log and optionally assert events and hooks that have not been removed - Add Update callback when plugins are added / removed (will be extended for config updates) - Some minor minification improvements * Add missing enum definition * Update Sender tests * Beta Part 5: Part of Mega Dynamic Load/Unload support (#1782) - Add Missing Exports - AnalyticsPlugin: Implement teardown and initial test validation - Dependencies Plugin: Implement teardown and initial test validation - Add flush() to IAppInsightsCore * AI Beta: Minor bug fixes and additional debug info (#1787) * Lint fixes: Enable Automatic formatting fixes (#1788) * Beta Part 6: Part of Mega Dynamic Load/Unload support (#1782) (#1789) - Add basic minimal unload / teardown support to all remaining components - Update rollup cleanup dependencies * Beta: Component Governance Updates to address known dependency issues (#1790) - #1793 Master Minification Improvements - #1796 Minification - Change to only use const enums internally - #1798 More Common Minification Updates - #1468 Enable fetch automatic dependency tracking by default - #1805 Finalize and Update the processTelemetry helper functions ## 2.7.4 (Feb 28th, 2022) - Updates React Plugin to v3.2.4 (with v2.7.4 as dependency) - Updates React Native Plugin to 2.4.4 (with v2.7.4 as dependency) - Updates Chrome Debug Extension to 0.2.4 This release is primarily a performance improvement release where we will now use any built in (or provided polyfill) function over the internal polyfills for - String trim() - String endsWith() - String startsWith() - Additional Date toISOString() - Array isArray() - Array indexOf() - Array map() - Array reduce() - Object freeze() - Object seal() ### Changelog - #1754 update react plugin readme - #1758 Additional Performance enhancements to use provided functions rather than internal polyfill's ## 2.7.3 (Jan 31st, 2022) - Updates the @microsoft/applicationinsights-shims module to 2.0.1 - Updates React Plugin to v3.2.3 (with v2.7.3 as dependency) - Updates React Native Plugin to 2.4.3 (with v2.7.3 as dependency) - Updates Chrome Debug Extension to 0.2.3 ### Changelog - #1735 [BUG] Dependency tracking is disabled when using an Embedded IE browser control - #1736 [BUG] New Fetch keepAlive support can cause duplicate events to be sent during unload processing - #1745 [Documentation] Document the deployed Module formats and release process - #1746 [Documentation] Update AISku Size tracking - #1744 Address CodeQL issues from https://github.com/microsoft/ApplicationInights-JS/security/code-scanning - Update to Rush 5.61.3 and NPM 8.4.0 - #1750 [Performance] Use the Date.toISOString() native function if it exists - #1753 [Performance] Cache the result of the getGlobal() to reduce the number of typeof expressions ## 2.7.2 (Dec 7th, 2021) ### Changelog - #1729 [BUG] Addition of stdDev metric support has broken custom metric reporting from #1680 - #1727 [BUG] Cannot track exception from service worker - #1731 Component Governance - Upgrade to npm v8.1.4 ## 2.7.1 (Nov 4th, 2021) ### Changelog - #1667 Allow properly disposing AI - expose internal log poller #1674 - #1683 Add support to optionally configure the events used for detecting and handling when page unload and flushing occurs - #1655 [BUG] When using Multiple instances of AI only the first instance is correctly reporting ajax events - #1093 "Pause" sending of messages - #1692 [BUG] Field 'ai.operation.name' on type 'ContextTagKeys' is too long. Expected: 1024 characters" - #1691 [BUG] Multiple errors are getting thrown and swallowed during initialization when no instrumentation Key is provided - DiagnosticLogger: Fix typo in defining the console function #1699 - #1676 React Plugin trackTrace method - add trackTrace and expose analytics extension to react plugin #1697 - #1680 [BUG] trackMetric does not track stdDev nor sum #1701 - fix readme traceID generate method #1687 - Update package.json to include the repository #1696 - Governance Updates -- update used dependencies #1694 - Refactor publishing script to combine shared content and support separate nightly container. #1677 - Enable EsLint auto fixing rules for extra-semicolons, dangling commas and tailing spaces #1669 - Update Perf Mark and Measure documentation and some exports #1666 - Update Release script to provide better automated creation of nightly builds #1664 ## 2.7.0 (Sept 7th, 2021) ___Major change___: Upgrades build environment to TypeScript __4.x__ - No known breaking, configuration or definition changes ### Changelog - #1640 [BUG] enableAjaxErrorStatusText: false (which is the default setting) does not turn off logging error response body - #1642 trackEvent() doesn't allow replacing the iKey - #1647 [BUG] customProperties parameter missing from trackException function - #1648 Update error reporting when a plugin throws an exception - #1650 [DebugPlugin] Add an option to disable DebugPlugin processTelemetry logging - #1653 Some requests are returning a CORB error for responses containing text content type - The warning is only being reported via the sendBeacon request, therefore not loss of events - Changes the 'unload' operations to try and use fetch with keepalive if available, fallsback to sendBeacon() - Also attempts to send as manay events as possible via sendBeacon, when the payload size is > 64kb - #1656 [BUG] 'Cannot use 'in' operator to search for 'ver' in Timeout', name: 'TypeError'}​​​​​ - #1660 [BUG] ITelemetryTrace parentId cannot be set to undefined Includes: [2.7.0-beta.1 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/54) - #1171 ___Update to TypeScript 4.x___ - #1526 [TypeScript Compile Error] Property 'sessionManager' does not exist on type 'ITelemetryContext' - #1627 Add sesId to allow access to sessionManager session info - #1471 Convert undefined to blank in customDimensions? - #1630 Convert undefined custom properties to empty string - #1585 ai_user cookie not present after re-enabling the cookie - #1561 How to enrich dependencies logs with context at the beginning of api call? - #1624 Provide a way to enrich dependencies logs with context at the beginning of api call - #1633 Add GitHub Automated Lock closed issue action ### New feature (may be release after primary release - out of band) - #617 Add performance.mark and performance.measure for performance browser tool integration ### 2.7.0-beta.1 (August 24th, 2021) - #1171 ___Update to TypeScript 4.x___ - #1526 [TypeScript Compile Error] Property 'sessionManager' does not exist on type 'ITelemetryContext' - #1627 Add sesId to allow access to sessionManager session info - #1471 Convert undefined to blank in customDimensions? - #1630 Convert undefined custom properties to empty string - #1585 ai_user cookie not present after reenabling the cookie - #1561 How to enrich dependencies logs with context at the beginning of api call? - #1624 Provide a way to enrich dependencies logs with context at the beginning of api call - #1633 Add GitHub Automated Lock closed issue action ### Update React plugin to v3.2.0-beta.1 - Update Core dependency to v2.7.0-beta.1 Core changes ### Update React Native plugin to v2.4.0-beta.1 - Update Core dependency to v2.7.0-beta.1 Core changes ## 2.6.5 (August 3rd, 2021) [2.6.5 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/53) ## Changelog - #1608 [BUG] empty messages for unhandled promise rejections - #1610 [BUG] error logging an error--need to null-check reason - #1621 [Task] Create and publish Sub Resource Integrity (SRI) hashes for the generated scripts - #1607 Remove AngularPlugin code from master and direct to new repo and angularplugin-legacy branch - #1606 Split Tests into Unit / Perf and update all active tests to use common test project - #1613 Update Dependencies - #1617 Add Stale Issue / PR GitHub Action ### Update React plugin to v3.1.5 - Update Core dependency to ^2.6.5 Core changes ### Update React Native plugin to v2.3.5 - Update Core dependency to ^2.6.5 Core changes ## 2.6.4 (July 6th, 2021) [2.6.4 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/52) ## Changelog - #1567 [BUG] Unit of "PageVisitTime" is well hidden - #1579 Add 307 Redirect Response - #1580 [BUG] URL without host fails in CanIncludeCorrelationHeader - #1586 [BUG] namePrefix is not getting assigned to ai_user Cookie - #1587 ai_user cookie should use userCookiePostfix for user cookie storage - #1590 Task 9901543: Remediate security vulnerabilities (Build Dependencies) - #1596 Apply the eslint fixes (from Component Governance policy Checks) - #1597 [BUG] The Pointer Events for the DebugPlugin are getting blocked - #1599 Add visibilitychange event to the set of events tracked for triggering page unload - #1602 [BUG] DebugPlugin - helpers.js:334 Uncaught TypeError: Cannot convert a Symbol value to a string - #1472 [Enhancement] Add config to exclude a specific request auto tracking - #1446 [FEATURE REQUEST] Ability to stop requests being tracked for array of domains ### Update React plugin to v3.1.4 - Update Core dependency to ^2.6.4 Core changes ### Update React Native plugin to v2.3.4 - Update Core dependency to ^2.6.4 Core changes ## 2.6.3 (June 8th, 2021) [2.6.3 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/50) ### Changelog - #1268 Investigate and add a sender that uses fetch when XMLHttpRequest is not available - #1545 Cannot modify the request headers and cookies when using a custom endpoint - #1546 [Typings] Update the TypeScript typings to identify the readonly properties/fields and dynamic values of the snippet - #1541 ITelemetryContext.user is sometimes null - setAuthenticatedUserContext throws - #1569 [BUG] Authorization header included when enableRequestHeaderTracking is enabled - As part of this change the ["Authorization", "X-API-Key", "WWW-Authenticate"] headers will NO longer be logged when ```enableRequestHeaderTracking``` is enabled, if you want these headers to be sent to AzureMonitor you will need to override the default ```ignoreHeaders``` config which excludes them (See the [Configuration settings](https://github.com/Microsoft/ApplicationInsights-JS#configuration)). - #1558 [BUG] Durations reported as zero (00:00:00.000) in Angular SPA for router changes - #363 Script error: Browser exception message not providing information type and method - #1568 Add VSCode specific exclusions - #1572 Task 9901543: Remediate security vulnerabilities ### Update React plugin to v3.1.3 - Update Core dependency to ^2.6.3 Core changes - Update DynamicProto version 1.1.4 (Removes unnecessary dependencies) ### Update React Native plugin to v2.3.3 - Update to React-Native 0.64.2 - Update Core dependency to ^2.6.3 Core changes - Update DynamicProto version 1.1.4 (Removes unnecessary dependencies) ## 2.6.2 (April 22nd, 2021) [2.6.2 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/49) ### Changelog - #1536 Update DynamicProto version 1.1.2 (Fixes IE7 mode issue originally reported in #1534) - #1280 Investigate removing the globals __extends() and __assign() populated by applicationinsights-shims - #1523 Remove exposing global instances of __extends() and __assign() and update sideEffects usage (by removing globals) - #1538 [BUG] Telemetry Buffer Getting Cleared in Offline Mode - Online Status Incorrectly Initialized in Offline Listener - #1528 [BUG] correlationHeaderExcludePatterns is not honored in Ajax calls - #1516 [BUG] App insight library will flush telemetry using beforeUnload event but this event is cancellable - #1509 [BUG] Investigate changing the sideEffects: false to list only the files that include the shims module from the all AI modules so that webpack can evaluate correctly - #1517 [BUG] addHousekeepingBeforeUnload should also be listening to the 'unload' event - #1524 [BUG] Config items are not functional for current snippet disableFlushOnBeforeUnload, disableFlushOnBeforeUnload and maybe others - #1440 [BUG] PageViewPerformanceManager.populatePageViewPerformanceEvent() is always returning zero for the network time - #1393 [BUG] enableAutoRouteTracking should also update the Operation Name with the hashroute - [BUG] Add test coverage for #1518 - #1510 Update PageView operation name to include the hash - #1522 add click plugin version to sdkversion tag - #1535 add click plugin js to cdn ### Update React plugin to v3.1.1 (April 26th, 2021) - Update Core dependency to ^2.6.2 Core changes - Update Shims dependency to ^2.0.0 (to address the __extends() and __assign()) issue - #1536 Update DynamicProto version 1.1.2 (Fixes IE7 mode issue originally reported in #1534) ### Update React Native plugin to v2.3.1 - Update Core dependency to ^2.6.2 Core changes - Update Shims dependency to ^2.0.0 (to address the __extends() and __assign()) issue - #1536 Update DynamicProto version 1.1.2 (Fixes IE7 mode issue originally reported in #1534) ## 2.6.1 (Hotfix - March 30th, 2021) [2.6.1 (Hotfix) Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/48) ### Changelog - #1518 P1 - [BUG] v2.6.0 is not re-hydrating the automatic session id correctly for each request - #1512 Expose the getCookieMgr() on the snippet proxy and analytics web instances ## 2.6.0 (March 23rd, 2021) [2.6.0 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/47) ### Version bump is due to the following major changes A large amount of [Tree-Shaking improvements](https://github.com/microsoft/ApplicationInsights-JS#tree-shaking-support-and-enhancements) have been included in this version, please [see the recommendations](TreeShakingRecommendations.md) you may need to apply to your code to take complete advantage of these changes to reduce the overall module sizes (when using NPM packages) Also includes major changes to the cookie management, please [see the readme cookie configuration section](https://github.com/microsoft/ApplicationInsights-JS#icookiemgrconfig) and [cookie handling changes](https://github.com/microsoft/ApplicationInsights-JS#cookie-handling). ### Changelog - General Performance improvements / optimizations - #1059 Enable W3C distributed tracing on by default with backward compatibility - #1076 Multiple Treeshaking enhancements, [see recommendations](TreeShakingRecommendations.md) - #1091 Enable cookie support after the SDK has been initialized - #1125 Disable Cookies - #1276 [BUG] Does not work with Closure Compiler (possible fix, now generates `applicationinsights-web.d.ts` (This version is namespaced) and `applicationinsights-web.rollup.d.ts` in the dist folder - #1434 Ability to specify cookie Path so that AI works behind App Gateway - #1473 [BUG] New dts gneration doesn't work when the environment doesn't have powershell (introduced for #1276) - #1474 Add initial stamp endpoint redirection logic - #1478 [Bug] Ajax tracking for XHR and fetch is not always setting the start time correctly - #1496 [BUG] applicationinsights-web npm package does not have types or a types folder. - #1498 [BUG][ES6] TypeError: xxx is not a function or TypeError: DynamicProto [XXXX] is not in class heirarchy of [Object] #28 - #1503 [BUG] New Perf tests are randomly failing when the build environment is busy (tests added as part of #1076 and #1091) - Some documentation updates ### Update React plugin to v3.1.0 - Update Core dependency to ^2.6.0 Core changes - #1470 Update applicationinsights-react-js to react 17 ### Update React Native plugin to v2.3.0 - Update Core dependency to ^2.6.0 Core changes ## 2.5.11 (January 15th, 2021) [2.5.11 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/46) ### Changelog - #1452 [BUG] v2.5.10 Snippet Initialization fails to redirect proxied functions -- causing terminal exception - #1433 Typo in 'disableInstrumentaionKeyValidation' config property. ### Update Click Analytics plugin to v2.5.11 - Update Core dependency to ^2.5.11 Core changes - #1441 [BUG] Fix issues based on pageName,clickevent name and improved the way we collect useful telemetry data - Updated Docs ## 2.5.10 (November 16th, 2020) [2.5.10 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/45) ### New extension @microsoft/applicationinsights-clickanalytics-js Provides the ability to gather telemetry in Web pages to automatic track clicks using data meta tags. ### Changelog - #1420 Fix issues with for..in usage with prototype extension libraries like ember.js and prototype.js - #1417 Adding nuspec for new Snippet nuget package - #1415 Update Publishing scripts to allow different container names -- replaces the cdn switch #1415 - #1411 [BUG] - License file link is invalid #1411 - #1410 Remove mention of resolution in Device Information - #1408 Update publish scripts to support a sub-container - #1409 Initial release of new Click Analytics Plugin - #1407 Adding logger during core constructor - #1403 [Feature Request] Snippet - Add an easier way to inject queue items as part of the snippet config (version 5 of snippet) - #1402 [BUG] "ReferenceError: method is not defined" from 2.5.5+ - #420 CDN endpoint ### Update React plugin to v3.0.5 - Update Core dependency to ^2.5.10 Core changes ### Update React Native plugin to v2.2.9 - Update Core dependency to ^2.5.10 Core changes ## 2.5.9 (October 5th, 2020) [2.5.9 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/44) ### Changelog - #1395 Update publishing scripts to support automation - #1391 Increase the randomness and size of the sessionId (newId()) - #1390 using older version of types/cheerio dependecy - #1389 take out SPO support - #1388 Bump shims version for React, React-Native and Angular to latest. - #1384 Add sideEffects field to applicationinsights-shims package.json - Use updated Shims module (v1.0.2) - #1381 [BUG] NPM package for @microsoft/applicationinsights-angularplugin-js does not have a dist folder - #1377 [BUG] Session storage buffers being initialized though configured not to use - #1375 Make AI JS SDK for with NativeScript-Angular - Use updated Shims module (v1.0.1) - #1374 indexof is wrongly cased - #1365 correlationHeaderExcludePatterns added to IConfig - #1364 [BUG] PerfManager and NotificationManager are not exported in AISKU - #1363 [BUG] correlationHeaderExcludePatterns missing from types - #1361 Debug plugin readme changes - #1359 Add trackMetric method for Angular plugin - #1358 Add snippet setup for SPO extension solution and update README ### New Package applicationinsights-shims v1.0.2 - #1384 Add sideEffects field to applicationinsights-shims package.json ### New Package applicationinsights-shims v1.0.1 - #1375 Make AI JS SDK for with NativeScript-Angular ### Update React plugin to v3.0.4 - Update Core dependency to ^2.5.9 Core changes ### Update React Native plugin to v2.2.8 - Update Core dependency to ^2.5.9 Core changes ## 2.5.8 (August 31st, 2020) [2.5.8 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/43) ### Changelog - #1356 add documentation on how to make snippet changes - #1355 update angular package name - #1350 [BUG] The new IPerfEvent is using Date.now() which is not supported in an ES3 environment - #1349 Update angular plugin track pageview logic and test - #1343 [BUG] IPerfManager interface - the create() function is defined to return an IPerfEvent and not an IPerfEvent? - #1340 Instrumentation Key validation - #1018 Error Mismatched anonymous define() module - #1352 add .cjs.js and .cjs.min.js ### Update applicationinsights-rollup-es3 to v1.1.3 - #1350 [BUG] The new IPerfEvent is using Date.now() which is not supported in an ES3 environment - Added additional checks for Date.now() and Performance Api perf.now() ### Update React plugin to v3.0.3 - Update Core dependency to ^2.5.8 Core changes ### Update React Native plugin to v2.2.7 - Update Core dependency to ^2.5.8 Core changes ## 2.5.7 (August 7th, 2020) [2.5.7 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/42) ### Changelog - #1335 Add Performance / Testing support - Added IPerfManager and IPerfEvent interfaces to allow performance review / monitoring of the internal operations - [Performance Manager Documentation](./docs/PerformanceMonitoring.md) - #1334 [BUG] Getting XMLHttpRequest and XDomainRequest is not defined errors for gatsby environment - #1333 [BUG] DebugPlugin various updates - #1331 AppInsightsCore: Enable setting NotificationManager during initialization - #1076 Refactor code to provide better tree shaking and minification of generated code - Updated Sender and support classes to move all private properties and methods into constructor closure - #1328 applicationinsights-debugplugin-js: fixed various issues and updating to beta-2 - #1323 Add Retry as a SendRequestReason - #1324[BUG] Type 'ReactNativePlugin' is not assignable to type 'ITelemetryPlugin' - Refactored the Plugin to extend BaseTelemetryPlugin (part of the #1076 work) - #1321 [BUG] @microsoft/applicationinsights-web fails to initialize with latest version - #1319 fix incorrect references to configuration parameter names - #1316 Update dependency version of DynamicProto - Move all private properties and methods into constructor closure - #1316 Update dependency version of DynamicProto ### Updated React plugin to v3.0.2 - Update Core dependency to ^2.5.7 Core changes - #1335 Add Performance / Testing support - Added IPerfManager and IPerfEvent interfaces to allow performance review / monitoring of the internal operations - [Performance Manager Documentation](./docs/PerformanceMonitoring.md) ### Updated React Native plugin to v2.2.6 - Update Core dependency to ^2.5.7 Core changes - #1335 Add Performance / Testing support - Added IPerfManager and IPerfEvent interfaces to allow performance review / monitoring of the internal operations - [Performance Manager Documentation](./docs/PerformanceMonitoring.md) - #1324 [BUG] Type 'ReactNativePlugin' is not assignable to type 'ITelemetryPlugin' - Refactored the Plugin to extend BaseTelemetryPlugin (part of the #1076 work) - #1076 Refactor code to provide better tree shaking and minification of generated code - Move all private properties and methods into constructor closure - #1316 Update dependency version of DynamicProto ## 2.5.6 (Jul 6th, 2020) [2.5.6 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/40) ### New (Beta) extension applicationinsights-debugplugin-js - Created the initial extension to help developers understand, track, visualize and fix issues with events - This extension injects a UI onto your page details for the component is available at https://github.com/microsoft/ApplicationInsights-JS/tree/master/extensions/applicationinsights-debugplugin-js - This is a beta release so the UI, config etc are not yet complete, feedback for features, suggestions or changes are welcome -- please create an Issue - The detailed view is still under construction and contains known bugs, these will be address in the next few months (releases) as we build out the module. We had not originally planed to have any detailed view as part of this initial beta release. ### Changelog - #1311 Allow the generated modules to extend the namespace defined by "name" in rollup config -- rather than always replace. - Changes the way the "Microsoft.ApplicationInsights" is defined for each module to all modules to be added to the same namespace - #1309 When using prototype js the SessionStorage become corrupted causing requests internal exceptions - #1303 Task 7027291: Investigate CDN Configuration to support custom domain (automate CDN deployment scripts) - #1299 Releasing core queue as soon as possible (fixes lost events from page load immediate unload with no additional events) - #1297 Created initial applicationinsights-debugplugin-js - #1289 [Documentation] doc: SPO set up instruction - #1286 [Documentation] Update JS SDK Snippet documentation with bug fixes (new v4 snippet) - #1283 [BUG] (Snippet v3) AppInsights stub methods captured incorrect method names in the closure - #1262 [BUG] Custom properties added with addTelemetryInitializer are ignored for exceptions - #1245 React Native - AI (Internal): 19 message: "Could not add handler for beforeunload and pagehide" - Add isReactNative() function for detecting the runtime environment - #1095 Add an Error Boundary to the React plugin - #1089 Blocking certain URIs/Patterns from fetch tracking (patch included) - Added new config 'correlationHeaderExcludePatterns' to allow disabling correlation headers using regular expressions ### Updated React plugin to v3.0.1 - #1311 Allow the generated modules to extend the namespace defined by "name" in rollup config -- rather than always replace. - Changes the way the "Microsoft.ApplicationInsights" is defined for each module to all modules to be added to the same namespace ### Update applicationinsights-rollup-es3 to v1.1.2 - #1311 Allow the generated modules to extend the namespace defined by "name" in rollup config -- rather than always replace. ## 2.5.5 (Jun 2nd, 2020) [2.5.5 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/39) ### Updated React plugin to v3.0.0 - Updated to TypeScript 3.x - Removed React plugin from main rush pipeline - #991 Don't work with React HOOKS - #1120 Introducing React Hooks for AppInsights #1120 ### New Package applicationinsights-shims v1.0.0 - Created to remove dependency on TSLib as v 1.13.0 has introduced build breaks - provides internal implementation of __extends() and __assign() when no pre-existing version is present ### Changelog - #1278 Add optional 'eventsSendRequest' notification to NotificationManager - #1269 TsLib v1.13.0 has breaking change (Remove dependency on TSLib) - Added new package **'applicationinsights-shims@1.0.0'** - Removed React plugin from main rush pipeline - #991 Don't work with React HOOKS - #1120 Introducing React Hooks for AppInsights #1120 - #1274 Fix for withAITracking wrapping functional components. - Using crypto to generate GUIDs when available (Make GUID more random) - #1260 [BUG] Can't include Correlation Header on IE can fail - #1258 Update snippet to support reporting script load failures - #1251 [BUG] ajax.ts is using string trim() which is not supported on IE7/8 - #1249 Identify whether the script is being consumed via the CDN or NPM package - Several minor documentation updates ## 2.5.4 (Apr 7th, 2020) [2.5.4 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/37) ### Changelog - #1242 Upgrading the tslib dependency to 1.11.1 - #1233 [BUG] Duplicate React dependency - #1232 [BUG] window.appInsights.properties is marked private - Fix issue by always exposing window.appInsights.context - #1240 [BUG] Telemetry correlation headers are not included for all fetch requests - #1229 [BUG] Unable to include telemetry correlation headers - #1227 SPFX - undefinedundefined is not defined - #1221 npm @microsoft/applicationinsights-web: license information missing in package.json - #1191 [BUG] ICustomProperties does not support setting values ## 2.5.3 (Mar 25th, 2020) [2.5.3 Milestone](https://github.com/microsoft/ApplicationInsights-JS/milestone/38) ### Changelog - #1224 [BUG] When running in IE7/8 the app insights doesn't initialize and gets stuck in a loop (long running script) ## 2.5.2 (Mar 11th, 2020) ### Changelog - #1217 [BUG] App Insights fails when the XHR object is not extensible (or frozen) - #1186 [BUG] App Insights initialization setting 'enableAjaxErrorStatusText is not working #1218 ## 2.5.1 (Mar 9th, 2020) ### Changelog - #1210 [BUG] Typescript error when using @microsoft/applicationinsights-web 2.5.0 and "noImplicitAny"/"strict" option - #1207 [BUG] The latest version 2.4.4 cannot connect front-end with back-end on the Application Map on Application Insights ## 2.5.0 (Mar 9th, 2020) ### Changelog - #1204 When a fetch polyfill is installed there reporting endpoint is also causing events to be sent - #1202 ai_user and ai_session cookies not set #1203 - #1201 add to auto track exceptions in react native plugin - #1199 Build is breaking when you do a "rush update --full --purge --recheck" due to tslib v1.11.0 update - #1194 XHR/Fetch enhancement - add additional telemetry from window.performance #1195 - #1193 add sanitizer for operationName - #1189 Add the option to specify the refUri with stopTrackPage #1190 - #1186 App Insights initialization setting 'enableAjaxErrorStatusText' is not working #1187 #### XHR/Fetch enhancement Adds additional performance data derived from the window.performance.getEntries() for the fetch or XHR request. Configuration options | Name | Default | Description | |------|---------|-------------| | enableAjaxPerfTracking | false | Default false. Flag to enable looking up and including additional browser window.performance timings in the reported ajax (XHR and fetch) reported metrics. | maxAjaxPerfLookupAttempts | 3 | Defaults to 3. The maximum number of times to look for the window.performance timings (if available), this is required as not all browsers populate the window.performance before reporting the end of the XHR request and for fetch requests this is added after its complete. | ajaxPerfLookupDelay | 25 | Defaults to 25ms. The amount of time to wait before re-attempting to find the windows.performance timings for an ajax request, time is in milliseconds and is passed directly to setTimeout(). #### Auto track exception React Native Plugin This has been enabled by default in the updated version. It can be disabled by adding the ```disableExceptionCollection``` config value with a value of true. ## 2.4.4 (Feb 5th, 2020) ### Changelog - #1182 Fix error TS2430: Interface 'Window' incorrectly extends interface 'WindowEventHandlers' - #1185 Rollback namespace overwrite change ## 2.4.3 ## Changelog - Syntax error tools/rollup-es3/src/es3/Es3Tokens.ts #1179 ## 2.4.2 ### ES3 Support An additional conversion was required for ES3 support as TypeScript was adding a getter for embedding a constant enum into the Common class. ### Changelog - #1177 Add additional checks and polyfil for TypeScript get translations for constants ## v 2.4.1...2.4.0 ### ES3 Support With this release the source files can be loaded in an ES3 environment (IE7/8) and send requests to the server. As part of this change you will now receive requests from users using an older browser, prior to this version users using an ES3 base browser will (most likely) have been getting a javascript error, which would have caused no data to be sent. ### Enable support for reusing plugins in multiple instances of AppInsights #1132 We have added upport to enable reusing the same plugin in different instances of AppInsights, owned by the same application (but using different Instrumentation keys) is required so that they can reuse a single Plugin instance for all instances. This changes introduces a new [`IProcessTelemetryContext`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IProcessTelemetryContext.html) interface that is passed to the processTelemetry() method so that the plugins can use the current request context for the event rather than the context during initialization. To assist with creating plugins we have also introduced a base class that you can use for creating new plugins [BaseTelemetryPlugin](https://github.com/microsoft/ApplicationInsights-JS/blob/master/shared/AppInsightsCore/src/JavaScriptSDK/BaseTelemetryPlugin.ts), details are included on the [Readme](https://github.com/microsoft/ApplicationInsights-JS/blob/master/README.md) ### Changelog - #1175 [BUG] Typescript build with 2.4.0 breaks #1173 - #1174 Legacy Manage SameSite Cookie Settings #1126 - #1172 Update SameSite logic to handle UserAgents that don't support the attribute - #1169 Fixup Rollup ES3 plugin package.json - #1167 Add better support for referencing global objects from a window and web workers - #1164 add null check for sessionManager - #1162 [BUG]AppInsights not working in IE7 #1142 - #1161 include response error data - #1159 Export Common Telemetry classes in Snippet - #1157 fix: only change SameSite when secure - #1154 Queue events when track is called and not all extensions are initialized - #1153 Do not clean telemetryInitializers during initialization - #1150 Remove interface code from API reference and link - #1135 fix: dont block corr on empty location host - #1133 Enable support for reusing plugins in multiple instances of AppInsights #1132 - #1129 fix: console logging not honoring setting - #1122 fix anchor link - #1116 Move tslib to sku dependencies - #1113 [Enhancement] AI is not catching all "Unload" dom events #1080 ## v 2.3.1 ### Changelog - #1102 Enable support for IE8 - #1096 Add extra window nullchecks for non-browser environments - #1105 Fix issue where operation name is overwritten ## v 2.3.0...2.2.4 ### Changelog - #1066 Adds Connection String support - #1061, #1065,#1067, #1088 misc bug fixes ## v 2.2.4 ### Changelog - #1054 Fix issue with AppInsightsCore refactor ## v 2.2.3 ### Changelog - #1051 Add to call track trace on user init sending browser info to the end point when loggingLevelTelemetry config is on - #1050 Address issue https://github.com/MicrosoftDocs/azure-docs/issues/39011 - #1049 Fix issue with PageViewPerformance event being sent with undefined name property - #1041 Add tslint error screening - #1038 Re-organize repo folders - #1035 Update to use PerformanceNavigationInterface for supported browsers ## v 2.2.2 ### Changelog - #1030 Fix issue with appId correlation being appended with an incorrect format ## v 2.2.1 ### Changelog - #1015 Update to use beaconSender for page unload when browser supports Beacon API - #1028 Fix issue where window.location is not defined - #1021 Fix issue with not parsing correlationContext - #1020 Disable by default logging to console internal SDK errors. Enable by default logging as telemetry for internal SDK errors ## v 2.2.0 ### Changelog - #946 **Feature**: Adds automatic incoming/outgoing header tracking. *Outgoing header tracking is experimental and may be miss some headers* - #973 **Feature**: Support propagation of W3C compatible distributed tracing headers - #983: Fix issue regarding incorrect referrer uri when using `enableAutoRouteTracking` - #984: Fix issue where adding custom properties/tags would not work in telemetry processors - #999: Fix IE issue when using `enableAutoRouteTracking` - #1000 ## v 2.1.1 Patch release containing fixes to automatic Single Page Application route change tracking via `enableAutoRouteTracking` ### Changelog #970 - Fixes #967 #969 ## v 2.1.0 ### Highlights #### Source Map Support > *You do not need to upgrade for drag and drop to work. It will work on all previous and future versions of the javascript (and Node.js) SDK https://i.imgur.com/Efue9nU.gif You can now drag and drop your source maps onto your Exception Telemetry in the Azure Portal to unminify your callstack. Please open an issue or use the Feedback button in the Portal if a source map you've uploaded is not working as intended. This is a first iteration and in a future update, your source maps will be automatically unminified. #### SPA Route Change Tracking You can set `enableAutoRouteTracking: true` to enable state based route tracking for your Single Page Application (React, Angular, Vue, etc). You do not need to install a separate plugin to use this configuration option. This setting will cause a new Page View telemetry item to be sent each time your app's route changes (**including** Hash route changes). ### Changelog - #920 Resolve jest testing issues when using React plugin - #928 Make analytics plugin have last priority - #936 Fallback to XHR Sender when beacon sender tries to send >64 KB - #947 Add SPA route change tracking - #948 Docs: Source map support - #952 Re-enable `samplingPercentage` functionality - #918, #919, #932 #933 #935 #939 #940 #951 ## v 2.0.1 ### trackException Change This update has a couple of **non-breaking** API changes. Namely, `trackException` is now consistent with the Node.js SDK. The only change here is the named argument is renamed from **`error`** to **`exception`**. A shim is in place so **any existing usages of `trackException` will still work**, and the old field is marked as optional, so any type-checked files will still "compile". There are no breaking changes with this change, but you are encouraged to use `exception` as your named argument field as error will be deprecated in a future major version. #### Old ```js appInsights.trackException({ error: new Error() }); ``` #### New ```js appInsights.trackException({ exception: new Error() }); ``` ### Correlation Header Domain Whitelisting #869 Second, the ability to only send correlation headers to specific, whitelisted domains is now available as a configuration option , `correlationHeaderDomains`. It accepts an `array` of domain `strings`. Wildcards ("*") are okay. By populating this array, all other domains which your application makes requests to will **not** have correlation headers included. This setting makes it easy to avoid OPTIONS requests to services outside of your control. You can use the inclusion list and the exclusion list in conjunction with each other to add correlation headers to a particular domain, `example.com`, and at the same time exclude headers from a prefixed version of it, `no-headers.example.com`. ### Tag Override Change #903 Performing custom tag overrides is now more consistent with all of the other Application Insights SDKs, in that it is modified via a simple key-value dictionary. There are no breaking changes with this update, and if you are setting any tags via the old way, they will still work as they do now. You are encouraged to update them since the old way will be deprecated in a future major version release. #### Old ```js var telemetryInitializer = (item) => { item.tags.push({ "ai.cloud.role": "My Web App" }); }; appInsights.addTelemetryInitializer(telemetryInitializer); ``` #### New ```js var telemetryInitializer = (item) => { item.tags["ai.cloud.role"] = "My Web App"; }; appInsights.addTelemetryInitializer(telemetryInitializer); ``` ### Changelog #869 - config: add ability to whitelist specific domains for adding correlation headers #893 - docs: fix sample configuration settings #899 - common: replace Array.some with Array.forEach to simplify polyfill story, add tests #902 - snippet: add missing methods to lazy loaders #903 - tags can now be set with same API as other AI SDKs #904 - rename IExceptionTelemetry.error --> IExceptionTelemetry.exception #905 - react: fix plugin causing jest tests to fail #907 - docs: add mention of how to update current context's operation #908 - react: remove analytics package dependency #910 - docs: update context refresh information #913 - Remove code from adding libVer from extensions #918 - automatically add `ai.operation.name` tag, add `id` to pageview telemetry #919 - fix issue with `namePrefix` not affecting send buffers ## v 2.0.0 ### Changelog - #878 Fix issue with missing pageviewperformance - #881 Change access level of some non-exposed methods - #883 Allow `id` to be set in `Exception` telemetry ================================================ FILE: SECURITY.md ================================================ ## Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. ## Preferred Languages We prefer all communications to be in English. ## Policy Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). ================================================ FILE: SUPPORT.md ================================================ # Support ## How to file issues and get help This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new Issue. For help and questions about using this project, please create a Support request issue on https://github.com/microsoft/ApplicationInsights-JS/issues. ## Microsoft Support Policy Support for this **PROJECT or PRODUCT** is limited to the resources listed above. ================================================ FILE: ThirdPartyNotices.txt ================================================ THIRD-PARTY SOFTWARE NOTICES AND INFORMATION Do Not Translate or Localize The Microsoft Application Insights SDK for JavaScript source code repository includes third party material from the projects listed below. The original copyright notice and the license under which Microsoft received such third party material are set forth below. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. 1. jslitmus (https://github.com/broofa/jslitmus) 2. Sinon.JS (http://sinonjs.org) 3. Selenium (http://www.seleniumhq.org/download) 4. QUnit (http://code.jquery.com/) %% jslitmus NOTICES, INFORMATION, AND LICENSE BEGIN HERE ========================================= copyright(C) Robert Kieffer, 2010 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========================================= END OF jslitmus NOTICES, INFORMATION, AND LICENSE %% Sinon.JS NOTICES, INFORMATION, AND LICENSE BEGIN HERE ========================================= (The BSD License) Copyright (c) 2010-2014, Christian Johansen, christian@cjohansen.no All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Christian Johansen nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========================================= END OF Sinon.JS NOTICES, INFORMATION, AND LICENSE %% Selenium NOTICES, INFORMATION, AND LICENSE BEGIN HERE ========================================= Copyright 2011-2015 Software Freedom Conservancy Copyright 2004-2011 Selenium committers Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ========================================= END OF Selenium NOTICES, INFORMATION, AND LICENSE %% QUnit NOTICES, INFORMATION, AND LICENSE BEGIN HERE ========================================= Copyright jQuery Foundation and other contributors, https://jquery.org/ This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history available at https://github.com/jquery/qunit The following license applies to all parts of this software except as documented below: ==== Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ==== All files located in the node_modules directory are externally maintained libraries used by this software which have their own licenses; we recommend you read them, as their terms may differ from the terms above. ========================================= END OF QUnit NOTICES, INFORMATION, AND LICENSE ================================================ FILE: TreeShakingRecommendations.md ================================================ # Tree-Shaking Enhancements / Recommendations As part of changes introduced in version 2.6.0 we are deprecating and removing the *internal* usages of the static helper classes `CoreUtils`, `EventHelper`, `Util`, `UrlHelper`, `DateTimeUtils` and `ConnectionStringParser` to provide better support for tree-shaking algorithms so that unused code can be safely dropped when using NPM packages. As part of these changes we are now exporting the functions as top level root (direct) from the modules so that you can simply refactor your code to achieve better tree-shaking. To further assist with some tree-shakers, we have also changed these from static classes to const objects that reference the new exported functions (*mostly*). Future changes are required to continue refactoring out further the references below that have no currently available replacement or are not listed. **Why?** Simplistically, any reference to any property or function that was defined in these static classes would require that ALL of the properties and functions must be included in the resulting code as this code becomes unshakable (using static analysis). > Note: While we have tagged the classes as deprecated, they will continue to be exported and we are not currently planning on removing them from the current packages that they are exported from. ## Deprecated functions and replacements | Existing | Replacement | |----------|-------------| | **CoreUtils** | **@microsoft/applicationinsights-core-js** | | CoreUtils._canUseCookies | None - Do not use as this will cause all of CoreUtils reference to be included in your final code.
    Refactor your cookie handling to use the `appInsights.getCookieMgr().setEnabled(true/false)` to set the value and `appInsights.getCookieMgr().isEnabled()` to check the value. | | CoreUtils.isTypeof | isTypeof | | CoreUtils.isUndefined | isUndefined | | CoreUtils.isNullOrUndefined | isNullOrUndefined | | CoreUtils.hasOwnProperty | hasOwnProperty | | CoreUtils.isFunction | isFunction | | CoreUtils.isObject | isObject | | CoreUtils.isDate | isDate | | CoreUtils.isArray | isArray | | CoreUtils.isError | isError | | CoreUtils.isString | isString | | CoreUtils.isNumber | isNumber | | CoreUtils.isBoolean | isBoolean | | CoreUtils.toISOString | toISOString or getISOString | | CoreUtils.arrForEach | arrForEach | | CoreUtils.arrIndexOf | arrIndexOf | | CoreUtils.arrMap | arrMap | | CoreUtils.arrReduce | arrReduce | | CoreUtils.strTrim | strTrim | | CoreUtils.objCreate | objCreateFn | | CoreUtils.objKeys | objKeys | | CoreUtils.objDefineAccessors | objDefineAccessors | | CoreUtils.addEventHandler | addEventHandler | | CoreUtils.dateNow | dateNow | | CoreUtils.isIE | isIE | | CoreUtils.disableCookies | disableCookies
    Referencing either will cause CoreUtils to be referenced for backward compatibility.
    Refactor your cookie handling to use the `appInsights.getCookieMgr().setEnabled(false)` | | CoreUtils.newGuid | newGuid | | CoreUtils.perfNow | perfNow | | CoreUtils.newId | newId | | CoreUtils.randomValue | randomValue | | CoreUtils.random32 | random32 | | CoreUtils.mwcRandomSeed | mwcRandomSeed | | CoreUtils.mwcRandom32 | mwcRandom32 | | CoreUtils.generateW3CId | generateW3CId | | **EventHelper** | **@microsoft/applicationinsights-core-js** | | EventHelper.Attach | attachEvent | | EventHelper.AttachEvent | attachEvent | | EventHelper.Detach | detachEvent | | EventHelper.DetachEvent | detachEvent | | **Util** | **@microsoft/applicationinsights-common-js** | | Util.NotSpecified | strNotSpecified | | Util.createDomEvent | createDomEvent | | Util.disableStorage | utlDisableStorage | | Util.isInternalApplicationInsightsEndpoint | isInternalApplicationInsightsEndpoint | | Util.canUseLocalStorage | utlCanUseLocalStorage | | Util.getStorage | utlGetLocalStorage | | Util.setStorage | utlSetLocalStorage | | Util.removeStorage | utlRemoveStorage | | Util.canUseSessionStorage | utlCanUseSessionStorage | | Util.getSessionStorageKeys | utlGetSessionStorageKeys | | Util.getSessionStorage | utlGetSessionStorage | | Util.setSessionStorage | utlSetSessionStorage | | Util.removeSessionStorage | utlRemoveSessionStorage | | Util.disableCookies | disableCookies
    Referencing either will cause CoreUtils to be referenced for backward compatibility.
    Refactor your cookie handling to use the `appInsights.getCookieMgr().setEnabled(false)` | | Util.canUseCookies | canUseCookies
    Referencing either will cause CoreUtils to be referenced for backward compatibility.
    Refactor your cookie handling to use the `appInsights.getCookieMgr().isEnabled()` | | Util.disallowsSameSiteNone | uaDisallowsSameSiteNone | | Util.setCookie | coreSetCookie
    Referencing will cause CoreUtils to be referenced for backward compatibility.
    Refactor your cookie handling to use the `appInsights.getCookieMgr().set(name: string, value: string)` | | Util.stringToBoolOrDefault | stringToBoolOrDefault | | Util.getCookie | coreGetCookie
    Referencing will cause CoreUtils to be referenced for backward compatibility.
    Refactor your cookie handling to use the `appInsights.getCookieMgr().get(name: string)` | | Util.deleteCookie | coreDeleteCookie
    Referencing will cause CoreUtils to be referenced for backward compatibility.
    Refactor your cookie handling to use the `appInsights.getCookieMgr().del(name: string, path?: string)` | | Util.trim | strTrim | | Util.newId | newId | | Util.random32 | ---
    No replacement, refactor your code to use the core random32(true) | | Util.generateW3CId | generateW3CId | | Util.isArray | isArray | | Util.isError | isError | | Util.isDate | isDate | | Util.toISOStringForIE8 | toISOString | | Util.getIEVersion | getIEVersion | | Util.msToTimeSpan | msToTimeSpan | | Util.isCrossOriginError | isCrossOriginError | | Util.dump | dumpObj | | Util.getExceptionName | getExceptionName | | Util.addEventHandler | attachEvent | | Util.IsBeaconApiSupported | isBeaconApiSupported | | Util.getExtension | getExtensionByName | **UrlHelper** | **@microsoft/applicationinsights-common-js** | | UrlHelper.parseUrl | urlParseUrl | | UrlHelper.getAbsoluteUrl | urlGetAbsoluteUrl | | UrlHelper.getPathName | urlGetPathName | | UrlHelper.getCompeteUrl | urlGetCompleteUrl | | UrlHelper.parseHost | urlParseHost | | UrlHelper.parseFullHost | urlParseFullHost | **DateTimeUtils** | **@microsoft/applicationinsights-common-js** | | DateTimeUtils.Now | dateTimeUtilsNow | | DateTimeUtils.GetDuration | dateTimeUtilsDuration | | **ConnectionStringParser** | **@microsoft/applicationinsights-common-js** | | ConnectionStringParser.parse | parseConnectionString | ================================================ FILE: channels/1ds-post-js/.gitignore ================================================ /node_modules *.user /bundle /.vs /docs /dist-es5 /dist test/debug.log ================================================ FILE: channels/1ds-post-js/.npmignore ================================================ # NPM Ignore # ignore everything * # ... but these files !package.json !tsconfig.json !/CODE_OF_CONDUCT.md !/CONTRIBUTING.md !/README.md !/SECURITY.md !/SUPPORT.md !/NOTICE !/PRIVACY !/LICENSE !/LICENSE.TXT !dist-es5/** !dist/** !bundle/** !types/** ================================================ FILE: channels/1ds-post-js/CODE_OF_CONDUCT.md ================================================ # Microsoft Open Source Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). Resources: - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns ================================================ FILE: channels/1ds-post-js/CONTRIBUTING.md ================================================ # Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ================================================ FILE: channels/1ds-post-js/LICENSE.TXT ================================================ The MIT License (MIT) Copyright (c) Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: channels/1ds-post-js/NOTICE ================================================ NOTICES AND INFORMATION Do Not Translate or Localize This software incorporates material from third parties. Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, or you may send a check or money order for US $5.00, including the product name, the open source component name, and version number, to: Source Code Compliance Team Microsoft Corporation One Microsoft Way Redmond, WA 98052 USA Notwithstanding any other terms, you may reverse engineer this software to the extent required to debug changes to any libraries licensed under the GNU Lesser General Public License. ================================================ FILE: channels/1ds-post-js/PRIVACY ================================================ # Data Collection The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ================================================ FILE: channels/1ds-post-js/README.md ================================================ # Microsoft 1DS Web SDK Post Plugin ## Description 1DS Web SDK Post Channel main functionality is to send data to OneCollector using POST, currently supporting XMLHttpRequest, fetch API and XDomainRequest. ## npm Packages available [here](https://www.npmjs.com/package/@microsoft/1ds-post-js). ## Basic Usage ### Setup ```js import { AppInsightsCore, IExtendedConfiguration } from '@microsoft/1ds-core-js'; import { PostChannel, IChannelConfiguration } from '@microsoft/1ds-post-js'; ``` ```js var appInsightsCore: AppInsightsCore = new AppInsightsCore(); var postChannel: PostChannel = new PostChannel(); var coreConfig: IExtendedConfiguration = { instrumentationKey: "YOUR_TENANT_KEY", extensions: [ postChannel ], extensionConfig: {} }; var postChannelConfig: IChannelConfiguration = { eventsLimitInMem: 5000 }; coreConfig.extensionConfig[postChannel.identifier] = postChannelConfig; //Initialize SDK appInsightsCore.initialize(coreConfig, []); ``` ## Configuration ### [IChannelConfiguration](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html) | Config | Description | Type |----------------|--------------|---- | [eventsLimitInMem](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#eventsLimitInMem) | The number of events that can be kept in memory before the SDK starts to drop events. By default, this is 10,000.|number | [immediateEventLimit](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#immediateEventLimit) | [Optional] Sets the maximum number of immediate latency events that will be cached in memory before the SDK starts to drop other immediate events only, does not drop normal and real time latency events as immediate events have their own internal queue. Under normal situations immediate events are scheduled to be sent in the next Javascript execution cycle, so the typically number of immediate events is small (~1), the only time more than one event may be present is when the channel is paused or immediate send is disabled (via manual transmit profile). By default max number of events is 500 and the default transmit time is 0ms. Added in v3.1.1 | number | [autoFlushEventsLimit](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#autoFlushEventsLimit) | [Optional] If defined, once this number of events has been queued the system perform a flush() to send the queued events without waiting for the normal schedule timers. Default is undefined | number | [httpXHROverride](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#httpXHROverride) |The HTTP override that should be used to send requests, request properties and headers should be added to the request to maintain correct functionality with other plugins.|IXHROverride | [overrideInstrumentationKey](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#overrideInstrumentationKey) |Override for Instrumentation key.|string | [overrideEndpointUrl](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#overrideEndpointUrl) |Override for Endpoint where telemetry data is sent.|string | [disableTelemetry](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#disableTelemetry) |The master off switch. Do not send any data if set to TRUE.|boolean | [ignoreMc1Ms0CookieProcessing](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#ignoreMc1Ms0CookieProcessing) |MC1 and MSFPC cookies will not be provided. Default is false.|boolean | [payloadPreprocessor](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#payloadPreprocessor) |POST channel preprocessing function. Can be used to gzip the payload (and set appropriate HTTP headers) before transmission. |[Function](./src/DataModels.ts) | [payloadListener](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#payloadListener) |POST channel function hook to listen to events being sent, called after the batched events have been committed to be sent. Also used by Remote DDV Channel to send requests. |[Function](./src/DataModels.ts) | [disableEventTimings](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#disableEventTimings) | [Optional] By default additional timing metrics details are added to each event after they are sent to allow you to review how long it took to create serialized request. As not all users require this level of detail and it's now possible to get the same metrics via the IPerfManager and IPerfEvent, so you can now disabled this previous level. Default value is false to retain the previous behavior, if you are not using these metrics and performance is a concern then it is recommended to set this value to true. | boolean | [valueSanitizer](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#valueSanitizer) | [Optional] The value sanitizer to use while constructing the envelope, if not provided the default sanitizeProperty() method is called to validate and convert the fields for serialization. The path / fields names are based on the format of the envelope (serialized object) as defined via the [Common Schema 4.0](https://aka.ms/CommonSchema) specification. | IValueSanitizer | [stringifyObjects](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#stringifyObjects) | [Optional] During serialization, when an object is identified should the object serialized by true => JSON.stringify(theObject); otherwise theObject.toString(). Defaults to false. | boolean | [enableCompoundKey](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#enableCompoundKey) | [Optional] Enables support for objects with compound keys which indirectly represent an object eg. event: { "somedata.embeddedvalue": 123 } where the "key" of the object contains a "." as part of it's name. Defaults to false. | boolean | [disableOptimizeObj](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#disableOptimizeObj) | [Optional] Switch to disable the v8 `optimizeObject()` calls used to provide better serialization performance. Defaults to false. | boolean | [transports](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#transports) | [Optional] Either an array or single value identifying the requested `TransportType` (const enum) type that should be used. This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride is provided. | number or number[] | [useSendBeacon](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#useSendBeacon) | [Optional] A flag to enable or disable the usage of the sendBeacon() API if available by the runtime. If running on ReactNative this defaults to `false` for all other cases it defaults to `true`. | [disableFetchKeepAlive](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#disableFetchKeepAlive) | [Optional] A flag to disable the usage of the [fetch with keep-alive](https://javascript.info/fetch-api#keepalive) support. | [unloadTransports](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#unloadTransports) | [Optional] Either an array or single value identifying the requested TransportType type(s) that should be used during unload or events marked as sendBeacon. This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride is provided and alwaysUseXhrOverride is true. | [avoidOptions](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#avoidOptions)
    (Since 3.1.10+)
    Default: false (Since 3.2.0)
    Previously true
    | [Optional] Avoid adding request headers to the outgoing request that would cause a pre-flight (OPTIONS) request to be sent for each request. | boolean | [xhrTimeout](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#xhrTimeout)
    (Since 3.1.11+) | [Optional] Specify a timeout (in ms) to apply to requests when sending requests using XHR or fetch() requests only, does not affect sendBeacon() or XDR (XDomainRequest) usage. Defaults to undefined and therefore the runtime defaults (normally zero for browser environments) | number | [disableXhrSync](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#disableXhrSync)
    (Since 3.1.11+) | [Optional] When using [Xhr](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) for sending requests disable sending as synchronous during unload or synchronous flush. __You should enable this feature for IE (when there is no sendBeacon() or fetch (with keep-alive) support) and you have clients that end up blocking the UI during page unloading__. This will cause ALL XHR requests to be sent asynchronously which during page unload may result in the lose of telemetry. This does not affect any other request type (fetch(), sendBeacon() or XDR (XDomainRequest)) | boolean
    Default: undefined | [alwaysUseXhrOverride](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#alwaysUseXhrOverride)
    (Since 3.1.11+) | [Optional] By default during unload (or when you specify to use sendBeacon() or sync fetch (with keep-alive) for an event) the SDK ignores any provided httpXhrOverride and attempts to use sendBeacon() or fetch(with keep-alive) when they are available. When this configuration option is true any provided httpXhrOverride will always be used, so any provided httpXhrOverride will also need to "handle" the synchronous unload scenario. | boolean
    Default: false | [maxEventRetryAttempts](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#maxEventRetryAttempts)
    (Since 3.1.11+) | [Optional] Identifies the number of times any single event will be retried if it receives a failed (retirable) response, this causes the event to be internally "requeued" and resent in the next batch. As each normal batched send request is retried at least once before starting to increase the internal backoff send interval, normally batched events will generally be attempted the next nearest even number of times. This means that the total number of actual send attempts will almost always be even (setting to 5 will cause 6 requests), unless using manual synchronous flushing (calling flush(false)) which is not subject to request level retry attempts. | number
    Default: 6 | [maxUnloadEventRetryAttempts](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#maxUnloadEventRetryAttempts)
    (Since 3.1.11+) | [Optional] Identifies the number of times any single event will be retried if it receives a failed (retriable) response as part of processing / flushing events once a page unload state has been detected, this causes the event to be internally "requeued" and resent in the next batch, which during page unload. Unlike the normal batching process, send requests are never retried, so the value listed here is always the maximum number of attempts for any single event.
    Notes: The SDK by default will use the sendBeacon() API if it exists which is treated as a fire and forget successful response, so for environments that support or supply this API the events won't be retried (because they will be deeded to be successfully sent). When an environment (IE) doesn't support sendBeacon(), this will cause multiple synchronous (by default) XMLHttpRequests to be sent, which will block the UI until a response is received. You can disable ALL synchronous XHR requests by setting the 'disableXhrSync' configuration setting and/or changing this value to 0 or 1. | number
    Default: 2 | [addNoResponse](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#addNoResponse)
    (Since 3.2.8+) | [Optional] flag to indicate whether the sendBeacon and fetch (with keep-alive flag) should add the "NoResponseBody" query string value to indicate that the server should return a 204 for successful requests. | boolean
    Default: true | [disableZip](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IChannelConfiguration.html#disableZip)
    (Since 4.3.7+) | [Optional] flag to use CompressionStream API to compress the payload. Compression will only occur if the event is asynchronous. For events like unloads, compression will not be applied. * Note: if user set payloadPreprocessor, this zip compression will not be applied. | boolean
    Default: true ### [IXHROverride](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IXHROverride.html) | Config | Description | Type |----------------|----------------------------------------|----| | [sendPOST](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/interfaces/IXHROverride.html#sendPOST) |This method sends data to the specified URI using a POST request. If sync is true then the request is sent synchronously. The oncomplete function should always be called after the request is completed (either successfully or timed out or failed due to errors).|function ### Payload Preprocessors ```ts interface IPayloadData { urlString: string; data: Uint8Array | string; headers?: { [name: string]: string }; timeout?: number; // Optional value supplied by the xhrTimeout configuration option disableXhrSync?: boolean; // Optional value supplied by the disableXhrSync configuration option } type PayloadPreprocessorFunction = (payload: IPayloadData, callback: (modifiedBuffer: IPayloadData) => void) => void; ``` To perform some preprocessing operation on your payload before it is sent over the wire, you can supply the POST channel config with a `payloadPreprocessor` function. A typical usage of it would be to gzip your payloads. ```ts const zlib = require('zlib'); const gzipFn: PayloadPreprocessorFunction = (payload: IPayloadData, cb) => { zlib.gzip(payload.data, (err, dataToSend) => { if (err) return cb(payload); // send original payload on error const payloadToSend = { ...payload, headers: { ...payload.headers, 'Content-Encoding': 'gzip' }; data: dataToSend, }; cb(payloadToSend); }); } ``` ### XHR Override ```ts /** * SendPOSTFunction type defines how an HTTP POST request is sent to an ingestion server * @param payload - The payload object that should be sent, contains the url, bytes/string and headers for the request * @param oncomplete - The function to call once the request has completed whether a success, failure or timeout * @param sync - A boolean flag indicating whether the request should be sent as a synchronous request. */ export type SendPOSTFunction = (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string; }, response?: string) => void, sync?: boolean) => void; /** * The IXHROverride interface overrides the way HTTP requests are sent. */ export interface IXHROverride { /** * This method sends data to the specified URI using a POST request. If sync is true, * then the request is sent synchronously. The oncomplete function should always be called after the request is * completed (either successfully or timed out or failed due to errors). */ sendPOST: SendPOSTFunction; } ``` #### Example using node.js Https module ```ts const oneDs = require('@microsoft/1ds-analytics-js'); const https = require('https'); // XHR override using node.js https module var customHttpXHROverride= { sendPOST: (payload: IPayloadData, oncomplete) => { var options = { method: 'POST', headers: { ...payload.headers, "Content-Type": "application/json", "Content-Length": Buffer.byteLength(payload.data) } }; const req = https.request(payload.urlString, options, res => { res.on('data', function (responseData) { oncomplete(res.statusCode, res.headers, responseData.toString()); }); }); req.write(payload.data); req.end(); } }; var postChannelConfig: IChannelConfiguration = { httpXHROverride: customHttpXHROverride }; ``` #### Example always using fetch API This example is using the [fetch() API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch) for all requests, include synchronous requests and assumes that the browser environment supports the (currently) experimental keepalive option (for chromium). ```ts function fetchHttpXHROverride(payload: IPayloadData, onComplete: OnCompleteCallback, sync?: boolean) { let ignoreResponse = false; let responseHandled = false; let requestInit: RequestInit = { body: payload.data, method: Method, headers: payload.headers, [DisabledPropertyName]: true, credentials: "include" }; if (sync) { // You should validate whether the runtime environment supports this flag and if not you should use either sendBeacon or a synchronous XHR request requestInit.keepalive = true; if (sync) { // As a sync request (during unload), it is unlikely that we will get a chance to process the response so // just like beacon send assume that the events have been accepted and processed ignoreResponse = true; } } fetch(payload.urlString, requestInit).then((response) => { let headerMap = {}; let responseText = ""; if (response.headers) { response.headers.forEach((value: string, name: string) => { headerMap[name] = value; }); } if (response.body) { response.text().then(function(text) { responseText = text; }); } if (!responseHandled) { responseHandled = true; onComplete(response.status, headerMap, responseText); } }).catch((error) => { // In case there is an error in the request. Set the status to 0 // so that the events can be retried later. if (!responseHandled) { responseHandled = true; onComplete(0, {}); } }); // If we are treating this as a synchronous (keepAlive) we need to assume success during unload processing if (ignoreResponse && !responseHandled) { responseHandled = true; onComplete(200, {}); } // Simulate timeout if a timeout was supplied if (!responseHandled && payload.timeout > 0) { setTimeout(() => { if (!responseHandled) { // Assume a 500 response (which will cause a retry) responseHandled = true; onComplete(500, {}); } }, payload.timeout); } } let postChannelConfig: IChannelConfiguration = { httpXHROverride: fetchHttpXHROverride, // Enable this flag to cause the SDK to ALWAYS call your override otherwise during page unload the SDK will using it's internal // sendPost implementation using sendBeacon() or fetch (with keepalive support) whichever is the first supported //alwaysUseXhrOverride: true, // If you want to specify a timeout this value is passed on the payload object as `payload.timeout` //xhrTimeout: 20000, }; ``` ## IValueSanitizer Paths / Fields which are excluded To ensure that the service can continue to accept events that are sent from the SDK, some paths and fields are explicitly blocked and are never processed via any configured valueSanitizer. These fields are blocked at the serialization level and cannot be overridden. The path / fields names are based on the format of the envelope (serialized object) as defined via the [Common Schema 4.0](https://aka.ms/CommonSchema) specification, so the path / field names used for the IValueSanitizer are based on how the data is serialized to the service (CS 4.0 location) and not specifically the location on the event object you pass into the track methods (unless they are the same). The currently configured set of fields include ### Excluded Part A fields - All direct top-level fields of the envelope, this includes "ver"; "name"; "time" and "iKey". see [Common Schema 4.0 - Part A](https://aka.ms/CommonSchema/PartA) for all defined fields. Note: This exclusion does does not match sub-keys (objects) like "ext", "data" and "properties". - All fields of the web extension, this includes all fields and sub keys of "ext.web" (example fields include "ext.web.browser"; "ext.web.domain"; "ext.web.consentDetails"). see [Common Schema 4.0 - Part A Extension - web](https://aka.ms/CommonSchema/PartA/Web) for the complete set of defined fields. - All fields and paths of the metadata extension, this includes all fields and sub keys of "ext.metadata". see [Common Schema 4.0 - Part A Extension - metadata](https://aka.ms/CommonSchema/PartA/MetaData) for the complete set of defined fields. ## Synchronous Events By default events are batched and sent asynchronously, there are times when you want to send events immediately during the same JavaScript execution cycle. To support this you can set the ```sync``` property on an event to tell the PostChannel to skip the normal event batching and send this event now within it's own outbound connection. Because each ```sync``` event will cause a new request / connection (per event) you should use this approach SPARINGLY to avoid creating an excessive number of requests from the users browser which may have a negative impact on their experience. Note: If the initial synchronous request fails (not the normal case) any sync event will be queued for resending as an asynchronous batch (unless an "unload" event has been detected). ### Supported Sync values Supported event ```sync``` values to cause an event to be sent immediately during the same JavaScript execution cycle. In the case of the sendBeacon() and fetch() [with keepalive] (SyncFetch) both of these API's have a maximum payload size defined as 64Kb, as such if the size of the serialized (JSON) events are larger than this the events will be dropped as there is no safe way to send the event. | Name | Value | Description |----------|-------|------------------- | Batched | undefined,
    false,
    0 | This is the default situation and will cause the event to be Batched and sent asynchronously. | Synchronous | true,
    1 | Attempt to send the request using the default synchronous method.
    This will use the first available transport option:
    - httpXHROverride;
    -XMLHttpRequest (with sync flag);
    -fetch() [with keepalive] (Since v3.1.3);
    -sendBeacon() (Since v3.1.3) | SendBeacon | 2 | (Since v3.1.3) Attempt to send the event synchronously with a preference for the sendBeacon() API.
    This will use the first available transport option:
    -sendBeacon();
    -fetch() [with keepalive];
    -XMLHttpRequest (with sync flag);
    -httpXHROverride | SyncFetch | 3 | (Since v3.1.3) Attempt to send the event synchronously with a preference for the fetch() API with the keepalive flag, the SDK checks to ensure that the fetch() implementation supports the 'keepalive' flag and if not it will skip this transport option.
    This will use the first available transport option:
    -fetch() [with keepalive];
    -sendBeacon();
    -XMLHttpRequest (with sync flag);
    -httpXHROverride The named values are available in TypeScript via the ```EventSendType``` const enum class since v3.1.3. > Note: The SDK explicitly checks for ```keepalive``` support for fetch() via the ```Request``` class, so if not available this transport will not be used. [Browsers natively supporting fetch() keepalive](https://caniuse.com/?search=keepalive), as such any polyfill would also need to support this flag for it to be used. ___Special sendBeacon() Note___ As the sendBeacon() API does not provide any response handling, any events sent via this method are considered to have been successfully sent, even if the browser fails to send the requests. The only exception is that if the browser returns false indicating that it can't accept the sendBeacon() request, in this case the SDK will send a dropped event notification. ### When to use 'sync' events Events that cause a page navigation can cause a race condition that could result in either event loss or duplication. This happens when any previously batched events have been sent (the request is in-flight) and the browser subsequently cancels the request before a response is processed AND it also triggers the JavaScript "cancel" or "abort" event, normally only during the unload process. The SDK listens to all supported "unload" events (```unload```, ```beforeunload``` and ```pagehide```) and when any one of these are detected it will immediately send all (unsent) batched events via the "SendBeacon" (and fallback) methods above. This successfully mitigates the event loss case above, but it can compound the event duplication case for some scenarios as the SDK works to ensure that all events are sent and acknowledged. This situation has become more prevalent with the enforcement by modern browsers to disallow, cancel or abort the usage of synchronous Xhr requests during page "unload" event. There are effectively 2 scenarios where you should consider adding the `sync` property to an event (using the asynchronous SendBeacon and SyncFetch values) to remove the possibility of event duplication (the WebAnalytics extension already handles these cases). 1) You want to send your own event during the page "unload" events and you have hooked the "unload" events yourself (before) initializing the SDK. - When you listen to the events "before" the SDK initializes, there is a small window of time where any "batched" event may get sent (and therefore become in-flight) before the SDK receives and processes the "unload" events, thus the potential race condition. - If you attach to the "unload" events "after" the SDK is initialized, it will now (since v3.1.3) automatically convert all received event(s) into "sync" (SendBeacon) events to ensure delivery. 2) You want to send you own telemetry event(s) based on some user action after which a page-navigation immediately occurs, either via an anchor <a /> containing a href and letting the event bubble or by directly causing a navigation via a form Post or location change. - This is because because the href / post / location change will eventually cause an "unload" event to occur and therefore (potentially) any outbound (in-flight) requests may get canceled and cause event to be duplicated. - While this situation can occur with any other batched events, it is more likely to occur when events are created during these know situations that are known to directly trigger the "unload" cycle. ## API documentation [Typedoc generated API reference](https://microsoft.github.io/ApplicationInsights-JS/webSdk/1ds-post-js/index.html) ## Learn More You can learn more in [1DS First party getting started](https://aka.ms/1dsjs). ## Data Collection The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at [https://go.microsoft.com/fwlink/?LinkID=824704](https://go.microsoft.com/fwlink/?LinkID=824704). You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. To turn off sending telemetry to Microsoft, ensure that the POST channel is not configured in the extensions. See below configuration for example: ```js var coreConfig: IExtendedConfiguration = { instrumentationKey: "YOUR_TENANT_KEY", extensions: [ postChannel // << REMOVE THIS EXTENSION TO STOP SENDING TELEMETRY TO MICROSOFT ], extensionConfig: {} }; ``` ## Contributing Read our [contributing guide](./CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Application Insights. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft�s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft�s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party�s policies. ## License [MIT](./LICENSE.TXT) ================================================ FILE: channels/1ds-post-js/SECURITY.md ================================================ ## Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. ## Preferred Languages We prefer all communications to be in English. ## Policy Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). ================================================ FILE: channels/1ds-post-js/SUPPORT.md ================================================ # Support ## How to file issues and get help This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new Issue. For help and questions about using this project, please create a Support request issue on https://github.com/microsoft/ApplicationInsights-JS/issues. ## Microsoft Support Policy Support for this **PROJECT or PRODUCT** is limited to the resources listed above. ================================================ FILE: channels/1ds-post-js/api-extractor.json ================================================ /** * Config file for API Extractor. For more info, please visit: https://api-extractor.com */ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", /** * Optionally specifies another JSON config file that this file extends from. This provides a way for * standard settings to be shared across multiple projects. * * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be * resolved using NodeJS require(). * * SUPPORTED TOKENS: none * DEFAULT VALUE: "" */ // "extends": "./shared/api-extractor-base.json" // "extends": "my-package/include/api-extractor-base.json" /** * Determines the "" token that can be used with other config file settings. The project folder * typically contains the tsconfig.json and package.json config files, but the path is user-defined. * * The path is resolved relative to the folder of the config file that contains the setting. * * The default value for "projectFolder" is the token "", which means the folder is determined by traversing * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error * will be reported. * * SUPPORTED TOKENS: * DEFAULT VALUE: "" */ "projectFolder": ".", /** * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor * analyzes the symbols exported by this module. * * The file extension must be ".d.ts" and not ".ts". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , */ "mainEntryPointFilePath": "/build/types/Index.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. * * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly * imports library2. To avoid this, we can specify: * * "bundledPackages": [ "library2" ], * * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been * local files for library1. */ "bundledPackages": [ ], /** * Determines how the TypeScript compiler engine will be invoked by API Extractor. */ "compiler": { /** * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * Note: This setting will be ignored if "overrideTsconfig" is used. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/tsconfig.json" */ // "tsconfigFilePath": "/tsconfig.json", /** * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. * The object must conform to the TypeScript tsconfig schema: * * http://json.schemastore.org/tsconfig * * If omitted, then the tsconfig.json file will be read from the "projectFolder". * * DEFAULT VALUE: no overrideTsconfig section */ // "overrideTsconfig": { // . . . // } /** * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. * * DEFAULT VALUE: false */ // "skipLibCheck": true, }, /** * Configures how the API report file (*.api.md) will be generated. */ "apiReport": { /** * (REQUIRED) Whether to generate an API report. */ "enabled": false, /** * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce * a full file path. * * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". * * SUPPORTED TOKENS: , * DEFAULT VALUE: ".api.md" */ "reportFileName": ".api.md", /** * Specifies the folder where the API report file is written. The file name portion is determined by * the "reportFileName" setting. * * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, * e.g. for an API review. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/etc/" */ "reportFolder": "/build/dts/", /** * Specifies the folder where the temporary report file is written. The file name portion is determined by * the "reportFileName" setting. * * After the temporary file is written to disk, it is compared with the file in the "reportFolder". * If they are different, a production build will fail. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/" */ // "reportTempFolder": "/temp/" }, /** * Configures how the doc model file (*.api.json) will be generated. */ "docModel": { /** * (REQUIRED) Whether to generate a doc model file. */ "enabled": true, /** * The output path for the doc model file. The file extension should be ".api.json". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/.api.json" */ "apiJsonFilePath": "/build/dts/.api.json" }, /** * Configures how the .d.ts rollup file will be generated. */ "dtsRollup": { /** * (REQUIRED) Whether to generate the .d.ts rollup file. */ "enabled": true, /** * Specifies the output path for a .d.ts rollup file to be generated without any trimming. * This file will include all declarations that are exported by the main entry point. * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/dist/.d.ts" */ "untrimmedFilePath": "/build/dts/.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. * This file will include only declarations that are marked as "@public" or "@beta". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "betaTrimmedFilePath": "/dist/-beta.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. * This file will include only declarations that are marked as "@public". * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "publicTrimmedFilePath": "/dist/-public.d.ts", /** * When a declaration is trimmed, by default it will be replaced by a code comment such as * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the * declaration completely. * * DEFAULT VALUE: false */ // "omitTrimmingComments": true }, /** * Configures how the tsdoc-metadata.json file will be generated. */ "tsdocMetadata": { /** * Whether to generate the tsdoc-metadata.json file. * * DEFAULT VALUE: true */ "enabled": false, /** * Specifies where the TSDoc metadata file should be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup * falls back to "tsdoc-metadata.json" in the package folder. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ "tsdocMetadataFilePath": "/build/dts/tsdoc-metadata.json" }, /** * Configures how API Extractor reports error and warning messages produced during analysis. * * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. */ "messages": { /** * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing * the input .d.ts files. * * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "compilerMessageReporting": { /** * Configures the default routing for messages that don't match an explicit rule in this table. */ "default": { /** * Specifies whether the message should be written to the the tool's output log. Note that * the "addToApiReportFile" property may supersede this option. * * Possible values: "error", "warning", "none" * * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes * the "--local" option), the warning is displayed but the build will not fail. * * DEFAULT VALUE: "warning" */ "logLevel": "warning", /** * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), * then the message will be written inside that file; otherwise, the message is instead logged according to * the "logLevel" option. * * DEFAULT VALUE: false */ // "addToApiReportFile": false }, // "TS2551": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . }, /** * Configures handling of messages reported by API Extractor during its analysis. * * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" * * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings */ "extractorMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false }, "ae-missing-release-tag": { "logLevel": "none" }, // // . . . }, /** * Configures handling of messages reported by the TSDoc parser when analyzing code comments. * * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "tsdocMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false } // "tsdoc-link-tag-unescaped-text": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . } } } ================================================ FILE: channels/1ds-post-js/package.json ================================================ { "name": "@microsoft/1ds-post-js", "version": "4.4.1", "description": "Microsoft Application Insights JavaScript SDK - 1ds-post-channel-js", "author": "Microsoft Application Insights Team", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "license": "MIT", "sideEffects": false, "scripts": { "clean": "git clean -xdf", "build": "npm run build:esm && npm run build:browser && npm run dtsgen && npm run sri", "build:esm": "grunt 1dsPostBuild", "build:browser": "npx rollup -c rollup.config.js --bundleConfigAsCjs", "rebuild": "npm run build", "ai-min": "grunt 1dsPost-min", "ai-restore": "grunt 1dsPost-restore", "dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"1DS JS SDK Post Channel\" -oneDs", "test": "grunt 1dsPostTest", "mintest": "grunt adsPostMinTest", "perftest": "", "makePublicPackage": "node ../../tools/makePublic/makePublicPackage.js ./package.json && npm pack", "publishPackage": "npm publish", "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js", "npm-pack": "npm pack", "api-docs": "typedoc" }, "dependencies": { "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-core-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x", "@nevware21/ts-async": ">= 0.5.5 < 2.x" }, "devDependencies": { "@microsoft/ai-test-framework": "0.0.1", "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es5": "1.0.2", "@microsoft/api-extractor": "^7.40.0", "globby": "^11.0.0", "grunt": "^1.6.1", "sinon": "^7.3.1", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "rollup": "^3.20.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-sourcemaps": "^0.6.3", "typedoc": "^0.26.6", "typescript": "^4.9.3", "pako": "^2.0.3" }, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/channels/1ds-post-js" }, "main": "dist/es5/ms.post.js", "module": "dist-es5/Index.js", "types": "types/1ds-post-js.d.ts", "keywords": [ "1DS", "Js", "SDK" ] } ================================================ FILE: channels/1ds-post-js/rollup.config.js ================================================ import { createConfig } from "../../rollup.base.config"; import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const inputName = "Index"; const outputName = "ms.post"; const banner = [ "/*!", ` * 1DS JS SDK POST plugin, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " * (Microsoft Internal Only)", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the ISC License.": "" }; updateDistEsmFiles(replaceValues, banner, true, true, "dist-es5"); export default createConfig(banner, { namespace: "oneDS", version: version, node: { entryPoint: inputName, outputName: outputName, }, browser: { entryPoint: inputName, outputName: outputName } }, [ "Index" ], true ); ================================================ FILE: channels/1ds-post-js/src/BatchNotificationActions.ts ================================================ /** * BatchNotificationActions.ts * @author Nev Wylie (newylie) * @copyright Microsoft 2020 */ import { EventSendType } from "@microsoft/applicationinsights-core-js"; import { EventBatchNotificationReason } from "./DataModels"; import { EventBatch } from "./EventBatch"; export type BatchNotificationAction = (batches: EventBatch[], reason?: EventBatchNotificationReason, isSyncRequest?: boolean, sendType?: EventSendType) => void; // tslint:disable-next-line:interface-name export interface BatchNotificationActions { /** * Attempts have been made to send the events but all failed. * Requeue the events (if possible) for resending. */ requeue?: BatchNotificationAction; /** * The batch is about to be sent */ send?: BatchNotificationAction; /** * The batch has been sent acknowledged by the server */ sent?: BatchNotificationAction; /** * The events of the batch have been dropped */ drop?: BatchNotificationAction; /** * The events of the batch have been dropped after being sent but not acknowledged */ rspFail?: BatchNotificationAction; /** * Default callback action to call when no specific action could be identified for the reason */ oth?: BatchNotificationAction; } ================================================ FILE: channels/1ds-post-js/src/ClockSkewManager.ts ================================================ /** * ClockSkewManager.ts * @author Abhilash Panwar (abpanwar) * @copyright Microsoft 2018 */ /** * Internal interface to manage clock skew correction. * @internal */ export interface IClockSkewManager { /** * Determine if the request can be sent. * @returns True if requests can be sent, false otherwise. */ allowRequestSending(): boolean; /** * Tells the ClockSkewManager that it should assume that the first request has now been sent, * If this method had not yet been called AND the clock Skew had not been set this will set * allowRequestSending to false until setClockSet() is called. */ firstRequestSent(): void; /** * Determine if clock skew headers should be added to the request. * @returns True if clock skew headers should be added, false otherwise. */ shouldAddClockSkewHeaders(): boolean; /** * Gets the clock skew header value. * @returns The clock skew header value. */ getClockSkewHeaderValue(): string; /** * Sets the clock skew header value. Once clock skew is set this method * is no-op. * @param timeDeltaInMillis - Time delta to be saved as the clock skew header value. */ setClockSkew(timeDeltaInMillis?: string): void; } /** * Factory function to create a ClockSkewManager instance. * @returns A new IClockSkewManager instance. * @internal */ export function createClockSkewManager(): IClockSkewManager { let _allowRequestSending = true; let _shouldAddClockSkewHeaders = true; let _isFirstRequest = true; let _clockSkewHeaderValue = "use-collector-delta"; let _clockSkewSet = false; return { /** * Determine if requests can be sent. * @returns True if requests can be sent, false otherwise. */ allowRequestSending: (): boolean => { return _allowRequestSending; }, /** * Tells the ClockSkewManager that it should assume that the first request has now been sent, * If this method had not yet been called AND the clock Skew had not been set this will set * allowRequestSending to false until setClockSet() is called. */ firstRequestSent: () => { if (_isFirstRequest) { _isFirstRequest = false; if (!_clockSkewSet) { // Block sending until we get the first clock Skew _allowRequestSending = false; } } }, /** * Determine if clock skew headers should be added to the request. * @returns True if clock skew headers should be added, false otherwise. */ shouldAddClockSkewHeaders: (): boolean => { return _shouldAddClockSkewHeaders; }, /** * Gets the clock skew header value. * @returns The clock skew header value. */ getClockSkewHeaderValue: (): string => { return _clockSkewHeaderValue; }, /** * Sets the clock skew header value. Once clock skew is set this method * is no-op. * @param timeDeltaInMillis - Time delta to be saved as the clock skew header value. */ setClockSkew: (timeDeltaInMillis?: string) => { if (!_clockSkewSet) { if (timeDeltaInMillis) { _clockSkewHeaderValue = timeDeltaInMillis; _shouldAddClockSkewHeaders = true; _clockSkewSet = true; } else { _shouldAddClockSkewHeaders = false; } // Unblock sending _allowRequestSending = true; } } }; } ================================================ FILE: channels/1ds-post-js/src/DataModels.ts ================================================ /** * DataModels.ts * @author Abhilash Panwar (abpanwar) and Hector Hernandez (hectorh) * @copyright Microsoft 2018 * File containing the interfaces for Post channel module. */ import { IDiagnosticLogger, IExtendedTelemetryItem, IPayloadData, IProcessTelemetryContext, ITelemetryPlugin, IUnloadHook, IValueSanitizer, IXHROverride } from "@microsoft/applicationinsights-core-js"; /** * Defines the function signature for the Payload Preprocessor. * @param payload - The Initial constructed payload that if not modified should be passed onto the callback function. * @param callback - The preprocessor MUST call the callback function to ensure that the events are sent to the server, failing to call WILL result in dropped events. * The modifiedBuffer argument can be either the original payload or may be modified by performing GZipping of the payload and adding the content header. * @param isSync - A boolean flag indicating whether this request was initiated as part of a sync response (unload / flush request), this is for informative only. * e.g the preprocessor may wish to not perform any GZip operations if the request was a sync request which is normally called as part of an unload request. */ export type PayloadPreprocessorFunction = (payload: IPayloadData, callback: (modifiedBuffer: IPayloadData) => void, isSync?: boolean) => void; /** * Defines the function signature of a payload listener, which is called after the payload has been sent to the server. The listener is passed * both the initial payload object and any altered (modified) payload from a preprocessor so it can determine what payload it may want to log or send. * Used by the Remove DDV extension to listen to server send events. * @param orgPayload - The initially constructed payload object * @param sendPayload - The alternative (possibly modified by a preprocessor) payload * @param isSync - A boolean flag indicating whether this request was initiated as part of a sync response (unload / flush request), this is for informative only. * @param isBeaconSend - A boolean flag indicating whether the payload was sent using the navigator.sendBeacon() API. */ export type PayloadListenerFunction = (orgPayload: IPayloadData, sendPayload?: IPayloadData, isSync?: boolean, isBeaconSend?: boolean) => void; /** * The IChannelConfiguration interface holds the configuration details passed to Post module. */ export interface IChannelConfiguration { /** * [Optional] The number of events that can be kept in memory before the SDK starts to drop events. By default, this is 10,000. */ eventsLimitInMem?: number; /** * [Optional] Sets the maximum number of immediate latency events that will be cached in memory before the SDK starts to drop other * immediate events only, does not drop normal and real time latency events as immediate events have their own internal queue. Under * normal situations immediate events are scheduled to be sent in the next Javascript execution cycle, so the typically number of * immediate events is small (~1), the only time more than one event may be present is when the channel is paused or immediate send * is disabled (via manual transmit profile). By default max number of events is 500 and the default transmit time is 0ms. */ immediateEventLimit?: number; /** * [Optional] If defined, when the number of queued events reaches or exceeded this limit this will cause the queue to be immediately * flushed rather than waiting for the normal timers. Defaults to undefined. */ autoFlushEventsLimit?: number; /** * [Optional] If defined allows you to disable the auto batch (iKey set of requests) flushing logic. This is in addition to the * default transmission profile timers, autoFlushEventsLimit and eventsLimitInMem config values. */ disableAutoBatchFlushLimit?: boolean; /** * [Optional] Sets the record and request size limit in bytes for serializer. * Default for record size (sync) is 65000, record size (async) is 2000000. * Default for request size (sync) is 65000, request size (async) is 3145728. * @since 3.3.7 */ requestLimit?: IRequestSizeLimit; /** * [Optional] Sets the limit number of events per batch. * Default is 500 * @since 3.3.7 */ maxEvtPerBatch?: number /** * [Optional] The HTTP override that should be used to send requests, as an IXHROverride object. * By default during the unload of a page or if the event specifies that it wants to use sendBeacon() or sync fetch (with keep-alive), * this override will NOT be called. You can now change this behavior by enabling the 'alwaysUseXhrOverride' configuration value. * The payload data (first argument) now also includes any configured 'timeout' (defaults to undefined) and whether you should avoid * creating any synchronous XHR requests 'disableXhrSync' (defaults to false/undefined) */ httpXHROverride?: IXHROverride; /** * Override for Instrumentation key */ overrideInstrumentationKey?: string; /** * Override for Endpoint where telemetry data is sent */ overrideEndpointUrl?: string; /** * The master off switch. Do not send any data if set to TRUE */ disableTelemetry?: boolean; /** * MC1 and MS0 cookies will not be returned from Collector endpoint. */ ignoreMc1Ms0CookieProcessing?: boolean; /** * Override for setTimeout */ setTimeoutOverride?: typeof setTimeout; /** * Override for clearTimeout */ clearTimeoutOverride?: typeof clearTimeout; /** * [Optional] POST channel preprocessing function. Can be used to gzip the payload before transmission and to set the appropriate * Content-Encoding header. The preprocessor is explicitly not called during teardown when using the sendBeacon() API. */ payloadPreprocessor?: PayloadPreprocessorFunction; /** * [Optional] POST channel listener function, used for enabling logging or reporting (RemoteDDVChannel) of the payload that is being sent. */ payloadListener?: PayloadListenerFunction; /** * [Optional] By default additional timing metrics details are added to each event after they are sent to allow you to review how long it took * to create serialized request. As not all implementations require this level of detail and it's now possible to get the same metrics via * the IPerfManager and IPerfEvent we are enabling these details to be disabled. Default value is false to retain the previous behavior, * if you are not using these metrics and performance is a concern then it is recommended to set this value to true. */ disableEventTimings?: boolean; /** * [Optional] The value sanitizer to use while constructing the envelope. */ valueSanitizer?: IValueSanitizer; /** * [Optional] During serialization, when an object is identified, should the object be serialized by JSON.stringify(theObject); (when true) otherwise by theObject.toString(). * Defaults to false */ stringifyObjects?: boolean; /** * [Optional] Enables support for objects with compound keys which indirectly represent an object where the "key" of the object contains a "." as part of it's name. * @example * ```typescript * event: { "somedata.embeddedvalue": 123 } * ``` */ enableCompoundKey?: boolean; /** * [Optional] Switch to disable the v8 optimizeObject() calls used to provide better serialization performance. Defaults to false. */ disableOptimizeObj?: boolean; /** * [Optional] By default a "Cache-Control" header will be added to the outbound payloads with the value "no-cache, no-store", this is to * avoid instances where Chrome can "Stall" requests which use the same outbound URL. */ // See Task #7178858 - Collector requires a change to support this // disableCacheHeader?: boolean; /** * [Optional] Either an array or single value identifying the requested TransportType type that should be used. * This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride is provided. */ transports?: number | number[]; /** * [Optional] Either an array or single value identifying the requested TransportType type(s) that should be used during unload or events * marked as sendBeacon. This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride * is provided and alwaysUseXhrOverride is true. */ unloadTransports?: number | number[]; /** * [Optional] A flag to enable or disable the usage of the sendBeacon() API (if available). If running on ReactNative this defaults * to `false` for all other cases it defaults to `true`. */ useSendBeacon?: boolean; /** * [Optional] A flag to disable the usage of the [fetch with keep-alive](https://javascript.info/fetch-api#keepalive) support. */ disableFetchKeepAlive?: boolean; /** * [Optional] Avoid adding request headers to the outgoing request that would cause a pre-flight (OPTIONS) request to be sent for each request. * This currently defaults to false. This is changed as the collector enables Access-Control-Max-Age to allow the browser to better cache any * previous OPTIONS response. Hence, we moved some of the current dynamic values sent on the query string to a header. */ avoidOptions?: boolean; /** * [Optional] Specify a timeout (in ms) to apply to requests when sending requests using XHR, XDR or fetch requests. Defaults to undefined * and therefore the runtime defaults (normally zero for browser environments) */ xhrTimeout?: number; /** * [Optional] When using Xhr for sending requests disable sending as synchronous during unload or synchronous flush. * You should enable this feature for IE (when there is no sendBeacon() or fetch (with keep-alive)) and you have clients * that end up blocking the UI during page unloading. This will cause ALL XHR requests to be sent asynchronously which * during page unload may result in the lose of telemetry. */ disableXhrSync?: boolean; /** * [Optional] By default during unload (or when you specify to use sendBeacon() or sync fetch (with keep-alive) for an event) the SDK * ignores any provided httpXhrOverride and attempts to use sendBeacon() or fetch(with keep-alive) when they are available. * When this configuration option is true any provided httpXhrOverride will always be used, so any provided httpXhrOverride will * also need to "handle" the synchronous unload scenario. */ alwaysUseXhrOverride?: boolean; /** * [Optional] Identifies the number of times any single event will be retried if it receives a failed (retirable) response, this * causes the event to be internally "requeued" and resent in the next batch. As each normal batched send request is retried at * least once before starting to increase the internal backoff send interval, normally batched events will generally be attempted * the next nearest even number of times. This means that the total number of actual send attempts will almost always be even * (setting to 5 will cause 6 requests), unless using manual synchronous flushing (calling flush(false)) which is not subject to * request level retry attempts. * Defaults to 6 times. */ maxEventRetryAttempts?: number; /** * [Optional] Identifies the number of times any single event will be retried if it receives a failed (retriable) response as part * of processing / flushing events once a page unload state has been detected, this causes the event to be internally "requeued" * and resent in the next batch, which during page unload. Unlike the normal batching process, send requests are never retried, * so the value listed here is always the maximum number of attempts for any single event. * Defaults to 2 times. * Notes: * The SDK by default will use the sendBeacon() API if it exists which is treated as a fire and forget successful response, so for * environments that support or supply this API the events won't be retried (because they will be deeded to be successfully sent). * When an environment (IE) doesn't support sendBeacon(), this will cause multiple synchronous (by default) XMLHttpRequests to be sent, * which will block the UI until a response is received. You can disable ALL synchronous XHR requests by setting the 'disableXhrSync' * configuration setting and/or changing this value to 0 or 1. */ maxUnloadEventRetryAttempts?: number; /** * [Optional] flag to indicate whether the sendBeacon and fetch (with keep-alive flag) should add the "NoResponseBody" query string * value to indicate that the server should return a 204 for successful requests. Defaults to true */ addNoResponse?: boolean; /** * :warning: DO NOT USE THIS FLAG UNLESS YOU KNOW THAT PII DATA WILL NEVER BE INCLUDED IN THE EVENT! * * [Optional] Flag to indicate whether the SDK should include the common schema metadata in the payload. Defaults to true. * This flag is only applicable to the POST channel and will cause the SDK to exclude the common schema metadata from the payload, * while this will reduce the size of the payload, also means that the data marked as PII will not be processed as PII by the backend * and will not be included in the PII data purge process. * @since 4.1.0 */ excludeCsMetaData?: boolean; /** * [Optional] Specify whether cross-site Access-Control fetch requests should include credentials such as cookies, * authentication headers, or TLS client certificates. * * Possible values: * - "omit": never send credentials in the request or include credentials in the response. * - "include": always include credentials, even cross-origin. * - "same-origin": only send and include credentials for same-origin requests. * * If not set, the default value will be "include". * * For more information, refer to: * - [Fetch API - Using Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#including_credentials) * @since 3.3.1 */ fetchCredentials?: RequestCredentials; } /** * An interface which extends the telemetry event to track send attempts. */ export interface IPostTransmissionTelemetryItem extends IExtendedTelemetryItem { /** * The number of times the telemtry item has been attempted to be sent. */ sendAttempt?: number; } /** * Real Time profile (default profile). RealTime Latency events are sent every 1 sec and * Normal Latency events are sent every 2 sec. */ export const RT_PROFILE = "REAL_TIME"; /** * Near Real Time profile. RealTime Latency events are sent every 3 sec and * Normal Latency events are sent every 6 sec. */ export const NRT_PROFILE = "NEAR_REAL_TIME"; /** * Best Effort. RealTime Latency events are sent every 9 sec and * Normal Latency events are sent every 18 sec. */ export const BE_PROFILE = "BEST_EFFORT"; /** * An interface representing Collector Web responses. */ export interface ICollectorResult { /** * Number of events accepted. */ acc?: number; /** * Number of events rejected. */ rej?: number; /** * Web Result. */ webResult?: ICollectorWebResult; } /** * An interface representing Collector Web responses. */ export interface ICollectorWebResult { /** * MSFPC cookie. */ msfpc?: string; /** * Authentication error. */ authError?: string; /** * Auth Login URL. */ authLoginUrl?: string; } export interface IRequestSizeLimit { /** * Request size limit in bytes for serializer. * The value should be two numbers array, with format [async request size limit, sync request size limit] */ requestLimit?: number[]; /** * Record size limit in bytes for serializer. * The value should be two numbers array, with format [async record size limit, sync record size limit] */ recordLimit?: number[]; } /** * Post channel interface */ export interface IPostChannel extends ITelemetryPlugin { /** * Diagnostic logger */ diagLog: (itemCtx?: IProcessTelemetryContext) => IDiagnosticLogger; /** * Override for setTimeout */ _setTimeoutOverride?: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => any; /** * Backs off transmission. This exponentially increases all the timers. */ _backOffTransmission(): void; /** * Clears back off for transmission. */ _clearBackOff(): void; /** * Add handler to be executed with request response text. */ addResponseHandler(responseHandler: (responseText: string) => void): IUnloadHook; } /** * This is an internal notification reason used by the HttpManager to report the reason for notification events * it contains general events as well as specific sections which encompass other enum values such as * SendRequestReason, EventsDiscardedReason and general HttpStatus values. */ export declare const enum EventBatchNotificationReason { /** * Unable to send the batch as the outbound connection channel is paused */ Paused = 1, /** * The events failed to send or retry, so requeue them */ RequeueEvents = 100, /** * The Batch was successfully sent and a response received, equivalent to the HttpStatusCode of 200 */ Complete = 200, // Event Send Notifications (Mostly matched with SendRequestReason) /** * No specific reason was specified or normal event schedule / timer */ SendingUndefined = 1000, /** * Events are being sent based on the normal event schedule / timer. */ SendingNormalSchedule = 1001, /** * A manual flush request was received */ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values SendingManualFlush = 1001, /** * Unload event is being processed */ SendingUnload = 1002, /** * The event(s) being sent are sync events */ SendingSyncEvent = 1003, /** * The Channel was resumed */ SendingResumed = 1004, /** * The event(s) being sent as a retry */ SendingRetry = 1005, /** * Maximum batch size would be exceeded */ SendingMaxBatchSize = 1010, /** * The Maximum number of events have already been queued */ SendingMaxQueuedEvents = 1020, /** * The final value for a Sending notification */ SendingEventMax = 1999, // Events Dropped - Failures EventsDropped = 8000, // EventsDiscardedReason.Unknown NonRetryableStatus = 8001, // EventsDiscardedReason.NonRetryableStatus InvalidEvent = 8002, // EventsDiscardedReason.InvalidEvent SizeLimitExceeded = 8003, // EventsDiscardedReason.SizeLimitExceeded KillSwitch = 8004, // EventsDiscardedReason.KillSwitch, QueueFull = 8005, // EventsDiscardedReason.QueueFull BeaconSendFailure = 8006, // EventsDiscardedReason.BeaconSendFailure EventsDroppedMax = 8999, /** * Represents the range Http Status codes 000-999 as 9000-9999 */ ResponseFailure = 9000, /** * Represents the range Http Status codes 200-299 */ PartialSuccess = 9200, /** * Represents the range Http Status codes 300-399 */ ClientConfigFailure = 9300, /** * Represents the range Http Status codes 400-499 */ ClientFailure = 9400, /** * Represents the range Http Status codes 500-599 */ ServerFailure = 9500, ResponseFailureMax = 9999 } ================================================ FILE: channels/1ds-post-js/src/EventBatch.ts ================================================ /** * EventBatch.ts * @author Nev Wylie (newylie) * @copyright Microsoft 2020 */ import { isNullOrUndefined, isValueAssigned } from "@microsoft/applicationinsights-core-js"; import { IPostTransmissionTelemetryItem } from "./DataModels"; import { STR_EMPTY, STR_MSFPC } from "./InternalConstants"; function _getEventMsfpc(theEvent: IPostTransmissionTelemetryItem): string { let intWeb = ((theEvent.ext || {})["intweb"]); if (intWeb && isValueAssigned(intWeb[STR_MSFPC])) { return intWeb[STR_MSFPC]; } return null; } function _getMsfpc(theEvents: IPostTransmissionTelemetryItem[]): string { let msfpc: string = null; for (let lp = 0; msfpc === null && lp < theEvents.length; lp++) { msfpc = _getEventMsfpc(theEvents[lp]); } return msfpc; } /** * This class defines a "batch" events related to a specific iKey, it is used by the PostChannel and HttpManager * to collect and transfer ownership of events without duplicating them in-memory. This reduces the previous * array duplication and shared ownership issues that occurred due to race conditions caused by the async nature * of sending requests. */ export class EventBatch { /** * Creates a new Event Batch object * @param iKey - The iKey associated with this batch of events */ public static create(iKey: string, theEvents?: IPostTransmissionTelemetryItem[]): EventBatch { return new EventBatch(iKey, theEvents); } /** * Returns the iKey associated with this batch of events */ public iKey: () => string; /** * Returns the first msfpc value from the batch */ public Msfpc:() => string; /** * Returns the number of events contained in the batch */ public count: () => number; public events: () => IPostTransmissionTelemetryItem[]; /** * Add all of the events to the current batch, if the max number of events would be exceeded then no * events are added. * @param theEvents - The events that needs to be batched. * @returns The number of events added. */ public addEvent: (theEvents: IPostTransmissionTelemetryItem) => boolean; /** * Split this batch into 2 with any events > fromEvent returned in the new batch and all other * events are kept in the current batch. * @param fromEvent - The first event to remove from the current batch. * @param numEvents - The number of events to be removed from the current batch and returned in the new one. Defaults to all trailing events */ public split: (fromEvent: number, numEvents?: number) => EventBatch; /** * Private constructor so that caller is forced to use the static create method. * @param iKey - The iKey to associate with the events (not validated) * @param addEvents - The optional collection of events to assign to this batch - defaults to an empty array. */ private constructor(iKey: string, addEvents?: IPostTransmissionTelemetryItem[]) { let events: IPostTransmissionTelemetryItem[] = addEvents ? [].concat(addEvents) : []; let _self = this; let _msfpc = _getMsfpc(events); _self.iKey = (): string => { return iKey; }; _self.Msfpc = (): string => { // return the cached value unless it's undefined -- used to avoid cpu return _msfpc || STR_EMPTY; }; _self.count = (): number => { return events.length; }; _self.events = (): IPostTransmissionTelemetryItem[] => { return events; }; _self.addEvent = (theEvent: IPostTransmissionTelemetryItem): boolean => { if (theEvent) { events.push(theEvent); if (!_msfpc) { // Not found so try and find one _msfpc = _getEventMsfpc(theEvent); } return true; } return false; }; _self.split = (fromEvent: number, numEvents?: number) => { // Create a new batch with the same iKey let theEvents: IPostTransmissionTelemetryItem[]; if (fromEvent < events.length) { let cnt = events.length - fromEvent; if (!isNullOrUndefined(numEvents)) { cnt = numEvents < cnt ? numEvents : cnt; } theEvents = events.splice(fromEvent, cnt); // reset the fetched msfpc value _msfpc = _getMsfpc(events); } return new EventBatch(iKey, theEvents); }; } } ================================================ FILE: channels/1ds-post-js/src/HttpManager.ts ================================================ /** * HttpManager.ts * @author Abhilash Panwar (abpanwar); Hector Hernandez (hectorh); Nev Wylie (newylie) * @copyright Microsoft 2018-2020 */ import dynamicProto from "@microsoft/dynamicproto-js"; import { EventSendType, FullVersionString, IAppInsightsCore, ICookieMgr, IDiagnosticLogger, IExtendedConfiguration, IPayloadData, IPerfEvent, ITelemetryItem, IUnloadHook, IXDomainRequest, IXHROverride, OnCompleteCallback, SendRequestReason, SenderPostManager, TransportType, _IInternalXhrOverride, _ISendPostMgrConfig, _ISenderOnComplete, _eExtendedInternalMessageId, _eInternalMessageId, _getAllResponseHeaders, _throwInternal, _warnToConsole, arrForEach, dateNow, doPerf, dumpObj, eLoggingSeverity, extend, getCommonSchemaMetaData, getNavigator, getResponseText, getTime, hasOwnProperty, isBeaconsSupported, isFeatureEnabled, isFetchSupported, isNullOrUndefined, isReactNative, isUndefined, isValueAssigned, objForEachKey, objKeys, onConfigChange, optimizeObject, prependTransports, strUndefined } from "@microsoft/applicationinsights-core-js"; import { arrAppend, getInst, isFunction } from "@nevware21/ts-utils"; import { BatchNotificationAction, BatchNotificationActions } from "./BatchNotificationActions"; import { IClockSkewManager, createClockSkewManager } from "./ClockSkewManager"; import { EventBatchNotificationReason, IChannelConfiguration, ICollectorResult, IPostChannel, IPostTransmissionTelemetryItem, PayloadListenerFunction, PayloadPreprocessorFunction } from "./DataModels"; import { EventBatch } from "./EventBatch"; import { DEFAULT_CACHE_CONTROL, DEFAULT_CONTENT_TYPE, STR_API_KEY, STR_AUTH_XTOKEN, STR_CACHE_CONTROL, STR_CLIENT_ID, STR_CLIENT_VERSION, STR_CONTENT_TYPE_HEADER, STR_DROPPED, STR_EMPTY, STR_KILL_DURATION_HEADER, STR_KILL_TOKENS_HEADER, STR_MSA_DEVICE_TICKET, STR_MSFPC, STR_NO_RESPONSE_BODY, STR_OTHER, STR_REQUEUE, STR_RESPONSE_FAIL, STR_SENDING, STR_TIME_DELTA_HEADER, STR_TIME_DELTA_TO_APPLY, STR_UPLOAD_TIME } from "./InternalConstants"; import { IKillSwitch, createKillSwitch } from "./KillSwitch"; import { retryPolicyGetMillisToBackoffForRetry, retryPolicyShouldRetryForStatus } from "./RetryPolicy"; import { ISerializedPayload, Serializer } from "./Serializer"; import { ITimeoutOverrideWrapper, createTimeoutWrapper } from "./TimeoutOverrideWrapper"; const strSendAttempt = "sendAttempt"; const _noResponseQs = "&" + STR_NO_RESPONSE_BODY + "=true"; const UrlQueryString = "?cors=true&" + STR_CONTENT_TYPE_HEADER.toLowerCase() + "=" + DEFAULT_CONTENT_TYPE; interface IRequestUrlDetails { url: string, hdrs: { [key: string]: string }, useHdrs: boolean } /** * Identifies the default notification reason to the action names */ const _eventActionMap: any = { [EventBatchNotificationReason.Paused]: STR_REQUEUE, [EventBatchNotificationReason.RequeueEvents]: STR_REQUEUE, [EventBatchNotificationReason.Complete]: "sent", [EventBatchNotificationReason.KillSwitch]: STR_DROPPED, [EventBatchNotificationReason.SizeLimitExceeded]: STR_DROPPED, [EventBatchNotificationReason.BeaconSendFailure]: STR_DROPPED }; const _collectorQsHeaders = { }; const _collectorHeaderToQs = { }; function _addCollectorHeaderQsMapping(qsName: string, headerName: string, allowQs?: boolean) { _collectorQsHeaders[qsName] = headerName; if (allowQs !== false) { _collectorHeaderToQs[headerName] = qsName; } } _addCollectorHeaderQsMapping(STR_MSA_DEVICE_TICKET, STR_MSA_DEVICE_TICKET, false); _addCollectorHeaderQsMapping(STR_CLIENT_VERSION, STR_CLIENT_VERSION); _addCollectorHeaderQsMapping(STR_CLIENT_ID, "Client-Id"); _addCollectorHeaderQsMapping(STR_API_KEY, STR_API_KEY); _addCollectorHeaderQsMapping(STR_TIME_DELTA_TO_APPLY, STR_TIME_DELTA_TO_APPLY); _addCollectorHeaderQsMapping(STR_UPLOAD_TIME, STR_UPLOAD_TIME); _addCollectorHeaderQsMapping(STR_AUTH_XTOKEN, STR_AUTH_XTOKEN); interface IInternalPayloadData extends IPayloadData { _thePayload: ISerializedPayload; _sendReason: SendRequestReason; } function _hasHeader(headers: any, header: string) { let hasHeader = false; if (headers && header) { const keys = objKeys(headers); if (keys && keys.length > 0) { const lowerHeader = header.toLowerCase(); for (let lp = 0; lp < keys.length; lp++) { const value = keys[lp]; if (value && hasOwnProperty(header, value) && value.toLowerCase() === lowerHeader) { hasHeader = true; break; } } } } return hasHeader; } function _addRequestDetails(details: IRequestUrlDetails, name: string, value: string, useHeaders: boolean) { if (name && value && value.length > 0) { if (useHeaders && _collectorQsHeaders[name]) { details.hdrs[_collectorQsHeaders[name]] = value; details.useHdrs = true; } else { details.url += "&" + name + "=" + value; } } } interface IQueryStringParams { name: string, value: string } function _addQueryStringParameter(qsParams: IQueryStringParams[], name: string, value: string) { for (let i = 0; i < qsParams.length; i++) { if (qsParams[i].name === name) { qsParams[i].value = value; return; } } qsParams.push({ name: name, value: value }); } function _removeQueryStringParameter(qsParams: IQueryStringParams[], name: string) { for (let i = 0; i < qsParams.length; i++) { if (qsParams[i].name === name) { qsParams.splice(i, 1); return; } } } /** * Class managing the sending of requests. */ export class HttpManager { /** * @constructor * @param requestQueue - The queue that contains the requests to be sent. */ constructor(maxEventsPerBatch: number, maxConnections: number, maxRequestRetriesBeforeBackoff: number, actions: BatchNotificationActions) { // ------------------------------------------------------------------------------------------------------------------------ // Only set "Default" values in the _initDefaults() method, unless value are not "reset" during unloading // ------------------------------------------------------------------------------------------------------------------------ let _urlString: string; let _killSwitch: IKillSwitch; let _paused: boolean; let _clockSkewManager: IClockSkewManager; let _useBeacons = false; let _outstandingRequests: number; // Holds the number of outstanding async requests that have not returned a response yet let _postManager: IPostChannel; let _logger: IDiagnosticLogger; let _sendInterfaces: { [key: number]: _IInternalXhrOverride }; let _core: IAppInsightsCore; let _customHttpInterface: boolean; let _queryStringParameters: IQueryStringParams[]; let _headers: { [name: string]: string }; let _batchQueue: EventBatch[]; let _serializer: Serializer; let _enableEventTimings: boolean; let _cookieMgr: ICookieMgr; let _isUnloading: boolean; let _useHeaders: boolean; let _xhrTimeout: number; let _zipPayload: boolean; let _disableXhrSync: boolean; let _disableFetchKeepAlive: boolean; let _canHaveReducedPayload: boolean; let _addNoResponse: boolean; let _unloadHooks: IUnloadHook[]; let _sendHook: PayloadPreprocessorFunction | undefined; let _sendListener: PayloadListenerFunction | undefined; let _responseHandlers: Array<(responseText: string) => void>; let _isInitialized: boolean; let _timeoutWrapper: ITimeoutOverrideWrapper; let _excludeCsMetaData: boolean; let _sendPostMgr: SenderPostManager; let _fetchCredentials: RequestCredentials; let _maxEvtPerBatch: number = maxEventsPerBatch; // Sets default value in case the value is null dynamicProto(HttpManager, this, (_self) => { _initDefaults(); let _sendCredentials = true; _self.initialize = (theConfig: IExtendedConfiguration, core: IAppInsightsCore, postChannel: IPostChannel) => { if (!_isInitialized) { _core = core; _cookieMgr = core.getCookieMgr(); _postManager = postChannel; _logger = _postManager.diagLog(); arrAppend(_unloadHooks, onConfigChange(theConfig, (details) => { let coreConfig = details.cfg; let channelConfig: IChannelConfiguration = details.cfg.extensionConfig[postChannel.identifier]; _timeoutWrapper = createTimeoutWrapper(channelConfig.setTimeoutOverride, channelConfig.clearTimeoutOverride); if (isValueAssigned(coreConfig.anonCookieName)) { _addQueryStringParameter(_queryStringParameters, "anoncknm", coreConfig.anonCookieName); } else { _removeQueryStringParameter(_queryStringParameters, "anoncknm"); } _sendHook = channelConfig.payloadPreprocessor; _sendListener = channelConfig.payloadListener; let httpInterface = channelConfig.httpXHROverride; // Override endpointUrl if provided in Post config let endpointUrl = channelConfig.overrideEndpointUrl ? channelConfig.overrideEndpointUrl : coreConfig.endpointUrl; _urlString = endpointUrl + UrlQueryString; _useHeaders = !isUndefined(channelConfig.avoidOptions) ? !channelConfig.avoidOptions : true; _enableEventTimings = !channelConfig.disableEventTimings; let maxEvtCfg = channelConfig.maxEvtPerBatch; _maxEvtPerBatch = maxEvtCfg && maxEvtCfg <= maxEventsPerBatch? maxEvtCfg : maxEventsPerBatch; let valueSanitizer = channelConfig.valueSanitizer; let stringifyObjects = channelConfig.stringifyObjects; let enableCompoundKey = !!coreConfig.enableCompoundKey; if (!isUndefined(channelConfig.enableCompoundKey)) { enableCompoundKey = !!channelConfig.enableCompoundKey; } _xhrTimeout = channelConfig.xhrTimeout; const csStream = getInst("CompressionStream"); // Controls whether payload compression (gzip) is enabled. _zipPayload = isFeatureEnabled("zipPayload", coreConfig, false); // if user has payload processor (_sendHook), they may compress the payload themselves // to avoid double compression, we should disable the zipPayload if (!isFunction(csStream) || _sendHook) { _zipPayload = false; } _disableXhrSync = !!channelConfig.disableXhrSync; _disableFetchKeepAlive = !!channelConfig.disableFetchKeepAlive; _addNoResponse = channelConfig.addNoResponse !== false; _excludeCsMetaData = !!channelConfig.excludeCsMetaData; if (!!core.getPlugin("LocalStorage")) { // Always disable fetch keep alive when persisten storage is available _disableFetchKeepAlive = true; } _useBeacons = !isReactNative(); // Only use beacons if not running in React Native _serializer = new Serializer(_core, valueSanitizer, stringifyObjects, enableCompoundKey, getCommonSchemaMetaData, _excludeCsMetaData, channelConfig); if (!isNullOrUndefined(channelConfig.useSendBeacon)) { _useBeacons = !!channelConfig.useSendBeacon; } if (channelConfig.fetchCredentials){ _fetchCredentials= channelConfig.fetchCredentials; } let sendPostConfig = _getSendPostMgrConfig(); // only init it once if (!_sendPostMgr) { _sendPostMgr = new SenderPostManager(); _sendPostMgr.initialize(sendPostConfig, _logger); } else { _sendPostMgr.SetConfig(sendPostConfig); } let syncHttpInterface = httpInterface; let beaconHttpInterface: IXHROverride = channelConfig.alwaysUseXhrOverride ? httpInterface : null; let fetchSyncHttpInterface: IXHROverride = channelConfig.alwaysUseXhrOverride ? httpInterface : null; let beaconUnloadTransports: TransportType[] = [TransportType.Beacon, TransportType.Fetch]; if (!httpInterface) { _customHttpInterface = false; // this is handled in SendPostManager now // let location = getLocation(); // if (location && location.protocol && location.protocol.toLowerCase() === "file:") { // // Special case where a local html file fails with a CORS error on Chromium browsers // _sendCredentials = false; // } let theTransports: TransportType[] = []; if (isReactNative()) { // Use Fetch or XDR/XHR theTransports = [TransportType.Fetch, TransportType.Xhr]; beaconUnloadTransports = [TransportType.Fetch, TransportType.Xhr, TransportType.Beacon]; } else { // Use XDR/XHR, Fetch or beacons theTransports = [TransportType.Xhr, TransportType.Fetch, TransportType.Beacon]; } // Prefix any user requested transport(s) values theTransports = prependTransports(theTransports, channelConfig.transports); httpInterface = _getSenderInterface(theTransports, false); if (!httpInterface) { _warnToConsole(_logger, "No available transport to send events"); } syncHttpInterface = _getSenderInterface(theTransports, true); } if (!beaconHttpInterface) { // Allow overriding the usage of sendBeacon beaconUnloadTransports = prependTransports(beaconUnloadTransports, channelConfig.unloadTransports); beaconHttpInterface = _getSenderInterface(beaconUnloadTransports, true); } _canHaveReducedPayload = !_customHttpInterface && ((_useBeacons && isBeaconsSupported()) || (!_disableFetchKeepAlive && isFetchSupported(true))); _sendInterfaces = { [EventSendType.Batched]: httpInterface, [EventSendType.Synchronous]: syncHttpInterface || _getSenderInterface([TransportType.Xhr, TransportType.Fetch, TransportType.Beacon], true), [EventSendType.SendBeacon]: beaconHttpInterface || syncHttpInterface || _getSenderInterface([TransportType.Xhr], true), [EventSendType.SyncFetch]: fetchSyncHttpInterface || _getSenderInterface([TransportType.Fetch, TransportType.Beacon], true) || syncHttpInterface || _getSenderInterface([TransportType.Xhr], true) }; })); _isInitialized = true; } }; _self.addResponseHandler = (responseHandler: (responseText: string) => void): IUnloadHook => { _responseHandlers.push(responseHandler); return { rm: () => { let index = _responseHandlers.indexOf(responseHandler); if (index >= 0){ _responseHandlers.splice(index,1); } } } }; _self.serializeOfflineEvt = (evt) => { try { if (_serializer) { return _serializer.getEventBlob(evt); } } catch (e) { // eslint-disable-next-line no-empty } return STR_EMPTY; } _self.getOfflineRequestDetails = () => { try { // get current url without paramter let payload = _serializer && _serializer.createPayload(0, false, false, false, SendRequestReason.NormalSchedule, EventSendType.Batched); return _buildRequestDetails(payload, _useHeaders); } catch(e) { // eslint-disable-next-line no-empty } return null; } _self.createOneDSPayload = (evts: ITelemetryItem[], optimize?: boolean) => { try { // TODO: optimize let theBatches: EventBatch[] = []; // create a eventBatch for each event arrForEach(evts, (evt) => { if (optimize) { evt = optimizeObject(evt) } let batch = EventBatch.create(evt.iKey, [evt]); theBatches.push(batch); }) let thePayload: ISerializedPayload = null; while (theBatches.length > 0 && _serializer) { let theBatch = theBatches.shift(); if (theBatch && theBatch.count() > 0) { thePayload = thePayload || _serializer.createPayload(0, false, false, false, SendRequestReason.NormalSchedule, EventSendType.Batched); _serializer.appendPayload(thePayload, theBatch, _maxEvtPerBatch) } } let requestDetails = _buildRequestDetails(thePayload, _useHeaders); let payloadData: IPayloadData = { data: thePayload.payloadBlob, urlString: requestDetails.url, headers: requestDetails.hdrs, timeout: _xhrTimeout, disableXhrSync: _disableXhrSync, disableFetchKeepAlive: _disableFetchKeepAlive }; // Only automatically add the following headers if already sending headers and we are not attempting to avoid an options call if (_useHeaders) { if (!_hasHeader(payloadData.headers, STR_CACHE_CONTROL)) { payloadData.headers[STR_CACHE_CONTROL] = DEFAULT_CACHE_CONTROL; } if (!_hasHeader(payloadData.headers, STR_CONTENT_TYPE_HEADER)) { payloadData.headers[STR_CONTENT_TYPE_HEADER] = DEFAULT_CONTENT_TYPE; } } return payloadData; } catch (e) { // eslint-disable-next-line no-empty } return null; } // Special internal method to allow the DebugPlugin to hook embedded objects function _getSenderInterface(transports: TransportType[], syncSupport: boolean): _IInternalXhrOverride { try { return _sendPostMgr && _sendPostMgr.getSenderInst(transports, syncSupport); } catch (e) { // eslint-disable-next-line no-empty } return null; } _self["_getDbgPlgTargets"] = () => { return [_sendInterfaces[EventSendType.Batched], _killSwitch, _serializer, _sendInterfaces, _getSendPostMgrConfig(), _urlString, _maxEvtPerBatch]; }; function _getSendPostMgrConfig(): _ISendPostMgrConfig { try { let onCompleteFuncs = { xdrOnComplete: _xdrOncomplete, fetchOnComplete: _fetchOnComplete, xhrOnComplete: _xhrOnComplete, beaconOnRetry: _onBeaconRetry } as _ISenderOnComplete; let config = { enableSendPromise: false, isOneDs: true, disableCredentials: !_sendCredentials, fetchCredentials: _fetchCredentials, disableXhr: false, disableBeacon: !_useBeacons, disableBeaconSync: !_useBeacons, disableFetchKeepAlive: _disableFetchKeepAlive, timeWrapper: _timeoutWrapper, addNoResponse: _addNoResponse, senderOnCompleteCallBack: onCompleteFuncs } as _ISendPostMgrConfig; return config; } catch (e) { // eslint-disable-next-line no-empty } return null; } function _xdrOncomplete(xdr: IXDomainRequest, oncomplete: OnCompleteCallback, payload?: IPayloadData) { let response = getResponseText(xdr); _doOnComplete(oncomplete, 200, {}, response); _handleCollectorResponse(response); } function _initDefaults() { let undefValue: undefined; _urlString = null _killSwitch = createKillSwitch(); _paused = false; _clockSkewManager = createClockSkewManager(); _useBeacons = false; _outstandingRequests = 0; // Holds the number of outstanding async requests that have not returned a response yet _postManager = null _logger = null _sendInterfaces = null _core = null _customHttpInterface = true; _queryStringParameters = []; _headers = {}; _batchQueue = []; _serializer = null; _enableEventTimings = false; _cookieMgr = null; _isUnloading = false; _useHeaders = false; _xhrTimeout = undefValue; _disableXhrSync = undefValue; _disableFetchKeepAlive = undefValue; _canHaveReducedPayload = undefValue; _addNoResponse = undefValue; _unloadHooks = []; _sendHook = undefValue; _sendListener = undefValue; _responseHandlers = []; _isInitialized = false; _timeoutWrapper = createTimeoutWrapper(); _excludeCsMetaData = false; _sendPostMgr = null; _maxEvtPerBatch = null; } function _fetchOnComplete(response: Response, onComplete: OnCompleteCallback, resValue?: string, payload?: IPayloadData) { const handleResponse = (status: number, headerMap: { [x: string]: string; }, responseText: string) => { _doOnComplete(onComplete, status, headerMap, responseText); _handleCollectorResponse(responseText); }; let headerMap = {}; var headers = response.headers; if (headers) { headers["forEach"]((value: string, name: string) => { headerMap[name] = value; }); } handleResponse(response.status, headerMap, resValue || STR_EMPTY); } function _xhrOnComplete (request: XMLHttpRequest, oncomplete: OnCompleteCallback, payload?: IPayloadData) { let response = getResponseText(request); _doOnComplete(oncomplete, request.status, _getAllResponseHeaders(request, true), response); _handleCollectorResponse(response); } function _doOnComplete(oncomplete: OnCompleteCallback, status: number, headers: { [headerName: string]: string }, response?: string) { try { oncomplete(status, headers, response); } catch (e) { _throwInternal(_logger, eLoggingSeverity.WARNING, _eExtendedInternalMessageId.SendPostOnCompleteFailure, dumpObj(e)); } } function _onBeaconRetry(payload: IPayloadData, onComplete: OnCompleteCallback, canSend:(payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => boolean) { // Custom headers not supported in sendBeacon payload.headers would be ignored let internalPayloadData = payload as IInternalPayloadData; let status = 200; let thePayload = internalPayloadData._thePayload; let theUrl = payload.urlString + (_addNoResponse ? _noResponseQs : STR_EMPTY); try { let nav = getNavigator(); if (thePayload) { let persistStorage = !!_core.getPlugin("LocalStorage"); // Failed to send entire payload so try and split data and try to send as much events as possible let droppedBatches: EventBatch[] = []; let sentBatches: EventBatch[] = []; arrForEach(thePayload.batches, (theBatch) => { if (droppedBatches && theBatch && theBatch.count() > 0) { let theEvents = theBatch.events(); for (let lp = 0; lp < theEvents.length; lp++) { if (!nav.sendBeacon(theUrl, _serializer.getEventBlob(theEvents[lp]))) { // Can't send anymore, so split the batch and drop the rest droppedBatches.push(theBatch.split(lp)); break; } else { sentBatches.push(theBatch[lp]); } } } else { // Remove all of the events from the existing batch in the payload as the copy includes the original droppedBatches.push(theBatch.split(0)); } }); if (sentBatches.length > 0) { // Update the payload with the sent batches thePayload.sentEvts = sentBatches; } if (!persistStorage) { // Events passed Serializer size validation, log BeaconSendFailure // because it could still be size related but we did not exceed the // configured limit, and sendBeacon could fail for other reasons _sendBatchesNotification(droppedBatches, EventBatchNotificationReason.BeaconSendFailure, thePayload.sendType, true); } } else { status = 0; } } catch (ex) { _warnToConsole(_logger, "Failed to send telemetry using sendBeacon API. Ex:" + dumpObj(ex)); status = 0; } finally { _doOnComplete(onComplete, status, {}, STR_EMPTY); } } function _isBeaconPayload(sendType: EventSendType) { // Sync Fetch has the same payload limitation as sendBeacon -- 64kb limit, so treat both as a beacon send return sendType === EventSendType.SendBeacon || sendType === EventSendType.SyncFetch; } function _adjustSendType(sendType: EventSendType) { if (_isUnloading && _isBeaconPayload(sendType)) { sendType = EventSendType.SendBeacon; } return sendType; } _self.addHeader = (name: string, value: string) => { _headers[name] = value; }; _self.removeHeader = (name: string) => { delete _headers[name]; }; _self.canSendRequest = () => { return _hasIdleConnection() && _clockSkewManager.allowRequestSending(); }; _self.sendQueuedRequests = (sendType?: EventSendType, sendReason?: SendRequestReason) => { if (isUndefined(sendType)) { sendType = EventSendType.Batched; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = SendRequestReason.Unload; } if (_canSendPayload(_batchQueue, sendType, 0)) { _sendBatches(_clearQueue(), 0, false, sendType, sendReason || SendRequestReason.Undefined); } }; _self.isCompletelyIdle = (): boolean => { return !_paused && _outstandingRequests === 0 && _batchQueue.length === 0; }; _self.setUnloading = (value: boolean): void => { _isUnloading = value; }; _self.addBatch = (theBatch: EventBatch) => { if (theBatch && theBatch.count() > 0) { // Try and kill the event faster if (_killSwitch.isTenantKilled(theBatch.iKey())) { return false; } _batchQueue.push(theBatch); } return true; }; /** * Queue all the remaining requests to be sent. The requests will be * sent using HTML5 Beacons if they are available. */ _self.teardown = () => { if (_batchQueue.length > 0) { _sendBatches(_clearQueue(), 0, true, EventSendType.SendBeacon, SendRequestReason.Unload); } arrForEach(_unloadHooks, (hook) => { hook && hook.rm && hook.rm(); }); _unloadHooks = []; }; /** * Pause the sending of requests. No new requests will be sent. */ _self.pause = () => { _paused = true; }; /** * Resume the sending of requests. */ _self.resume = () => { _paused = false; _self.sendQueuedRequests(EventSendType.Batched, SendRequestReason.Resumed); }; /** * Sends a request synchronously to the Aria collector. This api is used to send * a request containing a single immediate event. * * @param batch - The request to be sent. * @param sendReason - The token used to send the request. */ _self.sendSynchronousBatch = (batch: EventBatch, sendType?: EventSendType, sendReason?: SendRequestReason) => { // This will not take into account the max connections restriction. Since this is sync, we can // only send one of this request at a time and thus should not worry about multiple connections // being used to send synchronous events. // Increment active connection since we are still going to use a connection to send the request. if (batch && batch.count() > 0) { if (isNullOrUndefined(sendType)) { sendType = EventSendType.Synchronous; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = SendRequestReason.Unload; } // For sync requests we will not wait for the clock skew. _sendBatches([batch], 0, false, sendType, sendReason || SendRequestReason.Undefined); } }; function _hasIdleConnection(): boolean { return !_paused && _outstandingRequests < maxConnections; } function _clearQueue() { let theQueue = _batchQueue; _batchQueue = []; return theQueue; } function _canSendPayload(theBatches: EventBatch[], sendType: EventSendType, retryCnt: number) { let result = false; if (theBatches && theBatches.length > 0 && !_paused && _sendInterfaces[sendType] && _serializer) { // Always attempt to send synchronous events don't wait for idle or clockSkew // and don't block retry requests if clockSkew is not yet set result = (sendType !== EventSendType.Batched) || (_hasIdleConnection() && (retryCnt > 0 || _clockSkewManager.allowRequestSending())); } return result; } function _createDebugBatches(theBatches: EventBatch[]) { let values = {}; if (theBatches) { arrForEach(theBatches, (theBatch, idx) => { values[idx] = { iKey: theBatch.iKey(), evts: theBatch.events() }; }); } return values; } function _sendBatches(theBatches: EventBatch[], retryCount: number, isTeardown: boolean, sendType: EventSendType, sendReason: SendRequestReason) { if (!theBatches || theBatches.length === 0) { // Nothing to do return; } if (_paused) { _sendBatchesNotification(theBatches, EventBatchNotificationReason.Paused, sendType); return; } // Make sure that if we are unloading the sendType is a supported version sendType = _adjustSendType(sendType); try { let orgBatches = theBatches; let isSynchronous = sendType !== EventSendType.Batched; doPerf(_core, () => "HttpManager:_sendBatches", (perfEvt?: IPerfEvent) => { if (perfEvt) { // Perf Monitoring is enabled, so create a "Quick" copy of the original batches so we still report // the original values as part of the perfEvent. This is because theBatches uses .shift() to remove each // batch as they are processed - removing from the original array, so by the time the _createDebugBatches() // function is called the passed in value has changed and therefore the reported value for the perfEvent is incorrect theBatches = theBatches.slice(0); } let droppedBatches: EventBatch[] = []; let thePayload: ISerializedPayload = null; let serializationStart = getTime(); let sendInterface = _sendInterfaces[sendType] || (isSynchronous ? _sendInterfaces[EventSendType.Synchronous] : _sendInterfaces[EventSendType.Batched]); let sendTransport = sendInterface && sendInterface._transport; // Sync Fetch has the same payload limitation as sendBeacon -- 64kb limit let isReducedPayload = _canHaveReducedPayload && (_isUnloading || _isBeaconPayload(sendType) || (sendTransport === TransportType.Beacon || (sendInterface._isSync && sendTransport === TransportType.Fetch))); while (_canSendPayload(theBatches, sendType, retryCount)) { let theBatch = theBatches.shift(); if (theBatch && theBatch.count() > 0) { if (!_killSwitch.isTenantKilled(theBatch.iKey())) { // Make sure we have a payload object thePayload = thePayload || _serializer.createPayload(retryCount, isTeardown, isSynchronous, isReducedPayload, sendReason, sendType); // Add the batch to the current payload if (!_serializer.appendPayload(thePayload, theBatch, _maxEvtPerBatch)) { // Entire batch was not added so send the payload and retry adding this batch _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); serializationStart = getTime(); theBatches = [theBatch].concat(theBatches); thePayload = null; } else if (thePayload.overflow !== null) { // Total Payload size was exceeded so send the payload and add the unsent as the next batch to send theBatches = [thePayload.overflow].concat(theBatches); thePayload.overflow = null; _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); serializationStart = getTime(); thePayload = null; } } else { droppedBatches.push(theBatch); } } } // Make sure to flush any remaining payload if (thePayload) { _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); } if (theBatches.length > 0) { // Add any unsent batches back to the head of the queue _batchQueue = theBatches.concat(_batchQueue); } // Now send notification about any dropped events _sendBatchesNotification(droppedBatches, EventBatchNotificationReason.KillSwitch, sendType); }, () => ({ batches: _createDebugBatches(orgBatches), retryCount, isTeardown, isSynchronous, sendReason, useSendBeacon: _isBeaconPayload(sendType), sendType }), !isSynchronous); } catch (ex) { _throwInternal(_logger, eLoggingSeverity.WARNING, _eInternalMessageId.CannotSerializeObject, "Unexpected Exception sending batch: " + dumpObj(ex)); } } function _buildRequestDetails(thePayload: ISerializedPayload, useHeaders: boolean): IRequestUrlDetails { let requestDetails: IRequestUrlDetails = { url: _urlString, hdrs: {}, useHdrs: false // Assume no headers }; if (!useHeaders) { // Attempt to map headers to a query string if possible objForEachKey(_headers, (name, value) => { if (_collectorHeaderToQs[name]) { _addRequestDetails(requestDetails, _collectorHeaderToQs[name], value, false); } else { // No mapping, so just include in the headers anyway (may not get sent if using sendBeacon()) requestDetails.hdrs[name] = value; requestDetails.useHdrs = true; } }); } else { // Copy the pre-defined headers into the payload headers requestDetails.hdrs = extend(requestDetails.hdrs, _headers); requestDetails.useHdrs = (objKeys(requestDetails.hdrs).length > 0); } _addRequestDetails(requestDetails, STR_CLIENT_ID, "NO_AUTH", useHeaders); _addRequestDetails(requestDetails, STR_CLIENT_VERSION, FullVersionString, useHeaders); let apiQsKeys = STR_EMPTY; arrForEach(thePayload.apiKeys, (apiKey) => { if (apiQsKeys.length > 0) { apiQsKeys += ","; } apiQsKeys += apiKey; }); _addRequestDetails(requestDetails, STR_API_KEY, apiQsKeys, useHeaders); _addRequestDetails(requestDetails, STR_UPLOAD_TIME, dateNow().toString(), useHeaders); let msfpc = _getMsfpc(thePayload); if (isValueAssigned(msfpc)) { requestDetails.url += "&ext.intweb.msfpc=" + msfpc; } if (_clockSkewManager.shouldAddClockSkewHeaders()) { _addRequestDetails(requestDetails, STR_TIME_DELTA_TO_APPLY, _clockSkewManager.getClockSkewHeaderValue(), useHeaders); } if (_core.getWParam) { let wParam = _core.getWParam(); if (wParam >= 0) { requestDetails.url += "&w=" + wParam; } } for (let i = 0; i < _queryStringParameters.length; i++) { requestDetails.url += "&" + _queryStringParameters[i].name + "=" + _queryStringParameters[i].value; } return requestDetails; } function _setTimingValue(timings: any, name: string, value: number) { timings[name] = timings[name] || {}; timings[name][_postManager.identifier] = value; } function _doPayloadSend(thePayload: ISerializedPayload, serializationStart: number, serializationCompleted: number, sendReason: SendRequestReason) { if (thePayload && thePayload.payloadBlob && thePayload.payloadBlob.length > 0) { let useSendHook = !!_sendHook; let sendInterface = _sendInterfaces[thePayload.sendType]; // Send all data using a beacon style transport if closing mode is on or channel was teared down if (!_isBeaconPayload(thePayload.sendType) && thePayload.isBeacon && thePayload.sendReason === SendRequestReason.Unload) { sendInterface = _sendInterfaces[EventSendType.SendBeacon] || _sendInterfaces[EventSendType.SyncFetch] || sendInterface; } let useHeaders = _useHeaders; // Disable header usage if we know we are using sendBeacon as additional headers are not supported if (thePayload.isBeacon || sendInterface._transport === TransportType.Beacon) { useHeaders = false; } let requestDetails = _buildRequestDetails(thePayload, useHeaders); useHeaders = useHeaders || requestDetails.useHdrs; let sendEventStart = getTime(); doPerf(_core, () => "HttpManager:_doPayloadSend", () => { // Increment the send attempt count and add timings after packaging (So it's not serialized in the 1st attempt) for (let batchLp = 0; batchLp < thePayload.batches.length; batchLp++) { let theBatch = thePayload.batches[batchLp]; let theEvents: IPostTransmissionTelemetryItem[] = theBatch.events(); for (let evtLp = 0; evtLp < theEvents.length; evtLp++) { let telemetryItem: IPostTransmissionTelemetryItem = theEvents[evtLp]; if (_enableEventTimings) { let timings = telemetryItem.timings = telemetryItem.timings || {}; _setTimingValue(timings, "sendEventStart", sendEventStart); _setTimingValue(timings, "serializationStart", serializationStart); _setTimingValue(timings, "serializationCompleted", serializationCompleted); } telemetryItem[strSendAttempt] > 0 ? telemetryItem[strSendAttempt]++ : telemetryItem[strSendAttempt] = 1; } } // Note: always sending this notification in a synchronous manner. _sendBatchesNotification( thePayload.batches, (EventBatchNotificationReason.SendingUndefined + (sendReason || SendRequestReason.Undefined)), thePayload.sendType, true); // Disabling the use of const because of Issue: // - Task 9227844: [1DS] Some environments and packagers automatically "freeze" objects which are defined as const which causes any mutations to throw // eslint-disable-next-line prefer-const let orgPayloadData: IInternalPayloadData = { data: thePayload.payloadBlob, urlString: requestDetails.url, headers: requestDetails.hdrs, _thePayload: thePayload, _sendReason: sendReason, timeout: _xhrTimeout, disableXhrSync: _disableXhrSync, disableFetchKeepAlive: _disableFetchKeepAlive }; // Only automatically add the following headers if already sending headers and we are not attempting to avoid an options call if (useHeaders) { if (!_hasHeader(orgPayloadData.headers, STR_CACHE_CONTROL)) { orgPayloadData.headers[STR_CACHE_CONTROL] = DEFAULT_CACHE_CONTROL; } if (!_hasHeader(orgPayloadData.headers, STR_CONTENT_TYPE_HEADER)) { orgPayloadData.headers[STR_CONTENT_TYPE_HEADER] = DEFAULT_CONTENT_TYPE; } } let sender: (payload: IPayloadData) => void = null; if (sendInterface) { // Send sync requests if the request is immediate or we are tearing down telemetry. sender = (payload: IPayloadData) => { // Notify the clock skew manager that we are sending the first request (Potentially blocking all further requests) _clockSkewManager.firstRequestSent(); let onComplete = (status, headers) => { _retryRequestIfNeeded(status, headers, thePayload, sendReason); }; let isSync = thePayload.isTeardown || thePayload.isSync; _sendPostMgr.preparePayload((processedPayload: IPayloadData) => { try { sendInterface.sendPOST(processedPayload, onComplete, isSync); if (_sendListener) { // Send the original payload to the listener _sendListener(orgPayloadData, processedPayload, isSync, thePayload.isBeacon); } } catch (ex) { _doOnComplete(onComplete, 0, {}); _warnToConsole(_logger, "Unexpected exception sending payload. Ex:" + dumpObj(ex)); } }, _zipPayload, payload, isSync); }; } doPerf(_core, () => "HttpManager:_doPayloadSend.sender", () => { if (sender) { if (thePayload.sendType === EventSendType.Batched) { _outstandingRequests ++; } // Only call the hook if it's defined and we are not using sendBeacon as additional headers are not supported if (useSendHook && !thePayload.isBeacon && sendInterface._transport !== TransportType.Beacon) { // Create a new IPayloadData that is sent into the hook method, so that the hook method // can't change the object references to the orgPayloadData (it can still change the content -- mainly the headers) // Disabling the use of const because of Issue: // - Task 9227844: [1DS] Some environments and packagers automatically "freeze" objects which are defined as const which causes any mutations to throw // eslint-disable-next-line prefer-const let hookData: IPayloadData = { data: orgPayloadData.data, urlString: orgPayloadData.urlString, headers: extend({}, orgPayloadData.headers), timeout: orgPayloadData.timeout, disableXhrSync: orgPayloadData.disableXhrSync, disableFetchKeepAlive: orgPayloadData.disableFetchKeepAlive }; let senderCalled = false; doPerf(_core, () => "HttpManager:_doPayloadSend.sendHook", () => { try { _sendHook( hookData, (payload: IInternalPayloadData) => { senderCalled = true; // Add back the internal properties if (!_customHttpInterface && !payload._thePayload) { payload._thePayload = payload._thePayload || orgPayloadData._thePayload; payload._sendReason = payload._sendReason || orgPayloadData._sendReason; } sender(payload); }, thePayload.isSync || thePayload.isTeardown); } catch (ex) { if (!senderCalled) { // The hook never called the sender -- assume that it never will sender(orgPayloadData); } } }); } else { sender(orgPayloadData); } } }); }, () => ({ thePayload, serializationStart, serializationCompleted, sendReason }), thePayload.isSync); } if (thePayload.sizeExceed && thePayload.sizeExceed.length > 0) { // Ensure that we send any discard events for oversize events even when there was no payload to send _sendBatchesNotification(thePayload.sizeExceed, EventBatchNotificationReason.SizeLimitExceeded, thePayload.sendType); } if (thePayload.failedEvts && thePayload.failedEvts.length > 0) { // Ensure that we send any discard events for events that could not be serialized even when there was no payload to send _sendBatchesNotification(thePayload.failedEvts, EventBatchNotificationReason.InvalidEvent, thePayload.sendType); } } function _addEventCompletedTimings(theEvents: IPostTransmissionTelemetryItem[], sendEventCompleted: number) { if (_enableEventTimings) { arrForEach(theEvents, (theEvent) => { let timings = theEvent.timings = theEvent.timings || {}; _setTimingValue(timings, "sendEventCompleted", sendEventCompleted); }); } } function _retryRequestIfNeeded(status: number, headers: { [headerName: string]: string }, thePayload: ISerializedPayload, sendReason: SendRequestReason) { let reason: EventBatchNotificationReason = EventBatchNotificationReason.ResponseFailure; let droppedBatches: EventBatch[] = null; let isRetrying = false; let backOffTrans = false; try { let shouldRetry = true; if (typeof status !== strUndefined) { if (headers) { _clockSkewManager.setClockSkew(headers[STR_TIME_DELTA_HEADER]); let killDuration = headers[STR_KILL_DURATION_HEADER] || headers["kill-duration-seconds"]; arrForEach(_killSwitch.setKillSwitchTenants(headers[STR_KILL_TOKENS_HEADER], killDuration), (killToken) => { arrForEach(thePayload.batches, (theBatch) => { if (theBatch.iKey() === killToken) { // Make sure we have initialized the array droppedBatches = droppedBatches || []; // Create a copy of the batch with all of the events (and more importantly the action functions) let removedEvents = theBatch.split(0); // And then remove the events for the payload batch and reduce the actual number of processed thePayload.numEvents -= removedEvents.count(); droppedBatches.push(removedEvents); } }); }); } // Disabling triple-equals rule to avoid httpOverrides from failing because they are returning a string value // tslint:disable-next-line:triple-equals if (status == 200 || status == 204) { // Response was successfully sent reason = EventBatchNotificationReason.Complete; return; } if (!retryPolicyShouldRetryForStatus(status) || thePayload.numEvents <= 0) { // Only retry for specific response codes and if there is still events after kill switch processing shouldRetry = false; } // Derive the notification response from the HttpStatus Code reason = EventBatchNotificationReason.ResponseFailure + (status % 1000); } if (shouldRetry) { // The events should be retried -- so change notification to requeue them reason = EventBatchNotificationReason.RequeueEvents; let retryCount = thePayload.retryCnt; if (thePayload.sendType === EventSendType.Batched) { // attempt to resend the entire batch if (retryCount < maxRequestRetriesBeforeBackoff) { isRetrying = true; _doAction(() => { // try to resend the same batches if (thePayload.sendType === EventSendType.Batched) { // Reduce the outstanding request count (if this was an async request) as we didn't reduce the count // previously and we are about to reschedule our retry attempt and we want an attempt to send // to occur, it's also required to ensure that a follow up handleRequestFinished() call occurs _outstandingRequests--; } _sendBatches(thePayload.batches, retryCount + 1, thePayload.isTeardown, _isUnloading ? EventSendType.SendBeacon : thePayload.sendType, SendRequestReason.Retry); }, _isUnloading, retryPolicyGetMillisToBackoffForRetry(retryCount)); } else { backOffTrans = true; if (_isUnloading) { // we are unloading so don't try and requeue the events otherwise let the events get requeued and resent during the backoff sending // This will also cause the events to be purged based on the priority (if necessary) reason = EventBatchNotificationReason.NonRetryableStatus; } } } } } finally { if (!isRetrying) { // Make sure the clockSkewManager doesn't blocking further sending of requests once we have a proper response // This won't override any previously sent clock Skew value _clockSkewManager.setClockSkew(); _handleRequestFinished(thePayload, reason, sendReason, backOffTrans); } _sendBatchesNotification(droppedBatches, EventBatchNotificationReason.KillSwitch, thePayload.sendType); } } function _handleRequestFinished( thePayload: ISerializedPayload, batchReason: EventBatchNotificationReason, sendReason: SendRequestReason, backOffTrans: boolean) { try { if (backOffTrans) { // Slow down the transmission requests _postManager._backOffTransmission(); } let theBatches = thePayload.batches; if (batchReason === EventBatchNotificationReason.Complete) { theBatches = thePayload.sentEvts || thePayload.batches; if (!backOffTrans && !thePayload.isSync) { // We have a successful async response, so the lets open the floodgates // The reason for checking isSync is to avoid unblocking if beacon send occurred as it // doesn't wait for a response. _postManager._clearBackOff(); } _addCompleteTimings(theBatches); } // Send the notifications synchronously _sendBatchesNotification(theBatches, batchReason, thePayload.sendType, true); } finally { if (thePayload.sendType === EventSendType.Batched) { // we always need to decrement this value otherwise the httpmanager locks up and won't send any more events _outstandingRequests--; // Don't try to send additional queued events if this is a retry operation as the retried // response will eventually call _handleRequestFinished for the retried event if (sendReason !== SendRequestReason.Retry) { // Try and send any other queued batched events _self.sendQueuedRequests(thePayload.sendType, sendReason); } } } } function _addCompleteTimings(theBatches: EventBatch[]) { if (_enableEventTimings) { let sendEventCompleted = getTime(); arrForEach(theBatches, (theBatch) => { if (theBatch && theBatch.count() > 0) { _addEventCompletedTimings(theBatch.events(), sendEventCompleted); } }); } } function _doAction(cb: VoidFunction, isSync: boolean, interval: number) { if (isSync) { cb(); } else { _timeoutWrapper.set(cb, interval); } } function _getMsfpc(thePayload: ISerializedPayload): string { for (let lp = 0; lp < thePayload.batches.length; lp++) { let msfpc = thePayload.batches[lp].Msfpc(); if (msfpc) { return encodeURIComponent(msfpc); } } return STR_EMPTY; } function _handleCollectorResponse(responseText: string): void { let responseHandlers = _responseHandlers; try { for (let i = 0; i < responseHandlers.length; i++) { try { responseHandlers[i](responseText); } catch (e) { _throwInternal(_logger, eLoggingSeverity.CRITICAL, _eExtendedInternalMessageId.PostResponseHandler, "Response handler failed: " + e); } } if (responseText) { let response = JSON.parse(responseText) as ICollectorResult; if (isValueAssigned(response.webResult) && isValueAssigned(response.webResult[STR_MSFPC])) { // Set cookie _cookieMgr.set("MSFPC", response.webResult[STR_MSFPC], 365 * 86400); } } } catch (ex) { // Doing nothing } } function _sendBatchesNotification(theBatches: EventBatch[], batchReason: EventBatchNotificationReason, sendType: EventSendType, sendSync?: boolean) { if (theBatches && theBatches.length > 0 && actions) { let theAction: BatchNotificationAction = actions[_getNotificationAction(batchReason)]; if (theAction) { let isSyncRequest = sendType !== EventSendType.Batched; doPerf(_core, () => "HttpManager:_sendBatchesNotification", () => { _doAction(() => { try { theAction.call(actions, theBatches, batchReason, isSyncRequest, sendType); } catch (e) { _throwInternal(_logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.NotificationException, "send request notification failed: " + e); } }, sendSync || isSyncRequest, 0); }, () => ({ batches: _createDebugBatches(theBatches), reason: batchReason, isSync: isSyncRequest, sendSync: sendSync, sendType: sendType }), !isSyncRequest); } } } function _getNotificationAction(reason: EventBatchNotificationReason): string { let action = _eventActionMap[reason]; if (!isValueAssigned(action)) { action = STR_OTHER; if (reason >= EventBatchNotificationReason.ResponseFailure && reason <= EventBatchNotificationReason.ResponseFailureMax) { action = STR_RESPONSE_FAIL; } else if (reason >= EventBatchNotificationReason.EventsDropped && reason <= EventBatchNotificationReason.EventsDroppedMax) { action = STR_DROPPED; } else if (reason >= EventBatchNotificationReason.SendingUndefined && reason <= EventBatchNotificationReason.SendingEventMax) { action = STR_SENDING; } } return action; } }); } /** * @constructor * @param requestQueue - The queue that contains the requests to be sent. * @param postManager - The post manager that we should add requests back to if needed. */ public initialize(coreConfig: IExtendedConfiguration, core: IAppInsightsCore, postChannel: IPostChannel) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Add header to request * @param name - Header name. * @param value - Header value. */ public addHeader(name: string, value: string) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Remove header to request * @param name - Header name. * @param value - Header value. */ public removeHeader(name: string) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Add handler to be executed with request response text. */ public addResponseHandler(responseHandler: (responseText: string) => void) : IUnloadHook { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } /** * Add the batch of events to the queue for sending * @param batch - The batch with the events to send * @returns True if the http manager has accepted the batch (including if the batch is empty) otherwise false */ public addBatch(batch: EventBatch): boolean { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return false; } /** * Check if there is an idle connection and we can send a request. * @returns True if there is an idle connection, false otherwise. */ public canSendRequest(): boolean { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return false; } /** * Send requests in the request queue up if there is an idle connection, sending is * not pause and clock skew manager allows sending request. * @param sendType - Identifies how the batched events should be send, defaults to Batched * @param sendReason - The reason the batch is being sent */ public sendQueuedRequests(sendType?: EventSendType, sendReason?: SendRequestReason) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Check if there are no active requests being sent. * @returns True if idle, false otherwise. */ public isCompletelyIdle(): boolean { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return false; } /** * Inform the HttpManager that a page unload event was received */ public setUnloading(value: boolean): void { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Queue all the remaining requests to be sent. The requests will be * sent using HTML5 Beacons if they are available. */ public teardown() { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Pause the sending of requests. No new requests will be sent. */ public pause() { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Resume the sending of requests. */ public resume() { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Sends the batches synchronously to the collector. This api is used to send a batches immediate event. * * @param batch - The batch of events to be sent. * @param sendReason - The reason the batch is being sent * @param sendType - Identifies the sending type to use when sending the batch */ public sendSynchronousBatch(batch: EventBatch, sendType?: EventSendType, sendReason?: SendRequestReason) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Get Offline Serializer support * @returns internal Offline Serializer object */ public serializeOfflineEvt(evt: ITelemetryItem | IPostTransmissionTelemetryItem): string { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } /** * Get Offline request details * @returnsrequest details */ public getOfflineRequestDetails(): IRequestUrlDetails { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } /** * Create payload data * @param evts - telemetry events * @returns payload */ public createOneDSPayload(evts?: ITelemetryItem[], optimize?: boolean): IPayloadData { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } } ================================================ FILE: channels/1ds-post-js/src/Index.ts ================================================ /** * @name Index.ts * @author Abhilash Panwar (abpanwar) * @copyright Microsoft 2018 * File to export public classes. */ import { IPayloadData, IXHROverride, OnCompleteCallback, SendPOSTFunction } from "@microsoft/applicationinsights-core-js"; import { BE_PROFILE, IChannelConfiguration, IPostChannel, IRequestSizeLimit, NRT_PROFILE, PayloadListenerFunction, PayloadPreprocessorFunction, RT_PROFILE } from "./DataModels"; import { PostChannel } from "./PostChannel"; export { PostChannel, IChannelConfiguration, IRequestSizeLimit, BE_PROFILE, NRT_PROFILE, RT_PROFILE, IXHROverride, IPostChannel, SendPOSTFunction, IPayloadData, PayloadPreprocessorFunction, PayloadListenerFunction, OnCompleteCallback }; ================================================ FILE: channels/1ds-post-js/src/InternalConstants.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!! // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // Generally you should only put values that are used more than 2 times and then only if not already exposed as a constant (such as SdkCoreNames) // as when using "short" named values from here they will be will be minified smaller than the SdkCoreNames[eSdkCoreNames.xxxx] value. export const STR_EMPTY = ""; export const STR_POST_METHOD = "POST"; export const STR_DISABLED_PROPERTY_NAME: string = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; export const STR_DROPPED = "drop"; export const STR_SENDING = "send"; export const STR_REQUEUE = "requeue"; export const STR_RESPONSE_FAIL = "rspFail"; export const STR_OTHER = "oth"; export const DEFAULT_CACHE_CONTROL = "no-cache, no-store"; export const DEFAULT_CONTENT_TYPE = "application/x-json-stream"; export const STR_CACHE_CONTROL = "cache-control"; export const STR_CONTENT_TYPE_HEADER = "content-type"; export const STR_KILL_TOKENS_HEADER = "kill-tokens"; export const STR_KILL_DURATION_HEADER = "kill-duration"; export const STR_KILL_DURATION_SECONDS_HEADER = "kill-duration-seconds"; export const STR_TIME_DELTA_HEADER = "time-delta-millis"; export const STR_CLIENT_VERSION = "client-version"; export const STR_CLIENT_ID = "client-id"; export const STR_TIME_DELTA_TO_APPLY = "time-delta-to-apply-millis"; export const STR_UPLOAD_TIME = "upload-time"; export const STR_API_KEY = "apikey"; export const STR_MSA_DEVICE_TICKET = "AuthMsaDeviceTicket"; export const STR_AUTH_WEB_TOKEN = "WebAuthToken"; export const STR_AUTH_XTOKEN = "AuthXToken"; export const STR_SDK_VERSION = "sdk-version"; export const STR_NO_RESPONSE_BODY = "NoResponseBody"; export const STR_MSFPC = "msfpc"; export const STR_TRACE = "trace"; export const STR_USER = "user"; ================================================ FILE: channels/1ds-post-js/src/KillSwitch.ts ================================================ /** * KillSwitch.ts * @author Abhilash Panwar (abpanwar) * @copyright Microsoft 2018 */ import { arrForEach, dateNow, strTrim } from "@microsoft/applicationinsights-core-js"; const SecToMsMultiplier = 1000; /** * Internal interface to stop certain tenants sending events. * @internal */ export interface IKillSwitch { /** * Set the tenants that are to be killed along with the duration. If the duration is * a special value identifying that the tokens are too be killed for only this request, then * a array of tokens is returned. * @param killTokens - Tokens that are too be marked to be killed. * @param killDuration - The duration for which the tokens are to be killed. * @returns The tokens that are killed only for this given request. */ setKillSwitchTenants(killTokens: string, killDuration: string): string[]; /** * Determing if the given tenant token has been killed for the moment. * @param tenantToken - The token to be checked. * @returns True if token has been killed, false otherwise. */ isTenantKilled(tenantToken: string): boolean; } function _normalizeTenants(values: string[]) { let result: string[] = []; if (values) { arrForEach(values, (value) => { result.push(strTrim(value)); }); } return result; } /** * Factory function to create a KillSwitch instance. * @returns A new IKillSwitch instance. * @internal */ export function createKillSwitch(): IKillSwitch { let _killedTokenDictionary: { [token: string]: number } = {}; return { setKillSwitchTenants: (killTokens: string, killDuration: string): string[] => { if (killTokens && killDuration) { try { let killedTokens: string[] = _normalizeTenants(killTokens.split(",")); if (killDuration === "this-request-only") { return killedTokens; } const durationMs = parseInt(killDuration, 10) * SecToMsMultiplier; for (let i = 0; i < killedTokens.length; ++i) { _killedTokenDictionary[killedTokens[i]] = dateNow() + durationMs; } } catch (ex) { return []; } } return []; }, isTenantKilled: (tenantToken: string): boolean => { let killDictionary = _killedTokenDictionary; let name = strTrim(tenantToken); if (killDictionary[name] !== undefined && killDictionary[name] > dateNow()) { return true; } delete killDictionary[name]; return false; } }; } ================================================ FILE: channels/1ds-post-js/src/PostChannel.ts ================================================ /** * PostManager.ts * @author Abhilash Panwar (abpanwar); Hector Hernandez (hectorh); Nev Wylie (newylie) * @copyright Microsoft 2018-2020 */ import dynamicProto from "@microsoft/dynamicproto-js"; import { BaseTelemetryPlugin, EventLatencyValue, EventSendType, EventsDiscardedReason, IAppInsightsCore, IChannelControls, IConfigDefaults, IExtendedConfiguration, IInternalOfflineSupport, IPlugin, IProcessTelemetryContext, IProcessTelemetryUnloadContext, ITelemetryItem, ITelemetryUnloadState, IUnloadHook, NotificationManager, SendRequestReason, _eInternalMessageId, _throwInternal, addPageHideEventListener, addPageShowEventListener, addPageUnloadEventListener, arrForEach, createProcessTelemetryContext, createUniqueNamespace, doPerf, eLoggingSeverity, getWindow, isChromium, isGreaterThanZero, isNumber, mergeEvtNamespace, objForEachKey, onConfigChange, optimizeObject, proxyFunctions, removePageHideEventListener, removePageShowEventListener, removePageUnloadEventListener, setProcessTelemetryTimings } from "@microsoft/applicationinsights-core-js"; import { IPromise, createPromise } from "@nevware21/ts-async"; import { ITimerHandler, isPromiseLike, mathCeil, mathMax, mathMin, objDeepFreeze } from "@nevware21/ts-utils"; import { BE_PROFILE, EventBatchNotificationReason, IChannelConfiguration, IPostChannel, IPostTransmissionTelemetryItem, IRequestSizeLimit, NRT_PROFILE, RT_PROFILE } from "./DataModels"; import { EventBatch } from "./EventBatch"; import { HttpManager } from "./HttpManager"; import { STR_AUTH_WEB_TOKEN, STR_MSA_DEVICE_TICKET, STR_TRACE, STR_USER } from "./InternalConstants"; import { retryPolicyGetMillisToBackoffForRetry } from "./RetryPolicy"; import { ITimeoutOverrideWrapper, createTimeoutWrapper } from "./TimeoutOverrideWrapper"; const FlushCheckTimer = 0.250; // This needs to be in seconds, so this is 250ms const MaxNumberEventPerBatch = 500; const EventsDroppedAtOneTime = 20; const MaxSendAttempts = 6; const MaxSyncUnloadSendAttempts = 2; // Assuming 2 based on beforeunload and unload const MaxBackoffCount = 4; const MaxConnections = 2; const MaxRequestRetriesBeforeBackoff = 1; const MaxEventsLimitInMem = 10000; const strEventsDiscarded = "eventsDiscarded"; const EMPTY_STR = ""; let undefValue = undefined; interface IPostChannelBatchQueue { /** * This is the actual queue of event batches */ batches: EventBatch[]; /** * This is just a lookup map using the iKey to link to the batch in the batches queue */ iKeyMap: { [iKey: string]: EventBatch }; } /** * The default settings for the config. * WE MUST include all defaults here to ensure that the config is created with all of the properties * defined as dynamic. */ const defaultPostChannelConfig: IConfigDefaults = objDeepFreeze({ eventsLimitInMem: { isVal: isGreaterThanZero, v: MaxEventsLimitInMem }, immediateEventLimit: { isVal: isGreaterThanZero, v: 500 }, autoFlushEventsLimit: { isVal: isGreaterThanZero, v: 0 }, disableAutoBatchFlushLimit: false, httpXHROverride: { isVal: isOverrideFn, v: undefValue }, overrideInstrumentationKey: undefValue, overrideEndpointUrl: undefValue, disableTelemetry: false, ignoreMc1Ms0CookieProcessing: false, setTimeoutOverride: undefValue, clearTimeoutOverride: undefValue, payloadPreprocessor: undefValue, payloadListener: undefValue, disableEventTimings: undefValue, valueSanitizer: undefValue, stringifyObjects: undefValue, enableCompoundKey: undefValue, disableOptimizeObj: false, fetchCredentials: undefValue, // disableCacheHeader: undefValue, // See Task #7178858 - Collector requires a change to support this transports: undefValue, unloadTransports: undefValue, useSendBeacon: undefValue, disableFetchKeepAlive: undefValue, avoidOptions: false, xhrTimeout: undefValue, disableXhrSync: undefValue, alwaysUseXhrOverride: false, maxEventRetryAttempts: { isVal: isNumber, v: MaxSendAttempts }, maxUnloadEventRetryAttempts: { isVal: isNumber, v: MaxSyncUnloadSendAttempts}, addNoResponse: undefValue, maxEvtPerBatch: {isVal: isNumber, v: MaxNumberEventPerBatch}, excludeCsMetaData: undefValue, requestLimit: {} as IRequestSizeLimit }); function isOverrideFn(httpXHROverride: any) { return httpXHROverride && httpXHROverride.sendPOST; } /** * Class that manages adding events to inbound queues and batching of events * into requests. * @group Classes * @group Entrypoint */ export class PostChannel extends BaseTelemetryPlugin implements IChannelControls, IPostChannel { public identifier = "PostChannel"; public priority = 1011; public version = "#version#"; constructor() { super(); let _postConfig: IChannelConfiguration; let _isTeardownCalled = false; let _flushCallbackQueue: Array<() => void> = []; let _flushCallbackTimer: ITimerHandler; let _paused = false; let _immediateQueueSize = 0; let _immediateQueueSizeLimit: number; let _queueSize = 0; let _queueSizeLimit: number; let _profiles: { [profileName: string]: number[] } = {}; let _currentProfile = RT_PROFILE; let _scheduledTimer: ITimerHandler; let _immediateTimer: ITimerHandler; let _currentBackoffCount; let _timerCount; let _httpManager: HttpManager; let _batchQueues: { [eventLatency: number]: IPostChannelBatchQueue }; let _autoFlushEventsLimit: number | undefined; // either MaxBatchSize * (1+ Max Connections) or _queueLimit / 6 (where 3 latency Queues [normal, realtime, cost deferred] * 2 [allow half full -- allow for retry]) let _autoFlushBatchLimit: number; let _delayedBatchSendLatency: number; let _delayedBatchReason: SendRequestReason; let _optimizeObject: boolean; let _isPageUnloadTriggered: boolean; let _maxEventSendAttempts: number; let _maxUnloadEventSendAttempts: number; let _evtNamespace: string | string[]; let _timeoutWrapper: ITimeoutOverrideWrapper; let _ignoreMc1Ms0CookieProcessing: boolean; let _disableAutoBatchFlushLimit: boolean; let _notificationManager: NotificationManager | undefined; let _unloadHandlersAdded: boolean; let _overrideInstrumentationKey: string; let _disableTelemetry: boolean; let _maxEvtPerBatch: number; dynamicProto(PostChannel, this, (_self, _base) => { _initDefaults(); // Special internal method to allow the DebugPlugin to hook embedded objects _self["_getDbgPlgTargets"] = () => { return [_httpManager, _postConfig]; }; _self.initialize = (theConfig: IExtendedConfiguration, core: IAppInsightsCore, extensions: IPlugin[]) => { doPerf(core, () => "PostChannel:initialize", () => { _base.initialize(theConfig, core, extensions); _notificationManager = core.getNotifyMgr(); try { _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace()); _self._addHook(onConfigChange(theConfig, (details) => { let coreConfig = details.cfg; let ctx = createProcessTelemetryContext(null, coreConfig, core); _postConfig = ctx.getExtCfg(_self.identifier, defaultPostChannelConfig); _timeoutWrapper = createTimeoutWrapper(_postConfig.setTimeoutOverride, _postConfig.clearTimeoutOverride); // Only try and use the optimizeObject() if this appears to be a chromium based browser and it has not been explicitly disabled _optimizeObject = !_postConfig.disableOptimizeObj && isChromium(); _ignoreMc1Ms0CookieProcessing = _postConfig.ignoreMc1Ms0CookieProcessing; _hookWParam(core); // _hookWParam uses _ignoreMc1Ms0CookieProcessing _queueSizeLimit = _postConfig.eventsLimitInMem; _immediateQueueSizeLimit = _postConfig.immediateEventLimit; _autoFlushEventsLimit = _postConfig.autoFlushEventsLimit; _maxEventSendAttempts = _postConfig.maxEventRetryAttempts; _maxUnloadEventSendAttempts = _postConfig.maxUnloadEventRetryAttempts; _disableAutoBatchFlushLimit = _postConfig.disableAutoBatchFlushLimit; _maxEvtPerBatch = _postConfig.maxEvtPerBatch; if (isPromiseLike(coreConfig.endpointUrl)) { _self.pause(); } else if (!!_paused) { // if previous url is promise, resume _self.resume(); } _setAutoLimits(); // Override iKey if provided in Post config if provided for during initialization _overrideInstrumentationKey = _postConfig.overrideInstrumentationKey; // DisableTelemetry was defined in the config provided during initialization _disableTelemetry = !!_postConfig.disableTelemetry; if (_unloadHandlersAdded) { _removeUnloadHandlers(); } let excludePageUnloadEvents = coreConfig.disablePageUnloadEvents || []; // When running in Web browsers try to send all telemetry if page is unloaded _unloadHandlersAdded = addPageUnloadEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace); _unloadHandlersAdded = addPageHideEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace) || _unloadHandlersAdded; _unloadHandlersAdded = addPageShowEventListener(_handleShowEvents, coreConfig.disablePageShowEvents, _evtNamespace) || _unloadHandlersAdded; })); // only initialize the manager once _httpManager.initialize(theConfig, _self.core, _self); } catch (e) { // resetting the initialized state because of failure _self.setInitialized(false); throw e; } }, () => ({ theConfig, core, extensions })); }; _self.processTelemetry = (ev: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void => { setProcessTelemetryTimings(ev, _self.identifier); itemCtx = itemCtx || _self._getTelCtx(itemCtx); var event = ev as IPostTransmissionTelemetryItem; if (!_disableTelemetry && !_isTeardownCalled) { // Override iKey if provided in Post config if provided for during initialization if (_overrideInstrumentationKey) { event.iKey = _overrideInstrumentationKey; } _addEventToQueues(event, true); if (_isPageUnloadTriggered) { // Unload event has been received so we need to try and flush new events _releaseAllQueues(EventSendType.SendBeacon, SendRequestReason.Unload); } else { _scheduleTimer(); } } _self.processNext(event, itemCtx); }; _self.getOfflineSupport = () => { try { let details = _httpManager && _httpManager.getOfflineRequestDetails(); if (_httpManager) { return { getUrl: () => { if (details) { return details.url } return null; }, serialize: _serialize, batch: _batch, shouldProcess: (evt) => { return !_disableTelemetry; }, createPayload: (evt) => { return null; }, createOneDSPayload: (evts: ITelemetryItem[]) => { if (_httpManager.createOneDSPayload) { return _httpManager.createOneDSPayload(evts, _optimizeObject); } } } as IInternalOfflineSupport; } } catch (e) { // eslint-disable-next-line no-empty } return null; }; _self._doTeardown = (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => { _releaseAllQueues(EventSendType.SendBeacon, SendRequestReason.Unload); _isTeardownCalled = true; _httpManager.teardown(); _removeUnloadHandlers(); // Just register to remove all events associated with this namespace _initDefaults(); }; function _removeUnloadHandlers() { removePageUnloadEventListener(null, _evtNamespace); removePageHideEventListener(null, _evtNamespace); removePageShowEventListener(null, _evtNamespace); } function _hookWParam(core: IAppInsightsCore) { var existingGetWParamMethod = core.getWParam; core.getWParam = () => { var wparam = 0; if (_ignoreMc1Ms0CookieProcessing) { wparam = wparam | 2; } return wparam | existingGetWParamMethod.call(core); }; } function _batch(arr: string[]) { let rlt = EMPTY_STR; if (arr && arr.length) { arrForEach(arr, (item) => { if (rlt) { rlt += "\n"; } rlt += item; }); } return rlt; } function _serialize(event: ITelemetryItem) { let rlt = EMPTY_STR; try { _cleanEvent(event); rlt = _httpManager.serializeOfflineEvt(event); } catch (e) { // eslint-disable-next-line no-empty } return rlt; } // Moving event handlers out from the initialize closure so that any local variables can be garbage collected function _handleUnloadEvents(evt: any) { let theEvt = evt || getWindow().event; // IE 8 does not pass the event if (theEvt.type !== "beforeunload") { // Only set the unload trigger if not beforeunload event as beforeunload can be cancelled while the other events can't _isPageUnloadTriggered = true; _httpManager.setUnloading(_isPageUnloadTriggered); } _releaseAllQueues(EventSendType.SendBeacon, SendRequestReason.Unload); } function _handleShowEvents(evt: any) { // Handle the page becoming visible again _isPageUnloadTriggered = false; _httpManager.setUnloading(_isPageUnloadTriggered); } function _cleanEvent(event: ITelemetryItem | IPostTransmissionTelemetryItem) { if (event.ext && event.ext[STR_TRACE]) { delete (event.ext[STR_TRACE]); } if (event.ext && event.ext[STR_USER] && event.ext[STR_USER]["id"]) { delete (event.ext[STR_USER]["id"]); } // v8 performance optimization for iterating over the keys if (_optimizeObject) { event.ext = optimizeObject(event.ext); if (event.baseData) { event.baseData = optimizeObject(event.baseData); } if (event.data) { event.data = optimizeObject(event.data); } } } function _addEventToQueues(event: IPostTransmissionTelemetryItem, append: boolean) { // If send attempt field is undefined we should set it to 0. if (!event.sendAttempt) { event.sendAttempt = 0; } // Add default latency if (!event.latency) { event.latency = EventLatencyValue.Normal; } _cleanEvent(event); if (event.sync) { // If the transmission is backed off then do not send synchronous events. // We will convert these events to Real time latency instead. if (_currentBackoffCount || _paused) { event.latency = EventLatencyValue.RealTime; event.sync = false; } else { // Log the event synchronously if (_httpManager) { // v8 performance optimization for iterating over the keys if (_optimizeObject) { event = optimizeObject(event); } _httpManager.sendSynchronousBatch( EventBatch.create(event.iKey, [event]), event.sync === true ? EventSendType.Synchronous : event.sync as EventSendType, SendRequestReason.SyncEvent); return; } } } let evtLatency = event.latency; let queueSize = _queueSize; let queueLimit = _queueSizeLimit; if (evtLatency === EventLatencyValue.Immediate) { queueSize = _immediateQueueSize; queueLimit = _immediateQueueSizeLimit; } let eventDropped = false; // Only add the event if the queue isn't full or it's a direct event (which don't add to the queue sizes) if (queueSize < queueLimit) { eventDropped = !_addEventToProperQueue(event, append); } else { let dropLatency = EventLatencyValue.Normal; let dropNumber = EventsDroppedAtOneTime; if (evtLatency === EventLatencyValue.Immediate) { // Only drop other immediate events as they are not technically sharing the general queue dropLatency = EventLatencyValue.Immediate; dropNumber = 1; } // Drop old event from lower or equal latency eventDropped = true; if (_dropEventWithLatencyOrLess(event.iKey, event.latency, dropLatency, dropNumber)) { eventDropped = !_addEventToProperQueue(event, append); } } if (eventDropped) { // Can't drop events from current queues because the all the slots are taken by queues that are being flushed. _notifyEvents(strEventsDiscarded, [event], EventsDiscardedReason.QueueFull); } } _self.setEventQueueLimits = (eventLimit: number, autoFlushLimit?: number) => { _postConfig.eventsLimitInMem = _queueSizeLimit = isGreaterThanZero(eventLimit) ? eventLimit : MaxEventsLimitInMem; _postConfig.autoFlushEventsLimit = _autoFlushEventsLimit = isGreaterThanZero(autoFlushLimit) ? autoFlushLimit : 0; _setAutoLimits(); // We only do this check here as during normal event addition if the queue is > then events start getting dropped let doFlush = _queueSize > eventLimit; if (!doFlush && _autoFlushBatchLimit > 0) { // Check the auto flush max batch size for (let latency = EventLatencyValue.Normal; !doFlush && latency <= EventLatencyValue.RealTime; latency++) { let batchQueue: IPostChannelBatchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { arrForEach(batchQueue.batches, (theBatch) => { if (theBatch && theBatch.count() >= _autoFlushBatchLimit) { // If any 1 batch is > than the limit then trigger an auto flush doFlush = true; } }); } } } _performAutoFlush(true, doFlush); }; _self.pause = () => { _clearScheduledTimer(); _paused = true; _httpManager && _httpManager.pause(); }; _self.resume = () => { _paused = false; _httpManager && _httpManager.resume(); _scheduleTimer(); }; _self._loadTransmitProfiles = (profiles: { [profileName: string]: number[] }) => { _resetTransmitProfiles(); objForEachKey(profiles, (profileName, profileValue) => { let profLen = profileValue.length; if (profLen >= 2) { let directValue = (profLen > 2 ? profileValue[2] : 0); profileValue.splice(0, profLen - 2); // Make sure if a higher latency is set to not send then don't send lower latency if (profileValue[1] < 0) { profileValue[0] = -1; } // Make sure each latency is multiple of the latency higher then it. If not a multiple // we round up so that it becomes a multiple. if (profileValue[1] > 0 && profileValue[0] > 0) { let timerMultiplier = profileValue[0] / profileValue[1]; profileValue[0] = mathCeil(timerMultiplier) * profileValue[1]; } // Add back the direct profile timeout if (directValue >= 0 && profileValue[1] >= 0 && directValue > profileValue[1]) { // Make sure if it's not disabled (< 0) then make sure it's not larger than RealTime directValue = profileValue[1]; } profileValue.push(directValue); _profiles[profileName] = profileValue; } }); }; _self.flush = (isAsync: boolean = true, callback?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void | IPromise => { let result: IPromise; if (!_paused) { sendReason = sendReason || SendRequestReason.ManualFlush; if (isAsync) { if (!callback) { result = createPromise((resolve) => { // Set the callback to the promise resolve callback callback = resolve; }); } if (_flushCallbackTimer == null) { // Clear the normal schedule timer as we are going to try and flush ASAP _clearScheduledTimer(); // Move all queued events to the HttpManager so that we don't discard new events (Auto flush scenario) _queueBatches(EventLatencyValue.Normal, EventSendType.Batched, sendReason); _flushCallbackTimer = _createTimer(() => { _flushCallbackTimer = null; _flushImpl(callback, sendReason); }, 0); } else { // Even if null (no callback) this will ensure after the flushImpl finishes waiting // for a completely idle connection it will attempt to re-flush any queued events on the next cycle _flushCallbackQueue.push(callback); } } else { // Clear the normal schedule timer as we are going to try and flush ASAP let cleared = _clearScheduledTimer(); // Now cause all queued events to be sent synchronously _sendEventsForLatencyAndAbove(EventLatencyValue.Normal, EventSendType.Synchronous, sendReason); callback && callback(); if (cleared) { // restart the normal event timer if it was cleared _scheduleTimer(); } } } return result; }; _self.setMsaAuthTicket = (ticket: string) => { _httpManager.addHeader(STR_MSA_DEVICE_TICKET, ticket); }; _self.setAuthPluginHeader = (token: string) => { _httpManager.addHeader(STR_AUTH_WEB_TOKEN, token); }; _self.removeAuthPluginHeader = () => { _httpManager.removeHeader(STR_AUTH_WEB_TOKEN); }; _self.hasEvents = _hasEvents; _self._setTransmitProfile = (profileName: string) => { if (_currentProfile !== profileName && _profiles[profileName] !== undefined) { _clearScheduledTimer(); _currentProfile = profileName; _scheduleTimer(); } }; proxyFunctions(_self, () => _httpManager, [ "addResponseHandler" ]); /** * Batch and send events currently in the queue for the given latency. * @param latency - Latency for which to send events. */ function _sendEventsForLatencyAndAbove(latency: number, sendType: EventSendType, sendReason: SendRequestReason): boolean { let queued = _queueBatches(latency, sendType, sendReason); // Always trigger the request as while the post channel may not have queued additional events, the httpManager may already have waiting events _httpManager.sendQueuedRequests(sendType, sendReason); return queued; } function _hasEvents(): boolean { return _queueSize > 0; } /** * Try to schedule the timer after which events will be sent. If there are * no events to be sent, or there is already a timer scheduled, or the * http manager doesn't have any idle connections this method is no-op. */ function _scheduleTimer() { // If we had previously attempted to send requests, but the http manager didn't have any idle connections then the requests where delayed // so try and requeue then again now if (_delayedBatchSendLatency >= 0 && _queueBatches(_delayedBatchSendLatency, EventSendType.Batched, _delayedBatchReason)) { _httpManager.sendQueuedRequests(EventSendType.Batched, _delayedBatchReason); } if (_immediateQueueSize > 0 && !_immediateTimer && !_paused) { // During initialization _profiles enforce that the direct [2] is less than real time [1] timer value // If the immediateTimeout is disabled the immediate events will be sent with Real Time events let immediateTimeOut = _profiles[_currentProfile][2]; if (immediateTimeOut >= 0) { _immediateTimer = _createTimer(() => { _immediateTimer = null; // Only try to send direct events _sendEventsForLatencyAndAbove(EventLatencyValue.Immediate, EventSendType.Batched, SendRequestReason.NormalSchedule); _scheduleTimer(); }, immediateTimeOut); } } // During initialization the _profiles enforce that the normal [0] is a multiple of the real time [1] timer value let timeOut = _profiles[_currentProfile][1]; if (!_scheduledTimer && !_flushCallbackTimer && timeOut >= 0 && !_paused) { if (_hasEvents()) { _scheduledTimer = _createTimer(() => { _scheduledTimer = null; _sendEventsForLatencyAndAbove(_timerCount === 0 ? EventLatencyValue.RealTime : EventLatencyValue.Normal, EventSendType.Batched, SendRequestReason.NormalSchedule); // Increment the count for next cycle _timerCount++; _timerCount %= 2; _scheduleTimer(); }, timeOut); } else { _timerCount = 0; } } } _self._backOffTransmission = () => { if (_currentBackoffCount < MaxBackoffCount) { _currentBackoffCount++; _clearScheduledTimer(); _scheduleTimer(); } }; _self._clearBackOff = () => { if (_currentBackoffCount) { _currentBackoffCount = 0; _clearScheduledTimer(); _scheduleTimer(); } }; function _initDefaults() { _postConfig = null; _isTeardownCalled = false; _flushCallbackQueue = []; _flushCallbackTimer = null; _paused = false; _immediateQueueSize = 0; _immediateQueueSizeLimit = 500; _queueSize = 0; _queueSizeLimit = MaxEventsLimitInMem; _profiles = {}; _currentProfile = RT_PROFILE; _scheduledTimer = null; _immediateTimer = null; _currentBackoffCount = 0; _timerCount = 0; _batchQueues = {}; _autoFlushEventsLimit = 0; _unloadHandlersAdded = false; // either MaxBatchSize * (1+ Max Connections) or _queueLimit / 6 (where 3 latency Queues [normal, realtime, cost deferred] * 2 [allow half full -- allow for retry]) _autoFlushBatchLimit = 0; _delayedBatchSendLatency = -1; _delayedBatchReason = null; _optimizeObject = true; _isPageUnloadTriggered = false; _maxEventSendAttempts = MaxSendAttempts; _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts; _evtNamespace = null; _overrideInstrumentationKey = null; _maxEvtPerBatch = null; _disableTelemetry = false; _timeoutWrapper = createTimeoutWrapper(); // httpManager init should use the default value, because _maxEvtPerBatch is null currently _httpManager = new HttpManager(MaxNumberEventPerBatch, MaxConnections, MaxRequestRetriesBeforeBackoff, { requeue: _requeueEvents, send: _sendingEvent, sent: _eventsSentEvent, drop: _eventsDropped, rspFail: _eventsResponseFail, oth: _otherEvent }); _initializeProfiles(); _clearQueues(); _setAutoLimits(); } function _createTimer(theTimerFunc: () => void, timeOut: number): ITimerHandler { // If the transmission is backed off make the timer at least 1 sec to allow for back off. if (timeOut === 0 && _currentBackoffCount) { timeOut = 1; } let timerMultiplier = 1000; if (_currentBackoffCount) { timerMultiplier = retryPolicyGetMillisToBackoffForRetry(_currentBackoffCount - 1); } return _timeoutWrapper.set(theTimerFunc, timeOut * timerMultiplier); } function _clearScheduledTimer() { if (_scheduledTimer !== null) { _scheduledTimer.cancel(); _scheduledTimer = null; _timerCount = 0; return true; } return false; } // Try to send all queued events using beacons if available function _releaseAllQueues(sendType: EventSendType, sendReason: SendRequestReason) { _clearScheduledTimer(); // Cancel all flush callbacks if (_flushCallbackTimer) { _flushCallbackTimer.cancel(); _flushCallbackTimer = null; } if (!_paused) { // Queue all the remaining requests to be sent. The requests will be sent using HTML5 Beacons if they are available. _sendEventsForLatencyAndAbove(EventLatencyValue.Normal, sendType, sendReason); } } /** * Add empty queues for all latencies in the inbound queues map. This is called * when Transmission Manager is being flushed. This ensures that new events added * after flush are stored separately till we flush the current events. */ function _clearQueues() { _batchQueues[EventLatencyValue.Immediate] = { batches: [], iKeyMap: {} }; _batchQueues[EventLatencyValue.RealTime] = { batches: [], iKeyMap: {} }; _batchQueues[EventLatencyValue.CostDeferred] = { batches: [], iKeyMap: {} }; _batchQueues[EventLatencyValue.Normal] = { batches: [], iKeyMap: {} }; } function _getEventBatch(iKey: string, latency: number, create: boolean) { let batchQueue: IPostChannelBatchQueue = _batchQueues[latency]; if (!batchQueue) { latency = EventLatencyValue.Normal; batchQueue = _batchQueues[latency]; } let eventBatch = batchQueue.iKeyMap[iKey]; if (!eventBatch && create) { eventBatch = EventBatch.create(iKey); batchQueue.batches.push(eventBatch); batchQueue.iKeyMap[iKey] = eventBatch; } return eventBatch; } function _performAutoFlush(isAsync: boolean, doFlush?: boolean) { // Only perform the auto flush check if the httpManager has an idle connection and we are not in a backoff situation if (_httpManager.canSendRequest() && !_currentBackoffCount) { if (_autoFlushEventsLimit > 0 && _queueSize > _autoFlushEventsLimit) { // Force flushing doFlush = true; } if (doFlush && _flushCallbackTimer == null) { // Auto flush the queue, adding a callback to avoid the creation of a promise _self.flush(isAsync, () => {}, SendRequestReason.MaxQueuedEvents); } } } function _addEventToProperQueue(event: IPostTransmissionTelemetryItem, append: boolean): boolean { // v8 performance optimization for iterating over the keys if (_optimizeObject) { event = optimizeObject(event); } const latency = event.latency; let eventBatch = _getEventBatch(event.iKey, latency, true); if (eventBatch.addEvent(event)) { if (latency !== EventLatencyValue.Immediate) { _queueSize++; // Check for auto flushing based on total events in the queue, but not for requeued or retry events if (append && event.sendAttempt === 0) { // Force the flushing of the batch if the batch (specific iKey / latency combination) reaches it's auto flush limit _performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch.count() >= _autoFlushBatchLimit); } } else { // Direct events don't need auto flushing as they are scheduled (by default) for immediate delivery _immediateQueueSize++; } return true; } return false; } function _dropEventWithLatencyOrLess(iKey: string, latency: number, currentLatency: number, dropNumber: number): boolean { while (currentLatency <= latency) { let eventBatch = _getEventBatch(iKey, latency, true); if (eventBatch && eventBatch.count() > 0) { // Dropped oldest events from lowest possible latency let droppedEvents = eventBatch.split(0, dropNumber); let droppedCount = droppedEvents.count(); if (droppedCount > 0) { if (currentLatency === EventLatencyValue.Immediate) { _immediateQueueSize -= droppedCount; } else { _queueSize -= droppedCount; } _notifyBatchEvents(strEventsDiscarded, [droppedEvents], EventsDiscardedReason.QueueFull, undefined); return true; } } currentLatency++; } // Unable to drop any events -- lets just make sure the queue counts are correct to avoid exhaustion _resetQueueCounts(); return false; } /** * Internal helper to reset the queue counts, used as a backstop to avoid future queue exhaustion errors * that might occur because of counting issues. */ function _resetQueueCounts() { let immediateQueue = 0; let normalQueue = 0; for (let latency = EventLatencyValue.Normal; latency <= EventLatencyValue.Immediate; latency++) { let batchQueue: IPostChannelBatchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { arrForEach(batchQueue.batches, (theBatch) => { if (latency === EventLatencyValue.Immediate) { immediateQueue += theBatch.count(); } else { normalQueue += theBatch.count(); } }); } } _queueSize = normalQueue; _immediateQueueSize = immediateQueue; } function _queueBatches(latency: number, sendType: EventSendType, sendReason: SendRequestReason): boolean { let eventsQueued = false; let isAsync = sendType === EventSendType.Batched; // Only queue batches (to the HttpManager) if this is a sync request or the httpManager has an idle connection // Thus keeping the events within the PostChannel until the HttpManager has a connection available // This is so we can drop "old" events if the queue is getting full because we can't successfully send events if (!isAsync || _httpManager.canSendRequest()) { doPerf(_self.core, () => "PostChannel._queueBatches", () => { let droppedEvents = []; let latencyToProcess = EventLatencyValue.Immediate; while (latencyToProcess >= latency) { let batchQueue: IPostChannelBatchQueue = _batchQueues[latencyToProcess]; if (batchQueue && batchQueue.batches && batchQueue.batches.length > 0) { arrForEach(batchQueue.batches, (theBatch) => { // Add the batch to the http manager to send the requests if (!_httpManager.addBatch(theBatch)) { // The events from this iKey are being dropped (killed) droppedEvents = droppedEvents.concat(theBatch.events()); } else { eventsQueued = eventsQueued || (theBatch && theBatch.count() > 0); } if (latencyToProcess === EventLatencyValue.Immediate) { _immediateQueueSize -= theBatch.count(); } else { _queueSize -= theBatch.count(); } }); // Remove all batches from this Queue batchQueue.batches = []; batchQueue.iKeyMap = {}; } latencyToProcess--; } if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.KillSwitch); } if (eventsQueued && _delayedBatchSendLatency >= latency) { // We have queued events at the same level as the delayed values so clear the setting _delayedBatchSendLatency = -1; _delayedBatchReason = SendRequestReason.Undefined; } }, () => ({ latency, sendType, sendReason }), !isAsync); } else { // remember the min latency so that we can re-trigger later _delayedBatchSendLatency = _delayedBatchSendLatency >= 0 ? mathMin(_delayedBatchSendLatency, latency) : latency; _delayedBatchReason = mathMax(_delayedBatchReason, sendReason); } return eventsQueued; } /** * This is the callback method is called as part of the manual flushing process. * @param callback - The callback method to call after the flush is complete * @param sendReason - The reason why the flush is being called */ function _flushImpl(callback: () => void, sendReason: SendRequestReason) { // Add any additional queued events and cause all queued events to be sent asynchronously _sendEventsForLatencyAndAbove(EventLatencyValue.Normal, EventSendType.Batched, sendReason); // All events (should) have been queue -- lets just make sure the queue counts are correct to avoid queue exhaustion (previous bug #9685112) _resetQueueCounts(); _waitForIdleManager(() => { // Only called AFTER the httpManager does not have any outstanding requests if (callback) { callback(); } if (_flushCallbackQueue.length > 0) { _flushCallbackTimer = _createTimer(() => { _flushCallbackTimer = null; _flushImpl(_flushCallbackQueue.shift(), sendReason); }, 0); } else { // No more flush requests _flushCallbackTimer = null; // Restart the normal timer schedule _scheduleTimer(); } }); } function _waitForIdleManager(callback: () => void) { if (_httpManager.isCompletelyIdle()) { callback(); } else { _flushCallbackTimer = _createTimer(() => { _flushCallbackTimer = null; _waitForIdleManager(callback); }, FlushCheckTimer); } } /** * Resets the transmit profiles to the default profiles of Real Time, Near Real Time * and Best Effort. This removes all the custom profiles that were loaded. */ function _resetTransmitProfiles() { _clearScheduledTimer(); _initializeProfiles(); _currentProfile = RT_PROFILE; _scheduleTimer(); } function _initializeProfiles() { _profiles = {}; _profiles[RT_PROFILE] = [2, 1, 0]; _profiles[NRT_PROFILE] = [6, 3, 0]; _profiles[BE_PROFILE] = [18, 9, 0]; } /** * The notification handler for requeue events * @ignore */ function _requeueEvents(batches: EventBatch[], reason?: number) { let droppedEvents: IPostTransmissionTelemetryItem[] = []; let maxSendAttempts = _maxEventSendAttempts; if (_isPageUnloadTriggered) { // If a page unlaod has been triggered reduce the number of times we try to "retry" maxSendAttempts = _maxUnloadEventSendAttempts; } arrForEach(batches, (theBatch) => { if (theBatch && theBatch.count() > 0) { arrForEach(theBatch.events(), (theEvent: IPostTransmissionTelemetryItem) => { if (theEvent) { // Check if the request being added back is for a sync event in which case mark it no longer a sync event if (theEvent.sync) { theEvent.latency = EventLatencyValue.Immediate; theEvent.sync = false; } if (theEvent.sendAttempt < maxSendAttempts) { // Reset the event timings setProcessTelemetryTimings(theEvent, _self.identifier); _addEventToQueues(theEvent, false); } else { droppedEvents.push(theEvent); } } }); } }); if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.NonRetryableStatus); } if (_isPageUnloadTriggered) { // Unload event has been received so we need to try and flush new events _releaseAllQueues(EventSendType.SendBeacon, SendRequestReason.Unload); } } function _callNotification(evtName: string, theArgs: any[]) { let manager = (_notificationManager || ({} as NotificationManager)); let notifyFunc = manager[evtName]; if (notifyFunc) { try { notifyFunc.apply(manager, theArgs); } catch (e) { _throwInternal(_self.diagLog(), eLoggingSeverity.CRITICAL, _eInternalMessageId.NotificationException, evtName + " notification failed: " + e); } } } function _notifyEvents(evtName: string, theEvents: IPostTransmissionTelemetryItem[], ...extraArgs) { if (theEvents && theEvents.length > 0) { _callNotification(evtName, [theEvents].concat(extraArgs)); } } function _notifyBatchEvents(evtName: string, batches: EventBatch[], ...extraArgs) { if (batches && batches.length > 0) { arrForEach(batches, (theBatch) => { if (theBatch && theBatch.count() > 0) { _callNotification(evtName, [theBatch.events()].concat(extraArgs)); } }); } } /** * The notification handler for when batches are about to be sent * @ignore */ function _sendingEvent(batches: EventBatch[], reason?: number, isSyncRequest?: boolean) { if (batches && batches.length > 0) { _callNotification( "eventsSendRequest", [(reason >= EventBatchNotificationReason.SendingUndefined && reason <= EventBatchNotificationReason.SendingEventMax ? reason - EventBatchNotificationReason.SendingUndefined : SendRequestReason.Undefined), isSyncRequest !== true]); } } /** * This event represents that a batch of events have been successfully sent and a response received * @param batches - The notification handler for when the batches have been successfully sent * @param reason - For this event the reason will always be EventBatchNotificationReason.Complete */ function _eventsSentEvent(batches: EventBatch[], reason?: number) { _notifyBatchEvents("eventsSent", batches, reason); // Try and schedule the processing timer if we have events _scheduleTimer(); } function _eventsDropped(batches: EventBatch[], reason?: number, isSyncRequest?: boolean, sendType?: EventSendType) { _notifyBatchEvents( strEventsDiscarded, batches, (reason >= EventBatchNotificationReason.EventsDropped && reason <= EventBatchNotificationReason.EventsDroppedMax ? reason - EventBatchNotificationReason.EventsDropped : EventsDiscardedReason.Unknown), sendType); } function _eventsResponseFail(batches: EventBatch[], reason?: number, isSyncRequest?: boolean, sendType?: EventSendType) { _notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.NonRetryableStatus, sendType); // Try and schedule the processing timer if we have events _scheduleTimer(); } function _otherEvent(batches: EventBatch[], reason?: number, isSyncRequest?: boolean, sendType?: EventSendType) { _notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.Unknown, sendType); // Try and schedule the processing timer if we have events _scheduleTimer(); } function _setAutoLimits() { if (!_disableAutoBatchFlushLimit) { _autoFlushBatchLimit = mathMax(_maxEvtPerBatch * (MaxConnections + 1), _queueSizeLimit / 6); } else { _autoFlushBatchLimit = 0; } } }); } /** * Start the queue manager to batch and send events via post. * @param config - The core configuration. */ public initialize(coreConfig: IExtendedConfiguration, core: IAppInsightsCore, extensions: IPlugin[]) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Add an event to the appropriate inbound queue based on its latency. * @param ev - The event to be added to the queue. * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances * can optionally use this to access the current core instance or define / pass additional information * to later plugins (vs appending items to the telemetry item) */ public processTelemetry(ev: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Sets the event queue limits at runtime (after initialization), if the number of queued events is greater than the * eventLimit or autoFlushLimit then a flush() operation will be scheduled. * @param eventLimit - The number of events that can be kept in memory before the SDK starts to drop events. If the value passed is less than or * equal to zero the value will be reset to the default (10,000). * @param autoFlushLimit - When defined, once this number of events has been queued the system perform a flush() to send the queued events * without waiting for the normal schedule timers. Passing undefined, null or a value less than or equal to zero will disable the auto flush. */ public setEventQueueLimits(eventLimit: number, autoFlushLimit?: number) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Pause the transmission of any requests */ public pause() { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Resumes transmission of events. */ public resume() { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Add handler to be executed with request response text. */ public addResponseHandler(responseHanlder: (responseText: string) => void): IUnloadHook { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } /** * Flush to send data immediately; channel should default to sending data asynchronously. If executing asynchronously (the default) and * you DO NOT pass a callback function then a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * will be returned which will resolve once the flush is complete. The actual implementation of the `IPromise` * will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async) * @param isAsync - send data asynchronously when true * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. * If the caller doesn't return true the caller should assume that it may never be called. * @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified * @returns - If a callback is provided `true` to indicate that callback will be called after the flush is complete otherwise the caller * should assume that any provided callback will never be called, Nothing or if occurring asynchronously a * [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) which will be resolved once the unload is complete, * the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) will only be returned when no callback is provided * and isAsync is true. */ public flush(isAsync: boolean = true, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void | IPromise { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Set AuthMsaDeviceTicket header * @param ticket - Ticket value. */ public setMsaAuthTicket(ticket: string) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Set setAuthPluginHeader header * @param token - token value. */ public setAuthPluginHeader(token: string) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * remove AuthPlugin Header * @param token - token value. */ public removeAuthPluginHeader(token: string) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Check if there are any events waiting to be scheduled for sending. * @returns True if there are events, false otherwise. */ public hasEvents(): boolean { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return false; } /** * Load custom transmission profiles. Each profile should have timers for real time, and normal and can * optionally specify the immediate latency time in ms (defaults to 0 when not defined). Each profile should * make sure that a each normal latency timer is a multiple of the real-time latency and the immediate * is smaller than the real-time. * Setting the timer value to -1 means that the events for that latency will not be scheduled to be sent. * Note that once a latency has been set to not send, all latencies below it will also not be sent. The * timers should be in the form of [normal, high, [immediate]]. * e.g Custom: * [10,5] - Sets the normal latency time to 10 seconds and real-time to 5 seconds; Immediate will default to 0ms * [10,5,1] - Sets the normal latency time to 10 seconds and real-time to 5 seconds; Immediate will default to 1ms * [10,5,0] - Sets the normal latency time to 10 seconds and real-time to 5 seconds; Immediate will default to 0ms * [10,5,-1] - Sets the normal latency time to 10 seconds and real-time to 5 seconds; Immediate events will not be * scheduled on their own and but they will be included with real-time or normal events as the first events in a batch. * This also removes any previously loaded custom profiles. * @param profiles - A dictionary containing the transmit profiles. */ public _loadTransmitProfiles(profiles: { [profileName: string]: number[] }) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Set the transmit profile to be used. This will change the transmission timers * based on the transmit profile. * @param profileName - The name of the transmit profile to be used. */ public _setTransmitProfile(profileName: string) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Backs off transmission. This exponentially increases all the timers. */ public _backOffTransmission() { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Clears backoff for transmission. */ public _clearBackOff() { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Get Offline support * @returns internal Offline support interface IInternalOfflineSupport */ public getOfflineSupport(): IInternalOfflineSupport { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } } ================================================ FILE: channels/1ds-post-js/src/RetryPolicy.ts ================================================ import { mathFloor, mathMin } from "@nevware21/ts-utils"; /** * RetryPolicy.ts * @author Abhilash Panwar (abpanwar) * @copyright Microsoft 2018 */ const RandomizationLowerThreshold = 0.8; const RandomizationUpperThreshold = 1.2; const BaseBackoff = 3000; const MaxBackoff = 600000; /** * Determine if the request should be retried for the given status code. * The below expression reads that we should only retry for: * - HttpStatusCodes that are smaller than 300. * - HttpStatusCodes greater or equal to 500 (except for 501-NotImplement * and 505-HttpVersionNotSupport). * - HttpStatusCode 408-RequestTimeout. * - HttpStatusCode 429. * This is based on Microsoft.WindowsAzure.Storage.RetryPolicies.ExponentialRetry class * @param httpStatusCode - The status code returned for the request. * @returns True if request should be retried, false otherwise. */ export function retryPolicyShouldRetryForStatus(httpStatusCode: number): boolean { /* tslint:disable:triple-equals */ // Disabling triple-equals rule to avoid httpOverrides from failing because they are returning a string value return !((httpStatusCode >= 300 && httpStatusCode < 500 && httpStatusCode != 429) || (httpStatusCode == 501) || (httpStatusCode == 505)); /* tslint:enable:triple-equals */ } /** * Gets the number of milliseconds to back off before retrying the request. The * back off duration is exponentially scaled based on the number of retries already * done for the request. * @param retriesSoFar - The number of times the request has already been retried. * @returns The back off duration for the request before it can be retried. */ export function retryPolicyGetMillisToBackoffForRetry(retriesSoFar: number): number { let waitDuration = 0; let minBackoff = BaseBackoff * RandomizationLowerThreshold; let maxBackoff = BaseBackoff * RandomizationUpperThreshold; let randomBackoff = mathFloor(Math.random() * (maxBackoff - minBackoff)) + minBackoff; waitDuration = Math.pow(2, retriesSoFar) * randomBackoff; return mathMin(waitDuration, MaxBackoff); } ================================================ FILE: channels/1ds-post-js/src/Serializer.ts ================================================ /** * Serializer.ts * @author Abhilash Panwar (abpanwar); Hector Hernandez (hectorh); Nev Wylie (newylie) * @copyright Microsoft 2018-2020 */ // @skip-file-minify import dynamicProto from "@microsoft/dynamicproto-js"; import { EventSendType, FieldValueSanitizerFunc, FieldValueSanitizerType, IEventProperty, IPerfManagerProvider, IValueSanitizer, SendRequestReason, arrIndexOf, doPerf, getCommonSchemaMetaData, getTenantId, isArray, isValueAssigned, objForEachKey, sanitizeProperty, strStartsWith } from "@microsoft/applicationinsights-core-js"; import { IChannelConfiguration, IPostTransmissionTelemetryItem, IRequestSizeLimit } from "./DataModels"; import { EventBatch } from "./EventBatch"; import { STR_EMPTY } from "./InternalConstants"; import { mathMin, strSubstr } from "@nevware21/ts-utils"; /** * Note: This is an optimization for V8-based browsers. When V8 concatenates a string, * the strings are only joined logically using a "cons string" or "constructed/concatenated * string". These containers keep references to one another and can result in very large * memory usage. For example, if a 2MB string is constructed by concatenating 4 bytes * together at a time, the memory usage will be ~44MB; so ~22x increase. The strings are * only joined together when an operation requiring their joining takes place, such as * substr(). This function is called when adding data to this buffer to ensure these * types of strings are periodically joined to reduce the memory footprint. * Setting to every 20 events as the JSON.stringify() may have joined many strings * and calling this too much causes a minor delay while processing. */ const _MAX_STRING_JOINS = 20; // Max Size set by One Collector: https://msazure.visualstudio.com/OneDsCollector/_git/Collector?path=/Services/Azure/CollectorWorkerRoleAzure/ServiceConfiguration.Cloud.cscfg const RequestSizeLimitBytes = 3145728; // approx 3.15 Mb const BeaconRequestSizeLimitBytes = 65000; // approx 64kb (the current Edge, Firefox and Chrome max limit) const MaxRecordSize = 2000000; // approx 2 Mb const MaxBeaconRecordSize = mathMin(MaxRecordSize, BeaconRequestSizeLimitBytes); const metadata = "metadata"; const f = "f"; const rCheckDot = /\./; /** * @ignore * Identifies the callback to add metadata for a property. * @since 4.1.0 * @group Private * @param pathKeys - The path keys for the property * @param key - The property key * @param value - The property value */ type EventMetaDataCallback = (pathKeys: string[], key: string, value: IEventProperty) => void; /** * @ignore * Identifies the callback to get the encoded type for a property. * This is added as a future hook for the serializer to allow for custom encoding of properties. * @since 4.1.0 * @group Private * @param value - The property value * @param kind - The property value kind * @param type - The property type * @returns The encoded type for the property */ export type SerializerGetEncodedType = (value: string | boolean | number | string[] | number[] | boolean[] | undefined, kind: number | undefined, type?: number | undefined) => number; export interface ISerializedPayload { /** * The collection of iKeys included in this payload */ apiKeys: string[]; /** * Serialized payload blob that needs to be sent. */ payloadBlob: string; /** * Extra events that would not fit into the serialized blob limit */ overflow: EventBatch; /** * Events that where dropped because they exceeded the individual limit */ sizeExceed: EventBatch[]; /** * Events that where dropped because they could not be serialized */ failedEvts: EventBatch[]; /** * The batches included in this payload */ batches: EventBatch[]; /** * The events that have been sent if not the full payload */ sentEvts?: EventBatch[]; /** * The number of events in the payload */ numEvents: number; /** * The retry count for this payload */ retryCnt: number; /** * Was this payload created during a teardown */ isTeardown: boolean; /** * Is this payload a synchronous payload */ isSync: boolean; /** * The payload has been constructed using a reduced payload size for usage with sendBeacon or fetch(with keepAlive) API's */ isBeacon: boolean; /** * The request event sync type */ sendType: EventSendType; /** * The reason the payload has is being sent */ sendReason?: SendRequestReason; } /** * Class to handle serialization of event and request. * Currently uses Bond for serialization. Please note that this may be subject to change. */ export class Serializer { /** * Constructs a new instance of the Serializer class * @param perfManager - The performance manager to use for tracking performance * @param valueSanitizer - The value sanitizer to use for sanitizing field values * @param stringifyObjects - Should objects be stringified before being sent * @param enableCompoundKey - Should compound keys be enabled (defaults to false) * @param getEncodedTypeOverride - The callback to get the encoded type for a property defaults to ({@link getCommonSchemaMetaData }(...)) * @param excludeCsMetaData - (!DANGER!) Should metadata be populated when encoding the event blob (defaults to false) - PII data will NOT be tagged as PII for backend processing * @param cfg channel cfg for setting request and record size limit */ constructor(perfManager?: IPerfManagerProvider, valueSanitizer?: IValueSanitizer, stringifyObjects?: boolean, enableCompoundKey?: boolean, getEncodedTypeOverride?: SerializerGetEncodedType, excludeCsMetaData?: boolean, cfg?: IChannelConfiguration) { const strData = "data"; const strBaseData = "baseData"; const strExt = "ext"; let _checkForCompoundkey = !!enableCompoundKey; let _processSubKeys = true; let _theSanitizer: IValueSanitizer = valueSanitizer; let _isReservedCache = {}; let _excludeCsMetaData: boolean = !!excludeCsMetaData; let _getEncodedType: SerializerGetEncodedType = getEncodedTypeOverride || getCommonSchemaMetaData; let _sizeCfg = _getSizeLimtCfg(cfg); let _requestSizeLimitBytes = _validateSizeLimit(_sizeCfg.requestLimit, RequestSizeLimitBytes, 0); let _beaconRequestSizeLimitBytes = _validateSizeLimit(_sizeCfg.requestLimit, BeaconRequestSizeLimitBytes, 1); let _maxRecordSize = _validateSizeLimit(_sizeCfg.recordLimit, MaxRecordSize, 0); let _maxBeaconRecordSize = Math.min(_validateSizeLimit(_sizeCfg.recordLimit, MaxBeaconRecordSize, 1), _beaconRequestSizeLimitBytes); dynamicProto(Serializer, this, (_self) => { _self.createPayload = (retryCnt: number, isTeardown: boolean, isSync: boolean, isReducedPayload: boolean, sendReason: SendRequestReason, sendType: EventSendType): ISerializedPayload => { return { apiKeys: [], payloadBlob: STR_EMPTY, overflow: null, sizeExceed: [], failedEvts: [], batches: [], numEvents: 0, retryCnt: retryCnt, isTeardown: isTeardown, isSync: isSync, isBeacon: isReducedPayload, sendType: sendType, sendReason: sendReason }; }; _self.appendPayload = (payload: ISerializedPayload, theBatch: EventBatch, maxEventsPerBatch: number): boolean => { let canAddEvents = payload && theBatch && !payload.overflow; if (canAddEvents) { doPerf(perfManager, () => "Serializer:appendPayload", () => { let theEvents = theBatch.events(); let payloadBlob = payload.payloadBlob; let payloadEvents = payload.numEvents; let eventsAdded = false; let sizeExceeded: IPostTransmissionTelemetryItem[] = []; let failedEvts: IPostTransmissionTelemetryItem[] = []; let isBeaconPayload = payload.isBeacon; let requestMaxSize = isBeaconPayload ? _beaconRequestSizeLimitBytes : _requestSizeLimitBytes; let recordMaxSize = isBeaconPayload ? _maxBeaconRecordSize : _maxRecordSize; let lp = 0; let joinCount = 0; while (lp < theEvents.length) { let theEvent = theEvents[lp]; if (theEvent) { if (payloadEvents >= maxEventsPerBatch) { // Maximum events per payload reached, so don't add any more payload.overflow = theBatch.split(lp); break; } let eventBlob = _self.getEventBlob(theEvent); if (eventBlob && eventBlob.length <= recordMaxSize) { // This event will fit into the payload let blobLength = eventBlob.length; let currentSize = payloadBlob.length; if (currentSize + blobLength > requestMaxSize) { // Request or batch size exceeded, so don't add any more to the payload payload.overflow = theBatch.split(lp); break; } if (payloadBlob) { payloadBlob += "\n"; } payloadBlob += eventBlob; joinCount ++; // v8 memory optimization only if (joinCount > _MAX_STRING_JOINS) { // this substr() should cause the constructed string to join strSubstr(payloadBlob, 0, 1); joinCount = 0; } eventsAdded = true; payloadEvents++; } else { if (eventBlob) { // Single event size exceeded so remove from the batch sizeExceeded.push(theEvent); } else { failedEvts.push(theEvent); } // We also need to remove this event from the existing array, otherwise a notification will be sent // indicating that it was successfully sent theEvents.splice(lp, 1); lp--; } } lp++; } if (sizeExceeded.length > 0) { payload.sizeExceed.push(EventBatch.create(theBatch.iKey(), sizeExceeded)); // Remove the exceeded events from the batch } if (failedEvts.length > 0) { payload.failedEvts.push(EventBatch.create(theBatch.iKey(), failedEvts)); // Remove the failed events from the batch } if (eventsAdded) { payload.batches.push(theBatch); payload.payloadBlob = payloadBlob; payload.numEvents = payloadEvents; let apiKey = theBatch.iKey(); if (arrIndexOf(payload.apiKeys, apiKey) === -1) { payload.apiKeys.push(apiKey); } } }, () => ({ payload: payload, theBatch: { iKey: theBatch.iKey(), evts: theBatch.events() }, max: maxEventsPerBatch })); } return canAddEvents; }; _self.getEventBlob = (eventData: IPostTransmissionTelemetryItem): string => { try { return doPerf(perfManager, () => "Serializer.getEventBlob", () => { let serializedEvent = { } as any; // Adding as dynamic keys for v8 performance serializedEvent.name = eventData.name; serializedEvent.time = eventData.time; serializedEvent.ver = eventData.ver; serializedEvent.iKey = "o:" + getTenantId(eventData.iKey); // Assigning local var so usage in part b/c don't throw if there is no ext let serializedExt = {}; let _addMetadataCallback: EventMetaDataCallback; if (!_excludeCsMetaData) { _addMetadataCallback = (pathKeys: string[], key: string, value: IEventProperty) => { _addJSONPropertyMetaData(_getEncodedType, serializedExt, pathKeys, key, value); }; } // Part A let eventExt = eventData[strExt]; if (eventExt) { // Only assign ext if the event had one (There are tests covering this use case) serializedEvent[strExt] = serializedExt; objForEachKey(eventExt, (key, value) => { let data = serializedExt[key] = {}; // Don't include a metadata callback as we don't currently set metadata Part A fields _processPathKeys(value, data, "ext." + key, true, null, null, true); }); } let serializedData: any = serializedEvent[strData] = {}; serializedData.baseType = eventData.baseType; let serializedBaseData = serializedData[strBaseData] = {}; // Part B _processPathKeys(eventData.baseData, serializedBaseData, strBaseData, false, [strBaseData], _addMetadataCallback, _processSubKeys); // Part C _processPathKeys(eventData.data, serializedData, strData, false, [], _addMetadataCallback, _processSubKeys); return JSON.stringify(serializedEvent); }, () => ({ item: eventData })); } catch (e) { return null; } }; function _isReservedField(path: string, name: string): boolean { let result = _isReservedCache[path]; if (result === undefined) { if (path.length >= 7) { // Do not allow the changing of fields located in the ext.metadata or ext.web extension result = strStartsWith(path, "ext.metadata") || strStartsWith(path, "ext.web"); } _isReservedCache[path] = result; } return result; } function _processPathKeys( srcObj: any, target: { [key: string]: {}}, thePath: string, checkReserved: boolean, metadataPathKeys: string[], metadataCallback: EventMetaDataCallback, processSubKeys: boolean) { objForEachKey(srcObj, (key, srcValue) => { let prop: IEventProperty = null; if (srcValue || isValueAssigned(srcValue)) { let path = thePath; let name = key; let theMetaPathKeys = metadataPathKeys; let destObj = target; // Handle keys with embedded '.', like "TestObject.testProperty" if (_checkForCompoundkey && !checkReserved && rCheckDot.test(key)) { let subKeys = key.split("."); let keyLen = subKeys.length; if (keyLen > 1) { if (theMetaPathKeys) { // Create a copy of the meta path keys so we can add the extra ones theMetaPathKeys = theMetaPathKeys.slice(); } for (let lp = 0; lp < keyLen - 1; lp++) { let subKey = subKeys[lp]; // Add/reuse the sub key object destObj = destObj[subKey] = destObj[subKey] || {}; path += "." + subKey; if (theMetaPathKeys) { theMetaPathKeys.push(subKey); } } name = subKeys[keyLen - 1]; } } let isReserved = checkReserved && _isReservedField(path, name); if (!isReserved && _theSanitizer && _theSanitizer.handleField(path, name)) { prop = _theSanitizer.value(path, name, srcValue, stringifyObjects); } else { prop = sanitizeProperty(name, srcValue, stringifyObjects); } if (prop) { // Set the value let newValue: any = prop.value; destObj[name] = newValue; if (metadataCallback) { metadataCallback(theMetaPathKeys, name, prop); } if (processSubKeys && typeof newValue === "object" && !isArray(newValue)) { let newPath = theMetaPathKeys; if (newPath) { newPath = newPath.slice(); newPath.push(name); } // Make sure we process sub objects as well (for value sanitization and metadata) _processPathKeys(srcValue, newValue, path + "." + name, checkReserved, newPath, metadataCallback, processSubKeys); } } } }); } }); } /** * Create a serializer payload package * @param retryCnt - The retry count for the events in this payload * @param isTeardown - Is this payload being created as part of a teardown request * @param isSync - Should this payload be sent as a synchronous request * @param isReducedPayload - Is this payload going to be sent via sendBeacon() API * @param sendReason - The reason the payload is being sent * @param sendType - Identifies how this payload will be sent */ public createPayload(retryCnt: number, isTeardown: boolean, isSync: boolean, isReducedPayload: boolean, sendReason: SendRequestReason, sendType: EventSendType): ISerializedPayload { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } /** * Append the batched events into the payload * @param payload - The serialized payload detail object * @param theBatch - The batched events to append to the payload * @param maxEventsPerBatch - The maximum number of events to allow in the payload * @returns True if the events from the new batch where attempted to be added to the payload otherwise false */ public appendPayload(payload: ISerializedPayload, theBatch: EventBatch, maxEventsPerBatch: number): boolean { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return false; } /** * Bond serialize the event. * @param eventData - The event that needs to be serialized. * @returns The serialized json event. */ public getEventBlob(eventData: IPostTransmissionTelemetryItem): string { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } /** * Does this field value sanitizer handle this path / field combination * @param path - The field path * @param name - The name of the field */ public handleField(path: string, name: string): boolean { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return false; } /** * Get the field sanitizer for this type of field based on the field type, value kind and/or event property type * @param path - The field path * @param name - The name of the field * @param theType - The type of field * @param theKind - The value kind of the field * @param propType - The property type of the field */ public getSanitizer(path: string, name: string, theType: FieldValueSanitizerType, theKind?: number, propType?: number): FieldValueSanitizerFunc | null | undefined { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } } function _validateSizeLimit(cfgVal: number[], defaultVal: number, idx: number): number { if (isArray(cfgVal)){ let val = cfgVal[idx]; if (val > 0 && val <= defaultVal) { return val; } } return defaultVal; } function _getSizeLimtCfg(cfg?: IChannelConfiguration) { let defaultCfg = {} as IRequestSizeLimit; if (cfg && cfg.requestLimit) { return cfg.requestLimit; } return defaultCfg; } /** * @ignore * @param getEncodedType - The function to get the encoded type for the property * @param json - The json object to add the metadata to * @param propKeys - The property keys to add to the metadata * @param name - The name of the property * @param propertyValue - The property value */ function _addJSONPropertyMetaData( getEncodedType: (value: string | boolean | number | string[] | number[] | boolean[] | undefined, kind: number | undefined, type?: number | undefined) => number, json: { [name: string]: {} }, propKeys: string[], name: string, propertyValue: IEventProperty | null) { if (propertyValue && json) { let encodedTypeValue = getEncodedType(propertyValue.value, propertyValue.kind, propertyValue.propertyType); if (encodedTypeValue > -1) { // Add the root metadata let metaData = json[metadata]; if (!metaData) { // Sets the root 'f' metaData = json[metadata] = { f: {} }; } let metaTarget = metaData[f]; if (!metaTarget) { // This can occur if someone has manually added an ext.metadata object // Such as ext.metadata.privLevel and ext.metadata.privTags metaTarget = metaData[f] = {}; } // Traverse the metadata path and build each object (contains an 'f' key) -- if required if (propKeys) { for (let lp = 0; lp < propKeys.length; lp++) { let key = propKeys[lp]; if (!metaTarget[key]) { metaTarget[key] = { f: {} }; } let newTarget = metaTarget[key][f]; if (!newTarget) { // Not expected, but can occur if the metadata context was pre-created as part of the event newTarget = metaTarget[key][f] = {}; } metaTarget = newTarget; } } metaTarget = metaTarget[name] = { }; if (isArray(propertyValue.value)) { metaTarget["a"] = { t: encodedTypeValue }; } else { metaTarget["t"] = encodedTypeValue; } } } } ================================================ FILE: channels/1ds-post-js/src/TimeoutOverrideWrapper.ts ================================================ /** * TimeoutOverrideWrapper.ts * @author Nev Wylie (newylie) * @copyright Microsoft 2022 * Simple internal timeout wrapper */ import { ClearTimeoutOverrideFn, ITimerHandler, TimeoutOverrideFn, scheduleTimeoutWith } from "@nevware21/ts-utils"; export interface ITimeoutOverrideWrapper { set: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => ITimerHandler; } export function createTimeoutWrapper(argSetTimeout?: TimeoutOverrideFn, argClearTimeout?: ClearTimeoutOverrideFn) { return { set: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => { return scheduleTimeoutWith([argSetTimeout, argClearTimeout], callback, ms, args); } } } ================================================ FILE: channels/1ds-post-js/src/typings/XDomainRequest.ts ================================================ // This interface was removed from newer versions of typescript. Restore it for legacy support export interface XDomainRequest { timeout: number; onerror: (ev: Event) => any; onload: (ev: Event) => any; onprogress: (ev: any) => any; ontimeout: (ev: Event) => any; responseText: string; contentType: string; open(method: string, url: string): void; create(): XDomainRequest; abort(): void; send(data?: any): void; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; addEventListener(type: "load" | "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; } // export declare var XDomainRequest: { // prototype: IXDomainRequest; // new (): IXDomainRequest; // }; ================================================ FILE: channels/1ds-post-js/test/Unit/src/FileSizeCheckTest.ts ================================================ import { AITestClass } from "@microsoft/ai-test-framework"; import { dumpObj, mathCeil } from '@nevware21/ts-utils'; import { createPromise, doAwait, IPromise } from '@nevware21/ts-async'; import * as pako from 'pako'; const MAX_DEFLATE_SIZE = 26.5; const PACKAGE_JSON = "../package.json"; function removeTrailingComma(text) { return text.replace(/,(\s*[}\],])/g, "$1"); } function _loadPackageJson(cb: (isNightly: boolean, packageJson: any) => IPromise): IPromise { return createPromise((testCompleted, testFailed) => { function _handleCallback(packageJson: any) { let version = packageJson.version || "unknown"; let isNightly = version.includes("nightly") || version.includes("dev"); doAwait(cb(isNightly, packageJson), () => { testCompleted(); }, (error) => { QUnit.assert.ok(false, `checkIsNightlyBuild error: ${error}`); testFailed(error); }); } fetch(PACKAGE_JSON).then((response) => { if (!response.ok) { QUnit.assert.ok(false, `fetch package.json error: ${dumpObj(response)}`); _handleCallback(false); } else { return response.text().then((content) => { let json = JSON.parse(removeTrailingComma(content)); _handleCallback(json); }, (error) => { QUnit.assert.ok(false, `fetch package.json error: ${error}`); _handleCallback({}); }); } }, (error) => { QUnit.assert.ok(false, `fetch package.json error: ${error}`); _handleCallback({}); }); }); } function _checkSize(checkType: string, maxSize: number, size: number, isNightly: boolean): void { if (isNightly) { maxSize += .5; } QUnit.assert.ok(size <= maxSize, `exceed ${maxSize} KB, current ${checkType} size is: ${size} KB`); } export class FileSizeCheckTest extends AITestClass { public testInitialize() { } public registerTests() { this.testCase({ name: "Test ms.post gzip size", useFakeServer: false, test: () => { return _loadPackageJson((isNightly, packageJson) => { QUnit.assert.ok(true, ` checking : ${packageJson.name || "??"} v${packageJson.version || "unknown"}`); return createPromise((testCompleted, testFailed) => { let xhr = new XMLHttpRequest(); xhr.open('GET', '../bundle/es5/ms.post.min.js', true); xhr.onload = () => { let size = mathCeil(pako.deflate(xhr.responseText).length / 1024); _checkSize("deflate", MAX_DEFLATE_SIZE, size, isNightly); testCompleted(); }; xhr.send() xhr.onerror = (err) => { QUnit.assert.ok(false, "error in getting deflate size: " + err) testFailed(err); } }); }); } }); } } ================================================ FILE: channels/1ds-post-js/test/Unit/src/GlobalTestHooks.Test.ts ================================================ import { _testHookMaxUnloadHooksCb } from "@microsoft/applicationinsights-core-js"; import { Assert } from "@microsoft/ai-test-framework"; import { dumpObj } from "@nevware21/ts-utils"; export class GlobalTestHooks { public registerTests() { // Set a global maximum _testHookMaxUnloadHooksCb(20, (state: string, hooks: Array) => { Assert.ok(false, "Max unload hooks exceeded [" + hooks.length + "] - " + state + " - " + dumpObj(hooks)); }); } } ================================================ FILE: channels/1ds-post-js/test/Unit/src/HttpManagerTest.ts ================================================ import { AITestClass, PollingAssert } from "@microsoft/ai-test-framework"; import { HttpManager } from "../../../src/HttpManager"; import { AppInsightsExtCore, BaseTelemetryPlugin, EventSendType, IAppInsightsCore, IExtendedConfiguration, IPlugin, IProcessTelemetryContext, ITelemetryItem, SendRequestReason, TransportType, isBeaconsSupported, IXHROverride, IPayloadData } from "@microsoft/applicationinsights-core-js"; import { PostChannel } from "../../../src/PostChannel"; import { IPostTransmissionTelemetryItem, EventBatchNotificationReason, IChannelConfiguration } from "../../../src/DataModels"; import { EventBatch } from "../../../src/EventBatch"; import { retryPolicyShouldRetryForStatus } from "../../../src/RetryPolicy"; import { setBypassLazyCache } from "@nevware21/ts-utils"; interface EventDetail { batches: EventBatch[]; reason: EventBatchNotificationReason; isSync: boolean; } interface SendHookDetail { payload: IPayloadData; isSync: boolean; } export class HttpManagerTest extends AITestClass { private postManager: PostChannel private xhrOverrideSpy: any; private core: IAppInsightsCore; private _requeueEvents: EventDetail[] = []; private _sendEvents: EventDetail[] = []; private _sentEvents: EventDetail[] = []; private _dropEvents: EventDetail[] = []; private _hookCalls: SendHookDetail[] = []; constructor(name?: string, emulateEs3?: boolean) { super(name, emulateEs3); this.assertNoEvents = true; this.assertNoHooks = true; } public testInitialize() { super.testInitialize(); setBypassLazyCache(true); // Reset the cached isBeacons supported isBeaconsSupported(false); this._requeueEvents = []; this._sendEvents = []; this._sentEvents = []; this._dropEvents = []; this._hookCalls = []; this.core = new AppInsightsExtCore(); var config = { instrumentationKey: "" }; this.postManager = new PostChannel(); this.core.initialize(config, [this.postManager]); } public testFinishedCleanup(): void { if (this.postManager) { // Stop the post channel from sending any events (after the fake server has been removed) this.postManager.pause(); } if (this.core && this.core.isInitialized()) { this.core.unload(false); } super.testFinishedCleanup(); } public registerTests() { let _requeueNotification = (batches: EventBatch[], reason?: EventBatchNotificationReason, isSyncRequest?: boolean) => { this._requeueEvents.push({ batches: batches, reason: reason, isSync: isSyncRequest }); }; let _sendNotification = (batches: EventBatch[], reason?: EventBatchNotificationReason, isSyncRequest?: boolean) => { this._sendEvents.push({ batches: batches, reason: reason, isSync: isSyncRequest }); }; let _sentNotification = (batches: EventBatch[], reason?: EventBatchNotificationReason, isSyncRequest?: boolean) => { this._sentEvents.push({ batches: batches, reason: reason, isSync: isSyncRequest }); }; let _dropNotification = (batches: EventBatch[], reason?: EventBatchNotificationReason, isSyncRequest?: boolean) => { this._dropEvents.push({ batches: batches, reason: reason, isSync: isSyncRequest }); }; let _sendHook = (payload: IPayloadData, callback: (modifiedBuffer: IPayloadData) => void, isSync?: boolean) => { this._hookCalls.push({ payload: payload, isSync: isSync }); // just call the callback callback(payload); }; this.testCase({ name: "HttpManager: dynamic config", useFakeTimers: true, test: () => { let xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { oncomplete(200, {}); } }; let hookSpy = this.sandbox.spy(_sendHook); let cbSpy = this.sandbox.spy(); let core = this.core; let postChannel = this.postManager; let postId = postChannel.identifier; core.config.extensionConfig = core.config.extensionConfig || {}; core.config.extensionConfig[postId].payloadListener = cbSpy; core.config.extensionConfig[postId].payloadPreprocessor = hookSpy; core.config.extensionConfig[postId].httpXHROverride = xhrOverride; core.config.endpointUrl = "testEndpoint"; let testBatch = EventBatch.create("testToken", [this._createEvent()]); let manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); manager.initialize(core.config, core, postChannel); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, " the override should be set"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "transport is set to undefined"); QUnit.assert.ok(hookSpy.notCalled, "sendhook should not be called"); QUnit.assert.equal(this._sendEvents.length, 0, "No batches sent yet"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); manager.sendSynchronousBatch(testBatch); QUnit.assert.ok(hookSpy.calledOnce, "preprocessor should be called when the manager makes an HTTP request"); QUnit.assert.ok(hookSpy.args[0][2], "preprocessor should have been told its a sync request"); QUnit.assert.equal(this._sendEvents.length, 1, "batches sent"); QUnit.assert.equal(this._sentEvents.length, 1, "batches Completed"); QUnit.assert.equal(testBatch.events()[0].sendAttempt, 1, "attempt should be 1"); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); let payload = cbSpy.args[0][1]; QUnit.assert.equal(payload.urlString, "testEndpoint?cors=true&content-type=application/x-json-stream&w=0", "endpoint should be testEndpoint"); QUnit.assert.equal(payload.headers.apikey, "testToken", "headers should contain testToken"); QUnit.assert.equal(payload.timeout, undefined, "Timeout was undefined"); QUnit.assert.equal(payload.disableXhrSync, false, "disable XHRSync was false"); QUnit.assert.equal(payload.disableFetchKeepAlive, false, "disable fetch keep alive should be false"); // dynamic changes core.config.extensionConfig[postId].disableFetchKeepAlive = true; core.config.endpointUrl = "newEndpoint"; this.clock.tick(1); testBatch = EventBatch.create("newToken", [this._createEvent()]); manager.sendSynchronousBatch(testBatch); QUnit.assert.equal(this._sendEvents.length, 2, "batches sent should be 2"); QUnit.assert.equal(this._sentEvents.length, 2, "batches Completed should be 2"); QUnit.assert.equal(testBatch.events()[0].sendAttempt, 1, "attempt should be 1"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.equal(cbSpy.callCount, 2, "listener should be called twice"); payload = cbSpy.args[1][1]; QUnit.assert.equal(payload.urlString, "newEndpoint?cors=true&content-type=application/x-json-stream&w=0","endpoint should be newEndpoint"); QUnit.assert.equal(payload.headers.apikey, "newToken", "apikey should contain newToken"); QUnit.assert.equal(payload.timeout, undefined, "Timeout was undefined"); QUnit.assert.equal(payload.disableXhrSync, false, "disable XHRSync was false"); QUnit.assert.equal(payload.disableFetchKeepAlive, true, "disable fetch keep alive should be true"); let fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); core.config.extensionConfig[postId].httpXHROverride = null; core.config.extensionConfig[postId].transports= TransportType.Fetch; core.config.extensionConfig[postId].disableFetchKeepAlive = false; this.clock.tick(1); QUnit.assert.ok(manager["_getDbgPlgTargets"]()[0], "Make sure that there is a transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Fetch, "Make sure that the transport type is fetch"); testBatch = EventBatch.create("newToken", [this._createEvent()]); manager.sendSynchronousBatch(testBatch); QUnit.assert.equal(fetchCalls.length, 1, "fetch call length should be 1"); QUnit.assert.equal(this._requeueEvents.length, 0, "requeueEvents should be 0"); QUnit.assert.ok(fetchCalls[0].input, "fetch call should not empty"); QUnit.assert.equal(fetchCalls[0].init.body, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}", "should get expected data"); QUnit.assert.equal(testBatch.events()[0].sendAttempt, 1, "attempt should be 1"); } }); this.testCase({ name: "HttpManager: Offline Support", useFakeTimers: true, test: () => { let core = this.core; let postChannel = this.postManager; core.config.extensionConfig = core.config.extensionConfig || {}; let postId = postChannel.identifier; core.config.endpointUrl = "testEndpoint"; let manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); manager.initialize(core.config, core, postChannel); QUnit.assert.ok(manager.serializeOfflineEvt, "seralize function should exist"); let evt = this._createEvent(); evt.iKey = "testKey-123"; let evtStr = manager.serializeOfflineEvt(evt); QUnit.assert.equal(evtStr, `{"name":"testEvent","iKey":"o:testKey","data":{"baseData":{}}}`,"Event should be serialized"); QUnit.assert.ok(manager.getOfflineRequestDetails, "request details function should exist"); QUnit.assert.ok(manager.getOfflineRequestDetails(), "request details should set"); QUnit.assert.equal(manager.getOfflineRequestDetails().url, "testEndpoint?cors=true&content-type=application/x-json-stream&w=0", "details url should be set"); let details = manager.createOneDSPayload([evt]); let headers = details.headers || {}; let apiKey = headers["apikey"]; QUnit.assert.equal(apiKey, "testKey-123", "should get expected api key"); QUnit.assert.equal(details.data, `{"name":"testEvent","iKey":"o:testKey","data":{"baseData":{}}}`, "should return expected data"); let evt1 = this._createEvent(); evt1.iKey = "testKey-12345"; evt1.name = "testEvent1"; details = manager.createOneDSPayload([evt, evt1]); headers = details.headers || {}; apiKey = headers["apikey"]; QUnit.assert.equal(apiKey, "testKey-123,testKey-12345", "should get expected api keys test1"); QUnit.assert.equal(details.data, `{"name":"testEvent","iKey":"o:testKey","data":{"baseData":{}}}\n{"name":"testEvent1","iKey":"o:testKey","data":{"baseData":{}}}`, "should return expected data test1"); let evt2 = this._createEvent(); evt2.iKey = "testKey-123"; evt2.name = "testEvent2"; details = manager.createOneDSPayload([evt, evt2]); headers = details.headers || {}; apiKey = headers["apikey"]; QUnit.assert.equal(apiKey, "testKey-123", "should get expected api keys test2"); QUnit.assert.equal(details.data, `{"name":"testEvent","iKey":"o:testKey","data":{"baseData":{}}}\n{"name":"testEvent2","iKey":"o:testKey","data":{"baseData":{}}}`, "should return expected data test2"); } }); this.testCase({ name: "Http Manager with maxNumberEvtPerBatch config set", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { oncomplete(200, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const hookSpy = this.sandbox.spy(_sendHook); this.core.config.extensionConfig = this.core.config.extensionConfig || {}; this.core.config.extensionConfig[this.postManager.identifier].maxEvtPerBatch = 3; this.core.config.extensionConfig[this.postManager.identifier].payloadPreprocessor = hookSpy; this.core.config.extensionConfig[this.postManager.identifier].httpXHROverride = xhrOverride; manager.initialize(this.core.config, this.core, this.postManager); let maxNumberEvtPerBatch = manager["_getDbgPlgTargets"]()[6]; QUnit.assert.equal(maxNumberEvtPerBatch, 3, "max number of events per batch should be 3"); let serializer = manager["_getDbgPlgTargets"]()[2]; let spy = this.sandbox.spy(serializer, "appendPayload"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); QUnit.assert.ok(hookSpy.notCalled); // precondition QUnit.assert.equal(this._sendEvents.length, 0, "No batches sent yet"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.ok(spy.notCalled, "appendPayload should not be called yet"); manager.sendSynchronousBatch(testBatch); QUnit.assert.ok(spy.calledOnce, "appendPayload should be called when the manager makes an HTTP request"); let appendPayloadArgs = spy.args[0][2]; QUnit.assert.equal(appendPayloadArgs, 3, "appendPayload should be called with max number of events per batch"); QUnit.assert.ok(hookSpy.calledOnce, "preprocessor should be called when the manager makes an HTTP request"); QUnit.assert.ok(hookSpy.args[0][2], "preprocessor should have been told its a sync request"); QUnit.assert.equal(this._sendEvents.length, 1, "batches sent"); QUnit.assert.equal(this._sentEvents.length, 1, "batches Completed"); } }); this.testCase({ name: "Http Manager with maxNumberEvtPerBatch config set to 0 or large than the default value", useFakeTimers: true, test: () => { var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig = this.core.config.extensionConfig || {}; this.core.config.extensionConfig[this.postManager.identifier].maxEvtPerBatch = 0; manager.initialize(this.core.config, this.core, this.postManager); let maxNumberEvtPerBatch = manager["_getDbgPlgTargets"]()[6]; QUnit.assert.equal(maxNumberEvtPerBatch, 500, "max number of events per batch should be 500"); var manager1: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig[this.postManager.identifier].maxEvtPerBatch = 1000; manager1.initialize(this.core.config, this.core, this.postManager); maxNumberEvtPerBatch = manager1["_getDbgPlgTargets"]()[6]; QUnit.assert.equal(maxNumberEvtPerBatch, 500, "max number of events per batch should be 500 test1"); } }); this.testCase({ name: "payloadPreprocessor with override", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { oncomplete(200, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); // Using the default values defined as const values in Postchannel // 500 = MaxNumberEventPerBatch // 2 = MaxConnections // 1 = MaxRetries var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const hookSpy = this.sandbox.spy(_sendHook); this.core.config.extensionConfig![this.postManager.identifier].payloadPreprocessor = hookSpy; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); QUnit.assert.ok(hookSpy.notCalled); // precondition QUnit.assert.equal(this._sendEvents.length, 0, "No batches sent yet"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); manager.sendSynchronousBatch(testBatch); QUnit.assert.ok(hookSpy.calledOnce, "preprocessor should be called when the manager makes an HTTP request"); QUnit.assert.ok(hookSpy.args[0][2], "preprocessor should have been told its a sync request"); QUnit.assert.equal(this._sendEvents.length, 1, "batches sent"); QUnit.assert.equal(this._sentEvents.length, 1, "batches Completed"); } }); this.testCase({ name: "payloadPreprocessor with override throws before calling callback", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { oncomplete(200, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); let sendHookCalled = 0; var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].payloadPreprocessor = (payload, callback, isAsync) => { sendHookCalled++; throw "Fake Error"; }; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); QUnit.assert.ok(sendHookCalled == 0); // precondition QUnit.assert.equal(this._sendEvents.length, 0, "No batches sent yet"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); manager.sendSynchronousBatch(testBatch); // Notifications are sent asynchronously QUnit.assert.equal(sendHookCalled, 1, "preprocessor should be called when the manager makes an HTTP request"); QUnit.assert.equal(this._sendEvents.length, 1, "batches sent"); QUnit.assert.equal(this._sentEvents.length, 1, "batches Completed"); } }); this.testCase({ name: "payloadPreprocessor with override throws after calling callback", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { oncomplete(200, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); let sendHookCalled = 0; var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const hookSpy = this.sandbox.spy(_sendHook); this.core.config.extensionConfig![this.postManager.identifier].payloadPreprocessor = (payload, callback, isAsync) => { sendHookCalled++; callback(payload); throw "Fake Error"; }; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); QUnit.assert.ok(sendHookCalled == 0); // precondition QUnit.assert.equal(this._sendEvents.length, 0, "No batches sent yet"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); manager.sendSynchronousBatch(testBatch); QUnit.assert.equal(sendHookCalled, 1, "preprocessor should be called when the manager makes an HTTP request"); QUnit.assert.equal(this._sendEvents.length, 1, "batches sent"); QUnit.assert.equal(this._sentEvents.length, 1, "batches Completed"); } }); if (!this.isEmulatingIe) { this.testCase({ name: "payloadPreprocessor should not be called during teardown with custom override", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { oncomplete(200, null); } }; var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const hookSpy = this.sandbox.spy(_sendHook); this.core.config.extensionConfig![this.postManager.identifier].payloadPreprocessor = hookSpy; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(hookSpy.notCalled); // precondition QUnit.assert.equal(this._sendEvents.length, 0, "No batches sent yet"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); manager.teardown(); QUnit.assert.ok(hookSpy.notCalled, "preprocessor should not be called when the manager is being torn down"); // QUnit.assert.ok(hookSpy.args[0][2], "preprocessor should have been told its a sync request"); QUnit.assert.equal(this._sendEvents.length, 1, "batches sent"); QUnit.assert.equal(this._sentEvents.length, 1, "batches Completed"); } }); // Beacons don't exist in ES3 mode this.testCase({ name: "payloadPreprocessor not called during teardown with beacons", useFakeTimers: true, test: () => { var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const hookSpy = this.sandbox.spy(_sendHook); this.core.config.extensionConfig![this.postManager.identifier].payloadPreprocessor = hookSpy; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(hookSpy.notCalled); // precondition QUnit.assert.equal(this._sendEvents.length, 0, "No batches sent yet"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); manager.teardown(); QUnit.assert.ok(hookSpy.notCalled, "preprocessor should not be called when the manager is being torn down"); QUnit.assert.equal(this._sendEvents.length, 1, "batches sent"); QUnit.assert.equal(this._sentEvents.length, 1, "batches Completed"); } }); } this.testCase({ name: "payloadListener with override", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { oncomplete(200, null); } }; var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); this.core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); QUnit.assert.ok(cbSpy.notCalled); // precondition manager.sendSynchronousBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(!cbSpy.args[0][3], "listener should have been told its not a beacon request"); } }); this.testCase({ name: "payloadListener with override called during teardown", useFakeTimers: true, test: () => { let overrideCalled = false; var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { overrideCalled = true; oncomplete(200, null); } }; var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); this.core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; // This stops the internal code from falling back to use sendBeacon() when running in ES3 mode during testing this.core.config.extensionConfig![this.postManager.identifier].alwaysUseXhrOverride = this.isEmulatingIe ? true : undefined; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.notCalled); // precondition manager.teardown(); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(!cbSpy.args[0][3], "listener should have been told its not a beacon request"); if (this.isEmulatingIe) { QUnit.assert.ok(overrideCalled, "The override should always be called"); } else { QUnit.assert.ok(!overrideCalled, "The override should not be called"); } } }); this.testCase({ name: "payloadListener with override called during teardown and override is always called", useFakeTimers: true, test: () => { let overrideCalled = false; var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { overrideCalled = true; oncomplete(200, null); } }; var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); this.core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; // This stops the internal code from falling back to use sendBeacon() when running in ES3 mode during testing this.core.config.extensionConfig![this.postManager.identifier].alwaysUseXhrOverride = true; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.notCalled); // precondition manager.teardown(); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(!cbSpy.args[0][3], "listener should have been told its not a beacon request"); QUnit.assert.ok(overrideCalled, "The override should always be called"); } }); if (!this.isEmulatingIe) { this.testCase({ name: "payloadListener called during teardown without xhr override using beacon for teardown", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); this.core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Xhr, "Make sure that XHR was actually selected as the transport"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.notCalled); // precondition manager.teardown(); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(cbSpy.args[0][3], "listener should have been told its a beacon request"); QUnit.assert.equal(fetchCalls.length, 0, "Make sure fetch was not called as beacons should be used for teardown"); QUnit.assert.equal(beaconCalls.length, 1, "Expect thant sendBeacon was called") } }); this.testCase({ name: "SendBeacon would not drop batches when local storage is available", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { //Error code oncomplete(0, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.sendSynchronousBatch(testBatch, EventSendType.SendBeacon); QUnit.assert.equal(this._requeueEvents.length, 0, "Send Beacon doesn't Requeue failed events"); QUnit.assert.equal(beaconCalls.length, 2, "Two Beacon attempts should have occurred"); QUnit.assert.equal(fetchCalls.length, 0, "No fetch calls should have occurred"); // Without local storage, after the second failure, baecon will be dropped QUnit.assert.equal(this._dropEvents.length, 1, "No batches have been dropped"); let localStorage = new TestLocalStorageChannel(); this.core.addPlugin(localStorage); let testBatch2 = EventBatch.create("testToken", [this._createEvent("testEvent1"), this._createEvent("testEvent2"), this._createEvent("testEvent3")]); this.clock.tick(1); manager.sendSynchronousBatch(testBatch2, EventSendType.SendBeacon); QUnit.assert.equal(this._requeueEvents.length, 0, "Send Beacon doesn't Requeue failed events"); QUnit.assert.equal(beaconCalls.length, 4, "Four Beacon attempts should have occurred"); QUnit.assert.equal(fetchCalls.length, 0, "No fetch calls should have occurred"); // With local storage, failed sending request will not cause the batch to get dropped QUnit.assert.equal(this._dropEvents.length, 1, "This time batche will not be dropped"); } }); this.testCase({ name: "even if local storage is available, beacon would not be dropped if successfully send", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { //Error code oncomplete(0, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); let localStorage = new TestLocalStorageChannel(); this.core.addPlugin(localStorage); let testBatch2 = EventBatch.create("testToken", [this._createEvent("testEvent1"), this._createEvent("testEvent2"), this._createEvent("testEvent3")]); this.clock.tick(1); manager.sendSynchronousBatch(testBatch2, EventSendType.SendBeacon); QUnit.assert.equal(this._requeueEvents.length, 0, "Send Beacon doesn't Requeue failed events"); // the first call would success, so should not go to the split and call again QUnit.assert.equal(beaconCalls.length, 1, "Only one Beacon attempts should have occurred"); QUnit.assert.equal(fetchCalls.length, 0, "No fetch calls should have occurred"); // With local storage, sussefully sending request will not cause the batch to get dropped QUnit.assert.equal(this._dropEvents.length, 0, "No batche should be dropped"); } }); this.testCase({ name: "payloadListener called during teardown without xhr override using fetch", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); let channelConfig: IChannelConfiguration = { transports: TransportType.Fetch, }; let core = new AppInsightsExtCore(); var config: IExtendedConfiguration = { instrumentationKey: "", extensionConfig: { "PostChannel": channelConfig } }; let postManager = new PostChannel(); core.initialize(config, [postManager]); this.onDone(() => { core.unload(false); }); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; core.config.endpointUrl = "testEndpoint"; manager.initialize(core.config, core, postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Fetch, "Make sure that fetch was actually selected as the transport"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.notCalled); // precondition manager.teardown(); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(cbSpy.args[0][3], "listener should have been told its a beacon request"); QUnit.assert.equal(fetchCalls.length, 0, "Make sure fetch was not called as beacons should be used for teardown"); QUnit.assert.equal(beaconCalls.length, 1, "Expect thant sendBeacon was called") } }); this.testCase({ name: "payloadListener called during teardown without xhr override using fetch and explicit sendBeacon", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); let channelConfig: IChannelConfiguration = { transports: TransportType.Fetch, useSendBeacon: true }; let core = new AppInsightsExtCore(); var config: IExtendedConfiguration = { instrumentationKey: "", extensionConfig: { "PostChannel": channelConfig } }; let postManager = new PostChannel(); core.initialize(config, [postManager]); this.onDone(() => { core.unload(false); }); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; core.config.endpointUrl = "testEndpoint"; manager.initialize(core.config, core, postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Fetch, "Make sure that fetch was actually selected as the transport"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.notCalled); // precondition manager.setUnloading(true); // Simulate page unload manager.teardown(); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(cbSpy.args[0][3], "listener should have been told its a beacon request"); QUnit.assert.equal(fetchCalls.length, 0, "Make sure fetch was not called as beacons should be used for teardown"); QUnit.assert.equal(beaconCalls.length, 1, "Expect thant sendBeacon was called"); QUnit.assert.ok(beaconCalls[0].url.indexOf("NoResponseBody=") !== -1, "Make sure NoResponseBody was requested") } }); this.testCase({ name: "payloadListener called during teardown without xhr override using fetch and explicit sendBeacon with addNoResponse", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); let channelConfig: IChannelConfiguration = { transports: TransportType.Fetch, useSendBeacon: true, addNoResponse: false }; let core = new AppInsightsExtCore(); var config: IExtendedConfiguration = { instrumentationKey: "", extensionConfig: { "PostChannel": channelConfig } }; let postManager = new PostChannel(); core.initialize(config, [postManager]); this.onDone(() => { core.unload(false); }); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; core.config.endpointUrl = "testEndpoint"; manager.initialize(core.config, core, postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Fetch, "Make sure that fetch was actually selected as the transport"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.notCalled); // precondition manager.setUnloading(true); // Simulate page unload manager.teardown(); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(cbSpy.args[0][3], "listener should have been told its a beacon request"); QUnit.assert.equal(fetchCalls.length, 0, "Make sure fetch was not called as beacons should be used for teardown"); QUnit.assert.equal(beaconCalls.length, 1, "Expect thant sendBeacon was called"); QUnit.assert.ok(beaconCalls[0].url.indexOf("NoResponseBody=") === -1, "Make sure NoResponseBody was NOT requested") } }); this.testCase({ name: "payloadListener called during teardown without xhr override and disabling sendBeacon using fetch", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); let channelConfig: IChannelConfiguration = { transports: TransportType.Fetch, useSendBeacon: false }; let core = new AppInsightsExtCore(); var config: IExtendedConfiguration = { instrumentationKey: "", extensionConfig: { "PostChannel": channelConfig } }; let postManager = new PostChannel(); core.initialize(config, [postManager]); this.onDone(() => { core.unload(false); }); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; core.config.endpointUrl = "testEndpoint"; manager.initialize(core.config, core, postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Fetch, "Make sure that fetch was actually selected as the transport"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.notCalled); // precondition manager.setUnloading(true); // Simulate page unload manager.teardown(); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(cbSpy.args[0][3], "listener should have been told its a beacon request (reduced payload size)"); QUnit.assert.equal(fetchCalls.length, 1, "It should have used fetch as sendBeacon is disabled for teardown"); QUnit.assert.equal(beaconCalls.length, 0, "Expect thant sendBeacon was not called") QUnit.assert.ok((fetchCalls[0].input as string).indexOf("NoResponseBody=") !== -1, "Make sure NoResponseBody was requested") } }); this.testCase({ name: "payloadListener called during simulated unload with teardown without xhr override using fetch for unload and normal", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); let channelConfig: IChannelConfiguration = { transports: TransportType.Fetch, unloadTransports: TransportType.Fetch }; let core = new AppInsightsExtCore(); var config: IExtendedConfiguration = { instrumentationKey: "", extensionConfig: { "PostChannel": channelConfig } }; let postManager = new PostChannel(); core.initialize(config, [postManager]); this.onDone(() => { core.unload(false); }); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; core.config.endpointUrl = "testEndpoint"; manager.initialize(core.config, core, postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Fetch, "Make sure that fetch was actually selected as the transport"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.notCalled); // precondition manager.setUnloading(true); // Simulate page unload manager.teardown(); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(cbSpy.args[0][3], "listener should have been told its a beacon request"); QUnit.assert.equal(cbSpy.args[0][1].timeout, undefined, "Timeout was undefined"); QUnit.assert.equal(cbSpy.args[0][1].disableXhrSync, false, "disable XHRSync was false"); QUnit.assert.equal(cbSpy.args[0][1].disableFetchKeepAlive, false, "disable fetch keep alive was false"); QUnit.assert.equal(fetchCalls.length, 1, "It should have used fetch as we requested for teardown"); QUnit.assert.ok((fetchCalls[0].input as string).indexOf("NoResponseBody=") !== -1, "Make sure NoResponseBody was requested") QUnit.assert.equal(beaconCalls.length, 0, "Expect thant sendBeacon was not called") } }); this.testCase({ name: "payloadListener called during simulated unload with teardown without xhr override specifying fetch for unload and normal but disabling fetch keepalive", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); let channelConfig: IChannelConfiguration = { transports: TransportType.Fetch, unloadTransports: TransportType.Fetch, disableFetchKeepAlive: true }; let core = new AppInsightsExtCore(); var config: IExtendedConfiguration = { instrumentationKey: "", extensionConfig: { "PostChannel": channelConfig } }; let postManager = new PostChannel(); core.initialize(config, [postManager]); this.onDone(() => { core.unload(false); }); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; core.config.endpointUrl = "testEndpoint"; manager.initialize(core.config, core, postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Fetch, "Make sure that fetch was actually selected as the transport"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.notCalled); // precondition manager.setUnloading(true); // Simulate page unload manager.teardown(); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(cbSpy.args[0][3], "listener should have been told its a beacon request"); QUnit.assert.equal(cbSpy.args[0][1].timeout, undefined, "Timeout was undefined"); QUnit.assert.equal(cbSpy.args[0][1].disableXhrSync, false, "disable XHRSync was false"); QUnit.assert.equal(cbSpy.args[0][1].disableFetchKeepAlive, true, "disable fetch keep alive was true"); QUnit.assert.equal(fetchCalls.length, 0, "It should have used fetch as we requested for teardown"); QUnit.assert.equal(beaconCalls.length, 1, "Expect thant sendBeacon was called") QUnit.assert.ok(beaconCalls[0].url.indexOf("NoResponseBody=") !== -1, "Make sure NoResponseBody was requested") } }); this.testCase({ name: "payloadListener called during teardown without send beacon and using fetch", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); let channelConfig: IChannelConfiguration = { transports: [ TransportType.Fetch ], unloadTransports: [ TransportType.Fetch ] }; let core = new AppInsightsExtCore(); var config: IExtendedConfiguration = { instrumentationKey: "", extensionConfig: { "PostChannel": channelConfig } }; let postManager = new PostChannel(); core.initialize(config, [postManager]); this.onDone(() => { core.unload(false); }); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; core.config.endpointUrl = "testEndpoint"; manager.initialize(core.config, core, postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Fetch, "Make sure that fetch was actually selected as the transport"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.notCalled); // precondition manager.setUnloading(true); // Simulate page unload manager.teardown(); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(cbSpy.args[0][3], "listener should have been told its a beacon request"); QUnit.assert.equal(cbSpy.args[0][1].timeout, undefined, "Timeout was undefined"); QUnit.assert.equal(cbSpy.args[0][1].disableXhrSync, false, "disable XHRSync was false"); QUnit.assert.equal(cbSpy.args[0][1].disableFetchKeepAlive, false, "disable fetch keep alive was false"); QUnit.assert.equal(fetchCalls.length, 1, "It should have used fetch as we requested for teardown"); QUnit.assert.ok((fetchCalls[0].input as string).indexOf("NoResponseBody=") !== -1, "Make sure NoResponseBody was requested") QUnit.assert.equal(beaconCalls.length, 0, "Expect thant sendBeacon was not called") } }); this.testCase({ name: "payloadListener called during teardown without send beacon and using fetch with noResponseBody", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); let channelConfig: IChannelConfiguration = { transports: [ TransportType.Fetch ], unloadTransports: [ TransportType.Fetch ], addNoResponse: false }; let core = new AppInsightsExtCore(); var config: IExtendedConfiguration = { instrumentationKey: "", extensionConfig: { "PostChannel": channelConfig } }; let postManager = new PostChannel(); core.initialize(config, [postManager]); this.onDone(() => { core.unload(false); }); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; core.config.endpointUrl = "testEndpoint"; manager.initialize(core.config, core, postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Fetch, "Make sure that fetch was actually selected as the transport"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.notCalled); // precondition manager.setUnloading(true); // Simulate page unload manager.teardown(); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(cbSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(cbSpy.args[0][3], "listener should have been told its a beacon request"); QUnit.assert.equal(cbSpy.args[0][1].timeout, undefined, "Timeout was undefined"); QUnit.assert.equal(cbSpy.args[0][1].disableXhrSync, false, "disable XHRSync was false"); QUnit.assert.equal(cbSpy.args[0][1].disableFetchKeepAlive, false, "disable fetch keep alive was false"); QUnit.assert.equal(fetchCalls.length, 1, "It should have used fetch as we requested for teardown"); QUnit.assert.ok((fetchCalls[0].input as string).indexOf("NoResponseBody=") === -1, "Make sure NoResponseBody was NOT requested") QUnit.assert.equal(beaconCalls.length, 0, "Expect thant sendBeacon was not called") } }); } this.testCase({ name: "payloadPreprocessor and payloadListener", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { oncomplete(200, null); } }; var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const hookSpy = this.sandbox.spy(_sendHook); this.core.config.extensionConfig![this.postManager.identifier].payloadPreprocessor = hookSpy; const listenerSpy = this.sandbox.spy(); this.core.config.extensionConfig![this.postManager.identifier].payloadListener = listenerSpy; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(hookSpy.notCalled); // precondition QUnit.assert.ok(listenerSpy.notCalled); // precondition manager.sendQueuedRequests(); QUnit.assert.ok(hookSpy.calledOnce, "preprocessor should be called when the manager makes an HTTP request"); QUnit.assert.ok(!hookSpy.args[0][2], "preprocessor should have been told its not a sync request"); QUnit.assert.ok(listenerSpy.called, "listener requires the sendHook to call its callback"); QUnit.assert.ok(listenerSpy.calledOnce, "listener should be called via the send hook callback"); QUnit.assert.ok(!listenerSpy.args[0][2], "listener should have been told its not a sync request"); QUnit.assert.ok(!listenerSpy.args[0][3], "listener should have been told its not a beacon request"); } }); this.testCase({ name: "payloadPreprocessor and payloadListener during teardown with override", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { oncomplete(200, null); } }; var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const hookSpy = this.sandbox.spy(_sendHook); this.core.config.extensionConfig![this.postManager.identifier].payloadPreprocessor = hookSpy; const listenerSpy = this.sandbox.spy(); this.core.config.extensionConfig![this.postManager.identifier].payloadListener = listenerSpy; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(hookSpy.notCalled); // precondition QUnit.assert.ok(listenerSpy.notCalled); // precondition manager.teardown(); QUnit.assert.ok(hookSpy.notCalled, "preprocessor should not be called when the manager is being torn down"); // QUnit.assert.ok(hookSpy.args[0][2], "preprocessor should have been told its a sync request"); QUnit.assert.ok(listenerSpy.called, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(listenerSpy.calledOnce, "listener should be called via the send hook callback"); QUnit.assert.ok(listenerSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(!listenerSpy.args[0][3], "listener should have been told its not a beacon request"); } }); this.testCase({ name: "payloadPreprocessor and payloadListener during teardown without xhr override", useFakeTimers: true, test: () => { var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const hookSpy = this.sandbox.spy(_sendHook); this.core.config.extensionConfig![this.postManager.identifier].payloadPreprocessor = hookSpy; const listenerSpy = this.sandbox.spy(); this.core.config.extensionConfig![this.postManager.identifier].payloadListener = listenerSpy; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(hookSpy.notCalled); // precondition QUnit.assert.ok(listenerSpy.notCalled); // precondition manager.teardown(); QUnit.assert.ok(hookSpy.notCalled, "preprocessor should not be called when the manager is being torn down"); QUnit.assert.ok(listenerSpy.calledOnce, "listener should be called via the send hook callback"); QUnit.assert.ok(listenerSpy.args[0][2], "listener should have been told its a sync request"); QUnit.assert.ok(listenerSpy.args[0][3], "listener should have been told its a beacon request"); } }); this.testCase({ name: "sendSynchronousRequest", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { oncomplete(200, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); let xhrOverrideSpy = this.sandbox.spy(xhrOverride, "sendPOST"); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); QUnit.assert.equal(this._sendEvents.length, 0, "No events sent yet"); manager.sendSynchronousBatch(testBatch); QUnit.assert.equal(this._sendEvents.length, 1, "No events sent yet"); QUnit.assert.equal(xhrOverrideSpy.called, true); QUnit.assert.equal(this._requeueEvents.length, 0); QUnit.assert.equal(this._sendEvents.length, 1); QUnit.assert.equal(this._sentEvents.length, 1); var overrideArgs = xhrOverrideSpy.getCall(0).args; QUnit.assert.notEqual(overrideArgs[0].urlString, ""); QUnit.assert.equal(overrideArgs[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); QUnit.assert.equal(testBatch.events()[0].sendAttempt, 1); this.clock.tick(1); QUnit.assert.equal(this._requeueEvents.length, 0); QUnit.assert.equal(this._sendEvents.length, 1); QUnit.assert.equal(this._sentEvents.length, 1); } }); this.testCase({ name: "Validate synchronous event with 299 response", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { // Error code oncomplete(299, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.sendSynchronousBatch(testBatch); QUnit.assert.equal(this._requeueEvents.length, 1, "Requeue got called once"); var addBackRequestArg: EventBatch = this._requeueEvents[0].batches[0]; QUnit.assert.equal(addBackRequestArg.count(), 1); QUnit.assert.equal(addBackRequestArg.events()[0].name, "testEvent"); } }); this.testCase({ name: "Fetch Credentials config could be set from post channel and pass into sendPostManager", useFakeTimers: true, test: () => { var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].fetchCredentials = "omit"; this.core.config.endpointUrl = "testEndpoint"; this.core.config.extensionConfig![this.postManager.identifier].alwaysUseXhrOverride = false; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[4].fetchCredentials, "omit", "Fetch credentials should be set to omit"); } }); this.testCase({ name: "Validate synchronous event with zero response - Default Send Type (Synchronous)", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { //Error code oncomplete(0, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.sendSynchronousBatch(testBatch); // Once requeued HttpManager has handed responsibility of the batch back to the "listener" (PostChannel) QUnit.assert.equal(this._requeueEvents.length, 1, "Requeue got called once"); var addBackRequestArg: EventBatch = this._requeueEvents[0].batches[0]; QUnit.assert.equal(addBackRequestArg.count(), 1); QUnit.assert.equal(addBackRequestArg.events()[0].name, "testEvent"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon calls should have occurred"); QUnit.assert.equal(fetchCalls.length, 0, "No fetch calls should have occurred"); QUnit.assert.equal(this._sendEvents.length, 1, "A batch has been sent"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); } }); if (!this.isEmulatingIe) { this.testCase({ name: "Validate synchronous event with failed response - Explicit Send Type (SendBeacon)", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { //Error code oncomplete(0, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.sendSynchronousBatch(testBatch, EventSendType.SendBeacon); QUnit.assert.equal(this._requeueEvents.length, 0, "Send Beacon doesn't Requeue failed events"); QUnit.assert.equal(beaconCalls.length, 2, "Two Beacon attempts should have occurred"); QUnit.assert.equal(fetchCalls.length, 0, "No fetch calls should have occurred"); QUnit.assert.equal(this._sendEvents.length, 1, "A batch has been sent"); QUnit.assert.equal(this._sentEvents.length, 1, "No batches Completed yet"); // The 2nd failed will cause the batch to get dropped QUnit.assert.equal(this._dropEvents.length, 1, "One batches have been dropped"); } }); } this.testCase({ name: "Validate synchronous event with zero response always using the override - Explicit Send Type (SendBeacon)", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { //Error code oncomplete(0, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].alwaysUseXhrOverride = true; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.sendSynchronousBatch(testBatch, EventSendType.SendBeacon); // Once Requeued HttpManager hands responsibility of the batch back to the PostChannel QUnit.assert.equal(this._requeueEvents.length, 1, "The httpXhrOverride will Requeue"); var addBackRequestArg: EventBatch = this._requeueEvents[0].batches[0]; QUnit.assert.equal(addBackRequestArg.count(), 1); QUnit.assert.equal(addBackRequestArg.events()[0].name, "testEvent"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon calls should have occurred"); QUnit.assert.equal(fetchCalls.length, 0, "No fetch calls should have occurred"); QUnit.assert.equal(this._sendEvents.length, 1, "A batch has been sent"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); } }); this.testCase({ name: "Validate synchronous event with delayed failed response - Explicit Send Type (SyncFetch)", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve, reject) => { setTimeout(function() { reject(); }, 1); }); var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { //Error code oncomplete(0, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.sendSynchronousBatch(testBatch, EventSendType.SyncFetch); QUnit.assert.equal(this._requeueEvents.length, 0, "wE need to wait for the response to get processed"); QUnit.assert.equal(fetchCalls.length, 1, "We should have performed a fetch call"); QUnit.assert.equal(this._sendEvents.length, 1, "A batch has been sent"); QUnit.assert.equal(this._sentEvents.length, 0, "Only unload reason causes the batch to be considered successful!"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); // This would have caused a "Retry" let retryAttempt = 0; /// Trigger the retry as it's random we need to loop while (retryAttempt < 4000 && this._sendEvents.length === 1) { this.clock.tick(100); retryAttempt += 100; } this.clock.tick(100); // Nothing should have occurred QUnit.assert.equal(this._requeueEvents.length, 1, "A Sync Fetch eventually requeues should occur unless it was an unload"); QUnit.assert.equal(fetchCalls.length, 1, "We should have performed a fetch call"); QUnit.assert.equal(this._sendEvents.length, 1, "A batch has been sent"); QUnit.assert.equal(this._sentEvents.length, 0, "Only unload reason causes the batch to be considered successful!"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); } }); this.testCase({ name: "Validate synchronous event with delayed failed response but simulating unload - Explicit Send Type (SyncFetch)", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve, reject) => { setTimeout(function() { reject(); }, 1); }); var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { //Error code oncomplete(0, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.sendSynchronousBatch(testBatch, EventSendType.SyncFetch, SendRequestReason.Unload); QUnit.assert.equal(this._requeueEvents.length, 0, "A Sync Fetch during unload acts like sendBeacon() -- ignores response so no requeue should occur"); QUnit.assert.equal(fetchCalls.length, 1, "We should have performed a fetch call"); QUnit.assert.equal(this._sendEvents.length, 1, "A batch has been sent"); QUnit.assert.equal(this._sentEvents.length, 1, "A sync Fetch during an unload is considered successful!"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); this.clock.tick(100); // Nothing should have occurred QUnit.assert.equal(this._requeueEvents.length, 0, "A Sync Fetch during unload acts like sendBeacon() -- ignores response so no requeue should occur"); QUnit.assert.equal(fetchCalls.length, 1, "We should have performed a fetch call"); QUnit.assert.equal(this._sendEvents.length, 1, "A batch has been sent"); QUnit.assert.equal(this._sentEvents.length, 1, "A sync Fetch during an unload is considered successful!"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); } }); this.testCase({ name: "Validate synchronous event with immediate reject - Explicit Send Type (SyncFetch)", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve, reject) => { reject(); }); var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { //Error code oncomplete(0, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.sendSynchronousBatch(testBatch, EventSendType.SyncFetch); QUnit.assert.equal(fetchCalls.length, 1, "We should have performed a fetch call"); // An immediate failure should requeue the events and once requeued HttpManager has handed responsibility of the batch back to the "listener" (PostChannel) QUnit.assert.equal(this._requeueEvents.length, 1, "Requeue got called once"); var addBackRequestArg: EventBatch = this._requeueEvents[0].batches[0]; QUnit.assert.equal(addBackRequestArg.count(), 1); QUnit.assert.equal(addBackRequestArg.events()[0].name, "testEvent"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon calls should have occurred"); QUnit.assert.equal(fetchCalls.length, 1, "No fetch calls should have occurred"); QUnit.assert.equal(this._sendEvents.length, 1, "A batch has been sent"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); /// Move forward to trigger and possible the 2nd timeout (which should not occur) this.clock.tick(5000); // Still No additional retries should occur QUnit.assert.equal(beaconCalls.length, 0, "No Beacon calls should have occurred"); QUnit.assert.equal(fetchCalls.length, 1, "No fetch calls should have occurred"); QUnit.assert.equal(this._requeueEvents.length, 1, "It did not get Requeue again"); QUnit.assert.equal(this._sendEvents.length, 1, "A batch has been sent"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "Batches should have been dropped"); } }); this.testCase({ name: "retry synchronous event with zero response always use override - Default Send Type (SyncFetch)", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { //Error code oncomplete(0, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].alwaysUseXhrOverride = true; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.sendSynchronousBatch(testBatch, EventSendType.SendBeacon); // Once Requeued HttpManager hands responsibility of the batch back to the PostChannel QUnit.assert.equal(this._requeueEvents.length, 1, "The httpXhrOverride will Requeue"); var addBackRequestArg: EventBatch = this._requeueEvents[0].batches[0]; QUnit.assert.equal(addBackRequestArg.count(), 1); QUnit.assert.equal(addBackRequestArg.events()[0].name, "testEvent"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon calls should have occurred"); QUnit.assert.equal(fetchCalls.length, 0, "No fetch calls should have occurred"); QUnit.assert.equal(this._sendEvents.length, 1, "A batch has been sent"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); } }); this.testCase({ name: "retry synchronous event with zero response - Default Send Type (Batched)", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { //Error code oncomplete(0, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.sendSynchronousBatch(testBatch, EventSendType.Batched); QUnit.assert.equal(this._requeueEvents.length, 0, "Normal batched events cause a retry and not a requeue"); QUnit.assert.equal(this._sendEvents.length, 1, "A batch has been sent"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); let retryAttempt = 0; /// Trigger the retry as it's random we need to loop (initial send plus retry send) while (retryAttempt < 40 && this._sendEvents.length < 2) { this.clock.tick(100); retryAttempt += 1; } QUnit.assert.equal(this._requeueEvents.length, 1, "It got Requeued"); QUnit.assert.equal(this._sendEvents.length, 2, "And it got sent"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); } }); this.testCase({ name: "sendQueuedRequests with override", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { oncomplete(200, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); let xhrOverrideSpy = this.sandbox.spy(xhrOverride, "sendPOST"); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.addBatch(testBatch); manager.sendQueuedRequests(); QUnit.assert.equal(xhrOverrideSpy.called, true); QUnit.assert.equal(this._requeueEvents.length, 0); var overrideArgs = xhrOverrideSpy.getCall(0).args; QUnit.assert.notEqual(overrideArgs[0].urlString, ""); QUnit.assert.equal(overrideArgs[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); QUnit.assert.equal(testBatch.events()[0].sendAttempt, 1); } }); this.testCase({ name: "sendQueuedRequests with fetch", useFakeTimers: true, test: () => { var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].transports = TransportType.Fetch; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.ok(manager["_getDbgPlgTargets"]()[0], "Make sure that there is a transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Fetch, "Make sure that the transport type is fetch"); manager.addBatch(testBatch); manager.sendQueuedRequests(); QUnit.assert.equal(fetchCalls.length, 1); QUnit.assert.equal(this._requeueEvents.length, 0); QUnit.assert.notEqual(fetchCalls[0].input, ""); QUnit.assert.equal(fetchCalls[0].init.body, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); QUnit.assert.equal(testBatch.events()[0].sendAttempt, 1); } }); if (!this.isEmulatingIe) { this.testCase({ name: "sendQueuedRequests with beacons", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].transports = TransportType.Beacon; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.ok(manager["_getDbgPlgTargets"]()[0], "Make sure that there is a transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Beacon, "Make sure that the transport type is Beacon"); manager.addBatch(testBatch); manager.sendQueuedRequests(); QUnit.assert.equal(fetchCalls.length, 0); QUnit.assert.equal(beaconCalls.length, 1); QUnit.assert.equal(this._requeueEvents.length, 0); QUnit.assert.notEqual(beaconCalls[0].url, ""); QUnit.assert.equal(beaconCalls[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); QUnit.assert.equal(testBatch.events()[0].sendAttempt, 1); } }); this.testCase({ name: "sendQueuedRequests with beacons with splitting", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); if (beaconCalls.length === 1) { // fail the first request so it gets split and resent return false; } return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); let testBatch = EventBatch.create("testToken", [this._createEvent("testEvent1"), this._createEvent("testEvent2"), this._createEvent("testEvent3")]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.extensionConfig![this.postManager.identifier].transports = TransportType.Beacon; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.ok(manager["_getDbgPlgTargets"]()[0], "Make sure that there is a transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Beacon, "Make sure that the transport type is Beacon"); manager.addBatch(testBatch); manager.sendQueuedRequests(); QUnit.assert.equal(fetchCalls.length, 0); QUnit.assert.equal(beaconCalls.length, 4); QUnit.assert.equal(this._requeueEvents.length, 0); QUnit.assert.notEqual(beaconCalls[0].url, ""); QUnit.assert.equal(beaconCalls[0].data, "{\"name\":\"testEvent1\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}\n{\"name\":\"testEvent2\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}\n{\"name\":\"testEvent3\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); QUnit.assert.equal(testBatch.events()[0].sendAttempt, 1); QUnit.assert.notEqual(beaconCalls[1].url, ""); QUnit.assert.equal(beaconCalls[1].data, "{\"name\":\"testEvent1\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); QUnit.assert.notEqual(beaconCalls[2].url, ""); QUnit.assert.equal(beaconCalls[2].data, "{\"name\":\"testEvent2\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); QUnit.assert.notEqual(beaconCalls[3].url, ""); QUnit.assert.equal(beaconCalls[3].data, "{\"name\":\"testEvent3\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); } }); } this.testCase({ name: "w parameter", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { oncomplete(200, null); } }; var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); let xhrOverrideSpy = this.sandbox.spy(xhrOverride, "sendPOST"); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); this.core.getWParam = () => { return 0; } manager.sendSynchronousBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.equal(xhrOverrideSpy.called, true); var overrideArgs = xhrOverrideSpy.getCall(0).args; QUnit.assert.ok(overrideArgs[0].urlString.indexOf("w=0") > -1); // w parameter is updated correctly this.core.getWParam = () => { return 2; } manager.sendSynchronousBatch(EventBatch.create("testToken", [this._createEvent()])); overrideArgs = xhrOverrideSpy.getCall(1).args; QUnit.assert.ok(overrideArgs[0].urlString.indexOf("w=2") > -1); } }); this.testCase({ name: "MSFPC test", useFakeTimers: true, test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { oncomplete(200, null); } }; var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); let xhrOverrideSpy = this.sandbox.spy(xhrOverride, "sendPOST"); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); var testEvent = { name: "testEvent", ext: {} }; testEvent.ext["intweb"] = {}; testEvent.ext["intweb"]["msfpc"] = "testMSFPC"; manager.sendSynchronousBatch(EventBatch.create("testToken", [testEvent])); QUnit.assert.equal(xhrOverrideSpy.called, true); var overrideArgs = xhrOverrideSpy.getCall(0).args; QUnit.assert.ok(overrideArgs[0].urlString.indexOf("ext.intweb.msfpc") > -1); // MSFPC not added in query string if not available in the event manager.sendSynchronousBatch(EventBatch.create("testToken", [this._createEvent()])); overrideArgs = xhrOverrideSpy.getCall(1).args; QUnit.assert.ok(overrideArgs[0].urlString.indexOf("ext.intweb.msfpc") === -1); } }); this.testCase({ name: "retry not synchronous event", test: () => { var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { //Error code oncomplete(299, null); } }; var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); this.xhrOverrideSpy = this.sandbox.spy(xhrOverride, "sendPOST"); this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); manager.sendQueuedRequests(); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { if (!this.xhrOverrideSpy.called || this.xhrOverrideSpy.callCount < 2) { // Wait for the expectations to be met return false; } QUnit.assert.equal(this.xhrOverrideSpy.called, true); QUnit.assert.equal(this.xhrOverrideSpy.callCount, 2); var secondEventArg = this.xhrOverrideSpy.getCall(1).args[0].urlString; QUnit.assert.notEqual(secondEventArg, null); return true; }, "Wait for events to send ", 10)); } }); if (!this.isEmulatingIe) { this.testCase({ name: "sendQueuedRequests with beacons once unload is detected", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); manager.setUnloading(true); QUnit.assert.ok(manager["_getDbgPlgTargets"]()[0], "Make sure that there is a transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Xhr, "Make sure that the transport type is Xhr"); manager.addBatch(testBatch); manager.sendQueuedRequests(); QUnit.assert.equal(fetchCalls.length, 0); QUnit.assert.equal(beaconCalls.length, 1); QUnit.assert.equal(this._requeueEvents.length, 0); QUnit.assert.notEqual(beaconCalls[0].url, ""); QUnit.assert.ok(beaconCalls[0].url.indexOf("NoResponseBody=") !== -1, "Make sure NoResponseBody was requested") QUnit.assert.equal(beaconCalls[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); QUnit.assert.equal(testBatch.events()[0].sendAttempt, 1); } }); this.testCase({ name: "sendQueuedRequests with beacons and splitting once unload is detected", useFakeTimers: true, test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); if (beaconCalls.length === 1) { // fail the first request so it gets split and resent return false; } return true; }); var fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); let testBatch = EventBatch.create("testToken", [this._createEvent("testEvent1"), this._createEvent("testEvent2"), this._createEvent("testEvent3")]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); // Simulate sending with beacons manager.setUnloading(true); QUnit.assert.ok(manager["_getDbgPlgTargets"]()[0], "Make sure that there is a transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Xhr, "Make sure that the transport type is Xhr"); manager.addBatch(testBatch); manager.sendQueuedRequests(); QUnit.assert.equal(fetchCalls.length, 0); QUnit.assert.equal(beaconCalls.length, 4); QUnit.assert.equal(this._requeueEvents.length, 0); QUnit.assert.notEqual(beaconCalls[0].url, ""); QUnit.assert.ok(beaconCalls[0].url.indexOf("NoResponseBody=") !== -1, "Make sure NoResponseBody was requested") QUnit.assert.equal(beaconCalls[0].data, "{\"name\":\"testEvent1\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}\n{\"name\":\"testEvent2\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}\n{\"name\":\"testEvent3\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); QUnit.assert.equal(testBatch.events()[0].sendAttempt, 1); QUnit.assert.notEqual(beaconCalls[1].url, ""); QUnit.assert.ok(beaconCalls[1].url.indexOf("NoResponseBody=") !== -1, "Make sure NoResponseBody was requested") QUnit.assert.equal(beaconCalls[1].data, "{\"name\":\"testEvent1\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); QUnit.assert.notEqual(beaconCalls[2].url, ""); QUnit.assert.ok(beaconCalls[2].url.indexOf("NoResponseBody=") !== -1, "Make sure NoResponseBody was requested") QUnit.assert.equal(beaconCalls[2].data, "{\"name\":\"testEvent2\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); QUnit.assert.notEqual(beaconCalls[3].url, ""); QUnit.assert.ok(beaconCalls[3].url.indexOf("NoResponseBody=") !== -1, "Make sure NoResponseBody was requested") QUnit.assert.equal(beaconCalls[3].data, "{\"name\":\"testEvent3\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); } }); } this.testCase({ name: "Validate that override and preprocessor receives timeout and disableXhr config settings with defaults", useFakeTimers: true, test: () => { let sentPayloadData = []; var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { sentPayloadData.push({ payload, sync }); oncomplete(200, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const hookSpy = this.sandbox.spy(_sendHook); this.core.config.extensionConfig![this.postManager.identifier].payloadPreprocessor = hookSpy; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); QUnit.assert.equal(this._sendEvents.length, 0, "No batches sent yet"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); manager.sendSynchronousBatch(testBatch); // Notifications are sent asynchronously QUnit.assert.equal(this._sendEvents.length, 1, "batches sent"); QUnit.assert.equal(this._sentEvents.length, 1, "batches Completed"); QUnit.assert.equal(this._hookCalls.length, 1, "Hook data got the payload"); QUnit.assert.equal(this._hookCalls[0].payload.timeout, undefined, "Timeout was undefined"); QUnit.assert.equal(this._hookCalls[0].payload.disableXhrSync, false, "disable XHRSync was false"); QUnit.assert.equal(this._hookCalls[0].payload.disableFetchKeepAlive, false, "disable fetch keep alive was false"); QUnit.assert.equal(sentPayloadData.length, 1, "Sent payload data got the payload"); QUnit.assert.equal(sentPayloadData[0].sync, true, "This should have been a synchronous request"); QUnit.assert.equal(sentPayloadData[0].payload.timeout, undefined, "Timeout was undefined"); QUnit.assert.equal(sentPayloadData[0].payload.disableXhrSync, false, "disable XHRSync was false"); QUnit.assert.equal(this._hookCalls[0].payload.disableFetchKeepAlive, false, "disable fetch keep alive was false"); } }); this.testCase({ name: "Validate that override and preprocessor receives timeout and disableXhr config settings with not disabled", useFakeTimers: true, test: () => { let sentPayloadData = []; var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { sentPayloadData.push({ payload, sync }); oncomplete(200, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const hookSpy = this.sandbox.spy(_sendHook); this.core.config.extensionConfig![this.postManager.identifier].payloadPreprocessor = hookSpy; this.core.config.extensionConfig![this.postManager.identifier].disableXhrSync = false; this.core.config.extensionConfig![this.postManager.identifier].xhrTimeout = 1000; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); QUnit.assert.equal(this._hookCalls.length, 0, "Nothing should be sent yet"); manager.sendSynchronousBatch(testBatch); QUnit.assert.equal(this._hookCalls.length, 1, "Hook data got the payload"); QUnit.assert.equal(this._hookCalls[0].payload.timeout, 1000, "Timeout was undefined"); QUnit.assert.equal(this._hookCalls[0].payload.disableXhrSync, false, "disable XHRSync was undefined"); QUnit.assert.equal(sentPayloadData.length, 1, "Sent payload data got the payload"); QUnit.assert.equal(sentPayloadData[0].sync, true, "Should have been a synchronous request"); QUnit.assert.equal(sentPayloadData[0].payload.timeout, 1000, "Timeout was undefined"); QUnit.assert.equal(sentPayloadData[0].payload.disableXhrSync, false, "disable XHRSync was undefined"); } }); this.testCase({ name: "Validate that override and preprocessor receives timeout and disableXhr config settings with not disabled", useFakeTimers: true, test: () => { let sentPayloadData = []; var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { sentPayloadData.push({ payload, sync }); oncomplete(200, null); } }; let testBatch = EventBatch.create("testToken", [this._createEvent()]); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const hookSpy = this.sandbox.spy(_sendHook); this.core.config.extensionConfig![this.postManager.identifier].payloadPreprocessor = hookSpy; this.core.config.extensionConfig![this.postManager.identifier].disableXhrSync = true; this.core.config.extensionConfig![this.postManager.identifier].xhrTimeout = 2000; this.core.config.extensionConfig![this.postManager.identifier].httpXHROverride = xhrOverride; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0], xhrOverride, "Make sure that the override is used as the internal transport"); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, undefined, "Make sure that no transport value is defined"); QUnit.assert.equal(this._hookCalls.length, 0, "Nothing should be called yet"); manager.sendSynchronousBatch(testBatch); QUnit.assert.equal(this._hookCalls.length, 1, "Hook data got the payload"); QUnit.assert.equal(this._hookCalls[0].payload.timeout, 2000, "Timeout was undefined"); QUnit.assert.equal(this._hookCalls[0].payload.disableXhrSync, true, "disable XHRSync was undefined"); QUnit.assert.equal(sentPayloadData.length, 1, "Sent payload data got the payload"); QUnit.assert.equal(sentPayloadData[0].sync, true, "Should have been a synchronous request"); QUnit.assert.equal(sentPayloadData[0].payload.timeout, 2000, "Timeout was undefined"); QUnit.assert.equal(sentPayloadData[0].payload.disableXhrSync, true, "disable XHRSync was undefined"); } }); this.testCase({ name: "Validate timeout with Xhr", useFakeTimers: true, test: () => { var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); this.core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; this.core.config.extensionConfig![this.postManager.identifier].xhrTimeout = 500; this.core.config.endpointUrl = "testEndpoint"; manager.initialize(this.core.config, this.core, this.postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Xhr, "Make sure that XHR was actually selected as the transport"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.notCalled); // precondition QUnit.assert.equal(this._requeueEvents.length, 0, "No batches requeued"); QUnit.assert.equal(this._sendEvents.length, 0, "No batches sent yet"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); manager.sendQueuedRequests(EventSendType.Batched); this.clock.tick(100); QUnit.assert.equal(this._sendEvents.length, 1, "A batch has been sent"); QUnit.assert.equal(this._requeueEvents.length, 0, "No batches requeued"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(!cbSpy.args[0][2], "listener should have been told its not a sync request"); QUnit.assert.ok(!cbSpy.args[0][3], "listener should have been told its not a beacon request"); /// Move forward to trigger the "timeout" and notifications this.clock.tick(400); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.equal(this._requeueEvents.length, 0, "No batches requeued"); QUnit.assert.equal(this._sendEvents.length, 1, "A batch has been sent"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); let retryAttempt = 0; /// Trigger the retry as it's random we need to loop while (retryAttempt< 4000 && this._requeueEvents.length < 2) { this.clock.tick(100); retryAttempt += 1; } QUnit.assert.equal(cbSpy.callCount, 2, "listener should be called when the manager makes an HTTP request"); QUnit.assert.equal(this._sendEvents.length, 2, "A batch has been sent twice (initial and retry)"); QUnit.assert.equal(this._requeueEvents.length, 1, "After the retry the events where requeued"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "Events where not dropped"); } }); if (!this.isEmulatingIe) { this.testCase({ name: "Validate timeout with fetch", useFakeTimers: true, test: () => { var fetchCalls = this.hookFetch((_resolve) => { // Do nothing to simulate no response }); let channelConfig: IChannelConfiguration = { transports: TransportType.Fetch, xhrTimeout: 500 }; let core = new AppInsightsExtCore(); var config: IExtendedConfiguration = { instrumentationKey: "", extensionConfig: { "PostChannel": channelConfig } }; let postManager = new PostChannel(); core.initialize(config, [postManager]); this.onDone(() => { core.unload(false); }); var manager: HttpManager = new HttpManager(500, 2, 1, { requeue: _requeueNotification, send: _sendNotification, sent: _sentNotification, drop: _dropNotification }); const cbSpy = this.sandbox.spy(); core.config.extensionConfig![this.postManager.identifier].payloadListener = cbSpy; core.config.endpointUrl = "testEndpoint"; manager.initialize(core.config, core, postManager); QUnit.assert.equal(manager["_getDbgPlgTargets"]()[0]._transport, TransportType.Fetch, "Make sure that fetch was actually selected as the transport"); manager.addBatch(EventBatch.create("testToken", [this._createEvent()])); QUnit.assert.ok(cbSpy.notCalled); // precondition QUnit.assert.equal(this._requeueEvents.length, 0, "No batches requeued"); QUnit.assert.equal(this._sendEvents.length, 0, "No batches sent yet"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); manager.sendQueuedRequests(EventSendType.Batched); this.clock.tick(100); QUnit.assert.equal(this._sendEvents.length, 1, "One send attempt sent"); QUnit.assert.equal(this._requeueEvents.length, 0, "No batches requeued"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); QUnit.assert.ok(cbSpy.calledOnce, "listener should be called when the manager makes an HTTP request"); QUnit.assert.ok(!cbSpy.args[0][2], "listener should have been told its not a sync request"); QUnit.assert.ok(!cbSpy.args[0][3], "listener should have been told its not a beacon request"); QUnit.assert.equal(fetchCalls.length, 1, "Make sure fetch was called"); let retryAttempt = 0; /// Trigger the retry as it's random we need to loop while (retryAttempt < 4000 && cbSpy.callCount === 1) { this.clock.tick(100); retryAttempt += 1; } QUnit.assert.equal(cbSpy.callCount, 2, "listener should be called when the manager makes an HTTP request"); QUnit.assert.equal(this._sendEvents.length, 2, "A batch has been sent"); QUnit.assert.equal(this._requeueEvents.length, 0, "Batche was requeued"); QUnit.assert.equal(this._sentEvents.length, 0, "No batches Completed yet"); QUnit.assert.equal(this._dropEvents.length, 0, "No batches have been dropped"); QUnit.assert.equal(fetchCalls.length, 2, "Make sure fetch was called"); } }); this.testCase({ name: "HttpManager: RetryPolicy works as expected", useFakeTimers: true, test: () => { // according to the one collector policy // status that should retry : 429, 500, 503 // status that should not retry : 204 (will return complete before checking retry in httpManager), 400, 401, 403, 408, 415, 501, 505 QUnit.assert.equal(true, retryPolicyShouldRetryForStatus(429), "status code 429 should retry"); QUnit.assert.equal(true, retryPolicyShouldRetryForStatus(500), "status code 500 should retry"); QUnit.assert.equal(true, retryPolicyShouldRetryForStatus(503), "status code 503 should retry"); QUnit.assert.equal(false, retryPolicyShouldRetryForStatus(400), "status code 400 should not retry"); QUnit.assert.equal(false, retryPolicyShouldRetryForStatus(401), "status code 401 should not retry"); QUnit.assert.equal(false, retryPolicyShouldRetryForStatus(403), "status code 403 should not retry"); QUnit.assert.equal(false, retryPolicyShouldRetryForStatus(408), "status code 408 should not retry"); QUnit.assert.equal(false, retryPolicyShouldRetryForStatus(415), "status code 415 should not retry"); QUnit.assert.equal(false, retryPolicyShouldRetryForStatus(501), "status code 501 should not retry"); QUnit.assert.equal(false, retryPolicyShouldRetryForStatus(505), "status code 505 should not retry"); } }); } } private _createEvent(name = "testEvent") { var testEvent: IPostTransmissionTelemetryItem = { sendAttempt: 0, name: name }; return testEvent; } } class TestLocalStorageChannel extends BaseTelemetryPlugin implements IPlugin { processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext | undefined): void { throw new Error("Method not implemented."); } public identifier: string = "LocalStorage"; } ================================================ FILE: channels/1ds-post-js/test/Unit/src/KillSwitchTest.ts ================================================ import { AITestClass } from "@microsoft/ai-test-framework"; import { IKillSwitch, createKillSwitch } from '../../../src/KillSwitch'; export class KillSwitchTest extends AITestClass { public testInitialize() { } public registerTests() { this.testCase({ name: 'check basic kill switch', test: () => { let killSwitch = createKillSwitch(); QUnit.assert.equal(killSwitch.isTenantKilled("test-tenant"), false, "tenant should not be listed"); let theRequest = killSwitch.setKillSwitchTenants("tenant1", "1000"); QUnit.assert.equal(theRequest.length, 0); QUnit.assert.equal(killSwitch.isTenantKilled("test-tenant"), false, "tenant should not be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant1"), true, "tenant1 should be listed"); theRequest = killSwitch.setKillSwitchTenants("tenant2", "1000"); QUnit.assert.equal(theRequest.length, 0); QUnit.assert.equal(killSwitch.isTenantKilled("test-tenant"), false, "tenant should not be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant1"), true, "tenant1 should be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant2"), true, "tenant2 should be listed"); } }); this.testCase({ name: 'check basic kill switch with expiry', useFakeTimers: true, test: () => { let killSwitch = createKillSwitch(); let theRequest = killSwitch.setKillSwitchTenants("tenant1", "1"); QUnit.assert.equal(theRequest.length, 0); QUnit.assert.equal(killSwitch.isTenantKilled("tenant1"), true, "tenant1 should be listed"); theRequest = killSwitch.setKillSwitchTenants("tenant2", "2"); QUnit.assert.equal(theRequest.length, 0); this.clock.tick(999); QUnit.assert.equal(killSwitch.isTenantKilled("tenant1"), true, "tenant1 should be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant2"), true, "tenant2 should be listed"); this.clock.tick(1); QUnit.assert.equal(killSwitch.isTenantKilled("tenant1"), false, "tenant1 should be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant2"), true, "tenant2 should be listed"); this.clock.tick(1000); QUnit.assert.equal(killSwitch.isTenantKilled("tenant1"), false, "tenant1 should be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant2"), false, "tenant2 should be listed"); } }); this.testCase({ name: 'check kill switch for this request only', test: () => { let killSwitch = createKillSwitch(); QUnit.assert.equal(killSwitch.isTenantKilled("test-tenant"), false, "tenant should not be listed"); let theRequest = killSwitch.setKillSwitchTenants("tenant1", "this-request-only"); QUnit.assert.equal(theRequest.length, 1); QUnit.assert.equal(theRequest[0], "tenant1"); QUnit.assert.equal(killSwitch.isTenantKilled("test-tenant"), false, "tenant should not be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant1"), false, "tenant should not be listed"); } }); this.testCase({ name: 'check multiple tenants kill switch', test: () => { let killSwitch = createKillSwitch(); QUnit.assert.equal(killSwitch.isTenantKilled("test-tenant"), false, "tenant should not be listed"); let theRequest = killSwitch.setKillSwitchTenants("tenant1,tenant2", "1000"); QUnit.assert.equal(theRequest.length, 0); QUnit.assert.equal(killSwitch.isTenantKilled("test-tenant"), false, "tenant should not be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant1"), true, "tenant1 should be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant2"), true, "tenant2 should be listed"); } }); this.testCase({ name: 'check multiple tenants kill switch with expiry', useFakeTimers: true, test: () => { let killSwitch = createKillSwitch(); let theRequest = killSwitch.setKillSwitchTenants("tenant1,tenant2", "1"); QUnit.assert.equal(theRequest.length, 0); QUnit.assert.equal(killSwitch.isTenantKilled("tenant1"), true, "tenant1 should be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant2"), true, "tenant2 should be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant3"), false, "tenant3 should not be listed"); theRequest = killSwitch.setKillSwitchTenants("tenant3", "3"); QUnit.assert.equal(theRequest.length, 0); this.clock.tick(999); QUnit.assert.equal(killSwitch.isTenantKilled("tenant1"), true, "tenant1 should be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant2"), true, "tenant2 should be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant3"), true, "tenant3 should be listed"); this.clock.tick(1); QUnit.assert.equal(killSwitch.isTenantKilled("tenant1"), false, "tenant1 should not be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant2"), false, "tenant2 should not be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant3"), true, "tenant3 should be listed"); this.clock.tick(2000); QUnit.assert.equal(killSwitch.isTenantKilled("tenant1"), false, "tenant1 should not be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant2"), false, "tenant2 should not be listed"); QUnit.assert.equal(killSwitch.isTenantKilled("tenant3"), false, "tenant3 should not be listed"); } }); this.testCase({ name: 'check whitespace kill switch', test: () => { let killSwitch = createKillSwitch(); let tenant1Checks: string[] = [ "tenant1", "tenant1 ", " tenant1", " tenant1 ", "tenant1\r", "tenant1\n", "tenant1\r\n", "\rtenant1", "\r\ntenant1", "\rtenant1\r\n", "\r\ntenant1\r\n" ]; let tenant2Checks: string[] = [ "tenant2", "tenant2 ", " tenant2", " tenant2 ", "tenant2\r", "tenant2\n", "tenant2\r\n", "\rtenant2", "\r\ntenant2", "\rtenant2\r\n", "\r\ntenant2\r\n" ]; tenant1Checks.forEach((tenant1) => { let killSwitch = createKillSwitch(); let theRequest = killSwitch.setKillSwitchTenants(tenant1, "1000"); QUnit.assert.equal(theRequest.length, 0); tenant2Checks.forEach((tenant2) => { theRequest = killSwitch.setKillSwitchTenants(tenant2, "1000"); QUnit.assert.equal(theRequest.length, 0); tenant1Checks.forEach((value) => { QUnit.assert.equal(killSwitch.isTenantKilled(value), true, "tenant1 should be listed from [" + tenant1 + "] with [" + value + "]"); }); tenant2Checks.forEach((value) => { QUnit.assert.equal(killSwitch.isTenantKilled(value), true, "tenant2 should be listed from [" + tenant2 + "] with [" + value + "]"); }); }); }); } }); this.testCase({ name: 'check whitespace kill switch for this request only', test: () => { let tenant1Values: string[] = [ "tenant1 ", " tenant1", " tenant1 ", "a, tenant1\n,b", "\rtenant1\r", " tenant1\n,", "\n tenant1 ,a" ]; tenant1Values.forEach((value) => { let killSwitch = createKillSwitch(); let theRequest = killSwitch.setKillSwitchTenants(value, "this-request-only"); let found = false; theRequest.forEach((tenant) => { if (tenant === "tenant1") { found = true; } }); QUnit.assert.equal(found, true, "Expected tenant1 in [" + value + "]"); }); } }); } } ================================================ FILE: channels/1ds-post-js/test/Unit/src/PostChannelTest.ts ================================================ import { AITestClass, PollingAssert, TestHelper } from "@microsoft/ai-test-framework"; import { IExtendedConfiguration, EventLatency, ITelemetryItem, IExtendedTelemetryItem, SendRequestReason, EventSendType, isFetchSupported, objKeys, arrForEach, isBeaconsSupported, EventPersistence, isNullOrUndefined, IXHROverride, IPayloadData } from '@microsoft/applicationinsights-core-js'; import { PostChannel } from '../../../src/PostChannel'; import { IPostTransmissionTelemetryItem, IChannelConfiguration } from '../../../src/DataModels'; import { SinonSpy } from 'sinon'; import { createAsyncResolvedPromise } from "@nevware21/ts-async"; import { ActiveStatus, AppInsightsExtCore } from "@microsoft/applicationinsights-core-js"; import { setBypassLazyCache } from "@nevware21/ts-utils"; interface IEventsSendRequests { sendReason: number; isAsync: boolean; } export function generateString(length: number): string { let result: string = ""; for (let i = 0; i < length; ++i) { result += "a"; } return result; } export class PostChannelTest extends AITestClass { private config: IExtendedConfiguration; private postChannel: PostChannel private xhrOverride: IXHROverride; private setTimeoutOverride: Function; private clearTimeoutOverride: Function; private genericSpy: SinonSpy; private core: AppInsightsExtCore; private eventsSent: Array = []; private eventsDiscarded: Array = []; private eventsSendRequests: Array = []; private testMessage: string; private beaconCalls = []; private ctx: any; constructor(name?: string, emulateEs3?: boolean) { super(name, emulateEs3); this.assertNoEvents = true; this.assertNoHooks = true; } public testInitialize() { super.testInitialize(); setBypassLazyCache(true); // Reset the cached isBeacons supported isBeaconsSupported(false); this.core = new AppInsightsExtCore(); this.config = { instrumentationKey: 'testIkey', endpointUrl: 'https://testEndpoint', featureOptIn : {["zipPayload"]: {mode: 1}}, extensionConfig: [] }; this.postChannel = new PostChannel(); this.testMessage = ""; this.eventsSent = []; this.eventsDiscarded = []; this.eventsSendRequests = []; this.xhrOverride = new AutoCompleteXhrOverride(); this.setTimeoutOverride = (handler: Function, timeout?: number) => { this.testMessage = "testSetTimeout"; setTimeout(handler, timeout ? timeout / 2 : timeout); }; this.clearTimeoutOverride = (params: any) => { this.testMessage = "testClearTimeout"; clearTimeout(params); }; this.ctx = {}; } public testFinishedCleanup(): void { if (this.postChannel) { // Stop the post channel from sending any events (after the fake server has been removed) this.postChannel.pause(); } if (this.core && this.core.isInitialized()) { this.core.unload(false); } this.ctx = null; super.testFinishedCleanup(); } public registerTests() { this.testCase({ name: "Override configs", test: () => { this.config.extensionConfig[this.postChannel.identifier] = { overrideInstrumentationKey: "overrideIkey-", overrideEndpointUrl: "overrideEndpoint", httpXHROverride: this.xhrOverride, }; var spy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); this.core.initialize(this.config, [this.postChannel]); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: true }; this.postChannel.processTelemetry(event); QUnit.assert.equal(spy.called, true); QUnit.assert.ok(spy.getCall(0).args[0].urlString.toString().indexOf("overrideEndpoint") > -1); QUnit.assert.equal(spy.getCall(0).args[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:overrideIkey\",\"data\":{\"baseData\":{}}}"); QUnit.assert.equal(isNaN(event.timings.processTelemetryStart["PostChannel"] as number), false); } }); this.testCase({ name: "Override configs at the root level with a post channel configuration", test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.config["overrideInstrumentationKey"] = "overrideIkey-"; this.config["overrideEndpointUrl"] = "overrideEndpoint"; var spy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); this.core.initialize(this.config, [this.postChannel]); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: true }; this.postChannel.processTelemetry(event); QUnit.assert.equal(spy.called, true); QUnit.assert.ok(spy.getCall(0).args[0].urlString.toString().indexOf("overrideEndpoint") > -1); QUnit.assert.equal(spy.getCall(0).args[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:overrideIkey\",\"data\":{\"baseData\":{}}}"); QUnit.assert.equal(isNaN(event.timings.processTelemetryStart["PostChannel"] as number), false); } }); this.testCase({ name: "Post Channel: dynamic config defaults", useFakeTimers: true, test: () => { let config = this.config; let core = this.core; let postChannel = this.postChannel; core.initialize(config, [postChannel]); let identifier = postChannel.identifier; let undefValue: undefined; let expectedConfig : IChannelConfiguration = { eventsLimitInMem: 10000, immediateEventLimit: 500, autoFlushEventsLimit: 0, disableAutoBatchFlushLimit: false, httpXHROverride: undefValue , overrideInstrumentationKey: undefValue, overrideEndpointUrl: undefValue, disableTelemetry: false, ignoreMc1Ms0CookieProcessing: false, setTimeoutOverride: undefValue, clearTimeoutOverride: undefValue, payloadPreprocessor: undefValue, payloadListener: undefValue, disableEventTimings: undefValue, valueSanitizer: undefValue, stringifyObjects: undefValue, enableCompoundKey: undefValue, disableOptimizeObj: false, transports: undefValue, unloadTransports: undefValue, useSendBeacon: undefValue, disableFetchKeepAlive: undefValue, avoidOptions: false, xhrTimeout: undefValue, disableXhrSync: undefValue, alwaysUseXhrOverride: false, fetchCredentials: undefValue, maxEventRetryAttempts: 6, maxUnloadEventRetryAttempts: 2, maxEvtPerBatch: 500, addNoResponse: undefValue, excludeCsMetaData: undefValue, requestLimit: {} }; let actaulConfig = postChannel["_getDbgPlgTargets"]()[1]; QUnit.assert.deepEqual(expectedConfig, actaulConfig, "default config should be set"); // change config with validation core.config.extensionConfig = core.config.extensionConfig || {}; core.config.extensionConfig[identifier].eventsLimitInMem = -1; core.config.extensionConfig[identifier].maxEventRetryAttempts = ""; core.config.extensionConfig[identifier].httpXHROverride = ""; this.clock.tick(1); actaulConfig = postChannel["_getDbgPlgTargets"]()[1]; QUnit.assert.deepEqual(actaulConfig.eventsLimitInMem, 10000, "eventsLimitInMem should not be changed by numbers smaller than 0"); QUnit.assert.deepEqual(actaulConfig.maxEventRetryAttempts, 6, "maxEventRetryAttempt should not be changed by string values"); QUnit.assert.deepEqual(actaulConfig.httpXHROverride, undefined, "xhttpXHROverride should not be changed by string values"); core.config.extensionConfig[identifier].eventsLimitInMem = 100; core.config.extensionConfig[identifier].maxEventRetryAttempts = 10; core.config.extensionConfig[identifier].httpXHROverride = this.xhrOverride; this.clock.tick(1); actaulConfig = postChannel["_getDbgPlgTargets"]()[1]; QUnit.assert.deepEqual(actaulConfig.eventsLimitInMem, 100, "eventsLimitInMem should be changed dynamically"); QUnit.assert.deepEqual(actaulConfig.maxEventRetryAttempts, 10, "maxEventRetryAttempt should should be changed dynamically"); QUnit.assert.deepEqual(actaulConfig.httpXHROverride, this.xhrOverride, "xhrOverride should be changed dynamically"); } }); this.testCase({ name: "Fetch Credentials config default to be null, and support dynamic change", useFakeTimers: true, test: () => { let config = this.config; let core = this.core; let postChannel = this.postChannel; core.initialize(config, [postChannel]); let actaulConfig = postChannel["_getDbgPlgTargets"]()[1]; QUnit.assert.deepEqual(actaulConfig["fetchCredentials"], undefined, "fetchCredentials was undefined if not set"); let httpManager = postChannel["_getDbgPlgTargets"]()[0]; QUnit.assert.deepEqual(httpManager["_getDbgPlgTargets"]()[4].fetchCredentials, undefined, "fetchCredentials was undefined if not set"); if (core.config.extensionConfig){ core.config.extensionConfig[postChannel.identifier].fetchCredentials = "omit"; } this.clock.tick(1); actaulConfig = postChannel["_getDbgPlgTargets"]()[1]; QUnit.assert.deepEqual(actaulConfig["fetchCredentials"], "omit", "post channel fetchCredentials was set to omit"); httpManager = postChannel["_getDbgPlgTargets"]()[0]; console.log("get", JSON.stringify(httpManager["_getDbgPlgTargets"]()[4])); QUnit.assert.deepEqual(httpManager["_getDbgPlgTargets"]()[4].fetchCredentials, "omit", "http manager fetchCredentials was set to omit"); } }); this.testCase({ name: "Post Channel: dynamic config changes", useFakeTimers: true, test: () => { let config = this.config; let core = this.core; let postChannel = this.postChannel; let identifier = postChannel.identifier; let event: IPostTransmissionTelemetryItem = { name: "testEvent", latency: EventLatency.RealTime, iKey: "testIkey" }; core.initialize(config, [postChannel]); // test timeout postChannel.processTelemetry(event); this.clock.tick(1001); QUnit.assert.equal(this.testMessage, "", "should use default test message"); core.config.extensionConfig = core.config.extensionConfig || {}; core.config.extensionConfig[identifier].setTimeoutOverride = this.setTimeoutOverride; this.clock.tick(1); let extConfig = postChannel["_getDbgPlgTargets"]()[1]; QUnit.assert.ok(extConfig.setTimeoutOverride, "setTimeoutOverride config should be changed dynamically"); postChannel.processTelemetry(event); this.clock.tick(501); QUnit.assert.equal(this.testMessage, "testSetTimeout", "setTimeoutOverride should be changed dynamically"); //test ignoreMc1Ms0CookieProcessing let path = core.getWParam(); QUnit.assert.equal(path, 0, "warm path should be default to 0"); core.config.extensionConfig[identifier].ignoreMc1Ms0CookieProcessing = true; this.clock.tick(1); path = core.getWParam(); QUnit.assert.equal(path, 2, "warm path should be updated dynamically"); // test disableTelemetry, overrideInstrumentationKey postChannel.flush(false); let spy = this.sandbox.spy(this.xhrOverride, "sendPOST"); core.config.extensionConfig[identifier].httpXHROverride = this.xhrOverride; core.config.extensionConfig[identifier].overrideInstrumentationKey = "overrideIkey-"; this.clock.tick(1); extConfig = postChannel["_getDbgPlgTargets"]()[1]; QUnit.assert.equal(extConfig.overrideInstrumentationKey, "overrideIkey-", "overrideInstrumentationKey should be changed to true dynamically"); QUnit.assert.ok(extConfig.httpXHROverride, "httpXHROverride should be set"); postChannel.processTelemetry(event); postChannel.flush(false); QUnit.assert.ok(spy.called, "sendPOST should be called"); QUnit.assert.equal(spy.callCount, 1, "sendPOST count should be called once "); QUnit.assert.equal(spy.getCall(0).args[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:overrideIkey\",\"data\":{\"baseData\":{}}}", "data should be set test1"); core.config.extensionConfig[identifier].disableTelemetry = true; this.clock.tick(1); extConfig = postChannel["_getDbgPlgTargets"]()[1]; QUnit.assert.equal(extConfig.disableTelemetry, true, "disableTelemetry should be changed dynamically"); postChannel.processTelemetry(event); postChannel.flush(false); QUnit.assert.equal(spy.callCount, 1, "sendPOST count should be 1 test1"); // test eventsLimitInMem core.config.extensionConfig[identifier].disableTelemetry = false; core.config.extensionConfig[identifier].eventsLimitInMem = 1; this.clock.tick(1); extConfig = postChannel["_getDbgPlgTargets"]()[1]; QUnit.assert.equal(extConfig.disableTelemetry, false, "telemetry should be enabled dynamically"); QUnit.assert.equal(extConfig.eventsLimitInMem, 1, "eventsLimitInMem should be changed dynamically"); postChannel.flush(false); QUnit.assert.equal(spy.callCount, 1, "sendPOST count should be 1"); postChannel.processTelemetry(event); postChannel.processTelemetry(event); postChannel.flush(false); QUnit.assert.equal(spy.callCount, 2, "sendPOST count should be 2"); QUnit.assert.equal(spy.getCall(1).args[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:overrideIkey\",\"data\":{\"baseData\":{}}}", "data should be set test2"); // TODO: NOTE: maxEventRetryAttempts and maxUnloadEventRetryAttempts are not used by httpMgr, http mgr will always use initial values } }); this.testCaseAsync({ name: "zip test: gzip encode is working and content-encode header is set", stepDelay: 10, useFakeTimers: true, useFakeServer: true, steps: [ () => { this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); this.config.featureOptIn = {["zipPayload"]: {mode: 3}}; this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride, }; this.core.initialize(this.config, [this.postChannel]); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(); this.clock.tick(10); }].concat(PollingAssert.createPollingAssert(() => { if (this.genericSpy.called){ let request = this.genericSpy.getCall(0).args[0]; let gzipData = request.data; QUnit.assert.ok(gzipData, "data should be set"); QUnit.assert.equal(true, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should be gzip encoded"); QUnit.assert.equal(request.headers["Content-Encoding"], "gzip", "telemetry should be gzip encoded"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000) as any) }); this.testCaseAsync({ name: "zip is default to be off", stepDelay: 10, useFakeTimers: true, useFakeServer: true, steps: [ () => { this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(); this.clock.tick(10); }].concat(PollingAssert.createPollingAssert(() => { if (this.genericSpy.called){ let request = this.genericSpy.getCall(0).args[0]; QUnit.assert.equal(request.headers["Content-Encoding"], undefined, "header should not be added"); QUnit.assert.ok(JSON.stringify(request.data).includes("testEvent"), "telemetry should not be encoded"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000) as any) }); this.testCaseAsync({ name: "test dynamic zip config", stepDelay: 10, useFakeTimers: true, useFakeServer: true, steps: [ () => { this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(); this.clock.tick(10); this.core.config.featureOptIn = {["zipPayload"]: {mode: 3}}; this.clock.tick(1); this.core.track(event); this.postChannel.flush(); this.clock.tick(10); }].concat(PollingAssert.createPollingAssert(() => { if (this.genericSpy.callCount === 2) { let request = this.genericSpy.getCall(0).args[0]; QUnit.assert.equal(request.headers["Content-Encoding"], undefined, "header should not be added"); QUnit.assert.ok(JSON.stringify(request.data).includes("testEvent"), "telemetry should not be encoded"); let request2 = this.genericSpy.getCall(1).args[0]; QUnit.assert.equal(request2.headers["Content-Encoding"], "gzip", "Telemetry should be gzip encoded after zipPayload is set to true"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000) as any) }); this.testCaseAsync({ name: "Init: init with ikey Promise and endpointUrl Promise", stepDelay: 100, useFakeTimers: true, steps: [() => { let config = this.config; config.initTimeOut = 80000; let ikeyPromise = createAsyncResolvedPromise("testIkey-test"); let urlPromise = createAsyncResolvedPromise("https://testEndpoint"); this.ctx.ikeyPromise = ikeyPromise; this.ctx.urlPromise = urlPromise; config.instrumentationKey = ikeyPromise; config.endpointUrl = urlPromise; let core = this.core; let postChannel = this.postChannel; let identifier = postChannel.identifier; let spy = this.sandbox.spy(this.xhrOverride, "sendPOST"); config.extensionConfig = {[identifier]: {}}; config.extensionConfig[identifier].httpXHROverride = this.xhrOverride; this.ctx.spy = spy; core.initialize(config, [postChannel]); let status = core.activeStatus && core.activeStatus(); QUnit.assert.equal(status, ActiveStatus.PENDING, "status should be set to pending"); let event: IPostTransmissionTelemetryItem = { name: "testEvent", iKey: "testIkey-test", latency: EventLatency.RealTime }; postChannel.processTelemetry(event); }].concat(PollingAssert.createPollingAssert(() => { let core = this.core; let activeStatus = core.activeStatus && core.activeStatus(); let ikeyPromise = this.ctx.ikeyPromise; let urlPromise = this.ctx.urlPromise; let config = this.core.config; let spy = this.ctx.spy; if (ikeyPromise.state === "resolved" && urlPromise.state === "resolved" && activeStatus === ActiveStatus.ACTIVE) { QUnit.assert.equal("testIkey-test", core.config.instrumentationKey, "ikey should be set"); QUnit.assert.equal("https://testEndpoint", core.config.endpointUrl ,"endpoint shoule be set"); let httpManager = this.postChannel["_getDbgPlgTargets"]()[0]; QUnit.assert.ok(httpManager ,"http Manager exists"); let url = httpManager["_getDbgPlgTargets"]()[5]; QUnit.assert.ok(url.indexOf("https://testEndpoint") > -1 ,"http manager endpoint shoule be set"); this.postChannel.flush(false); QUnit.assert.equal(spy.callCount, 1, "sendPOST count should be 1"); QUnit.assert.equal(spy.getCall(0).args[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:testIkey\",\"data\":{\"baseData\":{}}}", "data should be set"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000) as any) }); this.testCase({ name: "Post Channel: Offline Support", useFakeTimers: true, test: () => { let config = this.config; let core = this.core; let postChannel = this.postChannel; let postId = this.postChannel.identifier; config.instrumentationKey = "ikey-123" let event: IPostTransmissionTelemetryItem = { name: "testEvent", iKey: "testIkey-123" }; core.initialize(config, [postChannel]); let offlineSupport = this.postChannel.getOfflineSupport() as any; QUnit.assert.ok(offlineSupport.serialize, "serialize exist"); let eventStr = offlineSupport.serialize(event); let expectedStr = `{"name":"testEvent","iKey":"o:testIkey","data":{"baseData":{}}}`; QUnit.assert.equal(eventStr, expectedStr, "get expected string"); let url = offlineSupport.getUrl(); QUnit.assert.equal(url, "https://testEndpoint?cors=true&content-type=application/x-json-stream&w=0", "get expected url string"); QUnit.assert.ok(offlineSupport.batch, "batch should exit"); let batch = offlineSupport.batch([expectedStr, expectedStr]); QUnit.assert.equal(batch, expectedStr + "\n" + expectedStr, "get expected batch"); QUnit.assert.ok(offlineSupport.shouldProcess, "should process should exit"); QUnit.assert.equal(offlineSupport.shouldProcess(event), true, "should process"); QUnit.assert.ok(offlineSupport.createPayload, "createPayload should exit"); QUnit.assert.equal(offlineSupport.createPayload("test"), null, "createPayload should return null now"); let details = offlineSupport.createOneDSPayload([event]); QUnit.assert.equal(details.urlString, "https://testEndpoint?cors=true&content-type=application/x-json-stream&w=0", "get expected Url"); QUnit.assert.ok(details.headers, "get headers Url"); QUnit.assert.equal(details.data, expectedStr, "get expected data"); this.core.config.extensionConfig = this.core.config.extensionConfig || {}; this.core.config.extensionConfig[postId].disableTelemetry = true; this.clock.tick(1); offlineSupport = this.postChannel.getOfflineSupport() as any; QUnit.assert.equal(offlineSupport.shouldProcess(event), false, "should not process"); } }); this.testCase({ name: "Send Sync Event with Specific type override", test: () => { let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return true; }); var fetchCalls = this.hookFetch((resolve) => { AITestClass.orgSetTimeout(function() { resolve(); }, 0); }); this.config.extensionConfig[this.postChannel.identifier] = { overrideInstrumentationKey: "overrideIkey-", overrideEndpointUrl: "overrideEndpoint", httpXHROverride: this.xhrOverride, }; this.core.initialize(this.config, [this.postChannel]); var spy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent-xhr', sync: EventSendType.Synchronous }; this.postChannel.processTelemetry(event); QUnit.assert.equal(spy.called, true); QUnit.assert.equal(fetchCalls.length, 0); QUnit.assert.equal(beaconCalls.length, 0); QUnit.assert.ok(spy.getCall(0).args[0].urlString.toString().indexOf("overrideEndpoint") > -1); QUnit.assert.equal(spy.getCall(0).args[0].data, "{\"name\":\"testEvent-xhr\",\"iKey\":\"o:overrideIkey\",\"data\":{\"baseData\":{}}}"); QUnit.assert.equal(isNaN(event.timings.processTelemetryStart["PostChannel"] as number), false); var eventFetch: IPostTransmissionTelemetryItem = { name: 'testEvent-beacon', sync: EventSendType.SendBeacon }; this.postChannel.processTelemetry(eventFetch); QUnit.assert.equal(fetchCalls.length, 0); QUnit.assert.equal(beaconCalls.length, 1); QUnit.assert.notEqual(beaconCalls[0].input, ""); QUnit.assert.equal(beaconCalls[0].data, "{\"name\":\"testEvent-beacon\",\"iKey\":\"o:overrideIkey\",\"data\":{\"baseData\":{}}}"); var eventFetch: IPostTransmissionTelemetryItem = { name: 'testEvent-syncFetch', sync: EventSendType.SyncFetch }; this.postChannel.processTelemetry(eventFetch); if (!isFetchSupported(true)) { // Sync fetch is not supported (Firefox) so it should fall back to sendBeacon QUnit.assert.equal(fetchCalls.length, 0); QUnit.assert.equal(beaconCalls.length, 2); QUnit.assert.equal(beaconCalls[1].data, "{\"name\":\"testEvent-syncFetch\",\"iKey\":\"o:overrideIkey\",\"data\":{\"baseData\":{}}}"); } else { QUnit.assert.equal(fetchCalls.length, 1); QUnit.assert.equal(beaconCalls.length, 1); QUnit.assert.notEqual(fetchCalls[0].input, ""); QUnit.assert.equal(fetchCalls[0].init.body, "{\"name\":\"testEvent-syncFetch\",\"iKey\":\"o:overrideIkey\",\"data\":{\"baseData\":{}}}"); } } }); this.testCase({ name: "flush sync with override - Normal", test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); var spy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(false); QUnit.assert.equal(spy.called, true); QUnit.assert.equal(spy.callCount, 1); QUnit.assert.equal(spy.getCall(0).args[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); } }); this.testCase({ name: "flush sync with override - Cost Deferred", test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); var spy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.CostDeferred, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(false); QUnit.assert.equal(spy.called, true); QUnit.assert.equal(spy.callCount, 1); QUnit.assert.equal(spy.getCall(0).args[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); } }); this.testCase({ name: "flush sync with override - Real time", test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); var spy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.RealTime, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(false); QUnit.assert.equal(spy.called, true); QUnit.assert.equal(spy.callCount, 1); QUnit.assert.equal(spy.getCall(0).args[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); } }); this.testCase({ name: "flush sync with override - Direct", test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); var spy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Immediate, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(false); QUnit.assert.equal(spy.called, true); QUnit.assert.equal(spy.callCount, 1); QUnit.assert.equal(spy.getCall(0).args[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); } }); this.testCase({ name: "flush async with override - Normal", useFakeTimers: true, useFakeServer: true, test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(true); // Nothing should have been sent yet QUnit.assert.equal(this.genericSpy.called, false); this.clock.tick(1000); QUnit.assert.equal(this.genericSpy.called, true); QUnit.assert.equal(this.genericSpy.callCount, 1); QUnit.assert.equal(this.genericSpy.getCall(0).args[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); } }); this.testCase({ name: "flush async with override - Cost Deferred", useFakeTimers: true, useFakeServer: true, test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.CostDeferred, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(true); // Nothing should have been sent yet QUnit.assert.equal(this.genericSpy.called, false); this.clock.tick(1000); QUnit.assert.equal(this.genericSpy.called, true); QUnit.assert.equal(this.genericSpy.callCount, 1); QUnit.assert.equal(this.genericSpy.getCall(0).args[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); } }); this.testCase({ name: "flush async with override - Real time", useFakeTimers: true, useFakeServer: true, test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.RealTime, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(true); // Nothing should have been sent yet QUnit.assert.equal(this.genericSpy.called, false); this.clock.tick(1000); QUnit.assert.equal(this.genericSpy.called, true); QUnit.assert.equal(this.genericSpy.callCount, 1); QUnit.assert.equal(this.genericSpy.getCall(0).args[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); } }); this.testCase({ name: "flush async with override - Direct", useFakeTimers: true, useFakeServer: true, test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Immediate, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(true); // Nothing should have been sent yet QUnit.assert.equal(this.genericSpy.called, false); this.clock.tick(1000); QUnit.assert.equal(this.genericSpy.called, true); QUnit.assert.equal(this.genericSpy.callCount, 1); QUnit.assert.equal(this.genericSpy.getCall(0).args[0].data, "{\"name\":\"testEvent\",\"iKey\":\"o:\",\"data\":{\"baseData\":{}}}"); } }); this.testCase({ name: "qspHeaders", test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.config.anonCookieName = "APP_ANON"; this.core.initialize(this.config, [this.postChannel]); var spy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(false); QUnit.assert.equal(spy.called, true); QUnit.assert.ok(spy.getCall(0).args[0].urlString.indexOf('anoncknm=APP_ANON') > -1); } }); this.testCase({ name: "Avoid Headers: default", test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); var spy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(false); QUnit.assert.equal(spy.called, true); QUnit.assert.ok(spy.getCall(0).args[0].headers != null); QUnit.assert.equal(objKeys(spy.getCall(0).args[0].headers).length, 7); } }); this.testCase({ name: "Validate Avoid Headers: Explicitly Enabled (don't add default headers) with no manual headers", test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride, avoidOptions: true }; this.core.initialize(this.config, [this.postChannel]); var spy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(false); QUnit.assert.equal(spy.called, true); QUnit.assert.ok(spy.getCall(0).args[0].headers != null); QUnit.assert.equal(objKeys(spy.getCall(0).args[0].headers).length, 0); } }); this.testCase({ name: "Validate Avoid Headers: Explicitly Disabled (include and use headers)", test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride, avoidOptions: false }; this.core.initialize(this.config, [this.postChannel]); var spy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(false); QUnit.assert.equal(spy.called, true); QUnit.assert.ok(spy.getCall(0).args[0].headers != null); QUnit.assert.equal(objKeys(spy.getCall(0).args[0].headers).length, 7); QUnit.assert.equal(spy.getCall(0).args[0].headers["cache-control"], "no-cache, no-store"); QUnit.assert.equal(spy.getCall(0).args[0].headers["content-type"], "application/x-json-stream"); // Header should be present QUnit.assert.notEqual(spy.getCall(0).args[0].headers["upload-time"], undefined, spy.getCall(0).args[0].headers["upload-time"]); } }); this.testCase({ name: "Validate Avoid Headers: Explicitly Enabled with manual headers (will add the default headers)", test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride, avoidOptions: true // Also means put as much as possible on the query string }; this.core.initialize(this.config, [this.postChannel]); this.postChannel.setMsaAuthTicket("testMSA"); var spy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(false); QUnit.assert.equal(spy.called, true); QUnit.assert.ok(spy.getCall(0).args[0].headers != null); QUnit.assert.equal(objKeys(spy.getCall(0).args[0].headers).length, 3); QUnit.assert.equal(spy.getCall(0).args[0].headers["cache-control"], "no-cache, no-store"); QUnit.assert.equal(spy.getCall(0).args[0].headers["content-type"], "application/x-json-stream"); QUnit.assert.equal(spy.getCall(0).args[0].headers["AuthMsaDeviceTicket"], "testMSA"); // Header should not be present as we should be attempting to avoid an options call QUnit.assert.equal(spy.getCall(0).args[0].headers["upload-time"], undefined, spy.getCall(0).args[0].headers["upload-time"]); } }); this.testCase({ name: "Add MSA Auth ticket in headers", test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); this.postChannel.setMsaAuthTicket("testMSA"); var spy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(false); QUnit.assert.equal(spy.called, true); QUnit.assert.equal(spy.getCall(0).args[0].headers["AuthMsaDeviceTicket"],"testMSA"); } }); this.testCase({ name: "event sent using beacons", useFakeTimers: true, test: () => { this.beaconCalls = []; this.hookSendBeacon((url, body) => { this.beaconCalls.push({ url, body }); return true; }); this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsSent.push(events[i]); } }, eventsDiscarded: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsDiscarded.push(events[i]); } }, }); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); QUnit.assert.equal(this.beaconCalls.length, 0); // teardown should send events synchronously so don't cause any ticks this.postChannel.teardown(); QUnit.assert.equal(this.beaconCalls.length, 1, "There should have been 1 beacon call"); if (this.eventsSent.length === 0) { // The NotificationManger currently always sends the eventsSent() and eventsDiscarded via a timeout, so we need to schedule it // Remove this after 3P Notification manager is fixed this.clock.tick(1); } else { QUnit.assert.ok(false, "Looks like the 3P notification manager is now fixed -- you should now remove this if block test work around"); } QUnit.assert.equal(this.eventsSent.length, 1, "There should have been 1 event"); QUnit.assert.equal(this.eventsDiscarded.length, 0, "No events should have been discarded"); } }); this.testCase({ name: "setTimeout override", useFakeTimers: true, test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride, setTimeoutOverride: this.setTimeoutOverride }; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsSent.push(events[i]); } }, eventsDiscarded: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsDiscarded.push(events[i]); } }, }); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', latency: EventLatency.RealTime, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); // the override halves the timeout value so simulated 500ms should suffice plus 1ms for the event to be sent this.clock.tick(501); QUnit.assert.equal(this.eventsSent.length, 1); QUnit.assert.equal(isNaN(this.eventsSent[0].timings.processTelemetryStart["PostChannel"] as number), false); QUnit.assert.equal(isNaN(this.eventsSent[0].timings.sendEventStart["PostChannel"] as number), false); QUnit.assert.equal(isNaN(this.eventsSent[0].timings.sendEventCompleted["PostChannel"] as number), false); QUnit.assert.equal(isNaN(this.eventsSent[0].timings.serializationStart["PostChannel"] as number), false); QUnit.assert.equal(isNaN(this.eventsSent[0].timings.serializationCompleted["PostChannel"] as number), false); QUnit.assert.equal(this.testMessage, "testSetTimeout"); } }); this.testCaseAsync({ name: "clearTimeout override", stepDelay: 4000, steps: [ () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride, clearTimeoutOverride: this.clearTimeoutOverride, }; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsSent.push(events[i]); } } }); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', latency: EventLatency.RealTime, iKey: 'testIkey' }; this.core.track(event); this.postChannel.flush(false); }] .concat(() => { QUnit.assert.ok(this.eventsSent.length == 1); QUnit.assert.equal(this.testMessage, "testClearTimeout"); }) }); this.testCase({ name: "sendBeacon size limit", useFakeTimers: true, test: () => { this.beaconCalls = []; this.hookSendBeacon((url, body) => { this.beaconCalls.push({ url, body }); return true; }); this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsSent.push(events[i]); } }, eventsDiscarded: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsDiscarded.push(events[i]); } }, }); for (var i = 0; i < 600; i++) { var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey', data: { field: "1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890" } }; this.postChannel.processTelemetry(event); } QUnit.assert.equal(this.beaconCalls.length, 0); // teardown should send events synchronously so don't cause any ticks this.postChannel.teardown(); QUnit.assert.ok(this.beaconCalls.length > 0); if (!(this.eventsSent.length > 400 && this.eventsSent.length < 590)) { // The NotificationManger currently always sends the eventsSent() and eventsDiscarded via a timeout, so we need to schedule it // Remove this after 3P Notification manager is fixed this.clock.tick(10); } else { QUnit.assert.ok(false, "Looks like the 3P notification manager is now fixed -- you should now remove this if block test work around"); } QUnit.assert.equal(this.eventsSent.length, 600, "expected all 600 events have been sent"); QUnit.assert.equal(this.eventsDiscarded.length, 0); QUnit.assert.equal(isNaN(this.eventsSent[0].timings.sendEventStart["PostChannel"]), false); QUnit.assert.equal(isNaN(this.eventsSent[0].timings.sendEventCompleted["PostChannel"]), false); } }); this.testCase({ name: "Ignore MC1 and MS0 cookies", test: () => { this.config.extensionConfig[this.postChannel.identifier] = { ignoreMc1Ms0CookieProcessing: true, }; this.core.initialize(this.config, [this.postChannel]); QUnit.assert.equal(this.core.getWParam(), 2) } }); this.testCase({ name: "Notifications: events send notification on teardown", useFakeTimers: true, useFakeServer: true, test: () => { this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsSent.push(events[i]); } }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { this.eventsSendRequests.push({ sendReason, isAsync }); } }); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.teardown(); QUnit.assert.equal(this.eventsSendRequests.length, 1); QUnit.assert.equal(SendRequestReason.Unload, this.eventsSendRequests[0].sendReason); QUnit.assert.equal(false, this.eventsSendRequests[0].isAsync); if (this.eventsSent.length === 0) { // The NotificationManger currently always sends the eventsSent() and eventsDiscarded via a timeout, so we need to schedule it // Remove this after 3P Notification manager is fixed this.clock.tick(1); } else { QUnit.assert.ok(false, "Looks like the 3P notification manager is now fixed -- you should now remove this if block test work around"); } QUnit.assert.equal(this.eventsSent.length, 1); QUnit.assert.equal(this.eventsDiscarded.length, 0); } }); this.testCaseAsync({ name: "Notifications: events send notification on flush", stepDelay: 10, useFakeTimers: true, useFakeServer: true, steps: [ () => { this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSendRequest: (sendReason: number, isAsync?: boolean) => { this.eventsSendRequests.push({ sendReason, isAsync }); } }); var event: IPostTransmissionTelemetryItem = { name: 'testEvent', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.postChannel.flush(); QUnit.assert.equal(this.eventsSendRequests.length, 0); this.clock.tick(10); QUnit.assert.equal(this.eventsSendRequests.length, 1); QUnit.assert.equal(SendRequestReason.ManualFlush, this.eventsSendRequests[0].sendReason); QUnit.assert.equal(true, this.eventsSendRequests[0].isAsync); }] }); this.testCaseAsync({ name: "Notifications: events send events on auto flush limit exceeded", stepDelay: 10, useFakeTimers: true, useFakeServer: true, steps: [ () => { let extConfig = this.config.extensionConfig[this.postChannel.identifier] || {}; extConfig.autoFlushEventsLimit = 2; this.config.extensionConfig[this.postChannel.identifier] = extConfig; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSendRequest: (sendReason: number, isAsync?: boolean) => { this.eventsSendRequests.push({ sendReason, isAsync }); } }); this.postChannel.processTelemetry({ name: 'testEvent1', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); this.postChannel.processTelemetry({ name: 'testEvent2', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); this.postChannel.processTelemetry({ name: 'testEvent3', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); QUnit.assert.equal(this.eventsSendRequests.length, 0); this.clock.tick(10); QUnit.assert.equal(this.eventsSendRequests.length, 1); QUnit.assert.equal(SendRequestReason.MaxQueuedEvents, this.eventsSendRequests[0].sendReason); QUnit.assert.equal(true, this.eventsSendRequests[0].isAsync); }] }); this.testCaseAsync({ name: "Notifications: events sent when dynamically changing the auto flush limit to a smaller value", stepDelay: 10, useFakeTimers: true, useFakeServer: true, steps: [ () => { let extConfig = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = extConfig; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSendRequest: (sendReason: number, isAsync?: boolean) => { this.eventsSendRequests.push({ sendReason, isAsync }); } }); this.postChannel.processTelemetry({ name: 'testEvent1', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); this.postChannel.processTelemetry({ name: 'testEvent2', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); this.postChannel.processTelemetry({ name: 'testEvent3', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); QUnit.assert.equal(this.eventsSendRequests.length, 0); this.clock.tick(10); QUnit.assert.equal(this.eventsSendRequests.length, 0); this.postChannel.setEventQueueLimits(1000, 2); QUnit.assert.equal(this.eventsSendRequests.length, 0); // Let the async flush occur this.clock.tick(10); QUnit.assert.equal(this.eventsSendRequests.length, 1); QUnit.assert.equal(SendRequestReason.MaxQueuedEvents, this.eventsSendRequests[0].sendReason); QUnit.assert.equal(true, this.eventsSendRequests[0].isAsync); }] }); this.testCaseAsync({ name: "Notifications: events are not sent when dynamically changing the auto flush limit to a larger value", stepDelay: 10, useFakeTimers: true, useFakeServer: true, steps: [ () => { let extConfig = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = extConfig; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSendRequest: (sendReason: number, isAsync?: boolean) => { this.eventsSendRequests.push({ sendReason, isAsync }); } }); this.postChannel.processTelemetry({ name: 'testEvent1', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); this.postChannel.processTelemetry({ name: 'testEvent2', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); this.postChannel.processTelemetry({ name: 'testEvent3', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); QUnit.assert.equal(this.eventsSendRequests.length, 0); this.clock.tick(10); QUnit.assert.equal(this.eventsSendRequests.length, 0); this.postChannel.setEventQueueLimits(1000, 10); QUnit.assert.equal(this.eventsSendRequests.length, 0); // Let the async flush occur for (let lp = 0; lp < 10; lp++) { this.clock.tick(10); QUnit.assert.equal(this.eventsSendRequests.length, 0); } }] }); this.testCaseAsync({ name: "Notifications: events are not sent when dynamically changing the auto flush limit to nothing", stepDelay: 10, useFakeTimers: true, useFakeServer: true, steps: [ () => { let extConfig = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = extConfig; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSendRequest: (sendReason: number, isAsync?: boolean) => { this.eventsSendRequests.push({ sendReason, isAsync }); } }); this.postChannel.processTelemetry({ name: 'testEvent1', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); this.postChannel.processTelemetry({ name: 'testEvent2', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); this.postChannel.processTelemetry({ name: 'testEvent3', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); QUnit.assert.equal(this.eventsSendRequests.length, 0); this.clock.tick(10); QUnit.assert.equal(this.eventsSendRequests.length, 0); this.postChannel.setEventQueueLimits(1000); QUnit.assert.equal(this.eventsSendRequests.length, 0); // Let the async flush occur this.clock.tick(10); QUnit.assert.equal(this.eventsSendRequests.length, 0); }] }); this.testCase({ name: "Notifications: validate discarded events for excessive event using beacons", useFakeTimers: true, test: () => { this.beaconCalls = []; this.hookSendBeacon((url, body) => { this.beaconCalls.push({ url, body }); return true; }); this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsSent.push(events[i]); } }, eventsDiscarded: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsDiscarded.push(events[i]); } }, }); let eventWithVeryLongString: IPostTransmissionTelemetryItem = { iKey: "testIkey", name: "OfficeWAC_JS_1DS_Test_InvalidEvent", data: { StringValue: "Hello World Again", VeryLongString: generateString(64 * 1024) // 64Kb string } }; this.postChannel.processTelemetry(eventWithVeryLongString); QUnit.assert.equal(this.beaconCalls.length, 0); // teardown should send events synchronously so don't cause any ticks this.postChannel.teardown(); QUnit.assert.equal(this.beaconCalls.length, 0, "There should still have been 0 beacon calls"); if (this.eventsDiscarded.length === 0) { // The NotificationManger currently always sends the eventsSent() and eventsDiscarded via a timeout, so we need to schedule it // Remove this after 3P Notification manager is fixed this.clock.tick(1); } else { QUnit.assert.ok(false, "Looks like the 3P notification manager is now fixed -- you should now remove this if block test work around"); } QUnit.assert.equal(this.eventsSent.length, 0, "The event should not have been sent"); QUnit.assert.equal(this.eventsDiscarded.length, 1, "The event should have been discarded"); QUnit.assert.equal(this.eventsDiscarded[0].name, "OfficeWAC_JS_1DS_Test_InvalidEvent"); } }); this.testCase({ name: "Notifications: validate discarded events for excessive event and large (valid) event using beacons", useFakeTimers: true, test: () => { this.beaconCalls = []; this.hookSendBeacon((url, body) => { this.beaconCalls.push({ url, body }); return true; }); this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsSent.push(events[i]); } }, eventsDiscarded: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsDiscarded.push(events[i]); } }, }); this.postChannel.processTelemetry({ iKey: "testIkey", name: "OfficeWAC_JS_1DS_Test_InvalidEvent", data: { StringValue: "Hello World Again", VeryLongString: generateString(64 * 1024) // 64Kb string } }); this.postChannel.processTelemetry({ iKey: "testIkey", name: "OfficeWAC_JS_1DS_Test_ValidEvent", data: { StringValue: "Hello World Again", VeryLongString: generateString(32 * 1024) // 32Kb string } }); QUnit.assert.equal(this.beaconCalls.length, 0); // teardown should send events synchronously so don't cause any ticks this.postChannel.teardown(); QUnit.assert.equal(this.beaconCalls.length, 1, "There should have been 1 beacon calls"); if (this.eventsSent.length === 0) { // The NotificationManger currently always sends the eventsSent() and eventsDiscarded via a timeout, so we need to schedule it // Remove this after 3P Notification manager is fixed this.clock.tick(10); } else { QUnit.assert.ok(false, "Looks like the 3P notification manager is now fixed -- you should now remove this if block test work around"); } QUnit.assert.equal(this.eventsSent.length, 1, "The valid event should have been sent"); QUnit.assert.equal(this.eventsDiscarded.length, 1, "The event should have been discarded"); QUnit.assert.equal(this.eventsSent[0].name, "OfficeWAC_JS_1DS_Test_ValidEvent"); QUnit.assert.equal(this.eventsDiscarded[0].name, "OfficeWAC_JS_1DS_Test_InvalidEvent"); } }); this.testCase({ name: "Notifications: validate discarded events for large (valid) event and then an excessive event using beacons", useFakeTimers: true, test: () => { this.beaconCalls = []; this.hookSendBeacon((url, body) => { this.beaconCalls.push({ url, body }); return true; }); this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsSent.push(events[i]); } }, eventsDiscarded: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsDiscarded.push(events[i]); } }, }); this.postChannel.processTelemetry({ iKey: "testIkey", name: "OfficeWAC_JS_1DS_Test_ValidEvent", data: { StringValue: "Hello World Again", VeryLongString: generateString(60 * 1024) // 60Kb string } }); this.postChannel.processTelemetry({ iKey: "testIkey", name: "OfficeWAC_JS_1DS_Test_InvalidEvent", data: { StringValue: "Hello World Again", VeryLongString: generateString(64 * 1024) // 64Kb string } }); QUnit.assert.equal(this.beaconCalls.length, 0); // teardown should send events synchronously so don't cause any ticks this.postChannel.teardown(); QUnit.assert.equal(this.beaconCalls.length, 1, "There should have been 1 beacon calls"); if (this.eventsSent.length === 0) { // The NotificationManger currently always sends the eventsSent() and eventsDiscarded via a timeout, so we need to schedule it // Remove this after 3P Notification manager is fixed this.clock.tick(10); } else { QUnit.assert.ok(false, "Looks like the 3P notification manager is now fixed -- you should now remove this if block test work around"); } QUnit.assert.equal(this.eventsSent.length, 1, "The valid event should have been sent"); QUnit.assert.equal(this.eventsDiscarded.length, 1, "The event should have been discarded"); QUnit.assert.equal(this.eventsSent[0].name, "OfficeWAC_JS_1DS_Test_ValidEvent"); QUnit.assert.equal(this.eventsDiscarded[0].name, "OfficeWAC_JS_1DS_Test_InvalidEvent"); } }); this.testCase({ name: "Notifications: validate discarded events for excessive event using normal flow", useFakeTimers: true, test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsSent.push(events[i]); } }, eventsDiscarded: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsDiscarded.push(events[i]); } }, }); let eventWithVeryLongString: IPostTransmissionTelemetryItem = { iKey: "testIkey", name: "OfficeWAC_JS_1DS_Test_InvalidEvent", data: { StringValue: "Hello World Again", VeryLongString: generateString(2.5 * 1024 * 1024) // 2.5Mb string } }; this.postChannel.processTelemetry(eventWithVeryLongString); QUnit.assert.equal(this.eventsSent.length, 0); QUnit.assert.equal(this.eventsDiscarded.length, 0); this.postChannel.flush(false); this.clock.tick(100); QUnit.assert.equal(this.eventsSent.length, 0, "The event should not have been sent"); QUnit.assert.equal(this.eventsDiscarded.length, 1, "The event should have been discarded"); QUnit.assert.equal(this.eventsDiscarded[0].name, "OfficeWAC_JS_1DS_Test_InvalidEvent"); } }); this.testCase({ name: "Notifications: validate discarded events for excessive event and a large event using normal flow", useFakeTimers: true, test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsSent.push(events[i]); } }, eventsDiscarded: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsDiscarded.push(events[i]); } }, }); this.postChannel.processTelemetry({ iKey: "testIkey", name: "OfficeWAC_JS_1DS_Test_InvalidEvent", data: { StringValue: "Hello World Again", VeryLongString: generateString(2.5 * 1024 * 1024) // 2.5Mb string } }); this.postChannel.processTelemetry({ iKey: "testIkey", name: "OfficeWAC_JS_1DS_Test_ValidEvent", data: { StringValue: "Hello World Again", VeryLongString: generateString(64 * 1024) // 64Kb string (bigger than the beacon limit, but ok for normal flow) } }); QUnit.assert.equal(this.eventsSent.length, 0); this.postChannel.flush(false); this.clock.tick(100); QUnit.assert.equal(this.eventsSent.length, 1, "The valid event should have been sent"); QUnit.assert.equal(this.eventsDiscarded.length, 1, "The event should have been discarded"); QUnit.assert.equal(this.eventsSent[0].name, "OfficeWAC_JS_1DS_Test_ValidEvent"); QUnit.assert.equal(this.eventsDiscarded[0].name, "OfficeWAC_JS_1DS_Test_InvalidEvent"); } }); this.testCase({ name: "Notifications: validate discarded events for a large event and then an excessive event using normal flow", useFakeTimers: true, test: () => { this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: this.xhrOverride }; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsSent.push(events[i]); } }, eventsDiscarded: (events: IExtendedTelemetryItem[]) => { for (var i = 0; i < events.length; i++) { this.eventsDiscarded.push(events[i]); } }, }); this.postChannel.processTelemetry({ iKey: "testIkey", name: "OfficeWAC_JS_1DS_Test_ValidEvent", data: { StringValue: "Hello World Again", VeryLongString: generateString(64 * 1024) // 64Kb string (bigger than the beacon limit, but ok for normal flow) } }); this.postChannel.processTelemetry({ iKey: "testIkey", name: "OfficeWAC_JS_1DS_Test_InvalidEvent", data: { StringValue: "Hello World Again", VeryLongString: generateString(2.5 * 1024 * 1024) // 2.5Mb string } }); QUnit.assert.equal(this.eventsSent.length, 0); this.postChannel.flush(false); this.clock.tick(100); QUnit.assert.equal(this.eventsSent.length, 1, "The valid event should have been sent"); QUnit.assert.equal(this.eventsDiscarded.length, 1, "The event should have been discarded"); QUnit.assert.equal(this.eventsSent[0].name, "OfficeWAC_JS_1DS_Test_ValidEvent"); QUnit.assert.equal(this.eventsDiscarded[0].name, "OfficeWAC_JS_1DS_Test_InvalidEvent"); } }); this.testCase({ name: "addResponseHandler", useFakeTimers: true, useFakeServer: true, test: () => { let handlerCalled = false; let extConfig = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = extConfig; this.core.initialize(this.config, [this.postChannel]); this.postChannel.addResponseHandler((responseText) => { handlerCalled = true; }); QUnit.assert.ok(!handlerCalled, "Make sure the response handler has not yet been called"); this.postChannel.processTelemetry({ name: 'testEvent1', sync: false, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); this.postChannel.flush(); this.clock.tick(100); QUnit.assert.ok(!handlerCalled, "Make sure the response handler has not yet been called"); this._getXhrRequests().forEach((request) => { if (request.method) { this.sendJsonResponse(request, {}, 200); } }); this.clock.tick(100); QUnit.assert.ok(handlerCalled, "Make sure the response handler is called"); } }); this.testCase({ name: "removeResponseHandler", useFakeTimers: true, useFakeServer: true, test: () => { let handlerCalled = 0; let extConfig = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = extConfig; this.core.initialize(this.config, [this.postChannel]); let removeCall = this.postChannel.addResponseHandler((responseText) => { handlerCalled += 1; }); QUnit.assert.ok(handlerCalled == 0, "Make sure the response handler has not yet been called"); // Send 1600 events and accumulate 1.6 seconds of "time" for (let lp = 0; lp < 1600; lp++) { var event: IPostTransmissionTelemetryItem = { name: 'testEvent-' + lp, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.clock.tick(1); } this.postChannel.flush(); this.clock.tick(400); QUnit.assert.ok(handlerCalled == 0, "Make sure the response handler has not yet been called"); let request = this._getXhrRequests()[0] this.sendJsonResponse(request, {}, 200); this.clock.tick(100); let num = handlerCalled; QUnit.assert.ok(num > 0, "Make sure the response handler is called"); removeCall.rm(); this.postChannel.flush(); this.clock.tick(400); QUnit.assert.ok(num == handlerCalled, "Make sure the response handler has not yet been called again"); request = this._getXhrRequests()[1] this.sendJsonResponse(request, {}, 200); this.clock.tick(100); QUnit.assert.ok(num == handlerCalled, "Make sure the response handler is removed and not being called"); } }); this.testCase({ name: "test request batching and sending", useFakeTimers: true, test: () => { let sentRequests = []; let sentEvents = []; let discardEvents = []; let sendEvents = []; this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { sentRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); } } }; let extConfig = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = extConfig; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentEvents.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardEvents.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendEvents.push({ sendReason: sendReason, isAsync: isAsync }); } }); // Send 1600 events and accumulate 1.6 seconds of "time" for (let lp = 0; lp < 1600; lp++) { var event: IPostTransmissionTelemetryItem = { name: 'testEvent-' + lp, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.clock.tick(1); } // No Events should yet be sent for "normal" events QUnit.assert.equal(sentRequests.length, 0, 'No events should have been triggered yet'); QUnit.assert.equal(sendEvents.length, 0, 'No send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 0, 'No sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // Move timer up to 2 seconds -- triggering the first request this.clock.tick(400); // Clock Skew manager should block any additional requests from being immediately sent QUnit.assert.equal(sentRequests.length, 1, '1 request should have been triggered -- waiting for the kill switch for first response'); QUnit.assert.equal(sendEvents.length, 0, '1 send event should have been sent yet -- they are sent as a async event -- based on the request type'); QUnit.assert.equal(sentEvents.length, 0, 'No sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // Trigger any extra event notifications this.clock.tick(1); QUnit.assert.equal(sendEvents.length, 1, '1 send event should have been sent yet -- they are sent as a async event'); QUnit.assert.equal(sentEvents.length, 0, 'No sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); let data = sentRequests[0].payload.data.split('\n'); QUnit.assert.equal(data.length, 500, 'There should be 500 events'); // process the 1st request as successful, triggering a flushing of 2 additional requests sentRequests[0].oncomplete(200, {}); // No extra events should be triggered yet QUnit.assert.equal(sentRequests.length, 3, '3 request should have been triggered'); QUnit.assert.equal(sendEvents.length, 1, 'One send event should have been sent yet -- as they are sent async'); QUnit.assert.equal(sentEvents.length, 0, 'No sent events should have been sent yet - they are sent async'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // Trigger any extra event notifications this.clock.tick(1); QUnit.assert.equal(sendEvents.length, 3, '3 send events should have been sent yet -- they are sent as a async event'); QUnit.assert.equal(sentEvents.length, 1, '1 sent event should have been sent yet -- they are sent async'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // This should have caused an additional 2 requests to be sent QUnit.assert.equal(sentRequests.length, 3, '3 Events should have been triggered'); QUnit.assert.equal(sendEvents.length, 3, '3 send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 1, 'One sent event should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // process the 3rd request as successful sentRequests[2].oncomplete(200, {}); // This should have caused an additional requests to be sent QUnit.assert.equal(sentRequests.length, 4, '4 Events should have been triggered'); QUnit.assert.equal(sendEvents.length, 3, '3 send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 1, '1 sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // The forth request should have only included the remaining 400 requests data = sentRequests[3].payload.data.split('\n'); QUnit.assert.equal(data.length, 100, 'There should be 100 events'); // Trigger any extra event notifications this.clock.tick(1); QUnit.assert.equal(sentRequests.length, 4, '4 Events should have been triggered'); QUnit.assert.equal(sendEvents.length, 4, '4 send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 2, '2 sent (completed) events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); } }); this.testCase({ name: "test request batching and sending with a direct event after batched events", useFakeTimers: true, test: () => { let sentRequests = []; let sentEvents = []; let discardEvents = []; let sendEvents = []; this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { sentRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); } } }; let extConfig = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = extConfig; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentEvents.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardEvents.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendEvents.push({ sendReason: sendReason, isAsync: isAsync }); } }); // Send 1600 events and accumulate 1.6 seconds of "time" for (let lp = 0; lp < 1600; lp++) { var event: IPostTransmissionTelemetryItem = { name: 'testEvent-' + lp, latency: EventLatency.Normal, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); this.clock.tick(1); } // No Events should yet be sent for "normal" events QUnit.assert.equal(sentRequests.length, 0, 'No events should have been triggered yet'); QUnit.assert.equal(sendEvents.length, 0, 'No send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 0, 'No sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); var event: IPostTransmissionTelemetryItem = { name: 'testEvent-direct0', latency: EventLatency.Immediate, iKey: 'testIkey' }; this.postChannel.processTelemetry(event); // Still No Events should yet be sent for "normal" events QUnit.assert.equal(sentRequests.length, 0, 'No events should have been triggered yet'); QUnit.assert.equal(sendEvents.length, 0, 'No send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 0, 'No sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // Move timer 1ms -- triggering the direct send this.clock.tick(1); // Clock Skew manager should block any additional requests from being immediately sent QUnit.assert.equal(sentRequests.length, 1, '1 request should have been triggered -- waiting for the kill switch for first response'); let data = sentRequests[0].payload.data.split('\n'); QUnit.assert.equal(data.length, 1, 'There should be 1 events'); QUnit.assert.ok(data[0].indexOf("testEvent-direct0") !== -1, "The sent event should be the direct event"); // Move timer 1ms -- triggering the notifications this.clock.tick(1); QUnit.assert.equal(sentRequests.length, 1, '1 request should have been triggered -- waiting for the kill switch for first response'); QUnit.assert.equal(sendEvents.length, 1, '1 send event should have been sent yet -- they are sent as a async event -- based on the request type'); QUnit.assert.equal(sentEvents.length, 0, 'No sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // Move timer up to 2 seconds -- triggering the timeout for normal requests this.clock.tick(399); // Clock Skew manager should block any additional requests from being immediately sent QUnit.assert.equal(sentRequests.length, 1, '1 request should have been triggered -- waiting for the kill switch for first response'); QUnit.assert.equal(sendEvents.length, 1, '1 send event should have been sent yet -- they are sent as a async event -- based on the request type'); QUnit.assert.equal(sentEvents.length, 0, 'No sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // process the 1st request as successful, triggering a flushing of 2 additional requests sentRequests[0].oncomplete(200, {}); QUnit.assert.equal(sentRequests.length, 3, '3 request should have been triggered -- waiting for the kill switch for first response'); QUnit.assert.equal(sendEvents.length, 1, '1 send event should have been sent yet -- they are sent as a async event'); QUnit.assert.equal(sentEvents.length, 0, 'No sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); data = sentRequests[1].payload.data.split('\n'); QUnit.assert.equal(data.length, 500, 'There should be 500 events'); data = sentRequests[2].payload.data.split('\n'); QUnit.assert.equal(data.length, 500, 'There should be 500 events'); // Trigger any extra event notifications and 2nd send this.clock.tick(1); // No extra events should be triggered yet QUnit.assert.equal(sentRequests.length, 3, '3 request should have been triggered'); QUnit.assert.equal(sendEvents.length, 3, 'Three send event should have been sent yet -- as they are sent async'); QUnit.assert.equal(sentEvents.length, 1, 'No sent events should have been sent yet - they are sent async'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // process the 3rd request as successful sentRequests[2].oncomplete(200, {}); // This should have caused an additional request to be sent (Direct + Normal + Normal (complete) + Normal) QUnit.assert.equal(sentRequests.length, 4, '4 Events should have been triggered'); QUnit.assert.equal(sendEvents.length, 3, '3 send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 1, '1 sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // Trigger any extra event notifications and 2nd send this.clock.tick(1); QUnit.assert.equal(sentRequests.length, 4, '4 Events should have been triggered'); QUnit.assert.equal(sendEvents.length, 4, '4 send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 2, '1 sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); data = sentRequests[3].payload.data.split('\n'); QUnit.assert.equal(data.length, 500, 'There should be 500 events'); // process the 3rd request as successful sentRequests[1].oncomplete(200, {}); // This should have caused an additional request to be sent (Direct + Normal (complete) + Normal (complete) + Normal + Normal) QUnit.assert.equal(sentRequests.length, 5, '5 Events should have been triggered'); QUnit.assert.equal(sendEvents.length, 4, '4 send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 2, '1 sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // Trigger any extra event notifications this.clock.tick(1); // This should have caused an additional request to be sent (Direct + Normal (complete) + Normal (complete) + Normal + Normal) QUnit.assert.equal(sentRequests.length, 5, '5 Events should have been triggered'); QUnit.assert.equal(sendEvents.length, 5, '5 send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 3, '3 sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // The forth request should have only included the remaining 400 requests data = sentRequests[4].payload.data.split('\n'); QUnit.assert.equal(data.length, 100, 'There should be 100 events'); // Trigger any extra event notifications this.clock.tick(1); QUnit.assert.equal(sentRequests.length, 5, '5 Events should have been triggered'); QUnit.assert.equal(sendEvents.length, 5, '5 send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 3, '3 sent (completed) events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); } }); this.testCase({ name: "test the default queueSize and discard events with excessive events before the first flush request with no response", useFakeTimers: true, test: () => { let sentRequests = []; let sentEvents = []; let discardEvents = []; let sendEvents = []; this.config.extensionConfig![this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { sentRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); } } }; let extConfig = this.config.extensionConfig![this.postChannel.identifier] || {}; this.config.extensionConfig![this.postChannel.identifier] = extConfig; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentEvents.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardEvents.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendEvents.push({ sendReason: sendReason, isAsync: isAsync }); } }); // Send 11666 events = Queuelimit of 10,000 + auto flush limit 1,667 for (let lp = 0; lp < 11667; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendEvents.length, 0, 'No Send events yet as they are sent async'); QUnit.assert.equal(sentRequests.length, 0, "We haven't actually sent the request yet"); // Include 10 additional events -- triggering 1 discard batch for (let lp = 0; lp < 10; lp++) { this.postChannel.processTelemetry({ name: 'discardTriggerEvent-' + lp, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } // Let the auto flush send event to send this.clock.tick(1); QUnit.assert.equal(sendEvents.length, 1, 'Only 1 request should have been sent because of the kill switch'); QUnit.assert.equal(sentRequests.length, 1, 'Only 1 request should have been sent because of the kill switch'); let data = sentRequests[0].payload.data.split('\n'); QUnit.assert.equal(data.length, 500, 'There should be 500 events'); // Allow the request and event notifications to be sent this.clock.tick(1); QUnit.assert.equal(sendEvents.length, 1, 'Only 1 request should have been sent because of the kill switch'); QUnit.assert.equal(sentRequests.length, 1, 'Only 1 request should have been sent because of the kill switch'); QUnit.assert.equal(discardEvents.length, 1, 'We should have at least 1 discard event'); sentRequests[0].oncomplete(200, {}); this.clock.tick(1); QUnit.assert.equal(sendEvents.length, 3, '3 request should now have been sent'); QUnit.assert.equal(sentRequests.length, 3, '3 request should now have been sent'); QUnit.assert.equal(discardEvents.length, 1, 'We should have at least 1 discard event'); QUnit.assert.equal(discardEvents[0].events.length, 20, 'There should be 20 discarded events'); QUnit.assert.equal(discardEvents[0].events[0].name, 'testEvent-1667', 'The first event discarded should be event 1667 not the extra discarded event'); QUnit.assert.equal(discardEvents[0].events[1].name, 'testEvent-1668', 'The second event discarded should be event 1668 not the extra discarded event'); QUnit.assert.ok(JSON.stringify(discardEvents[0].events).indexOf('discardTriggerEvent-') === -1, 'The discard trigger event should not have been the event discarded'); } }); this.testCase({ name: "test the default queueSize and discard events with excessive events before the first flush request with no response and direct latency", useFakeTimers: true, test: () => { let sentRequests = []; let sentEvents = []; let discardEvents = []; let sendEvents = []; this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { sentRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); } } }; let extConfig = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = extConfig; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentEvents.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardEvents.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendEvents.push({ sendReason: sendReason, isAsync: isAsync }); } }); // Send 100 normal events for (let lp = 0; lp < 100; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } // Send 10 direct events (should not cause any additional normal events to be discarded) // As direct events are not "effectively" batched as part of the normal queuing for (let lp = 0; lp < 10; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-direct-' + lp, latency: EventLatency.Immediate, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } // Send 11566 additional events = Queuelimit of 10,000 + auto flush limit 1,667 for (let lp = 100; lp < 11667; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendEvents.length, 0, 'No Send events yet as they are sent async'); QUnit.assert.equal(sentRequests.length, 0, "We haven't actually sent the request yet"); // Let the direct events to send this.clock.tick(1); QUnit.assert.equal(sendEvents.length, 1, 'Only 1 request should have been sent because of the kill switch'); QUnit.assert.equal(sentRequests.length, 1, 'Only 1 request should have been sent because of the kill switch'); QUnit.assert.equal(discardEvents.length, 0, 'We should have at least 0 discard event'); let data = sentRequests[0].payload.data.split('\n'); QUnit.assert.equal(data.length, 500, 'There should be 500 events -- the 10 direct plus 490 normal events'); QUnit.assert.ok(data[0].indexOf('testEvent-direct-0') !== -1); QUnit.assert.ok(data[9].indexOf('testEvent-direct-9') !== -1); this.postChannel.processTelemetry({ name: 'discardTriggerEvent-0', latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); // Cause the direct send events to process (unblocking normal sending) sentRequests[0].oncomplete(200, {}); data = sentRequests[1].payload.data.split('\n'); QUnit.assert.equal(data.length, 500, 'There should be 500 events'); data = sentRequests[2].payload.data.split('\n'); QUnit.assert.equal(data.length, 500, 'There should be 500 events'); // Allow the request and event notifications to be sent this.clock.tick(1); QUnit.assert.equal(sendEvents.length, 3, 'Only 1 request should have been sent because of the kill switch'); QUnit.assert.equal(sentRequests.length, 3, 'Only 1 request should have been sent because of the kill switch'); QUnit.assert.equal(discardEvents.length, 1, 'We should have at least 1 discard event'); sentRequests[1].oncomplete(200, {}); this.clock.tick(1); QUnit.assert.equal(sendEvents.length, 4, '4 request should now have been sent'); QUnit.assert.equal(sentRequests.length, 4, '4 request should now have been sent'); QUnit.assert.equal(discardEvents.length, 1, 'We should have at least 1 discard event'); QUnit.assert.equal(discardEvents[0].events.length, 20, 'There should be 20 discarded events'); QUnit.assert.equal(discardEvents[0].events[0].name, 'testEvent-1667', 'The first event discarded should be event 1667 not the extra discarded event'); QUnit.assert.equal(discardEvents[0].events[1].name, 'testEvent-1668', 'The second event discarded should be event 1668 not the extra discarded event'); QUnit.assert.ok(JSON.stringify(discardEvents[0].events).indexOf('discardTriggerEvent-0') === -1, 'The discard trigger event should not have been the event discarded'); } }); this.testCase({ name: "test the default queueSize and discard events with excessive events after the first flush request with no response", useFakeTimers: true, test: () => { let sentRequests = []; let sentEvents = []; let discardEvents = []; let sendEvents = []; this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { sentRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); } } }; let extConfig = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = extConfig; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentEvents.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardEvents.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendEvents.push({ sendReason: sendReason, isAsync: isAsync }); } }); // Send 11666 events = Queue limit of 10,000 + auto flush limit 1,667 for (let lp = 0; lp < 11667; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendEvents.length, 0, 'No Send events yet as they are sent async'); QUnit.assert.equal(sentRequests.length, 0, "We haven't actually sent the request yet"); // Let the auto flush queue and send event -- this will also clear the queue from the PostChannel this.clock.tick(1); QUnit.assert.equal(sendEvents.length, 1, 'Only 1 request should have been sent because of the kill switch'); QUnit.assert.equal(sentRequests.length, 1, 'Only 1 request should have been sent because of the kill switch'); let data = sentRequests[0].payload.data.split('\n'); QUnit.assert.equal(data.length, 500, 'There should be 500 events'); // No process the "extra" event (which fails if flush has not occurred) this.postChannel.processTelemetry({ name: 'discardEvent-0', latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); // Allow the request and event notifications to be sent this.clock.tick(1); QUnit.assert.equal(sendEvents.length, 1, 'Only 1 request should have been sent because of the kill switch'); QUnit.assert.equal(sentRequests.length, 1, 'Only 1 request should have been sent because of the kill switch'); QUnit.assert.equal(discardEvents.length, 0, 'Nothing should have been discarded as the events are scheduled to be sent'); sentRequests[0].oncomplete(200, {}); this.clock.tick(1); QUnit.assert.equal(sendEvents.length, 3, '3 request should now have been sent'); QUnit.assert.equal(sentRequests.length, 3, '3 request should now have been sent'); QUnit.assert.equal(discardEvents.length, 0, 'Nothing should have been discarded as the events are scheduled to be sent'); } }); this.testCase({ name: "test mixed event latency batching and sending", useFakeTimers: true, test: () => { let sentRequests = []; let sentEvents = []; let discardEvents = []; let sendEvents = []; this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { sentRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); } } }; let extConfig = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = extConfig; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentEvents.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardEvents.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendEvents.push({ sendReason: sendReason, isAsync: isAsync }); } }); let latencyMap = { [EventLatency.Normal] : [], [EventLatency.RealTime] : [] }; // Send 1600 events and accumulate 1.6 seconds of "time" for (let lp = 0; lp < 1600; lp++) { var event: IPostTransmissionTelemetryItem = { name: 'testEvent-' + lp, latency: lp % 2 ? EventLatency.Normal : EventLatency.RealTime, iKey: 'testIkey' }; latencyMap[event.latency].push(event.name); this.postChannel.processTelemetry(event); this.clock.tick(1); } // No Events should yet be sent for "normal" events, but the "realtime" ones should have been QUnit.assert.equal(sentRequests.length, 1, 'Critical events should have been triggered yet'); QUnit.assert.equal(sendEvents.length, 1, '1 send event should have been sent -- they are sent as a async event'); QUnit.assert.equal(sentEvents.length, 0, 'No sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); let data = sentRequests[0].payload.data.split('\n'); QUnit.assert.equal(data.length, 500, 'There should be 500 events'); let allCritical = true; for (let lp = 0; lp < data.length; lp++) { let evt = JSON.parse(data[lp]); if (latencyMap[EventLatency.RealTime].indexOf(evt.name) === -1) { QUnit.assert.ok(false, "Event does not belong to the RealTime Latency - " + JSON.stringify(evt)); allCritical = false; break; } } QUnit.assert.ok(allCritical, "Not all of the events in batch 1 where realtime events"); // Move timer up to 2 seconds -- triggering the second request which should contain a mixture of events (normal / realtime) this.clock.tick(400); // Clock Skew manager should block any additional requests from being immediately sent QUnit.assert.equal(sentRequests.length, 1, '1 request should have been triggered -- waiting for the kill switch for first response'); QUnit.assert.equal(sendEvents.length, 1, '1 send event should have been sent yet -- they are sent as a async event -- based on the request type'); QUnit.assert.equal(sentEvents.length, 0, 'No sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // Trigger any extra event notifications this.clock.tick(1); QUnit.assert.equal(sentRequests.length, 1, '1 request should have been triggered -- waiting for the kill switch for first response'); QUnit.assert.equal(sentEvents.length, 0, 'No sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // process the 1st request as successful, triggering a flushing of 2 additional requests sentRequests[0].oncomplete(200, {}); // No extra events should be triggered yet QUnit.assert.equal(sentRequests.length, 3, '3 request should have been triggered'); QUnit.assert.equal(sendEvents.length, 1, 'One send event should have been sent yet -- as they are sent async'); QUnit.assert.equal(sentEvents.length, 0, 'No sent events should have been sent yet - they are sent async'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); data = sentRequests[1].payload.data.split('\n'); QUnit.assert.equal(data.length, 500, 'Second batch should also contain 500 events'); let hasCritical = false; let hasNormal = false; arrForEach(data, (evtData: string) => { let evt = JSON.parse(evtData); hasNormal = hasNormal || latencyMap[EventLatency.Normal].indexOf(evt.name) !== -1; hasCritical = hasCritical || latencyMap[EventLatency.RealTime].indexOf(evt.name) !== -1; }); QUnit.assert.ok(hasCritical, "Batch must contain realtime events - " + JSON.stringify(data)); QUnit.assert.ok(hasNormal, "Batch must contain normal events - " + JSON.stringify(data)); // Trigger any extra event notifications this.clock.tick(1); QUnit.assert.equal(sendEvents.length, 3, '3 send events should have been sent yet -- they are sent as a async event'); QUnit.assert.equal(sentEvents.length, 1, '1 sent event should have been sent yet -- they are sent async'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // This should have caused an additional 2 requests to be sent QUnit.assert.equal(sentRequests.length, 3, '3 Events should have been triggered'); QUnit.assert.equal(sendEvents.length, 3, '3 send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 1, 'One sent event should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // process the 3rd request as successful sentRequests[2].oncomplete(200, {}); // This should have caused an additional requests to be sent QUnit.assert.equal(sentRequests.length, 4, '4 Events should have been triggered'); QUnit.assert.equal(sendEvents.length, 3, '3 send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 1, '1 sent events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); // The forth request should have only included the remaining 400 requests data = sentRequests[3].payload.data.split('\n'); QUnit.assert.equal(data.length, 100, 'There should be 100 events'); hasCritical = false; hasNormal = false; arrForEach(data, (evtData: string) => { let evt = JSON.parse(evtData); hasNormal = hasNormal || latencyMap[EventLatency.Normal].indexOf(evt.name) !== -1; hasCritical = hasCritical || latencyMap[EventLatency.RealTime].indexOf(evt.name) !== -1; }); QUnit.assert.ok(!hasCritical, "All critical events should have been sent in the first 2 batches - " + JSON.stringify(data)); QUnit.assert.ok(hasNormal, "Batch must contain normal events - " + JSON.stringify(data)); // Trigger any extra event notifications this.clock.tick(1); QUnit.assert.equal(sentRequests.length, 4, '4 Events should have been triggered'); QUnit.assert.equal(sendEvents.length, 4, '4 send events should have been sent yet'); QUnit.assert.equal(sentEvents.length, 2, '2 sent (completed) events should have been sent yet'); QUnit.assert.equal(discardEvents.length, 0, 'No discard events should have been sent yet'); } }); this.testCase({ name: "test the queue counts are reset when events can't be dropped", useFakeTimers: true, test: () => { let sentRequests = []; let sentEvents = []; let discardEvents = []; let sendEvents = []; this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { sentRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); } } }; let extConfig = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = extConfig; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentEvents.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardEvents.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendEvents.push({ sendReason: sendReason, isAsync: isAsync }); } }); // Send 11666 events = Queuelimit of 10,000 + auto flush limit 1,667 for (let lp = 0; lp < 11667; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.RealTime, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendEvents.length, 0, 'No Send events yet as they are sent async'); QUnit.assert.equal(sentRequests.length, 0, "We haven't actually sent the request yet"); // Attempt to add a normal event that should get discarded this.postChannel.processTelemetry({ name: 'discardTriggerEvent-0', latency: EventLatency.Normal, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); // Let the auto flush send event to send this.clock.tick(1); QUnit.assert.equal(sendEvents.length, 1, 'Only 1 request should have been sent because of the kill switch'); QUnit.assert.equal(sentRequests.length, 1, 'Only 1 request should have been sent because of the kill switch'); QUnit.assert.equal(discardEvents.length, 1, 'We should have at least 1 discard event'); QUnit.assert.equal(discardEvents[0].events.length, 1, 'There should be 1 discarded event'); QUnit.assert.equal(discardEvents[0].events[0].name, 'discardTriggerEvent-0', 'The first event discarded should be event discardTriggerEvent-0'); } }); this.testCase({ name: "Validate unload scenario with zero response code and requeuing during beforeunload/unload - default", useFakeTimers: true, test: () => { let sentNotifications = []; let discardNotifications = []; let sendNotifications = []; let xhrRequests = []; let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve, reject) => { setTimeout(function() { reject(); }, 0); }); this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { xhrRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); // Return on error immediately to simulate a synchronous failure oncomplete(0, {}); } } }; let channelConfig: IChannelConfiguration = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = channelConfig; // Always use the XHR Override so that we can correct simulate a zero response channelConfig.alwaysUseXhrOverride = true; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentNotifications.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardNotifications.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason: sendReason, isAsync: isAsync }); } }); for (let lp = 0; lp < 50; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.RealTime, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendNotifications.length, 0, 'No Send events yet as they are sent'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 0, "We haven't actually sent the request yet"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); // Simulate an beforeunload event which will cause the event to get re-queued document.dispatchEvent(new Event("beforeunload")); QUnit.assert.equal(sendNotifications.length, 1, 'We should now have attempted to send the events'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 1, "Only 1 requests should be sent"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); // Let the auto flush send event to send this.clock.tick(1); QUnit.assert.equal(sendNotifications.length, 1, '1 requests should have been sent because of requeue and sync resend'); QUnit.assert.equal(xhrRequests.length, 1, '1 request should have been sent because of requeue and sync resend'); QUnit.assert.equal(discardNotifications.length, 0, 'We should have at least no discard events'); // Simulate an unload event which will cause the event triggering the internal unload logic document.dispatchEvent(new Event("unload")); QUnit.assert.equal(sendNotifications.length, 2, 'We should now have attempted to send the events'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 2, "2 requests should be sent"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); QUnit.assert.equal(discardNotifications.length, 0, 'There should no discarded events yet!'); // Discard events are always executed on the next cycle this.clock.tick(1); QUnit.assert.equal(discardNotifications.length, 1, 'There should be 1 batch of events should have been discarded'); QUnit.assert.equal(discardNotifications[0].events.length, 50, 'There should be 50 discarded event'); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', 'The first event discarded should be event testEvent-0'); // Lets tick over some time to see if anything else happens this.clock.tick(10000); QUnit.assert.equal(sendNotifications.length, 2, '2 requests should have been sent because of requeue and sync resend'); QUnit.assert.equal(xhrRequests.length, 2, '2 requests should have been sent because of requeue and sync resend'); QUnit.assert.equal(discardNotifications.length, 1, 'There should be 1 batch of events should have been discarded'); QUnit.assert.equal(discardNotifications[0].events.length, 50, 'There should be 50 discarded event'); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', 'The first event discarded should be event testEvent-0'); } }); this.testCase({ name: "Validate unload scenario with zero response code and requeuing during beforeunload/unload - maxUnloadRetryEvents == 5", useFakeTimers: true, test: () => { let sentNotifications = []; let discardNotifications = []; let sendNotifications = []; let xhrRequests = []; let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve, reject) => { setTimeout(function() { reject(); }, 0); }); this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { xhrRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); // Return on error immediately to simulate a synchronous failure oncomplete(0, {}); } } }; let channelConfig: IChannelConfiguration = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = channelConfig; // Always use the XHR Override so that we can correct simulate a zero response channelConfig.alwaysUseXhrOverride = true; channelConfig.maxUnloadEventRetryAttempts = 5; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentNotifications.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardNotifications.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason: sendReason, isAsync: isAsync }); } }); for (let lp = 0; lp < 50; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.RealTime, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendNotifications.length, 0, 'No Send events yet as they are sent'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 0, "We haven't actually sent the request yet"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); // Simulate an beforeunload event which will cause the event to get re-queued document.dispatchEvent(new Event("beforeunload")); QUnit.assert.equal(sendNotifications.length, 1, 'We should now have attempted to send the events'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 1, "Only 1 requests should be sent"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); // Let the auto flush send event to send this.clock.tick(1); QUnit.assert.equal(sendNotifications.length, 1, '1 requests should have been sent because of requeue and sync resend'); QUnit.assert.equal(xhrRequests.length, 1, '1 request should have been sent because of requeue and sync resend'); QUnit.assert.equal(discardNotifications.length, 0, 'We should have at least no discard events'); // Simulate an unload event which will cause the event triggering the internal unload logic document.dispatchEvent(new Event("unload")); QUnit.assert.equal(sendNotifications.length, 5, 'We should now have attempted to send the events'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 5, "5 requests should be sent"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); QUnit.assert.equal(discardNotifications.length, 0, 'There should no discarded events yet!'); // Discard events are always executed on the next cycle this.clock.tick(1); QUnit.assert.equal(discardNotifications.length, 1, 'There should be 1 batch of events should have been discarded'); QUnit.assert.equal(discardNotifications[0].events.length, 50, 'There should be 50 discarded event'); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', 'The first event discarded should be event testEvent-0'); // Just tick over some additional time this.clock.tick(10000); QUnit.assert.equal(sendNotifications.length, 5, '5 requests should have been sent because of requeue and sync resend'); QUnit.assert.equal(xhrRequests.length, 5, '5 requests should have been sent because of requeue and sync resend'); QUnit.assert.equal(discardNotifications.length, 1, 'There should be 1 batch of events should have been discarded'); QUnit.assert.equal(discardNotifications[0].events.length, 50, 'There should be 50 discarded event'); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', 'The first event discarded should be event testEvent-0'); } }); this.testCase({ name: "Validate unload scenario with zero response code and requeuing during unload - default", useFakeTimers: true, test: () => { let sentNotifications = []; let discardNotifications = []; let sendNotifications = []; let xhrRequests = []; let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve, reject) => { setTimeout(function() { reject(); }, 0); }); this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { xhrRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); // Return on error immediately to simulate a synchronous failure oncomplete(0, {}); } } }; let channelConfig: IChannelConfiguration = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = channelConfig; // Always use the XHR Override so that we can correct simulate a zero response channelConfig.alwaysUseXhrOverride = true; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentNotifications.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardNotifications.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason: sendReason, isAsync: isAsync }); } }); for (let lp = 0; lp < 50; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.RealTime, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendNotifications.length, 0, 'No Send events yet as they are sent'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 0, "We haven't actually sent the request yet"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); // Simulate an unload event document.dispatchEvent(new Event("unload")); QUnit.assert.equal(sendNotifications.length, 2, 'We should now have attempted to send the events'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 2, "2 attempts requeue events should be sent"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); QUnit.assert.equal(discardNotifications.length, 0, 'There should no discarded events yet!'); // Discard events are always executed on the next cycle this.clock.tick(1); QUnit.assert.equal(discardNotifications.length, 1, 'There should be 1 batch of events should have been discarded'); QUnit.assert.equal(discardNotifications[0].events.length, 50, 'There should be 50 discarded event'); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', 'The first event discarded should be event testEvent-0'); // Tick over some additional time this.clock.tick(10000); QUnit.assert.equal(sendNotifications.length, 2, '2 requests should have been sent because of requeue and sync resend'); QUnit.assert.equal(xhrRequests.length, 2, 'Still 2 requests should have been sent because of requeue sync resend'); QUnit.assert.equal(discardNotifications.length, 1, 'There should be 1 batch of events should have been discarded'); QUnit.assert.equal(discardNotifications[0].events.length, 50, 'There should be 50 discarded event'); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', 'The first event discarded should be event testEvent-0'); } }); this.testCase({ name: "Validate unload scenario with zero response code and requeuing during unload - with maxUnloadEvents == 5", useFakeTimers: true, test: () => { let sentNotifications = []; let discardNotifications = []; let sendNotifications = []; let xhrRequests = []; let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve, reject) => { setTimeout(function() { reject(); }, 0); }); this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { xhrRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); // Return on error immediately to simulate a synchronous failure oncomplete(0, {}); } } }; let channelConfig: IChannelConfiguration = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = channelConfig; // Always use the XHR Override so that we can correct simulate a zero response channelConfig.alwaysUseXhrOverride = true; channelConfig.maxUnloadEventRetryAttempts = 5; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentNotifications.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardNotifications.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason: sendReason, isAsync: isAsync }); } }); for (let lp = 0; lp < 50; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.RealTime, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendNotifications.length, 0, 'No Send events yet as they are sent'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 0, "We haven't actually sent the request yet"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); // Simulate an unload event document.dispatchEvent(new Event("unload")); QUnit.assert.equal(sendNotifications.length, 5, 'We should now have attempted to send the events'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 5, "5 attempts requeue events should be sent"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); QUnit.assert.equal(discardNotifications.length, 0, 'There should no discarded events yet!'); // Discard events are always executed on the next cycle this.clock.tick(1); QUnit.assert.equal(discardNotifications.length, 1, 'There should be 1 batch of events should have been discarded'); QUnit.assert.equal(discardNotifications[0].events.length, 50, 'There should be 50 discarded event'); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', 'The first event discarded should be event testEvent-0'); // Tick over some time to make sure nothing else happens this.clock.tick(10000); QUnit.assert.equal(sendNotifications.length, 5, '5 requests should have been sent because of requeue and sync resend'); QUnit.assert.equal(xhrRequests.length, 5, 'Still 5 requests should have been sent because of requeue sync resend'); QUnit.assert.equal(discardNotifications.length, 1, 'There should be 1 batch of events should have been discarded'); QUnit.assert.equal(discardNotifications[0].events.length, 50, 'There should be 50 discarded event'); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', 'The first event discarded should be event testEvent-0'); } }); this.testCase({ name: "Validate synchronous flush scenario with zero response code and requeuing with synchronous flushing and no unload - default retries", useFakeTimers: true, test: () => { let sentNotifications = []; let discardNotifications = []; let sendNotifications = []; let xhrRequests = []; let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve, reject) => { setTimeout(function() { reject(); }, 0); }); this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { xhrRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); // Return on error immediately to simulate a synchronous failure oncomplete(0, {}); } } }; let channelConfig: IChannelConfiguration = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = channelConfig; // Always use the XHR Override so that we can correct simulate a zero response channelConfig.alwaysUseXhrOverride = true; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentNotifications.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardNotifications.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason: sendReason, isAsync: isAsync }); } }); for (let lp = 0; lp < 50; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.RealTime, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendNotifications.length, 0, 'No Send events yet as they are sent'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 0, "We haven't actually sent the request yet"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); let flushCompleted = 0; for (let lp = 0; lp < 8; lp++) { // cause a synchronous flush this.postChannel.flush(false, () => { flushCompleted++; }); QUnit.assert.equal(flushCompleted, lp + 1, "The flush should have been completed synchronously"); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); if (lp < 6) { QUnit.assert.equal(sendNotifications.length, lp + 1, 'request should have been sent and the events requeued'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, lp + 1, "Check the number of attempts and requeue events should be sent"); } else { QUnit.assert.equal(sendNotifications.length, 6, 'request should have been sent and the events requeued'); QUnit.assert.equal(xhrRequests.length, 6, "Only 6 attempts and requeue events should be sent"); QUnit.assert.equal(discardNotifications.length, 1, 'The batch should now have been discarded'); QUnit.assert.equal(discardNotifications[0].events.length, 50, 'There should be 50 discarded event'); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', 'The first event discarded should be event testEvent-0'); } QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); // Should not be required but lets just tick over some time this.clock.tick(1); } } }); this.testCase({ name: "Validate asynchronous flush scenario with zero response code and requeuing and no unload - default retries", useFakeTimers: true, test: () => { let sentNotifications = []; let discardNotifications = []; let sendNotifications = []; let xhrRequests = []; let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve, reject) => { setTimeout(function() { reject(); }, 0); }); this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { xhrRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); // Return on error immediately to simulate a synchronous failure oncomplete(0, {}); } } }; let channelConfig: IChannelConfiguration = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = channelConfig; // Always use the XHR Override so that we can correct simulate a zero response channelConfig.alwaysUseXhrOverride = true; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentNotifications.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardNotifications.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason: sendReason, isAsync: isAsync }); } }); for (let lp = 0; lp < 50; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.RealTime, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendNotifications.length, 0, 'No Send events yet as they are sent'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 0, "We haven't actually sent the request yet"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); let flushCompleted = 0; for (let lp = 0; lp < 8; lp++) { // cause a asynchronous flush this.postChannel.flush(true, () => { flushCompleted++; }); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); if (lp < 3) { QUnit.assert.equal(flushCompleted, lp, lp + ":The flush should have been completed asynchronously"); QUnit.assert.equal(sendNotifications.length, (lp * 2), lp + ":request should have been sent and the events requeued"); QUnit.assert.equal(discardNotifications.length, 0, lp + ":No Discard events yet as they are sent"); QUnit.assert.equal(xhrRequests.length, (lp * 2), lp + ":Check the number of attempts and requeue events should be sent"); // Simulate time passing for the requeue/random back off timer for sending of the events and wait for the flush to complete let attempt = 0; while (attempt < 6000 && flushCompleted === lp) { this.clock.tick(10); attempt++; } QUnit.assert.equal(flushCompleted, lp + 1, "The flush should have been completed asynchronously"); QUnit.assert.equal(sendNotifications.length, ((lp + 1) * 2), 'request should have been sent and the events requeued'); QUnit.assert.equal(xhrRequests.length, ((lp + 1) * 2), "Check the number of attempts and requeue events should be sent"); if (lp === 2) { QUnit.assert.equal(discardNotifications.length, 1, "The batch should now have been discarded"); QUnit.assert.equal(discardNotifications[0].events.length, 50, "There should be 50 discarded event"); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', "The first event discarded should be event testEvent-0"); } else { QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); } } else { QUnit.assert.equal(flushCompleted, lp, lp + ":The flush should have been completed asynchronously"); this.clock.tick(30000); QUnit.assert.equal(flushCompleted, (lp + 1), lp + ":The flush should have been completed asynchronously"); QUnit.assert.equal(sendNotifications.length, 6, lp + ":request should have been sent and the events requeued"); QUnit.assert.equal(xhrRequests.length, 6, lp + ":Only 6 attempts and requeue events should be sent"); QUnit.assert.equal(discardNotifications.length, 1, 'No Discard events yet as they are sent'); QUnit.assert.equal(discardNotifications[0].events.length, 50, "There should be 50 discarded event"); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', "The first event discarded should be event testEvent-0"); } QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); // Should not be required but lets just tick over some time this.clock.tick(1); } } }); this.testCase({ name: "Validate synchronous flush scenario with zero response code and requeuing with synchronous flushing and no unload - maxEventRetry == 5", useFakeTimers: true, test: () => { let sentNotifications = []; let discardNotifications = []; let sendNotifications = []; let xhrRequests = []; let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve, reject) => { setTimeout(function() { reject(); }, 0); }); this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { xhrRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); // Return on error immediately to simulate a synchronous failure oncomplete(0, {}); } } }; let channelConfig: IChannelConfiguration = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = channelConfig; // Always use the XHR Override so that we can correct simulate a zero response channelConfig.alwaysUseXhrOverride = true; channelConfig.maxEventRetryAttempts = 5; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentNotifications.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardNotifications.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason: sendReason, isAsync: isAsync }); } }); for (let lp = 0; lp < 50; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.RealTime, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendNotifications.length, 0, 'No Send events yet as they are sent'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 0, "We haven't actually sent the request yet"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); let flushCompleted = 0; for (let lp = 0; lp < 8; lp++) { // cause a synchronous flush this.postChannel.flush(false, () => { flushCompleted++; }); QUnit.assert.equal(flushCompleted, lp + 1, "The flush should have been completed synchronously"); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); if (lp < 5) { QUnit.assert.equal(sendNotifications.length, lp + 1, 'request should have been sent and the events requeued'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, lp + 1, "Check the number of attempts and requeue events should be sent"); } else { QUnit.assert.equal(sendNotifications.length, 5, 'request should have been sent and the events requeued'); QUnit.assert.equal(xhrRequests.length, 5, "Only 5 attempts and requeue events should be sent"); QUnit.assert.equal(discardNotifications.length, 1, 'The batch should now have been discarded'); QUnit.assert.equal(discardNotifications[0].events.length, 50, 'There should be 50 discarded event'); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', 'The first event discarded should be event testEvent-0'); } QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); // Should not be required but lets just tick over some time this.clock.tick(1); } } }); this.testCase({ name: "Validate asynchronous flush scenario with zero response code and requeuing and no unload - maxEventRetry == 5", useFakeTimers: true, test: () => { let sentNotifications = []; let discardNotifications = []; let sendNotifications = []; let xhrRequests = []; let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve, reject) => { setTimeout(function() { reject(); }, 0); }); this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { xhrRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); // Return on error immediately to simulate a synchronous failure oncomplete(0, {}); } } }; let channelConfig: IChannelConfiguration = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = channelConfig; // Always use the XHR Override so that we can correct simulate a zero response channelConfig.alwaysUseXhrOverride = true; channelConfig.maxEventRetryAttempts = 5; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentNotifications.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardNotifications.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason: sendReason, isAsync: isAsync }); } }); for (let lp = 0; lp < 50; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.RealTime, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendNotifications.length, 0, 'No Send events yet as they are sent'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 0, "We haven't actually sent the request yet"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); let flushCompleted = 0; for (let lp = 0; lp < 8; lp++) { // cause a asynchronous flush this.postChannel.flush(true, () => { flushCompleted++; }); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); if (lp < 3) { QUnit.assert.equal(flushCompleted, lp, lp + ":The flush should have been completed asynchronously"); QUnit.assert.equal(sendNotifications.length, (lp * 2), lp + ":request should have been sent and the events requeued"); QUnit.assert.equal(discardNotifications.length, 0, lp + ":No Discard events yet as they are sent"); QUnit.assert.equal(xhrRequests.length, (lp * 2), lp + ":Check the number of attempts and requeue events should be sent"); // Simulate time passing for the requeue/random back off timer for sending of the events and wait for the flush to complete let attempt = 0; while (attempt < 6000 && flushCompleted === lp) { this.clock.tick(10); attempt++; } QUnit.assert.equal(flushCompleted, lp + 1, "The flush should have been completed asynchronously"); if (lp === 2) { QUnit.assert.equal(sendNotifications.length, 6, lp + ":request should have been sent and the events requeued"); QUnit.assert.equal(xhrRequests.length, 6, lp + ":Only 6 attempts and requeue events should be sent"); QUnit.assert.equal(discardNotifications.length, 1, "The batch should now have been discarded"); QUnit.assert.equal(discardNotifications[0].events.length, 50, "There should be 50 discarded event"); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', "The first event discarded should be event testEvent-0"); } else { QUnit.assert.equal(sendNotifications.length, ((lp + 1) * 2), 'request should have been sent and the events requeued'); QUnit.assert.equal(xhrRequests.length, ((lp + 1) * 2), "Check the number of attempts and requeue events should be sent"); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); } } else { QUnit.assert.equal(flushCompleted, lp, lp + ":The flush should have been completed asynchronously"); this.clock.tick(30000); QUnit.assert.equal(flushCompleted, (lp + 1), lp + ":The flush should have been completed asynchronously"); QUnit.assert.equal(sendNotifications.length, 6, lp + ":request should have been sent and the events requeued"); QUnit.assert.equal(xhrRequests.length, 6, lp + ":Only 6 attempts and requeue events should be sent"); QUnit.assert.equal(discardNotifications.length, 1, 'No Discard events yet as they are sent'); QUnit.assert.equal(discardNotifications[0].events.length, 50, "There should be 50 discarded event"); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', "The first event discarded should be event testEvent-0"); } QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); // Should not be required but lets just tick over some time this.clock.tick(1); } } }); this.testCase({ name: "Validate asynchronous flush scenario with zero response code and requeuing and no unload - maxEventRetry == 4", useFakeTimers: true, test: () => { let sentNotifications = []; let discardNotifications = []; let sendNotifications = []; let xhrRequests = []; let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve, reject) => { setTimeout(function() { reject(); }, 0); }); this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { xhrRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); // Return on error immediately to simulate a synchronous failure oncomplete(0, {}); } } }; let channelConfig: IChannelConfiguration = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = channelConfig; // Always use the XHR Override so that we can correct simulate a zero response channelConfig.alwaysUseXhrOverride = true; channelConfig.maxEventRetryAttempts = 4; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentNotifications.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardNotifications.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason: sendReason, isAsync: isAsync }); } }); for (let lp = 0; lp < 50; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.RealTime, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendNotifications.length, 0, 'No Send events yet as they are sent'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 0, "We haven't actually sent the request yet"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); let flushCompleted = 0; for (let lp = 0; lp < 8; lp++) { // cause a asynchronous flush this.postChannel.flush(true, () => { flushCompleted++; }); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); if (lp < 2) { QUnit.assert.equal(flushCompleted, lp, lp + ":The flush should have been completed asynchronously"); QUnit.assert.equal(sendNotifications.length, (lp * 2), lp + ":request should have been sent and the events requeued"); QUnit.assert.equal(discardNotifications.length, 0, lp + ":No Discard events yet as they are sent"); QUnit.assert.equal(xhrRequests.length, (lp * 2), lp + ":Check the number of attempts and requeue events should be sent"); // Simulate time passing for the requeue/random back off timer for sending of the events and wait for the flush to complete let attempt = 0; while (attempt < 6000 && flushCompleted === lp) { this.clock.tick(10); attempt++; } QUnit.assert.equal(flushCompleted, lp + 1, "The flush should have been completed asynchronously"); if (lp === 1) { QUnit.assert.equal(sendNotifications.length, 4, lp + ":request should have been sent and the events requeued"); QUnit.assert.equal(xhrRequests.length, 4, lp + ":Only 4 attempts and requeue events should be sent"); QUnit.assert.equal(discardNotifications.length, 1, "The batch should now have been discarded"); QUnit.assert.equal(discardNotifications[0].events.length, 50, "There should be 50 discarded event"); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', "The first event discarded should be event testEvent-0"); } else { QUnit.assert.equal(sendNotifications.length, ((lp + 1) * 2), 'request should have been sent and the events requeued'); QUnit.assert.equal(xhrRequests.length, ((lp + 1) * 2), "Check the number of attempts and requeue events should be sent"); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); } } else { QUnit.assert.equal(flushCompleted, lp, lp + ":The flush should have been completed asynchronously"); this.clock.tick(30000); QUnit.assert.equal(flushCompleted, (lp + 1), lp + ":The flush should have been completed asynchronously"); QUnit.assert.equal(sendNotifications.length, 4, lp + ":request should have been sent and the events requeued"); QUnit.assert.equal(xhrRequests.length, 4, lp + ":Only 4 attempts and requeue events should be sent"); QUnit.assert.equal(discardNotifications.length, 1, 'No Discard events yet as they are sent'); QUnit.assert.equal(discardNotifications[0].events.length, 50, "There should be 50 discarded event"); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', "The first event discarded should be event testEvent-0"); } QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); // Should not be required but lets just tick over some time this.clock.tick(1); } } }); this.testCase({ name: "Validate retry scenario with zero response code -- hitting the maximum back off limit", useFakeTimers: true, test: () => { let sentNotifications = []; let discardNotifications = []; let sendNotifications = []; let xhrRequests = []; let beaconCalls = []; this.hookSendBeacon((url, data) => { beaconCalls.push({ url, data, }); return false; }); var fetchCalls = this.hookFetch((resolve, reject) => { setTimeout(function() { reject(); }, 0); }); this.config.extensionConfig[this.postChannel.identifier] = { httpXHROverride: { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) => { xhrRequests.push({ payload: payload, isSync: sync, oncomplete: oncomplete }); setTimeout(function() { oncomplete(0, {}); }, 0); } } }; let channelConfig: IChannelConfiguration = this.config.extensionConfig[this.postChannel.identifier] || {}; this.config.extensionConfig[this.postChannel.identifier] = channelConfig; // Always use the XHR Override so that we can correct simulate a zero response channelConfig.alwaysUseXhrOverride = true; this.core.initialize(this.config, [this.postChannel]); this.core.addNotificationListener({ eventsSent: (events: ITelemetryItem[]) => { sentNotifications.push(events); }, eventsDiscarded: (events: ITelemetryItem[], reason: number) => { discardNotifications.push({ events: events, reason: reason }); }, eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason: sendReason, isAsync: isAsync }); } }); for (let lp = 0; lp < 50; lp++) { this.postChannel.processTelemetry({ name: 'testEvent-' + lp, latency: EventLatency.RealTime, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); } QUnit.assert.equal(sendNotifications.length, 0, 'No Send events yet as they are sent'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(discardNotifications.length, 0, 'No Discard events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 0, "We haven't actually sent the request yet"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); this.postChannel.flush(); // Let the auto flush send event to send this.clock.tick(2); for (let retry = 0; retry < 8; retry++) { if (retry < 4) { QUnit.assert.equal(sendNotifications.length, retry + 1, retry + ": We should now have attempted to send the events"); QUnit.assert.equal(sentNotifications.length, 0, retry + ": No Sent events yet as they are sent"); QUnit.assert.equal(discardNotifications.length, 0, retry + ": No Discard events yet as they are sent"); QUnit.assert.equal(xhrRequests.length, retry + 1, retry + ": Check requests should be sent"); QUnit.assert.equal(fetchCalls.length, 0, retry + ": No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, retry + ": No Beacon requests"); // Simulate time passing for the requeue and sending of the events let attempt = 0; while (attempt < 6000 && sendNotifications.length === (retry + 1)) { this.clock.tick(10); attempt++; } } else { QUnit.assert.equal(sendNotifications.length, 4, retry + ": We should now have attempted to send the events"); QUnit.assert.equal(sentNotifications.length, 0, retry + ": No Sent events yet as they are sent"); QUnit.assert.equal(xhrRequests.length, 4, retry + ": Check requests should be sent"); QUnit.assert.equal(fetchCalls.length, 0, retry + ": No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, retry + ": No Beacon requests"); // Jump forward 30 seconds this.clock.tick(30000); } } // Add a new event which will cause a new event to be sent this.postChannel.processTelemetry({ name: 'testEvent-extra', latency: EventLatency.RealTime, iKey: 'testIkey' } as IPostTransmissionTelemetryItem); // Simulate time passing for the requeue/random back off timer for sending of the events let attempt = 0; while (attempt < 6000 && sendNotifications.length < 5) { this.clock.tick(10); attempt++; } QUnit.assert.equal(sendNotifications.length, 5, 'We should now have attempted to send the events'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 5, "Check requests should be sent"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); // Simulate time passing for the retry which uses a random back off timer for sending of the events attempt = 0; while (attempt < 7000 && (sendNotifications.length < 6 || discardNotifications.length < 1 || xhrRequests.length < 6)) { this.clock.tick(10); attempt++; } QUnit.assert.equal(sendNotifications.length, 6, 'We should now have attempted to send the events'); QUnit.assert.equal(sentNotifications.length, 0, 'No Sent events yet as they are sent'); QUnit.assert.equal(xhrRequests.length, 6, "Check requests should be sent"); QUnit.assert.equal(fetchCalls.length, 0, "No Fetch requests"); QUnit.assert.equal(beaconCalls.length, 0, "No Beacon requests"); QUnit.assert.equal(discardNotifications.length, 1, 'The batch should now have been discarded'); QUnit.assert.equal(discardNotifications[0].events.length, 50, 'There should be 50 discarded event'); QUnit.assert.equal(discardNotifications[0].events[0].name, 'testEvent-0', 'The first event discarded should be event testEvent-0'); } }); this.testCase({ name: "Post Channel: check excludeCsMetaData", useFakeTimers: true, useFakeServer: true, test: () => { let config = this.config; let core = this.core; let postChannel = this.postChannel; let identifier = postChannel.identifier; let event1: IPostTransmissionTelemetryItem = TestHelper.mockEvent(EventPersistence.Normal); let event2: IPostTransmissionTelemetryItem = TestHelper.mockEvent(EventPersistence.Normal); core.initialize(config, [postChannel]); // test timeout core.track(event1); this.clock.tick(10001); let requests = this._getXhrRequests(); QUnit.assert.equal(requests.length, 1, "request should be sent"); requests[0].respond(200, {}, "response body"); QUnit.assert.equal(requests[0].method, "POST", "request method should be POST"); let evt = JSON.parse(requests[0]["requestBody"]); QUnit.assert.equal(evt.name, event1.name, "request data should be set"); let metaData = evt.ext.metadata; QUnit.assert.ok(!isNullOrUndefined(metaData)); QUnit.assert.equal(metaData.f.evValue2.t, 8193, "evValue should be tagged"); QUnit.assert.equal(metaData.f.value5.t, 6, "value5 should be tagged as number"); QUnit.assert.equal(metaData.f.value1.a.t, 6, "value1 should be tagged as array of numbers"); // Disable CsMetaData core!.config!.extensionConfig![identifier].excludeCsMetaData = true; // Let the dynamic config changes occur this.clock.tick(1); core.track(event2); this.clock.tick(10001); requests = this._getXhrRequests(); QUnit.assert.equal(requests.length, 2, "request should be sent"); requests[1].respond(200, {}, "response body"); QUnit.assert.equal(requests[1].method, "POST", "request method should be POST"); evt = JSON.parse(requests[1]["requestBody"]); QUnit.assert.equal(evt.name, event2.name, "request data should be set"); metaData = evt.ext.metadata; QUnit.assert.equal(metaData, undefined, "metadata should be undefined"); } }); } } class AutoCompleteXhrOverride { public sendPOST(payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) { oncomplete(200, null); } } ================================================ FILE: channels/1ds-post-js/test/Unit/src/SerializerTest.ts ================================================ import { AITestClass } from "@microsoft/ai-test-framework"; import { HttpManager } from '../../../src/HttpManager'; import { AppInsightsCore, EventLatency, EventSendType, IEventProperty, SendRequestReason, IXHROverride, IPayloadData } from '@microsoft/applicationinsights-core-js'; import { PostChannel } from '../../../src/PostChannel'; import { IPostTransmissionTelemetryItem, EventBatchNotificationReason, IChannelConfiguration } from '../../../src/DataModels'; import { Serializer } from '../../../src/Serializer'; import { EventBatch } from "../../../src/EventBatch"; export class SerializerTest extends AITestClass { constructor(name?: string, emulateEs3?: boolean) { super(name, emulateEs3); this.assertNoEvents = true; this.assertNoHooks = true; } public registerTests() { this.testCase({ name: 'getEventBlob with compoundKey support', test: () => { let serializer = new Serializer(null, null, null, true); let event: IPostTransmissionTelemetryItem = { name: "testEvent", iKey: "1234-5678", latency: EventLatency.Normal, // Should not get serialized data: { 'testObject.testProperty': 456 }, baseData: {}, }; let serializedEvent = serializer.getEventBlob(event); QUnit.assert.equal(serializedEvent, '{\"name\":\"testEvent\",\"iKey\":\"o:1234\",\"data\":{\"baseData\":{},\"testObject\":{\"testProperty\":456}}}'); } }); this.testCase({ name: "Append payload with max number per batch", test: () => { let maxNumberEvtPerBatch = 3; let serializer = new Serializer(null, null, null, false, null, null); let ikey = "1234-5678"; let event: IPostTransmissionTelemetryItem = { name: "testEvent", iKey: ikey, latency: EventLatency.Normal, // Should not get serialized data: { "testObject.testProperty": 456 }, baseData: {} }; let event1: IPostTransmissionTelemetryItem = { name: "testEvent1", iKey: ikey, latency: EventLatency.Normal, // Should not get serialized data: { "testObject.testProperty": 456 }, baseData: {} }; let payload = serializer.createPayload(0, false, false, false, SendRequestReason.NormalSchedule, EventSendType.Batched); let batch = EventBatch.create(ikey, [event, event1]); serializer.appendPayload(payload, batch, maxNumberEvtPerBatch); let evts = payload.payloadBlob; let expectedPayload = "{\"name\":\"testEvent\",\"iKey\":\"o:1234\",\"data\":{\"baseData\":{},\"testObject.testProperty\":456}}" + "\n" + "{\"name\":\"testEvent1\",\"iKey\":\"o:1234\",\"data\":{\"baseData\":{},\"testObject.testProperty\":456}}" QUnit.assert.equal(evts, expectedPayload, "should contain both events"); let overflow = payload.overflow; QUnit.assert.equal(overflow, null, "should not have overflow batch"); let sizeExceed = payload.sizeExceed; QUnit.assert.equal(sizeExceed.length, 0, "should not have size exceed batch"); } }); this.testCase({ name: "Append payload with exceed max number per batch", test: () => { let maxNumberEvtPerBatch = 1; let serializer = new Serializer(null, null, null, false, null, null); let ikey = "1234-5678"; let event: IPostTransmissionTelemetryItem = { name: "testEvent", iKey: ikey, latency: EventLatency.Normal, // Should not get serialized data: { "testObject.testProperty": 456 }, baseData: {} }; let event1: IPostTransmissionTelemetryItem = { name: "testEvent1", iKey: ikey, latency: EventLatency.Normal, // Should not get serialized data: { "testObject.testProperty": 456 }, baseData: {} }; let payload = serializer.createPayload(0, false, false, false, SendRequestReason.NormalSchedule, EventSendType.Batched); let batch = EventBatch.create(ikey, [event, event1]); serializer.appendPayload(payload, batch, maxNumberEvtPerBatch); let evts = payload.payloadBlob; let expectedPayload = "{\"name\":\"testEvent\",\"iKey\":\"o:1234\",\"data\":{\"baseData\":{},\"testObject.testProperty\":456}}"; QUnit.assert.equal(evts, expectedPayload, "should contain both events"); let overflow = payload.overflow; QUnit.assert.equal(overflow.count(), 1, "should have only one overflow batch"); let overflowEvts = overflow.events(); QUnit.assert.equal(overflowEvts.length, 1, "should have only one overflow event"); QUnit.assert.equal(overflowEvts[0], event1, "overflow should have event1"); let sizeExceed = payload.sizeExceed; QUnit.assert.equal(sizeExceed.length, 0, "should not have size exceed batch"); } }); this.testCase({ name: "Append payload with size limit channel config", test: () => { let cfg = { requestLimit: { requestLimit: [200, 200], recordLimit: [200,200] } } as IChannelConfiguration let serializer = new Serializer(null, null, null, false, null, null, cfg); let ikey = "1234-5678"; let event: IPostTransmissionTelemetryItem = { name: "testEvent", iKey: ikey, latency: EventLatency.Normal, // Should not get serialized data: { "testObject.testProperty": 456 }, baseData: {} }; let event1: IPostTransmissionTelemetryItem = { name: "testEvent1", iKey: ikey, latency: EventLatency.Normal, // Should not get serialized data: { "testObject.testProperty": 456 }, baseData: {} }; let payload = serializer.createPayload(0, false, false, false, SendRequestReason.NormalSchedule, EventSendType.Batched); let batch = EventBatch.create(ikey, [event, event1]); serializer.appendPayload(payload, batch, 100); let evts = payload.payloadBlob; let expectedPayload = "{\"name\":\"testEvent\",\"iKey\":\"o:1234\",\"data\":{\"baseData\":{},\"testObject.testProperty\":456}}" + "\n" + "{\"name\":\"testEvent1\",\"iKey\":\"o:1234\",\"data\":{\"baseData\":{},\"testObject.testProperty\":456}}" QUnit.assert.equal(evts, expectedPayload, "should contain both events"); let overflow = payload.overflow; QUnit.assert.equal(overflow, null, "should not have overflow batch"); let sizeExceed = payload.sizeExceed; QUnit.assert.equal(sizeExceed.length, 0, "should not have size exceed batch"); } }); this.testCase({ name: "Append overflow payload with size limit channel config", test: () => { let cfg = { requestLimit: { recordLimit: [100,100], requestLimit: [100, 100] } } as IChannelConfiguration let serializer = new Serializer(null, null, null, false, null, null, cfg); let ikey = "1234-5678"; let event: IPostTransmissionTelemetryItem = { name: "testEvent", iKey: ikey, latency: EventLatency.Normal, // Should not get serialized data: { "testObject.testProperty": 456 }, baseData: {} }; let event1: IPostTransmissionTelemetryItem = { name: "testEvent1", iKey: ikey, latency: EventLatency.Normal, // Should not get serialized data: { "testObject.testProperty": 456 }, baseData: {} }; let payload = serializer.createPayload(0, false, false, false, SendRequestReason.NormalSchedule, EventSendType.Batched); let batch = EventBatch.create(ikey, [event, event1]); serializer.appendPayload(payload, batch, 100); let evts = payload.payloadBlob; QUnit.assert.equal(evts, "{\"name\":\"testEvent\",\"iKey\":\"o:1234\",\"data\":{\"baseData\":{},\"testObject.testProperty\":456}}", "should contain only one event"); let overflow = payload.overflow; QUnit.assert.equal(overflow.count(), 1, "should have only one overflow batch"); let overflowEvts = overflow.events(); QUnit.assert.equal(overflowEvts.length, 1, "should have only one overflow event"); QUnit.assert.equal(overflowEvts[0], event1, "overflow should have event1"); } }); this.testCase({ name: "Append exceed size payload with size limit channel config", test: () => { let cfg = { requestLimit: { recordLimit: [100,100], requestLimit: [100, 100] } } as IChannelConfiguration let serializer = new Serializer(null, null, null, false, null, null, cfg); let ikey = "1234-5678"; let event: IPostTransmissionTelemetryItem = { name: "testEvent", iKey: ikey, latency: EventLatency.Normal, // Should not get serialized data: { "testObject.testProperty": 456 }, baseData: {} }; let largEvent: IPostTransmissionTelemetryItem = { name: "testEvent", iKey: ikey, latency: EventLatency.Normal, // Should not get serialized data: { "testObject.testProperty": new Array(100).join("a") }, baseData: {} }; let payload = serializer.createPayload(0, false, false, false, SendRequestReason.NormalSchedule, EventSendType.Batched); let largeBatch = EventBatch.create(ikey, [event, largEvent]); serializer.appendPayload(payload, largeBatch, 100); let evts = payload.payloadBlob; QUnit.assert.equal(evts, "{\"name\":\"testEvent\",\"iKey\":\"o:1234\",\"data\":{\"baseData\":{},\"testObject.testProperty\":456}}", "should have only one overflow batch"); let sizeExceed = payload.sizeExceed; QUnit.assert.equal(sizeExceed.length, 1, "should have only one payload with size exceed"); let sizeExceedBatch = sizeExceed[0]; QUnit.assert.equal(sizeExceedBatch.count(), 1, "exceed Batch should have only one event"); let sizeExceedEvts = sizeExceedBatch.events(); QUnit.assert.equal(sizeExceedEvts[0], largEvent, "exceed batch should only contain large event") } }); this.testCase({ name: 'getEventBlob without compoundKey support', test: () => { let serializer = new Serializer(null, null, null, false); let event: IPostTransmissionTelemetryItem = { name: "testEvent", iKey: "1234-5678", latency: EventLatency.Normal, // Should not get serialized data: { 'testObject.testProperty': 456 }, baseData: {}, }; let serializedEvent = serializer.getEventBlob(event); QUnit.assert.equal(serializedEvent, '{\"name\":\"testEvent\",\"iKey\":\"o:1234\",\"data\":{\"baseData\":{},\"testObject.testProperty\":456}}'); } }); this.testCase({ name: 'metadata with event property with compoundKey support', test: () => { let serializer = new Serializer(null, null, null, true); let testProperty: IEventProperty = { value: "testValue", kind: 13, //Pii_IPV4AddressLegacy propertyType: 1 //String }; let event: IPostTransmissionTelemetryItem = { name: "testEvent", baseData: { 'testProperty': testProperty }, data: { 'testPartC': 123, 'testObject.testProperty': 456 }, ext: {} }; let serializedEvent = serializer.getEventBlob(event); let parsedEvent = JSON.parse(serializedEvent); let expectedMetaData: any = { f: { baseData: { f: { testProperty: { t: 417 } } }, testPartC: { t: 6 }, testObject: { f: { testProperty: { t: 6 } } } } }; let metaData = JSON.stringify(parsedEvent.ext.metadata); QUnit.assert.equal(metaData, JSON.stringify(expectedMetaData), 'Checking: ' + metaData); } }); this.testCase({ name: 'metadata with event property without compoundKey support', test: () => { let serializer = new Serializer(null, null, null, false); let testProperty: IEventProperty = { value: "testValue", kind: 13, //Pii_IPV4AddressLegacy propertyType: 1 //String }; let event: IPostTransmissionTelemetryItem = { name: "testEvent", baseData: { 'testProperty': testProperty }, data: { 'testPartC': 123, 'testObject.testProperty': 456 }, ext: {} }; let serializedEvent = serializer.getEventBlob(event); let parsedEvent = JSON.parse(serializedEvent); let expectedMetaData: any = { f: { baseData: { f: { testProperty: { t: 417 } } }, testPartC: { t: 6 }, 'testObject.testProperty': { t: 6 } } }; let metaData = JSON.stringify(parsedEvent.ext.metadata); QUnit.assert.equal(metaData, JSON.stringify(expectedMetaData), 'Checking: ' + metaData); } }); this.testCase({ name: 'nested elements metadata', test: () => { let serializer = new Serializer(); let event: IPostTransmissionTelemetryItem = { name: "testEvent", baseData: { "testProperty": { "testA": 123, "testB": "test" } }, data: { "testProperty2": 123, "testPartCNested": { "testC": { "testD": { "test": 456 } } } }, ext: {} }; let serializedEvent = serializer.getEventBlob(event); let parsedEvent = JSON.parse(serializedEvent); let expectedMetaData: any = { f: { baseData: { f: { testProperty: { f: { testA: { t: 6 } } } } }, testProperty2: { t: 6 }, testPartCNested: { f: { testC: { f: { testD: { f: { test: { t: 6 } } } } } } } } }; let metaData = JSON.stringify(parsedEvent.ext.metadata); QUnit.assert.equal(metaData, JSON.stringify(expectedMetaData), 'Checking: ' + metaData); } }); this.testCase({ name: 'array metadata', test: () => { let serializer = new Serializer(); let event: IPostTransmissionTelemetryItem = { name: "testEvent", baseData: { "testProperty": { "testA": ["test1", "test2", "test3"] } }, data: { "testProperty2": [1, 2, 3, 4] }, ext: {} }; let serializedEvent = serializer.getEventBlob(event); let parsedEvent = JSON.parse(serializedEvent); let expectedMetaData: any = { f: { testProperty2: { a: { t: 6 } } } }; let metaData = JSON.stringify(parsedEvent.ext.metadata); QUnit.assert.equal(metaData, JSON.stringify(expectedMetaData), 'Checking: ' + metaData); } }); this.testCase({ name: 'excluded metadata with event property with compoundKey support', test: () => { let serializer = new Serializer(undefined, undefined, undefined, true, undefined, true); let testProperty: IEventProperty = { value: "testValue", kind: 13, //Pii_IPV4AddressLegacy propertyType: 1 //String }; let event: IPostTransmissionTelemetryItem = { name: "testEvent", baseData: { 'testProperty': testProperty }, data: { 'testPartC': 123, 'testObject.testProperty': 456 }, ext: {} }; let serializedEvent = serializer.getEventBlob(event); let parsedEvent = JSON.parse(serializedEvent); QUnit.assert.equal(parsedEvent.ext.metadata, undefined, 'Checking: Meta Data was not included'); } }); this.testCase({ name: 'exclude metadata with event property without compoundKey support', test: () => { let serializer = new Serializer(undefined, undefined, undefined, false, undefined, true); let testProperty: IEventProperty = { value: "testValue", kind: 13, //Pii_IPV4AddressLegacy propertyType: 1 //String }; let event: IPostTransmissionTelemetryItem = { name: "testEvent", baseData: { 'testProperty': testProperty }, data: { 'testPartC': 123, 'testObject.testProperty': 456 }, ext: {} }; let serializedEvent = serializer.getEventBlob(event); let parsedEvent = JSON.parse(serializedEvent); QUnit.assert.equal(parsedEvent.ext.metadata, undefined, 'Checking: Meta Data was not included'); } }); this.testCase({ name: 'nested elements excluding metadata', test: () => { let serializer = new Serializer(undefined, undefined, undefined, undefined, undefined, true); let event: IPostTransmissionTelemetryItem = { name: "testEvent", baseData: { "testProperty": { "testA": 123, "testB": "test" } }, data: { "testProperty2": 123, "testPartCNested": { "testC": { "testD": { "test": 456 } } } }, ext: {} }; let serializedEvent = serializer.getEventBlob(event); let parsedEvent = JSON.parse(serializedEvent); QUnit.assert.equal(parsedEvent.ext.metadata, undefined, 'Checking: Meta Data was not included'); } }); this.testCase({ name: 'array excluding metadata', test: () => { let serializer = new Serializer(undefined, undefined, undefined, undefined, undefined, true); let event: IPostTransmissionTelemetryItem = { name: "testEvent", baseData: { "testProperty": { "testA": ["test1", "test2", "test3"] } }, data: { "testProperty2": [1, 2, 3, 4] }, ext: {} }; let serializedEvent = serializer.getEventBlob(event); let parsedEvent = JSON.parse(serializedEvent); QUnit.assert.equal(parsedEvent.ext.metadata, undefined, 'Checking: Meta Data was not included'); } }); } } ================================================ FILE: channels/1ds-post-js/test/Unit/src/TestHelper.ts ================================================ import { IExtendedTelemetryItem } from '@microsoft/applicationinsights-core-js'; export class TestHelper { private static _idCount = 0; static reset(key: string) { this._idCount = 0; localStorage.removeItem(key); } static mockEvent(persistence: number): IExtendedTelemetryItem { this._idCount++; return { name: 'test_event-' + this._idCount.toString(), baseType: 'custom', time: '', persistence: persistence, data: { 'key': 'value', empty: [], value1: [1], value2: ['Hello'], value3: [['Hello']], value4: true, value5: 42, value6: { more: { data: 'X' } }, evValue1: { value: 'event Property' }, evValue2: { value: 'event Property2', kind: 32 /* CustomerContent_GenericContent */, propertyType: 1 /* String */ } } }; } static mockEvent2(persistence: number): IExtendedTelemetryItem { this._idCount++; return { name: 'test_event-' + this._idCount.toString(), time: ' 1970-01-01T00:00:00.000Z', ver: '4.0', iKey: 'o:12345-12345', ext: { sdk: { ver: 'Hello version 1.0', seq: 1, epoch: '0', installId: 'TestDeviceId' }, app: { sesId: '####' }, user: { locale: 'en-US' }, web: { domain: 'localhost' }, intweb: { }, utc: { popSample: 100 }, loc: { tz: '-08:00' }, metadata: { f: { value1: { a: { t: 6 } }, value5: { t: 6 }, evValue2: { t: 8193 } } } }, baseData: { properties: { version: '##currentPluginVersions##' } }, data: { baseType: 'testEventBaseType', value1: [1], value2: ['Hello'], value3: [['Hello']], value4: true, value5: 42, value6: { more: { data: 'X' } }, evValue1: 'event Property', evValue2: 'event Property2' } }; } } ================================================ FILE: channels/1ds-post-js/test/Unit/src/post.unittests.ts ================================================ import { PostChannelTest } from './PostChannelTest'; import { HttpManagerTest } from './HttpManagerTest'; import { KillSwitchTest } from './KillSwitchTest'; import { SerializerTest } from './SerializerTest'; import { FileSizeCheckTest } from "./FileSizeCheckTest" import { GlobalTestHooks } from './GlobalTestHooks.Test'; export function registerTests() { new GlobalTestHooks().registerTests(); new PostChannelTest("PostChannelTest").registerTests(); new HttpManagerTest("HttpManagerTest").registerTests(); new HttpManagerTest("HttpManagerTest", true).registerTests(); new KillSwitchTest("KillSwitchTest").registerTests(); new SerializerTest("SerializerTest").registerTests(); new FileSizeCheckTest("FileSizeCheckTest").registerTests(); } registerTests(); ================================================ FILE: channels/1ds-post-js/test/UnitTests.html ================================================ 1DS Unit Tests
    ================================================ FILE: channels/1ds-post-js/test/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": false, "module": "amd", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "declaration": true }, "files": [] } ================================================ FILE: channels/1ds-post-js/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "module": "es6", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "strictNullChecks": false, "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "importHelpers": true, "noEmitHelpers": true, "forceConsistentCasingInFileNames": true, "declaration": true, "declarationDir": "build/types", "removeComments": false, "outDir": "dist-es5/", "rootDir": "./src" }, "include": [ "./src/**/*.ts" ], "exclude": [ "node_modules/" ] } ================================================ FILE: channels/1ds-post-js/tsdoc.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", "extends": ["../../tsdoc.json"] } ================================================ FILE: channels/1ds-post-js/typedoc.json ================================================ { "$schema": "https://typedoc.org/schema.json", "entryPoints": [ "./src/Index.ts" ], "exclude": [ "**/internal/**/*.ts", "node_modules/**" ], "externalPattern": [ "**/node_modules/**", "node_modules/**" ], "sort": [ "alphabetical", "kind", "instance-first" ], "basePath": "./src", "sourceLinkTemplate": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/{path}#L{line}", "cleanOutputDir": true, "excludeExternals": false, "excludeInternal": true, "excludePrivate": true, "includeVersion": true, "groupOrder": [ "Entrypoint", "Modules", "Namespaces", "Enumerations", "Enumeration Members", "Classes", "Interfaces", "Type Aliases", "Constructors", "Properties", "Variables", "Functions", "Accessors", "Methods", "References", "*" ], "tsconfig": "./tsconfig.json", "out": "../../docs/webSdk/1ds-post-js", "readme": "none", "githubPages": true, "gitRevision": "main", "compilerOptions": { "stripInternal": true }, "sidebarLinks": { "Changelog": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/RELEASES.md", "Readme": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/shared/1ds-post.js", }, "navigationLinks": { "GitHub": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/channels/1ds-post.js", "npm": "https://www.npmjs.com/package/@microsoft/1ds-post-js" }, "visibilityFilters": { "protected": false, "private": false, "inherited": true, "external": true } } ================================================ FILE: channels/applicationinsights-channel-js/.gitignore ================================================ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. # User-specific files *.suo *.user *.sln.docstates # Build results [Dd]ebug/ [Rr]elease/ [Bb]in/ [Oo]bj/ [Oo]bj//Core/Javascript/ai*.[tj]s* # Telemetry output *.onesipkg # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets !packages/*/build/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* *_i.c *_p.c *.ilk *.meta *.obj *.pch *.pdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb *.log *.scc # Visual C++ cache files ipch/ *.aps *.ncb *.opensdf *.sdf *.cachefile # Local tgz files *.tgz # Visual Studio profiler *.psess *.vsp *.vspx # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # NCrunch *.ncrunch* .*crunch*.local.xml # Installshield output folder [Ee]xpress/ # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html # Click-Once directory publish/ # Publish Web Output *.Publish.xml # NuGet binaries downloaded automatically packages/ # Windows Azure Build Output csx *.build.csdef # Windows Store app package directory AppPackages/ # Others sql/ *.Cache ClientBin/ [Ss]tyle[Cc]op.* ~$* *~ *.dbmdl *.[Pp]ublish.xml *.publishsettings # RIA/Silverlight projects Generated_Code/ # Backup & report files from converting an old project file to a newer # Visual Studio version. Backup files are not needed, because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm # SQL Server files App_Data/*.mdf App_Data/*.ldf #LightSwitch generated files GeneratedArtifacts/ _Pvt_Extensions/ ModelManifest.xml # ========================= # Windows detritus # ========================= # Windows image file caches Thumbs.db ehthumbs.db # Folder config file Desktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # Mac desktop service store files .DS_Store # Build log files *.err *.prf *.wrn # Visual studio 2015 user specific files JavaScript/.vs # Temp directories bundle/ node_modules/ out/ coreSDK/node_modules # Build directories browser/ dist-esm/ dist/ types/ # Grunt .tscache #npm npm # Rollup statistics.html ================================================ FILE: channels/applicationinsights-channel-js/.npmignore ================================================ # NPM Ignore # ignore everything * # ... but these files !package.json !tsconfig.json !dist-es*/** !dist/** !browser/** !types/** !/CODE_OF_CONDUCT.md !/CONTRIBUTING.md !/README.md !/SECURITY.md !/SUPPORT.md !/NOTICE !/PRIVACY !/LICENSE !/LICENSE.TXT ================================================ FILE: channels/applicationinsights-channel-js/LICENSE ================================================ The MIT License (MIT) Copyright (c) Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: channels/applicationinsights-channel-js/NOTICE ================================================ NOTICES AND INFORMATION Do Not Translate or Localize This software incorporates material from third parties. Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, or you may send a check or money order for US $5.00, including the product name, the open source component name, and version number, to: Source Code Compliance Team Microsoft Corporation One Microsoft Way Redmond, WA 98052 USA Notwithstanding any other terms, you may reverse engineer this software to the extent required to debug changes to any libraries licensed under the GNU Lesser General Public License. ================================================ FILE: channels/applicationinsights-channel-js/PRIVACY ================================================ # Data Collection The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ================================================ FILE: channels/applicationinsights-channel-js/README.md ================================================ # Microsoft Application Insights JavaScript SDK - Channel Channel layer for the Application Insights JavaScript SDK [![GitHub Workflow Status (main)](https://img.shields.io/github/actions/workflow/status/microsoft/ApplicationInsights-JS/ci.yml?branch=main)](https://github.com/microsoft/ApplicationInsights-JS/tree/main) [![Build Status](https://dev.azure.com/mseng/AppInsights/_apis/build/status%2FAppInsights%20-%20DevTools%2F1DS%20JavaScript%20SDK%20web%20SKU%20(main%3B%20master)?branchName=main)](https://dev.azure.com/mseng/AppInsights/_build/latest?definitionId=8184&branchName=main) [![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-channel-js.svg)](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-channel-js) ## Build ``` npm install -g grunt-cli npm install npm run build --silent ``` ## Test ``` npm run test ``` ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. ## License [MIT](LICENSE) ================================================ FILE: channels/applicationinsights-channel-js/Tests/Unit/src/GlobalTestHooks.Test.ts ================================================ import { Assert } from "@microsoft/ai-test-framework"; import { _testHookMaxUnloadHooksCb } from "@microsoft/applicationinsights-core-js"; import { dumpObj } from "@nevware21/ts-utils"; export class GlobalTestHooks { public registerTests() { // Set a global maximum _testHookMaxUnloadHooksCb(20, (state: string, hooks: Array) => { Assert.ok(false, "Max unload hooks exceeded [" + hooks.length + "] - " + state + " - " + dumpObj(hooks)); }); } } ================================================ FILE: channels/applicationinsights-channel-js/Tests/Unit/src/Sample.tests.ts ================================================ import { AITestClass } from "@microsoft/ai-test-framework"; import { createSampler } from "../../../src/TelemetryProcessors/Sample"; import { ITelemetryItem, isBeaconsSupported, newId } from "@microsoft/applicationinsights-core-js"; import { TelemetryItemCreator, IPageViewTelemetry, PageViewDataType, PageViewEnvelopeType, ISample } from "@microsoft/applicationinsights-core-js"; import { getHashCodeScore } from "../../../src/TelemetryProcessors/SamplingScoreGenerators/HashCodeScoreGenerator"; export class SampleTests extends AITestClass { private sample: ISample; private item: ITelemetryItem; public testInitialize() { // Reset the cached isBeacons supported isBeaconsSupported(false); } public testCleanup() { this.sample = null; this.item = null; } public registerTests() { this.addSamplingTests(); } private addSamplingTests() { this.testCase({ name: 'Sampling: isSampledIn returns true for 100 sampling rate', test: () => { this.sample = createSampler(100); this.item = this.getTelemetryItem(); const scoreStub = this.sandbox.stub(this.sample["generator"], "getScore"); QUnit.assert.ok(this.sample.isSampledIn(this.item)); QUnit.assert.ok(scoreStub.notCalled); } }); this.testCase({ name: 'Sampling: hashing is based on user id even if operation id is provided', test: () => { this.sample = createSampler(33); const userid = "asdf"; const item1 = this.getTelemetryItem(); item1.tags["ai.user.id"] = userid; item1.tags["ai.operation.id"] = "operation 1"; const item2 = this.getTelemetryItem(); item2.tags["ai.user.id"] = userid; item2.tags["ai.operation.id"] = "operation 1"; const isSampledIn1 = this.sample.isSampledIn(item1); const isSampledIn2 = this.sample.isSampledIn(item2); QUnit.assert.equal(isSampledIn1, isSampledIn2); } }); this.testCase({ name: 'Sampling: hashing is based on operation id if no user id is provided', test: () => { this.sample = createSampler(33); const operationId = "operation id"; const item1 = this.getTelemetryItem(); item1.tags["ai.user.id"] = null; item1.tags["ai.operation.id"] = operationId; const item2 = this.getTelemetryItem(); item2.tags["ai.user.id"] = null; item2.tags["ai.operation.id"] = operationId; const item3 = this.getTelemetryItem(); item3.tags["ai.user.id"] = null; item3.tags["ai.operation.id"] = operationId; const item4 = this.getTelemetryItem(); item4.tags["ai.user.id"] = null; item4.tags["ai.operation.id"] = operationId; // Act const isSampledIn1 = this.sample.isSampledIn(item1); const isSampledIn2 = this.sample.isSampledIn(item2); const isSampledIn3 = this.sample.isSampledIn(item3); const isSampledIn4 = this.sample.isSampledIn(item4); QUnit.assert.equal(isSampledIn1, isSampledIn2); QUnit.assert.equal(isSampledIn1, isSampledIn3); QUnit.assert.equal(isSampledIn1, isSampledIn4); } }); this.testCase({ name: 'Sampling: hashing is random if no user id nor operation id provided', test: () => { // setup this.sample = createSampler(33); const envelope1 = this.getTelemetryItem(); envelope1.tags["ai.user.id"] = null; envelope1.tags["ai.operation.id"] = null; const mathRandomSpy = this.sandbox.spy(Math, "random"); // act this.sample.isSampledIn(envelope1); // assert QUnit.assert.ok(mathRandomSpy.calledOnce); } }); this.testCase({ name: 'Sampling: actual sampling rate should fall into 5% error range', test: () => { // setup const errorRange = 5; const totalItems = 1000; const ids = []; for (let i = 0; i < totalItems; ++i) { ids.push(newId()); } const sampleRates = [50, 33, 25, 20, 16, 10]; // act sampleRates.forEach((sampleRate) => { let countOfSampledItems = 0; ids.forEach((id) => { if (getHashCodeScore(id) < sampleRate) {++countOfSampledItems; } }); // Assert const actualSampleRate = 100 * countOfSampledItems / totalItems; QUnit.assert.ok(Math.abs(actualSampleRate - sampleRate) < errorRange, "Actual sampling (" + actualSampleRate + ") does not fall into +-2% range from expected rate (" + sampleRate + ")"); }); } }); } private getTelemetryItem(): ITelemetryItem { return TelemetryItemCreator.create({ name: 'some page', uri: 'some uri' }, PageViewDataType, PageViewEnvelopeType, null); } private getMetricItem(): ITelemetryItem { return null; } } ================================================ FILE: channels/applicationinsights-channel-js/Tests/Unit/src/Sender.tests.ts ================================================ import { AITestClass, PollingAssert } from "@microsoft/ai-test-framework"; import { Sender } from "../../../src/Sender"; import { ExceptionDataType, IOfflineListener, createOfflineListener, utlGetSessionStorageKeys, utlRemoveSessionStorage } from "@microsoft/applicationinsights-core-js"; import { EnvelopeCreator } from '../../../src/EnvelopeCreator'; import { Exception, CtxTagKeys, DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH, utlCanUseSessionStorage, utlGetSessionStorage, utlSetSessionStorage, ITelemetryItem, AppInsightsCore, ITelemetryPlugin, DiagnosticLogger, NotificationManager, SendRequestReason, _eInternalMessageId, safeGetLogger, isString, isArray, arrForEach, isBeaconsSupported, IXHROverride, IPayloadData,TransportType, getWindow, ActiveStatus } from "@microsoft/applicationinsights-core-js"; import { ArraySendBuffer, SessionStorageSendBuffer } from "../../../src/SendBuffer"; import { IInternalStorageItem, ISenderConfig } from "../../../src/Interfaces"; import { createAsyncResolvedPromise } from "@nevware21/ts-async"; import { isPromiseLike, isUndefined } from "@nevware21/ts-utils"; import { SinonSpy } from 'sinon'; const BUFFER_KEY = "AI_buffer_1"; const SENT_BUFFER_KEY = "AI_sentBuffer_1"; export class SenderTests extends AITestClass { private _sender: Sender; private _instrumentationKey = 'iKey'; private _offline: IOfflineListener; private genericSpy: SinonSpy; private xhrOverride: IXHROverride; protected _getBuffer(key: string, logger: DiagnosticLogger, namePrefix?: string): IInternalStorageItem[] { let prefixedKey = key; try { prefixedKey = namePrefix ? namePrefix + "_" + prefixedKey : prefixedKey; const bufferJson = utlGetSessionStorage(logger, prefixedKey); if (bufferJson) { let buffer: IInternalStorageItem[] = JSON.parse(bufferJson); if (isString(buffer)) { buffer = JSON.parse(buffer as any); } if (buffer && isArray(buffer)) { return buffer; } } } catch (e) { QUnit.assert.ok(false, "Exception - " + e); } return []; } public testInitialize() { this._sender = new Sender(); this._offline = createOfflineListener("SenderTests"); this.xhrOverride = new AutoCompleteXhrOverride(); // Reset the cached isBeacons supported isBeaconsSupported(false); } public testFinishedCleanup() { if (this._offline) { this._offline.unload(); } if (this._sender && this._sender.isInitialized()) { this._sender.pause(); this._sender._buffer.clear(); this._sender.teardown(); } this._sender = null; } public registerTests() { this.testCase({ name: "Channel Config: Channel can properly take args from root config", test: () => { this._sender.initialize( { instrumentationKey: 'abc', maxBatchInterval: 123, endpointUrl: 'https://example.com', maxBatchSizeInBytes: 654, extensionConfig: { [this._sender.identifier]: { maxBatchSizeInBytes: 456 } } }, new AppInsightsCore(), [] ); let extConfig = this._sender._senderConfig; QUnit.assert.equal(123, extConfig.maxBatchInterval, 'Channel config can be set from root config (maxBatchInterval)'); QUnit.assert.equal('https://example.com', extConfig.endpointUrl, 'Channel config can be set from root config (endpointUrl)'); QUnit.assert.notEqual(654, extConfig.maxBatchSizeInBytes, 'Channel config does not equal root config option if extensionConfig field is also set'); QUnit.assert.equal(456, extConfig.maxBatchSizeInBytes, 'Channel config prioritizes extensionConfig over root config'); let offlinelistener = this._sender.getOfflineListener(); QUnit.assert.ok(offlinelistener, "offline listener exists") } }); this.testCase({ name: "Channel Config: Config can be set from root dynamically", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let id = this._sender.identifier; let coreConfig = { instrumentationKey: "abc", extensionConfig: { [id]: { } } } core.initialize(coreConfig, [this._sender]); // check defaults let defaultSenderConfig = this._sender._senderConfig; QUnit.assert.equal(15000, defaultSenderConfig.maxBatchInterval, "Channel default maxBatchInterval config is set"); QUnit.assert.equal("https://dc.services.visualstudio.com/v2/track", defaultSenderConfig.endpointUrl, "Channel default endpointUrl config is set"); QUnit.assert.equal(102400, defaultSenderConfig.maxBatchSizeInBytes, "Channel default maxBatchSizeInBytes config is set"); QUnit.assert.equal(false, defaultSenderConfig.emitLineDelimitedJson, "Channel default emitLineDelimitedJson config is set"); QUnit.assert.equal(false, defaultSenderConfig.disableTelemetry, "Channel default disableTelemetry config is set"); QUnit.assert.equal(true, defaultSenderConfig.enableSessionStorageBuffer, "Channel default enableSessionStorageBuffer config is set"); QUnit.assert.equal(false, defaultSenderConfig.isRetryDisabled, "Channel default isRetryDisabled config is set"); QUnit.assert.equal(true, defaultSenderConfig.isBeaconApiDisabled, "Channel default isBeaconApiDisabled config is set"); QUnit.assert.equal(false, defaultSenderConfig.disableXhr, "Channel default disableXhr config is set"); QUnit.assert.equal(false, defaultSenderConfig.onunloadDisableFetch, "Channel default onunloadDisableFetch config is set"); QUnit.assert.equal(false, defaultSenderConfig.onunloadDisableBeacon, "Channel default onunloadDisableBeacon config is set"); QUnit.assert.equal(undefined, defaultSenderConfig.namePrefix, "Channel default namePrefix config is set"); QUnit.assert.equal(100, defaultSenderConfig.samplingPercentage, "Channel default samplingPercentage config is set"); QUnit.assert.equal(undefined, defaultSenderConfig.customHeaders, "Channel default customHeaders config is set"); QUnit.assert.equal(undefined, defaultSenderConfig.convertUndefined, "Channel default convertUndefined config is set"); QUnit.assert.equal(10000, defaultSenderConfig.eventsLimitInMem, "Channel default eventsLimitInMem config is set"); QUnit.assert.equal(undefined, defaultSenderConfig.httpXHROverride, "Channel default httpXHROverride config is set"); QUnit.assert.equal(false, defaultSenderConfig.alwaysUseXhrOverride, "Channel default alwaysUseXhrOverride config is set"); QUnit.assert.equal(true, defaultSenderConfig.disableSendBeaconSplit, "Channel default disableSendBeaconSplit config is set"); QUnit.assert.equal(10, defaultSenderConfig.maxRetryCnt, "Channel default maxRetryCnt config is set"); //check dynamic config core.config.extensionConfig = core.config.extensionConfig? core.config.extensionConfig : {}; let config = { maxBatchInterval: 10000, maxBatchSizeInBytes: 100000, endpointUrl: "https://test", emitLineDelimitedJson: true, disableTelemetry: true, enableSessionStorageBuffer: false, isRetryDisabled: true, disableXhr: true, samplingPercentage: 90, customHeaders: [{header: "header1",value:"value1"}], alwaysUseXhrOverride: true, disableSendBeaconSplit: false, } core.config.extensionConfig[id] = config; this.clock.tick(1); let curSenderConfig = this._sender._senderConfig; QUnit.assert.equal(10000, curSenderConfig.maxBatchInterval, "Channel maxBatchInterval config is dynamically set"); QUnit.assert.equal(100000, curSenderConfig.maxBatchSizeInBytes, "Channel maxBatchSizeInBytes config is dynamically set"); QUnit.assert.equal("https://test", curSenderConfig.endpointUrl, "Channel endpointUrl config is dynamically set"); QUnit.assert.equal(true, curSenderConfig.emitLineDelimitedJson, "Channel emitLineDelimitedJson config is dynamically set"); QUnit.assert.equal(true, curSenderConfig.disableTelemetry, "Channel disableTelemetry config is dynamically set"); QUnit.assert.equal(false, curSenderConfig.enableSessionStorageBuffer, "Channel enableSessionStorageBuffer config is dynamically set"); QUnit.assert.equal(true, curSenderConfig.isRetryDisabled, "Channel isRetryDisabled config is dynamically set"); QUnit.assert.equal(90, curSenderConfig.samplingPercentage, "Channel samplingPercentage config is dynamically set"); QUnit.assert.deepEqual([{header: "header1",value:"value1"}], curSenderConfig.customHeaders, "Channel customHeaders config is dynamically set"); QUnit.assert.deepEqual(true, curSenderConfig.alwaysUseXhrOverride, "Channel alwaysUseXhrOverride config is dynamically set"); QUnit.assert.equal(false, curSenderConfig.disableSendBeaconSplit, "Channel disableSendBeaconSplit config is dynamically set"); core.config.extensionConfig[this._sender.identifier].emitLineDelimitedJson = undefined; core.config.extensionConfig[this._sender.identifier].endpointUrl = undefined; this.clock.tick(1); QUnit.assert.equal("https://dc.services.visualstudio.com/v2/track", this._sender._senderConfig.endpointUrl, "Channel default endpointUrl config is set"); QUnit.assert.equal(false, this._sender._senderConfig.emitLineDelimitedJson, "Channel default emitLineDelimitedJson config is set"); } }); this.testCaseAsync({ name: "zip test: gzip encode is working and content-encode header is set (feature opt-in)", stepDelay: 10, useFakeTimers: true, useFakeServer: true, steps: [ () => { this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "000e0000-e000-0000-a000-000000000000", featureOptIn : {["zipPayload"]: {mode: 3}}, extensionConfig: { [this._sender.identifier]: { httpXHROverride: this.xhrOverride, alwaysUseXhrOverride: true, } } } core.initialize(coreConfig, [this._sender]); const telemetryItem: ITelemetryItem = { name: 'fake item with some really long name to take up space quickly', iKey: 'iKey', baseType: 'some type', baseData: {} }; this._sender.processTelemetry(telemetryItem); this._sender.flush(); this.clock.tick(10); }].concat(PollingAssert.createPollingAssert(() => { if (this.genericSpy.called){ let request = this.genericSpy.getCall(0).args[0]; let gzipData = request.data; QUnit.assert.ok(gzipData, "data should be set"); QUnit.assert.equal(true, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should be gzip encoded"); QUnit.assert.equal(request.headers["Content-Encoding"], "gzip", "telemetry should be gzip encoded"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000) as any) }); this.testCaseAsync({ name: "zip test: gzip encode is disabled (feature opt-in not set)", stepDelay: 10, useFakeTimers: true, useFakeServer: true, steps: [ () => { this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "000e0000-e000-0000-a000-000000000000", extensionConfig: { [this._sender.identifier]: { httpXHROverride: this.xhrOverride, alwaysUseXhrOverride: true, } } } core.initialize(coreConfig, [this._sender]); const telemetryItem: ITelemetryItem = { name: 'fake item with some really long name to take up space quickly', iKey: 'iKey', baseType: 'some type', baseData: {} }; this._sender.processTelemetry(telemetryItem); this._sender.flush(); this.clock.tick(10); }].concat(PollingAssert.createPollingAssert(() => { if (this.genericSpy.called){ let request = this.genericSpy.getCall(0).args[0]; let gzipData = request.data; QUnit.assert.ok(gzipData, "data should be set"); QUnit.assert.equal(false, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should not be gzip encoded"); QUnit.assert.ok(!("Content-Encoding" in request.headers), "telemetry should not be gzip encoded"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000) as any) }); this.testCase({ name: "zip test: gzip encode is working and content-encode header is set (feature opt-in)", pollDelay: 10, useFakeTimers: true, useFakeServer: true, test: () => { this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "000e0000-e000-0000-a000-000000000000", featureOptIn : {["zipPayload"]: {mode: 3}}, extensionConfig: { [this._sender.identifier]: { httpXHROverride: this.xhrOverride, alwaysUseXhrOverride: true, } } } core.initialize(coreConfig, [this._sender]); const telemetryItem: ITelemetryItem = { name: 'fake item with some really long name to take up space quickly', iKey: 'iKey', baseType: 'some type', baseData: {} }; this._sender.processTelemetry(telemetryItem); this._sender.flush(); this.clock.tick(10); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { if (this.genericSpy.called) { let request = this.genericSpy.getCall(0).args[0]; let gzipData = request.data; QUnit.assert.ok(gzipData, "data should be set"); QUnit.assert.equal(true, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should be gzip encoded"); QUnit.assert.equal(request.headers["Content-Encoding"], "gzip", "telemetry should be gzip encoded"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000)); } }); this.testCase({ name: "zip test: gzip encode is disabled (feature opt-in not set)", pollDelay: 10, useFakeTimers: true, useFakeServer: true, test: () => { this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "000e0000-e000-0000-a000-000000000000", extensionConfig: { [this._sender.identifier]: { httpXHROverride: this.xhrOverride, alwaysUseXhrOverride: true, } } } core.initialize(coreConfig, [this._sender]); const telemetryItem: ITelemetryItem = { name: 'fake item with some really long name to take up space quickly', iKey: 'iKey', baseType: 'some type', baseData: {} }; this._sender.processTelemetry(telemetryItem); this._sender.flush(); this.clock.tick(10); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { if (this.genericSpy.called){ let request = this.genericSpy.getCall(0).args[0]; let gzipData = request.data; QUnit.assert.ok(gzipData, "data should be set"); QUnit.assert.equal(false, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should not be gzip encoded"); QUnit.assert.ok(!("Content-Encoding" in request.headers), "telemetry should not be gzip encoded"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000)); } }); this.testCase({ name: "zip test: gzip encode is working and content-encode header is set (feature opt-in)", pollDelay: 10, useFakeTimers: true, useFakeServer: true, test: () => { this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "000e0000-e000-0000-a000-000000000000", featureOptIn : {["zipPayload"]: {mode: 3}}, extensionConfig: { [this._sender.identifier]: { httpXHROverride: this.xhrOverride, alwaysUseXhrOverride: true, } } } core.initialize(coreConfig, [this._sender]); const telemetryItem: ITelemetryItem = { name: 'fake item with some really long name to take up space quickly', iKey: 'iKey', baseType: 'some type', baseData: {} }; this._sender.processTelemetry(telemetryItem); this._sender.flush(); this.clock.tick(10); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { if (this.genericSpy.called) { let request = this.genericSpy.getCall(0).args[0]; let gzipData = request.data; QUnit.assert.ok(gzipData, "data should be set"); QUnit.assert.equal(true, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should be gzip encoded"); QUnit.assert.equal(request.headers["Content-Encoding"], "gzip", "telemetry should be gzip encoded"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000)); } }); this.testCase({ name: "zip test: gzip encode is disabled (feature opt-in not set)", pollDelay: 10, useFakeTimers: true, useFakeServer: true, test: () => { this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "000e0000-e000-0000-a000-000000000000", extensionConfig: { [this._sender.identifier]: { httpXHROverride: this.xhrOverride, alwaysUseXhrOverride: true, } } } core.initialize(coreConfig, [this._sender]); const telemetryItem: ITelemetryItem = { name: 'fake item with some really long name to take up space quickly', iKey: 'iKey', baseType: 'some type', baseData: {} }; this._sender.processTelemetry(telemetryItem); this._sender.flush(); this.clock.tick(10); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { if (this.genericSpy.called){ let request = this.genericSpy.getCall(0).args[0]; let gzipData = request.data; QUnit.assert.ok(gzipData, "data should be set"); QUnit.assert.equal(false, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should not be gzip encoded"); QUnit.assert.ok(!("Content-Encoding" in request.headers), "telemetry should not be gzip encoded"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000)); } }); this.testCase({ name: "zip test: gzip encode is working and content-encode header is set (feature opt-in)", pollDelay: 10, useFakeTimers: true, useFakeServer: true, test: () => { this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "000e0000-e000-0000-a000-000000000000", featureOptIn : {["zipPayload"]: {mode: 3}}, extensionConfig: { [this._sender.identifier]: { httpXHROverride: this.xhrOverride, alwaysUseXhrOverride: true, } } } core.initialize(coreConfig, [this._sender]); const telemetryItem: ITelemetryItem = { name: 'fake item with some really long name to take up space quickly', iKey: 'iKey', baseType: 'some type', baseData: {} }; this._sender.processTelemetry(telemetryItem); this._sender.flush(); this.clock.tick(10); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { if (this.genericSpy.called) { let request = this.genericSpy.getCall(0).args[0]; let gzipData = request.data; QUnit.assert.ok(gzipData, "data should be set"); QUnit.assert.equal(true, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should be gzip encoded"); QUnit.assert.equal(request.headers["Content-Encoding"], "gzip", "telemetry should be gzip encoded"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000)); } }); this.testCase({ name: "zip test: gzip encode is disabled (feature opt-in not set)", pollDelay: 10, useFakeTimers: true, useFakeServer: true, test: () => { this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST'); let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "000e0000-e000-0000-a000-000000000000", extensionConfig: { [this._sender.identifier]: { httpXHROverride: this.xhrOverride, alwaysUseXhrOverride: true, } } } core.initialize(coreConfig, [this._sender]); const telemetryItem: ITelemetryItem = { name: 'fake item with some really long name to take up space quickly', iKey: 'iKey', baseType: 'some type', baseData: {} }; this._sender.processTelemetry(telemetryItem); this._sender.flush(); this.clock.tick(10); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { if (this.genericSpy.called){ let request = this.genericSpy.getCall(0).args[0]; let gzipData = request.data; QUnit.assert.ok(gzipData, "data should be set"); QUnit.assert.equal(false, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should not be gzip encoded"); QUnit.assert.ok(!("Content-Encoding" in request.headers), "telemetry should not be gzip encoded"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000)); } }); this.testCase({ name: "Channel Config: Endpoint Url can be set from root dynamically", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let id = this._sender.identifier; let coreConfig = { instrumentationKey: "abc", extensionConfig: { [id]: { } }, endpointUrl: "test" } core.initialize(coreConfig, [this._sender]); let senderConfig = this._sender._senderConfig; QUnit.assert.equal(senderConfig.endpointUrl, "test", "Channel default endpoint url config is set from root"); //check dynamic config core.config.endpointUrl = "test1"; this.clock.tick(1); let curSenderConfig = this._sender._senderConfig; QUnit.assert.equal(curSenderConfig.endpointUrl,"test1", "Channel endpoint config is dynamically changed"); } }); this.testCase({ name: "Channel Init: init with promise", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let ikeyPromise = createAsyncResolvedPromise("testIkey"); let urlPromise = createAsyncResolvedPromise("testUrl"); let coreConfig = { instrumentationKey: ikeyPromise, endpointUrl: urlPromise, initTimeOut: 80000, extensionConfig: {} } core.initialize(coreConfig, [this._sender]); let status = core.activeStatus && core.activeStatus(); QUnit.assert.equal(status, ActiveStatus.PENDING, "status should be set to pending"); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { let core = this._sender.core; let activeStatus = core.activeStatus && core.activeStatus(); if (activeStatus === ActiveStatus.ACTIVE) { QUnit.assert.equal("testIkey", core.config.instrumentationKey, "ikey should be set"); QUnit.assert.equal("testUrl", core.config.endpointUrl ,"endpoint shoule be set"); // getExtCfg only finds undefined values from core let senderConfig = this._sender._senderConfig; QUnit.assert.equal("testIkey", senderConfig.instrumentationKey, "sender ikey should be set"); QUnit.assert.equal("testUrl", senderConfig.endpointUrl ,"sender endpoint shoule be set"); return true; } return false; }, "Wait for promise response" + new Date().toISOString(), 60, 1000)); } }); this.testCase({ name: "Channel Config: Sender override can be handled correctly", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let sentPayloadData: any[] = []; var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: {[headerName: string]: string;}, response?: string) => void, sync?: boolean) => { sentPayloadData.push({payload: payload, sync: sync}); } }; let coreConfig = { instrumentationKey: "abc", extensionConfig: { [this._sender.identifier]: { httpXHROverride: xhrOverride } } } let testBatch: IInternalStorageItem[] = [{item: "test", cnt: 0}, {item: "test1", cnt: 0}]; const telemetryItem: ITelemetryItem = { name: "fake item", iKey: "test", baseType: "some type", baseData: {} }; core.initialize(coreConfig, [this._sender]); // with always override to false QUnit.assert.deepEqual(xhrOverride, this._sender._senderConfig.httpXHROverride, "Channel httpXHROverride config is set"); QUnit.assert.deepEqual(false, this._sender._senderConfig.alwaysUseXhrOverride, "Channel alwaysUseXhrOverride config is set"); this._sender._sender(testBatch, true); QUnit.assert.equal(0, sentPayloadData.length, "httpXHROverride is not called once with always override to false"); this._sender._sender(testBatch, false); QUnit.assert.equal(0, sentPayloadData.length, "httpXHROverride is not called once with always override to false test1"); try { this._sender.processTelemetry(telemetryItem); } catch(e) { QUnit.assert.ok(false, "Exception - " + e); } this._sender.onunloadFlush(); QUnit.assert.deepEqual(0, sentPayloadData.length, "httpXHROverride should not be called again test2"); // with always override to true core.config.extensionConfig = core.config.extensionConfig || {}; core.config.extensionConfig[this._sender.identifier].alwaysUseXhrOverride = true; this.clock.tick(1); QUnit.assert.deepEqual(true, this._sender._senderConfig.alwaysUseXhrOverride, "Channel alwaysUseXhrOverride config is set to true dynamically"); this._sender._sender(testBatch, true); QUnit.assert.deepEqual(1, sentPayloadData.length, "httpXHROverride should be called with always override to true"); let payload = sentPayloadData[0].payload; let sync = sentPayloadData[0].sync; QUnit.assert.equal(false, sync, "Channel httpXHROverride sync is called with false during send test1 (sender interface should be opposite with the sender)"); QUnit.assert.deepEqual(testBatch, payload.oriPayload, "Channel httpXHROverride sync is called with expected original payload"); QUnit.assert.deepEqual(this._sender._buffer.batchPayloads(testBatch),payload.data, "Channel httpXHROverride sync is called with expected batch payload"); try { this._sender.processTelemetry(telemetryItem); } catch(e) { QUnit.assert.ok(false, "Exception - " + e); } this._sender.onunloadFlush(); QUnit.assert.deepEqual(2, sentPayloadData.length, "httpXHROverride should be called"); let data = sentPayloadData[1].payload.oriPayload; payload = JSON.parse(data[0].item); QUnit.assert.deepEqual("test", payload.iKey, "httpXHROverride should send expected payload test1"); sync = sentPayloadData[1].sync; QUnit.assert.equal(true, sync, "Channel httpXHROverride sync is called with true during send test2 (sender interface should be opposite with the sender)"); } }); this.testCase({ name: "Channel Config MaxRetry Count: payload exceeds max retry count should not be sent again", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "abc", extensionConfig: { [this._sender.identifier]: { //httpXHROverride: xhrOverride, //alwaysUseXhrOverride: true, maxRetryCnt: 1 } } } const telemetryItem: ITelemetryItem = { name: "fake item", iKey: "test", baseType: "some type", baseData: {} }; core.initialize(coreConfig, [this._sender]); let logger = new DiagnosticLogger({instrumentationKey: "abc"}); core.logger = logger; QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [], "session storage buffer is empty"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), [], "session storage sent buffer is empty"); try { this._sender.processTelemetry(telemetryItem); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger).length, 1, "session storage buffer should have 1 item"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), [], "session storage sent buffer is empty test1"); } catch(e) { QUnit.assert.ok(false, "Exception - " + e); } // inital send, cnt = 0 this._sender.flush(false); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [], "session storage buffer is empty"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger).length, 1, "session storage sent buffer should have one event"); let requests = this._getXhrRequests(); QUnit.assert.deepEqual(requests.length, 1, "should have only 1 requests"); let request = requests[0]; this.sendJsonResponse(request, {}, 500); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger).length, 1, "session storage buffer should have one item test2"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), [], "session storage sent buffer should not have one event test2"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger)[0].cnt, 1, "session storage buffer should have item with retry cnt 1"); // retry 1, cnt = 1 this._sender.flush(false); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [], "session storage buffer is empty test4"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger).length, 1, "session storage sent buffer should have one event test4"); requests = this._getXhrRequests(); QUnit.assert.deepEqual(requests.length, 2, "should have only 1 requests"); request = requests[1]; this.sendJsonResponse(request, {}, 500); // items should not be added back QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [], "session storage buffer should not have one item test5"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), [], "session storage sent buffer should not have one event test5"); } }); this.testCase({ name: "Channel Config: Invalid paylod Sender should not be sent", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let sentPayloadData: any[] = []; var xhrOverride: IXHROverride = { sendPOST: (payload: IPayloadData, oncomplete: (status: number, headers: {[headerName: string]: string;}, response?: string) => void, sync?: boolean) => { sentPayloadData.push({payload: payload, sync: sync}); } }; let coreConfig = { instrumentationKey: "abc", extensionConfig: { [this._sender.identifier]: { httpXHROverride: xhrOverride, alwaysUseXhrOverride: true } } } let testBatch: string[] = ["test", "test1"]; core.initialize(coreConfig, [this._sender]); QUnit.assert.deepEqual(xhrOverride, this._sender._senderConfig.httpXHROverride, "Channel httpXHROverride config is set"); QUnit.assert.deepEqual(true, this._sender._senderConfig.alwaysUseXhrOverride, "Channel alwaysUseXhrOverride config is set"); // case 1: payload is null this._sender._sender(null as any, true); QUnit.assert.equal(0, sentPayloadData.length, "httpXHROverride is not called test1"); this._sender._sender(null as any, false); QUnit.assert.equal(0, sentPayloadData.length, "httpXHROverride is not called once sync test1"); // case 2: payload is none array this._sender._sender({} as any, true); QUnit.assert.equal(0, sentPayloadData.length, "httpXHROverride is not called test2"); this._sender._sender({} as any, false); QUnit.assert.equal(0, sentPayloadData.length, "httpXHROverride is not called once sync test2"); // case 3: payload is an empty array this._sender._sender([] as any, true); QUnit.assert.equal(0, sentPayloadData.length, "httpXHROverride is not called test3"); this._sender._sender([] as any, false); QUnit.assert.equal(0, sentPayloadData.length, "httpXHROverride is not called once sync test3"); this._sender._sender(testBatch, true); QUnit.assert.equal(1, sentPayloadData.length, "httpXHROverride is called test4"); this._sender._sender(testBatch, false); QUnit.assert.equal(2, sentPayloadData.length, "httpXHROverride is called once sync test4"); } }); this.testCase({ name: "Channel Config: sessionStorage can get items from previous buffers", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "b7170927-2d1c-44f1-acec-59f4e1751c13", extensionConfig: { [this._sender.identifier]: { namePrefix: "test" } } } let item1: ITelemetryItem = { name: "fake item1", iKey: "abc", baseType: "some type", baseData: {} }; let item2: ITelemetryItem = { name: "fake item2", iKey: "abc", baseType: "some type", baseData: {} }; let item3: ITelemetryItem = { name: "fake item3", iKey: "abc", baseType: "some type", baseData: {} }; let item4: ITelemetryItem = { name: "fake item4", iKey: "abc", baseType: "some type", baseData: {} }; let item5: ITelemetryItem = { name: "fake item5", iKey: "abc", baseType: "some type", baseData: {} }; let items = [item1, item2]; let sentItems = [item3]; let prefixItems = [item4, item5]; //mock previous items stored in previous buffer key sessionStorage.setItem("AI_buffer",JSON.stringify(items)); sessionStorage.setItem("AI_sentBuffer",JSON.stringify(sentItems)); sessionStorage.setItem("test_AI_buffer",JSON.stringify(prefixItems)); let keys = utlGetSessionStorageKeys(); QUnit.assert.deepEqual(keys.length, 3, "session buffer should contain only three keys"); let logger = new DiagnosticLogger({instrumentationKey: "abc"}); core.logger = logger; core.initialize(coreConfig, [this._sender]); QUnit.assert.equal(true, this._sender._senderConfig.enableSessionStorageBuffer, "Channel default enableSessionStorageBuffer config is set"); QUnit.assert.equal(true, utlCanUseSessionStorage(), "SessionStorage should be able to use"); QUnit.assert.deepEqual(this._getBuffer("test_" + BUFFER_KEY, logger).length, 5, "session storage buffer should contain all previous events"); QUnit.assert.deepEqual(this._getBuffer("test_" + SENT_BUFFER_KEY, logger), [], "session storage sent buffer is empty"); let previousItems = this._sender._buffer.getItems(); QUnit.assert.deepEqual(previousItems.length, 5, "buffer should contain 5 previous items"); keys = utlGetSessionStorageKeys(); QUnit.assert.deepEqual(keys.length, 2, "session buffer should contain only two keys"); QUnit.assert.ok(keys.indexOf("test_" + BUFFER_KEY) > -1, "session buffer key contain buffer key"); QUnit.assert.ok(keys.indexOf("test_" + SENT_BUFFER_KEY) > -1, "session buffer key contain sent buffer key"); utlRemoveSessionStorage(logger, "test_" + BUFFER_KEY); utlRemoveSessionStorage(logger, "test_" + SENT_BUFFER_KEY); } }); this.testCase({ name: "Channel Config: sessionStorage change from true to false can be handled correctly", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "b7170927-2d1c-44f1-acec-59f4e1751c13", extensionConfig: { [this._sender.identifier]: { } } } let logger = new DiagnosticLogger({instrumentationKey: "abc"}); core.logger = logger; const loggerSpy = this.sandbox.stub(this._sender, "triggerSend"); core.initialize(coreConfig, [this._sender]); QUnit.assert.equal(true, this._sender._senderConfig.enableSessionStorageBuffer, "Channel default enableSessionStorageBuffer config is set"); QUnit.assert.equal(true, utlCanUseSessionStorage(), "SessionStorage should be able to use"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [], "session storage buffer is empty"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), [], "session storage sent buffer is empty"); QUnit.assert.deepEqual(this._sender._buffer.getItems(), [], "buffer is empty"); const telemetryItem: ITelemetryItem = { name: "fake item", iKey: "abc", baseType: "some type", baseData: {} }; try { this._sender.processTelemetry(telemetryItem); } catch(e) { QUnit.assert.ok(false, "Exception - " + e); } QUnit.assert.equal(false, loggerSpy.calledOnce, "The send has not yet been triggered"); let payload = this._getBuffer(BUFFER_KEY, logger); QUnit.assert.equal(payload.length, 1, "payload length is equal to one"); QUnit.assert.ok(payload[0].item.indexOf("some type") > 0, "payload is saved to session storage"); let sentPayload = this._getBuffer(SENT_BUFFER_KEY, logger); QUnit.assert.deepEqual([], sentPayload, "sent payload is empty"); QUnit.assert.equal(this._sender._buffer.getItems().length, 1, "buffer length shoule be one"); // change enableSessionStorageBuffer core.config.extensionConfig = core.config.extensionConfig? core.config.extensionConfig : {}; core.config.extensionConfig[this._sender.identifier].enableSessionStorageBuffer = false; this.clock.tick(1); QUnit.assert.equal(false, this._sender._senderConfig.enableSessionStorageBuffer, "Channel enableSessionStorageBuffer config is disabled"); QUnit.assert.equal(this._sender._buffer.getItems().length, 1, "session storage buffer is transferred"); QUnit.assert.ok(this._sender._buffer.getItems()[0].item.indexOf("some type") > 1, "in memory storage buffer is set"); this.clock.tick(15000); QUnit.assert.equal(true, loggerSpy.calledOnce, "The send has been triggered"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [], "session storage buffer is empty"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), [], "session storage sent buffer is empty"); utlSetSessionStorage(logger, BUFFER_KEY,JSON.stringify([])); } }); this.testCase({ name: "Storage Prefix Test: prefix should be added after init", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let setItemSpy = this.sandbox.spy(window.sessionStorage, "setItem"); let storagePrefix = "storageTestPrefix" let coreConfig = { instrumentationKey: "b7170927-2d1c-44f1-acec-59f4e1751c13ttt", storagePrefix: storagePrefix, extensionConfig: { [this._sender.identifier]: { } } } let logger = new DiagnosticLogger({instrumentationKey: "abc"}); core.logger = logger; core.initialize(coreConfig, [this._sender]); let firstCallArgs = setItemSpy.args[0]; // Arguments of the first call QUnit.assert.true(JSON.stringify(firstCallArgs).includes(storagePrefix)); utlSetSessionStorage(logger, BUFFER_KEY,JSON.stringify([])); } }); this.testCase({ name: "Channel Config: sessionStorage change from false to true can be handled correctly", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "b7170927-2d1c-44f1-acec-59f4e1751c13", enableSessionStorageBuffer: false, extensionConfig: { [this._sender.identifier]: { } } } let logger = new DiagnosticLogger({instrumentationKey: "abc"}); core.logger = logger; const loggerSpy = this.sandbox.stub(this._sender, "triggerSend"); core.initialize(coreConfig, [this._sender]); QUnit.assert.equal(false, this._sender._senderConfig.enableSessionStorageBuffer, "Channel enableSessionStorageBuffer config is set to false"); QUnit.assert.equal(true, utlCanUseSessionStorage(), "utlCanUseSessionStorage should return true"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [], "session storage buffer is empty"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), [], "session storage sent buffer is empty"); QUnit.assert.deepEqual(this._sender._buffer.getItems(), [], "buffer is empty"); const telemetryItem: ITelemetryItem = { name: "fake item", iKey: "abc", baseType: "some type", baseData: {} }; try { this._sender.processTelemetry(telemetryItem); } catch(e) { QUnit.assert.ok(false, "Exception - " + e); } QUnit.assert.equal(false, loggerSpy.calledOnce, "The send has not yet been triggered"); QUnit.assert.equal(this._sender._buffer.getItems().length, 1, "session storage in memory buffer is set"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [], "session storage buffer is empty"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), [], "session storage sent buffer is empty"); // change enableSessionStorageBuffer core.config.extensionConfig = core.config.extensionConfig? core.config.extensionConfig : {}; core.config.extensionConfig[this._sender.identifier].enableSessionStorageBuffer = true; this.clock.tick(1); QUnit.assert.equal(true, this._sender._senderConfig.enableSessionStorageBuffer, "Channel enableSessionStorageBuffer config is set to true"); let payload = this._getBuffer(BUFFER_KEY, logger); QUnit.assert.equal(payload.length, 1, "payload length is equal to one"); QUnit.assert.ok(payload[0].item.indexOf("some type") > 0, "payload is saved to session storage"); QUnit.assert.equal(this._sender._buffer.getItems().length, 1, "buffer length shoule be one"); let sentPayload = this._getBuffer(SENT_BUFFER_KEY, logger); QUnit.assert.deepEqual([], sentPayload, "sent payload is empty"); utlSetSessionStorage(logger, BUFFER_KEY,JSON.stringify([])); } }); this.testCase({ name: "Channel Config: sessionStorage prefixName change can be handled correctly", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "b7170927-2d1c-44f1-acec-59f4e1751c13", extensionConfig: { [this._sender.identifier]: { } } } let prefixName = "test"; let logger = new DiagnosticLogger({instrumentationKey: "abc"}); core.logger = logger; const loggerSpy = this.sandbox.stub(this._sender, "triggerSend"); core.initialize(coreConfig, [this._sender]); QUnit.assert.equal(true, this._sender._senderConfig.enableSessionStorageBuffer, "Channel enableSessionStorageBuffer config is set to true"); QUnit.assert.equal(undefined, this._sender._senderConfig.namePrefix, "Channel namePrefix config is set to default"); QUnit.assert.equal(true, utlCanUseSessionStorage(), "utlCanUseSessionStorage should return true"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [], "session storage buffer is empty"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger, prefixName), [], "session storage buffer with prefix is empty"); const telemetryItem: ITelemetryItem = { name: "fake item", iKey: "abc", baseType: "some type", baseData: {} }; try { this._sender.processTelemetry(telemetryItem); } catch(e) { QUnit.assert.ok(false, "Exception - " + e); } QUnit.assert.equal(false, loggerSpy.calledOnce, "The send has not yet been triggered"); QUnit.assert.equal(this._sender._buffer.getItems().length, 1, "session storage buffer is set"); let payload = this._getBuffer(BUFFER_KEY, logger); QUnit.assert.equal(payload.length, 1, "payload length is equal to one"); QUnit.assert.ok(payload[0].item.indexOf("some type") > 0, "payload is saved to session storage"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger, prefixName), [], "session storage buffer with prefix is empty"); // change prefix core.config.extensionConfig = core.config.extensionConfig? core.config.extensionConfig : {}; core.config.extensionConfig[this._sender.identifier].namePrefix = prefixName; this.clock.tick(1); QUnit.assert.equal(prefixName, this._sender._senderConfig.namePrefix, "Channel namePrefix config is set"); QUnit.assert.deepEqual([], this._getBuffer(BUFFER_KEY, logger), "default buffer is empty"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), [], "session storage sent buffer is empty"); payload = this._getBuffer(BUFFER_KEY, logger, prefixName); QUnit.assert.equal(payload.length, 1, "payload length is equal to one"); QUnit.assert.ok(payload[0].item.indexOf("some type") > 0, "payload is saved to session storage with prefix"); QUnit.assert.equal(this._sender._buffer.getItems().length, 1, "new session storage buffer is set"); utlSetSessionStorage(logger, BUFFER_KEY,JSON.stringify([])); utlSetSessionStorage(logger, `${prefixName}_${BUFFER_KEY}`,JSON.stringify([])); } }); this.testCase({ name: "Channel Config: endpoint change can be handled correctly", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let coreConfig = { instrumentationKey: "b7170927-2d1c-44f1-acec-59f4e1751c13", extensionConfig: { [this._sender.identifier]: { } } } let logger = new DiagnosticLogger({instrumentationKey: "abc"}); core.logger = logger; const loggerSpy = this.sandbox.stub(this._sender, "triggerSend"); core.initialize(coreConfig, [this._sender]); QUnit.assert.equal("https://dc.services.visualstudio.com/v2/track", this._sender._senderConfig.endpointUrl, "Channel default endpointUrl config is set"); QUnit.assert.equal(true, this._sender._senderConfig.enableSessionStorageBuffer, "Channel enableSessionStorageBuffer config is set to false"); QUnit.assert.equal(true, utlCanUseSessionStorage(), "utlCanUseSessionStorage should return true"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [], "session storage buffer is empty"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), [], "session storage sent buffer is empty"); const telemetryItem: ITelemetryItem = { name: "fake item", iKey: "test", baseType: "some type", baseData: {} }; try { this._sender.processTelemetry(telemetryItem); } catch(e) { QUnit.assert.ok(false, "Exception - " + e); } QUnit.assert.equal(false, loggerSpy.calledOnce, "The send has not yet been triggered"); let payload = this._getBuffer(BUFFER_KEY, logger); QUnit.assert.equal(payload.length, 1, "payload length is equal to one"); QUnit.assert.ok(payload[0].item.indexOf("some type") > 0, "payload is saved to session storage"); // change endpointUrl core.config.extensionConfig = core.config.extensionConfig? core.config.extensionConfig : {}; core.config.extensionConfig[this._sender.identifier].endpointUrl = "https://example.com"; this.clock.tick(1); QUnit.assert.equal("https://example.com", this._sender._senderConfig.endpointUrl, "Channel endpointUrl config is changed"); payload = this._sender._buffer.getItems(); QUnit.assert.deepEqual(payload.length, 1, "buffer is not changed"); payload = this._getBuffer(BUFFER_KEY, logger); QUnit.assert.ok(payload[0].item.indexOf("some type") > 0, "payload is not changed"); utlSetSessionStorage(logger, BUFFER_KEY,JSON.stringify([])); } }); this.testCase({ name: "ArraySendBuffer createNew: function createNew() can return expected array buffer", test: () => { let config = { endpointUrl: "https//: test", emitLineDelimitedJson: false, maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, disableTelemetry: false, enableSessionStorageBuffer: true, isRetryDisabled: false, isBeaconApiDisabled:true, disableXhr: false, onunloadDisableFetch: false, onunloadDisableBeacon: false, instrumentationKey:"key", namePrefix: "", samplingPercentage: 100, customHeaders: [{header:"header",value:"val" }], convertUndefined: "", eventsLimitInMem: 10000 } as ISenderConfig; let logger = new DiagnosticLogger({instrumentationKey: "abc"}); let arrBuffer = new ArraySendBuffer(logger, config); let arrBufferCopy= arrBuffer.createNew(logger, config, false); // set to false to make sure it is array buffer QUnit.assert.deepEqual(arrBufferCopy.getItems(), [], "payload should be empty"); //let payload = [{"payload1"}, "payload2", "payload3", "payload4", "payload5", "payload6"]; let payload = [{item: "payload1", cnt: 0}, {item: "payload2", cnt: 0}, {item: "payload3", cnt: 0}, {item: "payload4", cnt: 0}, {item: "payload5", cnt: 0}, {item: "payload6", cnt: 0} ]; arrForEach(payload, (val) =>{ arrBuffer.enqueue(val); }); arrBufferCopy = arrBuffer.createNew(logger, config, false); QUnit.assert.deepEqual(payload, arrBufferCopy.getItems(), "payload should be same"); arrBuffer.enqueue({item:"payload", cnt: 0}); QUnit.assert.deepEqual(arrBuffer.getItems().length, 7, "arrBuffer length"); QUnit.assert.deepEqual(arrBufferCopy.getItems().length, 6, "copy is deep copy"); } }); this.testCase({ name: "ArraySendBuffer Max Count: item exceeds max cnt should not be added again", test: () => { let config = { endpointUrl: "https//: test", emitLineDelimitedJson: false, maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, disableTelemetry: false, enableSessionStorageBuffer: true, isRetryDisabled: false, isBeaconApiDisabled:true, disableXhr: false, onunloadDisableFetch: false, onunloadDisableBeacon: false, instrumentationKey:"key", namePrefix: "", samplingPercentage: 100, customHeaders: [{header:"header",value:"val" }], convertUndefined: "", eventsLimitInMem: 10000, maxRetryCnt: 1 } as ISenderConfig; let logger = new DiagnosticLogger({instrumentationKey: "abc"}); let arrBuffer = new ArraySendBuffer(logger, config); QUnit.assert.deepEqual(arrBuffer.getItems(), [], "payload should be empty"); let payload1 = {item: "payload1", cnt: 1}; arrBuffer.enqueue(payload1); QUnit.assert.deepEqual(arrBuffer.getItems().length, 1, "buffer should have one item"); let payload2 = {item: "payload2", cnt: 2}; arrBuffer.enqueue(payload2); QUnit.assert.deepEqual(arrBuffer.getItems().length, 1, "payload exceeds max cnt should not be added again"); utlSetSessionStorage(logger, BUFFER_KEY,JSON.stringify([])) } }); this.testCase({ name: "ArraySendBuffer createNew: function createNew() can return expected sessionStorage buffer", test: () => { let config = { endpointUrl: "https//: test", emitLineDelimitedJson: false, maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, disableTelemetry: false, enableSessionStorageBuffer: true, isRetryDisabled: false, isBeaconApiDisabled:true, disableXhr: false, onunloadDisableFetch: false, onunloadDisableBeacon: false, instrumentationKey:"key", namePrefix: "", samplingPercentage: 100, customHeaders: [{header:"header",value:"val" }], convertUndefined: "", eventsLimitInMem: 10000 } as ISenderConfig; let logger = new DiagnosticLogger({instrumentationKey: "abc"}); let arrBuffer = new ArraySendBuffer(logger, config); let sessionBuffer = arrBuffer.createNew(logger, config, true); // set to false to make sure it is session storage buffer QUnit.assert.deepEqual(sessionBuffer.getItems(), [], "payload should be empty"); //let payload = ["payload1", "payload2", "payload3", "payload4", "payload5", "payload6"]; let payload = [{item: "payload1", cnt: 0}, {item: "payload2", cnt: 0}, {item: "payload3", cnt: 0}, {item: "payload4", cnt: 0}, {item: "payload5", cnt: 0}, {item: "payload6", cnt: 0} ]; arrForEach(payload, (val) =>{ arrBuffer.enqueue(val); }); sessionBuffer = arrBuffer.createNew(logger, config, true); QUnit.assert.deepEqual(sessionBuffer.getItems(), payload, "payload should be same"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), payload, "session storage buffer is set"); arrBuffer.enqueue({item: "payload", cnt: 0}); QUnit.assert.deepEqual(arrBuffer.getItems().length, 7, "arrBuffer length"); QUnit.assert.deepEqual(sessionBuffer.getItems().length, 6, "copy is deep copy"); utlSetSessionStorage(logger, BUFFER_KEY,JSON.stringify([])); } }); this.testCase({ name: "SessionStorageSendBuffer createNew: function createNew() can return expected array buffer", test: () => { let config = { endpointUrl: "https//: test", emitLineDelimitedJson: false, maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, disableTelemetry: false, enableSessionStorageBuffer: true, isRetryDisabled: false, isBeaconApiDisabled:true, disableXhr: false, onunloadDisableFetch: false, onunloadDisableBeacon: false, instrumentationKey:"key", namePrefix: "", samplingPercentage: 100, customHeaders: [{header:"header",value:"val" }], convertUndefined: "", eventsLimitInMem: 10000 } as ISenderConfig; let logger = new DiagnosticLogger({instrumentationKey: "abc"}); let sessionBuffer = new SessionStorageSendBuffer(logger, config); let arrBuffer = sessionBuffer.createNew(logger, config, false); QUnit.assert.deepEqual(arrBuffer.getItems(), [], "payload should be empty"); //let payload = ["payload1", "payload2", "payload3", "payload4", "payload5", "payload6"]; let payload = [{item: "payload1", cnt: 0}, {item: "payload2", cnt: 0}, {item: "payload3", cnt: 0}, {item: "payload4", cnt: 0}, {item: "payload5", cnt: 0}, {item: "payload6", cnt: 0} ]; arrForEach(payload, (val) =>{ sessionBuffer.enqueue(val); }); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), payload, "session storage buffer is set"); arrBuffer = sessionBuffer.createNew(logger, config, false); QUnit.assert.deepEqual(arrBuffer.getItems(), payload, "payload should be same"); sessionBuffer.enqueue({item: "payload", cnt: 0}); QUnit.assert.deepEqual(sessionBuffer.getItems().length, 1, "sessionBuffer length"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [{item: "payload", cnt: 0}], "session storage buffer is set"); QUnit.assert.deepEqual(arrBuffer.getItems().length, 6, "copy is deep copy"); utlSetSessionStorage(logger, BUFFER_KEY,JSON.stringify([])); } }); this.testCase({ name: "SessionStorageSendBuffer Max Count: payload exceeds max retry cnt should not be added again", test: () => { let config = { endpointUrl: "https//: test", emitLineDelimitedJson: false, maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, disableTelemetry: false, enableSessionStorageBuffer: true, isRetryDisabled: false, isBeaconApiDisabled:true, disableXhr: false, onunloadDisableFetch: false, onunloadDisableBeacon: false, instrumentationKey:"key", namePrefix: "", samplingPercentage: 100, customHeaders: [{header:"header",value:"val" }], convertUndefined: "", eventsLimitInMem: 10000, maxRetryCnt: 1 } as ISenderConfig; let logger = new DiagnosticLogger({instrumentationKey: "abc"}); let sessionBuffer = new SessionStorageSendBuffer(logger, config); QUnit.assert.deepEqual(sessionBuffer.getItems(), [], "payload should be empty"); let payload1 = {item: "payload1", cnt: 1}; sessionBuffer.enqueue(payload1); QUnit.assert.deepEqual(sessionBuffer.getItems().length, 1, "should have only one payload"); let payload2 = {item: "payload2", cnt: 2}; sessionBuffer.enqueue(payload2); QUnit.assert.deepEqual(sessionBuffer.getItems().length, 1, "should have only one payload"); utlSetSessionStorage(logger, BUFFER_KEY,JSON.stringify([])); } }); this.testCase({ name: "SessionStorageSendBuffer createNew: function createNew() can return expected sessionStorage buffer with same prefix name", test: () => { let config = { endpointUrl: "https//: test", emitLineDelimitedJson: false, maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, disableTelemetry: false, enableSessionStorageBuffer: true, isRetryDisabled: false, isBeaconApiDisabled:true, disableXhr: false, onunloadDisableFetch: false, onunloadDisableBeacon: false, instrumentationKey:"key", namePrefix: "", samplingPercentage: 100, customHeaders: [{header:"header",value:"val" }], convertUndefined: "", eventsLimitInMem: 10000 } as ISenderConfig; let logger = new DiagnosticLogger({instrumentationKey: "abc"}); let sessionBuffer = new SessionStorageSendBuffer(logger, config); let sessionBufferCopy = sessionBuffer.createNew(logger, config, true); QUnit.assert.deepEqual(sessionBufferCopy.getItems(), [], "payload should be empty"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [], "session storage buffer should be empty"); //let payload = ["payload1", "payload2", "payload3", "payload4", "payload5", "payload6"]; let payload = [{item: "payload1", cnt: 0}, {item: "payload2", cnt: 0}, {item: "payload3", cnt: 0}, {item: "payload4", cnt: 0}, {item: "payload5", cnt: 0}, {item: "payload6", cnt: 0} ]; let sentPayload = [{item: "sent1", cnt: 0}, {item: "sent2", cnt: 0}, {item: "sent3", cnt: 0}, {item: "sent4", cnt: 0} ]; //let sentPayload = ["sent1", "sent2","sent3","sent4"]; arrForEach(payload, (val) =>{ sessionBuffer.enqueue(val); }); sessionBuffer.markAsSent(sentPayload); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), payload, "session storage buffer is set"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), sentPayload, "session storage sent buffer is set"); QUnit.assert.deepEqual(sessionBuffer.getItems(), payload, "getItems() should only return unsent items"); sessionBufferCopy = sessionBuffer.createNew(logger, config, true); QUnit.assert.deepEqual(sessionBufferCopy.getItems(), payload, "payload should be same"); QUnit.assert.deepEqual(sessionBuffer.getItems(), [], "original session storage buffer should be clear"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), payload, "session storage should not be changed"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), sentPayload, "session storage sent buffer should not be changed"); utlSetSessionStorage(logger, BUFFER_KEY,JSON.stringify([])); utlSetSessionStorage(logger, SENT_BUFFER_KEY,JSON.stringify([])); } }); this.testCase({ name: "SessionStorageSendBuffer createNew: function createNew() can return expected sessionStorage buffer with different prefix name", test: () => { let prefix = "prefix" let config = { endpointUrl: "https//: test", emitLineDelimitedJson: false, maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, disableTelemetry: false, enableSessionStorageBuffer: true, isRetryDisabled: false, isBeaconApiDisabled:true, disableXhr: false, onunloadDisableFetch: false, onunloadDisableBeacon: false, instrumentationKey:"key", namePrefix: "", samplingPercentage: 100, customHeaders: [{header:"header",value:"val" }], convertUndefined: "", eventsLimitInMem: 10000 } as ISenderConfig; let newConfig = {...config}; newConfig.namePrefix = prefix; let logger = new DiagnosticLogger({instrumentationKey: "abc"}); let sessionBuffer = new SessionStorageSendBuffer(logger, config); let sessionBufferCopy = sessionBuffer.createNew(logger, newConfig, true); QUnit.assert.deepEqual(sessionBufferCopy.getItems(), [], "payload should be empty"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [], "session storage buffer should be empty"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), [], "session storage sent buffer should be empty"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger, prefix), [], "session storage sent buffer with prefix should be empty"); // let payload = ["payload1", "payload2", "payload3", "payload4", "payload5", "payload6"]; // let sentPayload = ["sent1", "sent2","sent3","sent4"]; let payload = [{item: "payload1", cnt: 0}, {item: "payload2", cnt: 0}, {item: "payload3", cnt: 0}, {item: "payload4", cnt: 0}, {item: "payload5", cnt: 0}, {item: "payload6", cnt: 0} ]; let sentPayload = [{item: "sent1", cnt: 0}, {item: "sent2", cnt: 0}, {item: "sent3", cnt: 0}, {item: "sent4", cnt: 0} ]; arrForEach(payload, (val) =>{ sessionBuffer.enqueue(val); }); sessionBuffer.markAsSent(sentPayload); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), payload, "session storage buffer is set"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), sentPayload, "session storage sent buffer is set"); QUnit.assert.deepEqual(sessionBuffer.getItems(), payload, "getItems() should only return unsent items"); sessionBufferCopy = sessionBuffer.createNew(logger, newConfig, true); QUnit.assert.deepEqual(sessionBufferCopy.getItems(), payload, "payload should be same"); QUnit.assert.deepEqual(sessionBuffer.getItems(), [], "original session storage buffer should be clear"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger, prefix), payload, "new session storage buffer should be set"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger, prefix), sentPayload, "session storage sent buffer with prefix should be set"); QUnit.assert.deepEqual(this._getBuffer(BUFFER_KEY, logger), [], "previous session storage should be clear"); QUnit.assert.deepEqual(this._getBuffer(SENT_BUFFER_KEY, logger), [], "previous session storage sent buffer should be clear"); utlSetSessionStorage(logger, BUFFER_KEY,JSON.stringify([])); utlSetSessionStorage(logger, SENT_BUFFER_KEY,JSON.stringify([])); utlSetSessionStorage(logger, `${prefix}_${BUFFER_KEY}`,JSON.stringify([])); utlSetSessionStorage(logger, `${prefix}_${SENT_BUFFER_KEY}`,JSON.stringify([])); } }); this.testCase({ name: "Channel Config: Offline Support", test: () => { this._sender.initialize( { instrumentationKey: "abc", maxBatchInterval: 123, endpointUrl: DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH, maxBatchSizeInBytes: 654, extensionConfig: { [this._sender.identifier]: { maxBatchSizeInBytes: 456 } } }, new AppInsightsCore(), [] ); let event: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; let offlineSupport = this._sender.getOfflineSupport() as any; QUnit.assert.ok(offlineSupport.serialize, "serialize exist"); let eventStr = offlineSupport.serialize(event); let expectedStr = `"iKey":"iKey","name":"Microsoft.ApplicationInsights.iKey.Event","tags":{"ai.internal.sdkVersion":"javascript:${EnvelopeCreator.Version}"},"data":{"baseType":"EventData","baseData":{"ver":2,"name":"not_specified","properties":{"baseTypeSource":"some type"},"measurements":{}}}`; QUnit.assert.ok(eventStr.indexOf(expectedStr) > -1, "get expected string"); let testStr = `{"name":"testEvent","iKey":"o:testIkey","data":{"baseData":{}}}`; QUnit.assert.ok(offlineSupport.batch, "batch should exit"); let batch = offlineSupport.batch([testStr, testStr]); QUnit.assert.equal(batch, `[{"name":"testEvent","iKey":"o:testIkey","data":{"baseData":{}}},{"name":"testEvent","iKey":"o:testIkey","data":{"baseData":{}}}]`, "get expected batch"); QUnit.assert.ok(offlineSupport.shouldProcess, "should process should exit"); QUnit.assert.equal(offlineSupport.shouldProcess(event), true, "should process"); QUnit.assert.ok(offlineSupport.createPayload, "getOffline createPayload should exit"); let details = offlineSupport.createPayload("test"); QUnit.assert.equal(details.urlString, "https://dc.services.visualstudio.com/v2/track", "get expected Url"); QUnit.assert.ok(details.headers, "should have headers"); QUnit.assert.equal(details.headers["Sdk-Context"], "appId", "get expected headers"); QUnit.assert.equal(details.data, "test", "should use headers"); } }); this.testCase({ name: "Channel Config: Validate empty endpointURL falls back to the default", test: () => { this._sender.initialize( { instrumentationKey: 'abc', maxBatchInterval: 123, endpointUrl: '', maxBatchSizeInBytes: 654, extensionConfig: { [this._sender.identifier]: { maxBatchSizeInBytes: 456 } } }, new AppInsightsCore(), [] ); QUnit.assert.equal(123, this._sender._senderConfig.maxBatchInterval, 'Channel config can be set from root config (maxBatchInterval)'); QUnit.assert.equal(DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH, this._sender._senderConfig.endpointUrl, 'Channel config can be set from root config (endpointUrl)'); QUnit.assert.notEqual(654, this._sender._senderConfig.maxBatchSizeInBytes, 'Channel config does not equal root config option if extensionConfig field is also set'); QUnit.assert.equal(456, this._sender._senderConfig.maxBatchSizeInBytes, 'Channel config prioritizes extensionConfig over root config'); } }); this.testCase({ name: "Channel Config: Session storage can be enabled", test: () => { let setItemSpy = this.sandbox.spy(window.sessionStorage, "setItem"); let getItemSpy = this.sandbox.spy(window.sessionStorage, "getItem"); this._sender.initialize( { enableSessionStorageBuffer: true }, new AppInsightsCore(), [] ); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; this._sender.processTelemetry(telemetryItem, null); QUnit.assert.true(this._sender._buffer instanceof SessionStorageSendBuffer, 'Channel config can be set from root config (enableSessionStorageBuffer)'); QUnit.assert.equal(false, setItemSpy.calledOnce, "The setItem has not yet been triggered"); QUnit.assert.equal(false, getItemSpy.calledOnce, "The getItemSpy has not yet been triggered"); } }); this.testCase({ name: "Channel Config: Session storage with buffer override is used", test: () => { let setItemSpy = this.sandbox.stub(); let getItemSpy = this.sandbox.stub(); this._sender.initialize( { enableSessionStorageBuffer: true, bufferOverride: { getItem: getItemSpy, setItem: setItemSpy } }, new AppInsightsCore(), [] ); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; this._sender.processTelemetry(telemetryItem, null); QUnit.assert.true(this._sender._buffer instanceof SessionStorageSendBuffer, 'Channel config can be set from root config (enableSessionStorageBuffer)'); QUnit.assert.equal(false, setItemSpy.calledOnce, "The setItem has not yet been triggered"); QUnit.assert.equal(false, getItemSpy.calledOnce, "The getItemSpy has not yet been triggered"); } }); this.testCase({ name: "Channel Config: Session storage can be disabled", test: () => { this._sender.initialize( { enableSessionStorageBuffer: false }, new AppInsightsCore(), [] ); QUnit.assert.true(this._sender._buffer instanceof ArraySendBuffer, 'Channel config can be set from root config (enableSessionStorageBuffer)'); } }); this.testCase({ name: "Channel Config: Session storage ignores buffer override when disabled", test: () => { this._sender.initialize( { enableSessionStorageBuffer: false, bufferOverride: { getItem: this.sandbox.stub(), setItem: this.sandbox.stub() } }, new AppInsightsCore(), [] ); QUnit.assert.true(this._sender._buffer instanceof ArraySendBuffer, 'Channel config can be set from root config (enableSessionStorageBuffer)'); } }); this.testCase({ name: "processTelemetry can be called with optional fields undefined", useFakeTimers: true, test: () => { this._sender.initialize({ instrumentationKey: 'abc' }, new AppInsightsCore(), []); const loggerSpy = this.sandbox.stub(this._sender, "triggerSend"); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; try { this._sender.processTelemetry(telemetryItem, null); } catch(e) { QUnit.assert.ok(false, "Exception - " + e); } QUnit.assert.equal(false, loggerSpy.calledOnce, "The send has not yet been triggered"); this.clock.tick(15000); QUnit.assert.equal(true, loggerSpy.calledOnce, "The send has been triggered"); } }) this.testCase({ name: "processTelemetry process ItelemetryItem with iKey", useFakeTimers: true, test: () => { this._sender.initialize({ instrumentationKey: 'abc' }, new AppInsightsCore(), []); const loggerSpy = this.sandbox.stub(this._sender, "triggerSend"); const expectedIkey = 'testIkey'; const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: expectedIkey, baseType: 'some type', baseData: {} }; try { this._sender.processTelemetry(telemetryItem, null); let buffer = this._sender._buffer.getItems(); let payload = JSON.parse(buffer[buffer.length-1].item); var actualIkey = payload.iKey; } catch(e) { QUnit.assert.ok(false, "Exception - " + e); } QUnit.assert.equal(false, loggerSpy.calledOnce, "The send has not yet been triggered"); QUnit.assert.equal(expectedIkey, actualIkey, "processTelemetry replaced ItelemetryItem Ikey"); this.clock.tick(15000); QUnit.assert.equal(true, loggerSpy.calledOnce, "The send has been triggered"); } }) this.testCase({ name: "telemetry is not send when legacy telemetry initializer returns false", test: () => { const cr = new AppInsightsCore(); cr.logger = new DiagnosticLogger({instrumentationKey: "ikey"}); this._sender.initialize({ instrumentationKey: 'abc' }, cr, []); const nextPlugin = { identifier: "foo", processTelemetry: (it) => {}, priority: 200, setNextPlugin: (it) => {} }; this._sender.setNextPlugin(nextPlugin); const processTelemetrySpy = this.sandbox.stub(nextPlugin, "processTelemetry"); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {}, tags: [ ] }; telemetryItem.tags["ProcessLegacy"] = [e => true, e => false, f=> true]; try { this._sender.processTelemetry(telemetryItem, null); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.ok(!processTelemetrySpy.calledOnce); } }); this.testCase({ name: 'BeaconAPI is not used when isBeaconApiDisabled flag is true', test: () => { let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return true; }); const sender = new Sender(); const cr = new AppInsightsCore(); sender.initialize({ instrumentationKey: 'abc', isBeaconApiDisabled: true }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(false, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); try { sender.processTelemetry(telemetryItem, null); sender.flush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(false, sendBeaconCalled, "Beacon API is disabled, Beacon API is not called"); QUnit.assert.equal(1, this._getXhrRequests().length, "xhr sender is called when Beacon API is disabled"); } }); this.testCase({ name: 'beaconSender is called when isBeaconApiDisabled flag is false', useFakeTimers: true, test: () => { let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return true; }); const cr = new AppInsightsCore(); const sender = new Sender(); sender.initialize({ instrumentationKey: 'abc', isBeaconApiDisabled: false }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(false, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); try { sender.processTelemetry(telemetryItem, null); sender.flush(); } catch(e) { QUnit.assert.ok(false); } this.clock.tick(15000); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender is not called when Beacon API is enabled"); QUnit.assert.equal(true, sendBeaconCalled, "Beacon API is enabled, Beacon API is called"); } }); this.testCase({ name: 'Unload Transport Type: User provide fetch in unloadtransports, but it is disabled, so we should use beacon', test: () => { let window = getWindow(); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let fetchstub = this.sandbox.stub((window as any), "fetch"); let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return true; }); let config = { endpointUrl: "https//: test", emitLineDelimitedJson: false, maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, disableTelemetry: false, enableSessionStorageBuffer: true, isRetryDisabled: false, isBeaconApiDisabled: false, disableXhr: false, onunloadDisableFetch: true, onunloadDisableBeacon: false, instrumentationKey:"key", namePrefix: "", samplingPercentage: 100, customHeaders: [{header:"header",value:"val" }], convertUndefined: "", eventsLimitInMem: 10000, unloadTransports: [TransportType.Fetch] } as ISenderConfig; const sender = new Sender(); const cr = new AppInsightsCore(); var coreConfig = { instrumentationKey: "", extensionConfig: {[sender.identifier]: config} }; cr.initialize(coreConfig, [sender]); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(false, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); try { sender.processTelemetry(telemetryItem, null); sender.onunloadFlush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(true, sendBeaconCalled, "Beacon API should be called"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender is not called"); QUnit.assert.ok(!fetchstub.called, "fetch sender is blocked"); // store it back (window as any).XMLHttpRequest = fakeXMLHttpRequest; } }); this.testCase({ name: 'Unload Transport Type: User provide fetch in unloadtransports, we should use fetch', test: () => { let window = getWindow(); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let fetchstub = this.sandbox.stub((window as any), "fetch"); let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return true; }); let config = { endpointUrl: "https//: test", emitLineDelimitedJson: false, maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, disableTelemetry: false, enableSessionStorageBuffer: true, isRetryDisabled: false, isBeaconApiDisabled: false, disableXhr: false, onunloadDisableFetch: false, onunloadDisableBeacon: false, instrumentationKey:"key", namePrefix: "", samplingPercentage: 100, customHeaders: [{header:"header",value:"val" }], convertUndefined: "", eventsLimitInMem: 10000, unloadTransports: [TransportType.Fetch] } as ISenderConfig; const sender = new Sender(); const cr = new AppInsightsCore(); var coreConfig = { instrumentationKey: "", extensionConfig: {[sender.identifier]: config} }; cr.initialize(coreConfig, [sender]); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(false, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); try { sender.processTelemetry(telemetryItem, null); sender.onunloadFlush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(false, sendBeaconCalled, "Beacon API should not be called"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender is not called"); QUnit.assert.ok(fetchstub.called, "fetch sender is called"); // store it back (window as any).XMLHttpRequest = fakeXMLHttpRequest; } }); this.testCase({ name: 'Unload Transport Type: User provide beacon in unloadtransports, we should use beacon', test: () => { let window = getWindow(); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let fetchstub = this.sandbox.stub((window as any), "fetch"); let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return true; }); let config = { endpointUrl: "https//: test", emitLineDelimitedJson: false, maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, disableTelemetry: false, enableSessionStorageBuffer: true, isRetryDisabled: false, isBeaconApiDisabled: false, disableXhr: false, onunloadDisableFetch: false, onunloadDisableBeacon: false, instrumentationKey:"key", namePrefix: "", samplingPercentage: 100, customHeaders: [{header:"header",value:"val" }], convertUndefined: "", eventsLimitInMem: 10000, unloadTransports: [TransportType.Beacon] } as ISenderConfig; const sender = new Sender(); const cr = new AppInsightsCore(); var coreConfig = { instrumentationKey: "", extensionConfig: {[sender.identifier]: config} }; cr.initialize(coreConfig, [sender]); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(false, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); try { sender.processTelemetry(telemetryItem, null); sender.onunloadFlush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(true, sendBeaconCalled, "Beacon API should be called"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender is not called"); QUnit.assert.ok(!fetchstub.called, "fetch sender is not called"); // store it back (window as any).XMLHttpRequest = fakeXMLHttpRequest; } }); this.testCase({ name: 'Transport Type: isBeaconApiDisabled is true and User provide beacon in transports, we should still block beacon', test: () => { let window = getWindow(); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let fetchstub = this.sandbox.stub((window as any), "fetch"); let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return false; }); let config = { endpointUrl: "https//: test", emitLineDelimitedJson: false, maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, disableTelemetry: false, enableSessionStorageBuffer: true, isRetryDisabled: false, isBeaconApiDisabled: true, disableXhr: false, onunloadDisableFetch: false, onunloadDisableBeacon: false, instrumentationKey:"key", namePrefix: "", samplingPercentage: 100, customHeaders: [{header:"header",value:"val" }], convertUndefined: "", eventsLimitInMem: 10000, transports: [TransportType.Beacon] } as ISenderConfig; const sender = new Sender(); const cr = new AppInsightsCore(); var coreConfig = { instrumentationKey: "", extensionConfig: {[sender.identifier]: config} }; cr.initialize(coreConfig, [sender]); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(false, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); try { sender.processTelemetry(telemetryItem, null); sender.flush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(false, sendBeaconCalled, "Beacon API is blocked, Beacon API should not be called"); QUnit.assert.equal(1, this._getXhrRequests().length, "xhr sender is called"); QUnit.assert.ok(!fetchstub.called, "fetch sender is not called"); // store it back (window as any).XMLHttpRequest = fakeXMLHttpRequest; } }); this.testCase({ name: 'Transport Type: isBeaconApiDisabled is false and User provide beacon in transports, we should pick beacon', useFakeTimers: true, test: () => { let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return true; }); let config = { isBeaconApiDisabled: false, disableXhr: false, transports: [TransportType.Beacon] } as ISenderConfig; const sender = new Sender(); const cr = new AppInsightsCore(); var coreConfig = { instrumentationKey: "", extensionConfig: {[sender.identifier]: config} }; cr.initialize(coreConfig, [sender]); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(false, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); try { sender.processTelemetry(telemetryItem, null); sender.flush(); } catch(e) { QUnit.assert.ok(false); } this.clock.tick(15000); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender is not called when Beacon API is enabled"); QUnit.assert.equal(true, sendBeaconCalled, "Beacon API is enabled, Beacon API is called"); } }); this.testCase({ name: 'Transport Type: disableXhr is false, and user provide xhr in transports', test: () => { let window = getWindow(); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let fetchstub = this.sandbox.stub((window as any), "fetch"); let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return false; }); let config = { endpointUrl: "https//: test", emitLineDelimitedJson: false, maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, disableTelemetry: false, enableSessionStorageBuffer: true, isRetryDisabled: false, isBeaconApiDisabled:true, disableXhr: false, onunloadDisableFetch: false, onunloadDisableBeacon: false, instrumentationKey:"key", namePrefix: "", samplingPercentage: 100, customHeaders: [{header:"header",value:"val" }], convertUndefined: "", eventsLimitInMem: 10000, transports: [TransportType.Xhr] } as ISenderConfig; const sender = new Sender(); const cr = new AppInsightsCore(); var coreConfig = { instrumentationKey: "", extensionConfig: {[sender.identifier]: config} }; cr.initialize(coreConfig, [sender]); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(false, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); try { sender.processTelemetry(telemetryItem, null); sender.flush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(false, sendBeaconCalled, "Beacon API is disabled, Beacon API is not called"); QUnit.assert.equal(1, this._getXhrRequests().length, "xhr sender is called"); QUnit.assert.ok(!fetchstub.called, "fetch sender is not called"); // store it back (window as any).XMLHttpRequest = fakeXMLHttpRequest; } }); this.testCase({ name: 'Transport Type: disableXhr is false, but user provide fetch in transports', test: () => { let window = getWindow(); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let fetchstub = this.sandbox.stub((window as any), "fetch"); let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return false; }); let config = { endpointUrl: "https//: test", emitLineDelimitedJson: false, maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, disableTelemetry: false, enableSessionStorageBuffer: true, isRetryDisabled: false, isBeaconApiDisabled:true, disableXhr: false, onunloadDisableFetch: false, onunloadDisableBeacon: false, instrumentationKey:"key", namePrefix: "", samplingPercentage: 100, customHeaders: [{header:"header",value:"val" }], convertUndefined: "", eventsLimitInMem: 10000, transports: [TransportType.Fetch] } as ISenderConfig; const sender = new Sender(); const cr = new AppInsightsCore(); var coreConfig = { instrumentationKey: "", extensionConfig: {[sender.identifier]: config} }; cr.initialize(coreConfig, [sender]); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(false, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); try { sender.processTelemetry(telemetryItem, null); sender.flush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(false, sendBeaconCalled, "Beacon API is disabled, Beacon API is not called"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender is not called"); QUnit.assert.ok(fetchstub.called, "fetch sender is called"); // store it back (window as any).XMLHttpRequest = fakeXMLHttpRequest; } }); this.testCase({ name: "disableBeaconSplit is set to true, xhr should be used to send data diretly instead of splitting payloads.", useFakeTimers: true, test: () => { let window = getWindow(); let fetchstub = this.sandbox.stub((window as any), "fetch"); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let sessionStorage = window.sessionStorage; QUnit.assert.ok(sessionStorage, "sessionStorage API is supported"); sessionStorage.clear(); let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return false; }); const sender = new Sender(); const cr = new AppInsightsCore(); sender.initialize({ instrumentationKey: "abc", extensionConfig: { [sender.identifier]: { disableSendBeaconSplit: true, onunloadDisableFetch: true, disableXhr: true // to make sure beacon is used } } }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: "fake item", iKey: "iKey", baseType: "some type", baseData: { largePayload: new Array(64 + 1).join("test") } }; let buffer = sender._buffer; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(false, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should be clear"); try { sender.processTelemetry(telemetryItem, null); QUnit.assert.equal(1, buffer.getItems().length, "sender buffer should have one payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 1, "sender buffer should have one payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(0, sentItems.length, "sent buffer should have zero payload"); sender.onunloadFlush(); } catch(e) { QUnit.assert.ok(false); } this.clock.tick(5); QUnit.assert.equal(true, sendBeaconCalled, "Beacon API should be called"); QUnit.assert.equal(1, this._getXhrRequests().length, "xhr sender should be called"); let xhrRequest = this._getXhrRequests()[0]; QUnit.assert.equal(false, fetchstub.called, "fetch sender is not called"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should not have one payload"); QUnit.assert.equal(0, buffer.count(), "sender buffer should not have any payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 0, "sender buffer should be clear payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(1, sentItems.length, "sent buffer should have only one payload"); this.sendJsonResponse(xhrRequest, {}, 200); bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 0, "sender buffer should be clear payload"); sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(0, sentItems.length, "sent buffer should have no payload"); (window as any).XMLHttpRequest = fakeXMLHttpRequest; sessionStorage.clear(); } }); this.testCase({ name: "disableBeaconSplit is set to false, xhr should not be called to send small payload.", test: () => { let window = getWindow(); let fetchstub = this.sandbox.stub((window as any), "fetch"); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let sessionStorage = window.sessionStorage; QUnit.assert.ok(sessionStorage, "sessionStorage API is supported"); sessionStorage.clear(); let sendBeaconCalled = 0; this.hookSendBeacon((url: string) => { sendBeaconCalled += 1; return true; }); const sender = new Sender(); const cr = new AppInsightsCore(); sender.initialize({ instrumentationKey: "abc", extensionConfig: { [sender.identifier]: { onunloadDisableFetch: true, disableXhr: true, disableSendBeaconSplit: false // to make sure beacon is used } } }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: "item", iKey: "iKey", baseType: "type", baseData: {} }; let buffer = sender._buffer; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(0, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should be clear"); try { sender.processTelemetry(telemetryItem, null); QUnit.assert.equal(1, buffer.getItems().length, "sender buffer should have one payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 1, "sender buffer should have one payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(0, sentItems.length, "sent buffer should have zero payload"); sender.onunloadFlush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(1, sendBeaconCalled, "Beacon API should be called"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender should be called"); QUnit.assert.equal(false, fetchstub.called, "fetch sender is not called"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should not have one payload"); QUnit.assert.equal(0, buffer.count(), "sender buffer should not have any payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 0, "sender buffer should be clear payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(0, sentItems.length, "sent buffer should not have one payload"); (window as any).XMLHttpRequest = fakeXMLHttpRequest; sessionStorage.clear(); } }); this.testCase({ name: "disableBeaconSplit is set to false, xhr should be called to send large payload.", useFakeTimers: true, test: () => { let window = getWindow(); let fetchstub = this.sandbox.stub((window as any), "fetch"); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let sessionStorage = window.sessionStorage; QUnit.assert.ok(sessionStorage, "sessionStorage API is supported"); sessionStorage.clear(); let sendBeaconCalled = 0; this.hookSendBeacon((url: string) => { sendBeaconCalled += 1; if (sendBeaconCalled == 2) { return true; } return false; }); const sender = new Sender(); const cr = new AppInsightsCore(); sender.initialize({ instrumentationKey: "abc", extensionConfig: { [sender.identifier]: { onunloadDisableFetch: true, disableXhr: true, disableSendBeaconSplit: false // to make sure beacon is used } } }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: "item", iKey: "iKey", baseType: "type", baseData: {} }; const telemetryItem1: ITelemetryItem = { name: "item", iKey: "iKey1", baseType: "type", baseData: {} }; let buffer = sender._buffer; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(0, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should be clear"); try { sender.processTelemetry(telemetryItem, null); sender.processTelemetry(telemetryItem1, null); QUnit.assert.equal(2, buffer.getItems().length, "sender buffer should have one payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 2, "sender buffer should have one payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(0, sentItems.length, "sent buffer should have zero payload"); sender.onunloadFlush(); } catch(e) { QUnit.assert.ok(false); } this.clock.tick(5); QUnit.assert.equal(3, sendBeaconCalled, "Beacon API should be called 3 times"); QUnit.assert.equal(1, this._getXhrRequests().length, "xhr sender should be called"); let xhrRequest = this._getXhrRequests()[0]; QUnit.assert.equal(false, fetchstub.called, "fetch sender is not called"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should not have one payload"); QUnit.assert.equal(0, buffer.count(), "sender buffer should not have any payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 0, "sender buffer should be clear payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(1, sentItems.length, "sent buffer should have one payload"); QUnit.assert.ok(sentItems[0].item.indexOf("iKey1") >= 0, "sent buffer should have ikey1 payload"); this.sendJsonResponse(xhrRequest, {}, 200); bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 0, "sender buffer should have no payload test1"); sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(0, sentItems.length, "sent buffer should have zero payload test1"); (window as any).XMLHttpRequest = fakeXMLHttpRequest; sessionStorage.clear(); } }); this.testCase({ name: "fetchKeepAliveSender should not send duplicacted events during unload.", useFakeTimers: true, test: () => { let window = getWindow(); let fetchstub = this.sandbox.stub((window as any), "fetch"); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let sessionStorage = window.sessionStorage; let sessionSpy = this.sandbox.spy(sessionStorage,"setItem"); QUnit.assert.ok(sessionStorage, "sessionStorage API is supported"); sessionStorage.clear(); let sendBeaconCalled = 0; this.hookSendBeacon((url: string) => { sendBeaconCalled += 1; return true; }); const sender = new Sender(); const cr = new AppInsightsCore(); sender.initialize({ instrumentationKey: "abc", extensionConfig: { [sender.identifier]: { disableXhr: true, disableSendBeaconSplit: false } } }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: "item", iKey: "iKey", baseType: "type", baseData: {} }; let buffer = sender._buffer; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(0, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should be clear"); QUnit.assert.equal(false, fetchstub.called, "fetch sender is not called before"); try { sender.processTelemetry(telemetryItem, null); QUnit.assert.equal(1, buffer.getItems().length, "sender buffer should have one payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 1, "sender buffer should have one payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(0, sentItems.length, "sent buffer should have zero payload"); sender.onunloadFlush(); } catch(e) { QUnit.assert.ok(false); } this.clock.tick(5); QUnit.assert.equal(0, sendBeaconCalled, "Beacon API should be not called"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender should not be called"); QUnit.assert.equal(true, fetchstub.calledOnce, "fetch sender is called once"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should not have one payload"); QUnit.assert.equal(0, buffer.count(), "sender buffer should not have any payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 0, "sender buffer should be clear payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(0, sentItems.length, "sent buffer should have one payload test1"); let setItemCalled = 0; let args = sessionSpy.args; let itemCount = 0; args.forEach((arg) => { if (arg && arg[0] === SENT_BUFFER_KEY) { let data = JSON.parse(arg[1]); let cnt = data.length; if(data && cnt) { setItemCalled ++; itemCount += cnt; } } }); QUnit.assert.equal(1, setItemCalled, "sent buffer session should have be called once"); QUnit.assert.equal(1, itemCount, "sent buffer session should have be called once with one item"); (window as any).XMLHttpRequest = fakeXMLHttpRequest; sessionStorage.clear(); } }); this.testCase({ name: "fetchKeepAliveSender should only trigger fetch once during unload.", useFakeTimers: true, test: () => { let window = getWindow(); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let sessionStorage = window.sessionStorage; QUnit.assert.ok(sessionStorage, "sessionStorage API is supported"); sessionStorage.clear(); let sendBeaconCalled = 0; this.hookSendBeacon((url: string) => { sendBeaconCalled += 1; return true; }); let fetchCalls = this.hookFetch((resolve) => { setTimeout(function() { resolve(); }, 0); }); const sender = new Sender(); const cr = new AppInsightsCore(); sender.initialize({ instrumentationKey: "abc", extensionConfig: { [sender.identifier]: { disableXhr: true, disableSendBeaconSplit: false } } }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: "item", iKey: "iKey", baseType: "type", baseData: {} }; let buffer = sender._buffer; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(0, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should be clear"); QUnit.assert.equal(0, fetchCalls.length, "fetch calls should not be called before"); try { sender.processTelemetry(telemetryItem, null); QUnit.assert.equal(1, buffer.getItems().length, "sender buffer should have one payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 1, "sender buffer should have one payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(0, sentItems.length, "sent buffer should have zero payload"); sender.onunloadFlush(); } catch(e) { QUnit.assert.ok(false); } this.clock.tick(5); QUnit.assert.equal(0, sendBeaconCalled, "Beacon API should be not called"); QUnit.assert.equal(1, fetchCalls.length, "fetch calls should be called only once"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender should not be called"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should not have one payload"); QUnit.assert.equal(0, buffer.count(), "sender buffer should not have any payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 0, "sender buffer should be clear payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(0, sentItems.length, "sent buffer should not have one payload"); (window as any).XMLHttpRequest = fakeXMLHttpRequest; sessionStorage.clear(); } }); this.testCase({ name: "Onunloadflush: send payloads with fetch.", test: () => { let window = getWindow(); let fetchstub = this.sandbox.stub((window as any), "fetch"); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let sessionStorage = window.sessionStorage; let sessionSpy = this.sandbox.spy(sessionStorage,"setItem"); QUnit.assert.ok(sessionStorage, "sessionStorage API is supported"); sessionStorage.clear(); let sendBeaconCalled = 0; this.hookSendBeacon((url: string) => { sendBeaconCalled += 1; return true; }); const sender = new Sender(); const cr = new AppInsightsCore(); sender.initialize({ instrumentationKey: "abc", extensionConfig: { [sender.identifier]: { onunloadDisableFetch: false, disableXhr: true, disableSendBeaconSplit: false // to make sure beacon is used } } }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: "large item", iKey: "iKey", baseType: "type", baseData: { name: "large item" } }; const telemetryItem1: ITelemetryItem = { name: "smell item", iKey: "iKey", baseType: "type", baseData: { name: "small item" } }; let buffer = sender._buffer; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(0, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should be clear"); try { sender.processTelemetry(telemetryItem, null); sender.processTelemetry(telemetryItem1, null); QUnit.assert.equal(2, buffer.getItems().length, "sender buffer should have two payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 2, "sender buffer should have two payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(0, sentItems.length, "sent buffer should have zero payload"); sender.onunloadFlush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(0, sendBeaconCalled, "Beacon API should not be called"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender should not be called"); QUnit.assert.equal(true, fetchstub.called, "fetch sender is called"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should not have one payload"); QUnit.assert.equal(0, buffer.count(), "sender buffer should not have any payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 0, "sender buffer should be clear payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(0, sentItems.length, "sent buffer should have no payload left"); let setItemCalled = 0; let itemCount = 0; let args = sessionSpy.args; args.forEach((arg) => { if (arg && arg[0] === SENT_BUFFER_KEY) { let data = JSON.parse(arg[1]); let cnt = data.length; if(data && cnt) { setItemCalled ++; itemCount += cnt; } } }); QUnit.assert.equal(1, setItemCalled, "sent buffer session should have be called once"); QUnit.assert.equal(2, itemCount, "sent buffer session should have be called once with two item"); (window as any).XMLHttpRequest = fakeXMLHttpRequest; sessionStorage.clear(); } }); this.testCase({ name: "Onunloadflush: send payloads with beacon.", test: () => { let window = getWindow(); let fetchstub = this.sandbox.stub((window as any), "fetch"); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let sessionStorage = window.sessionStorage; QUnit.assert.ok(sessionStorage, "sessionStorage API is supported"); sessionStorage.clear(); let sendBeaconCalled = 0; this.hookSendBeacon((url: string) => { sendBeaconCalled += 1; return false; }); const sender = new Sender(); const cr = new AppInsightsCore(); sender.initialize({ instrumentationKey: "abc", extensionConfig: { [sender.identifier]: { onunloadDisableFetch: true, disableXhr: true, disableSendBeaconSplit: false // to make sure beacon is used } } }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: "small item", iKey: "iKey", baseType: "type", baseData: { name: "small item" } }; const telemetryItem1: ITelemetryItem = { name: "large item", iKey: "iKey", baseType: "type", baseData: { name: "large item" } }; let buffer = sender._buffer; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(0, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should be clear"); try { sender.processTelemetry(telemetryItem, null); sender.processTelemetry(telemetryItem1, null); QUnit.assert.equal(2, buffer.getItems().length, "sender buffer should have two payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 2, "sender buffer should have two payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(0, sentItems.length, "sent buffer should have zero payload"); sender.onunloadFlush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(3, sendBeaconCalled, "Beacon API should be called"); QUnit.assert.equal(1, this._getXhrRequests().length, "xhr sender should not be called"); QUnit.assert.equal(false, fetchstub.called, "fetch sender is called"); QUnit.assert.equal(0, buffer.getItems().length, "sender buffer should not have one payload"); QUnit.assert.equal(0, buffer.count(), "sender buffer should not have any payload"); let bufferItems = JSON.parse(sessionStorage.getItem(BUFFER_KEY) as any); QUnit.assert.equal(bufferItems.length, 0, "sender buffer should be clear payload"); let sentItems = JSON.parse(sessionStorage.getItem(SENT_BUFFER_KEY) as any); QUnit.assert.equal(2, sentItems.length, "sent buffer should not have two payload"); (window as any).XMLHttpRequest = fakeXMLHttpRequest; sessionStorage.clear(); } }); this.testCase({ name: 'FetchAPI is used when isBeaconApiDisabled flag is true and disableXhr flag is true , use fetch sender.', test: () => { let window = getWindow(); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let fetchstub = this.sandbox.stub((window as any), "fetch"); let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return false; }); const sender = new Sender(); const cr = new AppInsightsCore(); sender.initialize({ instrumentationKey: 'abc', isBeaconApiDisabled: true, disableXhr: true }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(false, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); try { sender.processTelemetry(telemetryItem, null); sender.flush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(false, sendBeaconCalled, "Beacon API is disabled, Beacon API is not called"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender is not called"); QUnit.assert.ok(fetchstub.called, "fetch sender is called"); // store it back (window as any).XMLHttpRequest = fakeXMLHttpRequest; } }); this.testCase({ name: 'FetchAPI is used when isBeaconApiDisabled flag is true and XMLHttpRequest is not supported, use fetch sender.', test: () => { let window = getWindow(); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; (window as any).XMLHttpRequest = undefined; let fetchstub = this.sandbox.stub((window as any), "fetch"); let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return false; }); const sender = new Sender(); const cr = new AppInsightsCore(); sender.initialize({ instrumentationKey: 'abc', isBeaconApiDisabled: true }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); QUnit.assert.equal(false, sendBeaconCalled, "Beacon API was not called before"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender was not called before"); try { sender.processTelemetry(telemetryItem, null); sender.flush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(false, sendBeaconCalled, "Beacon API is disabled, Beacon API is not called"); QUnit.assert.equal(0, this._getXhrRequests().length, "xhr sender is not called"); QUnit.assert.ok(fetchstub.called, "fetch sender is called"); // store it back (window as any).XMLHttpRequest = fakeXMLHttpRequest; } }); this.testCase({ name: 'Users are not allowed to add customHeaders when endpointUrl is Breeze.', test: () => { let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return true; }); const sender = new Sender(); const cr = new AppInsightsCore(); sender.initialize({ instrumentationKey: 'abc', isBeaconApiDisabled: true, customHeaders: [ { header: 'testHeader', value: 'testValue' } ] }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; try { sender.processTelemetry(telemetryItem, null); sender.flush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(1, this._getXhrRequests().length, "xhr sender is called"); QUnit.assert.notOk(this._getXhrRequests()[0].requestHeaders.hasOwnProperty('testHeader')); } }); this.testCase({ name: 'Users could set the cross-origin header via request', useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let id = this._sender.identifier; let coreConfig = { instrumentationKey: 'abc', isBeaconApiDisabled: true, extensionConfig: { [this._sender.identifier]: { corsPolicy: "cross-origin", } } } core.initialize(coreConfig, [this._sender]); let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return true; }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; try { this._sender.processTelemetry(telemetryItem); this.clock.tick(30000); } catch(e) { QUnit.assert.ok(false); } const CrossOriginResourcePolicyHeader: string = "X-Set-Cross-Origin-Resource-Policy"; QUnit.assert.equal(1, this._getXhrRequests().length, "xhr sender is called"); let headers = this._getXhrRequests()[0].requestHeaders; QUnit.assert.ok(headers.hasOwnProperty(CrossOriginResourcePolicyHeader)); QUnit.assert.equal(headers[CrossOriginResourcePolicyHeader], 'cross-origin'); QUnit.assert.notOk(this._getXhrRequests()[0].requestHeaders.hasOwnProperty('testHeader')); // dynamic change core.config.extensionConfig[this._sender.identifier].corsPolicy = "same-origin"; this.clock.tick(1); try { this._sender.processTelemetry(telemetryItem); this.clock.tick(30000); } catch(e) { QUnit.assert.ok(false); } headers = this._getXhrRequests()[1].requestHeaders; QUnit.assert.ok(headers.hasOwnProperty(CrossOriginResourcePolicyHeader)); QUnit.assert.equal(headers[CrossOriginResourcePolicyHeader], 'same-origin'); QUnit.assert.notOk(this._getXhrRequests()[1].requestHeaders.hasOwnProperty('testHeader')); // dynamic change to null core.config.extensionConfig[this._sender.identifier].corsPolicy = null; this.clock.tick(1); try { this._sender.processTelemetry(telemetryItem); this.clock.tick(30000); } catch(e) { QUnit.assert.ok(false); } headers = this._getXhrRequests()[2].requestHeaders; QUnit.assert.notOk(this._getXhrRequests()[2].requestHeaders.hasOwnProperty(CrossOriginResourcePolicyHeader)); } }); this.testCase({ name: 'Users are allowed to add customHeaders when endpointUrl is not Breeze.', test: () => { let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return true; }); const sender = new Sender(); const cr = new AppInsightsCore(); sender.initialize({ instrumentationKey: 'abc', isBeaconApiDisabled: true, endpointUrl: 'https://example.com', customHeaders: [ { header: 'testHeader', value: 'testValue' } ] }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; try { sender.processTelemetry(telemetryItem, null); sender.flush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(1, this._getXhrRequests().length, "xhr sender is called"); QUnit.assert.ok(this._getXhrRequests()[0].requestHeaders.hasOwnProperty('testHeader')); QUnit.assert.equal(this._getXhrRequests()[0].requestHeaders.testHeader, 'testValue'); } }); this.testCase({ name: 'Users are allowed to add customHeaders via addHeader method.', test: () => { let sendBeaconCalled = false; this.hookSendBeacon((url: string) => { sendBeaconCalled = true; return true; }); const sender = new Sender(); const cr = new AppInsightsCore(); sender.addHeader('testHeader', 'testValue'); sender.initialize({ instrumentationKey: 'abc', isBeaconApiDisabled: true }, cr, []); this.onDone(() => { sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; try { sender.processTelemetry(telemetryItem, null); sender.flush(); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(1, this._getXhrRequests().length, "xhr sender is called"); QUnit.assert.ok(this._getXhrRequests()[0].requestHeaders.hasOwnProperty('testHeader')); QUnit.assert.equal(this._getXhrRequests()[0].requestHeaders.testHeader, 'testValue'); } }); this.testCase({ name: "AppInsightsTests: AppInsights Envelope created for Custom Event", test: () => { const inputEnvelope: ITelemetryItem = { name: "test", time: new Date("2018-06-12").toISOString(), iKey: "iKey", ext: { app: { sesId: "d041d2e5fa834b4f9eee41ac163bf402" }, device: { deviceClass: "Browser", localId: "browser" }, os: { osVer: "Windows11" } }, tags: [{"ai.internal.sdkVersion": "javascript:2.5.1"}], data: { "property1": "val1", "measurement1": 50.0, "measurement2": 1.3, "property2": "val2" }, baseData: { "name": "Event Name" } }; const appInsightsEnvelope = Sender.constructEnvelope(inputEnvelope, this._instrumentationKey, safeGetLogger(null)); const baseData = appInsightsEnvelope.data.baseData; // Assert measurements const resultMeasurements = baseData.measurements; QUnit.assert.ok(resultMeasurements); QUnit.assert.ok(resultMeasurements["measurement1"]); QUnit.assert.equal(50.0, resultMeasurements["measurement1"]); QUnit.assert.ok(resultMeasurements["measurement2"]); QUnit.assert.equal(1.3, resultMeasurements["measurement2"]); // Assert custom properties QUnit.assert.ok(baseData.properties); QUnit.assert.equal("val1", baseData.properties["property1"]); QUnit.assert.equal("val2", baseData.properties["property2"]); // Assert Event name QUnit.assert.ok(baseData.name); QUnit.assert.equal("Event Name", baseData.name); // Assert ver QUnit.assert.ok(baseData.ver); QUnit.assert.equal(2, baseData.ver); // Assert baseType added by default QUnit.assert.ok(appInsightsEnvelope.data.baseType); QUnit.assert.equal("EventData", appInsightsEnvelope.data.baseType); // Assert tags QUnit.assert.ok(appInsightsEnvelope.tags); QUnit.assert.equal("d041d2e5fa834b4f9eee41ac163bf402", appInsightsEnvelope.tags["ai.session.id"]); QUnit.assert.equal("browser", appInsightsEnvelope.tags["ai.device.id"]); QUnit.assert.equal("browser", appInsightsEnvelope.tags["ai.device.id"]); QUnit.assert.equal("Windows11", appInsightsEnvelope.tags["ai.device.osVersion"]); QUnit.assert.equal("Browser", appInsightsEnvelope.tags["ai.device.type"]); QUnit.assert.equal("javascript:2.5.1", appInsightsEnvelope.tags["ai.internal.sdkVersion"]); // Assert name QUnit.assert.ok(appInsightsEnvelope.name); QUnit.assert.equal("Microsoft.ApplicationInsights.iKey.Event", appInsightsEnvelope.name); // Assert iKey QUnit.assert.ok(appInsightsEnvelope.iKey); QUnit.assert.equal("iKey", appInsightsEnvelope.iKey); // Assert timestamp QUnit.assert.ok(appInsightsEnvelope.time); } }); this.testCase({ name: "AppInsightsTests: AppInsights Envelope use default config iKey when iKey of ItelemetryItem is empty", test: () => { const inputEnvelope: ITelemetryItem = { name: "test", iKey: "", ext: {}, data: { "property1": "val1"}, baseData: { "name": "Event Name" } }; const appInsightsEnvelope = Sender.constructEnvelope(inputEnvelope, this._instrumentationKey, null); const baseData = appInsightsEnvelope.data.baseData; // Assert Event name QUnit.assert.ok(baseData.name); QUnit.assert.equal("Event Name", baseData.name); // Assert name QUnit.assert.ok(appInsightsEnvelope.name); QUnit.assert.equal("Microsoft.ApplicationInsights.iKey.Event", appInsightsEnvelope.name); // Assert iKey QUnit.assert.ok(appInsightsEnvelope.iKey); QUnit.assert.equal( this._instrumentationKey, appInsightsEnvelope.iKey, "default config iKey is not set"); } }); this.testCase({ name: "AppInsightsTests: AppInsights Envelope unknown type returns custom Event data type", test: () => { const inputEnvelope: ITelemetryItem = { name: "test", time: new Date("2018-06-12").toISOString(), iKey: "iKey", ext: { "ai.session.id": "d041d2e5fa834b4f9eee41ac163bf402", "ai.device.id": "browser", "ai.device.type": "Browser", }, tags: [{}], data: { "property1": "val1", "measurement1": 50.0, "measurement2": 1.3, "property2": "val2" }, baseType: "PageUnloadData", baseData: { id: "EADE2F09-DEBA-4B60-A222-E1D80BB8AA7F", vpHeight: 1002, vScrollOffset: 292 } }; const appInsightsEnvelope = Sender.constructEnvelope(inputEnvelope, this._instrumentationKey, null); const baseData = appInsightsEnvelope.data.baseData; // Assert measurements const resultMeasurements = baseData.measurements; QUnit.assert.ok(resultMeasurements); QUnit.assert.ok(resultMeasurements["measurement1"]); QUnit.assert.equal(50.0, resultMeasurements["measurement1"]); QUnit.assert.ok(resultMeasurements["measurement2"]); QUnit.assert.equal(1.3, resultMeasurements["measurement2"]); QUnit.assert.ok(resultMeasurements["vpHeight"]); QUnit.assert.equal(1002, resultMeasurements["vpHeight"]); QUnit.assert.ok(resultMeasurements["vScrollOffset"]); QUnit.assert.equal(292, resultMeasurements["vScrollOffset"]); // Assert custom properties QUnit.assert.ok(baseData.properties); QUnit.assert.equal("val1", baseData.properties["property1"]); QUnit.assert.equal("val2", baseData.properties["property2"]); QUnit.assert.equal("EADE2F09-DEBA-4B60-A222-E1D80BB8AA7F", baseData.properties["id"]); // Assert Event name QUnit.assert.ok(baseData.name); QUnit.assert.equal("PageUnloadData", baseData.properties['baseTypeSource']); // Assert ver QUnit.assert.ok(baseData.ver); QUnit.assert.equal(2, baseData.ver); QUnit.assert.equal(`javascript:${EnvelopeCreator.Version}`, appInsightsEnvelope.tags["ai.internal.sdkVersion"]); } }) this.testCase({ name: "AppInsightsTests: AppInsights Envelope create for Dependency Data", test: () => { // setup const inputEnvelope: ITelemetryItem = { name: "test", time: new Date("2018-06-12").toISOString(), iKey: "iKey", ext: { "user" : { "localId": "TestId", "authId": "AuthenticatedId", "id": "TestId" } }, tags: [{"ai.user.accountId": "TestAccountId"}, {"ai.location.ip": "10.22.8.2"}], baseType: "RemoteDependencyData", baseData: { id: 'some id', name: "Some name given", success: true, responseCode: 200, duration: 123, type: 'Fetch', data: 'some data', target: 'https://example.com/test/name?q=bar', correlationContext: "cid-v1:foo" }, data: { property1: "val1", property2: "val2", measurement1: 50.0, measurement2: 1.3 } } // act const appInsightsEnvelope = Sender.constructEnvelope(inputEnvelope, this._instrumentationKey, null); const { baseData } = appInsightsEnvelope.data; // assert const resultDuration = baseData.duration; QUnit.assert.equal("00:00:00.123", resultDuration); // Assert measurements const resultMeasurements = baseData.measurements; QUnit.assert.ok(resultMeasurements); QUnit.assert.ok(resultMeasurements["measurement1"]); QUnit.assert.equal(50.0, resultMeasurements["measurement1"]); QUnit.assert.ok(resultMeasurements["measurement2"]); QUnit.assert.equal(1.3, resultMeasurements["measurement2"]); QUnit.assert.ok(!resultMeasurements.duration, "duration is not supposed to be treated as measurement"); // Assert custom properties QUnit.assert.ok(baseData.properties); QUnit.assert.equal("val1", baseData.properties["property1"]); QUnit.assert.equal("val2", baseData.properties["property2"]); // Assert baseData QUnit.assert.ok(baseData.name); QUnit.assert.equal("Some name given", baseData.data); QUnit.assert.equal("some id", baseData.id); QUnit.assert.equal(true, baseData.success); QUnit.assert.equal(200, baseData.resultCode); QUnit.assert.equal("Some name given", baseData.name); QUnit.assert.equal("example.com | cid-v1:foo", baseData.target); // Assert ver QUnit.assert.ok(baseData.ver); QUnit.assert.equal(2, baseData.ver); // Assert baseType QUnit.assert.ok(appInsightsEnvelope.data.baseType); QUnit.assert.equal("RemoteDependencyData", appInsightsEnvelope.data.baseType); // Assert tags QUnit.assert.ok(appInsightsEnvelope.tags); QUnit.assert.equal("TestAccountId", appInsightsEnvelope.tags["ai.user.accountId"]); QUnit.assert.equal("10.22.8.2", appInsightsEnvelope.tags["ai.location.ip"]); QUnit.assert.equal("AuthenticatedId", appInsightsEnvelope.tags["ai.user.authUserId"]); QUnit.assert.equal("TestId", appInsightsEnvelope.tags["ai.user.id"]); // Assert name QUnit.assert.ok(appInsightsEnvelope.name); QUnit.assert.equal("Microsoft.ApplicationInsights.iKey.RemoteDependency", appInsightsEnvelope.name); // Assert iKey QUnit.assert.ok(appInsightsEnvelope.iKey); QUnit.assert.equal("iKey", appInsightsEnvelope.iKey); // Assert timestamp QUnit.assert.ok(appInsightsEnvelope.time); } }); this.testCase({ name: "AppInsightsTests: When name is not provided, it is obtained from hostname", test: () => { // setup const inputEnvelope: ITelemetryItem = { name: "test", time: new Date("2018-06-12").toISOString(), iKey: "iKey", ext: { "user" : { "localId": "TestId", "authId": "AuthenticatedId", "id": "TestId" } }, tags: [{"ai.user.accountId": "TestAccountId"}, {"ai.location.ip": "10.22.8.2"}, {"ai.internal.sdkVersion": "1234"}], baseType: "RemoteDependencyData", baseData: { id: 'some id', success: true, responseCode: 200, duration: 123, type: 'Fetch', data: 'some data', target: 'https://example.com/test/name' }, data: { property1: "val1", property2: "val2", measurement1: 50.0, measurement2: 1.3 } } // act const appInsightsEnvelope = Sender.constructEnvelope(inputEnvelope, this._instrumentationKey, null); const { baseData } = appInsightsEnvelope.data; // Assert baseData QUnit.assert.ok(baseData.name); QUnit.assert.equal("GET /test/name", baseData.name); // retrieved from target QUnit.assert.equal("/test/name", baseData.data); // Assert sdkVersion QUnit.assert.equal("1234", appInsightsEnvelope.tags["ai.internal.sdkVersion"]) } }); this.testCase({ name: "AppInsightsTests: AppInsights Envelope created for Page View", test: () => { // setup const inputEnvelope: ITelemetryItem = { name: "test", time: new Date("2018-06-12").toISOString(), iKey: "iKey", ext: { "user": { "localId": "TestId", "authId": "AuthenticatedId", "id": "TestId" }, "trace": { "traceID": "1528B5FF-6455-4657-BE77-E6664CAC72DC", "parentID": "1528B5FF-6455-4657-BE77-E6664CACEEEE" } }, tags: [{"ai.user.accountId": "TestAccountId"}], baseType: "PageviewData", baseData: { "name": "Page View Name", "uri": "https://fakeUri.com", properties: { "property1": "val1", "property2": "val2", "duration": 300000 }, measurements: { "measurement1": 50.0, "measurement2": 1.3, } }, data: { "property3": "val3", "measurement3": 1000 } }; // Act const appInsightsEnvelope = Sender.constructEnvelope(inputEnvelope, this._instrumentationKey, null); const baseData = appInsightsEnvelope.data.baseData; // Assert duration const resultDuration = baseData.duration; QUnit.assert.equal("00:05:00.000", resultDuration); // Assert measurements const resultMeasurements = baseData.measurements; const props = baseData.properties; QUnit.assert.ok(resultMeasurements); QUnit.assert.ok(resultMeasurements["measurement1"]); QUnit.assert.equal(50.0, resultMeasurements["measurement1"]); QUnit.assert.ok(resultMeasurements["measurement2"]); QUnit.assert.equal(1.3, resultMeasurements["measurement2"]); QUnit.assert.ok(!resultMeasurements.duration, "duration is not supposed to be treated as property in envelope"); // Assert custom properties QUnit.assert.ok(baseData.properties); QUnit.assert.equal("val1", baseData.properties["property1"]); QUnit.assert.equal("val2", baseData.properties["property2"]); // Assert deprecated data custom properties/measurements QUnit.assert.equal("val3", baseData.properties["property3"]) QUnit.assert.equal(1000, baseData.measurements["measurement3"]); // Assert Page View name QUnit.assert.ok(baseData.name); QUnit.assert.equal("Page View Name", baseData.name); // Assert ver QUnit.assert.ok(baseData.ver); QUnit.assert.equal(2, baseData.ver); // Assert baseType QUnit.assert.ok(appInsightsEnvelope.data.baseType); QUnit.assert.equal("PageviewData", appInsightsEnvelope.data.baseType); // Assert tags QUnit.assert.ok(appInsightsEnvelope.tags); QUnit.assert.equal("TestAccountId", appInsightsEnvelope.tags["ai.user.accountId"]); QUnit.assert.equal("AuthenticatedId", appInsightsEnvelope.tags["ai.user.authUserId"]); QUnit.assert.equal("TestId", appInsightsEnvelope.tags["ai.user.id"]); // Assert sdkVersion QUnit.assert.ok(EnvelopeCreator.Version) QUnit.assert.ok(EnvelopeCreator.Version.length > 0) QUnit.assert.equal(`javascript:${EnvelopeCreator.Version}`, appInsightsEnvelope.tags["ai.internal.sdkVersion"]) // QUnit.assert.equal("d041d2e5fa834b4f9eee41ac163bf402", appInsightsEnvelope.tags["ai.session.id"]); // QUnit.assert.equal("browser", appInsightsEnvelope.tags["ai.device.id"]); // QUnit.assert.equal("Browser", appInsightsEnvelope.tags["ai.device.type"]); // QUnit.assert.equal("javascript:1.0.18", appInsightsEnvelope.tags["ai.internal.sdkVersion"]); // Assert name QUnit.assert.ok(appInsightsEnvelope.name); QUnit.assert.equal("Microsoft.ApplicationInsights.iKey.Pageview", appInsightsEnvelope.name); // Assert iKey QUnit.assert.ok(appInsightsEnvelope.iKey); QUnit.assert.equal("iKey", appInsightsEnvelope.iKey); // Assert timestamp QUnit.assert.ok(appInsightsEnvelope.time); QUnit.assert.equal("1528B5FF-6455-4657-BE77-E6664CAC72DC", appInsightsEnvelope.tags["ai.operation.id"]); QUnit.assert.equal("1528B5FF-6455-4657-BE77-E6664CACEEEE", appInsightsEnvelope.tags["ai.operation.parentId"]) } }); this.testCase({ name: "AppInsightsTests: AppInsights Envelope created for Page View with duration in customProperties Part C", test: () => { // setup const inputEnvelope: ITelemetryItem = { name: "test", time: new Date("2018-06-12").toISOString(), iKey: "iKey", ext: { "user": { "localId": "TestId", "authId": "AuthenticatedId", "id": "TestId" }, "trace": { "traceID": "1528B5FF-6455-4657-BE77-E6664CAC72DC", "parentID": "1528B5FF-6455-4657-BE77-E6664CACEEEE" } }, tags: [{"ai.user.accountId": "TestAccountId"}], baseType: "PageviewData", baseData: { "name": "Page View Name", "uri": "https://fakeUri.com", properties: { "property1": "val1", "property2": "val2", }, measurements: { "measurement1": 50.0, "measurement2": 1.3, } }, data: { "duration": 300000 } }; // Act const appInsightsEnvelope = Sender.constructEnvelope(inputEnvelope, this._instrumentationKey, null); const baseData = appInsightsEnvelope.data.baseData; // Assert duration const resultDuration = baseData.duration; QUnit.assert.equal("00:05:00.000", resultDuration); } }); this.testCase({ name: 'Envelope: custom properties are put into envelope for Exception data type', test: () => { const bd = new Exception( null, new Error(), {"property1": "val1", "property2": "val2" }, {"measurement1": 50.0, "measurement2": 1.3 } ); const inputEnvelope: ITelemetryItem = { name: "test", time: new Date("2018-06-12").toISOString(), iKey: "iKey", baseType: ExceptionDataType, baseData: bd, data: { "property3": "val3", "measurement3": 3.0 }, ext: { "user": { "localId": "TestId", "authId": "AuthenticatedId", "id": "TestId" } }, tags: [{"user.accountId": "TestAccountId"}], }; // Act const appInsightsEnvelope = Sender.constructEnvelope(inputEnvelope, this._instrumentationKey, null); const baseData = appInsightsEnvelope.data.baseData; QUnit.assert.equal("val3", baseData.properties["property3"], "ExceptionData: customProperties (item.data) are added to the properties of the envelope and not included in the item.data") QUnit.assert.equal("val1", baseData.properties["property1"], "ExceptionData: properties (item.baseData.properties) are added to telemetry envelope"); QUnit.assert.equal(50.0, baseData.measurements["measurement1"], "ExceptionData: measurements (item.baseData.measurements) are added to telemetry envelope"); } }); this.testCase({ name: 'Offline watcher is listening to events', test: () => { QUnit.assert.ok(this._offline.isListening(), 'Offline is listening'); QUnit.assert.equal(true, this._offline.isOnline(), 'Offline reports online status'); } }); this.testCase({ name: 'Offline watcher responds to offline events (window.addEventListener)', useFakeTimers: true, test: () => { // Setup const offlineEvent = new Event('offline'); const onlineEvent = new Event('online'); // Verify precondition QUnit.assert.ok(this._offline.isListening()); QUnit.assert.ok(this._offline.isOnline()); // Act - Go offline window.dispatchEvent(offlineEvent); this.clock.tick(1); // Verify offline QUnit.assert.ok(!this._offline.isOnline()); // Act - Go online window.dispatchEvent(onlineEvent); this.clock.tick(1); // Verify online QUnit.assert.ok(this._offline.isOnline()); } }); this.testCase({ name: "AppInsightsTests: AppInsights Envelope created for Page View with new web extension", test: () => { // setup const inputEnvelope: ITelemetryItem = { name: "test", iKey: "iKey", ext: { "web": { "domain": "www.bing.com", "userConsent": true, "screenRes": "1024x768", "browser": "internet explorer", "browserVer": "48.0", "isManual": true, "browserLang": "EN" } }, baseType: "PageviewData", baseData: { "name": "Page View Name", "uri": "https://fakeUri.com", "startTime": new Date(123), properties: { "property1": "val1", "property2": "val2" }, measurements: { "measurement1": 50.0, } } }; // Act const appInsightsEnvelope = Sender.constructEnvelope(inputEnvelope, this._instrumentationKey, null); const baseData = appInsightsEnvelope.data.baseData; // Assert envelope QUnit.assert.deepEqual(appInsightsEnvelope.time, new Date(123).toISOString()); // Assert measurements const resultMeasurements = baseData.measurements; QUnit.assert.ok(resultMeasurements); QUnit.assert.ok(resultMeasurements["measurement1"]); QUnit.assert.equal(50.0, resultMeasurements["measurement1"]); // Assert custom properties QUnit.assert.ok(baseData.properties); QUnit.assert.equal("val1", baseData.properties["property1"]); QUnit.assert.equal("val2", baseData.properties["property2"]); QUnit.assert.equal("true", baseData.properties["isManual"]); QUnit.assert.equal("1024x768", baseData.properties["screenRes"]); QUnit.assert.equal("true", baseData.properties["userConsent"]); QUnit.assert.equal("www.bing.com", baseData.properties["domain"]); QUnit.assert.equal("internet explorer", appInsightsEnvelope.tags[CtxTagKeys.deviceBrowser]); QUnit.assert.equal("48.0", appInsightsEnvelope.tags[CtxTagKeys.deviceBrowserVersion]); QUnit.assert.equal("EN", appInsightsEnvelope.tags[CtxTagKeys.deviceLanguage]); // Assert Page View name QUnit.assert.ok(baseData.name); QUnit.assert.equal("Page View Name", baseData.name); // Assert ver QUnit.assert.ok(baseData.ver); QUnit.assert.equal(2, baseData.ver); // Assert baseType QUnit.assert.ok(appInsightsEnvelope.data.baseType); QUnit.assert.equal("PageviewData", appInsightsEnvelope.data.baseType); // Assert name QUnit.assert.ok(appInsightsEnvelope.name); QUnit.assert.equal("Microsoft.ApplicationInsights.iKey.Pageview", appInsightsEnvelope.name); } }); this.testCase({ name: "Channel Config: Notification is sent when requests are being sent when requests exceed max batch size", useFakeTimers: true, test: () => { let sendNotifications = []; let notificationManager = new NotificationManager(); notificationManager.addNotificationListener({ eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason, isAsync }); } }); let core = new AppInsightsCore(); this.sandbox.stub(core, "getNotifyMgr").returns(notificationManager); this._sender.initialize( { instrumentationKey: 'abc', maxBatchInterval: 123, endpointUrl: 'https://example.com', maxBatchSizeInBytes: 100, extensionConfig: { [this._sender.identifier]: { maxBatchSizeInBytes: 100 } } }, core, [] ); const loggerSpy = this.sandbox.spy(this._sender, "triggerSend"); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; try { this._sender.processTelemetry(telemetryItem, null); this._sender.processTelemetry(telemetryItem, null); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(true, loggerSpy.called); this.clock.tick(1); QUnit.assert.ok(sendNotifications.length === 1); QUnit.assert.ok(sendNotifications[0].sendReason === SendRequestReason.MaxBatchSize); } }); this.testCase({ name: "Channel Config: Notification is sent when requests are being sent with manual flush", useFakeTimers: true, test: () => { let sendNotifications = []; let notificationManager = new NotificationManager(); notificationManager.addNotificationListener({ eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason, isAsync }); } }); let core = new AppInsightsCore(); this.sandbox.stub(core, "getNotifyMgr").returns(notificationManager); this._sender.initialize( { instrumentationKey: 'abc', maxBatchInterval: 123, endpointUrl: 'https://example.com', extensionConfig: { } }, core, [] ); const loggerSpy = this.sandbox.spy(this._sender, "triggerSend"); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; try { this._sender.processTelemetry(telemetryItem, null); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(false, loggerSpy.calledOnce); QUnit.assert.equal(0, sendNotifications.length); this._sender.flush(); QUnit.assert.equal(true, loggerSpy.calledOnce); QUnit.assert.equal(0, sendNotifications.length); this.clock.tick(1); QUnit.assert.equal(1, sendNotifications.length); QUnit.assert.equal(SendRequestReason.ManualFlush, sendNotifications[0].sendReason); } }); this.testCase({ name: "IKey Validation Test", test: () => { let appInsightsCore = new AppInsightsCore(); appInsightsCore.logger = new DiagnosticLogger(); let messageId: _eInternalMessageId = _eInternalMessageId.InvalidInstrumentationKey; this._sender.initialize( { instrumentationKey: '1aa11111-bbbb-1ccc-8ddd-eeeeffff3333', maxBatchInterval: 123, endpointUrl: 'https://example.com', maxBatchSizeInBytes: 654, extensionConfig: { [this._sender.identifier]: { maxBatchSizeInBytes: 456 } } }, appInsightsCore, [] ); QUnit.assert.equal(0, appInsightsCore.logger.queue.length, "POST: No messageId logged"); this._sender.teardown(); appInsightsCore = new AppInsightsCore(); appInsightsCore.logger = new DiagnosticLogger(); messageId = _eInternalMessageId.InvalidInstrumentationKey; this._sender.initialize( { instrumentationKey: '1aa11111bbbb1ccc8dddeeeeffff3333', maxBatchInterval: 123, endpointUrl: 'https://example.com', maxBatchSizeInBytes: 654, extensionConfig: { [this._sender.identifier]: { maxBatchSizeInBytes: 456 } } }, appInsightsCore, [] ); QUnit.assert.equal(1, appInsightsCore.logger.queue.length, "POST: Correct messageId logged"); QUnit.assert.ok(appInsightsCore.logger.queue[0].message.indexOf('Invalid Instrumentation key') !== -1, "Correct message logged"); QUnit.assert.equal(messageId, appInsightsCore.logger.queue[0].messageId, "Correct message logged"); this._sender.teardown(); appInsightsCore = new AppInsightsCore(); appInsightsCore.logger = new DiagnosticLogger(); messageId = _eInternalMessageId.InvalidInstrumentationKey; this._sender.initialize( { instrumentationKey: 'abc', maxBatchInterval: 123, endpointUrl: 'https://example.com', maxBatchSizeInBytes: 654, extensionConfig: { [this._sender.identifier]: { maxBatchSizeInBytes: 456 } } }, appInsightsCore, [] ); QUnit.assert.equal(1, appInsightsCore.logger.queue.length, "POST: Correct messageId logged"); QUnit.assert.ok(appInsightsCore.logger.queue[0].message.indexOf('Invalid Instrumentation key') !== -1, "Correct message logged"); QUnit.assert.equal(messageId, appInsightsCore.logger.queue[0].messageId, "Correct message logged"); this._sender.teardown(); appInsightsCore = new AppInsightsCore(); appInsightsCore.logger = new DiagnosticLogger(); messageId = _eInternalMessageId.InvalidInstrumentationKey; this._sender.initialize( { instrumentationKey: '', maxBatchInterval: 123, endpointUrl: 'https://example.com', maxBatchSizeInBytes: 654, extensionConfig: { [this._sender.identifier]: { maxBatchSizeInBytes: 456 } } }, appInsightsCore, [] ); QUnit.assert.equal(1, appInsightsCore.logger.queue.length, "POST: Correct messageId logged"); QUnit.assert.ok(appInsightsCore.logger.queue[0].message.indexOf('Invalid Instrumentation key') !== -1, "Correct message logged"); QUnit.assert.equal(messageId, appInsightsCore.logger.queue[0].messageId, "Correct message logged"); this._sender.teardown(); appInsightsCore = new AppInsightsCore(); appInsightsCore.logger = new DiagnosticLogger(); messageId = _eInternalMessageId.InvalidInstrumentationKey; this._sender.initialize( { instrumentationKey: 'abc', maxBatchInterval: 123, endpointUrl: 'https://example.com', maxBatchSizeInBytes: 654, extensionConfig: { [this._sender.identifier]: { maxBatchSizeInBytes: 456 } }, disableInstrumentationKeyValidation: true }, appInsightsCore, [] ); QUnit.assert.equal(0, appInsightsCore.logger.queue.length, "POST: No messageId logged"); this._sender.teardown(); } }); this.testCase({ name: "Channel Config: convert custom dimension undefined values to customer defined value with config convertUndefined", test: () => { const inputEnvelope: ITelemetryItem = { name: "test", iKey: "iKey", data: { "property1": undefined, "property2": "value2" }, baseData: { "name": "Event Name" } }; const appInsightsEnvelope = Sender.constructEnvelope(inputEnvelope, this._instrumentationKey, null, "test"); const baseData = appInsightsEnvelope.data.baseData; // Assert custom properties QUnit.assert.ok(baseData.properties); QUnit.assert.equal("test", baseData.properties["property1"]); QUnit.assert.equal("value2", baseData.properties["property2"]); } }); this.testCase({ name: "Channel Config: Validate pausing and resuming sending with manual flush", useFakeTimers: true, test: () => { let sendNotifications = []; let notificationManager = new NotificationManager(); notificationManager.addNotificationListener({ eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason, isAsync }); } }); let core = new AppInsightsCore(); this.sandbox.stub(core, "getNotifyMgr").returns(notificationManager); this._sender.initialize( { instrumentationKey: 'abc', maxBatchInterval: 123, endpointUrl: 'https://example.com', extensionConfig: { } }, core, [] ); const loggerSpy = this.sandbox.spy(this._sender, "triggerSend"); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; try { this._sender.processTelemetry(telemetryItem, null); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(false, loggerSpy.calledOnce); QUnit.assert.equal(0, sendNotifications.length); this._sender.pause(); this._sender.flush(); QUnit.assert.equal(false, loggerSpy.calledOnce); QUnit.assert.equal(0, sendNotifications.length); this.clock.tick(1); QUnit.assert.equal(0, sendNotifications.length); this._sender.resume(); this._sender.flush(); QUnit.assert.equal(true, loggerSpy.calledOnce); QUnit.assert.equal(0, sendNotifications.length); this.clock.tick(1); QUnit.assert.equal(1, sendNotifications.length); QUnit.assert.equal(SendRequestReason.ManualFlush, sendNotifications[0].sendReason); } }); this.testCase({ name: "Channel Config: Validate pausing and resuming sending when exceeding the batch size limits", useFakeTimers: true, test: () => { let sendNotifications = []; let notificationManager = new NotificationManager(); notificationManager.addNotificationListener({ eventsSendRequest: (sendReason: number, isAsync?: boolean) => { sendNotifications.push({ sendReason, isAsync }); } }); let core = new AppInsightsCore(); this.sandbox.stub(core, "getNotifyMgr").returns(notificationManager); this._sender.initialize( { instrumentationKey: 'abc', maxBatchInterval: 123, maxBatchSizeInBytes: 4096, endpointUrl: 'https://example.com', extensionConfig: { } }, core, [] ); const triggerSendSpy = this.sandbox.spy(this._sender, "triggerSend"); const telemetryItem: ITelemetryItem = { name: 'fake item', iKey: 'iKey', baseType: 'some type', baseData: {} }; this._sender.pause(); // Keep sending events until the max payload size is reached while (!triggerSendSpy.calledOnce) { try { this._sender.processTelemetry(telemetryItem, null); } catch(e) { QUnit.assert.ok(false); } } QUnit.assert.equal(true, triggerSendSpy.calledOnce); QUnit.assert.equal(0, sendNotifications.length); this.clock.tick(1); QUnit.assert.equal(0, sendNotifications.length); QUnit.assert.equal(false, triggerSendSpy.calledTwice); this._sender.resume(); QUnit.assert.equal(true, triggerSendSpy.calledTwice); QUnit.assert.equal(0, sendNotifications.length); this.clock.tick(1); QUnit.assert.equal(1, sendNotifications.length); QUnit.assert.equal(SendRequestReason.MaxBatchSize, sendNotifications[0].sendReason); } }); this.testCase({ name: "Channel Config: Process telemetry when offline and exceeding the batch size limits", useFakeTimers: true, test: () => { const maxBatchSizeInBytes = 1024; let core = new AppInsightsCore(); this._sender.initialize( { instrumentationKey: 'abc', maxBatchInterval: 123, maxBatchSizeInBytes: maxBatchSizeInBytes, endpointUrl: 'https://example.com', extensionConfig: { } }, core, [] ); const triggerSendSpy = this.sandbox.spy(this._sender, "triggerSend"); const telemetryItem: ITelemetryItem = { name: 'fake item with some really long name to take up space quickly', iKey: 'iKey', baseType: 'some type', baseData: {} }; // Act - Go offline const offlineEvent = new Event('offline'); window.dispatchEvent(offlineEvent); // Keep sending events until the max payload size is exceeded while (!triggerSendSpy.called && this._sender._buffer.size() < maxBatchSizeInBytes) { try { this._sender.processTelemetry(telemetryItem, null); } catch(e) { QUnit.assert.ok(false); } } QUnit.assert.equal(false, triggerSendSpy.called); this.clock.tick(1); QUnit.assert.equal(false, triggerSendSpy.called); } }); this.testCase({ name: "Channel Config: Process telemetry when offline and reponse code is 200", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); this._sender.initialize( { instrumentationKey: "abc", endpointUrl: 'https://example.com', extensionConfig: { [this._sender.identifier]: { namePrefix: "offline" } } }, core, [] ); const triggerSendSpy = this.sandbox.spy(this._sender, "triggerSend"); const telemetryItem: ITelemetryItem = { name: "testevent", iKey: "iKey", baseType: "some type", baseData: {} }; try { this._sender.processTelemetry(telemetryItem, undefined); } catch(e) { QUnit.assert.ok(false); } QUnit.assert.equal(false, triggerSendSpy.called, "trigger send should not be called"); let keys = utlGetSessionStorageKeys(); QUnit.assert.deepEqual(keys.length, 2, "session buffer should contain only two keys"); let bufferKey = "offline_"+ BUFFER_KEY; let sentKey = "offline_" + SENT_BUFFER_KEY; QUnit.assert.ok(keys.indexOf(bufferKey) > -1, "session buffer key contain buffer key"); QUnit.assert.ok(keys.indexOf(sentKey) > -1, "session buffer key contain sent buffer key"); let itemsStr = sessionStorage.getItem(bufferKey) || ""; let items =JSON.parse(itemsStr); QUnit.assert.equal(items.length, 1, "items should be saved"); this._sender.flush(); // Act - Go offline const offlineEvent = new Event('offline'); window.dispatchEvent(offlineEvent); QUnit.assert.equal(true, triggerSendSpy.called, "trigger send should be called"); itemsStr = sessionStorage.getItem(sentKey) || ""; items =JSON.parse(itemsStr); QUnit.assert.equal(items.length, 1, "items should be saved into sent buffer"); let requests = this._getXhrRequests(); QUnit.assert.deepEqual(requests.length, 1, "should have only 1 requests"); let request = requests[0]; this.sendJsonResponse(request, {}, 200); itemsStr = sessionStorage.getItem(bufferKey) || ""; items =JSON.parse(itemsStr); QUnit.assert.equal(items.length, 0, "items should be cleared"); itemsStr = sessionStorage.getItem(sentKey) || ""; items =JSON.parse(itemsStr); QUnit.assert.equal(items.length, 0, "sent items should be cleared"); } }); this.testCase({ name: 'Envelope: operation.name is correctly truncated if required', test: () => { const excessiveName = new Array(1234).join("a"); // exceeds max of 1024 const bd = new Exception( null, new Error(), {"property1": "val1", "property2": "val2" }, {"measurement1": 50.0, "measurement2": 1.3 } ); const inputEnvelope: ITelemetryItem = { name: "test", time: new Date("2018-06-12").toISOString(), iKey: "iKey", baseType: ExceptionDataType, baseData: bd, data: { "property3": "val3", "measurement3": 3.0 }, ext: { "trace": { "traceID": "1528B5FF-6455-4657-BE77-E6664CAC72DC", "parentID": "1528B5FF-6455-4657-BE77-E6664CACEEEE", "name": excessiveName } }, tags: [ {"user.accountId": "TestAccountId"}, ], }; // Act const appInsightsEnvelope = Sender.constructEnvelope(inputEnvelope, this._instrumentationKey, null); const baseData = appInsightsEnvelope.data.baseData; QUnit.assert.equal("val3", baseData.properties["property3"], "ExceptionData: customProperties (item.data) are added to the properties of the envelope and not included in the item.data") QUnit.assert.equal("val1", baseData.properties["property1"], "ExceptionData: properties (item.baseData.properties) are added to telemetry envelope"); QUnit.assert.equal(50.0, baseData.measurements["measurement1"], "ExceptionData: measurements (item.baseData.measurements) are added to telemetry envelope"); QUnit.assert.equal(1024, appInsightsEnvelope.tags["ai.operation.name"].length, "The ai.operation.name should have been truncated to the maximum"); } }); this.testCase({ name: "flush method handles synchronous callback execution", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); this._sender.initialize({ instrumentationKey: 'abc', endpointUrl: 'https://example.com', isBeaconApiDisabled: true }, core, []); this.onDone(() => { this._sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'test item', iKey: 'iKey', baseType: 'some type', baseData: {} }; // Add some telemetry to flush this._sender.processTelemetry(telemetryItem); // Test sync flush with callback let callbackCalled = false; let callbackResult: boolean; const result = this._sender.flush(false, (success) => { callbackCalled = true; callbackResult = success; }); QUnit.assert.equal(typeof result, 'boolean', "flush should return boolean when callback provided"); QUnit.assert.equal(result, true, "flush should return true when callback will be called"); QUnit.assert.equal(callbackCalled, true, "callback should be called synchronously"); QUnit.assert.equal(callbackResult, true, "callback should receive success=true"); } }); this.testCase({ name: "flush method handles asynchronous callback execution without callback", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); this._sender.initialize({ instrumentationKey: 'abc', endpointUrl: 'https://example.com', isBeaconApiDisabled: true }, core, []); this.onDone(() => { this._sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'test item', iKey: 'iKey', baseType: 'some type', baseData: {} }; // Add some telemetry to flush this._sender.processTelemetry(telemetryItem); // Test async flush without callback - should return promise-like const result = this._sender.flush(true); // Check if result is promise-like (has then method) QUnit.assert.ok(isPromiseLike(result), "flush should return promise-like object when async=true and no callback"); } }); this.testCase({ name: "flush method handles asynchronous callback execution with callback", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); this._sender.initialize({ instrumentationKey: 'abc', endpointUrl: 'https://example.com', isBeaconApiDisabled: true }, core, []); this.onDone(() => { this._sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'test item', iKey: 'iKey', baseType: 'some type', baseData: {} }; // Add some telemetry to flush this._sender.processTelemetry(telemetryItem); // Test async flush with callback let callbackCalled = false; let callbackResult: boolean; const result = this._sender.flush(true, (success) => { callbackCalled = true; callbackResult = success; }); QUnit.assert.equal(typeof result, 'boolean', "flush should return boolean when callback provided"); QUnit.assert.equal(result, true, "flush should return true when callback will be called"); QUnit.assert.equal(callbackCalled, true, "callback should be called synchronously even when async=true"); QUnit.assert.equal(callbackResult, true, "callback should receive success=true"); } }); this.testCase({ name: "flush method returns correct boolean result for sync operation", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); this._sender.initialize({ instrumentationKey: 'abc', endpointUrl: 'https://example.com', isBeaconApiDisabled: true }, core, []); this.onDone(() => { this._sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'test item', iKey: 'iKey', baseType: 'some type', baseData: {} }; // Add some telemetry to flush this._sender.processTelemetry(telemetryItem); // Test sync flush without callback - should return undefined/void const result = this._sender.flush(false); QUnit.assert.ok(isUndefined(result), "flush should return undefined when sync=true and no callback"); } }); this.testCase({ name: "flush method handles paused state correctly", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); this._sender.initialize({ instrumentationKey: 'abc', endpointUrl: 'https://example.com', isBeaconApiDisabled: true }, core, []); this.onDone(() => { this._sender.teardown(); }); const telemetryItem: ITelemetryItem = { name: 'test item', iKey: 'iKey', baseType: 'some type', baseData: {} }; // Add some telemetry to flush this._sender.processTelemetry(telemetryItem); // Pause the sender this._sender.pause(); // Test flush when paused - should return undefined const result = this._sender.flush(true); QUnit.assert.ok(isUndefined(result), "flush should return undefined when sender is paused"); } }); } } class AutoCompleteXhrOverride { public sendPOST(payload: IPayloadData, oncomplete: (status: number, headers: { [headerName: string]: string }) => void, sync?: boolean) { oncomplete(200, null); } } ================================================ FILE: channels/applicationinsights-channel-js/Tests/Unit/src/StatsBeat.tests.ts ================================================ // import { AITestClass, Assert, PollingAssert } from "@microsoft/ai-test-framework"; // import { AppInsightsCore, createStatsMgr, eStatsType, FeatureOptInMode, getWindow, IPayloadData, IStatsBeatState, IStatsMgr, ITelemetryItem, IUnloadHook, TransportType } from "@microsoft/applicationinsights-core-js"; // import { Sender } from "../../../src/Sender"; // import { SinonSpy, SinonStub } from "sinon"; // import { ISenderConfig } from "../../../types/applicationinsights-channel-js"; // import { isBeaconsSupported } from "@microsoft/applicationinsights-core-js"; // export class StatsbeatTests extends AITestClass { // private _core: AppInsightsCore; // private _sender: Sender; // private _statsMgr: IStatsMgr; // private _statsMgrUnloadHook: IUnloadHook | null; // private statsbeatCountSpy: SinonSpy; // private fetchStub: sinon.SinonStub; // private beaconStub: sinon.SinonStub; // private trackSpy: SinonSpy; // public testInitialize() { // this._core = new AppInsightsCore(); // this._sender = new Sender(); // this._statsMgr = createStatsMgr(); // } // public testFinishedCleanup() { // if (this._sender && this._sender.isInitialized()) { // this._sender.pause(); // this._sender._buffer.clear(); // this._sender.teardown(); // } // this._sender = null; // this._core = null; // this._statsMgr = null; // if (this._statsMgrUnloadHook) { // this._statsMgrUnloadHook.rm(); // this._statsMgrUnloadHook = null; // } // if (this.statsbeatCountSpy) { // this.statsbeatCountSpy.restore(); // } // if (this.fetchStub) { // this.fetchStub.restore(); // } // if (this.beaconStub) { // this.beaconStub.restore(); // } // if (this.trackSpy) { // this.trackSpy.restore(); // } // } // private initializeCoreAndSender(config: any, instrumentationKey: string) { // const sender = new Sender(); // const core = new AppInsightsCore(); // const coreConfig = { // instrumentationKey, // _sdk: { // stats: { // shrtInt: 900, // endCfg: [ // { // type: 0, // keyMap: [ // { // key: "stats-key1", // match: [ "https://example.endpoint.com" ] // } // ] // } // ] // } // }, // extensionConfig: { [sender.identifier]: config } // }; // let statsMgr = createStatsMgr(); // // Initialize // let unloadHook = statsMgr.init(this._core, { // feature: "StatsBeat", // getCfg: (core, cfg) => { // return cfg?._sdk?.stats; // } // }); // core.initialize(coreConfig, [sender]); // core.setStatsMgr(statsMgr); // this.statsbeatCountSpy = this.sandbox.spy(core.getStatsBeat(), "count"); // this.trackSpy = this.sandbox.spy(core, "track"); // this.onDone(() => { // sender.teardown(); // }); // return { core, sender, statsMgr, unloadHook }; // } // private createSenderConfig(transportType: TransportType) { // return { // endpointUrl: "https://test", // emitLineDelimitedJson: false, // maxBatchInterval: 15000, // maxBatchSizeInBytes: 102400, // disableTelemetry: false, // enableSessionStorageBuffer: true, // isRetryDisabled: false, // isBeaconApiDisabled: false, // disableXhr: false, // onunloadDisableFetch: false, // onunloadDisableBeacon: false, // namePrefix: "", // samplingPercentage: 100, // customHeaders: [{ header: "header", value: "val" }], // convertUndefined: "", // eventsLimitInMem: 10000, // transports: [transportType] // }; // } // private processTelemetryAndFlush(sender: Sender, telemetryItem: ITelemetryItem) { // try { // sender.processTelemetry(telemetryItem, null); // sender.flush(); // } catch (e) { // QUnit.assert.ok(false, "Unexpected error during telemetry processing"); // } // this.clock.tick(900000); // Simulate time passing for statsbeat to be sent // } // private assertStatsbeatCall(statusCode: number, eventName: string) { // Assert.equal(this.statsbeatCountSpy.callCount, 1, "Statsbeat count should be called once"); // Assert.equal(this.statsbeatCountSpy.firstCall.args[0], statusCode, `Statsbeat count should be called with status ${statusCode}`); // const data = JSON.stringify(this.statsbeatCountSpy.firstCall.args[1]); // Assert.ok(data.includes("startTime"), "Statsbeat count should be called with startTime set"); // const statsbeatEvent = this.trackSpy.firstCall.args[0]; // Assert.equal(statsbeatEvent.baseType, "MetricData", "Statsbeat event should be of type MetricData"); // Assert.equal(statsbeatEvent.baseData.name, eventName, `Statsbeat event should be of type ${eventName}`); // } // public registerTests() { // this.testCase({ // name: "Statsbeat initializes when stats is true", // test: () => { // const config = { // instrumentationKey: "Test-iKey", // featureOptIn: { // "StatsBeat": { // mode: FeatureOptInMode.enable // } // }, // _sdk: { // stats: { // shrtInt: 900, // endCfg: [ // { // type: 0, // keyMap: [ // { // key: "stats-key1", // match: [ "https://example.endpoint.com" ] // } // ] // } // ] // } // }, // }; // this._core.initialize(config, [this._sender]); // this._statsMgrUnloadHook = this._statsMgr.init(this._core, { // feature: "StatsBeat", // getCfg: (core, cfg) => { // return cfg?._sdk?.stats; // } // }); // let statsBeatState: IStatsBeatState = { // cKey: "Test-iKey", // endpoint: "https://example.endpoint.com", // sdkVer: "1.0.0", // type: eStatsType.SDK // }; // const statsbeat = this._core.getStatsBeat(statsBeatState); // QUnit.assert.ok(statsbeat, "Statsbeat is initialized"); // QUnit.assert.ok(statsbeat.enabled, "Statsbeat is marked as initialized"); // } // }); // this.testCaseAsync({ // name: "Statsbeat increments success count when fetch sender is called once", // useFakeTimers: true, // useFakeServer: true, // stepDelay: 100, // steps: [ // () => { // this.fetchStub = this.sandbox.stub(window, "fetch").callsFake(() => { // only fetch is supported to stub, why? // return Promise.resolve(new Response("{}", { status: 200, statusText: "OK" })); // }); // const config = this.createSenderConfig(TransportType.Fetch); // const { sender } = this.initializeCoreAndSender(config, "000e0000-e000-0000-a000-000000000000"); // const telemetryItem: ITelemetryItem = { // name: "fake item", // iKey: "testIkey2;ingestionendpoint=testUrl1", // baseType: "some type", // baseData: {} // }; // this.processTelemetryAndFlush(sender, telemetryItem); // } // ].concat(PollingAssert.createPollingAssert(() => { // if (this.statsbeatCountSpy.called && this.fetchStub.called) { // this.assertStatsbeatCall(200, "Request_Success_Count"); // return true; // } // return false; // }, "Waiting for fetch sender and Statsbeat count to be called") as any) // }); // this.testCaseAsync({ // name: "Statsbeat increments throttle count when fetch sender is called with status 439", // useFakeTimers: true, // stepDelay: 100, // steps: [ // () => { // this.fetchStub = this.sandbox.stub(window, "fetch").callsFake(() => { // return Promise.resolve(new Response("{}", { status: 439, statusText: "Too Many Requests" })); // }); // const config = this.createSenderConfig(TransportType.Fetch); // const { sender } = this.initializeCoreAndSender(config, "000e0000-e000-0000-a000-000000000000"); // const telemetryItem: ITelemetryItem = { // name: "fake item", // iKey: "testIkey2;ingestionendpoint=testUrl1", // baseType: "some type", // baseData: {} // }; // this.processTelemetryAndFlush(sender, telemetryItem); // } // ].concat(PollingAssert.createPollingAssert(() => { // if (this.statsbeatCountSpy.called && this.fetchStub.called) { // this.assertStatsbeatCall(439, "Throttle_Count"); // return true; // } // return false; // }, "Waiting for fetch sender and Statsbeat count to be called") as any) // }); // this.testCaseAsync({ // name: "Statsbeat increments success count for beacon sender", // useFakeTimers: true, // stepDelay: 100, // steps: [ // () => { // const config = this.createSenderConfig(TransportType.Beacon); // const { sender } = this.initializeCoreAndSender(config, "000e0000-e000-0000-a000-000000000000"); // const telemetryItem: ITelemetryItem = { // name: "fake item", // iKey: "testIkey2;ingestionendpoint=testUrl1", // baseType: "some type", // baseData: {} // }; // let sendBeaconCalled = false; // this.hookSendBeacon((url: string) => { // sendBeaconCalled = true; // return true; // }); // QUnit.assert.ok(isBeaconsSupported(), "Beacon API is supported"); // this.processTelemetryAndFlush(sender, telemetryItem); // } // ].concat(PollingAssert.createPollingAssert(() => { // if (this.statsbeatCountSpy.called) { // this.assertStatsbeatCall(200, "Request_Success_Count"); // return true; // } // return false; // }, "Waiting for beacon sender and Statsbeat count to be called") as any) // }); // this.testCaseAsync({ // name: "Statsbeat increments success count for xhr sender", // useFakeTimers: true, // useFakeServer: true, // stepDelay: 100, // fakeServerAutoRespond: true, // steps: [ // () => { // let window = getWindow(); // let fakeXMLHttpRequest = (window as any).XMLHttpRequest; // why we do this? // let config = this.createSenderConfig(TransportType.Xhr) && {disableSendBeaconSplit: true}; // const { sender } = this.initializeCoreAndSender(config, "000e0000-e000-0000-a000-000000000000"); // console.log("xhr sender called", this._getXhrRequests().length); // const telemetryItem: ITelemetryItem = { // name: "fake item", // iKey: "testIkey2;ingestionendpoint=testUrl1", // baseType: "some type", // baseData: {} // }; // this.processTelemetryAndFlush(sender, telemetryItem); // QUnit.assert.equal(1, this._getXhrRequests().length, "xhr sender is called"); // console.log("xhr sender is called", this._getXhrRequests().length); // (window as any).XMLHttpRequest = fakeXMLHttpRequest; // } // ].concat(PollingAssert.createPollingAssert(() => { // if (this.statsbeatCountSpy.called) { // this.assertStatsbeatCall(200, "Request_Success_Count"); // console.log("Statsbeat count called with success count for xhr sender"); // return true; // } // return false; // }, "Waiting for xhr sender and Statsbeat count to be called", 60, 1000) as any) // }); // } // } ================================================ FILE: channels/applicationinsights-channel-js/Tests/Unit/src/aichannel.tests.ts ================================================ import { SenderTests } from "./Sender.tests"; import { SampleTests } from "./Sample.tests"; import { GlobalTestHooks } from "./GlobalTestHooks.Test"; // import { StatsbeatTests } from "./StatsBeat.tests"; export function runTests() { new GlobalTestHooks().registerTests(); new SenderTests().registerTests(); new SampleTests().registerTests(); // new StatsbeatTests().registerTests(); } ================================================ FILE: channels/applicationinsights-channel-js/Tests/UnitTests.html ================================================  Tests for Application Insights JavaScript API
    ================================================ FILE: channels/applicationinsights-channel-js/Tests/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": false, "module": "amd", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "declaration": true }, "include": [ ], "exclude": [ "node_modules/" ] } ================================================ FILE: channels/applicationinsights-channel-js/api-extractor.json ================================================ /** * Config file for API Extractor. For more info, please visit: https://api-extractor.com */ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", /** * Optionally specifies another JSON config file that this file extends from. This provides a way for * standard settings to be shared across multiple projects. * * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be * resolved using NodeJS require(). * * SUPPORTED TOKENS: none * DEFAULT VALUE: "" */ // "extends": "./shared/api-extractor-base.json" // "extends": "my-package/include/api-extractor-base.json" /** * Determines the "" token that can be used with other config file settings. The project folder * typically contains the tsconfig.json and package.json config files, but the path is user-defined. * * The path is resolved relative to the folder of the config file that contains the setting. * * The default value for "projectFolder" is the token "", which means the folder is determined by traversing * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error * will be reported. * * SUPPORTED TOKENS: * DEFAULT VALUE: "" */ "projectFolder": ".", /** * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor * analyzes the symbols exported by this module. * * The file extension must be ".d.ts" and not ".ts". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , */ "mainEntryPointFilePath": "/build/types/applicationinsights-channel-js.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. * * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly * imports library2. To avoid this, we can specify: * * "bundledPackages": [ "library2" ], * * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been * local files for library1. */ "bundledPackages": [ ], /** * Determines how the TypeScript compiler engine will be invoked by API Extractor. */ "compiler": { /** * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * Note: This setting will be ignored if "overrideTsconfig" is used. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/tsconfig.json" */ // "tsconfigFilePath": "/tsconfig.json", /** * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. * The object must conform to the TypeScript tsconfig schema: * * http://json.schemastore.org/tsconfig * * If omitted, then the tsconfig.json file will be read from the "projectFolder". * * DEFAULT VALUE: no overrideTsconfig section */ // "overrideTsconfig": { // . . . // } /** * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. * * DEFAULT VALUE: false */ // "skipLibCheck": true, }, /** * Configures how the API report file (*.api.md) will be generated. */ "apiReport": { /** * (REQUIRED) Whether to generate an API report. */ "enabled": true, /** * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce * a full file path. * * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". * * SUPPORTED TOKENS: , * DEFAULT VALUE: ".api.md" */ "reportFileName": ".api.md", /** * Specifies the folder where the API report file is written. The file name portion is determined by * the "reportFileName" setting. * * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, * e.g. for an API review. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/etc/" */ "reportFolder": "/build/dts/", /** * Specifies the folder where the temporary report file is written. The file name portion is determined by * the "reportFileName" setting. * * After the temporary file is written to disk, it is compared with the file in the "reportFolder". * If they are different, a production build will fail. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/" */ // "reportTempFolder": "/temp/" }, /** * Configures how the doc model file (*.api.json) will be generated. */ "docModel": { /** * (REQUIRED) Whether to generate a doc model file. */ "enabled": true, /** * The output path for the doc model file. The file extension should be ".api.json". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/.api.json" */ "apiJsonFilePath": "/build/dts/.api.json" }, /** * Configures how the .d.ts rollup file will be generated. */ "dtsRollup": { /** * (REQUIRED) Whether to generate the .d.ts rollup file. */ "enabled": true, /** * Specifies the output path for a .d.ts rollup file to be generated without any trimming. * This file will include all declarations that are exported by the main entry point. * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/dist/.d.ts" */ "untrimmedFilePath": "/build/dts/.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. * This file will include only declarations that are marked as "@public" or "@beta". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "betaTrimmedFilePath": "/build/dts/-beta.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. * This file will include only declarations that are marked as "@public". * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "publicTrimmedFilePath": "/build/dts/-public.d.ts", /** * When a declaration is trimmed, by default it will be replaced by a code comment such as * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the * declaration completely. * * DEFAULT VALUE: false */ // "omitTrimmingComments": true }, /** * Configures how the tsdoc-metadata.json file will be generated. */ "tsdocMetadata": { /** * Whether to generate the tsdoc-metadata.json file. * * DEFAULT VALUE: true */ "enabled": false, /** * Specifies where the TSDoc metadata file should be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup * falls back to "tsdoc-metadata.json" in the package folder. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ "tsdocMetadataFilePath": "/build/dts/tsdoc-metadata.json" }, /** * Configures how API Extractor reports error and warning messages produced during analysis. * * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. */ "messages": { /** * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing * the input .d.ts files. * * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "compilerMessageReporting": { /** * Configures the default routing for messages that don't match an explicit rule in this table. */ "default": { /** * Specifies whether the message should be written to the the tool's output log. Note that * the "addToApiReportFile" property may supersede this option. * * Possible values: "error", "warning", "none" * * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes * the "--local" option), the warning is displayed but the build will not fail. * * DEFAULT VALUE: "warning" */ "logLevel": "warning", /** * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), * then the message will be written inside that file; otherwise, the message is instead logged according to * the "logLevel" option. * * DEFAULT VALUE: false */ // "addToApiReportFile": false }, // "TS2551": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . }, /** * Configures handling of messages reported by API Extractor during its analysis. * * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" * * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings */ "extractorMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false }, "ae-missing-release-tag": { "logLevel": "none" }, // // . . . }, /** * Configures handling of messages reported by the TSDoc parser when analyzing code comments. * * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "tsdocMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false } // "tsdoc-link-tag-unescaped-text": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . } } } ================================================ FILE: channels/applicationinsights-channel-js/package.json ================================================ { "name": "@microsoft/applicationinsights-channel-js", "version": "3.4.1", "description": "Microsoft Application Insights JavaScript SDK Channel", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "author": "Microsoft Application Insights Team", "main": "dist/es5/applicationinsights-channel-js.js", "module": "dist-es5/applicationinsights-channel-js.js", "types": "types/applicationinsights-channel-js.d.ts", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/channels/applicationinsights-channel-js" }, "scripts": { "clean": "git clean -xdf", "build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen", "build:esm": "grunt aichannel", "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs", "rebuild": "npm run build", "test": "grunt aichanneltest", "mintest": "grunt aichannel-mintest", "lint": "tslint -p tsconfig.json", "dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights JavaScript SDK Channel\"", "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js", "ai-min": "grunt aichannel-min", "ai-restore": "grunt aichannel-restore", "npm-pack": "npm pack", "api-docs": "typedoc" }, "devDependencies": { "@microsoft/ai-test-framework": "0.0.1", "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es5": "1.0.2", "@microsoft/api-extractor": "^7.40.0", "@types/sinon": "4.3.3", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "@nevware21/grunt-ts-plugin": "^0.5.2", "@nevware21/grunt-eslint-ts": "^0.5.2", "globby": "^11.0.0", "magic-string": "^0.25.7", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "rollup": "^3.20.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "^4.9.3", "tslib": "^2.0.0", "sinon": "^7.3.1", "typedoc": "^0.26.6" }, "peerDependencies": { "tslib": ">= 1.0.0" }, "dependencies": { "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/applicationinsights-core-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x", "@nevware21/ts-async": ">= 0.5.5 < 2.x" }, "license": "MIT" } ================================================ FILE: channels/applicationinsights-channel-js/rollup.config.js ================================================ import { createConfig } from "../../rollup.base.config"; import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const browserEntryPointName = "applicationinsights-channel-js"; const browserOutputName = "applicationinsights-channel-js"; const entryPointName = "applicationinsights-channel-js"; const outputName = "applicationinsights-channel-js"; const banner = [ "/*!", ` * Application Insights JavaScript SDK - Channel, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the MIT License.": "" }; updateDistEsmFiles(replaceValues, banner, true, true, "dist-es5"); export default createConfig(banner, { namespace: "Microsoft.ApplicationInsights", version: version, node: { entryPoint: entryPointName, outputName: outputName }, browser: { entryPoint: browserEntryPointName, outputName: browserOutputName } }, [ "applicationinsights-channel-js" ] ); ================================================ FILE: channels/applicationinsights-channel-js/src/EnvelopeCreator.ts ================================================ import { AIData, CtxTagKeys, Envelope, Event, EventDataType, EventEnvelopeType, Exception, ExceptionDataType, ExceptionEnvelopeType, HttpMethod, IDependencyTelemetry, IDiagnosticLogger, IEnvelope, IExceptionInternal, IPageViewPerformanceTelemetry, IPageViewTelemetryInternal, IRemoteDependencyData, IRequestTelemetry, ISerializable, ITelemetryItem, IWeb, Metric, MetricDataType, MetricEnvelopeType, PageView, PageViewDataType, PageViewEnvelopeType, PageViewPerformance, PageViewPerformanceDataType, PageViewPerformanceEnvelopeType, RemoteDependencyDataType, RequestDataType, SampleRate, Tags, Trace, TraceDataType, TraceEnvelopeType, _eInternalMessageId, _throwInternal, _warnToConsole, dataSanitizeString, eLoggingSeverity, getJSON, hasJSON, isDate, isNullOrUndefined, isNumber, isString, isTruthy, objForEachKey, optimizeObject, setValue, toISOString } from "@microsoft/applicationinsights-core-js"; import { IRequestData } from "./Interfaces/Contracts/IRequestData"; import { STR_DURATION } from "./InternalConstants"; import { _createData } from "./Telemetry/Common/Data"; import { RemoteDependencyEnvelopeType, createRemoteDependencyData } from "./Telemetry/RemoteDependencyData"; import { RequestEnvelopeType, createRequestData } from "./Telemetry/RequestData"; // these two constants are used to filter out properties not needed when trying to extract custom properties and measurements from the incoming payload const strBaseType = "baseType"; const strBaseData = "baseData"; const strProperties = "properties"; const strTrue = "true"; function _setValueIf(target:T, field:keyof T, value:any) { return setValue(target, field, value, isTruthy); } /* * Maps Part A data from CS 4.0 */ function _extractPartAExtensions(logger: IDiagnosticLogger, item: ITelemetryItem, env: IEnvelope) { // todo: switch to keys from common in this method let envTags = env.tags = env.tags || {}; let itmExt = item.ext = item.ext || {}; let itmTags = item.tags = item.tags || {} as Tags; let extUser = itmExt.user; if (extUser) { _setValueIf(envTags, CtxTagKeys.userAuthUserId, extUser.authId); _setValueIf(envTags, CtxTagKeys.userId, extUser.id || extUser.localId); } let extApp = itmExt.app; if (extApp) { _setValueIf(envTags, CtxTagKeys.sessionId, extApp.sesId); } let extDevice = itmExt.device; if (extDevice) { _setValueIf(envTags, CtxTagKeys.deviceId, extDevice.id || extDevice.localId); _setValueIf(envTags, CtxTagKeys.deviceType, extDevice.deviceClass); _setValueIf(envTags, CtxTagKeys.deviceIp, extDevice.ip); _setValueIf(envTags, CtxTagKeys.deviceModel, extDevice.model); _setValueIf(envTags, CtxTagKeys.deviceType, extDevice.deviceType); } const web: IWeb = item.ext.web as IWeb; if (web) { _setValueIf(envTags, CtxTagKeys.deviceLanguage, web.browserLang); _setValueIf(envTags, CtxTagKeys.deviceBrowserVersion, web.browserVer); _setValueIf(envTags, CtxTagKeys.deviceBrowser, web.browser); let envData = env.data = env.data || {}; let envBaseData = envData[strBaseData] = envData[strBaseData] || {}; let envProps = envBaseData[strProperties] = envBaseData[strProperties] || {}; _setValueIf(envProps, "domain", web.domain); _setValueIf(envProps, "isManual", web.isManual ? strTrue : null); _setValueIf(envProps, "screenRes", web.screenRes); _setValueIf(envProps, "userConsent", web.userConsent ? strTrue : null); } let extOs = itmExt.os; if (extOs) { _setValueIf(envTags, CtxTagKeys.deviceOS, extOs.name); _setValueIf(envTags, CtxTagKeys.deviceOSVersion, extOs.osVer); } // No support for mapping Trace.traceState to 2.0 as it is currently empty let extTrace = itmExt.trace; if (extTrace) { _setValueIf(envTags, CtxTagKeys.operationParentId, extTrace.parentID); _setValueIf(envTags, CtxTagKeys.operationName, dataSanitizeString(logger, extTrace.name)); _setValueIf(envTags, CtxTagKeys.operationId, extTrace.traceID); } // Sample 4.0 schema // { // "time" : "2018-09-05T22:51:22.4936Z", // "name" : "MetricWithNamespace", // "iKey" : "ABC-5a4cbd20-e601-4ef5-a3c6-5d6577e4398e", // "ext": { "cloud": { // "role": "WATSON3", // "roleInstance": "CO4AEAP00000260" // }, // "device": {}, "correlation": {} }, // "tags": [ // { "amazon.region" : "east2" }, // { "os.expid" : "wp:02df239" } // ] // } const tgs: Tags = {}; // deals with tags.push({object}) for(let i = itmTags.length - 1; i >= 0; i--){ const tg = itmTags[i]; objForEachKey(tg, (key, value) => { tgs[key] = value; }); itmTags.splice(i, 1); } // deals with tags[key]=value (and handles hasOwnProperty) objForEachKey(itmTags, (tg, value) => { tgs[tg] = value; }); let theTags = { ...envTags, ...tgs }; if(!theTags[CtxTagKeys.internalSdkVersion]) { // Append a version in case it is not already set theTags[CtxTagKeys.internalSdkVersion] = dataSanitizeString(logger, `javascript:${EnvelopeCreator.Version}`, 64); } env.tags = optimizeObject(theTags); } function _extractPropsAndMeasurements(data: { [key: string]: any }, properties: { [key: string]: any }, measurements: { [key: string]: any }) { if (!isNullOrUndefined(data)) { objForEachKey(data, (key, value) => { if (isNumber(value)) { measurements[key] = value; } else if (isString(value)) { properties[key] = value; } else if (hasJSON()) { properties[key] = getJSON().stringify(value); } }); } } function _convertPropsUndefinedToCustomDefinedValue(properties: { [key: string]: any }, customUndefinedValue: any) { if (!isNullOrUndefined(properties)) { objForEachKey(properties, (key, value) => { properties[key] = value || customUndefinedValue; }); } } // TODO: Do we want this to take logger as arg or use this._logger as nonstatic? function _createEnvelope(logger: IDiagnosticLogger, envelopeType: string, telemetryItem: ITelemetryItem, data: AIData): IEnvelope { const envelope = new Envelope(logger, data, envelopeType); _setValueIf(envelope, "sampleRate", (telemetryItem as any)[SampleRate]); let startTime = (telemetryItem[strBaseData] || {}).startTime; if (isDate(startTime)) { // Starting from Version 3.0.3, the time property will be assigned by the startTime value, // which records the loadEvent time for the pageView event. envelope.time = toISOString(startTime); } envelope.iKey = telemetryItem.iKey; const iKeyNoDashes = telemetryItem.iKey.replace(/-/g, ""); envelope.name = envelope.name.replace("{0}", iKeyNoDashes); // extract all extensions from ctx _extractPartAExtensions(logger, telemetryItem, envelope); // loop through the envelope tags (extension of Part A) and pick out the ones that should go in outgoing envelope tags telemetryItem.tags = telemetryItem.tags || []; return optimizeObject(envelope); } function EnvelopeCreatorInit(logger: IDiagnosticLogger, telemetryItem: ITelemetryItem) { if (isNullOrUndefined(telemetryItem[strBaseData])) { _throwInternal(logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.TelemetryEnvelopeInvalid, "telemetryItem.baseData cannot be null."); } } export const EnvelopeCreator = { Version: "#version#" }; export function DependencyEnvelopeCreator(logger: IDiagnosticLogger, telemetryItem: ITelemetryItem, customUndefinedValue?: any): IEnvelope { EnvelopeCreatorInit(logger, telemetryItem); const customMeasurements = telemetryItem[strBaseData].measurements || {}; const customProperties = telemetryItem[strBaseData][strProperties] || {}; _extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue); } const bd = telemetryItem[strBaseData] as IDependencyTelemetry; if (isNullOrUndefined(bd)) { _warnToConsole(logger, "Invalid input for dependency data"); return null; } const method = bd[strProperties] && bd[strProperties][HttpMethod] ? bd[strProperties][HttpMethod] : "GET"; const remoteDepData = createRemoteDependencyData(logger, bd.id, bd.target, bd.name, bd.duration, bd.success, bd.responseCode, method, bd.type, bd.correlationContext, customProperties, customMeasurements); const data = _createData(RemoteDependencyDataType, remoteDepData); return _createEnvelope(logger, RemoteDependencyEnvelopeType, telemetryItem, data); } export function RequestEnvelopeCreator(logger: IDiagnosticLogger, telemetryItem: ITelemetryItem, customUndefinedValue?: any): IEnvelope { EnvelopeCreatorInit(logger, telemetryItem); const customMeasurements = telemetryItem[strBaseData].measurements || {}; const customProperties = telemetryItem[strBaseData][strProperties] || {}; _extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue); } const bd = telemetryItem[strBaseData] as IRequestTelemetry; const requestData = createRequestData(logger, bd.id, bd.name, bd.duration, bd.success, bd.responseCode, bd.source, bd.url, customProperties, customMeasurements); const data = _createData(RequestDataType, requestData); return _createEnvelope(logger, RequestEnvelopeType, telemetryItem, data); } export function EventEnvelopeCreator(logger: IDiagnosticLogger, telemetryItem: ITelemetryItem, customUndefinedValue?: any): IEnvelope { EnvelopeCreatorInit(logger, telemetryItem); let customProperties = {} as { [key: string]: any }; let customMeasurements = {}; if (telemetryItem[strBaseType] !== EventDataType) { (customProperties as any)["baseTypeSource"] = telemetryItem[strBaseType]; // save the passed in base type as a property } if (telemetryItem[strBaseType] === EventDataType) { // take collection customProperties = telemetryItem[strBaseData][strProperties] || {}; customMeasurements = telemetryItem[strBaseData].measurements || {}; } else { // if its not a known type, convert to custom event if (telemetryItem[strBaseData]) { _extractPropsAndMeasurements(telemetryItem[strBaseData], customProperties, customMeasurements); } } // Extract root level properties from part C telemetryItem.data _extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue); } const eventName = telemetryItem[strBaseData].name; const eventData = new Event(logger, eventName, customProperties, customMeasurements); const data = _createData(EventDataType, eventData); return _createEnvelope(logger, EventEnvelopeType, telemetryItem, data); } export function ExceptionEnvelopeCreator(logger: IDiagnosticLogger, telemetryItem: ITelemetryItem, customUndefinedValue?: any): IEnvelope { EnvelopeCreatorInit(logger, telemetryItem); // Extract root level properties from part C telemetryItem.data const customMeasurements = telemetryItem[strBaseData].measurements || {}; const customProperties = telemetryItem[strBaseData][strProperties] || {}; _extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(customProperties, customUndefinedValue); } const bd = telemetryItem[strBaseData] as IExceptionInternal; const exData = Exception.CreateFromInterface(logger, bd, customProperties, customMeasurements); const data = _createData(ExceptionDataType, exData); return _createEnvelope(logger, ExceptionEnvelopeType, telemetryItem, data); } export function MetricEnvelopeCreator(logger: IDiagnosticLogger, telemetryItem: ITelemetryItem, customUndefinedValue?: any): IEnvelope { EnvelopeCreatorInit(logger, telemetryItem); const baseData = telemetryItem[strBaseData]; const props = baseData[strProperties] || {}; const measurements = baseData.measurements || {}; _extractPropsAndMeasurements(telemetryItem.data, props, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(props, customUndefinedValue); } const baseMetricData = new Metric(logger, baseData.name, baseData.average, baseData.sampleCount, baseData.min, baseData.max, baseData.stdDev, props, measurements); const data = _createData(MetricDataType, baseMetricData); return _createEnvelope(logger, MetricEnvelopeType, telemetryItem, data); } export function PageViewEnvelopeCreator(logger: IDiagnosticLogger, telemetryItem: ITelemetryItem, customUndefinedValue?: any): IEnvelope { EnvelopeCreatorInit(logger, telemetryItem); // Since duration is not part of the domain properties in Common Schema, extract it from part C let duration; let baseData = telemetryItem[strBaseData]; if (!isNullOrUndefined(baseData) && !isNullOrUndefined(baseData[strProperties]) && !isNullOrUndefined(baseData[strProperties][STR_DURATION])) { // from part B properties duration = baseData[strProperties][STR_DURATION]; delete baseData[strProperties][STR_DURATION]; } else if (!isNullOrUndefined(telemetryItem.data) && !isNullOrUndefined(telemetryItem.data[STR_DURATION])) { // from custom properties duration = telemetryItem.data[STR_DURATION]; delete telemetryItem.data[STR_DURATION]; } const bd = telemetryItem[strBaseData] as IPageViewTelemetryInternal; // special case: pageview.id is grabbed from current operation id. Analytics plugin is decoupled from properties plugin, so this is done here instead. This can be made a default telemetry intializer instead if needed to be decoupled from channel let currentContextId; if (((telemetryItem.ext || {}).trace || {}).traceID) { currentContextId = telemetryItem.ext.trace.traceID; } const id = bd.id || currentContextId; const name = bd.name; const url = bd.uri; const properties = bd[strProperties] || {}; const measurements = bd.measurements || {}; // refUri is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!isNullOrUndefined(bd.refUri)) { properties["refUri"] = bd.refUri; } // pageType is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!isNullOrUndefined(bd.pageType)) { properties["pageType"] = bd.pageType; } // isLoggedIn is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!isNullOrUndefined(bd.isLoggedIn)) { properties["isLoggedIn"] = bd.isLoggedIn.toString(); } // pageTags is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property if (!isNullOrUndefined(bd[strProperties])) { const pageTags = bd[strProperties]; objForEachKey(pageTags, (key, value) => { properties[key] = value; }); } _extractPropsAndMeasurements(telemetryItem.data, properties, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue); } const pageViewData = new PageView(logger, name, url, duration, properties, measurements, id); const data = _createData(PageViewDataType, pageViewData); return _createEnvelope(logger, PageViewEnvelopeType, telemetryItem, data); } export function PageViewPerformanceEnvelopeCreator(logger: IDiagnosticLogger, telemetryItem: ITelemetryItem, customUndefinedValue?: any): IEnvelope { EnvelopeCreatorInit(logger, telemetryItem); const bd = telemetryItem[strBaseData] as IPageViewPerformanceTelemetry; const name = bd.name; const url = bd.uri || (bd as any).url; const properties = bd[strProperties] || {}; const measurements = bd.measurements || {}; _extractPropsAndMeasurements(telemetryItem.data, properties, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(properties, customUndefinedValue); } const baseData = new PageViewPerformance(logger, name, url, undefined, properties, measurements, bd); const data = _createData(PageViewPerformanceDataType, baseData); return _createEnvelope(logger, PageViewPerformanceEnvelopeType, telemetryItem, data); } export function TraceEnvelopeCreator(logger: IDiagnosticLogger, telemetryItem: ITelemetryItem, customUndefinedValue?: any): IEnvelope { EnvelopeCreatorInit(logger, telemetryItem); const message = telemetryItem[strBaseData].message; const severityLevel = telemetryItem[strBaseData].severityLevel; const props = telemetryItem[strBaseData][strProperties] || {}; const measurements = telemetryItem[strBaseData].measurements || {}; _extractPropsAndMeasurements(telemetryItem.data, props, measurements); if (!isNullOrUndefined(customUndefinedValue)) { _convertPropsUndefinedToCustomDefinedValue(props, customUndefinedValue); } const baseData = new Trace(logger, message, severityLevel, props, measurements); const data = _createData(TraceDataType, baseData); return _createEnvelope(logger, TraceEnvelopeType, telemetryItem, data); } ================================================ FILE: channels/applicationinsights-channel-js/src/Interfaces/Contracts/IRequestData.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { IDomain } from "@microsoft/applicationinsights-core-js"; /** * This interface indentifies the serialized request data contract that is sent to Application Insights backend */ export interface IRequestData extends IDomain { /** * Schema version */ ver: number; /* 2 */ /** * Identifier of a request call instance. Used for correlation between request and other telemetry items. */ id: string; /** * Name of the request. Represents code path taken to process request. Low cardinality value to allow better grouping of requests. For HTTP requests it represents the HTTP method and URL path template like 'GET /values/\{id\}'. */ name?: string; /** * Request duration in format: DD.HH:MM:SS.MMMMMM. Must be less than 1000 days. */ duration: string; /** * Indication of successful or unsuccessful call. */ success: boolean; /** * Result of a request execution. HTTP status code for HTTP requests. */ responseCode?: string; /** * Source of the request. Examples are the instrumentation key of the caller or the ip address of the caller. */ source?: string; /** * Request URL with all query string parameters. */ url?: string; /** * Collection of custom properties. */ properties?: { [propertyName: string]: string }; /* \{\} */ /** * Collection of custom measurements. */ measurements?: { [propertyName: string]: number }; /* \{\} */ } ================================================ FILE: channels/applicationinsights-channel-js/src/Interfaces.ts ================================================ import { IStorageBuffer, IXHROverride } from "@microsoft/applicationinsights-core-js"; /** * Internal interface for sendBuffer, do not export it * @internal * @since 3.1.3 */ export interface IInternalStorageItem { /** * serialized telemetry to be stored. */ item: string; /** * total retry count */ cnt?: number; } export interface ISenderConfig { /** * The url to which payloads will be sent */ endpointUrl: string; /** * The JSON format (normal vs line delimited). True means line delimited JSON. */ emitLineDelimitedJson: boolean; /** * The maximum size of a batch in bytes */ maxBatchSizeInBytes: number; /** * The maximum interval allowed between calls to batchInvoke */ maxBatchInterval: number; /** * The master off switch. Do not send any data if set to TRUE */ disableTelemetry: boolean; /** * Store a copy of a send buffer in the session storage */ enableSessionStorageBuffer: boolean; /** * Specify the storage buffer type implementation. * @since 2.8.12 */ bufferOverride: IStorageBuffer | false; /** * Is retry handler disabled. * If enabled, retry on 206 (partial success), 408 (timeout), 429 (too many requests), 500 (internal server error) and 503 (service unavailable). */ isRetryDisabled: boolean; isBeaconApiDisabled: boolean; /** * Don't use XMLHttpRequest or XDomainRequest (for IE \< 9) by default instead attempt to use fetch() or sendBeacon. * If no other transport is available it will still use XMLHttpRequest */ disableXhr: boolean; /** * If fetch keepalive is supported do not use it for sending events during unload, it may still fallback to fetch() without keepalive */ onunloadDisableFetch: boolean; /** * Is beacon disabled on page unload. * If enabled, flush events through beaconSender. */ onunloadDisableBeacon: boolean; /** * (Optional) Override the instrumentation key that this channel instance sends to */ instrumentationKey: string; namePrefix: string; samplingPercentage: number; /** * (Optional) The ability for the user to provide extra headers */ customHeaders: [{header: string, value: string}]; /** * (Optional) Provide user an option to convert undefined field to user defined value. */ convertUndefined: any /** * (Optional) The number of events that can be kept in memory before the SDK starts to drop events. By default, this is 10,000. */ eventsLimitInMem: number; /** * (Optional) Enable the sender to return a promise so that manually flushing (and general sending) can wait for the request to finish. * Note: Enabling this may cause unhandled promise rejection errors to occur if you do not listen and handle any rejection response, * this *should* only be for manual flush attempts. * Defaults to false * @since 3.0.1 */ enableSendPromise?: boolean; /** * [Optional] The HTTP override that should be used to send requests, as an IXHROverride object. * By default during the unload of a page or if the event specifies that it wants to use sendBeacon() or sync fetch (with keep-alive), * this override will NOT be called. * If alwaysUseXhrOverride configuration value is set to true, the override will always be used. * The payload data (first argument) now also includes any configured 'timeout' (defaults to undefined) and whether you should avoid * creating any synchronous XHR requests 'disableXhr' (defaults to false/undefined) * @since 3.0.4 */ httpXHROverride?: IXHROverride; /** * [Optional] By default during unload (or when you specify to use sendBeacon() or sync fetch (with keep-alive) for an event) the SDK * ignores any provided httpXhrOverride and attempts to use sendBeacon() or fetch(with keep-alive) when they are available. * When this configuration option is true any provided httpXhrOverride will always be used, so any provided httpXhrOverride will * also need to "handle" the synchronous unload scenario. * @since 3.0.4 */ alwaysUseXhrOverride?: boolean; /** * [Optional] Disable events splitting during sendbeacon. * Default: false * @since 3.0.6 */ disableSendBeaconSplit?: boolean; /** * [Optional] Either an array or single value identifying the requested TransportType type that should be used. * This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride is provided. */ transports?: number | number[]; /** * [Optional] Either an array or single value identifying the requested TransportType type(s) that should be used during unload or events * marked as sendBeacon. This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride * is provided and alwaysUseXhrOverride is true. */ unloadTransports?: number | number[]; /** * (Optional) The specific error codes that will cause a retry of sending data to the backend. * @since 3.1.1 */ retryCodes?: number[]; /** * (Optional) The specific max retry count for each telemetry item. * Default: 10 * if it is set to 0, means no retry allowed * if it is set to undefined, means no limit for retry times * @since 3.2.0 */ maxRetryCnt?: number; /** * [Optional] Specifies the Cross-Origin Resource Policy (CORP) for the endpoint. * This value is included in the response header as `Cross-Origin-Resource-Policy`, * which helps control how resources can be shared across different origins. * * Possible values: * - `same-site`: Allows access only from the same site. * - `same-origin`: Allows access only from the same origin (protocol, host, and port). * - `cross-origin`: Allows access from any origin. * * @since 3.3.7 */ corsPolicy?: string; } export interface IBackendResponse { /** * Number of items received by the backend */ readonly itemsReceived: number; /** * Number of items succesfuly accepted by the backend */ readonly itemsAccepted: number; /** * List of errors for items which were not accepted */ readonly errors: IResponseError[]; /** * App id returned by the backend - not necessary returned, but we don't need it with each response. */ readonly appId?: string; } export interface XDomainRequest extends XMLHttpRequestEventTarget { readonly responseText: string; send(payload: string): void; open(method: string, url: string): void; } export interface IResponseError { readonly index: number; readonly statusCode: number; readonly message: string; } ================================================ FILE: channels/applicationinsights-channel-js/src/InternalConstants.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // ################################################################################################################################################### // Note: DON'T Export these const from the package as we are still targeting IE/ES5 this will export a mutable variables that someone could change ### // ################################################################################################################################################### // Generally you should only put values that are used more than 2 times and then only if not already exposed as a constant (such as SdkCoreNames) // as when using "short" named values from here they will be will be minified smaller than the SdkCoreNames[eSdkCoreNames.xxxx] value. export const STR_DURATION = "duration"; ================================================ FILE: channels/applicationinsights-channel-js/src/SendBuffer.ts ================================================ import dynamicProto from "@microsoft/dynamicproto-js"; import { IDiagnosticLogger, _eInternalMessageId, _throwInternal, arrForEach, arrIndexOf, dumpObj, eLoggingSeverity, getExceptionName, getJSON, isArray, isFunction, isNullOrUndefined, isString, utlGetSessionStorage, utlRemoveSessionStorage, utlSetSessionStorage } from "@microsoft/applicationinsights-core-js"; import { IInternalStorageItem, ISenderConfig } from "./Interfaces"; /** * Before 3.1.2, payload only allow string * After 3.2.0, IInternalStorageItem is accepted */ export interface ISendBuffer { /** * Enqueue the payload */ enqueue: (payload: IInternalStorageItem) => void; /** * Returns the number of elements in the buffer */ count: () => number; /** * Returns the current size of the serialized buffer */ size: () => number; /** * Clears the buffer */ clear: () => void; /** * Returns items stored in the buffer */ getItems: () => IInternalStorageItem[]; /** * Build a batch of all elements in the payload array */ batchPayloads: (payload: IInternalStorageItem[]) => string; /** * Moves items to the SENT_BUFFER. * The buffer holds items which were sent, but we haven't received any response from the backend yet. */ markAsSent: (payload: IInternalStorageItem[]) => void; /** * Removes items from the SENT_BUFFER. Should be called on successful response from the backend. */ clearSent: (payload: IInternalStorageItem[]) => void; /** * Copy current buffer items to a new buffer. * if canUseSessionStorage is undefined, it will set to false. * if newLogger and newConfig are undefined, current logger and empty config will be used. * if canUseSessionStorage is set to true, new SessionStorageSendBuffer will be returned otherwise ArraySendBuffer will be returned. */ createNew: (newLogger?: IDiagnosticLogger, newConfig?: ISenderConfig, canUseSessionStorage?: boolean) => ArraySendBuffer | SessionStorageSendBuffer; } abstract class BaseSendBuffer { protected _get: () => IInternalStorageItem[]; protected _set: (buffer: IInternalStorageItem[]) => IInternalStorageItem[]; constructor(logger: IDiagnosticLogger, config: ISenderConfig) { let _buffer: IInternalStorageItem[] = []; let _bufferFullMessageSent = false; let _maxRetryCnt = config.maxRetryCnt; this._get = () => { return _buffer; }; this._set = (buffer: IInternalStorageItem[]) => { _buffer = buffer; return _buffer; }; dynamicProto(BaseSendBuffer, this, (_self) => { _self.enqueue = (payload: IInternalStorageItem) => { if (_self.count() >= config.eventsLimitInMem) { // sent internal log only once per page view if (!_bufferFullMessageSent) { _throwInternal(logger, eLoggingSeverity.WARNING, _eInternalMessageId.InMemoryStorageBufferFull, "Maximum in-memory buffer size reached: " + _self.count(), true); _bufferFullMessageSent = true; } return; } payload.cnt = payload.cnt || 0; // max retry is defined, and max retry is reached, do not add the payload to buffer if (!isNullOrUndefined(_maxRetryCnt)) { if (payload.cnt > _maxRetryCnt) { // TODO: add log here on dropping payloads // will log statsbeat exception later here return; } } _buffer.push(payload); return; }; _self.count = (): number => { return _buffer.length; }; _self.size = (): number => { let size = _buffer.length; for (let lp = 0; lp < _buffer.length; lp++) { size += (_buffer[lp].item).length; } if (!config.emitLineDelimitedJson) { size += 2; } return size; }; _self.clear = () => { _buffer = []; _bufferFullMessageSent = false; }; _self.getItems = (): IInternalStorageItem[] => { return _buffer.slice(0) }; _self.batchPayloads = (payloads: IInternalStorageItem[]): string => { if (payloads && payloads.length > 0) { let payloadStr: string[] = []; arrForEach(payloads, (payload) => { payloadStr.push(payload.item); }) const batch = config.emitLineDelimitedJson ? payloadStr.join("\n") : "[" + payloadStr.join(",") + "]"; return batch; } return null; }; _self.createNew = (newLogger?: IDiagnosticLogger, newConfig?: ISenderConfig, canUseSessionStorage?: boolean): ArraySendBuffer | SessionStorageSendBuffer => { let items = _buffer.slice(0); newLogger = newLogger || logger; newConfig = newConfig || {} as ISenderConfig; let newBuffer = !!canUseSessionStorage? new SessionStorageSendBuffer(newLogger, newConfig) : new ArraySendBuffer(newLogger, newConfig); arrForEach(items, (payload) => { newBuffer.enqueue(payload); }); return newBuffer; } }); } public enqueue(payload: IInternalStorageItem) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public count(): number { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return 0; } public size(): number { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return 0; } public clear() { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public getItems(): IInternalStorageItem[] { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } public batchPayloads(payload: IInternalStorageItem[]): string { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } public createNew(newLogger?: IDiagnosticLogger, newConfig?: ISenderConfig, canUseSessionStorage?: boolean): ArraySendBuffer | SessionStorageSendBuffer { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null } } /* * An array based send buffer. */ export class ArraySendBuffer extends BaseSendBuffer implements ISendBuffer { constructor(logger: IDiagnosticLogger, config: ISenderConfig) { super(logger, config); dynamicProto(ArraySendBuffer, this, (_self, _base) => { _self.markAsSent = (payload: IInternalStorageItem[]) => { _base.clear(); }; _self.clearSent = (payload: IInternalStorageItem[]) => { // not supported }; }); } public markAsSent(payload: IInternalStorageItem[]) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public clearSent(payload: IInternalStorageItem[]) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } } const PREVIOUS_KEYS: string[] = ["AI_buffer", "AI_sentBuffer"]; /* * Session storage buffer holds a copy of all unsent items in the browser session storage. */ export class SessionStorageSendBuffer extends BaseSendBuffer implements ISendBuffer { static VERSION = "_1"; static BUFFER_KEY = "AI_buffer"+ this.VERSION; static SENT_BUFFER_KEY = "AI_sentBuffer" + this.VERSION; // Maximum number of payloads stored in the buffer. If the buffer is full, new elements will be dropped. static MAX_BUFFER_SIZE = 2000; constructor(logger: IDiagnosticLogger, config: ISenderConfig) { super(logger, config); let _bufferFullMessageSent = false; //Note: should not use config.namePrefix directly, because it will always refers to the latest namePrefix let _namePrefix = config?.namePrefix; // TODO: add remove buffer override as well const { getItem, setItem } = config.bufferOverride || { getItem: utlGetSessionStorage, setItem: utlSetSessionStorage }; let _maxRetryCnt = config.maxRetryCnt; dynamicProto(SessionStorageSendBuffer, this, (_self, _base) => { const bufferItems = _getBuffer(SessionStorageSendBuffer.BUFFER_KEY); const itemsInSentBuffer = _getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); let previousItems = _getPreviousEvents(); const notDeliveredItems = itemsInSentBuffer.concat(previousItems); let buffer = _self._set(bufferItems.concat(notDeliveredItems)); // If the buffer has too many items, drop items from the end. if (buffer.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { buffer.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } _setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); _setBuffer(SessionStorageSendBuffer.BUFFER_KEY, buffer); _self.enqueue = (payload: IInternalStorageItem) => { if (_self.count() >= SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // sent internal log only once per page view if (!_bufferFullMessageSent) { _throwInternal(logger, eLoggingSeverity.WARNING, _eInternalMessageId.SessionStorageBufferFull, "Maximum buffer size reached: " + _self.count(), true); _bufferFullMessageSent = true; } return; } payload.cnt = payload.cnt || 0; // max retry is defined, and max retry is reached, do not add the payload to buffer if (!isNullOrUndefined(_maxRetryCnt)) { if (payload.cnt > _maxRetryCnt) { // TODO: add log here on dropping payloads return; } } _base.enqueue(payload); _setBuffer(SessionStorageSendBuffer.BUFFER_KEY, _self._get()); }; _self.clear = () => { _base.clear(); _setBuffer(SessionStorageSendBuffer.BUFFER_KEY, _self._get()); _setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []); _bufferFullMessageSent = false; }; _self.markAsSent = (payload: IInternalStorageItem[]) => { _setBuffer(SessionStorageSendBuffer.BUFFER_KEY, _self._set(_removePayloadsFromBuffer(payload, _self._get()))); let sentElements = _getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); if (sentElements instanceof Array && payload instanceof Array) { sentElements = sentElements.concat(payload); if (sentElements.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) { // We send telemetry normally. If the SENT_BUFFER is too big we don't add new elements // until we receive a response from the backend and the buffer has free space again (see clearSent method) _throwInternal(logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.SessionStorageBufferFull, "Sent buffer reached its maximum size: " + sentElements.length, true); sentElements.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE; } _setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); } }; _self.clearSent = (payload: IInternalStorageItem[]) => { let sentElements = _getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY); sentElements = _removePayloadsFromBuffer(payload, sentElements); _setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements); }; _self.createNew = (newLogger?: IDiagnosticLogger, newConfig?: ISenderConfig, canUseSessionStorage?: boolean) => { canUseSessionStorage = !!canUseSessionStorage; let unsentItems = _self._get().slice(0); let sentItems = _getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY).slice(0); newLogger = newLogger || logger; newConfig = newConfig || {} as ISenderConfig; // to make sure that we do not send duplicated payloads when it is switched back to previous one _self.clear(); let newBuffer = canUseSessionStorage? new SessionStorageSendBuffer(newLogger, newConfig) : new ArraySendBuffer(newLogger, newConfig); arrForEach(unsentItems, (payload) => { newBuffer.enqueue(payload); }); if (canUseSessionStorage) { // arr buffer will clear all payloads if markAsSent() is called newBuffer.markAsSent(sentItems); } return newBuffer; }; function _removePayloadsFromBuffer(payloads: IInternalStorageItem[], buffer: IInternalStorageItem[]): IInternalStorageItem[] { const remaining: IInternalStorageItem[] = []; let payloadStr: string[] = []; arrForEach(payloads, (payload) => { payloadStr.push(payload.item); }); arrForEach(buffer, (value) => { if (!isFunction(value) && arrIndexOf(payloadStr, value.item) === -1) { remaining.push(value); } }); return remaining; } function _getBuffer(key: string): IInternalStorageItem[] { let prefixedKey = key; prefixedKey = _namePrefix ? _namePrefix + "_" + prefixedKey : prefixedKey; return _getBufferBase(prefixedKey); } function _getBufferBase(key: string): T[] { try { const bufferJson = getItem(logger, key); if (bufferJson) { let buffer: T[] = getJSON().parse(bufferJson); if (isString(buffer)) { // When using some version prototype.js the stringify / parse cycle does not decode array's correctly buffer = getJSON().parse(buffer as any); } if (buffer && isArray(buffer)) { return buffer; } } } catch (e) { _throwInternal(logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.FailedToRestoreStorageBuffer, " storage key: " + key + ", " + getExceptionName(e), { exception: dumpObj(e) }); } return []; } function _setBuffer(key: string, buffer: IInternalStorageItem[]) { let prefixedKey = key; try { prefixedKey = _namePrefix ? _namePrefix + "_" + prefixedKey : prefixedKey; const bufferJson = JSON.stringify(buffer); setItem(logger, prefixedKey, bufferJson); } catch (e) { // if there was an error, clear the buffer // telemetry is stored in the _buffer array so we won't loose any items setItem(logger, prefixedKey, JSON.stringify([])); _throwInternal(logger, eLoggingSeverity.WARNING, _eInternalMessageId.FailedToSetStorageBuffer, " storage key: " + prefixedKey + ", " + getExceptionName(e) + ". Buffer cleared", { exception: dumpObj(e) }); } } // this removes buffer with prefix+key function _getPreviousEvents() { let items: IInternalStorageItem[] = []; try { arrForEach(PREVIOUS_KEYS, (key) => { let events = _getItemsFromPreviousKey(key); items = items.concat(events); // to make sure that we also transfer items from old prefixed + key buffer if (_namePrefix) { let prefixedKey = _namePrefix + "_" + key; let prefixEvents = _getItemsFromPreviousKey(prefixedKey); items = items.concat( prefixEvents); } }); return items; } catch(e) { _throwInternal(logger, eLoggingSeverity.WARNING, _eInternalMessageId.FailedToSetStorageBuffer, "Transfer events from previous buffers: " + getExceptionName(e) + ". previous Buffer items can not be removed", { exception: dumpObj(e) }); } return []; } // transform string[] to IInternalStorageItem[] function _getItemsFromPreviousKey(key: string) { try { let items = _getBufferBase(key); let transFormedItems: IInternalStorageItem[] = []; arrForEach(items, (item) => { let internalItem = { item: item, cnt: 0 // previous events will be default to 0 count } as IInternalStorageItem; transFormedItems.push(internalItem); }); // remove the session storage if we can add events back utlRemoveSessionStorage(logger, key); return transFormedItems; } catch (e) { // eslint-disable-next-line no-empty } return []; } }); } public enqueue(payload: IInternalStorageItem) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public clear() { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public markAsSent(payload: IInternalStorageItem[]) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public clearSent(payload: IInternalStorageItem[]) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public createNew(newLogger?: IDiagnosticLogger, newConfig?: ISenderConfig, canUseSessionStorage?: boolean): ArraySendBuffer | SessionStorageSendBuffer { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null } } ================================================ FILE: channels/applicationinsights-channel-js/src/Sender.ts ================================================ import dynamicProto from "@microsoft/dynamicproto-js"; import { ActiveStatus, BaseTelemetryPlugin, BreezeChannelIdentifier, DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH, EventDataType, ExceptionDataType, IAppInsightsCore, IBackendResponse, IChannelControls, IConfig, IConfigDefaults, IConfiguration, IDiagnosticLogger, IEnvelope, IInternalOfflineSupport, INotificationManager, IOfflineListener, IPayloadData, IPlugin, IProcessTelemetryContext, IProcessTelemetryUnloadContext, ISample, IStorageBuffer, ITelemetryItem, ITelemetryPluginChain, ITelemetryUnloadState, IXDomainRequest, IXHROverride, MetricDataType, OnCompleteCallback, PageViewDataType, PageViewPerformanceDataType, ProcessLegacy, RemoteDependencyDataType, RequestDataType, RequestHeaders, SampleRate, SendPOSTFunction, SendRequestReason, SenderPostManager, TraceDataType, TransportType, _ISendPostMgrConfig, _ISenderOnComplete, _eInternalMessageId, _throwInternal, _warnToConsole, arrForEach, cfgDfBoolean, cfgDfValidate, createOfflineListener, createProcessTelemetryContext, createUniqueNamespace, dateNow, dumpObj, eLoggingSeverity, eRequestHeaders, formatErrorMessageXdr, formatErrorMessageXhr, getExceptionName, getIEVersion, isArray, isBeaconsSupported, isFeatureEnabled, isFetchSupported, isInternalApplicationInsightsEndpoint, isNullOrUndefined, mergeEvtNamespace, objExtend, onConfigChange, parseResponse, prependTransports, runTargetUnload, utlCanUseSessionStorage, utlSetStoragePrefix } from "@microsoft/applicationinsights-core-js"; import { IPromise, createPromise, doAwait, doAwaitResponse } from "@nevware21/ts-async"; import { ITimerHandler, getInst, isFunction, isNumber, isPromiseLike, isString, isTruthy, mathFloor, mathMax, mathMin, objDeepFreeze, objDefine, scheduleTimeout } from "@nevware21/ts-utils"; import { DependencyEnvelopeCreator, EnvelopeCreator, EventEnvelopeCreator, ExceptionEnvelopeCreator, MetricEnvelopeCreator, PageViewEnvelopeCreator, PageViewPerformanceEnvelopeCreator, RequestEnvelopeCreator, TraceEnvelopeCreator } from "./EnvelopeCreator"; import { IInternalStorageItem, ISenderConfig } from "./Interfaces"; import { ArraySendBuffer, ISendBuffer, SessionStorageSendBuffer } from "./SendBuffer"; import { Serializer } from "./Serializer"; import { createSampler } from "./TelemetryProcessors/Sample"; const UNDEFINED_VALUE: undefined = undefined; const EMPTY_STR = ""; const FetchSyncRequestSizeLimitBytes = 65000; // approx 64kb (the current Edge, Firefox and Chrome max limit) interface IInternalPayloadData extends IPayloadData { oriPayload: IInternalStorageItem[]; retryCnt?: number; // statsBeatData?: IStatsEventData; } function _getResponseText(xhr: XMLHttpRequest | IXDomainRequest) { try { return xhr.responseText; } catch (e) { // Best effort, as XHR may throw while XDR wont so just ignore } return null; } function isOverrideFn(httpXHROverride: any) { return httpXHROverride && httpXHROverride.sendPOST; } const defaultAppInsightsChannelConfig: IConfigDefaults = objDeepFreeze({ // Use the default value (handles empty string in the configuration) endpointUrl: cfgDfValidate(isTruthy, DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH), emitLineDelimitedJson: cfgDfBoolean(), maxBatchInterval: 15000, maxBatchSizeInBytes: 102400, // 100kb disableTelemetry: cfgDfBoolean(), enableSessionStorageBuffer: cfgDfBoolean(true), isRetryDisabled: cfgDfBoolean(), isBeaconApiDisabled: cfgDfBoolean(true), disableSendBeaconSplit: cfgDfBoolean(true), disableXhr: cfgDfBoolean(), onunloadDisableFetch: cfgDfBoolean(), onunloadDisableBeacon: cfgDfBoolean(), instrumentationKey: UNDEFINED_VALUE, // Channel doesn't need iKey, it should be set already namePrefix: UNDEFINED_VALUE, samplingPercentage: cfgDfValidate(_chkSampling, 100), customHeaders: UNDEFINED_VALUE, convertUndefined: UNDEFINED_VALUE, eventsLimitInMem: 10000, bufferOverride: false, httpXHROverride: { isVal: isOverrideFn, v:UNDEFINED_VALUE }, alwaysUseXhrOverride: cfgDfBoolean(), transports: UNDEFINED_VALUE, retryCodes: UNDEFINED_VALUE, corsPolicy: UNDEFINED_VALUE, maxRetryCnt: {isVal: isNumber, v:10} }); const CrossOriginResourcePolicyHeader: string = "X-Set-Cross-Origin-Resource-Policy"; function _chkSampling(value: number) { return !isNaN(value) && value > 0 && value <= 100; } type EnvelopeCreator = (logger: IDiagnosticLogger, telemetryItem: ITelemetryItem, customUndefinedValue?: any) => IEnvelope; const EnvelopeTypeCreator: { [key:string] : EnvelopeCreator } = { [EventDataType]: EventEnvelopeCreator, [TraceDataType]: TraceEnvelopeCreator, [PageViewDataType]: PageViewEnvelopeCreator, [PageViewPerformanceDataType]: PageViewPerformanceEnvelopeCreator, [ExceptionDataType]: ExceptionEnvelopeCreator, [MetricDataType]: MetricEnvelopeCreator, [RemoteDependencyDataType]: DependencyEnvelopeCreator, [RequestDataType]: RequestEnvelopeCreator }; export type SenderFunction = (payload: string[] | IInternalStorageItem[], isAsync: boolean) => void | IPromise; export class Sender extends BaseTelemetryPlugin implements IChannelControls { public static constructEnvelope(orig: ITelemetryItem, iKey: string, logger: IDiagnosticLogger, convertUndefined?: any): IEnvelope { let envelope: ITelemetryItem; if (iKey !== orig.iKey && !isNullOrUndefined(iKey)) { envelope = { ...orig, iKey }; } else { envelope = orig; } let creator: EnvelopeCreator = EnvelopeTypeCreator[envelope.baseType] || EventEnvelopeCreator; return creator(logger, envelope, convertUndefined); } public readonly priority: number = 1001; public readonly identifier: string = BreezeChannelIdentifier; /** * The configuration for this sender instance */ public readonly _senderConfig: ISenderConfig; /** * A method which will cause data to be send to the url */ public _sender: SenderFunction; /** * A send buffer object */ public _buffer: ISendBuffer; /** * AppId of this component parsed from some backend response. */ public _appId: string; protected _sample: ISample; constructor() { super(); // Don't set the defaults here, set them in the _initDefaults() as this is also called during unload let _consecutiveErrors: number; // How many times in a row a retryable error condition has occurred. let _retryAt: number; // The time to retry at in milliseconds from 1970/01/01 (this makes the timer calculation easy). let _lastSend: number; // The time of the last send operation. let _paused: boolean; // Flag indicating that the sending should be paused let _timeoutHandle: ITimerHandler; // Handle to the timer for delayed sending of batches of data. let _serializer: Serializer; let _stamp_specific_redirects: number; let _headers: { [name: string]: string }; let _syncFetchPayload = 0; // Keep track of the outstanding sync fetch payload total (as sync fetch has limits) let _syncUnloadSender: SenderFunction; // The identified sender to use for the synchronous unload stage let _offlineListener: IOfflineListener; let _evtNamespace: string | string[]; let _endpointUrl: string; let _orgEndpointUrl: string; let _maxBatchSizeInBytes: number; let _beaconSupported: boolean; let _beaconOnUnloadSupported: boolean; let _beaconNormalSupported: boolean; let _customHeaders: Array<{header: string, value: string}>; let _disableTelemetry: boolean; let _instrumentationKey: string; let _convertUndefined: any; let _isRetryDisabled: boolean; let _maxBatchInterval: number; let _sessionStorageUsed: boolean; let _bufferOverrideUsed: IStorageBuffer | false; let _namePrefix: string; let _enableSendPromise: boolean; let _alwaysUseCustomSend: boolean; let _disableXhr: boolean; let _fetchKeepAlive: boolean; let _xhrSend: SenderFunction; let _fallbackSend: SenderFunction; let _disableBeaconSplit: boolean; let _sendPostMgr: SenderPostManager; let _retryCodes: number[]; let _zipPayload: boolean; dynamicProto(Sender, this, (_self, _base) => { _initDefaults(); _self.pause = () => { _clearScheduledTimer(); _paused = true; }; _self.resume = () => { if (_paused) { _paused = false; _retryAt = null; // flush if we have exceeded the max-size already _checkMaxSize(); _setupTimer(); } }; _self.flush = (isAsync: boolean = true, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void | IPromise => { if (!_paused) { // Clear the normal schedule timer as we are going to try and flush ASAP _clearScheduledTimer(); try { let result = _self.triggerSend(isAsync, null, sendReason || SendRequestReason.ManualFlush); // Handles non-promise and always called if the returned promise resolves or rejects return doAwaitResponse(result as any, (rsp) => { if (callBack) { callBack(!rsp.rejected); return true; } // When async=true and no callback, return a promise if (isAsync) { return createPromise((resolve) => { resolve(!rsp.rejected); }); } return result; }); } catch (e) { _throwInternal(_self.diagLog(), eLoggingSeverity.CRITICAL, _eInternalMessageId.FlushFailed, "flush failed, telemetry will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } } }; _self.onunloadFlush = () => { if (!_paused) { if (_beaconSupported || _alwaysUseCustomSend) { try { return _self.triggerSend(true, _doUnloadSend, SendRequestReason.Unload); } catch (e) { _throwInternal(_self.diagLog(), eLoggingSeverity.CRITICAL, _eInternalMessageId.FailedToSendQueuedTelemetry, "failed to flush with beacon sender on page unload, telemetry will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } } else { _self.flush(false); } } }; _self.addHeader = (name: string, value: string) => { _headers[name] = value; }; _self.initialize = (config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?:ITelemetryPluginChain): void => { if (_self.isInitialized()) { _throwInternal(_self.diagLog(), eLoggingSeverity.CRITICAL, _eInternalMessageId.SenderNotInitialized, "Sender is already initialized"); } _base.initialize(config, core, extensions, pluginChain); let identifier = _self.identifier; _serializer = new Serializer(core.logger); _consecutiveErrors = 0; _retryAt = null; _lastSend = 0; _self._sender = null; _stamp_specific_redirects = 0; let diagLog = _self.diagLog(); _evtNamespace = mergeEvtNamespace(createUniqueNamespace("Sender"), core.evtNamespace && core.evtNamespace()); _offlineListener = createOfflineListener(_evtNamespace); // This function will be re-called whenever any referenced configuration is changed _self._addHook(onConfigChange(config, (details) => { let config = details.cfg; if (config.storagePrefix){ utlSetStoragePrefix(config.storagePrefix); } let ctx = createProcessTelemetryContext(null, config, core); // getExtCfg only finds undefined values from core let senderConfig = ctx.getExtCfg(identifier, defaultAppInsightsChannelConfig); let curExtUrl = senderConfig.endpointUrl; // if it is not inital change (_endpointUrl has value) // if current sender endpoint url is not changed directly // means ExtCfg is not changed directly // then we need to monitor endpoint url changes from core if (_endpointUrl && curExtUrl === _endpointUrl) { let coreUrl = config.endpointUrl as any; // if core endpoint url is changed if (coreUrl && coreUrl !== curExtUrl) { // and endpoint promise changes is handled by this as well senderConfig.endpointUrl = coreUrl; } } const csStream = getInst("CompressionStream"); // Determine whether to enable payload compression (zipping). _zipPayload = isFeatureEnabled("zipPayload", config, false); if (!isFunction(csStream)) { _zipPayload = false; } let corsPolicy = senderConfig.corsPolicy; if (corsPolicy){ if (corsPolicy === "same-origin" || corsPolicy === "same-site" || corsPolicy === "cross-origin") { this.addHeader(CrossOriginResourcePolicyHeader, corsPolicy); } } else { delete _headers[CrossOriginResourcePolicyHeader]; } if(isPromiseLike(senderConfig.instrumentationKey)) { // if it is promise, means the endpoint url is from core.endpointurl senderConfig.instrumentationKey = config.instrumentationKey as any; } objDefine(_self, "_senderConfig", { g: function() { return senderConfig; } }); // Only update the endpoint if the original config !== the current config // This is so any redirect endpointUrl is not overwritten if (_orgEndpointUrl !== senderConfig.endpointUrl) { if (_orgEndpointUrl) { // TODO: add doc to remind users to flush before changing endpoint, otherwise all unsent payload will be sent to new endpoint } _endpointUrl = _orgEndpointUrl = senderConfig.endpointUrl; } // or is not string if (core.activeStatus() === ActiveStatus.PENDING) { // waiting for core promises to be resolved // NOTE: if active status is set to pending, stop sending, clear timer here _self.pause(); } else if (core.activeStatus() === ActiveStatus.ACTIVE) { // core status changed from pending to other status _self.resume(); } if (_customHeaders && _customHeaders !== senderConfig.customHeaders) { // Removing any previously defined custom headers as they have changed arrForEach(_customHeaders, customHeader => { delete _headers[customHeader.header]; }); } _maxBatchSizeInBytes = senderConfig.maxBatchSizeInBytes; _beaconSupported = (senderConfig.onunloadDisableBeacon === false || senderConfig.isBeaconApiDisabled === false) && isBeaconsSupported(); _beaconOnUnloadSupported = senderConfig.onunloadDisableBeacon === false && isBeaconsSupported(); _beaconNormalSupported = senderConfig.isBeaconApiDisabled === false && isBeaconsSupported(); _alwaysUseCustomSend = senderConfig.alwaysUseXhrOverride; _disableXhr = !!senderConfig.disableXhr; _retryCodes = senderConfig.retryCodes; let bufferOverride = senderConfig.bufferOverride; let canUseSessionStorage = !!senderConfig.enableSessionStorageBuffer && (!!bufferOverride || utlCanUseSessionStorage()); let namePrefix = senderConfig.namePrefix; //Note: emitLineDelimitedJson and eventsLimitInMem is directly accessed via config in senderBuffer //Therefore, if canUseSessionStorage is not changed, we do not need to re initialize a new one let shouldUpdate = (canUseSessionStorage !== _sessionStorageUsed) || (canUseSessionStorage && (_namePrefix !== namePrefix)) // prefixName is only used in session storage || (canUseSessionStorage && (_bufferOverrideUsed !== bufferOverride)); if (_self._buffer) { // case1 (Pre and Now enableSessionStorageBuffer settings are same) // if namePrefix changes, transfer current buffer to new buffer // else no action needed //case2 (Pre and Now enableSessionStorageBuffer settings are changed) // transfer current buffer to new buffer if (shouldUpdate) { try { _self._buffer = _self._buffer.createNew(diagLog, senderConfig, canUseSessionStorage); } catch (e) { _throwInternal(_self.diagLog(), eLoggingSeverity.CRITICAL, _eInternalMessageId.FailedAddingTelemetryToBuffer, "failed to transfer telemetry to different buffer storage, telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) }); } } _checkMaxSize(); } else { _self._buffer = canUseSessionStorage ? new SessionStorageSendBuffer(diagLog, senderConfig) : new ArraySendBuffer(diagLog, senderConfig); } _namePrefix = namePrefix; _sessionStorageUsed = canUseSessionStorage; _bufferOverrideUsed = bufferOverride; _fetchKeepAlive = !senderConfig.onunloadDisableFetch && isFetchSupported(true); _disableBeaconSplit = !!senderConfig.disableSendBeaconSplit; _self._sample = createSampler(senderConfig.samplingPercentage, diagLog); _instrumentationKey = senderConfig.instrumentationKey; if(!isPromiseLike(_instrumentationKey) && !_validateInstrumentationKey(_instrumentationKey, config)) { _throwInternal(diagLog, eLoggingSeverity.CRITICAL, _eInternalMessageId.InvalidInstrumentationKey, "Invalid Instrumentation key " + _instrumentationKey); } _customHeaders = senderConfig.customHeaders; if (isString(_endpointUrl) && !isInternalApplicationInsightsEndpoint(_endpointUrl) && _customHeaders && _customHeaders.length > 0) { arrForEach(_customHeaders, customHeader => { this.addHeader(customHeader.header, customHeader.value); }); } else { _customHeaders = null; } _enableSendPromise = senderConfig.enableSendPromise; let sendPostConfig = _getSendPostMgrConfig(); // only init it once if (!_sendPostMgr) { _sendPostMgr = new SenderPostManager(); _sendPostMgr.initialize(sendPostConfig, diagLog); } else { _sendPostMgr.SetConfig(sendPostConfig); } let customInterface = senderConfig.httpXHROverride; let httpInterface: IXHROverride = null; let syncInterface: IXHROverride = null; // User requested transport(s) values > Beacon > Fetch > XHR // Beacon would be filtered out if user has set disableBeaconApi to true at _getSenderInterface let theTransports: TransportType[] = prependTransports([TransportType.Beacon, TransportType.Xhr, TransportType.Fetch], senderConfig.transports); httpInterface = _sendPostMgr && _sendPostMgr.getSenderInst(theTransports, false); let xhrInterface = _sendPostMgr && _sendPostMgr.getFallbackInst(); _xhrSend = (payload: IInternalStorageItem[], isAsync: boolean) => { return _doSend(xhrInterface, payload, isAsync); }; _fallbackSend = (payload: IInternalStorageItem[], isAsync: boolean) => { // for fallback send, should NOT mark payload as sent again! return _doSend(xhrInterface, payload, isAsync, false); }; httpInterface = _alwaysUseCustomSend? customInterface : (httpInterface || customInterface || xhrInterface); _self._sender = (payload: IInternalStorageItem[], isAsync: boolean) => { return _doSend(httpInterface, payload, isAsync); }; if (_fetchKeepAlive) { // Try and use the fetch with keepalive _syncUnloadSender = _fetchKeepAliveSender; } let syncTransports: TransportType[] = prependTransports([TransportType.Beacon, TransportType.Xhr], senderConfig.unloadTransports); if (!_fetchKeepAlive){ // remove fetch from theTransports syncTransports = syncTransports.filter(transport => transport !== TransportType.Fetch); } syncInterface = _sendPostMgr && _sendPostMgr.getSenderInst(syncTransports, true); syncInterface = _alwaysUseCustomSend? customInterface : (syncInterface || customInterface); if ((_alwaysUseCustomSend || senderConfig.unloadTransports || !_syncUnloadSender) && syncInterface) { _syncUnloadSender = (payload: IInternalStorageItem[], isAsync: boolean) => { return _doSend(syncInterface, payload, isAsync); }; } if (!_syncUnloadSender) { _syncUnloadSender = _xhrSend; } _disableTelemetry = senderConfig.disableTelemetry; _convertUndefined = senderConfig.convertUndefined || UNDEFINED_VALUE; _isRetryDisabled = senderConfig.isRetryDisabled; _maxBatchInterval = senderConfig.maxBatchInterval; })); }; _self.processTelemetry = (telemetryItem: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => { itemCtx = _self._getTelCtx(itemCtx); let diagLogger = itemCtx.diagLog(); try { let isValidate = _validate(telemetryItem, diagLogger); if (!isValidate) { return; } let aiEnvelope = _getEnvelope(telemetryItem, diagLogger); if (!aiEnvelope) { return; } // check if the incoming payload is too large, truncate if necessary const payload: string = _serializer.serialize(aiEnvelope); // flush if we would exceed the max-size limit by adding this item const buffer = _self._buffer; _checkMaxSize(payload); let payloadItem = { item: payload, cnt: 0 // inital cnt will always be 0 } as IInternalStorageItem; // enqueue the payload buffer.enqueue(payloadItem); // ensure an invocation timeout is set _setupTimer(); } catch (e) { _throwInternal(diagLogger, eLoggingSeverity.WARNING, _eInternalMessageId.FailedAddingTelemetryToBuffer, "Failed adding telemetry to the sender's buffer, some telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) }); } // hand off the telemetry item to the next plugin _self.processNext(telemetryItem, itemCtx); }; _self.isCompletelyIdle = () => { return !_paused && _syncFetchPayload === 0 && _self._buffer.count() === 0; } _self.getOfflineListener = () => { return _offlineListener; } /** * xhr state changes */ _self._xhrReadyStateChange = (xhr: XMLHttpRequest, payload: string[] | IInternalStorageItem[], countOfItemsInPayload: number) => { // since version 3.2.0, this function is no-op if (_isStringArr(payload)) { return; } return _xhrReadyStateChange(xhr, payload as IInternalStorageItem[], countOfItemsInPayload); } /** * Immediately send buffered data * @param isAsync - Indicates if the events should be sent asynchronously * @param forcedSender - Indicates the forcedSender, undefined if not passed */ _self.triggerSend = (isAsync = true, forcedSender?: SenderFunction, sendReason?: SendRequestReason) => { let result: void | IPromise; if (!_paused) { try { const buffer = _self._buffer; // Send data only if disableTelemetry is false if (!_disableTelemetry) { if (buffer.count() > 0) { const payload = buffer.getItems(); _notifySendRequest(sendReason||SendRequestReason.Undefined, isAsync); // invoke send if (forcedSender) { result = forcedSender.call(_self, payload, isAsync); } else { result = _self._sender(payload, isAsync); } } // update lastSend time to enable throttling _lastSend = +new Date; } else { buffer.clear(); } _clearScheduledTimer(); } catch (e) { /* Ignore this error for IE under v10 */ let ieVer = getIEVersion(); if (!ieVer || ieVer > 9) { _throwInternal(_self.diagLog(), eLoggingSeverity.CRITICAL, _eInternalMessageId.TransmissionFailed, "Telemetry transmission failed, some telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) }); } // potential place to call countException q3 } } return result; }; _self.getOfflineSupport = () => { return { getUrl: () => { return _endpointUrl; }, createPayload:_createPayload, serialize: _serialize, batch: _batch, shouldProcess:(evt) => { return !!_validate(evt); } } as IInternalOfflineSupport; } _self._doTeardown = (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => { _self.onunloadFlush(); runTargetUnload(_offlineListener, false); _initDefaults(); }; /** * error handler */ _self._onError = (payload: IInternalStorageItem[] | string[], message: string, event?: ErrorEvent) => { // since version 3.1.3, string[] is no-op if (_isStringArr(payload)) { return; } return _onError(payload as IInternalStorageItem[], message, event); }; /** * partial success handler */ _self._onPartialSuccess = (payload: IInternalStorageItem[] | string[], results: IBackendResponse) => { // since version 3.1.3, string[] is no-op if (_isStringArr(payload)) { return; } return _onPartialSuccess(payload as IInternalStorageItem[], results); }; /** * success handler */ _self._onSuccess = (payload: IInternalStorageItem[] | string[], countOfItemsInPayload: number) => { // since version 3.1.3, string[] is no-op if (_isStringArr(payload)) { return; } return _onSuccess(payload as IInternalStorageItem[], countOfItemsInPayload); //_self._buffer && _self._buffer.clearSent(payload); }; /** * xdr state changes */ _self._xdrOnLoad = (xdr: IXDomainRequest, payload: IInternalStorageItem[] | string[]) => { // since version 3.1.3, string[] is no-op if (_isStringArr(payload)) { return; } return _xdrOnLoad(xdr, payload as IInternalStorageItem[]); } // function _getStatsBeat() { // let statsBeatConfig: IStatsBeatState = { // cKey: _self._senderConfig.instrumentationKey, // endpoint: _endpointUrl, // sdkVer: EnvelopeCreator.Version, // type: eStatsType.SDK // }; // let core = _self.core; // // During page unload the core may have been cleared and some async events may not have been sent yet // // resulting in the core being null. In this case we don't want to create a statsbeat instance // return core ? core.getStatsBeat(statsBeatConfig) : null; // } function _xdrOnLoad (xdr: IXDomainRequest, payload: IInternalStorageItem[]) { const responseText = _getResponseText(xdr); if (xdr && (responseText + "" === "200" || responseText === "")) { _consecutiveErrors = 0; _self._onSuccess(payload, 0); } else { const results = parseResponse(responseText); if (results && results.itemsReceived && results.itemsReceived > results.itemsAccepted && !_isRetryDisabled) { _self._onPartialSuccess(payload, results); } else { _self._onError(payload, formatErrorMessageXdr(xdr)); } } } function _getSendPostMgrConfig(): _ISendPostMgrConfig { try { let onCompleteFuncs = { xdrOnComplete: (xdr: IXDomainRequest, oncomplete: OnCompleteCallback,payload?: IPayloadData) => { let payloadArr = _getPayloadArr(payload); if (!payloadArr) { return; } //const responseText = _getResponseText(xdr); // let statsbeat = _getStatsBeat(); // if (statsbeat) { // if (xdr && (responseText + "" === "200" || responseText === "")) { // _consecutiveErrors = 0; // statsbeat.count(200, payload, _endpointUrl); // } else { // const results = parseResponse(responseText); // if (results && results.itemsReceived && results.itemsReceived > results.itemsAccepted // && !_isRetryDisabled) { // statsbeat.count(206, payload, _endpointUrl); // } else { // statsbeat.count(499, payload, _endpointUrl); // } // } // } return _xdrOnLoad(xdr, payloadArr); }, fetchOnComplete: (response: Response, onComplete: OnCompleteCallback, resValue?: string, payload?: IPayloadData) => { let payloadArr = _getPayloadArr(payload); if (!payloadArr) { return; } // let statsbeat = _getStatsBeat(); // if (statsbeat) { // statsbeat.count(response.status, payload, _endpointUrl); // } return _checkResponsStatus(response.status, payloadArr, response.url, payloadArr.length, response.statusText, resValue || ""); }, xhrOnComplete: (request: XMLHttpRequest, oncomplete: OnCompleteCallback, payload?: IPayloadData) => { let payloadArr = _getPayloadArr(payload); if (!payloadArr) { return; } // let statsbeat = _getStatsBeat(); // if (statsbeat && request.readyState === 4) { // statsbeat.count(request.status, payload, _endpointUrl); // } return _xhrReadyStateChange(request, payloadArr, payloadArr.length); }, beaconOnRetry: (data: IPayloadData, onComplete: OnCompleteCallback, canSend: (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => boolean) => { // let statsbeat = _getStatsBeat(); // if (statsbeat) { // statsbeat.count(499, data, _endpointUrl); // } return _onBeaconRetry(data, onComplete, canSend); } } as _ISenderOnComplete; let config = { enableSendPromise: _enableSendPromise, isOneDs: false, disableCredentials: false, disableXhr: _disableXhr, disableBeacon: !_beaconNormalSupported, disableBeaconSync: !_beaconOnUnloadSupported, senderOnCompleteCallBack: onCompleteFuncs } as _ISendPostMgrConfig; return config; } catch (e) { // eslint-disable-next-line no-empty } return null; } /** * xhr state changes */ function _xhrReadyStateChange (xhr: XMLHttpRequest, payload: IInternalStorageItem[], countOfItemsInPayload: number) { if (xhr.readyState === 4) { _checkResponsStatus(xhr.status, payload, xhr.responseURL, countOfItemsInPayload, formatErrorMessageXhr(xhr), _getResponseText(xhr) || xhr.response); } } /** * error handler */ function _onError(payload: IInternalStorageItem[], message: string, event?: ErrorEvent) { _throwInternal(_self.diagLog(), eLoggingSeverity.WARNING, _eInternalMessageId.OnError, "Failed to send telemetry.", { message }); _self._buffer && _self._buffer.clearSent(payload); } /** * partial success handler */ function _onPartialSuccess(payload: IInternalStorageItem[], results: IBackendResponse) { const failed: IInternalStorageItem[] = []; const retry: IInternalStorageItem[] = []; // Iterate through the reversed array of errors so that splicing doesn't have invalid indexes after the first item. const errors = results.errors.reverse(); for (const error of errors) { const extracted = payload.splice(error.index, 1)[0]; if (_isRetriable(error.statusCode)) { retry.push(extracted); } else { // All other errors, including: 402 (Monthly quota exceeded) and 439 (Too many requests and refresh cache). failed.push(extracted); } } if (payload.length > 0) { _self._onSuccess(payload, results.itemsAccepted); } if (failed.length > 0) { _self._onError(failed, formatErrorMessageXhr(null, ["partial success", results.itemsAccepted, "of", results.itemsReceived].join(" "))); } if (retry.length > 0) { _resendPayload(retry); _throwInternal(_self.diagLog(), eLoggingSeverity.WARNING, _eInternalMessageId.TransmissionFailed, "Partial success. " + "Delivered: " + payload.length + ", Failed: " + failed.length + ". Will retry to send " + retry.length + " our of " + results.itemsReceived + " items"); } } /** * success handler */ function _onSuccess(payload: IInternalStorageItem[], countOfItemsInPayload: number) { _self._buffer && _self._buffer.clearSent(payload); } function _getPayloadArr(payload?: IPayloadData) { try { if (payload) { let internalPayload = payload as IInternalPayloadData; let arr = internalPayload.oriPayload; if (arr && arr.length) { return arr; } return null; } } catch (e) { // eslint-disable-next-line no-empty } return null; } function _validate(telemetryItem: ITelemetryItem, diagLogger?: IDiagnosticLogger) { if (_disableTelemetry) { // Do not send/save data return false; } // validate input if (!telemetryItem) { diagLogger && _throwInternal(diagLogger, eLoggingSeverity.CRITICAL, _eInternalMessageId.CannotSendEmptyTelemetry, "Cannot send empty telemetry"); return false; } // validate event if (telemetryItem.baseData && !telemetryItem.baseType) { diagLogger && _throwInternal(diagLogger, eLoggingSeverity.CRITICAL, _eInternalMessageId.InvalidEvent, "Cannot send telemetry without baseData and baseType"); return false; } if (!telemetryItem.baseType) { // Default telemetryItem.baseType = "EventData"; } // ensure a sender was constructed if (!_self._sender) { diagLogger && _throwInternal(diagLogger, eLoggingSeverity.CRITICAL, _eInternalMessageId.SenderNotInitialized, "Sender was not initialized"); return false; } // check if this item should be sampled in, else add sampleRate tag let sampleRate = (telemetryItem as any).sampleRate; if (isNullOrUndefined(sampleRate) || !isNumber(sampleRate) || sampleRate < 0 || sampleRate > 100) { if (!_isSampledIn(telemetryItem)) { // Item is sampled out, do not send it diagLogger && _throwInternal(diagLogger, eLoggingSeverity.WARNING, _eInternalMessageId.TelemetrySampledAndNotSent, "Telemetry item was sampled out and not sent", { SampleRate: _self._sample.sampleRate }); return false; } else { telemetryItem[SampleRate] = _self._sample.sampleRate; } } return true; } function _getEnvelope(telemetryItem: ITelemetryItem, diagLogger: IDiagnosticLogger) { // construct an envelope that Application Insights endpoint can understand // if ikey of telemetry is provided and not empty, envelope will use this iKey instead of senderConfig iKey let defaultEnvelopeIkey = telemetryItem.iKey || _instrumentationKey; let aiEnvelope = Sender.constructEnvelope(telemetryItem, defaultEnvelopeIkey, diagLogger, _convertUndefined); if (!aiEnvelope) { _throwInternal(diagLogger, eLoggingSeverity.CRITICAL, _eInternalMessageId.CreateEnvelopeError, "Unable to create an AppInsights envelope"); return; } let doNotSendItem = false; // this is for running in legacy mode, where customer may already have a custom initializer present if (telemetryItem.tags && telemetryItem.tags[ProcessLegacy]) { arrForEach(telemetryItem.tags[ProcessLegacy], (callBack: (env: IEnvelope) => boolean | void) => { try { if (callBack && callBack(aiEnvelope) === false) { doNotSendItem = true; _warnToConsole(diagLogger, "Telemetry processor check returns false"); } } catch (e) { // log error but dont stop executing rest of the telemetry initializers // doNotSendItem = true; _throwInternal(diagLogger, eLoggingSeverity.CRITICAL, _eInternalMessageId.TelemetryInitializerFailed, "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true); } }); delete telemetryItem.tags[ProcessLegacy]; } if (doNotSendItem) { return; // do not send, no need to execute next plugin } return aiEnvelope; } function _serialize(item: ITelemetryItem) { let rlt = EMPTY_STR; let diagLogger = _self.diagLog(); try { let valid = _validate(item, diagLogger); let envelope = null; if (valid) { envelope = _getEnvelope(item, diagLogger); } if (envelope) { rlt = _serializer.serialize(envelope); } } catch (e) { // eslint-disable-next-line no-empty } return rlt; } function _batch(arr: string[]) { let rlt = EMPTY_STR; if (arr && arr.length) { rlt = "[" + arr.join(",") + "]"; } return rlt; } function _createPayload(data: string |Uint8Array) { let headers = _getHeaders(); return { urlString: _endpointUrl, data: data, headers: headers } as IPayloadData; } function _isSampledIn(envelope: ITelemetryItem): boolean { return _self._sample.isSampledIn(envelope); } function _getOnComplete(payload: IInternalStorageItem[], status: number, headers: {[headerName: string]: string;}, response?: string) { // *********************************************************************************************** //TODO: handle other status codes if (status === 200 && payload) { _self._onSuccess(payload, payload.length); } else { response && _self._onError(payload, response); } } function _doSend(sendInterface: IXHROverride, payload: IInternalStorageItem[], isAsync: boolean, markAsSent: boolean = true): void | IPromise { let onComplete = (status: number, headers: {[headerName: string]: string;}, response?: string) => { // let statsbeat = _getStatsBeat(); // if (statsbeat) { // statsbeat.count(status, payloadData, _endpointUrl); // } return _getOnComplete(payload, status, headers, response); } let payloadData = _getPayload(payload); // if (payloadData) { // payloadData.statsBeatData = {startTime: dateNow()}; // } let sendPostFunc: SendPOSTFunction = sendInterface && sendInterface.sendPOST; if (sendPostFunc && payloadData) { // *********************************************************************************************** // mark payload as sent at the beginning of calling each send function if (markAsSent) { _self._buffer.markAsSent(payload); } let result: void | IPromise; let callbackExecuted = false; let resolveFn: any; let rejectFn: any; _sendPostMgr.preparePayload((processedPayload: IPayloadData) => { result = sendPostFunc(processedPayload, onComplete, !isAsync); callbackExecuted = true; if (resolveFn) { doAwait(result as any, resolveFn, rejectFn); } }, _zipPayload, payloadData, !isAsync); if (callbackExecuted) { return result; } // Callback was not executed synchronously, so we need to return a promise return createPromise((resolve, reject) => { resolveFn = resolve; rejectFn = reject; }); } return null; } function _getPayload(payload: IInternalStorageItem[]): IInternalPayloadData { if (isArray(payload) && payload.length > 0) { let batch = _self._buffer.batchPayloads(payload); let headers = _getHeaders(); let payloadData: IInternalPayloadData = { data: batch, urlString: _endpointUrl, headers: headers, disableXhrSync: _disableXhr, disableFetchKeepAlive: !_fetchKeepAlive, oriPayload: payload }; return payloadData; } return null; } function _getHeaders() { try { let headers = _headers || {}; if (isInternalApplicationInsightsEndpoint(_endpointUrl)) { headers[RequestHeaders[eRequestHeaders.sdkContextHeader]] = RequestHeaders[eRequestHeaders.sdkContextHeaderAppIdRequest]; } return headers; } catch(e) { // eslint-disable-next-line no-empty } return null; } function _checkMaxSize(incomingPayload?: string): boolean { let incomingSize = incomingPayload? incomingPayload.length : 0; if ((_self._buffer.size() + incomingSize) > _maxBatchSizeInBytes) { if (!_offlineListener || _offlineListener.isOnline()) { // only trigger send when currently online _self.triggerSend(true, null, SendRequestReason.MaxBatchSize); } return true; } return false; } function _checkResponsStatus(status: number, payload: IInternalStorageItem[], responseUrl: string, countOfItemsInPayload: number, errorMessage: string, res: any) { let response: IBackendResponse = null; if (!_self._appId) { response = parseResponse(res); if (response && response.appId) { _self._appId = response.appId; } } if ((status < 200 || status >= 300) && status !== 0) { // Update End Point url if permanent redirect or moved permanently // Updates the end point url before retry if(status === 301 || status === 307 || status === 308) { if(!_checkAndUpdateEndPointUrl(responseUrl)) { _self._onError(payload, errorMessage); return; } } if (_offlineListener && !_offlineListener.isOnline()) { // offline // Note: Don't check for status == 0, since adblock gives this code if (!_isRetryDisabled) { const offlineBackOffMultiplier = 10; // arbritrary number _resendPayload(payload, offlineBackOffMultiplier); _throwInternal(_self.diagLog(), eLoggingSeverity.WARNING, _eInternalMessageId.TransmissionFailed, `. Offline - Response Code: ${status}. Offline status: ${!_offlineListener.isOnline()}. Will retry to send ${payload.length} items.`); } return; } if (!_isRetryDisabled && _isRetriable(status)) { _resendPayload(payload); _throwInternal(_self.diagLog(), eLoggingSeverity.WARNING, _eInternalMessageId.TransmissionFailed, ". " + "Response code " + status + ". Will retry to send " + payload.length + " items."); } else { _self._onError(payload, errorMessage); } } else { // check if the xhr's responseURL or fetch's response.url is same as endpoint url // TODO after 10 redirects force send telemetry with 'redirect=false' as query parameter. _checkAndUpdateEndPointUrl(responseUrl); if (status === 206) { if (!response) { response = parseResponse(res); } if (response && !_isRetryDisabled) { _self._onPartialSuccess(payload, response); } else { _self._onError(payload, errorMessage); } } else { _consecutiveErrors = 0; _self._onSuccess(payload, countOfItemsInPayload); } } } function _checkAndUpdateEndPointUrl(responseUrl: string) { // Maximum stamp specific redirects allowed(uncomment this when breeze is ready with not allowing redirects feature) if(_stamp_specific_redirects >= 10) { // _self._senderConfig.endpointUrl = () => Sender._getDefaultAppInsightsChannelConfig().endpointUrl()+"/?redirect=false"; // _stamp_specific_redirects = 0; return false; } if(!isNullOrUndefined(responseUrl) && responseUrl !== "") { if(responseUrl !== _endpointUrl) { _endpointUrl = responseUrl; ++_stamp_specific_redirects; return true; } } return false; } function _doUnloadSend(payload: IInternalStorageItem[], isAsync: boolean) { if (_syncUnloadSender) { // We are unloading so always call the sender with sync set to false _syncUnloadSender(payload, false); } else { // Fallback to the previous beacon Sender (which causes a CORB warning on chrome now) let beaconInst = _sendPostMgr && _sendPostMgr.getSenderInst([TransportType.Beacon], true); return _doSend(beaconInst, payload, isAsync); } } function _onBeaconRetry(payload: IPayloadData, onComplete: OnCompleteCallback, canSend:(payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => boolean) { let internalPayload = payload as IInternalPayloadData; let data = internalPayload && internalPayload.oriPayload; if (!_disableBeaconSplit) { // Failed to send entire payload so try and split data and try to send as much events as possible let droppedPayload: IInternalStorageItem[] = []; for (let lp = 0; lp < data.length; lp++) { const thePayload = data[lp]; let arr = [thePayload]; let item = _getPayload(arr); if (!canSend(item, onComplete)) { // Can't send anymore, so split the batch and drop the rest droppedPayload.push(thePayload); } else { _self._onSuccess(arr, arr.length); } } if (droppedPayload.length > 0) { _fallbackSend && _fallbackSend(droppedPayload, true); _throwInternal(_self.diagLog(), eLoggingSeverity.WARNING, _eInternalMessageId.TransmissionFailed, ". " + "Failed to send telemetry with Beacon API, retried with normal sender."); } } else { _fallbackSend && _fallbackSend(data, true); _throwInternal(_self.diagLog(), eLoggingSeverity.WARNING, _eInternalMessageId.TransmissionFailed, ". " + "Failed to send telemetry with Beacon API, retried with normal sender."); } } function _isStringArr(arr: string[] | IInternalStorageItem[]) { try { if (arr && arr.length){ return (isString(arr[0])); } } catch(e) { //TODO: log, sender use IInternalStorageItem instead of string since 3.1.3 } return null; } function _fetchKeepAliveSender(payload: IInternalStorageItem[], isAsync: boolean) { let transport = null; if (isArray(payload)) { let payloadSize = payload.length; for (let lp = 0; lp < payload.length; lp++) { payloadSize += payload[lp].item.length; } let syncFetchPayload = _sendPostMgr.getSyncFetchPayload(); if ((syncFetchPayload + payloadSize) <= FetchSyncRequestSizeLimitBytes) { transport = TransportType.Fetch; } else if (isBeaconsSupported()) { // Fallback to beacon sender as we at least get told which events can't be scheduled transport = TransportType.Beacon; } else { // Payload is going to be too big so just try and send via XHR transport = TransportType.Xhr; _throwInternal(_self.diagLog(), eLoggingSeverity.WARNING, _eInternalMessageId.TransmissionFailed, ". " + "Failed to send telemetry with Beacon API, retried with xhrSender."); } let inst = _sendPostMgr && _sendPostMgr.getSenderInst([transport], true); return _doSend(inst, payload, isAsync); } return null; } /** * Resend payload. Adds payload back to the send buffer and setup a send timer (with exponential backoff). * @param payload */ function _resendPayload(payload: IInternalStorageItem[], linearFactor: number = 1) { if (!payload || payload.length === 0) { return; } const buffer = _self._buffer; buffer.clearSent(payload); _consecutiveErrors++; for (const item of payload) { item.cnt = item.cnt || 0; // to make sure we have cnt for each payload item.cnt ++; // when resend, increase cnt buffer.enqueue(item); } // setup timer _setRetryTime(linearFactor); _setupTimer(); } /** * Calculates the time to wait before retrying in case of an error based on * http://en.wikipedia.org/wiki/Exponential_backoff */ function _setRetryTime(linearFactor: number) { const SlotDelayInSeconds = 10; let delayInSeconds: number; if (_consecutiveErrors <= 1) { delayInSeconds = SlotDelayInSeconds; } else { const backOffSlot = (Math.pow(2, _consecutiveErrors) - 1) / 2; // tslint:disable-next-line:insecure-random let backOffDelay = mathFloor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1; backOffDelay = linearFactor * backOffDelay; delayInSeconds = mathMax(mathMin(backOffDelay, 3600), SlotDelayInSeconds); } // TODO: Log the backoff time like the C# version does. const retryAfterTimeSpan = dateNow() + (delayInSeconds * 1000); // TODO: Log the retry at time like the C# version does. _retryAt = retryAfterTimeSpan; } /** * Sets up the timer which triggers actually sending the data. */ function _setupTimer() { if (!_timeoutHandle && !_paused) { const retryInterval = _retryAt ? mathMax(0, _retryAt - dateNow()) : 0; const timerValue = mathMax(_maxBatchInterval, retryInterval); _timeoutHandle = scheduleTimeout(() => { _timeoutHandle = null; _self.triggerSend(true, null, SendRequestReason.NormalSchedule); }, timerValue); } } function _clearScheduledTimer() { _timeoutHandle && _timeoutHandle.cancel(); _timeoutHandle = null; _retryAt = null; } /** * Checks if the SDK should resend the payload after receiving this status code from the backend. * @param statusCode */ function _isRetriable(statusCode: number): boolean { // retryCodes = [] means should not retry if (!isNullOrUndefined(_retryCodes)) { return _retryCodes.length && _retryCodes.indexOf(statusCode) > -1; } return statusCode === 401 // Unauthorized // Removing as private links can return a 403 which causes excessive retries and session storage usage // || statusCode === 403 // Forbidden || statusCode === 408 // Timeout || statusCode === 429 // Too many requests. || statusCode === 500 // Internal server error. || statusCode === 502 // Bad Gateway. || statusCode === 503 // Service unavailable. || statusCode === 504; // Gateway timeout. } // Using function lookups for backward compatibility as the getNotifyMgr() did not exist until after v2.5.6 function _getNotifyMgr() : INotificationManager { const func = "getNotifyMgr"; let result: INotificationManager; let core = _self.core; if (core) { // During page unload the core may have been cleared and some async events may not have been sent yet // resulting in the core being null. In this case we don't want to create a statsbeat instance if (core[func]) { result = core[func](); } else { // using _self.core['_notificationManager'] for backward compatibility result = (core as any)["_notificationManager"]; } } return result; } function _notifySendRequest(sendRequest: SendRequestReason, isAsync: boolean) { let manager = _getNotifyMgr(); if (manager && manager.eventsSendRequest) { try { manager.eventsSendRequest(sendRequest, isAsync); } catch (e) { _throwInternal(_self.diagLog(), eLoggingSeverity.CRITICAL, _eInternalMessageId.NotificationException, "send request notification failed: " + getExceptionName(e), { exception: dumpObj(e) }); } } } /** * Validate UUID Format * Specs taken from https://tools.ietf.org/html/rfc4122 and breeze repo */ function _validateInstrumentationKey(instrumentationKey: string, config: IConfiguration & IConfig) :boolean { let disableValidation = config.disableInstrumentationKeyValidation; const disableIKeyValidationFlag = isNullOrUndefined(disableValidation) ? false : disableValidation; if(disableIKeyValidationFlag) { return true; } const UUID_Regex = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"; const regexp = new RegExp(UUID_Regex); return regexp.test(instrumentationKey); } function _initDefaults() { _self._sender = null; _self._buffer = null; _self._appId = null; _self._sample = null; _headers = {}; _offlineListener = null; _consecutiveErrors = 0; _retryAt = null; _lastSend = null; _paused = false; _timeoutHandle = null; _serializer = null; _stamp_specific_redirects = 0; _syncFetchPayload = 0; _syncUnloadSender = null; _evtNamespace = null; _endpointUrl = null; _orgEndpointUrl = null; _maxBatchSizeInBytes = 0; _beaconSupported = false; _customHeaders = null; _disableTelemetry = false; _instrumentationKey = null; _convertUndefined = UNDEFINED_VALUE; _isRetryDisabled = false; _sessionStorageUsed = null; _namePrefix = UNDEFINED_VALUE; _disableXhr = false; _fetchKeepAlive = false; _disableBeaconSplit = false; _xhrSend = null; _fallbackSend = null; _sendPostMgr = null; objDefine(_self, "_senderConfig", { g: function() { return objExtend({}, defaultAppInsightsChannelConfig); } }); } }); } /** * Pause the sending (transmission) of events, this will cause all events to be batched only until the maximum limits are * hit at which point new events are dropped. Will also cause events to NOT be sent during page unload, so if Session storage * is disabled events will be lost. * SessionStorage Limit is 2000 events, In-Memory (Array) Storage is 10,000 events (can be configured via the eventsLimitInMem). */ public pause(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Resume the sending (transmission) of events, this will restart the timer and any batched events will be sent using the normal * send interval. */ public resume(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Flush to send data immediately; channel should default to sending data asynchronously. If executing asynchronously (the default) and * you DO NOT pass a callback function then a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * will be returned which will resolve once the flush is complete. The actual implementation of the `IPromise` * will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async) * @param isAsync - send data asynchronously when true * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. * If the caller doesn't return true the caller should assume that it may never be called. * @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified * @returns - If a callback is provided `true` to indicate that callback will be called after the flush is complete otherwise the caller * should assume that any provided callback will never be called, Nothing or if occurring asynchronously a * [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) which will be resolved once the unload is complete, * the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) will only be returned when no callback is provided * and isAsync is true. */ public flush(isAsync: boolean = true, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void | IPromise { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Flush the batched events synchronously (if possible -- based on configuration). * Will not flush if the Send has been paused. */ public onunloadFlush() { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?:ITelemetryPluginChain): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public processTelemetry(telemetryItem: ITelemetryItem, itemCtx?: IProcessTelemetryContext) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * xhr state changes * @deprecated * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility) */ public _xhrReadyStateChange(xhr: XMLHttpRequest, payload: string[] | IInternalStorageItem[], countOfItemsInPayload: number) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging // TODO: no-op // add note to users, this will be removed } /** * Trigger the immediate send of buffered data; If executing asynchronously (the default) this may (not required) return * an [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) that will resolve once the * send is complete. The actual implementation of the `IPromise` will be a native Promise (if supported) or the default * as supplied by [ts-async library](https://github.com/nevware21/ts-async) * @param isAsync - Indicates if the events should be sent asynchronously * @param forcedSender - Indicates the forcedSender, undefined if not passed * @returns - Nothing or optionally, if occurring asynchronously a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * which will be resolved (or reject) once the send is complete, the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * should only be returned when isAsync is true. */ public triggerSend(isAsync = true, forcedSender?: SenderFunction, sendReason?: SendRequestReason): void | IPromise { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * error handler * @internal * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility) */ public _onError(payload: string[] | IInternalStorageItem[], message: string, event?: ErrorEvent) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * partial success handler * @internal * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility) */ public _onPartialSuccess(payload: string[] | IInternalStorageItem[], results: IBackendResponse) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * success handler * @internal * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility) */ public _onSuccess(payload: string[] | IInternalStorageItem[], countOfItemsInPayload: number) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * xdr state changes * @deprecated * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility) */ public _xdrOnLoad(xdr: IXDomainRequest, payload: string[] | IInternalStorageItem[]) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Add header to request * @param name - Header name. * @param value - Header value. */ public addHeader(name: string, value: string) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Check if there are no active requests being sent. * @returns True if idle, false otherwise. */ public isCompletelyIdle(): boolean { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return false; } /** * Get Offline Serializer support * @returns internal Offline Serializer object */ public getOfflineSupport(): IInternalOfflineSupport { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } /** * Get Offline listener * @returns offlineListener * @since 3.3.4 */ public getOfflineListener(): IOfflineListener { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } } ================================================ FILE: channels/applicationinsights-channel-js/src/Serializer.ts ================================================ import dynamicProto from "@microsoft/dynamicproto-js" import { IDiagnosticLogger, _eInternalMessageId, _throwInternal, eLoggingSeverity, getJSON, isArray, isFunction, isNullOrUndefined, isObject, objForEachKey } from "@microsoft/applicationinsights-core-js"; import { FieldType, ISerializable } from "@microsoft/applicationinsights-core-js"; const enum eSerializeType { String = 1, Number = 2 } /** * Used to "tag" objects that are currently being serialized to detect circular references */ const circularReferenceCheck = "__aiCircularRefCheck"; function _serializeObject(logger: IDiagnosticLogger, source: ISerializable, name: string): any { let output: any = {}; if (!source) { _throwInternal(logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.CannotSerializeObject, "cannot serialize object because it is null or undefined", { name }, true); return output; } if ((source as any)[circularReferenceCheck]) { _throwInternal(logger, eLoggingSeverity.WARNING, _eInternalMessageId.CircularReferenceDetected, "Circular reference detected while serializing object", { name }, true); return output; } if (!source.aiDataContract) { // special case for measurements/properties/tags if (name === "measurements") { output = _serializeStringMap(logger, source, eSerializeType.Number, name); } else if (name === "properties") { output = _serializeStringMap(logger, source, eSerializeType.String, name); } else if (name === "tags") { output = _serializeStringMap(logger, source, eSerializeType.String, name); } else if (isArray(source)) { output = _serializeArray(logger, source as any, name); } else { _throwInternal(logger, eLoggingSeverity.WARNING, _eInternalMessageId.CannotSerializeObjectNonSerializable, "Attempting to serialize an object which does not implement ISerializable", { name }, true); try { // verify that the object can be stringified getJSON().stringify(source); output = source; } catch (e) { // if serialization fails return an empty string _throwInternal(logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.CannotSerializeObject, (e && isFunction(e.toString)) ? e.toString() : "Error serializing object", null, true); } } return output; } (source as any)[circularReferenceCheck] = true; objForEachKey(source.aiDataContract, (field, contract) => { const fieldType = isFunction(contract) ? contract() : contract; const isRequired = fieldType & FieldType.Required; const isHidden = fieldType & FieldType.Hidden; const isArray = fieldType & FieldType.Array; const isPresent = (source as any)[field] !== undefined; const isObj = isObject((source as any)[field]) && (source as any)[field] !== null; if (isRequired && !isPresent && !isArray) { _throwInternal(logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.MissingRequiredFieldSpecification, "Missing required field specification. The field is required but not present on source", { field, name }); // If not in debug mode, continue and hope the error is permissible } else if (!isHidden) { // Don't serialize hidden fields let value; if (isObj) { if (isArray) { // special case; recurse on each object in the source array value = _serializeArray(logger, (source as any)[field], field); } else { // recurse on the source object in this field value = _serializeObject(logger, (source as any)[field], field); } } else { // assign the source field to the output even if undefined or required value = (source as any)[field]; } // only emit this field if the value is defined if (value !== undefined) { output[field] = value; } } }); delete (source as any)[circularReferenceCheck]; return output; } function _serializeArray(logger: IDiagnosticLogger, sources: ISerializable[], name: string): any[] { let output: any[]; if (!!sources) { if (!isArray(sources)) { _throwInternal(logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.ItemNotInArray, "This field was specified as an array in the contract but the item is not an array.\r\n", { name }, true); } else { output = []; for (let i = 0; i < sources.length; i++) { const source = sources[i]; const item = _serializeObject(logger, source, name + "[" + i + "]"); output.push(item); } } } return output; } function _serializeStringMap(logger: IDiagnosticLogger, map: any, expectedType: eSerializeType, name: string) { let output: any; if (map) { output = {}; objForEachKey(map, (field, value) => { let serializedValue: string | number; if (value === undefined) { serializedValue = "undefined"; } else if (value === null) { serializedValue = "null"; } if (expectedType === eSerializeType.String && !serializedValue) { if (!value.toString) { serializedValue = "invalid field: toString() is not defined."; } else { serializedValue = value.toString(); } } else if (expectedType === eSerializeType.Number && !serializedValue) { serializedValue = parseFloat(value); } if (serializedValue || !isNullOrUndefined(value)) { output[field] = serializedValue; } }); } return output; } export class Serializer { constructor(logger: IDiagnosticLogger) { dynamicProto(Serializer, this, (_self) => { /** * Serializes the current object to a JSON string. */ _self.serialize = (input: ISerializable): string => { const output = _serializeObject(logger, input, "root"); try { return getJSON().stringify(output); } catch (e) { // if serialization fails return an empty string _throwInternal(logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.CannotSerializeObject, (e && isFunction(e.toString)) ? e.toString() : "Error serializing object", null, true); } } }); } /** * Serializes the current object to a JSON string. */ public serialize(input: ISerializable): string { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } } ================================================ FILE: channels/applicationinsights-channel-js/src/Telemetry/Common/Data.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { AIData, FieldType, ISerializable } from "@microsoft/applicationinsights-core-js"; export function _createData(baseType: string, data: TDomain): AIData & ISerializable { return { baseType: baseType, baseData: data, aiDataContract: { baseType: FieldType.Required, baseData: FieldType.Required } }; } ================================================ FILE: channels/applicationinsights-channel-js/src/Telemetry/RemoteDependencyData.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { FieldType, IDiagnosticLogger, IRemoteDependencyData, ISerializable, dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl, msToTimeSpan, urlParseUrl } from "@microsoft/applicationinsights-core-js"; export const RemoteDependencyEnvelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency"; function AjaxHelperParseDependencyPath(logger: IDiagnosticLogger, absoluteUrl: string, method: string, commandName: string) { let target, name = commandName, data = commandName; if (absoluteUrl && absoluteUrl.length > 0) { const parsedUrl: HTMLAnchorElement = urlParseUrl(absoluteUrl); target = parsedUrl.host; if (!name) { if (parsedUrl.pathname != null) { let pathName: string = (parsedUrl.pathname.length === 0) ? "/" : parsedUrl.pathname; if (pathName.charAt(0) !== "/") { pathName = "/" + pathName; } data = parsedUrl.pathname; name = dataSanitizeString(logger, method ? method + " " + pathName : pathName); } else { name = dataSanitizeString(logger, absoluteUrl); } } } else { target = commandName; name = commandName; } return { target, name, data }; } export function createRemoteDependencyData( logger: IDiagnosticLogger, id: string, absoluteUrl: string, commandName: string, value: number, success: boolean, resultCode: number, method?: string, requestAPI: string = "Ajax", correlationContext?: string, properties?: Object, measurements?: Object) : IRemoteDependencyData & ISerializable { const dependencyFields = AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName); let data: IRemoteDependencyData & ISerializable = { ver: 2, id: id, duration: msToTimeSpan(value), success: success, resultCode: "" + resultCode, type: dataSanitizeString(logger, requestAPI), data: dataSanitizeUrl(logger, commandName) || dependencyFields.data, // get a value from hosturl if commandName not available target: dataSanitizeString(logger, dependencyFields.target), name: dataSanitizeString(logger, dependencyFields.name), properties: dataSanitizeProperties(logger, properties), measurements: dataSanitizeMeasurements(logger, measurements), aiDataContract: { id: FieldType.Required, ver: FieldType.Required, name: FieldType.Default, resultCode: FieldType.Default, duration: FieldType.Default, success: FieldType.Default, data: FieldType.Default, target: FieldType.Default, type: FieldType.Default, properties: FieldType.Default, measurements: FieldType.Default, kind: FieldType.Default, value: FieldType.Default, count: FieldType.Default, min: FieldType.Default, max: FieldType.Default, stdDev: FieldType.Default, dependencyKind: FieldType.Default, dependencySource: FieldType.Default, commandName: FieldType.Default, dependencyTypeName: FieldType.Default } }; if (correlationContext) { data.target = "" + data.target + " | " + correlationContext; } return data; } ================================================ FILE: channels/applicationinsights-channel-js/src/Telemetry/RequestData.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { FieldType, IDiagnosticLogger, ISerializable, asString, dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl, msToTimeSpan } from "@microsoft/applicationinsights-core-js"; import { IRequestData } from "../Interfaces/Contracts/IRequestData"; export const RequestEnvelopeType = "Microsoft.ApplicationInsights.{0}.Request"; /** * Constructs a new instance of the RequestData object */ export function createRequestData(logger: IDiagnosticLogger, id: string, name: string | undefined, value: number, success: boolean, responseCode: number, source?: string, url?: string, properties?: Object, measurements?: Object): IRequestData & ISerializable { return { ver: 2, id: id, name: dataSanitizeString(logger, name), duration: msToTimeSpan(value), success: success, responseCode: asString(responseCode || "0"), source: dataSanitizeString(logger, source), url: dataSanitizeUrl(logger, url), properties: dataSanitizeProperties(logger, properties), measurements: dataSanitizeMeasurements(logger, measurements), aiDataContract: { id: FieldType.Required, ver: FieldType.Required, name: FieldType.Default, responseCode: FieldType.Required, duration: FieldType.Required, success: FieldType.Required, source: FieldType.Default, url: FieldType.Default, properties: FieldType.Default, measurements: FieldType.Default } }; } ================================================ FILE: channels/applicationinsights-channel-js/src/TelemetryProcessors/Sample.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { IDiagnosticLogger, ISample, ITelemetryItem, MetricDataType, _eInternalMessageId, _throwInternal, eLoggingSeverity } from "@microsoft/applicationinsights-core-js"; import { IScoreGenerator, createSamplingScoreGenerator } from "./SamplingScoreGenerators/SamplingScoreGenerator"; function _isSampledIn(envelope: ITelemetryItem, samplingPercentage: number, scoreGenerator: IScoreGenerator): boolean { let isSampledIn = false; if (samplingPercentage === null || samplingPercentage === undefined || samplingPercentage >= 100) { isSampledIn = true; } else if (envelope.baseType === MetricDataType) { // exclude MetricData telemetry from sampling isSampledIn = true; } if (!isSampledIn) { isSampledIn = scoreGenerator.getScore(envelope) < samplingPercentage; } return isSampledIn; } export function createSampler(sampleRate: number, logger?: IDiagnosticLogger): ISample { let _samplingScoreGenerator = createSamplingScoreGenerator(); if (sampleRate > 100 || sampleRate < 0) { _throwInternal(logger, eLoggingSeverity.WARNING, _eInternalMessageId.SampleRateOutOfRange, "Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.", { samplingRate: sampleRate }, true); sampleRate = 100; } let sampler: ISample & { generator: IScoreGenerator } = { sampleRate: sampleRate, generator: _samplingScoreGenerator, isSampledIn: function (envelope: ITelemetryItem) { return _isSampledIn(envelope, sampler.sampleRate, sampler.generator); } }; return sampler; } ================================================ FILE: channels/applicationinsights-channel-js/src/TelemetryProcessors/SamplingScoreGenerators/HashCodeScoreGenerator.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { mathAbs } from "@nevware21/ts-utils"; // (Magic number) DJB algorithm can't work on shorter strings (results in poor distribution const MIN_INPUT_LENGTH: number = 8; // We're using 32 bit math, hence max value is (2^31 - 1) const INT_MAX_VALUE: number = 2147483647; export function getHashCodeScore(key: string): number { let score = 0; let input = key; if (input) { while (input.length < MIN_INPUT_LENGTH) { input = input.concat(input); } // 5381 is a magic number: http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function let hash: number = 5381; for (let i: number = 0; i < input.length; ++i) { hash = ((hash << 5) + hash) + input.charCodeAt(i); // 'hash' is of number type which means 53 bit integer (http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types-number-type) // 'hash & hash' will keep it 32 bit integer - just to make it clearer what the result is. hash = hash & hash; } score = mathAbs(hash) / INT_MAX_VALUE; } return score * 100; } ================================================ FILE: channels/applicationinsights-channel-js/src/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { ContextTagKeys, ITelemetryItem } from "@microsoft/applicationinsights-core-js"; import { getHashCodeScore } from "./HashCodeScoreGenerator"; export interface IScoreGenerator { getScore(item: ITelemetryItem): number; } export function createSamplingScoreGenerator(): IScoreGenerator { let keys: ContextTagKeys = new ContextTagKeys(); return { getScore: (item: ITelemetryItem): number => { let score: number = 0; if (item.tags && item.tags[keys.userId]) { // search in tags first, then ext score = getHashCodeScore(item.tags[keys.userId]); } else if (item.ext && item.ext.user && item.ext.user.id) { score = getHashCodeScore(item.ext.user.id); } else if (item.tags && item.tags[keys.operationId]) { // search in tags first, then ext score = getHashCodeScore(item.tags[keys.operationId]); } else if (item.ext && item.ext.telemetryTrace && item.ext.telemetryTrace.traceID) { score = getHashCodeScore(item.ext.telemetryTrace.traceID); } else { // tslint:disable-next-line:insecure-random score = (Math.random() * 100); } return score; } }; } ================================================ FILE: channels/applicationinsights-channel-js/src/applicationinsights-channel-js.ts ================================================ export { Sender } from "./Sender"; export { ISenderConfig } from "./Interfaces"; ================================================ FILE: channels/applicationinsights-channel-js/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": true, "module": "es6", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "importHelpers": true, "noEmitHelpers": true, "skipLibCheck": true, "declaration": true, "declarationDir": "build/types", "outDir": "dist-es5", "rootDir": "./src", "removeComments": false }, "include": [ "./src/**/*.ts" ], "exclude": [ "./node_modules/**" ] } ================================================ FILE: channels/applicationinsights-channel-js/tsdoc.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", "extends": ["../../tsdoc.json"] } ================================================ FILE: channels/applicationinsights-channel-js/tslint.json ================================================ { "extends": [ "../../tslint-base.json" ], "rules": { "prefer-conditional-expression": false } } ================================================ FILE: channels/applicationinsights-channel-js/typedoc.json ================================================ { "$schema": "https://typedoc.org/schema.json", "entryPoints": [ "./src/applicationinsights-channel-js.ts" ], "exclude": [ "**/internal/**/*.ts", "node_modules/**" ], "externalPattern": [ "**/node_modules/**", "node_modules/**" ], "sort": [ "alphabetical", "kind", "instance-first" ], "basePath": "./src", "sourceLinkTemplate": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/{path}#L{line}", "cleanOutputDir": true, "excludeExternals": false, "excludeInternal": true, "excludePrivate": true, "includeVersion": true, "groupOrder": [ "Entrypoint", "Modules", "Namespaces", "Enumerations", "Enumeration Members", "Classes", "Interfaces", "Type Aliases", "Constructors", "Properties", "Variables", "Functions", "Accessors", "Methods", "References", "*" ], "tsconfig": "./tsconfig.json", "out": "../../docs/webSdk/applicationinsights-channel-js", "readme": "none", "githubPages": true, "gitRevision": "main", "compilerOptions": { "stripInternal": true }, "sidebarLinks": { "Changelog": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/RELEASES.md", "Examples": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/examples/README.md", "Readme": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/channels/applicationinsights-channel-js" }, "navigationLinks": { "GitHub": "https://github.com/Microsoft/ApplicationInsights-JS", "npm": "https://www.npmjs.com/package/@microsoft/applicationinsights-channel-js" }, "visibilityFilters": { "protected": false, "private": false, "inherited": true, "external": true } } ================================================ FILE: channels/offline-channel-js/.gitignore ================================================ /node_modules *.user /bundle /.vs /docs /dist-es5 /dist test/debug.log ================================================ FILE: channels/offline-channel-js/.npmignore ================================================ # NPM Ignore # ignore everything * # ... but these files !package.json !tsconfig.json !/CODE_OF_CONDUCT.md !/CONTRIBUTING.md !/README.md !/SECURITY.md !/SUPPORT.md !/NOTICE !/PRIVACY !/LICENSE !/LICENSE.TXT !dist-es5/** !dist/** !bundle/** !types/** ================================================ FILE: channels/offline-channel-js/CODE_OF_CONDUCT.md ================================================ # Microsoft Open Source Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). Resources: - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns ================================================ FILE: channels/offline-channel-js/CONTRIBUTING.md ================================================ # Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ================================================ FILE: channels/offline-channel-js/LICENSE.TXT ================================================ The MIT License (MIT) Copyright (c) Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: channels/offline-channel-js/PRIVACY ================================================ # Data Collection The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at . You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ================================================ FILE: channels/offline-channel-js/README.md ================================================ # Microsoft Application Insights JavaScript SDK - Offline Channel ## [Beta] ## Description The Offline Channel supports the saving of events when your application is offline and resending those events when the application is online. ### Note - A post or sender channel is required for processing online events. - Request header details will be stored in local/session storage or IndexedDB based on your configuration. - If you are using the default endpoint `https://dc.services.visualstudio.com` for Application Insights, partial success is currently considered as success and events not sent in partial success will be dropped. ## Configuration [`IOfflineChannelConfiguration`](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html) | Name | Type | Default | Description | |------|------|---------|-------------| | [maxStorageSizeInBytes](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#maxStorageSizeInBytes) | [Optional]| 5000000 | The max size in bytes that should be used for storing events in local/session storage. | | [storageKeyPrefix](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#storageKeyPrefix) | [Optional] | AIOffline | The storage key prefix that should be used when storing events in persistent storage. | | [minPersistenceLevel](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#minPersistenceLevel) | [Optional] | `EventPersistence.Normal` or 1 | Identifies the minimum level that will be cached in the offline channel. Valid values of this setting are defined by the `EventPersistence` enum, currently Normal (1) and Critical (2) with the default value being Normal (1), which means all events without a persistence level set or with invalid persistence level will be marked as Normal(1) events.| | [providers](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#providers) | [Optional] | [`eStorageProviders.LocalStorage, eStorageProviders.IndexedDB`]| Identifies the StorageProviders that should be used by the system if available, the first available provider will be used. Valid available values are defined by the `eStorageProviders` enum.
    Note: LocalStorage will be used to save unload events even if it is not in the providers list. | | [eventsLimitInMem](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#eventsLimitInMem) | [Optional] | null | Identifies the maximum number of events to store in memory before sending to persistent storage. | | [autoClean](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#autoClean) | [Optional] | false | Identifies if events that have existed in storage longer than the maximum allowed time (configured in inStorageMaxTime) should be cleaned after connection with storage. | | [inMemoMaxTime](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#inMemoMaxTime) | [Optional] | 15000 | Identifies the maximum time in ms that items should be in memory before being saved into storage. | | [inStorageMaxTime](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#inStorageMaxTime) | [Optional] | 10080000 (around 7days) | Identifies the maximum time in ms that items should be in the configured persistent storage. | | [maxRetry](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#maxRetry) | [Optional] | 1 | Identifies the maximum retry times for an event batch. | | [primaryOnlineChannelId](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#primaryOnlineChannelId) | [Optional] | `[AppInsightsChannelPlugin, PostChannel]` | Identifies online channel IDs in order. The first available one will be used. | | [maxBatchsize](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#maxBatchsize) | [Optional] | 63000 | Identifies the maximum size per batch in bytes that is saved in persistent storage. | | [senderCfg](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#senderCfg) | [Optional] | `IOfflineSenderConfig` | Identifies offline sender properties. | | [maxSentBatchInterval](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#maxSentBatchInterval) | [Optional] | 15000 | Identifies the interval time in ms that previously stored offline event batches should be sent under online status. | | [EventsToDropPerTime](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#EventsToDropPerTime) | [Optional] | 10 | Identifies the maximum event batch count when cleaning or releasing space for persistent storage per time. | | [maxCriticalEvtsDropCnt](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#maxCriticalEvtsDropCnt) | [Optional] | 2 | Identifies the maximum critical events count for an event batch to be able to drop when releasing space for persistent storage per time. | | [overrideInstrumentationKey](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineChannelConfiguration.html#overrideInstrumentationKey) | [Optional] | null | Identifies overridden for the Instrumentation key when the offline channel calls `processTelemetry`. | ### [IOfflineSenderConfig](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineSenderConfig.html) | Name | Type | Default | Description | |------|------|---------|-------------| | [retryCodes](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineSenderConfig.html#retryCodes) | [Optional] | `[401, 403, 408, 429, 500, 502, 503, 504]` | Identifies status codes for re-sending event batches. | | [transports](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineSenderConfig.html#transports) | [Optional] | null | Either an array or single value identifying the requested TransportType type(s) that should be used for sending events. If not defined, the same transports will be used in the channel with the `primaryOnlineChannelI`. | | [httpXHROverride](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineSenderConfig.html#httpXHROverride) | [Optional] | null | The HTTP override that should be used to send requests, as an `IXHROverride` object. | | [alwaysUseXhrOverride](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-offlinechannel-js/interfaces/IOfflineSenderConfig.html#alwaysUseXhrOverride) | [Optional] | false | Identifies if provided httpXhrOverride will always be used. | ## Basic Usage ### NPM Setup ```js import { OfflineChannel, eStorageProviders } from "@microsoft/applicationinsights-offlinechannel-js"; let offlineChannel = new OfflineChannel(); let coreConfig = { connectionString: "YOUR_CONNECTION_STRING", extensionConfig: { [offlineChannel.identifier]: { providers: [eStorageProviders.LocalStorage, eStorageProviders.IndexedDb], minPersistenceLevel: 2, // only events with PersistenceLevel >=2 will be saved/sent } // Add config for offline support channel } }; let appInsights = new ApplicationInsights({config: coreConfig}); appInsights.loadAppInsights(); // this is to make sure offline channel is initialized after sender channel appInsights.addPlugin(offlineChannel); // get offlineListener to set online/offline status let offlineListener = offlineChannel.getOfflineListener(); // set application status to online offlineListener.setOnlineState(1); // offline channel will not process events when the status is online appInsights.track({ name:"onlineEvent" }); // sender channel will send this event // set application status to offline offlineListener.setOnlineState(2); // offline channel will process and save this event to the configured persistent storage // the event will be sent when the application status is online again appInsights.track({ name:"offlineEvent" }); ``` ## Contributing Read our [contributing guide](./CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Application Insights. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at . You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. ## License [MIT](./LICENSE.TXT) ================================================ FILE: channels/offline-channel-js/SECURITY.md ================================================ # Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. ## Preferred Languages We prefer all communications to be in English. ## Policy Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). ================================================ FILE: channels/offline-channel-js/SUPPORT.md ================================================ # Support ## How to file issues and get help This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new Issue. For help and questions about using this project, please create a Support request issue on . ## Microsoft Support Policy Support for this **PROJECT or PRODUCT** is limited to the resources listed above. ================================================ FILE: channels/offline-channel-js/Tests/Unit/src/GlobalTestHooks.Test.ts ================================================ import { Assert } from "@microsoft/ai-test-framework"; import { _testHookMaxUnloadHooksCb } from "@microsoft/applicationinsights-core-js"; import { dumpObj } from "@nevware21/ts-utils"; export class GlobalTestHooks { public registerTests() { // Set a global maximum _testHookMaxUnloadHooksCb(20, (state: string, hooks: Array) => { Assert.ok(false, "Max unload hooks exceeded [" + hooks.length + "] - " + state + " - " + dumpObj(hooks)); }); } } ================================================ FILE: channels/offline-channel-js/Tests/Unit/src/IndexedDB.tests.ts ================================================ import { AITestClass, Assert, PollingAssert } from "@microsoft/ai-test-framework"; import { IndexedDbHelper } from "../../../src/Providers/IndexDbHelper"; import { IIndexedDbOpenDbContext } from "../../../src/Interfaces/IOfflineIndexDb"; import { createAsyncPromise, doAwait } from "@nevware21/ts-async"; import { arrForEach } from "@nevware21/ts-utils"; interface IProviderDbContext { iKey: string; // The current iKey for the events storageId: string; // The current storage instance (think browser instance / tab) iKeyPrefix?: () => string; // Returns the prefix applied to all events of the current iKey evtKeyPrefix?: () => string; // Returns the current prefix to apply to events } export class OfflineIndexedDBTests extends AITestClass { private dbHelper: any; private ctx: any; public testInitialize() { super.testInitialize(); this.dbHelper = new IndexedDbHelper(); this.ctx = {}; } public testCleanup() { super.testCleanup(); this.dbHelper = null; this.ctx = null } public registerTests() { this.testCase({ name: "IndexedDBHelper: Open one new db once and then close it", test: () => { let dbName = "testDB"; let isAvailable = this.dbHelper.isAvailable(); Assert.ok(isAvailable, "db should be available"); let ctxKeys = Object.keys(this.ctx); Assert.equal(ctxKeys.length, 0, "db should not have ctx"); let processFunc = (dbContext: IIndexedDbOpenDbContext) => { return createAsyncPromise>((resolve, reject) => { if (dbContext) { this.ctx.processFunc = dbContext; resolve(dbContext); } reject(new Error("process function error")); }); }; let versionChangeFunc = (dbContext: IIndexedDbOpenDbContext) => { function _createDb(db: IDBDatabase) { // data in the same db must have same endpoint url if (!db.objectStoreNames.contains("Evts")) { // since we have in Memory timer, so time for each Ipayload data should be different. let evtStore = db.createObjectStore("Evts", { keyPath: "time" }); evtStore.createIndex("persistence", "persistence", {unique: false }); } } return createAsyncPromise((resolve, reject) => { if (dbContext) { let db = dbContext.db; _createDb(db); this.ctx.versionChangeFunc = dbContext; resolve(); } reject(new Error("versionChangeFunc function error")); }); } this.dbHelper.openDb(dbName, 1, processFunc, versionChangeFunc); this.dbHelper.deleteDb(dbName).then((val) => { this.ctx.isClosed = val; }); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { let processFunc = this.ctx.processFunc; let versionChangeFunc = this.ctx.processFunc; if (processFunc && versionChangeFunc) { Assert.equal(processFunc.dbName, "testDB", "process function should have correct db name"); Assert.equal(processFunc.dbVersion, 1, "process function should have correct db version"); Assert.ok(processFunc.isNew, "db is new"); Assert.equal(versionChangeFunc.dbName,"testDB", "versionChange function should have correct db name"); Assert.equal(versionChangeFunc.dbVersion,1, "versionChange function should have correct db version"); Assert.ok(versionChangeFunc.isNew, "db is new"); return true; } return false; }, "Wait for response " + new Date().toISOString(), 15, 1000)).concat(PollingAssert.asyncTaskPollingAssert(() => { let isClosed = this.ctx.isClosed; if (isClosed) { return true; } return false; }, "Wait for response " + new Date().toISOString(), 15, 1000)); } }); this.testCase({ name: "IndexedDBHelper: Open one db mutiple times and close db once", test: () => { let dbName = "testDB"; let isAvailable = this.dbHelper.isAvailable(); Assert.ok(isAvailable, "db should be available"); let ctxKeys = Object.keys(this.ctx); Assert.equal(ctxKeys.length, 0, "db should not have ctx"); this.ctx = { process: [], versionChangeFunc: 0 } let processFunc = (dbContext: IIndexedDbOpenDbContext) => { return createAsyncPromise>((resolve, reject) => { if (dbContext) { this.ctx.process.push(dbContext) resolve(dbContext); } reject(new Error("process function error")); }); }; let versionChangeFunc = (dbContext: IIndexedDbOpenDbContext) => { function _createDb(db: IDBDatabase) { // data in the same db must have same endpoint url if (!db.objectStoreNames.contains("Evts")) { // since we have in Memory timer, so time for each Ipayload data should be different. let evtStore = db.createObjectStore("Evts", { keyPath: "time" }); evtStore.createIndex("persistence", "persistence", {unique: false }); } } return createAsyncPromise((resolve, reject) => { if (dbContext) { let db = dbContext.db; _createDb(db); this.ctx.versionChangeFunc++; resolve(); } reject(new Error("versionChangeFunc function error")); }); } this.dbHelper.openDb(dbName, 1, processFunc, versionChangeFunc); this.dbHelper.openDb(dbName, 1, processFunc, versionChangeFunc); this.dbHelper.openDb(dbName, 1, processFunc, versionChangeFunc); this.dbHelper.openDb(dbName, 1, processFunc, versionChangeFunc); this.dbHelper.deleteDb(dbName).then((val) => { this.ctx.isClosed = val; }); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { let process = this.ctx.process; let versionChangeFunc = this.ctx.versionChangeFunc; if (process.length > 3 && versionChangeFunc) { let newOpenRequest = 0; let oldOpenRequest = 0 arrForEach(process, (item) => { item.isNew? newOpenRequest++ : oldOpenRequest++; }) Assert.equal(newOpenRequest, 1, "should have only one new open request"); Assert.equal(oldOpenRequest, 3, "should have three old open request"); Assert.equal(versionChangeFunc, 1, "versionChange function should be called 1 times"); return true; } return false; }, "Wait for response " + new Date().toISOString(), 15, 1000)).concat(PollingAssert.asyncTaskPollingAssert(() => { let isClosed = this.ctx.isClosed; if (isClosed) { return true; } return false; }, "Wait for response " + new Date().toISOString(), 15, 1000)); } }); this.testCase({ name: "IndexedDBHelper: Open mutiple db and close all opend db", test: () => { let dbName = "testDB"; let dbName1 = "testDB1"; let dbName2 = "testDB2"; let isAvailable = this.dbHelper.isAvailable(); Assert.ok(isAvailable, "db should be available"); let ctxKeys = Object.keys(this.ctx); Assert.equal(ctxKeys.length, 0, "db should not have ctx"); this.ctx = { process: [], versionChangeFunc: 0, isClosed: 0 } let processFunc = (dbContext: IIndexedDbOpenDbContext) => { return createAsyncPromise>((resolve, reject) => { if (dbContext) { this.ctx.process.push(dbContext) resolve(dbContext); } reject(new Error("process function error")); }); }; let versionChangeFunc = (dbContext: IIndexedDbOpenDbContext) => { function _createDb(db: IDBDatabase) { // data in the same db must have same endpoint url if (!db.objectStoreNames.contains("Evts")) { // since we have in Memory timer, so time for each Ipayload data should be different. let evtStore = db.createObjectStore("Evts", { keyPath: "time" }); evtStore.createIndex("persistence", "persistence", {unique: false }); } } return createAsyncPromise((resolve, reject) => { if (dbContext) { let db = dbContext.db; _createDb(db); this.ctx.versionChangeFunc++; resolve(); } reject(new Error("versionChangeFunc function error")); }); } this.dbHelper.openDb(dbName, 1, processFunc, versionChangeFunc); this.dbHelper.openDb(dbName1, 1, processFunc, versionChangeFunc); this.dbHelper.openDb(dbName2, 1, processFunc, versionChangeFunc); this.dbHelper.deleteDb(dbName).then((val) => { this.ctx.isClosed ++; }); this.dbHelper.deleteDb(dbName1).then((val) => { this.ctx.isClosed ++; }); this.dbHelper.deleteDb(dbName2).then((val) => { this.ctx.isClosed ++; }); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { let process = this.ctx.process; let versionChangeFunc = this.ctx.versionChangeFunc; if (process.length > 2 && versionChangeFunc) { let newOpenRequest = 0; let oldOpenRequest = 0 arrForEach(process, (item) => { item.isNew? newOpenRequest++ : oldOpenRequest++; }) Assert.equal(newOpenRequest, 3, "should have three new open request"); Assert.equal(oldOpenRequest, 0, "should have no open request"); Assert.equal(versionChangeFunc, 3, "versionChange function should be called 3 times"); return true; } return false; }, "Wait for response " + new Date().toISOString(), 15, 1000)).concat(PollingAssert.asyncTaskPollingAssert(() => { let isClosed = this.ctx.isClosed; if (isClosed == 3) { return true; } return false; }, "Wait for response " + new Date().toISOString(), 15, 1000)); } }); } } ================================================ FILE: channels/offline-channel-js/Tests/Unit/src/TestHelper.ts ================================================ import { BreezeChannelIdentifier, DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH, IConfig } from "@microsoft/applicationinsights-core-js"; import { BaseTelemetryPlugin, IAppInsightsCore, IChannelControls, IConfiguration, IInternalOfflineSupport, IPayloadData, IPlugin, ITelemetryItem } from "@microsoft/applicationinsights-core-js"; export class TestChannel extends BaseTelemetryPlugin implements IChannelControls { public identifier = BreezeChannelIdentifier; public priority: number = 1001; public endpoint: string = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; public isIdle: boolean = true; public isInitialized = () => { return true; } lastEventAdded: ITelemetryItem; eventsAdded: ITelemetryItem[] = []; flushCalled: boolean; uploadNowCallback: () => void; pauseCalled: boolean; resumeCalled: boolean; teardownCalled: boolean; initialize(config: IConfig & IConfiguration, core: IAppInsightsCore, extensions: IPlugin[]) { //No-op } processTelemetry(event: ITelemetryItem) { this.lastEventAdded = event; this.eventsAdded.push(this.lastEventAdded); } pause() { this.pauseCalled = true; } resume() { this.resumeCalled = true; } teardown() { this.teardownCalled = true; } flush(async = true, callback?: () => void) { this.flushCalled = true; } setIsIdle(val) { this.isIdle = val; } isCompletelyIdle() { return this.isIdle; } getOfflineSupport() { return { serialize: (evt) => { return JSON.stringify(evt); }, batch: (arr) => { if (!arr || !arr.length) { return ""; } return "[" + arr.join(",") + "]"; }, shouldProcess: (evt) => { return true; }, getUrl: () => { return this.endpoint; }, createPayload: (evt) => { return { urlString: this.endpoint, data: evt, headers: {header1: "val1"} } as IPayloadData } } as IInternalOfflineSupport; } } export function mockTelemetryItem(level?: number): ITelemetryItem { let evt = { ver: "testVer" + Math.random(), name:"testName", time: "testTime", iKey:"testKey", baseData: {pro1: "prop1", persistence: level}, baseType: "testType" } as ITelemetryItem; return evt; } ================================================ FILE: channels/offline-channel-js/Tests/Unit/src/channel.tests.ts ================================================ import { AITestClass, Assert, PollingAssert } from "@microsoft/ai-test-framework"; import { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH, EventPersistence, IConfig } from "@microsoft/applicationinsights-core-js"; import { AppInsightsCore, IConfiguration, arrForEach, getGlobal, getGlobalInst, objKeys } from "@microsoft/applicationinsights-core-js"; import { TestChannel, mockTelemetryItem } from "./TestHelper"; import { OfflineChannel } from "../../../src/OfflineChannel" import { IOfflineChannelConfiguration, eStorageProviders } from "../../../src/applicationinsights-offlinechannel-js"; export class ChannelTests extends AITestClass { private core: AppInsightsCore; private coreConfig: IConfig & IConfiguration; private ctx: any; private fetchStub: any; private _fetch: any; private evtSent: any; private evtDiscard: any; private evtStore: any; private batchDrop: any; private levelKeys: any; public testInitialize() { super.testInitialize(); AITestClass.orgLocalStorage.clear(); this.coreConfig = { instrumentationKey: "testIkey", disableInstrumentationKeyValidation: true, endpointUrl: DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH }; this.core = new AppInsightsCore(); this.ctx = {}; this._fetch = getGlobalInst("fetch"); this.evtDiscard = 0; this.evtSent = 0; this.evtStore = 0; this.batchDrop = 0; this.levelKeys = [EventPersistence.Critical, EventPersistence.Normal]; } public testCleanup() { super.testCleanup(); AITestClass.orgLocalStorage.clear(); this.onDone(() => { this.core.unload(false); }); this.core = null as any; this.coreConfig = null as any; AITestClass.orgLocalStorage.clear(); this.ctx = null; this.fetchStub = null; getGlobal().fetch = this._fetch; if (window.localStorage){ window.localStorage.clear(); } this.evtDiscard = 0; this.evtSent = 0; this.evtStore = 0; this.batchDrop = 0; this.levelKeys = null; } public registerTests() { this.testCase({ name: "Channel: Init from core", useFakeTimers: true, test: () => { let channel = new OfflineChannel(); let onlineChannel = new TestChannel(); this.core.initialize(this.coreConfig,[channel, onlineChannel]); this.core.addNotificationListener({ eventsDiscarded: (evts, reason) => { this.evtDiscard += 1; }, offlineEventsStored: (evts) => { this.evtStore += 1; }, offlineBatchSent: (batch) => { this.evtSent += 1; }, offlineBatchDrop(cnt, reason) { this.batchDrop += 1; } }); this.clock.tick(1); let offlineListener = channel.getOfflineListener() as any; offlineListener.setOnlineState(1); let evt = mockTelemetryItem(); channel.processTelemetry(evt); let inMemoMap = channel["_getDbgPlgTargets"]()[1]; let mapKeys = objKeys(inMemoMap); Assert.deepEqual(mapKeys.length, this.levelKeys.length, "in memo map should have expected keys"); arrForEach(this.levelKeys, (key) => { let inMemoBatch = inMemoMap[key]; Assert.equal(inMemoBatch.count(), 0, key + " in memo batch should exist"); }); Assert.equal(this.evtDiscard, 0, "discard listener notification should not be called"); Assert.equal(this.evtStore, 0, "store listener notification should not be called"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should not be called"); channel.teardown(); } }); this.testCase({ name: "Channel: Init from core indexed db", useFakeTimers: true, test: () => { let channel = new OfflineChannel(); let onlineChannel = new TestChannel(); this.coreConfig.extensionConfig = {["OfflineChannel"]: {providers:[eStorageProviders.IndexedDb], inMemoMaxTime: 2000} as IOfflineChannelConfiguration}; this.core.initialize(this.coreConfig,[channel, onlineChannel]); this.core.addNotificationListener({ eventsDiscarded: (evts, reason) => { this.evtDiscard += 1; }, offlineEventsStored: (evts) => { this.evtStore += 1; }, offlineBatchSent: (batch) => { this.evtSent += 1; }, offlineBatchDrop(cnt, reason) { this.batchDrop += 1; } }); this.clock.tick(1); let offlineListener = channel.getOfflineListener() as any; offlineListener.setOnlineState(1); let evt = mockTelemetryItem(); channel.processTelemetry(evt); let inMemoMap = channel["_getDbgPlgTargets"]()[1]; let mapKeys = objKeys(inMemoMap); Assert.deepEqual(mapKeys.length, this.levelKeys.length, "in memo map should have expected keys"); Assert.ok(inMemoMap, "inMemoMap should exist"); arrForEach(this.levelKeys, (key) => { let inMemoBatch = inMemoMap[key]; Assert.equal(inMemoBatch.count(), 0, key + " in memo batch should exist"); }); Assert.equal(this.evtDiscard, 0, "discard listener notification should not be called"); Assert.equal(this.evtStore, 0, "store listener notification should not be called"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should not be called"); channel.teardown(); } }); this.testCase({ name: "Channel: Process Telemetry with web provider ", useFakeTimers: true, test: () => { let window = getGlobalInst("window"); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; this.coreConfig.extensionConfig = {["OfflineChannel"]: {inMemoMaxTime: 2000} as IOfflineChannelConfiguration}; let sendChannel = new TestChannel(); let storedEvts:any[] = []; let expectedStoreId: any[] = []; this.core.initialize(this.coreConfig, [sendChannel]); this.core.addNotificationListener({ eventsDiscarded: (evts, reason) => { this.evtDiscard += 1; }, offlineEventsStored: (evts) => { this.evtStore += 1; arrForEach(evts, (item) => { storedEvts.push(item.ver); }) }, offlineBatchDrop(cnt, reason) { this.batchDrop += 1; } }); let channel = new OfflineChannel(); channel.initialize(this.coreConfig, this.core,[]); this.onDone(() => { channel.teardown(); }); this.clock.tick(1); let offlineListener = channel.getOfflineListener() as any; offlineListener.setOnlineState(1); let evt = mockTelemetryItem(); expectedStoreId.push(evt.ver); channel.processTelemetry(evt); let inMemoMap = channel["_getDbgPlgTargets"]()[1]; let mapKeys = objKeys(inMemoMap); Assert.deepEqual(mapKeys.length, this.levelKeys.length, "in memo map should have expected keys"); Assert.ok(inMemoMap, "inMemoMap should exist"); arrForEach(this.levelKeys, (key) => { let inMemoBatch = inMemoMap[key]; Assert.equal(inMemoBatch.count(), 0, key + " in memo batch should exist"); }); let inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(this.evtDiscard, 0, "discard listener notification should not be called"); Assert.equal(this.evtStore, 0, "store listener notification should not be called"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should not be called"); offlineListener.setOnlineState(2); channel.processTelemetry(evt); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 1, "offline should process"); this.clock.tick(2000); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 0, "provider should store item"); let storage = AITestClass.orgLocalStorage; let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = storage.getItem(storageKey) as any; Assert.ok(storageStr.indexOf("header1") > -1, "should contain expeceted header"); let storageObj = JSON.parse(storageStr); let evts = storageObj.evts; Assert.deepEqual(Object.keys(evts).length, 1, "storage should have one event"); this.clock.tick(10); offlineListener.setOnlineState(1); this.clock.tick(15000); let requests = this._getXhrRequests(); Assert.deepEqual(requests.length, 1, "xhr request should be triggered"); storageStr = storage.getItem(storageKey) as any; storageObj = JSON.parse(storageStr); evts = storageObj.evts; Assert.deepEqual(Object.keys(evts).length, 0, "storage should not have one event"); let request = requests[0]; inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 0, "in memo should not have item"); offlineListener.setOnlineState(2); evt = mockTelemetryItem(); expectedStoreId.push(evt.ver); channel.processTelemetry(evt); this.clock.tick(2000); evt = mockTelemetryItem(); expectedStoreId.push(evt.ver); channel.processTelemetry(evt); this.clock.tick(2000); storageStr = storage.getItem(storageKey) as any; storageObj = JSON.parse(storageStr); evts = storageObj.evts; Assert.deepEqual(Object.keys(evts).length, 2, "storage should have two events"); offlineListener.setOnlineState(1); this.clock.tick(15000); requests = this._getXhrRequests(); Assert.deepEqual(requests.length, 2, "xhr request should be triggered again"); storageStr = storage.getItem(storageKey) as any; storageObj = JSON.parse(storageStr); evts = storageObj.evts; Assert.deepEqual(Object.keys(evts).length, 1, "storage should have one event test1"); request = requests[1]; this.sendJsonResponse(request, {}, 200); this.clock.tick(15000); requests = this._getXhrRequests(); Assert.deepEqual(requests.length, 3, "xhr request should be triggered again test1"); request = requests[2]; this.sendJsonResponse(request, {}, 200); storageStr = storage.getItem(storageKey) as any; storageObj = JSON.parse(storageStr); evts = storageObj.evts; Assert.deepEqual(Object.keys(evts).length, 0, "storage should not have one event test1"); this.clock.tick(1); Assert.equal(this.evtDiscard, 0, "discard listener notification should not be called test1"); Assert.equal(this.evtStore, 3, "store listener notification should be called three times test1"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should not be called test1"); Assert.deepEqual( storedEvts, expectedStoreId, "should notify expected evts"); channel.teardown(); (window as any).XMLHttpRequest = fakeXMLHttpRequest; } }); this.testCase({ name: "Channel: Process Telemetry with web provider when splitevts is set to true ", useFakeTimers: true, test: () => { let window = getGlobalInst("window"); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; this.coreConfig.extensionConfig = {["OfflineChannel"]: {inMemoMaxTime: 2000, splitEvts: true} as IOfflineChannelConfiguration}; let sendChannel = new TestChannel(); let storedEvts:any[] = []; let expectedStoreId: any[] = []; this.core.initialize(this.coreConfig, [sendChannel]); this.core.addNotificationListener({ eventsDiscarded: (evts, reason) => { this.evtDiscard += 1; }, offlineEventsStored: (evts) => { this.evtStore += 1; arrForEach(evts, (item) => { storedEvts.push(item.ver); }) }, offlineBatchDrop(cnt, reason) { this.batchDrop += 1; } }); let channel = new OfflineChannel(); channel.initialize(this.coreConfig, this.core,[]); this.onDone(() => { channel.teardown(); }); this.clock.tick(1); let offlineListener = channel.getOfflineListener() as any; offlineListener.setOnlineState(1); let evt = mockTelemetryItem(); expectedStoreId.push(evt.ver); channel.processTelemetry(evt); let inMemoMap = channel["_getDbgPlgTargets"]()[1]; let mapKeys = objKeys(inMemoMap); Assert.deepEqual(mapKeys.length, this.levelKeys.length, "in memo map should have expected keys"); Assert.ok(inMemoMap, "inMemoMap should exist"); arrForEach(this.levelKeys, (key) => { let inMemoBatch = inMemoMap[key]; Assert.equal(inMemoBatch.count(), 0, key + " in memo batch should exist"); }); Assert.equal(this.evtDiscard, 0, "discard listener notification should not be called"); Assert.equal(this.evtStore, 0, "store listener notification should not be called"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should not be called"); offlineListener.setOnlineState(2); // process EventPersistence.Normal event channel.processTelemetry(evt); inMemoMap = channel["_getDbgPlgTargets"]()[1]; let inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 1, "offline should process normal event"); // process ventPersistence.Critical event let criticalEvt = mockTelemetryItem(2); channel.processTelemetry(criticalEvt); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Critical]; Assert.equal(inMemoBatch.count(), 1, "offline should process critical event"); this.clock.tick(2000); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 0, "provider should store normal item"); inMemoBatch = inMemoMap[EventPersistence.Critical]; Assert.equal(inMemoBatch.count(), 0, "provider should store critical normal item"); let storage = AITestClass.orgLocalStorage; let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = storage.getItem(storageKey) as any; Assert.ok(storageStr.indexOf("header1") > -1, "should contain expeceted header"); let storageObj = JSON.parse(storageStr); let evts = storageObj.evts; Assert.deepEqual(Object.keys(evts).length, 2, "storage should have two events"); let normalCnt = '"criticalCnt":0'; let criticalCnt = '"criticalCnt":1'; Assert.ok(storageStr.indexOf(normalCnt) > -1, "should contain expeceted critical count for normal event batches"); Assert.ok(storageStr.indexOf(criticalCnt) > -1, "should contain expeceted critical count for critical event batches"); this.clock.tick(1); Assert.equal(this.evtDiscard, 0, "discard listener notification should not be called test1"); Assert.equal(this.evtStore, 2, "store listener notification should be called two times test1"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should not be called test1"); channel.teardown(); (window as any).XMLHttpRequest = fakeXMLHttpRequest; } }); this.testCase({ name: "Channel: Process Telemetry with indexed db provider", useFakeTimers: true, pollDelay: 100, test: () => { let window = getGlobalInst("window"); let fakeXMLHttpRequest = (window as any).XMLHttpRequest; let sendChannel = new TestChannel(); this.core.initialize(this.coreConfig, [sendChannel]); this.core.addNotificationListener({ eventsDiscarded: (evts, reason) => { this.evtDiscard += 1; }, offlineEventsStored: (evts) => { this.evtStore += 1; }, offlineBatchSent: (batch) => { this.evtSent += 1; this.ctx.sent = this.ctx.sent || []; this.ctx.sent.push(batch.data); }, offlineBatchDrop(cnt, reason) { this.batchDrop += 1; } }); let channel = new OfflineChannel(); this.coreConfig.extensionConfig = {["OfflineChannel"]: {providers:[eStorageProviders.IndexedDb], inMemoMaxTime: 2000} as IOfflineChannelConfiguration}; channel.initialize(this.coreConfig, this.core,[]); this.clock.tick(1); let senderInst = channel["_getDbgPlgTargets"]()[2]; let sender1 = (payload: any, oncomplete: any, sync?: boolean) => { oncomplete(200, {}); } this.ctx.called = 0; this.sandbox.stub((senderInst) as any, "sendPOST").callsFake((payload: any, oncomplete: any, sync?: boolean) => { this.ctx.called++; return sender1(payload, oncomplete, sync) }); Assert.equal(this.evtDiscard, 0, "discard listener notification should not be called"); Assert.equal(this.evtStore, 0, "store listener notification should not be called"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should not be called"); let offlineListener = channel.getOfflineListener() as any; offlineListener.setOnlineState(1); let evt = mockTelemetryItem(); channel.processTelemetry(evt); let inMemoMap = channel["_getDbgPlgTargets"]()[1]; let mapKeys = objKeys(inMemoMap); Assert.deepEqual(mapKeys.length, this.levelKeys.length, "in memo map should have expected keys"); Assert.ok(inMemoMap, "inMemoMap should exist"); arrForEach(this.levelKeys, (key) => { let inMemoBatch = inMemoMap[key]; Assert.equal(inMemoBatch.count(), 0, key + " in memo batch should exist"); }); let inMemoBatch = inMemoMap[EventPersistence.Normal]; offlineListener.setOnlineState(2); channel.processTelemetry(evt); inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 1, "offline should process"); this.clock.tick(2000); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 0, "provider should store item"); this.clock.tick(10); offlineListener.setOnlineState(1); this.clock.tick(15000); offlineListener.setOnlineState(2); evt = mockTelemetryItem(); channel.processTelemetry(evt); this.clock.tick(2000); evt = mockTelemetryItem(); channel.processTelemetry(evt); this.clock.tick(2000); offlineListener.setOnlineState(1); this.clock.tick(15000); channel.teardown(); (window as any).XMLHttpRequest = fakeXMLHttpRequest; return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { let item = this.ctx.called; if (item == 2) { Assert.equal(this.evtDiscard, 0, "discard listener notification should not be called test1"); Assert.equal(this.evtStore, 3, "store listener notification should be called twice test1"); // only wait one 15000 interval, so sent notification should be sent twice only Assert.equal(this.evtSent, 2, "sent listener notification should not called twice test1"); let evts = this.ctx.sent; Assert.ok(evts[0].indexOf(evts[1]) < 0, "events should be different"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should not be called test1"); return true; } return false; }, "Wait for fetch response " + new Date().toISOString(), 200, 1000)); } }); this.testCase({ name: "Channel: add event when in Memory batch is full", useFakeTimers: true, test: () => { let channel = new OfflineChannel(); let sendChannel = new TestChannel(); // make sure in memo time is long enough this.coreConfig.extensionConfig = {["OfflineChannel"]: {providers:[eStorageProviders.LocalStorage], inMemoMaxTime: 200000000, eventsLimitInMem: 1, minPersistenceLevel: 2} as IOfflineChannelConfiguration}; this.core.initialize(this.coreConfig,[channel, sendChannel]); this.core.addNotificationListener({ eventsDiscarded: (evts, reason) => { this.evtDiscard += 1; }, offlineEventsStored: (evts) => { this.evtStore += 1; }, offlineBatchSent: (batch) => { this.evtSent += 1; }, offlineBatchDrop(cnt, reason) { this.batchDrop += 1; } }); this.clock.tick(1); Assert.equal(this.evtDiscard, 0, "discard listener notification should not be called"); Assert.equal(this.evtStore, 0, "store listener notification should not be called"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should not be called"); let offlineListener = channel.getOfflineListener() as any; offlineListener.setOnlineState(2); let evt1 = mockTelemetryItem(2); let ver1 = evt1.ver; let evt2 = mockTelemetryItem(2); channel.processTelemetry(evt1); let inMemoMap = channel["_getDbgPlgTargets"]()[1]; let mapKeys = objKeys(inMemoMap); Assert.deepEqual(mapKeys.length, this.levelKeys.length, "in memo map should have expected keys"); Assert.ok(inMemoMap, "inMemoMap should exist"); let inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 1, "online should process evt1"); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; channel.processTelemetry(evt2); Assert.equal(inMemoBatch.count(), 1, "online should process evt2"); let storage = AITestClass.orgLocalStorage; let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = storage.getItem(storageKey) as any; let storageObj = JSON.parse(storageStr); let evts = storageObj.evts; Assert.equal(evts && Object.keys(evts).length, 1, "should have one events"); Assert.ok(storageStr.indexOf(ver1) > -1, "should contain only the first event"); this.clock.tick(1); Assert.equal(this.evtDiscard, 0, "discard listener notification should not called test1"); Assert.equal(this.evtStore, 1, "store listener notification should be called once test1"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called test1") let invalidEvt = mockTelemetryItem(); channel.processTelemetry(invalidEvt); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 1, "online should not process invalid item"); this.clock.tick(1); Assert.equal(this.evtDiscard, 1, "discard listener notification should be called once test2"); Assert.equal(this.evtStore, 1, "store listener notification should be called once test2"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called test2"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should not be called test2"); channel.teardown(); } }); this.testCase({ name: "Channel: add event when in Memory batch is full with splitEvts set to true", useFakeTimers: true, test: () => { let channel = new OfflineChannel(); let sendChannel = new TestChannel(); // make sure in memo time is long enough this.coreConfig.extensionConfig = {["OfflineChannel"]: {providers:[eStorageProviders.LocalStorage], inMemoMaxTime: 200000000, eventsLimitInMem: 1, splitEvts: true} as IOfflineChannelConfiguration}; this.core.initialize(this.coreConfig,[channel, sendChannel]); this.core.addNotificationListener({ eventsDiscarded: (evts, reason) => { this.evtDiscard += 1; }, offlineEventsStored: (evts) => { this.evtStore += 1; }, offlineBatchSent: (batch) => { this.evtSent += 1; }, offlineBatchDrop(cnt, reason) { this.batchDrop += 1; } }); this.clock.tick(1); Assert.equal(this.evtDiscard, 0, "discard listener notification should not be called"); Assert.equal(this.evtStore, 0, "store listener notification should not be called"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should not be called"); let inMemoMap = channel["_getDbgPlgTargets"]()[1]; Assert.ok(inMemoMap, "inMemoMap should exist"); let mapKeys = objKeys(inMemoMap); Assert.deepEqual(mapKeys.length, this.levelKeys.length, "in memo map should have expected keys"); let offlineListener = channel.getOfflineListener() as any; offlineListener.setOnlineState(2); // eventsLimitInMem = 1, means for each persistent level, max number allowed for in memory events is 1 // process one critical event and one normal event (inMemoMap[nomral] should have 1 event and inMemoMap[critical] should have 1 event) // then process another normal event (one normal event should be saved, inMemoMap[nomral] should have 1 event and inMemoMap[critical] should have 1 event) let normalEvt1 = mockTelemetryItem(); let ver1 = normalEvt1.ver; let normalEvt2 = mockTelemetryItem(); let criticalEvt1 = mockTelemetryItem(2); let cVer1 = criticalEvt1.ver; channel.processTelemetry(normalEvt1); channel.processTelemetry(criticalEvt1); inMemoMap = channel["_getDbgPlgTargets"]()[1]; let inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 1, "online should process normal evt"); inMemoBatch = inMemoMap[EventPersistence.Critical]; Assert.equal(inMemoBatch.count(), 1, "online should process critical evt2"); channel.processTelemetry(normalEvt2); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 1, "normal event batch should have one event"); inMemoBatch = inMemoMap[EventPersistence.Critical]; Assert.equal(inMemoBatch.count(), 1, "critical event batch should have one event"); let storage = AITestClass.orgLocalStorage; let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = storage.getItem(storageKey) as any; let storageObj = JSON.parse(storageStr); let evts = storageObj.evts; Assert.equal(evts && Object.keys(evts).length, 1, "should have one events"); Assert.ok(storageStr.indexOf(ver1) > -1, "should contain only the first event"); this.clock.tick(1); Assert.equal(this.evtDiscard, 0, "discard listener notification should not called test1"); Assert.equal(this.evtStore, 1, "store listener notification should be called once test1"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called test1"); // process another critical event let criticalEvt2 = mockTelemetryItem(2); channel.processTelemetry(criticalEvt2); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 1, "normal event batch should have one event test1"); inMemoBatch = inMemoMap[EventPersistence.Critical]; Assert.equal(inMemoBatch.count(), 1, "critical event batch should have one event test1"); storage = AITestClass.orgLocalStorage; storageKey = "AIOffline_1_dc.services.visualstudio.com"; storageStr = storage.getItem(storageKey) as any; storageObj = JSON.parse(storageStr); evts = storageObj.evts; Assert.equal(evts && Object.keys(evts).length, 2, "should have two events"); Assert.ok(storageStr.indexOf(ver1) > -1, "should contain the first normal event"); Assert.ok(storageStr.indexOf(cVer1) > -1, "should contain the first critical event"); this.clock.tick(1); Assert.equal(this.evtDiscard, 0, "discard listener notification should not called test2"); Assert.equal(this.evtStore, 2, "store listener notification should be called twice test2"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called test2"); channel.teardown(); } }); this.testCase({ name: "Channel: drop batch notification should be handled with inMemo batch", useFakeTimers: true, test: () => { let channel = new OfflineChannel(); let sendChannel = new TestChannel(); // make sure in memo time is long enough this.coreConfig.extensionConfig = {["OfflineChannel"]: {providers:[eStorageProviders.LocalStorage], inMemoMaxTime: 200000000, eventsLimitInMem: 1} as IOfflineChannelConfiguration}; this.core.initialize(this.coreConfig,[channel, sendChannel]); this.core.addNotificationListener({ eventsDiscarded: (evts, reason) => { this.evtDiscard += 1; }, offlineEventsStored: (evts) => { this.evtStore += 1; }, offlineBatchSent: (batch) => { this.evtSent += 1; }, offlineBatchDrop(cnt, reason) { this.batchDrop += 1; } }); this.clock.tick(1); let inMemoMap = channel["_getDbgPlgTargets"]()[1]; let inMemoBatch = inMemoMap[EventPersistence.Normal]; this.sandbox.stub((inMemoBatch) as any, "addEvent").callsFake((evt) => { return false; }); Assert.equal(inMemoBatch.count(), 0, "in memo has no events"); Assert.equal(this.evtDiscard, 0, "discard listener notification should not be called"); Assert.equal(this.evtStore, 0, "store listener notification should not be called"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should not be called"); let offlineListener = channel.getOfflineListener() as any; offlineListener.setOnlineState(2); let evt = mockTelemetryItem(); channel.processTelemetry(evt); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 0, "should not process evt"); this.clock.tick(1); Assert.equal(this.evtDiscard, 1, "discard listener notification should be called once test1"); Assert.equal(this.evtStore, 0, "store listener notification should not be called once test1"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called test1"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should be called test1"); channel.teardown(); } }); this.testCase({ name: "Channel: drop batch notification should be with send", useFakeTimers: true, test: () => { let channel = new OfflineChannel(); let sendChannel = new TestChannel(); let senderCalled = 0; // make sure in memo time is long enough this.coreConfig.extensionConfig = {["OfflineChannel"]: {providers:[eStorageProviders.LocalStorage], inMemoMaxTime: 200, eventsLimitInMem: 1} as IOfflineChannelConfiguration}; this.core.initialize(this.coreConfig,[channel, sendChannel]); this.core.addNotificationListener({ eventsDiscarded: (evts, reason) => { this.evtDiscard += 1; }, offlineEventsStored: (evts) => { this.evtStore += 1; }, offlineBatchSent: (batch) => { this.evtSent += 1; }, offlineBatchDrop(cnt, reason) { this.batchDrop += 1; } }); this.clock.tick(1); let senderInst = channel["_getDbgPlgTargets"]()[2]; let sender1 = (payload: any, oncomplete: any, sync?: boolean) => { oncomplete(800, {}); } this.sandbox.stub((senderInst) as any, "sendPOST").callsFake((payload: any, oncomplete: any, sync?: boolean) => { senderCalled ++; return sender1(payload, oncomplete, sync) }); let inMemoMap = channel["_getDbgPlgTargets"]()[1]; let mapKeys = objKeys(inMemoMap); Assert.equal(mapKeys.length, this.levelKeys.length, "in memo map should have expected keys"); Assert.ok(inMemoMap, "inMemoMap should exist"); arrForEach(this.levelKeys, (key) => { let inMemoBatch = inMemoMap[key]; Assert.equal(inMemoBatch.count(), 0, key + " in memo batch should exist"); }); let inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(this.evtDiscard, 0, "discard listener notification should not be called"); Assert.equal(this.evtStore, 0, "store listener notification should not be called"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called"); Assert.equal(this.batchDrop, 0, "batch drop listener notification should be called"); let offlineListener = channel.getOfflineListener() as any; offlineListener.setOnlineState(2); let evt = mockTelemetryItem(); channel.processTelemetry(evt); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 1, "offline should process evt"); this.clock.tick(300); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 0, "in Memo should have no events remaining"); let storage = AITestClass.orgLocalStorage; let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = storage.getItem(storageKey) as any; let storageObj = JSON.parse(storageStr); let evts = storageObj.evts; Assert.equal(evts && Object.keys(evts).length, 1, "should have one events"); offlineListener.setOnlineState(1); this.clock.tick(15000); Assert.equal(senderCalled, 1, "sent should be called once"); this.clock.tick(1); Assert.equal(this.evtDiscard, 0, "discard listener notification shouldnot be called once test1"); Assert.equal(this.evtStore, 1, "store listener notification should be called once test1"); Assert.equal(this.evtSent, 0, "sent listener notification should not be called test1"); channel.teardown(); } }); this.testCase({ name: "Channel: Should handle endpoint change", useFakeTimers: true, test: () => { let channel = new OfflineChannel(); let sendChannel = new TestChannel(); // make sure in memo time is long enough this.coreConfig.extensionConfig = {["OfflineChannel"]: {providers:[eStorageProviders.LocalStorage], inMemoMaxTime: 200000} as IOfflineChannelConfiguration}; this.core.initialize(this.coreConfig,[channel, sendChannel]); this.clock.tick(1); let offlineListener = channel.getOfflineListener() as any; offlineListener.setOnlineState(2); let inMemoMap = channel["_getDbgPlgTargets"]()[1]; let mapKeys = objKeys(inMemoMap); Assert.deepEqual(mapKeys.length, this.levelKeys.length, "in memo map should have expected keys"); Assert.ok(inMemoMap, "inMemoMap should exist"); arrForEach(this.levelKeys, (key) => { let inMemoBatch = inMemoMap[key]; Assert.equal(inMemoBatch.count(), 0, key + " in memo batch should exist"); }); let inMemoBatch = inMemoMap[EventPersistence.Normal]; let config = channel["_getDbgPlgTargets"]()[0]; Assert.ok(config, "should have config"); Assert.equal(config.url, DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH, "should have expected url"); let evt = mockTelemetryItem(); channel.processTelemetry(evt); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 1, "offline should process evt"); // should get url from online channel first let expectedUrl = "testUrl"; sendChannel.endpoint = expectedUrl; this.core.config.endpointUrl = expectedUrl; this.core.config.instrumentationKey = "test1"; this.clock.tick(1); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 1, "in memo has one events"); Assert.equal(inMemoBatch.endpoint(), expectedUrl, "in memo has expected url"); config = channel["_getDbgPlgTargets"]()[0]; Assert.ok(config, "should have config"); Assert.equal(config.url, expectedUrl, "should have expected url"); // when can't get from online channel, get from core let expectedUrl1 = "testURL1"; sendChannel.endpoint = ""; this.core.config.instrumentationKey = "test2"; this.core.config.endpointUrl = expectedUrl1; this.clock.tick(1); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 1, "in memo has one events"); Assert.equal(inMemoBatch.endpoint(), expectedUrl1, "in memo has expected url test1"); config = channel["_getDbgPlgTargets"]()[0]; Assert.ok(config, "should have config"); Assert.equal(config.url, expectedUrl1, "should have expected url test1"); // when sender channel url change let expectedUrl2 = "testURL2"; sendChannel.endpoint = ""; this.core.config.extensionConfig = this.core.config.extensionConfig || {}; this.core.config.endpointUrl = expectedUrl2; this.core.config.extensionConfig[sendChannel.identifier].endpointUrl = expectedUrl2; this.clock.tick(1); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch.count(), 1, "in memo has one events"); Assert.equal(inMemoBatch.endpoint(), expectedUrl2, "in memo has expected url test1"); config = channel["_getDbgPlgTargets"]()[0]; Assert.ok(config, "should have config"); Assert.equal(config.url, expectedUrl2, "should have expected url test1"); channel.teardown(); } }); } } ================================================ FILE: channels/offline-channel-js/Tests/Unit/src/customprovider.tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import dynamicProto from "@microsoft/dynamicproto-js"; import { AppInsightsCore, arrForEach, createDynamicConfig, getJSON, IConfiguration, IProcessTelemetryContext, newGuid, objForEachKey } from "@microsoft/applicationinsights-core-js"; import { OfflineBatchHandler } from "../../../src/OfflineBatchHandler"; import { ILocalStorageProviderContext, IOfflineChannelConfiguration, IOfflineProvider, eStorageProviders } from "../../../src/Interfaces/IOfflineProvider"; import { getTimeId } from "../../../src/Helpers/Utils"; import { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH, IConfig } from "@microsoft/applicationinsights-core-js"; import { mockTelemetryItem, TestChannel } from "./TestHelper"; import { OfflineChannel } from "../../../src/OfflineChannel"; export class OfflineCustomProviderTests extends AITestClass { private syncStorage: any; private core: AppInsightsCore; private coreConfig: IConfig & IConfiguration; public testInitialize() { super.testInitialize(); this.syncStorage = {}; let channel = new TestChannel(); this.coreConfig = { instrumentationKey: "testIkey", endpointUrl: "https://testurl.com" }; this.core = new AppInsightsCore(); this.core.initialize(this.coreConfig, [channel]); } public testCleanup() { super.testCleanup(); AITestClass.orgLocalStorage.clear(); this.onDone(() => { this.core.unload(); }); this.core = null as any; this.coreConfig = null as any; this.syncStorage = null; } public registerTests() { this.testCase({ name: "OfflineChannel: should initialize successfully with custom provider", useFakeTimers: true, test: () => { // Arrange let mockCustomProvider = this._createMockProvider(true, true, true); let channel = new OfflineChannel(); let sendChannel = new TestChannel(); let core = new AppInsightsCore(); this.coreConfig.extensionConfig = { ["OfflineChannel"]: { customProvider: mockCustomProvider, providers: [eStorageProviders.LocalStorage], inMemoMaxTime: 2000 } as IOfflineChannelConfiguration }; core.initialize(this.coreConfig, [sendChannel, channel]); // Act this.clock.tick(1); let offlineListener = channel.getOfflineListener(); offlineListener && offlineListener.setOnlineState(2); // Set offline let evt = mockTelemetryItem(); channel.processTelemetry(evt); this.clock.tick(2100); // Wait for storage // Verify event was stored using custom provider Assert.ok(this.syncStorage, "Custom provider should have used syncStorage"); let storageKeys = Object.keys(this.syncStorage); Assert.ok(storageKeys.length > 0, "Should have stored data in custom provider"); channel.teardown(); core.unload(); } }); this.testCase({ name: "initProvider: with custom provider(supports sync) and unload(supports sync) provider provided", test: () => { // Arrange let mockCustomProvider = this._createMockProvider(true, true); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg as IOfflineChannelConfiguration; storageConfig.customProvider = mockCustomProvider; storageConfig.customUnloadProvider = mockCustomProvider; let providerContext = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint:DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH } let handler = new OfflineBatchHandler(); // Act let initialized = handler.initialize(providerContext); // Assert Assert.ok(initialized, "Handler should be initialized"); let targets = handler["_getDbgPlgTargets"](); Assert.equal(targets[0], mockCustomProvider, "Custom provider should be used as main provider"); Assert.equal(targets[2], mockCustomProvider, "Custom provider should be used as unload provider when it supports sync"); } }); this.testCase({ name: "initProvider: with custom provider(supports sync) and no unload provider provided", test: () => { // Arrange let mockCustomProvider = this._createMockProvider(true, true); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg as IOfflineChannelConfiguration; storageConfig.customProvider = mockCustomProvider; // No customUnloadProvider specified let providerContext = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH }; let handler = new OfflineBatchHandler(); // Act let initialized = handler.initialize(providerContext); // Assert Assert.ok(initialized, "Handler should be initialized"); let targets = handler["_getDbgPlgTargets"](); Assert.equal(targets[0], mockCustomProvider, "Custom provider should be used as main provider"); Assert.equal(targets[2], mockCustomProvider, "Custom provider should be used as unload provider when it supports sync and no unload provider specified"); } }); this.testCase({ name: "initProvider: with custom provider(no sync support) and custom unload provider(supports sync)", test: () => { // Arrange let mockMainProvider = this._createMockProvider(true, false); // No sync support let mockUnloadProvider = this._createMockProvider(true, true); // Supports sync let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg as IOfflineChannelConfiguration; storageConfig.customProvider = mockMainProvider; storageConfig.customUnloadProvider = mockUnloadProvider; let providerContext = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH }; let handler = new OfflineBatchHandler(); // Act let initialized = handler.initialize(providerContext); // Assert Assert.ok(initialized, "Handler should be initialized"); let targets = handler["_getDbgPlgTargets"](); Assert.equal(targets[0], mockMainProvider, "Custom provider should be used as main provider"); Assert.equal(targets[2], mockUnloadProvider, "Custom unload provider should be used as unload provider"); Assert.notEqual(targets[0], targets[2], "Main and unload providers should be different"); } }); this.testCase({ name: "initProvider: with custom provider(no sync support) and no unload provider provided", test: () => { // Arrange let mockCustomProvider = this._createMockProvider(true, false); // No sync support let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg as IOfflineChannelConfiguration; storageConfig.customProvider = mockCustomProvider; storageConfig.providers = [eStorageProviders.LocalStorage]; // Fallback for unload // No customUnloadProvider specified let providerContext = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH }; let handler = new OfflineBatchHandler(); // Act let initialized = handler.initialize(providerContext); // Assert Assert.ok(initialized, "Handler should be initialized"); let targets = handler["_getDbgPlgTargets"](); Assert.equal(targets[0], mockCustomProvider, "Custom provider should be used as main provider"); Assert.notEqual(targets[2], mockCustomProvider, "Should not use custom provider as unload provider when it doesn't support sync"); Assert.ok(targets[2], "Should have fallback unload provider"); } }); this.testCase({ name: "initProvider: with custom provider initialization failure and fallback providers", test: () => { // Arrange let mockCustomProvider = this._createMockProvider(false, true); // Fails initialization let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg as IOfflineChannelConfiguration; storageConfig.customProvider = mockCustomProvider; storageConfig.providers = [eStorageProviders.LocalStorage]; let providerContext = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH }; let handler = new OfflineBatchHandler(); // Act let initialized = handler.initialize(providerContext); // Assert Assert.ok(initialized, "Handler should be initialized with fallback provider"); let targets = handler["_getDbgPlgTargets"](); Assert.notEqual(targets[0], mockCustomProvider, "Should not use failed custom provider"); Assert.ok(targets[0], "Should have fallback main provider"); } }); this.testCase({ name: "initProvider: with custom provider and storage operations", test: () => { // Arrange let mockCustomProvider = this._createMockProvider(true, true, true); // Full provider let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg as IOfflineChannelConfiguration; storageConfig.customProvider = mockCustomProvider; let providerContext = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH }; let handler = new OfflineBatchHandler(); // Act let initialized = handler.initialize(providerContext); // Assert - Test basic operations Assert.ok(initialized, "Handler should be initialized"); let targets = handler["_getDbgPlgTargets"](); Assert.equal(targets[0], mockCustomProvider, "Should use custom provider"); // Test storage operations let testEvent = { urlString: "testcustomprovider", data: '[{"name":"test1","prop":{"prop1":"prop1"}},{"name":"test1","prop":{"prop1":"prop1"}}]', headers: { "header1": "header1val", "header2": "header2val" }, disableXhrSync: false, disableFetchKeepAlive: false, sendReason: 1, id: newGuid(), iKey: "testIKey", criticalCnt: 1 } let addResult = mockCustomProvider.addEvent("testKey", testEvent, itemCtx); Assert.ok(addResult, "Should successfully add event to custom provider"); let retrievedEvents = mockCustomProvider.getAllEvents() as any; Assert.ok(retrievedEvents && retrievedEvents.length > 0, "Should retrieve stored events from custom provider"); let batchEvents = mockCustomProvider.getNextBatch(); Assert.ok(batchEvents, "Should get next batch from custom provider"); let removeResult = mockCustomProvider.removeEvents([testEvent]); Assert.ok(removeResult, "Should remove events from custom provider"); } }); } private _createMockProvider(shouldInitialize: boolean, supportsSyncRequests: boolean, full?: boolean): IOfflineProvider { let mockProvider = new MockNoopProvider(shouldInitialize, supportsSyncRequests); if (!!full) { mockProvider = new MockFullStorageProvider(this.syncStorage); } return mockProvider; } } // Mock Storage Provider for testing - mimics WebStorageProvider but uses syncStorage instead of browser storage class MockFullStorageProvider implements IOfflineProvider { public id: string; /** * Creates a MockStorageProvider using syncStorage for testing * @param syncStorage - The sync storage object to use for storing data * @param id - Optional identifier for the provider */ constructor(syncStorage: any, id?: string) { dynamicProto(MockFullStorageProvider, this, (_this) => { let _storage: any = null; let _storageKeyPrefix: string = "AIOffline"; let _maxStorageSizeInBytes: number = 5000000; let _storageKey: string; let _endpoint: string ; let _maxStorageTime: number = 604800000; // 7 days _this.id = id || "mock-provider"; // Use the provided syncStorage instead of browser storage _storage = syncStorage; _this["_getDbgPlgTargets"] = () => { return [_storageKey, _maxStorageSizeInBytes, _maxStorageTime]; }; _this.initialize = (providerContext: ILocalStorageProviderContext, endpointUrl?: string) => { if (!_storage) { return false; } let storageConfig = providerContext.storageConfig; _endpoint = endpointUrl || providerContext.endpoint || "test-endpoint"; _maxStorageSizeInBytes = storageConfig.maxStorageSizeInBytes || 5000000; _maxStorageTime = storageConfig.inStorageMaxTime || 604800000; _storageKeyPrefix = storageConfig.storageKeyPrefix || "AIOffline"; _storageKey = _storageKeyPrefix + "_1_" + _endpoint; return true; }; /** * Identifies whether this storage provider support synchronous requests */ _this.supportsSyncRequests = () => { return true; }; /** * Get all of the currently cached events from the storage mechanism */ _this.getAllEvents = (cnt?: number) => { try { if (!_storage) { return null; } return _getEvts(cnt); } catch (e) { return null; } }; /** * Get Next cached event from the storage mechanism */ _this.getNextBatch = () => { try { if (!_storage) { return null; } // set ordered to true, to make sure to get earliest events first return _getEvts(1); } catch (e) { return null; } }; function _getEvts(cnt?: number) { let allItems:any[] = []; let theStore = _fetchStoredDb(_storageKey).db; if (theStore) { let events = theStore.evts; objForEachKey(events, (evt) => { if (evt) { allItems.push(evt); } if (cnt && allItems && allItems.length === cnt) { return; } }); } return allItems; } /** * Stores the value into the storage using the specified key. * @param key - The key value to use for the value * @param evt - The actual event of the request * @param itemCtx - This is the context for the current request */ _this.addEvent = (key: string, evt: any, itemCtx: IProcessTelemetryContext) => { try { let theStore = _fetchStoredDb(_storageKey); evt.id = evt.id || getTimeId(); evt.criticalCnt = evt.criticalCnt || 0; let events = theStore.db.evts; let id = evt.id; events[id] = evt; if (_updateStoredDb(theStore)) { // Database successfully updated return evt; } return null; } catch (e) { return null; } }; /** * Removes the value associated with the provided key * @param evts - The events to be removed */ _this.removeEvents = (evts: any[]) => { try { let theStore = _fetchStoredDb(_storageKey, false); let currentDb = theStore.db; if (currentDb) { let events = currentDb.evts; try { arrForEach(events, (evt) => { delete events[evt.id]; }); // Update takes care of removing the DB if it's completely empty now if (_updateStoredDb(theStore)) { return evts; } } catch (e) { // Storage corrupted } // failure here so try and remove db to unblock following events evts = _clearDatabase(theStore.key); } return evts; } catch (e) { return evts || []; } }; /** * Removes all entries from the storage provider for the current endpoint and returns them as part of the response, if there are any. */ _this.clear = () => { try { let removedItems: any[] = []; let theStore = _fetchStoredDb(_storageKey, false); let storedDb = theStore.db; if (storedDb) { let events = storedDb.evts; objForEachKey(events, (key) => { let evt = events[key]; if (evt) { delete events[evt.id]; removedItems.push(evt); } }); _updateStoredDb(theStore); } return removedItems; } catch (e) { return []; } }; _this.clean = () => { let storeDetails = _fetchStoredDb(_storageKey, false); let currentDb = storeDetails.db; if (currentDb) { try { syncStorage = {}; return true; } catch (e) { // should not throw errors here // because we don't want to block following process } return false; } }; /** * Shuts-down the telemetry plugin. This is usually called when telemetry is shut down. * This attempts to update the lastAccessTime for any storedDb */ _this.teardown = () => { try { let theStore = _fetchStoredDb(_storageKey, false); let storedDb = theStore.db; if (storedDb) { // reset the last access time storedDb.lastAccessTime = 0; _updateStoredDb(theStore, false); } } catch (e) { // Add diagnostic logging } }; /** * @ignore * Creates a new json store with the StorageJSON (may be null), a null db value indicates that the store * associated with the key is empty and should be removed. * @param dbKey - The key to associate with the database * @param db - The database */ function _newStore(dbKey: string, db: any) { return { key: dbKey, db: db }; } function _fetchStoredDb(dbKey: string, returnDefault?: boolean) { let dbToStore; if (_storage) { let previousDb = _storage[dbKey]; if (previousDb) { try { dbToStore = getJSON().parse(previousDb); } catch (e) { // storage corrupted delete _storage[dbKey]; } } if (returnDefault !== false && !dbToStore) { // Create and return a default empty database dbToStore = { evts: {}, lastAccessTime: 0 }; } } return _newStore(dbKey, dbToStore); } function _updateStoredDb(jsonStore: any, updateLastAccessTime?: boolean) { let dbToStore = jsonStore.db; if (dbToStore) { if (updateLastAccessTime !== false) { // Update the last access time dbToStore.lastAccessTime = (new Date()).getTime(); } } try { let jsonString = getJSON().stringify(dbToStore); if (jsonString.length > _maxStorageSizeInBytes) { // We can't store the database as it would exceed the configured max size return false; } _storage && (_storage[jsonStore.key] = jsonString); } catch (e) { // catch exception due to trying to store or clear JSON // We could not store the database return false; } return true; } function _clearDatabase(dbKey: string) { let removedItems: any[] = []; let storeDetails = _fetchStoredDb(dbKey, false); let currentDb = storeDetails.db; if (currentDb) { try { let events = currentDb.evts; objForEachKey(events, (key) => { let evt = events[key]; if (evt) { removedItems.push(evt); } }); } catch (e) { // catch exception due to trying to store or clear JSON } // Remove the entire stored database _storage && delete _storage[storeDetails.key]; } return removedItems; } }); } /** * Initializes the provider using the config * @param providerContext - The provider context that should be used to initialize the provider * @returns True if the provider is initialized and available for use otherwise false */ public initialize(providerContext: ILocalStorageProviderContext): boolean { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return false; } /** * Identifies whether this storage provider support synchronous requests */ public supportsSyncRequests(): boolean { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return false; } /** * Get all of the currently cached events from the storage mechanism */ public getAllEvents(cnt?: number): any { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Get the Next one cached batch from the storage mechanism */ public getNextBatch(): any { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Stores the value into the storage using the specified key. * @param key - The key value to use for the value * @param evt - The actual event of the request * @param itemCtx - This is the context for the current request */ public addEvent(key: string, evt: any, itemCtx: IProcessTelemetryContext): any { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Removes the value associated with the provided key * @param evts - The events to be removed */ public removeEvents(evts: any[]): any { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Removes all entries from the storage provider, if there are any. */ public clear(): any { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Removes all entries with storage time longer than inStorageMaxTime from the storage provider */ public clean(): any { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Shuts-down the telemetry plugin. This is usually called when telemetry is shut down. */ public teardown(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } } /** * Mock Storage Provider for testing - mimics WebStorageProvider but uses syncStorage instead of browser storage */ export class MockNoopProvider implements IOfflineProvider { public id: string; /** * Creates a MockStorageProvider using syncStorage for testing * @param syncStorage - The sync storage object to use for storing data * @param id - Optional identifier for the provider */ constructor(shouldInitialize: boolean, supportsSyncRequests: boolean) { dynamicProto(MockNoopProvider, this, (_this) => { _this.id = "mock-syncnoop-provider"; _this.initialize = (providerContext: ILocalStorageProviderContext, endpointUrl?: string) => { return shouldInitialize; }; _this.supportsSyncRequests = () => { return supportsSyncRequests; }; _this.getAllEvents = (cnt?: number) => { return null; }; _this.getNextBatch = () => { return null; }; _this.removeEvents = (evts: any[]) => { return []; }; _this.clear = () => { return []; }; _this.clean = () => { return false; }; _this.teardown = () => { // tear down no op }; }); } /** * Initializes the provider using the config * @param providerContext - The provider context that should be used to initialize the provider * @returns True if the provider is initialized and available for use otherwise false */ public initialize(providerContext: ILocalStorageProviderContext): boolean { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return false; } /** * Identifies whether this storage provider support synchronous requests */ public supportsSyncRequests(): boolean { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return false; } /** * Get all of the currently cached events from the storage mechanism */ public getAllEvents(cnt?: number): any { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Get the Next one cached batch from the storage mechanism */ public getNextBatch(): any { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Stores the value into the storage using the specified key. * @param key - The key value to use for the value * @param evt - The actual event of the request * @param itemCtx - This is the context for the current request */ public addEvent(key: string, evt: any, itemCtx: IProcessTelemetryContext): any { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Removes the value associated with the provided key * @param evts - The events to be removed */ public removeEvents(evts: any[]): any { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Removes all entries from the storage provider, if there are any. */ public clear(): any { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Removes all entries with storage time longer than inStorageMaxTime from the storage provider */ public clean(): any { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Shuts-down the telemetry plugin. This is usually called when telemetry is shut down. */ public teardown(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } } ================================================ FILE: channels/offline-channel-js/Tests/Unit/src/dbprovider.tests.ts ================================================ import { AITestClass, Assert, PollingAssert } from "@microsoft/ai-test-framework"; import { IndexedDbProvider } from "../../../src/Providers/IndexDbProvider"; import { createAsyncPromise, createAsyncRejectedPromise, createSyncPromise, doAwait, doAwaitResponse } from "@nevware21/ts-async"; import { arrForEach, strSubstr } from "@nevware21/ts-utils"; import { TestChannel } from "./TestHelper"; import { AppInsightsCore, IConfiguration, createDynamicConfig, generateW3CId, newGuid } from "@microsoft/applicationinsights-core-js"; import { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH, IConfig } from "@microsoft/applicationinsights-core-js"; import { IStorageTelemetryItem } from "../../../src/Interfaces/IOfflineProvider"; export class OfflineDbProviderTests extends AITestClass { private core: AppInsightsCore; private coreConfig: IConfig & IConfiguration; private ctx: any; private preEvts: IStorageTelemetryItem[] = []; private batchDrop: any; public testInitialize() { super.testInitialize(); let channel = new TestChannel(); this.coreConfig = { instrumentationKey: "testIkey", endpointUrl: "https://testurl.com" }; this.core = new AppInsightsCore(); this.core.initialize(this.coreConfig, [channel]); this.ctx = {}; this.batchDrop = []; } public testCleanup() { super.testCleanup(); this.onDone(() => { this.core.unload(); }); this.core = null as any; this.coreConfig = null as any; this.batchDrop = []; } public registerTests() { this.testCase({ name: "IndexedDbProvider: init with auto clean set to false", test: () => { let provider = new IndexedDbProvider(); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); let ctx = provider["_getDbgPlgTargets"](); let expectedStorageKey = "AIOffline_1_dc.services.visualstudio.com"; Assert.equal(ctx[0], expectedStorageKey, "should have expected storage"); Assert.equal(ctx[1], "dc.services.visualstudio.com", "default endpoint is set"); let expectedMaxStorageTime = 604800000; Assert.equal(ctx[2], expectedMaxStorageTime, "default Max time is set"); Assert.ok(!provider.supportsSyncRequests(), "support sync should be set to false"); // this test will run database creation/dbupgrade as well provider.teardown(); } }); this.testCase({ name: "IndexedDbProvider: init with auto clean set to true", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let provider = new IndexedDbProvider(); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({autoClean: true}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint }; return this._asyncQueue().add(() => doAwait(provider.initialize(providerCxt), (val) => { this.ctx.isInit = val; Assert.ok(val, "init process is successful"); }, (reason)=> { this.ctx.initErr = reason; Assert.ok(false, "error for init"); }) ).add(() => doAwait(provider.teardown(), () => { this.ctx.isclosed = true; Assert.ok(true, "should teardown provider"); }, (reason) => { Assert.ok(false, "error for teardown"); }) ); } }); this.testCase({ name: "IndexedDbProvider: addEvent with no previous stored events", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let provider = new IndexedDbProvider(); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({autoClean: true}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint }; let evt = TestHelper.mockEvent(endpoint, 3, false); return this._asyncQueue().add(() => doAwait(provider.initialize(providerCxt), (val) => { this.ctx.isInit = val; }, (reason)=> { this.ctx.initErr = reason; Assert.ok(false, "error for init"); }) ).add(() => doAwait(provider.addEvent("", evt, itemCtx), (item) => { this.ctx.evt = item; Assert.deepEqual(item, evt, "should add expected item"); Assert.ok(evt.id, "should add id to the item"); this.preEvts.push(evt); }, (reason) => { this.ctx.addEventErr = reason; Assert.ok(false, "error for addEvt"); }) ).add(() => doAwait(provider.getNextBatch(), (item) => { this.ctx.getEvt = item; Assert.equal(item && item.length, 1, "should have one item"); Assert.deepEqual((item as any)[0], evt, "should add expected item"); }, (reason) => { this.ctx.getEvtErr = reason; Assert.ok(false, "error for get event"); }) ).add(() => doAwait(provider.teardown(), () => { this.ctx.isclosed = true; Assert.ok(true, "should teardown provider"); },(reason) => { Assert.ok(false, "error for teardown"); }) ); } }); this.testCase({ name: "IndexedDbProvider: addEvent with previous stored events", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let provider = new IndexedDbProvider(); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({autoClean: true}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint }; let evt = TestHelper.mockEvent(endpoint, 3, false); let evt1 = TestHelper.mockEvent(endpoint, 1, false); let evt2 = TestHelper.mockEvent(endpoint, 2, false); return this._asyncQueue().add(() => doAwait(provider.initialize(providerCxt), (val) => { this.ctx.isInit = val; }, (reason)=> { this.ctx.initErr = reason; Assert.ok(false, "error for init"); }) ).add(() => doAwait(provider.getAllEvents(), (val) => { this.ctx.preEvts = val; Assert.equal(val && val.length, 1 , "should have the event from the previous test"); Assert.ok((val as any)[0].id, "should have id"); Assert.equal((val as any)[0].id, this.preEvts[0].id, "should get back expected previous events"); }, (reason)=> { this.ctx.preEvtsErr = reason; Assert.ok(false, "get previous events error"); }) ).add(() => doAwait(provider.addEvent("", evt, itemCtx), (item) => { this.ctx.evt = item; Assert.equal(item, evt, "should have one event"); }, (reason)=> { this.ctx.preEvtsErr = reason; Assert.ok(false, "get previous events error"); }) ).add(() => doAwait(provider.getAllEvents(), (val) => { this.ctx.allEvts = val; Assert.equal(val && val.length, 2 , "should have the two events"); Assert.deepEqual((val as any)[1], evt, "should get back expected added events"); }, (reason) => { this.ctx.addEventErr = reason; Assert.ok(false, "add event error"); }) ).add(() => doAwait(provider.addEvent("", evt1, itemCtx), (item) => { this.ctx.evt1 = item; Assert.deepEqual(item, evt1, "should have expected event1"); }, (reason) => { this.ctx.addEvent1Err = reason; Assert.ok(false, "add event1 error"); }) ).add(() => doAwait(provider.addEvent("", evt2, itemCtx), (item) => { this.ctx.evt2 = item; Assert.deepEqual(item, evt2, "should have expected event2"); }, (reason) => { this.ctx.addEvent2Err = reason; Assert.ok(false, "add event2 error"); }) ).add(() => doAwait(provider.getAllEvents(), (val) => { this.ctx.allEvts1 = val; Assert.equal(val && (val as any).length, 4, "should have four events"); }, (reason)=> { this.ctx.oneEvtsErr = reason; Assert.ok(false, "get all events1 error"); }) ).add(() => doAwait(provider.getNextBatch(), (val) => { this.ctx.nextBatch = val; Assert.equal(val && (val as any).length, 1, "should return one event"); Assert.deepEqual((val as any)[0], this.preEvts[0], "should have return the earliest event"); }, (reason)=> { this.ctx.nextBatchErr = reason; Assert.ok(false, "get next batch error"); }) ).add(() => doAwait(provider.getAllEvents(2), (val) => { this.ctx.twoEvts = val; Assert.equal(val && (val as any).length, 2, "should return two events"); Assert.deepEqual((val as any)[0], this.preEvts[0], "should have return the earliest event1"); }, (reason)=> { this.ctx.twoEvtsErr = reason; Assert.ok(false, "get two events error"); }) ).add(() => doAwait(provider.clear(), (val) => { this.ctx.clear = val; Assert.equal(val && (val as any).length, 4, "should clear all events"); }, (reason)=> { this.ctx.twoEvtsErr = reason; Assert.ok(false, "get two events error"); }) ).add(() => doAwait(provider.teardown(), () => { this.ctx.isclosed = true; }, (reason) => { Assert.ok(false, "teardown error"); }) ) } }); this.testCase({ name: "IndexedDbProvider: getAllEvents should handle cursor errors", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let provider = new IndexedDbProvider(); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({autoClean: true}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint }; let evt = TestHelper.mockEvent(endpoint, 3, false); return this._asyncQueue().add(() => doAwait(provider.initialize(providerCxt), (val) => { this.ctx.isInit = val; }, (reason)=> { this.ctx.initErr = reason; Assert.ok(false, "error for init"); }) ).add(() => doAwait(provider.addEvent("", evt, itemCtx), (item) => { this.ctx.evt = item; }, (reason) => { this.ctx.addEventErr = reason; Assert.ok(false, "add evt error"); doAwait(provider.teardown(), () => { this.ctx.isclosed = true; }); }) ).add(() => { let ctx = provider["_getDbgPlgTargets"](); let db = ctx[3]; this.sandbox.stub(db as any, "openDb").callsFake((name, ver, func, change?) => { return createAsyncPromise((resolve, reject)=> { try { let openDbCtx = { openCursor: (var1, var2, var3?) => { return createAsyncRejectedPromise(new Error("open cursor mock error")); } } // Database has been opened doAwait(func(openDbCtx), resolve, reject); } catch (e) { reject(e); } }); }); return doAwait(provider.getNextBatch(), (val) => { this.ctx.nextBatch = val; Assert.ok(false, "should handle errors"); }, (reason)=> { this.ctx.nextBatchErr = reason; Assert.equal(reason.message, "open cursor mock error"); }); }).add(() => doAwait(provider.teardown(), () => { this.ctx.isclosed = true; },(reason) => { Assert.ok(false, "teardown errors"); }) ) } }); this.testCase({ name: "IndexedDbProvider: removeEvents should delete expected events", test: () => { this.core.addNotificationListener({ offlineBatchDrop: (cnt, reason)=> { this.batchDrop.push({cnt: cnt, reason: reason}); } }); let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let provider = new IndexedDbProvider(); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({autoClean: true, inStorageMaxTime:1}).cfg; // this should clean all previous events let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint, notificationMgr: this.core.getNotifyMgr() }; let evt = TestHelper.mockEvent(endpoint, 3, false); let evt1 = TestHelper.mockEvent(endpoint, 1, false); let evt2 = TestHelper.mockEvent(endpoint, 2, false); let evt4 = TestHelper.mockEvent(endpoint, 4, false); return this._asyncQueue().add(() => doAwait(provider.initialize(providerCxt), (val) => { this.ctx.isInit = val; }, (reason)=> { this.ctx.initErr = reason; Assert.ok(false, "error for init"); }) ).add(() => doAwait(provider.removeEvents([evt]), (item) => { this.ctx.removeEvts = item; Assert.deepEqual(item && item.length, 0,"should not delete any events"); }, (reason) => { this.ctx.removeEvtsErr = reason; Assert.ok(false, "error for remove events"); }) ).add(() => doAwait(provider.addEvent("", evt, itemCtx), (item) => { this.ctx.evt = item; Assert.deepEqual(item, evt, "should add exepcted evt"); }, (reason) => { this.ctx.addEventErr = reason; Assert.ok(false, "error for add events"); }) ).add(() => doAwait(provider.addEvent("", evt1, itemCtx), (item) => { this.ctx.evt1 = item; Assert.deepEqual(item, evt1, "should add exepcted evt1"); }, (reason) => { this.ctx.addEvent1Err = reason; Assert.ok(false, "error for add event 1"); }) ).add(() => doAwait(provider.addEvent("", evt2, itemCtx), (item) => { this.ctx.evt2 = item; Assert.deepEqual(item, evt2, "should add exepcted evt2"); }, (reason) => { this.ctx.addEvent2Err = reason; Assert.ok(false, "error for add event 2"); }) ).add(() => doAwait(provider.getAllEvents(), (val) => { this.ctx.allEvts = val; Assert.deepEqual(val && val.length, 3, "should have all expected 3 events"); }, (reason)=> { this.ctx.allEvtsErr = reason; Assert.ok(false, "error for get all events"); }) ).add(() => doAwait(provider.removeEvents([evt4]), (item) => { this.ctx.removeEvts1 = item; Assert.deepEqual(item && item.length, 0, "should not delete event1"); }, (reason) => { this.ctx.removeEvts1Err = reason; Assert.ok(false, "error for remove events1"); }) ).add(() => doAwait(provider.removeEvents([evt, evt1]), (item) => { this.ctx.removeEvts2 = item; Assert.deepEqual(item && item.length, 2, "should delete all expected events"); let item1 = (item as any)[0]; let item2 = (item as any)[1]; if (item1.id == evt1.id) { Assert.deepEqual(item1, evt1, "should have deleted all event"); Assert.deepEqual(item2, evt, "should have deleted all event1"); } else { Assert.deepEqual(item1, evt, "should have deleted all event"); Assert.deepEqual(item2, evt1, "should have deleted all event1"); } }, (reason) => { this.ctx.removeEvts2Err = reason; Assert.ok(false, "error for remove events2"); }) ).add(() => doAwait(provider.getAllEvents(), (val) => { this.ctx.allEvts1 = val; Assert.deepEqual(val && val.length, 1, "should have one event remaining"); Assert.deepEqual((val as any)[0], evt2, "should have evt2"); }, (reason)=> { this.ctx.allEvts1Err = reason; Assert.ok(false, "error for get all evts1"); }) ).add(() => doAwait(provider.teardown(), () => { this.ctx.isclosed = true; Assert.equal(this.batchDrop.length, 1, "notification should be called once"); // sent in clean process during initialization Assert.equal(this.batchDrop[0].reason, 3, "notification should be called with expected reason time exceeded"); },(reason) => { Assert.ok(false, "teardown error"); }) ) } }); this.testCase({ name: "IndexedDbProvider: clear should delete all events", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let provider = new IndexedDbProvider(); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint }; let evt = TestHelper.mockEvent(endpoint, 3, false); let evt1 = TestHelper.mockEvent(endpoint, 1, false); let evt2 = TestHelper.mockEvent(endpoint, 2, false); return this._asyncQueue().add(() => doAwait(provider.initialize(providerCxt), (val) => { this.ctx.isInit = val; }, (reason)=> { this.ctx.initErr = reason; Assert.ok(false, "error for init"); }) ).add(() => doAwait(provider.addEvent("", evt, itemCtx), (item) => { this.ctx.evt = item; Assert.deepEqual(item, evt, "should add evt"); }, (reason) => { this.ctx.addEventErr = reason; Assert.ok(false, "error for add evt"); }) ).add(() => doAwait(provider.addEvent("", evt1, itemCtx), (item) => { this.ctx.evt1 = item; Assert.deepEqual(item, evt1, "should add evt1"); }, (reason) => { this.ctx.addEvent1Err = reason; Assert.ok(false, "error for add evt1"); }) ).add(() => doAwait(provider.addEvent("", evt2, itemCtx), (item) => { this.ctx.evt2 = item; Assert.deepEqual(item, evt2, "should add evt2"); }, (reason) => { this.ctx.addEvent2Err = reason; Assert.ok(false, "error for add evt2"); }) ).add(() => doAwait(provider.clear(), (val)=> { this.ctx.clearEvts = val; Assert.ok(val && val.length >= 3, "should clear events"); // may have the events from previous test }, (reason)=> { this.ctx.clearEvtsErr = reason; Assert.ok(false, "error for clear"); }) ).add(() => doAwait(provider.getAllEvents(), (val) => { this.ctx.allEvts1 = val; Assert.equal(val && val.length, 0, "should not have any events" ); }, (reason)=> { this.ctx.allEvts1Err = reason; Assert.ok(false, "get events error"); }) ).add(() => doAwait(provider.teardown(), () => { this.ctx.isclosed = true; },(reason) => { Assert.ok(false, "teardown error"); }) ) } }); this.testCase({ name: "IndexedDbProvider: clean should delete all events that exist longer than max storage time", pollDelay: 100, useFakeTimers: true, test: () => { this.core.addNotificationListener({ offlineBatchDrop: (cnt, reason)=> { this.batchDrop.push({cnt: cnt, reason: reason}); } }); let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let provider = new IndexedDbProvider(); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({inStorageMaxTime: 30000}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint, notificationMgr: this.core.getNotifyMgr() }; doAwait(provider.initialize(providerCxt), (val) => { this.ctx.isInit = val; }, (reason)=> { this.ctx.initErr = reason; Assert.ok(false, "error for init"); }); let evt = TestHelper.mockEvent(endpoint, 3, false); let evt1 = TestHelper.mockEvent(endpoint, 1, false); doAwait(provider.addEvent("", evt, itemCtx), (item) => { this.ctx.evt = item; Assert.deepEqual(item, evt, "should add event"); }, (reason) => { this.ctx.addEventErr = reason; Assert.ok(false, "error for add event"); }); doAwait(provider.addEvent("", evt1, itemCtx), (item) => { this.ctx.evt1 = item; Assert.deepEqual(item, evt1, "should add event1"); }, (reason) => { this.ctx.addEvent1Err = reason; Assert.ok(false, "error for add event1"); }); this.clock.tick(25000); let evt2 = TestHelper.mockEvent(endpoint, 2, false); doAwait(provider.addEvent("", evt2, itemCtx), (item) => { this.ctx.evt2 = item; Assert.deepEqual(item, evt2, "should add event2"); }, (reason) => { this.ctx.addEvent2Err = reason; Assert.ok(false, "error for add event2"); }); doAwait(provider.getAllEvents(), (val) => { this.ctx.allEvts = val; Assert.equal(val && val.length, 3, "should have three events"); }, (reason)=> { this.ctx.allEvtsErr = reason; Assert.ok(false, "error for get events"); }); doAwait(provider.clean(), (val) => { this.ctx.cleanEvts = val; Assert.equal(val, true, "should clean events"); }, (reason)=> { this.ctx.cleanEvtsErr = reason; Assert.ok(false, "error for clean"); }); doAwait(provider.getAllEvents(), (val) => { this.ctx.allEvts1 = val; Assert.equal(val && val.length, 1, "should only have one event"); }, (reason)=> { this.ctx.allEvts1Err = reason; Assert.ok(false, "get all events error") }); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { let isInit = this.ctx.isInit; if (isInit) { return true; } return false; }, "Wait for Init response" + new Date().toISOString(), 30, 1000)).concat(PollingAssert.asyncTaskPollingAssert(() => { let items = this.ctx.allEvts; let cnt = 0; if (items && items.length == 3) { arrForEach(items, (item) => { cnt += item.criticalCnt; }) Assert.equal(cnt, 6, "should get expected three events"); return true; } return false; }, "Wait for get Events response" + new Date().toISOString(), 30, 1000)).concat(PollingAssert.asyncTaskPollingAssert(() => { let item = this.ctx.cleanEvts; if (item) { return true; } return false; }, "Wait for clean Events response" + new Date().toISOString(), 30, 1000)).concat(PollingAssert.asyncTaskPollingAssert(() => { let items = this.ctx.allEvts1; if (items) { doAwait(provider.teardown(), () => { this.ctx.isclosed = true; }); return true; } return false; }, "Wait for get Events1 response" + new Date().toISOString(), 30, 1000)).concat(PollingAssert.asyncTaskPollingAssert(() => { let isclosed = this.ctx.isclosed; if (isclosed) { Assert.equal(this.batchDrop.length, 1, "notification should be called once"); Assert.equal(this.batchDrop[0].cnt, 2, "notification should be called with 2 count"); Assert.equal(this.batchDrop[0].reason, 3, "notification should be called with expected reason clean time exceeded"); return true; } return false; }, "Wait for close response" + new Date().toISOString(), 30, 1000)) } }); this.testCase({ name: "IndexedDbProvider: Error handle should handle open errors", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let provider = new IndexedDbProvider(); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({autoClean: true}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint }; let evt = TestHelper.mockEvent(endpoint, 3, false); return this._asyncQueue().add(() => doAwait(provider.initialize(providerCxt), (val) => { this.ctx.isInit = val; let ctx = provider["_getDbgPlgTargets"](); let db = ctx[3]; this.sandbox.stub(db as any, "openDb").callsFake((name, ver, func, change?) => { return createAsyncPromise((resolve, reject)=> { try { let openDbCtx = { openCursor: (var1, var2, var3?) => { return createAsyncRejectedPromise(new Error("open cursor mock error")); }, openStore: (var1, var2, var3) => { return createAsyncRejectedPromise(new Error("open store mock error")); } } // Database has been opened doAwait(func(openDbCtx), resolve, reject); } catch (e) { reject(e); } }); }); }, (reason)=> { this.ctx.initErr = reason; Assert.ok(false, "error for init"); }) ).add(() => { return doAwait(provider.addEvent("", evt, itemCtx), (item) => { this.ctx.evt = item; Assert.ok(false, "should handle add event error"); }, (reason) => { this.ctx.addEvent = reason; Assert.equal(reason.message, "open store mock error", "add event message"); }) }).add(() => { doAwait(provider.getNextBatch(), (val) => { Assert.ok(false, "should handle get next batch error") }, (reason)=> { this.ctx.nextBatch = reason; Assert.equal(reason.message, "open cursor mock error", "get next batch message"); }) }).add(() => { doAwait(provider.getAllEvents(), (val) => { Assert.ok(false, "should handle get all events error") }, (reason)=> { this.ctx.allEvts = reason; Assert.equal(reason.message, "open cursor mock error", "get all events message") }) }).add(() => { doAwait(provider.removeEvents([evt]), (val) => { this.ctx.removeEvts = val; Assert.deepEqual([], val, "should handle remove events error") }, (reason)=> { this.ctx.removeEvtsErr = reason; Assert.ok(false, "error for get next batch"); }) }).add(() => doAwait(provider.clear(), (val) => { this.ctx.clear = val; Assert.deepEqual([], val, "should handle clear error") }, (reason)=> { this.ctx.clearErr = reason; Assert.ok(false, "error for clear"); }) ).add(() => doAwait(provider.clean(), (val) => { this.ctx.clean = val; Assert.ok(!val, "should handle clean error") }, (reason)=> { this.ctx.cleanErr = reason; Assert.ok(false, "error for clean"); }) ).add(() => doAwait(provider.teardown(), () => { this.ctx.isclosed = true; },(reason) => { Assert.ok(false, "teardown error"); }) ) } }); } } class TestHelper { private static _idCount = 0; static reset(key: string) { this._idCount = 0; AITestClass.orgLocalStorage.removeItem(key); } static mockEvent(endPointUrl: string, criticalCnt: number, setId = true): IStorageTelemetryItem { this._idCount++; let time = new Date().getTime(); let random = strSubstr(generateW3CId(), 0, 8); let payload = { urlString: endPointUrl, data: '[{"name":"test1","prop":{"prop1":"prop1"}},{"name":"test1","prop":{"prop1":"prop1"}}]', headers: { "header1": "header1val", "header2": "header2val" }, disableXhrSync: false, disableFetchKeepAlive: false, sendReason: 1, id: setId? random : "", iKey: "testIKey123", criticalCnt: criticalCnt } return payload; } } ================================================ FILE: channels/offline-channel-js/Tests/Unit/src/inmemorybatch.tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import {IPostTransmissionTelemetryItem} from "../../../src/Interfaces/IInMemoryBatch"; import { InMemoryBatch } from "../../../src/InMemoryBatch"; import { DiagnosticLogger, IDiagnosticLogger, arrForEach } from "@microsoft/applicationinsights-core-js"; import { base64Decode, base64Encode, forEachMap, getEndpointDomain, getPersistence } from "../../../src/Helpers/Utils"; import { IStorageTelemetryItem } from "../../../src/Interfaces/IOfflineProvider"; export class OfflineInMemoryBatchTests extends AITestClass { private _logger: IDiagnosticLogger; public testInitialize() { super.testInitialize(); this._logger = new DiagnosticLogger(); } public testCleanup() { super.testCleanup(); this._logger = null as any; } public registerTests() { this.testCase({ name: "Init: Init should contain expected events", test: () => { let endpoint = "testEndpoint"; let inMemoBatch = new InMemoryBatch(this._logger, endpoint); let evts = inMemoBatch.getItems(); Assert.deepEqual(evts, [], "should have no events"); let mockEvt = mockPostTransmissionTelemetryItem(); let evtArr = [mockEvt, mockEvt, mockEvt, mockEvt, mockEvt, mockEvt]; inMemoBatch = new InMemoryBatch(this._logger, endpoint, evtArr); evts = inMemoBatch.getItems(); Assert.deepEqual(evts.length, 6, "should have 6 events"); } }); this.testCase({ name: "Add Event: Add Event with expected event limit ", test: () => { let endpoint = "testEndpoint"; let inMemoBatch = new InMemoryBatch(this._logger, endpoint, undefined, 2); let evts = inMemoBatch.getItems(); Assert.deepEqual(evts, [], "should have no events"); let mockEvt = mockPostTransmissionTelemetryItem(); inMemoBatch.addEvent(mockEvt); inMemoBatch.addEvent(mockEvt); evts = inMemoBatch.getItems(); Assert.deepEqual(evts.length, 2, "should have 2 events"); let isAdded = inMemoBatch.addEvent(mockEvt); Assert.ok(!isAdded, "should not added"); evts = inMemoBatch.getItems(); Assert.deepEqual(evts.length, 2, "should have 2 events test1"); inMemoBatch.clear(); evts = inMemoBatch.getItems(); Assert.deepEqual(evts.length, 0, "should clear events"); } }); this.testCase({ name: "Get domain: get domain from endpoint", test: () => { let testUrl: string[] = [ "test.com", "http://test.com", "https://test.com", "www.test.com", "https://test.com?test", "https://test.com??test", "https://test.com?test?test123" ] let expectedDomain = "test.com"; arrForEach(testUrl, (url) => { let domain = getEndpointDomain(url); Assert.equal(domain, expectedDomain, "should get expected domain"); }); let domain = getEndpointDomain("http://test.us.eu-east.com?warmpth&auth=true"); Assert.equal(domain, "test.us.eu-east.com", "should get expected domain"); } }); this.testCase({ name: "Uint8 tranform: Encode and decode Uint8 array", test: () => { let arr = new Uint8Array([255,255,1,236,45,18]); let str = base64Encode(arr); Assert.equal(str, "MjU1LDI1NSwxLDIzNiw0NSwxOA==", "get expected string") let decode = base64Decode(str); Assert.deepEqual(decode, arr, "should return expected arr") Assert.deepEqual(decode.toString(), arr.toString(), "get expected arr string back"); } }); this.testCase({ name: "Get Persistent Level: Get persistent level from a telemetry item", test: () => { let arr1 = [ null, {}, {name: "test"}, {name: "test", baseData: {prop1: "prop1"}, data: {prop1: "prop1"}}, {name: "test", persistence: 1}, {name: "test", baseData: {persistence: 1, prop1: "prop1"}}, {name: "test", data: {persistence: 1, prop1: "prop1"}}, {name: "test", baseData: {persistence: 1, prop1: "prop1"}, data: {persistence: 2, prop1: "prop1"}}, {name: "test", persistence: 1, baseData: {persistence: 2, prop1: "prop1"}, data: {persistence: 2, prop1: "prop1"}} ]; arrForEach(arr1, (item) => { let level = getPersistence(item as any); Assert.equal(level, 1, "should get expected level"); }); } }); this.testCase({ name: "Util for order map: should get events id in order", test: () => { let arr1 = ["1", "5.1", "2.abc", "6.jdfhhdf", "4.123","8.123"]; let expectedArr = ["2.abc", "4.123", "5.1", "6.jdfhhdf", "8.123", "1"]; let evts: {[key: string]:IStorageTelemetryItem} = {}; let idArr: string[] = []; arrForEach(arr1, (id) => { let evt = mockStorageItem(id); evts[id] = evt; }); forEachMap({}, (val, key) => { idArr.push(key); return true; }, true); forEachMap(evts, (val, key) => { idArr.push(key); return true; }, true); Assert.deepEqual(idArr, expectedArr, "should get expected ordered id array"); } }); } } function mockPostTransmissionTelemetryItem(): IPostTransmissionTelemetryItem { let evt = { ver: "testVer", name:"testName", time: "testTime", iKey:"testKey", sendAttempt: 1, baseData: {pro1: "prop1"} } as IPostTransmissionTelemetryItem; return evt; } function mockStorageItem(id: string): IStorageTelemetryItem { let evt = { id: id, urlString: "testString", data: "testData" } as IStorageTelemetryItem; return evt; } ================================================ FILE: channels/offline-channel-js/Tests/Unit/src/offlinebatchhandler.tests.ts ================================================ import { AITestClass, Assert, PollingAssert } from "@microsoft/ai-test-framework"; import { AppInsightsCore, IConfiguration, IPayloadData, OnCompleteCallback, arrForEach, createDynamicConfig, newGuid } from "@microsoft/applicationinsights-core-js"; import { TestChannel } from "./TestHelper"; import { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH, IConfig } from "@microsoft/applicationinsights-core-js"; import { IOfflineChannelConfiguration, eStorageProviders } from "../../../src/Interfaces/IOfflineProvider"; import { OfflineBatchHandler } from "../../../src/OfflineBatchHandler"; import { createAsyncRejectedPromise, doAwait, doAwaitResponse } from "@nevware21/ts-async"; import { eBatchSendStatus, eBatchStoreStatus } from "../../../src/Interfaces/IOfflineBatch"; export class OfflineBatchHandlerTests extends AITestClass { private core: AppInsightsCore; private coreConfig: IConfig & IConfiguration; private ctx: any; private batchHandler: any; public testInitialize() { super.testInitialize(); let channel = new TestChannel(); this.coreConfig = { instrumentationKey: "testIkey", endpointUrl: "https://testurl.com" }; this.core = new AppInsightsCore(); this.core.initialize(this.coreConfig, [channel]); this.ctx = {}; } public testCleanup() { super.testCleanup(); AITestClass.orgLocalStorage.clear(); this.onDone(() => { this.core.unload(); }); this.core = null as any; this.coreConfig = null as any; } public registerTests() { this.testCase({ name: "Offline Batch Handler: init with web storge provider", test: () => { let storageObj = {providers:[eStorageProviders.LocalStorage, eStorageProviders.SessionStorage], autoClean: true } as IOfflineChannelConfiguration; let storageConfig = createDynamicConfig(storageObj).cfg; let itemCtx = this.core.getProcessTelContext(); let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint:DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH } let batchHandler = new OfflineBatchHandler(); batchHandler.initialize(providerCxt); let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); batchHandler.teardown(); } }); this.testCase({ name: "Offline Batch Handler: init with IndexedDB storge provider", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let storageObj = {providers:[eStorageProviders.IndexedDb], autoClean: true, inStorageMaxTime: 1 } as IOfflineChannelConfiguration; let storageConfig = createDynamicConfig(storageObj).cfg; let itemCtx = this.core.getProcessTelContext(); let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let batchHandler = new OfflineBatchHandler(); return this._asyncQueue().add(() => doAwait(batchHandler.initialize(providerCxt),(res) => { this.ctx.isInit = true; let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); },(reason) => { Assert.ok(false, "init errors"); }) ).add(() => doAwait(batchHandler.teardown(),(res) => { this.ctx.isclosed = true; },(reason) => { Assert.ok(false, "teardown errors"); }) ) } }); this.testCase({ name: "Store Batch: store batch with web storge provider", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let storageObj = {providers:[eStorageProviders.LocalStorage], autoClean: true } as IOfflineChannelConfiguration; let storageConfig = createDynamicConfig(storageObj).cfg; let itemCtx = this.core.getProcessTelContext(); let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let batchHandler = new OfflineBatchHandler(); batchHandler.initialize(providerCxt); this.ctx.isInit = true; this.ctx.handler = batchHandler; let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); let result:any[] = []; let cb = (res) => { result.push(res); } let evt = TestHelper.mockEvent(endpoint, 1, false); return this._asyncQueue().add(() => doAwait(batchHandler.storeBatch(evt, cb) as any,(storeRes) => { this.ctx.storeBatch = true; this.ctx.result = result; let res = result[0]; let state = res.state == eBatchStoreStatus.Success; Assert.ok(state, "state should be ok"); let item = res.item; Assert.ok(item.id, "item id should be set"); Assert.equal(item.criticalCnt, 1, "expected item should be returned"); let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; let storageObject = JSON.parse(storageStr); let storageEvts = storageObject.evts; Assert.deepEqual(Object.keys(storageEvts).length, 1, "storgae should only have one event"); Assert.ok(storageEvts[item.id], "storgae should contain expected item"); }, (reason) => { Assert.ok(false, "init error"); }) ).add(() => doAwait(batchHandler.hasStoredBatch(),(res) => { this.ctx.hasBatch = res; }, (reason) => { Assert.ok(false, "hasStoreBatch error") }) ).add(() => doAwait( batchHandler.teardown(), () => { this.ctx.isclosed = true; },(reason) => { Assert.ok(false, "teardown errors") }) ) } }); this.testCase({ name: "Store Batch: store batch with indexedDB storge provider", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let storageObj = {providers:[eStorageProviders.IndexedDb], autoClean: true, inStorageMaxTime:1} as IOfflineChannelConfiguration; let storageConfig = createDynamicConfig(storageObj).cfg; let itemCtx = this.core.getProcessTelContext(); let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let batchHandler = new OfflineBatchHandler(); let result:any[] = []; let cb = (res) => { this.ctx.storeBatch = true; result.push(res); } let evt = TestHelper.mockEvent(endpoint, 1, false); return this._asyncQueue().add(() => doAwait(batchHandler.initialize(providerCxt),(res) => { this.ctx.isInit = true; let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); },(reason) => { Assert.ok(false, "init errors") }) ).add(() => doAwait(batchHandler.storeBatch(evt, cb) as any,(res) => { this.ctx.storeBatch = true; this.ctx.result = result; }, (reason) => { Assert.ok(false, "storebatch error") }) ).add(() => doAwait(batchHandler.hasStoredBatch(),(res) => { this.ctx.hasBatch = res; }, (reason) => { Assert.ok(false, "hasbatch error"); }) ).add(() => doAwait( batchHandler.teardown(), () => { this.ctx.isclosed = true; }, (reason) => { Assert.ok(false, "teardown error") }) ) } }); this.testCase({ name: "Clean Batch: clean batch with web storge provider", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let storageObj = {providers:[eStorageProviders.LocalStorage], autoClean: true, inStorageMaxTime:1} as IOfflineChannelConfiguration; let storageConfig = createDynamicConfig(storageObj).cfg; let itemCtx = this.core.getProcessTelContext(); let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let batchHandler = new OfflineBatchHandler(); batchHandler.initialize(providerCxt); this.ctx.isInit = true; this.ctx.handler = batchHandler; let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); let result:any[] = []; let cb = (res) => { result.push(res); } let cb1 = (res) => { this.ctx.hasBatch = res; } let cb2 = (res) => { this.ctx.cleanBatch = true; this.ctx.cleanBatchRes = res; } let evt = TestHelper.mockEvent(endpoint, 1, false); let evt1 = TestHelper.mockEvent(endpoint, 2, false); let evt2 = TestHelper.mockEvent(endpoint, 3, false); return this._asyncQueue().add(() => doAwait(batchHandler.storeBatch(evt, cb) as any,(res) => { this.ctx.storeBatch = 1; this.ctx.result = result; },(reason) => { Assert.ok(false, "init errors"); }) ).add(() => doAwait(batchHandler.storeBatch(evt1, cb) as any,(res) => { this.ctx.storeBatch = 2; this.ctx.result = result; },(reason) => { Assert.ok(false, "store batch errors"); }) ).add(() => doAwait(batchHandler.storeBatch(evt2, cb) as any,(res) => { this.ctx.storeBatch = 3; this.ctx.result = result; let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; let storageObject = JSON.parse(storageStr); let storageEvts = storageObject.evts; Assert.deepEqual(Object.keys(storageEvts).length, 3, "storage should have three events"); },(reason) => { Assert.ok(false, "storebatch error") }) ).add(() => doAwait(batchHandler.hasStoredBatch(cb1),(res) => { }, (reason) => { Assert.ok(false, "hasstoredbatch error"); }) ).add(() => doAwait(batchHandler.cleanStorage(cb2) as any,(cleanRes) => { let res = this.ctx.cleanBatchRes; Assert.equal(res.batchCnt, 3, "should clean all three items"); let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; let storageObject = JSON.parse(storageStr); let storageEvts = storageObject.evts; Assert.deepEqual(Object.keys(storageEvts).length, 0, "storgae should not only have any event"); },(reason) => { Assert.ok(false, "clean storage errors") }) ).add(() => doAwait( batchHandler.teardown(), () => { this.ctx.isclosed = true; }, (reason) => { Assert.ok(false, "teardown error") }) ) } }); this.testCase({ name: "Clean Batch: clean batch with IndexedDB storge provider", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let storageObj = {providers:[eStorageProviders.IndexedDb], autoClean: true, inStorageMaxTime:1} as IOfflineChannelConfiguration; let storageConfig = createDynamicConfig(storageObj).cfg; AITestClass.orgLocalStorage.clear(); let itemCtx = this.core.getProcessTelContext(); let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let batchHandler = new OfflineBatchHandler(); let provider; let result:any[] = []; let cb = (res) => { result.push(res); } let cb1 = (res) => { this.ctx.hasBatch = res; } let cb2 = (res) => { this.ctx.cleanBatch = true; this.ctx.cleanBatchRes = res; } let cb3 = (res) => { this.ctx.hasBatch1Called = true; this.ctx.hasBatch1 = res; } let evt = TestHelper.mockEvent(endpoint, 1, false); let evt1 = TestHelper.mockEvent(endpoint, 2, false); let evt2 = TestHelper.mockEvent(endpoint, 3, false); return this._asyncQueue().add(() => doAwait(batchHandler.initialize(providerCxt),(res) => { this.ctx.isInit = true; let items = batchHandler["_getDbgPlgTargets"](); provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); }, (reason) => { Assert.ok(false, "init errors") }) ).add(() => doAwait(batchHandler.storeBatch(evt, cb) as any,(res) => { this.ctx.storeBatch = 1; this.ctx.result = result; }, (reason) => { Assert.ok(false, "store batch errors") }) ).add(() => doAwait(batchHandler.storeBatch(evt1, cb) as any,(res) => { this.ctx.storeBatch = 2; this.ctx.result = result; }, (reason) => { Assert.ok(false, "store batch error 1") }) ).add(() => doAwait(batchHandler.storeBatch(evt2, cb) as any,(res) => { this.ctx.storeBatch = 3; this.ctx.result = result; Assert.equal(result.length, 3, "response should have three items"); }, (reason) => { Assert.ok(false, "store batch error 2") }) ).add(() => doAwait(batchHandler.hasStoredBatch(cb1),(res) => {},(reason) => { Assert.ok(false, "has store batch error") }) ).add(() => doAwait(batchHandler.cleanStorage(cb2) as any,(cleanRes) => { let res = this.ctx.cleanBatchRes; Assert.equal(res.batchCnt, 3, "should clean all three items"); },(reason) => { Assert.ok(false, "clean store batch error") }) ).add(() => doAwait(batchHandler.hasStoredBatch(cb3),(res) => { let hasBatch = this.ctx.hasBatch1; Assert.equal(hasBatch, false, "should not contain any events") },(reason) => { Assert.ok(false, "has store store batch error") }) ).add(() => doAwait(batchHandler.teardown(), () => { this.ctx.isclosed = true; }, (reason) => { Assert.ok(false, "teardown error") }) ) } }); this.testCase({ name: "Send Next Batch: send Next Batch with web storge provider", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let storageObj = {providers:[eStorageProviders.LocalStorage], autoClean: true, senderCfg:{retryCodes: [500]}, maxRetry: 2} as IOfflineChannelConfiguration; let storageConfig = createDynamicConfig(storageObj).cfg; let itemCtx = this.core.getProcessTelContext(); let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let batchHandler = new OfflineBatchHandler(); batchHandler.initialize(providerCxt); this.ctx.isInit = true; this.ctx.handler = batchHandler; let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); let evt = TestHelper.mockEvent(endpoint, 1, false); let evt1 = TestHelper.mockEvent(endpoint, 2, false); let evt2 = TestHelper.mockEvent(endpoint, 3, false); let sender1Payload: any[] = [] let sender1 = (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => { sender1Payload.push(payload); oncomplete(400, {}); } let sender2Payload: any[] = [] let sender2 = (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => { sender2Payload.push(payload); oncomplete(200, {}); } let sender3Payload: any[] = [] let sender3 = (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => { sender3Payload.push(payload); oncomplete(500, {}); } let res1: any[] = []; let cb1 = (res) => { res1.push(res); } let res2: any[] = []; let cb2 = (res) => { res2.push(res); } let res3: any[] = []; let cb3 = (res) => { res3.push(res); } let cb4 = (res) => { this.ctx.hasBatch1Called = true; this.ctx.hasBatch1 = res && res.length >= 1; } return this._asyncQueue().add(() => { doAwait(batchHandler.storeBatch(evt), (res) => { this.ctx.storeBatch = 1; }, (reason) => { Assert.ok(false, "storeBatch 1 error: " + (reason && reason.message)); }); }).add(() => { doAwait(batchHandler.storeBatch(evt1), (res) => { this.ctx.storeBatch = 2; }, (reason) => { Assert.ok(false, "storeBatch 2 error: " + (reason && reason.message)); }); }).add(() => { doAwait(batchHandler.storeBatch(evt2), (res) => { this.ctx.storeBatch = 3; }, (reason) => { Assert.ok(false, "storeBatch 3 error: " + (reason && reason.message)); }); }).add(() => { doAwait(batchHandler.sendNextBatch(cb1, false, {sendPOST: sender1}) as any, (res) => { this.ctx.sendBatch1 = true; this.ctx.sendBatch1Res = res1; this.ctx.sendBatch1Pd = sender1Payload; }, (reason) => { Assert.ok(false, "sendNextBatch 1 error: " + (reason && reason.message)); }); }).add(() => { doAwait(batchHandler.sendNextBatch(cb2, false, {sendPOST: sender2}) as any, (res) => { this.ctx.sendBatch2 = true; this.ctx.sendBatch2Res = res2; this.ctx.sendBatch2Pd = sender2Payload; }, (reason) => { Assert.ok(false, "sendNextBatch 2 error: " + (reason && reason.message)); }); }).add(() => { doAwait(batchHandler.sendNextBatch(cb3, false, {sendPOST: sender3}) as any, (res) => { this.ctx.sendBatch3 = true; this.ctx.sendBatch3Res = res3; this.ctx.sendBatch3Pd = sender3Payload; }, (reason) => { Assert.ok(false, "sendNextBatch 3 error: " + (reason && reason.message)); }); }).add(() => { doAwait(batchHandler.hasStoredBatch(cb4), (res) => { }, (reason) => { Assert.ok(false, "hasStoredBatch error: " + (reason && reason.message)); }); }).add(() => { doAwait(batchHandler.teardown(), () => { this.ctx.isclosed = true; }, (reason) => { Assert.ok(false, "teardown error: " + (reason && reason.message)); }); }) } }); this.testCase({ name: "Send Next Batch: send Next Batch with IndexedDB provider", test: ()=> { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let storageObj = {providers:[eStorageProviders.IndexedDb], autoClean: false, senderCfg:{retryCodes: [500]}, maxRetry: 2} as IOfflineChannelConfiguration; let storageConfig = createDynamicConfig(storageObj).cfg; let itemCtx = this.core.getProcessTelContext(); let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let batchHandler = new OfflineBatchHandler(); batchHandler.initialize(providerCxt); this.ctx.isInit = true; this.ctx.handler = batchHandler; this.batchHandler = batchHandler; let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); let evt = TestHelper.mockEvent(endpoint, 1, false); let evt1 = TestHelper.mockEvent(endpoint, 2, false); let evt2 = TestHelper.mockEvent(endpoint, 3, false); let sender1Payload: any[] = []; let sender1 = (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => { sender1Payload.push(payload); oncomplete(400, {}); }; let res1: any[] = []; let cb1 = (res) => { res1.push(res); }; return this._asyncQueue().add(() => doAwait(batchHandler.storeBatch(evt), (res) => { this.ctx.storeBatch = 1; }, (reason) => { Assert.ok(false, "storeBatch 1 error: " + (reason && reason.message)); }) ).add(() => doAwait(batchHandler.storeBatch(evt1), (res) => { this.ctx.storeBatch = 2; }, (reason) => { Assert.ok(false, "storeBatch 2 error: " + (reason && reason.message)); }) ).add(() => doAwait(batchHandler.storeBatch(evt2), (res) => { this.ctx.storeBatch = 3; }, (reason) => { Assert.ok(false, "storeBatch 3 error: " + (reason && reason.message)); }) ).add(() => doAwaitResponse(batchHandler.sendNextBatch(cb1, false, {sendPOST: sender1}) as any, (res) => { this.ctx.sendBatch1 = true; this.ctx.sendBatch1Res = res1; this.ctx.sendBatch1Pd = sender1Payload; Assert.equal(res.value.state, eBatchSendStatus.Drop, "should have drop status"); doAwaitResponse(provider.getAllEvents(), (res)=> { this.ctx.getAll = true; let val = res.value; Assert.equal(val && val.length, 2, "should have 2 events"); let sentcriticalCnt = res1[0].data.criticalCnt; arrForEach(val, (item) => { Assert.ok(sentcriticalCnt !== item.criticalCnt, "should not contain deleted item"); }); }); }) ) } }); this.testCase({ name: "Send Next Batch: send Next Batch with IndexedDB provider test1 with retry code", test: () => { let batchHandler = this.batchHandler; this.ctx.isInit = true; this.ctx.handler = batchHandler; let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); let sender1Payload: any[] = [] let sender1 = (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => { sender1Payload.push(payload); oncomplete(500, {}); } let res1: any[] = []; let cb1 = (res) => { res1.push(res); } return this._asyncQueue().add(() => doAwaitResponse(batchHandler.sendNextBatch(cb1, false, {sendPOST: sender1}) as any,(res) => { this.ctx.sendBatch1 = true; this.ctx.sendBatch1Res = res1; this.ctx.sendBatch1Pd = sender1Payload; Assert.equal(res.value.state, eBatchSendStatus.Retry, "should have retry status"); }) ).add(()=> doAwaitResponse(provider.getAllEvents(), (res)=> { this.ctx.getAll = true; let val = res.value; Assert.equal(val && val.length, 1, "should have 1 events"); let sentcriticalCnt = res1[0].data.criticalCnt; arrForEach(val, (item) => { Assert.ok(sentcriticalCnt !== item.criticalCnt, "should not contain deleted item"); }); let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; let storageObject = JSON.parse(storageStr); let storageEvts = storageObject.evts; Assert.deepEqual(Object.keys(storageEvts).length, 1, "storgae should only have one event"); }) ) } }); this.testCase({ name: "Send Next Batch: send Next Batch with IndexedDB provider test1 with 200", test: () => { let batchHandler = this.batchHandler; this.ctx.isInit = true; this.ctx.handler = batchHandler; let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); let sender1Payload: any[] = [] let sender1 = (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => { sender1Payload.push(payload); oncomplete(200, {}); } let res1: any[] = []; let cb1 = (res) => { res1.push(res); } return this._asyncQueue().add(() => doAwaitResponse(batchHandler.sendNextBatch(cb1, false, {sendPOST: sender1}) as any,(res) => { this.ctx.sendBatch1 = true; this.ctx.sendBatch1Res = res1; this.ctx.sendBatch1Pd = sender1Payload; Assert.equal(res.value.state, eBatchSendStatus.Complete, "should have complete status"); }) ).add(() => doAwaitResponse(provider.getAllEvents(), (res)=> { this.ctx.getAll = true; let val = res.value; Assert.equal(val && val.length, 0, "should have 0 events"); let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; Assert.deepEqual(storageStr, null, "storgae should not have one event"); }) ) } }); this.testCase({ name: "Send Next Batch: send Next Batch with IndexedDB provider test1 with unload events", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageObj = {providers:[eStorageProviders.LocalStorage], autoClean: true, senderCfg:{retryCodes: [500]}, maxRetry: 2} as IOfflineChannelConfiguration; let storageConfig = createDynamicConfig(storageObj).cfg; let itemCtx = this.core.getProcessTelContext(); let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let unloadHandler = new OfflineBatchHandler(); unloadHandler.initialize(providerCxt); let evt = TestHelper.mockEvent(endpoint, 1, false); unloadHandler.storeBatch(evt); // add events to local storage let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; Assert.ok(storageStr, "storage should have one event"); let batchHandler = this.batchHandler; this.ctx.isInit = true; this.ctx.handler = batchHandler; let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); let sender1Payload: any[] = [] let sender1 = (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => { sender1Payload.push(payload); oncomplete(200, {}); } let res1: any[] = []; let cb1 = (res) => { res1.push(res); } return this._asyncQueue().add(() => doAwaitResponse(batchHandler.sendNextBatch(cb1, false, {sendPOST: sender1}) as any,(res) => { this.ctx.sendBatch1 = true; this.ctx.sendBatch1Res = res1; this.ctx.sendBatch1Pd = sender1Payload; Assert.equal(res.value.state, eBatchSendStatus.Complete, "should have complete status"); Assert.equal(res.value.data.id, evt.id, "should have expected event"); }) ).add(() => doAwaitResponse(provider.getAllEvents(), (res)=> { this.ctx.getAll = true; let val = res.value; Assert.equal(val && val.length, 0, "should have 0 events"); let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; let evts = JSON.parse(storageStr).evts; Assert.deepEqual(evts, {}, "storage should not have one event"); }) ) } }); this.testCase({ name: "Send Next Batch: Error handle store batch", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let storageObj = {providers:[eStorageProviders.LocalStorage], autoClean: true, senderCfg:{retryCodes: [500]}, maxRetry: 2} as IOfflineChannelConfiguration; let storageConfig = createDynamicConfig(storageObj).cfg; let itemCtx = this.core.getProcessTelContext(); let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let batchHandler = new OfflineBatchHandler(); batchHandler.initialize(providerCxt); let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); let res1: any[] = []; let cb1 = (res) => { res1.push(res); } this.sandbox.stub((provider) as any, "addEvent").callsFake((key) => { return createAsyncRejectedPromise(new Error ("add event mock error")); }); let evt = TestHelper.mockEvent(endpoint, 1, false); doAwaitResponse(batchHandler.storeBatch(evt, cb1),(res) => { this.ctx.storeBatch = true; if (res.rejected) { Assert.ok(false, "error should be catched"); return; } let item = res.value; Assert.equal(item?.state, eBatchStoreStatus.Failure, "should have expected state"); Assert.equal(item?.item.message, "add event mock error" , "should have expected message"); Assert.equal(res1.length, 1, "should call callback"); Assert.equal(res1[0].state, item?.state, "should call callback with expected response"); }) return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { let item = this.ctx.storeBatch; if (item) { return true; } return false; }, "Wait for store batch response" + new Date().toISOString(), 15, 1000)) } }); this.testCase({ name: "Send Next Batch: Error handle clean batch", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let storageObj = {providers:[eStorageProviders.LocalStorage], autoClean: true, senderCfg:{retryCodes: [500]}, maxRetry: 2} as IOfflineChannelConfiguration; let storageConfig = createDynamicConfig(storageObj).cfg; let itemCtx = this.core.getProcessTelContext(); let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let batchHandler = new OfflineBatchHandler(); batchHandler.initialize(providerCxt); let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); let res1: any[] = []; let cb1 = (res) => { res1.push(res); } this.sandbox.stub((provider) as any, "clear").callsFake((key) => { return createAsyncRejectedPromise(new Error ("clear mock error")); }); doAwaitResponse(batchHandler.cleanStorage(cb1),(res) => { this.ctx.clearBatch = true; if (res.rejected) { Assert.ok(false, "error should be catched"); return; } let item = res.value; Assert.equal(item?.batchCnt, 0, "should have expected state"); Assert.equal(res1.length, 1, "should call callback"); Assert.equal(res1[0].batchCnt, item?.batchCnt, "should call callback with expected response"); batchHandler.teardown(); }); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { let item = this.ctx.clearBatch; if (item) { return true; } return false; }, "Wait for clear batch response" + new Date().toISOString(), 15, 1000)) } }); this.testCase({ name: "Send Next Batch: Error handle add batch with remove error", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let storageObj = {providers:[eStorageProviders.LocalStorage], autoClean: true, senderCfg:{retryCodes: [500]}, maxRetry: 2} as IOfflineChannelConfiguration; let storageConfig = createDynamicConfig(storageObj).cfg; let itemCtx = this.core.getProcessTelContext(); let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let batchHandler = new OfflineBatchHandler(); batchHandler.initialize(providerCxt); let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); let evt = TestHelper.mockEvent(endpoint, 1, false); batchHandler.storeBatch(evt); this.sandbox.stub((provider) as any, "removeEvents").callsFake((key) => { return createAsyncRejectedPromise(new Error ("remove mock error")); }); let sender1Payload: any[] = [] let sender1 = (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => { sender1Payload.push(payload); oncomplete(200, {}); } let res1: any[] = []; let cb1 = (res) => { res1.push(res); } doAwaitResponse(batchHandler.sendNextBatch(cb1, false, {sendPOST: sender1}),(res) => { this.ctx.addBatch = true; if (res.rejected) { Assert.ok(false, "error should be catched"); Assert.equal(res.reason.message, "error should be catched"); return; } let item = res.value; Assert.equal(item?.state, eBatchSendStatus.Failure, "should have expected state"); Assert.equal(item?.data.message, "remove mock error" , "should have expected message"); Assert.equal(res1.length, 1, "should call callback"); Assert.equal(res1[0].state, item?.state, "should call callback with expected response"); batchHandler.teardown(); }); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { let item = this.ctx.addBatch; if (item) { return true; } return false; }, "Wait for add batch response" + new Date().toISOString(), 15, 1000)) } }); this.testCase({ name: "Send Next Batch: Error handle add batch", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let storageObj = {providers:[eStorageProviders.LocalStorage], autoClean: true, senderCfg:{retryCodes: [500]}, maxRetry: 2} as IOfflineChannelConfiguration; let storageConfig = createDynamicConfig(storageObj).cfg; let itemCtx = this.core.getProcessTelContext(); let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let batchHandler = new OfflineBatchHandler(); batchHandler.initialize(providerCxt); let items = batchHandler["_getDbgPlgTargets"](); let provider = items[0]; let isInit = items[1]; Assert.ok(provider, "provider is initialized"); Assert.ok(isInit, "initialization is successful"); let sender1Payload: any[] = [] let sender1 = (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => { sender1Payload.push(payload); oncomplete(200, {}); } let res1: any[] = []; let cb1 = (res) => { res1.push(res); } this.sandbox.stub((provider) as any, "getNextBatch").callsFake((key) => { return createAsyncRejectedPromise(new Error ("get mock error")); }); doAwaitResponse(batchHandler.sendNextBatch(cb1, false, {sendPOST: sender1}),(res) => { this.ctx.getBatch = true; if (res.rejected) { Assert.ok(false, "error should be catched test1"); return; } let item = res.value; Assert.equal(item?.state, eBatchSendStatus.Failure, "should have expected state"); Assert.equal(item?.data.message, "get mock error" , "should have expected message"); Assert.equal(res1.length, 1, "should call callback again"); Assert.equal(res1[0].state, item?.state, "should call callback with expected response"); batchHandler.teardown(); }); return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => { let item = this.ctx.getBatch; if (item) { return true; } return false; }, "Wait for get batch response" + new Date().toISOString(), 15, 1000)) } }); } } class TestHelper { private static _idCount = 0; static reset(key: string) { this._idCount = 0; AITestClass.orgLocalStorage.removeItem(key); } static mockEvent(endPointUrl: string, criticalCnt: number, setId = true) { this._idCount++; let payload = { urlString: endPointUrl, data: '[{"name":"test1","prop":{"prop1":"prop1"}},{"name":"test1","prop":{"prop1":"prop1"}}]', headers: { "header1": "header1val", "header2": "header2val" }, disableXhrSync: false, disableFetchKeepAlive: false, sendReason: 1, id: setId? newGuid() : "", iKey: "testIKey", criticalCnt: criticalCnt } return payload; } } ================================================ FILE: channels/offline-channel-js/Tests/Unit/src/offlinechannel.tests.ts ================================================ import { OfflineIndexedDBTests } from "./IndexedDB.tests"; import { OfflineWebProviderTests } from "./webprovider.tests"; import { OfflineDbProviderTests } from "./dbprovider.tests" import { OfflineInMemoryBatchTests } from "./inmemorybatch.tests"; import { OfflineBatchHandlerTests } from "./offlinebatchhandler.tests"; import { ChannelTests } from "./channel.tests"; import { Offlinetimer } from "./offlinetimer.tests"; import { GlobalTestHooks } from "./GlobalTestHooks.Test"; import { OfflineCustomProviderTests } from "./customprovider.tests"; export function runTests() { new GlobalTestHooks().registerTests(); new OfflineIndexedDBTests().registerTests(); new OfflineWebProviderTests().registerTests(); new OfflineDbProviderTests().registerTests(); new OfflineInMemoryBatchTests().registerTests(); new ChannelTests().registerTests(); new OfflineBatchHandlerTests().registerTests(); new Offlinetimer().registerTests(); new OfflineCustomProviderTests().registerTests(); } ================================================ FILE: channels/offline-channel-js/Tests/Unit/src/offlinetimer.tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH, EventPersistence, IConfig } from "@microsoft/applicationinsights-core-js"; import { AppInsightsCore, IConfiguration, IPayloadData, OnCompleteCallback } from "@microsoft/applicationinsights-core-js"; import { TestChannel, mockTelemetryItem } from "./TestHelper"; import { OfflineChannel } from "../../../src/OfflineChannel"; import { IOfflineChannelConfiguration, eStorageProviders } from "../../../src/Interfaces/IOfflineProvider"; import { IPostTransmissionTelemetryItem } from "../../../src/applicationinsights-offlinechannel-js"; export class Offlinetimer extends AITestClass { private core: AppInsightsCore; private coreConfig: IConfig & IConfiguration; public testInitialize() { super.testInitialize(); AITestClass.orgLocalStorage.clear(); this.coreConfig = { instrumentationKey: "testIkey", endpointUrl: DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH }; this.core = new AppInsightsCore(); } public testCleanup() { super.testCleanup(); AITestClass.orgLocalStorage.clear(); this.onDone(() => { this.core.unload(); }); this.core = null as any; this.coreConfig = null as any; } public registerTests() { this.testCase({ name: "InMemo Timer: Handle in memory timer", useFakeTimers: true, test: () => { this.coreConfig.extensionConfig = {["OfflineChannel"]: {providers:[eStorageProviders.LocalStorage], inMemoMaxTime: 2000, minPersistenceLevel: EventPersistence.Critical, eventsLimitInMem: 2 } as IOfflineChannelConfiguration}; let channel = new OfflineChannel(); let onlineChannel = new TestChannel(); this.core.initialize(this.coreConfig,[channel, onlineChannel]); this.clock.tick(1); let offlineListener = channel.getOfflineListener() as any; // online, processTelemetry is not called offlineListener.setOnlineState(1); let inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer, "in memo timer should be null"); // offline, processTelemetry is not called offlineListener.setOnlineState(2); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer, "in memo timer should be null test1"); // online, processTelemetry is called offlineListener.setOnlineState(1); let evt = mockTelemetryItem(); channel.processTelemetry(evt); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer, "in memo timer should be null test2"); // offline, processTelemetry is called with event that should not be sent offlineListener.setOnlineState(2); evt = mockTelemetryItem(); channel.processTelemetry(evt); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer, "in memo timer should be null test3"); // offline, processTelemetry is called with event that should be sent offlineListener.setOnlineState(2); let validEvt = mockTelemetryItem() as IPostTransmissionTelemetryItem; validEvt.persistence = 2; channel.processTelemetry(validEvt); channel.processTelemetry(validEvt); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(inMemoTimer, "in memo timer should be created"); Assert.ok(inMemoTimer.enabled, "in memo timer should be enabled"); let inMemoMap = channel["_getDbgPlgTargets"]()[1]; let inMemoBatch = inMemoMap[EventPersistence.Normal]; //let inMemoBatch = channel["_getDbgPlgTargets"]()[1]; Assert.equal(inMemoBatch && inMemoBatch.count(), 2, "should have two events"); // offline, flush all events in memory, and processTelemetry is not called again this.clock.tick(2000); //inMemoBatch = channel["_getDbgPlgTargets"]()[1]; inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch && inMemoBatch.count(), 0, "should have no event left"); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer.enabled, "in memo timer enabled should be false with no events in memory"); this.clock.tick(2000); //inMemoBatch = channel["_getDbgPlgTargets"]()[1]; inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch && inMemoBatch.count(), 0, "should have no event left"); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer.enabled, "in memo timer enabled should be false with no events in memory and no processTelemtry is called"); // offline, flush all events and with one event left in memory, and processTelemetry is not called again channel.processTelemetry(validEvt); channel.processTelemetry(validEvt); channel.processTelemetry(validEvt); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(inMemoTimer.enabled, "in memo timer should be enabled"); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; //inMemoBatch = channel["_getDbgPlgTargets"]()[1]; Assert.equal(inMemoBatch && inMemoBatch.count(), 1, "should have one event left after flush"); this.clock.tick(2000); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; //inMemoBatch = channel["_getDbgPlgTargets"]()[1]; Assert.equal(inMemoBatch && inMemoBatch.count(), 0, "should have no event left"); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer.enabled, "in memo timer should be canceld with no events in memory test1"); // offline with one event saved in memory, and then online with processTelemetry called channel.processTelemetry(validEvt); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(inMemoTimer.enabled, "in memo timer should be enabled"); //inMemoBatch = channel["_getDbgPlgTargets"]()[1]; inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch && inMemoBatch.count(), 1, "should have one event left after flush"); offlineListener.setOnlineState(1); this.clock.tick(2000); //inMemoBatch = channel["_getDbgPlgTargets"]()[1]; inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch && inMemoBatch.count(), 0, "should have no event left"); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer.enabled, "in memo timer should be canceld with no events in memory test2"); channel.processTelemetry(validEvt); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer.enabled, "in memo timer should be canceld when back online"); channel.teardown(); } }); this.testCase({ name: "InMemo Timer: Handle in memory timer with splitEvts set to true", useFakeTimers: true, test: () => { this.coreConfig.extensionConfig = {["OfflineChannel"]: {providers:[eStorageProviders.LocalStorage], inMemoMaxTime: 2000, eventsLimitInMem: 1, splitEvts: true } as IOfflineChannelConfiguration}; let channel = new OfflineChannel(); let onlineChannel = new TestChannel(); this.core.initialize(this.coreConfig,[channel, onlineChannel]); this.clock.tick(1); let offlineListener = channel.getOfflineListener() as any; // online, processTelemetry is not called offlineListener.setOnlineState(1); let inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer, "in memo timer should be null"); // offline, processTelemetry is not called offlineListener.setOnlineState(2); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer, "in memo timer should be null test1"); // online, processTelemetry is called offlineListener.setOnlineState(1); let evt = mockTelemetryItem(); channel.processTelemetry(evt); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer, "in memo timer should be null test2"); // offline, processTelemetry is called with normal event offlineListener.setOnlineState(2); evt = mockTelemetryItem(); channel.processTelemetry(evt); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(inMemoTimer, "in memo timer should be created test3"); Assert.ok(inMemoTimer.enabled, "in memo timer should be enabled test1"); let inMemoMap = channel["_getDbgPlgTargets"]()[1]; let inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch && inMemoBatch.count(), 1, "should have one normal event"); // offline, processTelemetry is called with critical event offlineListener.setOnlineState(2); let criticalEvt = mockTelemetryItem(2) as IPostTransmissionTelemetryItem; channel.processTelemetry(criticalEvt); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(inMemoTimer, "in memo timer should be not null"); Assert.ok(inMemoTimer.enabled, "in memo timer should be enabled test2"); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Critical]; Assert.equal(inMemoBatch && inMemoBatch.count(), 1, "should have one critical event"); // offline, processTelemetry is called with normal event again offlineListener.setOnlineState(2); evt = mockTelemetryItem(); channel.processTelemetry(evt); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(inMemoTimer, "in memo timer should not be null test1"); Assert.ok(inMemoTimer.enabled, "in memo timer should be enabled test2"); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch && inMemoBatch.count(), 1, "should have one normal event test1"); inMemoBatch = inMemoMap[EventPersistence.Critical]; Assert.equal(inMemoBatch && inMemoBatch.count(), 1, "should have one critical event test1"); // offline, flush all events in memory, and processTelemetry is not called again this.clock.tick(2000); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch && inMemoBatch.count(), 0, "should have no noraml event left"); inMemoBatch = inMemoMap[EventPersistence.Critical]; Assert.equal(inMemoBatch && inMemoBatch.count(), 0, "should have no critical event left"); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer.enabled, "in memo timer enabled should be false with no events in memory"); this.clock.tick(2000); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch && inMemoBatch.count(), 0, "should have no noraml event left test1"); inMemoBatch = inMemoMap[EventPersistence.Critical]; Assert.equal(inMemoBatch && inMemoBatch.count(), 0, "should have no critical event left tes1 "); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer.enabled, "in memo timer enabled should be false with no events in memory"); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer.enabled, "in memo timer enabled should be false with no events in memory and no processTelemtry is called"); // offline with one normal event saved in memory, and then online with processTelemetry called channel.processTelemetry(evt); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(inMemoTimer.enabled, "in memo timer should be enabled"); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch && inMemoBatch.count(), 1, "should have one normal event left test1"); offlineListener.setOnlineState(1); this.clock.tick(2000); inMemoMap = channel["_getDbgPlgTargets"]()[1]; inMemoBatch = inMemoMap[EventPersistence.Normal]; Assert.equal(inMemoBatch && inMemoBatch.count(), 0, "should have no event left test1"); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer.enabled, "in memo timer should be canceld with no events in memory test2"); channel.processTelemetry(evt); inMemoTimer = channel["_getDbgPlgTargets"]()[3]; Assert.ok(!inMemoTimer.enabled, "in memo timer should be canceld when back online"); channel.teardown(); } }); this.testCase({ name: "SendNextBatch Timer: Timer should resume sending after offline-to-online transition", useFakeTimers: true, test: () => { let sendCalled = 0; let sendPost = (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => { sendCalled++; oncomplete(200, {}); return; } let xhrOverride = {sendPOST: sendPost} this.coreConfig.extensionConfig = {["OfflineChannel"]: { providers:[eStorageProviders.LocalStorage], inMemoMaxTime: 2000, eventsLimitInMem: 2, maxSentBatchInterval: 10000, senderCfg: {httpXHROverride: xhrOverride, alwaysUseXhrOverride: true} } as IOfflineChannelConfiguration}; let channel = new OfflineChannel(); let onlineChannel = new TestChannel(); onlineChannel.setIsIdle(true); this.core.initialize(this.coreConfig,[channel, onlineChannel]); let offlineListener = channel.getOfflineListener() as any; // Start offline offlineListener.setOnlineState(2); this.clock.tick(1); // Verify timer is still enabled while offline let sendBatchTimer = channel["_getDbgPlgTargets"]()[4]; Assert.ok(sendBatchTimer.enabled, "Timer should be initially enabled even when offline"); Assert.equal(sendCalled, 0, "No data should be sent while offline"); // Add events while offline let evt = mockTelemetryItem() as IPostTransmissionTelemetryItem; evt.persistence = EventPersistence.Critical; channel.processTelemetry(evt); channel.processTelemetry(evt); // Flush to storage this.clock.tick(10000); // Timer should be disabled after send attempt sendBatchTimer = channel["_getDbgPlgTargets"]()[4]; Assert.ok(!sendBatchTimer.enabled, "Timer should be disabled after send attempt"); Assert.equal(sendCalled, 0, "No data should be sent while offline"); // Transition from offline to online - this triggers the bug offlineListener.setOnlineState(1); // Timer should be enabled after going online sendBatchTimer = channel["_getDbgPlgTargets"]()[4]; Assert.ok(sendBatchTimer, "Timer should exist after going online"); Assert.ok(sendBatchTimer.enabled, "Timer should be enabled after going online"); // Wait for timer to fire this.clock.tick(10000); // BUG: The timer callback still thinks we're offline due to stale closure // so it cancels itself and doesn't send data sendBatchTimer = channel["_getDbgPlgTargets"]()[4]; // This assertion will fail with the bug - timer gets cancelled Assert.ok(sendBatchTimer.enabled, "Timer should still be enabled and continue sending batches"); // This assertion will fail with the bug - no data gets sent Assert.ok(sendCalled > 0, "Data should be sent after going online"); channel.teardown(); } }); this.testCase({ name: "SendNextBatch Timer: Handle sendNextBatch timer", useFakeTimers: true, test: () => { let called = 0; let sendPost = (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => { // first call, return complete, data null; called ++; oncomplete(200, {}); return; } let xhrOverride = {sendPOST: sendPost} this.coreConfig.extensionConfig = {["OfflineChannel"]: {providers:[eStorageProviders.LocalStorage], inMemoMaxTime: 2000, eventsLimitInMem: 2, maxSentBatchInterval: 10000, senderCfg: {httpXHROverride: xhrOverride, alwaysUseXhrOverride: true} } as IOfflineChannelConfiguration}; let channel = new OfflineChannel(); let onlineChannel = new TestChannel(); this.core.initialize(this.coreConfig,[channel, onlineChannel]); this.clock.tick(1); let offlineListener = channel.getOfflineListener() as any; // online, processTelemetry is not called offlineListener.setOnlineState(1); let sendBatchTimer = channel["_getDbgPlgTargets"]()[4]; Assert.ok(sendBatchTimer, "sendBatch timer should be created after init"); Assert.ok(sendBatchTimer.enabled, "sendBatch timer should be enabled"); // online, processTelemetry is not called, no previous stored events returned this.clock.tick(10000); sendBatchTimer = channel["_getDbgPlgTargets"]()[4]; Assert.ok(!sendBatchTimer.enabled, "sendBatch timer should not start again with no events in storage"); // online, processTelemetry called, no previous stored events returned this.clock.tick(10000); let evt = mockTelemetryItem() as IPostTransmissionTelemetryItem; evt.persistence = 2; channel.processTelemetry(evt); sendBatchTimer = channel["_getDbgPlgTargets"]()[4]; Assert.ok(!sendBatchTimer.enabled, "sendBatch timer should not start again with no events in storage test1"); Assert.equal(called, 0 , "no data is sent"); // offline, processTelemetry is not called offlineListener.setOnlineState(2); this.clock.tick(10000); sendBatchTimer = channel["_getDbgPlgTargets"]()[4]; Assert.ok(!sendBatchTimer.enabled, "sendBatch timer should not start again with no events in storage test2"); Assert.equal(called, 0 , "no data is sent"); // offline, processTelemetry is called, in Memory flush called channel.processTelemetry(evt); channel.processTelemetry(evt); this.clock.tick(10000); sendBatchTimer = channel["_getDbgPlgTargets"]()[4]; Assert.ok(!sendBatchTimer.enabled, "sendBatch timer should not start again with no events in storage test3"); Assert.equal(called, 0 , "no data is sent"); // online, with online sender is not idle offlineListener.setOnlineState(1); onlineChannel.setIsIdle(false); channel.processTelemetry(evt); this.clock.tick(10000); sendBatchTimer = channel["_getDbgPlgTargets"]()[4]; Assert.ok(sendBatchTimer.enabled, "sendBatch timer be refreshed when it is online and not idle"); Assert.equal(called, 0 , "no data is sent"); // online, with online sender is idle offlineListener.setOnlineState(1); onlineChannel.setIsIdle(true); channel.processTelemetry(evt); this.clock.tick(10000); sendBatchTimer = channel["_getDbgPlgTargets"]()[4]; Assert.ok(sendBatchTimer.enabled, "sendBatch timer be refreshed when it is online and idle"); Assert.equal(called, 1 , "data is sent"); // online, with processTelemtry called again offlineListener.setOnlineState(1); channel.processTelemetry(evt); this.clock.tick(10000); sendBatchTimer = channel["_getDbgPlgTargets"]()[4]; Assert.ok(!sendBatchTimer.enabled, "sendBatch timer not be refreshed when it is online and no stored events"); Assert.equal(called, 1 , "no data is sent again"); channel.teardown(); } }); } } ================================================ FILE: channels/offline-channel-js/Tests/Unit/src/webprovider.tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { AppInsightsCore, IConfiguration, arrForEach, createDynamicConfig, eBatchDiscardedReason, generateW3CId, isArray } from "@microsoft/applicationinsights-core-js"; import { WebStorageProvider } from "../../../src/Providers/WebStorageProvider"; import { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH, IConfig } from "@microsoft/applicationinsights-core-js"; import { TestChannel } from "./TestHelper"; import { IOfflineChannelConfiguration, IStorageTelemetryItem } from "../../../src/Interfaces/IOfflineProvider"; import { doAwaitResponse } from "@nevware21/ts-async"; import { strSubstr } from "@nevware21/ts-utils"; export class OfflineWebProviderTests extends AITestClass { private core: AppInsightsCore; private coreConfig: IConfig & IConfiguration; private batchDrop: any; public testInitialize() { super.testInitialize(); AITestClass.orgLocalStorage.clear(); let channel = new TestChannel(); this.coreConfig = { instrumentationKey: "testIkey", endpointUrl: "https://testurl.com" }; this.core = new AppInsightsCore(); this.core.initialize(this.coreConfig, [channel]); this.batchDrop = []; } public testCleanup() { super.testCleanup(); AITestClass.orgLocalStorage.clear(); this.onDone(() => { this.core.unload(); }); this.core = null as any; this.coreConfig = null as any; this.batchDrop = []; } public registerTests() { this.testCase({ name: "Web local Storage Provider: Init with storage available", test: () => { let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint:DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); let ctx = provider["_getDbgPlgTargets"](); let expectedStorageKey = "AIOffline_1_dc.services.visualstudio.com"; Assert.equal(ctx[0], expectedStorageKey, "should have expected storage"); let expectedMaxStorage = 5000000; Assert.equal(ctx[1], expectedMaxStorage, "default MaxStorage is set"); Assert.ok(provider.supportsSyncRequests(), "support sync should be set to true"); } }); this.testCase({ name: "Web local Storage Provider: Init with no storage available", test: () => { let provider = new WebStorageProvider("testStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint:DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH } let isInit = provider.initialize(providerCxt); Assert.ok(!isInit, "init process should return false"); } }); this.testCase({ name: "Web local Storage Provider: Init with expected config", test: () => { let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({ autoClean: true, maxStorageSizeInBytes: 1000, inStorageMaxTime: 3600, storageKeyPrefix: "testPrefix" } as IOfflineChannelConfiguration).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint:DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process should return true"); let ctx = provider["_getDbgPlgTargets"](); let expectedStorageKey = "testPrefix_1_dc.services.visualstudio.com"; Assert.equal(ctx[0], expectedStorageKey, "should have expected storage"); let expectedMaxStorage = 1000; Assert.equal(ctx[1], expectedMaxStorage, "default MaxStorage is set"); let expectedMaxTime = 3600; Assert.equal(ctx[2], expectedMaxTime, "default MaxStorageTime is set"); Assert.ok(provider.supportsSyncRequests(), "support sync should be set to true"); } }); this.testCase({ name: "Web local Storage Provider: getNextBatch with no old events", test: () => { let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint:DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); let evts = provider.getNextBatch(); Assert.deepEqual(evts, [], "should have no stored events and return array"); } }); this.testCase({ name: "Web local Storage Provider: getNextBatch with old events", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let expectedStorageKey = "AIOffline_1_dc.services.visualstudio.com"; let evt = TestHelper.mockEvent(endpoint, 3); let jsonObj = TestHelper.mockStorageJSON(evt); let evtStr = JSON.stringify(jsonObj); AITestClass.orgLocalStorage.setItem(expectedStorageKey, evtStr); let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); let ctx = provider["_getDbgPlgTargets"](); Assert.equal(ctx[0], expectedStorageKey, "should have expected storage"); let evts = provider.getNextBatch(); Assert.deepEqual(evts, [evt], "should have one stored event"); } }); this.testCase({ name: "Web local Storage Provider: getNextBatch should return expected number of events", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let expectedStorageKey = "AIOffline_1_dc.services.visualstudio.com"; let evt = TestHelper.mockEvent(endpoint, 3); let evt1 = TestHelper.mockEvent(endpoint, 2); let evt2 = TestHelper.mockEvent(endpoint, 1); let jsonObj = TestHelper.mockStorageJSON([evt, evt1, evt2]); let evtStr = JSON.stringify(jsonObj); AITestClass.orgLocalStorage.setItem(expectedStorageKey, evtStr); let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); let ctx = provider["_getDbgPlgTargets"](); Assert.equal(ctx[0], expectedStorageKey, "should have expected storage"); let evts = provider.getNextBatch(); Assert.deepEqual(evts, [evt], "should have one stored event"); } }); this.testCase({ name: "Web local Storage Provider: getNextBatch should handle errors", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let expectedStorageKey = "AIOffline_1_dc.services.visualstudio.com"; this.sandbox.stub((window.localStorage) as any, "getItem").callsFake((key) => { throw new Error("test error"); }); let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); let ctx = provider["_getDbgPlgTargets"](); Assert.equal(ctx[0], expectedStorageKey, "should have expected storage"); doAwaitResponse(provider.getNextBatch(), (res) => { if (res.reason) { Assert.ok(true, "error promise created"); Assert.equal(res.reason.message, "test error", "should create expected promise"); } else { Assert.ok(false, "should create promise error"); } }); } }); this.testCase({ name: "Web local Storage Provider: getNextBatch should return null when no storage available", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let provider = new WebStorageProvider("testStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let isInit = provider.initialize(providerCxt); Assert.ok(!isInit, "init process is expected"); let ctx = provider["_getDbgPlgTargets"](); Assert.equal(ctx[0], undefined, "should have expected storage"); doAwaitResponse(provider.getNextBatch(), (res) => { if (!res.rejected) { Assert.ok(true, "response returned"); Assert.equal(res.value, null, "should return null"); } else { Assert.ok(false, "should return successful response"); } }); } }); this.testCase({ name: "Web local Storage Provider: addEvent should set default id when it is not provided", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let evt = TestHelper.mockEvent(endpoint, 3, false); let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); let addedEvt = provider.addEvent("", evt, itemCtx); Assert.ok(addedEvt, "evt should be added"); let id = addedEvt && (addedEvt as any).id; Assert.ok(id, "evt id should be set"); Assert.ok(id.indexOf(".") > -1, "evt id should be set with time"); let evts = provider.getAllEvents(); Assert.deepEqual(evts, [evt], "should have the expected stored event"); let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; let storageObj = JSON.parse(storageStr).evts; Assert.deepEqual(Object.keys(storageObj).length, 1, "storgae should have expected events"); } }); this.testCase({ name: "Web local Storage Provider: addEvent should add expected events", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let evt = TestHelper.mockEvent(endpoint, 3); let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); let addedEvt = provider.addEvent("", evt, itemCtx); Assert.ok(addedEvt, "evt should be added"); let evts = provider.getAllEvents(); Assert.deepEqual(evts, [evt], "should have the expected stored event"); let evt1 = TestHelper.mockEvent(endpoint, 2); let addedEvt1 = provider.addEvent("", evt1, itemCtx); Assert.ok(addedEvt1, "evt should be added test1"); evts = provider.getAllEvents() as any[]; Assert.deepEqual(JSON.stringify(evts), JSON.stringify([evt, evt1]), "should have the expected stored event test1"); let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; let storageObj = JSON.parse(storageStr).evts; Assert.deepEqual(Object.keys(storageObj).length, 2, "storgae should have expected two events"); } }); this.testCase({ name: "Web local Storage Provider: addEvent should handle errors", test: () => { this.core.addNotificationListener({ offlineBatchDrop: (cnt, reason)=> { this.batchDrop.push({cnt: cnt, reason: reason}); } }); let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({EventsToDropPerTime: 2}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint, notificationMgr: this.core.getNotifyMgr() } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); let evt = TestHelper.mockEvent(endpoint, 3, true); let addedEvt = provider.addEvent("", evt, itemCtx); Assert.ok(addedEvt, "evt should be added"); let evt1 = TestHelper.mockEvent(endpoint, 2, true); let addedEvt1 = provider.addEvent("", evt1, itemCtx); Assert.ok(addedEvt1, "evt1 should be added"); let evt2 = TestHelper.mockEvent(endpoint, 1, true); let addedEvt2 = provider.addEvent("", evt2, itemCtx); Assert.ok(addedEvt2, "evt2 should be added"); let evt3 = TestHelper.mockEvent(endpoint, 0, true); let addedEvt3 = provider.addEvent("", evt3, itemCtx); Assert.ok(addedEvt3, "evt3 should be added"); let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; let storageObj = JSON.parse(storageStr).evts; Assert.deepEqual(Object.keys(storageObj).length, 4, "storage should have expected four events"); let called = -1; let evts: any[] = [] this.sandbox.stub((window.localStorage) as any, "setItem").callsFake((key, val) => { evts.push(val); called += 1; if (called == 1) { return; } throw new Error("test error"); }); let evt4 = TestHelper.mockEvent(endpoint, 5, true); let addedEvt4 = provider.addEvent("", evt4, itemCtx); Assert.equal(evts.length, 2, "should be called two times"); // notification should be triggered here let jsonObj = JSON.parse(evts[1]); Assert.deepEqual(jsonObj.evts, {[evt.id as any]: evt, [evt1.id as any]: evt1, [evt2.id as any]: evt2, [evt4.id as any]: evt4}, "should have expected events test1"); let evt6 = TestHelper.mockEvent(endpoint, 6, true); doAwaitResponse(provider.addEvent("", evt6, itemCtx), (res) => { if (res.rejected) { Assert.ok(true, "error triggered"); Assert.equal(res.reason.message, "Unable to free up event space", "should have expected error"); Assert.equal(this.batchDrop.length, 1, "notification should be called"); Assert.equal(this.batchDrop[0].cnt, 1, "notification should be called with 1 cnt"); Assert.equal(this.batchDrop[0].reason, 2, "notification should be called with expected reason"); return; } Assert.ok(false, "error is not triggered"); }); } }); this.testCase({ name: "Web local Storage Provider: removeEvents with id set", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let evt = TestHelper.mockEvent(endpoint, 3); let evt1 = TestHelper.mockEvent(endpoint, 2); let evt2 = TestHelper.mockEvent(endpoint, 1); let evt3 = TestHelper.mockEvent(endpoint, 0); let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); provider.addEvent("", evt, itemCtx); provider.addEvent("", evt1, itemCtx); provider.addEvent("", evt2, itemCtx); provider.addEvent("", evt3, itemCtx); let evts = provider.getAllEvents(); Assert.deepEqual(JSON.stringify(evts), JSON.stringify([evt, evt1, evt2, evt3]), "should have the expected stored events"); provider.removeEvents([evt, evt1]); evts = provider.getAllEvents(); Assert.deepEqual(JSON.stringify(evts), JSON.stringify([evt2, evt3]), "should have the expected remaining stored events test1"); provider.removeEvents([evt]); evts = provider.getAllEvents(); Assert.deepEqual(JSON.stringify(evts), JSON.stringify([evt2, evt3]), "should have the expected remaining stored events test2"); provider.removeEvents([evt, evt2]); evts = provider.getAllEvents(); Assert.deepEqual(JSON.stringify(evts), JSON.stringify([evt3]), "should have the expected remaining stored events test3"); } }); this.testCase({ name: "Web local Storage Provider: removeEvents with id not set", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let evt = TestHelper.mockEvent(endpoint, 3, false); let evt1 = TestHelper.mockEvent(endpoint, 2, false); let evt2 = TestHelper.mockEvent(endpoint, 1, false); let evt3 = TestHelper.mockEvent(endpoint, 0, false); let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); provider.addEvent("", evt, itemCtx); provider.addEvent("", evt1, itemCtx); provider.addEvent("", evt2, itemCtx); provider.addEvent("", evt3, itemCtx); let evts = provider.getAllEvents(); Assert.deepEqual(JSON.stringify(evts), JSON.stringify([evt, evt1, evt2, evt3]), "should have the expected stored events"); let evts1 = provider.getAllEvents(1); Assert.deepEqual(JSON.stringify(evts1), JSON.stringify([evt]), "should have the expected 1 stored events"); let evts2 = provider.getAllEvents(2); Assert.deepEqual(JSON.stringify(evts2), JSON.stringify([evt, evt1]), "should have the expected 2 stored events"); provider.removeEvents([evt]); evts = provider.getAllEvents(); Assert.deepEqual(JSON.stringify(evts), JSON.stringify([evt1, evt2, evt3]), "should have the expected remaining stored events test1"); provider.removeEvents([evt1]); provider.removeEvents([evt2]); provider.removeEvents([evt3]); evts = provider.getAllEvents(); Assert.deepEqual(JSON.stringify(evts), JSON.stringify([]), "should have the expected remaining stored events test2"); let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; let storageObj = JSON.parse(storageStr); Assert.deepEqual(storageObj.evts, {}, "storgae should not have any remaining events"); } }); this.testCase({ name: "Web local Storage Provider: clear should clear all events in storage", test: () => { this.core.addNotificationListener({ offlineBatchDrop: (cnt, reason)=> { this.batchDrop.push({cnt: cnt, reason: reason}); } }); let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let evt = TestHelper.mockEvent(endpoint, 3, false); let evt1 = TestHelper.mockEvent(endpoint, 2, false); let evt2 = TestHelper.mockEvent(endpoint, 1, false); let evt3 = TestHelper.mockEvent(endpoint, 0, false); let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint, notificationMgr: this.core.getNotifyMgr() } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); provider.addEvent("", evt, itemCtx); provider.addEvent("", evt1, itemCtx); provider.addEvent("", evt2, itemCtx); provider.addEvent("", evt3, itemCtx); let evts = provider.getAllEvents(); Assert.deepEqual(JSON.stringify(evts), JSON.stringify([evt, evt1, evt2, evt3]), "should have the expected stored events"); provider.clear(); evts = provider.getAllEvents(); Assert.deepEqual(JSON.stringify(evts), JSON.stringify([]), "should not have any remaining events"); let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; let storageObj = JSON.parse(storageStr); Assert.deepEqual(storageObj.evts, {}, "storgae should not have any remaining events"); Assert.equal(this.batchDrop.length, 0, "notification should not be called"); } }); this.testCase({ name: "Web local Storage Provider: Clean should drop events that exist longer than max storage time", useFakeTimers: true, test: () => { this.core.addNotificationListener({ offlineBatchDrop: (cnt, reason)=> { this.batchDrop.push({cnt: cnt, reason: reason}); } }); let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let evt = TestHelper.mockEvent(endpoint, 3, false); let evt1 = TestHelper.mockEvent(endpoint, 2, false); let evt2 = TestHelper.mockEvent(endpoint, 1, false); let evt3 = TestHelper.mockEvent(endpoint, 0, false); let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({inStorageMaxTime: 1}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint, notificationMgr: this.core.getNotifyMgr() } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); this.clock.tick(1); provider.addEvent("", evt, itemCtx); provider.addEvent("", evt1, itemCtx); provider.addEvent("", evt2, itemCtx); provider.addEvent("", evt3, itemCtx); let evts = provider.getAllEvents(); Assert.deepEqual(JSON.stringify(evts), JSON.stringify([evt, evt1, evt2, evt3]), "should have the expected stored events"); this.clock.tick(10); let isCleaned = provider.clean(); evts = provider.getAllEvents(); Assert.ok(isCleaned, "should clean all events"); evts = provider.getAllEvents(); Assert.deepEqual(JSON.stringify(evts), JSON.stringify([]), "should have clean all previous events"); let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; let storageObj = JSON.parse(storageStr); Assert.deepEqual(storageObj.evts, {}, "storgae should not have any remaining events"); this.clock.tick(1); Assert.equal(this.batchDrop.length, 1, "notification should be called"); Assert.equal(this.batchDrop[0].cnt, 4, "notification should not be called with 4 count"); Assert.equal(this.batchDrop[0].reason, eBatchDiscardedReason.MaxInStorageTimeExceeded, "notification should be called with expected reason"); } }); this.testCase({ name: "Web local Storage Provider: autoClean should drop expected events when it is set to true", useFakeTimers: true, test: () => { this.core.addNotificationListener({ offlineBatchDrop: (cnt, reason)=> { this.batchDrop.push({cnt: cnt, reason: reason}); } }); let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let storageKey = "AIOffline_1_dc.services.visualstudio.com"; let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint, notificationMgr: this.core.getNotifyMgr() } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); this.clock.tick(10); let evt = TestHelper.mockEvent(endpoint, 3, false); let evt1 = TestHelper.mockEvent(endpoint, 2, false); provider.addEvent("", evt, itemCtx); provider.addEvent("", evt1, itemCtx); this.clock.tick(20); let provider1 = new WebStorageProvider("localStorage"); let storageConfig1 = createDynamicConfig({autoClean: true, inStorageMaxTime: 10}).cfg; let providerCxt1 = { itemCtx: itemCtx, storageConfig: storageConfig1, endpoint: endpoint, notificationMgr: this.core.getNotifyMgr() } let evt2 = TestHelper.mockEvent(endpoint, 1, false); let evt3 = TestHelper.mockEvent(endpoint, 0, false); provider.addEvent("", evt2, itemCtx); provider.addEvent("", evt3, itemCtx); let isInit1 = provider1.initialize(providerCxt1); Assert.ok(isInit1, "init process is successful test1"); let evts = provider.getAllEvents(); Assert.deepEqual(JSON.stringify(evts), JSON.stringify([evt2, evt3]), "should clean the expected events"); let storageStr = AITestClass.orgLocalStorage.getItem(storageKey) as any; let storageObj = JSON.parse(storageStr); let remainingEvts = storageObj.evts; Assert.deepEqual(Object.keys(remainingEvts).length, 2, "storgae should have expected remaining events"); this.clock.tick(1) Assert.equal(this.batchDrop.length, 1, "notification should be called"); Assert.equal(this.batchDrop[0].cnt, 2, "notification should not be called with 2 count"); Assert.equal(this.batchDrop[0].reason, eBatchDiscardedReason.MaxInStorageTimeExceeded, "notification should be called with expected reason"); } }); this.testCase({ name: "Web local Storage Provider: Uint8 Array should be handled correctly", test: () => { let endpoint = DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH; let arr = new Uint8Array([21, 32]); let evt = { urlString: endpoint, data: arr, headers: { "header1": "header1val", "header2": "header2val" }, isArr: true, disableXhrSync: false, disableFetchKeepAlive: false, sendReason: 1, iKey: "testIKey", criticalCnt: 0 } let provider = new WebStorageProvider("localStorage"); let itemCtx = this.core.getProcessTelContext(); let storageConfig = createDynamicConfig({}).cfg; let providerCxt = { itemCtx: itemCtx, storageConfig: storageConfig, endpoint: endpoint } let isInit = provider.initialize(providerCxt); Assert.ok(isInit, "init process is successful"); let addedEvt = provider.addEvent("", evt, itemCtx); Assert.ok(addedEvt, "evt should be added"); Assert.equal((addedEvt as IStorageTelemetryItem).data, "MjEsMzI=", "should have the expected encoded stored event"); let evts = provider.getAllEvents(); let data = evts && evts[0]; Assert.deepEqual(data.data, arr, "should have the expected decoded stored event array"); } }); } } class TestHelper { private static _idCount = 0; static reset(key: string) { this._idCount = 0; AITestClass.orgLocalStorage.removeItem(key); } static mockEvent(endPointUrl: string, criticalCnt: number, setId = true): IStorageTelemetryItem { let time = new Date().getTime(); let random = strSubstr(generateW3CId(), 0, 8); this._idCount++; let payload = { urlString: endPointUrl, data: '[{"name":"test1","prop":{"prop1":"prop1"}},{"name":"test1","prop":{"prop1":"prop1"}}]', headers: { "header1": "header1val", "header2": "header2val" }, disableXhrSync: false, disableFetchKeepAlive: false, sendReason: 1, id: setId? time + "." + random : "", iKey: "testIKey", criticalCnt: criticalCnt } return payload; } static mockStorageJSON(item: IStorageTelemetryItem | IStorageTelemetryItem[]): any { if (isArray(item)) { let evts = {}; arrForEach(item, (evt) => { let id = evt.id; evts[id as any] = evt }); return { lastAccessTime: 0, evts:evts } } let id = item.id; return { lastAccessTime: 0, evts:{[id as any]: item } } } } ================================================ FILE: channels/offline-channel-js/Tests/UnitTests.html ================================================  Tests for Application Insights JavaScript API
    ================================================ FILE: channels/offline-channel-js/Tests/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": false, "module": "amd", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "declaration": true }, "include": [ ], "exclude": [ "node_modules/" ] } ================================================ FILE: channels/offline-channel-js/api-extractor.json ================================================ /** * Config file for API Extractor. For more info, please visit: https://api-extractor.com */ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", /** * Optionally specifies another JSON config file that this file extends from. This provides a way for * standard settings to be shared across multiple projects. * * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be * resolved using NodeJS require(). * * SUPPORTED TOKENS: none * DEFAULT VALUE: "" */ // "extends": "./shared/api-extractor-base.json" // "extends": "my-package/include/api-extractor-base.json" /** * Determines the "" token that can be used with other config file settings. The project folder * typically contains the tsconfig.json and package.json config files, but the path is user-defined. * * The path is resolved relative to the folder of the config file that contains the setting. * * The default value for "projectFolder" is the token "", which means the folder is determined by traversing * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error * will be reported. * * SUPPORTED TOKENS: * DEFAULT VALUE: "" */ "projectFolder": ".", /** * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor * analyzes the symbols exported by this module. * * The file extension must be ".d.ts" and not ".ts". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , */ "mainEntryPointFilePath": "/build/types/applicationinsights-offlinechannel-js.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. * * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly * imports library2. To avoid this, we can specify: * * "bundledPackages": [ "library2" ], * * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been * local files for library1. */ "bundledPackages": [ ], /** * Determines how the TypeScript compiler engine will be invoked by API Extractor. */ "compiler": { /** * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * Note: This setting will be ignored if "overrideTsconfig" is used. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/tsconfig.json" */ // "tsconfigFilePath": "/tsconfig.json", /** * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. * The object must conform to the TypeScript tsconfig schema: * * http://json.schemastore.org/tsconfig * * If omitted, then the tsconfig.json file will be read from the "projectFolder". * * DEFAULT VALUE: no overrideTsconfig section */ // "overrideTsconfig": { // . . . // } /** * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. * * DEFAULT VALUE: false */ // "skipLibCheck": true, }, /** * Configures how the API report file (*.api.md) will be generated. */ "apiReport": { /** * (REQUIRED) Whether to generate an API report. */ "enabled": false, /** * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce * a full file path. * * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". * * SUPPORTED TOKENS: , * DEFAULT VALUE: ".api.md" */ "reportFileName": ".api.md", /** * Specifies the folder where the API report file is written. The file name portion is determined by * the "reportFileName" setting. * * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, * e.g. for an API review. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/etc/" */ "reportFolder": "/build/dts/", /** * Specifies the folder where the temporary report file is written. The file name portion is determined by * the "reportFileName" setting. * * After the temporary file is written to disk, it is compared with the file in the "reportFolder". * If they are different, a production build will fail. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/" */ // "reportTempFolder": "/temp/" }, /** * Configures how the doc model file (*.api.json) will be generated. */ "docModel": { /** * (REQUIRED) Whether to generate a doc model file. */ "enabled": true, /** * The output path for the doc model file. The file extension should be ".api.json". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/.api.json" */ "apiJsonFilePath": "/build/dts/.api.json" }, /** * Configures how the .d.ts rollup file will be generated. */ "dtsRollup": { /** * (REQUIRED) Whether to generate the .d.ts rollup file. */ "enabled": true, /** * Specifies the output path for a .d.ts rollup file to be generated without any trimming. * This file will include all declarations that are exported by the main entry point. * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/dist/.d.ts" */ "untrimmedFilePath": "/build/dts/.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. * This file will include only declarations that are marked as "@public" or "@beta". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "betaTrimmedFilePath": "/dist/-beta.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. * This file will include only declarations that are marked as "@public". * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "publicTrimmedFilePath": "/dist/-public.d.ts", /** * When a declaration is trimmed, by default it will be replaced by a code comment such as * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the * declaration completely. * * DEFAULT VALUE: false */ // "omitTrimmingComments": true }, /** * Configures how the tsdoc-metadata.json file will be generated. */ "tsdocMetadata": { /** * Whether to generate the tsdoc-metadata.json file. * * DEFAULT VALUE: true */ "enabled": false, /** * Specifies where the TSDoc metadata file should be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup * falls back to "tsdoc-metadata.json" in the package folder. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ "tsdocMetadataFilePath": "/build/dts/tsdoc-metadata.json" }, /** * Configures how API Extractor reports error and warning messages produced during analysis. * * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. */ "messages": { /** * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing * the input .d.ts files. * * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "compilerMessageReporting": { /** * Configures the default routing for messages that don't match an explicit rule in this table. */ "default": { /** * Specifies whether the message should be written to the the tool's output log. Note that * the "addToApiReportFile" property may supersede this option. * * Possible values: "error", "warning", "none" * * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes * the "--local" option), the warning is displayed but the build will not fail. * * DEFAULT VALUE: "warning" */ "logLevel": "warning", /** * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), * then the message will be written inside that file; otherwise, the message is instead logged according to * the "logLevel" option. * * DEFAULT VALUE: false */ // "addToApiReportFile": false }, // "TS2551": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . }, /** * Configures handling of messages reported by API Extractor during its analysis. * * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" * * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings */ "extractorMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false }, "ae-missing-release-tag": { "logLevel": "none" }, // // . . . }, /** * Configures handling of messages reported by the TSDoc parser when analyzing code comments. * * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "tsdocMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false } // "tsdoc-link-tag-unescaped-text": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . } } } ================================================ FILE: channels/offline-channel-js/package.json ================================================ { "name": "@microsoft/applicationinsights-offlinechannel-js", "version": "0.4.1", "description": "Microsoft Application Insights JavaScript SDK Offline Channel", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "author": "Microsoft Application Insights Team", "main": "dist/es5/applicationinsights-offlinechannel-js.js", "module": "dist-es5/applicationinsights-offlinechannel-js.js", "types": "types/applicationinsights-offlinechannel-js.d.ts", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/channels/offline-channel-js" }, "scripts": { "clean": "git clean -xdf", "build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen", "build:esm": "grunt offlinechannel", "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs", "rebuild": "npm run build", "test": "grunt offlinechanneltest", "mintest": "grunt offlinechannel-mintest", "lint": "tslint -p tsconfig.json", "dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights JavaScript SDK Offline Channel\"", "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js", "ai-min": "grunt offlinechannel-min", "ai-restore": "grunt offlinechannel-restore", "npm-pack": "npm pack", "api-docs": "typedoc" }, "dependencies": { "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/applicationinsights-core-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x", "@nevware21/ts-async": ">= 0.5.5 < 2.x" }, "peerDependencies": { "tslib": ">= 1.0.0" }, "devDependencies": { "@microsoft/ai-test-framework": "0.0.1", "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es5": "1.0.2", "@microsoft/api-extractor": "^7.40.0", "@types/sinon": "4.3.3", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "@nevware21/grunt-ts-plugin": "^0.5.2", "@nevware21/grunt-eslint-ts": "^0.5.2", "globby": "^11.0.0", "magic-string": "^0.25.7", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "rollup": "^3.20.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "^4.9.3", "tslib": "^2.0.0", "sinon": "^7.3.1", "typedoc": "^0.26.6" }, "license": "MIT" } ================================================ FILE: channels/offline-channel-js/rollup.config.js ================================================ import { createConfig } from "../../rollup.base.config"; import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const outputName = "applicationinsights-offlinechannel-js"; const banner = [ "/*!", ` * Application Insights JavaScript SDK - Offline Channel, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the MIT License.": "" }; updateDistEsmFiles(replaceValues, banner, true, true, "dist-es5"); export default createConfig(banner, { namespace: "Microsoft.ApplicationInsights", version: version, node: { entryPoint: outputName, outputName: outputName }, browser: { entryPoint: outputName, outputName: outputName } }, ["applicationinsights-offlinechannel-js"] ); ================================================ FILE: channels/offline-channel-js/src/Helpers/Utils.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { EventPersistence, INotificationManager, ITelemetryItem, NotificationManager, eLoggingSeverity, generateW3CId } from "@microsoft/applicationinsights-core-js"; import { isNumber, isString, objKeys, strSubstr } from "@nevware21/ts-utils"; import { IPostTransmissionTelemetryItem } from "../Interfaces/IInMemoryBatch"; /** * Checks if the value is a valid EventPersistence. * @param {enum} value - The value that needs to be checked. * @returns {boolean} True if the value is in EventPersistence, false otherwise. */ export function isValidPersistenceLevel(value: EventPersistence | number): boolean { return (isNumber(value) && value >= eLoggingSeverity.DISABLED && value <= EventPersistence.Critical); } // Endpoint schema // . //Prefix: Defines a service. //Suffix: Defines the common domain name. /** * Get domian from an endpoint url. * for example, https://test.com?auth=true, will return test.com * @param endpoint - endpoint url * @returns domain string */ export function getEndpointDomain(endpoint: string) { try { let url = endpoint.replace(/^https?:\/\/|^www\./, ""); url = url.replace(/\?/, "/"); let arr = url.split("/"); if (arr && arr.length > 0) { return arr[0]; } } catch (e) { // eslint-disable-next-line no-empty } // if we can't get domain, entire endpoint will be used return endpoint; } /** * If current value is equal or greater than zero. * @param value - number * @returns boolean */ export function isGreaterThanZero(value: number) { return value >= 0; } //Base64 is a binary encoding rather than a text encoding, // it were added to the web platform before it supported binary data types. // As a result, the two functions use strings to represent binary data const _base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; /** * Base64-encodes a Uint8Array. * * @param data - the Uint8Array or string to encode. * * @returns the base64-encoded output string. */ export function base64Encode(data: string | Uint8Array) { let line = ""; let input = ""; if (isString(data)) { input = data; } else { input = data.toString(); } let output = ""; // tslint:disable-next-line:one-variable-per-declaration let chr1, chr2, chr3; let lp = 0; while (lp < input.length) { chr1 = input.charCodeAt(lp++); chr2 = input.charCodeAt(lp++); chr3 = input.charCodeAt(lp++); // encode 4 character group line += _base64.charAt(chr1 >> 2); line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4)); if (isNaN(chr2)) { line += "=="; } else { line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6)); line += isNaN(chr3) ? "=" : _base64.charAt(chr3 & 63); } } output += line; return output; } /** * Base64-decodes an encoded string and transforms it back to a Uint8Array. * @param input - the encoded string to decode * @returns Uint8Array */ export function base64Decode(input: string) { var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); while (i < input.length) { enc1 = _base64.indexOf(input.charAt(i++)); enc2 = _base64.indexOf(input.charAt(i++)); enc3 = _base64.indexOf(input.charAt(i++)); enc4 = _base64.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) { output = output + String.fromCharCode(chr2); } if (enc4 != 64) { output = output + String.fromCharCode(chr3); } } let arr = output.split(",").map(c => Number(c)); return new Uint8Array(arr); } /** * Get number value of current time and append a random float number. * For example, if current time value is 12345678, so "12345678.randomfl" will be returned * @returns time id string */ export function getTimeId(): string { let time = (new Date()).getTime(); // append random digits to avoid same timestamp value const random = strSubstr(generateW3CId(), 0, 8); // function to create spanid(); return time + "." + random; } /** * Get time value from a time id that is generated from getTimeId() function. * For example, if time id is "12345678.randomfl", 12345678 will be returned * @param id - time id string * @returns time value number */ export function getTimeFromId(id: string) { try { let regex = new RegExp(/\d+\./g); if (id && isString(id) && regex.test(id)) { let arr = id.split("."); return parseInt(arr[0]); } } catch (e) { // eslint-disable-next-line no-empty } return 0; } /** * Get persistence level from a telemetry item. * Persistence level will be get from root, baseData or data in order. * For example, if persistence level is set both in root and baseData, the root one will be returned. * If no valid persistence level defined, normal level will be returned. * @param item - telemetry item * @returns persistent level */ export function getPersistence(item: ITelemetryItem | IPostTransmissionTelemetryItem): number | EventPersistence { let rlt = EventPersistence.Normal; // if item is null, return normal level if (!item) { return rlt; } try { let iItem = item as IPostTransmissionTelemetryItem; let level = iItem.persistence || (iItem.baseData && iItem.baseData.persistence) || (iItem.data && iItem.data.persistence); if (level && isValidPersistenceLevel(level)) { return level; } } catch (e) { // eslint-disable-next-line no-empty } return rlt; } export const EVT_DISCARD_STR = "eventsDiscarded"; export const EVT_STORE_STR = "offlineEventsStored"; export const EVT_SENT_STR = "offlineBatchSent"; export const BATCH_DROP_STR = "offlineBatchDrop"; export function forEachMap(map: { [key: string]: T }, callback: (value: T, key: string) => boolean, ordered?: boolean): void { if (map) { let keys = objKeys(map); if (!!ordered && keys) { let time = (new Date()).getTime(); keys = keys.sort((a,b) => { try { // if getTimeFromId returns 0, mean the time is not valid let aTime = getTimeFromId(a) || time; let bTime = getTimeFromId(b) || time; return aTime - bTime; } catch(e) { // eslint-disable-next-line no-empty } return -1; }); } for (let lp = 0; lp < keys.length; lp++) { let key = keys[lp]; if (!callback(map[key], key)) { break; } } } } export function callNotification(mgr: INotificationManager, evtName: string, theArgs: any[]) { let manager = (mgr || ({} as NotificationManager)); let notifyFunc = manager[evtName]; if (notifyFunc) { try { notifyFunc.apply(manager, theArgs); } catch (e) { // eslint-disable-next-line no-empty } } } export function batchDropNotification(mgr: INotificationManager, cnt: number, reason?: number) { if (mgr && cnt > 0) { callNotification(mgr, BATCH_DROP_STR, [cnt, reason]); } return; } // OneCollector: // 200-OK – Success or partial success. // 204-NoContent – Success or partial success. Regarding accepting events, identical to 200-OK. If the request header contains NoResponseBody with the value of true and the request was successful/partially successful, 204-NoContent status code is returned instead of 200-OK. // 400-BadRequest – all events were rejected. // 403-Forbidden – client is above its quota and all events were throttled. // 413-RequestEntityTooLarge – the request doesn’t conform to limits described in Request constraints section. // 415-UnsupportedMediaType – the Content-Type or Content-Encoding header has an unexpected value. // 429-TooManyRequests – the server decided to throttle given request (no data accepted) as the client (device, client version, …) generates too much traffic. // 401-Unauthorized – Can occur under two conditions: // All tenant tokens included in this request are invalid (unauthorized). kill-tokens header indicates which one(s). WWW-Authenticate: Token realm="ingestion" (see: rfc2617 for more details) header is added. // The client has supplied the “strict” header (see section 3.3), and at least one MSA and/or XAuth event token cannot be used as a source of trusted user or device information. The event failure reason “TokenCrackingFailure” will be present in the response’ JSON body. In this scenario, the client is expected to fix or replace the offending ticket and retry. // 500-InternalServerError – an unexpected exception while handling the request. // 503-ServiceUnavailable – a machine serving this request is overloaded or shutting down. The request should be retried to a different machine. The server adds Connection: Close header to enforce TCP connection closing. // Breeze // 0 ad blockers // 200 Success! // 206 - Partial Accept // 307/308 - Redirect // 400 - Invalid // 400 can also be caused by Azure AD authentication. // 400 is not retriable and SDK should drop invalid data. // 401 - Unauthorized // 401 can be also caused by an AAD outage. // 401 is retriable. // 402 - Daily Quota Exceeded, drop the data. // There is no retry-after in the response header for 402. // 403 - Forbidden // 403 can also caused by misconfiguring the access control assigned to the Application Insights resource. // 403 is retriable. // 404 - Ingestion is allowed only from stamp specific endpoint // Telemetry will be dropped and customer must update their connection string. // 404 is not retriable and SDK should drop the data. // 408 - Timeout, retry it later. (offline might get this) // 429 - Too Many Requests, Breeze returns retry-after for status code 429 only. // 500 - Internal Server Error, retry it later. // 502 - Bad Gateway, retry it later. // 503 - Service Unavailable, retry it later. (offline) // 504 - Gateway timeout, retry it later. // All other response codes, SDK should drop the data. ================================================ FILE: channels/offline-channel-js/src/InMemoryBatch.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import dynamicProto from "@microsoft/dynamicproto-js"; import { IDiagnosticLogger, ITelemetryItem, isNullOrUndefined } from "@microsoft/applicationinsights-core-js"; import { IInMemoryBatch, IPostTransmissionTelemetryItem } from "./Interfaces/IInMemoryBatch"; export class InMemoryBatch implements IInMemoryBatch { constructor(logger: IDiagnosticLogger, endpoint: string, evts?: IPostTransmissionTelemetryItem[], evtsLimitInMem?: number) { let _buffer: IPostTransmissionTelemetryItem[] = evts ? [].concat(evts) : []; dynamicProto(InMemoryBatch, this, (_self) => { _self.endpoint = () =>{ return endpoint; } _self.addEvent = (payload: IPostTransmissionTelemetryItem | ITelemetryItem) => { if (!isNullOrUndefined(evtsLimitInMem) && _self.count() >= evtsLimitInMem) { return false; } _buffer.push(payload); return true; }; _self.count = (): number => { return _buffer.length; }; _self.clear = () => { _buffer = []; }; _self.getItems = () => { return _buffer.slice(0); }; _self.split = (fromEvt: number, numEvts?: number) => { // Create a new batch with the same endpointUrl let theEvts: IPostTransmissionTelemetryItem[]; if (fromEvt < _buffer.length) { let cnt = _buffer.length - fromEvt; if (!isNullOrUndefined(numEvts)) { cnt = numEvts < cnt ? numEvts : cnt; } theEvts = _buffer.splice(fromEvt, cnt); } return new InMemoryBatch(logger, endpoint, theEvts, evtsLimitInMem); }; _self.createNew = (newEndpoint: string, evts?: IPostTransmissionTelemetryItem[] | ITelemetryItem[], newEvtsLimitInMem?: number) => { return new InMemoryBatch(logger, newEndpoint, evts, newEvtsLimitInMem); } }); } public addEvent(payload: IPostTransmissionTelemetryItem | ITelemetryItem) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } public endpoint() { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } public count(): number { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return 0; } public clear() { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public getItems(): IPostTransmissionTelemetryItem[] | ITelemetryItem[] { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Split this batch into 2 with any events > fromEvent returned in the new batch and all other * events are kept in the current batch. * @param fromEvt - The first event to remove from the current batch. * @param numEvts - The number of events to be removed from the current batch and returned in the new one. Defaults to all trailing events */ public split(fromEvt: number, numEvts?: number) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * create current buffer to a new endpoint * @param endpoint - if not defined, current endpoint will be used * @param evts - new events to be added * @param addCurEvts - if it is set to true, current itemss will be transferred to the new batch */ public createNew(endpoint: string, evts?: IPostTransmissionTelemetryItem[] | ITelemetryItem[], evtsLimitInMem?: number) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } } ================================================ FILE: channels/offline-channel-js/src/Interfaces/IInMemoryBatch.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { EventPersistence, ITelemetryItem } from "@microsoft/applicationinsights-core-js"; /** * An internal interface which defines a in memory batch */ export interface IInMemoryBatch { /** * Enqueue the payload */ addEvent: (evt: IPostTransmissionTelemetryItem | ITelemetryItem) => boolean; /** * Returns the number of elements in the buffer */ count: () => number; /** * Returns items stored in the buffer */ getItems: () => IPostTransmissionTelemetryItem[] | ITelemetryItem[]; /** * Split this batch into 2 with any events > fromEvent returned in the new batch and all other * events are kept in the current batch. * @param fromEvt - The first event to remove from the current batch. * @param numEvts - The number of events to be removed from the current batch and returned in the new one. Defaults to all trailing events */ split: (fromEvt: number, numEvts?: number) => IInMemoryBatch; /** * create current buffer to a new endpoint with current logger * @param endpoint - new endpoint * @param evts - new events to be added * @param evtsLimitInMem - new evtsLimitInMem */ createNew(endpoint: string, evts?: IPostTransmissionTelemetryItem[] | ITelemetryItem[], evtsLimitInMem?: number): IInMemoryBatch; } export interface IPostTransmissionTelemetryItem extends ITelemetryItem { /** * [Optional] An EventPersistence value, that specifies the persistence for the event. The EventPersistence constant */ persistence?: EventPersistence; } ================================================ FILE: channels/offline-channel-js/src/Interfaces/IOfflineBatch.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { IOfflineListener, IPayloadData, IProcessTelemetryUnloadContext, ITelemetryUnloadState, IXHROverride, createEnumStyle } from "@microsoft/applicationinsights-core-js"; import { IPromise } from "@nevware21/ts-async"; // NOTE: Most interfaces here should be moved to core eventually. // TODO: move interfaces to core //TODO: add doc export interface IOfflineDetectorCfg { autoStop: boolean; //default trues pollingInterval: number; //default 5min pollingUrl: string; } export interface IOfflineDetector { startPolling(): boolean; stopPolling(): boolean; getOfflineListener(): IOfflineListener; } export declare type createDefaultOfflineDetector = (cfg?: IOfflineDetectorCfg) => IOfflineDetector; export declare type createNoopOfflineDetector = (cfg?: IOfflineDetectorCfg) => IOfflineDetector; export const enum eStorageType { Unknown = 0, LocalStorage = 1, SessionStorage = 2, IndexDb = 3 } export const StorageType = (/* @__PURE__ */ createEnumStyle({ Unknown: eStorageType.Unknown, LocalStorage: eStorageType.LocalStorage, SessionStorage: eStorageType.SessionStorage, IndexDb: eStorageType.IndexDb })); export type StorageType = number | eStorageType; export const enum eBatchSendStatus { Complete = 1, Retry = 2, Drop = 3, Failure = 4 } export const BatchSendStatus = (/* @__PURE__ */ createEnumStyle({ Complete: eBatchSendStatus.Complete, Retry: eBatchSendStatus.Retry, Drop: eBatchSendStatus.Drop, Failure: eBatchSendStatus.Failure })); export type BatchSendStatus = number | eBatchSendStatus; export const enum eBatchStoreStatus { Success = 1, Failure = 2 } export const BatchStoreStatus = (/* @__PURE__ */ createEnumStyle({ Success: eBatchStoreStatus.Success, Failure: eBatchStoreStatus.Failure })); export type BatchStoreStatus = number | eBatchStoreStatus; export interface IOfflineBatchHandlerCfg { batchMaxSize?: number; // default 10000 storageType?: eStorageType; // default local storage offineDetector?: IOfflineDetector; // default no-op detector autoClean?: Boolean; maxRetryCnt?: number; // Max count for retry default 5 } export interface IOfflineBatchResponse { state: eBatchSendStatus, data?: any; } export interface IOfflineBatchStoreResponse { // Identifies if the batch was stored successfully or not state: eBatchStoreStatus; item?: any; } export interface IOfflineBatchCleanResponse { batchCnt: number; } export declare type OfflineBatchSendCallback = (response: IOfflineBatchResponse) => void; export declare type OfflineBatchStoreCallback = (response: IOfflineBatchStoreResponse) => void; export declare type OfflineBatchCallback = (response: IOfflineBatchResponse) => void; export interface IOfflineBatchHandler { storeBatch(batch: IPayloadData, cb?: OfflineBatchStoreCallback, sync?: boolean): undefined | IOfflineBatchStoreResponse | IPromise; sendNextBatch(cb?: OfflineBatchCallback, sync?: boolean, xhrOverride?: IXHROverride, cnt?: number): undefined | IOfflineBatchResponse | IPromise; hasStoredBatch(callback?: (hasBatches: boolean) => void): undefined | boolean | IPromise; cleanStorage(cb?:(res: IOfflineBatchCleanResponse) => void ): undefined | IOfflineBatchCleanResponse | IPromise; teardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void } //export declare type createOfflineBatchHandler = (storageType: eStorageType, cfg?: IOfflineBatchHandlerCfg) => IOfflineBatchHandler; ================================================ FILE: channels/offline-channel-js/src/Interfaces/IOfflineIndexDb.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { IPromise, ITaskScheduler } from "@nevware21/ts-async"; export interface IDbState { ver: number; table: any; db: IDBDatabase; active: boolean; openErr: any; isClosing: any; } export interface IDbContext { /** * The name of the database that has been opened */ name: string; /** * The specific ITaskScheduler that will be used to schedule events against this opened database */ sch: ITaskScheduler; /** * The Actual IndexedDB IDBDatabase handles returned and opened by the helper instance. */ dbHdl: IDBDatabase[]; /** * Adds a new handle to the array of open handles * @param db - */ add(db: IDBDatabase): void; /** * Removes the given handle from the array of open handles (if present) * @param db - */ remove(db: IDBDatabase): void; /** * Returns whether the identified database if considered to be open (i.e. has at least 1 open db handle) */ isOpen(): boolean; /** * Internal helper to return the first available open db handle */ openHdl(): IDBDatabase; state?: IDbState } export interface IIndexedDbContext { name: string; ver?: string; } /** * Result value returned by the processFunc() delegate of the _openCursor() iterating function so that * the internal iteration knows whether to stop, continue or wait. */ export const enum CursorProcessResult { /** * Just move onto the next available item for the cursor */ Continue = 0, /** * The process function is waiting on another async operation and will continue or complete when it's ready */ Waiting = 1, /** * Stop processing the cursor and resolve the Promise returned from the openCursor() call. */ Complete = 2 } /** * The open database context created by the openDb() method and passed to the processFunc() delegate to perform operations * on the opened db, this is used to pass around the current db context. */ export interface IIndexedDbOpenDbContext { dbName: string; dbVersion: number; db: IDBDatabase; // The opened indexedDb object ctx: C; // User Context isNew: boolean; // Identifies if the Db was newly created during this event txn: IDBTransaction; // Open DB Transaction /** * Once the database hased been opened by the openDb() method you can use this method to open a specific table (store), once successfully opened * the doAction callback will be called. * The Promise returned by the openStore() method will not resolve until either the promise returned by the doAction() callback is resolved/rejected * or there was an error opening the store (The database was not or is no longer open). * Special Note: This method IS optional and will NOT exist for the versionChangeFunc() callback, but will always exist for the processFunc() provided during the openDb() method call. * @param eventTable - The name of the store (table) to open * @param doAction - The callback function to execute once the store is opened and will be passed a IIndexedDbStoreActionContext<> context instance, this * context can be used to open a cursor and perform operations on the table. If the action does not return an Promise then open store will return a resolved promise with the returned value */ openStore?( eventTable: string, doAction: (store: IIndexedDbStoreActionContext) => IPromise|T|void): IPromise; /** * A helper method that opens the store and a cursor on the table previously opened by the openStore() method of the IIndexedDbOpenDbContext<> instance that was provided by the openDb() call. * This enables searching (query) and iterating over the request table. The returned Promise will be resolved with an array of the requested items (if successful) and whether * the passed processFunc() requests or manually inserts the elements into the array. Or rejected if there was an issue opening the cursor. * @param eventTable - The name of the store (table) to open * @param query - Either a string that will be used to construct a SimpleQuery definition or an instance of the IIndexedDbSimpleQuery interface used to open the cursor on the store. * May be null to iterate over the entire store. * @param processFunc - [Optional] The callback method that will be called for every item found matching the query for the store. * - If no callback is provided then the returned Promise will include all items matching the provided query (if any are found) * - When provided it is the processFunc() responsibility to populate the passed values[] and this array will be the values used to resolve the outer Promise once the cursor has finished iterating. * - The result of the processFunc() (A CursorProcessResult value) will be used to determine whether the cursor will just Continue onto the next value (if present), Complete (stop iterating) or * Wait for the processFunc() to call the continue() or done() methods of the IProcessCursorState<> instance, when returning "Waiting" it is the responsibility of the processFunc() to call either of * these methods, failure to do so will result in the operation to never complete. */ openCursor?( eventTable: string, query: string|IIndexedDbSimpleQuery, processFunc?: (state: IProcessCursorState, value: T, values: T[]) => CursorProcessResult): IPromise; } /** * The context object created by _openStore() function and passed to the doAction() delegate. */ export interface IIndexedDbStoreActionContext { /** * The open database context used and passed to the doAction() method from the openDb() call. */ db: IIndexedDbOpenDbContext; // The Open Db Context used for this requests /** * The IndexedDB database transaction used for this object store */ tx: IDBTransaction; /** * Identifies the name of the current object store (Table) that was opened */ tbl: string; /** * The actual IndexedDB IDBObjectStore instance for the opened store that can by used to perform operations on the table (add, put, etc) */ store: IDBObjectStore; // The IndexedDb object store interface /** * A helper method that opens a cursor on the table previously opened by the openStore() method of the IIndexedDbOpenDbContext<> instance that was provided by the openDb() call. * This enables searching (query) and iterating over the request table. The returned Promise will be resolved with an array of the requested items (if successful) and whether * the passed processFunc() requests or manually inserts the elements into the array. Or rejected if there was an issue opening the cursor. * @param query - Either a string that will be used to construct a SimpleQuery definition or an instance of the IIndexedDbSimpleQuery interface used to open the cursor on the store. * May be null to iterate over the entire store. * @param processFunc - [Optional] The callback method that will be called for every item found matching the query for the store. * - If no callback is provided then the returned Promise will include all items matching the provided query (if any are found) * - When provided it is the processFunc() responsibility to populate the passed values[] and this array will be the values used to resolve the outer Promise once the cursor has finished iterating. * - The result of the processFunc() (A CursorProcessResult value) will be used to determine whether the cursor will just Continue onto the next value (if present), Complete (stop iterating) or * Wait for the processFunc() to call the continue() or done() methods of the IProcessCursorState<> instance, when returning "Waiting" it is the responsibility of the processFunc() to call either of * these methods, failure to do so will result in the operation to never complete. */ openCursor( query: string|IIndexedDbSimpleQuery, processFunc?: (state: IProcessCursorState, value: T, values: T[]) => CursorProcessResult): IPromise; /** * Starts another transaction on the current store, once successfully created the doAction callback will be called. * The Promise returned by the newTransaction() method will not resolve until either the promise returned by the doAction() callback is resolved/rejected * or there was an error opening the store (The database was not or is no longer open). * Special Note: This method IS optional and will NOT exist for the versionChangeFunc() callback, but will always exist for the processFunc() provided during the openDb() method call. * @param doAction - The callback function to execute once the store is opened and will be passed a IIndexedDbStoreActionContext<> context instance, this * context can be used to open a cursor and perform operations on the table. */ newTransaction( doAction: (store: IIndexedDbStoreActionContext) => IPromise): IPromise; } /** * Interface used for passing around internal state when iterating over a table via a cursor */ export interface IProcessCursorState { /** * The context returned and used by the openStore() method returned from the openDb() method. */ store: IIndexedDbStoreActionContext; /** * The IndexedDB IDBCursorWithValue instance for the cursor operation */ cursor: IDBCursorWithValue; /** * Helper to continue onto the next available item using the cursor */ continue(): void; /** * Helper to stop processing/iterating over the cursor, the cursor operation will be stopped and the Promise returned by openCursor() will be * resolved with the values[]/ */ done(): void; } /** * Interface defining the object returned by the getDbDetails() function */ export interface IIndexedDbDetails { name: string; // The name of the database version?: number; // The version of the database } /** * Interface defining the search query arguments used for the openCursor() function */ export interface IIndexedDbSimpleQuery { /** * [Optional] Returns and optional IndexedDB IDBKeyRange instance that will be passed to the IndexedDB Api openCursor() method. * Value returned May be null. */ keyRange?(): IDBKeyRange; /** * [Optional] Callback method used to provide additional validation on whether the returned value from the IndexedDB Api cursor iteration, this method * must return true for the processFunc() of the openCursor() is called or the value is just added to the identified items. * @param value - The value returned by the IndexedDB IDBCursorWithValue cursor event. * @returns true if the value matches otherwise false */ isMatch?(value: any): boolean; } ================================================ FILE: channels/offline-channel-js/src/Interfaces/IOfflineProvider.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { EventPersistence, INotificationManager, IPayloadData, IProcessTelemetryContext, IXHROverride, createEnumStyle } from "@microsoft/applicationinsights-core-js"; import { IPromise } from "@nevware21/ts-async"; /** * Identifies the Storage Providers used by the LocalStorageChannel */ export const enum eStorageProviders { /** * Identifies that the provider that uses (window||globalThis||self).localStorage */ LocalStorage = 1, /** * Identifies that the provider that uses (window||globalThis||self).sessionStorage */ SessionStorage = 2, /** * Identifies that the provider that uses (window||globalThis||self).indexedDB */ IndexedDb = 3 } export const StorageProviders = (/* @__PURE__ */ createEnumStyle({ LocalStorage: eStorageProviders.LocalStorage, SessionStorage: eStorageProviders.SessionStorage, IndexedDb: eStorageProviders.IndexedDb })); export type StorageProviders = number | eStorageProviders; /** * The IOfflineChannelConfiguration interface defines the configuration options for offline channel, * supports offline events storage, retrieval and re-sending. */ export interface IOfflineChannelConfiguration { /** * [Optional] The max size in bytes that should be used for storing events(default up to 5 Mb) in local/session storage. * The maximum size in bytes that should be used for storing events in storage If not specified, the system will use up to 5 MB * @default 5000000 */ maxStorageSizeInBytes?: number; /** * [Optional] The storage key prefix that should be used when storing events in persistent storage. * @default AIOffline */ storageKeyPrefix?: string; /** * [Optional] Identifies the minimum level that will be cached in the offline channel. Valid values of this * setting are defined by the EventPersistence enum, currently Normal (1) and Critical (2) with the default * value being Normal (1), which means all events without a persistence level set or with invalid persistence level will be marked as Normal(1) events. * @default 1 */ minPersistenceLevel?: number | EventPersistence; /** * [Optional] Identifies the StorageProviders that should be used by the system if available, the first available * provider will be used. Valid available values are defined by the eStorageProviders enum. Only the first 5 entries * are processed, so if this value contains more than 5 elements they will be ignored. * Note: LocalStorage will be used to save unload events even if it is not in the providers list * Default order is [StorageProviders.LocalStorage, StorageProviders.IndexedDB] */ providers?: number[] | eStorageProviders[]; /** * [Optional] The IndexedDb database name that should be used when storing events using (window||globalThis||self).indexedDb. */ indexedDbName?: string; /** * [Optional] Identifies the maximum number of events to store in each memory batch before sending to persistent storage. * For versions > 3.3.2, new config splitEvts is added * If splitEvts is set true, eventsLimitInMem will be applied to each persistent level batch */ eventsLimitInMem?: number; /** * [Optional] Identifies if events that have existed in storage longer than the maximum allowed time (configured in inStorageMaxTime) should be cleaned after connection with storage. * If not provided, default is false */ autoClean?: boolean; /** * [Optional] Identifies the maximum time in ms that items should be in memory before being saved into storage. * @default 15000 */ inMemoMaxTime?: number; /** * [Optional] Identifies the maximum time in ms that items should be in persistent storage. * default: 10080000 (around 2.8 hours) for versions <= 3.3.0 * default: 604800000 (around 7days) for versions > 3.3.0 */ inStorageMaxTime?: number; /** * [Optional] Identifies the maximum retry times for an event batch. * default: 1 */ maxRetry?: number; /** * Identifies online channel IDs in order. The first available one will be used. * default is [AppInsightsChannelPlugin, PostChannel] */ primaryOnlineChannelId?: string[]; /** * Identifies the maximum size per batch in bytes that is saved in persistent storage. * default 63000 */ maxBatchsize?: number; /** * Identifies offline sender properties. If not defined, settings will be the same as the online channel configured in primaryOnlineChannelId. */ senderCfg?: IOfflineSenderConfig; /** * Identifies the interval time in ms that previously stored offline event batches should be sent under online status. * default 15000 */ maxSentBatchInterval?: number; /** * Identifies the maximum event batch count when cleaning or releasing space for persistent storage per time. * default 10 */ EventsToDropPerTime?: number; /** * Identifies the maximum critical events count for an event batch to be able to drop when releasing space for persistent storage per time. * default 2 */ maxCriticalEvtsDropCnt?: number; /** * Identifies overridden for the Instrumentation key when the offline channel calls processTelemetry. */ overrideInstrumentationKey?: string; /** * Identifies when saving events into the persistent storage, events will be batched and saved separately based on persistence level * this is useful to help reduce the loss of critical events during cleaning process * but it will result in more frequest storage implementations. * If it is set to false, all events will be saved into single in memory batch * Default: false */ splitEvts?: boolean; /** * [Optional] Custom provider that can be used instead of the provided LocalStorage, SessionStorage, IndexedDB. * Default: null * @since 3.9.10 */ customProvider?: IOfflineProvider; /** * [Optional] Custom unload provider should be used for handling unload scenarios. * This provider should support synchronous operations (supportsSyncRequests should return true) * If the unload provider is not provided, the provided customProvider will be used if it supports sync requests, * otherwise localStorage will be used by default. * Default: null * @since 3.9.10 */ customUnloadProvider?: IOfflineProvider; //TODO: add do sampling } export interface IOfflineSenderConfig { /** * Identifies status codes for re-sending event batches * Default: [401, 403, 408, 429, 500, 502, 503, 504] */ retryCodes?: number[]; /** * [Optional] Either an array or single value identifying the requested TransportType type(s) that should be used for sending events * If not defined, the same transports will be used in the channel with the primaryOnlineChannelId */ transports?: number | number[]; /** * [Optional] The HTTP override that should be used to send requests, as an IXHROverride object. */ httpXHROverride?: IXHROverride; /** * Identifies if provided httpXhrOverride will always be used * default false */ alwaysUseXhrOverride?: boolean; } /** * An internal interface which defines web provider Storage JSON details */ export interface IStorageJSON { /** * The timestamp at which the storage was last accessed. */ lastAccessTime?: number; evts?: { [id: string]: IStorageTelemetryItem }; // id is the timestamp value } /** * An internal interface which defines a common storage item */ export interface IStorageTelemetryItem extends IPayloadData { id?: string; iKey?: string; sync?: boolean; criticalCnt?: number; isArr?: boolean; attempCnt?: number; } /** * An internal interface which defines a common provider context that is used to pass multiple values when initializing provider instances */ export interface ILocalStorageProviderContext { /** * Identifies the context for the current event */ itemCtx?: IProcessTelemetryContext; /** * Identifies the local storage config that should be used to initialize the provider */ storageConfig: IOfflineChannelConfiguration; /** * Identifies the unique identifier to be used for this provider instance, when not provided a new Guid will be generated for this instance. * This value must be unique across all instances to avoid polluting events between browser / tabs instances as they may share the same persistent storage. * The primary use case for setting this value is for unit testing. */ id?: string; /** * Identifies endpoint url. */ endpoint?: string; /** * Identifies Notification Manager */ notificationMgr?: INotificationManager; } /* * An internal interface to provide access to different local storage options */ export interface IOfflineProvider { /** * Initializes the provider using the config * @param providerContext - The provider context that should be used to initialize the provider * @returns True if the provider is initialized and available for use otherwise false */ initialize(providerContext: ILocalStorageProviderContext): boolean; /** * Identifies whether this storage provider support synchronious requests */ supportsSyncRequests(): boolean; /** * Stores the value into the storage using the specified key. * @param key - The key value to use for the value * @param evt - The actual event of the request * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances * can optionally use this to access the current core instance or define / pass additional information * to later plugins (vs appending items to the telemetry item) * @returns Either the added element (for synchronous operation) or a Promise for an asynchronous processing */ addEvent(key: string, evt: IStorageTelemetryItem, itemCtx: IProcessTelemetryContext): IStorageTelemetryItem | IPromise | null; /** * Get Next batch from the storage */ getNextBatch(): IStorageTelemetryItem[] | IPromise< IStorageTelemetryItem[]> | null; /** * Get all stored batches from the storage. * @param cnt - batch numbers if it is defined, it will returns given number of batches. * if cnt is not defined, it will return all available batches */ getAllEvents(cnt?: number): IStorageTelemetryItem[] | IPromise< IStorageTelemetryItem[]> | null; /** * Removes the value associated with the provided key * @param evts - The events to be removed * @returns Either the removed item array (for synchronous operation) or a Promise for an asynchronous processing */ removeEvents(evts: IStorageTelemetryItem[]): IStorageTelemetryItem[] | IPromise | null; /** * Removes all entries from the storage provider, if there are any. * @returns Either the removed item array (for synchronous operation) or a Promise for an asynchronous processing */ clear(): IStorageTelemetryItem[] | IPromise | null; /** * Removes all entries with stroage time longer than inStorageMaxTime from the storage provider */ clean(disable?: boolean): boolean | IPromise; /** * Shuts-down the telemetry plugin. This is usually called when telemetry is shut down. */ teardown(): void; } ================================================ FILE: channels/offline-channel-js/src/Interfaces/ISender.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // *********************************************************************************************************** // TODO: remove all interfaces here to common export interface IBackendResponse { /** * Number of items received by the backend */ readonly itemsReceived: number; /** * Number of items succesfuly accepted by the backend */ readonly itemsAccepted: number; /** * List of errors for items which were not accepted */ readonly errors: IResponseError[]; /** * App id returned by the backend - not necessary returned, but we don't need it with each response. */ readonly appId?: string; } export interface XDomainRequest extends XMLHttpRequestEventTarget { readonly responseText: string; send(payload: string): void; open(method: string, url: string): void; } export interface IResponseError { readonly index: number; readonly statusCode: number; readonly message: string; } ================================================ FILE: channels/offline-channel-js/src/OfflineBatchHandler.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import dynamicProto from "@microsoft/dynamicproto-js"; import { IDiagnosticLogger, IPayloadData, IProcessTelemetryContext, IProcessTelemetryUnloadContext, ITelemetryUnloadState, IUnloadHookContainer, IXHROverride, isNullOrUndefined, isObject } from "@microsoft/applicationinsights-core-js"; import { AwaitResponse, IPromise, createPromise, doAwaitResponse } from "@nevware21/ts-async"; import { IOfflineBatchCleanResponse, IOfflineBatchHandler, IOfflineBatchResponse, IOfflineBatchStoreResponse, OfflineBatchCallback, OfflineBatchStoreCallback, eBatchSendStatus, eBatchStoreStatus } from "./Interfaces/IOfflineBatch"; import { ILocalStorageProviderContext, IOfflineProvider, IStorageTelemetryItem, eStorageProviders } from "./Interfaces/IOfflineProvider"; import { IndexedDbProvider } from "./Providers/IndexDbProvider"; import { WebStorageProvider } from "./Providers/WebStorageProvider"; const MaxStorageProviderConfig = 2; const NoProviderErrMsg = "No provider is available"; export class OfflineBatchHandler implements IOfflineBatchHandler { constructor(logger?: IDiagnosticLogger, unloadHookContainer?: IUnloadHookContainer) { dynamicProto(OfflineBatchHandler, this, (_self) => { let _isInitialized: boolean; let _logger: IDiagnosticLogger; let _provider: IOfflineProvider; let _unloadProvider: IOfflineProvider; let _itemCtx: IProcessTelemetryContext; let _maxRetryCnt: number; let _retryCodes: number[]; _initDefaults(); _self.initialize = (providerContext: ILocalStorageProviderContext) => { // TODO: handle provider change try { if (!_isInitialized) { _logger = logger || providerContext.itemCtx.diagLog(); _itemCtx = providerContext.itemCtx; _provider = _initProvider(providerContext); let storeCfg = providerContext.storageConfig || {}; let retry = storeCfg.maxRetry; _maxRetryCnt = !isNullOrUndefined(retry)? retry : 2; _retryCodes = (storeCfg.senderCfg || {}).retryCodes; if (_provider) { _isInitialized = true; } } } catch(e) { _isInitialized = false; } return _isInitialized; } _self["_getDbgPlgTargets"] = () => { return [_provider, _isInitialized, _unloadProvider]; }; _self.storeBatch = (batch: IPayloadData, cb?: OfflineBatchStoreCallback, sync?: boolean) => { let provider = _provider; if(!!sync) { provider = _unloadProvider; } return createPromise((resolve, reject) => { if (!provider) { reject(new Error(NoProviderErrMsg)) } let evt = _getOfflineEvt(batch); return doAwaitResponse(provider.addEvent(evt.id, evt, _itemCtx), (response: AwaitResponse) => { try { let evt = response.value || response.reason || []; let state = eBatchStoreStatus.Failure; if (!response.rejected) { state = eBatchStoreStatus.Success; } let res = {state: state, item: evt}; try { cb && cb(res); } catch(e) { // eslint-disable-next-line no-empty } resolve(res); } catch(e) { reject(e); } }); }); } _self.sendNextBatch = (cb?: OfflineBatchCallback, sync?: boolean, xhrOverride?: IXHROverride, cnt: number = 1) => { return createPromise((resolve, reject) => { if (!_provider && !_unloadProvider) { reject(new Error(NoProviderErrMsg)); } function storeResolve(result) { try { cb && cb(result); } catch (e) { // eslint-disable-next-line no-empty } resolve(result); } let provider = _provider; try { if (_unloadProvider) { doAwaitResponse(_unloadProvider.getNextBatch(), (res) => { if (res && !res.rejected) { let unloadEvts = res.value; if (unloadEvts && unloadEvts.length) { // always try to send ones from local storage provider = _unloadProvider; return _handleNextBatch(unloadEvts); } } return _sendNextBatch(); }); } else { return _sendNextBatch(); } } catch(e) { // eslint-disable-next-line no-empty reject(e); } function _sendNextBatch() { return doAwaitResponse(provider.getNextBatch(), (response: AwaitResponse) => { try { if(!response || response.rejected) { let res = {state: eBatchSendStatus.Failure, data: response.reason}; storeResolve(res); return; } let evts = response.value || []; return _handleNextBatch(evts); } catch(e) { reject(e); } }); } function _handleNextBatch(evts: IStorageTelemetryItem[]) { let result = {state: eBatchSendStatus.Complete, data: null} as IOfflineBatchResponse; if (evts.length) { // make sure doawait has resolve return doAwaitResponse(provider.removeEvents(evts), (res) => { if(res && !res.rejected && res.value) { let deletedItems = res.value; for (let lp = 0; lp < deletedItems.length; lp++) { try { let evt = evts[lp]; result.data = evt; // add data if (xhrOverride && xhrOverride.sendPOST) { evt.attempCnt++; let sender = xhrOverride.sendPOST; // use transports let onCompleteCallback = (status: number, headers: { [headerName: string]: string; }, res?: string) => { if (status == 200) { // status code (e.g: invalid key) drop payload result.state = eBatchSendStatus.Complete; } else { let isRetriable = _isRetriable(evt, status); if (isRetriable) { result.state = eBatchSendStatus.Retry; _unloadProvider && _unloadProvider.addEvent(evt.id, evt, _itemCtx); } else { result.state = eBatchSendStatus.Drop; } } storeResolve(result); }; return doAwaitResponse(sender(evt, onCompleteCallback, sync) as any, (res) => { // do nothing, because it should be resolved in callback }); } // call resolve result.state = eBatchSendStatus.Drop; storeResolve(result); return; } catch (e) { reject(e); } } // this case should never happen because this function is called after we confirm that evt is available // add resolve here in case result.state = eBatchSendStatus.Complete; storeResolve(result); return; } // if can not delete first, resolve result.state = eBatchSendStatus.Failure; result.data = res.reason; storeResolve(result); return; }); } storeResolve(result); } }); } _self.hasStoredBatch = (cb?: (hasBatches: boolean) => void) => { return createPromise((resolve, reject) => { if (!_provider) { reject(new Error(NoProviderErrMsg)) } return doAwaitResponse(_provider.getNextBatch(), (response: AwaitResponse) => { try { let evts = response.value || []; let hasEvts = evts.length > 0; cb && cb(hasEvts); resolve(hasEvts); } catch(e) { reject(e); } }); }); } _self.cleanStorage = (cb?:(res: IOfflineBatchCleanResponse) => void) => { return createPromise((resolve, reject) => { // note: doawaitresponse currently returns undefined if (!_provider) { reject(new Error(NoProviderErrMsg)) } return doAwaitResponse(_provider.clear(), (response: AwaitResponse) => { try { let cnt = 0; if (!response.rejected) { let evts = response.value || []; cnt = evts.length; } let res = {batchCnt: cnt} as IOfflineBatchCleanResponse; cb && cb(res); // get value. make sure to use callback resolve(res); // won't get val } catch(e) { reject(e); } }); }); } _self.teardown = (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => { _provider && _provider.teardown(); _initDefaults(); }; function _initDefaults() { _provider = null; _unloadProvider = null; _isInitialized = false; _maxRetryCnt = null; _retryCodes = null; } function _tryGetIndexedDbProvider(providerContext: ILocalStorageProviderContext): IOfflineProvider { let newProvider = new IndexedDbProvider(undefined, unloadHookContainer); if (!newProvider.initialize(providerContext)) { // Failed to initialize the provider newProvider = null; } return newProvider as any; } function _tryGetWebStorageProvider(storageType: string, providerContext: ILocalStorageProviderContext): IOfflineProvider { let newProvider = new WebStorageProvider(storageType, undefined, unloadHookContainer); if (!newProvider.initialize(providerContext)) { // Failed to initialize the provider newProvider = null; } return newProvider as any; } function _tryGetCustomProvider(provider: IOfflineProvider, providerContext: ILocalStorageProviderContext, unload?: boolean): IOfflineProvider { try { if (provider && provider.initialize(providerContext)) { return provider; } } catch (e) { // eslint-disable-next-line no-empty } return null; } function _initProvider(providerContext: ILocalStorageProviderContext): IOfflineProvider { let storageConfig = providerContext.storageConfig; let providers = storageConfig.providers; let newProvider: IOfflineProvider = null; let lp: number = 0; // If custom provider is provided, use the custom one instead let cmProvider = _tryGetCustomProvider(storageConfig.customProvider, providerContext); let cmUnloadProvider = _tryGetCustomProvider(storageConfig.customUnloadProvider, providerContext); newProvider = cmProvider; _unloadProvider = cmUnloadProvider; while (!newProvider && lp < providers.length && lp < MaxStorageProviderConfig) { switch (providers[lp++]) { case eStorageProviders.LocalStorage: newProvider = _tryGetWebStorageProvider("localStorage", providerContext); _unloadProvider = newProvider; break; case eStorageProviders.SessionStorage: newProvider = _tryGetWebStorageProvider("sessionStorage", providerContext); _unloadProvider = newProvider; break; case eStorageProviders.IndexedDb: newProvider = _tryGetIndexedDbProvider(providerContext); _unloadProvider = _tryGetWebStorageProvider("localStorage", providerContext); } } if (!_unloadProvider) { if (newProvider && newProvider.supportsSyncRequests && newProvider.supportsSyncRequests()) { _unloadProvider = newProvider; } else { _unloadProvider = _tryGetWebStorageProvider("localStorage", providerContext); } } return newProvider; } function _getOfflineEvt(batch: IPayloadData) { let item = batch as IStorageTelemetryItem; // TODO: add details let data = item.data; if (data) { let isArr = isObject(data); item.isArr = isArr; } return item; } /** * Checks if the SDK should resend the payload after receiving this status code from the backend. * @param statusCode - */ function _isRetriable(item: IStorageTelemetryItem, statusCode: number): boolean { if (!_shouldSend(item)) { return false; } // retryCodes = [] means should not retry if (!isNullOrUndefined(_retryCodes)) { return _retryCodes.length && _retryCodes.indexOf(statusCode) > -1; } return statusCode === 401 // Unauthorized || statusCode === 403 // Forbidden || statusCode === 408 // Timeout || statusCode === 429 // Too many requests. || statusCode === 500 // Internal server error. || statusCode === 502 // Bad Gateway. || statusCode === 503 // Service unavailable. || statusCode === 504; // Gateway timeout. } function _shouldSend(item: IStorageTelemetryItem): boolean { if (item && item.data) { item.attempCnt = item.attempCnt || 0; return item.attempCnt <= _maxRetryCnt; } return false; } }); } /** * Initializes the provider using the config * @returns True if the provider is initialized and available for use otherwise false */ public initialize(providerContext: ILocalStorageProviderContext) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } public storeBatch(batch: IPayloadData, cb?: OfflineBatchStoreCallback, sync?: boolean): undefined | IOfflineBatchStoreResponse | IPromise { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } public sendNextBatch(cb?: OfflineBatchCallback, sync?: boolean, xhrOverride?: IXHROverride, cnt?: number): undefined | IOfflineBatchResponse | IPromise { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } public hasStoredBatch(callback?: (hasBatches: boolean) => void): undefined | boolean | IPromise { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } public cleanStorage(cb?:(res: IOfflineBatchCleanResponse) => void ): undefined | IOfflineBatchCleanResponse | IPromise { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } public teardown (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } } ================================================ FILE: channels/offline-channel-js/src/OfflineChannel.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import dynamicProto from "@microsoft/dynamicproto-js"; import { BaseTelemetryPlugin, BreezeChannelIdentifier, EventPersistence, EventsDiscardedReason, IAppInsightsCore, IChannelControls, IConfig, IConfigDefaults, IConfiguration, IDiagnosticLogger, IInternalOfflineSupport, INotificationListener, INotificationManager, IOfflineListener, IPayloadData, IPlugin, IProcessTelemetryContext, IProcessTelemetryUnloadContext, ITelemetryItem, ITelemetryPluginChain, ITelemetryUnloadState, IXHROverride, SendRequestReason, _eInternalMessageId, _throwInternal, arrForEach, createOfflineListener, createProcessTelemetryContext, createUniqueNamespace, dateNow, eBatchDiscardedReason, eLoggingSeverity, mergeEvtNamespace, onConfigChange, runTargetUnload } from "@microsoft/applicationinsights-core-js"; import { IPromise, ITaskScheduler, createAsyncPromise, createTaskScheduler } from "@nevware21/ts-async"; import { ITimerHandler, arrSlice, isFunction, isString, mathFloor, mathMax, mathMin, objDeepFreeze, objForEachKey, scheduleTimeout } from "@nevware21/ts-utils"; import { EVT_DISCARD_STR, EVT_SENT_STR, EVT_STORE_STR, batchDropNotification, callNotification, isGreaterThanZero, isValidPersistenceLevel } from "./Helpers/Utils"; import { InMemoryBatch } from "./InMemoryBatch"; import { IPostTransmissionTelemetryItem } from "./Interfaces/IInMemoryBatch"; import { IOfflineBatchHandler, OfflineBatchCallback, OfflineBatchStoreCallback, eBatchSendStatus, eBatchStoreStatus } from "./Interfaces/IOfflineBatch"; import { ILocalStorageProviderContext, IOfflineChannelConfiguration, IOfflineSenderConfig, IStorageTelemetryItem, eStorageProviders } from "./Interfaces/IOfflineProvider"; import { OfflineBatchHandler } from "./OfflineBatchHandler"; import { Sender } from "./Sender"; const version = "#version#"; const DefaultOfflineIdentifier = "OfflineChannel"; const DefaultBatchInterval = 15000; const DefaultInMemoMaxTime = 15000; const PostChannelIdentifier = "PostChannel"; const PersistenceKeys = [EventPersistence.Critical, EventPersistence.Normal]; interface IUrlLocalStorageConfig { iKey?: string; url: string; coreRootCtx: IProcessTelemetryContext; providerContext: ILocalStorageProviderContext; batchHandler: IOfflineBatchHandler; // simply use the current one, do not need to re-init minPersistenceCacheLevel: number; preListener?: INotificationListener; } let undefValue = undefined; const DefaultBatchSizeLimitBytes = 63000; // approx 64kb (the current Edge, Firefox and Chrome max limit) const defaultOfflineChannelConfig: IConfigDefaults = objDeepFreeze({ maxStorageSizeInBytes: { isVal: isGreaterThanZero, v: 5000000 }, storageKey: undefValue, minPersistenceLevel: { isVal: isValidPersistenceLevel, v: EventPersistence.Normal }, providers: [eStorageProviders.LocalStorage, eStorageProviders.IndexedDb], indexedDbName: undefValue, maxStorageItems: { isVal: isGreaterThanZero, v: undefValue}, inMemoMaxTime: { isVal: isGreaterThanZero, v: DefaultInMemoMaxTime}, maxRetry: {isVal: isGreaterThanZero, v: 1}, // 0 means no retry maxBatchsize:{ isVal: isGreaterThanZero, v: DefaultBatchSizeLimitBytes}, maxSentBatchInterval: { isVal: isGreaterThanZero, v: DefaultBatchInterval}, primaryOnlineChannelId: [BreezeChannelIdentifier, PostChannelIdentifier], overrideInstrumentationKey: undefValue, senderCfg: {} as IOfflineSenderConfig, splitEvts: false }); //TODO: add tests for sharedAnanlytics export class OfflineChannel extends BaseTelemetryPlugin implements IChannelControls { public identifier = DefaultOfflineIdentifier; public priority = 1000; // before channel (post = 1011 and sender = 1001, teechannel = 999, localstorage: 1009) public version = version; public id: string; constructor() { super(); dynamicProto(OfflineChannel, this, (_self, _base) => { // Internal properties used for tracking the current state, these are "true" internal/private properties for this instance let _hasInitialized; let _paused; let _sender: Sender; let _urlCfg: IUrlLocalStorageConfig; let _offlineListener: IOfflineListener; let _inMemoFlushTimer: ITimerHandler; let _inMemoTimerOut: number; let _diagLogger:IDiagnosticLogger; let _endpoint: string; let _maxBatchSize: number; let _sendNextBatchTimer: ITimerHandler; let _convertUndefined: any; let _retryAt: number; let _maxBatchInterval: number; let _consecutiveErrors: number; let _senderInst: IXHROverride; let _taskScheduler: ITaskScheduler; let _offineSupport: IInternalOfflineSupport; let _primaryChannelId: string; let _overrideIkey: string; let _evtsLimitInMemo: number; let _notificationManager: INotificationManager | undefined; let _isLazyInit: boolean; let _dependencyPlugin: IChannelControls; let _splitEvts: Boolean; let _inMemoMap: { [priority: EventPersistence]: InMemoryBatch }; _initDefaults(); _self.initialize = (coreConfig: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) => { if (!_hasInitialized) { _base.initialize(coreConfig, core, extensions); // keep setting hasInitialized status here to avoid re-initialize _hasInitialized = true; _diagLogger = _self.diagLog(); let evtNamespace = mergeEvtNamespace(createUniqueNamespace("OfflineSender"), core.evtNamespace && core.evtNamespace()); _offlineListener = createOfflineListener(evtNamespace); // TODO: add config to be passed _taskScheduler = createTaskScheduler(createAsyncPromise, "offline channel"); _notificationManager = core.getNotifyMgr(); } // TODO: add refresh inside timer until dependency plugin is initialized scheduleTimeout(() => { try { let _dependencyPlugin = _getDependencyPlugin(coreConfig, core); // make sure that online sender is initialized if (!_isLazyInit && _dependencyPlugin && _dependencyPlugin.isInitialized()) { _isLazyInit = true; _createUrlConfig(coreConfig, core, extensions, pluginChain); let ctx = _getCoreItemCtx(coreConfig, core, extensions, pluginChain); _sender.initialize(coreConfig, core, ctx, _diagLogger, _primaryChannelId, _self._unloadHooks); _senderInst = _sender.getXhrInst(); _offlineListener.addListener((val)=> { if (!val.isOnline) { _sendNextBatchTimer && _sendNextBatchTimer.cancel(); } else { _setSendNextTimer(); } }); // need it for first time to confirm if there are any events _setSendNextTimer(); } } catch (e) { // eslint-disable-next-line no-empty } }, 0); }; _self.processTelemetry = (evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => { try { let onlineStatus = _offlineListener.isOnline(); itemCtx = itemCtx || _self._getTelCtx(itemCtx); if (!!onlineStatus || !_offineSupport || !_endpoint) { // if we can't get url from online sender or core config, process next _self.processNext(evt, itemCtx); return; } if (_hasInitialized && !_paused ) { let shouldProcess = true; if (isFunction(_offineSupport.shouldProcess)) { shouldProcess = _offineSupport.shouldProcess(evt); } if (!shouldProcess) { _self.processNext(evt, itemCtx); return; } let item = evt as IPostTransmissionTelemetryItem; //TODO: add function to better get level item.persistence = item.persistence || (item.baseData && item.baseData.persistence) || EventPersistence.Normal; // in case the level is in baseData if (_shouldCacheEvent(_urlCfg, item) && _inMemoMap) { if (_overrideIkey) { item.iKey = _overrideIkey; } let added = _addEvtToMap(item); // inMemo is full if (!added) { _flushInMemoItems(false, item.persistence); let retry = _addEvtToMap(item); if (!retry) { _evtDropNotification([evt], EventsDiscardedReason.QueueFull); _throwInternal(_diagLogger, eLoggingSeverity.WARNING, _eInternalMessageId.InMemoryStorageBufferFull, "Maximum offline in-memory buffer size reached", true); } } // start timer when the first should-cache event added _setupInMemoTimer(); } else { // if should not cache,send event drop notification _evtDropNotification([item], EventsDiscardedReason.InvalidEvent); } return; } } catch (e) { // eslint-disable-next-line no-empty } // hand off the telemetry item to the next plugin _self.processNext(evt, itemCtx); }; _self.pause = () => { _paused = true; _clearScheduledTimer(); _consecutiveErrors = 0; _retryAt = null; }; _self.resume = () => { _paused = false; _clearScheduledTimer(); _setupInMemoTimer(); _setSendNextTimer(); }; _self.onunloadFlush = () => { if (!_paused) { while (_hasEvts()) { _flushInMemoItems(true); } // TODO: unloadprovider might send events out of order } }; _self.flush = (sync: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void | IPromise => { // TODO: should we implement normal flush return _self.onunloadFlush(); }; _self.getOfflineListener = () => { return _offlineListener; }; _self.sendNextBatch = () => { // TODO: add callback function return _offineSupport && _setSendNextTimer(); }; _self._doTeardown = (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => { _self.onunloadFlush(); _offlineListener && runTargetUnload(_offlineListener, false); let handler = _urlCfg && _urlCfg.batchHandler; handler && handler.teardown(); _clearScheduledTimer(); _initDefaults(); }; _self["_getDbgPlgTargets"] = () => { return [_urlCfg, _inMemoMap, _senderInst, _inMemoFlushTimer, _sendNextBatchTimer]; }; function _initDefaults() { _hasInitialized = false; _paused = false; _sender = new Sender(); _urlCfg = null; _offlineListener = null; _diagLogger = null; _endpoint = null; _convertUndefined = undefValue; _maxBatchSize = null; _sendNextBatchTimer = null; _consecutiveErrors = null; _retryAt = null; _maxBatchInterval = null; _senderInst = null; _offineSupport = null; _primaryChannelId = null; _overrideIkey = null; _evtsLimitInMemo = null; _isLazyInit = false; _dependencyPlugin = null; _splitEvts= false; _inMemoMap = null; } function _shouldCacheEvent(urlConfig: IUrlLocalStorageConfig, item: IPostTransmissionTelemetryItem) { if ((item.persistence) < urlConfig.minPersistenceCacheLevel) { return false; } return true; } function _setupInMemoTimer() { if (!_inMemoFlushTimer) { _inMemoFlushTimer = scheduleTimeout(() => { _flushInMemoItems(); let hasEvts = _hasEvts(); if (hasEvts && _inMemoFlushTimer) { _inMemoFlushTimer.refresh(); } _setSendNextTimer(); }, _inMemoTimerOut); _inMemoFlushTimer.unref(); } else { // Restart the timer if not already running https://nevware21.github.io/ts-utils/typedoc/interfaces/ITimerHandler.html#enabled _inMemoFlushTimer.enabled = true; } } //flush only flush max batch size event, may still have events lefts function _flushInMemoItems(unload?: boolean, mapKey?: number | EventPersistence) { try { // TODO: add while loop to flush everything let hasEvts = false; // can use objForEachKey(_inMemoMap, (key)), but keys returned by this function is always string arrForEach(PersistenceKeys, (key) => { let inMemoBatch: InMemoryBatch = _inMemoMap[key]; let inMemo = inMemoBatch; let evts = inMemo && inMemo.getItems(); if (!evts || !evts.length) { return; } if (_splitEvts && mapKey && mapKey !== key) { // if split evts is set to true // specific mapkey is defined // for key !== mapkey, only check if there are any events left in order to refresh timer hasEvts = hasEvts || !!evts.length; return; } let payloadArr:string[] = []; let size = 0; let idx = -1; let criticalCnt = 0; arrForEach(evts, (evt, index) => { let curEvt = evt as IPostTransmissionTelemetryItem idx = index; let payload = _getPayload(curEvt); size += payload.length; if (size > _maxBatchSize) { return; } if(curEvt.persistence == EventPersistence.Critical) { criticalCnt ++; } idx = index; payloadArr.push(payload); }); if (!payloadArr.length) { return; } let sentItems = evts.slice(0, idx + 1); if (idx + 1 < evts.length) { // keep track if there is any remaining events hasEvts = true; } _inMemoMap[key] = inMemoBatch.createNew(_endpoint, arrSlice(inMemo.getItems(),idx + 1), _evtsLimitInMemo); let payloadData: IStorageTelemetryItem = null; if (_offineSupport && _offineSupport.createOneDSPayload) { payloadData = _offineSupport.createOneDSPayload(sentItems); if (payloadData) { payloadData.criticalCnt = criticalCnt; } } else { payloadData = _constructPayloadData(payloadArr, criticalCnt); } let callback: OfflineBatchStoreCallback = (res) => { if (!res || !res.state) { return null; } let state = res.state; if (state == eBatchStoreStatus.Failure) { if (!unload) { // for unload, just try to add each batch once arrForEach(sentItems, (item) => { _addEvtToMap(item); }); _setupInMemoTimer(); } else { // unload, drop events _evtDropNotification(sentItems, EventsDiscardedReason.NonRetryableStatus); } } else { // if eBatchStoreStatus is success _storeNotification(sentItems); } }; if (payloadData && _urlCfg && _urlCfg.batchHandler) { let promise = _urlCfg.batchHandler.storeBatch(payloadData, callback, unload); _queueStorageEvent("storeBatch", promise); } }); // this is outside loop if (!hasEvts) { _inMemoFlushTimer && _inMemoFlushTimer.cancel(); } } catch (e) { // eslint-disable-next-line no-empty } return null; } function _setSendNextTimer() { const isOnline = _offlineListener && _offlineListener.isOnline(); if(!_sendNextBatchTimer) { let retryInterval = _retryAt ? mathMax(0, _retryAt - dateNow()) : 0; let timerValue = mathMax(_maxBatchInterval, retryInterval); _sendNextBatchTimer = scheduleTimeout(() => { if (_offlineListener && _offlineListener.isOnline()) { // is no isCompletelyIdle function is available, assume we can send if(isFunction(_sender.isCompletelyIdle) && !_sender.isCompletelyIdle()) { _sendNextBatchTimer && _sendNextBatchTimer.refresh(); } else { let callback: OfflineBatchCallback = (res) => { let state = res && res.state; if (state !== eBatchSendStatus.Complete) { _consecutiveErrors ++; } let data = res && res.data; if (state === eBatchSendStatus.Complete && data) { // if status is complete and data is null, means no data _sentNotification(data as IPayloadData); _sendNextBatchTimer && _sendNextBatchTimer.refresh(); } if (state === eBatchSendStatus.Drop) { batchDropNotification(_notificationManager, 1, eBatchDiscardedReason.NonRetryableStatus); } } if (_urlCfg && _urlCfg.batchHandler) { let promise = _urlCfg.batchHandler.sendNextBatch(callback, false, _senderInst); _queueStorageEvent("sendNextBatch", promise); } } } else { _sendNextBatchTimer && _sendNextBatchTimer.cancel(); } // if offline, do nothing; },timerValue); _sendNextBatchTimer.unref(); } else { // only restart it when online if (isOnline) { _sendNextBatchTimer.enabled = true; _sendNextBatchTimer.refresh(); } // if offline, do noting } } function _clearScheduledTimer() { _inMemoFlushTimer && _inMemoFlushTimer.cancel(); _sendNextBatchTimer && _sendNextBatchTimer.cancel(); _inMemoFlushTimer = null; _sendNextBatchTimer = null; } function _queueStorageEvent(taskName: string, task: T | IPromise) { if (_taskScheduler) { _taskScheduler.queue(() => { return task; }, taskName).catch((reason) => { // Just handling any rejection to avoid an unhandled rejection event }); } } function _setRetryTime(linearFactor: number = 1) { const SlotDelayInSeconds = 10; let delayInSeconds: number; if (_consecutiveErrors <= 1) { delayInSeconds = SlotDelayInSeconds; } else { const backOffSlot = (Math.pow(2, _consecutiveErrors) - 1) / 2; // tslint:disable-next-line:insecure-random let backOffDelay = mathFloor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1; backOffDelay = linearFactor * backOffDelay; delayInSeconds = mathMax(mathMin(backOffDelay, 3600), SlotDelayInSeconds); } // TODO: Log the backoff time like the C# version does. let retryAfterTimeSpan = dateNow() + (delayInSeconds * 1000); // TODO: Log the retry at time like the C# version does. _retryAt = retryAfterTimeSpan; } function _getCoreItemCtx(coreConfig: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) { if (coreConfig) { // Make sure the extensionConfig exists coreConfig.extensionConfig = coreConfig.extensionConfig || {}; } if (!pluginChain && core) { // Get the first plugin from the core pluginChain = core.getProcessTelContext().getNext(); } let nextPlugin: IPlugin = null; let rootNext = _self._getTelCtx().getNext(); if (rootNext) { nextPlugin = rootNext.getPlugin(); } return createProcessTelemetryContext(pluginChain, coreConfig, core, nextPlugin); } function _getPayload(evt: IPostTransmissionTelemetryItem | ITelemetryItem) { try { if (evt) { return _offineSupport && _offineSupport.serialize(evt, _convertUndefined); } } catch (e) { // eslint-disable-next-line no-empty } return null; } function _constructPayloadData(payloadArr: string[], criticalCnt?: number) { try { if (!_offineSupport) { return null; } let cnt = criticalCnt || 0; let payload = _offineSupport.batch(payloadArr); let payloadData = _offineSupport.createPayload && _offineSupport.createPayload(payload) as IStorageTelemetryItem; if (payloadData) { payloadData.criticalCnt = cnt; return payloadData; } } catch(e) { // eslint-disable-next-line no-empty } return null; } function _createUrlConfig(coreConfig: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) { _self._addHook(onConfigChange(coreConfig, (details) => { if (!isString(coreConfig.instrumentationKey) || !isString(coreConfig.endpointUrl)) { // if ikey or endpointUrl is promise, delay initialization _self.pause(); return; } if (_paused) { _self.resume(); } let storageConfig: IOfflineChannelConfiguration = null; let theConfig = details.cfg; let ctx = createProcessTelemetryContext(null, theConfig, core); storageConfig = ctx.getExtCfg(_self.identifier, defaultOfflineChannelConfig); // let channelIds = storageConfig.primaryOnlineChannelId; let onlineUrl = null; let channel = _getDependencyPlugin(coreConfig, core); if (!!channel.isInitialized() && isFunction(channel.getOfflineSupport)) { _offineSupport = channel.getOfflineSupport(); onlineUrl = isFunction(_offineSupport && _offineSupport.getUrl) && _offineSupport.getUrl(); } else { return; } _overrideIkey = storageConfig.overrideInstrumentationKey; let urlConfig: IUrlLocalStorageConfig = _urlCfg; let curUrl = onlineUrl || coreConfig.endpointUrl || _endpoint; // NOTE: should add default endpoint value to core as well if (curUrl !== _endpoint) { let coreRootCtx = _getCoreItemCtx(coreConfig, core, extensions, pluginChain); let providerContext: ILocalStorageProviderContext = { itemCtx: coreRootCtx, storageConfig: storageConfig, id: _self.id, endpoint: curUrl, notificationMgr: _notificationManager }; let oriHandler = _urlCfg && _urlCfg.batchHandler; try { oriHandler && oriHandler.teardown(); } catch(e) { // eslint-disable-next-line no-empty } let handler = new OfflineBatchHandler(_self.diagLog(), _self._unloadHooks); handler.initialize(providerContext); urlConfig = { iKey: coreConfig.instrumentationKey as string, url: curUrl, minPersistenceCacheLevel: storageConfig.minPersistenceLevel, coreRootCtx: coreRootCtx, providerContext: providerContext, batchHandler: handler }; _evtsLimitInMemo = storageConfig.eventsLimitInMem; _inMemoMap = _inMemoMap || {}; let newMap = {}; // transfer previous events to new buffer arrForEach(PersistenceKeys, (key) => { // when init map, we will initize a in memo batch for each EventPersistence key // evts to be transferred to new inMemo map let evts = null; if ( _inMemoMap && _inMemoMap[key]) { let inMemoBatch = _inMemoMap[key]; let curEvts = inMemoBatch && inMemoBatch.getItems(); if (curEvts && curEvts.length) { evts = arrSlice(curEvts); inMemoBatch && inMemoBatch.clear(); } } newMap[key] = new InMemoryBatch(_self.diagLog(), curUrl, evts, _evtsLimitInMemo); }); _inMemoMap = newMap; _inMemoTimerOut = storageConfig.inMemoMaxTime; let onlineConfig = ctx.getExtCfg(_primaryChannelId, {}) || {}; _convertUndefined = onlineConfig.convertUndefined; _endpoint = curUrl; _setRetryTime(); _maxBatchInterval = storageConfig.maxSentBatchInterval; _maxBatchSize = storageConfig.maxBatchsize; _splitEvts = storageConfig.splitEvts; } _urlCfg = urlConfig; _endpoint = curUrl; })); } function _getDependencyPlugin(coreConfig: IConfiguration & IConfig, core: IAppInsightsCore) { if (!_dependencyPlugin) { let ctx = createProcessTelemetryContext(null, coreConfig, core); let storageConfig = ctx.getExtCfg(_self.identifier, defaultOfflineChannelConfig); let channelIds = storageConfig.primaryOnlineChannelId; if (channelIds && channelIds.length) { arrForEach(channelIds, (id) => { let plugin = core.getPlugin(id); let channel = plugin && plugin.plugin; if (channel) { _dependencyPlugin = channel; return; } }); } } return _dependencyPlugin; } function _hasEvts() { let hasEvts = false; objForEachKey(_inMemoMap, (key) => { let inMemoBatch = _inMemoMap[key]; if (inMemoBatch && inMemoBatch.count()) { hasEvts = true; return -1; } }); return hasEvts; } function _addEvtToMap(item:IPostTransmissionTelemetryItem) { // if split evts is false, all events will be saved into EventPersistence.Normal batch let mapKey = EventPersistence.Normal; if (_splitEvts && item.persistence) { mapKey = item.persistence; } let inMemoBatch = _inMemoMap[mapKey]; return inMemoBatch.addEvent(item); } function _callNotification(evtName: string, theArgs: any[]) { callNotification(_notificationManager, evtName, theArgs); } function _evtDropNotification(events: ITelemetryItem[] | IPostTransmissionTelemetryItem[], reason: number | EventsDiscardedReason ) { if (events && events.length) { _callNotification(EVT_DISCARD_STR, [events, reason]); } return; } function _sentNotification(batch: IPayloadData) { if (batch && batch.data) { _callNotification(EVT_SENT_STR, [batch]); } return; } function _storeNotification(events: ITelemetryItem[] | IPostTransmissionTelemetryItem[]) { if (events && events.length) { _callNotification(EVT_STORE_STR, [events]); } return; } }); } /* ================================================================================================================ * DO NOT add any code to these empty implementations as any code defined here will be removed, as * this class is using @dynamicProto which will implement the methods during the execution of the * dynamicProto() in the constructor. * * The final generated files will also have these implementations removed as part of the packaging process. * * These empty definitions exists only to keep the generated TypeScript definition files aligned with the * actual resulting implementation, this is so that TS is still happy to create extension classes from the * resulting definitions. * * This also keeps the generated *.d.ts files and documentation the same as they where prior to using dynamicProto() */ /** * The function does the initial set up. It adds a notification listener to determine which events to remove. * @param coreConfig - The core configuration. * @param core - The AppInsights core. * @param extensions - An array of all the plugins being used. */ public initialize(coreConfig: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Process an event to add it to the local storage and then pass it to the next plugin. * @param event - The event that needs to be stored. * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances * can optionally use this to access the current core instance or define / pass additional information * to later plugins (vs appending items to the telemetry item) */ public processTelemetry(evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } // ================================================================================================================ /** * Pauses the adding of new events to the plugin. Also calls pause on the next * plugin. */ public pause(): void { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Resumes the adding of new events to the plugin. Also calls resume on * the next plugin. Adds all events in storage to the next plugin. */ public resume(): void { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Get offline listener * @returns offline listener */ public getOfflineListener() { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } /** *No op */ public flush(sync: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void | IPromise { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Flush the batched events synchronously (if possible -- based on configuration). * Will not flush if the Send has been paused. */ public onunloadFlush() { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Flush the next stored event batch */ public sendNextBatch() { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } } ================================================ FILE: channels/offline-channel-js/src/PayloadHelper.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import dynamicProto from "@microsoft/dynamicproto-js" import { IDiagnosticLogger, _eInternalMessageId, _throwInternal, eLoggingSeverity, isFunction } from "@microsoft/applicationinsights-core-js"; import { base64Decode, base64Encode } from "./Helpers/Utils"; import { IStorageTelemetryItem } from "./Interfaces/IOfflineProvider"; export class PayloadHelper { constructor(logger: IDiagnosticLogger) { dynamicProto(PayloadHelper, this, (_self) => { /** * Deserializes the current stringto a JSON object. */ _self.base64ToArr = (input: IStorageTelemetryItem): IStorageTelemetryItem => { if (!input || !input.isArr) { return input; } try { let data = input.data; if (data) { input.data = base64Decode(data as any); } return input; } catch (e) { // if serialization fails return an empty string _throwInternal(logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.CannotSerializeObject, (e && isFunction(e.toString)) ? e.toString() : "Error serializing object", null, true); } return null; } _self.base64ToStr = (item: IStorageTelemetryItem): IStorageTelemetryItem => { if (!item || !item.isArr) { return item; } try { let data = item.data; if (data) { item.data = base64Encode(data as any); } return item; } catch (e) { // if serialization fails return an empty string _throwInternal(logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.CannotSerializeObject, (e && isFunction(e.toString)) ? e.toString() : "Error serializing object", null, true); } return null; } }); } /** * Decode the JSON string back to Uint8 array. */ public base64ToArr(input: IStorageTelemetryItem): IStorageTelemetryItem { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Code the Uint8 array object to string. */ public base64ToStr(item: IStorageTelemetryItem): IStorageTelemetryItem { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } } ================================================ FILE: channels/offline-channel-js/src/Providers/IndexDbHelper.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import dynamicProto from "@microsoft/dynamicproto-js"; import { IDiagnosticLogger, getGlobalInst } from "@microsoft/applicationinsights-core-js"; import { IPromise, StartQueuedTaskFn, createAsyncPromise, createAsyncRejectedPromise, createAsyncResolvedPromise, createTaskScheduler, doAwait, doAwaitResponse } from "@nevware21/ts-async"; import { getGlobal, isFunction, isPromiseLike, isString } from "@nevware21/ts-utils"; import { CursorProcessResult, IDbContext, IIndexedDbDetails, IIndexedDbOpenDbContext, IIndexedDbSimpleQuery, IIndexedDbStoreActionContext, IProcessCursorState } from "../Interfaces/IOfflineIndexDb"; //TODO: move all const to one file //TODO: handle db names const IndexedDBNames: string[] = ["indexedDB"/*, 'mozIndexedDB', 'webkitIndexedDB', 'msIndexedDb'*/]; const DbReadWrite = "readwrite"; const Result = "result"; const ErrorMessageUnableToOpenDb = "DBError: Unable to open database"; const ErrorMessageDbUpgradeRequired = "DBError: Database upgrade required"; const ErrorMessageDbNotOpen = "Database is not open"; const ErrorMessageDbDoesNotExist = "DBError: Database does not exist"; const ErrorMessageFailedToDeleteDatabase = "DBError: Failed to delete the database"; const ErrorMessageDbNotSupported = "DBError: Feature not supported"; const ErrorMessageFailedToOpenCursor = "DBError: Failed to Open Cursor"; //window.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.msIDBTransaction; //window.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.msIDBKeyRange; // By placing this variable here it becomes a global hidden static /** * This is used to enforce sequential access to the IndexedDb, so that all operations don't interfere * with each other, this is REALLY useful to ensure that any previous operation has completed before * subsequent operations are completed -- especially for testing using different IndexedDbHelper instances. */ let _dbContext: IDbContext[] = []; /** * Constructs the IDbContext instance * @param dbName - The current database name * @param diagLog - The diagnostics logger to use */ function _getDbContext(dbName: string, diagLog?: IDiagnosticLogger): IDbContext { let dbCtx: IDbContext = null; for (let lp = 0; lp < _dbContext.length; lp++) { dbCtx = _dbContext[lp]; if (dbCtx.name === dbName) { return dbCtx; } } // Create the global handle for the database dbCtx = { name: dbName, sch: createTaskScheduler(createAsyncPromise, "IndexedDbHelper[" + dbName + "]"), dbHdl: [], add: (db: IDBDatabase) => { dbCtx.dbHdl.push(db); _debugLog(dbName, "- dbOpened (add) -- hdls [" + dbCtx.dbHdl.length + "]"); }, remove: (db: IDBDatabase) => { let hdls = dbCtx.dbHdl; for (let lp = 0; lp < hdls.length; lp++) { if (hdls[lp] === db) { hdls.splice(lp, 1); break; } } _debugLog(dbName, "- dbClosed (remove) -- hdls [" + dbCtx.dbHdl.length + "]"); }, isOpen: (): boolean => { return dbCtx.dbHdl.length > 0; }, openHdl: (): IDBDatabase => { if (dbCtx.dbHdl.length > 0) { return dbCtx.dbHdl[0]; } return null; } }; _dbContext.push(dbCtx); return dbCtx; } /** * Schedule an event that will execute the startEvent after all outstanding events are resolved or if any event rejects the optional * rejectEvent will be executed. This is used to ensure that we don't attempt to execute events out of order such as attempting to removed * an event from the indexedDb before the insertion of the event has completed. Only one of the startEvent or unableToStateEvent callbacks * functions will be called. * @param startEvent - The event to execute after all outstanding events are complete, may be called synchronously or asynchronously. * @param actionName - The name of the action being performed */ function _scheduleEvent(dbName: string, actionName: string, startEvent: StartQueuedTaskFn, evtTimeOut?: number): IPromise { // Create or fetch the current scheduler for this dbName let dbCtx = _getDbContext(dbName); return dbCtx.sch.queue(startEvent, actionName, evtTimeOut); } // TODO: move to common to be able to used by lds export function getDbFactory(): IDBFactory { let global = getGlobal() || ({} as Window); let dbFactory: IDBFactory = null; if (global) { try { for (let lp = 0; lp < IndexedDBNames.length; lp++) { dbFactory = (global[IndexedDBNames[lp]] as IDBFactory); if (dbFactory && isFunction(dbFactory.open)) { return dbFactory; } } } catch (e) { dbFactory = null; } } return dbFactory; } function _debugLog(dbName: string, message: string) { // Only log if running within test harness if (getGlobalInst("QUnit")) { // tslint:disable-next-line:no-console console && console.log("IndexedDbHelper [" + dbName + "] " + message); } } /** * Helper method to map an Event rejection to a reject with a message, this is mainly for terminal errors where the * IndexedDb API returns an event which we are going to ignore * @param rejectMessage * @param rejectFunc */ function _eventReject(dbName: string, rejectMessage: string, rejectFunc: (reason?: any) => void, evtName: string) { return function(evt: Event) { rejectFunc(new Error(rejectMessage)); _debugLog(dbName, "[" + evtName + "] event rejected"); }; } // This helper is designed to allow multiple database implementation // The IndexedDB provider will be using only one database with different stores. // for each transaction, will open a new connection export class IndexedDbHelper { constructor(diagLog?: IDiagnosticLogger) { let _dbFactory = getDbFactory() || null; dynamicProto(IndexedDbHelper, this, (_this) => { _this.isAvailable = (): boolean => { return !!_dbFactory; }; /** * Schedules the opening of the database if not already open */ _this.openDb = ( dbName: string, dbVersion: number, processFunc: (dbContext: IIndexedDbOpenDbContext) => T | IPromise, versionChangeFunc?: (dbContext: IIndexedDbOpenDbContext) => IPromise): IPromise => { // Schedule the database to be opened return _scheduleEvent(dbName, "openDb", (evtName) => { return createAsyncPromise((openResolve, openReject) => { let createdNewDb = false; function _createDbCtx(dbContext: IDbContext, db: IDBDatabase, dbOpenRequest: IDBOpenDBRequest, isNew: boolean, isUpgrade?: boolean): IIndexedDbOpenDbContext { let crDbCtx: IIndexedDbOpenDbContext = { db: db, dbName: dbName, dbVersion: dbVersion, ctx: null, isNew: isNew, txn: dbOpenRequest ? dbOpenRequest.transaction : null // Special case see the versionChangeFunc usage below }; if (!isUpgrade) { crDbCtx.openStore = (eventTable: string, doAction: (store: IIndexedDbStoreActionContext) => IPromise|R|void): IPromise => { return _openStore(crDbCtx, eventTable, doAction); }; crDbCtx.openCursor = (eventTable: string, query: string|IIndexedDbSimpleQuery, cursorFunc?: (state: IProcessCursorState, value: R, values: R[]) => CursorProcessResult): IPromise => { return _openCursor(crDbCtx, eventTable, query, cursorFunc); }; } return crDbCtx; } // TODO: add function to handle version change function _databaseUpgrade(db: IDBDatabase, dbOpenRequest: IDBOpenDBRequest, ev?: Event) { _debugLog(dbName, "db upgrade called") let upgDbCtx = _createDbCtx(null, db, dbOpenRequest, true, true); if (!versionChangeFunc) { try { dbOpenRequest.transaction && dbOpenRequest.transaction.abort(); dbOpenRequest.result && dbOpenRequest.result.close(); // close database to unblock others } finally { openReject(new Error(ErrorMessageDbUpgradeRequired)); } return; } createdNewDb = true; doAwaitResponse(versionChangeFunc(upgDbCtx), (response) => { if (!response.rejected) { // Special case handling, when a DB is first created calling createObjectStore() will // automatically start a version change transaction which will block all other transactions // from getting created, so we save the auto opened on here for reuse as part of opening the store _debugLog(upgDbCtx.dbName, "on version change success") if (!upgDbCtx.txn) { upgDbCtx.txn = dbOpenRequest.transaction; _debugLog(upgDbCtx.dbName, "added open request") } } else { // Abort the upgrade event try { dbOpenRequest.transaction && dbOpenRequest.transaction.abort(); } finally { openReject(response.reason); } } }); } function _databaseOpen(db: IDBDatabase, dbOpenRequest: IDBOpenDBRequest) { // Save the IDBDatabase handle to the global reference (so we can make sure we can close/delete the Db) // Also used to track the number of times the DB has been opened let opDbCtx = _getDbContext(dbName); opDbCtx.add(db); db.onabort = (evt: Event) => { _debugLog(dbName, "onabort -- closing the Db"); opDbCtx.remove(db); }; db.onerror = (evt: Event) => { _debugLog(dbName, "onerror -- closing the Db"); opDbCtx.remove(db); }; (db as any).onclose = (evt: Event) => { _debugLog(dbName, "onclose -- closing the Db"); opDbCtx.remove(db); }; db.onversionchange = (evt: Event) => { _debugLog(dbName, "onversionchange -- force closing the Db"); db.close(); opDbCtx.remove(db); }; let openDbCtx: IIndexedDbOpenDbContext = null; let dbHdl: IDBDatabase = null; if (opDbCtx.dbHdl.length > 0) { dbHdl = opDbCtx.dbHdl[0]; } openDbCtx = _createDbCtx(opDbCtx, dbHdl, dbOpenRequest, createdNewDb); try { // Database has been opened doAwait(processFunc(openDbCtx), openResolve, openReject); } catch (e) { openReject(e); } } let dbCtx = _getDbContext(dbName); if (_dbFactory == null) { openReject(new Error("No available storage factory")); } else if (dbCtx.isOpen()) { // Database is already open let openDbCtx = _createDbCtx(dbCtx, dbCtx.openHdl(), null, false); doAwait(processFunc(openDbCtx), openResolve, openReject); } else { let dbOpenRequest = _dbFactory.open(dbName, dbVersion); if (!dbOpenRequest) { throw new Error("missing API"); // in case, some corners case (such as private mode for certain browsers) does not support open db } // We can't open the database, possible issues are // - We are attempting to open the db as a different version but it's already open dbOpenRequest.onblocked = (evt: Event) => { _debugLog(dbName, "Db Open Blocked event [" + evtName + "] - " + (dbOpenRequest.error || "")) openReject(new Error(ErrorMessageUnableToOpenDb)); }; dbOpenRequest.onerror = (evt: Event) => { _debugLog( dbName,"Db Open Error event [" + evtName + "] - " + (dbOpenRequest.error || "")) openReject(new Error(ErrorMessageUnableToOpenDb)); }; dbOpenRequest.onupgradeneeded = (evt: Event) => { _debugLog(dbName, "Db Open Create/Upgrade needed event [" + evtName + "]"); try { let db = evt.target[Result] || dbOpenRequest.result; if (!db) { _debugLog(dbName, "no db"); openReject(new Error(ErrorMessageUnableToOpenDb)); return; } _databaseUpgrade(db, dbOpenRequest, evt); } catch (e) { _eventReject(dbName, ErrorMessageUnableToOpenDb, openReject, evtName)(e); } }; dbOpenRequest.onsuccess = (evt) => { _debugLog(dbName, "Db Open sucess [" + evtName + "]"); let db = evt.target[Result]; if (!db) { openReject(new Error(ErrorMessageUnableToOpenDb)); return; } _databaseOpen(db, dbOpenRequest); }; } }); }); }; _this.closeDb = (dbName: string): void => { // Schedule the close so we don't interrupt an previous scheduled operations _debugLog(dbName, "close db"); _scheduleEvent(dbName, "closeDb", (evtName) => { let dbCtx = _getDbContext(dbName); let dbHdls = dbCtx.dbHdl; let len = dbHdls.length; if (len > 0) { for (let lp = 0; lp < len; lp++) { // Just call close the db.onclose() event should take care of decrementing and removing the references dbHdls[lp].close(); } dbCtx.dbHdl = []; } return 1; }).catch((reason) => { // Handle promise rejection to avoid an unhandled rejection event }); }; _this.deleteDb = (dbName: string): boolean | IPromise => { if (_dbFactory == null) { return false; } return _scheduleEvent(dbName, "deleteDb", (evtName) => { // Implicitly close any open db first as this WILL block the deleting let dbCtx = _getDbContext(dbName); let dbHdls = dbCtx.dbHdl; let len = dbHdls.length; if (len > 0) { _debugLog(dbName, "Db is open [" + len + "] force closing"); for (let lp = 0; lp < len; lp++) { // Just call close the db.onclose() event should take care of decrementing and removing the references dbHdls[lp].close(); } // Clear all of the existing handles as we have forced closed them and for compatibility we can't // rely on the db onclose event dbCtx.dbHdl = []; } return createAsyncPromise((deleteResolve, deleteReject) => { // Attempting to delete the Db, only after we wait so that any outstanding operations can finish setTimeout(() => { try { _debugLog(dbName, "[" + evtName + "] starting"); let dbRequest = _dbFactory.deleteDatabase(dbName); dbRequest.onerror = (evt: Event) => { deleteReject(new Error(ErrorMessageFailedToDeleteDatabase)); }; dbRequest.onblocked = (evt: Event) => { deleteReject(new Error(ErrorMessageFailedToDeleteDatabase)); }; dbRequest.onupgradeneeded = (evt: Event) => { deleteReject(new Error(ErrorMessageFailedToDeleteDatabase)); }; dbRequest.onsuccess = (evt: Event) => { _debugLog(dbName, "[" + evtName + "] complete"); deleteResolve(true); }; _debugLog(dbName, "[" + evtName + "] started"); } catch (e) { deleteReject(new Error(ErrorMessageFailedToDeleteDatabase + " - " + e)); } }, 0); }); }); }; _this.getDbDetails = (dbName: string): IPromise => { return _scheduleEvent(dbName, "getDbDetails", (evtName) => { if (_dbFactory == null || !(_dbFactory as any).databases) { // Either IndexedDb is not supported or databases is not supported return createAsyncRejectedPromise(new Error(ErrorMessageDbNotSupported)); } return createAsyncPromise((databasesResolve, databasesReject) => { // databases() is still experimental, so it's not fully available // The promise will reject if there is a JS error let dbPromise = (_dbFactory as any).databases(); dbPromise.then((databases) => { for (let lp = 0; lp < databases.length; lp++) { if (databases[lp].name === dbName) { databasesResolve(databases[lp]); return; } } databasesReject(new Error(ErrorMessageDbDoesNotExist)); }, databasesReject); }); }, 2000); }; function _createStoreContext(openDbCtx: IIndexedDbOpenDbContext, eventTable: string): IIndexedDbStoreActionContext { // Save the current handle so we close the correct one during the transaction events let dbHdl: IDBDatabase = openDbCtx.db || null; // Check if the openDb event created a transaction that we should reuse let tx: IDBTransaction = dbHdl && dbHdl.transaction(eventTable, DbReadWrite); if (tx) { // The transaction was aborted and therefore the adding of the event failed tx.onabort = () => { // add log }; tx.onerror = () => { // add log }; // Note we don't listen for the transaction onComplete event as we don't have any value // to resolve the promise with, we are relying on the doAction() to resolve and the exception // handling below to ensure we don't deadlock. tx.oncomplete = () => { // We need to capture the transaction close event as not all browsers are triggering the db onclose event _debugLog(openDbCtx.dbName, "txn.oncomplete"); }; // Ok, so now we have the transaction handling setup lets try and store the event return { db: openDbCtx, store: tx.objectStore(eventTable), tx: tx, tbl: eventTable, openCursor: ( query: string|IIndexedDbSimpleQuery, processFunc?: (state: IProcessCursorState, value: T, values: T[]) => CursorProcessResult): IPromise => { return _openCursor(openDbCtx, eventTable, query, processFunc); }, newTransaction: (doAction: (store: IIndexedDbStoreActionContext) => IPromise): IPromise => { return _openStore(openDbCtx, eventTable, doAction); } }; } return null; } /** * Opens the specific store for the database * @param openDbCtx * @param eventTable * @param doAction */ function _openStore(openDbCtx: IIndexedDbOpenDbContext, eventTable: string, doAction: (store: IIndexedDbStoreActionContext) => IPromise|T|void): IPromise { // While the open DB promise may have been resolved we still might not have opened the DB (This is to ensure that // non-critical failures don't cause event execution out of order) if (!openDbCtx || !openDbCtx.db) { // Database is not open so pass the only option is to resolve the event so it's passed onto the next on the event to the next chain return createAsyncRejectedPromise(new Error(ErrorMessageDbNotOpen)); } try { // Perform the transaction action let result = doAction(_createStoreContext(openDbCtx, eventTable)); if (isPromiseLike(result)) { return result; } return createAsyncResolvedPromise(result as T); } catch (e) { return createAsyncRejectedPromise(e); } } function _openCursor( openDbCtx: IIndexedDbOpenDbContext, eventTable: string, query: string | IIndexedDbSimpleQuery, processFunc?: (state: IProcessCursorState, value: T, values: T[]) => CursorProcessResult): IPromise { // While the open DB promise may have been resolved we still might not have opened the DB (This is to ensure that // non-critical failures don't cause event execution out of order) if (!openDbCtx || !openDbCtx.db) { // Database is not open so pass the only option is to resolve the event so it's passed onto the next on the event to the next chain return createAsyncRejectedPromise(new Error(ErrorMessageDbNotOpen)); } let simpleQuery: IIndexedDbSimpleQuery = null; if (query && isString(query)) { simpleQuery = new SimpleQuery(query as string); } else if (query && (query as any).isMatch) { // simple check to make sure this is a IIndexedDbSimpleQuery simpleQuery = (query as IIndexedDbSimpleQuery); } return createAsyncPromise((openCursorResolve, openCursorReject) => { let values: T[] = []; let cursorRequest: IDBRequest = null; let queryKeyRange = null; if (simpleQuery && simpleQuery.keyRange) { queryKeyRange = simpleQuery.keyRange(); } let storeCtx = _createStoreContext(openDbCtx, eventTable); if (queryKeyRange) { cursorRequest = storeCtx.store.openCursor(queryKeyRange); } else { cursorRequest = storeCtx.store.openCursor(); } cursorRequest.onerror = _eventReject(storeCtx.db.dbName, ErrorMessageFailedToOpenCursor, openCursorReject, "openCursor"); cursorRequest.onsuccess = (evt: Event) => { // Cursor was open/next iteration let cursor: IDBCursorWithValue = evt.target[Result]; if (!cursor) { // This occurs when we get to the end of the cursor iteration openCursorResolve(values); return; } let processCursorState: IProcessCursorState = { store: storeCtx, cursor: cursor, continue: () => { cursor.continue(); }, // Moves to the next matching item done: () => { openCursorResolve(values); } // Stops the cursor processing }; var value = cursor.value; if (simpleQuery && !simpleQuery.isMatch(value)) { processCursorState.continue(); return; } if (processFunc) { try { switch (processFunc(processCursorState, value, values)) { case CursorProcessResult.Complete: openCursorResolve(values); break; case CursorProcessResult.Waiting: // The process method now controls whether th break; case CursorProcessResult.Continue: default: processCursorState.continue(); break; } } catch (ex) { // Make sure the reject the promise if the processFunc callback throws unexpectable openCursorReject(ex); } } else { values.push(value); processCursorState.continue(); } }; }); } }); } /** * Identifies whether an IndexedDb api is available */ public isAvailable(): boolean { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return false; } public openDb( dbName: string, dbVersion: number, processFunc: (dbContext: IIndexedDbOpenDbContext) => T | IPromise, versionChangeFunc?: (dbContext: IIndexedDbOpenDbContext) => IPromise): IPromise { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return; } /** * Request that any open database handles for the named database be closed. * This method will return immediately, however, the scheduled event to close the open Db handles will not occur until all outstanding database operations * (openDb, deleteDb, getDbDetails) started by IndexedDbHelper for the named db have completed. This will NOT affect or wait for any open database handles * which have been directly opened by the IndexedDB Api. * @param dbName - The name of the database to close, no error will be returned if the database does not exist or was not opened. */ public closeDb(dbName: string): void { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } /** * Request that the named database should be deleted, this implicitly closes any previously opened database that was opened via IndexedDBHelper. * It will also wait for all Promise objects from previous openDb, closeDb, getDbDetails to complete (resolve or reject) before attempting to * perform the delete operation. This operation may block or fail if the database is opened outstide of the IndexedDbHelper * The returned promise will be resolved or rejected depending on the outcome of the delete operation. * @param dbName - The name of the database to delete */ public deleteDb(dbName: string): boolean | IPromise { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return; } /** * Attempt to return the details (version) of the named database if possible. * This method requires that the underlying browser support draft specification for IDBFactory.databases, if this is not supported then the returned * Promise will be rejected with an error message stating that the feature is not supported. * The returned Promise will be resolved with the details if available or rejected on error. * @param dbName - The name of the database to request the details for */ public getDbDetails(dbName: string): IPromise { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return; } } /** * Internal value used by the SimpleQuery to identify the type of search being performed */ const enum ValueQueryType { StartsWith = 0, Contains = 1 } /** * Internal Interface used by the SimpleQuery class to define the cursor search definition */ interface IValueQuery { name: string; value: string; type: ValueQueryType; } /** * A simple query interface to provide a simple cursor query (IDBKeyRange) key range and matching. * Used by the openCursor() method. */ class SimpleQuery implements IIndexedDbSimpleQuery { constructor(theQuery?: string) { let _queryCols: IValueQuery[] = []; let _keyRange: IDBKeyRange = null; dynamicProto(SimpleQuery, this, (_this) => { _this.keyRange = () => { return _keyRange; }; _this.parseQuery = (query: string) => { _queryCols = []; if (query) { let items = query.split(";"); for (let lp = 0; lp < items.length; lp++) { let item = items[lp]; let idx = item.indexOf("="); if (idx !== -1) { let key = item.substring(0, idx); let value = item.substring(idx + 1); if (key.indexOf("#") === 0) { key = key.substring(1); if (!_keyRange) { _keyRange = IDBKeyRange.bound(value, value + "\uffff"); } } _this.startsWith(key, value); } } } }; _this.startsWith = (columnName: string, value: string) => { _queryCols.push({ name: columnName, value: value, type: ValueQueryType.StartsWith }); }; _this.contains = (columnName: string, value: string) => { _queryCols.push({ name: columnName, value: value, type: ValueQueryType.Contains }); }; _this.isMatch = (value: any) => { // No query restriction so everything matches if (!_queryCols || _queryCols.length === 0) { return true; } if (!value) { return false; } for (let lp = 0; lp < _queryCols.length; lp++) { let query = _queryCols[lp]; let chkValue = value[query.name]; if (chkValue) { if (query.type === ValueQueryType.StartsWith) { if (chkValue.indexOf(query.value) !== 0) { return false; } } else if (query.type === ValueQueryType.Contains) { if (chkValue.indexOf(query.value) === -1) { return false; } } } } return true; }; if (theQuery) { _this.parseQuery(theQuery); } }); } /** * [Optional] Returns and optional IndexedDB IDBKeyRange instance that will be passed to the IndexedDB Api openCursor() method. * Value returned May be null. */ public keyRange?(): IDBKeyRange; /** * Processes the provided string and attempts to create a simple query from the values, this can be a ';' seperated list of values where each value represents a * = set with being the property name to match and being the value. If the is prefixed with a '#' character then this will be used to as * the query "key" and will populate the keyRange() returned by the keyRange() method. * @param query - */ public parseQuery?(query: string): void; /** * Creates a simple "startsWith" check. This is same as passing "=" to the parseQuery() method. * @param columnName - The property of the returned object * @param value - The value of the property from the returned object to perform a startsWith() match against */ public startsWith?(columnName: string, value: string): void; /** * Creates a simple "contains" check. This will create a search query that will return true whenever the value contains * anywhere in the resulting string (i.e. it performs an xxxx.indexOf() != -1) * @param columnName - The property of the returned object * @param value - The value of the property from the returned object to perform a startsWith() match against */ public contains?(columnName: string, value: string): void; /** * [Optional] Callback method used to provide additional validation on whether the returned value from the IndexedDB Api cursor iteration, this method * must return true for the processFunc() of the openCursor() is called or the value is just added to the identified items. * @param value - The value returned by the IndexedDB IDBCursorWithValue cursor event. * @returns true if the value matches otherwise false */ public isMatch?(value: any): boolean; } ================================================ FILE: channels/offline-channel-js/src/Providers/IndexDbProvider.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import dynamicProto from "@microsoft/dynamicproto-js"; import { INotificationManager, IProcessTelemetryContext, IUnloadHookContainer, eBatchDiscardedReason, isNotNullOrUndefined, isString, newGuid, onConfigChange } from "@microsoft/applicationinsights-core-js"; import { IPromise, createAsyncAllPromise, createAsyncPromise, doAwait, doAwaitResponse } from "@nevware21/ts-async"; import { batchDropNotification, getEndpointDomain, getTimeFromId, getTimeId } from "../Helpers/Utils"; import { CursorProcessResult, IIndexedDbOpenDbContext, IIndexedDbStoreActionContext, IProcessCursorState } from "../Interfaces/IOfflineIndexDb"; import { ILocalStorageProviderContext, IOfflineChannelConfiguration, IOfflineProvider, IStorageTelemetryItem } from "../Interfaces/IOfflineProvider"; import { IndexedDbHelper } from "./IndexDbHelper"; //TODO: move all const to one file const EventsToDropAtOneTime = 10; // If we fail to add a new event this is the max number of events we will attempt to remove to make space const StoreVersion = 1; // The Current version for the stored items, this will be used in the future for versioning const OrhpanedEventThresholdInMs = 604800000; // 7 days const UnknowniKey = "Unknown"; const ErrorMessageUnableToAddEvent = "DBError: Unable to add event"; const MaxCriticalEvtsDropCnt = 2; export const DefaultDbName = "AIOffline"; // Db Name including the version number on the end so that if we ever have to upgrade old and new code can co-exist export const DbVersion = 1; // The Current version of the database (Used to trigger upgrades) export const EventObjectStoreName = "Evts"; /** * The format of the data stored in the iKey objectStore */ export interface IIkeyData { iKey: string; // The ikey tm: number; // The last time this iKey was used } /** * The format of the data stored in the Evts objectStore */ export interface IIndexedDbItem { key?: string; // The actual key for the event id: string | undefined | null; // The stored key of the event (This MUST be the id of the event) evt: IStorageTelemetryItem; // The actual store tm: number; // Identifies when this event was added to the store v: number; // Identifies the version type of this entry } /** * The open database context created by the _openDb() function and passed to the processFunc() delegate to perform operations * on the opened db, this is used to pass around the current db context. */ interface IProviderDbContext { iKey: string; // The current iKey for the events storageId: string; id?: string | number | undefined | null; // The current id/endpoint for the events iKeyPrefix?: () => string; // Returns the prefix applied to all events of the current iKey (used by 1ds) evtKeyPrefix?: () => string; // Returns the current prefix to apply to events (used by 1ds) } function _getTime() { return new Date().getTime(); } function _createDb(db: IDBDatabase) { // data in the same db must have same endpoint url if (!db.objectStoreNames.contains(EventObjectStoreName)) { let evtStore = db.createObjectStore(EventObjectStoreName, { keyPath: "id" }); evtStore.createIndex("criticalCnt", "criticalCnt", { unique: false }); } } function _getEvents(values: IIndexedDbItem[]): IStorageTelemetryItem[] { let events: IStorageTelemetryItem[] = []; for (let lp = 0; lp < values.length; lp++) { let item = values[lp]; if (item && item.evt) { events.push(item.evt); } } return events; } function _addEventByTime(values: IIndexedDbItem[], newValue: IIndexedDbItem): IIndexedDbItem[] { for (let idx = 0; idx < values.length; idx++) { if (newValue.tm < values[idx].tm) { values.splice(idx, 0, newValue); return; } } values.push(newValue); } function _getId(key: string | number , values: IStorageTelemetryItem[]|IIndexedDbItem[]) { let len = values.length; for (let lp = 0; lp < len; lp++) { if (key === values[lp].id) { return lp; } } return -1; } function _cursorContinueEvent(cursorState: IProcessCursorState, value?: IIndexedDbItem) { return (evt: any) => { return cursorState.continue(); }; } function _cursorDeleteAndContinue(cursorState: IProcessCursorState, value?: IIndexedDbItem) { let deleteRequest = cursorState.cursor.delete(); deleteRequest.onerror = _cursorContinueEvent(cursorState); deleteRequest.onsuccess = _cursorContinueEvent(cursorState); return CursorProcessResult.Waiting; } function _getAllEvents(dbCtx: IIndexedDbOpenDbContext, cursorQuery: string, cnt?: number): IPromise { // Open the Db store returning the embedded promise for handling resolving and rejecting the request chain return dbCtx.openCursor( EventObjectStoreName, cursorQuery, (cursorState, value, values) => { values.push(value); if (cnt && values && values.length == cnt) { return CursorProcessResult.Complete; } return CursorProcessResult.Continue; }); } function _deleteEvents(dbCtx: IIndexedDbOpenDbContext, eventPrefixQuery: string, shouldDelete: (value: IIndexedDbItem) => boolean): IPromise { // Open the Event object store return dbCtx.openCursor( EventObjectStoreName, eventPrefixQuery, (deleteCursorState, value: IIndexedDbItem, values: IIndexedDbItem[]) => { if (shouldDelete(value)) { values.push(value); return _cursorDeleteAndContinue(deleteCursorState, value); } return CursorProcessResult.Continue; }); } function _dropMaxTimeEvents(dbCtx: IIndexedDbOpenDbContext, maxTime?: number): IPromise { return createAsyncPromise((deleteEvtsResolve, deleteEvtsReject) => { return _deleteEvents(dbCtx, null, (value) => { if (!value || !value.evt) { return true; } let addedTime = getTimeFromId(value.id); let minStartTime = _getTime() + 1 - maxTime; if (addedTime <= minStartTime) { return true; } return false; }).then((values) => { deleteEvtsResolve(values); }, deleteEvtsReject); }); } function _dropEventsUpToPersistence(dbCtx: IIndexedDbOpenDbContext, maxpriorityCnt: number, maxDropCnt: number): IPromise { return createAsyncPromise((dropEventsResolve, dropEventsReject) => { let droppedEvents = 0; function _resolveWithDroppedEvents() { dropEventsResolve(droppedEvents); } function _dropEvent(deleteStoreCtx: IIndexedDbStoreActionContext, dropItem: IIndexedDbItem): IPromise { return createAsyncPromise((deleteResolve) => { let deleteRequest = deleteStoreCtx.store.delete(dropItem.key); deleteRequest.onsuccess = (evt) => { droppedEvents++; deleteResolve(); }; deleteRequest.onerror = (evt) => { deleteResolve(); }; }); } function _processCandidates(dropCandidates: IIndexedDbItem[]) { if (dropCandidates.length === 0) { _resolveWithDroppedEvents(); return; } dbCtx.openStore(EventObjectStoreName, (deleteStoreCtx) => { let deleteEvts: Array> = []; for (let lp = 0; lp < dropCandidates.length; lp++) { deleteEvts.push(_dropEvent(deleteStoreCtx, dropCandidates[lp])); } return createAsyncAllPromise(deleteEvts).then(_resolveWithDroppedEvents, _resolveWithDroppedEvents); }); } // Get all of the candidates that we may delete var cursorPromise = dbCtx.openCursor( EventObjectStoreName, null, (cursorState, value: IIndexedDbItem, values: IIndexedDbItem[]) => { if (value.evt.criticalCnt <= maxpriorityCnt) { _addEventByTime(values, value); if (values.length > maxDropCnt) { values.splice(values.length - 1, 1); } } return CursorProcessResult.Continue; }); cursorPromise.then(_processCandidates, () => { dropEventsResolve(0); }); }); } /** * Class that implements storing of events using the WebStorage Api ((window||globalThis||self).localstorage, (window||globalThis||self).sessionStorage). */ export class IndexedDbProvider implements IOfflineProvider { public id: string; /** * Creates a WebStorageProvider using the provider storageType */ constructor(id?: string, unloadHookContainer?: IUnloadHookContainer) { dynamicProto(IndexedDbProvider, this, (_this) => { let _indexedDb: IndexedDbHelper = null; let _dbName: string = null; let _iKey: string = UnknowniKey; let _storageId: string = null; // Used as a unique id so that when active on multiple tabs (threads) the apps don't corrupts each other let _autoClean: boolean = null; let _endpoint: string = null; let _storageKeyPrefix: string = null; let _maxStorageTime: number = null; let _eventDropPerTime: number = null; let _maxCriticalCnt: number = null; let _notificationManager: INotificationManager = null; _this.id = id; _this.initialize = (providerContext: ILocalStorageProviderContext) => { let diagLog = providerContext.itemCtx.diagLog(); _indexedDb = new IndexedDbHelper(diagLog); if (!_indexedDb.isAvailable()) { _indexedDb = null; return false; } let coreConfig = providerContext.itemCtx.getCfg(); let itemCtx = providerContext.itemCtx; let ikey = itemCtx.getCfg().instrumentationKey || coreConfig.instrumentationKey; if (!isString(ikey)) { //_iKey = ikey return; } _iKey = ikey; let storageConfig: IOfflineChannelConfiguration = providerContext.storageConfig; _storageId = _this.id || providerContext.id || newGuid(); _notificationManager = providerContext.notificationMgr; _endpoint = getEndpointDomain(providerContext.endpoint); _autoClean = !!storageConfig.autoClean; _storageKeyPrefix = storageConfig.storageKeyPrefix || DefaultDbName; _dbName = _storageKeyPrefix + "_" + DbVersion + "_" + _endpoint; // currently, won't handle endpoint change // new endpoint will open a new db // endpoint change will be handled at offline batch lavel // namePrefix should not contain any "_" let unloadHook = onConfigChange(storageConfig, () => { _maxStorageTime = storageConfig.inStorageMaxTime || OrhpanedEventThresholdInMs; // TODO: handle 0 let dropNum = storageConfig.EventsToDropPerTime; _eventDropPerTime = isNotNullOrUndefined(dropNum)? dropNum : EventsToDropAtOneTime; _maxCriticalCnt = storageConfig.maxCriticalEvtsDropCnt || MaxCriticalEvtsDropCnt; }); unloadHookContainer && unloadHookContainer.add(unloadHook); if (_dbName) { doAwaitResponse(_this.clean(!_autoClean), (response) => { _openDb( (dbCtx) => { return true; }).then( (value) => { // All done, but as initialize isn't waiting just ignore }, (reason) => { // clear and stop using indexedDb diagLog.warnToConsole("IndexedDbProvider failed to initialize - " + (reason || "")); _indexedDb = null; }); }); } return true; }; _this["_getDbgPlgTargets"] = () => { return [_dbName, _endpoint, _maxStorageTime, _indexedDb]; }; /** * Identifies whether this storage provider support synchronious requests */ _this.supportsSyncRequests = () => { return false; }; /** * Get all of the currently cached events( with given number) from the storage mechanism */ _this.getAllEvents = (cnt?: number) => { if (_indexedDb == null || !_indexedDb.isAvailable()) { return []; } return _openDb((dbCtx: IIndexedDbOpenDbContext) => { return createAsyncPromise((allEventsResolve, allEventsReject) => { _getAllEvents(dbCtx, null, cnt).then( (values: IIndexedDbItem[]) => { //TODO: orderEvents By CriticalCnt allEventsResolve(_getEvents(values)); }, allEventsReject); }); }); }; /** * Get all of the currently cached events( with given number) from the storage mechanism */ _this.getNextBatch = () => { if (_indexedDb == null || !_indexedDb.isAvailable()) { return []; } // Start an asynchronous set of events to access the Db, this first one will wait until all current outstanding // events are completed or rejected return _openDb((dbCtx: IIndexedDbOpenDbContext) => { return createAsyncPromise((allEventsResolve, allEventsReject) => { _getAllEvents(dbCtx, null, 1).then( (values: IIndexedDbItem[]) => { allEventsResolve(_getEvents(values)); }, allEventsReject); }); }); }; /** * Stores the value into the storage using the specified key. * @param key - The key value to use for the value * @param value - The actual value of the request */ _this.addEvent = (key: string, item: IStorageTelemetryItem, itemCtx: IProcessTelemetryContext) => { if (_indexedDb == null || !_indexedDb.isAvailable()) { return item; } item.id = item.id || getTimeId(); item.criticalCnt = item.criticalCnt || 0; return _openDb( (dbCtx) => { let eventKey = key || item.id; let dbItem: IIndexedDbItem = { id: eventKey, evt: item, tm: _getTime(), v: StoreVersion }; return _addDbEvent(dbCtx, dbItem, true); }); }; /** * Removes the values * @param evts - */ _this.removeEvents = (evts: IStorageTelemetryItem[]) => { if (_indexedDb == null || !_indexedDb.isAvailable()) { return []; } let removedEvents: IStorageTelemetryItem[] = []; return createAsyncPromise((removeEventsResolve, removeEventsReject) => { // Open the Db store, this will handling resolving and rejecting this promise via the passed resolve/reject functions _openDb((dbCtx) => { return dbCtx.openCursor( EventObjectStoreName, null, (cursorState, value: IIndexedDbItem, values: IIndexedDbItem[]) => { if (_getId(value.id, evts) !== -1) { let deleteRequest = cursorState.cursor.delete(); deleteRequest.onerror = _cursorContinueEvent(cursorState); deleteRequest.onsuccess = () => { removedEvents.push(value.evt); cursorState.continue(); }; return CursorProcessResult.Waiting; } return CursorProcessResult.Continue; }); }).then(() => { removeEventsResolve(removedEvents); // Resolve the RemoveEvents call promise }, (reason) => { removeEventsResolve(removedEvents); // Resolve the RemoveEvents call promise }); }); }; /** * Removes all entries from the storage provider and returns them as part of the response, if there are any. */ _this.clear = (disable?: boolean) => { if (_indexedDb == null || !_indexedDb.isAvailable() || !!disable) { return []; } return createAsyncPromise((clearResolve, clearReject) => { _openDb((dbCtx) => { //delete all evts return _deleteEvents(dbCtx, null, (value) => { return true; }); }).then( (values: IIndexedDbItem[]) => { clearResolve(_getEvents(values)); }, (reason) => { clearResolve([]); } ) }); }; _this.clean = (disable?: boolean) => { if (_indexedDb == null || !_indexedDb.isAvailable() || !!disable) { return false; } return createAsyncPromise((cleanResolve, cleanReject) => { _openDb((dbCtx) => { if (dbCtx.isNew) { return []; } return _dropMaxTimeEvents(dbCtx, _maxStorageTime); }).then( (value:IIndexedDbItem[]) => { let cnt = value && value.length; if (_notificationManager && cnt) { batchDropNotification(_notificationManager, cnt, eBatchDiscardedReason.MaxInStorageTimeExceeded); } cleanResolve(cnt && cnt > 0); },(reason) => { cleanResolve(false); } ); }); }; /** * Shuts-down the telemetry plugin. This is usually called when telemetry is shut down. * This attempts to update the lastAccessTime for any storedDb */ _this.teardown = (): void => { if (_indexedDb) { _indexedDb.closeDb(_dbName); } }; /** * Schedules the opening of the database if not already open */ function _openDb(processFunc: (dbCtx: IIndexedDbOpenDbContext) => T | IPromise): IPromise { function _handleDbUpgrade(dbCtx: IIndexedDbOpenDbContext) { return createAsyncPromise((createResolve, createReject) => { try { _createDb(dbCtx.db); } catch(e) { createReject(e); } createResolve(); }); } function _handleDbOpen(dbCtx: IIndexedDbOpenDbContext) { return createAsyncPromise((openResolve, openReject) => { let providerCtx: IProviderDbContext = { iKey: _iKey, id: _endpoint, storageId: _storageId }; dbCtx.ctx = providerCtx; doAwait(processFunc(dbCtx), openResolve, openReject); }); } return _indexedDb.openDb( _dbName, DbVersion, _handleDbOpen, _handleDbUpgrade); } function _addDbEvent( dbCtx: IIndexedDbOpenDbContext, dbItem: IIndexedDbItem, doRetry: boolean): IPromise { return createAsyncPromise((addEventResolve, addEventReject) => { function dropEvents(droppedFunc: (droppedCount: number) => void) { // Try and clear space by dropping the Normal level events, note dropEvents promise never rejects _dropEventsUpToPersistence(dbCtx, _maxCriticalCnt, _eventDropPerTime).then( (droppedCount) => { if (_notificationManager && droppedCount) { batchDropNotification(_notificationManager, droppedCount, eBatchDiscardedReason.CleanStorage); } droppedFunc(droppedCount); }, (reason) => { // won't throw errors here, unblock following process droppedFunc(0); }); } function _insertNewEvent() { dbCtx.openStore(EventObjectStoreName, (storeCtx) => { let request = storeCtx.store.put(dbItem); request.onsuccess = (evt) => { addEventResolve(dbItem.evt); }; request.onerror = (evt: Event) => { if (!doRetry) { addEventReject(new Error(ErrorMessageUnableToAddEvent)); // Reject the calling promise return; } function _retryAddEvent(dropCount: number) { if (dropCount === 0) { // We failed to free up space so just reject addEventReject(new Error(ErrorMessageUnableToAddEvent)); // Reject the calling promise } // Retry sending the event _addDbEvent(dbCtx, dbItem, false).then( (theItem) => { addEventResolve(dbItem.evt); // Resolve the calling add Event promise }, () => { addEventReject(new Error(ErrorMessageUnableToAddEvent)); // Reject the calling promise }); } dropEvents((droppedCount: number) => { if (droppedCount > 0) { // We dropped some events so lets try adding the item again _retryAddEvent(droppedCount); } else { // We have already tried to remove all we can addEventReject(new Error(ErrorMessageUnableToAddEvent)); // Reject the calling promise } }); }; }).catch((e)=> { addEventReject(e); }); } _insertNewEvent(); }); } }); } /** * Initializes the provider using the config * @param providerContext - The provider context that should be used to initialize the provider * @returns True if the provider is initialized and available for use otherwise false */ public initialize(providerContext: ILocalStorageProviderContext): boolean { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return false; } /** * Identifies whether this storage provider support synchronous requests */ public supportsSyncRequests(): boolean { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return false; } /** * Get all of the currently cached events from the storage mechanism */ public getNextBatch(): IStorageTelemetryItem[] | IPromise | null { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } /** * Get all of the currently cached events from the storage mechanism */ public getAllEvents(cnt?: number): IStorageTelemetryItem[] | IPromise< IStorageTelemetryItem[]> | null { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } /** * Stores the value into the storage using the specified key. * @param key - The key value to use for the value * @param evt - The actual event of the request * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances * can optionally use this to access the current core instance or define / pass additional information * to later plugins (vs appending items to the telemetry item) */ public addEvent(key: string, evt: any, itemCtx: IProcessTelemetryContext): IStorageTelemetryItem | IPromise | null { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return; } /** * Removes the value associated with the provided key * @param evts - The events to be removed */ public removeEvents(evts: any[]): IStorageTelemetryItem[] | IPromise | null { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return } /** * Removes all entries from the storage provider, if there are any. */ public clear(disable?: boolean): IStorageTelemetryItem[] | IPromise | null { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return; } /** * Removes all entries with stroage time longer than inStorageMaxTime from the storage provider */ public clean(disable?: boolean): boolean | IPromise { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return; } /** * Shuts-down the telemetry plugin. This is usually called when telemetry is shut down. */ public teardown(): void { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } } ================================================ FILE: channels/offline-channel-js/src/Providers/WebStorageProvider.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import dynamicProto from "@microsoft/dynamicproto-js"; import { INotificationManager, IProcessTelemetryContext, IUnloadHookContainer, eBatchDiscardedReason, getGlobal, getJSON, isNotNullOrUndefined, onConfigChange } from "@microsoft/applicationinsights-core-js"; import { IPromise, createAsyncRejectedPromise } from "@nevware21/ts-async"; import { batchDropNotification, forEachMap, getEndpointDomain, getTimeFromId, getTimeId } from "../Helpers/Utils"; import { ILocalStorageProviderContext, IOfflineChannelConfiguration, IOfflineProvider, IStorageJSON, IStorageTelemetryItem } from "../Interfaces/IOfflineProvider"; import { PayloadHelper } from "../PayloadHelper"; //TODO: move all const to one file const EventsToDropAtOneTime = 10; const Version = "1"; const DefaultStorageKey = "AIOffline"; const DefaultMaxStorageSizeInBytes = 5000000; const MaxCriticalEvtsDropCnt = 2; const DefaultMaxInStorageTime = 604800000; //7*24*60*60*1000 7days // [Optional for version 1]: TODO: order event by time interface IJsonStoreDetails { key: string; db: IStorageJSON; } // Private helper methods that are not exposed as class methods function _isQuotaExceeded(storage: Storage, e) { let result = false; if (e instanceof DOMException) { // test name field too, because code might not be present if (e.code === 22 || e.name === "QuotaExceededError" || // everything except Firefox e.code === 1014 || e.name === "NS_ERROR_DOM_QUOTA_REACHED") { // Firefox if (storage && storage.length !== 0) { // acknowledge QuotaExceededError only if there's something already stored result = true; } } } return result; } /** * Check and return that the storage type exists and has space to use */ function _getAvailableStorage(type: string): Storage { let global = getGlobal() || ({} as Window); let storage: Storage = null; try { storage = ((global[type]) as Storage); if (storage) { let x = "__storage_test__"; storage.setItem(x, x); storage.removeItem(x); } } catch (e) { if (!_isQuotaExceeded(storage, e)) { // If not Quota exception then assume not available storage = null; } } return storage; } // will drop batches with no critical evts first function _dropEventsUpToPersistence( maxCnt: number, events: { [id: string]: IStorageTelemetryItem }, eventsToDropAtOneTime: number): number { let dropKeys = []; let persistenceCnt = 0; let droppedEvents = 0; while (persistenceCnt <= maxCnt && droppedEvents < eventsToDropAtOneTime) { forEachMap(events, (evt, key) => { if (evt.criticalCnt === persistenceCnt) { dropKeys.push(key); droppedEvents++; } return (droppedEvents < eventsToDropAtOneTime); }); if (droppedEvents > 0) { for (let lp = 0; lp < dropKeys.length; lp++) { delete events[dropKeys[lp]]; } return droppedEvents; } persistenceCnt++; } return droppedEvents; } function _dropMaxTimeEvents( maxStorageTime: number, events: { [id: string]: IStorageTelemetryItem }, eventsToDropAtOneTime: number, mgr?: INotificationManager): boolean { let dropKeys = []; let droppedEvents = 0; let currentTime = (new Date()).getTime() + 1; // handle appended random float number let minStartTime = (currentTime - maxStorageTime); try { forEachMap(events, (evt, key) => { let id = getTimeFromId(key); if (id <= minStartTime) { dropKeys.push(key); droppedEvents++; } return (droppedEvents < eventsToDropAtOneTime); }); if (droppedEvents > 0) { for (let lp = 0; lp < dropKeys.length; lp++) { delete events[dropKeys[lp]]; } if (mgr) { batchDropNotification(mgr, droppedEvents, eBatchDiscardedReason.MaxInStorageTimeExceeded); } return true; } } catch (e) { // catch drop events error } return droppedEvents > 0; } /** * Class that implements storing of events using the WebStorage Api ((window||globalThis||self).localstorage, (window||globalThis||self).sessionStorage). */ export class WebStorageProvider implements IOfflineProvider { public id: string; /** * Creates a WebStorageProvider using the provider storageType * @param storageType - The type of Storage provider, normal values are "localStorage" or "sessionStorage" */ constructor(storageType: string, id?: string, unloadHookContainer?: IUnloadHookContainer) { dynamicProto(WebStorageProvider, this, (_this) => { let _storage: Storage = null; let _storageKeyPrefix: string = DefaultStorageKey; let _maxStorageSizeInBytes: number = DefaultMaxStorageSizeInBytes; let _payloadHelper: PayloadHelper = null; let _storageKey: string = null; let _endpoint: string = null; let _maxStorageTime: number = null; let _eventDropPerTime: number = null; let _maxCriticalCnt: number = null; let _notificationManager: INotificationManager = null; _this.id = id; _storage = _getAvailableStorage(storageType) || null; _this["_getDbgPlgTargets"] = () => { return [_storageKey, _maxStorageSizeInBytes, _maxStorageTime]; }; _this.initialize = (providerContext: ILocalStorageProviderContext, endpointUrl?: string) => { if (!_storage) { return false; } let storageConfig: IOfflineChannelConfiguration = providerContext.storageConfig; let itemCtx = providerContext.itemCtx; _payloadHelper = new PayloadHelper(itemCtx.diagLog()); _endpoint = getEndpointDomain(endpointUrl || providerContext.endpoint); let autoClean = !!storageConfig.autoClean; _notificationManager = providerContext.notificationMgr; let unloadHook = onConfigChange(storageConfig, () => { _maxStorageSizeInBytes = storageConfig.maxStorageSizeInBytes || DefaultMaxStorageSizeInBytes; // value checks and defaults should be applied during core config _maxStorageTime = storageConfig.inStorageMaxTime || DefaultMaxInStorageTime; // TODO: handle 0 let dropNum = storageConfig.EventsToDropPerTime; _eventDropPerTime = isNotNullOrUndefined(dropNum)? dropNum : EventsToDropAtOneTime; _maxCriticalCnt = storageConfig.maxCriticalEvtsDropCnt || MaxCriticalEvtsDropCnt; }); unloadHookContainer && unloadHookContainer.add(unloadHook); // currently, won't handle endpoint change here // new endpoint will open a new db // endpoint change will be handled at offline batch level // namePrefix should not contain any "_" _storageKeyPrefix = storageConfig.storageKeyPrefix || DefaultStorageKey; _storageKey = _storageKeyPrefix + "_" + Version + "_" + _endpoint; if (autoClean) { // won't wait response here _this.clean(); } // TODO: handle versoin Upgrade //_checkVersion(); return true; }; /** * Identifies whether this storage provider support synchronous requests */ _this.supportsSyncRequests = () => { return true; }; /** * Get all of the currently cached events from the storage mechanism */ _this.getAllEvents = (cnt?: number) => { try { if (!_storage) { // if not init, return null return; } return _getEvts(cnt); } catch (e) { return createAsyncRejectedPromise(e); } }; /** * Get Next cached event from the storage mechanism */ _this.getNextBatch = () => { try { if (!_storage) { // if not init, return null return; } // set ordered to true, to make sure to get earliest events first return _getEvts(1, true); } catch (e) { return createAsyncRejectedPromise(e); } }; function _getEvts(cnt?: number, ordered?: boolean) { let allItems: IStorageTelemetryItem[] = []; let theStore = _fetchStoredDb(_storageKey).db; if (theStore) { let events = theStore.evts; forEachMap(events, (evt) => { if (evt) { if (evt.isArr) { evt = _payloadHelper.base64ToArr(evt); } allItems.push(evt); } if(cnt && allItems && allItems.length == cnt) { return false; } return true; }, ordered); } return allItems; } /** * Stores the value into the storage using the specified key. * @param key - The key value to use for the value * @param value - The actual value of the request */ _this.addEvent = (key: string, evt: IStorageTelemetryItem, itemCtx: IProcessTelemetryContext) => { try { let theStore = _fetchStoredDb(_storageKey); evt.id = evt.id || getTimeId(); evt.criticalCnt = evt.criticalCnt || 0; let events = theStore.db.evts; let id = evt.id; if (evt && evt.isArr) { evt = _payloadHelper.base64ToStr(evt); } let preDroppedCnt = 0; // eslint-disable-next-line no-constant-condition while (true && evt) { events[id] = evt; if (_updateStoredDb(theStore)) { // Database successfully updated if (preDroppedCnt && _notificationManager) { // only send notification when batches are updated successfully in storage batchDropNotification(_notificationManager, preDroppedCnt, eBatchDiscardedReason.CleanStorage); } return evt; } // Could not not add events to storage assuming its full, so drop events to make space // or max size exceeded delete events[id]; let droppedCnt = _dropEventsUpToPersistence(_maxCriticalCnt, events, _eventDropPerTime); preDroppedCnt += droppedCnt; if (!droppedCnt) { // Can't free any space for event return createAsyncRejectedPromise(new Error("Unable to free up event space")); } } } catch (e) { return createAsyncRejectedPromise(e); } }; /** * Removes the value associated with the provided key * @param evts - The events to be removed */ _this.removeEvents = (evts: IStorageTelemetryItem[]) => { try { let theStore = _fetchStoredDb(_storageKey, false); let currentDb = theStore.db; if (currentDb) { let events = currentDb.evts; try { for (let i = 0; i < evts.length; ++i) { let evt = evts[i]; delete events[evt.id]; } // Update takes care of removing the DB if it's completely empty now if (_updateStoredDb(theStore)) { return evts; } } catch (e) { // Storage corrupted } // failure here so try and remove db to unblock following events evts = _clearDatabase(theStore.key); } return evts; } catch (e) { return createAsyncRejectedPromise(e); } }; /** * Removes all entries from the storage provider for the current endpoint and returns them as part of the response, if there are any. */ _this.clear = () => { try { let removedItems: IStorageTelemetryItem[] = []; let theStore = _fetchStoredDb(_storageKey, false); let storedDb = theStore.db; if (storedDb) { let events = storedDb.evts; forEachMap(events, (evt) => { if (evt) { delete events[evt.id] removedItems.push(evt); } return true; }); _updateStoredDb(theStore); } return removedItems; } catch (e) { // Unable to clear the database return createAsyncRejectedPromise(e); } }; _this.clean = () => { let storeDetails = _fetchStoredDb(_storageKey, false); let currentDb = storeDetails.db; if (currentDb) { let events = currentDb.evts; try { let isDropped = _dropMaxTimeEvents(_maxStorageTime, events, _eventDropPerTime, _notificationManager); if (isDropped) { return _updateStoredDb(storeDetails); } return true; } catch (e) { // should not throw errors here // because we don't want to block following process } return false; } }; /** * Shuts-down the telemetry plugin. This is usually called when telemetry is shut down. * This attempts to update the lastAccessTime for any storedDb */ _this.teardown = (): void => { try { let theStore = _fetchStoredDb(_storageKey, false); let storedDb = theStore.db; if (storedDb) { // reset the last access time storedDb.lastAccessTime = 0; _updateStoredDb(theStore, false); } } catch (e) { // Add diagnostic logging } }; /** * @ignore * Creates a new json store with the StorageJSON (may be null), a null db value indicates that the store * associated with the key is empty and should be removed. * @param dbKey - The key to associate with the database * @param db - The database */ function _newStore(dbKey: string, db: IStorageJSON): IJsonStoreDetails { return { key: dbKey, db: db }; } function _fetchStoredDb(dbKey: string, returnDefault = true): IJsonStoreDetails { let dbToStore: IStorageJSON = null; if (_storage) { let previousDb = _storage.getItem(dbKey); if (previousDb) { try { dbToStore = getJSON().parse(previousDb); } catch (e) { // storage corrupted _storage.removeItem(dbKey); } } if (returnDefault && !dbToStore) { // Create and return a default empty database dbToStore = { evts: {}, lastAccessTime: 0 }; } } return _newStore(dbKey, dbToStore); } function _updateStoredDb(jsonStore: IJsonStoreDetails, updateLastAccessTime = true): boolean { //let removeDb = true; let dbToStore = jsonStore.db; if (dbToStore) { if (updateLastAccessTime) { // Update the last access time dbToStore.lastAccessTime = (new Date()).getTime(); } } try { let jsonString = getJSON().stringify(dbToStore); if (jsonString.length > _maxStorageSizeInBytes) { // We can't store the database as it would exceed the configured max size return false; } _storage && _storage.setItem(jsonStore.key, jsonString); //} } catch (e) { // catch exception due to trying to store or clear JSON // We could not store the database return false; } return true; } function _clearDatabase(dbKey: string): IStorageTelemetryItem[] { let removedItems: IStorageTelemetryItem[] = []; let storeDetails = _fetchStoredDb(dbKey, false); let currentDb = storeDetails.db; if (currentDb) { let events = currentDb.evts; try { forEachMap(events, (evt) => { if (evt) { removedItems.push(evt); } return true; }); } catch (e) { // catch exception due to trying to store or clear JSON } // Remove the entire stored database _storage && _storage.removeItem(storeDetails.key); } return removedItems; } }); } /** * Initializes the provider using the config * @param providerContext - The provider context that should be used to initialize the provider * @returns True if the provider is initialized and available for use otherwise false */ public initialize(providerContext: ILocalStorageProviderContext): boolean { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return false; } /** * Identifies whether this storage provider support synchronous requests */ public supportsSyncRequests(): boolean { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return false; } /** * Get all of the currently cached events from the storage mechanism */ public getAllEvents(cnt?: number): IStorageTelemetryItem[] | IPromise< IStorageTelemetryItem[]> | null { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } /** * Get the Next one cached batch from the storage mechanism */ public getNextBatch(): IStorageTelemetryItem[] | IPromise< IStorageTelemetryItem[]> | null { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } /** * Stores the value into the storage using the specified key. * @param key - The key value to use for the value * @param evt - The actual event of the request * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances * can optionally use this to access the current core instance or define / pass additional information * to later plugins (vs appending items to the telemetry item) */ public addEvent(key: string, evt: any, itemCtx: IProcessTelemetryContext): IStorageTelemetryItem | IPromise | null { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return; } /** * Removes the value associated with the provided key * @param evts - The events to be removed */ public removeEvents(evts: any[]): IStorageTelemetryItem[] | IPromise | null { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return; } /** * Removes all entries from the storage provider, if there are any. */ public clear(): IStorageTelemetryItem[] | IPromise | null { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return; } /** * Removes all entries with stroage time longer than inStorageMaxTime from the storage provider */ public clean(): boolean | IPromise { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return; } /** * Shuts-down the telemetry plugin. This is usually called when telemetry is shut down. */ public teardown(): void { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging } } ================================================ FILE: channels/offline-channel-js/src/Sender.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import dynamicProto from "@microsoft/dynamicproto-js"; import { BreezeChannelIdentifier, IAppInsightsCore, IConfig, IConfiguration, IDiagnosticLogger, IProcessTelemetryContext, IProcessTelemetryUnloadContext, ITelemetryUnloadState, IUnloadHookContainer, IXDomainRequest, IXHROverride, OnCompleteCallback, SendRequestReason, SenderPostManager, TransportType, _ISendPostMgrConfig, _ISenderOnComplete, _eInternalMessageId, _throwInternal, createProcessTelemetryContext, eLoggingSeverity, formatErrorMessageXdr, getResponseText, onConfigChange, parseResponse, prependTransports, utlSetStoragePrefix } from "@microsoft/applicationinsights-core-js"; import { IPromise } from "@nevware21/ts-async"; import { isFunction } from "@nevware21/ts-utils"; import { IOfflineChannelConfiguration, IOfflineSenderConfig } from "./Interfaces/IOfflineProvider"; const DefaultOfflineIdentifier = "OfflineChannel"; const PostChannelId = "PostChannel"; function isOverrideFn(httpXHROverride: any) { return httpXHROverride && httpXHROverride.sendPOST; } export type SenderFunction = (payload: string[], isAsync: boolean) => void | IPromise; export class Sender { public _appId: string; //TODO: set id constructor() { let _consecutiveErrors: number; // How many times in a row a retryable error condition has occurred. let _retryAt: number; // The time to retry at in milliseconds from 1970/01/01 (this makes the timer calculation easy). let _paused: boolean; // Flag indicating that the sending should be paused let _enableSendPromise: boolean; let _alwaysUseCustomSend: boolean; let _isInitialized: boolean; let _diagLog: IDiagnosticLogger; let _core: IAppInsightsCore; let _httpInterface: IXHROverride; let _onlineChannelId: string; let _isOneDs: boolean; let _sendPostMgr: SenderPostManager; let _disableCredentials: boolean; let _fetchCredentials: RequestCredentials; dynamicProto(Sender, this, (_self, _base) => { //let _sendCredentials = true; // for 1ds _initDefaults(); _self.pause = () => { _clearScheduledTimer(); _paused = true; }; _self.resume = () => { if (_paused) { _paused = false; _retryAt = null; } }; _self.getXhrInst = (sync?: boolean): IXHROverride => { // unload events will be saved. so not return unload interface return _httpInterface; } _self.initialize = (config: IConfiguration & IConfig, core: IAppInsightsCore, cxt: IProcessTelemetryContext, diagLog: IDiagnosticLogger, channelId?: string, unloadHookContainer?: IUnloadHookContainer): void => { _diagLog = diagLog || core.logger; if (_isInitialized) { _throwInternal(_diagLog, eLoggingSeverity.CRITICAL, _eInternalMessageId.SenderNotInitialized, "Sender is already initialized"); } _core = core; _consecutiveErrors = 0; _retryAt = null; // This function will be re-called whenever any referenced configuration is changed let hook = onConfigChange(config, (details) => { let config = details.cfg; if (config.storagePrefix){ utlSetStoragePrefix(config.storagePrefix); } let ctx = createProcessTelemetryContext(null, config, core); let offlineCfg = ctx.getExtCfg(DefaultOfflineIdentifier) as IOfflineChannelConfiguration; _onlineChannelId = channelId || BreezeChannelIdentifier; let senderConfig = ctx.getExtCfg(_onlineChannelId, {}) as any; let offlineSenderCfg = offlineCfg.senderCfg || {} as IOfflineSenderConfig; _fetchCredentials = null; if (_onlineChannelId == PostChannelId) { _isOneDs = true; let channelConfig = ctx.getExtCfg(PostChannelId); if (channelConfig && channelConfig["fetchCredentials"]) { _fetchCredentials = channelConfig["fetchCredentials"]; } } _alwaysUseCustomSend = offlineSenderCfg.alwaysUseXhrOverride; // default true _enableSendPromise = !(senderConfig.enableSendPromise === false); let xhrOverride = offlineSenderCfg.httpXHROverride || senderConfig.httpXHROverride; let customInterface = isOverrideFn(xhrOverride)? xhrOverride : null; _disableCredentials = !customInterface && _isOneDs; let sendPostMgrConfig = _getSendPostMgrConfig(); if (!_sendPostMgr) { _sendPostMgr = new SenderPostManager(); _sendPostMgr.initialize(sendPostMgrConfig, _diagLog); } else { _sendPostMgr.SetConfig(sendPostMgrConfig); } let httpInterface: IXHROverride = null; let customTransPorts = offlineSenderCfg.transports || senderConfig.transports || []; let theTransports: TransportType[] = prependTransports([TransportType.Xhr, TransportType.Fetch, TransportType.Beacon], customTransPorts); httpInterface = _sendPostMgr.getSenderInst(theTransports, false); let xhrInterface = _sendPostMgr.getFallbackInst(); httpInterface = _alwaysUseCustomSend? customInterface : (httpInterface || customInterface || xhrInterface); _httpInterface = httpInterface || xhrInterface; }); unloadHookContainer && unloadHookContainer.add(hook); }; _self.isCompletelyIdle = (): boolean => { let syncPayload = 0; try { let senderPlugin = (_core.getPlugin(_onlineChannelId).plugin as any); if (senderPlugin && isFunction(senderPlugin.isCompletelyIdle)) { if(!senderPlugin.isCompletelyIdle()) { return false; } } if (_sendPostMgr) { syncPayload = _sendPostMgr.getSyncFetchPayload(); } } catch (e) { // if can't get idle status of online sender, then isidle status only depends on offine sender idle status } return !_paused && syncPayload === 0; }; // partial 206, parse payload (not send again) _self._doTeardown = (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => { _initDefaults(); }; /** * success handler */ function _onSuccess (res?: string, onComplete?: OnCompleteCallback) { _doOnComplete(onComplete, 200, {}, res); } function _getSendPostMgrConfig(): _ISendPostMgrConfig { let config = { enableSendPromise: _enableSendPromise, isOneDs: _isOneDs, disableCredentials: _disableCredentials, fetchCredentials: _fetchCredentials, senderOnCompleteCallBack: _getOnCompleteFuncs() } as _ISendPostMgrConfig; return config; } /** * error handler */ function _onError(message: string, onComplete?: OnCompleteCallback) { _throwInternal(_diagLog, eLoggingSeverity.WARNING, _eInternalMessageId.OnError, "Failed to send telemetry.", { message }); _doOnComplete(onComplete, 400, {}); } function _getOnCompleteFuncs(): _ISenderOnComplete { let funcs = { xdrOnComplete: (response: IXDomainRequest, oncomplete: OnCompleteCallback) => { return _xdrOnLoad(response, oncomplete); }, fetchOnComplete: (response: Response, onComplete: OnCompleteCallback, resValue?: string) => { let status = response.status; return _handleResponse(onComplete, status, {}, resValue); }, xhrOnComplete: (request, oncomplete) => { let response = getResponseText(request); return _handleResponse(oncomplete, request.status, {}, response); } } as _ISenderOnComplete; return funcs; } function _doOnComplete(oncomplete: OnCompleteCallback, status: number, headers: { [headerName: string]: string }, response?: string) { try { oncomplete && oncomplete(status, headers, response); } catch (e) { // eslint-disable-next-line no-empty } } function _handleResponse(oncomplete: OnCompleteCallback, status: number, headers?: {}, response?: string) { if (status == 206 && !_isOneDs) { // for breeze, 206 is partially success, currently consider success // TODO: handle partial success _doOnComplete(oncomplete, 200, headers, response); // TODO: doc (support partial success)-> partial success add known issue (breeze) } else if (status == 204 && _isOneDs) { // one collector _doOnComplete(oncomplete, 200, headers, response); } else { _doOnComplete(oncomplete, status, headers, response); } } function _clearScheduledTimer() { _retryAt = null; } /** * xdr state changes */ function _xdrOnLoad(xdr: IXDomainRequest, oncomplete: OnCompleteCallback){ const responseText = getResponseText(xdr); if (xdr && (responseText + "" === "200" || responseText === "")) { _consecutiveErrors = 0; _onSuccess(responseText, oncomplete); } else { const results = parseResponse(responseText, _diagLog); if (results && results.itemsAccepted) { // TODO: onPartial success for appInsights _onSuccess(responseText, oncomplete); } else { _onError(formatErrorMessageXdr(xdr), oncomplete); } } } function _initDefaults() { _self._appId = null; _consecutiveErrors = 0; _retryAt = null; _paused = false; _isInitialized = false; _core = null; _onlineChannelId = null; _sendPostMgr = null; } }); } /** * Pause the sending (transmission) of events, this will cause all events to be batched only until the maximum limits are * hit at which point new events are dropped. Will also cause events to NOT be sent during page unload, so if Session storage * is disabled events will be lost. */ public pause(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Resume the sending (transmission) of events, this will restart the timer and any batched events will be sent using the normal * send interval. */ public resume(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, cxt: IProcessTelemetryContext, diagLog: IDiagnosticLogger, channelId?: string, unloadHookContainer?: IUnloadHookContainer): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Trigger the immediate send of buffered data; If executing asynchronously (the default) this may (not required) return * an [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) that will resolve once the * send is complete. The actual implementation of the `IPromise` will be a native Promise (if supported) or the default * as supplied by [ts-async library](https://github.com/nevware21/ts-async) * @param async - Indicates if the events should be sent asynchronously * @param forcedSender - Indicates the forcedSender, undefined if not passed * @returns - Nothing or optionally, if occurring asynchronously a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * which will be resolved (or reject) once the send is complete, the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * should only be returned when async is true. */ public triggerSend(async = true, forcedSender?: SenderFunction, sendReason?: SendRequestReason): void | IPromise { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Check if there are no active requests being sent. * @returns True if idle, false otherwise. */ public isCompletelyIdle(): boolean { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return false; } /** * Get current xhr instance */ public getXhrInst(sync?: boolean) { // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging return null; } public _doTeardown (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } } ================================================ FILE: channels/offline-channel-js/src/applicationinsights-offlinechannel-js.ts ================================================ export { IInMemoryBatch, IPostTransmissionTelemetryItem } from "./Interfaces/IInMemoryBatch"; export { IOfflineBatchCleanResponse, IOfflineBatchHandler, IOfflineBatchHandlerCfg, IOfflineBatchResponse, IOfflineBatchStoreResponse, eBatchSendStatus, BatchSendStatus, eBatchStoreStatus, BatchStoreStatus, eStorageType, StorageType, OfflineBatchSendCallback, OfflineBatchStoreCallback,OfflineBatchCallback, createDefaultOfflineDetector, createNoopOfflineDetector, IOfflineDetector, IOfflineDetectorCfg } from "./Interfaces/IOfflineBatch"; export {IOfflineChannelConfiguration, ILocalStorageProviderContext, IOfflineProvider, IOfflineSenderConfig, IStorageTelemetryItem, eStorageProviders, StorageProviders } from "./Interfaces/IOfflineProvider"; export { WebStorageProvider } from "./Providers/WebStorageProvider"; export { IndexedDbProvider } from "./Providers/IndexDbProvider"; export { OfflineBatchHandler } from "./OfflineBatchHandler"; export { InMemoryBatch } from "./InMemoryBatch"; export { Sender } from "./Sender"; export { OfflineChannel } from "./OfflineChannel"; ================================================ FILE: channels/offline-channel-js/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "module": "es6", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "strictNullChecks": false, "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "importHelpers": true, "noEmitHelpers": true, "forceConsistentCasingInFileNames": true, "skipLibCheck": true, "declaration": true, "declarationDir": "build/types", "removeComments": false, "outDir": "dist-es5/", "rootDir": "./src" }, "include": [ "./src/**/*.ts"], "exclude": [ "node_modules/**" ] } ================================================ FILE: channels/offline-channel-js/tsdoc.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", "extends": ["../../tsdoc.json"] } ================================================ FILE: channels/offline-channel-js/typedoc.json ================================================ { "$schema": "https://typedoc.org/schema.json", "entryPoints": [ "./src/applicationinsights-offlinechannel-js.ts" ], "exclude": [ "**/internal/**/*.ts", "node_modules/**" ], "externalPattern": [ "**/node_modules/**", "node_modules/**" ], "sort": [ "alphabetical", "kind", "instance-first" ], "basePath": "./src", "sourceLinkTemplate": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/{path}#L{line}", "cleanOutputDir": true, "excludeExternals": false, "excludeInternal": true, "excludePrivate": true, "includeVersion": true, "groupOrder": [ "Entrypoint", "Modules", "Namespaces", "Enumerations", "Enumeration Members", "Classes", "Interfaces", "Type Aliases", "Constructors", "Properties", "Variables", "Functions", "Accessors", "Methods", "References", "*" ], "tsconfig": "./tsconfig.json", "out": "../../docs/webSdk/applicationinsights-offlinechannel-js", "readme": "none", "githubPages": true, "gitRevision": "main", "compilerOptions": { "stripInternal": true }, "sidebarLinks": { "Changelog": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/RELEASES.md", "Readme": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/channels/offline-channel-js", }, "navigationLinks": { "GitHub": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/channels/offline-channel-js", "npm": "https://www.npmjs.com/package/@microsoft/applicationinsights-offlinechannel-js" }, "visibilityFilters": { "protected": false, "private": false, "inherited": true, "external": true } } ================================================ FILE: channels/tee-channel-js/.npmignore ================================================ # NPM Ignore # ignore everything * # ... but these files !package.json !tsconfig.json !dist-es*/** !dist/** !browser/** !types/** !/CODE_OF_CONDUCT.md !/CONTRIBUTING.md !/README.md !/SECURITY.md !/SUPPORT.md !/NOTICE !/PRIVACY !/LICENSE !/LICENSE.TXT ================================================ FILE: channels/tee-channel-js/LICENSE ================================================ The MIT License (MIT) Copyright (c) Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: channels/tee-channel-js/NOTICE ================================================ NOTICES AND INFORMATION Do Not Translate or Localize This software incorporates material from third parties. Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, or you may send a check or money order for US $5.00, including the product name, the open source component name, and version number, to: Source Code Compliance Team Microsoft Corporation One Microsoft Way Redmond, WA 98052 USA Notwithstanding any other terms, you may reverse engineer this software to the extent required to debug changes to any libraries licensed under the GNU Lesser General Public License. ================================================ FILE: channels/tee-channel-js/PRIVACY ================================================ # Data Collection The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ================================================ FILE: channels/tee-channel-js/README.md ================================================ # Microsoft Application Insights JavaScript SDK - Tee Channel This Channel is used to support multiple channel queues as defined by the `channels` configuration, this channel will execute all of the channels as defined in the `channels` array from index 1 onwards (`channels[1..X]`). The main ApplicationInsights Core will process the channels as defined in the `channels[0]`. [![GitHub Workflow Status (main)](https://img.shields.io/github/actions/workflow/status/microsoft/ApplicationInsights-JS/ci.yml?branch=main)](https://github.com/microsoft/ApplicationInsights-JS/tree/main) [![Build Status](https://dev.azure.com/mseng/AppInsights/_apis/build/status%2FAppInsights%20-%20DevTools%2F1DS%20JavaScript%20SDK%20web%20SKU%20(main%3B%20master)?branchName=main)](https://dev.azure.com/mseng/AppInsights/_build/latest?definitionId=8184&branchName=main) [![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-channel-js.svg)](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-channel-js) ## Getting Started ## NPM Setup (ignore if using Snippet Setup) Install npm package: ```bash npm install --save @microsoft/applicationinsights-teechannel-js @microsoft/applicationinsights-web ``` ```js import { ApplicationInsights } from '@microsoft/applicationinsights-web'; import { TeeChannel } from '@microsoft/applicationinsights-teechannel-js'; const teeChannel = new TeeChannel(); // TeeChannel configuration const teeChannelConfig = { teeChannels: [[]], ignoreCoreChannels: false }; // Application Insights Configuration passing the tee Channel via extensions const configObj = { instrumentationKey: "YOUR INSTRUMENTATION KEY", extensions: [teeChannel], extensionConfig: { [teeChannel.identifier]: teeChannelConfig }, }; const appInsights = new ApplicationInsights({ config: configObj }); appInsights.loadAppInsights(); ``` ## [Configuration](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-teechannel-js/interfaces/ITeeChannelConfig.html) | Name | Type | Default | Description | --------------------- | -----------------------------------| -----------| ---------------------------------------------------------------------------------------------------------------- | [teeChannels](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-teechannel-js/interfaces/ITeeChannelConfig.html#teeChannels) | `IChannelControls`[][] | undefined | Defines the Channels specific to the TeeChannel | [ignoreCoreChannels](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-teechannel-js/interfaces/ITeeChannelConfig.html#ignoreCoreChannels) | boolean | false |By default the TeeChannel will use the core configuration `channels` (starting at index 1 `channels[1.xxx]`) as separate tee'd channel chains for processing events. This configuration allow you to ignore any additional core channels and only use the `teeChannels` ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. ## License [MIT](LICENSE) ================================================ FILE: channels/tee-channel-js/Tests/Unit/src/GlobalTestHooks.Test.ts ================================================ import { Assert } from "@microsoft/ai-test-framework"; import { _testHookMaxUnloadHooksCb } from "@microsoft/applicationinsights-core-js"; import { dumpObj } from "@nevware21/ts-utils"; export class GlobalTestHooks { public registerTests() { // Set a global maximum _testHookMaxUnloadHooksCb(20, (state: string, hooks: Array) => { Assert.ok(false, "Max unload hooks exceeded [" + hooks.length + "] - " + state + " - " + dumpObj(hooks)); }); } } ================================================ FILE: channels/tee-channel-js/Tests/Unit/src/TeeChannelCore.Tests.ts ================================================ import { Assert, AITestClass } from "@microsoft/ai-test-framework"; import { ITelemetryItem, AppInsightsCore, isNullOrUndefined, IChannelControls, ITelemetryPlugin, ITelemetryPluginChain, IConfiguration, IPlugin, eLoggingSeverity, _eInternalMessageId } from "@microsoft/applicationinsights-core-js"; import { TeeChannel } from "../../../src/TeeChannel"; const AIInternalMessagePrefix = "AITR_"; const MaxInt32 = 0xFFFFFFFF; export class TeeChannelCoreTests extends AITestClass { public testInitialize() { super.testInitialize(); } public testCleanup() { super.testCleanup(); } public registerTests() { this.testCase({ name: "config.channel dynamic config", useFakeTimers: true, test: () => { const channelPlugin = new ChannelPlugin(); const teeChannel = new TeeChannel(); const appInsightsCore = new AppInsightsCore(); const channelPlugin1 = new ChannelPlugin(); channelPlugin1.priority = 1030; const channelPlugin2 = new ChannelPlugin(); channelPlugin2.priority = 1031; const extId = teeChannel.identifier; appInsightsCore.initialize( { instrumentationKey: "09465199-12AA-4124-817F-544738CC7C41", channels: [[channelPlugin, teeChannel],[channelPlugin1]]},[] ); let coreChannels = appInsightsCore.getChannels(); Assert.equal(2, coreChannels.length, "Total number of core channel queues in test 1"); Assert.deepEqual(coreChannels[0], teeChannel, "core channel 2 in test 1"); Assert.deepEqual(coreChannels[1], channelPlugin, "core channel 2 in test 1"); let teeChannels = teeChannel.getTeeChannels(); Assert.equal(1, teeChannels.length, "Total number of tee channel queues"); Assert.equal(1, teeChannels[0].length, "tee channel 1 length in test 1"); Assert.equal(channelPlugin1, teeChannels[0][0], "tee channel 1 in test 1"); appInsightsCore.config.extensionConfig = appInsightsCore.config.extensionConfig? appInsightsCore.config.extensionConfig : {}; let extConfig = appInsightsCore.config.extensionConfig; let teeChanneConfig = extConfig[extId]; Assert.deepEqual(teeChanneConfig, {ignoreCoreChannels: false, teeChannels: null}, "default config is set"); appInsightsCore.config.extensionConfig[extId] = {ignoreCoreChannels: false, teeChannels: [[channelPlugin2]]}; this.clock.tick(1); coreChannels = appInsightsCore.getChannels(); Assert.equal(2, coreChannels.length, "Total number of core channel queues in test 2"); Assert.deepEqual(coreChannels[0], teeChannel, "core channel 1 in test 2"); Assert.deepEqual(coreChannels[1], channelPlugin, "core channel 2 in test 2"); teeChannels = teeChannel.getTeeChannels(); Assert.equal(2, teeChannels.length, "Total number of tee channel queues"); Assert.equal(1, teeChannels[0].length, "tee channel 1 length in test 2"); Assert.equal(channelPlugin1, teeChannels[0][0], "tee channel 1 in test 2"); Assert.equal(1, teeChannels[1].length, "tee channel 2 length in test 2"); Assert.equal(channelPlugin2, teeChannels[1][0], "tee channel 2 in test 2"); appInsightsCore.config.extensionConfig[extId] = {ignoreCoreChannels: true, teeChannels: [[channelPlugin1, teeChannel]]}; this.clock.tick(1); coreChannels = appInsightsCore.getChannels(); Assert.equal(2, coreChannels.length, "Total number of core channel queues in test 3"); Assert.deepEqual(coreChannels[0], teeChannel, "core channel 1 in test 3"); Assert.deepEqual(coreChannels[1], channelPlugin, "core channel 2 in test 3"); teeChannels = teeChannel.getTeeChannels(); Assert.equal(1, teeChannels.length, "Total number of tee channel queues"); Assert.equal(1, teeChannels[0].length, "tee channel 1 length in test 3"); Assert.equal(channelPlugin1, teeChannels[0][0], "tee channel 1 index 1 in test 3"); appInsightsCore.config.extensionConfig[extId] = {ignoreCoreChannels: false, teeChannels: [[channelPlugin1, teeChannel]]}; this.clock.tick(1); coreChannels = appInsightsCore.getChannels(); Assert.equal(2, coreChannels.length, "Total number of core channel queues in test 4"); Assert.deepEqual(coreChannels[0], teeChannel, "core channel 1 in test 4"); Assert.deepEqual(coreChannels[1], channelPlugin, "core channel 2 in test 4"); teeChannels = teeChannel.getTeeChannels(); Assert.equal(2, teeChannels.length, "Total number of tee channel queues"); Assert.equal(1, teeChannels[0].length, "tee channel 1 length in test 4"); Assert.equal(channelPlugin1, teeChannels[0][0], "tee channel 1 index1 in test 4"); Assert.equal(1, teeChannels[1].length, "tee channel 2 length in test 4"); Assert.equal(channelPlugin1, teeChannels[1][0], "tee channel 2 index 1 in test 4"); } }); this.testCase({ name: "config.channel adds queue to existing channels", test: () => { const channelPlugin = new ChannelPlugin(); channelPlugin.priority = 1030; const channelPlugin1 = new ChannelPlugin(); channelPlugin1.priority = 1030; const teeChannel = new TeeChannel(); const appInsightsCore = new AppInsightsCore(); appInsightsCore.initialize( { instrumentationKey: "09465199-12AA-4124-817F-544738CC7C41", channels: [[channelPlugin1, teeChannel]] }, [channelPlugin]); const coreChannels = appInsightsCore.getChannels(); const teeChannels = teeChannel.getTeeChannels(); Assert.equal(3, coreChannels.length, "Total number of channel queues"); Assert.equal(0, teeChannels.length, "Total number of tee channel queues"); } }); this.testCase({ name: "teeChannels config adds queue to existing channels", test: () => { const channelPlugin = new ChannelPlugin(); channelPlugin.priority = 1030; const channelPlugin1 = new ChannelPlugin(); channelPlugin1.priority = 1030; const channelPlugin2 = new ChannelPlugin(); channelPlugin1.priority = 1030; const teeChannel = new TeeChannel(); const appInsightsCore = new AppInsightsCore(); appInsightsCore.initialize( { instrumentationKey: "09465199-12AA-4124-817F-544738CC7C41", channels: [[channelPlugin1, teeChannel]], extensionConfig: { [teeChannel.identifier] : { teeChannels: [[channelPlugin2]] } } }, [channelPlugin], ); const coreChannels = appInsightsCore.getChannels(); const teeChannels = teeChannel.getTeeChannels(); Assert.equal(3, coreChannels.length, "Total number of channel queues"); Assert.equal(1, teeChannels.length, "Total number of tee channel queues"); Assert.equal(1, teeChannels[0].length, "Number of tee channels in queue 1"); Assert.ok(teeChannels[0][0] === channelPlugin2); } }); this.testCase({ name: "Tee channels can be passed in through the config.channel with the teeChannel in the primary channel queue", test: () => { const channelPlugin2 = new ChannelPlugin(); channelPlugin2.priority = 1030; const channelPlugin1 = new ChannelPlugin(); channelPlugin1.priority = 1030; const teeChannel = new TeeChannel(); const appInsightsCore = new AppInsightsCore(); appInsightsCore.initialize( { instrumentationKey: "09465199-12AA-4124-817F-544738CC7C41", channels: [[channelPlugin1, teeChannel], [channelPlugin2]] }, [] ); const coreChannels = appInsightsCore.getChannels(); const teeChannels = teeChannel.getTeeChannels(); Assert.equal(2, coreChannels.length, "Total number of channel queues"); Assert.ok(coreChannels[0] === teeChannel); Assert.ok(coreChannels[1] === channelPlugin1); Assert.ok(channelPlugin1._nextPlugin === undefined); Assert.equal(1, teeChannels.length, "Total number of tee channel queues"); Assert.equal(1, teeChannels[0].length, "Number of tee channels in queue 1"); Assert.ok(teeChannels[0][0] === channelPlugin2); Assert.ok(channelPlugin2._nextPlugin === undefined); } }); this.testCase({ name: "Tee channels passed via config.channel and extensionConfig teeChannels", test: () => { const channelPlugin1 = new ChannelPlugin(); channelPlugin1.priority = 1030; const channelPlugin2 = new ChannelPlugin(); channelPlugin2.priority = 1030; const channelPlugin3 = new ChannelPlugin(); channelPlugin2.priority = 1030; const teeChannel = new TeeChannel(); const appInsightsCore = new AppInsightsCore(); appInsightsCore.initialize( { instrumentationKey: "09465199-12AA-4124-817F-544738CC7C41", channels: [[channelPlugin1, teeChannel], [channelPlugin2]], extensionConfig: { [teeChannel.identifier] : { teeChannels: [[channelPlugin3]] } } }, [] ); const coreChannels = appInsightsCore.getChannels(); const teeChannels = teeChannel.getTeeChannels(); Assert.equal(2, coreChannels.length, "Total number of channel queues"); Assert.ok(coreChannels[0] === teeChannel); Assert.ok(coreChannels[1] === channelPlugin1); Assert.ok(channelPlugin1._nextPlugin === undefined); Assert.equal(2, teeChannels.length, "Total number of tee channel queues"); Assert.equal(1, teeChannels[0].length, "Number of tee channels in queue 1"); Assert.equal(1, teeChannels[1].length, "Number of tee channels in queue 1"); Assert.ok(teeChannels[0][0] === channelPlugin2); Assert.ok(teeChannels[1][0] === channelPlugin3); Assert.ok(channelPlugin2._nextPlugin === undefined); } }); this.testCase({ name: "Channels can be passed in through configuration with the teeChannel as an extension", test: () => { const channelPlugin1 = new ChannelPlugin(); channelPlugin1.priority = 1001; const channelPlugin2 = new ChannelPlugin(); channelPlugin2.priority = 1002; const channelPlugin3 = new ChannelPlugin(); channelPlugin3.priority = 1001; const appInsightsCore = new AppInsightsCore(); const teeChannel = new TeeChannel(); appInsightsCore.initialize( { instrumentationKey: "09465199-12AA-4124-817F-544738CC7C41", channels: [[channelPlugin1, channelPlugin2], [channelPlugin3]], extensions: [teeChannel] }, []); Assert.ok(channelPlugin1._nextPlugin === channelPlugin2); Assert.ok(isNullOrUndefined(channelPlugin3._nextPlugin)); const coreChannels = appInsightsCore.getChannels(); const teeChannels = teeChannel.getTeeChannels(); Assert.equal(3, coreChannels.length, "Number of core channels"); Assert.ok(coreChannels[0] === teeChannel); Assert.ok(coreChannels[1] === channelPlugin1); Assert.ok(coreChannels[2] === channelPlugin2); Assert.equal(1, teeChannels[0].length); Assert.ok(teeChannels[0][0] === channelPlugin3); Assert.ok(channelPlugin2._nextPlugin === undefined); Assert.ok(channelPlugin3._nextPlugin === undefined); } }); this.testCase({ name: "Validate a warning when the TeeChannel is not added", test: () => { const channelPlugin1 = new ChannelPlugin(); channelPlugin1.priority = 1001; const channelPlugin2 = new ChannelPlugin(); channelPlugin2.priority = 1002; const channelPlugin3 = new ChannelPlugin(); channelPlugin3.priority = 1001; const appInsightsCore = new AppInsightsCore(); let throwSpy = this.sandbox.stub(appInsightsCore.logger, 'throwInternal'); appInsightsCore.initialize( { instrumentationKey: "09465199-12AA-4124-817F-544738CC7C41", channels: [[channelPlugin1, channelPlugin2], [channelPlugin3]] }, [], appInsightsCore.logger // Reuse the default logger ); Assert.ok(channelPlugin1._nextPlugin === channelPlugin2); Assert.ok(isNullOrUndefined(channelPlugin3._nextPlugin)); const coreChannels = appInsightsCore.getChannels(); Assert.equal(2, coreChannels.length, "Number of core channels"); Assert.ok(coreChannels[0] === channelPlugin1); Assert.ok(coreChannels[1] === channelPlugin2); Assert.ok(channelPlugin2._nextPlugin === undefined); Assert.ok(channelPlugin3._nextPlugin === undefined); // Test Assert.equal(throwSpy.calledOnce, true, "Critical was logged"); Assert.equal(throwSpy.args[0][0], eLoggingSeverity.CRITICAL, "Checking that the error is critical"); Assert.equal(throwSpy.args[0][1], _eInternalMessageId.SenderNotInitialized, "Checking that the error number"); Assert.ok(throwSpy.args[0][2].indexOf("TeeChannel") != -1); Assert.equal(throwSpy.args[0][4], false, "Checking that this was not a user error"); } }); } } class ChannelPlugin implements IChannelControls { public _nextPlugin: ITelemetryPlugin | ITelemetryPluginChain; public isFlushInvoked = false; public isUnloadInvoked = false; public isTearDownInvoked = false; public isResumeInvoked = false; public isPauseInvoked = false; public version: string = "1.0.33-Beta"; public processTelemetry; public identifier = "Sender"; public priority: number = 1001; constructor() { this.processTelemetry = this._processTelemetry.bind(this); } public pause(): void { this.isPauseInvoked = true; } public resume(): void { this.isResumeInvoked = true; } public teardown(): void { this.isTearDownInvoked = true; } flush(async?: boolean, callBack?: () => void): void { this.isFlushInvoked = true; if (callBack) { callBack(); } } onunloadFlush(async?: boolean) { this.isUnloadInvoked = true; } setNextPlugin(next: ITelemetryPlugin | ITelemetryPluginChain) { this._nextPlugin = next; } public initialize = (config: IConfiguration) => { } public _processTelemetry(env: ITelemetryItem) { } } ================================================ FILE: channels/tee-channel-js/Tests/Unit/src/teechannel.tests.ts ================================================ import { TeeChannelCoreTests } from "./TeeChannelCore.Tests"; import { GlobalTestHooks } from "./GlobalTestHooks.Test"; export function runTests() { new GlobalTestHooks().registerTests(); new TeeChannelCoreTests().registerTests(); } ================================================ FILE: channels/tee-channel-js/Tests/UnitTests.html ================================================  Tests for Application Insights JavaScript API
    ================================================ FILE: channels/tee-channel-js/Tests/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": false, "module": "amd", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "declaration": true }, "include": [ ], "exclude": [ "node_modules/" ] } ================================================ FILE: channels/tee-channel-js/api-extractor.json ================================================ /** * Config file for API Extractor. For more info, please visit: https://api-extractor.com */ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", /** * Optionally specifies another JSON config file that this file extends from. This provides a way for * standard settings to be shared across multiple projects. * * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be * resolved using NodeJS require(). * * SUPPORTED TOKENS: none * DEFAULT VALUE: "" */ // "extends": "./shared/api-extractor-base.json" // "extends": "my-package/include/api-extractor-base.json" /** * Determines the "" token that can be used with other config file settings. The project folder * typically contains the tsconfig.json and package.json config files, but the path is user-defined. * * The path is resolved relative to the folder of the config file that contains the setting. * * The default value for "projectFolder" is the token "", which means the folder is determined by traversing * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error * will be reported. * * SUPPORTED TOKENS: * DEFAULT VALUE: "" */ "projectFolder": ".", /** * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor * analyzes the symbols exported by this module. * * The file extension must be ".d.ts" and not ".ts". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , */ "mainEntryPointFilePath": "/build/types/applicationinsights-teechannel-js.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. * * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly * imports library2. To avoid this, we can specify: * * "bundledPackages": [ "library2" ], * * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been * local files for library1. */ "bundledPackages": [ ], /** * Determines how the TypeScript compiler engine will be invoked by API Extractor. */ "compiler": { /** * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * Note: This setting will be ignored if "overrideTsconfig" is used. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/tsconfig.json" */ // "tsconfigFilePath": "/tsconfig.json", /** * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. * The object must conform to the TypeScript tsconfig schema: * * http://json.schemastore.org/tsconfig * * If omitted, then the tsconfig.json file will be read from the "projectFolder". * * DEFAULT VALUE: no overrideTsconfig section */ // "overrideTsconfig": { // . . . // } /** * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. * * DEFAULT VALUE: false */ // "skipLibCheck": true, }, /** * Configures how the API report file (*.api.md) will be generated. */ "apiReport": { /** * (REQUIRED) Whether to generate an API report. */ "enabled": true, /** * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce * a full file path. * * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". * * SUPPORTED TOKENS: , * DEFAULT VALUE: ".api.md" */ "reportFileName": ".api.md", /** * Specifies the folder where the API report file is written. The file name portion is determined by * the "reportFileName" setting. * * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, * e.g. for an API review. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/etc/" */ "reportFolder": "/build/dts/", /** * Specifies the folder where the temporary report file is written. The file name portion is determined by * the "reportFileName" setting. * * After the temporary file is written to disk, it is compared with the file in the "reportFolder". * If they are different, a production build will fail. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/" */ // "reportTempFolder": "/temp/" }, /** * Configures how the doc model file (*.api.json) will be generated. */ "docModel": { /** * (REQUIRED) Whether to generate a doc model file. */ "enabled": true, /** * The output path for the doc model file. The file extension should be ".api.json". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/.api.json" */ "apiJsonFilePath": "/build/dts/.api.json" }, /** * Configures how the .d.ts rollup file will be generated. */ "dtsRollup": { /** * (REQUIRED) Whether to generate the .d.ts rollup file. */ "enabled": true, /** * Specifies the output path for a .d.ts rollup file to be generated without any trimming. * This file will include all declarations that are exported by the main entry point. * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/dist/.d.ts" */ "untrimmedFilePath": "/build/dts/.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. * This file will include only declarations that are marked as "@public" or "@beta". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "betaTrimmedFilePath": "/build/dts/-beta.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. * This file will include only declarations that are marked as "@public". * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "publicTrimmedFilePath": "/build/dts/-public.d.ts", /** * When a declaration is trimmed, by default it will be replaced by a code comment such as * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the * declaration completely. * * DEFAULT VALUE: false */ // "omitTrimmingComments": true }, /** * Configures how the tsdoc-metadata.json file will be generated. */ "tsdocMetadata": { /** * Whether to generate the tsdoc-metadata.json file. * * DEFAULT VALUE: true */ "enabled": false, /** * Specifies where the TSDoc metadata file should be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup * falls back to "tsdoc-metadata.json" in the package folder. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ "tsdocMetadataFilePath": "/build/dts/tsdoc-metadata.json" }, /** * Configures how API Extractor reports error and warning messages produced during analysis. * * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. */ "messages": { /** * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing * the input .d.ts files. * * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "compilerMessageReporting": { /** * Configures the default routing for messages that don't match an explicit rule in this table. */ "default": { /** * Specifies whether the message should be written to the the tool's output log. Note that * the "addToApiReportFile" property may supersede this option. * * Possible values: "error", "warning", "none" * * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes * the "--local" option), the warning is displayed but the build will not fail. * * DEFAULT VALUE: "warning" */ "logLevel": "warning", /** * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), * then the message will be written inside that file; otherwise, the message is instead logged according to * the "logLevel" option. * * DEFAULT VALUE: false */ // "addToApiReportFile": false }, // "TS2551": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . }, /** * Configures handling of messages reported by API Extractor during its analysis. * * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" * * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings */ "extractorMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false }, "ae-missing-release-tag": { "logLevel": "none" }, // // . . . }, /** * Configures handling of messages reported by the TSDoc parser when analyzing code comments. * * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "tsdocMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false } // "tsdoc-link-tag-unescaped-text": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . } } } ================================================ FILE: channels/tee-channel-js/package.json ================================================ { "name": "@microsoft/applicationinsights-teechannel-js", "version": "3.4.1", "description": "Microsoft Application Insights JavaScript SDK Tee Channel", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "author": "Microsoft Application Insights Team", "main": "dist/es5/applicationinsights-teechannel-js.js", "module": "dist-es5/applicationinsights-teechannel-js.js", "types": "types/applicationinsights-teechannel-js.d.ts", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/channels/tee-channel-js" }, "scripts": { "clean": "git clean -xdf", "build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen", "build:esm": "grunt teechannel", "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs", "rebuild": "npm run build", "test": "grunt teechanneltest", "mintest": "grunt teechannel-mintest", "lint": "tslint -p tsconfig.json", "dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights JavaScript SDK Tee Channel\"", "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js", "ai-min": "grunt teechannel-min", "ai-restore": "grunt teechannel-restore", "npm-pack": "npm pack", "npm-publish-ai": "node ../../tools/release-tools/npm_publish.js .", "api-docs": "typedoc" }, "devDependencies": { "@microsoft/ai-test-framework": "0.0.1", "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es5": "1.0.2", "@microsoft/api-extractor": "^7.40.0", "@types/sinon": "4.3.3", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "@nevware21/grunt-ts-plugin": "^0.5.2", "@nevware21/grunt-eslint-ts": "^0.5.2", "globby": "^11.0.0", "magic-string": "^0.25.7", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "rollup": "^3.20.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "^4.9.3", "tslib": "^2.0.0", "typedoc": "^0.26.6", "sinon": "^7.3.1" }, "peerDependencies": { "tslib": ">= 1.0.0" }, "dependencies": { "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/applicationinsights-core-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x", "@nevware21/ts-async": ">= 0.5.5 < 2.x" }, "license": "MIT" } ================================================ FILE: channels/tee-channel-js/rollup.config.js ================================================ import { createConfig } from "../../rollup.base.config"; import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const browserEntryPointName = "applicationinsights-teechannel-js"; const browserOutputName = "applicationinsights-teechannel-js"; const entryPointName = "applicationinsights-teechannel-js"; const outputName = "applicationinsights-teechannel-js"; const banner = [ "/*!", ` * Application Insights JavaScript SDK - Tee Channel, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the MIT License.": "" }; updateDistEsmFiles(replaceValues, banner, true, true, "dist-es5"); export default createConfig(banner, { namespace: "Microsoft.ApplicationInsights", version: version, node: { entryPoint: entryPointName, outputName: outputName }, browser: { entryPoint: browserEntryPointName, outputName: browserOutputName } }, [ "applicationinsights-teechannel-js" ] ); ================================================ FILE: channels/tee-channel-js/src/ChannelController.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { IAppInsightsCore, IBaseProcessingContext, IChannelControls, IPlugin, IProcessTelemetryContext, IProcessTelemetryUnloadContext, IProcessTelemetryUpdateContext, ITelemetryItem, ITelemetryUnloadState, ITelemetryUpdateState, SendRequestReason, TelemetryUnloadReason, TelemetryUpdateReason, createProcessTelemetryContext } from "@microsoft/applicationinsights-core-js"; import { IPromise, createPromise } from "@nevware21/ts-async"; import { ITimerHandler, arrForEach, scheduleTimeout } from "@nevware21/ts-utils"; export const ChannelControllerPriority = 500; export interface IChannelController { init: (channelQueue: _IInternalChannels[], core: IAppInsightsCore) => void; getQueues: () => _IInternalChannels[]; /** * Call back for telemetry processing before it it is sent * @param env - This is the current event being reported * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances * can optionally use this to access the current core instance or define / pass additional information * to later plugins (vs appending items to the telemetry item) */ processTelemetry: (env: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => void; /** * The the plugin should re-evaluate configuration and update any cached configuration settings or * plugins. If implemented this method will be called whenever a plugin is added or removed and if * the configuration has bee updated. * @param updateCtx - This is the context that should be used during updating. * @param updateState - The details / state of the update process, it holds details like the current and previous configuration. * @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations. */ update?: (updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState) => void | boolean; /** * Pause sending data */ pause(): void; /** * Resume sending data */ resume(): void; /** * Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and * therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further * processTelemetry calls are ignored and it just calls the processNext() with the provided context. * @param unloadCtx - This is the context that should be used during unloading. * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload. * @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing. */ teardown: (unloadCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState, onComplete: () => void) => void | boolean; /** * Flush any batched events immediately; Will not flush if the paused and channel should default to sending data asynchronously. * If executing asynchronously and you DO NOT pass a callback function then a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * will be returned which will resolve once the flush is complete. The actual implementation of the `IPromise` * will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async) * @param async - send data asynchronously when true * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. * If the caller doesn't return true the caller should assume that it may never be called. * @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified * @returns - If a callback is provided `true` to indicate that callback will be called after the flush is complete otherwise the caller * should assume that any provided callback will never be called, Nothing or if occurring asynchronously a * [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) which will be resolved once the unload is complete, * the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) will only be returned when no callback is provided * and isAsync is true. */ flush(isAsync: boolean, callBack: (flushComplete?: boolean) => void, sendReason: SendRequestReason, cbTimeout?: number): void; /** * Get and return the named channel instance (if present) from the queues * @param pluginIdentifier - The identifier name of the plugin */ getChannel(pluginIdentifier: string): T; } export interface _IInternalChannels { queue: IChannelControls[]; } function _getTelCtx(core: IAppInsightsCore) { return createProcessTelemetryContext(null, core.config, core, null) } function _processChannelQueue(theChannels: _IInternalChannels[], itemCtx: T, processFn: (chainCtx: T) => void, onComplete: (() => void) | null) { let waiting = theChannels ? (theChannels.length + 1) : 1; function _runChainOnComplete() { waiting --; if (waiting === 0) { onComplete && onComplete(); onComplete = null; } } if (waiting > 0) { arrForEach(theChannels, (channels) => { // pass on to first item in queue if (channels && channels.queue.length > 0) { let chainCtx = itemCtx.createNew(channels.queue) as T; chainCtx.onComplete(_runChainOnComplete); // Cause this chain to start processing processFn(chainCtx); } else { waiting --; } }); } _runChainOnComplete(); } export function createChannelControllerPlugin(): IChannelController { let _channelQueue: _IInternalChannels[] = []; let _core: IAppInsightsCore = null; function _doUpdate(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState) { let theUpdateState: ITelemetryUpdateState = updateState || { reason: TelemetryUpdateReason.Unknown }; _processChannelQueue(_channelQueue, updateCtx, (chainCtx: IProcessTelemetryUpdateContext) => { chainCtx.processNext(theUpdateState); }, () => { updateCtx.processNext(theUpdateState); }); return true; } function _getChannel(pluginIdentifier: string): T { let thePlugin: T = null; if (_channelQueue && _channelQueue.length > 0) { arrForEach(_channelQueue, (channels) => { // pass on to first item in queue if (channels && channels.queue.length > 0) { arrForEach(channels.queue, (ext: any) => { if (ext.identifier === pluginIdentifier) { thePlugin = ext; // Cause arrForEach to stop iterating return -1; } }); if (thePlugin) { // Cause arrForEach to stop iterating return -1; } } }); } return thePlugin; } let channelController: IChannelController = { init: (channelQueue: _IInternalChannels[], core: IAppInsightsCore) => { _channelQueue = channelQueue; _core = core; }, getQueues: () => { return _channelQueue; }, processTelemetry: (item: ITelemetryItem, itemCtx: IProcessTelemetryContext) => { _processChannelQueue(_channelQueue, itemCtx || _getTelCtx(_core), (chainCtx: IProcessTelemetryContext) => { chainCtx.processNext(item); }, () => { itemCtx.processNext(item); }); }, update: _doUpdate, pause: () => { _processChannelQueue(_channelQueue, _getTelCtx(_core), (chainCtx: IProcessTelemetryContext) => { chainCtx.iterate((plugin) => { plugin.pause && plugin.pause(); }); }, null); }, resume: () => { _processChannelQueue(_channelQueue, _getTelCtx(_core), (chainCtx: IProcessTelemetryContext) => { chainCtx.iterate((plugin) => { plugin.resume && plugin.resume(); }); }, null); }, teardown: (unloadCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState, onComplete: () => void) => { let theUnloadState: ITelemetryUnloadState = unloadState || { reason: TelemetryUnloadReason.ManualTeardown, isAsync: false }; _processChannelQueue(_channelQueue, unloadCtx, (chainCtx: IProcessTelemetryUnloadContext) => { chainCtx.processNext(theUnloadState); }, () => { unloadCtx.processNext(theUnloadState); onComplete && onComplete(); }); return true; }, getChannel: _getChannel, flush: (isAsync: boolean, callBack: (flushComplete?: boolean) => void, sendReason: SendRequestReason, cbTimeout?: number) => { // Setting waiting to one so that we don't call the callBack until we finish iterating let waiting = 1; let doneIterating = false; let cbTimer: ITimerHandler = null; let result: boolean | IPromise = true; cbTimeout = cbTimeout || 5000; if (isAsync && !callBack) { result = createPromise((resolve) => { callBack = resolve; }); } function doCallback() { waiting--; if (doneIterating && waiting === 0) { cbTimer && cbTimer.cancel(); cbTimer = null; callBack && callBack(doneIterating); callBack = null; } } _processChannelQueue(_channelQueue, _getTelCtx(_core), (chainCtx: IProcessTelemetryContext) => { chainCtx.iterate((plugin) => { if (plugin.flush) { waiting ++; let handled = false; // Not all channels will call this callback for every scenario if (!plugin.flush(isAsync, () => { handled = true; doCallback(); }, sendReason)) { if (!handled) { // If any channel doesn't return true and it didn't call the callback, then we should assume that the callback // will never be called, so use a timeout to allow the channel(s) some time to "finish" before triggering any // followup function (such as unloading) if (isAsync && cbTimer == null) { cbTimer = scheduleTimeout(() => { cbTimer = null; doCallback(); }, cbTimeout); } else { doCallback(); } } } } }); }, () => { doneIterating = true; doCallback(); }); return result; } }; return channelController; } ================================================ FILE: channels/tee-channel-js/src/Interfaces/ITeeChannelConfig.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { IChannelControls } from "@microsoft/applicationinsights-core-js"; export interface ITeeChannelConfig { /** * Channel queues that is setup by caller in desired order. * If channels are provided here, core will ignore any channels that are already setup, example if there is a SKU with an initialized channel */ teeChannels?: IChannelControls[][]; /** * By default the TeeChannel will use the core configuration `channels` (starting at index 1 `channels[1.xxx]`) as separate tee'd channel chains * for processing events. This configuration allow you to ignore any additional core channels and only use the `teeChannels` * Defaults to false */ ignoreCoreChannels?: boolean; } ================================================ FILE: channels/tee-channel-js/src/TeeChannel.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import dynamicProto from "@microsoft/dynamicproto-js"; import { BaseTelemetryPlugin, IAppInsightsCore, IChannelControls, IChannelControlsHost, IConfig, IConfigDefaults, IConfiguration, IPlugin, IProcessTelemetryContext, IProcessTelemetryUnloadContext, IProcessTelemetryUpdateContext, ITelemetryItem, ITelemetryPluginChain, ITelemetryUnloadState, ITelemetryUpdateState, SendRequestReason, cfgDfBoolean, createProcessTelemetryContext, initializePlugins, onConfigChange, proxyFunctions } from "@microsoft/applicationinsights-core-js"; import { IPromise } from "@nevware21/ts-async"; import { arrForEach, isArray, objDeepFreeze, objFreeze, throwError } from "@nevware21/ts-utils"; import { ChannelControllerPriority, IChannelController, _IInternalChannels, createChannelControllerPlugin } from "./ChannelController"; import { ITeeChannelConfig } from "./Interfaces/ITeeChannelConfig"; const ChannelValidationMessage = "Channel has invalid priority - "; const defaultTeeChannelConfig: IConfigDefaults = objDeepFreeze({ teeChannels: null, ignoreCoreChannels: cfgDfBoolean() }); function _addChannelQueue(channelQueue: _IInternalChannels[], queue: IChannelControls[], core: IAppInsightsCore, teeChannel?: IChannelControls) { if (queue && isArray(queue) && queue.length > 0) { queue = queue.sort((a, b) => { // sort based on priority within each queue return a.priority - b.priority; }); let _queue: IChannelControls[] = []; arrForEach(queue, queueItem => { if (queueItem.priority < ChannelControllerPriority) { throwError(ChannelValidationMessage + queueItem.identifier); } if (queueItem !== teeChannel) { _queue.push(queueItem); } }); channelQueue.push({ queue: objFreeze(_queue) }); } } function _createChannelQueues(config: ITeeChannelConfig, core: IAppInsightsCore, teeChannel?: TeeChannel) { let channelQueue: _IInternalChannels[] = []; if (config) { if (!config.ignoreCoreChannels && core.config.channels) { // Add and sort the configuration channel queues arrForEach(core.config.channels, (queue, idx) => { if (idx > 0) { _addChannelQueue(channelQueue, queue, core, teeChannel); } }); } if (config.teeChannels) { // Add and sort the configuration channel queues arrForEach(config.teeChannels, queue => _addChannelQueue(channelQueue, queue, core, teeChannel)); } } return channelQueue; } export class TeeChannel extends BaseTelemetryPlugin implements IChannelControlsHost { public readonly identifier: string = "TeeChannelController"; public readonly priority: number = 999; /** * Returns whether the plugin has been initialized */ public isInitialized: () => boolean; constructor() { super(); let _channelController: IChannelController; let _isInitialized: boolean; dynamicProto(TeeChannel, this, (_self, base) => { _initDefaults(); _self.initialize = (config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) => { if (!_isInitialized) { _isInitialized = true; _initChannels(_self, core); } }; _self.getTeeChannels = (): IChannelControls[][] => { let controls: IChannelControls[][] = []; let channelQueues = _channelController.getQueues() if (channelQueues) { arrForEach(channelQueues, (channels) => { controls.push(channels.queue); }); } return objFreeze(controls); }; _self.isInitialized = () => { return _isInitialized }; _self.teardown = (unloadCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => { return _channelController.teardown(unloadCtx, unloadState, () => { _isInitialized = false; }); }; proxyFunctions(_self, _channelController, [ "processTelemetry", "update", "pause", "resume", "getChannel", "flush" ]); }); function _initDefaults() { _channelController = createChannelControllerPlugin(); _isInitialized = false; } function _initChannels(self: TeeChannel, core: IAppInsightsCore) { // This function will be re-called whenever any referenced configuration is changed self._addHook(onConfigChange(core.config, (details) => { let ctx = createProcessTelemetryContext(null, details.cfg, core); let theConfig = ctx.getExtCfg(self.identifier, defaultTeeChannelConfig); let channelQueue = _createChannelQueues(theConfig, core, self); arrForEach(channelQueue, (channels) => { if (channels && channels.queue.length > 0) { initializePlugins(ctx.createNew(channels.queue), details.cfg.extensions); } }); _channelController.init(channelQueue, core); })); } } public initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?:ITelemetryPluginChain): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public getTeeChannels(): IChannelControls[][] { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } public processTelemetry(telemetryItem: ITelemetryItem, itemCtx?: IProcessTelemetryContext) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and * therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further * processTelemetry calls are ignored and it just calls the processNext() with the provided context. * @param unloadCtx - This is the context that should be used during unloading. * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload. * @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing. */ public teardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void | boolean { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * The the plugin should re-evaluate configuration and update any cached configuration settings. * @param updateCtx - This is the context that should be used during updating. * @param updateState - The details / state of the update process, it holds details like the current and previous configuration. * @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations. */ public update(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Pause the sending (transmission) of events, this will cause all events to be batched only until the maximum limits are * hit at which point new events are dropped. Will also cause events to NOT be sent during page unload, so if Session storage * is disabled events will be lost. * SessionStorage Limit is 2000 events, In-Memory (Array) Storage is 10,000 events (can be configured via the eventsLimitInMem). */ public pause(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Resume the sending (transmission) of events, this will restart the timer and any batched events will be sent using the normal * send interval. */ public resume(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Flush any batched events immediately; Will not flush if the paused and channel should default to sending data asynchronously. * If executing asynchronously and you DO NOT pass a callback function then a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) * will be returned which will resolve once the flush is complete. The actual implementation of the `IPromise` * will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async) * @param async - send data asynchronously when true * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. * If the caller doesn't return true the caller should assume that it may never be called. * @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified * @returns - If a callback is provided `true` to indicate that callback will be called after the flush is complete otherwise the caller * should assume that any provided callback will never be called, Nothing or if occurring asynchronously a * [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) which will be resolved once the unload is complete, * the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) will only be returned when no callback is provided * and isAsync is true. */ public flush(isAsync: boolean, callBack: (flushComplete?: boolean) => void, sendReason: SendRequestReason, cbTimeout?: number): void | IPromise { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Flush the batched events synchronously (if possible -- based on configuration). * Will not flush if the Send has been paused. */ public onunloadFlush() { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Get and return the named channel instance (if present) from the queues * @param pluginIdentifier - The identifier name of the plugin */ public getChannel(pluginIdentifier: string): T { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } } ================================================ FILE: channels/tee-channel-js/src/applicationinsights-teechannel-js.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. export { ITeeChannelConfig } from "./Interfaces/ITeeChannelConfig"; export { TeeChannel } from "./TeeChannel"; ================================================ FILE: channels/tee-channel-js/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": true, "module": "es6", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "importHelpers": true, "noEmitHelpers": true, "skipLibCheck": true, "declaration": true, "declarationDir": "build/types", "outDir": "dist-es5", "rootDir": "./src", "removeComments": false }, "include": [ "./src/**/*.ts" ], "exclude": [ "node_modules" ] } ================================================ FILE: channels/tee-channel-js/tsdoc.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", "extends": ["../../tsdoc.json"] } ================================================ FILE: channels/tee-channel-js/typedoc.json ================================================ { "$schema": "https://typedoc.org/schema.json", "entryPoints": [ "./src/applicationinsights-teechannel-js.ts" ], "exclude": [ "**/internal/**/*.ts", "node_modules/**" ], "externalPattern": [ "**/node_modules/**", "node_modules/**" ], "sort": [ "alphabetical", "kind", "instance-first" ], "basePath": "./src", "sourceLinkTemplate": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/{path}#L{line}", "cleanOutputDir": true, "excludeExternals": false, "excludeInternal": true, "excludePrivate": true, "includeVersion": true, "groupOrder": [ "Entrypoint", "Modules", "Namespaces", "Enumerations", "Enumeration Members", "Classes", "Interfaces", "Type Aliases", "Constructors", "Properties", "Variables", "Functions", "Accessors", "Methods", "References", "*" ], "tsconfig": "./tsconfig.json", "out": "../../docs/webSdk/applicationinsights-teechannel-js", "readme": "none", "githubPages": true, "gitRevision": "main", "compilerOptions": { "stripInternal": true }, "sidebarLinks": { "Changelog": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/RELEASES.md", "Examples": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/examples/README.md", "Readme": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/channels/tee-channel-js" }, "navigationLinks": { "GitHub": "https://github.com/Microsoft/ApplicationInsights-JS", "npm": "https://www.npmjs.com/package/@microsoft/applicationinsights-teechannel-js" }, "visibilityFilters": { "protected": false, "private": false, "inherited": true, "external": true } } ================================================ FILE: common/Tests/External/blanket-1.2.2.js ================================================ "undefined" != typeof QUnit && (QUnit.config.autostart = !1), function (a) { !function (b) { if ("object" == typeof exports && "undefined" != typeof module) module.exports = b(); else if ("function" == typeof a && a.amd) a([], b); else { var c; c = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, c.acorn = b() } }(function () { return function a(b, c, d) { function e(g, h) { if (!c[g]) { if (!b[g]) { var i = "function" == typeof require && require; if (!h && i) return i(g, !0); if (f) return f(g, !0); var j = new Error("Cannot find module '" + g + "'"); throw j.code = "MODULE_NOT_FOUND", j } var k = c[g] = { exports: {} }; b[g][0].call(k.exports, function (a) { var c = b[g][1][a]; return e(c ? c : a) }, k, k.exports, a, b, c, d) } return c[g].exports } for (var f = "function" == typeof require && require, g = 0; g < d.length; g++) e(d[g]); return e }({ 1: [function (a, b, c) { "use strict"; function d(a, b) { var c = g(b, a), d = c.pos, e = c.options.locations && c.curPosition(); return c.nextToken(), c.parseTopLevel(c.options.program || c.startNodeAt(d, e)) } function e(a, b, c) { var d = g(c, a, b); return d.nextToken(), d.parseExpression() } function f(a, b) { return g(b, a) } function g(a, b) { return new i(k(a), String(b)) } c.parse = d, c.parseExpressionAt = e, c.tokenizer = f, c.__esModule = !0; // various contributors and released under an MIT license. // // Git repositories for Acorn are available at // // http://marijnhaverbeke.nl/git/acorn // https://github.com/marijnh/acorn.git // // Please use the [github bug tracker][ghbt] to report issues. // // [ghbt]: https://github.com/marijnh/acorn/issues // // This file defines the main parser interface. The library also comes // with a [error-tolerant parser][dammit] and an // [abstract syntax tree walker][walk], defined in other files. // // [dammit]: acorn_loose.js // [walk]: util/walk.js var h = a("./state"), i = h.Parser, j = a("./options"), k = j.getOptions; a("./parseutil"), a("./statement"), a("./lval"), a("./expression"), c.Parser = h.Parser, c.plugins = h.plugins, c.defaultOptions = j.defaultOptions; var l = a("./location"); c.SourceLocation = l.SourceLocation, c.getLineInfo = l.getLineInfo, c.Node = a("./node").Node; var m = a("./tokentype"); c.TokenType = m.TokenType, c.tokTypes = m.types; var n = a("./tokencontext"); c.TokContext = n.TokContext, c.tokContexts = n.types; var o = a("./identifier"); c.isIdentifierChar = o.isIdentifierChar, c.isIdentifierStart = o.isIdentifierStart, c.Token = a("./tokenize").Token; var p = a("./whitespace"); c.isNewLine = p.isNewLine, c.lineBreak = p.lineBreak, c.lineBreakG = p.lineBreakG; var q = "1.2.2"; c.version = q }, { "./expression": 6, "./identifier": 7, "./location": 8, "./lval": 9, "./node": 10, "./options": 11, "./parseutil": 12, "./state": 13, "./statement": 14, "./tokencontext": 15, "./tokenize": 16, "./tokentype": 17, "./whitespace": 19 }], 2: [function (a, b, c) { "function" == typeof Object.create ? b.exports = function (a, b) { a.super_ = b, a.prototype = Object.create(b.prototype, { constructor: { value: a, enumerable: !1, writable: !0, configurable: !0 } }) } : b.exports = function (a, b) { a.super_ = b; var c = function () { }; c.prototype = b.prototype, a.prototype = new c, a.prototype.constructor = a } }, {}], 3: [function (a, b, c) { function d() { if (!h) { h = !0; for (var a, b = g.length; b;) { a = g, g = []; for (var c = -1; ++c < b;) a[c](); b = g.length } h = !1 } } function e() { } var f = b.exports = {}, g = [], h = !1; f.nextTick = function (a) { g.push(a), h || setTimeout(d, 0) }, f.title = "browser", f.browser = !0, f.env = {}, f.argv = [], f.version = "", f.versions = {}, f.on = e, f.addListener = e, f.once = e, f.off = e, f.removeListener = e, f.removeAllListeners = e, f.emit = e, f.binding = function (a) { throw new Error("process.binding is not supported") }, f.cwd = function () { return "/" }, f.chdir = function (a) { throw new Error("process.chdir is not supported") }, f.umask = function () { return 0 } }, {}], 4: [function (a, b, c) { b.exports = function (a) { return a && "object" == typeof a && "function" == typeof a.copy && "function" == typeof a.fill && "function" == typeof a.readUInt8 } }, {}], 5: [function (a, b, c) { (function (b, d) { function e(a, b) { var d = { seen: [], stylize: g }; return arguments.length >= 3 && (d.depth = arguments[2]), arguments.length >= 4 && (d.colors = arguments[3]), p(b) ? d.showHidden = b : b && c._extend(d, b), v(d.showHidden) && (d.showHidden = !1), v(d.depth) && (d.depth = 2), v(d.colors) && (d.colors = !1), v(d.customInspect) && (d.customInspect = !0), d.colors && (d.stylize = f), i(d, a, d.depth) } function f(a, b) { var c = e.styles[b]; return c ? "[" + e.colors[c][0] + "m" + a + "[" + e.colors[c][1] + "m" : a } function g(a, b) { return a } function h(a) { var b = {}; return a.forEach(function (a, c) { b[a] = !0 }), b } function i(a, b, d) { if (a.customInspect && b && A(b.inspect) && b.inspect !== c.inspect && (!b.constructor || b.constructor.prototype !== b)) { var e = b.inspect(d, a); return t(e) || (e = i(a, e, d)), e } var f = j(a, b); if (f) return f; var g = Object.keys(b), p = h(g); if (a.showHidden && (g = Object.getOwnPropertyNames(b)), z(b) && (g.indexOf("message") >= 0 || g.indexOf("description") >= 0)) return k(b); if (0 === g.length) { if (A(b)) { var q = b.name ? ": " + b.name : ""; return a.stylize("[Function" + q + "]", "special") } if (w(b)) return a.stylize(RegExp.prototype.toString.call(b), "regexp"); if (y(b)) return a.stylize(Date.prototype.toString.call(b), "date"); if (z(b)) return k(b) } var r = "", s = !1, u = ["{", "}"]; if (o(b) && (s = !0, u = ["[", "]"]), A(b)) { var v = b.name ? ": " + b.name : ""; r = " [Function" + v + "]" } if (w(b) && (r = " " + RegExp.prototype.toString.call(b)), y(b) && (r = " " + Date.prototype.toUTCString.call(b)), z(b) && (r = " " + k(b)), 0 === g.length && (!s || 0 == b.length)) return u[0] + r + u[1]; if (0 > d) return w(b) ? a.stylize(RegExp.prototype.toString.call(b), "regexp") : a.stylize("[Object]", "special"); a.seen.push(b); var x; return x = s ? l(a, b, d, p, g) : g.map(function (c) { return m(a, b, d, p, c, s) }), a.seen.pop(), n(x, r, u) } function j(a, b) { if (v(b)) return a.stylize("undefined", "undefined"); if (t(b)) { var c = "'" + JSON.stringify(b).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; return a.stylize(c, "string") } return s(b) ? a.stylize("" + b, "number") : p(b) ? a.stylize("" + b, "boolean") : q(b) ? a.stylize("null", "null") : void 0 } function k(a) { return "[" + Error.prototype.toString.call(a) + "]" } function l(a, b, c, d, e) { for (var f = [], g = 0, h = b.length; h > g; ++g) F(b, String(g)) ? f.push(m(a, b, c, d, String(g), !0)) : f.push(""); return e.forEach(function (e) { e.match(/^\d+$/) || f.push(m(a, b, c, d, e, !0)) }), f } function m(a, b, c, d, e, f) { var g, h, j; if (j = Object.getOwnPropertyDescriptor(b, e) || { value: b[e] }, j.get ? h = j.set ? a.stylize("[Getter/Setter]", "special") : a.stylize("[Getter]", "special") : j.set && (h = a.stylize("[Setter]", "special")), F(d, e) || (g = "[" + e + "]"), h || (a.seen.indexOf(j.value) < 0 ? (h = q(c) ? i(a, j.value, null) : i(a, j.value, c - 1), h.indexOf("\n") > -1 && (h = f ? h.split("\n").map(function (a) { return " " + a }).join("\n").substr(2) : "\n" + h.split("\n").map(function (a) { return " " + a }).join("\n"))) : h = a.stylize("[Circular]", "special")), v(g)) { if (f && e.match(/^\d+$/)) return h; g = JSON.stringify("" + e), g.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (g = g.substr(1, g.length - 2), g = a.stylize(g, "name")) : (g = g.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), g = a.stylize(g, "string")) } return g + ": " + h } function n(a, b, c) { var d = 0, e = a.reduce(function (a, b) { return d++, b.indexOf("\n") >= 0 && d++, a + b.replace(/\u001b\[\d\d?m/g, "").length + 1 }, 0); return e > 60 ? c[0] + ("" === b ? "" : b + "\n ") + " " + a.join(",\n ") + " " + c[1] : c[0] + b + " " + a.join(", ") + " " + c[1] } function o(a) { return Array.isArray(a) } function p(a) { return "boolean" == typeof a } function q(a) { return null === a } function r(a) { return null == a } function s(a) { return "number" == typeof a } function t(a) { return "string" == typeof a } function u(a) { return "symbol" == typeof a } function v(a) { return void 0 === a } function w(a) { return x(a) && "[object RegExp]" === C(a) } function x(a) { return "object" == typeof a && null !== a } function y(a) { return x(a) && "[object Date]" === C(a) } function z(a) { return x(a) && ("[object Error]" === C(a) || a instanceof Error) } function A(a) { return "function" == typeof a } function B(a) { return null === a || "boolean" == typeof a || "number" == typeof a || "string" == typeof a || "symbol" == typeof a || "undefined" == typeof a } function C(a) { return Object.prototype.toString.call(a) } function D(a) { return 10 > a ? "0" + a.toString(10) : a.toString(10) } function E() { var a = new Date, b = [D(a.getHours()), D(a.getMinutes()), D(a.getSeconds())].join(":"); return [a.getDate(), J[a.getMonth()], b].join(" ") } function F(a, b) { return Object.prototype.hasOwnProperty.call(a, b) } // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var G = /%[sdj%]/g; c.format = function (a) { if (!t(a)) { for (var b = [], c = 0; c < arguments.length; c++) b.push(e(arguments[c])); return b.join(" ") } for (var c = 1, d = arguments, f = d.length, g = String(a).replace(G, function (a) { if ("%%" === a) return "%"; if (c >= f) return a; switch (a) { case "%s": return String(d[c++]); case "%d": return Number(d[c++]); case "%j": try { return JSON.stringify(d[c++]) } catch (b) { return "[Circular]" } default: return a } }), h = d[c]; f > c; h = d[++c]) g += q(h) || !x(h) ? " " + h : " " + e(h); return g }, c.deprecate = function (a, e) { function f() { if (!g) { if (b.throwDeprecation) throw new Error(e); b.traceDeprecation ? console.trace(e) : console.error(e), g = !0 } return a.apply(this, arguments) } if (v(d.process)) return function () { return c.deprecate(a, e).apply(this, arguments) }; if (b.noDeprecation === !0) return a; var g = !1; return f }; var H, I = {}; c.debuglog = function (a) { if (v(H) && (H = b.env.NODE_DEBUG || ""), a = a.toUpperCase(), !I[a]) if (new RegExp("\\b" + a + "\\b", "i").test(H)) { var d = b.pid; I[a] = function () { var b = c.format.apply(c, arguments); console.error("%s %d: %s", a, d, b) } } else I[a] = function () { }; return I[a] }, c.inspect = e, e.colors = { bold: [1, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], white: [37, 39], grey: [90, 39], black: [30, 39], blue: [34, 39], cyan: [36, 39], green: [32, 39], magenta: [35, 39], red: [31, 39], yellow: [33, 39] }, e.styles = { special: "cyan", number: "yellow", "boolean": "yellow", undefined: "grey", "null": "bold", string: "green", date: "magenta", regexp: "red" }, c.isArray = o, c.isBoolean = p, c.isNull = q, c.isNullOrUndefined = r, c.isNumber = s, c.isString = t, c.isSymbol = u, c.isUndefined = v, c.isRegExp = w, c.isObject = x, c.isDate = y, c.isError = z, c.isFunction = A, c.isPrimitive = B, c.isBuffer = a("./support/isBuffer"); var J = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; c.log = function () { console.log("%s - %s", E(), c.format.apply(c, arguments)) }, c.inherits = a("inherits"), c._extend = function (a, b) { if (!b || !x(b)) return a; for (var c = Object.keys(b), d = c.length; d--;) a[c[d]] = b[c[d]]; return a } }).call(this, a("_process"), "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) }, { "./support/isBuffer": 4, _process: 3, inherits: 2 }], 6: [function (a, b, c) { "use strict"; var d = a("./tokentype").types, e = a("./state").Parser, f = a("./identifier").reservedWords, g = a("./util").has, h = e.prototype; h.checkPropClash = function (a, b) { if (!(this.options.ecmaVersion >= 6)) { var c = a.key, d = void 0; switch (c.type) { case "Identifier": d = c.name; break; case "Literal": d = String(c.value); break; default: return } var e = a.kind || "init", f = void 0; if (g(b, d)) { f = b[d]; var h = "init" !== e; ((this.strict || h) && f[e] || !(h ^ f.init)) && this.raise(c.start, "Redefinition of property") } else f = b[d] = { init: !1, get: !1, set: !1 }; f[e] = !0 } }, h.parseExpression = function (a, b) { var c = this.start, e = this.startLoc, f = this.parseMaybeAssign(a, b); if (this.type === d.comma) { var g = this.startNodeAt(c, e); for (g.expressions = [f]; this.eat(d.comma) ;) g.expressions.push(this.parseMaybeAssign(a, b)); return this.finishNode(g, "SequenceExpression") } return f }, h.parseMaybeAssign = function (a, b, c) { if (this.type == d._yield && this.inGenerator) return this.parseYield(); var e = void 0; b ? e = !1 : (b = { start: 0 }, e = !0); var f = this.start, g = this.startLoc; (this.type == d.parenL || this.type == d.name) && (this.potentialArrowAt = this.start); var h = this.parseMaybeConditional(a, b); if (c && (h = c.call(this, h, f, g)), this.type.isAssign) { var i = this.startNodeAt(f, g); return i.operator = this.value, i.left = this.type === d.eq ? this.toAssignable(h) : h, b.start = 0, this.checkLVal(h), this.next(), i.right = this.parseMaybeAssign(a), this.finishNode(i, "AssignmentExpression") } return e && b.start && this.unexpected(b.start), h }, h.parseMaybeConditional = function (a, b) { var c = this.start, e = this.startLoc, f = this.parseExprOps(a, b); if (b && b.start) return f; if (this.eat(d.question)) { var g = this.startNodeAt(c, e); return g.test = f, g.consequent = this.parseMaybeAssign(), this.expect(d.colon), g.alternate = this.parseMaybeAssign(a), this.finishNode(g, "ConditionalExpression") } return f }, h.parseExprOps = function (a, b) { var c = this.start, d = this.startLoc, e = this.parseMaybeUnary(b); return b && b.start ? e : this.parseExprOp(e, c, d, -1, a) }, h.parseExprOp = function (a, b, c, e, f) { var g = this.type.binop; if (Array.isArray(b) && this.options.locations && void 0 === f && (f = e, e = c, c = b[1], b = b[0]), null != g && (!f || this.type !== d._in) && g > e) { var h = this.startNodeAt(b, c); h.left = a, h.operator = this.value; var i = this.type; this.next(); var j = this.start, k = this.startLoc; return h.right = this.parseExprOp(this.parseMaybeUnary(), j, k, g, f), this.finishNode(h, i === d.logicalOR || i === d.logicalAND ? "LogicalExpression" : "BinaryExpression"), this.parseExprOp(h, b, c, e, f) } return a }, h.parseMaybeUnary = function (a) { if (this.type.prefix) { var b = this.startNode(), c = this.type === d.incDec; return b.operator = this.value, b.prefix = !0, this.next(), b.argument = this.parseMaybeUnary(), a && a.start && this.unexpected(a.start), c ? this.checkLVal(b.argument) : this.strict && "delete" === b.operator && "Identifier" === b.argument.type && this.raise(b.start, "Deleting local variable in strict mode"), this.finishNode(b, c ? "UpdateExpression" : "UnaryExpression") } var e = this.start, f = this.startLoc, g = this.parseExprSubscripts(a); if (a && a.start) return g; for (; this.type.postfix && !this.canInsertSemicolon() ;) { var b = this.startNodeAt(e, f); b.operator = this.value, b.prefix = !1, b.argument = g, this.checkLVal(g), this.next(), g = this.finishNode(b, "UpdateExpression") } return g }, h.parseExprSubscripts = function (a) { var b = this.start, c = this.startLoc, d = this.parseExprAtom(a); return a && a.start ? d : this.parseSubscripts(d, b, c) }, h.parseSubscripts = function (a, b, c, e) { for (Array.isArray(b) && this.options.locations && void 0 === e && (e = c, c = b[1], b = b[0]) ; ;) if (this.eat(d.dot)) { var f = this.startNodeAt(b, c); f.object = a, f.property = this.parseIdent(!0), f.computed = !1, a = this.finishNode(f, "MemberExpression") } else if (this.eat(d.bracketL)) { var f = this.startNodeAt(b, c); f.object = a, f.property = this.parseExpression(), f.computed = !0, this.expect(d.bracketR), a = this.finishNode(f, "MemberExpression") } else if (!e && this.eat(d.parenL)) { var f = this.startNodeAt(b, c); f.callee = a, f.arguments = this.parseExprList(d.parenR, !1), a = this.finishNode(f, "CallExpression") } else { if (this.type !== d.backQuote) return a; var f = this.startNodeAt(b, c); f.tag = a, f.quasi = this.parseTemplate(), a = this.finishNode(f, "TaggedTemplateExpression") } }, h.parseExprAtom = function (a) { var b = void 0, c = this.potentialArrowAt == this.start; switch (this.type) { case d._this: case d._super: var e = this.type === d._this ? "ThisExpression" : "Super"; return b = this.startNode(), this.next(), this.finishNode(b, e); case d._yield: this.inGenerator && this.unexpected(); case d.name: var f = this.start, g = this.startLoc, h = this.parseIdent(this.type !== d.name); return c && !this.canInsertSemicolon() && this.eat(d.arrow) ? this.parseArrowExpression(this.startNodeAt(f, g), [h]) : h; case d.regexp: var i = this.value; return b = this.parseLiteral(i.value), b.regex = { pattern: i.pattern, flags: i.flags }, b; case d.num: case d.string: return this.parseLiteral(this.value); case d._null: case d._true: case d._false: return b = this.startNode(), b.value = this.type === d._null ? null : this.type === d._true, b.raw = this.type.keyword, this.next(), this.finishNode(b, "Literal"); case d.parenL: return this.parseParenAndDistinguishExpression(c); case d.bracketL: return b = this.startNode(), this.next(), this.options.ecmaVersion >= 7 && this.type === d._for ? this.parseComprehension(b, !1) : (b.elements = this.parseExprList(d.bracketR, !0, !0, a), this.finishNode(b, "ArrayExpression")); case d.braceL: return this.parseObj(!1, a); case d._function: return b = this.startNode(), this.next(), this.parseFunction(b, !1); case d._class: return this.parseClass(this.startNode(), !1); case d._new: return this.parseNew(); case d.backQuote: return this.parseTemplate(); default: this.unexpected() } }, h.parseLiteral = function (a) { var b = this.startNode(); return b.value = a, b.raw = this.input.slice(this.start, this.end), this.next(), this.finishNode(b, "Literal") }, h.parseParenExpression = function () { this.expect(d.parenL); var a = this.parseExpression(); return this.expect(d.parenR), a }, h.parseParenAndDistinguishExpression = function (a) { var b = this.start, c = this.startLoc, e = void 0; if (this.options.ecmaVersion >= 6) { if (this.next(), this.options.ecmaVersion >= 7 && this.type === d._for) return this.parseComprehension(this.startNodeAt(b, c), !0); for (var f = this.start, g = this.startLoc, h = [], i = !0, j = { start: 0 }, k = void 0, l = void 0; this.type !== d.parenR;) { if (i ? i = !1 : this.expect(d.comma), this.type === d.ellipsis) { k = this.start, h.push(this.parseParenItem(this.parseRest())); break } this.type !== d.parenL || l || (l = this.start), h.push(this.parseMaybeAssign(!1, j, this.parseParenItem)) } var m = this.start, n = this.startLoc; if (this.expect(d.parenR), a && !this.canInsertSemicolon() && this.eat(d.arrow)) return l && this.unexpected(l), this.parseParenArrowList(b, c, h); h.length || this.unexpected(this.lastTokStart), k && this.unexpected(k), j.start && this.unexpected(j.start), h.length > 1 ? (e = this.startNodeAt(f, g), e.expressions = h, this.finishNodeAt(e, "SequenceExpression", m, n)) : e = h[0] } else e = this.parseParenExpression(); if (this.options.preserveParens) { var o = this.startNodeAt(b, c); return o.expression = e, this.finishNode(o, "ParenthesizedExpression") } return e }, h.parseParenItem = function (a) { return a }, h.parseParenArrowList = function (a, b, c) { return this.parseArrowExpression(this.startNodeAt(a, b), c) }; var i = []; h.parseNew = function () { var a = this.startNode(), b = this.parseIdent(!0); if (this.options.ecmaVersion >= 6 && this.eat(d.dot)) return a.meta = b, a.property = this.parseIdent(!0), "target" !== a.property.name && this.raise(a.property.start, "The only valid meta property for new is new.target"), this.finishNode(a, "MetaProperty"); var c = this.start, e = this.startLoc; return a.callee = this.parseSubscripts(this.parseExprAtom(), c, e, !0), this.eat(d.parenL) ? a.arguments = this.parseExprList(d.parenR, !1) : a.arguments = i, this.finishNode(a, "NewExpression") }, h.parseTemplateElement = function () { var a = this.startNode(); return a.value = { raw: this.input.slice(this.start, this.end), cooked: this.value }, this.next(), a.tail = this.type === d.backQuote, this.finishNode(a, "TemplateElement") }, h.parseTemplate = function () { var a = this.startNode(); this.next(), a.expressions = []; var b = this.parseTemplateElement(); for (a.quasis = [b]; !b.tail;) this.expect(d.dollarBraceL), a.expressions.push(this.parseExpression()), this.expect(d.braceR), a.quasis.push(b = this.parseTemplateElement()); return this.next(), this.finishNode(a, "TemplateLiteral") }, h.parseObj = function (a, b) { var c = this.startNode(), e = !0, f = {}; for (c.properties = [], this.next() ; !this.eat(d.braceR) ;) { if (e) e = !1; else if (this.expect(d.comma), this.afterTrailingComma(d.braceR)) break; var g = this.startNode(), h = void 0, i = void 0, j = void 0; this.options.ecmaVersion >= 6 && (g.method = !1, g.shorthand = !1, (a || b) && (i = this.start, j = this.startLoc), a || (h = this.eat(d.star))), this.parsePropertyName(g), this.parsePropertyValue(g, a, h, i, j, b), this.checkPropClash(g, f), c.properties.push(this.finishNode(g, "Property")) } return this.finishNode(c, a ? "ObjectPattern" : "ObjectExpression") }, h.parsePropertyValue = function (a, b, c, e, g, h) { this.eat(d.colon) ? (a.value = b ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, h), a.kind = "init") : this.options.ecmaVersion >= 6 && this.type === d.parenL ? (b && this.unexpected(), a.kind = "init", a.method = !0, a.value = this.parseMethod(c)) : this.options.ecmaVersion >= 5 && !a.computed && "Identifier" === a.key.type && ("get" === a.key.name || "set" === a.key.name) && this.type != d.comma && this.type != d.braceR ? ((c || b) && this.unexpected(), a.kind = a.key.name, this.parsePropertyName(a), a.value = this.parseMethod(!1)) : this.options.ecmaVersion >= 6 && !a.computed && "Identifier" === a.key.type ? (a.kind = "init", b ? ((this.isKeyword(a.key.name) || this.strict && (f.strictBind(a.key.name) || f.strict(a.key.name)) || !this.options.allowReserved && this.isReservedWord(a.key.name)) && this.raise(a.key.start, "Binding " + a.key.name), a.value = this.parseMaybeDefault(e, g, a.key)) : this.type === d.eq && h ? (h.start || (h.start = this.start), a.value = this.parseMaybeDefault(e, g, a.key)) : a.value = a.key, a.shorthand = !0) : this.unexpected() }, h.parsePropertyName = function (a) { if (this.options.ecmaVersion >= 6) { if (this.eat(d.bracketL)) return a.computed = !0, a.key = this.parseMaybeAssign(), this.expect(d.bracketR), a.key; a.computed = !1 } return a.key = this.type === d.num || this.type === d.string ? this.parseExprAtom() : this.parseIdent(!0) }, h.initFunction = function (a) { a.id = null, this.options.ecmaVersion >= 6 && (a.generator = !1, a.expression = !1) }, h.parseMethod = function (a) { var b = this.startNode(); this.initFunction(b), this.expect(d.parenL), b.params = this.parseBindingList(d.parenR, !1, !1); var c = void 0; return this.options.ecmaVersion >= 6 ? (b.generator = a, c = !0) : c = !1, this.parseFunctionBody(b, c), this.finishNode(b, "FunctionExpression") }, h.parseArrowExpression = function (a, b) { return this.initFunction(a), a.params = this.toAssignableList(b, !0), this.parseFunctionBody(a, !0), this.finishNode(a, "ArrowFunctionExpression") }, h.parseFunctionBody = function (a, b) { var c = b && this.type !== d.braceL; if (c) a.body = this.parseMaybeAssign(), a.expression = !0; else { var e = this.inFunction, f = this.inGenerator, g = this.labels; this.inFunction = !0, this.inGenerator = a.generator, this.labels = [], a.body = this.parseBlock(!0), a.expression = !1, this.inFunction = e, this.inGenerator = f, this.labels = g } if (this.strict || !c && a.body.body.length && this.isUseStrict(a.body.body[0])) { var h = {}, i = this.strict; this.strict = !0, a.id && this.checkLVal(a.id, !0); for (var j = 0; j < a.params.length; j++) this.checkLVal(a.params[j], !0, h); this.strict = i } }, h.parseExprList = function (a, b, c, e) { for (var f = [], g = !0; !this.eat(a) ;) { if (g) g = !1; else if (this.expect(d.comma), b && this.afterTrailingComma(a)) break; c && this.type === d.comma ? f.push(null) : this.type === d.ellipsis ? f.push(this.parseSpread(e)) : f.push(this.parseMaybeAssign(!1, e)) } return f }, h.parseIdent = function (a) { var b = this.startNode(); return a && "never" == this.options.allowReserved && (a = !1), this.type === d.name ? (!a && (!this.options.allowReserved && this.isReservedWord(this.value) || this.strict && f.strict(this.value) && (this.options.ecmaVersion >= 6 || -1 == this.input.slice(this.start, this.end).indexOf("\\"))) && this.raise(this.start, "The keyword '" + this.value + "' is reserved"), b.name = this.value) : a && this.type.keyword ? b.name = this.type.keyword : this.unexpected(), this.next(), this.finishNode(b, "Identifier") }, h.parseYield = function () { var a = this.startNode(); return this.next(), this.type == d.semi || this.canInsertSemicolon() || this.type != d.star && !this.type.startsExpr ? (a.delegate = !1, a.argument = null) : (a.delegate = this.eat(d.star), a.argument = this.parseMaybeAssign()), this.finishNode(a, "YieldExpression") }, h.parseComprehension = function (a, b) { for (a.blocks = []; this.type === d._for;) { var c = this.startNode(); this.next(), this.expect(d.parenL), c.left = this.parseBindingAtom(), this.checkLVal(c.left, !0), this.expectContextual("of"), c.right = this.parseExpression(), this.expect(d.parenR), a.blocks.push(this.finishNode(c, "ComprehensionBlock")) } return a.filter = this.eat(d._if) ? this.parseParenExpression() : null, a.body = this.parseExpression(), this.expect(b ? d.parenR : d.bracketR), a.generator = b, this.finishNode(a, "ComprehensionExpression") } }, { "./identifier": 7, "./state": 13, "./tokentype": 17, "./util": 18 }], 7: [function (a, b, c) { "use strict"; function d(a) { function b(a) { if (1 == a.length) return c += "return str === " + JSON.stringify(a[0]) + ";"; c += "switch(str){"; for (var b = 0; b < a.length; ++b) c += "case " + JSON.stringify(a[b]) + ":"; c += "return true}return false;" } a = a.split(" "); var c = "", d = []; a: for (var e = 0; e < a.length; ++e) { for (var f = 0; f < d.length; ++f) if (d[f][0].length == a[e].length) { d[f].push(a[e]); continue a } d.push([a[e]]) } if (d.length > 3) { d.sort(function (a, b) { return b.length - a.length }), c += "switch(str.length){"; for (var e = 0; e < d.length; ++e) { var g = d[e]; c += "case " + g[0].length + ":", b(g) } c += "}" } else b(a); return new Function("str", c) } function e(a, b) { for (var c = 65536, d = 0; d < b.length; d += 2) { if (c += b[d], c > a) return !1; if (c += b[d + 1], c >= a) return !0 } } function f(a, b) { return 65 > a ? 36 === a : 91 > a ? !0 : 97 > a ? 95 === a : 123 > a ? !0 : 65535 >= a ? a >= 170 && m.test(String.fromCharCode(a)) : b === !1 ? !1 : e(a, o) } function g(a, b) { return 48 > a ? 36 === a : 58 > a ? !0 : 65 > a ? !1 : 91 > a ? !0 : 97 > a ? 95 === a : 123 > a ? !0 : 65535 >= a ? a >= 170 && n.test(String.fromCharCode(a)) : b === !1 ? !1 : e(a, o) || e(a, p) } c.isIdentifierStart = f, c.isIdentifierChar = g, c.__esModule = !0; var h = { 3: d("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"), 5: d("class enum extends super const export import"), 6: d("enum await"), strict: d("implements interface let package private protected public static yield"), strictBind: d("eval arguments") }; c.reservedWords = h; var i = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this", j = { 5: d(i), 6: d(i + " let const class extends export import yield super") }; c.keywords = j; var k = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", l = "‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_", m = new RegExp("[" + k + "]"), n = new RegExp("[" + k + l + "]"); k = l = null; var o = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 17, 26, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 99, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 98, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 955, 52, 76, 44, 33, 24, 27, 35, 42, 34, 4, 0, 13, 47, 15, 3, 22, 0, 38, 17, 2, 24, 133, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 32, 4, 287, 47, 21, 1, 2, 0, 185, 46, 82, 47, 21, 0, 60, 42, 502, 63, 32, 0, 449, 56, 1288, 920, 104, 110, 2962, 1070, 13266, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 881, 68, 12, 0, 67, 12, 16481, 1, 3071, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 4149, 196, 1340, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42710, 42, 4148, 12, 221, 16355, 541], p = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 16, 9, 83, 11, 168, 11, 6, 9, 8, 2, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 316, 19, 13, 9, 214, 6, 3, 8, 112, 16, 16, 9, 82, 12, 9, 9, 535, 9, 20855, 9, 135, 4, 60, 6, 26, 9, 1016, 45, 17, 3, 19723, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 4305, 6, 792618, 239] }, {}], 8: [function (a, b, c) { "use strict"; function d(a, b) { for (var c = 1, d = 0; ;) { g.lastIndex = d; var e = g.exec(a); if (!(e && e.index < b)) return new h(c, b - d); ++c, d = e.index + e[0].length } } var e = function (a, b) { if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function") }; c.getLineInfo = d, c.__esModule = !0; var f = a("./state").Parser, g = a("./whitespace").lineBreakG, h = (a("util").deprecate, c.Position = function () { function a(b, c) { e(this, a), this.line = b, this.column = c } return a.prototype.offset = function (b) { return new a(this.line, this.column + b) }, a }()), i = (c.SourceLocation = function j(a, b, c) { e(this, j), this.start = b, this.end = c, null !== a.sourceFile && (this.source = a.sourceFile) }, f.prototype); i.raise = function (a, b) { var c = d(this.input, a); b += " (" + c.line + ":" + c.column + ")"; var e = new SyntaxError(b); throw e.pos = a, e.loc = c, e.raisedAt = this.pos, e }, i.curPosition = function () { return new h(this.curLine, this.pos - this.lineStart) }, i.markPosition = function () { return this.options.locations ? [this.start, this.startLoc] : this.start } }, { "./state": 13, "./whitespace": 19, util: 5 }], 9: [function (a, b, c) { "use strict"; var d = a("./tokentype").types, e = a("./state").Parser, f = a("./identifier").reservedWords, g = a("./util").has, h = e.prototype; h.toAssignable = function (a, b) { if (this.options.ecmaVersion >= 6 && a) switch (a.type) { case "Identifier": case "ObjectPattern": case "ArrayPattern": case "AssignmentPattern": break; case "ObjectExpression": a.type = "ObjectPattern"; for (var c = 0; c < a.properties.length; c++) { var d = a.properties[c]; "init" !== d.kind && this.raise(d.key.start, "Object pattern can't contain getter or setter"), this.toAssignable(d.value, b) } break; case "ArrayExpression": a.type = "ArrayPattern", this.toAssignableList(a.elements, b); break; case "AssignmentExpression": "=" === a.operator ? a.type = "AssignmentPattern" : this.raise(a.left.end, "Only '=' operator can be used for specifying default value."); break; case "ParenthesizedExpression": a.expression = this.toAssignable(a.expression, b); break; case "MemberExpression": if (!b) break; default: this.raise(a.start, "Assigning to rvalue") } return a }, h.toAssignableList = function (a, b) { var c = a.length; if (c) { var d = a[c - 1]; if (d && "RestElement" == d.type)--c; else if (d && "SpreadElement" == d.type) { d.type = "RestElement"; var e = d.argument; this.toAssignable(e, b), "Identifier" !== e.type && "MemberExpression" !== e.type && "ArrayPattern" !== e.type && this.unexpected(e.start), --c } } for (var f = 0; c > f; f++) { var g = a[f]; g && this.toAssignable(g, b) } return a }, h.parseSpread = function (a) { var b = this.startNode(); return this.next(), b.argument = this.parseMaybeAssign(a), this.finishNode(b, "SpreadElement") }, h.parseRest = function () { var a = this.startNode(); return this.next(), a.argument = this.type === d.name || this.type === d.bracketL ? this.parseBindingAtom() : this.unexpected(), this.finishNode(a, "RestElement") }, h.parseBindingAtom = function () { if (this.options.ecmaVersion < 6) return this.parseIdent(); switch (this.type) { case d.name: return this.parseIdent(); case d.bracketL: var a = this.startNode(); return this.next(), a.elements = this.parseBindingList(d.bracketR, !0, !0), this.finishNode(a, "ArrayPattern"); case d.braceL: return this.parseObj(!0); default: this.unexpected() } }, h.parseBindingList = function (a, b, c) { for (var e = [], f = !0; !this.eat(a) ;) if (f ? f = !1 : this.expect(d.comma), b && this.type === d.comma) e.push(null); else { if (c && this.afterTrailingComma(a)) break; if (this.type === d.ellipsis) { var g = this.parseRest(); this.parseBindingListItem(g), e.push(g), this.expect(a); break } var h = this.parseMaybeDefault(this.start, this.startLoc); this.parseBindingListItem(h), e.push(h) } return e }, h.parseBindingListItem = function (a) { return a }, h.parseMaybeDefault = function (a, b, c) { if (Array.isArray(a) && this.options.locations && void 0 === noCalls && (c = b, b = a[1], a = a[0]), c = c || this.parseBindingAtom(), !this.eat(d.eq)) return c; var e = this.startNodeAt(a, b); return e.operator = "=", e.left = c, e.right = this.parseMaybeAssign(), this.finishNode(e, "AssignmentPattern") }, h.checkLVal = function (a, b, c) { switch (a.type) { case "Identifier": this.strict && (f.strictBind(a.name) || f.strict(a.name)) && this.raise(a.start, (b ? "Binding " : "Assigning to ") + a.name + " in strict mode"), c && (g(c, a.name) && this.raise(a.start, "Argument name clash in strict mode"), c[a.name] = !0); break; case "MemberExpression": b && this.raise(a.start, (b ? "Binding" : "Assigning to") + " member expression"); break; case "ObjectPattern": for (var d = 0; d < a.properties.length; d++) this.checkLVal(a.properties[d].value, b, c); break; case "ArrayPattern": for (var d = 0; d < a.elements.length; d++) { var e = a.elements[d]; e && this.checkLVal(e, b, c) } break; case "AssignmentPattern": this.checkLVal(a.left, b, c); break; case "RestElement": this.checkLVal(a.argument, b, c); break; case "ParenthesizedExpression": this.checkLVal(a.expression, b, c); break; default: this.raise(a.start, (b ? "Binding" : "Assigning to") + " rvalue") } } }, { "./identifier": 7, "./state": 13, "./tokentype": 17, "./util": 18 }], 10: [function (a, b, c) { "use strict"; var d = function (a, b) { if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function") }; c.__esModule = !0; var e = a("./state").Parser, f = a("./location").SourceLocation, g = e.prototype, h = c.Node = function i() { d(this, i) }; g.startNode = function () { var a = new h; return a.start = this.start, this.options.locations && (a.loc = new f(this, this.startLoc)), this.options.directSourceFile && (a.sourceFile = this.options.directSourceFile), this.options.ranges && (a.range = [this.start, 0]), a }, g.startNodeAt = function (a, b) { var c = new h; return Array.isArray(a) && this.options.locations && void 0 === b && (b = a[1], a = a[0]), c.start = a, this.options.locations && (c.loc = new f(this, b)), this.options.directSourceFile && (c.sourceFile = this.options.directSourceFile), this.options.ranges && (c.range = [a, 0]), c }, g.finishNode = function (a, b) { return a.type = b, a.end = this.lastTokEnd, this.options.locations && (a.loc.end = this.lastTokEndLoc), this.options.ranges && (a.range[1] = this.lastTokEnd), a }, g.finishNodeAt = function (a, b, c, d) { return a.type = b, Array.isArray(c) && this.options.locations && void 0 === d && (d = c[1], c = c[0]), a.end = c, this.options.locations && (a.loc.end = d), this.options.ranges && (a.range[1] = c), a } }, { "./location": 8, "./state": 13 }], 11: [function (a, b, c) { "use strict"; function d(a) { var b = {}; for (var c in j) b[c] = a && g(a, c) ? a[c] : j[c]; return h(b.onToken) && !function () { var a = b.onToken; b.onToken = function (b) { return a.push(b) } }(), h(b.onComment) && (b.onComment = e(b, b.onComment)), b } function e(a, b) { return function (c, d, e, f, g, h) { var j = { type: c ? "Block" : "Line", value: d, start: e, end: f }; a.locations && (j.loc = new i(this, g, h)), a.ranges && (j.range = [e, f]), b.push(j) } } c.getOptions = d, c.__esModule = !0; var f = a("./util"), g = f.has, h = f.isArray, i = a("./location").SourceLocation, j = { ecmaVersion: 5, sourceType: "script", onInsertedSemicolon: null, onTrailingComma: null, allowReserved: !0, allowReturnOutsideFunction: !1, allowImportExportEverywhere: !1, allowHashBang: !1, locations: !1, onToken: null, onComment: null, ranges: !1, program: null, sourceFile: null, directSourceFile: null, preserveParens: !1, plugins: {} }; c.defaultOptions = j }, { "./location": 8, "./util": 18 }], 12: [function (a, b, c) { "use strict"; var d = a("./tokentype").types, e = a("./state").Parser, f = a("./whitespace").lineBreak, g = e.prototype; g.isUseStrict = function (a) { return this.options.ecmaVersion >= 5 && "ExpressionStatement" === a.type && "Literal" === a.expression.type && "use strict" === a.expression.value }, g.eat = function (a) { return this.type === a ? (this.next(), !0) : !1 }, g.isContextual = function (a) { return this.type === d.name && this.value === a }, g.eatContextual = function (a) { return this.value === a && this.eat(d.name) }, g.expectContextual = function (a) { this.eatContextual(a) || this.unexpected() }, g.canInsertSemicolon = function () { return this.type === d.eof || this.type === d.braceR || f.test(this.input.slice(this.lastTokEnd, this.start)) }, g.insertSemicolon = function () { return this.canInsertSemicolon() ? (this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0) : void 0 }, g.semicolon = function () { this.eat(d.semi) || this.insertSemicolon() || this.unexpected() }, g.afterTrailingComma = function (a) { return this.type == a ? (this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), this.next(), !0) : void 0 }, g.expect = function (a) { this.eat(a) || this.unexpected() }, g.unexpected = function (a) { this.raise(null != a ? a : this.start, "Unexpected token") } }, { "./state": 13, "./tokentype": 17, "./whitespace": 19 }], 13: [function (a, b, c) { "use strict"; function d(a, b, c) { this.options = a, this.sourceFile = this.options.sourceFile || null, this.isKeyword = g[this.options.ecmaVersion >= 6 ? 6 : 5], this.isReservedWord = f[this.options.ecmaVersion], this.input = b, this.loadPlugins(this.options.plugins), c ? (this.pos = c, this.lineStart = Math.max(0, this.input.lastIndexOf("\n", c)), this.curLine = this.input.slice(0, this.lineStart).split(i).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = h.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = null, this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.strict = this.inModule = "module" === this.options.sourceType, this.potentialArrowAt = -1, this.inFunction = this.inGenerator = !1, this.labels = [], 0 === this.pos && this.options.allowHashBang && "#!" === this.input.slice(0, 2) && this.skipLineComment(2) } c.Parser = d, c.__esModule = !0; var e = a("./identifier"), f = e.reservedWords, g = e.keywords, h = a("./tokentype").types, i = a("./whitespace").lineBreak; d.prototype.extend = function (a, b) { this[a] = b(this[a]) }; var j = {}; c.plugins = j, d.prototype.loadPlugins = function (a) { for (var b in a) { var d = c.plugins[b]; if (!d) throw new Error("Plugin '" + b + "' not found"); d(this, a[b]) } } }, { "./identifier": 7, "./tokentype": 17, "./whitespace": 19 }], 14: [function (a, b, c) { "use strict"; var d = a("./tokentype").types, e = a("./state").Parser, f = a("./whitespace").lineBreak, g = e.prototype; g.parseTopLevel = function (a) { var b = !0; for (a.body || (a.body = []) ; this.type !== d.eof;) { var c = this.parseStatement(!0, !0); a.body.push(c), b && this.isUseStrict(c) && this.setStrict(!0), b = !1 } return this.next(), this.options.ecmaVersion >= 6 && (a.sourceType = this.options.sourceType), this.finishNode(a, "Program") }; var h = { kind: "loop" }, i = { kind: "switch" }; g.parseStatement = function (a, b) { var c = this.type, e = this.startNode(); switch (c) { case d._break: case d._continue: return this.parseBreakContinueStatement(e, c.keyword); case d._debugger: return this.parseDebuggerStatement(e); case d._do: return this.parseDoStatement(e); case d._for: return this.parseForStatement(e); case d._function: return !a && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(e); case d._class: return a || this.unexpected(), this.parseClass(e, !0); case d._if: return this.parseIfStatement(e); case d._return: return this.parseReturnStatement(e); case d._switch: return this.parseSwitchStatement(e); case d._throw: return this.parseThrowStatement(e); case d._try: return this.parseTryStatement(e); case d._let: case d._const: a || this.unexpected(); case d._var: return this.parseVarStatement(e, c); case d._while: return this.parseWhileStatement(e); case d._with: return this.parseWithStatement(e); case d.braceL: return this.parseBlock(); case d.semi: return this.parseEmptyStatement(e); case d._export: case d._import: return this.options.allowImportExportEverywhere || (b || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), c === d._import ? this.parseImport(e) : this.parseExport(e); default: var f = this.value, g = this.parseExpression(); return c === d.name && "Identifier" === g.type && this.eat(d.colon) ? this.parseLabeledStatement(e, f, g) : this.parseExpressionStatement(e, g) } }, g.parseBreakContinueStatement = function (a, b) { var c = "break" == b; this.next(), this.eat(d.semi) || this.insertSemicolon() ? a.label = null : this.type !== d.name ? this.unexpected() : (a.label = this.parseIdent(), this.semicolon()); for (var e = 0; e < this.labels.length; ++e) { var f = this.labels[e]; if (null == a.label || f.name === a.label.name) { if (null != f.kind && (c || "loop" === f.kind)) break; if (a.label && c) break } } return e === this.labels.length && this.raise(a.start, "Unsyntactic " + b), this.finishNode(a, c ? "BreakStatement" : "ContinueStatement") }, g.parseDebuggerStatement = function (a) { return this.next(), this.semicolon(), this.finishNode(a, "DebuggerStatement") }, g.parseDoStatement = function (a) { return this.next(), this.labels.push(h), a.body = this.parseStatement(!1), this.labels.pop(), this.expect(d._while), a.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(d.semi) : this.semicolon(), this.finishNode(a, "DoWhileStatement") }, g.parseForStatement = function (a) { if (this.next(), this.labels.push(h), this.expect(d.parenL), this.type === d.semi) return this.parseFor(a, null); if (this.type === d._var || this.type === d._let || this.type === d._const) { var b = this.startNode(), c = this.type; return this.next(), this.parseVar(b, !0, c), this.finishNode(b, "VariableDeclaration"), !(this.type === d._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) || 1 !== b.declarations.length || c !== d._var && b.declarations[0].init ? this.parseFor(a, b) : this.parseForIn(a, b) } var e = { start: 0 }, f = this.parseExpression(!0, e); return this.type === d._in || this.options.ecmaVersion >= 6 && this.isContextual("of") ? (this.toAssignable(f), this.checkLVal(f), this.parseForIn(a, f)) : (e.start && this.unexpected(e.start), this.parseFor(a, f)) }, g.parseFunctionStatement = function (a) { return this.next(), this.parseFunction(a, !0) }, g.parseIfStatement = function (a) { return this.next(), a.test = this.parseParenExpression(), a.consequent = this.parseStatement(!1), a.alternate = this.eat(d._else) ? this.parseStatement(!1) : null, this.finishNode(a, "IfStatement") }, g.parseReturnStatement = function (a) { return this.inFunction || this.options.allowReturnOutsideFunction || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(d.semi) || this.insertSemicolon() ? a.argument = null : (a.argument = this.parseExpression(), this.semicolon()), this.finishNode(a, "ReturnStatement") }, g.parseSwitchStatement = function (a) { this.next(), a.discriminant = this.parseParenExpression(), a.cases = [], this.expect(d.braceL), this.labels.push(i); for (var b, c; this.type != d.braceR;) if (this.type === d._case || this.type === d._default) { var e = this.type === d._case; b && this.finishNode(b, "SwitchCase"), a.cases.push(b = this.startNode()), b.consequent = [], this.next(), e ? b.test = this.parseExpression() : (c && this.raise(this.lastTokStart, "Multiple default clauses"), c = !0, b.test = null), this.expect(d.colon) } else b || this.unexpected(), b.consequent.push(this.parseStatement(!0)); return b && this.finishNode(b, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(a, "SwitchStatement") }, g.parseThrowStatement = function (a) { return this.next(), f.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), a.argument = this.parseExpression(), this.semicolon(), this.finishNode(a, "ThrowStatement") }; var j = []; g.parseTryStatement = function (a) { if (this.next(), a.block = this.parseBlock(), a.handler = null, this.type === d._catch) { var b = this.startNode(); this.next(), this.expect(d.parenL), b.param = this.parseBindingAtom(), this.checkLVal(b.param, !0), this.expect(d.parenR), b.guard = null, b.body = this.parseBlock(), a.handler = this.finishNode(b, "CatchClause") } return a.guardedHandlers = j, a.finalizer = this.eat(d._finally) ? this.parseBlock() : null, a.handler || a.finalizer || this.raise(a.start, "Missing catch or finally clause"), this.finishNode(a, "TryStatement") }, g.parseVarStatement = function (a, b) { return this.next(), this.parseVar(a, !1, b), this.semicolon(), this.finishNode(a, "VariableDeclaration") }, g.parseWhileStatement = function (a) { return this.next(), a.test = this.parseParenExpression(), this.labels.push(h), a.body = this.parseStatement(!1), this.labels.pop(), this.finishNode(a, "WhileStatement") }, g.parseWithStatement = function (a) { return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), a.object = this.parseParenExpression(), a.body = this.parseStatement(!1), this.finishNode(a, "WithStatement") }, g.parseEmptyStatement = function (a) { return this.next(), this.finishNode(a, "EmptyStatement") }, g.parseLabeledStatement = function (a, b, c) { for (var e = 0; e < this.labels.length; ++e) this.labels[e].name === b && this.raise(c.start, "Label '" + b + "' is already declared"); var f = this.type.isLoop ? "loop" : this.type === d._switch ? "switch" : null; return this.labels.push({ name: b, kind: f }), a.body = this.parseStatement(!0), this.labels.pop(), a.label = c, this.finishNode(a, "LabeledStatement") }, g.parseExpressionStatement = function (a, b) { return a.expression = b, this.semicolon(), this.finishNode(a, "ExpressionStatement") }, g.parseBlock = function (a) { var b = this.startNode(), c = !0, e = void 0; for (b.body = [], this.expect(d.braceL) ; !this.eat(d.braceR) ;) { var f = this.parseStatement(!0); b.body.push(f), c && a && this.isUseStrict(f) && (e = this.strict, this.setStrict(this.strict = !0)), c = !1 } return e === !1 && this.setStrict(!1), this.finishNode(b, "BlockStatement") }, g.parseFor = function (a, b) { return a.init = b, this.expect(d.semi), a.test = this.type === d.semi ? null : this.parseExpression(), this.expect(d.semi), a.update = this.type === d.parenR ? null : this.parseExpression(), this.expect(d.parenR), a.body = this.parseStatement(!1), this.labels.pop(), this.finishNode(a, "ForStatement") }, g.parseForIn = function (a, b) { var c = this.type === d._in ? "ForInStatement" : "ForOfStatement"; return this.next(), a.left = b, a.right = this.parseExpression(), this.expect(d.parenR), a.body = this.parseStatement(!1), this.labels.pop(), this.finishNode(a, c) }, g.parseVar = function (a, b, c) { for (a.declarations = [], a.kind = c.keyword; ;) { var e = this.startNode(); if (this.parseVarId(e), this.eat(d.eq) ? e.init = this.parseMaybeAssign(b) : c !== d._const || this.type === d._in || this.options.ecmaVersion >= 6 && this.isContextual("of") ? "Identifier" == e.id.type || b && (this.type === d._in || this.isContextual("of")) ? e.init = null : this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : this.unexpected(), a.declarations.push(this.finishNode(e, "VariableDeclarator")), !this.eat(d.comma)) break } return a }, g.parseVarId = function (a) { a.id = this.parseBindingAtom(), this.checkLVal(a.id, !0) }, g.parseFunction = function (a, b, c) { return this.initFunction(a), this.options.ecmaVersion >= 6 && (a.generator = this.eat(d.star)), (b || this.type === d.name) && (a.id = this.parseIdent()), this.parseFunctionParams(a), this.parseFunctionBody(a, c), this.finishNode(a, b ? "FunctionDeclaration" : "FunctionExpression") }, g.parseFunctionParams = function (a) { this.expect(d.parenL), a.params = this.parseBindingList(d.parenR, !1, !1) }, g.parseClass = function (a, b) { this.next(), this.parseClassId(a, b), this.parseClassSuper(a); var c = this.startNode(), e = !1; for (c.body = [], this.expect(d.braceL) ; !this.eat(d.braceR) ;) if (!this.eat(d.semi)) { var f = this.startNode(), g = this.eat(d.star), h = this.type === d.name && "static" === this.value; if (this.parsePropertyName(f), f["static"] = h && this.type !== d.parenL, f["static"] && (g && this.unexpected(), g = this.eat(d.star), this.parsePropertyName(f)), f.kind = "method", !f.computed) { var i = f.key, j = !1; g || "Identifier" !== i.type || this.type === d.parenL || "get" !== i.name && "set" !== i.name || (j = !0, f.kind = i.name, i = this.parsePropertyName(f)), !f["static"] && ("Identifier" === i.type && "constructor" === i.name || "Literal" === i.type && "constructor" === i.value) && (e && this.raise(i.start, "Duplicate constructor in the same class"), j && this.raise(i.start, "Constructor can't have get/set modifier"), g && this.raise(i.start, "Constructor can't be a generator"), f.kind = "constructor", e = !0) } this.parseClassMethod(c, f, g) } return a.body = this.finishNode(c, "ClassBody"), this.finishNode(a, b ? "ClassDeclaration" : "ClassExpression") }, g.parseClassMethod = function (a, b, c) { b.value = this.parseMethod(c), a.body.push(this.finishNode(b, "MethodDefinition")) }, g.parseClassId = function (a, b) { a.id = this.type === d.name ? this.parseIdent() : b ? this.unexpected() : null }, g.parseClassSuper = function (a) { a.superClass = this.eat(d._extends) ? this.parseExprSubscripts() : null }, g.parseExport = function (a) { if (this.next(), this.eat(d.star)) return this.expectContextual("from"), a.source = this.type === d.string ? this.parseExprAtom() : this.unexpected(), this.semicolon(), this.finishNode(a, "ExportAllDeclaration"); if (this.eat(d._default)) { var b = this.parseMaybeAssign(), c = !0; return ("FunctionExpression" == b.type || "ClassExpression" == b.type) && (c = !1, b.id && (b.type = "FunctionExpression" == b.type ? "FunctionDeclaration" : "ClassDeclaration")), a.declaration = b, c && this.semicolon(), this.finishNode(a, "ExportDefaultDeclaration") } return this.shouldParseExportStatement() ? (a.declaration = this.parseStatement(!0), a.specifiers = [], a.source = null) : (a.declaration = null, a.specifiers = this.parseExportSpecifiers(), this.eatContextual("from") ? a.source = this.type === d.string ? this.parseExprAtom() : this.unexpected() : a.source = null, this.semicolon()), this.finishNode(a, "ExportNamedDeclaration") }, g.shouldParseExportStatement = function () { return this.type.keyword }, g.parseExportSpecifiers = function () { var a = [], b = !0; for (this.expect(d.braceL) ; !this.eat(d.braceR) ;) { if (b) b = !1; else if (this.expect(d.comma), this.afterTrailingComma(d.braceR)) break; var c = this.startNode(); c.local = this.parseIdent(this.type === d._default), c.exported = this.eatContextual("as") ? this.parseIdent(!0) : c.local, a.push(this.finishNode(c, "ExportSpecifier")) } return a }, g.parseImport = function (a) { return this.next(), this.type === d.string ? (a.specifiers = j, a.source = this.parseExprAtom(), a.kind = "") : (a.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), a.source = this.type === d.string ? this.parseExprAtom() : this.unexpected()), this.semicolon(), this.finishNode(a, "ImportDeclaration") }, g.parseImportSpecifiers = function () { var a = [], b = !0; if (this.type === d.name) { var c = this.startNode(); if (c.local = this.parseIdent(), this.checkLVal(c.local, !0), a.push(this.finishNode(c, "ImportDefaultSpecifier")), !this.eat(d.comma)) return a } if (this.type === d.star) { var c = this.startNode(); return this.next(), this.expectContextual("as"), c.local = this.parseIdent(), this.checkLVal(c.local, !0), a.push(this.finishNode(c, "ImportNamespaceSpecifier")), a } for (this.expect(d.braceL) ; !this.eat(d.braceR) ;) { if (b) b = !1; else if (this.expect(d.comma), this.afterTrailingComma(d.braceR)) break; var c = this.startNode(); c.imported = this.parseIdent(!0), c.local = this.eatContextual("as") ? this.parseIdent() : c.imported, this.checkLVal(c.local, !0), a.push(this.finishNode(c, "ImportSpecifier")) } return a } }, { "./state": 13, "./tokentype": 17, "./whitespace": 19 }], 15: [function (a, b, c) { "use strict"; var d = function (a, b) { if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function") }; c.__esModule = !0; var e = a("./state").Parser, f = a("./tokentype").types, g = a("./whitespace").lineBreak, h = c.TokContext = function k(a, b, c, e) { d(this, k), this.token = a, this.isExpr = b, this.preserveSpace = c, this.override = e }, i = { b_stat: new h("{", !1), b_expr: new h("{", !0), b_tmpl: new h("${", !0), p_stat: new h("(", !1), p_expr: new h("(", !0), q_tmpl: new h("`", !0, !0, function (a) { return a.readTmplToken() }), f_expr: new h("function", !0) }; c.types = i; var j = e.prototype; j.initialContext = function () { return [i.b_stat] }, j.braceIsBlock = function (a) { var b = void 0; return a === f.colon && "{" == (b = this.curContext()).token ? !b.isExpr : a === f._return ? g.test(this.input.slice(this.lastTokEnd, this.start)) : a === f._else || a === f.semi || a === f.eof ? !0 : a == f.braceL ? this.curContext() === i.b_stat : !this.exprAllowed }, j.updateContext = function (a) { var b = void 0, c = this.type; c.keyword && a == f.dot ? this.exprAllowed = !1 : (b = c.updateContext) ? b.call(this, a) : this.exprAllowed = c.beforeExpr }, f.parenR.updateContext = f.braceR.updateContext = function () { if (1 == this.context.length) return void (this.exprAllowed = !0); var a = this.context.pop(); a === i.b_stat && this.curContext() === i.f_expr ? (this.context.pop(), this.exprAllowed = !1) : a === i.b_tmpl ? this.exprAllowed = !0 : this.exprAllowed = !a.isExpr }, f.braceL.updateContext = function (a) { this.context.push(this.braceIsBlock(a) ? i.b_stat : i.b_expr), this.exprAllowed = !0 }, f.dollarBraceL.updateContext = function () { this.context.push(i.b_tmpl), this.exprAllowed = !0 }, f.parenL.updateContext = function (a) { var b = a === f._if || a === f._for || a === f._with || a === f._while; this.context.push(b ? i.p_stat : i.p_expr), this.exprAllowed = !0 }, f.incDec.updateContext = function () { }, f._function.updateContext = function () { this.curContext() !== i.b_stat && this.context.push(i.f_expr), this.exprAllowed = !1 }, f.backQuote.updateContext = function () { this.curContext() === i.q_tmpl ? this.context.pop() : this.context.push(i.q_tmpl), this.exprAllowed = !1 } }, { "./state": 13, "./tokentype": 17, "./whitespace": 19 }], 16: [function (a, b, c) { "use strict"; function d(a) { return 65535 >= a ? String.fromCharCode(a) : String.fromCharCode((a - 65536 >> 10) + 55296, (a - 65536 & 1023) + 56320) } var e = function (a, b) { if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function") }; c.__esModule = !0; var f = a("./identifier"), g = f.isIdentifierStart, h = f.isIdentifierChar, i = a("./tokentype"), j = i.types, k = i.keywords, l = a("./state").Parser, m = a("./location").SourceLocation, n = a("./whitespace"), o = n.lineBreak, p = n.lineBreakG, q = n.isNewLine, r = n.nonASCIIwhitespace, s = c.Token = function y(a) { e(this, y), this.type = a.type, this.value = a.value, this.start = a.start, this.end = a.end, a.options.locations && (this.loc = new m(a, a.startLoc, a.endLoc)), a.options.ranges && (this.range = [a.start, a.end]) }, t = l.prototype, u = "undefined" != typeof Packages; t.next = function () { this.options.onToken && this.options.onToken(new s(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken() }, t.getToken = function () { return this.next(), new s(this) }, "undefined" != typeof Symbol && (t[Symbol.iterator] = function () { var a = this; return { next: function () { var b = a.getToken(); return { done: b.type === j.eof, value: b } } } }), t.setStrict = function (a) { if (this.strict = a, this.type === j.num || this.type === j.string) { if (this.pos = this.start, this.options.locations) for (; this.pos < this.lineStart;) this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1, --this.curLine; this.nextToken() } }, t.curContext = function () { return this.context[this.context.length - 1] }, t.nextToken = function () { var a = this.curContext(); return a && a.preserveSpace || this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length ? this.finishToken(j.eof) : a.override ? a.override(this) : void this.readToken(this.fullCharCodeAtPos()) }, t.readToken = function (a) { return g(a, this.options.ecmaVersion >= 6) || 92 === a ? this.readWord() : this.getTokenFromCode(a) }, t.fullCharCodeAtPos = function () { var a = this.input.charCodeAt(this.pos); if (55295 >= a || a >= 57344) return a; var b = this.input.charCodeAt(this.pos + 1); return (a << 10) + b - 56613888 }, t.skipBlockComment = function () { var a = this.options.onComment && this.options.locations && this.curPosition(), b = this.pos, c = this.input.indexOf("*/", this.pos += 2); if (-1 === c && this.raise(this.pos - 2, "Unterminated comment"), this.pos = c + 2, this.options.locations) { p.lastIndex = b; for (var d = void 0; (d = p.exec(this.input)) && d.index < this.pos;)++this.curLine, this.lineStart = d.index + d[0].length } this.options.onComment && this.options.onComment(!0, this.input.slice(b + 2, c), b, this.pos, a, this.options.locations && this.curPosition()) }, t.skipLineComment = function (a) { for (var b = this.pos, c = this.options.onComment && this.options.locations && this.curPosition(), d = this.input.charCodeAt(this.pos += a) ; this.pos < this.input.length && 10 !== d && 13 !== d && 8232 !== d && 8233 !== d;)++this.pos, d = this.input.charCodeAt(this.pos); this.options.onComment && this.options.onComment(!1, this.input.slice(b + a, this.pos), b, this.pos, c, this.options.locations && this.curPosition()) }, t.skipSpace = function () { for (; this.pos < this.input.length;) { var a = this.input.charCodeAt(this.pos); if (32 === a)++this.pos; else if (13 === a) { ++this.pos; var b = this.input.charCodeAt(this.pos); 10 === b && ++this.pos, this.options.locations && (++this.curLine, this.lineStart = this.pos) } else if (10 === a || 8232 === a || 8233 === a)++this.pos, this.options.locations && (++this.curLine, this.lineStart = this.pos); else if (a > 8 && 14 > a)++this.pos; else if (47 === a) { var b = this.input.charCodeAt(this.pos + 1); if (42 === b) this.skipBlockComment(); else { if (47 !== b) break; this.skipLineComment(2) } } else if (160 === a)++this.pos; else { if (!(a >= 5760 && r.test(String.fromCharCode(a)))) break; ++this.pos } } }, t.finishToken = function (a, b) { this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition()); var c = this.type; this.type = a, this.value = b, this.updateContext(c) }, t.readToken_dot = function () { var a = this.input.charCodeAt(this.pos + 1); if (a >= 48 && 57 >= a) return this.readNumber(!0); var b = this.input.charCodeAt(this.pos + 2); return this.options.ecmaVersion >= 6 && 46 === a && 46 === b ? (this.pos += 3, this.finishToken(j.ellipsis)) : (++this.pos, this.finishToken(j.dot)) }, t.readToken_slash = function () { var a = this.input.charCodeAt(this.pos + 1); return this.exprAllowed ? (++this.pos, this.readRegexp()) : 61 === a ? this.finishOp(j.assign, 2) : this.finishOp(j.slash, 1) }, t.readToken_mult_modulo = function (a) { var b = this.input.charCodeAt(this.pos + 1); return 61 === b ? this.finishOp(j.assign, 2) : this.finishOp(42 === a ? j.star : j.modulo, 1) }, t.readToken_pipe_amp = function (a) { var b = this.input.charCodeAt(this.pos + 1); return b === a ? this.finishOp(124 === a ? j.logicalOR : j.logicalAND, 2) : 61 === b ? this.finishOp(j.assign, 2) : this.finishOp(124 === a ? j.bitwiseOR : j.bitwiseAND, 1) }, t.readToken_caret = function () { var a = this.input.charCodeAt(this.pos + 1); return 61 === a ? this.finishOp(j.assign, 2) : this.finishOp(j.bitwiseXOR, 1) }, t.readToken_plus_min = function (a) { var b = this.input.charCodeAt(this.pos + 1); return b === a ? 45 == b && 62 == this.input.charCodeAt(this.pos + 2) && o.test(this.input.slice(this.lastTokEnd, this.pos)) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(j.incDec, 2) : 61 === b ? this.finishOp(j.assign, 2) : this.finishOp(j.plusMin, 1) }, t.readToken_lt_gt = function (a) { var b = this.input.charCodeAt(this.pos + 1), c = 1; return b === a ? (c = 62 === a && 62 === this.input.charCodeAt(this.pos + 2) ? 3 : 2, 61 === this.input.charCodeAt(this.pos + c) ? this.finishOp(j.assign, c + 1) : this.finishOp(j.bitShift, c)) : 33 == b && 60 == a && 45 == this.input.charCodeAt(this.pos + 2) && 45 == this.input.charCodeAt(this.pos + 3) ? (this.inModule && this.unexpected(), this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (61 === b && (c = 61 === this.input.charCodeAt(this.pos + 2) ? 3 : 2), this.finishOp(j.relational, c)) }, t.readToken_eq_excl = function (a) { var b = this.input.charCodeAt(this.pos + 1); return 61 === b ? this.finishOp(j.equality, 61 === this.input.charCodeAt(this.pos + 2) ? 3 : 2) : 61 === a && 62 === b && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(j.arrow)) : this.finishOp(61 === a ? j.eq : j.prefix, 1) }, t.getTokenFromCode = function (a) { switch (a) { case 46: return this.readToken_dot(); case 40: return ++this.pos, this.finishToken(j.parenL); case 41: return ++this.pos, this.finishToken(j.parenR); case 59: return ++this.pos, this.finishToken(j.semi); case 44: return ++this.pos, this.finishToken(j.comma); case 91: return ++this.pos, this.finishToken(j.bracketL); case 93: return ++this.pos, this.finishToken(j.bracketR); case 123: return ++this.pos, this.finishToken(j.braceL); case 125: return ++this.pos, this.finishToken(j.braceR); case 58: return ++this.pos, this.finishToken(j.colon); case 63: return ++this.pos, this.finishToken(j.question); case 96: if (this.options.ecmaVersion < 6) break; return ++this.pos, this.finishToken(j.backQuote); case 48: var b = this.input.charCodeAt(this.pos + 1); if (120 === b || 88 === b) return this.readRadixNumber(16); if (this.options.ecmaVersion >= 6) { if (111 === b || 79 === b) return this.readRadixNumber(8); if (98 === b || 66 === b) return this.readRadixNumber(2) } case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: return this.readNumber(!1); case 34: case 39: return this.readString(a); case 47: return this.readToken_slash(); case 37: case 42: return this.readToken_mult_modulo(a); case 124: case 38: return this.readToken_pipe_amp(a); case 94: return this.readToken_caret(); case 43: case 45: return this.readToken_plus_min(a); case 60: case 62: return this.readToken_lt_gt(a); case 61: case 33: return this.readToken_eq_excl(a); case 126: return this.finishOp(j.prefix, 1) } this.raise(this.pos, "Unexpected character '" + d(a) + "'") }, t.finishOp = function (a, b) { var c = this.input.slice(this.pos, this.pos + b); return this.pos += b, this.finishToken(a, c) }; var v = !1; try { new RegExp("￿", "u"), v = !0 } catch (w) { } t.readRegexp = function () { for (var a = void 0, b = void 0, c = this.pos; ;) { this.pos >= this.input.length && this.raise(c, "Unterminated regular expression"); var d = this.input.charAt(this.pos); if (o.test(d) && this.raise(c, "Unterminated regular expression"), a) a = !1; else { if ("[" === d) b = !0; else if ("]" === d && b) b = !1; else if ("/" === d && !b) break; a = "\\" === d } ++this.pos } var e = this.input.slice(c, this.pos); ++this.pos; var f = this.readWord1(), g = e; if (f) { var h = /^[gmsiy]*$/; this.options.ecmaVersion >= 6 && (h = /^[gmsiyu]*$/), h.test(f) || this.raise(c, "Invalid regular expression flag"), f.indexOf("u") >= 0 && !v && (g = g.replace(/\\u([a-fA-F0-9]{4})|\\u\{([0-9a-fA-F]+)\}|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "x")) } var i = null; if (!u) { try { new RegExp(g) } catch (k) { k instanceof SyntaxError && this.raise(c, "Error parsing regular expression: " + k.message), this.raise(k) } try { i = new RegExp(e, f) } catch (l) { } } return this.finishToken(j.regexp, { pattern: e, flags: f, value: i }) }, t.readInt = function (a, b) { for (var c = this.pos, d = 0, e = 0, f = null == b ? 1 / 0 : b; f > e; ++e) { var g = this.input.charCodeAt(this.pos), h = void 0; if (h = g >= 97 ? g - 97 + 10 : g >= 65 ? g - 65 + 10 : g >= 48 && 57 >= g ? g - 48 : 1 / 0, h >= a) break; ++this.pos, d = d * a + h } return this.pos === c || null != b && this.pos - c !== b ? null : d }, t.readRadixNumber = function (a) { this.pos += 2; var b = this.readInt(a); return null == b && this.raise(this.start + 2, "Expected number in radix " + a), g(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(j.num, b) }, t.readNumber = function (a) { var b = this.pos, c = !1, d = 48 === this.input.charCodeAt(this.pos); a || null !== this.readInt(10) || this.raise(b, "Invalid number"), 46 === this.input.charCodeAt(this.pos) && (++this.pos, this.readInt(10), c = !0); var e = this.input.charCodeAt(this.pos); (69 === e || 101 === e) && (e = this.input.charCodeAt(++this.pos), (43 === e || 45 === e) && ++this.pos, null === this.readInt(10) && this.raise(b, "Invalid number"), c = !0), g(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"); var f = this.input.slice(b, this.pos), h = void 0; return c ? h = parseFloat(f) : d && 1 !== f.length ? /[89]/.test(f) || this.strict ? this.raise(b, "Invalid number") : h = parseInt(f, 8) : h = parseInt(f, 10), this.finishToken(j.num, h) }, t.readCodePoint = function () { var a = this.input.charCodeAt(this.pos), b = void 0; return 123 === a ? (this.options.ecmaVersion < 6 && this.unexpected(), ++this.pos, b = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos), ++this.pos, b > 1114111 && this.unexpected()) : b = this.readHexChar(4), b }, t.readString = function (a) { for (var b = "", c = ++this.pos; ;) { this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant"); var d = this.input.charCodeAt(this.pos); if (d === a) break; 92 === d ? (b += this.input.slice(c, this.pos), b += this.readEscapedChar(), c = this.pos) : (q(d) && this.raise(this.start, "Unterminated string constant"), ++this.pos) } return b += this.input.slice(c, this.pos++), this.finishToken(j.string, b) }, t.readTmplToken = function () { for (var a = "", b = this.pos; ;) { this.pos >= this.input.length && this.raise(this.start, "Unterminated template"); var c = this.input.charCodeAt(this.pos); if (96 === c || 36 === c && 123 === this.input.charCodeAt(this.pos + 1)) return this.pos === this.start && this.type === j.template ? 36 === c ? (this.pos += 2, this.finishToken(j.dollarBraceL)) : (++this.pos, this.finishToken(j.backQuote)) : (a += this.input.slice(b, this.pos), this.finishToken(j.template, a)); 92 === c ? (a += this.input.slice(b, this.pos), a += this.readEscapedChar(), b = this.pos) : q(c) ? (a += this.input.slice(b, this.pos), ++this.pos, 13 === c && 10 === this.input.charCodeAt(this.pos) ? (++this.pos, a += "\n") : a += String.fromCharCode(c), this.options.locations && (++this.curLine, this.lineStart = this.pos), b = this.pos) : ++this.pos } }, t.readEscapedChar = function () { var a = this.input.charCodeAt(++this.pos), b = /^[0-7]+/.exec(this.input.slice(this.pos, this.pos + 3)); for (b && (b = b[0]) ; b && parseInt(b, 8) > 255;) b = b.slice(0, -1); if ("0" === b && (b = null), ++this.pos, b) return this.strict && this.raise(this.pos - 2, "Octal literal in strict mode"), this.pos += b.length - 1, String.fromCharCode(parseInt(b, 8)); switch (a) { case 110: return "\n"; case 114: return "\r"; case 120: return String.fromCharCode(this.readHexChar(2)); case 117: return d(this.readCodePoint()); case 116: return " "; case 98: return "\b"; case 118: return "\x0B"; case 102: return "\f"; case 48: return "\x00"; case 13: 10 === this.input.charCodeAt(this.pos) && ++this.pos; case 10: return this.options.locations && (this.lineStart = this.pos, ++this.curLine), ""; default: return String.fromCharCode(a) } }, t.readHexChar = function (a) { var b = this.readInt(16, a); return null === b && this.raise(this.start, "Bad character escape sequence"), b }; var x; t.readWord1 = function () { x = !1; for (var a = "", b = !0, c = this.pos, e = this.options.ecmaVersion >= 6; this.pos < this.input.length;) { var f = this.fullCharCodeAtPos(); if (h(f, e)) this.pos += 65535 >= f ? 1 : 2; else { if (92 !== f) break; x = !0, a += this.input.slice(c, this.pos); var i = this.pos; 117 != this.input.charCodeAt(++this.pos) && this.raise(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos; var j = this.readCodePoint(); (b ? g : h)(j, e) || this.raise(i, "Invalid Unicode escape"), a += d(j), c = this.pos } b = !1 } return a + this.input.slice(c, this.pos) }, t.readWord = function () { var a = this.readWord1(), b = j.name; return (this.options.ecmaVersion >= 6 || !x) && this.isKeyword(a) && (b = k[a]), this.finishToken(b, a) } }, { "./identifier": 7, "./location": 8, "./state": 13, "./tokentype": 17, "./whitespace": 19 }], 17: [function (a, b, c) { "use strict"; function d(a, b) { return new g(a, { beforeExpr: !0, binop: b }) } function e(a) { var b = void 0 === arguments[1] ? {} : arguments[1]; b.keyword = a, k[a] = j["_" + a] = new g(a, b) } var f = function (a, b) { if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function") }; c.__esModule = !0; var g = c.TokenType = function l(a) { var b = void 0 === arguments[1] ? {} : arguments[1]; f(this, l), this.label = a, this.keyword = b.keyword, this.beforeExpr = !!b.beforeExpr, this.startsExpr = !!b.startsExpr, this.isLoop = !!b.isLoop, this.isAssign = !!b.isAssign, this.prefix = !!b.prefix, this.postfix = !!b.postfix, this.binop = b.binop || null, this.updateContext = null }, h = { beforeExpr: !0 }, i = { startsExpr: !0 }, j = { num: new g("num", i), regexp: new g("regexp", i), string: new g("string", i), name: new g("name", i), eof: new g("eof"), bracketL: new g("[", { beforeExpr: !0, startsExpr: !0 }), bracketR: new g("]"), braceL: new g("{", { beforeExpr: !0, startsExpr: !0 }), braceR: new g("}"), parenL: new g("(", { beforeExpr: !0, startsExpr: !0 }), parenR: new g(")"), comma: new g(",", h), semi: new g(";", h), colon: new g(":", h), dot: new g("."), question: new g("?", h), arrow: new g("=>", h), template: new g("template"), ellipsis: new g("...", h), backQuote: new g("`", i), dollarBraceL: new g("${", { beforeExpr: !0, startsExpr: !0 }), eq: new g("=", { beforeExpr: !0, isAssign: !0 }), assign: new g("_=", { beforeExpr: !0, isAssign: !0 }), incDec: new g("++/--", { prefix: !0, postfix: !0, startsExpr: !0 }), prefix: new g("prefix", { beforeExpr: !0, prefix: !0, startsExpr: !0 }), logicalOR: d("||", 1), logicalAND: d("&&", 2), bitwiseOR: d("|", 3), bitwiseXOR: d("^", 4), bitwiseAND: d("&", 5), equality: d("==/!=", 6), relational: d("", 7), bitShift: d("<>", 8), plusMin: new g("+/-", { beforeExpr: !0, binop: 9, prefix: !0, startsExpr: !0 }), modulo: d("%", 10), star: d("*", 10), slash: d("/", 10) }; c.types = j; var k = {}; c.keywords = k, e("break"), e("case", h), e("catch"), e("continue"), e("debugger"), e("default"), e("do", { isLoop: !0 }), e("else", h), e("finally"), e("for", { isLoop: !0 }), e("function", i), e("if"), e("return", h), e("switch"), e("throw", h), e("try"), e("var"), e("let"), e("const"), e("while", { isLoop: !0 }), e("with"), e("new", { beforeExpr: !0, startsExpr: !0 }), e("this", i), e("super", i), e("class"), e("extends", h), e("export"), e("import"), e("yield", { beforeExpr: !0, startsExpr: !0 }), e("null", i), e("true", i), e("false", i), e("in", { beforeExpr: !0, binop: 7 }), e("instanceof", { beforeExpr: !0, binop: 7 }), e("typeof", { beforeExpr: !0, prefix: !0, startsExpr: !0 }), e("void", { beforeExpr: !0, prefix: !0, startsExpr: !0 }), e("delete", { beforeExpr: !0, prefix: !0, startsExpr: !0 }) }, {}], 18: [function (a, b, c) { "use strict"; function d(a) { return "[object Array]" === Object.prototype.toString.call(a) } function e(a, b) { return Object.prototype.hasOwnProperty.call(a, b) } c.isArray = d, c.has = e, c.__esModule = !0 }, {}], 19: [function (a, b, c) { "use strict"; function d(a) { return 10 === a || 13 === a || 8232 === a || 8233 == a } c.isNewLine = d, c.__esModule = !0; var e = /\r\n?|\n|\u2028|\u2029/; c.lineBreak = e; var f = new RegExp(e.source, "g"); c.lineBreakG = f; var g = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; c.nonASCIIwhitespace = g }, {}] }, {}, [1])(1) }) }(null), function (a) { "use strict"; var b = Object.prototype.toString; a.exports = function (a) { var c = b.call(a), d = "[object Arguments]" === c; return d || (d = "[object Array]" !== c && null !== a && "object" == typeof a && "number" == typeof a.length && a.length >= 0 && "[object Function]" === b.call(a.callee)), d }, window.isArguments = a.exports }({ exports: {} }), function (a) { var b = Object.prototype.hasOwnProperty, c = Object.prototype.toString; a.exports = function (a, d, e) { if ("[object Function]" !== c.call(d)) throw new TypeError("iterator must be a function"); var f = a.length; if (f === +f) for (var g = 0; f > g; g++) d.call(e, a[g], g, a); else for (var h in a) b.call(a, h) && d.call(e, a[h], h, a) }, window.forEach = a.exports }({ exports: {} }), function (a) { a.exports = Array.isArray || function (a) { return "[object Array]" == Object.prototype.toString.call(a) }, window.isArray = a.exports }({ exports: {} }), function (a, b) { "use strict"; var c = Object.prototype.hasOwnProperty, d = Object.prototype.toString, e = Array.prototype.slice, f = a("./isArguments"), g = !{ toString: null }.propertyIsEnumerable("toString"), h = function () { }.propertyIsEnumerable("prototype"), i = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"], j = function (a) { var b = a.constructor; return b && b.prototype === a }, k = { $console: !0, $frame: !0, $frameElement: !0, $frames: !0, $parent: !0, $self: !0, $webkitIndexedDB: !0, $webkitStorageInfo: !0, $window: !0 }, l = function () { if ("undefined" == typeof window) return !1; for (var a in window) try { if (!k["$" + a] && c.call(window, a) && null !== window[a] && "object" == typeof window[a]) try { j(window[a]) } catch (b) { return !0 } } catch (b) { return !0 } return !1 }(), m = function (a) { if ("undefined" == typeof window || !l) return j(a); try { return j(a) } catch (b) { return !1 } }, n = function (a) { var b = null !== a && "object" == typeof a, e = "[object Function]" === d.call(a), j = f(a), k = b && "[object String]" === d.call(a), l = []; if (!b && !e && !j) throw new TypeError("Object.keys called on a non-object"); var n = h && e; if (k && a.length > 0 && !c.call(a, 0)) for (var o = 0; o < a.length; ++o) l.push(String(o)); if (j && a.length > 0) for (var p = 0; p < a.length; ++p) l.push(String(p)); else for (var q in a) n && "prototype" === q || !c.call(a, q) || l.push(String(q)); if (g) for (var r = m(a), s = 0; s < i.length; ++s) r && "constructor" === i[s] || !c.call(a, i[s]) || l.push(i[s]); return l }; n.shim = function () { if (Object.keys) { var a = function () { return 2 === (Object.keys(arguments) || "").length }(1, 2); if (!a) { var b = Object.keys; Object.keys = function (a) { return b(f(a) ? e.call(a) : a) } } } else Object.keys = n; return Object.keys || n }, b.exports = n, window.objectKeys = b.exports }(function () { return isArguments }, { exports: {} }),/*! * falafel (c) James Halliday / MIT License * https://github.com/substack/node-falafel */ function (a, b) { function c(a, b, c) { function d(b) { c[a.start] = b; for (var d = a.start + 1; d < a.end; d++) c[d] = "" } if (a.parent = b, a.source = function () { return c.slice(a.start, a.end).join("") }, a.update && "object" == typeof a.update) { var e = a.update; g(f(e), function (a) { d[a] = e[a] }), a.update = d } else a.update = d } var d = a("acorn").parse, e = a("isarray"), f = a("object-keys"), g = a("foreach"); b.exports = function (a, b, h) { "function" == typeof b && (h = b, b = {}), a && "object" == typeof a && "Buffer" === a.constructor.name ? a = a.toString() : a && "object" == typeof a && (b = a, a = b.source, delete b.source), a = void 0 === a ? b.source : a, "string" != typeof a && (a = String(a)), b.parser && (d = b.parser.parse); var i = d(a, b), j = { chunks: a.split(""), toString: function () { return j.chunks.join("") }, inspect: function () { return j.toString() } }; return function k(a, b) { c(a, b, j.chunks), g(f(a), function (b) { if ("parent" !== b) { var c = a[b]; e(c) ? g(c, function (b) { b && "string" == typeof b.type && k(b, a) }) : c && "string" == typeof c.type && k(c, a) } }), h(a) }(i, void 0), j }, window.falafel = b.exports }(function (a) { switch (a) { case "acorn": return { parse: acorn.parse }; case "object-keys": return objectKeys; case "foreach": return forEach; case "isarray": return isArray } }, { exports: {} }); var inBrowser = "undefined" != typeof window && this === window, parseAndModify = inBrowser ? window.falafel : require("falafel"); (inBrowser ? window : exports).blanket = function () { var a, b = ["ExpressionStatement", "BreakStatement", "ContinueStatement", "VariableDeclaration", "ReturnStatement", "ThrowStatement", "TryStatement", "FunctionDeclaration", "IfStatement", "WhileStatement", "DoWhileStatement", "ForStatement", "ForInStatement", "SwitchStatement", "WithStatement"], c = ["IfStatement", "WhileStatement", "DoWhileStatement", "ForStatement", "ForInStatement", "WithStatement"], d = Math.floor(1e3 * Math.random()), e = {}, f = { reporter: null, adapter: null, filter: null, customVariable: null, loader: null, ignoreScriptError: !1, existingRequireJS: !1, autoStart: !1, timeout: 180, ignoreCors: !1, branchTracking: !1, sourceURL: !1, debug: !1, engineOnly: !1, testReadyCallback: null, commonJS: !1, instrumentCache: !1, modulePattern: null, ecmaVersion: 5 }; return inBrowser && "undefined" != typeof window.blanket && (a = window.blanket.noConflict()), _blanket = { noConflict: function () { return a ? a : _blanket }, _getCopyNumber: function () { return d }, extend: function (a) { _blanket._extend(_blanket, a) }, _extend: function (a, b) { if (b) for (var c in b) a[c] instanceof Object && "function" != typeof a[c] ? _blanket._extend(a[c], b[c]) : a[c] = b[c] }, getCovVar: function () { var a = _blanket.options("customVariable"); return a ? (_blanket.options("debug") && console.log("BLANKET-Using custom tracking variable:", a), inBrowser ? "window." + a : a) : inBrowser ? "window._$blanket" : "_$jscoverage" }, options: function (a, b) { if ("string" != typeof a) _blanket._extend(f, a); else { if ("undefined" == typeof b) return f[a]; f[a] = b } }, instrumentSync: function (a, b) { var c = a.inputFile, d = a.inputFileName; if (_blanket.options("instrumentCache") && sessionStorage && sessionStorage.getItem("blanket_instrument_store-" + d)) { if (_blanket.options("debug") && console.log("BLANKET-Reading instrumentation from cache: ", d), !b) return sessionStorage.getItem("blanket_instrument_store-" + d); b(sessionStorage.getItem("blanket_instrument_store-" + d)) } else { var e = _blanket._prepareSource(c); _blanket._trackingArraySetup = [], c = c.replace(/^\#\!.*/, ""); var f = parseAndModify(c, { locations: !0, comment: !0, ecmaVersion: _blanket.options("ecmaVersion") }, _blanket._addTracking(d)); if (f = _blanket._trackingSetup(d, e) + f, _blanket.options("sourceURL") && (f += "\n//@ sourceURL=" + d.replace("http://", "")), _blanket.options("debug") && console.log("BLANKET-Instrumented file: ", d), _blanket.options("instrumentCache") && sessionStorage && (_blanket.options("debug") && console.log("BLANKET-Saving instrumentation to cache: ", d), sessionStorage.setItem("blanket_instrument_store-" + d, f)), !b) return f; b(f) } }, instrument: function (a, b) { _blanket.instrumentSync(a, b) }, _trackingArraySetup: [], _branchingArraySetup: [], _useStrictMode: !1, _prepareSource: function (a) { return a.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/(\r\n|\n|\r)/gm, "\n").split("\n") }, _trackingSetup: function (a, b) { var c = _blanket.options("branchTracking"), d = b.join("',\n'"), e = "", f = _blanket.getCovVar(); return _blanket._useStrictMode && (e += "'use strict';\n"), e += "if (typeof " + f + " === 'undefined') " + f + " = {};\n", c && (e += "var _$branchFcn=function(f,l,c,r){ ", e += "if (!!r) { ", e += f + "[f].branchData[l][c][0] = " + f + "[f].branchData[l][c][0] || [];", e += f + "[f].branchData[l][c][0].push(r); }", e += "else { ", e += f + "[f].branchData[l][c][1] = " + f + "[f].branchData[l][c][1] || [];", e += f + "[f].branchData[l][c][1].push(r); }", e += "return r;};\n"), e += "if (typeof " + f + "['" + a + "'] === 'undefined'){", e += f + "['" + a + "']=[];\n", c && (e += f + "['" + a + "'].branchData=[];\n"), e += f + "['" + a + "'].source=['" + d + "'];\n", _blanket._trackingArraySetup.sort(function (a, b) { return parseInt(a, 10) > parseInt(b, 10) }).forEach(function (b) { e += f + "['" + a + "'][" + b + "]=0;\n" }), c && _blanket._branchingArraySetup.sort(function (a, b) { return a.line > b.line }).sort(function (a, b) { return a.column > b.column }).forEach(function (b) { b.file === a && (e += "if (typeof " + f + "['" + a + "'].branchData[" + b.line + "] === 'undefined'){\n", e += f + "['" + a + "'].branchData[" + b.line + "]=[];\n", e += "}", e += f + "['" + a + "'].branchData[" + b.line + "][" + b.column + "] = [];\n", e += f + "['" + a + "'].branchData[" + b.line + "][" + b.column + "].consequent = " + JSON.stringify(b.consequent) + ";\n", e += f + "['" + a + "'].branchData[" + b.line + "][" + b.column + "].alternate = " + JSON.stringify(b.alternate) + ";\n") }), e += "}" }, _blockifyIf: function (a) { if (c.indexOf(a.type) > -1) { var b = a.consequent || a.body, d = a.alternate; d && "BlockStatement" !== d.type && d.update("{\n" + d.source() + "}\n"), b && "BlockStatement" !== b.type && b.update("{\n" + b.source() + "}\n") } }, _trackBranch: function (a, b) { var c = a.loc.start.line, d = a.loc.start.column; _blanket._branchingArraySetup.push({ line: c, column: d, file: b, consequent: a.consequent.loc, alternate: a.alternate.loc }); var e = "_$branchFcn('" + b + "'," + c + "," + d + "," + a.test.source() + ")?" + a.consequent.source() + ":" + a.alternate.source(); a.update(e) }, _addTracking: function (a) { var c = _blanket.getCovVar(); return function (d) { if (_blanket._blockifyIf(d), b.indexOf(d.type) > -1 && "LabeledStatement" !== d.parent.type) { if (_blanket._checkDefs(d, a), "VariableDeclaration" === d.type && ("ForStatement" === d.parent.type || "ForInStatement" === d.parent.type)) return; if (!d.loc || !d.loc.start) throw new Error("The instrumenter encountered a node with no location: " + Object.keys(d)); d.update(c + "['" + a + "'][" + d.loc.start.line + "]++;\n" + d.source()), _blanket._trackingArraySetup.push(d.loc.start.line) } else _blanket.options("branchTracking") && "ConditionalExpression" === d.type ? _blanket._trackBranch(d, a) : "Literal" === d.type && "use strict" === d.value && d.parent && "ExpressionStatement" === d.parent.type && d.parent.parent && "Program" === d.parent.parent.type && (_blanket._useStrictMode = !0) } }, _checkDefs: function (a, b) { if (inBrowser) { if ("VariableDeclaration" === a.type && a.declarations && a.declarations.forEach(function (c) {/*if("window"===c.id.name)throw new Error("Instrumentation error, you cannot redefine the 'window' variable in "+b+":"+a.loc.start.line)*/ }), "FunctionDeclaration" === a.type && a.params && a.params.forEach(function (c) {/*if("window"===c.name)throw new Error("Instrumentation error, you cannot redefine the 'window' variable in "+b+":"+a.loc.start.line)*/ }), "ExpressionStatement" === a.type && a.expression && a.expression.left && a.expression.left.object && a.expression.left.property && a.expression.left.object.name + "." + a.expression.left.property.name === _blanket.getCovVar()) throw new Error("Instrumentation error, you cannot redefine the coverage variable in " + b + ":" + a.loc.start.line) } else if ("ExpressionStatement" === a.type && a.expression && a.expression.left && !a.expression.left.object && !a.expression.left.property && a.expression.left.name === _blanket.getCovVar()) throw new Error("Instrumentation error, you cannot redefine the coverage variable in " + b + ":" + a.loc.start.line) }, setupCoverage: function () { e.instrumentation = "blanket", e.stats = { suites: 0, tests: 0, passes: 0, pending: 0, failures: 0, start: new Date } }, _checkIfSetup: function () { if (!e.stats) throw new Error("You must call blanket.setupCoverage() first.") }, onTestStart: function () { _blanket.options("debug") && console.log("BLANKET-Test event started"), this._checkIfSetup(), e.stats.tests++, e.stats.pending++ }, onTestDone: function (a, b) { this._checkIfSetup(), b === a ? e.stats.passes++ : e.stats.failures++, e.stats.pending-- }, onModuleStart: function () { this._checkIfSetup(), e.stats.suites++ }, onTestsDone: function () { _blanket.options("debug") && console.log("BLANKET-Test event done"), this._checkIfSetup(), e.stats.end = new Date, inBrowser ? this.report(e) : (_blanket.options("branchTracking") || delete (inBrowser ? window : global)[_blanket.getCovVar()].branchFcn, this.options("reporter").call(this, e)) } }, _blanket }(), function (a) { var b = a.options; a.extend({ outstandingRequireFiles: [], options: function (c, d) { var e = {}; if ("string" != typeof c) b(c), e = c; else { if ("undefined" == typeof d) return b(c); b(c, d), e[c] = d } e.adapter && a._loadFile(e.adapter), e.loader && a._loadFile(e.loader) }, requiringFile: function (b, c) { "undefined" == typeof b ? a.outstandingRequireFiles = [] : "undefined" == typeof c ? a.outstandingRequireFiles.push(b) : a.outstandingRequireFiles.splice(a.outstandingRequireFiles.indexOf(b), 1) }, requireFilesLoaded: function () { return 0 === a.outstandingRequireFiles.length }, showManualLoader: function () { if (!document.getElementById("blanketLoaderDialog")) { var a = "
    "; a += " 
    ", a += "
    ", a += "
    ", a += "Error: Blanket.js encountered a cross origin request error while instrumenting the source files. ", a += "

    This is likely caused by the source files being referenced locally (using the file:// protocol). ", a += "

    Some solutions include starting Chrome with special flags, running a server locally, or using a browser without these CORS restrictions (Safari).", a += "
    ", "undefined" != typeof FileReader && (a += "
    Or, try the experimental loader. When prompted, simply click on the directory containing all the source files you want covered.", a += "Start Loader", a += ""), a += "
    Close", a += "
    ", a += "
    "; var b = ".blanketDialogWrapper {"; b += "display:block;", b += "position:fixed;", b += "z-index:40001; }", b += ".blanketDialogOverlay {", b += "position:fixed;", b += "width:100%;", b += "height:100%;", b += "background-color:black;", b += "opacity:.5; ", b += "-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=50)'; ", b += "filter:alpha(opacity=50); ", b += "z-index:40001; }", b += ".blanketDialogVerticalOffset { ", b += "position:fixed;", b += "top:30%;", b += "width:100%;", b += "z-index:40002; }", b += ".blanketDialogBox { ", b += "width:405px; ", b += "position:relative;", b += "margin:0 auto;", b += "background-color:white;", b += "padding:10px;", b += "border:1px solid black; }"; var c = document.createElement("style"); c.innerHTML = b, document.head.appendChild(c); var d = document.createElement("div"); d.id = "blanketLoaderDialog", d.className = "blanketDialogWrapper", d.innerHTML = a, document.body.insertBefore(d, document.body.firstChild) } }, manualFileLoader: function (a) { function b(a) { var b = new FileReader; b.onload = g, b.readAsText(a) } var c = Array.prototype.slice; a = c.call(a).filter(function (a) { return "" !== a.type }); var d = a.length - 1, e = 0, f = {}; sessionStorage.blanketSessionLoader && (f = JSON.parse(sessionStorage.blanketSessionLoader)); var g = function (c) { var g = c.currentTarget.result, h = a[e], i = h.webkitRelativePath && "" !== h.webkitRelativePath ? h.webkitRelativePath : h.name; f[i] = g, e++, e === d ? (sessionStorage.setItem("blanketSessionLoader", JSON.stringify(f)), document.location.reload()) : b(a[e]) }; b(a[e]) }, _loadFile: function (b) { if ("undefined" != typeof b) { var c = new XMLHttpRequest; c.open("GET", b, !1), c.send(), a._addScript(c.responseText) } }, _addScript: function (a) { var b = document.createElement("script"); b.type = "text/javascript", b.text = a, (document.body || document.getElementsByTagName("head")[0]).appendChild(b) }, hasAdapter: function (b) { return null !== a.options("adapter") }, report: function (b) { document.getElementById("blanketLoaderDialog") || (a.blanketSession = null), b.files = window._$blanket; blanket.options("commonJS") ? blanket._commonjs.require : window.require; if (!b.files || !Object.keys(b.files).length) return void (a.options("debug") && console.log("BLANKET-Reporting No files were instrumented.")); if ("undefined" != typeof b.files.branchFcn && delete b.files.branchFcn, "string" == typeof a.options("reporter")) a._loadFile(a.options("reporter")), a.customReporter(b, a.options("reporter_options")); else if ("function" == typeof a.options("reporter")) a.options("reporter")(b, a.options("reporter_options")); else { if ("function" != typeof a.defaultReporter) throw new Error("no reporter defined."); a.defaultReporter(b, a.options("reporter_options")) } }, _bindStartTestRunner: function (a, b) { a ? a(b) : "complete" === document.readyState ? b() : window.addEventListener("load", b, !1) }, _loadSourceFiles: function (b) { blanket.options("commonJS") ? blanket._commonjs.require : window.require; a.options("debug") && console.log("BLANKET-Collecting page scripts"); var c = a.utils.collectPageScripts(); if (0 === c.length) b(); else { sessionStorage.blanketSessionLoader && (a.blanketSession = JSON.parse(sessionStorage.blanketSessionLoader)), c.forEach(function (b, c) { a.utils.cache[b] = { loaded: !1 } }); var d = -1; a.utils.loadAll(function (a) { return a ? "undefined" != typeof c[d + 1] : (d++, d >= c.length ? null : c[d]) }, b) } }, beforeStartTestRunner: function (b) { b = b || {}, b.checkRequirejs = "undefined" == typeof b.checkRequirejs ? !0 : b.checkRequirejs, b.callback = b.callback || function () { }, b.coverage = "undefined" == typeof b.coverage ? !0 : b.coverage, b.coverage ? a._bindStartTestRunner(b.bindEvent, function () { a._loadSourceFiles(function () { var c = function () { return b.condition ? b.condition() : a.requireFilesLoaded() }, d = function () { if (c()) { a.options("debug") && console.log("BLANKET-All files loaded, init start test runner callback."); var e = a.options("testReadyCallback"); e ? "function" == typeof e ? e(b.callback) : "string" == typeof e && (a._addScript(e), b.callback()) : b.callback() } else setTimeout(d, 13) }; d() }) }) : b.callback() }, utils: { qualifyURL: function (a) { var b = document.createElement("a"); return b.href = a, b.href } } }) }(blanket), blanket.defaultReporter = function (a) { function b(a) { var b = document.getElementById(a); "block" === b.style.display ? b.style.display = "none" : b.style.display = "block" } function c(a) { return a.replace(/\&/g, "&").replace(//g, ">").replace(/\"/g, """).replace(/\'/g, "'").replace(/`/g, "`").replace(/[$]/g, "$").replace(/&/g, "&") } function d(a, b) { var c = b ? 0 : 1; return "undefined" == typeof a || null === typeof a || "undefined" == typeof a[c] ? !1 : a[c].length > 0 } function e(a, b, f, g, h) { var i = "", j = ""; if (q.length > 0) if (i += "", q[0][0].end.line === h) { if (i += c(b.slice(0, q[0][0].end.column)) + "", b = b.slice(q[0][0].end.column), q.shift(), q.length > 0) if (i += "", q[0][0].end.line === h) { if (i += c(b.slice(0, q[0][0].end.column)) + "", b = b.slice(q[0][0].end.column), q.shift(), !f) return { src: i + c(b), cols: f } } else { if (!f) return { src: i + c(b) + "", cols: f }; j = "" } else if (!f) return { src: i + c(b), cols: f } } else { if (!f) return { src: i + c(b) + "", cols: f }; j = "" } var k = f[a], l = k.consequent; if (l.start.line > h) q.unshift([k.alternate, k]), q.unshift([l, k]), b = c(b); else { var m = ""; if (i += c(b.slice(0, l.start.column - g)) + m, f.length > a + 1 && f[a + 1].consequent.start.line === h && f[a + 1].consequent.start.column - g < f[a].consequent.end.column - g) { var n = e(a + 1, b.slice(l.start.column - g, l.end.column - g), f, l.start.column - g, h); i += n.src, f = n.cols, f[a + 1] = f[a + 2], f.length-- } else i += c(b.slice(l.start.column - g, l.end.column - g)); i += ""; var o = k.alternate; if (o.start.line > h) i += c(b.slice(l.end.column - g)), q.unshift([o, k]); else { if (i += c(b.slice(l.end.column - g, o.start.column - g)), m = "", i += m, f.length > a + 1 && f[a + 1].consequent.start.line === h && f[a + 1].consequent.start.column - g < f[a].alternate.end.column - g) { var p = e(a + 1, b.slice(o.start.column - g, o.end.column - g), f, o.start.column - g, h); i += p.src, f = p.cols, f[a + 1] = f[a + 2], f.length-- } else i += c(b.slice(o.start.column - g, o.end.column - g)); i += "", i += c(b.slice(o.end.column - g)), b = i } } return { src: b + j, cols: f } } var f = "#blanket-main {margin:2px;background:#EEE;color:#333;clear:both;font-family:'Helvetica Neue Light', 'HelveticaNeue-Light', 'Helvetica Neue', Calibri, Helvetica, Arial, sans-serif; font-size:17px;} #blanket-main a {color:#333;text-decoration:none;} #blanket-main a:hover {text-decoration:underline;} .blanket {margin:0;padding:5px;clear:both;border-bottom: 1px solid #FFFFFF;} .bl-error {color:red;}.bl-success {color:#5E7D00;} .bl-file{width:auto;} .bl-cl{float:left;} .blanket div.rs {margin-left:50px; width:150px; float:right} .bl-nb {padding-right:10px;} #blanket-main a.bl-logo {color: #EB1764;cursor: pointer;font-weight: bold;text-decoration: none} .bl-source{ overflow-x:scroll; background-color: #FFFFFF; border: 1px solid #CBCBCB; color: #363636; margin: 25px 20px; width: 80%;} .bl-source div{white-space: pre;font-family: monospace;} .bl-source > div > span:first-child{background-color: #EAEAEA;color: #949494;display: inline-block;padding: 0 10px;text-align: center;width: 30px;} .bl-source .hit{background-color:#c3e6c7} .bl-source .miss{background-color:#e6c3c7} .bl-source span.branchWarning{color:#000;background-color:yellow;} .bl-source span.branchOkay{color:#000;background-color:transparent;}", g = 60, h = document.head, i = 0, j = document.body, k = Object.keys(a.files).some(function (b) { return "undefined" != typeof a.files[b].branchData }), l = "
    results
    Coverage (%)
    Covered/Total Smts.
    " + (k ? "
    Covered/Total Branches
    " : "") + "
    ", m = "
    {{fileNumber}}.{{file}}
    {{percentage}} %
    {{numberCovered}}/{{totalSmts}}
    " + (k ? "
    {{passedBranches}}/{{totalBranches}}
    " : "") + "
    "; grandTotalTemplate = "
    {{rowTitle}}
    {{percentage}} %
    {{numberCovered}}/{{totalSmts}}
    " + (k ? "
    {{passedBranches}}/{{totalBranches}}
    " : "") + "
    "; var n = document.createElement("script"); n.type = "text/javascript", n.text = b.toString().replace("function " + b.name, "function blanket_toggleSource"), j.appendChild(n); var o = function (a, b) { return Math.round(a / b * 100 * 100) / 100 }, p = function (a, b, c) { var d = document.createElement(a); d.innerHTML = c, b.appendChild(d) }, q = [], r = function (a) { return "undefined" != typeof a }, s = a.files, t = { totalSmts: 0, numberOfFilesCovered: 0, passedBranches: 0, totalBranches: 0, moduleTotalStatements: {}, moduleTotalCoveredStatements: {}, moduleTotalBranches: {}, moduleTotalCoveredBranches: {} }, u = _blanket.options("modulePattern"), v = u ? new RegExp(u) : null; for (var w in s) if (s.hasOwnProperty(w)) { i++; var x, y = s[w], z = 0, A = 0, B = []; for (x = 0; x < y.source.length; x += 1) { var C = y.source[x]; if (q.length > 0 || "undefined" != typeof y.branchData) if ("undefined" != typeof y.branchData[x + 1]) { var D = y.branchData[x + 1].filter(r), E = 0; C = e(E, C, D, 0, x + 1).src } else C = q.length ? e(0, C, null, 0, x + 1).src : c(C); else C = c(C); var F = ""; y[x + 1] ? (A += 1, z += 1, F = "hit") : 0 === y[x + 1] && (z++, F = "miss"), B[x + 1] = "
    " + (x + 1) + "" + C + "
    " } t.totalSmts += z, t.numberOfFilesCovered += A; var G = 0, H = 0; if ("undefined" != typeof y.branchData) for (var I = 0; I < y.branchData.length; I++) if ("undefined" != typeof y.branchData[I]) for (var J = 0; J < y.branchData[I].length; J++) "undefined" != typeof y.branchData[I][J] && (G++, "undefined" != typeof y.branchData[I][J][0] && y.branchData[I][J][0].length > 0 && "undefined" != typeof y.branchData[I][J][1] && y.branchData[I][J][1].length > 0 && H++); if (t.passedBranches += H, t.totalBranches += G, v) { var K = w.match(v)[1]; t.moduleTotalStatements.hasOwnProperty(K) || (t.moduleTotalStatements[K] = 0, t.moduleTotalCoveredStatements[K] = 0), t.moduleTotalStatements[K] += z, t.moduleTotalCoveredStatements[K] += A, t.moduleTotalBranches.hasOwnProperty(K) || (t.moduleTotalBranches[K] = 0, t.moduleTotalCoveredBranches[K] = 0), t.moduleTotalBranches[K] += G, t.moduleTotalCoveredBranches[K] += H } var L = o(A, z), M = m.replace("{{file}}", w).replace("{{percentage}}", L).replace("{{numberCovered}}", A).replace(/\{\{fileNumber\}\}/g, i).replace("{{totalSmts}}", z).replace("{{totalBranches}}", G).replace("{{passedBranches}}", H).replace("{{source}}", B.join(" ")); M = g > L ? M.replace("{{statusclass}}", "bl-error") : M.replace("{{statusclass}}", "bl-success"), l += M } var N = function (a, b, c, d, e) { var f = o(b, a), h = g > f ? "bl-error" : "bl-success", i = e ? "Total for module: " + e : "Global total", j = grandTotalTemplate.replace("{{rowTitle}}", i).replace("{{percentage}}", f).replace("{{numberCovered}}", b).replace("{{totalSmts}}", a).replace("{{passedBranches}}", d).replace("{{totalBranches}}", c).replace("{{statusclass}}", h); l += j }; if (v) for (var O in t.moduleTotalStatements) if (t.moduleTotalStatements.hasOwnProperty(O)) { var P = t.moduleTotalStatements[O], Q = t.moduleTotalCoveredStatements[O], R = t.moduleTotalBranches[O], S = t.moduleTotalCoveredBranches[O]; N(P, Q, R, S, O) } N(t.totalSmts, t.numberOfFilesCovered, t.totalBranches, t.passedBranches, null), l += "
    ", p("style", h, f), document.getElementById("blanket-main") ? document.getElementById("blanket-main").innerHTML = l.slice(23, -6) : p("div", j, l) }, function () { var a = {}, b = Array.prototype.slice, c = b.call(document.scripts); b.call(c[c.length - 1].attributes).forEach(function (b) { if ("data-cover-only" === b.nodeName && (a.filter = b.nodeValue), "data-cover-never" === b.nodeName && (a.antifilter = b.nodeValue), "data-cover-reporter" === b.nodeName && (a.reporter = b.nodeValue), "data-cover-adapter" === b.nodeName && (a.adapter = b.nodeValue), "data-cover-loader" === b.nodeName && (a.loader = b.nodeValue), "data-cover-timeout" === b.nodeName && (a.timeout = b.nodeValue), "data-cover-modulepattern" === b.nodeName && (a.modulePattern = b.nodeValue), "data-cover-reporter-options" === b.nodeName) try { a.reporter_options = JSON.parse(b.nodeValue) } catch (c) { if (blanket.options("debug")) throw new Error("Invalid reporter options. Must be a valid stringified JSON object.") } if ("data-cover-testReadyCallback" === b.nodeName && (a.testReadyCallback = b.nodeValue), "data-cover-customVariable" === b.nodeName && (a.customVariable = b.nodeValue), "data-cover-flags" === b.nodeName) { var d = " " + b.nodeValue + " "; d.indexOf(" ignoreError ") > -1 && (a.ignoreScriptError = !0), d.indexOf(" autoStart ") > -1 && (a.autoStart = !0), d.indexOf(" ignoreCors ") > -1 && (a.ignoreCors = !0), d.indexOf(" branchTracking ") > -1 && (a.branchTracking = !0), d.indexOf(" sourceURL ") > -1 && (a.sourceURL = !0), d.indexOf(" debug ") > -1 && (a.debug = !0), d.indexOf(" engineOnly ") > -1 && (a.engineOnly = !0), d.indexOf(" commonJS ") > -1 && (a.commonJS = !0), d.indexOf(" instrumentCache ") > -1 && (a.instrumentCache = !0) } }), blanket.options(a), "undefined" != typeof requirejs && blanket.options("existingRequireJS", !0), blanket.options("commonJS") && (blanket._commonjs = {}) }(), function (a) { a.extend({ utils: { normalizeBackslashes: function (a) { return a.replace(/\\/g, "/") }, matchPatternAttribute: function (b, c) { if ("string" == typeof c) { if (0 === c.indexOf("[")) { var d = c.slice(1, c.length - 1).split(","); return d.some(function (c) { return a.utils.matchPatternAttribute(b, a.utils.normalizeBackslashes(c.slice(1, -1))) }) } if (0 === c.indexOf("//")) { var e = c.slice(2, c.lastIndexOf("/")), f = c.slice(c.lastIndexOf("/") + 1), g = new RegExp(e, f); return g.test(b) } return 0 === c.indexOf("#") ? window[c.slice(1)].call(window, b) : b.indexOf(a.utils.normalizeBackslashes(c)) > -1 } return c instanceof Array ? c.some(function (c) { return a.utils.matchPatternAttribute(b, c) }) : c instanceof RegExp ? c.test(b) : "function" == typeof c ? c.call(window, b) : void 0 }, blanketEval: function (b) { a._addScript(b) }, collectPageScripts: function () { var b = Array.prototype.slice, c = (b.call(document.scripts), []), d = [], e = a.options("filter"); if (null != e) { var f = a.options("antifilter"); c = b.call(document.scripts).filter(function (c) { return 1 === b.call(c.attributes).filter(function (b) { return "src" === b.nodeName && a.utils.matchPatternAttribute(b.nodeValue, e) && ("undefined" == typeof f || !a.utils.matchPatternAttribute(b.nodeValue, f)) }).length }) } else c = b.call(document.querySelectorAll("script[data-cover]")); return d = c.map(function (c) { return a.utils.qualifyURL(b.call(c.attributes).filter(function (a) { return "src" === a.nodeName })[0].nodeValue) }), e || a.options("filter", "['" + d.join("','") + "']"), d }, loadAll: function (b, c, d) { var e = b(), f = a.utils.scriptIsLoaded(e, a.utils.ifOrdered, b, c); if (a.utils.cache[e] && a.utils.cache[e].loaded) f(); else { var g = function () { a.options("debug") && console.log("BLANKET-Mark script:" + e + ", as loaded and move to next script."), f() }, h = function (b) { a.options("debug") && console.log("BLANKET-File loading finished"), "undefined" != typeof b && (a.options("debug") && console.log("BLANKET-Add file to DOM."), a._addScript(b)), g() }; a.utils.attachScript({ url: e }, function (b) { a.utils.processFile(b, e, h, h) }) } }, attachScript: function (b, c) { var d = a.options("timeout") || 3e3; setTimeout(function () { if (!a.utils.cache[b.url].loaded) throw new Error("error (timeout=" + d + ") loading source script: " + b.url) }, d), a.utils.getFile(b.url, c, function () { throw new Error("error loading source script: " + b.url) }) }, ifOrdered: function (b, c) { var d = b(!0); d ? a.utils.loadAll(b, c) : c(new Error("Error in loading chain.")) }, scriptIsLoaded: function (b, c, d, e) { return a.options("debug") && console.log("BLANKET-Returning function"), function () { a.options("debug") && console.log("BLANKET-Marking file as loaded: " + b), a.utils.cache[b].loaded = !0, a.utils.allLoaded() ? (a.options("debug") && console.log("BLANKET-All files loaded"), e()) : c && (a.options("debug") && console.log("BLANKET-Load next file."), c(d, e)) } }, cache: {}, allLoaded: function () { for (var b = Object.keys(a.utils.cache), c = 0; c < b.length; c++) if (!a.utils.cache[b[c]].loaded) return !1; return !0 }, processFile: function (b, c, d, e) { var f = a.options("filter"), g = a.options("antifilter"); "undefined" != typeof g && a.utils.matchPatternAttribute(c, g) ? (e(b), a.options("debug") && console.log("BLANKET-File will never be instrumented:" + c), a.requiringFile(c, !0)) : a.utils.matchPatternAttribute(c, f) ? (a.options("debug") && console.log("BLANKET-Attempting instrument of:" + c), a.instrument({ inputFile: b, inputFileName: c }, function (e) { try { a.options("debug") && console.log("BLANKET-instrument of:" + c + " was successfull."), a.utils.blanketEval(e), d(), a.requiringFile(c, !0) } catch (f) { if (!a.options("ignoreScriptError")) { var g = new Error("Error parsing instrumented code: " + f); throw g.error = f, g } a.options("debug") && console.log("BLANKET-There was an error loading the file:" + c), d(b), a.requiringFile(c, !0) } })) : (a.options("debug") && console.log("BLANKET-Loading (without instrumenting) the file:" + c), e(b), a.requiringFile(c, !0)) }, cacheXhrConstructor: function () { var a, b, c; if ("undefined" != typeof XMLHttpRequest) a = XMLHttpRequest, this.createXhr = function () { return new a }; else if ("undefined" != typeof ActiveXObject) { for (a = ActiveXObject, b = 0; 3 > b; b += 1) { c = progIds[b]; try { new ActiveXObject(c); break } catch (d) { } } this.createXhr = function () { return new a(c) } } }, craeteXhr: function () { throw new Error("cacheXhrConstructor is supposed to overwrite this function.") }, getFile: function (b, c, d, e) { var f = !1; if (a.blanketSession) for (var g = Object.keys(a.blanketSession), h = 0; h < g.length; h++) { var i = g[h]; if (b.indexOf(i) > -1) return c(a.blanketSession[i]), void (f = !0) } if (!f) { var j = a.utils.createXhr(); j.open("GET", b, !0), e && e(j, b), j.onreadystatechange = function (a) { var e, f; 4 === j.readyState && (e = j.status, e > 399 && 600 > e ? (f = new Error(b + " HTTP status: " + e), f.xhr = j, d(f)) : c(j.responseText)) }; try { j.send(null) } catch (k) { if (!k.code || 101 !== k.code && 1012 !== k.code || a.options("ignoreCors") !== !1) throw k; a.showManualLoader() } } } } }), function () { var b = (blanket.options("commonJS") ? blanket._commonjs.require : window.require, blanket.options("commonJS") ? blanket._commonjs.requirejs : window.requirejs); !a.options("engineOnly") && a.options("existingRequireJS") && (a.utils.oldloader = b.load, b.load = function (b, c, d) { a.requiringFile(d), a.utils.getFile(d, function (e) { a.utils.processFile(e, d, function () { b.completeLoad(c) }, function () { a.utils.oldloader(b, c, d) }) }, function (b) { throw a.requiringFile(), b }) }), a.utils.cacheXhrConstructor() }() }(blanket), function () { if ("undefined" != typeof QUnit) { var a = function () { return window.QUnit.config.queue.length > 0 && blanket.noConflict().requireFilesLoaded() }; QUnit.config.urlConfig[0].tooltip ? (QUnit.config.urlConfig.push({ id: "coverage", label: "Enable coverage", tooltip: "Enable code coverage." }), QUnit.urlParams.coverage || blanket.options("autoStart") ? (QUnit.begin(function () { blanket.noConflict().setupCoverage() }), QUnit.done(function (a, b) { blanket.noConflict().onTestsDone() }), QUnit.moduleStart(function (a) { blanket.noConflict().onModuleStart() }), QUnit.testStart(function (a) { blanket.noConflict().onTestStart() }), QUnit.testDone(function (a) { blanket.noConflict().onTestDone(a.total, a.passed) }), blanket.noConflict().beforeStartTestRunner({ condition: a, callback: function () { (!blanket.options("existingRequireJS") || blanket.options("autoStart")) && QUnit.start() } })) : (blanket.options("existingRequireJS") && (requirejs.load = _blanket.utils.oldloader), blanket.noConflict().beforeStartTestRunner({ condition: a, callback: function () { (!blanket.options("existingRequireJS") || blanket.options("autoStart")) && QUnit.start() }, coverage: !1 }))) : (QUnit.begin = function () { blanket.noConflict().setupCoverage() }, QUnit.done = function (a, b) { blanket.noConflict().onTestsDone() }, QUnit.moduleStart = function (a) { blanket.noConflict().onModuleStart() }, QUnit.testStart = function (a) { blanket.noConflict().onTestStart() }, QUnit.testDone = function (a) { blanket.noConflict().onTestDone(a.total, a.passed) }, blanket.beforeStartTestRunner({ condition: a, callback: QUnit.start })) } }(); ================================================ FILE: common/Tests/External/blanket-reporter.js ================================================ (function myReporter() { var reported = false; var a = document.createElement("a"); document.body.appendChild(a); //your reporter code blanket.customReporter = function (coverage) { blanket.defaultReporter(coverage); var styleTags = document.getElementsByTagName("style"); var styles = ""; for (var i = 0; i < styleTags.length; i++) { styles += styleTags[i].outerHTML; } var scriptTags = document.getElementsByTagName("body")[0].getElementsByTagName("script"); var scripts = ""; for (var i = 0; i < scriptTags.length; i++) { scripts += scriptTags[i].outerHTML; } var title = document.getElementsByTagName("title")[0].text; var documentName = title.replace(/[^\w]/ig, '') + 'Coverage.html'; var coverageReport = ''; coverageReport += '' + '' + styles + "

    " + title.replace(/[^\w\s]/ig, '') + "

    " + scripts + document.getElementById("blanket-main").outerHTML + ""; var file = new Blob([coverageReport], { type: 'text/plain' }); a.href = URL.createObjectURL(file); a.download = documentName; if (!reported) { a.click(); reported = true; } }; })(); ================================================ FILE: common/Tests/External/jquery.d.ts ================================================ // Type definitions for jQuery 1.10.x / 2.0.x // Project: http://jquery.com/ // Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton , Diullei Gomes , Tass Iliopoulos , Jason Swearingen , Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , James Harrison Fisher , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly , Dick van den Brink // Definitions: https://github.com/borisyankov/DefinitelyTyped /* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /** * Interface for the AJAX setting that will configure the AJAX request */ interface JQueryAjaxSettings { /** * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. */ accepts?: any; /** * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). */ async?: boolean; /** * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. */ beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any; /** * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. */ cache?: boolean; /** * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. */ complete? (jqXHR: JQueryXHR, textStatus: string): any; /** * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5) */ contents?: { [key: string]: any; }; //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false" // https://github.com/borisyankov/DefinitelyTyped/issues/742 /** * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. */ contentType?: any; /** * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). */ context?: any; /** * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5) */ converters?: { [key: string]: any; }; /** * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5) */ crossDomain?: boolean; /** * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). */ data?: any; /** * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. */ dataFilter? (data: any, ty: any): any; /** * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). */ dataType?: string; /** * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. */ error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; /** * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. */ global?: boolean; /** * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5) */ headers?: { [key: string]: any; }; /** * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. */ ifModified?: boolean; /** * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1) */ isLocal?: boolean; /** * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } */ jsonp?: any; /** * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. */ jsonpCallback?: any; /** * A mime type to override the XHR mime type. (version added: 1.5.1) */ mimeType?: string; /** * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. */ password?: string; /** * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. */ processData?: boolean; /** * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. */ scriptCharset?: string; /** * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5) */ statusCode?: { [key: string]: any; }; /** * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. */ success? (data: any, textStatus: string, jqXHR: JQueryXHR): any; /** * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. */ timeout?: number; /** * Set this to true if you wish to use the traditional style of param serialization. */ traditional?: boolean; /** * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers. */ type?: string; /** * A string containing the URL to which the request is sent. */ url?: string; /** * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. */ username?: string; /** * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. */ xhr?: any; /** * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1) */ xhrFields?: { [key: string]: any; }; } /** * Interface for the jqXHR object */ interface JQueryXHR extends XMLHttpRequest, JQueryPromise { /** * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). */ overrideMimeType(mimeType: string): any; /** * Cancel the request. * * @param statusText - A string passed as the textStatus parameter for the done callback. Default value: "canceled" */ abort(statusText?: string): void; /** * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. */ then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise; /** * Property containing the parsed response if the response Content-Type is json */ responseJSON?: any; } /** * Interface for the JQuery callback */ interface JQueryCallback { /** * Add a callback or a collection of callbacks to a callback list. * * @param callbacks - A function, or array of functions, that are to be added to the callback list. */ add(callbacks: Function): JQueryCallback; /** * Add a callback or a collection of callbacks to a callback list. * * @param callbacks - A function, or array of functions, that are to be added to the callback list. */ add(callbacks: Function[]): JQueryCallback; /** * Disable a callback list from doing anything more. */ disable(): JQueryCallback; /** * Determine if the callbacks list has been disabled. */ disabled(): boolean; /** * Remove all of the callbacks from a list. */ empty(): JQueryCallback; /** * Call all of the callbacks with the given arguments * * @param arguments - The argument or list of arguments to pass back to the callback list. */ fire(...arguments: any[]): JQueryCallback; /** * Determine if the callbacks have already been called at least once. */ fired(): boolean; /** * Call all callbacks in a list with the given context and arguments. * * @param context - A reference to the context in which the callbacks in the list should be fired. * @param arguments - An argument, or array of arguments, to pass to the callbacks in the list. */ fireWith(context?: any, ...args: any[]): JQueryCallback; /** * Determine whether a supplied callback is in a list * * @param callback - The callback to search for. */ has(callback: Function): boolean; /** * Lock a callback list in its current state. */ lock(): JQueryCallback; /** * Determine if the callbacks list has been locked. */ locked(): boolean; /** * Remove a callback or a collection of callbacks from a callback list. * * @param callbacks - A function, or array of functions, that are to be removed from the callback list. */ remove(callbacks: Function): JQueryCallback; /** * Remove a callback or a collection of callbacks from a callback list. * * @param callbacks - A function, or array of functions, that are to be removed from the callback list. */ remove(callbacks: Function[]): JQueryCallback; } /** * Allows jQuery Promises to interop with non-jQuery promises */ interface JQueryGenericPromise { /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter - A function that is called when the Deferred is resolved. * @param failFilter - An optional function that is called when the Deferred is rejected. */ then(doneFilter: (value: T) => U, failFilter?: (reason: any) => U): JQueryGenericPromise; /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter - A function that is called when the Deferred is resolved. * @param failFilter - An optional function that is called when the Deferred is rejected. */ then(doneFilter: (value: T) => JQueryGenericPromise, failFilter?: (reason: any) => U): JQueryGenericPromise; /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter - A function that is called when the Deferred is resolved. * @param failFilter - An optional function that is called when the Deferred is rejected. */ then(doneFilter: (value: T) => U, failFilter?: (reason: any) => JQueryGenericPromise): JQueryGenericPromise; /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter - A function that is called when the Deferred is resolved. * @param failFilter - An optional function that is called when the Deferred is rejected. */ then(doneFilter: (value: T) => JQueryGenericPromise, failFilter?: (reason: any) => JQueryGenericPromise): JQueryGenericPromise; } /** * Interface for the JQuery promise/deferred callbacks */ interface JQueryPromiseCallback { (value?: T, ...args: any[]): void; } interface JQueryPromiseOperator { (callback: JQueryPromiseCallback, ...callbacks: JQueryPromiseCallback[]): JQueryPromise; (callback: JQueryPromiseCallback[], ...callbacks: JQueryPromiseCallback[]): JQueryPromise; } /** * Interface for the JQuery promise, part of callbacks */ interface JQueryPromise { /** * Add handlers to be called when the Deferred object is either resolved or rejected. * * @param alwaysCallbacks1 - A function, or array of functions, that is called when the Deferred is resolved or rejected. * @param alwaysCallbacks2 - Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. */ always: JQueryPromiseOperator; /** * Add handlers to be called when the Deferred object is resolved. * * @param doneCallbacks1 - A function, or array of functions, that are called when the Deferred is resolved. * @param doneCallbacks2 - Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. */ done: JQueryPromiseOperator; /** * Add handlers to be called when the Deferred object is rejected. * * @param failCallbacks1 - A function, or array of functions, that are called when the Deferred is rejected. * @param failCallbacks2 - Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. */ fail: JQueryPromiseOperator; /** * Add handlers to be called when the Deferred object generates progress notifications. * * @param progressCallbacks - A function, or array of functions, to be called when the Deferred generates progress notifications. */ progress(progressCallback: JQueryPromiseCallback): JQueryPromise; progress(progressCallbacks: JQueryPromiseCallback[]): JQueryPromise; /** * Determine the current state of a Deferred object. */ state(): string; // Deprecated - given no typings pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter - A function that is called when the Deferred is resolved. * @param failFilter - An optional function that is called when the Deferred is rejected. * @param progressFilter - An optional function that is called when progress notifications are sent to the Deferred. */ then(doneFilter: (value: T) => U, failFilter?: (...reasons: any[]) => U, progressFilter?: (...progression: any[]) => any): JQueryPromise; /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter - A function that is called when the Deferred is resolved. * @param failFilter - An optional function that is called when the Deferred is rejected. * @param progressFilter - An optional function that is called when progress notifications are sent to the Deferred. */ then(doneFilter: (value: T) => JQueryGenericPromise, failFilter?: (...reasons: any[]) => U, progressFilter?: (...progression: any[]) => any): JQueryPromise; /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter - A function that is called when the Deferred is resolved. * @param failFilter - An optional function that is called when the Deferred is rejected. * @param progressFilter - An optional function that is called when progress notifications are sent to the Deferred. */ then(doneFilter: (value: T) => U, failFilter?: (...reasons: any[]) => JQueryGenericPromise, progressFilter?: (...progression: any[]) => any): JQueryPromise; /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter - A function that is called when the Deferred is resolved. * @param failFilter - An optional function that is called when the Deferred is rejected. * @param progressFilter - An optional function that is called when progress notifications are sent to the Deferred. */ then(doneFilter: (value: T) => JQueryGenericPromise, failFilter?: (...reasons: any[]) => JQueryGenericPromise, progressFilter?: (...progression: any[]) => any): JQueryPromise; // Because JQuery Promises Suck /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter - A function that is called when the Deferred is resolved. * @param failFilter - An optional function that is called when the Deferred is rejected. * @param progressFilter - An optional function that is called when progress notifications are sent to the Deferred. */ then(doneFilter: (...values: any[]) => U, failFilter?: (...reasons: any[]) => U, progressFilter?: (...progression: any[]) => any): JQueryPromise; /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter - A function that is called when the Deferred is resolved. * @param failFilter - An optional function that is called when the Deferred is rejected. * @param progressFilter - An optional function that is called when progress notifications are sent to the Deferred. */ then(doneFilter: (...values: any[]) => JQueryGenericPromise, failFilter?: (...reasons: any[]) => U, progressFilter?: (...progression: any[]) => any): JQueryPromise; /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter - A function that is called when the Deferred is resolved. * @param failFilter - An optional function that is called when the Deferred is rejected. * @param progressFilter - An optional function that is called when progress notifications are sent to the Deferred. */ then(doneFilter: (...values: any[]) => U, failFilter?: (...reasons: any[]) => JQueryGenericPromise, progressFilter?: (...progression: any[]) => any): JQueryPromise; /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter - A function that is called when the Deferred is resolved. * @param failFilter - An optional function that is called when the Deferred is rejected. * @param progressFilter - An optional function that is called when progress notifications are sent to the Deferred. */ then(doneFilter: (...values: any[]) => JQueryGenericPromise, failFilter?: (...reasons: any[]) => JQueryGenericPromise, progressFilter?: (...progression: any[]) => any): JQueryPromise; } /** * Interface for the JQuery deferred, part of callbacks */ interface JQueryDeferred extends JQueryPromise { /** * Add handlers to be called when the Deferred object is either resolved or rejected. * * @param alwaysCallbacks1 - A function, or array of functions, that is called when the Deferred is resolved or rejected. * @param alwaysCallbacks2 - Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. */ always(alwaysCallbacks1?: JQueryPromiseCallback, ...alwaysCallbacks2: JQueryPromiseCallback[]): JQueryDeferred; always(alwaysCallbacks1?: JQueryPromiseCallback[], ...alwaysCallbacks2: JQueryPromiseCallback[]): JQueryDeferred; always(alwaysCallbacks1?: JQueryPromiseCallback, ...alwaysCallbacks2: any[]): JQueryDeferred; always(alwaysCallbacks1?: JQueryPromiseCallback[], ...alwaysCallbacks2: any[]): JQueryDeferred; /** * Add handlers to be called when the Deferred object is resolved. * * @param doneCallbacks1 - A function, or array of functions, that are called when the Deferred is resolved. * @param doneCallbacks2 - Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. */ done(doneCallbacks1?: JQueryPromiseCallback, ...doneCallbacks2: JQueryPromiseCallback[]): JQueryDeferred; done(doneCallbacks1?: JQueryPromiseCallback[], ...doneCallbacks2: JQueryPromiseCallback[]): JQueryDeferred; done(doneCallbacks1?: JQueryPromiseCallback, ...doneCallbacks2: any[]): JQueryDeferred; done(doneCallbacks1?: JQueryPromiseCallback[], ...doneCallbacks2: any[]): JQueryDeferred; /** * Add handlers to be called when the Deferred object is rejected. * * @param failCallbacks1 - A function, or array of functions, that are called when the Deferred is rejected. * @param failCallbacks2 - Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. */ fail(failCallbacks1?: JQueryPromiseCallback, ...failCallbacks2: JQueryPromiseCallback[]): JQueryDeferred; fail(failCallbacks1?: JQueryPromiseCallback[], ...failCallbacks2: JQueryPromiseCallback[]): JQueryDeferred; fail(failCallbacks1?: JQueryPromiseCallback, ...failCallbacks2: any[]): JQueryDeferred; fail(failCallbacks1?: JQueryPromiseCallback[], ...failCallbacks2: any[]): JQueryDeferred; /** * Add handlers to be called when the Deferred object generates progress notifications. * * @param progressCallbacks - A function, or array of functions, to be called when the Deferred generates progress notifications. */ progress(progressCallback: JQueryPromiseCallback): JQueryDeferred; progress(progressCallbacks: JQueryPromiseCallback[]): JQueryDeferred; /** * Call the progressCallbacks on a Deferred object with the given args. * * @param args - Optional arguments that are passed to the progressCallbacks. */ notify(...args: any[]): JQueryDeferred; /** * Call the progressCallbacks on a Deferred object with the given context and args. * * @param context - Context passed to the progressCallbacks as the this object. * @param args - Optional arguments that are passed to the progressCallbacks. */ notifyWith(context: any, ...args: any[]): JQueryDeferred; /** * Reject a Deferred object and call any failCallbacks with the given args. * * @param args - Optional arguments that are passed to the failCallbacks. */ reject(...args: any[]): JQueryDeferred; /** * Reject a Deferred object and call any failCallbacks with the given context and args. * * @param context - Context passed to the failCallbacks as the this object. * @param args - An optional array of arguments that are passed to the failCallbacks. */ rejectWith(context: any, ...args: any[]): JQueryDeferred; /** * Resolve a Deferred object and call any doneCallbacks with the given args. * * @param value - First argument passed to doneCallbacks. * @param args - Optional subsequent arguments that are passed to the doneCallbacks. */ resolve(value?: T, ...args: any[]): JQueryDeferred; /** * Resolve a Deferred object and call any doneCallbacks with the given context and args. * * @param context - Context passed to the doneCallbacks as the this object. * @param args - An optional array of arguments that are passed to the doneCallbacks. */ resolveWith(context: any, ...args: any[]): JQueryDeferred; /** * Return a Deferred's Promise object. * * @param target - Object onto which the promise methods have to be attached */ promise(target?: any): JQueryPromise; } /** * Interface of the JQuery extension of the W3C event object */ interface BaseJQueryEventObject extends Event { data: any; delegateTarget: Element; isDefaultPrevented(): boolean; isImmediatePropagationStopped(): boolean; isPropagationStopped(): boolean; namespace: string; originalEvent: Event; preventDefault(): any; relatedTarget: Element; result: any; stopImmediatePropagation(): void; stopPropagation(): void; pageX: number; pageY: number; which: number; metaKey: boolean; } interface JQueryInputEventObject extends BaseJQueryEventObject { altKey: boolean; ctrlKey: boolean; metaKey: boolean; shiftKey: boolean; } interface JQueryMouseEventObject extends JQueryInputEventObject { button: number; clientX: number; clientY: number; offsetX: number; offsetY: number; pageX: number; pageY: number; screenX: number; screenY: number; } interface JQueryKeyEventObject extends JQueryInputEventObject { char: any; charCode: number; key: any; keyCode: number; } interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { } /* Collection of properties of the current browser */ interface JQuerySupport { ajax?: boolean; boxModel?: boolean; changeBubbles?: boolean; checkClone?: boolean; checkOn?: boolean; cors?: boolean; cssFloat?: boolean; hrefNormalized?: boolean; htmlSerialize?: boolean; leadingWhitespace?: boolean; noCloneChecked?: boolean; noCloneEvent?: boolean; opacity?: boolean; optDisabled?: boolean; optSelected?: boolean; scriptEval? (): boolean; style?: boolean; submitBubbles?: boolean; tbody?: boolean; } interface JQueryParam { /** * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. * * @param obj - An array or object to serialize. */ (obj: any): string; /** * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. * * @param obj - An array or object to serialize. * @param traditional - A Boolean indicating whether to perform a traditional "shallow" serialization. */ (obj: any, traditional: boolean): string; } /** * The interface used to construct jQuery events (with $.Event). It is * defined separately instead of inline in JQueryStatic to allow * overriding the construction function with specific strings * returning specific event objects. */ interface JQueryEventConstructor { (name: string, eventProperties?: any): JQueryEventObject; new (name: string, eventProperties?: any): JQueryEventObject; } /** * The interface used to specify coordinates. */ interface JQueryCoordinates { left: number; top: number; } interface JQueryAnimationOptions { /** * A string or number determining how long the animation will run. */ duration?: any; /** * A string indicating which easing function to use for the transition. */ easing?: string; /** * A function to call once the animation is complete. */ complete?: Function; /** * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. */ step?: (now: number, tween: any) => any; /** * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) */ progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any; /** * A function to call when the animation begins. (version added: 1.8) */ start?: (animation: JQueryPromise) => any; /** * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) */ done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; /** * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) */ fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; /** * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) */ always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; /** * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. */ queue?: any; /** * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) */ specialEasing?: Object; } /** * Static members of jQuery (those on $ and jQuery themselves) */ interface JQueryStatic { /** * Perform an asynchronous HTTP (Ajax) request. * * @param settings - A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). */ ajax(settings: JQueryAjaxSettings): JQueryXHR; /** * Perform an asynchronous HTTP (Ajax) request. * * @param url - A string containing the URL to which the request is sent. * @param settings - A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). */ ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR; /** * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). * * @param dataTypes - An optional string containing one or more space-separated dataTypes * @param handler - A handler to set default values for future Ajax requests. */ ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; /** * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). * * @param handler - A handler to set default values for future Ajax requests. */ ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; ajaxSettings: JQueryAjaxSettings; /** * Set default values for future Ajax requests. Its use is not recommended. * * @param options - A set of key/value pairs that configure the default Ajax request. All options are optional. */ ajaxSetup(options: JQueryAjaxSettings): void; /** * Load data from the server using a HTTP GET request. * * @param url - A string containing the URL to which the request is sent. * @param success - A callback function that is executed if the request succeeds. * @param dataType - The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). */ get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * Load data from the server using a HTTP GET request. * * @param url - A string containing the URL to which the request is sent. * @param data - A plain object or string that is sent to the server with the request. * @param success - A callback function that is executed if the request succeeds. * @param dataType - The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). */ get(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * Load data from the server using a HTTP GET request. * * @param url - A string containing the URL to which the request is sent. * @param data - A plain object or string that is sent to the server with the request. * @param success - A callback function that is executed if the request succeeds. * @param dataType - The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). */ get(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * Load JSON-encoded data from the server using a GET HTTP request. * * @param url - A string containing the URL to which the request is sent. * @param success - A callback function that is executed if the request succeeds. */ getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; /** * Load JSON-encoded data from the server using a GET HTTP request. * * @param url - A string containing the URL to which the request is sent. * @param data - A plain object or string that is sent to the server with the request. * @param success - A callback function that is executed if the request succeeds. */ getJSON(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; /** * Load JSON-encoded data from the server using a GET HTTP request. * * @param url - A string containing the URL to which the request is sent. * @param data - A plain object or string that is sent to the server with the request. * @param success - A callback function that is executed if the request succeeds. */ getJSON(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; /** * Load a JavaScript file from the server using a GET HTTP request, then execute it. * * @param url - A string containing the URL to which the request is sent. * @param success - A callback function that is executed if the request succeeds. */ getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; /** * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. */ param: JQueryParam; /** * Load data from the server using a HTTP POST request. * * @param url - A string containing the URL to which the request is sent. * @param success - A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. * @param dataType - The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). */ post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * Load data from the server using a HTTP POST request. * * @param url - A string containing the URL to which the request is sent. * @param data - A plain object or string that is sent to the server with the request. * @param success - A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. * @param dataType - The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). */ post(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * Load data from the server using a HTTP POST request. * * @param url - A string containing the URL to which the request is sent. * @param data - A plain object or string that is sent to the server with the request. * @param success - A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. * @param dataType - The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). */ post(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. * * @param flags - An optional list of space-separated flags that change how the callback list behaves. */ Callbacks(flags?: string): JQueryCallback; /** * Holds or releases the execution of jQuery's ready event. * * @param hold - Indicates whether the ready hold is being requested or released */ holdReady(hold: boolean): void; /** * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param selector - A string containing a selector expression * @param context - A DOM Element, Document, or jQuery to use as context */ (selector: string, context?: Element): JQuery; /** * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param selector - A string containing a selector expression * @param context - A DOM Element, Document, or jQuery to use as context */ (selector: string, context?: JQuery): JQuery; /** * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param element - A DOM element to wrap in a jQuery object. */ (element: Element): JQuery; /** * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param elementArray - An array containing a set of DOM elements to wrap in a jQuery object. */ (elementArray: Element[]): JQuery; /** * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param object - A plain object to wrap in a jQuery object. */ (object: {}): JQuery; /** * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param object - An existing jQuery object to clone. */ (object: JQuery): JQuery; /** * Specify a function to execute when the DOM is fully loaded. */ (): JQuery; /** * Creates DOM elements on the fly from the provided string of raw HTML. * * @param html - A string of HTML to create on the fly. Note that this parses HTML, not XML. * @param ownerDocument - A document in which the new elements will be created. */ (html: string, ownerDocument?: Document): JQuery; /** * Creates DOM elements on the fly from the provided string of raw HTML. * * @param html - A string defining a single, standalone, HTML element (e.g.
    or
    ). * @param attributes - An object of attributes, events, and methods to call on the newly-created element. */ (html: string, attributes: Object): JQuery; /** * Binds a function to be executed when the DOM has finished loading. * * @param callback - A function to execute after the DOM is ready. */ (callback: Function): JQuery; /** * Relinquish jQuery's control of the $ variable. * * @param removeAll - A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). */ noConflict(removeAll?: boolean): Object; /** * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. * * @param deferreds - One or more Deferred objects, or plain JavaScript objects. */ when(...deferreds: JQueryGenericPromise[]): JQueryPromise; /** * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. * * @param deferreds - One or more Deferred objects, or plain JavaScript objects. */ when(...deferreds: T[]): JQueryPromise; /** * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. * * @param deferreds - One or more Deferred objects, or plain JavaScript objects. */ when(...deferreds: any[]): JQueryPromise; /** * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. */ cssHooks: { [key: string]: any; }; cssNumber: any; /** * Store arbitrary data associated with the specified element. Returns the value that was set. * * @param element - The DOM element to associate with the data. * @param key - A string naming the piece of data to set. * @param value - The new data value. */ data(element: Element, key: string, value: T): T; /** * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. * * @param element - The DOM element to associate with the data. * @param key - A string naming the piece of data to set. */ data(element: Element, key: string): any; /** * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. * * @param element - The DOM element to associate with the data. */ data(element: Element): any; /** * Execute the next function on the queue for the matched element. * * @param element - A DOM element from which to remove and execute a queued function. * @param queueName - A string containing the name of the queue. Defaults to fx, the standard effects queue. */ dequeue(element: Element, queueName?: string): void; /** * Determine whether an element has any jQuery data associated with it. * * @param element - A DOM element to be checked for data. */ hasData(element: Element): boolean; /** * Show the queue of functions to be executed on the matched element. * * @param element - A DOM element to inspect for an attached queue. * @param queueName - A string containing the name of the queue. Defaults to fx, the standard effects queue. */ queue(element: Element, queueName?: string): any[]; /** * Manipulate the queue of functions to be executed on the matched element. * * @param element - A DOM element where the array of queued functions is attached. * @param queueName - A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param newQueue - An array of functions to replace the current queue contents. */ queue(element: Element, queueName: string, newQueue: Function[]): JQuery; /** * Manipulate the queue of functions to be executed on the matched element. * * @param element - A DOM element on which to add a queued function. * @param queueName - A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param callback - The new function to add to the queue. */ queue(element: Element, queueName: string, callback: Function): JQuery; /** * Remove a previously-stored piece of data. * * @param element - A DOM element from which to remove data. * @param name - A string naming the piece of data to remove. */ removeData(element: Element, name?: string): JQuery; /** * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. * * @param beforeStart - A function that is called just before the constructor returns. */ Deferred(beforeStart?: (deferred: JQueryDeferred) => any): JQueryDeferred; /** * Effects */ fx: { tick: () => void; /** * The rate (in milliseconds) at which animations fire. */ interval: number; stop: () => void; speeds: { slow: number; fast: number; }; /** * Globally disable all animations. */ off: boolean; step: any; }; /** * Takes a function and returns a new one that will always have a particular context. * * @param fnction - The function whose context will be changed. * @param context - The object to which the context (this) of the function should be set. * @param additionalArguments - Any number of arguments to be passed to the function referenced in the function argument. */ proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any; /** * Takes a function and returns a new one that will always have a particular context. * * @param context - The object to which the context (this) of the function should be set. * @param name - The name of the function whose context will be changed (should be a property of the context object). * @param additionalArguments - Any number of arguments to be passed to the function named in the name argument. */ proxy(context: Object, name: string, ...additionalArguments: any[]): any; Event: JQueryEventConstructor; /** * Takes a string and throws an exception containing it. * * @param message - The message to send out. */ error(message: any): JQuery; expr: any; fn: any; //TODO: Decide how we want to type this isReady: boolean; // Properties support: JQuerySupport; /** * Check to see if a DOM element is a descendant of another DOM element. * * @param container - The DOM element that may contain the other element. * @param contained - The DOM element that may be contained by (a descendant of) the other element. */ contains(container: Element, contained: Element): boolean; /** * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. * * @param collection - The object or array to iterate over. * @param callback - The function that will be executed on every object. */ each( collection: T[], callback: (indexInArray: number, valueOfElement: T) => any ): any; /** * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. * * @param collection - The object or array to iterate over. * @param callback - The function that will be executed on every object. */ each( collection: any, callback: (indexInArray: any, valueOfElement: any) => any ): any; /** * Merge the contents of two or more objects together into the first object. * * @param target - An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. * @param object1 - An object containing additional properties to merge in. * @param objectN - Additional objects containing properties to merge in. */ extend(target: any, object1?: any, ...objectN: any[]): any; /** * Merge the contents of two or more objects together into the first object. * * @param deep - If true, the merge becomes recursive (aka. deep copy). * @param target - The object to extend. It will receive the new properties. * @param object1 - An object containing additional properties to merge in. * @param objectN - Additional objects containing properties to merge in. */ extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any; /** * Execute some JavaScript code globally. * * @param code - The JavaScript code to execute. */ globalEval(code: string): any; /** * Finds the elements of an array which satisfy a filter function. The original array is not affected. * * @param array - The array to search through. * @param func - The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. * @param invert - If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false. */ grep(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[]; /** * Search for a specified value within an array and return its index (or -1 if not found). * * @param value - The value to search for. * @param array - An array through which to search. * @param fromIndex - he index of the array at which to begin the search. The default is 0, which will search the whole array. */ inArray(value: T, array: T[], fromIndex?: number): number; /** * Determine whether the argument is an array. * * @param obj - Object to test whether or not it is an array. */ isArray(obj: any): boolean; /** * Check to see if an object is empty (contains no enumerable properties). * * @param obj - The object that will be checked to see if it's empty. */ isEmptyObject(obj: any): boolean; /** * Determine if the argument passed is a Javascript function object. * * @param obj - Object to test whether or not it is a function. */ isFunction(obj: any): boolean; /** * Determines whether its argument is a number. * * @param obj - The value to be tested. */ isNumeric(value: any): boolean; /** * Check to see if an object is a plain object (created using "{}" or "new Object"). * * @param obj - The object that will be checked to see if it's a plain object. */ isPlainObject(obj: any): boolean; /** * Determine whether the argument is a window. * * @param obj - Object to test whether or not it is a window. */ isWindow(obj: any): boolean; /** * Check to see if a DOM node is within an XML document (or is an XML document). * * @param node - he DOM node that will be checked to see if it's in an XML document. */ isXMLDoc(node: Node): boolean; /** * Convert an array-like object into a true JavaScript array. * * @param obj - Any object to turn into a native Array. */ makeArray(obj: any): any[]; /** * Translate all items in an array or object to new array of items. * * @param array - The Array to translate. * @param callback - The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. */ map(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[]; /** * Translate all items in an array or object to new array of items. * * @param arrayOrObject - The Array or Object to translate. * @param callback - The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. */ map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any; /** * Merge the contents of two arrays together into the first array. * * @param first - The first array to merge, the elements of second added. * @param second - The second array to merge into the first, unaltered. */ merge(first: T[], second: T[]): T[]; /** * An empty function. */ noop(): any; /** * Return a number representing the current time. */ now(): number; /** * Takes a well-formed JSON string and returns the resulting JavaScript object. * * @param json - The JSON string to parse. */ parseJSON(json: string): any; /** * Parses a string into an XML document. * * @param data - a well-formed XML string to be parsed */ parseXML(data: string): XMLDocument; /** * Remove the whitespace from the beginning and end of a string. * * @param str - Remove the whitespace from the beginning and end of a string. */ trim(str: string): string; /** * Determine the internal JavaScript [[Class]] of an object. * * @param obj - Object to get the internal JavaScript [[Class]] of. */ type(obj: any): string; /** * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. * * @param array - The Array of DOM elements. */ unique(array: Element[]): Element[]; /** * Parses a string into an array of DOM nodes. * * @param data - HTML string to be parsed * @param context - DOM element to serve as the context in which the HTML fragment will be created * @param keepScripts - A Boolean indicating whether to include scripts passed in the HTML string */ parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; /** * Parses a string into an array of DOM nodes. * * @param data - HTML string to be parsed * @param context - DOM element to serve as the context in which the HTML fragment will be created * @param keepScripts - A Boolean indicating whether to include scripts passed in the HTML string */ parseHTML(data: string, context?: Document, keepScripts?: boolean): any[]; } /** * The jQuery instance members */ interface JQuery { /** * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. * * @param handler - The function to be invoked. */ ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery; /** * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. * * @param handler - The function to be invoked. */ ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery; /** * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. * * @param handler - The function to be invoked. */ ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery; /** * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. * * @param handler - The function to be invoked. */ ajaxStart(handler: () => any): JQuery; /** * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. * * @param handler - The function to be invoked. */ ajaxStop(handler: () => any): JQuery; /** * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. * * @param handler - The function to be invoked. */ ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery; /** * Load data from the server and place the returned HTML into the matched element. * * @param url - A string containing the URL to which the request is sent. * @param data - A plain object or string that is sent to the server with the request. * @param complete - A callback function that is executed when the request completes. */ load(url: string, data?: string, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; /** * Load data from the server and place the returned HTML into the matched element. * * @param url - A string containing the URL to which the request is sent. * @param data - A plain object or string that is sent to the server with the request. * @param complete - A callback function that is executed when the request completes. */ load(url: string, data?: Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; /** * Encode a set of form elements as a string for submission. */ serialize(): string; /** * Encode a set of form elements as an array of names and values. */ serializeArray(): Object[]; /** * Adds the specified class(es) to each of the set of matched elements. * * @param className - One or more space-separated classes to be added to the class attribute of each matched element. */ addClass(className: string): JQuery; /** * Adds the specified class(es) to each of the set of matched elements. * * @param function - A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. */ addClass(func: (index: number, className: string) => string): JQuery; /** * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. */ addBack(selector?: string): JQuery; /** * Get the value of an attribute for the first element in the set of matched elements. * * @param attributeName - The name of the attribute to get. */ attr(attributeName: string): string; /** * Set one or more attributes for the set of matched elements. * * @param attributeName - The name of the attribute to set. * @param value - A value to set for the attribute. */ attr(attributeName: string, value: string): JQuery; /** * Set one or more attributes for the set of matched elements. * * @param attributeName - The name of the attribute to set. * @param value - A value to set for the attribute. */ attr(attributeName: string, value: number): JQuery; /** * Set one or more attributes for the set of matched elements. * * @param attributeName - The name of the attribute to set. * @param func - A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. */ attr(attributeName: string, func: (index: number, attr: any) => any): JQuery; /** * Set one or more attributes for the set of matched elements. * * @param attributes - An object of attribute-value pairs to set. */ attr(attributes: Object): JQuery; /** * Determine whether any of the matched elements are assigned the given class. * * @param className - The class name to search for. */ hasClass(className: string): boolean; /** * Get the HTML contents of the first element in the set of matched elements. */ html(): string; /** * Set the HTML contents of each element in the set of matched elements. * * @param htmlString - A string of HTML to set as the content of each matched element. */ html(htmlString: string): JQuery; /** * Set the HTML contents of each element in the set of matched elements. * * @param func - A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. */ html(func: (index: number, oldhtml: string) => string): JQuery; /** * Set the HTML contents of each element in the set of matched elements. * * @param func - A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. */ /** * Get the value of a property for the first element in the set of matched elements. * * @param propertyName - The name of the property to get. */ prop(propertyName: string): any; /** * Set one or more properties for the set of matched elements. * * @param propertyName - The name of the property to set. * @param value - A value to set for the property. */ prop(propertyName: string, value: string): JQuery; /** * Set one or more properties for the set of matched elements. * * @param propertyName - The name of the property to set. * @param value - A value to set for the property. */ prop(propertyName: string, value: number): JQuery; /** * Set one or more properties for the set of matched elements. * * @param propertyName - The name of the property to set. * @param value - A value to set for the property. */ prop(propertyName: string, value: boolean): JQuery; /** * Set one or more properties for the set of matched elements. * * @param properties - An object of property-value pairs to set. */ prop(properties: Object): JQuery; /** * Set one or more properties for the set of matched elements. * * @param propertyName - The name of the property to set. * @param func - A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. */ prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery; /** * Remove an attribute from each element in the set of matched elements. * * @param attributeName - An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. */ removeAttr(attributeName: string): JQuery; /** * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. * * @param className - One or more space-separated classes to be removed from the class attribute of each matched element. */ removeClass(className?: string): JQuery; /** * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. * * @param function - A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. */ removeClass(func: (index: number, className: string) => string): JQuery; /** * Remove a property for the set of matched elements. * * @param propertyName - The name of the property to remove. */ removeProp(propertyName: string): JQuery; /** * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. * * @param className - One or more class names (separated by spaces) to be toggled for each element in the matched set. * @param swtch - A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. */ toggleClass(className: string, swtch?: boolean): JQuery; /** * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. * * @param swtch - A boolean value to determine whether the class should be added or removed. */ toggleClass(swtch?: boolean): JQuery; /** * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. * * @param func - A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. * @param swtch - A boolean value to determine whether the class should be added or removed. */ toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery; /** * Get the current value of the first element in the set of matched elements. */ val(): any; /** * Set the value of each element in the set of matched elements. * * @param value - A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. */ val(value: string): JQuery; /** * Set the value of each element in the set of matched elements. * * @param value - A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. */ val(value: string[]): JQuery; /** * Set the value of each element in the set of matched elements. * * @param func - A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */ val(func: (index: number, value: string) => string): JQuery; /** * Set the value of each element in the set of matched elements. * * @param func - A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */ val(func: (index: number, value: string[]) => string): JQuery; /** * Set the value of each element in the set of matched elements. * * @param func - A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */ val(func: (index: number, value: number) => string): JQuery; /** * Set the value of each element in the set of matched elements. * * @param func - A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */ val(func: (index: number, value: string) => string[]): JQuery; /** * Set the value of each element in the set of matched elements. * * @param func - A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */ val(func: (index: number, value: string[]) => string[]): JQuery; /** * Set the value of each element in the set of matched elements. * * @param func - A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */ val(func: (index: number, value: number) => string[]): JQuery; /** * Get the value of style properties for the first element in the set of matched elements. * * @param propertyName - A CSS property. */ css(propertyName: string): string; /** * Set one or more CSS properties for the set of matched elements. * * @param propertyName - A CSS property name. * @param value - A value to set for the property. */ css(propertyName: string, value: string): JQuery; /** * Set one or more CSS properties for the set of matched elements. * * @param propertyName - A CSS property name. * @param value - A value to set for the property. */ css(propertyName: string, value: number): JQuery; /** * Set one or more CSS properties for the set of matched elements. * * @param propertyName - A CSS property name. * @param value - A value to set for the property. */ css(propertyName: string, value: string[]): JQuery; /** * Set one or more CSS properties for the set of matched elements. * * @param propertyName - A CSS property name. * @param value - A value to set for the property. */ css(propertyName: string, value: number[]): JQuery; /** * Set one or more CSS properties for the set of matched elements. * * @param propertyName - A CSS property name. * @param value - A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */ css(propertyName: string, value: (index: number, value: string) => string): JQuery; /** * Set one or more CSS properties for the set of matched elements. * * @param propertyName - A CSS property name. * @param value - A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */ css(propertyName: string, value: (index: number, value: number) => number): JQuery; /** * Set one or more CSS properties for the set of matched elements. * * @param properties - An object of property-value pairs to set. */ css(properties: Object): JQuery; /** * Get the current computed height for the first element in the set of matched elements. */ height(): number; /** * Set the CSS height of every matched element. * * @param value - An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). */ height(value: number): JQuery; /** * Set the CSS height of every matched element. * * @param value - An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). */ height(value: string): JQuery; /** * Set the CSS height of every matched element. * * @param func - A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. */ height(func: (index: number, height: number) => number): JQuery; /** * Set the CSS height of every matched element. * * @param func - A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. */ height(func: (index: number, height: string) => string): JQuery; /** * Set the CSS height of every matched element. * * @param func - A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. */ height(func: (index: number, height: string) => number): JQuery; /** * Set the CSS height of every matched element. * * @param func - A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. */ height(func: (index: number, height: number) => string): JQuery; /** * Get the current computed height for the first element in the set of matched elements, including padding but not border. */ innerHeight(): number; /** * Sets the inner height on elements in the set of matched elements, including padding but not border. * * @param value - An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ innerHeight(height: number): JQuery; /** * Sets the inner height on elements in the set of matched elements, including padding but not border. * * @param value - An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ innerHeight(height: string): JQuery; /** * Get the current computed width for the first element in the set of matched elements, including padding but not border. */ innerWidth(): number; /** * Sets the inner width on elements in the set of matched elements, including padding but not border. * * @param value - An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ innerWidth(width: number): JQuery; /** * Sets the inner width on elements in the set of matched elements, including padding but not border. * * @param value - An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ innerWidth(width: string): JQuery; /** * Get the current coordinates of the first element in the set of matched elements, relative to the document. */ offset(): JQueryCoordinates; /** * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. * * @param coordinates - An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. */ offset(coordinates: JQueryCoordinates): JQuery; /** * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. * * @param func - A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. */ offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery; /** * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. * * @param includeMargin - A Boolean indicating whether to include the element's margin in the calculation. */ outerHeight(includeMargin?: boolean): number; /** * Sets the outer height on elements in the set of matched elements, including padding and border. * * @param value - An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ outerHeight(height: number): JQuery; /** * Sets the outer height on elements in the set of matched elements, including padding and border. * * @param value - An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ outerHeight(height: string): JQuery; /** * Get the current computed width for the first element in the set of matched elements, including padding and border. * * @param includeMargin - A Boolean indicating whether to include the element's margin in the calculation. */ outerWidth(includeMargin?: boolean): number; /** * Sets the outer width on elements in the set of matched elements, including padding and border. * * @param value - An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ outerWidth(width: number): JQuery; /** * Sets the outer width on elements in the set of matched elements, including padding and border. * * @param value - An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ outerWidth(width: string): JQuery; /** * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. */ position(): JQueryCoordinates; /** * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element. */ scrollLeft(): number; /** * Set the current horizontal position of the scroll bar for each of the set of matched elements. * * @param value - An integer indicating the new position to set the scroll bar to. */ scrollLeft(value: number): JQuery; /** * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. */ scrollTop(): number; /** * Set the current vertical position of the scroll bar for each of the set of matched elements. * * @param value - An integer indicating the new position to set the scroll bar to. */ scrollTop(value: number): JQuery; /** * Get the current computed width for the first element in the set of matched elements. */ width(): number; /** * Set the CSS width of each element in the set of matched elements. * * @param value - An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ width(value: number): JQuery; /** * Set the CSS width of each element in the set of matched elements. * * @param value - An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ width(value: string): JQuery; /** * Set the CSS width of each element in the set of matched elements. * * @param func - A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. */ width(func: (index: number, width: number) => number): JQuery; /** * Set the CSS width of each element in the set of matched elements. * * @param func - A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. */ width(func: (index: number, width: string) => string): JQuery; /** * Set the CSS width of each element in the set of matched elements. * * @param func - A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. */ width(func: (index: number, width: string) => number): JQuery; /** * Set the CSS width of each element in the set of matched elements. * * @param func - A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. */ width(func: (index: number, width: number) => string): JQuery; /** * Remove from the queue all items that have not yet been run. * * @param queueName - A string containing the name of the queue. Defaults to fx, the standard effects queue. */ clearQueue(queueName?: string): JQuery; /** * Store arbitrary data associated with the matched elements. * * @param key - A string naming the piece of data to set. * @param value - The new data value; it can be any Javascript type including Array or Object. */ data(key: string, value: any): JQuery; /** * Store arbitrary data associated with the matched elements. * * @param obj - An object of key-value pairs of data to update. */ data(obj: { [key: string]: any; }): JQuery; /** * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. * * @param key - Name of the data stored. */ data(key: string): any; /** * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. */ data(): any; /** * Execute the next function on the queue for the matched elements. * * @param queueName - A string containing the name of the queue. Defaults to fx, the standard effects queue. */ dequeue(queueName?: string): JQuery; /** * Remove a previously-stored piece of data. * * @param name - A string naming the piece of data to delete or space-separated string naming the pieces of data to delete. */ removeData(name: string): JQuery; /** * Remove a previously-stored piece of data. * * @param list - An array of strings naming the pieces of data to delete. */ removeData(list: string[]): JQuery; /** * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. * * @param type - The type of queue that needs to be observed. (default: fx) * @param target - Object onto which the promise methods have to be attached */ promise(type?: string, target?: Object): JQueryPromise; /** * Perform a custom animation of a set of CSS properties. * * @param properties - An object of CSS properties and values that the animation will move toward. * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ animate(properties: Object, duration?: string, complete?: Function): JQuery; /** * Perform a custom animation of a set of CSS properties. * * @param properties - An object of CSS properties and values that the animation will move toward. * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ animate(properties: Object, duration?: number, complete?: Function): JQuery; /** * Perform a custom animation of a set of CSS properties. * * @param properties - An object of CSS properties and values that the animation will move toward. * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. (default: swing) * @param complete - A function to call once the animation is complete. */ animate(properties: Object, duration?: string, easing?: string, complete?: Function): JQuery; /** * Perform a custom animation of a set of CSS properties. * * @param properties - An object of CSS properties and values that the animation will move toward. * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. (default: swing) * @param complete - A function to call once the animation is complete. */ animate(properties: Object, duration?: number, easing?: string, complete?: Function): JQuery; /** * Perform a custom animation of a set of CSS properties. * * @param properties - An object of CSS properties and values that the animation will move toward. * @param options - A map of additional options to pass to the method. */ animate(properties: Object, options: JQueryAnimationOptions): JQuery; /** * Set a timer to delay execution of subsequent items in the queue. * * @param duration - An integer indicating the number of milliseconds to delay execution of the next item in the queue. * @param queueName - A string containing the name of the queue. Defaults to fx, the standard effects queue. */ delay(duration: number, queueName?: string): JQuery; /** * Display the matched elements by fading them to opaque. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ fadeIn(duration?: number, complete?: Function): JQuery; /** * Display the matched elements by fading them to opaque. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ fadeIn(duration?: string, complete?: Function): JQuery; /** * Display the matched elements by fading them to opaque. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ fadeIn(duration?: number, easing?: string, complete?: Function): JQuery; /** * Display the matched elements by fading them to opaque. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ fadeIn(duration?: string, easing?: string, complete?: Function): JQuery; /** * Display the matched elements by fading them to opaque. * * @param options - A map of additional options to pass to the method. */ fadeIn(options: JQueryAnimationOptions): JQuery; /** * Hide the matched elements by fading them to transparent. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ fadeOut(duration?: number, complete?: Function): JQuery; /** * Hide the matched elements by fading them to transparent. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ fadeOut(duration?: string, complete?: Function): JQuery; /** * Hide the matched elements by fading them to transparent. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ fadeOut(duration?: number, easing?: string, complete?: Function): JQuery; /** * Hide the matched elements by fading them to transparent. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ fadeOut(duration?: string, easing?: string, complete?: Function): JQuery; /** * Hide the matched elements by fading them to transparent. * * @param options - A map of additional options to pass to the method. */ fadeOut(options: JQueryAnimationOptions): JQuery; /** * Adjust the opacity of the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param opacity - A number between 0 and 1 denoting the target opacity. * @param complete - A function to call once the animation is complete. */ fadeTo(duration: string, opacity: number, complete?: Function): JQuery; /** * Adjust the opacity of the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param opacity - A number between 0 and 1 denoting the target opacity. * @param complete - A function to call once the animation is complete. */ fadeTo(duration: number, opacity: number, complete?: Function): JQuery; /** * Adjust the opacity of the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param opacity - A number between 0 and 1 denoting the target opacity. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ fadeTo(duration: string, opacity: number, easing?: string, complete?: Function): JQuery; /** * Adjust the opacity of the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param opacity - A number between 0 and 1 denoting the target opacity. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ fadeTo(duration: number, opacity: number, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements by animating their opacity. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ fadeToggle(duration?: number, complete?: Function): JQuery; /** * Display or hide the matched elements by animating their opacity. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ fadeToggle(duration?: string, complete?: Function): JQuery; /** * Display or hide the matched elements by animating their opacity. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ fadeToggle(duration?: number, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements by animating their opacity. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ fadeToggle(duration?: string, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements by animating their opacity. * * @param options - A map of additional options to pass to the method. */ fadeToggle(options: JQueryAnimationOptions): JQuery; /** * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. * * @param queue - The name of the queue in which to stop animations. */ finish(queue?: string): JQuery; /** * Hide the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ hide(duration?: number, complete?: Function): JQuery; /** * Hide the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ hide(duration?: string, complete?: Function): JQuery; /** * Hide the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ hide(duration?: number, easing?: string, complete?: Function): JQuery; /** * Hide the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ hide(duration?: string, easing?: string, complete?: Function): JQuery; /** * Hide the matched elements. * * @param options - A map of additional options to pass to the method. */ hide(options: JQueryAnimationOptions): JQuery; /** * Display the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ show(duration?: number, complete?: Function): JQuery; /** * Display the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ show(duration?: string, complete?: Function): JQuery; /** * Display the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ show(duration?: number, easing?: string, complete?: Function): JQuery; /** * Display the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ show(duration?: string, easing?: string, complete?: Function): JQuery; /** * Display the matched elements. * * @param options - A map of additional options to pass to the method. */ show(options: JQueryAnimationOptions): JQuery; /** * Display the matched elements with a sliding motion. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ slideDown(duration?: number, complete?: Function): JQuery; /** * Display the matched elements with a sliding motion. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ slideDown(duration?: string, complete?: Function): JQuery; /** * Display the matched elements with a sliding motion. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ slideDown(duration?: number, easing?: string, complete?: Function): JQuery; /** * Display the matched elements with a sliding motion. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ slideDown(duration?: string, easing?: string, complete?: Function): JQuery; /** * Display the matched elements with a sliding motion. * * @param options - A map of additional options to pass to the method. */ slideDown(options: JQueryAnimationOptions): JQuery; /** * Display or hide the matched elements with a sliding motion. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ slideToggle(duration?: number, complete?: Function): JQuery; /** * Display or hide the matched elements with a sliding motion. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ slideToggle(duration?: string, complete?: Function): JQuery; /** * Display or hide the matched elements with a sliding motion. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ slideToggle(duration?: number, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements with a sliding motion. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ slideToggle(duration?: string, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements with a sliding motion. * * @param options - A map of additional options to pass to the method. */ slideToggle(options: JQueryAnimationOptions): JQuery; /** * Hide the matched elements with a sliding motion. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ slideUp(duration?: number, complete?: Function): JQuery; /** * Hide the matched elements with a sliding motion. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ slideUp(duration?: string, complete?: Function): JQuery; /** * Hide the matched elements with a sliding motion. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ slideUp(duration?: number, easing?: string, complete?: Function): JQuery; /** * Hide the matched elements with a sliding motion. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ slideUp(duration?: string, easing?: string, complete?: Function): JQuery; /** * Hide the matched elements with a sliding motion. * * @param options - A map of additional options to pass to the method. */ slideUp(options: JQueryAnimationOptions): JQuery; /** * Stop the currently-running animation on the matched elements. * * @param clearQueue - A Boolean indicating whether to remove queued animation as well. Defaults to false. * @param jumpToEnd - A Boolean indicating whether to complete the current animation immediately. Defaults to false. */ stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery; /** * Stop the currently-running animation on the matched elements. * * @param queue - The name of the queue in which to stop animations. * @param clearQueue - A Boolean indicating whether to remove queued animation as well. Defaults to false. * @param jumpToEnd - A Boolean indicating whether to complete the current animation immediately. Defaults to false. */ stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; /** * Display or hide the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ toggle(duration?: number, complete?: Function): JQuery; /** * Display or hide the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param complete - A function to call once the animation is complete. */ toggle(duration?: string, complete?: Function): JQuery; /** * Display or hide the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ toggle(duration?: number, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements. * * @param duration - A string or number determining how long the animation will run. * @param easing - A string indicating which easing function to use for the transition. * @param complete - A function to call once the animation is complete. */ toggle(duration?: string, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements. * * @param options - A map of additional options to pass to the method. */ toggle(options: JQueryAnimationOptions): JQuery; /** * Display or hide the matched elements. * * @param showOrHide - A Boolean indicating whether to show or hide the elements. */ toggle(showOrHide: boolean): JQuery; /** * Attach a handler to an event for the elements. * * @param eventType - A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. * * @param eventType - A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param handler - A function to execute each time the event is triggered. */ bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. * * @param eventType - A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param eventData - An object containing data that will be passed to the event handler. * @param preventBubble - Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. */ bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; /** * Attach a handler to an event for the elements. * * @param eventType - A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param preventBubble - Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. */ bind(eventType: string, preventBubble: boolean): JQuery; /** * Attach a handler to an event for the elements. * * @param events - An object containing one or more DOM event types and functions to execute for them. */ bind(events: any): JQuery; /** * Trigger the "blur" event on an element */ blur(): JQuery; /** * Bind an event handler to the "blur" JavaScript event * * @param handler - A function to execute each time the event is triggered. */ blur(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "blur" JavaScript event * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "change" event on an element. */ change(): JQuery; /** * Bind an event handler to the "change" JavaScript event * * @param handler - A function to execute each time the event is triggered. */ change(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "change" JavaScript event * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "click" event on an element. */ click(): JQuery; /** * Bind an event handler to the "click" JavaScript event * * @param eventData - An object containing data that will be passed to the event handler. */ click(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "click" JavaScript event * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "dblclick" event on an element. */ dblclick(): JQuery; /** * Bind an event handler to the "dblclick" JavaScript event * * @param handler - A function to execute each time the event is triggered. */ dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "dblclick" JavaScript event * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "focus" event on an element. */ focus(): JQuery; /** * Bind an event handler to the "focus" JavaScript event * * @param handler - A function to execute each time the event is triggered. */ focus(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "focus" JavaScript event * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "focusin" JavaScript event * * @param handler - A function to execute each time the event is triggered. */ focusin(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "focusin" JavaScript event * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "focusout" JavaScript event * * @param handler - A function to execute each time the event is triggered. */ focusout(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "focusout" JavaScript event * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. * * @param handlerIn - A function to execute when the mouse pointer enters the element. * @param handlerOut - A function to execute when the mouse pointer leaves the element. */ hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. * * @param handlerInOut - A function to execute when the mouse pointer enters or leaves the element. */ hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "keydown" event on an element. */ keydown(): JQuery; /** * Bind an event handler to the "keydown" JavaScript event * * @param handler - A function to execute each time the event is triggered. */ keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; /** * Bind an event handler to the "keydown" JavaScript event * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; /** * Trigger the "keypress" event on an element. */ keypress(): JQuery; /** * Bind an event handler to the "keypress" JavaScript event * * @param handler - A function to execute each time the event is triggered. */ keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; /** * Bind an event handler to the "keypress" JavaScript event * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; /** * Trigger the "keyup" event on an element. */ keyup(): JQuery; /** * Bind an event handler to the "keyup" JavaScript event * * @param handler - A function to execute each time the event is triggered. */ keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; /** * Bind an event handler to the "keyup" JavaScript event * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; /** * Bind an event handler to the "load" JavaScript event. * * @param handler - A function to execute when the event is triggered. */ load(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "load" JavaScript event. * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute when the event is triggered. */ load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "mousedown" event on an element. */ mousedown(): JQuery; /** * Bind an event handler to the "mousedown" JavaScript event. * * @param handler - A function to execute when the event is triggered. */ mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to the "mousedown" JavaScript event. * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute when the event is triggered. */ mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Trigger the "mouseenter" event on an element. */ mouseenter(): JQuery; /** * Bind an event handler to be fired when the mouse enters an element. * * @param handler - A function to execute when the event is triggered. */ mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to be fired when the mouse enters an element. * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute when the event is triggered. */ mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Trigger the "mouseleave" event on an element. */ mouseleave(): JQuery; /** * Bind an event handler to be fired when the mouse leaves an element. * * @param handler - A function to execute when the event is triggered. */ mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to be fired when the mouse leaves an element. * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute when the event is triggered. */ mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Trigger the "mousemove" event on an element. */ mousemove(): JQuery; /** * Bind an event handler to the "mousemove" JavaScript event. * * @param handler - A function to execute when the event is triggered. */ mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to the "mousemove" JavaScript event. * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute when the event is triggered. */ mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Trigger the "mouseout" event on an element. */ mouseout(): JQuery; /** * Bind an event handler to the "mouseout" JavaScript event. * * @param handler - A function to execute when the event is triggered. */ mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to the "mouseout" JavaScript event. * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute when the event is triggered. */ mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Trigger the "mouseover" event on an element. */ mouseover(): JQuery; /** * Bind an event handler to the "mouseover" JavaScript event. * * @param handler - A function to execute when the event is triggered. */ mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to the "mouseover" JavaScript event. * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute when the event is triggered. */ mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Trigger the "mouseup" event on an element. */ mouseup(): JQuery; /** * Bind an event handler to the "mouseup" JavaScript event. * * @param handler - A function to execute when the event is triggered. */ mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to the "mouseup" JavaScript event. * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute when the event is triggered. */ mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Remove an event handler. */ off(): JQuery; /** * Remove an event handler. * * @param events - One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". * @param selector - A selector which should match the one originally passed to .on() when attaching event handlers. * @param handler - A handler function previously attached for the event(s), or the special value false. */ off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Remove an event handler. * * @param events - One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". * @param handler - A handler function previously attached for the event(s), or the special value false. */ off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Remove an event handler. * * @param events - An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s). * @param selector - A selector which should match the one originally passed to .on() when attaching event handlers. */ off(events: { [key: string]: any; }, selector?: string): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * * @param events - One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". * @param handler - A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax). */ on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * * @param events - One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". * @param data - Data to be passed to the handler in event.data when an event is triggered. * @param handler - A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. */ on(events: string, data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * * @param events - One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". * @param selector - A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. * @param handler - A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. */ on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * * @param events - One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". * @param selector - A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. * @param data - Data to be passed to the handler in event.data when an event is triggered. * @param handler - A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. */ on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * * @param events - An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). * @param selector - A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. * @param data - Data to be passed to the handler in event.data when an event occurs. */ on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * * @param events - An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). * @param data - Data to be passed to the handler in event.data when an event occurs. */ on(events: { [key: string]: any; }, data?: any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. * * @param events - A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. * @param handler - A function to execute at the time the event is triggered. */ one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. * * @param events - A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. * @param data - An object containing data that will be passed to the event handler. * @param handler - A function to execute at the time the event is triggered. */ one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. * * @param events - One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". * @param selector - A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. * @param handler - A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. */ one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. * * @param events - One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". * @param selector - A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. * @param data - Data to be passed to the handler in event.data when an event is triggered. * @param handler - A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. */ one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. * * @param events - An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). * @param selector - A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. * @param data - Data to be passed to the handler in event.data when an event occurs. */ one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. * * @param events - An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). * @param data - Data to be passed to the handler in event.data when an event occurs. */ one(events: { [key: string]: any; }, data?: any): JQuery; /** * Specify a function to execute when the DOM is fully loaded. * * @param handler - A function to execute after the DOM is ready. */ ready(handler: Function): JQuery; /** * Trigger the "resize" event on an element. */ resize(): JQuery; /** * Bind an event handler to the "resize" JavaScript event. * * @param handler - A function to execute each time the event is triggered. */ resize(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "resize" JavaScript event. * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "scroll" event on an element. */ scroll(): JQuery; /** * Bind an event handler to the "scroll" JavaScript event. * * @param handler - A function to execute each time the event is triggered. */ scroll(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "scroll" JavaScript event. * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "select" event on an element. */ select(): JQuery; /** * Bind an event handler to the "select" JavaScript event. * * @param handler - A function to execute each time the event is triggered. */ select(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "select" JavaScript event. * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "submit" event on an element. */ submit(): JQuery; /** * Bind an event handler to the "submit" JavaScript event * * @param handler - A function to execute each time the event is triggered. */ submit(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "submit" JavaScript event * * @param eventData - An object containing data that will be passed to the event handler. * @param handler - A function to execute each time the event is triggered. */ submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Execute all handlers and behaviors attached to the matched elements for the given event type. * * @param eventType - A string containing a JavaScript event type, such as click or submit. * @param extraParameters - Additional parameters to pass along to the event handler. */ trigger(eventType: string, extraParameters?: any[]): JQuery; /** * Execute all handlers and behaviors attached to the matched elements for the given event type. * * @param eventType - A string containing a JavaScript event type, such as click or submit. * @param extraParameters - Additional parameters to pass along to the event handler. */ trigger(eventType: string, extraParameters?: Object): JQuery; /** * Execute all handlers and behaviors attached to the matched elements for the given event type. * * @param event - A jQuery.Event object. * @param extraParameters - Additional parameters to pass along to the event handler. */ trigger(event: JQueryEventObject, extraParameters?: any[]): JQuery; /** * Execute all handlers and behaviors attached to the matched elements for the given event type. * * @param event - A jQuery.Event object. * @param extraParameters - Additional parameters to pass along to the event handler. */ trigger(event: JQueryEventObject, extraParameters?: Object): JQuery; /** * Execute all handlers attached to an element for an event. * * @param eventType - A string containing a JavaScript event type, such as click or submit. * @param extraParameters - An array of additional parameters to pass along to the event handler. */ triggerHandler(eventType: string, ...extraParameters: any[]): Object; /** * Remove a previously-attached event handler from the elements. * * @param eventType - A string containing a JavaScript event type, such as click or submit. * @param handler - The function that is to be no longer executed. */ unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Remove a previously-attached event handler from the elements. * * @param eventType - A string containing a JavaScript event type, such as click or submit. * @param fls - Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). */ unbind(eventType: string, fls: boolean): JQuery; /** * Remove a previously-attached event handler from the elements. * * @param evt - A JavaScript event object as passed to an event handler. */ unbind(evt: any): JQuery; /** * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. */ undelegate(): JQuery; /** * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. * * @param selector - A selector which will be used to filter the event results. * @param eventType - A string containing a JavaScript event type, such as "click" or "keydown" * @param handler - A function to execute at the time the event is triggered. */ undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. * * @param selector - A selector which will be used to filter the event results. * @param events - An object of one or more event types and previously bound functions to unbind from them. */ undelegate(selector: string, events: Object): JQuery; /** * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. * * @param namespace - A string containing a namespace to unbind all events from. */ undelegate(namespace: string): JQuery; /** * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) * * @param handler - A function to execute when the event is triggered. */ unload(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) * * @param eventData - A plain object of data that will be passed to the event handler. * @param handler - A function to execute when the event is triggered. */ unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10) */ context: Element; jquery: string; /** * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) * * @param handler - A function to execute when the event is triggered. */ error(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) * * @param eventData - A plain object of data that will be passed to the event handler. * @param handler - A function to execute when the event is triggered. */ error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Add a collection of DOM elements onto the jQuery stack. * * @param elements - An array of elements to push onto the stack and make into a new jQuery object. */ pushStack(elements: any[]): JQuery; /** * Add a collection of DOM elements onto the jQuery stack. * * @param elements - An array of elements to push onto the stack and make into a new jQuery object. * @param name - The name of a jQuery method that generated the array of elements. * @param arguments - The arguments that were passed in to the jQuery method (for serialization). */ pushStack(elements: any[], name: string, arguments: any[]): JQuery; /** * Insert content, specified by the parameter, after each element in the set of matched elements. * * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. */ after(content1: JQuery, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, after each element in the set of matched elements. * * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. */ after(content1: any[], ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, after each element in the set of matched elements. * * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. */ after(content1: Element, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, after each element in the set of matched elements. * * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. */ after(content1: Text, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, after each element in the set of matched elements. * * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. */ after(content1: string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, after each element in the set of matched elements. * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ after(func: (index: number) => any): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. * * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. */ append(content1: JQuery, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. * * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. */ append(content1: any[], ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. * * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. */ append(content1: Element, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. * * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. */ append(content1: Text, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. * * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. */ append(content1: string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. */ append(func: (index: number, html: string) => any): JQuery; /** * Insert every element in the set of matched elements to the end of the target. * * @param target - A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. */ appendTo(target: JQuery): JQuery; /** * Insert every element in the set of matched elements to the end of the target. * * @param target - A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. */ appendTo(target: any[]): JQuery; /** * Insert every element in the set of matched elements to the end of the target. * * @param target - A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. */ appendTo(target: Element): JQuery; /** * Insert every element in the set of matched elements to the end of the target. * * @param target - A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. */ appendTo(target: string): JQuery; /** * Insert content, specified by the parameter, before each element in the set of matched elements. * * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. */ before(content1: JQuery, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, before each element in the set of matched elements. * * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. */ before(content1: any[], ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, before each element in the set of matched elements. * * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. */ before(content1: Element, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, before each element in the set of matched elements. * * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. */ before(content1: Text, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, before each element in the set of matched elements. * * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. */ before(content1: string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, before each element in the set of matched elements. * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ before(func: (index: number) => any): JQuery; /** * Create a deep copy of the set of matched elements. * * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. * param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false). */ clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery; /** * Remove the set of matched elements from the DOM. * * param selector A selector expression that filters the set of matched elements to be removed. */ detach(selector?: string): JQuery; /** * Remove all child nodes of the set of matched elements from the DOM. */ empty(): JQuery; /** * Insert every element in the set of matched elements after the target. * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. */ insertAfter(target: JQuery): JQuery; /** * Insert every element in the set of matched elements after the target. * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. */ insertAfter(target: any[]): JQuery; /** * Insert every element in the set of matched elements after the target. * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. */ insertAfter(target: Element): JQuery; /** * Insert every element in the set of matched elements after the target. * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. */ insertAfter(target: Text): JQuery; /** * Insert every element in the set of matched elements after the target. * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. */ insertAfter(target: string): JQuery; /** * Insert every element in the set of matched elements before the target. * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. */ insertBefore(target: JQuery): JQuery; /** * Insert every element in the set of matched elements before the target. * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. */ insertBefore(target: any[]): JQuery; /** * Insert every element in the set of matched elements before the target. * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. */ insertBefore(target: Element): JQuery; /** * Insert every element in the set of matched elements before the target. * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. */ insertBefore(target: Text): JQuery; /** * Insert every element in the set of matched elements before the target. * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. */ insertBefore(target: string): JQuery; /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. * * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. */ prepend(content1: JQuery, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. * * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. */ prepend(content1: any[], ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. * * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. */ prepend(content1: Element, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. * * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. */ prepend(content1: Text, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. * * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. */ prepend(content1: string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. */ prepend(func: (index: number, html: string) => any): JQuery; /** * Insert every element in the set of matched elements to the beginning of the target. * * @param target - A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. */ prependTo(target: JQuery): JQuery; /** * Insert every element in the set of matched elements to the beginning of the target. * * @param target - A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. */ prependTo(target: any[]): JQuery; /** * Insert every element in the set of matched elements to the beginning of the target. * * @param target - A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. */ prependTo(target: Element): JQuery; /** * Insert every element in the set of matched elements to the beginning of the target. * * @param target - A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. */ prependTo(target: string): JQuery; /** * Remove the set of matched elements from the DOM. * * @param selector - A selector expression that filters the set of matched elements to be removed. */ remove(selector?: string): JQuery; /** * Replace each target element with the set of matched elements. * * @param target - A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. */ replaceAll(target: JQuery): JQuery; /** * Replace each target element with the set of matched elements. * * @param target - A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. */ replaceAll(target: any[]): JQuery; /** * Replace each target element with the set of matched elements. * * @param target - A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. */ replaceAll(target: Element): JQuery; /** * Replace each target element with the set of matched elements. * * @param target - A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. */ replaceAll(target: string): JQuery; /** * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. * * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. */ replaceWith(newContent: JQuery): JQuery; /** * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. * * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. */ replaceWith(newContent: any[]): JQuery; /** * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. * * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. */ replaceWith(newContent: Element): JQuery; /** * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. * * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. */ replaceWith(newContent: Text): JQuery; /** * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. * * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. */ replaceWith(newContent: string): JQuery; /** * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. * * param func A function that returns content with which to replace the set of matched elements. */ replaceWith(func: () => any): JQuery; /** * Get the combined text contents of each element in the set of matched elements, including their descendants. */ text(): string; /** * Set the content of each element in the set of matched elements to the specified text. * * @param text - The text to set as the content of each matched element. */ text(text: string): JQuery; /** * Set the content of each element in the set of matched elements to the specified text. * * @param text - The text to set as the content of each matched element. */ text(text: number): JQuery; /** * Set the content of each element in the set of matched elements to the specified text. * * @param text - The text to set as the content of each matched element. */ text(text: boolean): JQuery; /** * Set the content of each element in the set of matched elements to the specified text. * * @param func - A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. */ text(func: (index: number, text: string) => string): JQuery; /** * Retrieve all the elements contained in the jQuery set, as an array. */ toArray(): any[]; /** * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. */ unwrap(): JQuery; /** * Wrap an HTML structure around each element in the set of matched elements. * * @param wrappingElement - A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. */ wrap(wrappingElement: JQuery): JQuery; /** * Wrap an HTML structure around each element in the set of matched elements. * * @param wrappingElement - A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. */ wrap(wrappingElement: Element): JQuery; /** * Wrap an HTML structure around each element in the set of matched elements. * * @param wrappingElement - A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. */ wrap(wrappingElement: string): JQuery; /** * Wrap an HTML structure around each element in the set of matched elements. * * @param func - A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ wrap(func: (index: number) => any): JQuery; /** * Wrap an HTML structure around all elements in the set of matched elements. * * @param wrappingElement - A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. */ wrapAll(wrappingElement: JQuery): JQuery; /** * Wrap an HTML structure around all elements in the set of matched elements. * * @param wrappingElement - A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. */ wrapAll(wrappingElement: Element): JQuery; /** * Wrap an HTML structure around all elements in the set of matched elements. * * @param wrappingElement - A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. */ wrapAll(wrappingElement: string): JQuery; /** * Wrap an HTML structure around the content of each element in the set of matched elements. * * @param wrappingElement - An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. */ wrapInner(wrappingElement: JQuery): JQuery; /** * Wrap an HTML structure around the content of each element in the set of matched elements. * * @param wrappingElement - An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. */ wrapInner(wrappingElement: Element): JQuery; /** * Wrap an HTML structure around the content of each element in the set of matched elements. * * @param wrappingElement - An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. */ wrapInner(wrappingElement: string): JQuery; /** * Wrap an HTML structure around the content of each element in the set of matched elements. * * @param func - A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ wrapInner(func: (index: number) => any): JQuery; /** * Iterate over a jQuery object, executing a function for each matched element. * * @param func - A function to execute for each matched element. */ each(func: (index: number, elem: Element) => any): JQuery; /** * Retrieve one of the elements matched by the jQuery object. * * @param index - A zero-based integer indicating which element to retrieve. */ get(index: number): HTMLElement; /** * Retrieve the elements matched by the jQuery object. */ get(): any[]; /** * Search for a given element from among the matched elements. */ index(): number; /** * Search for a given element from among the matched elements. * * @param selector - A selector representing a jQuery collection in which to look for an element. */ index(selector: string): number; /** * Search for a given element from among the matched elements. * * @param element - The DOM element or first element within the jQuery object to look for. */ index(element: JQuery): number; /** * Search for a given element from among the matched elements. * * @param element - The DOM element or first element within the jQuery object to look for. */ index(element: Element): number; /** * The number of elements in the jQuery object. */ length: number; /** * A selector representing selector passed to jQuery(), if any, when creating the original set. * version deprecated: 1.7, removed: 1.9 */ selector: string; [index: string]: any; [index: number]: HTMLElement; /** * Add elements to the set of matched elements. * * @param selector - A string representing a selector expression to find additional elements to add to the set of matched elements. * @param context - The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. */ add(selector: string, context?: Element): JQuery; /** * Add elements to the set of matched elements. * * @param elements - One or more elements to add to the set of matched elements. */ add(...elements: Element[]): JQuery; /** * Add elements to the set of matched elements. * * @param html - An HTML fragment to add to the set of matched elements. */ add(html: string): JQuery; /** * Add elements to the set of matched elements. * * @param obj - An existing jQuery object to add to the set of matched elements. */ add(obj: JQuery): JQuery; /** * Get the children of each element in the set of matched elements, optionally filtered by a selector. * * @param selector - A string containing a selector expression to match elements against. */ children(selector?: string): JQuery; /** * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. * * @param selector - A string containing a selector expression to match elements against. */ closest(selector: string): JQuery; /** * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. * * @param selector - A string containing a selector expression to match elements against. * @param context - A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. */ closest(selector: string, context?: Element): JQuery; /** * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. * * @param obj - A jQuery object to match elements against. */ closest(obj: JQuery): JQuery; /** * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. * * @param element - An element to match elements against. */ closest(element: Element): JQuery; /** * Get an array of all the elements and selectors matched against the current element up through the DOM tree. * * @param selectors - An array or string containing a selector expression to match elements against (can also be a jQuery object). * @param context - A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. */ closest(selectors: any, context?: Element): any[]; /** * Get the children of each element in the set of matched elements, including text and comment nodes. */ contents(): JQuery; /** * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. */ end(): JQuery; /** * Reduce the set of matched elements to the one at the specified index. * * @param index - An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set. * */ eq(index: number): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. * * @param selector - A string containing a selector expression to match the current set of elements against. */ filter(selector: string): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. * * @param func - A function used as a test for each element in the set. this is the current DOM element. */ filter(func: (index: number, element: Element) => any): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. * * @param element - An element to match the current set of elements against. */ filter(element: Element): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. * * @param obj - An existing jQuery object to match the current set of elements against. */ filter(obj: JQuery): JQuery; /** * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. * * @param selector - A string containing a selector expression to match elements against. */ find(selector: string): JQuery; /** * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. * * @param element - An element to match elements against. */ find(element: Element): JQuery; /** * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. * * @param obj - A jQuery object to match elements against. */ find(obj: JQuery): JQuery; /** * Reduce the set of matched elements to the first in the set. */ first(): JQuery; /** * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. * * @param selector - A string containing a selector expression to match elements against. */ has(selector: string): JQuery; /** * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. * * @param contained - A DOM element to match elements against. */ has(contained: Element): JQuery; /** * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. * * @param selector - A string containing a selector expression to match elements against. */ is(selector: string): boolean; /** * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. * * @param func - A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. */ is(func: (index: number) => any): boolean; /** * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. * * @param obj - An existing jQuery object to match the current set of elements against. */ is(obj: JQuery): boolean; /** * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. * * @param elements - One or more elements to match the current set of elements against. */ is(elements: any): boolean; /** * Reduce the set of matched elements to the final one in the set. */ last(): JQuery; /** * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. * * @param callback - A function object that will be invoked for each element in the current set. */ map(callback: (index: number, domElement: Element) => any): JQuery; /** * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. * * @param selector - A string containing a selector expression to match elements against. */ next(selector?: string): JQuery; /** * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. * * @param selector - A string containing a selector expression to match elements against. */ nextAll(selector?: string): JQuery; /** * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. * * @param selector - A string containing a selector expression to indicate where to stop matching following sibling elements. * @param filter - A string containing a selector expression to match elements against. */ nextUntil(selector?: string, filter?: string): JQuery; /** * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. * * @param element - A DOM node or jQuery object indicating where to stop matching following sibling elements. * @param filter - A string containing a selector expression to match elements against. */ nextUntil(element?: Element, filter?: string): JQuery; /** * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. * * @param obj - A DOM node or jQuery object indicating where to stop matching following sibling elements. * @param filter - A string containing a selector expression to match elements against. */ nextUntil(obj?: JQuery, filter?: string): JQuery; /** * Remove elements from the set of matched elements. * * @param selector - A string containing a selector expression to match elements against. */ not(selector: string): JQuery; /** * Remove elements from the set of matched elements. * * @param func - A function used as a test for each element in the set. this is the current DOM element. */ not(func: (index: number) => any): JQuery; /** * Remove elements from the set of matched elements. * * @param elements - One or more DOM elements to remove from the matched set. */ not(...elements: Element[]): JQuery; /** * Remove elements from the set of matched elements. * * @param obj - An existing jQuery object to match the current set of elements against. */ not(obj: JQuery): JQuery; /** * Get the closest ancestor element that is positioned. */ offsetParent(): JQuery; /** * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. * * @param selector - A string containing a selector expression to match elements against. */ parent(selector?: string): JQuery; /** * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. * * @param selector - A string containing a selector expression to match elements against. */ parents(selector?: string): JQuery; /** * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. * * @param selector - A string containing a selector expression to indicate where to stop matching ancestor elements. * @param filter - A string containing a selector expression to match elements against. */ parentsUntil(selector?: string, filter?: string): JQuery; /** * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. * * @param element - A DOM node or jQuery object indicating where to stop matching ancestor elements. * @param filter - A string containing a selector expression to match elements against. */ parentsUntil(element?: Element, filter?: string): JQuery; /** * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. * * @param obj - A DOM node or jQuery object indicating where to stop matching ancestor elements. * @param filter - A string containing a selector expression to match elements against. */ parentsUntil(obj?: JQuery, filter?: string): JQuery; /** * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. * * @param selector - A string containing a selector expression to match elements against. */ prev(selector?: string): JQuery; /** * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. * * @param selector - A string containing a selector expression to match elements against. */ prevAll(selector?: string): JQuery; /** * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. * * @param selector - A string containing a selector expression to indicate where to stop matching preceding sibling elements. * @param filter - A string containing a selector expression to match elements against. */ prevUntil(selector?: string, filter?: string): JQuery; /** * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. * * @param element - A DOM node or jQuery object indicating where to stop matching preceding sibling elements. * @param filter - A string containing a selector expression to match elements against. */ prevUntil(element?: Element, filter?: string): JQuery; /** * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. * * @param obj - A DOM node or jQuery object indicating where to stop matching preceding sibling elements. * @param filter - A string containing a selector expression to match elements against. */ prevUntil(obj?: JQuery, filter?: string): JQuery; /** * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. * * @param selector - A string containing a selector expression to match elements against. */ siblings(selector?: string): JQuery; /** * Reduce the set of matched elements to a subset specified by a range of indices. * * @param start - An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set. * @param end - An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. */ slice(start: number, end?: number): JQuery; /** * Show the queue of functions to be executed on the matched elements. * * @param queueName - A string containing the name of the queue. Defaults to fx, the standard effects queue. */ queue(queueName?: string): any[]; /** * Manipulate the queue of functions to be executed, once for each matched element. * * @param newQueue - An array of functions to replace the current queue contents. */ queue(newQueue: Function[]): JQuery; /** * Manipulate the queue of functions to be executed, once for each matched element. * * @param callback - The new function to add to the queue, with a function to call that will dequeue the next item. */ queue(callback: Function): JQuery; /** * Manipulate the queue of functions to be executed, once for each matched element. * * @param queueName - A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param newQueue - An array of functions to replace the current queue contents. */ queue(queueName: string, newQueue: Function[]): JQuery; /** * Manipulate the queue of functions to be executed, once for each matched element. * * @param queueName - A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param callback - The new function to add to the queue, with a function to call that will dequeue the next item. */ queue(queueName: string, callback: Function): JQuery; } declare module "jquery" { export = $; } declare var jQuery: JQueryStatic; declare var $: JQueryStatic; ================================================ FILE: common/Tests/External/magic-string.umd.js ================================================ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = global || self, global.MagicString = factory()); }(this, function () { 'use strict'; var BitSet = function BitSet(arg) { this.bits = arg instanceof BitSet ? arg.bits.slice() : []; }; BitSet.prototype.add = function add (n) { this.bits[Math.floor(n / BITS)] |= 1 << n % BITS; }; BitSet.prototype.has = function has (n) { return !!(this.bits[Math.floor(n / BITS)] & (1 << n % BITS)); }; var BITS = 32; var Chunk = function Chunk(start, end, content) { this.start = start; this.end = end; this.original = content; this.intro = ''; this.outro = ''; this.content = content; this.storeName = false; this.edited = false; // we make these non-enumerable, for sanity while debugging Object.defineProperties(this, { previous: { writable: true, value: null }, next: { writable: true, value: null } }); }; Chunk.prototype.appendLeft = function appendLeft (content) { this.outro += content; }; Chunk.prototype.appendRight = function appendRight (content) { this.intro = this.intro + content; }; Chunk.prototype.clone = function clone () { var chunk = new Chunk(this.start, this.end, this.original); chunk.intro = this.intro; chunk.outro = this.outro; chunk.content = this.content; chunk.storeName = this.storeName; chunk.edited = this.edited; return chunk; }; Chunk.prototype.contains = function contains (index) { return this.start < index && index < this.end; }; Chunk.prototype.eachNext = function eachNext (fn) { var chunk = this; while (chunk) { fn(chunk); chunk = chunk.next; } }; Chunk.prototype.eachPrevious = function eachPrevious (fn) { var chunk = this; while (chunk) { fn(chunk); chunk = chunk.previous; } }; Chunk.prototype.edit = function edit (content, storeName, contentOnly) { this.content = content; if (!contentOnly) { this.intro = ''; this.outro = ''; } this.storeName = storeName; this.edited = true; return this; }; Chunk.prototype.prependLeft = function prependLeft (content) { this.outro = content + this.outro; }; Chunk.prototype.prependRight = function prependRight (content) { this.intro = content + this.intro; }; Chunk.prototype.split = function split (index) { var sliceIndex = index - this.start; var originalBefore = this.original.slice(0, sliceIndex); var originalAfter = this.original.slice(sliceIndex); this.original = originalBefore; var newChunk = new Chunk(index, this.end, originalAfter); newChunk.outro = this.outro; this.outro = ''; this.end = index; if (this.edited) { // TODO is this block necessary?... newChunk.edit('', false); this.content = ''; } else { this.content = originalBefore; } newChunk.next = this.next; if (newChunk.next) { newChunk.next.previous = newChunk; } newChunk.previous = this; this.next = newChunk; return newChunk; }; Chunk.prototype.toString = function toString () { return this.intro + this.content + this.outro; }; Chunk.prototype.trimEnd = function trimEnd (rx) { this.outro = this.outro.replace(rx, ''); if (this.outro.length) { return true; } var trimmed = this.content.replace(rx, ''); if (trimmed.length) { if (trimmed !== this.content) { this.split(this.start + trimmed.length).edit('', undefined, true); } return true; } else { this.edit('', undefined, true); this.intro = this.intro.replace(rx, ''); if (this.intro.length) { return true; } } }; Chunk.prototype.trimStart = function trimStart (rx) { this.intro = this.intro.replace(rx, ''); if (this.intro.length) { return true; } var trimmed = this.content.replace(rx, ''); if (trimmed.length) { if (trimmed !== this.content) { this.split(this.end - trimmed.length); this.edit('', undefined, true); } return true; } else { this.edit('', undefined, true); this.outro = this.outro.replace(rx, ''); if (this.outro.length) { return true; } } }; var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; function encode(decoded) { var sourceFileIndex = 0; // second field var sourceCodeLine = 0; // third field var sourceCodeColumn = 0; // fourth field var nameIndex = 0; // fifth field var mappings = ''; for (var i = 0; i < decoded.length; i++) { var line = decoded[i]; if (i > 0) mappings += ';'; if (line.length === 0) continue; var generatedCodeColumn = 0; // first field var lineMappings = []; for (var _i = 0, line_1 = line; _i < line_1.length; _i++) { var segment = line_1[_i]; var segmentMappings = encodeInteger(segment[0] - generatedCodeColumn); generatedCodeColumn = segment[0]; if (segment.length > 1) { segmentMappings += encodeInteger(segment[1] - sourceFileIndex) + encodeInteger(segment[2] - sourceCodeLine) + encodeInteger(segment[3] - sourceCodeColumn); sourceFileIndex = segment[1]; sourceCodeLine = segment[2]; sourceCodeColumn = segment[3]; } if (segment.length === 5) { segmentMappings += encodeInteger(segment[4] - nameIndex); nameIndex = segment[4]; } lineMappings.push(segmentMappings); } mappings += lineMappings.join(','); } return mappings; } function encodeInteger(num) { var result = ''; num = num < 0 ? (-num << 1) | 1 : num << 1; do { var clamped = num & 31; num >>= 5; if (num > 0) { clamped |= 32; } result += chars[clamped]; } while (num > 0); return result; } var btoa = function () { throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); }; if (typeof window !== 'undefined' && typeof window.btoa === 'function') { btoa = function (str) { return window.btoa(unescape(encodeURIComponent(str))); }; } else if (typeof Buffer === 'function') { btoa = function (str) { return Buffer.from(str, 'utf-8').toString('base64'); }; } var SourceMap = function SourceMap(properties) { this.version = 3; this.file = properties.file; this.sources = properties.sources; this.sourcesContent = properties.sourcesContent; this.names = properties.names; this.mappings = encode(properties.mappings); }; SourceMap.prototype.toString = function toString () { return JSON.stringify(this); }; SourceMap.prototype.toUrl = function toUrl () { return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); }; function guessIndent(code) { var lines = code.split('\n'); var tabbed = lines.filter(function (line) { return /^\t+/.test(line); }); var spaced = lines.filter(function (line) { return /^ {2,}/.test(line); }); if (tabbed.length === 0 && spaced.length === 0) { return null; } // More lines tabbed than spaced? Assume tabs, and // default to tabs in the case of a tie (or nothing // to go on) if (tabbed.length >= spaced.length) { return '\t'; } // Otherwise, we need to guess the multiple var min = spaced.reduce(function (previous, current) { var numSpaces = /^ +/.exec(current)[0].length; return Math.min(numSpaces, previous); }, Infinity); return new Array(min + 1).join(' '); } function getRelativePath(from, to) { var fromParts = from.split(/[/\\]/); var toParts = to.split(/[/\\]/); fromParts.pop(); // get dirname while (fromParts[0] === toParts[0]) { fromParts.shift(); toParts.shift(); } if (fromParts.length) { var i = fromParts.length; while (i--) { fromParts[i] = '..'; } } return fromParts.concat(toParts).join('/'); } var toString = Object.prototype.toString; function isObject(thing) { return toString.call(thing) === '[object Object]'; } function getLocator(source) { var originalLines = source.split('\n'); var lineOffsets = []; for (var i = 0, pos = 0; i < originalLines.length; i++) { lineOffsets.push(pos); pos += originalLines[i].length + 1; } return function locate(index) { var i = 0; var j = lineOffsets.length; while (i < j) { var m = (i + j) >> 1; if (index < lineOffsets[m]) { j = m; } else { i = m + 1; } } var line = i - 1; var column = index - lineOffsets[line]; return { line: line, column: column }; }; } var Mappings = function Mappings(hires) { this.hires = hires; this.generatedCodeLine = 0; this.generatedCodeColumn = 0; this.raw = []; this.rawSegments = this.raw[this.generatedCodeLine] = []; this.pending = null; }; Mappings.prototype.addEdit = function addEdit (sourceIndex, content, loc, nameIndex) { if (content.length) { var segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; if (nameIndex >= 0) { segment.push(nameIndex); } this.rawSegments.push(segment); } else if (this.pending) { this.rawSegments.push(this.pending); } this.advance(content); this.pending = null; }; Mappings.prototype.addUneditedChunk = function addUneditedChunk (sourceIndex, chunk, original, loc, sourcemapLocations) { var originalCharIndex = chunk.start; var first = true; while (originalCharIndex < chunk.end) { if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]); } if (original[originalCharIndex] === '\n') { loc.line += 1; loc.column = 0; this.generatedCodeLine += 1; this.raw[this.generatedCodeLine] = this.rawSegments = []; this.generatedCodeColumn = 0; first = true; } else { loc.column += 1; this.generatedCodeColumn += 1; first = false; } originalCharIndex += 1; } this.pending = sourceIndex > 0 ? [this.generatedCodeColumn, sourceIndex, loc.line, loc.column] : null; }; Mappings.prototype.advance = function advance (str) { if (!str) { return; } var lines = str.split('\n'); if (lines.length > 1) { for (var i = 0; i < lines.length - 1; i++) { this.generatedCodeLine++; this.raw[this.generatedCodeLine] = this.rawSegments = []; } this.generatedCodeColumn = 0; } this.generatedCodeColumn += lines[lines.length - 1].length; }; var n = '\n'; var warned = { insertLeft: false, insertRight: false, storeName: false }; var MagicString = function MagicString(string, options) { if ( options === void 0 ) options = {}; var chunk = new Chunk(0, string.length, string); Object.defineProperties(this, { original: { writable: true, value: string }, outro: { writable: true, value: '' }, intro: { writable: true, value: '' }, firstChunk: { writable: true, value: chunk }, lastChunk: { writable: true, value: chunk }, lastSearchedChunk: { writable: true, value: chunk }, byStart: { writable: true, value: {} }, byEnd: { writable: true, value: {} }, filename: { writable: true, value: options.filename }, indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, sourcemapLocations: { writable: true, value: new BitSet() }, storedNames: { writable: true, value: {} }, indentStr: { writable: true, value: guessIndent(string) } }); this.byStart[0] = chunk; this.byEnd[string.length] = chunk; }; MagicString.prototype.addSourcemapLocation = function addSourcemapLocation (char) { this.sourcemapLocations.add(char); }; MagicString.prototype.append = function append (content) { if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); } this.outro += content; return this; }; MagicString.prototype.appendLeft = function appendLeft (index, content) { if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } this._split(index); var chunk = this.byEnd[index]; if (chunk) { chunk.appendLeft(content); } else { this.intro += content; } return this; }; MagicString.prototype.appendRight = function appendRight (index, content) { if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } this._split(index); var chunk = this.byStart[index]; if (chunk) { chunk.appendRight(content); } else { this.outro += content; } return this; }; MagicString.prototype.clone = function clone () { var cloned = new MagicString(this.original, { filename: this.filename }); var originalChunk = this.firstChunk; var clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); while (originalChunk) { cloned.byStart[clonedChunk.start] = clonedChunk; cloned.byEnd[clonedChunk.end] = clonedChunk; var nextOriginalChunk = originalChunk.next; var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); if (nextClonedChunk) { clonedChunk.next = nextClonedChunk; nextClonedChunk.previous = clonedChunk; clonedChunk = nextClonedChunk; } originalChunk = nextOriginalChunk; } cloned.lastChunk = clonedChunk; if (this.indentExclusionRanges) { cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); } cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); cloned.intro = this.intro; cloned.outro = this.outro; return cloned; }; MagicString.prototype.generateDecodedMap = function generateDecodedMap (options) { var this$1 = this; options = options || {}; var sourceIndex = 0; var names = Object.keys(this.storedNames); var mappings = new Mappings(options.hires); var locate = getLocator(this.original); if (this.intro) { mappings.advance(this.intro); } this.firstChunk.eachNext(function (chunk) { var loc = locate(chunk.start); if (chunk.intro.length) { mappings.advance(chunk.intro); } if (chunk.edited) { mappings.addEdit( sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1 ); } else { mappings.addUneditedChunk(sourceIndex, chunk, this$1.original, loc, this$1.sourcemapLocations); } if (chunk.outro.length) { mappings.advance(chunk.outro); } }); return { file: options.file ? options.file.split(/[/\\]/).pop() : null, sources: [options.source ? getRelativePath(options.file || '', options.source) : null], sourcesContent: options.includeContent ? [this.original] : [null], names: names, mappings: mappings.raw }; }; MagicString.prototype.generateMap = function generateMap (options) { return new SourceMap(this.generateDecodedMap(options)); }; MagicString.prototype.getIndentString = function getIndentString () { return this.indentStr === null ? '\t' : this.indentStr; }; MagicString.prototype.indent = function indent (indentStr, options) { var pattern = /^[^\r\n]/gm; if (isObject(indentStr)) { options = indentStr; indentStr = undefined; } indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t'; if (indentStr === '') { return this; } // noop options = options || {}; // Process exclusion ranges var isExcluded = {}; if (options.exclude) { var exclusions = typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; exclusions.forEach(function (exclusion) { for (var i = exclusion[0]; i < exclusion[1]; i += 1) { isExcluded[i] = true; } }); } var shouldIndentNextCharacter = options.indentStart !== false; var replacer = function (match) { if (shouldIndentNextCharacter) { return ("" + indentStr + match); } shouldIndentNextCharacter = true; return match; }; this.intro = this.intro.replace(pattern, replacer); var charIndex = 0; var chunk = this.firstChunk; while (chunk) { var end = chunk.end; if (chunk.edited) { if (!isExcluded[charIndex]) { chunk.content = chunk.content.replace(pattern, replacer); if (chunk.content.length) { shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; } } } else { charIndex = chunk.start; while (charIndex < end) { if (!isExcluded[charIndex]) { var char = this.original[charIndex]; if (char === '\n') { shouldIndentNextCharacter = true; } else if (char !== '\r' && shouldIndentNextCharacter) { shouldIndentNextCharacter = false; if (charIndex === chunk.start) { chunk.prependRight(indentStr); } else { this._splitChunk(chunk, charIndex); chunk = chunk.next; chunk.prependRight(indentStr); } } } charIndex += 1; } } charIndex = chunk.end; chunk = chunk.next; } this.outro = this.outro.replace(pattern, replacer); return this; }; MagicString.prototype.insert = function insert () { throw new Error('magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)'); }; MagicString.prototype.insertLeft = function insertLeft (index, content) { if (!warned.insertLeft) { console.warn('magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'); // eslint-disable-line no-console warned.insertLeft = true; } return this.appendLeft(index, content); }; MagicString.prototype.insertRight = function insertRight (index, content) { if (!warned.insertRight) { console.warn('magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'); // eslint-disable-line no-console warned.insertRight = true; } return this.prependRight(index, content); }; MagicString.prototype.move = function move (start, end, index) { if (index >= start && index <= end) { throw new Error('Cannot move a selection inside itself'); } this._split(start); this._split(end); this._split(index); var first = this.byStart[start]; var last = this.byEnd[end]; var oldLeft = first.previous; var oldRight = last.next; var newRight = this.byStart[index]; if (!newRight && last === this.lastChunk) { return this; } var newLeft = newRight ? newRight.previous : this.lastChunk; if (oldLeft) { oldLeft.next = oldRight; } if (oldRight) { oldRight.previous = oldLeft; } if (newLeft) { newLeft.next = first; } if (newRight) { newRight.previous = last; } if (!first.previous) { this.firstChunk = last.next; } if (!last.next) { this.lastChunk = first.previous; this.lastChunk.next = null; } first.previous = newLeft; last.next = newRight || null; if (!newLeft) { this.firstChunk = first; } if (!newRight) { this.lastChunk = last; } return this; }; MagicString.prototype.overwrite = function overwrite (start, end, content, options) { if (typeof content !== 'string') { throw new TypeError('replacement content must be a string'); } while (start < 0) { start += this.original.length; } while (end < 0) { end += this.original.length; } if (end > this.original.length) { throw new Error('end is out of bounds'); } if (start === end) { throw new Error('Cannot overwrite a zero-length range – use appendLeft or prependRight instead'); } this._split(start); this._split(end); if (options === true) { if (!warned.storeName) { console.warn('The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'); // eslint-disable-line no-console warned.storeName = true; } options = { storeName: true }; } var storeName = options !== undefined ? options.storeName : false; var contentOnly = options !== undefined ? options.contentOnly : false; if (storeName) { var original = this.original.slice(start, end); this.storedNames[original] = true; } var first = this.byStart[start]; var last = this.byEnd[end]; if (first) { if (end > first.end && first.next !== this.byStart[first.end]) { throw new Error('Cannot overwrite across a split point'); } first.edit(content, storeName, contentOnly); if (first !== last) { var chunk = first.next; while (chunk !== last) { chunk.edit('', false); chunk = chunk.next; } chunk.edit('', false); } } else { // must be inserting at the end var newChunk = new Chunk(start, end, '').edit(content, storeName); // TODO last chunk in the array may not be the last chunk, if it's moved... last.next = newChunk; newChunk.previous = last; } return this; }; MagicString.prototype.prepend = function prepend (content) { if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); } this.intro = content + this.intro; return this; }; MagicString.prototype.prependLeft = function prependLeft (index, content) { if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } this._split(index); var chunk = this.byEnd[index]; if (chunk) { chunk.prependLeft(content); } else { this.intro = content + this.intro; } return this; }; MagicString.prototype.prependRight = function prependRight (index, content) { if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } this._split(index); var chunk = this.byStart[index]; if (chunk) { chunk.prependRight(content); } else { this.outro = content + this.outro; } return this; }; MagicString.prototype.remove = function remove (start, end) { while (start < 0) { start += this.original.length; } while (end < 0) { end += this.original.length; } if (start === end) { return this; } if (start < 0 || end > this.original.length) { throw new Error('Character is out of bounds'); } if (start > end) { throw new Error('end must be greater than start'); } this._split(start); this._split(end); var chunk = this.byStart[start]; while (chunk) { chunk.intro = ''; chunk.outro = ''; chunk.edit(''); chunk = end > chunk.end ? this.byStart[chunk.end] : null; } return this; }; MagicString.prototype.lastChar = function lastChar () { if (this.outro.length) { return this.outro[this.outro.length - 1]; } var chunk = this.lastChunk; do { if (chunk.outro.length) { return chunk.outro[chunk.outro.length - 1]; } if (chunk.content.length) { return chunk.content[chunk.content.length - 1]; } if (chunk.intro.length) { return chunk.intro[chunk.intro.length - 1]; } } while (chunk = chunk.previous); if (this.intro.length) { return this.intro[this.intro.length - 1]; } return ''; }; MagicString.prototype.lastLine = function lastLine () { var lineIndex = this.outro.lastIndexOf(n); if (lineIndex !== -1) { return this.outro.substr(lineIndex + 1); } var lineStr = this.outro; var chunk = this.lastChunk; do { if (chunk.outro.length > 0) { lineIndex = chunk.outro.lastIndexOf(n); if (lineIndex !== -1) { return chunk.outro.substr(lineIndex + 1) + lineStr; } lineStr = chunk.outro + lineStr; } if (chunk.content.length > 0) { lineIndex = chunk.content.lastIndexOf(n); if (lineIndex !== -1) { return chunk.content.substr(lineIndex + 1) + lineStr; } lineStr = chunk.content + lineStr; } if (chunk.intro.length > 0) { lineIndex = chunk.intro.lastIndexOf(n); if (lineIndex !== -1) { return chunk.intro.substr(lineIndex + 1) + lineStr; } lineStr = chunk.intro + lineStr; } } while (chunk = chunk.previous); lineIndex = this.intro.lastIndexOf(n); if (lineIndex !== -1) { return this.intro.substr(lineIndex + 1) + lineStr; } return this.intro + lineStr; }; MagicString.prototype.slice = function slice (start, end) { if ( start === void 0 ) start = 0; if ( end === void 0 ) end = this.original.length; while (start < 0) { start += this.original.length; } while (end < 0) { end += this.original.length; } var result = ''; // find start chunk var chunk = this.firstChunk; while (chunk && (chunk.start > start || chunk.end <= start)) { // found end chunk before start if (chunk.start < end && chunk.end >= end) { return result; } chunk = chunk.next; } if (chunk && chunk.edited && chunk.start !== start) { throw new Error(("Cannot use replaced character " + start + " as slice start anchor.")); } var startChunk = chunk; while (chunk) { if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { result += chunk.intro; } var containsEnd = chunk.start < end && chunk.end >= end; if (containsEnd && chunk.edited && chunk.end !== end) { throw new Error(("Cannot use replaced character " + end + " as slice end anchor.")); } var sliceStart = startChunk === chunk ? start - chunk.start : 0; var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; result += chunk.content.slice(sliceStart, sliceEnd); if (chunk.outro && (!containsEnd || chunk.end === end)) { result += chunk.outro; } if (containsEnd) { break; } chunk = chunk.next; } return result; }; // TODO deprecate this? not really very useful MagicString.prototype.snip = function snip (start, end) { var clone = this.clone(); clone.remove(0, start); clone.remove(end, clone.original.length); return clone; }; MagicString.prototype._split = function _split (index) { if (this.byStart[index] || this.byEnd[index]) { return; } var chunk = this.lastSearchedChunk; var searchForward = index > chunk.end; while (chunk) { if (chunk.contains(index)) { return this._splitChunk(chunk, index); } chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; } }; MagicString.prototype._splitChunk = function _splitChunk (chunk, index) { if (chunk.edited && chunk.content.length) { // zero-length edited chunks are a special case (overlapping replacements) var loc = getLocator(this.original)(index); throw new Error( ("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")") ); } var newChunk = chunk.split(index); this.byEnd[index] = chunk; this.byStart[index] = newChunk; this.byEnd[newChunk.end] = newChunk; if (chunk === this.lastChunk) { this.lastChunk = newChunk; } this.lastSearchedChunk = chunk; return true; }; MagicString.prototype.toString = function toString () { var str = this.intro; var chunk = this.firstChunk; while (chunk) { str += chunk.toString(); chunk = chunk.next; } return str + this.outro; }; MagicString.prototype.isEmpty = function isEmpty () { var chunk = this.firstChunk; do { if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim()) { return false; } } while (chunk = chunk.next); return true; }; MagicString.prototype.length = function length () { var chunk = this.firstChunk; var length = 0; do { length += chunk.intro.length + chunk.content.length + chunk.outro.length; } while (chunk = chunk.next); return length; }; MagicString.prototype.trimLines = function trimLines () { return this.trim('[\\r\\n]'); }; MagicString.prototype.trim = function trim (charType) { return this.trimStart(charType).trimEnd(charType); }; MagicString.prototype.trimEndAborted = function trimEndAborted (charType) { var rx = new RegExp((charType || '\\s') + '+$'); this.outro = this.outro.replace(rx, ''); if (this.outro.length) { return true; } var chunk = this.lastChunk; do { var end = chunk.end; var aborted = chunk.trimEnd(rx); // if chunk was trimmed, we have a new lastChunk if (chunk.end !== end) { if (this.lastChunk === chunk) { this.lastChunk = chunk.next; } this.byEnd[chunk.end] = chunk; this.byStart[chunk.next.start] = chunk.next; this.byEnd[chunk.next.end] = chunk.next; } if (aborted) { return true; } chunk = chunk.previous; } while (chunk); return false; }; MagicString.prototype.trimEnd = function trimEnd (charType) { this.trimEndAborted(charType); return this; }; MagicString.prototype.trimStartAborted = function trimStartAborted (charType) { var rx = new RegExp('^' + (charType || '\\s') + '+'); this.intro = this.intro.replace(rx, ''); if (this.intro.length) { return true; } var chunk = this.firstChunk; do { var end = chunk.end; var aborted = chunk.trimStart(rx); if (chunk.end !== end) { // special case... if (chunk === this.lastChunk) { this.lastChunk = chunk.next; } this.byEnd[chunk.end] = chunk; this.byStart[chunk.next.start] = chunk.next; this.byEnd[chunk.next.end] = chunk.next; } if (aborted) { return true; } chunk = chunk.next; } while (chunk); return false; }; MagicString.prototype.trimStart = function trimStart (charType) { this.trimStartAborted(charType); return this; }; var hasOwnProp = Object.prototype.hasOwnProperty; var Bundle = function Bundle(options) { if ( options === void 0 ) options = {}; this.intro = options.intro || ''; this.separator = options.separator !== undefined ? options.separator : '\n'; this.sources = []; this.uniqueSources = []; this.uniqueSourceIndexByFilename = {}; }; Bundle.prototype.addSource = function addSource (source) { if (source instanceof MagicString) { return this.addSource({ content: source, filename: source.filename, separator: this.separator }); } if (!isObject(source) || !source.content) { throw new Error('bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`'); } ['filename', 'indentExclusionRanges', 'separator'].forEach(function (option) { if (!hasOwnProp.call(source, option)) { source[option] = source.content[option]; } }); if (source.separator === undefined) { // TODO there's a bunch of this sort of thing, needs cleaning up source.separator = this.separator; } if (source.filename) { if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; this.uniqueSources.push({ filename: source.filename, content: source.content.original }); } else { var uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; if (source.content.original !== uniqueSource.content) { throw new Error(("Illegal source: same filename (" + (source.filename) + "), different contents")); } } } this.sources.push(source); return this; }; Bundle.prototype.append = function append (str, options) { this.addSource({ content: new MagicString(str), separator: (options && options.separator) || '' }); return this; }; Bundle.prototype.clone = function clone () { var bundle = new Bundle({ intro: this.intro, separator: this.separator }); this.sources.forEach(function (source) { bundle.addSource({ filename: source.filename, content: source.content.clone(), separator: source.separator }); }); return bundle; }; Bundle.prototype.generateDecodedMap = function generateDecodedMap (options) { var this$1 = this; if ( options === void 0 ) options = {}; var names = []; this.sources.forEach(function (source) { Object.keys(source.content.storedNames).forEach(function (name) { if (!~names.indexOf(name)) { names.push(name); } }); }); var mappings = new Mappings(options.hires); if (this.intro) { mappings.advance(this.intro); } this.sources.forEach(function (source, i) { if (i > 0) { mappings.advance(this$1.separator); } var sourceIndex = source.filename ? this$1.uniqueSourceIndexByFilename[source.filename] : -1; var magicString = source.content; var locate = getLocator(magicString.original); if (magicString.intro) { mappings.advance(magicString.intro); } magicString.firstChunk.eachNext(function (chunk) { var loc = locate(chunk.start); if (chunk.intro.length) { mappings.advance(chunk.intro); } if (source.filename) { if (chunk.edited) { mappings.addEdit( sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1 ); } else { mappings.addUneditedChunk( sourceIndex, chunk, magicString.original, loc, magicString.sourcemapLocations ); } } else { mappings.advance(chunk.content); } if (chunk.outro.length) { mappings.advance(chunk.outro); } }); if (magicString.outro) { mappings.advance(magicString.outro); } }); return { file: options.file ? options.file.split(/[/\\]/).pop() : null, sources: this.uniqueSources.map(function (source) { return options.file ? getRelativePath(options.file, source.filename) : source.filename; }), sourcesContent: this.uniqueSources.map(function (source) { return options.includeContent ? source.content : null; }), names: names, mappings: mappings.raw }; }; Bundle.prototype.generateMap = function generateMap (options) { return new SourceMap(this.generateDecodedMap(options)); }; Bundle.prototype.getIndentString = function getIndentString () { var indentStringCounts = {}; this.sources.forEach(function (source) { var indentStr = source.content.indentStr; if (indentStr === null) { return; } if (!indentStringCounts[indentStr]) { indentStringCounts[indentStr] = 0; } indentStringCounts[indentStr] += 1; }); return ( Object.keys(indentStringCounts).sort(function (a, b) { return indentStringCounts[a] - indentStringCounts[b]; })[0] || '\t' ); }; Bundle.prototype.indent = function indent (indentStr) { var this$1 = this; if (!arguments.length) { indentStr = this.getIndentString(); } if (indentStr === '') { return this; } // noop var trailingNewline = !this.intro || this.intro.slice(-1) === '\n'; this.sources.forEach(function (source, i) { var separator = source.separator !== undefined ? source.separator : this$1.separator; var indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator)); source.content.indent(indentStr, { exclude: source.indentExclusionRanges, indentStart: indentStart //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator ) }); trailingNewline = source.content.lastChar() === '\n'; }); if (this.intro) { this.intro = indentStr + this.intro.replace(/^[^\n]/gm, function (match, index) { return index > 0 ? indentStr + match : match; }); } return this; }; Bundle.prototype.prepend = function prepend (str) { this.intro = str + this.intro; return this; }; Bundle.prototype.toString = function toString () { var this$1 = this; var body = this.sources .map(function (source, i) { var separator = source.separator !== undefined ? source.separator : this$1.separator; var str = (i > 0 ? separator : '') + source.content.toString(); return str; }) .join(''); return this.intro + body; }; Bundle.prototype.isEmpty = function isEmpty () { if (this.intro.length && this.intro.trim()) { return false; } if (this.sources.some(function (source) { return !source.content.isEmpty(); })) { return false; } return true; }; Bundle.prototype.length = function length () { return this.sources.reduce(function (length, source) { return length + source.content.length(); }, this.intro.length); }; Bundle.prototype.trimLines = function trimLines () { return this.trim('[\\r\\n]'); }; Bundle.prototype.trim = function trim (charType) { return this.trimStart(charType).trimEnd(charType); }; Bundle.prototype.trimStart = function trimStart (charType) { var rx = new RegExp('^' + (charType || '\\s') + '+'); this.intro = this.intro.replace(rx, ''); if (!this.intro) { var source; var i = 0; do { source = this.sources[i++]; if (!source) { break; } } while (!source.content.trimStartAborted(charType)); } return this; }; Bundle.prototype.trimEnd = function trimEnd (charType) { var rx = new RegExp((charType || '\\s') + '+$'); var source; var i = this.sources.length - 1; do { source = this.sources[i--]; if (!source) { this.intro = this.intro.replace(rx, ''); break; } } while (!source.content.trimEndAborted(charType)); return this; }; MagicString.Bundle = Bundle; MagicString.SourceMap = SourceMap; MagicString.default = MagicString; // work around TypeScript bug https://github.com/Rich-Harris/magic-string/pull/121 return MagicString; })); //# sourceMappingURL=magic-string.umd.js.map ================================================ FILE: common/Tests/External/qunit-1.23.1.css ================================================ /*! * QUnit 1.23.1 * https://qunitjs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2016-04-12T17:29Z */ /** Font Family and Sizes */ #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult { font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; } #qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } #qunit-tests { font-size: smaller; } /** Resets */ #qunit-tests, #qunit-header, #qunit-banner, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { margin: 0; padding: 0; } /** Header */ #qunit-header { padding: 0.5em 0 0.5em 1em; color: #8699A4; background-color: #0D3349; font-size: 1.5em; line-height: 1em; font-weight: 400; border-radius: 5px 5px 0 0; } #qunit-header a { text-decoration: none; color: #C2CCD1; } #qunit-header a:hover, #qunit-header a:focus { color: #FFF; } #qunit-testrunner-toolbar label { display: inline-block; padding: 0 0.5em 0 0.1em; } #qunit-banner { height: 5px; } #qunit-testrunner-toolbar { padding: 0.5em 1em 0.5em 1em; color: #5E740B; background-color: #EEE; overflow: hidden; } #qunit-filteredTest { padding: 0.5em 1em 0.5em 1em; background-color: #F4FF77; color: #366097; } #qunit-userAgent { padding: 0.5em 1em 0.5em 1em; background-color: #2B81AF; color: #FFF; text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; } #qunit-modulefilter-container { float: right; padding: 0.2em; } .qunit-url-config { display: inline-block; padding: 0.1em; } .qunit-filter { display: block; float: right; margin-left: 1em; } /** Tests: Pass/Fail */ #qunit-tests { list-style-position: inside; } #qunit-tests li { padding: 0.4em 1em 0.4em 1em; border-bottom: 1px solid #FFF; list-style-position: inside; } #qunit-tests > li { display: none; } #qunit-tests li.running, #qunit-tests li.pass, #qunit-tests li.fail, #qunit-tests li.skipped { display: list-item; } #qunit-tests.hidepass { position: relative; } #qunit-tests.hidepass li.running, #qunit-tests.hidepass li.pass { visibility: hidden; position: absolute; width: 0; height: 0; padding: 0; border: 0; margin: 0; } #qunit-tests li strong { cursor: pointer; } #qunit-tests li.skipped strong { cursor: default; } #qunit-tests li a { padding: 0.5em; color: #C2CCD1; text-decoration: none; } #qunit-tests li p a { padding: 0.25em; color: #6B6464; } #qunit-tests li a:hover, #qunit-tests li a:focus { color: #000; } #qunit-tests li .runtime { float: right; font-size: smaller; } .qunit-assert-list { margin-top: 0.5em; padding: 0.5em; background-color: #FFF; border-radius: 5px; } .qunit-source { margin: 0.6em 0 0.3em; } .qunit-collapsed { display: none; } #qunit-tests table { border-collapse: collapse; margin-top: 0.2em; } #qunit-tests th { text-align: right; vertical-align: top; padding: 0 0.5em 0 0; } #qunit-tests td { vertical-align: top; } #qunit-tests pre { margin: 0; white-space: pre-wrap; word-wrap: break-word; } #qunit-tests del { background-color: #E0F2BE; color: #374E0C; text-decoration: none; } #qunit-tests ins { background-color: #FFCACA; color: #500; text-decoration: none; } /*** Test Counts */ #qunit-tests b.counts { color: #000; } #qunit-tests b.passed { color: #5E740B; } #qunit-tests b.failed { color: #710909; } #qunit-tests li li { padding: 5px; background-color: #FFF; border-bottom: none; list-style-position: inside; } /*** Passing Styles */ #qunit-tests li li.pass { color: #3C510C; background-color: #FFF; border-left: 10px solid #C6E746; } #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } #qunit-tests .pass .test-name { color: #366097; } #qunit-tests .pass .test-actual, #qunit-tests .pass .test-expected { color: #999; } #qunit-banner.qunit-pass { background-color: #C6E746; } /*** Failing Styles */ #qunit-tests li li.fail { color: #710909; background-color: #FFF; border-left: 10px solid #EE5757; white-space: pre; } #qunit-tests > li:last-child { border-radius: 0 0 5px 5px; } #qunit-tests .fail { color: #000; background-color: #EE5757; } #qunit-tests .fail .test-name, #qunit-tests .fail .module-name { color: #000; } #qunit-tests .fail .test-actual { color: #EE5757; } #qunit-tests .fail .test-expected { color: #008000; } #qunit-banner.qunit-fail { background-color: #EE5757; } /*** Skipped tests */ #qunit-tests .skipped { background-color: #EBECE9; } #qunit-tests .qunit-skipped-label { background-color: #F4FF77; display: inline-block; font-style: normal; color: #366097; line-height: 1.8em; padding: 0 0.5em; margin: -0.4em 0.4em -0.4em 0; } /** Result */ #qunit-testresult { padding: 0.5em 1em 0.5em 1em; color: #2B81AF; background-color: #D2E0E6; border-bottom: 1px solid #FFF; } #qunit-testresult .module-name { font-weight: 700; } /** Fixture */ #qunit-fixture { position: absolute; top: -10000px; left: -10000px; width: 1000px; height: 1000px; } ================================================ FILE: common/Tests/External/qunit-1.23.1.js ================================================ /*! * QUnit 1.23.1 * https://qunitjs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2016-04-12T17:29Z */ ( function( global ) { var QUnit = {}; var Date = global.Date; var now = Date.now || function() { return new Date().getTime(); }; var setTimeout = global.setTimeout; var clearTimeout = global.clearTimeout; // Store a local window from the global to allow direct references. var window = global.window; var defined = { document: window && window.document !== undefined, setTimeout: setTimeout !== undefined, sessionStorage: ( function() { var x = "qunit-test-string"; try { sessionStorage.setItem( x, x ); sessionStorage.removeItem( x ); return true; } catch ( e ) { return false; } }() ) }; var fileName = ( sourceFromStacktrace( 0 ) || "" ).replace( /(:\d+)+\)?/, "" ).replace( /.+\//, "" ); var globalStartCalled = false; var runStarted = false; var toString = Object.prototype.toString, hasOwn = Object.prototype.hasOwnProperty; // Returns a new Array with the elements that are in a but not in b function diff( a, b ) { var i, j, result = a.slice(); for ( i = 0; i < result.length; i++ ) { for ( j = 0; j < b.length; j++ ) { if ( result[ i ] === b[ j ] ) { result.splice( i, 1 ); i--; break; } } } return result; } // From jquery.js function inArray( elem, array ) { if ( array.indexOf ) { return array.indexOf( elem ); } for ( var i = 0, length = array.length; i < length; i++ ) { if ( array[ i ] === elem ) { return i; } } return -1; } /** * Makes a clone of an object using only Array or Object as base, * and copies over the own enumerable properties. * * @param {Object} obj * @return {Object} New object with only the own properties (recursively). */ function objectValues ( obj ) { var key, val, vals = QUnit.is( "array", obj ) ? [] : {}; for ( key in obj ) { if ( hasOwn.call( obj, key ) ) { val = obj[ key ]; vals[ key ] = val === Object( val ) ? objectValues( val ) : val; } } return vals; } function extend( a, b, undefOnly ) { for ( var prop in b ) { if ( hasOwn.call( b, prop ) ) { // Avoid "Member not found" error in IE8 caused by messing with window.constructor // This block runs on every environment, so `global` is being used instead of `window` // to avoid errors on node. if ( prop !== "constructor" || a !== global ) { if ( b[ prop ] === undefined ) { delete a[ prop ]; } else if ( !( undefOnly && typeof a[ prop ] !== "undefined" ) ) { a[ prop ] = b[ prop ]; } } } } return a; } function objectType( obj ) { if ( typeof obj === "undefined" ) { return "undefined"; } // Consider: typeof null === object if ( obj === null ) { return "null"; } var match = toString.call( obj ).match( /^\[object\s(.*)\]$/ ), type = match && match[ 1 ]; switch ( type ) { case "Number": if ( isNaN( obj ) ) { return "nan"; } return "number"; case "String": case "Boolean": case "Array": case "Set": case "Map": case "Date": case "RegExp": case "Function": case "Symbol": return type.toLowerCase(); } if ( typeof obj === "object" ) { return "object"; } } // Safe object type checking function is( type, obj ) { return QUnit.objectType( obj ) === type; } // Doesn't support IE6 to IE9, it will return undefined on these browsers // See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack function extractStacktrace( e, offset ) { offset = offset === undefined ? 4 : offset; var stack, include, i; if ( e.stack ) { stack = e.stack.split( "\n" ); if ( /^error$/i.test( stack[ 0 ] ) ) { stack.shift(); } if ( fileName ) { include = []; for ( i = offset; i < stack.length; i++ ) { if ( stack[ i ].indexOf( fileName ) !== -1 ) { break; } include.push( stack[ i ] ); } if ( include.length ) { return include.join( "\n" ); } } return stack[ offset ]; // Support: Safari <=6 only } else if ( e.sourceURL ) { // Exclude useless self-reference for generated Error objects if ( /qunit.js$/.test( e.sourceURL ) ) { return; } // For actual exceptions, this is useful return e.sourceURL + ":" + e.line; } } function sourceFromStacktrace( offset ) { var error = new Error(); // Support: Safari <=7 only, IE <=10 - 11 only // Not all browsers generate the `stack` property for `new Error()`, see also #636 if ( !error.stack ) { try { throw error; } catch ( err ) { error = err; } } return extractStacktrace( error, offset ); } /** * Config object: Maintain internal state * Later exposed as QUnit.config * `config` initialized at top of scope */ var config = { // The queue of tests to run queue: [], // Block until document ready blocking: true, // By default, run previously failed tests first // very useful in combination with "Hide passed tests" checked reorder: true, // By default, modify document.title when suite is done altertitle: true, // HTML Reporter: collapse every test except the first failing test // If false, all failing tests will be expanded collapse: true, // By default, scroll to top of the page when suite is done scrolltop: true, // Depth up-to which object will be dumped maxDepth: 5, // When enabled, all tests must call expect() requireExpects: false, // Placeholder for user-configurable form-exposed URL parameters urlConfig: [], // Set of all modules. modules: [], // Stack of nested modules moduleStack: [], // The first unnamed module currentModule: { name: "", tests: [] }, callbacks: {} }; // Push a loose unnamed module to the modules collection config.modules.push( config.currentModule ); var loggingCallbacks = {}; // Register logging callbacks function registerLoggingCallbacks( obj ) { var i, l, key, callbackNames = [ "begin", "done", "log", "testStart", "testDone", "moduleStart", "moduleDone" ]; function registerLoggingCallback( key ) { var loggingCallback = function( callback ) { if ( objectType( callback ) !== "function" ) { throw new Error( "QUnit logging methods require a callback function as their first parameters." ); } config.callbacks[ key ].push( callback ); }; // DEPRECATED: This will be removed on QUnit 2.0.0+ // Stores the registered functions allowing restoring // at verifyLoggingCallbacks() if modified loggingCallbacks[ key ] = loggingCallback; return loggingCallback; } for ( i = 0, l = callbackNames.length; i < l; i++ ) { key = callbackNames[ i ]; // Initialize key collection of logging callback if ( objectType( config.callbacks[ key ] ) === "undefined" ) { config.callbacks[ key ] = []; } obj[ key ] = registerLoggingCallback( key ); } } function runLoggingCallbacks( key, args ) { var i, l, callbacks; callbacks = config.callbacks[ key ]; for ( i = 0, l = callbacks.length; i < l; i++ ) { callbacks[ i ]( args ); } } // DEPRECATED: This will be removed on 2.0.0+ // This function verifies if the loggingCallbacks were modified by the user // If so, it will restore it, assign the given callback and print a console warning function verifyLoggingCallbacks() { var loggingCallback, userCallback; for ( loggingCallback in loggingCallbacks ) { if ( QUnit[ loggingCallback ] !== loggingCallbacks[ loggingCallback ] ) { userCallback = QUnit[ loggingCallback ]; // Restore the callback function QUnit[ loggingCallback ] = loggingCallbacks[ loggingCallback ]; // Assign the deprecated given callback QUnit[ loggingCallback ]( userCallback ); if ( global.console && global.console.warn ) { global.console.warn( "QUnit." + loggingCallback + " was replaced with a new value.\n" + "Please, check out the documentation on how to apply logging callbacks.\n" + "Reference: https://api.qunitjs.com/category/callbacks/" ); } } } } ( function() { if ( !defined.document ) { return; } // `onErrorFnPrev` initialized at top of scope // Preserve other handlers var onErrorFnPrev = window.onerror; // Cover uncaught exceptions // Returning true will suppress the default browser handler, // returning false will let it run. window.onerror = function( error, filePath, linerNr ) { var ret = false; if ( onErrorFnPrev ) { ret = onErrorFnPrev( error, filePath, linerNr ); } // Treat return value as window.onerror itself does, // Only do our handling if not suppressed. if ( ret !== true ) { if ( QUnit.config.current ) { if ( QUnit.config.current.ignoreGlobalErrors ) { return true; } QUnit.pushFailure( error, filePath + ":" + linerNr ); } else { QUnit.test( "global failure", extend( function() { QUnit.pushFailure( error, filePath + ":" + linerNr ); }, { validTest: true } ) ); } return false; } return ret; }; }() ); // Figure out if we're running the tests from a server or not QUnit.isLocal = !( defined.document && window.location.protocol !== "file:" ); // Expose the current QUnit version QUnit.version = "1.23.1"; extend( QUnit, { // Call on start of module test to prepend name to all tests module: function( name, testEnvironment, executeNow ) { var module, moduleFns; var currentModule = config.currentModule; if ( arguments.length === 2 ) { if ( objectType( testEnvironment ) === "function" ) { executeNow = testEnvironment; testEnvironment = undefined; } } // DEPRECATED: handles setup/teardown functions, // beforeEach and afterEach should be used instead if ( testEnvironment && testEnvironment.setup ) { testEnvironment.beforeEach = testEnvironment.setup; delete testEnvironment.setup; } if ( testEnvironment && testEnvironment.teardown ) { testEnvironment.afterEach = testEnvironment.teardown; delete testEnvironment.teardown; } module = createModule(); moduleFns = { beforeEach: setHook( module, "beforeEach" ), afterEach: setHook( module, "afterEach" ) }; if ( objectType( executeNow ) === "function" ) { config.moduleStack.push( module ); setCurrentModule( module ); executeNow.call( module.testEnvironment, moduleFns ); config.moduleStack.pop(); module = module.parentModule || currentModule; } setCurrentModule( module ); function createModule() { var parentModule = config.moduleStack.length ? config.moduleStack.slice( -1 )[ 0 ] : null; var moduleName = parentModule !== null ? [ parentModule.name, name ].join( " > " ) : name; var module = { name: moduleName, parentModule: parentModule, tests: [], moduleId: generateHash( moduleName ) }; var env = {}; if ( parentModule ) { extend( env, parentModule.testEnvironment ); delete env.beforeEach; delete env.afterEach; } extend( env, testEnvironment ); module.testEnvironment = env; config.modules.push( module ); return module; } function setCurrentModule( module ) { config.currentModule = module; } }, // DEPRECATED: QUnit.asyncTest() will be removed in QUnit 2.0. asyncTest: asyncTest, test: test, skip: skip, only: only, // DEPRECATED: The functionality of QUnit.start() will be altered in QUnit 2.0. // In QUnit 2.0, invoking it will ONLY affect the `QUnit.config.autostart` blocking behavior. start: function( count ) { var globalStartAlreadyCalled = globalStartCalled; if ( !config.current ) { globalStartCalled = true; if ( runStarted ) { throw new Error( "Called start() outside of a test context while already started" ); } else if ( globalStartAlreadyCalled || count > 1 ) { throw new Error( "Called start() outside of a test context too many times" ); } else if ( config.autostart ) { throw new Error( "Called start() outside of a test context when " + "QUnit.config.autostart was true" ); } else if ( !config.pageLoaded ) { // The page isn't completely loaded yet, so bail out and let `QUnit.load` handle it config.autostart = true; return; } } else { // If a test is running, adjust its semaphore config.current.semaphore -= count || 1; // If semaphore is non-numeric, throw error if ( isNaN( config.current.semaphore ) ) { config.current.semaphore = 0; QUnit.pushFailure( "Called start() with a non-numeric decrement.", sourceFromStacktrace( 2 ) ); return; } // Don't start until equal number of stop-calls if ( config.current.semaphore > 0 ) { return; } // Throw an Error if start is called more often than stop if ( config.current.semaphore < 0 ) { config.current.semaphore = 0; QUnit.pushFailure( "Called start() while already started (test's semaphore was 0 already)", sourceFromStacktrace( 2 ) ); return; } } resumeProcessing(); }, // DEPRECATED: QUnit.stop() will be removed in QUnit 2.0. stop: function( count ) { // If there isn't a test running, don't allow QUnit.stop() to be called if ( !config.current ) { throw new Error( "Called stop() outside of a test context" ); } // If a test is running, adjust its semaphore config.current.semaphore += count || 1; pauseProcessing(); }, config: config, is: is, objectType: objectType, extend: extend, load: function() { config.pageLoaded = true; // Initialize the configuration options extend( config, { stats: { all: 0, bad: 0 }, moduleStats: { all: 0, bad: 0 }, started: 0, updateRate: 1000, autostart: true, filter: "" }, true ); config.blocking = false; if ( config.autostart ) { resumeProcessing(); } }, stack: function( offset ) { offset = ( offset || 0 ) + 2; return sourceFromStacktrace( offset ); } } ); registerLoggingCallbacks( QUnit ); function begin() { var i, l, modulesLog = []; // If the test run hasn't officially begun yet if ( !config.started ) { // Record the time of the test run's beginning config.started = now(); verifyLoggingCallbacks(); // Delete the loose unnamed module if unused. if ( config.modules[ 0 ].name === "" && config.modules[ 0 ].tests.length === 0 ) { config.modules.shift(); } // Avoid unnecessary information by not logging modules' test environments for ( i = 0, l = config.modules.length; i < l; i++ ) { modulesLog.push( { name: config.modules[ i ].name, tests: config.modules[ i ].tests } ); } // The test run is officially beginning now runLoggingCallbacks( "begin", { totalTests: Test.count, modules: modulesLog } ); } config.blocking = false; process( true ); } function process( last ) { function next() { process( last ); } var start = now(); config.depth = ( config.depth || 0 ) + 1; while ( config.queue.length && !config.blocking ) { if ( !defined.setTimeout || config.updateRate <= 0 || ( ( now() - start ) < config.updateRate ) ) { if ( config.current ) { // Reset async tracking for each phase of the Test lifecycle config.current.usedAsync = false; } config.queue.shift()(); } else { setTimeout( next, 13 ); break; } } config.depth--; if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) { done(); } } function pauseProcessing() { config.blocking = true; if ( config.testTimeout && defined.setTimeout ) { clearTimeout( config.timeout ); config.timeout = setTimeout( function() { if ( config.current ) { config.current.semaphore = 0; QUnit.pushFailure( "Test timed out", sourceFromStacktrace( 2 ) ); } else { throw new Error( "Test timed out" ); } resumeProcessing(); }, config.testTimeout ); } } function resumeProcessing() { runStarted = true; // A slight delay to allow this iteration of the event loop to finish (more assertions, etc.) if ( defined.setTimeout ) { setTimeout( function() { if ( config.current && config.current.semaphore > 0 ) { return; } if ( config.timeout ) { clearTimeout( config.timeout ); } begin(); }, 13 ); } else { begin(); } } function done() { var runtime, passed; config.autorun = true; // Log the last module results if ( config.previousModule ) { runLoggingCallbacks( "moduleDone", { name: config.previousModule.name, tests: config.previousModule.tests, failed: config.moduleStats.bad, passed: config.moduleStats.all - config.moduleStats.bad, total: config.moduleStats.all, runtime: now() - config.moduleStats.started } ); } delete config.previousModule; runtime = now() - config.started; passed = config.stats.all - config.stats.bad; runLoggingCallbacks( "done", { failed: config.stats.bad, passed: passed, total: config.stats.all, runtime: runtime } ); } function setHook( module, hookName ) { if ( module.testEnvironment === undefined ) { module.testEnvironment = {}; } return function( callback ) { module.testEnvironment[ hookName ] = callback; }; } var focused = false; var priorityCount = 0; var unitSampler; function Test( settings ) { var i, l; ++Test.count; extend( this, settings ); this.assertions = []; this.semaphore = 0; this.usedAsync = false; this.module = config.currentModule; this.stack = sourceFromStacktrace( 3 ); // Register unique strings for ( i = 0, l = this.module.tests; i < l.length; i++ ) { if ( this.module.tests[ i ].name === this.testName ) { this.testName += " "; } } this.testId = generateHash( this.module.name, this.testName ); this.module.tests.push( { name: this.testName, testId: this.testId } ); if ( settings.skip ) { // Skipped tests will fully ignore any sent callback this.callback = function() {}; this.async = false; this.expected = 0; } else { this.assert = new Assert( this ); } } Test.count = 0; Test.prototype = { before: function() { if ( // Emit moduleStart when we're switching from one module to another this.module !== config.previousModule || // They could be equal (both undefined) but if the previousModule property doesn't // yet exist it means this is the first test in a suite that isn't wrapped in a // module, in which case we'll just emit a moduleStart event for 'undefined'. // Without this, reporters can get testStart before moduleStart which is a problem. !hasOwn.call( config, "previousModule" ) ) { if ( hasOwn.call( config, "previousModule" ) ) { runLoggingCallbacks( "moduleDone", { name: config.previousModule.name, tests: config.previousModule.tests, failed: config.moduleStats.bad, passed: config.moduleStats.all - config.moduleStats.bad, total: config.moduleStats.all, runtime: now() - config.moduleStats.started } ); } config.previousModule = this.module; config.moduleStats = { all: 0, bad: 0, started: now() }; runLoggingCallbacks( "moduleStart", { name: this.module.name, tests: this.module.tests } ); } config.current = this; if ( this.module.testEnvironment ) { delete this.module.testEnvironment.beforeEach; delete this.module.testEnvironment.afterEach; } this.testEnvironment = extend( {}, this.module.testEnvironment ); this.started = now(); runLoggingCallbacks( "testStart", { name: this.testName, module: this.module.name, testId: this.testId } ); if ( !config.pollution ) { saveGlobal(); } }, run: function() { var promise; config.current = this; if ( this.async ) { QUnit.stop(); } this.callbackStarted = now(); if ( config.notrycatch ) { runTest( this ); return; } try { runTest( this ); } catch ( e ) { this.pushFailure( "Died on test #" + ( this.assertions.length + 1 ) + " " + this.stack + ": " + ( e.message || e ), extractStacktrace( e, 0 ) ); // Else next test will carry the responsibility saveGlobal(); // Restart the tests if they're blocking if ( config.blocking ) { QUnit.start(); } } function runTest( test ) { promise = test.callback.call( test.testEnvironment, test.assert ); test.resolvePromise( promise ); } }, after: function() { checkPollution(); }, queueHook: function( hook, hookName ) { var promise, test = this; return function runHook() { config.current = test; if ( config.notrycatch ) { callHook(); return; } try { callHook(); } catch ( error ) { test.pushFailure( hookName + " failed on " + test.testName + ": " + ( error.message || error ), extractStacktrace( error, 0 ) ); } function callHook() { promise = hook.call( test.testEnvironment, test.assert ); test.resolvePromise( promise, hookName ); } }; }, // Currently only used for module level hooks, can be used to add global level ones hooks: function( handler ) { var hooks = []; function processHooks( test, module ) { if ( module.parentModule ) { processHooks( test, module.parentModule ); } if ( module.testEnvironment && QUnit.objectType( module.testEnvironment[ handler ] ) === "function" ) { hooks.push( test.queueHook( module.testEnvironment[ handler ], handler ) ); } } // Hooks are ignored on skipped tests if ( !this.skip ) { processHooks( this, this.module ); } return hooks; }, finish: function() { config.current = this; if ( config.requireExpects && this.expected === null ) { this.pushFailure( "Expected number of assertions to be defined, but expect() was " + "not called.", this.stack ); } else if ( this.expected !== null && this.expected !== this.assertions.length ) { this.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack ); } else if ( this.expected === null && !this.assertions.length ) { this.pushFailure( "Expected at least one assertion, but none were run - call " + "expect(0) to accept zero assertions.", this.stack ); } var i, bad = 0; this.runtime = now() - this.started; config.stats.all += this.assertions.length; config.moduleStats.all += this.assertions.length; for ( i = 0; i < this.assertions.length; i++ ) { if ( !this.assertions[ i ].result ) { bad++; config.stats.bad++; config.moduleStats.bad++; } } runLoggingCallbacks( "testDone", { name: this.testName, module: this.module.name, skipped: !!this.skip, failed: bad, passed: this.assertions.length - bad, total: this.assertions.length, runtime: this.runtime, // HTML Reporter use assertions: this.assertions, testId: this.testId, // Source of Test source: this.stack, // DEPRECATED: this property will be removed in 2.0.0, use runtime instead duration: this.runtime } ); // QUnit.reset() is deprecated and will be replaced for a new // fixture reset function on QUnit 2.0/2.1. // It's still called here for backwards compatibility handling QUnit.reset(); config.current = undefined; }, queue: function() { var priority, test = this; if ( !this.valid() ) { return; } function run() { // Each of these can by async synchronize( [ function() { test.before(); }, test.hooks( "beforeEach" ), function() { test.run(); }, test.hooks( "afterEach" ).reverse(), function() { test.after(); }, function() { test.finish(); } ] ); } // Prioritize previously failed tests, detected from sessionStorage priority = QUnit.config.reorder && defined.sessionStorage && +sessionStorage.getItem( "qunit-test-" + this.module.name + "-" + this.testName ); return synchronize( run, priority, config.seed ); }, pushResult: function( resultInfo ) { // Destructure of resultInfo = { result, actual, expected, message, negative } var source, details = { module: this.module.name, name: this.testName, result: resultInfo.result, message: resultInfo.message, actual: resultInfo.actual, expected: resultInfo.expected, testId: this.testId, negative: resultInfo.negative || false, runtime: now() - this.started }; if ( !resultInfo.result ) { source = sourceFromStacktrace(); if ( source ) { details.source = source; } } runLoggingCallbacks( "log", details ); this.assertions.push( { result: !!resultInfo.result, message: resultInfo.message } ); }, pushFailure: function( message, source, actual ) { if ( !( this instanceof Test ) ) { throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace( 2 ) ); } var details = { module: this.module.name, name: this.testName, result: false, message: message || "error", actual: actual || null, testId: this.testId, runtime: now() - this.started }; if ( source ) { details.source = source; } runLoggingCallbacks( "log", details ); this.assertions.push( { result: false, message: message } ); }, resolvePromise: function( promise, phase ) { var then, message, test = this; if ( promise != null ) { then = promise.then; if ( QUnit.objectType( then ) === "function" ) { QUnit.stop(); then.call( promise, function() { QUnit.start(); }, function( error ) { message = "Promise rejected " + ( !phase ? "during" : phase.replace( /Each$/, "" ) ) + " " + test.testName + ": " + ( error.message || error ); test.pushFailure( message, extractStacktrace( error, 0 ) ); // Else next test will carry the responsibility saveGlobal(); // Unblock QUnit.start(); } ); } } }, valid: function() { var filter = config.filter, regexFilter = /^(!?)\/([\w\W]*)\/(i?$)/.exec( filter ), module = config.module && config.module.toLowerCase(), fullName = ( this.module.name + ": " + this.testName ); function moduleChainNameMatch( testModule ) { var testModuleName = testModule.name ? testModule.name.toLowerCase() : null; if ( testModuleName === module ) { return true; } else if ( testModule.parentModule ) { return moduleChainNameMatch( testModule.parentModule ); } else { return false; } } function moduleChainIdMatch( testModule ) { return inArray( testModule.moduleId, config.moduleId ) > -1 || testModule.parentModule && moduleChainIdMatch( testModule.parentModule ); } // Internally-generated tests are always valid if ( this.callback && this.callback.validTest ) { return true; } if ( config.moduleId && config.moduleId.length > 0 && !moduleChainIdMatch( this.module ) ) { return false; } if ( config.testId && config.testId.length > 0 && inArray( this.testId, config.testId ) < 0 ) { return false; } if ( module && !moduleChainNameMatch( this.module ) ) { return false; } if ( !filter ) { return true; } return regexFilter ? this.regexFilter( !!regexFilter[ 1 ], regexFilter[ 2 ], regexFilter[ 3 ], fullName ) : this.stringFilter( filter, fullName ); }, regexFilter: function( exclude, pattern, flags, fullName ) { var regex = new RegExp( pattern, flags ); var match = regex.test( fullName ); return match !== exclude; }, stringFilter: function( filter, fullName ) { filter = filter.toLowerCase(); fullName = fullName.toLowerCase(); var include = filter.charAt( 0 ) !== "!"; if ( !include ) { filter = filter.slice( 1 ); } // If the filter matches, we need to honour include if ( fullName.indexOf( filter ) !== -1 ) { return include; } // Otherwise, do the opposite return !include; } }; // Resets the test setup. Useful for tests that modify the DOM. /* DEPRECATED: Use multiple tests instead of resetting inside a test. Use testStart or testDone for custom cleanup. This method will throw an error in 2.0, and will be removed in 2.1 */ QUnit.reset = function() { // Return on non-browser environments // This is necessary to not break on node tests if ( !defined.document ) { return; } var fixture = defined.document && document.getElementById && document.getElementById( "qunit-fixture" ); if ( fixture ) { fixture.innerHTML = config.fixture; } }; QUnit.pushFailure = function() { if ( !QUnit.config.current ) { throw new Error( "pushFailure() assertion outside test context, in " + sourceFromStacktrace( 2 ) ); } // Gets current test obj var currentTest = QUnit.config.current; return currentTest.pushFailure.apply( currentTest, arguments ); }; // Based on Java's String.hashCode, a simple but not // rigorously collision resistant hashing function function generateHash( module, testName ) { var hex, i = 0, hash = 0, str = module + "\x1C" + testName, len = str.length; for ( ; i < len; i++ ) { hash = ( ( hash << 5 ) - hash ) + str.charCodeAt( i ); hash |= 0; } // Convert the possibly negative integer hash code into an 8 character hex string, which isn't // strictly necessary but increases user understanding that the id is a SHA-like hash hex = ( 0x100000000 + hash ).toString( 16 ); if ( hex.length < 8 ) { hex = "0000000" + hex; } return hex.slice( -8 ); } function synchronize( callback, priority, seed ) { var last = !priority, index; if ( QUnit.objectType( callback ) === "array" ) { while ( callback.length ) { synchronize( callback.shift() ); } return; } if ( priority ) { config.queue.splice( priorityCount++, 0, callback ); } else if ( seed ) { if ( !unitSampler ) { unitSampler = unitSamplerGenerator( seed ); } // Insert into a random position after all priority items index = Math.floor( unitSampler() * ( config.queue.length - priorityCount + 1 ) ); config.queue.splice( priorityCount + index, 0, callback ); } else { config.queue.push( callback ); } if ( config.autorun && !config.blocking ) { process( last ); } } function unitSamplerGenerator( seed ) { // 32-bit xorshift, requires only a nonzero seed // http://excamera.com/sphinx/article-xorshift.html var sample = parseInt( generateHash( seed ), 16 ) || -1; return function() { sample ^= sample << 13; sample ^= sample >>> 17; sample ^= sample << 5; // ECMAScript has no unsigned number type if ( sample < 0 ) { sample += 0x100000000; } return sample / 0x100000000; }; } function saveGlobal() { config.pollution = []; if ( config.noglobals ) { for ( var key in global ) { if ( hasOwn.call( global, key ) ) { // In Opera sometimes DOM element ids show up here, ignore them if ( /^qunit-test-output/.test( key ) ) { continue; } config.pollution.push( key ); } } } } function checkPollution() { var newGlobals, deletedGlobals, old = config.pollution; saveGlobal(); newGlobals = diff( config.pollution, old ); if ( newGlobals.length > 0 ) { QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join( ", " ) ); } deletedGlobals = diff( old, config.pollution ); if ( deletedGlobals.length > 0 ) { QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join( ", " ) ); } } // Will be exposed as QUnit.asyncTest function asyncTest( testName, expected, callback ) { if ( arguments.length === 2 ) { callback = expected; expected = null; } QUnit.test( testName, expected, callback, true ); } // Will be exposed as QUnit.test function test( testName, expected, callback, async ) { if ( focused ) { return; } var newTest; if ( arguments.length === 2 ) { callback = expected; expected = null; } newTest = new Test( { testName: testName, expected: expected, async: async, callback: callback } ); newTest.queue(); } // Will be exposed as QUnit.skip function skip( testName ) { if ( focused ) { return; } var test = new Test( { testName: testName, skip: true } ); test.queue(); } // Will be exposed as QUnit.only function only( testName, expected, callback, async ) { var newTest; if ( focused ) { return; } QUnit.config.queue.length = 0; focused = true; if ( arguments.length === 2 ) { callback = expected; expected = null; } newTest = new Test( { testName: testName, expected: expected, async: async, callback: callback } ); newTest.queue(); } function Assert( testContext ) { this.test = testContext; } // Assert helpers QUnit.assert = Assert.prototype = { // Specify the number of expected assertions to guarantee that failed test // (no assertions are run at all) don't slip through. expect: function( asserts ) { if ( arguments.length === 1 ) { this.test.expected = asserts; } else { return this.test.expected; } }, // Increment this Test's semaphore counter, then return a function that // decrements that counter a maximum of once. async: function( count ) { var test = this.test, popped = false, acceptCallCount = count; if ( typeof acceptCallCount === "undefined" ) { acceptCallCount = 1; } test.semaphore += 1; test.usedAsync = true; pauseProcessing(); return function done() { if ( popped ) { test.pushFailure( "Too many calls to the `assert.async` callback", sourceFromStacktrace( 2 ) ); return; } acceptCallCount -= 1; if ( acceptCallCount > 0 ) { return; } test.semaphore -= 1; popped = true; resumeProcessing(); }; }, // Exports test.push() to the user API // Alias of pushResult. push: function( result, actual, expected, message, negative ) { var currentAssert = this instanceof Assert ? this : QUnit.config.current.assert; return currentAssert.pushResult( { result: result, actual: actual, expected: expected, message: message, negative: negative } ); }, pushResult: function( resultInfo ) { // Destructure of resultInfo = { result, actual, expected, message, negative } var assert = this, currentTest = ( assert instanceof Assert && assert.test ) || QUnit.config.current; // Backwards compatibility fix. // Allows the direct use of global exported assertions and QUnit.assert.* // Although, it's use is not recommended as it can leak assertions // to other tests from async tests, because we only get a reference to the current test, // not exactly the test where assertion were intended to be called. if ( !currentTest ) { throw new Error( "assertion outside test context, in " + sourceFromStacktrace( 2 ) ); } if ( currentTest.usedAsync === true && currentTest.semaphore === 0 ) { currentTest.pushFailure( "Assertion after the final `assert.async` was resolved", sourceFromStacktrace( 2 ) ); // Allow this assertion to continue running anyway... } if ( !( assert instanceof Assert ) ) { assert = currentTest.assert; } return assert.test.pushResult( resultInfo ); }, ok: function( result, message ) { message = message || ( result ? "okay" : "failed, expected argument to be truthy, was: " + QUnit.dump.parse( result ) ); this.pushResult( { result: !!result, actual: result, expected: true, message: message } ); }, notOk: function( result, message ) { message = message || ( !result ? "okay" : "failed, expected argument to be falsy, was: " + QUnit.dump.parse( result ) ); this.pushResult( { result: !result, actual: result, expected: false, message: message } ); }, equal: function( actual, expected, message ) { /*jshint eqeqeq:false */ this.pushResult( { result: expected == actual, actual: actual, expected: expected, message: message } ); }, notEqual: function( actual, expected, message ) { /*jshint eqeqeq:false */ this.pushResult( { result: expected != actual, actual: actual, expected: expected, message: message, negative: true } ); }, propEqual: function( actual, expected, message ) { actual = objectValues( actual ); expected = objectValues( expected ); this.pushResult( { result: QUnit.equiv( actual, expected ), actual: actual, expected: expected, message: message } ); }, notPropEqual: function( actual, expected, message ) { actual = objectValues( actual ); expected = objectValues( expected ); this.pushResult( { result: !QUnit.equiv( actual, expected ), actual: actual, expected: expected, message: message, negative: true } ); }, deepEqual: function( actual, expected, message ) { this.pushResult( { result: QUnit.equiv( actual, expected ), actual: actual, expected: expected, message: message } ); }, notDeepEqual: function( actual, expected, message ) { this.pushResult( { result: !QUnit.equiv( actual, expected ), actual: actual, expected: expected, message: message, negative: true } ); }, strictEqual: function( actual, expected, message ) { this.pushResult( { result: expected === actual, actual: actual, expected: expected, message: message } ); }, notStrictEqual: function( actual, expected, message ) { this.pushResult( { result: expected !== actual, actual: actual, expected: expected, message: message, negative: true } ); }, "throws": function( block, expected, message ) { var actual, expectedType, expectedOutput = expected, ok = false, currentTest = ( this instanceof Assert && this.test ) || QUnit.config.current; // 'expected' is optional unless doing string comparison if ( message == null && typeof expected === "string" ) { message = expected; expected = null; } currentTest.ignoreGlobalErrors = true; try { block.call( currentTest.testEnvironment ); } catch ( e ) { actual = e; } currentTest.ignoreGlobalErrors = false; if ( actual ) { expectedType = QUnit.objectType( expected ); // We don't want to validate thrown error if ( !expected ) { ok = true; expectedOutput = null; // Expected is a regexp } else if ( expectedType === "regexp" ) { ok = expected.test( errorString( actual ) ); // Expected is a string } else if ( expectedType === "string" ) { ok = expected === errorString( actual ); // Expected is a constructor, maybe an Error constructor } else if ( expectedType === "function" && actual instanceof expected ) { ok = true; // Expected is an Error object } else if ( expectedType === "object" ) { ok = actual instanceof expected.constructor && actual.name === expected.name && actual.message === expected.message; // Expected is a validation function which returns true if validation passed } else if ( expectedType === "function" && expected.call( {}, actual ) === true ) { expectedOutput = null; ok = true; } } currentTest.assert.pushResult( { result: ok, actual: actual, expected: expectedOutput, message: message } ); } }; // Provide an alternative to assert.throws(), for environments that consider throws a reserved word // Known to us are: Closure Compiler, Narwhal ( function() { /*jshint sub:true */ Assert.prototype.raises = Assert.prototype [ "throws" ]; //jscs:ignore requireDotNotation }() ); function errorString( error ) { var name, message, resultErrorString = error.toString(); if ( resultErrorString.substring( 0, 7 ) === "[object" ) { name = error.name ? error.name.toString() : "Error"; message = error.message ? error.message.toString() : ""; if ( name && message ) { return name + ": " + message; } else if ( name ) { return name; } else if ( message ) { return message; } else { return "Error"; } } else { return resultErrorString; } } // Test for equality any JavaScript type. // Author: Philippe Rath QUnit.equiv = ( function() { // Stack to decide between skip/abort functions var callers = []; // Stack to avoiding loops from circular referencing var parents = []; var parentsB = []; var getProto = Object.getPrototypeOf || function( obj ) { /*jshint proto: true */ return obj.__proto__; }; function useStrictEquality( b, a ) { // To catch short annotation VS 'new' annotation of a declaration. e.g.: // `var i = 1;` // `var j = new Number(1);` if ( typeof a === "object" ) { a = a.valueOf(); } if ( typeof b === "object" ) { b = b.valueOf(); } return a === b; } function compareConstructors( a, b ) { var protoA = getProto( a ); var protoB = getProto( b ); // Comparing constructors is more strict than using `instanceof` if ( a.constructor === b.constructor ) { return true; } // Ref #851 // If the obj prototype descends from a null constructor, treat it // as a null prototype. if ( protoA && protoA.constructor === null ) { protoA = null; } if ( protoB && protoB.constructor === null ) { protoB = null; } // Allow objects with no prototype to be equivalent to // objects with Object as their constructor. if ( ( protoA === null && protoB === Object.prototype ) || ( protoB === null && protoA === Object.prototype ) ) { return true; } return false; } function getRegExpFlags( regexp ) { return "flags" in regexp ? regexp.flags : regexp.toString().match( /[gimuy]*$/ )[ 0 ]; } var callbacks = { "string": useStrictEquality, "boolean": useStrictEquality, "number": useStrictEquality, "null": useStrictEquality, "undefined": useStrictEquality, "symbol": useStrictEquality, "date": useStrictEquality, "nan": function() { return true; }, "regexp": function( b, a ) { return a.source === b.source && // Include flags in the comparison getRegExpFlags( a ) === getRegExpFlags( b ); }, // - skip when the property is a method of an instance (OOP) // - abort otherwise, // initial === would have catch identical references anyway "function": function() { var caller = callers[ callers.length - 1 ]; return caller !== Object && typeof caller !== "undefined"; }, "array": function( b, a ) { var i, j, len, loop, aCircular, bCircular; len = a.length; if ( len !== b.length ) { // Safe and faster return false; } // Track reference to avoid circular references parents.push( a ); parentsB.push( b ); for ( i = 0; i < len; i++ ) { loop = false; for ( j = 0; j < parents.length; j++ ) { aCircular = parents[ j ] === a[ i ]; bCircular = parentsB[ j ] === b[ i ]; if ( aCircular || bCircular ) { if ( a[ i ] === b[ i ] || aCircular && bCircular ) { loop = true; } else { parents.pop(); parentsB.pop(); return false; } } } if ( !loop && !innerEquiv( a[ i ], b[ i ] ) ) { parents.pop(); parentsB.pop(); return false; } } parents.pop(); parentsB.pop(); return true; }, "set": function( b, a ) { var innerEq, outerEq = true; if ( a.size !== b.size ) { return false; } a.forEach( function( aVal ) { innerEq = false; b.forEach( function( bVal ) { if ( innerEquiv( bVal, aVal ) ) { innerEq = true; } } ); if ( !innerEq ) { outerEq = false; } } ); return outerEq; }, "map": function( b, a ) { var innerEq, outerEq = true; if ( a.size !== b.size ) { return false; } a.forEach( function( aVal, aKey ) { innerEq = false; b.forEach( function( bVal, bKey ) { if ( innerEquiv( [ bVal, bKey ], [ aVal, aKey ] ) ) { innerEq = true; } } ); if ( !innerEq ) { outerEq = false; } } ); return outerEq; }, "object": function( b, a ) { var i, j, loop, aCircular, bCircular; // Default to true var eq = true; var aProperties = []; var bProperties = []; if ( compareConstructors( a, b ) === false ) { return false; } // Stack constructor before traversing properties callers.push( a.constructor ); // Track reference to avoid circular references parents.push( a ); parentsB.push( b ); // Be strict: don't ensure hasOwnProperty and go deep for ( i in a ) { loop = false; for ( j = 0; j < parents.length; j++ ) { aCircular = parents[ j ] === a[ i ]; bCircular = parentsB[ j ] === b[ i ]; if ( aCircular || bCircular ) { if ( a[ i ] === b[ i ] || aCircular && bCircular ) { loop = true; } else { eq = false; break; } } } aProperties.push( i ); if ( !loop && !innerEquiv( a[ i ], b[ i ] ) ) { eq = false; break; } } parents.pop(); parentsB.pop(); // Unstack, we are done callers.pop(); for ( i in b ) { // Collect b's properties bProperties.push( i ); } // Ensures identical properties name return eq && innerEquiv( aProperties.sort(), bProperties.sort() ); } }; function typeEquiv( a, b ) { var type = QUnit.objectType( a ); return QUnit.objectType( b ) === type && callbacks[ type ]( b, a ); } // The real equiv function function innerEquiv( a, b ) { // We're done when there's nothing more to compare if ( arguments.length < 2 ) { return true; } // Require type-specific equality return ( a === b || typeEquiv( a, b ) ) && // ...across all consecutive argument pairs ( arguments.length === 2 || innerEquiv.apply( this, [].slice.call( arguments, 1 ) ) ); } return innerEquiv; }() ); // Based on jsDump by Ariel Flesler // http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html QUnit.dump = ( function() { function quote( str ) { return "\"" + str.toString().replace( /\\/g, "\\\\" ).replace( /"/g, "\\\"" ) + "\""; } function literal( o ) { return o + ""; } function join( pre, arr, post ) { var s = dump.separator(), base = dump.indent(), inner = dump.indent( 1 ); if ( arr.join ) { arr = arr.join( "," + s + inner ); } if ( !arr ) { return pre + post; } return [ pre, inner + arr, base + post ].join( s ); } function array( arr, stack ) { var i = arr.length, ret = new Array( i ); if ( dump.maxDepth && dump.depth > dump.maxDepth ) { return "[object Array]"; } this.up(); while ( i-- ) { ret[ i ] = this.parse( arr[ i ], undefined, stack ); } this.down(); return join( "[", ret, "]" ); } var reName = /^function (\w+)/, dump = { // The objType is used mostly internally, you can fix a (custom) type in advance parse: function( obj, objType, stack ) { stack = stack || []; var res, parser, parserType, inStack = inArray( obj, stack ); if ( inStack !== -1 ) { return "recursion(" + ( inStack - stack.length ) + ")"; } objType = objType || this.typeOf( obj ); parser = this.parsers[ objType ]; parserType = typeof parser; if ( parserType === "function" ) { stack.push( obj ); res = parser.call( this, obj, stack ); stack.pop(); return res; } return ( parserType === "string" ) ? parser : this.parsers.error; }, typeOf: function( obj ) { var type; if ( obj === null ) { type = "null"; } else if ( typeof obj === "undefined" ) { type = "undefined"; } else if ( QUnit.is( "regexp", obj ) ) { type = "regexp"; } else if ( QUnit.is( "date", obj ) ) { type = "date"; } else if ( QUnit.is( "function", obj ) ) { type = "function"; } else if ( obj.setInterval !== undefined && obj.document !== undefined && obj.nodeType === undefined ) { type = "window"; } else if ( obj.nodeType === 9 ) { type = "document"; } else if ( obj.nodeType ) { type = "node"; } else if ( // Native arrays toString.call( obj ) === "[object Array]" || // NodeList objects ( typeof obj.length === "number" && obj.item !== undefined && ( obj.length ? obj.item( 0 ) === obj[ 0 ] : ( obj.item( 0 ) === null && obj[ 0 ] === undefined ) ) ) ) { type = "array"; } else if ( obj.constructor === Error.prototype.constructor ) { type = "error"; } else { type = typeof obj; } return type; }, separator: function() { return this.multiline ? this.HTML ? "
    " : "\n" : this.HTML ? " " : " "; }, // Extra can be a number, shortcut for increasing-calling-decreasing indent: function( extra ) { if ( !this.multiline ) { return ""; } var chr = this.indentChar; if ( this.HTML ) { chr = chr.replace( /\t/g, " " ).replace( / /g, " " ); } return new Array( this.depth + ( extra || 0 ) ).join( chr ); }, up: function( a ) { this.depth += a || 1; }, down: function( a ) { this.depth -= a || 1; }, setParser: function( name, parser ) { this.parsers[ name ] = parser; }, // The next 3 are exposed so you can use them quote: quote, literal: literal, join: join, depth: 1, maxDepth: QUnit.config.maxDepth, // This is the list of parsers, to modify them, use dump.setParser parsers: { window: "[Window]", document: "[Document]", error: function( error ) { return "Error(\"" + error.message + "\")"; }, unknown: "[Unknown]", "null": "null", "undefined": "undefined", "function": function( fn ) { var ret = "function", // Functions never have name in IE name = "name" in fn ? fn.name : ( reName.exec( fn ) || [] )[ 1 ]; if ( name ) { ret += " " + name; } ret += "("; ret = [ ret, dump.parse( fn, "functionArgs" ), "){" ].join( "" ); return join( ret, dump.parse( fn, "functionCode" ), "}" ); }, array: array, nodelist: array, "arguments": array, object: function( map, stack ) { var keys, key, val, i, nonEnumerableProperties, ret = []; if ( dump.maxDepth && dump.depth > dump.maxDepth ) { return "[object Object]"; } dump.up(); keys = []; for ( key in map ) { keys.push( key ); } // Some properties are not always enumerable on Error objects. nonEnumerableProperties = [ "message", "name" ]; for ( i in nonEnumerableProperties ) { key = nonEnumerableProperties[ i ]; if ( key in map && inArray( key, keys ) < 0 ) { keys.push( key ); } } keys.sort(); for ( i = 0; i < keys.length; i++ ) { key = keys[ i ]; val = map[ key ]; ret.push( dump.parse( key, "key" ) + ": " + dump.parse( val, undefined, stack ) ); } dump.down(); return join( "{", ret, "}" ); }, node: function( node ) { var len, i, val, open = dump.HTML ? "<" : "<", close = dump.HTML ? ">" : ">", tag = node.nodeName.toLowerCase(), ret = open + tag, attrs = node.attributes; if ( attrs ) { for ( i = 0, len = attrs.length; i < len; i++ ) { val = attrs[ i ].nodeValue; // IE6 includes all attributes in .attributes, even ones not explicitly // set. Those have values like undefined, null, 0, false, "" or // "inherit". if ( val && val !== "inherit" ) { ret += " " + attrs[ i ].nodeName + "=" + dump.parse( val, "attribute" ); } } } ret += close; // Show content of TextNode or CDATASection if ( node.nodeType === 3 || node.nodeType === 4 ) { ret += node.nodeValue; } return ret + open + "/" + tag + close; }, // Function calls it internally, it's the arguments part of the function functionArgs: function( fn ) { var args, l = fn.length; if ( !l ) { return ""; } args = new Array( l ); while ( l-- ) { // 97 is 'a' args[ l ] = String.fromCharCode( 97 + l ); } return " " + args.join( ", " ) + " "; }, // Object calls it internally, the key part of an item in a map key: quote, // Function calls it internally, it's the content of the function functionCode: "[code]", // Node calls it internally, it's a html attribute value attribute: quote, string: quote, date: quote, regexp: literal, number: literal, "boolean": literal }, // If true, entities are escaped ( <, >, \t, space and \n ) HTML: false, // Indentation unit indentChar: " ", // If true, items in a collection, are separated by a \n, else just a space. multiline: true }; return dump; }() ); // Back compat QUnit.jsDump = QUnit.dump; // Deprecated // Extend assert methods to QUnit for Backwards compatibility ( function() { var i, assertions = Assert.prototype; function applyCurrent( current ) { return function() { var assert = new Assert( QUnit.config.current ); current.apply( assert, arguments ); }; } for ( i in assertions ) { QUnit[ i ] = applyCurrent( assertions[ i ] ); } }() ); // For browser, export only select globals if ( defined.document ) { ( function() { var i, l, keys = [ "test", "module", "expect", "asyncTest", "start", "stop", "ok", "notOk", "equal", "notEqual", "propEqual", "notPropEqual", "deepEqual", "notDeepEqual", "strictEqual", "notStrictEqual", "throws", "raises" ]; for ( i = 0, l = keys.length; i < l; i++ ) { window[ keys[ i ] ] = QUnit[ keys[ i ] ]; } }() ); window.QUnit = QUnit; } // For nodejs if ( typeof module !== "undefined" && module && module.exports ) { module.exports = QUnit; // For consistency with CommonJS environments' exports module.exports.QUnit = QUnit; } // For CommonJS with exports, but without module.exports, like Rhino if ( typeof exports !== "undefined" && exports ) { exports.QUnit = QUnit; } if ( typeof define === "function" && define.amd ) { define( function() { return QUnit; } ); QUnit.config.autostart = false; } // Get a reference to the global object, like window in browsers }( ( function() { return this; }() ) ) ); ( function() { // Only interact with URLs via window.location var location = typeof window !== "undefined" && window.location; if ( !location ) { return; } var urlParams = getUrlParams(); QUnit.urlParams = urlParams; // Match module/test by inclusion in an array QUnit.config.moduleId = [].concat( urlParams.moduleId || [] ); QUnit.config.testId = [].concat( urlParams.testId || [] ); // Exact case-insensitive match of the module name QUnit.config.module = urlParams.module; // Regular expression or case-insenstive substring match against "moduleName: testName" QUnit.config.filter = urlParams.filter; // Test order randomization if ( urlParams.seed === true ) { // Generate a random seed if the option is specified without a value QUnit.config.seed = Math.random().toString( 36 ).slice( 2 ); } else if ( urlParams.seed ) { QUnit.config.seed = urlParams.seed; } // Add URL-parameter-mapped config values with UI form rendering data QUnit.config.urlConfig.push( { id: "hidepassed", label: "Hide passed tests", tooltip: "Only show tests and assertions that fail. Stored as query-strings." }, { id: "noglobals", label: "Check for Globals", tooltip: "Enabling this will test if any test introduces new properties on the " + "global object (`window` in Browsers). Stored as query-strings." }, { id: "notrycatch", label: "No try-catch", tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging " + "exceptions in IE reasonable. Stored as query-strings." } ); QUnit.begin( function() { var i, option, urlConfig = QUnit.config.urlConfig; for ( i = 0; i < urlConfig.length; i++ ) { // Options can be either strings or objects with nonempty "id" properties option = QUnit.config.urlConfig[ i ]; if ( typeof option !== "string" ) { option = option.id; } if ( QUnit.config[ option ] === undefined ) { QUnit.config[ option ] = urlParams[ option ]; } } } ); function getUrlParams() { var i, param, name, value; var urlParams = {}; var params = location.search.slice( 1 ).split( "&" ); var length = params.length; for ( i = 0; i < length; i++ ) { if ( params[ i ] ) { param = params[ i ].split( "=" ); name = decodeURIComponent( param[ 0 ] ); // Allow just a key to turn on a flag, e.g., test.html?noglobals value = param.length === 1 || decodeURIComponent( param.slice( 1 ).join( "=" ) ) ; if ( urlParams[ name ] ) { urlParams[ name ] = [].concat( urlParams[ name ], value ); } else { urlParams[ name ] = value; } } } return urlParams; } // Don't load the HTML Reporter on non-browser environments if ( typeof window === "undefined" || !window.document ) { return; } // Deprecated QUnit.init - Ref #530 // Re-initialize the configuration options QUnit.init = function() { var config = QUnit.config; config.stats = { all: 0, bad: 0 }; config.moduleStats = { all: 0, bad: 0 }; config.started = 0; config.updateRate = 1000; config.blocking = false; config.autostart = true; config.autorun = false; config.filter = ""; config.queue = []; appendInterface(); }; var config = QUnit.config, document = window.document, collapseNext = false, hasOwn = Object.prototype.hasOwnProperty, unfilteredUrl = setUrl( { filter: undefined, module: undefined, moduleId: undefined, testId: undefined } ), defined = { sessionStorage: ( function() { var x = "qunit-test-string"; try { sessionStorage.setItem( x, x ); sessionStorage.removeItem( x ); return true; } catch ( e ) { return false; } }() ) }, modulesList = []; /** * Escape text for attribute or text content. */ function escapeText( s ) { if ( !s ) { return ""; } s = s + ""; // Both single quotes and double quotes (for attributes) return s.replace( /['"<>&]/g, function( s ) { switch ( s ) { case "'": return "'"; case "\"": return """; case "<": return "<"; case ">": return ">"; case "&": return "&"; } } ); } /** * @param {HTMLElement} elem * @param {string} type * @param {Function} fn */ function addEvent( elem, type, fn ) { if ( elem.addEventListener ) { // Standards-based browsers elem.addEventListener( type, fn, false ); } else if ( elem.attachEvent ) { // Support: IE <9 elem.attachEvent( "on" + type, function() { var event = window.event; if ( !event.target ) { event.target = event.srcElement || document; } fn.call( elem, event ); } ); } } /** * @param {Array|NodeList} elems * @param {string} type * @param {Function} fn */ function addEvents( elems, type, fn ) { var i = elems.length; while ( i-- ) { addEvent( elems[ i ], type, fn ); } } function hasClass( elem, name ) { return ( " " + elem.className + " " ).indexOf( " " + name + " " ) >= 0; } function addClass( elem, name ) { if ( !hasClass( elem, name ) ) { elem.className += ( elem.className ? " " : "" ) + name; } } function toggleClass( elem, name, force ) { if ( force || typeof force === "undefined" && !hasClass( elem, name ) ) { addClass( elem, name ); } else { removeClass( elem, name ); } } function removeClass( elem, name ) { var set = " " + elem.className + " "; // Class name may appear multiple times while ( set.indexOf( " " + name + " " ) >= 0 ) { set = set.replace( " " + name + " ", " " ); } // Trim for prettiness elem.className = typeof set.trim === "function" ? set.trim() : set.replace( /^\s+|\s+$/g, "" ); } function id( name ) { return document.getElementById && document.getElementById( name ); } function getUrlConfigHtml() { var i, j, val, escaped, escapedTooltip, selection = false, urlConfig = config.urlConfig, urlConfigHtml = ""; for ( i = 0; i < urlConfig.length; i++ ) { // Options can be either strings or objects with nonempty "id" properties val = config.urlConfig[ i ]; if ( typeof val === "string" ) { val = { id: val, label: val }; } escaped = escapeText( val.id ); escapedTooltip = escapeText( val.tooltip ); if ( !val.value || typeof val.value === "string" ) { urlConfigHtml += ""; } else { urlConfigHtml += ""; } } return urlConfigHtml; } // Handle "click" events on toolbar checkboxes and "change" for select menus. // Updates the URL with the new state of `config.urlConfig` values. function toolbarChanged() { var updatedUrl, value, tests, field = this, params = {}; // Detect if field is a select menu or a checkbox if ( "selectedIndex" in field ) { value = field.options[ field.selectedIndex ].value || undefined; } else { value = field.checked ? ( field.defaultValue || true ) : undefined; } params[ field.name ] = value; updatedUrl = setUrl( params ); // Check if we can apply the change without a page refresh if ( "hidepassed" === field.name && "replaceState" in window.history ) { QUnit.urlParams[ field.name ] = value; config[ field.name ] = value || false; tests = id( "qunit-tests" ); if ( tests ) { toggleClass( tests, "hidepass", value || false ); } window.history.replaceState( null, "", updatedUrl ); } else { window.location = updatedUrl; } } function setUrl( params ) { var key, arrValue, i, querystring = "?", location = window.location; params = QUnit.extend( QUnit.extend( {}, QUnit.urlParams ), params ); for ( key in params ) { // Skip inherited or undefined properties if ( hasOwn.call( params, key ) && params[ key ] !== undefined ) { // Output a parameter for each value of this key (but usually just one) arrValue = [].concat( params[ key ] ); for ( i = 0; i < arrValue.length; i++ ) { querystring += encodeURIComponent( key ); if ( arrValue[ i ] !== true ) { querystring += "=" + encodeURIComponent( arrValue[ i ] ); } querystring += "&"; } } } return location.protocol + "//" + location.host + location.pathname + querystring.slice( 0, -1 ); } function applyUrlParams() { var selectedModule, modulesList = id( "qunit-modulefilter" ), filter = id( "qunit-filter-input" ).value; selectedModule = modulesList ? decodeURIComponent( modulesList.options[ modulesList.selectedIndex ].value ) : undefined; window.location = setUrl( { module: ( selectedModule === "" ) ? undefined : selectedModule, filter: ( filter === "" ) ? undefined : filter, // Remove moduleId and testId filters moduleId: undefined, testId: undefined } ); } function toolbarUrlConfigContainer() { var urlConfigContainer = document.createElement( "span" ); urlConfigContainer.innerHTML = getUrlConfigHtml(); addClass( urlConfigContainer, "qunit-url-config" ); // For oldIE support: // * Add handlers to the individual elements instead of the container // * Use "click" instead of "change" for checkboxes addEvents( urlConfigContainer.getElementsByTagName( "input" ), "click", toolbarChanged ); addEvents( urlConfigContainer.getElementsByTagName( "select" ), "change", toolbarChanged ); return urlConfigContainer; } function toolbarLooseFilter() { var filter = document.createElement( "form" ), label = document.createElement( "label" ), input = document.createElement( "input" ), button = document.createElement( "button" ); addClass( filter, "qunit-filter" ); label.innerHTML = "Filter: "; input.type = "text"; input.value = config.filter || ""; input.name = "filter"; input.id = "qunit-filter-input"; button.innerHTML = "Go"; label.appendChild( input ); filter.appendChild( label ); filter.appendChild( button ); addEvent( filter, "submit", function( ev ) { applyUrlParams(); if ( ev && ev.preventDefault ) { ev.preventDefault(); } return false; } ); return filter; } function toolbarModuleFilterHtml() { var i, moduleFilterHtml = ""; if ( !modulesList.length ) { return false; } moduleFilterHtml += "" + ""; return moduleFilterHtml; } function toolbarModuleFilter() { var toolbar = id( "qunit-testrunner-toolbar" ), moduleFilter = document.createElement( "span" ), moduleFilterHtml = toolbarModuleFilterHtml(); if ( !toolbar || !moduleFilterHtml ) { return false; } moduleFilter.setAttribute( "id", "qunit-modulefilter-container" ); moduleFilter.innerHTML = moduleFilterHtml; addEvent( moduleFilter.lastChild, "change", applyUrlParams ); toolbar.appendChild( moduleFilter ); } function appendToolbar() { var toolbar = id( "qunit-testrunner-toolbar" ); if ( toolbar ) { toolbar.appendChild( toolbarUrlConfigContainer() ); toolbar.appendChild( toolbarLooseFilter() ); toolbarModuleFilter(); } } function appendHeader() { var header = id( "qunit-header" ); if ( header ) { header.innerHTML = "" + header.innerHTML + " "; } } function appendBanner() { var banner = id( "qunit-banner" ); if ( banner ) { banner.className = ""; } } function appendTestResults() { var tests = id( "qunit-tests" ), result = id( "qunit-testresult" ); if ( result ) { result.parentNode.removeChild( result ); } if ( tests ) { tests.innerHTML = ""; result = document.createElement( "p" ); result.id = "qunit-testresult"; result.className = "result"; tests.parentNode.insertBefore( result, tests ); result.innerHTML = "Running...
     "; } } function storeFixture() { var fixture = id( "qunit-fixture" ); if ( fixture ) { config.fixture = fixture.innerHTML; } } function appendFilteredTest() { var testId = QUnit.config.testId; if ( !testId || testId.length <= 0 ) { return ""; } return "
    Rerunning selected tests: " + escapeText( testId.join( ", " ) ) + " Run all tests
    "; } function appendUserAgent() { var userAgent = id( "qunit-userAgent" ); if ( userAgent ) { userAgent.innerHTML = ""; userAgent.appendChild( document.createTextNode( "QUnit " + QUnit.version + "; " + navigator.userAgent ) ); } } function appendInterface() { var qunit = id( "qunit" ); if ( qunit ) { qunit.innerHTML = "

    " + escapeText( document.title ) + "

    " + "

    " + "
    " + appendFilteredTest() + "

    " + "
      "; } appendHeader(); appendBanner(); appendTestResults(); appendUserAgent(); appendToolbar(); } function appendTestsList( modules ) { var i, l, x, z, test, moduleObj; for ( i = 0, l = modules.length; i < l; i++ ) { moduleObj = modules[ i ]; for ( x = 0, z = moduleObj.tests.length; x < z; x++ ) { test = moduleObj.tests[ x ]; appendTest( test.name, test.testId, moduleObj.name ); } } } function appendTest( name, testId, moduleName ) { var title, rerunTrigger, testBlock, assertList, tests = id( "qunit-tests" ); if ( !tests ) { return; } title = document.createElement( "strong" ); title.innerHTML = getNameHtml( name, moduleName ); rerunTrigger = document.createElement( "a" ); rerunTrigger.innerHTML = "Rerun"; rerunTrigger.href = setUrl( { testId: testId } ); testBlock = document.createElement( "li" ); testBlock.appendChild( title ); testBlock.appendChild( rerunTrigger ); testBlock.id = "qunit-test-output-" + testId; assertList = document.createElement( "ol" ); assertList.className = "qunit-assert-list"; testBlock.appendChild( assertList ); tests.appendChild( testBlock ); } // HTML Reporter initialization and load QUnit.begin( function( details ) { var i, moduleObj, tests; // Sort modules by name for the picker for ( i = 0; i < details.modules.length; i++ ) { moduleObj = details.modules[ i ]; if ( moduleObj.name ) { modulesList.push( moduleObj.name ); } } modulesList.sort( function( a, b ) { return a.localeCompare( b ); } ); // Capture fixture HTML from the page storeFixture(); // Initialize QUnit elements appendInterface(); appendTestsList( details.modules ); tests = id( "qunit-tests" ); if ( tests && config.hidepassed ) { addClass( tests, "hidepass" ); } } ); QUnit.done( function( details ) { var i, key, banner = id( "qunit-banner" ), tests = id( "qunit-tests" ), html = [ "Tests completed in ", details.runtime, " milliseconds.
      ", "", details.passed, " assertions of ", details.total, " passed, ", details.failed, " failed." ].join( "" ); if ( banner ) { banner.className = details.failed ? "qunit-fail" : "qunit-pass"; } if ( tests ) { id( "qunit-testresult" ).innerHTML = html; } if ( config.altertitle && document.title ) { // Show ? for good, ? for bad suite result in title // use escape sequences in case file gets loaded with non-utf-8-charset document.title = [ ( details.failed ? "\u2716" : "\u2714" ), document.title.replace( /^[\u2714\u2716] /i, "" ) ].join( " " ); } // Clear own sessionStorage items if all tests passed if ( config.reorder && defined.sessionStorage && details.failed === 0 ) { for ( i = 0; i < sessionStorage.length; i++ ) { key = sessionStorage.key( i++ ); if ( key.indexOf( "qunit-test-" ) === 0 ) { sessionStorage.removeItem( key ); } } } // Scroll back to top to show results if ( config.scrolltop && window.scrollTo ) { window.scrollTo( 0, 0 ); } } ); function getNameHtml( name, module ) { var nameHtml = ""; if ( module ) { nameHtml = "" + escapeText( module ) + ": "; } nameHtml += "" + escapeText( name ) + ""; return nameHtml; } QUnit.testStart( function( details ) { var running, testBlock, bad; testBlock = id( "qunit-test-output-" + details.testId ); if ( testBlock ) { testBlock.className = "running"; } else { // Report later registered tests appendTest( details.name, details.testId, details.module ); } running = id( "qunit-testresult" ); if ( running ) { bad = QUnit.config.reorder && defined.sessionStorage && +sessionStorage.getItem( "qunit-test-" + details.module + "-" + details.name ); running.innerHTML = ( bad ? "Rerunning previously failed test:
      " : "Running:
      " ) + getNameHtml( details.name, details.module ); } } ); function stripHtml( string ) { // Strip tags, html entity and whitespaces return string.replace( /<\/?[^>]+(>|$)/g, "" ).replace( /\"/g, "" ).replace( /\s+/g, "" ); } QUnit.log( function( details ) { var assertList, assertLi, message, expected, actual, diff, showDiff = false, testItem = id( "qunit-test-output-" + details.testId ); if ( !testItem ) { return; } message = escapeText( details.message ) || ( details.result ? "okay" : "failed" ); message = "" + message + ""; message += "@ " + details.runtime + " ms"; // The pushFailure doesn't provide details.expected // when it calls, it's implicit to also not show expected and diff stuff // Also, we need to check details.expected existence, as it can exist and be undefined if ( !details.result && hasOwn.call( details, "expected" ) ) { if ( details.negative ) { expected = "NOT " + QUnit.dump.parse( details.expected ); } else { expected = QUnit.dump.parse( details.expected ); } actual = QUnit.dump.parse( details.actual ); message += ""; if ( actual !== expected ) { message += ""; // Don't show diff if actual or expected are booleans if ( !( /^(true|false)$/.test( actual ) ) && !( /^(true|false)$/.test( expected ) ) ) { diff = QUnit.diff( expected, actual ); showDiff = stripHtml( diff ).length !== stripHtml( expected ).length + stripHtml( actual ).length; } // Don't show diff if expected and actual are totally different if ( showDiff ) { message += ""; } } else if ( expected.indexOf( "[object Array]" ) !== -1 || expected.indexOf( "[object Object]" ) !== -1 ) { message += ""; } else { message += ""; } if ( details.source ) { message += ""; } message += "
      Expected:
      " +
      			escapeText( expected ) +
      			"
      Result:
      " +
      				escapeText( actual ) + "
      Diff:
      " +
      					diff + "
      Message: " + "Diff suppressed as the depth of object is more than current max depth (" + QUnit.config.maxDepth + ").

      Hint: Use QUnit.dump.maxDepth to " + " run with a higher max depth or " + "Rerun without max depth.

      Message: " + "Diff suppressed as the expected and actual results have an equivalent" + " serialization
      Source:
      " +
      				escapeText( details.source ) + "
      "; // This occurs when pushFailure is set and we have an extracted stack trace } else if ( !details.result && details.source ) { message += "" + "" + "
      Source:
      " +
      			escapeText( details.source ) + "
      "; } assertList = testItem.getElementsByTagName( "ol" )[ 0 ]; assertLi = document.createElement( "li" ); assertLi.className = details.result ? "pass" : "fail"; assertLi.innerHTML = message; assertList.appendChild( assertLi ); } ); QUnit.testDone( function( details ) { var testTitle, time, testItem, assertList, good, bad, testCounts, skipped, sourceName, tests = id( "qunit-tests" ); if ( !tests ) { return; } testItem = id( "qunit-test-output-" + details.testId ); assertList = testItem.getElementsByTagName( "ol" )[ 0 ]; good = details.passed; bad = details.failed; // Store result when possible if ( config.reorder && defined.sessionStorage ) { if ( bad ) { sessionStorage.setItem( "qunit-test-" + details.module + "-" + details.name, bad ); } else { sessionStorage.removeItem( "qunit-test-" + details.module + "-" + details.name ); } } if ( bad === 0 ) { // Collapse the passing tests addClass( assertList, "qunit-collapsed" ); } else if ( bad && config.collapse && !collapseNext ) { // Skip collapsing the first failing test collapseNext = true; } else { // Collapse remaining tests addClass( assertList, "qunit-collapsed" ); } // The testItem.firstChild is the test name testTitle = testItem.firstChild; testCounts = bad ? "" + bad + ", " + "" + good + ", " : ""; testTitle.innerHTML += " (" + testCounts + details.assertions.length + ")"; if ( details.skipped ) { testItem.className = "skipped"; skipped = document.createElement( "em" ); skipped.className = "qunit-skipped-label"; skipped.innerHTML = "skipped"; testItem.insertBefore( skipped, testTitle ); } else { addEvent( testTitle, "click", function() { toggleClass( assertList, "qunit-collapsed" ); } ); testItem.className = bad ? "fail" : "pass"; time = document.createElement( "span" ); time.className = "runtime"; time.innerHTML = details.runtime + " ms"; testItem.insertBefore( time, assertList ); } // Show the source of the test when showing assertions if ( details.source ) { sourceName = document.createElement( "p" ); sourceName.innerHTML = "Source: " + details.source; addClass( sourceName, "qunit-source" ); if ( bad === 0 ) { addClass( sourceName, "qunit-collapsed" ); } addEvent( testTitle, "click", function() { toggleClass( sourceName, "qunit-collapsed" ); } ); testItem.appendChild( sourceName ); } } ); // Avoid readyState issue with phantomjs // Ref: #818 var notPhantom = ( function( p ) { return !( p && p.version && p.version.major > 0 ); } )( window.phantom ); if ( notPhantom && document.readyState === "complete" ) { QUnit.load(); } else { addEvent( window, "load", QUnit.load ); } /* * This file is a modified version of google-diff-match-patch's JavaScript implementation * (https://code.google.com/p/google-diff-match-patch/source/browse/trunk/javascript/diff_match_patch_uncompressed.js), * modifications are licensed as more fully set forth in LICENSE.txt. * * The original source of google-diff-match-patch is attributable and licensed as follows: * * Copyright 2006 Google Inc. * https://code.google.com/p/google-diff-match-patch/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * More Info: * https://code.google.com/p/google-diff-match-patch/ * * Usage: QUnit.diff(expected, actual) * */ QUnit.diff = ( function() { function DiffMatchPatch() { } // DIFF FUNCTIONS /** * The data structure representing a diff is an array of tuples: * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] * which means: delete 'Hello', add 'Goodbye' and keep ' world.' */ var DIFF_DELETE = -1, DIFF_INSERT = 1, DIFF_EQUAL = 0; /** * Find the differences between two texts. Simplifies the problem by stripping * any common prefix or suffix off the texts before diffing. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {boolean=} optChecklines Optional speedup flag. If present and false, * then don't run a line-level diff first to identify the changed areas. * Defaults to true, which does a faster, slightly less optimal diff. * @return {!Array.} Array of diff tuples. */ DiffMatchPatch.prototype.DiffMain = function( text1, text2, optChecklines ) { var deadline, checklines, commonlength, commonprefix, commonsuffix, diffs; // The diff must be complete in up to 1 second. deadline = ( new Date() ).getTime() + 1000; // Check for null inputs. if ( text1 === null || text2 === null ) { throw new Error( "Null input. (DiffMain)" ); } // Check for equality (speedup). if ( text1 === text2 ) { if ( text1 ) { return [ [ DIFF_EQUAL, text1 ] ]; } return []; } if ( typeof optChecklines === "undefined" ) { optChecklines = true; } checklines = optChecklines; // Trim off common prefix (speedup). commonlength = this.diffCommonPrefix( text1, text2 ); commonprefix = text1.substring( 0, commonlength ); text1 = text1.substring( commonlength ); text2 = text2.substring( commonlength ); // Trim off common suffix (speedup). commonlength = this.diffCommonSuffix( text1, text2 ); commonsuffix = text1.substring( text1.length - commonlength ); text1 = text1.substring( 0, text1.length - commonlength ); text2 = text2.substring( 0, text2.length - commonlength ); // Compute the diff on the middle block. diffs = this.diffCompute( text1, text2, checklines, deadline ); // Restore the prefix and suffix. if ( commonprefix ) { diffs.unshift( [ DIFF_EQUAL, commonprefix ] ); } if ( commonsuffix ) { diffs.push( [ DIFF_EQUAL, commonsuffix ] ); } this.diffCleanupMerge( diffs ); return diffs; }; /** * Reduce the number of edits by eliminating operationally trivial equalities. * @param {!Array.} diffs Array of diff tuples. */ DiffMatchPatch.prototype.diffCleanupEfficiency = function( diffs ) { var changes, equalities, equalitiesLength, lastequality, pointer, preIns, preDel, postIns, postDel; changes = false; equalities = []; // Stack of indices where equalities are found. equalitiesLength = 0; // Keeping our own length var is faster in JS. /** @type {?string} */ lastequality = null; // Always equal to diffs[equalities[equalitiesLength - 1]][1] pointer = 0; // Index of current position. // Is there an insertion operation before the last equality. preIns = false; // Is there a deletion operation before the last equality. preDel = false; // Is there an insertion operation after the last equality. postIns = false; // Is there a deletion operation after the last equality. postDel = false; while ( pointer < diffs.length ) { // Equality found. if ( diffs[ pointer ][ 0 ] === DIFF_EQUAL ) { if ( diffs[ pointer ][ 1 ].length < 4 && ( postIns || postDel ) ) { // Candidate found. equalities[ equalitiesLength++ ] = pointer; preIns = postIns; preDel = postDel; lastequality = diffs[ pointer ][ 1 ]; } else { // Not a candidate, and can never become one. equalitiesLength = 0; lastequality = null; } postIns = postDel = false; // An insertion or deletion. } else { if ( diffs[ pointer ][ 0 ] === DIFF_DELETE ) { postDel = true; } else { postIns = true; } /* * Five types to be split: * ABXYCD * AXCD * ABXC * AXCD * ABXC */ if ( lastequality && ( ( preIns && preDel && postIns && postDel ) || ( ( lastequality.length < 2 ) && ( preIns + preDel + postIns + postDel ) === 3 ) ) ) { // Duplicate record. diffs.splice( equalities[ equalitiesLength - 1 ], 0, [ DIFF_DELETE, lastequality ] ); // Change second copy to insert. diffs[ equalities[ equalitiesLength - 1 ] + 1 ][ 0 ] = DIFF_INSERT; equalitiesLength--; // Throw away the equality we just deleted; lastequality = null; if ( preIns && preDel ) { // No changes made which could affect previous entry, keep going. postIns = postDel = true; equalitiesLength = 0; } else { equalitiesLength--; // Throw away the previous equality. pointer = equalitiesLength > 0 ? equalities[ equalitiesLength - 1 ] : -1; postIns = postDel = false; } changes = true; } } pointer++; } if ( changes ) { this.diffCleanupMerge( diffs ); } }; /** * Convert a diff array into a pretty HTML report. * @param {!Array.} diffs Array of diff tuples. * @param {integer} string to be beautified. * @return {string} HTML representation. */ DiffMatchPatch.prototype.diffPrettyHtml = function( diffs ) { var op, data, x, html = []; for ( x = 0; x < diffs.length; x++ ) { op = diffs[ x ][ 0 ]; // Operation (insert, delete, equal) data = diffs[ x ][ 1 ]; // Text of change. switch ( op ) { case DIFF_INSERT: html[ x ] = "" + escapeText( data ) + ""; break; case DIFF_DELETE: html[ x ] = "" + escapeText( data ) + ""; break; case DIFF_EQUAL: html[ x ] = "" + escapeText( data ) + ""; break; } } return html.join( "" ); }; /** * Determine the common prefix of two strings. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {number} The number of characters common to the start of each * string. */ DiffMatchPatch.prototype.diffCommonPrefix = function( text1, text2 ) { var pointermid, pointermax, pointermin, pointerstart; // Quick check for common null cases. if ( !text1 || !text2 || text1.charAt( 0 ) !== text2.charAt( 0 ) ) { return 0; } // Binary search. // Performance analysis: https://neil.fraser.name/news/2007/10/09/ pointermin = 0; pointermax = Math.min( text1.length, text2.length ); pointermid = pointermax; pointerstart = 0; while ( pointermin < pointermid ) { if ( text1.substring( pointerstart, pointermid ) === text2.substring( pointerstart, pointermid ) ) { pointermin = pointermid; pointerstart = pointermin; } else { pointermax = pointermid; } pointermid = Math.floor( ( pointermax - pointermin ) / 2 + pointermin ); } return pointermid; }; /** * Determine the common suffix of two strings. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {number} The number of characters common to the end of each string. */ DiffMatchPatch.prototype.diffCommonSuffix = function( text1, text2 ) { var pointermid, pointermax, pointermin, pointerend; // Quick check for common null cases. if ( !text1 || !text2 || text1.charAt( text1.length - 1 ) !== text2.charAt( text2.length - 1 ) ) { return 0; } // Binary search. // Performance analysis: https://neil.fraser.name/news/2007/10/09/ pointermin = 0; pointermax = Math.min( text1.length, text2.length ); pointermid = pointermax; pointerend = 0; while ( pointermin < pointermid ) { if ( text1.substring( text1.length - pointermid, text1.length - pointerend ) === text2.substring( text2.length - pointermid, text2.length - pointerend ) ) { pointermin = pointermid; pointerend = pointermin; } else { pointermax = pointermid; } pointermid = Math.floor( ( pointermax - pointermin ) / 2 + pointermin ); } return pointermid; }; /** * Find the differences between two texts. Assumes that the texts do not * have any common prefix or suffix. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {boolean} checklines Speedup flag. If false, then don't run a * line-level diff first to identify the changed areas. * If true, then run a faster, slightly less optimal diff. * @param {number} deadline Time when the diff should be complete by. * @return {!Array.} Array of diff tuples. * @private */ DiffMatchPatch.prototype.diffCompute = function( text1, text2, checklines, deadline ) { var diffs, longtext, shorttext, i, hm, text1A, text2A, text1B, text2B, midCommon, diffsA, diffsB; if ( !text1 ) { // Just add some text (speedup). return [ [ DIFF_INSERT, text2 ] ]; } if ( !text2 ) { // Just delete some text (speedup). return [ [ DIFF_DELETE, text1 ] ]; } longtext = text1.length > text2.length ? text1 : text2; shorttext = text1.length > text2.length ? text2 : text1; i = longtext.indexOf( shorttext ); if ( i !== -1 ) { // Shorter text is inside the longer text (speedup). diffs = [ [ DIFF_INSERT, longtext.substring( 0, i ) ], [ DIFF_EQUAL, shorttext ], [ DIFF_INSERT, longtext.substring( i + shorttext.length ) ] ]; // Swap insertions for deletions if diff is reversed. if ( text1.length > text2.length ) { diffs[ 0 ][ 0 ] = diffs[ 2 ][ 0 ] = DIFF_DELETE; } return diffs; } if ( shorttext.length === 1 ) { // Single character string. // After the previous speedup, the character can't be an equality. return [ [ DIFF_DELETE, text1 ], [ DIFF_INSERT, text2 ] ]; } // Check to see if the problem can be split in two. hm = this.diffHalfMatch( text1, text2 ); if ( hm ) { // A half-match was found, sort out the return data. text1A = hm[ 0 ]; text1B = hm[ 1 ]; text2A = hm[ 2 ]; text2B = hm[ 3 ]; midCommon = hm[ 4 ]; // Send both pairs off for separate processing. diffsA = this.DiffMain( text1A, text2A, checklines, deadline ); diffsB = this.DiffMain( text1B, text2B, checklines, deadline ); // Merge the results. return diffsA.concat( [ [ DIFF_EQUAL, midCommon ] ], diffsB ); } if ( checklines && text1.length > 100 && text2.length > 100 ) { return this.diffLineMode( text1, text2, deadline ); } return this.diffBisect( text1, text2, deadline ); }; /** * Do the two texts share a substring which is at least half the length of the * longer text? * This speedup can produce non-minimal diffs. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {Array.} Five element Array, containing the prefix of * text1, the suffix of text1, the prefix of text2, the suffix of * text2 and the common middle. Or null if there was no match. * @private */ DiffMatchPatch.prototype.diffHalfMatch = function( text1, text2 ) { var longtext, shorttext, dmp, text1A, text2B, text2A, text1B, midCommon, hm1, hm2, hm; longtext = text1.length > text2.length ? text1 : text2; shorttext = text1.length > text2.length ? text2 : text1; if ( longtext.length < 4 || shorttext.length * 2 < longtext.length ) { return null; // Pointless. } dmp = this; // 'this' becomes 'window' in a closure. /** * Does a substring of shorttext exist within longtext such that the substring * is at least half the length of longtext? * Closure, but does not reference any external variables. * @param {string} longtext Longer string. * @param {string} shorttext Shorter string. * @param {number} i Start index of quarter length substring within longtext. * @return {Array.} Five element Array, containing the prefix of * longtext, the suffix of longtext, the prefix of shorttext, the suffix * of shorttext and the common middle. Or null if there was no match. * @private */ function diffHalfMatchI( longtext, shorttext, i ) { var seed, j, bestCommon, prefixLength, suffixLength, bestLongtextA, bestLongtextB, bestShorttextA, bestShorttextB; // Start with a 1/4 length substring at position i as a seed. seed = longtext.substring( i, i + Math.floor( longtext.length / 4 ) ); j = -1; bestCommon = ""; while ( ( j = shorttext.indexOf( seed, j + 1 ) ) !== -1 ) { prefixLength = dmp.diffCommonPrefix( longtext.substring( i ), shorttext.substring( j ) ); suffixLength = dmp.diffCommonSuffix( longtext.substring( 0, i ), shorttext.substring( 0, j ) ); if ( bestCommon.length < suffixLength + prefixLength ) { bestCommon = shorttext.substring( j - suffixLength, j ) + shorttext.substring( j, j + prefixLength ); bestLongtextA = longtext.substring( 0, i - suffixLength ); bestLongtextB = longtext.substring( i + prefixLength ); bestShorttextA = shorttext.substring( 0, j - suffixLength ); bestShorttextB = shorttext.substring( j + prefixLength ); } } if ( bestCommon.length * 2 >= longtext.length ) { return [ bestLongtextA, bestLongtextB, bestShorttextA, bestShorttextB, bestCommon ]; } else { return null; } } // First check if the second quarter is the seed for a half-match. hm1 = diffHalfMatchI( longtext, shorttext, Math.ceil( longtext.length / 4 ) ); // Check again based on the third quarter. hm2 = diffHalfMatchI( longtext, shorttext, Math.ceil( longtext.length / 2 ) ); if ( !hm1 && !hm2 ) { return null; } else if ( !hm2 ) { hm = hm1; } else if ( !hm1 ) { hm = hm2; } else { // Both matched. Select the longest. hm = hm1[ 4 ].length > hm2[ 4 ].length ? hm1 : hm2; } // A half-match was found, sort out the return data. text1A, text1B, text2A, text2B; if ( text1.length > text2.length ) { text1A = hm[ 0 ]; text1B = hm[ 1 ]; text2A = hm[ 2 ]; text2B = hm[ 3 ]; } else { text2A = hm[ 0 ]; text2B = hm[ 1 ]; text1A = hm[ 2 ]; text1B = hm[ 3 ]; } midCommon = hm[ 4 ]; return [ text1A, text1B, text2A, text2B, midCommon ]; }; /** * Do a quick line-level diff on both strings, then rediff the parts for * greater accuracy. * This speedup can produce non-minimal diffs. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {number} deadline Time when the diff should be complete by. * @return {!Array.} Array of diff tuples. * @private */ DiffMatchPatch.prototype.diffLineMode = function( text1, text2, deadline ) { var a, diffs, linearray, pointer, countInsert, countDelete, textInsert, textDelete, j; // Scan the text on a line-by-line basis first. a = this.diffLinesToChars( text1, text2 ); text1 = a.chars1; text2 = a.chars2; linearray = a.lineArray; diffs = this.DiffMain( text1, text2, false, deadline ); // Convert the diff back to original text. this.diffCharsToLines( diffs, linearray ); // Eliminate freak matches (e.g. blank lines) this.diffCleanupSemantic( diffs ); // Rediff any replacement blocks, this time character-by-character. // Add a dummy entry at the end. diffs.push( [ DIFF_EQUAL, "" ] ); pointer = 0; countDelete = 0; countInsert = 0; textDelete = ""; textInsert = ""; while ( pointer < diffs.length ) { switch ( diffs[ pointer ][ 0 ] ) { case DIFF_INSERT: countInsert++; textInsert += diffs[ pointer ][ 1 ]; break; case DIFF_DELETE: countDelete++; textDelete += diffs[ pointer ][ 1 ]; break; case DIFF_EQUAL: // Upon reaching an equality, check for prior redundancies. if ( countDelete >= 1 && countInsert >= 1 ) { // Delete the offending records and add the merged ones. diffs.splice( pointer - countDelete - countInsert, countDelete + countInsert ); pointer = pointer - countDelete - countInsert; a = this.DiffMain( textDelete, textInsert, false, deadline ); for ( j = a.length - 1; j >= 0; j-- ) { diffs.splice( pointer, 0, a[ j ] ); } pointer = pointer + a.length; } countInsert = 0; countDelete = 0; textDelete = ""; textInsert = ""; break; } pointer++; } diffs.pop(); // Remove the dummy entry at the end. return diffs; }; /** * Find the 'middle snake' of a diff, split the problem in two * and return the recursively constructed diff. * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {number} deadline Time at which to bail if not yet complete. * @return {!Array.} Array of diff tuples. * @private */ DiffMatchPatch.prototype.diffBisect = function( text1, text2, deadline ) { var text1Length, text2Length, maxD, vOffset, vLength, v1, v2, x, delta, front, k1start, k1end, k2start, k2end, k2Offset, k1Offset, x1, x2, y1, y2, d, k1, k2; // Cache the text lengths to prevent multiple calls. text1Length = text1.length; text2Length = text2.length; maxD = Math.ceil( ( text1Length + text2Length ) / 2 ); vOffset = maxD; vLength = 2 * maxD; v1 = new Array( vLength ); v2 = new Array( vLength ); // Setting all elements to -1 is faster in Chrome & Firefox than mixing // integers and undefined. for ( x = 0; x < vLength; x++ ) { v1[ x ] = -1; v2[ x ] = -1; } v1[ vOffset + 1 ] = 0; v2[ vOffset + 1 ] = 0; delta = text1Length - text2Length; // If the total number of characters is odd, then the front path will collide // with the reverse path. front = ( delta % 2 !== 0 ); // Offsets for start and end of k loop. // Prevents mapping of space beyond the grid. k1start = 0; k1end = 0; k2start = 0; k2end = 0; for ( d = 0; d < maxD; d++ ) { // Bail out if deadline is reached. if ( ( new Date() ).getTime() > deadline ) { break; } // Walk the front path one step. for ( k1 = -d + k1start; k1 <= d - k1end; k1 += 2 ) { k1Offset = vOffset + k1; if ( k1 === -d || ( k1 !== d && v1[ k1Offset - 1 ] < v1[ k1Offset + 1 ] ) ) { x1 = v1[ k1Offset + 1 ]; } else { x1 = v1[ k1Offset - 1 ] + 1; } y1 = x1 - k1; while ( x1 < text1Length && y1 < text2Length && text1.charAt( x1 ) === text2.charAt( y1 ) ) { x1++; y1++; } v1[ k1Offset ] = x1; if ( x1 > text1Length ) { // Ran off the right of the graph. k1end += 2; } else if ( y1 > text2Length ) { // Ran off the bottom of the graph. k1start += 2; } else if ( front ) { k2Offset = vOffset + delta - k1; if ( k2Offset >= 0 && k2Offset < vLength && v2[ k2Offset ] !== -1 ) { // Mirror x2 onto top-left coordinate system. x2 = text1Length - v2[ k2Offset ]; if ( x1 >= x2 ) { // Overlap detected. return this.diffBisectSplit( text1, text2, x1, y1, deadline ); } } } } // Walk the reverse path one step. for ( k2 = -d + k2start; k2 <= d - k2end; k2 += 2 ) { k2Offset = vOffset + k2; if ( k2 === -d || ( k2 !== d && v2[ k2Offset - 1 ] < v2[ k2Offset + 1 ] ) ) { x2 = v2[ k2Offset + 1 ]; } else { x2 = v2[ k2Offset - 1 ] + 1; } y2 = x2 - k2; while ( x2 < text1Length && y2 < text2Length && text1.charAt( text1Length - x2 - 1 ) === text2.charAt( text2Length - y2 - 1 ) ) { x2++; y2++; } v2[ k2Offset ] = x2; if ( x2 > text1Length ) { // Ran off the left of the graph. k2end += 2; } else if ( y2 > text2Length ) { // Ran off the top of the graph. k2start += 2; } else if ( !front ) { k1Offset = vOffset + delta - k2; if ( k1Offset >= 0 && k1Offset < vLength && v1[ k1Offset ] !== -1 ) { x1 = v1[ k1Offset ]; y1 = vOffset + x1 - k1Offset; // Mirror x2 onto top-left coordinate system. x2 = text1Length - x2; if ( x1 >= x2 ) { // Overlap detected. return this.diffBisectSplit( text1, text2, x1, y1, deadline ); } } } } } // Diff took too long and hit the deadline or // number of diffs equals number of characters, no commonality at all. return [ [ DIFF_DELETE, text1 ], [ DIFF_INSERT, text2 ] ]; }; /** * Given the location of the 'middle snake', split the diff in two parts * and recurse. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {number} x Index of split point in text1. * @param {number} y Index of split point in text2. * @param {number} deadline Time at which to bail if not yet complete. * @return {!Array.} Array of diff tuples. * @private */ DiffMatchPatch.prototype.diffBisectSplit = function( text1, text2, x, y, deadline ) { var text1a, text1b, text2a, text2b, diffs, diffsb; text1a = text1.substring( 0, x ); text2a = text2.substring( 0, y ); text1b = text1.substring( x ); text2b = text2.substring( y ); // Compute both diffs serially. diffs = this.DiffMain( text1a, text2a, false, deadline ); diffsb = this.DiffMain( text1b, text2b, false, deadline ); return diffs.concat( diffsb ); }; /** * Reduce the number of edits by eliminating semantically trivial equalities. * @param {!Array.} diffs Array of diff tuples. */ DiffMatchPatch.prototype.diffCleanupSemantic = function( diffs ) { var changes, equalities, equalitiesLength, lastequality, pointer, lengthInsertions2, lengthDeletions2, lengthInsertions1, lengthDeletions1, deletion, insertion, overlapLength1, overlapLength2; changes = false; equalities = []; // Stack of indices where equalities are found. equalitiesLength = 0; // Keeping our own length var is faster in JS. /** @type {?string} */ lastequality = null; // Always equal to diffs[equalities[equalitiesLength - 1]][1] pointer = 0; // Index of current position. // Number of characters that changed prior to the equality. lengthInsertions1 = 0; lengthDeletions1 = 0; // Number of characters that changed after the equality. lengthInsertions2 = 0; lengthDeletions2 = 0; while ( pointer < diffs.length ) { if ( diffs[ pointer ][ 0 ] === DIFF_EQUAL ) { // Equality found. equalities[ equalitiesLength++ ] = pointer; lengthInsertions1 = lengthInsertions2; lengthDeletions1 = lengthDeletions2; lengthInsertions2 = 0; lengthDeletions2 = 0; lastequality = diffs[ pointer ][ 1 ]; } else { // An insertion or deletion. if ( diffs[ pointer ][ 0 ] === DIFF_INSERT ) { lengthInsertions2 += diffs[ pointer ][ 1 ].length; } else { lengthDeletions2 += diffs[ pointer ][ 1 ].length; } // Eliminate an equality that is smaller or equal to the edits on both // sides of it. if ( lastequality && ( lastequality.length <= Math.max( lengthInsertions1, lengthDeletions1 ) ) && ( lastequality.length <= Math.max( lengthInsertions2, lengthDeletions2 ) ) ) { // Duplicate record. diffs.splice( equalities[ equalitiesLength - 1 ], 0, [ DIFF_DELETE, lastequality ] ); // Change second copy to insert. diffs[ equalities[ equalitiesLength - 1 ] + 1 ][ 0 ] = DIFF_INSERT; // Throw away the equality we just deleted. equalitiesLength--; // Throw away the previous equality (it needs to be reevaluated). equalitiesLength--; pointer = equalitiesLength > 0 ? equalities[ equalitiesLength - 1 ] : -1; // Reset the counters. lengthInsertions1 = 0; lengthDeletions1 = 0; lengthInsertions2 = 0; lengthDeletions2 = 0; lastequality = null; changes = true; } } pointer++; } // Normalize the diff. if ( changes ) { this.diffCleanupMerge( diffs ); } // Find any overlaps between deletions and insertions. // e.g: abcxxxxxxdef // -> abcxxxdef // e.g: xxxabcdefxxx // -> defxxxabc // Only extract an overlap if it is as big as the edit ahead or behind it. pointer = 1; while ( pointer < diffs.length ) { if ( diffs[ pointer - 1 ][ 0 ] === DIFF_DELETE && diffs[ pointer ][ 0 ] === DIFF_INSERT ) { deletion = diffs[ pointer - 1 ][ 1 ]; insertion = diffs[ pointer ][ 1 ]; overlapLength1 = this.diffCommonOverlap( deletion, insertion ); overlapLength2 = this.diffCommonOverlap( insertion, deletion ); if ( overlapLength1 >= overlapLength2 ) { if ( overlapLength1 >= deletion.length / 2 || overlapLength1 >= insertion.length / 2 ) { // Overlap found. Insert an equality and trim the surrounding edits. diffs.splice( pointer, 0, [ DIFF_EQUAL, insertion.substring( 0, overlapLength1 ) ] ); diffs[ pointer - 1 ][ 1 ] = deletion.substring( 0, deletion.length - overlapLength1 ); diffs[ pointer + 1 ][ 1 ] = insertion.substring( overlapLength1 ); pointer++; } } else { if ( overlapLength2 >= deletion.length / 2 || overlapLength2 >= insertion.length / 2 ) { // Reverse overlap found. // Insert an equality and swap and trim the surrounding edits. diffs.splice( pointer, 0, [ DIFF_EQUAL, deletion.substring( 0, overlapLength2 ) ] ); diffs[ pointer - 1 ][ 0 ] = DIFF_INSERT; diffs[ pointer - 1 ][ 1 ] = insertion.substring( 0, insertion.length - overlapLength2 ); diffs[ pointer + 1 ][ 0 ] = DIFF_DELETE; diffs[ pointer + 1 ][ 1 ] = deletion.substring( overlapLength2 ); pointer++; } } pointer++; } pointer++; } }; /** * Determine if the suffix of one string is the prefix of another. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {number} The number of characters common to the end of the first * string and the start of the second string. * @private */ DiffMatchPatch.prototype.diffCommonOverlap = function( text1, text2 ) { var text1Length, text2Length, textLength, best, length, pattern, found; // Cache the text lengths to prevent multiple calls. text1Length = text1.length; text2Length = text2.length; // Eliminate the null case. if ( text1Length === 0 || text2Length === 0 ) { return 0; } // Truncate the longer string. if ( text1Length > text2Length ) { text1 = text1.substring( text1Length - text2Length ); } else if ( text1Length < text2Length ) { text2 = text2.substring( 0, text1Length ); } textLength = Math.min( text1Length, text2Length ); // Quick check for the worst case. if ( text1 === text2 ) { return textLength; } // Start by looking for a single character match // and increase length until no match is found. // Performance analysis: https://neil.fraser.name/news/2010/11/04/ best = 0; length = 1; while ( true ) { pattern = text1.substring( textLength - length ); found = text2.indexOf( pattern ); if ( found === -1 ) { return best; } length += found; if ( found === 0 || text1.substring( textLength - length ) === text2.substring( 0, length ) ) { best = length; length++; } } }; /** * Split two texts into an array of strings. Reduce the texts to a string of * hashes where each Unicode character represents one line. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {{chars1: string, chars2: string, lineArray: !Array.}} * An object containing the encoded text1, the encoded text2 and * the array of unique strings. * The zeroth element of the array of unique strings is intentionally blank. * @private */ DiffMatchPatch.prototype.diffLinesToChars = function( text1, text2 ) { var lineArray, lineHash, chars1, chars2; lineArray = []; // E.g. lineArray[4] === 'Hello\n' lineHash = {}; // E.g. lineHash['Hello\n'] === 4 // '\x00' is a valid character, but various debuggers don't like it. // So we'll insert a junk entry to avoid generating a null character. lineArray[ 0 ] = ""; /** * Split a text into an array of strings. Reduce the texts to a string of * hashes where each Unicode character represents one line. * Modifies linearray and linehash through being a closure. * @param {string} text String to encode. * @return {string} Encoded string. * @private */ function diffLinesToCharsMunge( text ) { var chars, lineStart, lineEnd, lineArrayLength, line; chars = ""; // Walk the text, pulling out a substring for each line. // text.split('\n') would would temporarily double our memory footprint. // Modifying text would create many large strings to garbage collect. lineStart = 0; lineEnd = -1; // Keeping our own length variable is faster than looking it up. lineArrayLength = lineArray.length; while ( lineEnd < text.length - 1 ) { lineEnd = text.indexOf( "\n", lineStart ); if ( lineEnd === -1 ) { lineEnd = text.length - 1; } line = text.substring( lineStart, lineEnd + 1 ); lineStart = lineEnd + 1; if ( lineHash.hasOwnProperty ? lineHash.hasOwnProperty( line ) : ( lineHash[ line ] !== undefined ) ) { chars += String.fromCharCode( lineHash[ line ] ); } else { chars += String.fromCharCode( lineArrayLength ); lineHash[ line ] = lineArrayLength; lineArray[ lineArrayLength++ ] = line; } } return chars; } chars1 = diffLinesToCharsMunge( text1 ); chars2 = diffLinesToCharsMunge( text2 ); return { chars1: chars1, chars2: chars2, lineArray: lineArray }; }; /** * Rehydrate the text in a diff from a string of line hashes to real lines of * text. * @param {!Array.} diffs Array of diff tuples. * @param {!Array.} lineArray Array of unique strings. * @private */ DiffMatchPatch.prototype.diffCharsToLines = function( diffs, lineArray ) { var x, chars, text, y; for ( x = 0; x < diffs.length; x++ ) { chars = diffs[ x ][ 1 ]; text = []; for ( y = 0; y < chars.length; y++ ) { text[ y ] = lineArray[ chars.charCodeAt( y ) ]; } diffs[ x ][ 1 ] = text.join( "" ); } }; /** * Reorder and merge like edit sections. Merge equalities. * Any edit section can move as long as it doesn't cross an equality. * @param {!Array.} diffs Array of diff tuples. */ DiffMatchPatch.prototype.diffCleanupMerge = function( diffs ) { var pointer, countDelete, countInsert, textInsert, textDelete, commonlength, changes, diffPointer, position; diffs.push( [ DIFF_EQUAL, "" ] ); // Add a dummy entry at the end. pointer = 0; countDelete = 0; countInsert = 0; textDelete = ""; textInsert = ""; commonlength; while ( pointer < diffs.length ) { switch ( diffs[ pointer ][ 0 ] ) { case DIFF_INSERT: countInsert++; textInsert += diffs[ pointer ][ 1 ]; pointer++; break; case DIFF_DELETE: countDelete++; textDelete += diffs[ pointer ][ 1 ]; pointer++; break; case DIFF_EQUAL: // Upon reaching an equality, check for prior redundancies. if ( countDelete + countInsert > 1 ) { if ( countDelete !== 0 && countInsert !== 0 ) { // Factor out any common prefixes. commonlength = this.diffCommonPrefix( textInsert, textDelete ); if ( commonlength !== 0 ) { if ( ( pointer - countDelete - countInsert ) > 0 && diffs[ pointer - countDelete - countInsert - 1 ][ 0 ] === DIFF_EQUAL ) { diffs[ pointer - countDelete - countInsert - 1 ][ 1 ] += textInsert.substring( 0, commonlength ); } else { diffs.splice( 0, 0, [ DIFF_EQUAL, textInsert.substring( 0, commonlength ) ] ); pointer++; } textInsert = textInsert.substring( commonlength ); textDelete = textDelete.substring( commonlength ); } // Factor out any common suffixies. commonlength = this.diffCommonSuffix( textInsert, textDelete ); if ( commonlength !== 0 ) { diffs[ pointer ][ 1 ] = textInsert.substring( textInsert.length - commonlength ) + diffs[ pointer ][ 1 ]; textInsert = textInsert.substring( 0, textInsert.length - commonlength ); textDelete = textDelete.substring( 0, textDelete.length - commonlength ); } } // Delete the offending records and add the merged ones. if ( countDelete === 0 ) { diffs.splice( pointer - countInsert, countDelete + countInsert, [ DIFF_INSERT, textInsert ] ); } else if ( countInsert === 0 ) { diffs.splice( pointer - countDelete, countDelete + countInsert, [ DIFF_DELETE, textDelete ] ); } else { diffs.splice( pointer - countDelete - countInsert, countDelete + countInsert, [ DIFF_DELETE, textDelete ], [ DIFF_INSERT, textInsert ] ); } pointer = pointer - countDelete - countInsert + ( countDelete ? 1 : 0 ) + ( countInsert ? 1 : 0 ) + 1; } else if ( pointer !== 0 && diffs[ pointer - 1 ][ 0 ] === DIFF_EQUAL ) { // Merge this equality with the previous one. diffs[ pointer - 1 ][ 1 ] += diffs[ pointer ][ 1 ]; diffs.splice( pointer, 1 ); } else { pointer++; } countInsert = 0; countDelete = 0; textDelete = ""; textInsert = ""; break; } } if ( diffs[ diffs.length - 1 ][ 1 ] === "" ) { diffs.pop(); // Remove the dummy entry at the end. } // Second pass: look for single edits surrounded on both sides by equalities // which can be shifted sideways to eliminate an equality. // e.g: ABAC -> ABAC changes = false; pointer = 1; // Intentionally ignore the first and last element (don't need checking). while ( pointer < diffs.length - 1 ) { if ( diffs[ pointer - 1 ][ 0 ] === DIFF_EQUAL && diffs[ pointer + 1 ][ 0 ] === DIFF_EQUAL ) { diffPointer = diffs[ pointer ][ 1 ]; position = diffPointer.substring( diffPointer.length - diffs[ pointer - 1 ][ 1 ].length ); // This is a single edit surrounded by equalities. if ( position === diffs[ pointer - 1 ][ 1 ] ) { // Shift the edit over the previous equality. diffs[ pointer ][ 1 ] = diffs[ pointer - 1 ][ 1 ] + diffs[ pointer ][ 1 ].substring( 0, diffs[ pointer ][ 1 ].length - diffs[ pointer - 1 ][ 1 ].length ); diffs[ pointer + 1 ][ 1 ] = diffs[ pointer - 1 ][ 1 ] + diffs[ pointer + 1 ][ 1 ]; diffs.splice( pointer - 1, 1 ); changes = true; } else if ( diffPointer.substring( 0, diffs[ pointer + 1 ][ 1 ].length ) === diffs[ pointer + 1 ][ 1 ] ) { // Shift the edit over the next equality. diffs[ pointer - 1 ][ 1 ] += diffs[ pointer + 1 ][ 1 ]; diffs[ pointer ][ 1 ] = diffs[ pointer ][ 1 ].substring( diffs[ pointer + 1 ][ 1 ].length ) + diffs[ pointer + 1 ][ 1 ]; diffs.splice( pointer + 1, 1 ); changes = true; } } pointer++; } // If shifts were made, the diff needs reordering and another shift sweep. if ( changes ) { this.diffCleanupMerge( diffs ); } }; return function( o, n ) { var diff, output, text; diff = new DiffMatchPatch(); output = diff.DiffMain( o, n ); diff.diffCleanupEfficiency( output ); text = diff.diffPrettyHtml( output ); return text; }; }() ); }() ); ================================================ FILE: common/Tests/External/qunit-2.9.1.css ================================================ /*! * QUnit 2.9.1 * https://qunitjs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2019-01-07T16:37Z */ /** Font Family and Sizes */ #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult { font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; } #qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } #qunit-tests { font-size: smaller; } /** Resets */ #qunit-tests, #qunit-header, #qunit-banner, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { margin: 0; padding: 0; } /** Header (excluding toolbar) */ #qunit-header { padding: 0.5em 0 0.5em 1em; color: #8699A4; background-color: #0D3349; font-size: 1.5em; line-height: 1em; font-weight: 400; border-radius: 5px 5px 0 0; } #qunit-header a { text-decoration: none; color: #C2CCD1; } #qunit-header a:hover, #qunit-header a:focus { color: #FFF; } #qunit-banner { height: 5px; } #qunit-filteredTest { padding: 0.5em 1em 0.5em 1em; color: #366097; background-color: #F4FF77; } #qunit-userAgent { padding: 0.5em 1em 0.5em 1em; color: #FFF; background-color: #2B81AF; text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; } /** Toolbar */ #qunit-testrunner-toolbar { padding: 0.5em 1em 0.5em 1em; color: #5E740B; background-color: #EEE; } #qunit-testrunner-toolbar .clearfix { height: 0; clear: both; } #qunit-testrunner-toolbar label { display: inline-block; } #qunit-testrunner-toolbar input[type=checkbox], #qunit-testrunner-toolbar input[type=radio] { margin: 3px; vertical-align: -2px; } #qunit-testrunner-toolbar input[type=text] { box-sizing: border-box; height: 1.6em; } .qunit-url-config, .qunit-filter, #qunit-modulefilter { display: inline-block; line-height: 2.1em; } .qunit-filter, #qunit-modulefilter { float: right; position: relative; margin-left: 1em; } .qunit-url-config label { margin-right: 0.5em; } #qunit-modulefilter-search { box-sizing: border-box; width: 400px; } #qunit-modulefilter-search-container:after { position: absolute; right: 0.3em; content: "\25bc"; color: black; } #qunit-modulefilter-dropdown { /* align with #qunit-modulefilter-search */ box-sizing: border-box; width: 400px; position: absolute; right: 0; top: 50%; margin-top: 0.8em; border: 1px solid #D3D3D3; border-top: none; border-radius: 0 0 .25em .25em; color: #000; background-color: #F5F5F5; z-index: 99; } #qunit-modulefilter-dropdown a { color: inherit; text-decoration: none; } #qunit-modulefilter-dropdown .clickable.checked { font-weight: bold; color: #000; background-color: #D2E0E6; } #qunit-modulefilter-dropdown .clickable:hover { color: #FFF; background-color: #0D3349; } #qunit-modulefilter-actions { display: block; overflow: auto; /* align with #qunit-modulefilter-dropdown-list */ font: smaller/1.5em sans-serif; } #qunit-modulefilter-dropdown #qunit-modulefilter-actions > * { box-sizing: border-box; max-height: 2.8em; display: block; padding: 0.4em; } #qunit-modulefilter-dropdown #qunit-modulefilter-actions > button { float: right; font: inherit; } #qunit-modulefilter-dropdown #qunit-modulefilter-actions > :last-child { /* insert padding to align with checkbox margins */ padding-left: 3px; } #qunit-modulefilter-dropdown-list { max-height: 200px; overflow-y: auto; margin: 0; border-top: 2px groove threedhighlight; padding: 0.4em 0 0; font: smaller/1.5em sans-serif; } #qunit-modulefilter-dropdown-list li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } #qunit-modulefilter-dropdown-list .clickable { display: block; padding-left: 0.15em; } /** Tests: Pass/Fail */ #qunit-tests { list-style-position: inside; } #qunit-tests li { padding: 0.4em 1em 0.4em 1em; border-bottom: 1px solid #FFF; list-style-position: inside; } #qunit-tests > li { display: none; } #qunit-tests li.running, #qunit-tests li.pass, #qunit-tests li.fail, #qunit-tests li.skipped, #qunit-tests li.aborted { display: list-item; } #qunit-tests.hidepass { position: relative; } #qunit-tests.hidepass li.running, #qunit-tests.hidepass li.pass:not(.todo) { visibility: hidden; position: absolute; width: 0; height: 0; padding: 0; border: 0; margin: 0; } #qunit-tests li strong { cursor: pointer; } #qunit-tests li.skipped strong { cursor: default; } #qunit-tests li a { padding: 0.5em; color: #C2CCD1; text-decoration: none; } #qunit-tests li p a { padding: 0.25em; color: #6B6464; } #qunit-tests li a:hover, #qunit-tests li a:focus { color: #000; } #qunit-tests li .runtime { float: right; font-size: smaller; } .qunit-assert-list { margin-top: 0.5em; padding: 0.5em; background-color: #FFF; border-radius: 5px; } .qunit-source { margin: 0.6em 0 0.3em; } .qunit-collapsed { display: none; } #qunit-tests table { border-collapse: collapse; margin-top: 0.2em; } #qunit-tests th { text-align: right; vertical-align: top; padding: 0 0.5em 0 0; } #qunit-tests td { vertical-align: top; } #qunit-tests pre { margin: 0; white-space: pre-wrap; word-wrap: break-word; } #qunit-tests del { color: #374E0C; background-color: #E0F2BE; text-decoration: none; } #qunit-tests ins { color: #500; background-color: #FFCACA; text-decoration: none; } /*** Test Counts */ #qunit-tests b.counts { color: #000; } #qunit-tests b.passed { color: #5E740B; } #qunit-tests b.failed { color: #710909; } #qunit-tests li li { padding: 5px; background-color: #FFF; border-bottom: none; list-style-position: inside; } /*** Passing Styles */ #qunit-tests li li.pass { color: #3C510C; background-color: #FFF; border-left: 10px solid #C6E746; } #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } #qunit-tests .pass .test-name { color: #366097; } #qunit-tests .pass .test-actual, #qunit-tests .pass .test-expected { color: #999; } #qunit-banner.qunit-pass { background-color: #C6E746; } /*** Failing Styles */ #qunit-tests li li.fail { color: #710909; background-color: #FFF; border-left: 10px solid #EE5757; white-space: pre; } #qunit-tests > li:last-child { border-radius: 0 0 5px 5px; } #qunit-tests .fail { color: #000; background-color: #EE5757; } #qunit-tests .fail .test-name, #qunit-tests .fail .module-name { color: #000; } #qunit-tests .fail .test-actual { color: #EE5757; } #qunit-tests .fail .test-expected { color: #008000; } #qunit-banner.qunit-fail { background-color: #EE5757; } /*** Aborted tests */ #qunit-tests .aborted { color: #000; background-color: orange; } /*** Skipped tests */ #qunit-tests .skipped { background-color: #EBECE9; } #qunit-tests .qunit-todo-label, #qunit-tests .qunit-skipped-label { background-color: #F4FF77; display: inline-block; font-style: normal; color: #366097; line-height: 1.8em; padding: 0 0.5em; margin: -0.4em 0.4em -0.4em 0; } #qunit-tests .qunit-todo-label { background-color: #EEE; } /** Result */ #qunit-testresult { color: #2B81AF; background-color: #D2E0E6; border-bottom: 1px solid #FFF; } #qunit-testresult .clearfix { height: 0; clear: both; } #qunit-testresult .module-name { font-weight: 700; } #qunit-testresult-display { padding: 0.5em 1em 0.5em 1em; width: 85%; float:left; } #qunit-testresult-controls { padding: 0.5em 1em 0.5em 1em; width: 10%; float:left; } /** Fixture */ #qunit-fixture { position: absolute; top: -10000px; left: -10000px; width: 1000px; height: 1000px; } ================================================ FILE: common/Tests/External/qunit-2.9.1.js ================================================ /*! * QUnit 2.9.1 * https://qunitjs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2019-01-07T16:37Z */ (function (global$1) { 'use strict'; global$1 = global$1 && global$1.hasOwnProperty('default') ? global$1['default'] : global$1; var window$1 = global$1.window; var self$1 = global$1.self; var console = global$1.console; var setTimeout$1 = global$1.setTimeout; var clearTimeout = global$1.clearTimeout; var document$1 = window$1 && window$1.document; var navigator = window$1 && window$1.navigator; var localSessionStorage = function () { var x = "qunit-test-string"; try { global$1.sessionStorage.setItem(x, x); global$1.sessionStorage.removeItem(x); return global$1.sessionStorage; } catch (e) { return undefined; } }(); /** * Returns a function that proxies to the given method name on the globals * console object. The proxy will also detect if the console doesn't exist and * will appropriately no-op. This allows support for IE9, which doesn't have a * console if the developer tools are not open. */ function consoleProxy(method) { return function () { if (console) { console[method].apply(console, arguments); } }; } var Logger = { warn: consoleProxy("warn") }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }; var toString = Object.prototype.toString; var hasOwn = Object.prototype.hasOwnProperty; var now = Date.now || function () { return new Date().getTime(); }; var hasPerformanceApi = detectPerformanceApi(); var performance = hasPerformanceApi ? window$1.performance : undefined; var performanceNow = hasPerformanceApi ? performance.now.bind(performance) : now; function detectPerformanceApi() { return window$1 && typeof window$1.performance !== "undefined" && typeof window$1.performance.mark === "function" && typeof window$1.performance.measure === "function"; } function measure(comment, startMark, endMark) { // `performance.measure` may fail if the mark could not be found. // reasons a specific mark could not be found include: outside code invoking `performance.clearMarks()` try { performance.measure(comment, startMark, endMark); } catch (ex) { Logger.warn("performance.measure could not be executed because of ", ex.message); } } var defined = { document: window$1 && window$1.document !== undefined, setTimeout: setTimeout$1 !== undefined }; // Returns a new Array with the elements that are in a but not in b function diff(a, b) { var i, j, result = a.slice(); for (i = 0; i < result.length; i++) { for (j = 0; j < b.length; j++) { if (result[i] === b[j]) { result.splice(i, 1); i--; break; } } } return result; } /** * Determines whether an element exists in a given array or not. * * @method inArray * @param {Any} elem * @param {Array} array * @return {Boolean} */ function inArray(elem, array) { return array.indexOf(elem) !== -1; } /** * Makes a clone of an object using only Array or Object as base, * and copies over the own enumerable properties. * * @param {Object} obj * @return {Object} New object with only the own properties (recursively). */ function objectValues(obj) { var key, val, vals = is("array", obj) ? [] : {}; for (key in obj) { if (hasOwn.call(obj, key)) { val = obj[key]; vals[key] = val === Object(val) ? objectValues(val) : val; } } return vals; } function extend(a, b, undefOnly) { for (var prop in b) { if (hasOwn.call(b, prop)) { if (b[prop] === undefined) { delete a[prop]; } else if (!(undefOnly && typeof a[prop] !== "undefined")) { a[prop] = b[prop]; } } } return a; } function objectType(obj) { if (typeof obj === "undefined") { return "undefined"; } // Consider: typeof null === object if (obj === null) { return "null"; } var match = toString.call(obj).match(/^\[object\s(.*)\]$/), type = match && match[1]; switch (type) { case "Number": if (isNaN(obj)) { return "nan"; } return "number"; case "String": case "Boolean": case "Array": case "Set": case "Map": case "Date": case "RegExp": case "Function": case "Symbol": return type.toLowerCase(); default: return typeof obj === "undefined" ? "undefined" : _typeof(obj); } } // Safe object type checking function is(type, obj) { return objectType(obj) === type; } // Based on Java's String.hashCode, a simple but not // rigorously collision resistant hashing function function generateHash(module, testName) { var str = module + "\x1C" + testName; var hash = 0; for (var i = 0; i < str.length; i++) { hash = (hash << 5) - hash + str.charCodeAt(i); hash |= 0; } // Convert the possibly negative integer hash code into an 8 character hex string, which isn't // strictly necessary but increases user understanding that the id is a SHA-like hash var hex = (0x100000000 + hash).toString(16); if (hex.length < 8) { hex = "0000000" + hex; } return hex.slice(-8); } // Test for equality any JavaScript type. // Authors: Philippe Rathé , David Chan var equiv = (function () { // Value pairs queued for comparison. Used for breadth-first processing order, recursion // detection and avoiding repeated comparison (see below for details). // Elements are { a: val, b: val }. var pairs = []; var getProto = Object.getPrototypeOf || function (obj) { return obj.__proto__; }; function useStrictEquality(a, b) { // This only gets called if a and b are not strict equal, and is used to compare on // the primitive values inside object wrappers. For example: // `var i = 1;` // `var j = new Number(1);` // Neither a nor b can be null, as a !== b and they have the same type. if ((typeof a === "undefined" ? "undefined" : _typeof(a)) === "object") { a = a.valueOf(); } if ((typeof b === "undefined" ? "undefined" : _typeof(b)) === "object") { b = b.valueOf(); } return a === b; } function compareConstructors(a, b) { var protoA = getProto(a); var protoB = getProto(b); // Comparing constructors is more strict than using `instanceof` if (a.constructor === b.constructor) { return true; } // Ref #851 // If the obj prototype descends from a null constructor, treat it // as a null prototype. if (protoA && protoA.constructor === null) { protoA = null; } if (protoB && protoB.constructor === null) { protoB = null; } // Allow objects with no prototype to be equivalent to // objects with Object as their constructor. if (protoA === null && protoB === Object.prototype || protoB === null && protoA === Object.prototype) { return true; } return false; } function getRegExpFlags(regexp) { return "flags" in regexp ? regexp.flags : regexp.toString().match(/[gimuy]*$/)[0]; } function isContainer(val) { return ["object", "array", "map", "set"].indexOf(objectType(val)) !== -1; } function breadthFirstCompareChild(a, b) { // If a is a container not reference-equal to b, postpone the comparison to the // end of the pairs queue -- unless (a, b) has been seen before, in which case skip // over the pair. if (a === b) { return true; } if (!isContainer(a)) { return typeEquiv(a, b); } if (pairs.every(function (pair) { return pair.a !== a || pair.b !== b; })) { // Not yet started comparing this pair pairs.push({ a: a, b: b }); } return true; } var callbacks = { "string": useStrictEquality, "boolean": useStrictEquality, "number": useStrictEquality, "null": useStrictEquality, "undefined": useStrictEquality, "symbol": useStrictEquality, "date": useStrictEquality, "nan": function nan() { return true; }, "regexp": function regexp(a, b) { return a.source === b.source && // Include flags in the comparison getRegExpFlags(a) === getRegExpFlags(b); }, // abort (identical references / instance methods were skipped earlier) "function": function _function() { return false; }, "array": function array(a, b) { var i, len; len = a.length; if (len !== b.length) { // Safe and faster return false; } for (i = 0; i < len; i++) { // Compare non-containers; queue non-reference-equal containers if (!breadthFirstCompareChild(a[i], b[i])) { return false; } } return true; }, // Define sets a and b to be equivalent if for each element aVal in a, there // is some element bVal in b such that aVal and bVal are equivalent. Element // repetitions are not counted, so these are equivalent: // a = new Set( [ {}, [], [] ] ); // b = new Set( [ {}, {}, [] ] ); "set": function set$$1(a, b) { var innerEq, outerEq = true; if (a.size !== b.size) { // This optimization has certain quirks because of the lack of // repetition counting. For instance, adding the same // (reference-identical) element to two equivalent sets can // make them non-equivalent. return false; } a.forEach(function (aVal) { // Short-circuit if the result is already known. (Using for...of // with a break clause would be cleaner here, but it would cause // a syntax error on older Javascript implementations even if // Set is unused) if (!outerEq) { return; } innerEq = false; b.forEach(function (bVal) { var parentPairs; // Likewise, short-circuit if the result is already known if (innerEq) { return; } // Swap out the global pairs list, as the nested call to // innerEquiv will clobber its contents parentPairs = pairs; if (innerEquiv(bVal, aVal)) { innerEq = true; } // Replace the global pairs list pairs = parentPairs; }); if (!innerEq) { outerEq = false; } }); return outerEq; }, // Define maps a and b to be equivalent if for each key-value pair (aKey, aVal) // in a, there is some key-value pair (bKey, bVal) in b such that // [ aKey, aVal ] and [ bKey, bVal ] are equivalent. Key repetitions are not // counted, so these are equivalent: // a = new Map( [ [ {}, 1 ], [ {}, 1 ], [ [], 1 ] ] ); // b = new Map( [ [ {}, 1 ], [ [], 1 ], [ [], 1 ] ] ); "map": function map(a, b) { var innerEq, outerEq = true; if (a.size !== b.size) { // This optimization has certain quirks because of the lack of // repetition counting. For instance, adding the same // (reference-identical) key-value pair to two equivalent maps // can make them non-equivalent. return false; } a.forEach(function (aVal, aKey) { // Short-circuit if the result is already known. (Using for...of // with a break clause would be cleaner here, but it would cause // a syntax error on older Javascript implementations even if // Map is unused) if (!outerEq) { return; } innerEq = false; b.forEach(function (bVal, bKey) { var parentPairs; // Likewise, short-circuit if the result is already known if (innerEq) { return; } // Swap out the global pairs list, as the nested call to // innerEquiv will clobber its contents parentPairs = pairs; if (innerEquiv([bVal, bKey], [aVal, aKey])) { innerEq = true; } // Replace the global pairs list pairs = parentPairs; }); if (!innerEq) { outerEq = false; } }); return outerEq; }, "object": function object(a, b) { var i, aProperties = [], bProperties = []; if (compareConstructors(a, b) === false) { return false; } // Be strict: don't ensure hasOwnProperty and go deep for (i in a) { // Collect a's properties aProperties.push(i); // Skip OOP methods that look the same if (a.constructor !== Object && typeof a.constructor !== "undefined" && typeof a[i] === "function" && typeof b[i] === "function" && a[i].toString() === b[i].toString()) { continue; } // Compare non-containers; queue non-reference-equal containers if (!breadthFirstCompareChild(a[i], b[i])) { return false; } } for (i in b) { // Collect b's properties bProperties.push(i); } // Ensures identical properties name return typeEquiv(aProperties.sort(), bProperties.sort()); } }; function typeEquiv(a, b) { var type = objectType(a); // Callbacks for containers will append to the pairs queue to achieve breadth-first // search order. The pairs queue is also used to avoid reprocessing any pair of // containers that are reference-equal to a previously visited pair (a special case // this being recursion detection). // // Because of this approach, once typeEquiv returns a false value, it should not be // called again without clearing the pair queue else it may wrongly report a visited // pair as being equivalent. return objectType(b) === type && callbacks[type](a, b); } function innerEquiv(a, b) { var i, pair; // We're done when there's nothing more to compare if (arguments.length < 2) { return true; } // Clear the global pair queue and add the top-level values being compared pairs = [{ a: a, b: b }]; for (i = 0; i < pairs.length; i++) { pair = pairs[i]; // Perform type-specific comparison on any pairs that are not strictly // equal. For container types, that comparison will postpone comparison // of any sub-container pair to the end of the pair queue. This gives // breadth-first search order. It also avoids the reprocessing of // reference-equal siblings, cousins etc, which can have a significant speed // impact when comparing a container of small objects each of which has a // reference to the same (singleton) large object. if (pair.a !== pair.b && !typeEquiv(pair.a, pair.b)) { return false; } } // ...across all consecutive argument pairs return arguments.length === 2 || innerEquiv.apply(this, [].slice.call(arguments, 1)); } return function () { var result = innerEquiv.apply(undefined, arguments); // Release any retained objects pairs.length = 0; return result; }; })(); /** * Config object: Maintain internal state * Later exposed as QUnit.config * `config` initialized at top of scope */ var config = { // The queue of tests to run queue: [], // Block until document ready blocking: true, // By default, run previously failed tests first // very useful in combination with "Hide passed tests" checked reorder: true, // By default, modify document.title when suite is done altertitle: true, // HTML Reporter: collapse every test except the first failing test // If false, all failing tests will be expanded collapse: true, // By default, scroll to top of the page when suite is done scrolltop: true, // Depth up-to which object will be dumped maxDepth: 5, // When enabled, all tests must call expect() requireExpects: false, // Placeholder for user-configurable form-exposed URL parameters urlConfig: [], // Set of all modules. modules: [], // The first unnamed module currentModule: { name: "", tests: [], childModules: [], testsRun: 0, unskippedTestsRun: 0, hooks: { before: [], beforeEach: [], afterEach: [], after: [] } }, callbacks: {}, // The storage module to use for reordering tests storage: localSessionStorage }; // take a predefined QUnit.config and extend the defaults var globalConfig = window$1 && window$1.QUnit && window$1.QUnit.config; // only extend the global config if there is no QUnit overload if (window$1 && window$1.QUnit && !window$1.QUnit.version) { extend(config, globalConfig); } // Push a loose unnamed module to the modules collection config.modules.push(config.currentModule); // Based on jsDump by Ariel Flesler // http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html var dump = (function () { function quote(str) { return "\"" + str.toString().replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\""; } function literal(o) { return o + ""; } function join(pre, arr, post) { var s = dump.separator(), base = dump.indent(), inner = dump.indent(1); if (arr.join) { arr = arr.join("," + s + inner); } if (!arr) { return pre + post; } return [pre, inner + arr, base + post].join(s); } function array(arr, stack) { var i = arr.length, ret = new Array(i); if (dump.maxDepth && dump.depth > dump.maxDepth) { return "[object Array]"; } this.up(); while (i--) { ret[i] = this.parse(arr[i], undefined, stack); } this.down(); return join("[", ret, "]"); } function isArray(obj) { return ( //Native Arrays toString.call(obj) === "[object Array]" || // NodeList objects typeof obj.length === "number" && obj.item !== undefined && (obj.length ? obj.item(0) === obj[0] : obj.item(0) === null && obj[0] === undefined) ); } var reName = /^function (\w+)/, dump = { // The objType is used mostly internally, you can fix a (custom) type in advance parse: function parse(obj, objType, stack) { stack = stack || []; var res, parser, parserType, objIndex = stack.indexOf(obj); if (objIndex !== -1) { return "recursion(" + (objIndex - stack.length) + ")"; } objType = objType || this.typeOf(obj); parser = this.parsers[objType]; parserType = typeof parser === "undefined" ? "undefined" : _typeof(parser); if (parserType === "function") { stack.push(obj); res = parser.call(this, obj, stack); stack.pop(); return res; } return parserType === "string" ? parser : this.parsers.error; }, typeOf: function typeOf(obj) { var type; if (obj === null) { type = "null"; } else if (typeof obj === "undefined") { type = "undefined"; } else if (is("regexp", obj)) { type = "regexp"; } else if (is("date", obj)) { type = "date"; } else if (is("function", obj)) { type = "function"; } else if (obj.setInterval !== undefined && obj.document !== undefined && obj.nodeType === undefined) { type = "window"; } else if (obj.nodeType === 9) { type = "document"; } else if (obj.nodeType) { type = "node"; } else if (isArray(obj)) { type = "array"; } else if (obj.constructor === Error.prototype.constructor) { type = "error"; } else { type = typeof obj === "undefined" ? "undefined" : _typeof(obj); } return type; }, separator: function separator() { if (this.multiline) { return this.HTML ? "
      " : "\n"; } else { return this.HTML ? " " : " "; } }, // Extra can be a number, shortcut for increasing-calling-decreasing indent: function indent(extra) { if (!this.multiline) { return ""; } var chr = this.indentChar; if (this.HTML) { chr = chr.replace(/\t/g, " ").replace(/ /g, " "); } return new Array(this.depth + (extra || 0)).join(chr); }, up: function up(a) { this.depth += a || 1; }, down: function down(a) { this.depth -= a || 1; }, setParser: function setParser(name, parser) { this.parsers[name] = parser; }, // The next 3 are exposed so you can use them quote: quote, literal: literal, join: join, depth: 1, maxDepth: config.maxDepth, // This is the list of parsers, to modify them, use dump.setParser parsers: { window: "[Window]", document: "[Document]", error: function error(_error) { return "Error(\"" + _error.message + "\")"; }, unknown: "[Unknown]", "null": "null", "undefined": "undefined", "function": function _function(fn) { var ret = "function", // Functions never have name in IE name = "name" in fn ? fn.name : (reName.exec(fn) || [])[1]; if (name) { ret += " " + name; } ret += "("; ret = [ret, dump.parse(fn, "functionArgs"), "){"].join(""); return join(ret, dump.parse(fn, "functionCode"), "}"); }, array: array, nodelist: array, "arguments": array, object: function object(map, stack) { var keys, key, val, i, nonEnumerableProperties, ret = []; if (dump.maxDepth && dump.depth > dump.maxDepth) { return "[object Object]"; } dump.up(); keys = []; for (key in map) { keys.push(key); } // Some properties are not always enumerable on Error objects. nonEnumerableProperties = ["message", "name"]; for (i in nonEnumerableProperties) { key = nonEnumerableProperties[i]; if (key in map && !inArray(key, keys)) { keys.push(key); } } keys.sort(); for (i = 0; i < keys.length; i++) { key = keys[i]; val = map[key]; ret.push(dump.parse(key, "key") + ": " + dump.parse(val, undefined, stack)); } dump.down(); return join("{", ret, "}"); }, node: function node(_node) { var len, i, val, open = dump.HTML ? "<" : "<", close = dump.HTML ? ">" : ">", tag = _node.nodeName.toLowerCase(), ret = open + tag, attrs = _node.attributes; if (attrs) { for (i = 0, len = attrs.length; i < len; i++) { val = attrs[i].nodeValue; // IE6 includes all attributes in .attributes, even ones not explicitly // set. Those have values like undefined, null, 0, false, "" or // "inherit". if (val && val !== "inherit") { ret += " " + attrs[i].nodeName + "=" + dump.parse(val, "attribute"); } } } ret += close; // Show content of TextNode or CDATASection if (_node.nodeType === 3 || _node.nodeType === 4) { ret += _node.nodeValue; } return ret + open + "/" + tag + close; }, // Function calls it internally, it's the arguments part of the function functionArgs: function functionArgs(fn) { var args, l = fn.length; if (!l) { return ""; } args = new Array(l); while (l--) { // 97 is 'a' args[l] = String.fromCharCode(97 + l); } return " " + args.join(", ") + " "; }, // Object calls it internally, the key part of an item in a map key: quote, // Function calls it internally, it's the content of the function functionCode: "[code]", // Node calls it internally, it's a html attribute value attribute: quote, string: quote, date: quote, regexp: literal, number: literal, "boolean": literal, symbol: function symbol(sym) { return sym.toString(); } }, // If true, entities are escaped ( <, >, \t, space and \n ) HTML: false, // Indentation unit indentChar: " ", // If true, items in a collection, are separated by a \n, else just a space. multiline: true }; return dump; })(); var SuiteReport = function () { function SuiteReport(name, parentSuite) { classCallCheck(this, SuiteReport); this.name = name; this.fullName = parentSuite ? parentSuite.fullName.concat(name) : []; this.tests = []; this.childSuites = []; if (parentSuite) { parentSuite.pushChildSuite(this); } } createClass(SuiteReport, [{ key: "start", value: function start(recordTime) { if (recordTime) { this._startTime = performanceNow(); if (performance) { var suiteLevel = this.fullName.length; performance.mark("qunit_suite_" + suiteLevel + "_start"); } } return { name: this.name, fullName: this.fullName.slice(), tests: this.tests.map(function (test) { return test.start(); }), childSuites: this.childSuites.map(function (suite) { return suite.start(); }), testCounts: { total: this.getTestCounts().total } }; } }, { key: "end", value: function end(recordTime) { if (recordTime) { this._endTime = performanceNow(); if (performance) { var suiteLevel = this.fullName.length; performance.mark("qunit_suite_" + suiteLevel + "_end"); var suiteName = this.fullName.join(" – "); measure(suiteLevel === 0 ? "QUnit Test Run" : "QUnit Test Suite: " + suiteName, "qunit_suite_" + suiteLevel + "_start", "qunit_suite_" + suiteLevel + "_end"); } } return { name: this.name, fullName: this.fullName.slice(), tests: this.tests.map(function (test) { return test.end(); }), childSuites: this.childSuites.map(function (suite) { return suite.end(); }), testCounts: this.getTestCounts(), runtime: this.getRuntime(), status: this.getStatus() }; } }, { key: "pushChildSuite", value: function pushChildSuite(suite) { this.childSuites.push(suite); } }, { key: "pushTest", value: function pushTest(test) { this.tests.push(test); } }, { key: "getRuntime", value: function getRuntime() { return this._endTime - this._startTime; } }, { key: "getTestCounts", value: function getTestCounts() { var counts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { passed: 0, failed: 0, skipped: 0, todo: 0, total: 0 }; counts = this.tests.reduce(function (counts, test) { if (test.valid) { counts[test.getStatus()]++; counts.total++; } return counts; }, counts); return this.childSuites.reduce(function (counts, suite) { return suite.getTestCounts(counts); }, counts); } }, { key: "getStatus", value: function getStatus() { var _getTestCounts = this.getTestCounts(), total = _getTestCounts.total, failed = _getTestCounts.failed, skipped = _getTestCounts.skipped, todo = _getTestCounts.todo; if (failed) { return "failed"; } else { if (skipped === total) { return "skipped"; } else if (todo === total) { return "todo"; } else { return "passed"; } } } }]); return SuiteReport; }(); var focused = false; var moduleStack = []; function createModule(name, testEnvironment, modifiers) { var parentModule = moduleStack.length ? moduleStack.slice(-1)[0] : null; var moduleName = parentModule !== null ? [parentModule.name, name].join(" > ") : name; var parentSuite = parentModule ? parentModule.suiteReport : globalSuite; var skip = parentModule !== null && parentModule.skip || modifiers.skip; var todo = parentModule !== null && parentModule.todo || modifiers.todo; var module = { name: moduleName, parentModule: parentModule, tests: [], moduleId: generateHash(moduleName), testsRun: 0, unskippedTestsRun: 0, childModules: [], suiteReport: new SuiteReport(name, parentSuite), // Pass along `skip` and `todo` properties from parent module, in case // there is one, to childs. And use own otherwise. // This property will be used to mark own tests and tests of child suites // as either `skipped` or `todo`. skip: skip, todo: skip ? false : todo }; var env = {}; if (parentModule) { parentModule.childModules.push(module); extend(env, parentModule.testEnvironment); } extend(env, testEnvironment); module.testEnvironment = env; config.modules.push(module); return module; } function processModule(name, options, executeNow) { var modifiers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; if (objectType(options) === "function") { executeNow = options; options = undefined; } var module = createModule(name, options, modifiers); // Move any hooks to a 'hooks' object var testEnvironment = module.testEnvironment; var hooks = module.hooks = {}; setHookFromEnvironment(hooks, testEnvironment, "before"); setHookFromEnvironment(hooks, testEnvironment, "beforeEach"); setHookFromEnvironment(hooks, testEnvironment, "afterEach"); setHookFromEnvironment(hooks, testEnvironment, "after"); var moduleFns = { before: setHookFunction(module, "before"), beforeEach: setHookFunction(module, "beforeEach"), afterEach: setHookFunction(module, "afterEach"), after: setHookFunction(module, "after") }; var currentModule = config.currentModule; if (objectType(executeNow) === "function") { moduleStack.push(module); config.currentModule = module; executeNow.call(module.testEnvironment, moduleFns); moduleStack.pop(); module = module.parentModule || currentModule; } config.currentModule = module; function setHookFromEnvironment(hooks, environment, name) { var potentialHook = environment[name]; hooks[name] = typeof potentialHook === "function" ? [potentialHook] : []; delete environment[name]; } function setHookFunction(module, hookName) { return function setHook(callback) { module.hooks[hookName].push(callback); }; } } function module$1(name, options, executeNow) { if (focused) { return; } processModule(name, options, executeNow); } module$1.only = function () { if (focused) { return; } config.modules.length = 0; config.queue.length = 0; module$1.apply(undefined, arguments); focused = true; }; module$1.skip = function (name, options, executeNow) { if (focused) { return; } processModule(name, options, executeNow, { skip: true }); }; module$1.todo = function (name, options, executeNow) { if (focused) { return; } processModule(name, options, executeNow, { todo: true }); }; var LISTENERS = Object.create(null); var SUPPORTED_EVENTS = ["runStart", "suiteStart", "testStart", "assertion", "testEnd", "suiteEnd", "runEnd"]; /** * Emits an event with the specified data to all currently registered listeners. * Callbacks will fire in the order in which they are registered (FIFO). This * function is not exposed publicly; it is used by QUnit internals to emit * logging events. * * @private * @method emit * @param {String} eventName * @param {Object} data * @return {Void} */ function emit(eventName, data) { if (objectType(eventName) !== "string") { throw new TypeError("eventName must be a string when emitting an event"); } // Clone the callbacks in case one of them registers a new callback var originalCallbacks = LISTENERS[eventName]; var callbacks = originalCallbacks ? [].concat(toConsumableArray(originalCallbacks)) : []; for (var i = 0; i < callbacks.length; i++) { callbacks[i](data); } } /** * Registers a callback as a listener to the specified event. * * @public * @method on * @param {String} eventName * @param {Function} callback * @return {Void} */ function on(eventName, callback) { if (objectType(eventName) !== "string") { throw new TypeError("eventName must be a string when registering a listener"); } else if (!inArray(eventName, SUPPORTED_EVENTS)) { var events = SUPPORTED_EVENTS.join(", "); throw new Error("\"" + eventName + "\" is not a valid event; must be one of: " + events + "."); } else if (objectType(callback) !== "function") { throw new TypeError("callback must be a function when registering a listener"); } if (!LISTENERS[eventName]) { LISTENERS[eventName] = []; } // Don't register the same callback more than once if (!inArray(callback, LISTENERS[eventName])) { LISTENERS[eventName].push(callback); } } function objectOrFunction(x) { var type = typeof x === 'undefined' ? 'undefined' : _typeof(x); return x !== null && (type === 'object' || type === 'function'); } function isFunction(x) { return typeof x === 'function'; } var _isArray = void 0; if (Array.isArray) { _isArray = Array.isArray; } else { _isArray = function _isArray(x) { return Object.prototype.toString.call(x) === '[object Array]'; }; } var isArray = _isArray; var len = 0; var vertxNext = void 0; var customSchedulerFn = void 0; var asap = function asap(callback, arg) { queue[len] = callback; queue[len + 1] = arg; len += 2; if (len === 2) { // If len is 2, that means that we need to schedule an async flush. // If additional callbacks are queued before the queue is flushed, they // will be processed by this flush that we are scheduling. if (customSchedulerFn) { customSchedulerFn(flush); } else { scheduleFlush(); } } }; function setScheduler(scheduleFn) { customSchedulerFn = scheduleFn; } function setAsap(asapFn) { asap = asapFn; } var browserWindow = typeof window !== 'undefined' ? window : undefined; var browserGlobal = browserWindow || {}; var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; // test for web worker but not in IE10 var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; // node function useNextTick() { // node version 0.10.x displays a deprecation warning when nextTick is used recursively // see https://github.com/cujojs/when/issues/410 for details return function () { return process.nextTick(flush); }; } // vertx function useVertxTimer() { if (typeof vertxNext !== 'undefined') { return function () { vertxNext(flush); }; } return useSetTimeout(); } function useMutationObserver() { var iterations = 0; var observer = new BrowserMutationObserver(flush); var node = document.createTextNode(''); observer.observe(node, { characterData: true }); return function () { node.data = iterations = ++iterations % 2; }; } // web worker function useMessageChannel() { var channel = new MessageChannel(); channel.port1.onmessage = flush; return function () { return channel.port2.postMessage(0); }; } function useSetTimeout() { // Store setTimeout reference so es6-promise will be unaffected by // other code modifying setTimeout (like sinon.useFakeTimers()) var globalSetTimeout = setTimeout; return function () { return globalSetTimeout(flush, 1); }; } var queue = new Array(1000); function flush() { for (var i = 0; i < len; i += 2) { var callback = queue[i]; var arg = queue[i + 1]; callback(arg); queue[i] = undefined; queue[i + 1] = undefined; } len = 0; } function attemptVertx() { try { var vertx = Function('return this')().require('vertx'); vertxNext = vertx.runOnLoop || vertx.runOnContext; return useVertxTimer(); } catch (e) { return useSetTimeout(); } } var scheduleFlush = void 0; // Decide what async method to use to triggering processing of queued callbacks: if (isNode) { scheduleFlush = useNextTick(); } else if (BrowserMutationObserver) { scheduleFlush = useMutationObserver(); } else if (isWorker) { scheduleFlush = useMessageChannel(); } else if (browserWindow === undefined && typeof require === 'function') { scheduleFlush = attemptVertx(); } else { scheduleFlush = useSetTimeout(); } function then(onFulfillment, onRejection) { var parent = this; var child = new this.constructor(noop); if (child[PROMISE_ID] === undefined) { makePromise(child); } var _state = parent._state; if (_state) { var callback = arguments[_state - 1]; asap(function () { return invokeCallback(_state, child, callback, parent._result); }); } else { subscribe(parent, child, onFulfillment, onRejection); } return child; } /** `Promise.resolve` returns a promise that will become resolved with the passed `value`. It is shorthand for the following: ```javascript let promise = new Promise(function(resolve, reject){ resolve(1); }); promise.then(function(value){ // value === 1 }); ``` Instead of writing the above, your code now simply becomes the following: ```javascript let promise = Promise.resolve(1); promise.then(function(value){ // value === 1 }); ``` @method resolve @static @param {Any} value value that the returned promise will be resolved with Useful for tooling. @return {Promise} a promise that will become fulfilled with the given `value` */ function resolve$1(object) { /*jshint validthis:true */ var Constructor = this; if (object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && object.constructor === Constructor) { return object; } var promise = new Constructor(noop); resolve(promise, object); return promise; } var PROMISE_ID = Math.random().toString(36).substring(2); function noop() {} var PENDING = void 0; var FULFILLED = 1; var REJECTED = 2; var TRY_CATCH_ERROR = { error: null }; function selfFulfillment() { return new TypeError("You cannot resolve a promise with itself"); } function cannotReturnOwn() { return new TypeError('A promises callback cannot return that same promise.'); } function getThen(promise) { try { return promise.then; } catch (error) { TRY_CATCH_ERROR.error = error; return TRY_CATCH_ERROR; } } function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) { try { then$$1.call(value, fulfillmentHandler, rejectionHandler); } catch (e) { return e; } } function handleForeignThenable(promise, thenable, then$$1) { asap(function (promise) { var sealed = false; var error = tryThen(then$$1, thenable, function (value) { if (sealed) { return; } sealed = true; if (thenable !== value) { resolve(promise, value); } else { fulfill(promise, value); } }, function (reason) { if (sealed) { return; } sealed = true; reject(promise, reason); }, 'Settle: ' + (promise._label || ' unknown promise')); if (!sealed && error) { sealed = true; reject(promise, error); } }, promise); } function handleOwnThenable(promise, thenable) { if (thenable._state === FULFILLED) { fulfill(promise, thenable._result); } else if (thenable._state === REJECTED) { reject(promise, thenable._result); } else { subscribe(thenable, undefined, function (value) { return resolve(promise, value); }, function (reason) { return reject(promise, reason); }); } } function handleMaybeThenable(promise, maybeThenable, then$$1) { if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) { handleOwnThenable(promise, maybeThenable); } else { if (then$$1 === TRY_CATCH_ERROR) { reject(promise, TRY_CATCH_ERROR.error); TRY_CATCH_ERROR.error = null; } else if (then$$1 === undefined) { fulfill(promise, maybeThenable); } else if (isFunction(then$$1)) { handleForeignThenable(promise, maybeThenable, then$$1); } else { fulfill(promise, maybeThenable); } } } function resolve(promise, value) { if (promise === value) { reject(promise, selfFulfillment()); } else if (objectOrFunction(value)) { handleMaybeThenable(promise, value, getThen(value)); } else { fulfill(promise, value); } } function publishRejection(promise) { if (promise._onerror) { promise._onerror(promise._result); } publish(promise); } function fulfill(promise, value) { if (promise._state !== PENDING) { return; } promise._result = value; promise._state = FULFILLED; if (promise._subscribers.length !== 0) { asap(publish, promise); } } function reject(promise, reason) { if (promise._state !== PENDING) { return; } promise._state = REJECTED; promise._result = reason; asap(publishRejection, promise); } function subscribe(parent, child, onFulfillment, onRejection) { var _subscribers = parent._subscribers; var length = _subscribers.length; parent._onerror = null; _subscribers[length] = child; _subscribers[length + FULFILLED] = onFulfillment; _subscribers[length + REJECTED] = onRejection; if (length === 0 && parent._state) { asap(publish, parent); } } function publish(promise) { var subscribers = promise._subscribers; var settled = promise._state; if (subscribers.length === 0) { return; } var child = void 0, callback = void 0, detail = promise._result; for (var i = 0; i < subscribers.length; i += 3) { child = subscribers[i]; callback = subscribers[i + settled]; if (child) { invokeCallback(settled, child, callback, detail); } else { callback(detail); } } promise._subscribers.length = 0; } function tryCatch(callback, detail) { try { return callback(detail); } catch (e) { TRY_CATCH_ERROR.error = e; return TRY_CATCH_ERROR; } } function invokeCallback(settled, promise, callback, detail) { var hasCallback = isFunction(callback), value = void 0, error = void 0, succeeded = void 0, failed = void 0; if (hasCallback) { value = tryCatch(callback, detail); if (value === TRY_CATCH_ERROR) { failed = true; error = value.error; value.error = null; } else { succeeded = true; } if (promise === value) { reject(promise, cannotReturnOwn()); return; } } else { value = detail; succeeded = true; } if (promise._state !== PENDING) { // noop } else if (hasCallback && succeeded) { resolve(promise, value); } else if (failed) { reject(promise, error); } else if (settled === FULFILLED) { fulfill(promise, value); } else if (settled === REJECTED) { reject(promise, value); } } function initializePromise(promise, resolver) { try { resolver(function resolvePromise(value) { resolve(promise, value); }, function rejectPromise(reason) { reject(promise, reason); }); } catch (e) { reject(promise, e); } } var id = 0; function nextId() { return id++; } function makePromise(promise) { promise[PROMISE_ID] = id++; promise._state = undefined; promise._result = undefined; promise._subscribers = []; } function validationError() { return new Error('Array Methods must be provided an Array'); } var Enumerator = function () { function Enumerator(Constructor, input) { classCallCheck(this, Enumerator); this._instanceConstructor = Constructor; this.promise = new Constructor(noop); if (!this.promise[PROMISE_ID]) { makePromise(this.promise); } if (isArray(input)) { this.length = input.length; this._remaining = input.length; this._result = new Array(this.length); if (this.length === 0) { fulfill(this.promise, this._result); } else { this.length = this.length || 0; this._enumerate(input); if (this._remaining === 0) { fulfill(this.promise, this._result); } } } else { reject(this.promise, validationError()); } } createClass(Enumerator, [{ key: '_enumerate', value: function _enumerate(input) { for (var i = 0; this._state === PENDING && i < input.length; i++) { this._eachEntry(input[i], i); } } }, { key: '_eachEntry', value: function _eachEntry(entry, i) { var c = this._instanceConstructor; var resolve$$1 = c.resolve; if (resolve$$1 === resolve$1) { var _then = getThen(entry); if (_then === then && entry._state !== PENDING) { this._settledAt(entry._state, i, entry._result); } else if (typeof _then !== 'function') { this._remaining--; this._result[i] = entry; } else if (c === Promise$2) { var promise = new c(noop); handleMaybeThenable(promise, entry, _then); this._willSettleAt(promise, i); } else { this._willSettleAt(new c(function (resolve$$1) { return resolve$$1(entry); }), i); } } else { this._willSettleAt(resolve$$1(entry), i); } } }, { key: '_settledAt', value: function _settledAt(state, i, value) { var promise = this.promise; if (promise._state === PENDING) { this._remaining--; if (state === REJECTED) { reject(promise, value); } else { this._result[i] = value; } } if (this._remaining === 0) { fulfill(promise, this._result); } } }, { key: '_willSettleAt', value: function _willSettleAt(promise, i) { var enumerator = this; subscribe(promise, undefined, function (value) { return enumerator._settledAt(FULFILLED, i, value); }, function (reason) { return enumerator._settledAt(REJECTED, i, reason); }); } }]); return Enumerator; }(); /** `Promise.all` accepts an array of promises, and returns a new promise which is fulfilled with an array of fulfillment values for the passed promises, or rejected with the reason of the first passed promise to be rejected. It casts all elements of the passed iterable to promises as it runs this algorithm. Example: ```javascript let promise1 = resolve(1); let promise2 = resolve(2); let promise3 = resolve(3); let promises = [ promise1, promise2, promise3 ]; Promise.all(promises).then(function(array){ // The array here would be [ 1, 2, 3 ]; }); ``` If any of the `promises` given to `all` are rejected, the first promise that is rejected will be given as an argument to the returned promises's rejection handler. For example: Example: ```javascript let promise1 = resolve(1); let promise2 = reject(new Error("2")); let promise3 = reject(new Error("3")); let promises = [ promise1, promise2, promise3 ]; Promise.all(promises).then(function(array){ // Code here never runs because there are rejected promises! }, function(error) { // error.message === "2" }); ``` @method all @static @param {Array} entries array of promises @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} promise that is fulfilled when all `promises` have been fulfilled, or rejected if any of them become rejected. @static */ function all(entries) { return new Enumerator(this, entries).promise; } /** `Promise.race` returns a new promise which is settled in the same way as the first passed promise to settle. Example: ```javascript let promise1 = new Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 1'); }, 200); }); let promise2 = new Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 2'); }, 100); }); Promise.race([promise1, promise2]).then(function(result){ // result === 'promise 2' because it was resolved before promise1 // was resolved. }); ``` `Promise.race` is deterministic in that only the state of the first settled promise matters. For example, even if other promises given to the `promises` array argument are resolved, but the first settled promise has become rejected before the other promises became fulfilled, the returned promise will become rejected: ```javascript let promise1 = new Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 1'); }, 200); }); let promise2 = new Promise(function(resolve, reject){ setTimeout(function(){ reject(new Error('promise 2')); }, 100); }); Promise.race([promise1, promise2]).then(function(result){ // Code here never runs }, function(reason){ // reason.message === 'promise 2' because promise 2 became rejected before // promise 1 became fulfilled }); ``` An example real-world use case is implementing timeouts: ```javascript Promise.race([ajax('foo.json'), timeout(5000)]) ``` @method race @static @param {Array} promises array of promises to observe Useful for tooling. @return {Promise} a promise which settles in the same way as the first passed promise to settle. */ function race(entries) { /*jshint validthis:true */ var Constructor = this; if (!isArray(entries)) { return new Constructor(function (_, reject) { return reject(new TypeError('You must pass an array to race.')); }); } else { return new Constructor(function (resolve, reject) { var length = entries.length; for (var i = 0; i < length; i++) { Constructor.resolve(entries[i]).then(resolve, reject); } }); } } /** `Promise.reject` returns a promise rejected with the passed `reason`. It is shorthand for the following: ```javascript let promise = new Promise(function(resolve, reject){ reject(new Error('WHOOPS')); }); promise.then(function(value){ // Code here doesn't run because the promise is rejected! }, function(reason){ // reason.message === 'WHOOPS' }); ``` Instead of writing the above, your code now simply becomes the following: ```javascript let promise = Promise.reject(new Error('WHOOPS')); promise.then(function(value){ // Code here doesn't run because the promise is rejected! }, function(reason){ // reason.message === 'WHOOPS' }); ``` @method reject @static @param {Any} reason value that the returned promise will be rejected with. Useful for tooling. @return {Promise} a promise rejected with the given `reason`. */ function reject$1(reason) { /*jshint validthis:true */ var Constructor = this; var promise = new Constructor(noop); reject(promise, reason); return promise; } function needsResolver() { throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); } function needsNew() { throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); } /** Promise objects represent the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled. Terminology ----------- - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - `thenable` is an object or function that defines a `then` method. - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - `exception` is a value that is thrown using the throw statement. - `reason` is a value that indicates why a promise was rejected. - `settled` the final resting state of a promise, fulfilled or rejected. A promise can be in one of three states: pending, fulfilled, or rejected. Promises that are fulfilled have a fulfillment value and are in the fulfilled state. Promises that are rejected have a rejection reason and are in the rejected state. A fulfillment value is never a thenable. Promises can also be said to *resolve* a value. If this value is also a promise, then the original promise's settled state will match the value's settled state. So a promise that *resolves* a promise that rejects will itself reject, and a promise that *resolves* a promise that fulfills will itself fulfill. Basic Usage: ------------ ```js let promise = new Promise(function(resolve, reject) { // on success resolve(value); // on failure reject(reason); }); promise.then(function(value) { // on fulfillment }, function(reason) { // on rejection }); ``` Advanced Usage: --------------- Promises shine when abstracting away asynchronous interactions such as `XMLHttpRequest`s. ```js function getJSON(url) { return new Promise(function(resolve, reject){ let xhr = new XMLHttpRequest(); xhr.open('GET', url); xhr.onreadystatechange = handler; xhr.responseType = 'json'; xhr.setRequestHeader('Accept', 'application/json'); xhr.send(); function handler() { if (this.readyState === this.DONE) { if (this.status === 200) { resolve(this.response); } else { reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); } } }; }); } getJSON('/posts.json').then(function(json) { // on fulfillment }, function(reason) { // on rejection }); ``` Unlike callbacks, promises are great composable primitives. ```js Promise.all([ getJSON('/posts'), getJSON('/comments') ]).then(function(values){ values[0] // => postsJSON values[1] // => commentsJSON return values; }); ``` @class Promise @param {Function} resolver Useful for tooling. @constructor */ var Promise$2 = function () { function Promise(resolver) { classCallCheck(this, Promise); this[PROMISE_ID] = nextId(); this._result = this._state = undefined; this._subscribers = []; if (noop !== resolver) { typeof resolver !== 'function' && needsResolver(); this instanceof Promise ? initializePromise(this, resolver) : needsNew(); } } /** The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled. ```js findUser().then(function(user){ // user is available }, function(reason){ // user is unavailable, and you are given the reason why }); ``` Chaining -------- The return value of `then` is itself a promise. This second, 'downstream' promise is resolved with the return value of the first promise's fulfillment or rejection handler, or rejected if the handler throws an exception. ```js findUser().then(function (user) { return user.name; }, function (reason) { return 'default name'; }).then(function (userName) { // If `findUser` fulfilled, `userName` will be the user's name, otherwise it // will be `'default name'` }); findUser().then(function (user) { throw new Error('Found user, but still unhappy'); }, function (reason) { throw new Error('`findUser` rejected and we're unhappy'); }).then(function (value) { // never reached }, function (reason) { // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. }); ``` If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. ```js findUser().then(function (user) { throw new PedagogicalException('Upstream error'); }).then(function (value) { // never reached }).then(function (value) { // never reached }, function (reason) { // The `PedgagocialException` is propagated all the way down to here }); ``` Assimilation ------------ Sometimes the value you want to propagate to a downstream promise can only be retrieved asynchronously. This can be achieved by returning a promise in the fulfillment or rejection handler. The downstream promise will then be pending until the returned promise is settled. This is called *assimilation*. ```js findUser().then(function (user) { return findCommentsByAuthor(user); }).then(function (comments) { // The user's comments are now available }); ``` If the assimliated promise rejects, then the downstream promise will also reject. ```js findUser().then(function (user) { return findCommentsByAuthor(user); }).then(function (comments) { // If `findCommentsByAuthor` fulfills, we'll have the value here }, function (reason) { // If `findCommentsByAuthor` rejects, we'll have the reason here }); ``` Simple Example -------------- Synchronous Example ```javascript let result; try { result = findResult(); // success } catch(reason) { // failure } ``` Errback Example ```js findResult(function(result, err){ if (err) { // failure } else { // success } }); ``` Promise Example; ```javascript findResult().then(function(result){ // success }, function(reason){ // failure }); ``` Advanced Example -------------- Synchronous Example ```javascript let author, books; try { author = findAuthor(); books = findBooksByAuthor(author); // success } catch(reason) { // failure } ``` Errback Example ```js function foundBooks(books) { } function failure(reason) { } findAuthor(function(author, err){ if (err) { failure(err); // failure } else { try { findBoooksByAuthor(author, function(books, err) { if (err) { failure(err); } else { try { foundBooks(books); } catch(reason) { failure(reason); } } }); } catch(error) { failure(err); } // success } }); ``` Promise Example; ```javascript findAuthor(). then(findBooksByAuthor). then(function(books){ // found books }).catch(function(reason){ // something went wrong }); ``` @method then @param {Function} onFulfilled @param {Function} onRejected Useful for tooling. @return {Promise} */ /** `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same as the catch block of a try/catch statement. ```js function findAuthor(){ throw new Error('couldn't find that author'); } // synchronous try { findAuthor(); } catch(reason) { // something went wrong } // async with promises findAuthor().catch(function(reason){ // something went wrong }); ``` @method catch @param {Function} onRejection Useful for tooling. @return {Promise} */ createClass(Promise, [{ key: 'catch', value: function _catch(onRejection) { return this.then(null, onRejection); } /** `finally` will be invoked regardless of the promise's fate just as native try/catch/finally behaves Synchronous example: ```js findAuthor() { if (Math.random() > 0.5) { throw new Error(); } return new Author(); } try { return findAuthor(); // succeed or fail } catch(error) { return findOtherAuther(); } finally { // always runs // doesn't affect the return value } ``` Asynchronous example: ```js findAuthor().catch(function(reason){ return findOtherAuther(); }).finally(function(){ // author was either found, or not }); ``` @method finally @param {Function} callback @return {Promise} */ }, { key: 'finally', value: function _finally(callback) { var promise = this; var constructor = promise.constructor; if (isFunction(callback)) { return promise.then(function (value) { return constructor.resolve(callback()).then(function () { return value; }); }, function (reason) { return constructor.resolve(callback()).then(function () { throw reason; }); }); } return promise.then(callback, callback); } }]); return Promise; }(); Promise$2.prototype.then = then; Promise$2.all = all; Promise$2.race = race; Promise$2.resolve = resolve$1; Promise$2.reject = reject$1; Promise$2._setScheduler = setScheduler; Promise$2._setAsap = setAsap; Promise$2._asap = asap; /*global self*/ function polyfill() { var local = void 0; if (typeof global !== 'undefined') { local = global; } else if (typeof self !== 'undefined') { local = self; } else { try { local = Function('return this')(); } catch (e) { throw new Error('polyfill failed because global object is unavailable in this environment'); } } var P = local.Promise; if (P) { var promiseToString = null; try { promiseToString = Object.prototype.toString.call(P.resolve()); } catch (e) { // silently ignored } if (promiseToString === '[object Promise]' && !P.cast) { return; } } local.Promise = Promise$2; } // Strange compat.. Promise$2.polyfill = polyfill; Promise$2.Promise = Promise$2; var Promise$1 = typeof Promise !== "undefined" ? Promise : Promise$2; // Register logging callbacks function registerLoggingCallbacks(obj) { var i, l, key, callbackNames = ["begin", "done", "log", "testStart", "testDone", "moduleStart", "moduleDone"]; function registerLoggingCallback(key) { var loggingCallback = function loggingCallback(callback) { if (objectType(callback) !== "function") { throw new Error("QUnit logging methods require a callback function as their first parameters."); } config.callbacks[key].push(callback); }; return loggingCallback; } for (i = 0, l = callbackNames.length; i < l; i++) { key = callbackNames[i]; // Initialize key collection of logging callback if (objectType(config.callbacks[key]) === "undefined") { config.callbacks[key] = []; } obj[key] = registerLoggingCallback(key); } } function runLoggingCallbacks(key, args) { var callbacks = config.callbacks[key]; // Handling 'log' callbacks separately. Unlike the other callbacks, // the log callback is not controlled by the processing queue, // but rather used by asserts. Hence to promisfy the 'log' callback // would mean promisfying each step of a test if (key === "log") { callbacks.map(function (callback) { return callback(args); }); return; } // ensure that each callback is executed serially return callbacks.reduce(function (promiseChain, callback) { return promiseChain.then(function () { return Promise$1.resolve(callback(args)); }); }, Promise$1.resolve([])); } // Doesn't support IE9, it will return undefined on these browsers // See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack var fileName = (sourceFromStacktrace(0) || "").replace(/(:\d+)+\)?/, "").replace(/.+\//, ""); function extractStacktrace(e, offset) { offset = offset === undefined ? 4 : offset; var stack, include, i; if (e && e.stack) { stack = e.stack.split("\n"); if (/^error$/i.test(stack[0])) { stack.shift(); } if (fileName) { include = []; for (i = offset; i < stack.length; i++) { if (stack[i].indexOf(fileName) !== -1) { break; } include.push(stack[i]); } if (include.length) { return include.join("\n"); } } return stack[offset]; } } function sourceFromStacktrace(offset) { var error = new Error(); // Support: Safari <=7 only, IE <=10 - 11 only // Not all browsers generate the `stack` property for `new Error()`, see also #636 if (!error.stack) { try { throw error; } catch (err) { error = err; } } return extractStacktrace(error, offset); } var priorityCount = 0; var unitSampler = void 0; // This is a queue of functions that are tasks within a single test. // After tests are dequeued from config.queue they are expanded into // a set of tasks in this queue. var taskQueue = []; /** * Advances the taskQueue to the next task. If the taskQueue is empty, * process the testQueue */ function advance() { advanceTaskQueue(); if (!taskQueue.length && !config.blocking && !config.current) { advanceTestQueue(); } } /** * Advances the taskQueue with an increased depth */ function advanceTaskQueue() { var start = now(); config.depth = (config.depth || 0) + 1; processTaskQueue(start); config.depth--; } /** * Process the first task on the taskQueue as a promise. * Each task is a function returned by https://github.com/qunitjs/qunit/blob/master/src/test.js#L381 */ function processTaskQueue(start) { if (taskQueue.length && !config.blocking) { var elapsedTime = now() - start; if (!defined.setTimeout || config.updateRate <= 0 || elapsedTime < config.updateRate) { var task = taskQueue.shift(); Promise$1.resolve(task()).then(function () { if (!taskQueue.length) { advance(); } else { processTaskQueue(start); } }); } else { setTimeout$1(advance); } } } /** * Advance the testQueue to the next test to process. Call done() if testQueue completes. */ function advanceTestQueue() { if (!config.blocking && !config.queue.length && config.depth === 0) { done(); return; } var testTasks = config.queue.shift(); addToTaskQueue(testTasks()); if (priorityCount > 0) { priorityCount--; } advance(); } /** * Enqueue the tasks for a test into the task queue. * @param {Array} tasksArray */ function addToTaskQueue(tasksArray) { taskQueue.push.apply(taskQueue, toConsumableArray(tasksArray)); } /** * Return the number of tasks remaining in the task queue to be processed. * @return {Number} */ function taskQueueLength() { return taskQueue.length; } /** * Adds a test to the TestQueue for execution. * @param {Function} testTasksFunc * @param {Boolean} prioritize * @param {String} seed */ function addToTestQueue(testTasksFunc, prioritize, seed) { if (prioritize) { config.queue.splice(priorityCount++, 0, testTasksFunc); } else if (seed) { if (!unitSampler) { unitSampler = unitSamplerGenerator(seed); } // Insert into a random position after all prioritized items var index = Math.floor(unitSampler() * (config.queue.length - priorityCount + 1)); config.queue.splice(priorityCount + index, 0, testTasksFunc); } else { config.queue.push(testTasksFunc); } } /** * Creates a seeded "sample" generator which is used for randomizing tests. */ function unitSamplerGenerator(seed) { // 32-bit xorshift, requires only a nonzero seed // http://excamera.com/sphinx/article-xorshift.html var sample = parseInt(generateHash(seed), 16) || -1; return function () { sample ^= sample << 13; sample ^= sample >>> 17; sample ^= sample << 5; // ECMAScript has no unsigned number type if (sample < 0) { sample += 0x100000000; } return sample / 0x100000000; }; } /** * This function is called when the ProcessingQueue is done processing all * items. It handles emitting the final run events. */ function done() { var storage = config.storage; ProcessingQueue.finished = true; var runtime = now() - config.started; var passed = config.stats.all - config.stats.bad; if (config.stats.all === 0) { if (config.filter && config.filter.length) { throw new Error("No tests matched the filter \"" + config.filter + "\"."); } if (config.module && config.module.length) { throw new Error("No tests matched the module \"" + config.module + "\"."); } if (config.moduleId && config.moduleId.length) { throw new Error("No tests matched the moduleId \"" + config.moduleId + "\"."); } if (config.testId && config.testId.length) { throw new Error("No tests matched the testId \"" + config.testId + "\"."); } throw new Error("No tests were run."); } emit("runEnd", globalSuite.end(true)); runLoggingCallbacks("done", { passed: passed, failed: config.stats.bad, total: config.stats.all, runtime: runtime }).then(function () { // Clear own storage items if all tests passed if (storage && config.stats.bad === 0) { for (var i = storage.length - 1; i >= 0; i--) { var key = storage.key(i); if (key.indexOf("qunit-test-") === 0) { storage.removeItem(key); } } } }); } var ProcessingQueue = { finished: false, add: addToTestQueue, advance: advance, taskCount: taskQueueLength }; var TestReport = function () { function TestReport(name, suite, options) { classCallCheck(this, TestReport); this.name = name; this.suiteName = suite.name; this.fullName = suite.fullName.concat(name); this.runtime = 0; this.assertions = []; this.skipped = !!options.skip; this.todo = !!options.todo; this.valid = options.valid; this._startTime = 0; this._endTime = 0; suite.pushTest(this); } createClass(TestReport, [{ key: "start", value: function start(recordTime) { if (recordTime) { this._startTime = performanceNow(); if (performance) { performance.mark("qunit_test_start"); } } return { name: this.name, suiteName: this.suiteName, fullName: this.fullName.slice() }; } }, { key: "end", value: function end(recordTime) { if (recordTime) { this._endTime = performanceNow(); if (performance) { performance.mark("qunit_test_end"); var testName = this.fullName.join(" – "); measure("QUnit Test: " + testName, "qunit_test_start", "qunit_test_end"); } } return extend(this.start(), { runtime: this.getRuntime(), status: this.getStatus(), errors: this.getFailedAssertions(), assertions: this.getAssertions() }); } }, { key: "pushAssertion", value: function pushAssertion(assertion) { this.assertions.push(assertion); } }, { key: "getRuntime", value: function getRuntime() { return this._endTime - this._startTime; } }, { key: "getStatus", value: function getStatus() { if (this.skipped) { return "skipped"; } var testPassed = this.getFailedAssertions().length > 0 ? this.todo : !this.todo; if (!testPassed) { return "failed"; } else if (this.todo) { return "todo"; } else { return "passed"; } } }, { key: "getFailedAssertions", value: function getFailedAssertions() { return this.assertions.filter(function (assertion) { return !assertion.passed; }); } }, { key: "getAssertions", value: function getAssertions() { return this.assertions.slice(); } // Remove actual and expected values from assertions. This is to prevent // leaking memory throughout a test suite. }, { key: "slimAssertions", value: function slimAssertions() { this.assertions = this.assertions.map(function (assertion) { delete assertion.actual; delete assertion.expected; return assertion; }); } }]); return TestReport; }(); var focused$1 = false; function Test(settings) { var i, l; ++Test.count; this.expected = null; this.assertions = []; this.semaphore = 0; this.module = config.currentModule; this.stack = sourceFromStacktrace(3); this.steps = []; this.timeout = undefined; // If a module is skipped, all its tests and the tests of the child suites // should be treated as skipped even if they are defined as `only` or `todo`. // As for `todo` module, all its tests will be treated as `todo` except for // tests defined as `skip` which will be left intact. // // So, if a test is defined as `todo` and is inside a skipped module, we should // then treat that test as if was defined as `skip`. if (this.module.skip) { settings.skip = true; settings.todo = false; // Skipped tests should be left intact } else if (this.module.todo && !settings.skip) { settings.todo = true; } extend(this, settings); this.testReport = new TestReport(settings.testName, this.module.suiteReport, { todo: settings.todo, skip: settings.skip, valid: this.valid() }); // Register unique strings for (i = 0, l = this.module.tests; i < l.length; i++) { if (this.module.tests[i].name === this.testName) { this.testName += " "; } } this.testId = generateHash(this.module.name, this.testName); this.module.tests.push({ name: this.testName, testId: this.testId, skip: !!settings.skip }); if (settings.skip) { // Skipped tests will fully ignore any sent callback this.callback = function () {}; this.async = false; this.expected = 0; } else { if (typeof this.callback !== "function") { var method = this.todo ? "todo" : "test"; // eslint-disable-next-line max-len throw new TypeError("You must provide a function as a test callback to QUnit." + method + "(\"" + settings.testName + "\")"); } this.assert = new Assert(this); } } Test.count = 0; function getNotStartedModules(startModule) { var module = startModule, modules = []; while (module && module.testsRun === 0) { modules.push(module); module = module.parentModule; } // The above push modules from the child to the parent // return a reversed order with the top being the top most parent module return modules.reverse(); } Test.prototype = { before: function before() { var _this = this; var module = this.module, notStartedModules = getNotStartedModules(module); // ensure the callbacks are executed serially for each module var callbackPromises = notStartedModules.reduce(function (promiseChain, startModule) { return promiseChain.then(function () { startModule.stats = { all: 0, bad: 0, started: now() }; emit("suiteStart", startModule.suiteReport.start(true)); return runLoggingCallbacks("moduleStart", { name: startModule.name, tests: startModule.tests }); }); }, Promise$1.resolve([])); return callbackPromises.then(function () { config.current = _this; _this.testEnvironment = extend({}, module.testEnvironment); _this.started = now(); emit("testStart", _this.testReport.start(true)); return runLoggingCallbacks("testStart", { name: _this.testName, module: module.name, testId: _this.testId, previousFailure: _this.previousFailure }).then(function () { if (!config.pollution) { saveGlobal(); } }); }); }, run: function run() { var promise; config.current = this; this.callbackStarted = now(); if (config.notrycatch) { runTest(this); return; } try { runTest(this); } catch (e) { this.pushFailure("Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + (e.message || e), extractStacktrace(e, 0)); // Else next test will carry the responsibility saveGlobal(); // Restart the tests if they're blocking if (config.blocking) { internalRecover(this); } } function runTest(test) { promise = test.callback.call(test.testEnvironment, test.assert); test.resolvePromise(promise); // If the test has a "lock" on it, but the timeout is 0, then we push a // failure as the test should be synchronous. if (test.timeout === 0 && test.semaphore !== 0) { pushFailure("Test did not finish synchronously even though assert.timeout( 0 ) was used.", sourceFromStacktrace(2)); } } }, after: function after() { checkPollution(); }, queueHook: function queueHook(hook, hookName, hookOwner) { var _this2 = this; var callHook = function callHook() { var promise = hook.call(_this2.testEnvironment, _this2.assert); _this2.resolvePromise(promise, hookName); }; var runHook = function runHook() { if (hookName === "before") { if (hookOwner.unskippedTestsRun !== 0) { return; } _this2.preserveEnvironment = true; } // The 'after' hook should only execute when there are not tests left and // when the 'after' and 'finish' tasks are the only tasks left to process if (hookName === "after" && hookOwner.unskippedTestsRun !== numberOfUnskippedTests(hookOwner) - 1 && (config.queue.length > 0 || ProcessingQueue.taskCount() > 2)) { return; } config.current = _this2; if (config.notrycatch) { callHook(); return; } try { callHook(); } catch (error) { _this2.pushFailure(hookName + " failed on " + _this2.testName + ": " + (error.message || error), extractStacktrace(error, 0)); } }; return runHook; }, // Currently only used for module level hooks, can be used to add global level ones hooks: function hooks(handler) { var hooks = []; function processHooks(test, module) { if (module.parentModule) { processHooks(test, module.parentModule); } if (module.hooks[handler].length) { for (var i = 0; i < module.hooks[handler].length; i++) { hooks.push(test.queueHook(module.hooks[handler][i], handler, module)); } } } // Hooks are ignored on skipped tests if (!this.skip) { processHooks(this, this.module); } return hooks; }, finish: function finish() { config.current = this; // Release the test callback to ensure that anything referenced has been // released to be garbage collected. this.callback = undefined; if (this.steps.length) { var stepsList = this.steps.join(", "); this.pushFailure("Expected assert.verifySteps() to be called before end of test " + ("after using assert.step(). Unverified steps: " + stepsList), this.stack); } if (config.requireExpects && this.expected === null) { this.pushFailure("Expected number of assertions to be defined, but expect() was " + "not called.", this.stack); } else if (this.expected !== null && this.expected !== this.assertions.length) { this.pushFailure("Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack); } else if (this.expected === null && !this.assertions.length) { this.pushFailure("Expected at least one assertion, but none were run - call " + "expect(0) to accept zero assertions.", this.stack); } var i, module = this.module, moduleName = module.name, testName = this.testName, skipped = !!this.skip, todo = !!this.todo, bad = 0, storage = config.storage; this.runtime = now() - this.started; config.stats.all += this.assertions.length; module.stats.all += this.assertions.length; for (i = 0; i < this.assertions.length; i++) { if (!this.assertions[i].result) { bad++; config.stats.bad++; module.stats.bad++; } } notifyTestsRan(module, skipped); // Store result when possible if (storage) { if (bad) { storage.setItem("qunit-test-" + moduleName + "-" + testName, bad); } else { storage.removeItem("qunit-test-" + moduleName + "-" + testName); } } // After emitting the js-reporters event we cleanup the assertion data to // avoid leaking it. It is not used by the legacy testDone callbacks. emit("testEnd", this.testReport.end(true)); this.testReport.slimAssertions(); return runLoggingCallbacks("testDone", { name: testName, module: moduleName, skipped: skipped, todo: todo, failed: bad, passed: this.assertions.length - bad, total: this.assertions.length, runtime: skipped ? 0 : this.runtime, // HTML Reporter use assertions: this.assertions, testId: this.testId, // Source of Test source: this.stack }).then(function () { if (module.testsRun === numberOfTests(module)) { var completedModules = [module]; // Check if the parent modules, iteratively, are done. If that the case, // we emit the `suiteEnd` event and trigger `moduleDone` callback. var parent = module.parentModule; while (parent && parent.testsRun === numberOfTests(parent)) { completedModules.push(parent); parent = parent.parentModule; } return completedModules.reduce(function (promiseChain, completedModule) { return promiseChain.then(function () { return logSuiteEnd(completedModule); }); }, Promise$1.resolve([])); } }).then(function () { config.current = undefined; }); function logSuiteEnd(module) { // Reset `module.hooks` to ensure that anything referenced in these hooks // has been released to be garbage collected. module.hooks = {}; emit("suiteEnd", module.suiteReport.end(true)); return runLoggingCallbacks("moduleDone", { name: module.name, tests: module.tests, failed: module.stats.bad, passed: module.stats.all - module.stats.bad, total: module.stats.all, runtime: now() - module.stats.started }); } }, preserveTestEnvironment: function preserveTestEnvironment() { if (this.preserveEnvironment) { this.module.testEnvironment = this.testEnvironment; this.testEnvironment = extend({}, this.module.testEnvironment); } }, queue: function queue() { var test = this; if (!this.valid()) { return; } function runTest() { return [function () { return test.before(); }].concat(toConsumableArray(test.hooks("before")), [function () { test.preserveTestEnvironment(); }], toConsumableArray(test.hooks("beforeEach")), [function () { test.run(); }], toConsumableArray(test.hooks("afterEach").reverse()), toConsumableArray(test.hooks("after").reverse()), [function () { test.after(); }, function () { return test.finish(); }]); } var previousFailCount = config.storage && +config.storage.getItem("qunit-test-" + this.module.name + "-" + this.testName); // Prioritize previously failed tests, detected from storage var prioritize = config.reorder && !!previousFailCount; this.previousFailure = !!previousFailCount; ProcessingQueue.add(runTest, prioritize, config.seed); // If the queue has already finished, we manually process the new test if (ProcessingQueue.finished) { ProcessingQueue.advance(); } }, pushResult: function pushResult(resultInfo) { if (this !== config.current) { throw new Error("Assertion occurred after test had finished."); } // Destructure of resultInfo = { result, actual, expected, message, negative } var source, details = { module: this.module.name, name: this.testName, result: resultInfo.result, message: resultInfo.message, actual: resultInfo.actual, testId: this.testId, negative: resultInfo.negative || false, runtime: now() - this.started, todo: !!this.todo }; if (hasOwn.call(resultInfo, "expected")) { details.expected = resultInfo.expected; } if (!resultInfo.result) { source = resultInfo.source || sourceFromStacktrace(); if (source) { details.source = source; } } this.logAssertion(details); this.assertions.push({ result: !!resultInfo.result, message: resultInfo.message }); }, pushFailure: function pushFailure(message, source, actual) { if (!(this instanceof Test)) { throw new Error("pushFailure() assertion outside test context, was " + sourceFromStacktrace(2)); } this.pushResult({ result: false, message: message || "error", actual: actual || null, source: source }); }, /** * Log assertion details using both the old QUnit.log interface and * QUnit.on( "assertion" ) interface. * * @private */ logAssertion: function logAssertion(details) { runLoggingCallbacks("log", details); var assertion = { passed: details.result, actual: details.actual, expected: details.expected, message: details.message, stack: details.source, todo: details.todo }; this.testReport.pushAssertion(assertion); emit("assertion", assertion); }, resolvePromise: function resolvePromise(promise, phase) { var then, resume, message, test = this; if (promise != null) { then = promise.then; if (objectType(then) === "function") { resume = internalStop(test); if (config.notrycatch) { then.call(promise, function () { resume(); }); } else { then.call(promise, function () { resume(); }, function (error) { message = "Promise rejected " + (!phase ? "during" : phase.replace(/Each$/, "")) + " \"" + test.testName + "\": " + (error && error.message || error); test.pushFailure(message, extractStacktrace(error, 0)); // Else next test will carry the responsibility saveGlobal(); // Unblock internalRecover(test); }); } } } }, valid: function valid() { var filter = config.filter, regexFilter = /^(!?)\/([\w\W]*)\/(i?$)/.exec(filter), module = config.module && config.module.toLowerCase(), fullName = this.module.name + ": " + this.testName; function moduleChainNameMatch(testModule) { var testModuleName = testModule.name ? testModule.name.toLowerCase() : null; if (testModuleName === module) { return true; } else if (testModule.parentModule) { return moduleChainNameMatch(testModule.parentModule); } else { return false; } } function moduleChainIdMatch(testModule) { return inArray(testModule.moduleId, config.moduleId) || testModule.parentModule && moduleChainIdMatch(testModule.parentModule); } // Internally-generated tests are always valid if (this.callback && this.callback.validTest) { return true; } if (config.moduleId && config.moduleId.length > 0 && !moduleChainIdMatch(this.module)) { return false; } if (config.testId && config.testId.length > 0 && !inArray(this.testId, config.testId)) { return false; } if (module && !moduleChainNameMatch(this.module)) { return false; } if (!filter) { return true; } return regexFilter ? this.regexFilter(!!regexFilter[1], regexFilter[2], regexFilter[3], fullName) : this.stringFilter(filter, fullName); }, regexFilter: function regexFilter(exclude, pattern, flags, fullName) { var regex = new RegExp(pattern, flags); var match = regex.test(fullName); return match !== exclude; }, stringFilter: function stringFilter(filter, fullName) { filter = filter.toLowerCase(); fullName = fullName.toLowerCase(); var include = filter.charAt(0) !== "!"; if (!include) { filter = filter.slice(1); } // If the filter matches, we need to honour include if (fullName.indexOf(filter) !== -1) { return include; } // Otherwise, do the opposite return !include; } }; function pushFailure() { if (!config.current) { throw new Error("pushFailure() assertion outside test context, in " + sourceFromStacktrace(2)); } // Gets current test obj var currentTest = config.current; return currentTest.pushFailure.apply(currentTest, arguments); } function saveGlobal() { config.pollution = []; if (config.noglobals) { for (var key in global$1) { if (hasOwn.call(global$1, key)) { // In Opera sometimes DOM element ids show up here, ignore them if (/^qunit-test-output/.test(key)) { continue; } config.pollution.push(key); } } } } function checkPollution() { var newGlobals, deletedGlobals, old = config.pollution; saveGlobal(); newGlobals = diff(config.pollution, old); if (newGlobals.length > 0) { pushFailure("Introduced global variable(s): " + newGlobals.join(", ")); } deletedGlobals = diff(old, config.pollution); if (deletedGlobals.length > 0) { pushFailure("Deleted global variable(s): " + deletedGlobals.join(", ")); } } // Will be exposed as QUnit.test function test(testName, callback) { if (focused$1) { return; } var newTest = new Test({ testName: testName, callback: callback }); newTest.queue(); } function todo(testName, callback) { if (focused$1) { return; } var newTest = new Test({ testName: testName, callback: callback, todo: true }); newTest.queue(); } // Will be exposed as QUnit.skip function skip(testName) { if (focused$1) { return; } var test = new Test({ testName: testName, skip: true }); test.queue(); } // Will be exposed as QUnit.only function only(testName, callback) { if (focused$1) { return; } config.queue.length = 0; focused$1 = true; var newTest = new Test({ testName: testName, callback: callback }); newTest.queue(); } // Put a hold on processing and return a function that will release it. function internalStop(test) { test.semaphore += 1; config.blocking = true; // Set a recovery timeout, if so configured. if (defined.setTimeout) { var timeoutDuration = void 0; if (typeof test.timeout === "number") { timeoutDuration = test.timeout; } else if (typeof config.testTimeout === "number") { timeoutDuration = config.testTimeout; } if (typeof timeoutDuration === "number" && timeoutDuration > 0) { clearTimeout(config.timeout); config.timeout = setTimeout$1(function () { pushFailure("Test took longer than " + timeoutDuration + "ms; test timed out.", sourceFromStacktrace(2)); internalRecover(test); }, timeoutDuration); } } var released = false; return function resume() { if (released) { return; } released = true; test.semaphore -= 1; internalStart(test); }; } // Forcefully release all processing holds. function internalRecover(test) { test.semaphore = 0; internalStart(test); } // Release a processing hold, scheduling a resumption attempt if no holds remain. function internalStart(test) { // If semaphore is non-numeric, throw error if (isNaN(test.semaphore)) { test.semaphore = 0; pushFailure("Invalid value on test.semaphore", sourceFromStacktrace(2)); return; } // Don't start until equal number of stop-calls if (test.semaphore > 0) { return; } // Throw an Error if start is called more often than stop if (test.semaphore < 0) { test.semaphore = 0; pushFailure("Tried to restart test while already started (test's semaphore was 0 already)", sourceFromStacktrace(2)); return; } // Add a slight delay to allow more assertions etc. if (defined.setTimeout) { if (config.timeout) { clearTimeout(config.timeout); } config.timeout = setTimeout$1(function () { if (test.semaphore > 0) { return; } if (config.timeout) { clearTimeout(config.timeout); } begin(); }); } else { begin(); } } function collectTests(module) { var tests = [].concat(module.tests); var modules = [].concat(toConsumableArray(module.childModules)); // Do a breadth-first traversal of the child modules while (modules.length) { var nextModule = modules.shift(); tests.push.apply(tests, nextModule.tests); modules.push.apply(modules, toConsumableArray(nextModule.childModules)); } return tests; } function numberOfTests(module) { return collectTests(module).length; } function numberOfUnskippedTests(module) { return collectTests(module).filter(function (test) { return !test.skip; }).length; } function notifyTestsRan(module, skipped) { module.testsRun++; if (!skipped) { module.unskippedTestsRun++; } while (module = module.parentModule) { module.testsRun++; if (!skipped) { module.unskippedTestsRun++; } } } var Assert = function () { function Assert(testContext) { classCallCheck(this, Assert); this.test = testContext; } // Assert helpers createClass(Assert, [{ key: "timeout", value: function timeout(duration) { if (typeof duration !== "number") { throw new Error("You must pass a number as the duration to assert.timeout"); } this.test.timeout = duration; } // Documents a "step", which is a string value, in a test as a passing assertion }, { key: "step", value: function step(message) { var assertionMessage = message; var result = !!message; this.test.steps.push(message); if (objectType(message) === "undefined" || message === "") { assertionMessage = "You must provide a message to assert.step"; } else if (objectType(message) !== "string") { assertionMessage = "You must provide a string value to assert.step"; result = false; } this.pushResult({ result: result, message: assertionMessage }); } // Verifies the steps in a test match a given array of string values }, { key: "verifySteps", value: function verifySteps(steps, message) { // Since the steps array is just string values, we can clone with slice var actualStepsClone = this.test.steps.slice(); this.deepEqual(actualStepsClone, steps, message); this.test.steps.length = 0; } // Specify the number of expected assertions to guarantee that failed test // (no assertions are run at all) don't slip through. }, { key: "expect", value: function expect(asserts) { if (arguments.length === 1) { this.test.expected = asserts; } else { return this.test.expected; } } // Put a hold on processing and return a function that will release it a maximum of once. }, { key: "async", value: function async(count) { var test$$1 = this.test; var popped = false, acceptCallCount = count; if (typeof acceptCallCount === "undefined") { acceptCallCount = 1; } var resume = internalStop(test$$1); return function done() { if (config.current !== test$$1) { throw Error("assert.async callback called after test finished."); } if (popped) { test$$1.pushFailure("Too many calls to the `assert.async` callback", sourceFromStacktrace(2)); return; } acceptCallCount -= 1; if (acceptCallCount > 0) { return; } popped = true; resume(); }; } // Exports test.push() to the user API // Alias of pushResult. }, { key: "push", value: function push(result, actual, expected, message, negative) { Logger.warn("assert.push is deprecated and will be removed in QUnit 3.0." + " Please use assert.pushResult instead (https://api.qunitjs.com/assert/pushResult)."); var currentAssert = this instanceof Assert ? this : config.current.assert; return currentAssert.pushResult({ result: result, actual: actual, expected: expected, message: message, negative: negative }); } }, { key: "pushResult", value: function pushResult(resultInfo) { // Destructure of resultInfo = { result, actual, expected, message, negative } var assert = this; var currentTest = assert instanceof Assert && assert.test || config.current; // Backwards compatibility fix. // Allows the direct use of global exported assertions and QUnit.assert.* // Although, it's use is not recommended as it can leak assertions // to other tests from async tests, because we only get a reference to the current test, // not exactly the test where assertion were intended to be called. if (!currentTest) { throw new Error("assertion outside test context, in " + sourceFromStacktrace(2)); } if (!(assert instanceof Assert)) { assert = currentTest.assert; } return assert.test.pushResult(resultInfo); } }, { key: "ok", value: function ok(result, message) { if (!message) { message = result ? "okay" : "failed, expected argument to be truthy, was: " + dump.parse(result); } this.pushResult({ result: !!result, actual: result, expected: true, message: message }); } }, { key: "notOk", value: function notOk(result, message) { if (!message) { message = !result ? "okay" : "failed, expected argument to be falsy, was: " + dump.parse(result); } this.pushResult({ result: !result, actual: result, expected: false, message: message }); } }, { key: "equal", value: function equal(actual, expected, message) { // eslint-disable-next-line eqeqeq var result = expected == actual; this.pushResult({ result: result, actual: actual, expected: expected, message: message }); } }, { key: "notEqual", value: function notEqual(actual, expected, message) { // eslint-disable-next-line eqeqeq var result = expected != actual; this.pushResult({ result: result, actual: actual, expected: expected, message: message, negative: true }); } }, { key: "propEqual", value: function propEqual(actual, expected, message) { actual = objectValues(actual); expected = objectValues(expected); this.pushResult({ result: equiv(actual, expected), actual: actual, expected: expected, message: message }); } }, { key: "notPropEqual", value: function notPropEqual(actual, expected, message) { actual = objectValues(actual); expected = objectValues(expected); this.pushResult({ result: !equiv(actual, expected), actual: actual, expected: expected, message: message, negative: true }); } }, { key: "deepEqual", value: function deepEqual(actual, expected, message) { this.pushResult({ result: equiv(actual, expected), actual: actual, expected: expected, message: message }); } }, { key: "notDeepEqual", value: function notDeepEqual(actual, expected, message) { this.pushResult({ result: !equiv(actual, expected), actual: actual, expected: expected, message: message, negative: true }); } }, { key: "strictEqual", value: function strictEqual(actual, expected, message) { this.pushResult({ result: expected === actual, actual: actual, expected: expected, message: message }); } }, { key: "notStrictEqual", value: function notStrictEqual(actual, expected, message) { this.pushResult({ result: expected !== actual, actual: actual, expected: expected, message: message, negative: true }); } }, { key: "throws", value: function throws(block, expected, message) { var actual = void 0, result = false; var currentTest = this instanceof Assert && this.test || config.current; // 'expected' is optional unless doing string comparison if (objectType(expected) === "string") { if (message == null) { message = expected; expected = null; } else { throw new Error("throws/raises does not accept a string value for the expected argument.\n" + "Use a non-string object value (e.g. regExp) instead if it's necessary."); } } currentTest.ignoreGlobalErrors = true; try { block.call(currentTest.testEnvironment); } catch (e) { actual = e; } currentTest.ignoreGlobalErrors = false; if (actual) { var expectedType = objectType(expected); // We don't want to validate thrown error if (!expected) { result = true; // Expected is a regexp } else if (expectedType === "regexp") { result = expected.test(errorString(actual)); // Log the string form of the regexp expected = String(expected); // Expected is a constructor, maybe an Error constructor } else if (expectedType === "function" && actual instanceof expected) { result = true; // Expected is an Error object } else if (expectedType === "object") { result = actual instanceof expected.constructor && actual.name === expected.name && actual.message === expected.message; // Log the string form of the Error object expected = errorString(expected); // Expected is a validation function which returns true if validation passed } else if (expectedType === "function" && expected.call({}, actual) === true) { expected = null; result = true; } } currentTest.assert.pushResult({ result: result, // undefined if it didn't throw actual: actual && errorString(actual), expected: expected, message: message }); } }, { key: "rejects", value: function rejects(promise, expected, message) { var result = false; var currentTest = this instanceof Assert && this.test || config.current; // 'expected' is optional unless doing string comparison if (objectType(expected) === "string") { if (message === undefined) { message = expected; expected = undefined; } else { message = "assert.rejects does not accept a string value for the expected " + "argument.\nUse a non-string object value (e.g. validator function) instead " + "if necessary."; currentTest.assert.pushResult({ result: false, message: message }); return; } } var then = promise && promise.then; if (objectType(then) !== "function") { var _message = "The value provided to `assert.rejects` in " + "\"" + currentTest.testName + "\" was not a promise."; currentTest.assert.pushResult({ result: false, message: _message, actual: promise }); return; } var done = this.async(); return then.call(promise, function handleFulfillment() { var message = "The promise returned by the `assert.rejects` callback in " + "\"" + currentTest.testName + "\" did not reject."; currentTest.assert.pushResult({ result: false, message: message, actual: promise }); done(); }, function handleRejection(actual) { var expectedType = objectType(expected); // We don't want to validate if (expected === undefined) { result = true; // Expected is a regexp } else if (expectedType === "regexp") { result = expected.test(errorString(actual)); // Log the string form of the regexp expected = String(expected); // Expected is a constructor, maybe an Error constructor } else if (expectedType === "function" && actual instanceof expected) { result = true; // Expected is an Error object } else if (expectedType === "object") { result = actual instanceof expected.constructor && actual.name === expected.name && actual.message === expected.message; // Log the string form of the Error object expected = errorString(expected); // Expected is a validation function which returns true if validation passed } else { if (expectedType === "function") { result = expected.call({}, actual) === true; expected = null; // Expected is some other invalid type } else { result = false; message = "invalid expected value provided to `assert.rejects` " + "callback in \"" + currentTest.testName + "\": " + expectedType + "."; } } currentTest.assert.pushResult({ result: result, // leave rejection value of undefined as-is actual: actual && errorString(actual), expected: expected, message: message }); done(); }); } }]); return Assert; }(); // Provide an alternative to assert.throws(), for environments that consider throws a reserved word // Known to us are: Closure Compiler, Narwhal // eslint-disable-next-line dot-notation Assert.prototype.raises = Assert.prototype["throws"]; /** * Converts an error into a simple string for comparisons. * * @param {Error|Object} error * @return {String} */ function errorString(error) { var resultErrorString = error.toString(); // If the error wasn't a subclass of Error but something like // an object literal with name and message properties... if (resultErrorString.substring(0, 7) === "[object") { var name = error.name ? error.name.toString() : "Error"; var message = error.message ? error.message.toString() : ""; if (name && message) { return name + ": " + message; } else if (name) { return name; } else if (message) { return message; } else { return "Error"; } } else { return resultErrorString; } } /* global module, exports, define */ function exportQUnit(QUnit) { if (defined.document) { // QUnit may be defined when it is preconfigured but then only QUnit and QUnit.config may be defined. if (window$1.QUnit && window$1.QUnit.version) { throw new Error("QUnit has already been defined."); } window$1.QUnit = QUnit; } // For nodejs if (typeof module !== "undefined" && module && module.exports) { module.exports = QUnit; // For consistency with CommonJS environments' exports module.exports.QUnit = QUnit; } // For CommonJS with exports, but without module.exports, like Rhino if (typeof exports !== "undefined" && exports) { exports.QUnit = QUnit; } if (typeof define === "function" && define.amd) { define(function () { return QUnit; }); QUnit.config.autostart = false; } // For Web/Service Workers if (self$1 && self$1.WorkerGlobalScope && self$1 instanceof self$1.WorkerGlobalScope) { self$1.QUnit = QUnit; } } // Handle an unhandled exception. By convention, returns true if further // error handling should be suppressed and false otherwise. // In this case, we will only suppress further error handling if the // "ignoreGlobalErrors" configuration option is enabled. function onError(error) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } if (config.current) { if (config.current.ignoreGlobalErrors) { return true; } pushFailure.apply(undefined, [error.message, error.stacktrace || error.fileName + ":" + error.lineNumber].concat(args)); } else { test("global failure", extend(function () { pushFailure.apply(undefined, [error.message, error.stacktrace || error.fileName + ":" + error.lineNumber].concat(args)); }, { validTest: true })); } return false; } // Handle an unhandled rejection function onUnhandledRejection(reason) { var resultInfo = { result: false, message: reason.message || "error", actual: reason, source: reason.stack || sourceFromStacktrace(3) }; var currentTest = config.current; if (currentTest) { currentTest.assert.pushResult(resultInfo); } else { test("global failure", extend(function (assert) { assert.pushResult(resultInfo); }, { validTest: true })); } } var QUnit = {}; var globalSuite = new SuiteReport(); // The initial "currentModule" represents the global (or top-level) module that // is not explicitly defined by the user, therefore we add the "globalSuite" to // it since each module has a suiteReport associated with it. config.currentModule.suiteReport = globalSuite; var globalStartCalled = false; var runStarted = false; // Figure out if we're running the tests from a server or not QUnit.isLocal = !(defined.document && window$1.location.protocol !== "file:"); // Expose the current QUnit version QUnit.version = "2.9.1"; extend(QUnit, { on: on, module: module$1, test: test, todo: todo, skip: skip, only: only, start: function start(count) { var globalStartAlreadyCalled = globalStartCalled; if (!config.current) { globalStartCalled = true; if (runStarted) { throw new Error("Called start() while test already started running"); } else if (globalStartAlreadyCalled || count > 1) { throw new Error("Called start() outside of a test context too many times"); } else if (config.autostart) { throw new Error("Called start() outside of a test context when " + "QUnit.config.autostart was true"); } else if (!config.pageLoaded) { // The page isn't completely loaded yet, so we set autostart and then // load if we're in Node or wait for the browser's load event. config.autostart = true; // Starts from Node even if .load was not previously called. We still return // early otherwise we'll wind up "beginning" twice. if (!defined.document) { QUnit.load(); } return; } } else { throw new Error("QUnit.start cannot be called inside a test context."); } scheduleBegin(); }, config: config, is: is, objectType: objectType, extend: extend, load: function load() { config.pageLoaded = true; // Initialize the configuration options extend(config, { stats: { all: 0, bad: 0 }, started: 0, updateRate: 1000, autostart: true, filter: "" }, true); if (!runStarted) { config.blocking = false; if (config.autostart) { scheduleBegin(); } } }, stack: function stack(offset) { offset = (offset || 0) + 2; return sourceFromStacktrace(offset); }, onError: onError, onUnhandledRejection: onUnhandledRejection }); QUnit.pushFailure = pushFailure; QUnit.assert = Assert.prototype; QUnit.equiv = equiv; QUnit.dump = dump; registerLoggingCallbacks(QUnit); function scheduleBegin() { runStarted = true; // Add a slight delay to allow definition of more modules and tests. if (defined.setTimeout) { setTimeout$1(function () { begin(); }); } else { begin(); } } function unblockAndAdvanceQueue() { config.blocking = false; ProcessingQueue.advance(); } function begin() { var i, l, modulesLog = []; // If the test run hasn't officially begun yet if (!config.started) { // Record the time of the test run's beginning config.started = now(); // Delete the loose unnamed module if unused. if (config.modules[0].name === "" && config.modules[0].tests.length === 0) { config.modules.shift(); } // Avoid unnecessary information by not logging modules' test environments for (i = 0, l = config.modules.length; i < l; i++) { modulesLog.push({ name: config.modules[i].name, tests: config.modules[i].tests }); } // The test run is officially beginning now emit("runStart", globalSuite.start(true)); runLoggingCallbacks("begin", { totalTests: Test.count, modules: modulesLog }).then(unblockAndAdvanceQueue); } else { unblockAndAdvanceQueue(); } } exportQUnit(QUnit); (function () { if (typeof window$1 === "undefined" || typeof document$1 === "undefined") { return; } var config = QUnit.config, hasOwn = Object.prototype.hasOwnProperty; // Stores fixture HTML for resetting later function storeFixture() { // Avoid overwriting user-defined values if (hasOwn.call(config, "fixture")) { return; } var fixture = document$1.getElementById("qunit-fixture"); if (fixture) { config.fixture = fixture.cloneNode(true); } } QUnit.begin(storeFixture); // Resets the fixture DOM element if available. function resetFixture() { if (config.fixture == null) { return; } var fixture = document$1.getElementById("qunit-fixture"); var resetFixtureType = _typeof(config.fixture); if (resetFixtureType === "string") { // support user defined values for `config.fixture` var newFixture = document$1.createElement("div"); newFixture.setAttribute("id", "qunit-fixture"); newFixture.innerHTML = config.fixture; fixture.parentNode.replaceChild(newFixture, fixture); } else { var clonedFixture = config.fixture.cloneNode(true); fixture.parentNode.replaceChild(clonedFixture, fixture); } } QUnit.testStart(resetFixture); })(); (function () { // Only interact with URLs via window.location var location = typeof window$1 !== "undefined" && window$1.location; if (!location) { return; } var urlParams = getUrlParams(); QUnit.urlParams = urlParams; // Match module/test by inclusion in an array QUnit.config.moduleId = [].concat(urlParams.moduleId || []); QUnit.config.testId = [].concat(urlParams.testId || []); // Exact case-insensitive match of the module name QUnit.config.module = urlParams.module; // Regular expression or case-insenstive substring match against "moduleName: testName" QUnit.config.filter = urlParams.filter; // Test order randomization if (urlParams.seed === true) { // Generate a random seed if the option is specified without a value QUnit.config.seed = Math.random().toString(36).slice(2); } else if (urlParams.seed) { QUnit.config.seed = urlParams.seed; } // Add URL-parameter-mapped config values with UI form rendering data QUnit.config.urlConfig.push({ id: "hidepassed", label: "Hide passed tests", tooltip: "Only show tests and assertions that fail. Stored as query-strings." }, { id: "noglobals", label: "Check for Globals", tooltip: "Enabling this will test if any test introduces new properties on the " + "global object (`window` in Browsers). Stored as query-strings." }, { id: "notrycatch", label: "No try-catch", tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging " + "exceptions in IE reasonable. Stored as query-strings." }); QUnit.begin(function () { var i, option, urlConfig = QUnit.config.urlConfig; for (i = 0; i < urlConfig.length; i++) { // Options can be either strings or objects with nonempty "id" properties option = QUnit.config.urlConfig[i]; if (typeof option !== "string") { option = option.id; } if (QUnit.config[option] === undefined) { QUnit.config[option] = urlParams[option]; } } }); function getUrlParams() { var i, param, name, value; var urlParams = Object.create(null); var params = location.search.slice(1).split("&"); var length = params.length; for (i = 0; i < length; i++) { if (params[i]) { param = params[i].split("="); name = decodeQueryParam(param[0]); // Allow just a key to turn on a flag, e.g., test.html?noglobals value = param.length === 1 || decodeQueryParam(param.slice(1).join("=")); if (name in urlParams) { urlParams[name] = [].concat(urlParams[name], value); } else { urlParams[name] = value; } } } return urlParams; } function decodeQueryParam(param) { return decodeURIComponent(param.replace(/\+/g, "%20")); } })(); var stats = { passedTests: 0, failedTests: 0, skippedTests: 0, todoTests: 0 }; // Escape text for attribute or text content. function escapeText(s) { if (!s) { return ""; } s = s + ""; // Both single quotes and double quotes (for attributes) return s.replace(/['"<>&]/g, function (s) { switch (s) { case "'": return "'"; case "\"": return """; case "<": return "<"; case ">": return ">"; case "&": return "&"; } }); } (function () { // Don't load the HTML Reporter on non-browser environments if (typeof window$1 === "undefined" || !window$1.document) { return; } var config = QUnit.config, hiddenTests = [], document = window$1.document, collapseNext = false, hasOwn = Object.prototype.hasOwnProperty, unfilteredUrl = setUrl({ filter: undefined, module: undefined, moduleId: undefined, testId: undefined }), modulesList = []; function addEvent(elem, type, fn) { elem.addEventListener(type, fn, false); } function removeEvent(elem, type, fn) { elem.removeEventListener(type, fn, false); } function addEvents(elems, type, fn) { var i = elems.length; while (i--) { addEvent(elems[i], type, fn); } } function hasClass(elem, name) { return (" " + elem.className + " ").indexOf(" " + name + " ") >= 0; } function addClass(elem, name) { if (!hasClass(elem, name)) { elem.className += (elem.className ? " " : "") + name; } } function toggleClass(elem, name, force) { if (force || typeof force === "undefined" && !hasClass(elem, name)) { addClass(elem, name); } else { removeClass(elem, name); } } function removeClass(elem, name) { var set = " " + elem.className + " "; // Class name may appear multiple times while (set.indexOf(" " + name + " ") >= 0) { set = set.replace(" " + name + " ", " "); } // Trim for prettiness elem.className = typeof set.trim === "function" ? set.trim() : set.replace(/^\s+|\s+$/g, ""); } function id(name) { return document.getElementById && document.getElementById(name); } function abortTests() { var abortButton = id("qunit-abort-tests-button"); if (abortButton) { abortButton.disabled = true; abortButton.innerHTML = "Aborting..."; } QUnit.config.queue.length = 0; return false; } function interceptNavigation(ev) { applyUrlParams(); if (ev && ev.preventDefault) { ev.preventDefault(); } return false; } function getUrlConfigHtml() { var i, j, val, escaped, escapedTooltip, selection = false, urlConfig = config.urlConfig, urlConfigHtml = ""; for (i = 0; i < urlConfig.length; i++) { // Options can be either strings or objects with nonempty "id" properties val = config.urlConfig[i]; if (typeof val === "string") { val = { id: val, label: val }; } escaped = escapeText(val.id); escapedTooltip = escapeText(val.tooltip); if (!val.value || typeof val.value === "string") { urlConfigHtml += ""; } else { urlConfigHtml += ""; } } return urlConfigHtml; } // Handle "click" events on toolbar checkboxes and "change" for select menus. // Updates the URL with the new state of `config.urlConfig` values. function toolbarChanged() { var updatedUrl, value, tests, field = this, params = {}; // Detect if field is a select menu or a checkbox if ("selectedIndex" in field) { value = field.options[field.selectedIndex].value || undefined; } else { value = field.checked ? field.defaultValue || true : undefined; } params[field.name] = value; updatedUrl = setUrl(params); // Check if we can apply the change without a page refresh if ("hidepassed" === field.name && "replaceState" in window$1.history) { QUnit.urlParams[field.name] = value; config[field.name] = value || false; tests = id("qunit-tests"); if (tests) { var length = tests.children.length; var children = tests.children; if (field.checked) { for (var i = 0; i < length; i++) { var test = children[i]; if (test && test.className.indexOf("pass") > -1) { hiddenTests.push(test); } } var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = hiddenTests[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var hiddenTest = _step.value; tests.removeChild(hiddenTest); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } else { while ((test = hiddenTests.pop()) != null) { tests.appendChild(test); } } } window$1.history.replaceState(null, "", updatedUrl); } else { window$1.location = updatedUrl; } } function setUrl(params) { var key, arrValue, i, querystring = "?", location = window$1.location; params = QUnit.extend(QUnit.extend({}, QUnit.urlParams), params); for (key in params) { // Skip inherited or undefined properties if (hasOwn.call(params, key) && params[key] !== undefined) { // Output a parameter for each value of this key // (but usually just one) arrValue = [].concat(params[key]); for (i = 0; i < arrValue.length; i++) { querystring += encodeURIComponent(key); if (arrValue[i] !== true) { querystring += "=" + encodeURIComponent(arrValue[i]); } querystring += "&"; } } } return location.protocol + "//" + location.host + location.pathname + querystring.slice(0, -1); } function applyUrlParams() { var i, selectedModules = [], modulesList = id("qunit-modulefilter-dropdown-list").getElementsByTagName("input"), filter = id("qunit-filter-input").value; for (i = 0; i < modulesList.length; i++) { if (modulesList[i].checked) { selectedModules.push(modulesList[i].value); } } window$1.location = setUrl({ filter: filter === "" ? undefined : filter, moduleId: selectedModules.length === 0 ? undefined : selectedModules, // Remove module and testId filter module: undefined, testId: undefined }); } function toolbarUrlConfigContainer() { var urlConfigContainer = document.createElement("span"); urlConfigContainer.innerHTML = getUrlConfigHtml(); addClass(urlConfigContainer, "qunit-url-config"); addEvents(urlConfigContainer.getElementsByTagName("input"), "change", toolbarChanged); addEvents(urlConfigContainer.getElementsByTagName("select"), "change", toolbarChanged); return urlConfigContainer; } function abortTestsButton() { var button = document.createElement("button"); button.id = "qunit-abort-tests-button"; button.innerHTML = "Abort"; addEvent(button, "click", abortTests); return button; } function toolbarLooseFilter() { var filter = document.createElement("form"), label = document.createElement("label"), input = document.createElement("input"), button = document.createElement("button"); addClass(filter, "qunit-filter"); label.innerHTML = "Filter: "; input.type = "text"; input.value = config.filter || ""; input.name = "filter"; input.id = "qunit-filter-input"; button.innerHTML = "Go"; label.appendChild(input); filter.appendChild(label); filter.appendChild(document.createTextNode(" ")); filter.appendChild(button); addEvent(filter, "submit", interceptNavigation); return filter; } function moduleListHtml() { var i, checked, html = ""; for (i = 0; i < config.modules.length; i++) { if (config.modules[i].name !== "") { checked = config.moduleId.indexOf(config.modules[i].moduleId) > -1; html += "
    1. "; } } return html; } function toolbarModuleFilter() { var allCheckbox, commit, reset, moduleFilter = document.createElement("form"), label = document.createElement("label"), moduleSearch = document.createElement("input"), dropDown = document.createElement("div"), actions = document.createElement("span"), dropDownList = document.createElement("ul"), dirty = false; moduleSearch.id = "qunit-modulefilter-search"; moduleSearch.autocomplete = "off"; addEvent(moduleSearch, "input", searchInput); addEvent(moduleSearch, "input", searchFocus); addEvent(moduleSearch, "focus", searchFocus); addEvent(moduleSearch, "click", searchFocus); label.id = "qunit-modulefilter-search-container"; label.innerHTML = "Module: "; label.appendChild(moduleSearch); actions.id = "qunit-modulefilter-actions"; actions.innerHTML = "" + "" + ""; allCheckbox = actions.lastChild.firstChild; commit = actions.firstChild; reset = commit.nextSibling; addEvent(commit, "click", applyUrlParams); dropDownList.id = "qunit-modulefilter-dropdown-list"; dropDownList.innerHTML = moduleListHtml(); dropDown.id = "qunit-modulefilter-dropdown"; dropDown.style.display = "none"; dropDown.appendChild(actions); dropDown.appendChild(dropDownList); addEvent(dropDown, "change", selectionChange); selectionChange(); moduleFilter.id = "qunit-modulefilter"; moduleFilter.appendChild(label); moduleFilter.appendChild(dropDown); addEvent(moduleFilter, "submit", interceptNavigation); addEvent(moduleFilter, "reset", function () { // Let the reset happen, then update styles window$1.setTimeout(selectionChange); }); // Enables show/hide for the dropdown function searchFocus() { if (dropDown.style.display !== "none") { return; } dropDown.style.display = "block"; addEvent(document, "click", hideHandler); addEvent(document, "keydown", hideHandler); // Hide on Escape keydown or outside-container click function hideHandler(e) { var inContainer = moduleFilter.contains(e.target); if (e.keyCode === 27 || !inContainer) { if (e.keyCode === 27 && inContainer) { moduleSearch.focus(); } dropDown.style.display = "none"; removeEvent(document, "click", hideHandler); removeEvent(document, "keydown", hideHandler); moduleSearch.value = ""; searchInput(); } } } // Processes module search box input function searchInput() { var i, item, searchText = moduleSearch.value.toLowerCase(), listItems = dropDownList.children; for (i = 0; i < listItems.length; i++) { item = listItems[i]; if (!searchText || item.textContent.toLowerCase().indexOf(searchText) > -1) { item.style.display = ""; } else { item.style.display = "none"; } } } // Processes selection changes function selectionChange(evt) { var i, item, checkbox = evt && evt.target || allCheckbox, modulesList = dropDownList.getElementsByTagName("input"), selectedNames = []; toggleClass(checkbox.parentNode, "checked", checkbox.checked); dirty = false; if (checkbox.checked && checkbox !== allCheckbox) { allCheckbox.checked = false; removeClass(allCheckbox.parentNode, "checked"); } for (i = 0; i < modulesList.length; i++) { item = modulesList[i]; if (!evt) { toggleClass(item.parentNode, "checked", item.checked); } else if (checkbox === allCheckbox && checkbox.checked) { item.checked = false; removeClass(item.parentNode, "checked"); } dirty = dirty || item.checked !== item.defaultChecked; if (item.checked) { selectedNames.push(item.parentNode.textContent); } } commit.style.display = reset.style.display = dirty ? "" : "none"; moduleSearch.placeholder = selectedNames.join(", ") || allCheckbox.parentNode.textContent; moduleSearch.title = "Type to filter list. Current selection:\n" + (selectedNames.join("\n") || allCheckbox.parentNode.textContent); } return moduleFilter; } function appendToolbar() { var toolbar = id("qunit-testrunner-toolbar"); if (toolbar) { toolbar.appendChild(toolbarUrlConfigContainer()); toolbar.appendChild(toolbarModuleFilter()); toolbar.appendChild(toolbarLooseFilter()); toolbar.appendChild(document.createElement("div")).className = "clearfix"; } } function appendHeader() { var header = id("qunit-header"); if (header) { header.innerHTML = "" + header.innerHTML + " "; } } function appendBanner() { var banner = id("qunit-banner"); if (banner) { banner.className = ""; } } function appendTestResults() { var tests = id("qunit-tests"), result = id("qunit-testresult"), controls; if (result) { result.parentNode.removeChild(result); } if (tests) { tests.innerHTML = ""; result = document.createElement("p"); result.id = "qunit-testresult"; result.className = "result"; tests.parentNode.insertBefore(result, tests); result.innerHTML = "
      Running...
       
      " + "
      " + "
      "; controls = id("qunit-testresult-controls"); } if (controls) { controls.appendChild(abortTestsButton()); } } function appendFilteredTest() { var testId = QUnit.config.testId; if (!testId || testId.length <= 0) { return ""; } return "
      Rerunning selected tests: " + escapeText(testId.join(", ")) + " Run all tests
      "; } function appendUserAgent() { var userAgent = id("qunit-userAgent"); if (userAgent) { userAgent.innerHTML = ""; userAgent.appendChild(document.createTextNode("QUnit " + QUnit.version + "; " + navigator.userAgent)); } } function appendInterface() { var qunit = id("qunit"); if (qunit) { qunit.innerHTML = "

      " + escapeText(document.title) + "

      " + "

      " + "
      " + appendFilteredTest() + "

      " + "
        "; } appendHeader(); appendBanner(); appendTestResults(); appendUserAgent(); appendToolbar(); } function appendTest(name, testId, moduleName) { var title, rerunTrigger, testBlock, assertList, tests = id("qunit-tests"); if (!tests) { return; } title = document.createElement("strong"); title.innerHTML = getNameHtml(name, moduleName); rerunTrigger = document.createElement("a"); rerunTrigger.innerHTML = "Rerun"; rerunTrigger.href = setUrl({ testId: testId }); testBlock = document.createElement("li"); testBlock.appendChild(title); testBlock.appendChild(rerunTrigger); testBlock.id = "qunit-test-output-" + testId; assertList = document.createElement("ol"); assertList.className = "qunit-assert-list"; testBlock.appendChild(assertList); tests.appendChild(testBlock); } // HTML Reporter initialization and load QUnit.begin(function (details) { var i, moduleObj; // Sort modules by name for the picker for (i = 0; i < details.modules.length; i++) { moduleObj = details.modules[i]; if (moduleObj.name) { modulesList.push(moduleObj.name); } } modulesList.sort(function (a, b) { return a.localeCompare(b); }); // Initialize QUnit elements appendInterface(); }); QUnit.done(function (details) { var banner = id("qunit-banner"), tests = id("qunit-tests"), abortButton = id("qunit-abort-tests-button"), totalTests = stats.passedTests + stats.skippedTests + stats.todoTests + stats.failedTests, html = [totalTests, " tests completed in ", details.runtime, " milliseconds, with ", stats.failedTests, " failed, ", stats.skippedTests, " skipped, and ", stats.todoTests, " todo.
        ", "", details.passed, " assertions of ", details.total, " passed, ", details.failed, " failed."].join(""), test, assertLi, assertList; // Update remaing tests to aborted if (abortButton && abortButton.disabled) { html = "Tests aborted after " + details.runtime + " milliseconds."; for (var i = 0; i < tests.children.length; i++) { test = tests.children[i]; if (test.className === "" || test.className === "running") { test.className = "aborted"; assertList = test.getElementsByTagName("ol")[0]; assertLi = document.createElement("li"); assertLi.className = "fail"; assertLi.innerHTML = "Test aborted."; assertList.appendChild(assertLi); } } } if (banner && (!abortButton || abortButton.disabled === false)) { banner.className = stats.failedTests ? "qunit-fail" : "qunit-pass"; } if (abortButton) { abortButton.parentNode.removeChild(abortButton); } if (tests) { id("qunit-testresult-display").innerHTML = html; } if (config.altertitle && document.title) { // Show ✖ for good, ✔ for bad suite result in title // use escape sequences in case file gets loaded with non-utf-8 // charset document.title = [stats.failedTests ? "\u2716" : "\u2714", document.title.replace(/^[\u2714\u2716] /i, "")].join(" "); } // Scroll back to top to show results if (config.scrolltop && window$1.scrollTo) { window$1.scrollTo(0, 0); } }); function getNameHtml(name, module) { var nameHtml = ""; if (module) { nameHtml = "" + escapeText(module) + ": "; } nameHtml += "" + escapeText(name) + ""; return nameHtml; } QUnit.testStart(function (details) { var running, bad; appendTest(details.name, details.testId, details.module); running = id("qunit-testresult-display"); if (running) { addClass(running, "running"); bad = QUnit.config.reorder && details.previousFailure; running.innerHTML = [bad ? "Rerunning previously failed test:
        " : "Running:
        ", getNameHtml(details.name, details.module)].join(""); } }); function stripHtml(string) { // Strip tags, html entity and whitespaces return string.replace(/<\/?[^>]+(>|$)/g, "").replace(/"/g, "").replace(/\s+/g, ""); } QUnit.log(function (details) { var assertList, assertLi, message, expected, actual, diff, showDiff = false, testItem = id("qunit-test-output-" + details.testId); if (!testItem) { return; } message = escapeText(details.message) || (details.result ? "okay" : "failed"); message = "" + message + ""; message += "@ " + details.runtime + " ms"; // The pushFailure doesn't provide details.expected // when it calls, it's implicit to also not show expected and diff stuff // Also, we need to check details.expected existence, as it can exist and be undefined if (!details.result && hasOwn.call(details, "expected")) { if (details.negative) { expected = "NOT " + QUnit.dump.parse(details.expected); } else { expected = QUnit.dump.parse(details.expected); } actual = QUnit.dump.parse(details.actual); message += ""; if (actual !== expected) { message += ""; if (typeof details.actual === "number" && typeof details.expected === "number") { if (!isNaN(details.actual) && !isNaN(details.expected)) { showDiff = true; diff = details.actual - details.expected; diff = (diff > 0 ? "+" : "") + diff; } } else if (typeof details.actual !== "boolean" && typeof details.expected !== "boolean") { diff = QUnit.diff(expected, actual); // don't show diff if there is zero overlap showDiff = stripHtml(diff).length !== stripHtml(expected).length + stripHtml(actual).length; } if (showDiff) { message += ""; } } else if (expected.indexOf("[object Array]") !== -1 || expected.indexOf("[object Object]") !== -1) { message += ""; } else { message += ""; } if (details.source) { message += ""; } message += "
        Expected:
        " + escapeText(expected) + "
        Result:
        " + escapeText(actual) + "
        Diff:
        " + diff + "
        Message: " + "Diff suppressed as the depth of object is more than current max depth (" + QUnit.config.maxDepth + ").

        Hint: Use QUnit.dump.maxDepth to " + " run with a higher max depth or " + "Rerun without max depth.

        Message: " + "Diff suppressed as the expected and actual results have an equivalent" + " serialization
        Source:
        " + escapeText(details.source) + "
        "; // This occurs when pushFailure is set and we have an extracted stack trace } else if (!details.result && details.source) { message += "" + "" + "
        Source:
        " + escapeText(details.source) + "
        "; } assertList = testItem.getElementsByTagName("ol")[0]; assertLi = document.createElement("li"); assertLi.className = details.result ? "pass" : "fail"; assertLi.innerHTML = message; assertList.appendChild(assertLi); }); QUnit.testDone(function (details) { var testTitle, time, testItem, assertList, status, good, bad, testCounts, skipped, sourceName, tests = id("qunit-tests"); if (!tests) { return; } testItem = id("qunit-test-output-" + details.testId); removeClass(testItem, "running"); if (details.failed > 0) { status = "failed"; } else if (details.todo) { status = "todo"; } else { status = details.skipped ? "skipped" : "passed"; } assertList = testItem.getElementsByTagName("ol")[0]; good = details.passed; bad = details.failed; // This test passed if it has no unexpected failed assertions var testPassed = details.failed > 0 ? details.todo : !details.todo; if (testPassed) { // Collapse the passing tests addClass(assertList, "qunit-collapsed"); } else if (config.collapse) { if (!collapseNext) { // Skip collapsing the first failing test collapseNext = true; } else { // Collapse remaining tests addClass(assertList, "qunit-collapsed"); } } // The testItem.firstChild is the test name testTitle = testItem.firstChild; testCounts = bad ? "" + bad + ", " + "" + good + ", " : ""; testTitle.innerHTML += " (" + testCounts + details.assertions.length + ")"; if (details.skipped) { stats.skippedTests++; testItem.className = "skipped"; skipped = document.createElement("em"); skipped.className = "qunit-skipped-label"; skipped.innerHTML = "skipped"; testItem.insertBefore(skipped, testTitle); } else { addEvent(testTitle, "click", function () { toggleClass(assertList, "qunit-collapsed"); }); testItem.className = testPassed ? "pass" : "fail"; if (details.todo) { var todoLabel = document.createElement("em"); todoLabel.className = "qunit-todo-label"; todoLabel.innerHTML = "todo"; testItem.className += " todo"; testItem.insertBefore(todoLabel, testTitle); } time = document.createElement("span"); time.className = "runtime"; time.innerHTML = details.runtime + " ms"; testItem.insertBefore(time, assertList); if (!testPassed) { stats.failedTests++; } else if (details.todo) { stats.todoTests++; } else { stats.passedTests++; } } // Show the source of the test when showing assertions if (details.source) { sourceName = document.createElement("p"); sourceName.innerHTML = "Source: " + escapeText(details.source); addClass(sourceName, "qunit-source"); if (testPassed) { addClass(sourceName, "qunit-collapsed"); } addEvent(testTitle, "click", function () { toggleClass(sourceName, "qunit-collapsed"); }); testItem.appendChild(sourceName); } if (config.hidepassed && status === "passed") { // use removeChild instead of remove because of support hiddenTests.push(testItem); tests.removeChild(testItem); } }); // Avoid readyState issue with phantomjs // Ref: #818 var notPhantom = function (p) { return !(p && p.version && p.version.major > 0); }(window$1.phantom); if (notPhantom && document.readyState === "complete") { QUnit.load(); } else { addEvent(window$1, "load", QUnit.load); } // Wrap window.onerror. We will call the original window.onerror to see if // the existing handler fully handles the error; if not, we will call the // QUnit.onError function. var originalWindowOnError = window$1.onerror; // Cover uncaught exceptions // Returning true will suppress the default browser handler, // returning false will let it run. window$1.onerror = function (message, fileName, lineNumber, columnNumber, errorObj) { var ret = false; if (originalWindowOnError) { for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { args[_key - 5] = arguments[_key]; } ret = originalWindowOnError.call.apply(originalWindowOnError, [this, message, fileName, lineNumber, columnNumber, errorObj].concat(args)); } // Treat return value as window.onerror itself does, // Only do our handling if not suppressed. if (ret !== true) { var error = { message: message, fileName: fileName, lineNumber: lineNumber }; // According to // https://blog.sentry.io/2016/01/04/client-javascript-reporting-window-onerror, // most modern browsers support an errorObj argument; use that to // get a full stack trace if it's available. if (errorObj && errorObj.stack) { error.stacktrace = extractStacktrace(errorObj, 0); } ret = QUnit.onError(error); } return ret; }; // Listen for unhandled rejections, and call QUnit.onUnhandledRejection window$1.addEventListener("unhandledrejection", function (event) { QUnit.onUnhandledRejection(event.reason); }); })(); /* * This file is a modified version of google-diff-match-patch's JavaScript implementation * (https://code.google.com/p/google-diff-match-patch/source/browse/trunk/javascript/diff_match_patch_uncompressed.js), * modifications are licensed as more fully set forth in LICENSE.txt. * * The original source of google-diff-match-patch is attributable and licensed as follows: * * Copyright 2006 Google Inc. * https://code.google.com/p/google-diff-match-patch/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * More Info: * https://code.google.com/p/google-diff-match-patch/ * * Usage: QUnit.diff(expected, actual) * */ QUnit.diff = function () { function DiffMatchPatch() {} // DIFF FUNCTIONS /** * The data structure representing a diff is an array of tuples: * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] * which means: delete 'Hello', add 'Goodbye' and keep ' world.' */ var DIFF_DELETE = -1, DIFF_INSERT = 1, DIFF_EQUAL = 0; /** * Find the differences between two texts. Simplifies the problem by stripping * any common prefix or suffix off the texts before diffing. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {boolean=} optChecklines Optional speedup flag. If present and false, * then don't run a line-level diff first to identify the changed areas. * Defaults to true, which does a faster, slightly less optimal diff. * @return {!Array.} Array of diff tuples. */ DiffMatchPatch.prototype.DiffMain = function (text1, text2, optChecklines) { var deadline, checklines, commonlength, commonprefix, commonsuffix, diffs; // The diff must be complete in up to 1 second. deadline = new Date().getTime() + 1000; // Check for null inputs. if (text1 === null || text2 === null) { throw new Error("Null input. (DiffMain)"); } // Check for equality (speedup). if (text1 === text2) { if (text1) { return [[DIFF_EQUAL, text1]]; } return []; } if (typeof optChecklines === "undefined") { optChecklines = true; } checklines = optChecklines; // Trim off common prefix (speedup). commonlength = this.diffCommonPrefix(text1, text2); commonprefix = text1.substring(0, commonlength); text1 = text1.substring(commonlength); text2 = text2.substring(commonlength); // Trim off common suffix (speedup). commonlength = this.diffCommonSuffix(text1, text2); commonsuffix = text1.substring(text1.length - commonlength); text1 = text1.substring(0, text1.length - commonlength); text2 = text2.substring(0, text2.length - commonlength); // Compute the diff on the middle block. diffs = this.diffCompute(text1, text2, checklines, deadline); // Restore the prefix and suffix. if (commonprefix) { diffs.unshift([DIFF_EQUAL, commonprefix]); } if (commonsuffix) { diffs.push([DIFF_EQUAL, commonsuffix]); } this.diffCleanupMerge(diffs); return diffs; }; /** * Reduce the number of edits by eliminating operationally trivial equalities. * @param {!Array.} diffs Array of diff tuples. */ DiffMatchPatch.prototype.diffCleanupEfficiency = function (diffs) { var changes, equalities, equalitiesLength, lastequality, pointer, preIns, preDel, postIns, postDel; changes = false; equalities = []; // Stack of indices where equalities are found. equalitiesLength = 0; // Keeping our own length var is faster in JS. /** @type {?string} */ lastequality = null; // Always equal to diffs[equalities[equalitiesLength - 1]][1] pointer = 0; // Index of current position. // Is there an insertion operation before the last equality. preIns = false; // Is there a deletion operation before the last equality. preDel = false; // Is there an insertion operation after the last equality. postIns = false; // Is there a deletion operation after the last equality. postDel = false; while (pointer < diffs.length) { // Equality found. if (diffs[pointer][0] === DIFF_EQUAL) { if (diffs[pointer][1].length < 4 && (postIns || postDel)) { // Candidate found. equalities[equalitiesLength++] = pointer; preIns = postIns; preDel = postDel; lastequality = diffs[pointer][1]; } else { // Not a candidate, and can never become one. equalitiesLength = 0; lastequality = null; } postIns = postDel = false; // An insertion or deletion. } else { if (diffs[pointer][0] === DIFF_DELETE) { postDel = true; } else { postIns = true; } /* * Five types to be split: * ABXYCD * AXCD * ABXC * AXCD * ABXC */ if (lastequality && (preIns && preDel && postIns && postDel || lastequality.length < 2 && preIns + preDel + postIns + postDel === 3)) { // Duplicate record. diffs.splice(equalities[equalitiesLength - 1], 0, [DIFF_DELETE, lastequality]); // Change second copy to insert. diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT; equalitiesLength--; // Throw away the equality we just deleted; lastequality = null; if (preIns && preDel) { // No changes made which could affect previous entry, keep going. postIns = postDel = true; equalitiesLength = 0; } else { equalitiesLength--; // Throw away the previous equality. pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1; postIns = postDel = false; } changes = true; } } pointer++; } if (changes) { this.diffCleanupMerge(diffs); } }; /** * Convert a diff array into a pretty HTML report. * @param {!Array.} diffs Array of diff tuples. * @param {integer} string to be beautified. * @return {string} HTML representation. */ DiffMatchPatch.prototype.diffPrettyHtml = function (diffs) { var op, data, x, html = []; for (x = 0; x < diffs.length; x++) { op = diffs[x][0]; // Operation (insert, delete, equal) data = diffs[x][1]; // Text of change. switch (op) { case DIFF_INSERT: html[x] = "" + escapeText(data) + ""; break; case DIFF_DELETE: html[x] = "" + escapeText(data) + ""; break; case DIFF_EQUAL: html[x] = "" + escapeText(data) + ""; break; } } return html.join(""); }; /** * Determine the common prefix of two strings. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {number} The number of characters common to the start of each * string. */ DiffMatchPatch.prototype.diffCommonPrefix = function (text1, text2) { var pointermid, pointermax, pointermin, pointerstart; // Quick check for common null cases. if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) { return 0; } // Binary search. // Performance analysis: https://neil.fraser.name/news/2007/10/09/ pointermin = 0; pointermax = Math.min(text1.length, text2.length); pointermid = pointermax; pointerstart = 0; while (pointermin < pointermid) { if (text1.substring(pointerstart, pointermid) === text2.substring(pointerstart, pointermid)) { pointermin = pointermid; pointerstart = pointermin; } else { pointermax = pointermid; } pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); } return pointermid; }; /** * Determine the common suffix of two strings. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {number} The number of characters common to the end of each string. */ DiffMatchPatch.prototype.diffCommonSuffix = function (text1, text2) { var pointermid, pointermax, pointermin, pointerend; // Quick check for common null cases. if (!text1 || !text2 || text1.charAt(text1.length - 1) !== text2.charAt(text2.length - 1)) { return 0; } // Binary search. // Performance analysis: https://neil.fraser.name/news/2007/10/09/ pointermin = 0; pointermax = Math.min(text1.length, text2.length); pointermid = pointermax; pointerend = 0; while (pointermin < pointermid) { if (text1.substring(text1.length - pointermid, text1.length - pointerend) === text2.substring(text2.length - pointermid, text2.length - pointerend)) { pointermin = pointermid; pointerend = pointermin; } else { pointermax = pointermid; } pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); } return pointermid; }; /** * Find the differences between two texts. Assumes that the texts do not * have any common prefix or suffix. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {boolean} checklines Speedup flag. If false, then don't run a * line-level diff first to identify the changed areas. * If true, then run a faster, slightly less optimal diff. * @param {number} deadline Time when the diff should be complete by. * @return {!Array.} Array of diff tuples. * @private */ DiffMatchPatch.prototype.diffCompute = function (text1, text2, checklines, deadline) { var diffs, longtext, shorttext, i, hm, text1A, text2A, text1B, text2B, midCommon, diffsA, diffsB; if (!text1) { // Just add some text (speedup). return [[DIFF_INSERT, text2]]; } if (!text2) { // Just delete some text (speedup). return [[DIFF_DELETE, text1]]; } longtext = text1.length > text2.length ? text1 : text2; shorttext = text1.length > text2.length ? text2 : text1; i = longtext.indexOf(shorttext); if (i !== -1) { // Shorter text is inside the longer text (speedup). diffs = [[DIFF_INSERT, longtext.substring(0, i)], [DIFF_EQUAL, shorttext], [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; // Swap insertions for deletions if diff is reversed. if (text1.length > text2.length) { diffs[0][0] = diffs[2][0] = DIFF_DELETE; } return diffs; } if (shorttext.length === 1) { // Single character string. // After the previous speedup, the character can't be an equality. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; } // Check to see if the problem can be split in two. hm = this.diffHalfMatch(text1, text2); if (hm) { // A half-match was found, sort out the return data. text1A = hm[0]; text1B = hm[1]; text2A = hm[2]; text2B = hm[3]; midCommon = hm[4]; // Send both pairs off for separate processing. diffsA = this.DiffMain(text1A, text2A, checklines, deadline); diffsB = this.DiffMain(text1B, text2B, checklines, deadline); // Merge the results. return diffsA.concat([[DIFF_EQUAL, midCommon]], diffsB); } if (checklines && text1.length > 100 && text2.length > 100) { return this.diffLineMode(text1, text2, deadline); } return this.diffBisect(text1, text2, deadline); }; /** * Do the two texts share a substring which is at least half the length of the * longer text? * This speedup can produce non-minimal diffs. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {Array.} Five element Array, containing the prefix of * text1, the suffix of text1, the prefix of text2, the suffix of * text2 and the common middle. Or null if there was no match. * @private */ DiffMatchPatch.prototype.diffHalfMatch = function (text1, text2) { var longtext, shorttext, dmp, text1A, text2B, text2A, text1B, midCommon, hm1, hm2, hm; longtext = text1.length > text2.length ? text1 : text2; shorttext = text1.length > text2.length ? text2 : text1; if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { return null; // Pointless. } dmp = this; // 'this' becomes 'window' in a closure. /** * Does a substring of shorttext exist within longtext such that the substring * is at least half the length of longtext? * Closure, but does not reference any external variables. * @param {string} longtext Longer string. * @param {string} shorttext Shorter string. * @param {number} i Start index of quarter length substring within longtext. * @return {Array.} Five element Array, containing the prefix of * longtext, the suffix of longtext, the prefix of shorttext, the suffix * of shorttext and the common middle. Or null if there was no match. * @private */ function diffHalfMatchI(longtext, shorttext, i) { var seed, j, bestCommon, prefixLength, suffixLength, bestLongtextA, bestLongtextB, bestShorttextA, bestShorttextB; // Start with a 1/4 length substring at position i as a seed. seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); j = -1; bestCommon = ""; while ((j = shorttext.indexOf(seed, j + 1)) !== -1) { prefixLength = dmp.diffCommonPrefix(longtext.substring(i), shorttext.substring(j)); suffixLength = dmp.diffCommonSuffix(longtext.substring(0, i), shorttext.substring(0, j)); if (bestCommon.length < suffixLength + prefixLength) { bestCommon = shorttext.substring(j - suffixLength, j) + shorttext.substring(j, j + prefixLength); bestLongtextA = longtext.substring(0, i - suffixLength); bestLongtextB = longtext.substring(i + prefixLength); bestShorttextA = shorttext.substring(0, j - suffixLength); bestShorttextB = shorttext.substring(j + prefixLength); } } if (bestCommon.length * 2 >= longtext.length) { return [bestLongtextA, bestLongtextB, bestShorttextA, bestShorttextB, bestCommon]; } else { return null; } } // First check if the second quarter is the seed for a half-match. hm1 = diffHalfMatchI(longtext, shorttext, Math.ceil(longtext.length / 4)); // Check again based on the third quarter. hm2 = diffHalfMatchI(longtext, shorttext, Math.ceil(longtext.length / 2)); if (!hm1 && !hm2) { return null; } else if (!hm2) { hm = hm1; } else if (!hm1) { hm = hm2; } else { // Both matched. Select the longest. hm = hm1[4].length > hm2[4].length ? hm1 : hm2; } // A half-match was found, sort out the return data. if (text1.length > text2.length) { text1A = hm[0]; text1B = hm[1]; text2A = hm[2]; text2B = hm[3]; } else { text2A = hm[0]; text2B = hm[1]; text1A = hm[2]; text1B = hm[3]; } midCommon = hm[4]; return [text1A, text1B, text2A, text2B, midCommon]; }; /** * Do a quick line-level diff on both strings, then rediff the parts for * greater accuracy. * This speedup can produce non-minimal diffs. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {number} deadline Time when the diff should be complete by. * @return {!Array.} Array of diff tuples. * @private */ DiffMatchPatch.prototype.diffLineMode = function (text1, text2, deadline) { var a, diffs, linearray, pointer, countInsert, countDelete, textInsert, textDelete, j; // Scan the text on a line-by-line basis first. a = this.diffLinesToChars(text1, text2); text1 = a.chars1; text2 = a.chars2; linearray = a.lineArray; diffs = this.DiffMain(text1, text2, false, deadline); // Convert the diff back to original text. this.diffCharsToLines(diffs, linearray); // Eliminate freak matches (e.g. blank lines) this.diffCleanupSemantic(diffs); // Rediff any replacement blocks, this time character-by-character. // Add a dummy entry at the end. diffs.push([DIFF_EQUAL, ""]); pointer = 0; countDelete = 0; countInsert = 0; textDelete = ""; textInsert = ""; while (pointer < diffs.length) { switch (diffs[pointer][0]) { case DIFF_INSERT: countInsert++; textInsert += diffs[pointer][1]; break; case DIFF_DELETE: countDelete++; textDelete += diffs[pointer][1]; break; case DIFF_EQUAL: // Upon reaching an equality, check for prior redundancies. if (countDelete >= 1 && countInsert >= 1) { // Delete the offending records and add the merged ones. diffs.splice(pointer - countDelete - countInsert, countDelete + countInsert); pointer = pointer - countDelete - countInsert; a = this.DiffMain(textDelete, textInsert, false, deadline); for (j = a.length - 1; j >= 0; j--) { diffs.splice(pointer, 0, a[j]); } pointer = pointer + a.length; } countInsert = 0; countDelete = 0; textDelete = ""; textInsert = ""; break; } pointer++; } diffs.pop(); // Remove the dummy entry at the end. return diffs; }; /** * Find the 'middle snake' of a diff, split the problem in two * and return the recursively constructed diff. * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {number} deadline Time at which to bail if not yet complete. * @return {!Array.} Array of diff tuples. * @private */ DiffMatchPatch.prototype.diffBisect = function (text1, text2, deadline) { var text1Length, text2Length, maxD, vOffset, vLength, v1, v2, x, delta, front, k1start, k1end, k2start, k2end, k2Offset, k1Offset, x1, x2, y1, y2, d, k1, k2; // Cache the text lengths to prevent multiple calls. text1Length = text1.length; text2Length = text2.length; maxD = Math.ceil((text1Length + text2Length) / 2); vOffset = maxD; vLength = 2 * maxD; v1 = new Array(vLength); v2 = new Array(vLength); // Setting all elements to -1 is faster in Chrome & Firefox than mixing // integers and undefined. for (x = 0; x < vLength; x++) { v1[x] = -1; v2[x] = -1; } v1[vOffset + 1] = 0; v2[vOffset + 1] = 0; delta = text1Length - text2Length; // If the total number of characters is odd, then the front path will collide // with the reverse path. front = delta % 2 !== 0; // Offsets for start and end of k loop. // Prevents mapping of space beyond the grid. k1start = 0; k1end = 0; k2start = 0; k2end = 0; for (d = 0; d < maxD; d++) { // Bail out if deadline is reached. if (new Date().getTime() > deadline) { break; } // Walk the front path one step. for (k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { k1Offset = vOffset + k1; if (k1 === -d || k1 !== d && v1[k1Offset - 1] < v1[k1Offset + 1]) { x1 = v1[k1Offset + 1]; } else { x1 = v1[k1Offset - 1] + 1; } y1 = x1 - k1; while (x1 < text1Length && y1 < text2Length && text1.charAt(x1) === text2.charAt(y1)) { x1++; y1++; } v1[k1Offset] = x1; if (x1 > text1Length) { // Ran off the right of the graph. k1end += 2; } else if (y1 > text2Length) { // Ran off the bottom of the graph. k1start += 2; } else if (front) { k2Offset = vOffset + delta - k1; if (k2Offset >= 0 && k2Offset < vLength && v2[k2Offset] !== -1) { // Mirror x2 onto top-left coordinate system. x2 = text1Length - v2[k2Offset]; if (x1 >= x2) { // Overlap detected. return this.diffBisectSplit(text1, text2, x1, y1, deadline); } } } } // Walk the reverse path one step. for (k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { k2Offset = vOffset + k2; if (k2 === -d || k2 !== d && v2[k2Offset - 1] < v2[k2Offset + 1]) { x2 = v2[k2Offset + 1]; } else { x2 = v2[k2Offset - 1] + 1; } y2 = x2 - k2; while (x2 < text1Length && y2 < text2Length && text1.charAt(text1Length - x2 - 1) === text2.charAt(text2Length - y2 - 1)) { x2++; y2++; } v2[k2Offset] = x2; if (x2 > text1Length) { // Ran off the left of the graph. k2end += 2; } else if (y2 > text2Length) { // Ran off the top of the graph. k2start += 2; } else if (!front) { k1Offset = vOffset + delta - k2; if (k1Offset >= 0 && k1Offset < vLength && v1[k1Offset] !== -1) { x1 = v1[k1Offset]; y1 = vOffset + x1 - k1Offset; // Mirror x2 onto top-left coordinate system. x2 = text1Length - x2; if (x1 >= x2) { // Overlap detected. return this.diffBisectSplit(text1, text2, x1, y1, deadline); } } } } } // Diff took too long and hit the deadline or // number of diffs equals number of characters, no commonality at all. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; }; /** * Given the location of the 'middle snake', split the diff in two parts * and recurse. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {number} x Index of split point in text1. * @param {number} y Index of split point in text2. * @param {number} deadline Time at which to bail if not yet complete. * @return {!Array.} Array of diff tuples. * @private */ DiffMatchPatch.prototype.diffBisectSplit = function (text1, text2, x, y, deadline) { var text1a, text1b, text2a, text2b, diffs, diffsb; text1a = text1.substring(0, x); text2a = text2.substring(0, y); text1b = text1.substring(x); text2b = text2.substring(y); // Compute both diffs serially. diffs = this.DiffMain(text1a, text2a, false, deadline); diffsb = this.DiffMain(text1b, text2b, false, deadline); return diffs.concat(diffsb); }; /** * Reduce the number of edits by eliminating semantically trivial equalities. * @param {!Array.} diffs Array of diff tuples. */ DiffMatchPatch.prototype.diffCleanupSemantic = function (diffs) { var changes, equalities, equalitiesLength, lastequality, pointer, lengthInsertions2, lengthDeletions2, lengthInsertions1, lengthDeletions1, deletion, insertion, overlapLength1, overlapLength2; changes = false; equalities = []; // Stack of indices where equalities are found. equalitiesLength = 0; // Keeping our own length var is faster in JS. /** @type {?string} */ lastequality = null; // Always equal to diffs[equalities[equalitiesLength - 1]][1] pointer = 0; // Index of current position. // Number of characters that changed prior to the equality. lengthInsertions1 = 0; lengthDeletions1 = 0; // Number of characters that changed after the equality. lengthInsertions2 = 0; lengthDeletions2 = 0; while (pointer < diffs.length) { if (diffs[pointer][0] === DIFF_EQUAL) { // Equality found. equalities[equalitiesLength++] = pointer; lengthInsertions1 = lengthInsertions2; lengthDeletions1 = lengthDeletions2; lengthInsertions2 = 0; lengthDeletions2 = 0; lastequality = diffs[pointer][1]; } else { // An insertion or deletion. if (diffs[pointer][0] === DIFF_INSERT) { lengthInsertions2 += diffs[pointer][1].length; } else { lengthDeletions2 += diffs[pointer][1].length; } // Eliminate an equality that is smaller or equal to the edits on both // sides of it. if (lastequality && lastequality.length <= Math.max(lengthInsertions1, lengthDeletions1) && lastequality.length <= Math.max(lengthInsertions2, lengthDeletions2)) { // Duplicate record. diffs.splice(equalities[equalitiesLength - 1], 0, [DIFF_DELETE, lastequality]); // Change second copy to insert. diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT; // Throw away the equality we just deleted. equalitiesLength--; // Throw away the previous equality (it needs to be reevaluated). equalitiesLength--; pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1; // Reset the counters. lengthInsertions1 = 0; lengthDeletions1 = 0; lengthInsertions2 = 0; lengthDeletions2 = 0; lastequality = null; changes = true; } } pointer++; } // Normalize the diff. if (changes) { this.diffCleanupMerge(diffs); } // Find any overlaps between deletions and insertions. // e.g: abcxxxxxxdef // -> abcxxxdef // e.g: xxxabcdefxxx // -> defxxxabc // Only extract an overlap if it is as big as the edit ahead or behind it. pointer = 1; while (pointer < diffs.length) { if (diffs[pointer - 1][0] === DIFF_DELETE && diffs[pointer][0] === DIFF_INSERT) { deletion = diffs[pointer - 1][1]; insertion = diffs[pointer][1]; overlapLength1 = this.diffCommonOverlap(deletion, insertion); overlapLength2 = this.diffCommonOverlap(insertion, deletion); if (overlapLength1 >= overlapLength2) { if (overlapLength1 >= deletion.length / 2 || overlapLength1 >= insertion.length / 2) { // Overlap found. Insert an equality and trim the surrounding edits. diffs.splice(pointer, 0, [DIFF_EQUAL, insertion.substring(0, overlapLength1)]); diffs[pointer - 1][1] = deletion.substring(0, deletion.length - overlapLength1); diffs[pointer + 1][1] = insertion.substring(overlapLength1); pointer++; } } else { if (overlapLength2 >= deletion.length / 2 || overlapLength2 >= insertion.length / 2) { // Reverse overlap found. // Insert an equality and swap and trim the surrounding edits. diffs.splice(pointer, 0, [DIFF_EQUAL, deletion.substring(0, overlapLength2)]); diffs[pointer - 1][0] = DIFF_INSERT; diffs[pointer - 1][1] = insertion.substring(0, insertion.length - overlapLength2); diffs[pointer + 1][0] = DIFF_DELETE; diffs[pointer + 1][1] = deletion.substring(overlapLength2); pointer++; } } pointer++; } pointer++; } }; /** * Determine if the suffix of one string is the prefix of another. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {number} The number of characters common to the end of the first * string and the start of the second string. * @private */ DiffMatchPatch.prototype.diffCommonOverlap = function (text1, text2) { var text1Length, text2Length, textLength, best, length, pattern, found; // Cache the text lengths to prevent multiple calls. text1Length = text1.length; text2Length = text2.length; // Eliminate the null case. if (text1Length === 0 || text2Length === 0) { return 0; } // Truncate the longer string. if (text1Length > text2Length) { text1 = text1.substring(text1Length - text2Length); } else if (text1Length < text2Length) { text2 = text2.substring(0, text1Length); } textLength = Math.min(text1Length, text2Length); // Quick check for the worst case. if (text1 === text2) { return textLength; } // Start by looking for a single character match // and increase length until no match is found. // Performance analysis: https://neil.fraser.name/news/2010/11/04/ best = 0; length = 1; while (true) { pattern = text1.substring(textLength - length); found = text2.indexOf(pattern); if (found === -1) { return best; } length += found; if (found === 0 || text1.substring(textLength - length) === text2.substring(0, length)) { best = length; length++; } } }; /** * Split two texts into an array of strings. Reduce the texts to a string of * hashes where each Unicode character represents one line. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {{chars1: string, chars2: string, lineArray: !Array.}} * An object containing the encoded text1, the encoded text2 and * the array of unique strings. * The zeroth element of the array of unique strings is intentionally blank. * @private */ DiffMatchPatch.prototype.diffLinesToChars = function (text1, text2) { var lineArray, lineHash, chars1, chars2; lineArray = []; // E.g. lineArray[4] === 'Hello\n' lineHash = {}; // E.g. lineHash['Hello\n'] === 4 // '\x00' is a valid character, but various debuggers don't like it. // So we'll insert a junk entry to avoid generating a null character. lineArray[0] = ""; /** * Split a text into an array of strings. Reduce the texts to a string of * hashes where each Unicode character represents one line. * Modifies linearray and linehash through being a closure. * @param {string} text String to encode. * @return {string} Encoded string. * @private */ function diffLinesToCharsMunge(text) { var chars, lineStart, lineEnd, lineArrayLength, line; chars = ""; // Walk the text, pulling out a substring for each line. // text.split('\n') would would temporarily double our memory footprint. // Modifying text would create many large strings to garbage collect. lineStart = 0; lineEnd = -1; // Keeping our own length variable is faster than looking it up. lineArrayLength = lineArray.length; while (lineEnd < text.length - 1) { lineEnd = text.indexOf("\n", lineStart); if (lineEnd === -1) { lineEnd = text.length - 1; } line = text.substring(lineStart, lineEnd + 1); lineStart = lineEnd + 1; var lineHashExists = lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) : lineHash[line] !== undefined; if (lineHashExists) { chars += String.fromCharCode(lineHash[line]); } else { chars += String.fromCharCode(lineArrayLength); lineHash[line] = lineArrayLength; lineArray[lineArrayLength++] = line; } } return chars; } chars1 = diffLinesToCharsMunge(text1); chars2 = diffLinesToCharsMunge(text2); return { chars1: chars1, chars2: chars2, lineArray: lineArray }; }; /** * Rehydrate the text in a diff from a string of line hashes to real lines of * text. * @param {!Array.} diffs Array of diff tuples. * @param {!Array.} lineArray Array of unique strings. * @private */ DiffMatchPatch.prototype.diffCharsToLines = function (diffs, lineArray) { var x, chars, text, y; for (x = 0; x < diffs.length; x++) { chars = diffs[x][1]; text = []; for (y = 0; y < chars.length; y++) { text[y] = lineArray[chars.charCodeAt(y)]; } diffs[x][1] = text.join(""); } }; /** * Reorder and merge like edit sections. Merge equalities. * Any edit section can move as long as it doesn't cross an equality. * @param {!Array.} diffs Array of diff tuples. */ DiffMatchPatch.prototype.diffCleanupMerge = function (diffs) { var pointer, countDelete, countInsert, textInsert, textDelete, commonlength, changes, diffPointer, position; diffs.push([DIFF_EQUAL, ""]); // Add a dummy entry at the end. pointer = 0; countDelete = 0; countInsert = 0; textDelete = ""; textInsert = ""; while (pointer < diffs.length) { switch (diffs[pointer][0]) { case DIFF_INSERT: countInsert++; textInsert += diffs[pointer][1]; pointer++; break; case DIFF_DELETE: countDelete++; textDelete += diffs[pointer][1]; pointer++; break; case DIFF_EQUAL: // Upon reaching an equality, check for prior redundancies. if (countDelete + countInsert > 1) { if (countDelete !== 0 && countInsert !== 0) { // Factor out any common prefixes. commonlength = this.diffCommonPrefix(textInsert, textDelete); if (commonlength !== 0) { if (pointer - countDelete - countInsert > 0 && diffs[pointer - countDelete - countInsert - 1][0] === DIFF_EQUAL) { diffs[pointer - countDelete - countInsert - 1][1] += textInsert.substring(0, commonlength); } else { diffs.splice(0, 0, [DIFF_EQUAL, textInsert.substring(0, commonlength)]); pointer++; } textInsert = textInsert.substring(commonlength); textDelete = textDelete.substring(commonlength); } // Factor out any common suffixies. commonlength = this.diffCommonSuffix(textInsert, textDelete); if (commonlength !== 0) { diffs[pointer][1] = textInsert.substring(textInsert.length - commonlength) + diffs[pointer][1]; textInsert = textInsert.substring(0, textInsert.length - commonlength); textDelete = textDelete.substring(0, textDelete.length - commonlength); } } // Delete the offending records and add the merged ones. if (countDelete === 0) { diffs.splice(pointer - countInsert, countDelete + countInsert, [DIFF_INSERT, textInsert]); } else if (countInsert === 0) { diffs.splice(pointer - countDelete, countDelete + countInsert, [DIFF_DELETE, textDelete]); } else { diffs.splice(pointer - countDelete - countInsert, countDelete + countInsert, [DIFF_DELETE, textDelete], [DIFF_INSERT, textInsert]); } pointer = pointer - countDelete - countInsert + (countDelete ? 1 : 0) + (countInsert ? 1 : 0) + 1; } else if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) { // Merge this equality with the previous one. diffs[pointer - 1][1] += diffs[pointer][1]; diffs.splice(pointer, 1); } else { pointer++; } countInsert = 0; countDelete = 0; textDelete = ""; textInsert = ""; break; } } if (diffs[diffs.length - 1][1] === "") { diffs.pop(); // Remove the dummy entry at the end. } // Second pass: look for single edits surrounded on both sides by equalities // which can be shifted sideways to eliminate an equality. // e.g: ABAC -> ABAC changes = false; pointer = 1; // Intentionally ignore the first and last element (don't need checking). while (pointer < diffs.length - 1) { if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) { diffPointer = diffs[pointer][1]; position = diffPointer.substring(diffPointer.length - diffs[pointer - 1][1].length); // This is a single edit surrounded by equalities. if (position === diffs[pointer - 1][1]) { // Shift the edit over the previous equality. diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length); diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]; diffs.splice(pointer - 1, 1); changes = true; } else if (diffPointer.substring(0, diffs[pointer + 1][1].length) === diffs[pointer + 1][1]) { // Shift the edit over the next equality. diffs[pointer - 1][1] += diffs[pointer + 1][1]; diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1]; diffs.splice(pointer + 1, 1); changes = true; } } pointer++; } // If shifts were made, the diff needs reordering and another shift sweep. if (changes) { this.diffCleanupMerge(diffs); } }; return function (o, n) { var diff, output, text; diff = new DiffMatchPatch(); output = diff.DiffMain(o, n); diff.diffCleanupEfficiency(output); text = diff.diffPrettyHtml(output); return text; }; }(); }((function() { return this; }()))); ================================================ FILE: common/Tests/External/qunit-2.9.3.css ================================================ /*! * QUnit 2.19.3 * https://qunitjs.com/ * * Copyright OpenJS Foundation and other contributors * Released under the MIT license * https://jquery.org/license */ /** Font Family and Sizes */ #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult { font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; } #qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } #qunit-tests { font-size: smaller; } /** Resets */ #qunit-tests, #qunit-header, #qunit-banner, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { margin: 0; padding: 0; } /* Style our buttons in a simple way, uninfluenced by the styles the tested app might load. Don't affect buttons in #qunit-fixture! https://github.com/qunitjs/qunit/pull/1395 https://github.com/qunitjs/qunit/issues/1437 */ #qunit-testrunner-toolbar button, #qunit-testresult button { all: unset; /* best effort, modern browsers only */ font: inherit; color: initial; border: initial; background-color: buttonface; padding: 0 4px; } /** Fixed headers with scrollable tests */ @supports (display: flex) or (display: -webkit-box) { @media (min-height: 500px) { #qunit { position: fixed; left: 0px; right: 0px; top: 0px; bottom: 0px; padding: 8px; display: -webkit-box; display: flex; flex-direction: column; } #qunit-tests { overflow: scroll; } #qunit-banner { flex: 5px 0 0; } } } /** Header (excluding toolbar) */ #qunit-header { padding: 0.5em 0 0.5em 1em; color: #C2CCD1; background-color: #0D3349; font-size: 1.5em; line-height: 1em; font-weight: 400; border-radius: 5px 5px 0 0; } #qunit-header a { text-decoration: none; color: inherit; } #qunit-header a:hover, #qunit-header a:focus { color: #FFF; } #qunit-banner { height: 5px; } #qunit-filteredTest { padding: 0.5em 1em 0.5em 1em; color: #366097; background-color: #F4FF77; } #qunit-userAgent { padding: 0.5em 1em 0.5em 1em; color: #FFF; background-color: #2B81AF; text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; } /** Toolbar */ #qunit-testrunner-toolbar { padding: 0.5em 1em 0.5em 1em; color: #5E740B; background-color: #EEE; } #qunit-testrunner-toolbar .clearfix { height: 0; clear: both; } #qunit-testrunner-toolbar label { display: inline-block; } #qunit-testrunner-toolbar input[type=checkbox], #qunit-testrunner-toolbar input[type=radio] { margin: 3px; vertical-align: -2px; } #qunit-testrunner-toolbar input[type=text] { box-sizing: border-box; height: 1.6em; } #qunit-testrunner-toolbar button, #qunit-testresult button { border-radius: .25em; border: 1px solid #AAA; background-color: #F8F8F8; color: #222; line-height: 1.6; cursor: pointer; } #qunit-testrunner-toolbar button:hover, #qunit-testresult button:hover { border-color: #AAA; background-color: #FFF; color: #444; } #qunit-testrunner-toolbar button:active, #qunit-testresult button:active { border-color: #777; background-color: #CCC; color: #000; } #qunit-testrunner-toolbar button:focus, #qunit-testresult button:focus { border-color: #2F68DA; /* emulate 2px border without a layout shift */ box-shadow: inset 0 0 0 1px #2F68DA } #qunit-testrunner-toolbar button:disabled, #qunit-testresult button:disabled { border-color: #CCC; background-color: #CCC; color: #FFF; cursor: default; } #qunit-toolbar-filters { float: right; /* aligning right avoids overflows and inefficient use of space around the dropdown menu on narrow viewports */ text-align: right; } .qunit-url-config, .qunit-filter, #qunit-modulefilter { display: inline-block; line-height: 2.1em; text-align: left; } .qunit-filter, #qunit-modulefilter { position: relative; margin-left: 1em; } .qunit-url-config label { margin-right: 0.5em; } #qunit-modulefilter-search { box-sizing: border-box; min-width: 400px; min-width: min(400px, 80vw); } #qunit-modulefilter-search-container { position: relative; } #qunit-modulefilter-search-container:after { position: absolute; right: 0.3em; bottom: 0; line-height: 100%; content: "\25bc"; color: black; } #qunit-modulefilter-dropdown { /* align with #qunit-modulefilter-search */ box-sizing: border-box; min-width: 400px; min-width: min(400px, 80vw); max-width: 80vw; position: absolute; right: 0; top: 100%; margin-top: 2px; /* ensure that when on a narrow viewports and having only one result, that #qunit-modulefilter-actions fall outside the dropdown rectangle. */ min-height: 3em; border: 1px solid #AAA; border-top-color: transparent; border-radius: 0 0 .25em .25em; color: #0D3349; background-color: #F5F5F5; z-index: 99; } #qunit-modulefilter-actions { display: block; overflow: auto; /* align with #qunit-modulefilter-dropdown-list */ font: smaller/1.5em sans-serif; } @media (min-width: 350px) { #qunit-modulefilter-actions { position: absolute; right: 0; } } #qunit-modulefilter-dropdown #qunit-modulefilter-actions > * { box-sizing: border-box; max-height: 2.8em; display: block; padding: 0.4em; } #qunit-modulefilter-dropdown #qunit-modulefilter-actions > button { float: right; margin: 0.25em; } #qunit-modulefilter-dropdown-list { margin: 0; padding: 0; font: smaller/1.5em sans-serif; } #qunit-modulefilter-dropdown-list li { list-style: none; } #qunit-modulefilter-dropdown-list .clickable { display: block; padding: 0.25em 0.50em 0.25em 0.15em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } #qunit-modulefilter-dropdown-list .clickable.checked { font-weight: bold; background-color: #E2F0F7; color: #0D3349; } #qunit-modulefilter-dropdown .clickable:hover { background-color: #FFF; color: #444; } /** Tests: Pass/Fail */ #qunit-tests { list-style-position: inside; } #qunit-tests li { padding: 0.4em 1em 0.4em 1em; border-bottom: 1px solid #FFF; list-style-position: inside; } #qunit-tests > li { display: none; } #qunit-tests li.running, #qunit-tests li.pass, #qunit-tests li.fail, #qunit-tests li.skipped, #qunit-tests li.aborted { display: list-item; } #qunit-tests.hidepass { position: relative; } #qunit-tests.hidepass li.running, #qunit-tests.hidepass li.pass:not(.todo) { visibility: hidden; position: absolute; width: 0; height: 0; padding: 0; border: 0; margin: 0; } #qunit-tests li strong { cursor: pointer; } #qunit-tests li.skipped strong { cursor: default; } #qunit-tests li a { padding: 0.5em; color: inherit; text-decoration: underline; } #qunit-tests li a:hover, #qunit-tests li a:focus { color: #0D3349; } #qunit-tests li .runtime { float: right; font-size: smaller; } .qunit-assert-list { margin-top: 0.5em; padding: 0.5em; background-color: #FFF; border-radius: 5px; } .qunit-source { margin: 0.6em 0 0.3em; } .qunit-collapsed { display: none; } #qunit-tests table { border-collapse: collapse; margin-top: 0.2em; } #qunit-tests th { text-align: right; vertical-align: top; padding: 0 0.5em 0 0; } #qunit-tests td { vertical-align: top; } #qunit-tests pre { margin: 0; white-space: pre-wrap; word-wrap: break-word; } #qunit-tests del { color: #374E0C; background-color: #E0F2BE; text-decoration: none; } #qunit-tests ins { color: #500; background-color: #FFCACA; text-decoration: none; } /*** Test Counts */ #qunit-tests b.counts { color: #0D3349; } #qunit-tests b.passed { color: #5E740B; } #qunit-tests b.failed { color: #710909; } #qunit-tests li li { padding: 5px; background-color: #FFF; border-bottom: none; list-style-position: inside; } /*** Passing Styles */ #qunit-tests .pass { color: #2F68DA; background-color: #E2F0F7; } #qunit-tests .pass .test-name { color: #366097; } #qunit-tests li li.pass { color: #3C510C; background-color: #FFF; border-left: 10px solid #C6E746; } #qunit-tests .pass .test-actual, #qunit-tests .pass .test-expected { color: #999; } #qunit-banner.qunit-pass { background-color: #C6E746; } /*** Failing Styles */ #qunit-tests .fail { color: #000; background-color: #EE5757; } #qunit-tests li li.fail { color: #710909; background-color: #FFF; border-left: 10px solid #EE5757; white-space: pre; } #qunit-tests > li:last-child { border-radius: 0 0 5px 5px; } #qunit-tests .fail .test-actual { color: #EE5757; } #qunit-tests .fail .test-expected { color: #008000; } #qunit-banner.qunit-fail { background-color: #EE5757; } /*** Aborted tests */ #qunit-tests .aborted { color: #000; background-color: orange; } /*** Skipped tests */ #qunit-tests .skipped { background-color: #EBECE9; } #qunit-tests .qunit-todo-label, #qunit-tests .qunit-skipped-label { background-color: #F4FF77; display: inline-block; font-style: normal; color: #366097; line-height: 1.8em; padding: 0 0.5em; margin: -0.4em 0.4em -0.4em 0; } #qunit-tests .qunit-todo-label { background-color: #EEE; } /** Result */ #qunit-testresult { color: #366097; background-color: #E2F0F7; border-bottom: 1px solid #FFF; } #qunit-testresult a { color: #2F68DA; } #qunit-testresult .clearfix { height: 0; clear: both; } #qunit-testresult .module-name { font-weight: 700; } #qunit-testresult-display { padding: 0.5em 1em 0.5em 1em; width: 85%; float:left; } #qunit-testresult-controls { padding: 0.5em 1em 0.5em 1em; width: 10%; float:left; } /** Fixture */ #qunit-fixture { position: absolute; top: -10000px; left: -10000px; width: 1000px; height: 1000px; } ================================================ FILE: common/Tests/External/qunit-2.9.3.js ================================================ /*! * QUnit 2.19.3 * https://qunitjs.com/ * * Copyright OpenJS Foundation and other contributors * Released under the MIT license * https://jquery.org/license */ (function () { 'use strict'; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function () {}; return { s: F, n: function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function (e) { throw e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function () { it = it.call(o); }, n: function () { var step = it.next(); normalCompletion = step.done; return step; }, e: function (e) { didErr = true; err = e; }, f: function () { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } // We don't use global-this-polyfill [1], because it modifies // the globals scope by default. QUnit must not affect the host context // as developers may test their project may be such a polyfill, and/or // they may intentionally test their project with and without certain // polyfills and we must not affect that. It also uses an obscure // mechanism that seems to sometimes causes a runtime error in older // browsers (specifically Safari and IE versions that support // Object.defineProperty but then report _T_ as undefined). // [1] https://github.com/ungap/global-this/blob/v0.4.4/esm/index.js // // Another way is `Function('return this')()`, but doing so relies // on eval which will cause a CSP error on some servers. // // Instead, simply check the four options that already exist // in all supported environments. function getGlobalThis() { if (typeof globalThis !== 'undefined') { // For SpiderMonkey, modern browsers, and recent Node.js // eslint-disable-next-line no-undef return globalThis; } if (typeof self !== 'undefined') { // For web workers // eslint-disable-next-line no-undef return self; } if (typeof window$1 !== 'undefined') { // For document context in browsers return window$1; } if (typeof global !== 'undefined') { // For Node.js // eslint-disable-next-line no-undef return global; } throw new Error('Unable to locate global object'); } // This avoids a simple `export const` assignment as that would lead Rollup // to change getGlobalThis and use the same (generated) variable name there. var g = getGlobalThis(); var window$1 = g.window; var console$1 = g.console; var setTimeout$1 = g.setTimeout; var clearTimeout = g.clearTimeout; var document = window$1 && window$1.document; var navigator = window$1 && window$1.navigator; var localSessionStorage = function () { var x = 'qunit-test-string'; try { g.sessionStorage.setItem(x, x); g.sessionStorage.removeItem(x); return g.sessionStorage; } catch (e) { return undefined; } }(); // Basic fallback for ES6 Map // Support: IE 9-10, Safari 7, PhantomJS; Map is undefined // Support: iOS 8; `new Map(iterable)` is not supported // // Fallback for ES7 Map#keys // Support: IE 11; Map#keys is undefined var StringMap = typeof g.Map === 'function' && typeof g.Map.prototype.keys === 'function' && typeof g.Symbol === 'function' && _typeof(g.Symbol.iterator) === 'symbol' ? g.Map : function StringMap(input) { var _this = this; var store = Object.create(null); var hasOwn = Object.prototype.hasOwnProperty; this.has = function (strKey) { return hasOwn.call(store, strKey); }; this.get = function (strKey) { return store[strKey]; }; this.set = function (strKey, val) { if (!hasOwn.call(store, strKey)) { this.size++; } store[strKey] = val; return this; }; this.delete = function (strKey) { if (hasOwn.call(store, strKey)) { delete store[strKey]; this.size--; } }; this.forEach = function (callback) { for (var strKey in store) { callback(store[strKey], strKey); } }; this.keys = function () { return Object.keys(store); }; this.clear = function () { store = Object.create(null); this.size = 0; }; this.size = 0; if (input) { input.forEach(function (val, strKey) { _this.set(strKey, val); }); } }; // Basic fallback for ES6 Set // Support: IE 11, `new Set(iterable)` parameter not yet implemented // Test for Set#values() which came after Set(iterable). var StringSet = typeof g.Set === 'function' && typeof g.Set.prototype.values === 'function' ? g.Set : function (input) { var set = Object.create(null); if (Array.isArray(input)) { input.forEach(function (item) { set[item] = true; }); } return { add: function add(value) { set[value] = true; }, has: function has(value) { return value in set; }, get size() { return Object.keys(set).length; } }; }; // Support: IE 9 // Detect if the console object exists and no-op otherwise. // This allows support for IE 9, which doesn't have a console // object if the developer tools are not open. // Support: IE 9 // Function#bind is supported, but no console.log.bind(). // Support: SpiderMonkey (mozjs 68+) // The console object has a log method, but no warn method. var Logger = { warn: console$1 ? Function.prototype.bind.call(console$1.warn || console$1.log, console$1) : function () {} }; var toString = Object.prototype.toString; var hasOwn$1 = Object.prototype.hasOwnProperty; var nativePerf = getNativePerf(); // TODO: Consider using globalThis instead so that perf marks work // in Node.js as well. As they can have overhead, we should also // have a way to disable these, and/or make them an opt-in reporter // in QUnit 3 and then support globalThis. // For example: `QUnit.addReporter(QUnit.reporters.perf)`. function getNativePerf() { if (window$1 && typeof window$1.performance !== 'undefined' && typeof window$1.performance.mark === 'function' && typeof window$1.performance.measure === 'function') { return window$1.performance; } else { return undefined; } } var performance = { now: nativePerf ? nativePerf.now.bind(nativePerf) : Date.now, measure: nativePerf ? function (comment, startMark, endMark) { // `performance.measure` may fail if the mark could not be found. // reasons a specific mark could not be found include: outside code invoking `performance.clearMarks()` try { nativePerf.measure(comment, startMark, endMark); } catch (ex) { Logger.warn('performance.measure could not be executed because of ', ex.message); } } : function () {}, mark: nativePerf ? nativePerf.mark.bind(nativePerf) : function () {} }; // Returns a new Array with the elements that are in a but not in b function diff(a, b) { return a.filter(function (a) { return b.indexOf(a) === -1; }); } /** * Determines whether an element exists in a given array or not. * * @method inArray * @param {any} elem * @param {Array} array * @return {boolean} */ function inArray(elem, array) { return array.indexOf(elem) !== -1; } /** * Recursively clone an object into a plain array or object, taking only the * own enumerable properties. * * @param {any} obj * @param {bool} [allowArray=true] * @return {Object|Array} */ function objectValues(obj) { var allowArray = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var vals = allowArray && is('array', obj) ? [] : {}; for (var key in obj) { if (hasOwn$1.call(obj, key)) { var val = obj[key]; vals[key] = val === Object(val) ? objectValues(val, allowArray) : val; } } return vals; } /** * Recursively clone an object into a plain object, taking only the * subset of own enumerable properties that exist a given model. * * @param {any} obj * @param {any} model * @return {Object} */ function objectValuesSubset(obj, model) { // Return primitive values unchanged to avoid false positives or confusing // results from assert.propContains(). // E.g. an actual null or false wrongly equaling an empty object, // or an actual string being reported as object not matching a partial object. if (obj !== Object(obj)) { return obj; } // Unlike objectValues(), subset arrays to a plain objects as well. // This enables subsetting [20, 30] with {1: 30}. var subset = {}; for (var key in model) { if (hasOwn$1.call(model, key) && hasOwn$1.call(obj, key)) { subset[key] = objectValuesSubset(obj[key], model[key]); } } return subset; } function extend(a, b, undefOnly) { for (var prop in b) { if (hasOwn$1.call(b, prop)) { if (b[prop] === undefined) { delete a[prop]; } else if (!(undefOnly && typeof a[prop] !== 'undefined')) { a[prop] = b[prop]; } } } return a; } function objectType(obj) { if (typeof obj === 'undefined') { return 'undefined'; } // Consider: typeof null === object if (obj === null) { return 'null'; } var match = toString.call(obj).match(/^\[object\s(.*)\]$/); var type = match && match[1]; switch (type) { case 'Number': if (isNaN(obj)) { return 'nan'; } return 'number'; case 'String': case 'Boolean': case 'Array': case 'Set': case 'Map': case 'Date': case 'RegExp': case 'Function': case 'Symbol': return type.toLowerCase(); default: return _typeof(obj); } } // Safe object type checking function is(type, obj) { return objectType(obj) === type; } // Based on Java's String.hashCode, a simple but not // rigorously collision resistant hashing function function generateHash(module, testName) { var str = module + '\x1C' + testName; var hash = 0; for (var i = 0; i < str.length; i++) { hash = (hash << 5) - hash + str.charCodeAt(i); hash |= 0; } // Convert the possibly negative integer hash code into an 8 character hex string, which isn't // strictly necessary but increases user understanding that the id is a SHA-like hash var hex = (0x100000000 + hash).toString(16); if (hex.length < 8) { hex = '0000000' + hex; } return hex.slice(-8); } /** * Converts an error into a simple string for comparisons. * * @param {Error|any} error * @return {string} */ function errorString(error) { // Use String() instead of toString() to handle non-object values like undefined or null. var resultErrorString = String(error); // If the error wasn't a subclass of Error but something like // an object literal with name and message properties... if (resultErrorString.slice(0, 7) === '[object') { // Based on https://es5.github.io/#x15.11.4.4 return (error.name || 'Error') + (error.message ? ": ".concat(error.message) : ''); } else { return resultErrorString; } } var BOXABLE_TYPES = new StringSet(['boolean', 'number', 'string']); // Memory for previously seen containers (object, array, map, set). // Used for recursion detection, and to avoid repeated comparison. // // Elements are { a: val, b: val }. var memory = []; function useStrictEquality(a, b) { return a === b; } function useObjectValueEquality(a, b) { return a === b || a.valueOf() === b.valueOf(); } function compareConstructors(a, b) { // Comparing constructors is more strict than using `instanceof` return getConstructor(a) === getConstructor(b); } function getConstructor(obj) { var proto = Object.getPrototypeOf(obj); // If the obj prototype descends from a null constructor, treat it // as a null prototype. // Ref https://github.com/qunitjs/qunit/issues/851 // // Allow objects with no prototype, from Object.create(null), to be equivalent to // plain objects that have Object as their constructor. return !proto || proto.constructor === null ? Object : obj.constructor; } function getRegExpFlags(regexp) { return 'flags' in regexp ? regexp.flags : regexp.toString().match(/[gimuy]*$/)[0]; } // Specialised comparisons after entryTypeCallbacks.object, based on `objectType()` var objTypeCallbacks = { undefined: useStrictEquality, null: useStrictEquality, // Handle boxed boolean boolean: useObjectValueEquality, number: function number(a, b) { // Handle NaN and boxed number return a === b || a.valueOf() === b.valueOf() || isNaN(a.valueOf()) && isNaN(b.valueOf()); }, // Handle boxed string string: useObjectValueEquality, symbol: useStrictEquality, date: useObjectValueEquality, nan: function nan() { return true; }, regexp: function regexp(a, b) { return a.source === b.source && // Include flags in the comparison getRegExpFlags(a) === getRegExpFlags(b); }, // identical reference only function: useStrictEquality, array: function array(a, b) { if (a.length !== b.length) { // Safe and faster return false; } for (var i = 0; i < a.length; i++) { if (!typeEquiv(a[i], b[i])) { return false; } } return true; }, // Define sets a and b to be equivalent if for each element aVal in a, there // is some element bVal in b such that aVal and bVal are equivalent. Element // repetitions are not counted, so these are equivalent: // a = new Set( [ X={}, Y=[], Y ] ); // b = new Set( [ Y, X, X ] ); set: function set(a, b) { if (a.size !== b.size) { // This optimization has certain quirks because of the lack of // repetition counting. For instance, adding the same // (reference-identical) element to two equivalent sets can // make them non-equivalent. return false; } var outerEq = true; a.forEach(function (aVal) { // Short-circuit if the result is already known. (Using for...of // with a break clause would be cleaner here, but it would cause // a syntax error on older JavaScript implementations even if // Set is unused) if (!outerEq) { return; } var innerEq = false; b.forEach(function (bVal) { // Likewise, short-circuit if the result is already known if (innerEq) { return; } // Swap out the global memory, as nested typeEquiv() would clobber it var originalMemory = memory; memory = []; if (typeEquiv(bVal, aVal)) { innerEq = true; } // Restore memory = originalMemory; }); if (!innerEq) { outerEq = false; } }); return outerEq; }, // Define maps a and b to be equivalent if for each key-value pair (aKey, aVal) // in a, there is some key-value pair (bKey, bVal) in b such that // [ aKey, aVal ] and [ bKey, bVal ] are equivalent. Key repetitions are not // counted, so these are equivalent: // a = new Map( [ [ {}, 1 ], [ {}, 1 ], [ [], 1 ] ] ); // b = new Map( [ [ {}, 1 ], [ [], 1 ], [ [], 1 ] ] ); map: function map(a, b) { if (a.size !== b.size) { // This optimization has certain quirks because of the lack of // repetition counting. For instance, adding the same // (reference-identical) key-value pair to two equivalent maps // can make them non-equivalent. return false; } var outerEq = true; a.forEach(function (aVal, aKey) { // Short-circuit if the result is already known. (Using for...of // with a break clause would be cleaner here, but it would cause // a syntax error on older JavaScript implementations even if // Map is unused) if (!outerEq) { return; } var innerEq = false; b.forEach(function (bVal, bKey) { // Likewise, short-circuit if the result is already known if (innerEq) { return; } // Swap out the global memory, as nested typeEquiv() would clobber it var originalMemory = memory; memory = []; if (objTypeCallbacks.array([bVal, bKey], [aVal, aKey])) { innerEq = true; } // Restore memory = originalMemory; }); if (!innerEq) { outerEq = false; } }); return outerEq; } }; // Entry points from typeEquiv, based on `typeof` var entryTypeCallbacks = { undefined: useStrictEquality, null: useStrictEquality, boolean: useStrictEquality, number: function number(a, b) { // Handle NaN return a === b || isNaN(a) && isNaN(b); }, string: useStrictEquality, symbol: useStrictEquality, function: useStrictEquality, object: function object(a, b) { // Handle memory (skip recursion) if (memory.some(function (pair) { return pair.a === a && pair.b === b; })) { return true; } memory.push({ a: a, b: b }); var aObjType = objectType(a); var bObjType = objectType(b); if (aObjType !== 'object' || bObjType !== 'object') { // Handle literal `null` // Handle: Array, Map/Set, Date, Regxp/Function, boxed primitives return aObjType === bObjType && objTypeCallbacks[aObjType](a, b); } // NOTE: Literal null must not make it here as it would throw if (compareConstructors(a, b) === false) { return false; } var aProperties = []; var bProperties = []; // Be strict and go deep, no filtering with hasOwnProperty. for (var i in a) { // Collect a's properties aProperties.push(i); // Skip OOP methods that look the same if (a.constructor !== Object && typeof a.constructor !== 'undefined' && typeof a[i] === 'function' && typeof b[i] === 'function' && a[i].toString() === b[i].toString()) { continue; } if (!typeEquiv(a[i], b[i])) { return false; } } for (var _i in b) { // Collect b's properties bProperties.push(_i); } return objTypeCallbacks.array(aProperties.sort(), bProperties.sort()); } }; function typeEquiv(a, b) { // Optimization: Only perform type-specific comparison when pairs are not strictly equal. if (a === b) { return true; } var aType = _typeof(a); var bType = _typeof(b); if (aType !== bType) { // Support comparing primitive to boxed primitives // Try again after possibly unwrapping one return (aType === 'object' && BOXABLE_TYPES.has(objectType(a)) ? a.valueOf() : a) === (bType === 'object' && BOXABLE_TYPES.has(objectType(b)) ? b.valueOf() : b); } return entryTypeCallbacks[aType](a, b); } function innerEquiv(a, b) { var res = typeEquiv(a, b); // Release any retained objects and reset recursion detection for next call memory = []; return res; } /** * Test any two types of JavaScript values for equality. * * @author Philippe Rathé * @author David Chan */ function equiv(a, b) { if (arguments.length === 2) { return a === b || innerEquiv(a, b); } // Given 0 or 1 arguments, just return true (nothing to compare). // Given (A,B,C,D) compare C,D then B,C then A,B. var i = arguments.length - 1; while (i > 0) { if (!innerEquiv(arguments[i - 1], arguments[i])) { return false; } i--; } return true; } /** * Config object: Maintain internal state * Later exposed as QUnit.config * `config` initialized at top of scope */ var config = { // HTML Reporter: Modify document.title when suite is done altertitle: true, // HTML Reporter: collapse every test except the first failing test // If false, all failing tests will be expanded collapse: true, // whether or not to fail when there are zero tests // defaults to `true` failOnZeroTests: true, // Select by pattern or case-insenstive substring match against "moduleName: testName" filter: undefined, // Depth up-to which object will be dumped maxDepth: 5, // Select case-insensitive match of the module name module: undefined, // HTML Reporter: Select module/test by array of internal IDs moduleId: undefined, // By default, run previously failed tests first // very useful in combination with "Hide passed tests" checked reorder: true, // When enabled, all tests must call expect() requireExpects: false, // By default, scroll to top of the page when suite is done scrolltop: true, // The storage module to use for reordering tests storage: localSessionStorage, testId: undefined, // HTML Reporter: List of URL parameters that are given visual controls urlConfig: [], // Internal: The first unnamed module // // By being defined as the intial value for currentModule, it is the // receptacle and implied parent for any global tests. It is as if we // called `QUnit.module( "" );` before any other tests were defined. // // If we reach begin() and no tests were put in it, we dequeue it as if it // never existed, and in that case never expose it to the events and // callbacks API. // // When global tests are defined, then this unnamed module will execute // as any other module, including moduleStart/moduleDone events etc. // // Since this module isn't explicitly created by the user, they have no // access to add hooks for it. The hooks object is defined to comply // with internal expectations of test.js, but they will be empty. // To apply hooks, place tests explicitly in a QUnit.module(), and use // its hooks accordingly. // // For global hooks that apply to all tests and all modules, use QUnit.hooks. // // NOTE: This is *not* a "global module". It is not an ancestor of all modules // and tests. It is merely the parent for any tests defined globally, // before the first QUnit.module(). As such, the events for this unnamed // module will fire as normal, right after its last test, and *not* at // the end of the test run. // // NOTE: This also should probably also not become a global module, unless // we keep it out of the public API. For example, it would likely not // improve the user interface and plugin behaviour if all modules became // wrapped between the start and end events of this module, and thus // needlessly add indentation, indirection, or other visible noise. // Unit tests for the callbacks API would detect that as a regression. currentModule: { name: '', tests: [], childModules: [], testsRun: 0, testsIgnored: 0, hooks: { before: [], beforeEach: [], afterEach: [], after: [] } }, // Internal: Exposed to make resets easier // Ref https://github.com/qunitjs/qunit/pull/1598 globalHooks: {}, // Internal state blocking: true, callbacks: {}, modules: [], queue: [], stats: { all: 0, bad: 0, testCount: 0 } }; // Apply a predefined QUnit.config object // // Ignore QUnit.config if it is a QUnit distribution instead of preconfig. // That means QUnit was loaded twice! (Use the same approach as export.js) var preConfig = g && g.QUnit && !g.QUnit.version && g.QUnit.config; if (preConfig) { extend(config, preConfig); } // Push a loose unnamed module to the modules collection config.modules.push(config.currentModule); var dump = (function () { function quote(str) { return '"' + str.toString().replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"'; } function literal(o) { return o + ''; } function join(pre, arr, post) { var s = dump.separator(); var inner = dump.indent(1); if (arr.join) { arr = arr.join(',' + s + inner); } if (!arr) { return pre + post; } var base = dump.indent(); return [pre, inner + arr, base + post].join(s); } function array(arr, stack) { if (dump.maxDepth && dump.depth > dump.maxDepth) { return '[object Array]'; } this.up(); var i = arr.length; var ret = new Array(i); while (i--) { ret[i] = this.parse(arr[i], undefined, stack); } this.down(); return join('[', ret, ']'); } function isArray(obj) { return ( // Native Arrays toString.call(obj) === '[object Array]' || // NodeList objects typeof obj.length === 'number' && obj.item !== undefined && (obj.length ? obj.item(0) === obj[0] : obj.item(0) === null && obj[0] === undefined) ); } var reName = /^function (\w+)/; var dump = { // The objType is used mostly internally, you can fix a (custom) type in advance parse: function parse(obj, objType, stack) { stack = stack || []; var objIndex = stack.indexOf(obj); if (objIndex !== -1) { return "recursion(".concat(objIndex - stack.length, ")"); } objType = objType || this.typeOf(obj); var parser = this.parsers[objType]; var parserType = _typeof(parser); if (parserType === 'function') { stack.push(obj); var res = parser.call(this, obj, stack); stack.pop(); return res; } if (parserType === 'string') { return parser; } return '[ERROR: Missing QUnit.dump formatter for type ' + objType + ']'; }, typeOf: function typeOf(obj) { var type; if (obj === null) { type = 'null'; } else if (typeof obj === 'undefined') { type = 'undefined'; } else if (is('regexp', obj)) { type = 'regexp'; } else if (is('date', obj)) { type = 'date'; } else if (is('function', obj)) { type = 'function'; } else if (obj.setInterval !== undefined && obj.document !== undefined && obj.nodeType === undefined) { type = 'window'; } else if (obj.nodeType === 9) { type = 'document'; } else if (obj.nodeType) { type = 'node'; } else if (isArray(obj)) { type = 'array'; } else if (obj.constructor === Error.prototype.constructor) { type = 'error'; } else { type = _typeof(obj); } return type; }, separator: function separator() { if (this.multiline) { return this.HTML ? '
        ' : '\n'; } else { return this.HTML ? ' ' : ' '; } }, // Extra can be a number, shortcut for increasing-calling-decreasing indent: function indent(extra) { if (!this.multiline) { return ''; } var chr = this.indentChar; if (this.HTML) { chr = chr.replace(/\t/g, ' ').replace(/ /g, ' '); } return new Array(this.depth + (extra || 0)).join(chr); }, up: function up(a) { this.depth += a || 1; }, down: function down(a) { this.depth -= a || 1; }, setParser: function setParser(name, parser) { this.parsers[name] = parser; }, // The next 3 are exposed so you can use them quote: quote, literal: literal, join: join, depth: 1, maxDepth: config.maxDepth, // This is the list of parsers, to modify them, use dump.setParser parsers: { window: '[Window]', document: '[Document]', error: function error(_error) { return 'Error("' + _error.message + '")'; }, // This has been unused since QUnit 1.0.0. // @todo Deprecate and remove. unknown: '[Unknown]', null: 'null', undefined: 'undefined', function: function _function(fn) { var ret = 'function'; // Functions never have name in IE var name = 'name' in fn ? fn.name : (reName.exec(fn) || [])[1]; if (name) { ret += ' ' + name; } ret += '('; ret = [ret, dump.parse(fn, 'functionArgs'), '){'].join(''); return join(ret, dump.parse(fn, 'functionCode'), '}'); }, array: array, nodelist: array, arguments: array, object: function object(map, stack) { var ret = []; if (dump.maxDepth && dump.depth > dump.maxDepth) { return '[object Object]'; } dump.up(); var keys = []; for (var key in map) { keys.push(key); } // Some properties are not always enumerable on Error objects. var nonEnumerableProperties = ['message', 'name']; for (var i in nonEnumerableProperties) { var _key = nonEnumerableProperties[i]; if (_key in map && !inArray(_key, keys)) { keys.push(_key); } } keys.sort(); for (var _i = 0; _i < keys.length; _i++) { var _key2 = keys[_i]; var val = map[_key2]; ret.push(dump.parse(_key2, 'key') + ': ' + dump.parse(val, undefined, stack)); } dump.down(); return join('{', ret, '}'); }, node: function node(_node) { var open = dump.HTML ? '<' : '<'; var close = dump.HTML ? '>' : '>'; var tag = _node.nodeName.toLowerCase(); var ret = open + tag; var attrs = _node.attributes; if (attrs) { for (var i = 0; i < attrs.length; i++) { var val = attrs[i].nodeValue; // IE6 includes all attributes in .attributes, even ones not explicitly // set. Those have values like undefined, null, 0, false, "" or // "inherit". if (val && val !== 'inherit') { ret += ' ' + attrs[i].nodeName + '=' + dump.parse(val, 'attribute'); } } } ret += close; // Show content of TextNode or CDATASection if (_node.nodeType === 3 || _node.nodeType === 4) { ret += _node.nodeValue; } return ret + open + '/' + tag + close; }, // Function calls it internally, it's the arguments part of the function functionArgs: function functionArgs(fn) { var l = fn.length; if (!l) { return ''; } var args = new Array(l); while (l--) { // 97 is 'a' args[l] = String.fromCharCode(97 + l); } return ' ' + args.join(', ') + ' '; }, // Object calls it internally, the key part of an item in a map key: quote, // Function calls it internally, it's the content of the function functionCode: '[code]', // Node calls it internally, it's a html attribute value attribute: quote, string: quote, date: quote, regexp: literal, number: literal, boolean: literal, symbol: function symbol(sym) { return sym.toString(); } }, // If true, entities are escaped ( <, >, \t, space and \n ) HTML: false, // Indentation unit indentChar: ' ', // If true, items in a collection, are separated by a \n, else just a space. multiline: true }; return dump; })(); var SuiteReport = /*#__PURE__*/function () { function SuiteReport(name, parentSuite) { _classCallCheck(this, SuiteReport); this.name = name; this.fullName = parentSuite ? parentSuite.fullName.concat(name) : []; // When an "error" event is emitted from onUncaughtException(), the // "runEnd" event should report the status as failed. The "runEnd" event data // is tracked through this property (via the "runSuite" instance). this.globalFailureCount = 0; this.tests = []; this.childSuites = []; if (parentSuite) { parentSuite.pushChildSuite(this); } } _createClass(SuiteReport, [{ key: "start", value: function start(recordTime) { if (recordTime) { this._startTime = performance.now(); var suiteLevel = this.fullName.length; performance.mark("qunit_suite_".concat(suiteLevel, "_start")); } return { name: this.name, fullName: this.fullName.slice(), tests: this.tests.map(function (test) { return test.start(); }), childSuites: this.childSuites.map(function (suite) { return suite.start(); }), testCounts: { total: this.getTestCounts().total } }; } }, { key: "end", value: function end(recordTime) { if (recordTime) { this._endTime = performance.now(); var suiteLevel = this.fullName.length; var suiteName = this.fullName.join(' – '); performance.mark("qunit_suite_".concat(suiteLevel, "_end")); performance.measure(suiteLevel === 0 ? 'QUnit Test Run' : "QUnit Test Suite: ".concat(suiteName), "qunit_suite_".concat(suiteLevel, "_start"), "qunit_suite_".concat(suiteLevel, "_end")); } return { name: this.name, fullName: this.fullName.slice(), tests: this.tests.map(function (test) { return test.end(); }), childSuites: this.childSuites.map(function (suite) { return suite.end(); }), testCounts: this.getTestCounts(), runtime: this.getRuntime(), status: this.getStatus() }; } }, { key: "pushChildSuite", value: function pushChildSuite(suite) { this.childSuites.push(suite); } }, { key: "pushTest", value: function pushTest(test) { this.tests.push(test); } }, { key: "getRuntime", value: function getRuntime() { return Math.round(this._endTime - this._startTime); } }, { key: "getTestCounts", value: function getTestCounts() { var counts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { passed: 0, failed: 0, skipped: 0, todo: 0, total: 0 }; counts.failed += this.globalFailureCount; counts.total += this.globalFailureCount; counts = this.tests.reduce(function (counts, test) { if (test.valid) { counts[test.getStatus()]++; counts.total++; } return counts; }, counts); return this.childSuites.reduce(function (counts, suite) { return suite.getTestCounts(counts); }, counts); } }, { key: "getStatus", value: function getStatus() { var _this$getTestCounts = this.getTestCounts(), total = _this$getTestCounts.total, failed = _this$getTestCounts.failed, skipped = _this$getTestCounts.skipped, todo = _this$getTestCounts.todo; if (failed) { return 'failed'; } else { if (skipped === total) { return 'skipped'; } else if (todo === total) { return 'todo'; } else { return 'passed'; } } } }]); return SuiteReport; }(); var moduleStack = []; var runSuite = new SuiteReport(); function isParentModuleInQueue() { var modulesInQueue = config.modules.filter(function (module) { return !module.ignored; }).map(function (module) { return module.moduleId; }); return moduleStack.some(function (module) { return modulesInQueue.includes(module.moduleId); }); } function createModule(name, testEnvironment, modifiers) { var parentModule = moduleStack.length ? moduleStack.slice(-1)[0] : null; var moduleName = parentModule !== null ? [parentModule.name, name].join(' > ') : name; var parentSuite = parentModule ? parentModule.suiteReport : runSuite; var skip = parentModule !== null && parentModule.skip || modifiers.skip; var todo = parentModule !== null && parentModule.todo || modifiers.todo; var env = {}; if (parentModule) { extend(env, parentModule.testEnvironment); } extend(env, testEnvironment); var module = { name: moduleName, parentModule: parentModule, hooks: { before: [], beforeEach: [], afterEach: [], after: [] }, testEnvironment: env, tests: [], moduleId: generateHash(moduleName), testsRun: 0, testsIgnored: 0, childModules: [], suiteReport: new SuiteReport(name, parentSuite), // Initialised by test.js when the module start executing, // i.e. before the first test in this module (or a child). stats: null, // Pass along `skip` and `todo` properties from parent module, in case // there is one, to childs. And use own otherwise. // This property will be used to mark own tests and tests of child suites // as either `skipped` or `todo`. skip: skip, todo: skip ? false : todo, ignored: modifiers.ignored || false }; if (parentModule) { parentModule.childModules.push(module); } config.modules.push(module); return module; } function setHookFromEnvironment(hooks, environment, name) { var potentialHook = environment[name]; if (typeof potentialHook === 'function') { hooks[name].push(potentialHook); } delete environment[name]; } function makeSetHook(module, hookName) { return function setHook(callback) { if (config.currentModule !== module) { Logger.warn('The `' + hookName + '` hook was called inside the wrong module (`' + config.currentModule.name + '`). ' + 'Instead, use hooks provided by the callback to the containing module (`' + module.name + '`). ' + 'This will become an error in QUnit 3.0.'); } module.hooks[hookName].push(callback); }; } function processModule(name, options, executeNow) { var modifiers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; if (typeof options === 'function') { executeNow = options; options = undefined; } var module = createModule(name, options, modifiers); // Transfer any initial hooks from the options object to the 'hooks' object var testEnvironment = module.testEnvironment; var hooks = module.hooks; setHookFromEnvironment(hooks, testEnvironment, 'before'); setHookFromEnvironment(hooks, testEnvironment, 'beforeEach'); setHookFromEnvironment(hooks, testEnvironment, 'afterEach'); setHookFromEnvironment(hooks, testEnvironment, 'after'); var moduleFns = { before: makeSetHook(module, 'before'), beforeEach: makeSetHook(module, 'beforeEach'), afterEach: makeSetHook(module, 'afterEach'), after: makeSetHook(module, 'after') }; var prevModule = config.currentModule; config.currentModule = module; if (typeof executeNow === 'function') { moduleStack.push(module); try { var cbReturnValue = executeNow.call(module.testEnvironment, moduleFns); if (cbReturnValue && typeof cbReturnValue.then === 'function') { Logger.warn('Returning a promise from a module callback is not supported. ' + 'Instead, use hooks for async behavior. ' + 'This will become an error in QUnit 3.0.'); } } finally { // If the module closure threw an uncaught error during the load phase, // we let this bubble up to global error handlers. But, not until after // we teardown internal state to ensure correct module nesting. // Ref https://github.com/qunitjs/qunit/issues/1478. moduleStack.pop(); config.currentModule = module.parentModule || prevModule; } } } var focused$1 = false; // indicates that the "only" filter was used function module$1(name, options, executeNow) { var ignored = focused$1 && !isParentModuleInQueue(); processModule(name, options, executeNow, { ignored: ignored }); } module$1.only = function () { if (!focused$1) { // Upon the first module.only() call, // delete any and all previously registered modules and tests. config.modules.length = 0; config.queue.length = 0; // Ignore any tests declared after this block within the same // module parent. https://github.com/qunitjs/qunit/issues/1645 config.currentModule.ignored = true; } focused$1 = true; processModule.apply(void 0, arguments); }; module$1.skip = function (name, options, executeNow) { if (focused$1) { return; } processModule(name, options, executeNow, { skip: true }); }; module$1.todo = function (name, options, executeNow) { if (focused$1) { return; } processModule(name, options, executeNow, { todo: true }); }; // Doesn't support IE9, it will return undefined on these browsers // See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack var fileName = (sourceFromStacktrace(0) || '').replace(/(:\d+)+\)?/, '') // Remove anything prior to the last slash (Unix/Windows) // from the last frame .replace(/.+[/\\]/, ''); function extractStacktrace(e, offset) { offset = offset === undefined ? 4 : offset; if (e && e.stack) { var stack = e.stack.split('\n'); if (/^error$/i.test(stack[0])) { stack.shift(); } if (fileName) { var include = []; for (var i = offset; i < stack.length; i++) { if (stack[i].indexOf(fileName) !== -1) { break; } include.push(stack[i]); } if (include.length) { return include.join('\n'); } } return stack[offset]; } } function sourceFromStacktrace(offset) { var error = new Error(); // Support: Safari <=7 only, IE <=10 - 11 only // Not all browsers generate the `stack` property for `new Error()`, see also #636 if (!error.stack) { try { throw error; } catch (err) { error = err; } } return extractStacktrace(error, offset); } var Assert = /*#__PURE__*/function () { function Assert(testContext) { _classCallCheck(this, Assert); this.test = testContext; } _createClass(Assert, [{ key: "timeout", value: function timeout(duration) { if (typeof duration !== 'number') { throw new Error('You must pass a number as the duration to assert.timeout'); } this.test.timeout = duration; // If a timeout has been set, clear it and reset with the new duration if (config.timeout) { clearTimeout(config.timeout); config.timeout = null; if (config.timeoutHandler && this.test.timeout > 0) { this.test.internalResetTimeout(this.test.timeout); } } } // Documents a "step", which is a string value, in a test as a passing assertion }, { key: "step", value: function step(message) { var assertionMessage = message; var result = !!message; this.test.steps.push(message); if (typeof message === 'undefined' || message === '') { assertionMessage = 'You must provide a message to assert.step'; } else if (typeof message !== 'string') { assertionMessage = 'You must provide a string value to assert.step'; result = false; } this.pushResult({ result: result, message: assertionMessage }); } // Verifies the steps in a test match a given array of string values }, { key: "verifySteps", value: function verifySteps(steps, message) { // Since the steps array is just string values, we can clone with slice var actualStepsClone = this.test.steps.slice(); this.deepEqual(actualStepsClone, steps, message); this.test.steps.length = 0; } }, { key: "expect", value: function expect(asserts) { if (arguments.length === 1) { this.test.expected = asserts; } else { return this.test.expected; } } // Create a new async pause and return a new function that can release the pause. }, { key: "async", value: function async(count) { var requiredCalls = count === undefined ? 1 : count; return this.test.internalStop(requiredCalls); } // Exports test.push() to the user API // Alias of pushResult. }, { key: "push", value: function push(result, actual, expected, message, negative) { Logger.warn('assert.push is deprecated and will be removed in QUnit 3.0.' + ' Please use assert.pushResult instead (https://api.qunitjs.com/assert/pushResult).'); var currentAssert = this instanceof Assert ? this : config.current.assert; return currentAssert.pushResult({ result: result, actual: actual, expected: expected, message: message, negative: negative }); } }, { key: "pushResult", value: function pushResult(resultInfo) { // Destructure of resultInfo = { result, actual, expected, message, negative } var assert = this; var currentTest = assert instanceof Assert && assert.test || config.current; // Backwards compatibility fix. // Allows the direct use of global exported assertions and QUnit.assert.* // Although, it's use is not recommended as it can leak assertions // to other tests from async tests, because we only get a reference to the current test, // not exactly the test where assertion were intended to be called. if (!currentTest) { throw new Error('assertion outside test context, in ' + sourceFromStacktrace(2)); } if (!(assert instanceof Assert)) { assert = currentTest.assert; } return assert.test.pushResult(resultInfo); } }, { key: "ok", value: function ok(result, message) { if (!message) { message = result ? 'okay' : "failed, expected argument to be truthy, was: ".concat(dump.parse(result)); } this.pushResult({ result: !!result, actual: result, expected: true, message: message }); } }, { key: "notOk", value: function notOk(result, message) { if (!message) { message = !result ? 'okay' : "failed, expected argument to be falsy, was: ".concat(dump.parse(result)); } this.pushResult({ result: !result, actual: result, expected: false, message: message }); } }, { key: "true", value: function _true(result, message) { this.pushResult({ result: result === true, actual: result, expected: true, message: message }); } }, { key: "false", value: function _false(result, message) { this.pushResult({ result: result === false, actual: result, expected: false, message: message }); } }, { key: "equal", value: function equal(actual, expected, message) { this.pushResult({ // eslint-disable-next-line eqeqeq result: expected == actual, actual: actual, expected: expected, message: message }); } }, { key: "notEqual", value: function notEqual(actual, expected, message) { this.pushResult({ // eslint-disable-next-line eqeqeq result: expected != actual, actual: actual, expected: expected, message: message, negative: true }); } }, { key: "propEqual", value: function propEqual(actual, expected, message) { actual = objectValues(actual); expected = objectValues(expected); this.pushResult({ result: equiv(actual, expected), actual: actual, expected: expected, message: message }); } }, { key: "notPropEqual", value: function notPropEqual(actual, expected, message) { actual = objectValues(actual); expected = objectValues(expected); this.pushResult({ result: !equiv(actual, expected), actual: actual, expected: expected, message: message, negative: true }); } }, { key: "propContains", value: function propContains(actual, expected, message) { actual = objectValuesSubset(actual, expected); // The expected parameter is usually a plain object, but clone it for // consistency with propEqual(), and to make it easy to explain that // inheritence is not considered (on either side), and to support // recursively checking subsets of nested objects. expected = objectValues(expected, false); this.pushResult({ result: equiv(actual, expected), actual: actual, expected: expected, message: message }); } }, { key: "notPropContains", value: function notPropContains(actual, expected, message) { actual = objectValuesSubset(actual, expected); expected = objectValues(expected); this.pushResult({ result: !equiv(actual, expected), actual: actual, expected: expected, message: message, negative: true }); } }, { key: "deepEqual", value: function deepEqual(actual, expected, message) { this.pushResult({ result: equiv(actual, expected), actual: actual, expected: expected, message: message }); } }, { key: "notDeepEqual", value: function notDeepEqual(actual, expected, message) { this.pushResult({ result: !equiv(actual, expected), actual: actual, expected: expected, message: message, negative: true }); } }, { key: "strictEqual", value: function strictEqual(actual, expected, message) { this.pushResult({ result: expected === actual, actual: actual, expected: expected, message: message }); } }, { key: "notStrictEqual", value: function notStrictEqual(actual, expected, message) { this.pushResult({ result: expected !== actual, actual: actual, expected: expected, message: message, negative: true }); } }, { key: 'throws', value: function throws(block, expected, message) { var _validateExpectedExce = validateExpectedExceptionArgs(expected, message, 'throws'); var _validateExpectedExce2 = _slicedToArray(_validateExpectedExce, 2); expected = _validateExpectedExce2[0]; message = _validateExpectedExce2[1]; var currentTest = this instanceof Assert && this.test || config.current; if (typeof block !== 'function') { currentTest.assert.pushResult({ result: false, actual: block, message: 'The value provided to `assert.throws` in ' + '"' + currentTest.testName + '" was not a function.' }); return; } var actual; var result = false; currentTest.ignoreGlobalErrors = true; try { block.call(currentTest.testEnvironment); } catch (e) { actual = e; } currentTest.ignoreGlobalErrors = false; if (actual) { var _validateException = validateException(actual, expected, message); var _validateException2 = _slicedToArray(_validateException, 3); result = _validateException2[0]; expected = _validateException2[1]; message = _validateException2[2]; } currentTest.assert.pushResult({ result: result, // undefined if it didn't throw actual: actual && errorString(actual), expected: expected, message: message }); } }, { key: "rejects", value: function rejects(promise, expected, message) { var _validateExpectedExce3 = validateExpectedExceptionArgs(expected, message, 'rejects'); var _validateExpectedExce4 = _slicedToArray(_validateExpectedExce3, 2); expected = _validateExpectedExce4[0]; message = _validateExpectedExce4[1]; var currentTest = this instanceof Assert && this.test || config.current; var then = promise && promise.then; if (typeof then !== 'function') { currentTest.assert.pushResult({ result: false, message: 'The value provided to `assert.rejects` in ' + '"' + currentTest.testName + '" was not a promise.', actual: promise }); return; } var done = this.async(); return then.call(promise, function handleFulfillment() { currentTest.assert.pushResult({ result: false, message: 'The promise returned by the `assert.rejects` callback in ' + '"' + currentTest.testName + '" did not reject.', actual: promise }); done(); }, function handleRejection(actual) { var result; var _validateException3 = validateException(actual, expected, message); var _validateException4 = _slicedToArray(_validateException3, 3); result = _validateException4[0]; expected = _validateException4[1]; message = _validateException4[2]; currentTest.assert.pushResult({ result: result, // leave rejection value of undefined as-is actual: actual && errorString(actual), expected: expected, message: message }); done(); }); } }]); return Assert; }(); function validateExpectedExceptionArgs(expected, message, assertionMethod) { var expectedType = objectType(expected); // 'expected' is optional unless doing string comparison if (expectedType === 'string') { if (message === undefined) { message = expected; expected = undefined; return [expected, message]; } else { throw new Error('assert.' + assertionMethod + ' does not accept a string value for the expected argument.\n' + 'Use a non-string object value (e.g. RegExp or validator function) ' + 'instead if necessary.'); } } var valid = !expected || // TODO: be more explicit here expectedType === 'regexp' || expectedType === 'function' || expectedType === 'object'; if (!valid) { throw new Error('Invalid expected value type (' + expectedType + ') ' + 'provided to assert.' + assertionMethod + '.'); } return [expected, message]; } function validateException(actual, expected, message) { var result = false; var expectedType = objectType(expected); // These branches should be exhaustive, based on validation done in validateExpectedException // We don't want to validate if (!expected) { result = true; // Expected is a regexp } else if (expectedType === 'regexp') { result = expected.test(errorString(actual)); // Log the string form of the regexp expected = String(expected); // Expected is a constructor, maybe an Error constructor. // Note the extra check on its prototype - this is an implicit // requirement of "instanceof", else it will throw a TypeError. } else if (expectedType === 'function' && expected.prototype !== undefined && actual instanceof expected) { result = true; // Expected is an Error object } else if (expectedType === 'object') { result = actual instanceof expected.constructor && actual.name === expected.name && actual.message === expected.message; // Log the string form of the Error object expected = errorString(expected); // Expected is a validation function which returns true if validation passed } else if (expectedType === 'function') { // protect against accidental semantics which could hard error in the test try { result = expected.call({}, actual) === true; expected = null; } catch (e) { // assign the "expected" to a nice error string to communicate the local failure to the user expected = errorString(e); } } return [result, expected, message]; } // Provide an alternative to assert.throws(), for environments that consider throws a reserved word // Known to us are: Closure Compiler, Narwhal // eslint-disable-next-line dot-notation Assert.prototype.raises = Assert.prototype['throws']; var LISTENERS = Object.create(null); var SUPPORTED_EVENTS = ['error', 'runStart', 'suiteStart', 'testStart', 'assertion', 'testEnd', 'suiteEnd', 'runEnd']; /** * Emits an event with the specified data to all currently registered listeners. * Callbacks will fire in the order in which they are registered (FIFO). This * function is not exposed publicly; it is used by QUnit internals to emit * logging events. * * @private * @method emit * @param {string} eventName * @param {Object} data * @return {void} */ function emit(eventName, data) { if (typeof eventName !== 'string') { throw new TypeError('eventName must be a string when emitting an event'); } // Clone the callbacks in case one of them registers a new callback var originalCallbacks = LISTENERS[eventName]; var callbacks = originalCallbacks ? _toConsumableArray(originalCallbacks) : []; for (var i = 0; i < callbacks.length; i++) { callbacks[i](data); } } /** * Registers a callback as a listener to the specified event. * * @public * @method on * @param {string} eventName * @param {Function} callback * @return {void} */ function on(eventName, callback) { if (typeof eventName !== 'string') { throw new TypeError('eventName must be a string when registering a listener'); } else if (!inArray(eventName, SUPPORTED_EVENTS)) { var events = SUPPORTED_EVENTS.join(', '); throw new Error("\"".concat(eventName, "\" is not a valid event; must be one of: ").concat(events, ".")); } else if (typeof callback !== 'function') { throw new TypeError('callback must be a function when registering a listener'); } if (!LISTENERS[eventName]) { LISTENERS[eventName] = []; } // Don't register the same callback more than once if (!inArray(callback, LISTENERS[eventName])) { LISTENERS[eventName].push(callback); } } var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function commonjsRequire (path) { throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } var promisePolyfill = {exports: {}}; (function () { /** @suppress {undefinedVars} */ var globalNS = function () { // the only reliable means to get the global object is // `Function('return this')()` // However, this causes CSP violations in Chrome apps. if (typeof globalThis !== 'undefined') { return globalThis; } if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof commonjsGlobal !== 'undefined') { return commonjsGlobal; } throw new Error('unable to locate global object'); }(); // Expose the polyfill if Promise is undefined or set to a // non-function value. The latter can be due to a named HTMLElement // being exposed by browsers for legacy reasons. // https://github.com/taylorhakes/promise-polyfill/issues/114 if (typeof globalNS['Promise'] === 'function') { promisePolyfill.exports = globalNS['Promise']; return; } /** * @this {Promise} */ function finallyConstructor(callback) { var constructor = this.constructor; return this.then(function (value) { // @ts-ignore return constructor.resolve(callback()).then(function () { return value; }); }, function (reason) { // @ts-ignore return constructor.resolve(callback()).then(function () { // @ts-ignore return constructor.reject(reason); }); }); } function allSettled(arr) { var P = this; return new P(function (resolve, reject) { if (!(arr && typeof arr.length !== 'undefined')) { return reject(new TypeError(_typeof(arr) + ' ' + arr + ' is not iterable(cannot read property Symbol(Symbol.iterator))')); } var args = Array.prototype.slice.call(arr); if (args.length === 0) return resolve([]); var remaining = args.length; function res(i, val) { if (val && (_typeof(val) === 'object' || typeof val === 'function')) { var then = val.then; if (typeof then === 'function') { then.call(val, function (val) { res(i, val); }, function (e) { args[i] = { status: 'rejected', reason: e }; if (--remaining === 0) { resolve(args); } }); return; } } args[i] = { status: 'fulfilled', value: val }; if (--remaining === 0) { resolve(args); } } for (var i = 0; i < args.length; i++) { res(i, args[i]); } }); } // Store setTimeout reference so promise-polyfill will be unaffected by // other code modifying setTimeout (like sinon.useFakeTimers()) var setTimeoutFunc = setTimeout; function isArray(x) { return Boolean(x && typeof x.length !== 'undefined'); } function noop() {} // Polyfill for Function.prototype.bind function bind(fn, thisArg) { return function () { fn.apply(thisArg, arguments); }; } /** * @constructor * @param {Function} fn */ function Promise(fn) { if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new'); if (typeof fn !== 'function') throw new TypeError('not a function'); /** @type {!number} */ this._state = 0; /** @type {!boolean} */ this._handled = false; /** @type {Promise|undefined} */ this._value = undefined; /** @type {!Array} */ this._deferreds = []; doResolve(fn, this); } function handle(self, deferred) { while (self._state === 3) { self = self._value; } if (self._state === 0) { self._deferreds.push(deferred); return; } self._handled = true; Promise._immediateFn(function () { var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; if (cb === null) { (self._state === 1 ? resolve : reject)(deferred.promise, self._value); return; } var ret; try { ret = cb(self._value); } catch (e) { reject(deferred.promise, e); return; } resolve(deferred.promise, ret); }); } function resolve(self, newValue) { try { // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.'); if (newValue && (_typeof(newValue) === 'object' || typeof newValue === 'function')) { var then = newValue.then; if (newValue instanceof Promise) { self._state = 3; self._value = newValue; finale(self); return; } else if (typeof then === 'function') { doResolve(bind(then, newValue), self); return; } } self._state = 1; self._value = newValue; finale(self); } catch (e) { reject(self, e); } } function reject(self, newValue) { self._state = 2; self._value = newValue; finale(self); } function finale(self) { if (self._state === 2 && self._deferreds.length === 0) { Promise._immediateFn(function () { if (!self._handled) { Promise._unhandledRejectionFn(self._value); } }); } for (var i = 0, len = self._deferreds.length; i < len; i++) { handle(self, self._deferreds[i]); } self._deferreds = null; } /** * @constructor */ function Handler(onFulfilled, onRejected, promise) { this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; this.onRejected = typeof onRejected === 'function' ? onRejected : null; this.promise = promise; } /** * Take a potentially misbehaving resolver function and make sure * onFulfilled and onRejected are only called once. * * Makes no guarantees about asynchrony. */ function doResolve(fn, self) { var done = false; try { fn(function (value) { if (done) return; done = true; resolve(self, value); }, function (reason) { if (done) return; done = true; reject(self, reason); }); } catch (ex) { if (done) return; done = true; reject(self, ex); } } Promise.prototype['catch'] = function (onRejected) { return this.then(null, onRejected); }; Promise.prototype.then = function (onFulfilled, onRejected) { // @ts-ignore var prom = new this.constructor(noop); handle(this, new Handler(onFulfilled, onRejected, prom)); return prom; }; Promise.prototype['finally'] = finallyConstructor; Promise.all = function (arr) { return new Promise(function (resolve, reject) { if (!isArray(arr)) { return reject(new TypeError('Promise.all accepts an array')); } var args = Array.prototype.slice.call(arr); if (args.length === 0) return resolve([]); var remaining = args.length; function res(i, val) { try { if (val && (_typeof(val) === 'object' || typeof val === 'function')) { var then = val.then; if (typeof then === 'function') { then.call(val, function (val) { res(i, val); }, reject); return; } } args[i] = val; if (--remaining === 0) { resolve(args); } } catch (ex) { reject(ex); } } for (var i = 0; i < args.length; i++) { res(i, args[i]); } }); }; Promise.allSettled = allSettled; Promise.resolve = function (value) { if (value && _typeof(value) === 'object' && value.constructor === Promise) { return value; } return new Promise(function (resolve) { resolve(value); }); }; Promise.reject = function (value) { return new Promise(function (resolve, reject) { reject(value); }); }; Promise.race = function (arr) { return new Promise(function (resolve, reject) { if (!isArray(arr)) { return reject(new TypeError('Promise.race accepts an array')); } for (var i = 0, len = arr.length; i < len; i++) { Promise.resolve(arr[i]).then(resolve, reject); } }); }; // Use polyfill for setImmediate for performance gains Promise._immediateFn = // @ts-ignore typeof setImmediate === 'function' && function (fn) { // @ts-ignore setImmediate(fn); } || function (fn) { setTimeoutFunc(fn, 0); }; Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { if (typeof console !== 'undefined' && console) { console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console } }; promisePolyfill.exports = Promise; })(); var _Promise = promisePolyfill.exports; // Register logging callbacks function registerLoggingCallbacks(obj) { var callbackNames = ['begin', 'done', 'log', 'testStart', 'testDone', 'moduleStart', 'moduleDone']; function registerLoggingCallback(key) { return function loggingCallback(callback) { if (typeof callback !== 'function') { throw new Error('Callback parameter must be a function'); } config.callbacks[key].push(callback); }; } for (var i = 0; i < callbackNames.length; i++) { var key = callbackNames[i]; // Initialize key collection of logging callback if (typeof config.callbacks[key] === 'undefined') { config.callbacks[key] = []; } obj[key] = registerLoggingCallback(key); } } function runLoggingCallbacks(key, args) { var callbacks = config.callbacks[key]; // Handling 'log' callbacks separately. Unlike the other callbacks, // the log callback is not controlled by the processing queue, // but rather used by asserts. Hence to promisfy the 'log' callback // would mean promisfying each step of a test if (key === 'log') { callbacks.map(function (callback) { return callback(args); }); return; } // ensure that each callback is executed serially var promiseChain = _Promise.resolve(); callbacks.forEach(function (callback) { promiseChain = promiseChain.then(function () { return _Promise.resolve(callback(args)); }); }); return promiseChain; } var priorityCount = 0; var unitSampler; // This is a queue of functions that are tasks within a single test. // After tests are dequeued from config.queue they are expanded into // a set of tasks in this queue. var taskQueue = []; /** * Advances the taskQueue to the next task. If the taskQueue is empty, * process the testQueue */ function advance() { advanceTaskQueue(); if (!taskQueue.length && !config.blocking && !config.current) { advanceTestQueue(); } } /** * Advances the taskQueue with an increased depth */ function advanceTaskQueue() { var start = performance.now(); config.depth = (config.depth || 0) + 1; processTaskQueue(start); config.depth--; } /** * Process the first task on the taskQueue as a promise. * Each task is a function added by Test#queue() in /src/test.js */ function processTaskQueue(start) { if (taskQueue.length && !config.blocking) { var elapsedTime = performance.now() - start; // The updateRate ensures that a user interface (HTML Reporter) can be updated // at least once every second. This can also prevent browsers from prompting // a warning about long running scripts. if (!setTimeout$1 || config.updateRate <= 0 || elapsedTime < config.updateRate) { var task = taskQueue.shift(); _Promise.resolve(task()).then(function () { if (!taskQueue.length) { advance(); } else { processTaskQueue(start); } }); } else { setTimeout$1(advance); } } } /** * Advance the testQueue to the next test to process. Call done() if testQueue completes. */ function advanceTestQueue() { if (!config.blocking && !config.queue.length && config.depth === 0) { done(); return; } var testTasks = config.queue.shift(); addToTaskQueue(testTasks()); if (priorityCount > 0) { priorityCount--; } advance(); } /** * Enqueue the tasks for a test into the task queue. * @param {Array} tasksArray */ function addToTaskQueue(tasksArray) { taskQueue.push.apply(taskQueue, _toConsumableArray(tasksArray)); } /** * Return the number of tasks remaining in the task queue to be processed. * @return {number} */ function taskQueueLength() { return taskQueue.length; } /** * Adds a test to the TestQueue for execution. * @param {Function} testTasksFunc * @param {boolean} prioritize * @param {string} seed */ function addToTestQueue(testTasksFunc, prioritize, seed) { if (prioritize) { config.queue.splice(priorityCount++, 0, testTasksFunc); } else if (seed) { if (!unitSampler) { unitSampler = unitSamplerGenerator(seed); } // Insert into a random position after all prioritized items var index = Math.floor(unitSampler() * (config.queue.length - priorityCount + 1)); config.queue.splice(priorityCount + index, 0, testTasksFunc); } else { config.queue.push(testTasksFunc); } } /** * Creates a seeded "sample" generator which is used for randomizing tests. */ function unitSamplerGenerator(seed) { // 32-bit xorshift, requires only a nonzero seed // https://excamera.com/sphinx/article-xorshift.html var sample = parseInt(generateHash(seed), 16) || -1; return function () { sample ^= sample << 13; sample ^= sample >>> 17; sample ^= sample << 5; // ECMAScript has no unsigned number type if (sample < 0) { sample += 0x100000000; } return sample / 0x100000000; }; } /** * This function is called when the ProcessingQueue is done processing all * items. It handles emitting the final run events. */ function done() { // We have reached the end of the processing queue and are about to emit the // "runEnd" event after which reporters typically stop listening and exit // the process. First, check if we need to emit one final test. if (config.stats.testCount === 0 && config.failOnZeroTests === true) { var error; if (config.filter && config.filter.length) { error = new Error("No tests matched the filter \"".concat(config.filter, "\".")); } else if (config.module && config.module.length) { error = new Error("No tests matched the module \"".concat(config.module, "\".")); } else if (config.moduleId && config.moduleId.length) { error = new Error("No tests matched the moduleId \"".concat(config.moduleId, "\".")); } else if (config.testId && config.testId.length) { error = new Error("No tests matched the testId \"".concat(config.testId, "\".")); } else { error = new Error('No tests were run.'); } test('global failure', extend(function (assert) { assert.pushResult({ result: false, message: error.message, source: error.stack }); }, { validTest: true })); // We do need to call `advance()` in order to resume the processing queue. // Once this new test is finished processing, we'll reach `done` again, and // that time the above condition will evaluate to false. advance(); return; } var storage = config.storage; var runtime = Math.round(performance.now() - config.started); var passed = config.stats.all - config.stats.bad; ProcessingQueue.finished = true; emit('runEnd', runSuite.end(true)); runLoggingCallbacks('done', { // @deprecated since 2.19.0 Use done() without `details` parameter, // or use `QUnit.on('runEnd')` instead. Parameter to be replaced in // QUnit 3.0 with test counts. passed: passed, failed: config.stats.bad, total: config.stats.all, runtime: runtime }).then(function () { // Clear own storage items if all tests passed if (storage && config.stats.bad === 0) { for (var i = storage.length - 1; i >= 0; i--) { var key = storage.key(i); if (key.indexOf('qunit-test-') === 0) { storage.removeItem(key); } } } }); } var ProcessingQueue = { finished: false, add: addToTestQueue, advance: advance, taskCount: taskQueueLength }; var TestReport = /*#__PURE__*/function () { function TestReport(name, suite, options) { _classCallCheck(this, TestReport); this.name = name; this.suiteName = suite.name; this.fullName = suite.fullName.concat(name); this.runtime = 0; this.assertions = []; this.skipped = !!options.skip; this.todo = !!options.todo; this.valid = options.valid; this._startTime = 0; this._endTime = 0; suite.pushTest(this); } _createClass(TestReport, [{ key: "start", value: function start(recordTime) { if (recordTime) { this._startTime = performance.now(); performance.mark('qunit_test_start'); } return { name: this.name, suiteName: this.suiteName, fullName: this.fullName.slice() }; } }, { key: "end", value: function end(recordTime) { if (recordTime) { this._endTime = performance.now(); if (performance) { performance.mark('qunit_test_end'); var testName = this.fullName.join(' – '); performance.measure("QUnit Test: ".concat(testName), 'qunit_test_start', 'qunit_test_end'); } } return extend(this.start(), { runtime: this.getRuntime(), status: this.getStatus(), errors: this.getFailedAssertions(), assertions: this.getAssertions() }); } }, { key: "pushAssertion", value: function pushAssertion(assertion) { this.assertions.push(assertion); } }, { key: "getRuntime", value: function getRuntime() { return Math.round(this._endTime - this._startTime); } }, { key: "getStatus", value: function getStatus() { if (this.skipped) { return 'skipped'; } var testPassed = this.getFailedAssertions().length > 0 ? this.todo : !this.todo; if (!testPassed) { return 'failed'; } else if (this.todo) { return 'todo'; } else { return 'passed'; } } }, { key: "getFailedAssertions", value: function getFailedAssertions() { return this.assertions.filter(function (assertion) { return !assertion.passed; }); } }, { key: "getAssertions", value: function getAssertions() { return this.assertions.slice(); } // Remove actual and expected values from assertions. This is to prevent // leaking memory throughout a test suite. }, { key: "slimAssertions", value: function slimAssertions() { this.assertions = this.assertions.map(function (assertion) { delete assertion.actual; delete assertion.expected; return assertion; }); } }]); return TestReport; }(); function Test(settings) { this.expected = null; this.assertions = []; this.module = config.currentModule; this.steps = []; this.timeout = undefined; this.data = undefined; this.withData = false; this.pauses = new StringMap(); this.nextPauseId = 1; // For the most common case, we have: // - 0: new Test // - 1: addTest // - 2: QUnit.test // - 3: user file // // This needs is customised by test.each() this.stackOffset = 3; extend(this, settings); // If a module is skipped, all its tests and the tests of the child suites // should be treated as skipped even if they are defined as `only` or `todo`. // As for `todo` module, all its tests will be treated as `todo` except for // tests defined as `skip` which will be left intact. // // So, if a test is defined as `todo` and is inside a skipped module, we should // then treat that test as if was defined as `skip`. if (this.module.skip) { this.skip = true; this.todo = false; // Skipped tests should be left intact } else if (this.module.todo && !this.skip) { this.todo = true; } // Queuing a late test after the run has ended is not allowed. // This was once supported for internal use by QUnit.onError(). // Ref https://github.com/qunitjs/qunit/issues/1377 if (ProcessingQueue.finished) { // Using this for anything other than onError(), such as testing in QUnit.done(), // is unstable and will likely result in the added tests being ignored by CI. // (Meaning the CI passes irregardless of the added tests). // // TODO: Make this an error in QUnit 3.0 // throw new Error( "Unexpected test after runEnd" ); Logger.warn('Unexpected test after runEnd. This is unstable and will fail in QUnit 3.0.'); return; } if (!this.skip && typeof this.callback !== 'function') { var method = this.todo ? 'QUnit.todo' : 'QUnit.test'; throw new TypeError("You must provide a callback to ".concat(method, "(\"").concat(this.testName, "\")")); } // Register unique strings for (var i = 0, l = this.module.tests; i < l.length; i++) { if (this.module.tests[i].name === this.testName) { this.testName += ' '; } } this.testId = generateHash(this.module.name, this.testName); // No validation after this. Beyond this point, failures must be recorded as // a completed test with errors, instead of early bail out. // Otherwise, internals may be left in an inconsistent state. // Ref https://github.com/qunitjs/qunit/issues/1514 ++Test.count; this.errorForStack = new Error(); if (this.callback && this.callback.validTest) { // Omit the test-level trace for the internal "No tests" test failure, // There is already an assertion-level trace, and that's noisy enough // as it is. this.errorForStack.stack = undefined; } this.testReport = new TestReport(this.testName, this.module.suiteReport, { todo: this.todo, skip: this.skip, valid: this.valid() }); this.module.tests.push({ name: this.testName, testId: this.testId, skip: !!this.skip }); if (this.skip) { // Skipped tests will fully ignore any sent callback this.callback = function () {}; this.async = false; this.expected = 0; } else { this.assert = new Assert(this); } } Test.count = 0; function getNotStartedModules(startModule) { var module = startModule; var modules = []; while (module && module.testsRun === 0) { modules.push(module); module = module.parentModule; } // The above push modules from the child to the parent // return a reversed order with the top being the top most parent module return modules.reverse(); } Test.prototype = { // Use a getter to avoid computing a stack trace (which can be expensive), // This is displayed by the HTML Reporter, but most other integrations do // not access it. get stack() { return extractStacktrace(this.errorForStack, this.stackOffset); }, before: function before() { var _this = this; var module = this.module; var notStartedModules = getNotStartedModules(module); // ensure the callbacks are executed serially for each module var moduleStartChain = _Promise.resolve(); notStartedModules.forEach(function (startModule) { moduleStartChain = moduleStartChain.then(function () { startModule.stats = { all: 0, bad: 0, started: performance.now() }; emit('suiteStart', startModule.suiteReport.start(true)); return runLoggingCallbacks('moduleStart', { name: startModule.name, tests: startModule.tests }); }); }); return moduleStartChain.then(function () { config.current = _this; _this.testEnvironment = extend({}, module.testEnvironment); _this.started = performance.now(); emit('testStart', _this.testReport.start(true)); return runLoggingCallbacks('testStart', { name: _this.testName, module: module.name, testId: _this.testId, previousFailure: _this.previousFailure }).then(function () { if (!config.pollution) { saveGlobal(); } }); }); }, run: function run() { config.current = this; if (config.notrycatch) { runTest(this); return; } try { runTest(this); } catch (e) { this.pushFailure('Died on test #' + (this.assertions.length + 1) + ': ' + (e.message || e) + '\n' + this.stack, extractStacktrace(e, 0)); // Else next test will carry the responsibility saveGlobal(); // Restart the tests if they're blocking if (config.blocking) { internalRecover(this); } } function runTest(test) { var promise; if (test.withData) { promise = test.callback.call(test.testEnvironment, test.assert, test.data); } else { promise = test.callback.call(test.testEnvironment, test.assert); } test.resolvePromise(promise); // If the test has an async "pause" on it, but the timeout is 0, then we push a // failure as the test should be synchronous. if (test.timeout === 0 && test.pauses.size > 0) { pushFailure('Test did not finish synchronously even though assert.timeout( 0 ) was used.', sourceFromStacktrace(2)); } } }, after: function after() { checkPollution(); }, queueGlobalHook: function queueGlobalHook(hook, hookName) { var _this2 = this; var runHook = function runHook() { config.current = _this2; var promise; if (config.notrycatch) { promise = hook.call(_this2.testEnvironment, _this2.assert); } else { try { promise = hook.call(_this2.testEnvironment, _this2.assert); } catch (error) { _this2.pushFailure('Global ' + hookName + ' failed on ' + _this2.testName + ': ' + errorString(error), extractStacktrace(error, 0)); return; } } _this2.resolvePromise(promise, hookName); }; return runHook; }, queueHook: function queueHook(hook, hookName, hookOwner) { var _this3 = this; var callHook = function callHook() { var promise = hook.call(_this3.testEnvironment, _this3.assert); _this3.resolvePromise(promise, hookName); }; var runHook = function runHook() { if (hookName === 'before') { if (hookOwner.testsRun !== 0) { return; } _this3.preserveEnvironment = true; } // The 'after' hook should only execute when there are not tests left and // when the 'after' and 'finish' tasks are the only tasks left to process if (hookName === 'after' && !lastTestWithinModuleExecuted(hookOwner) && (config.queue.length > 0 || ProcessingQueue.taskCount() > 2)) { return; } config.current = _this3; if (config.notrycatch) { callHook(); return; } try { // This try-block includes the indirect call to resolvePromise, which shouldn't // have to be inside try-catch. But, since we support any user-provided thenable // object, the thenable might throw in some unexpected way. // This subtle behaviour is undocumented. To avoid new failures in minor releases // we will not change this until QUnit 3. // TODO: In QUnit 3, reduce this try-block to just hook.call(), matching // the simplicity of queueGlobalHook. callHook(); } catch (error) { _this3.pushFailure(hookName + ' failed on ' + _this3.testName + ': ' + (error.message || error), extractStacktrace(error, 0)); } }; return runHook; }, // Currently only used for module level hooks, can be used to add global level ones hooks: function hooks(handler) { var hooks = []; function processGlobalhooks(test) { if ((handler === 'beforeEach' || handler === 'afterEach') && config.globalHooks[handler]) { for (var i = 0; i < config.globalHooks[handler].length; i++) { hooks.push(test.queueGlobalHook(config.globalHooks[handler][i], handler)); } } } function processHooks(test, module) { if (module.parentModule) { processHooks(test, module.parentModule); } if (module.hooks[handler].length) { for (var i = 0; i < module.hooks[handler].length; i++) { hooks.push(test.queueHook(module.hooks[handler][i], handler, module)); } } } // Hooks are ignored on skipped tests if (!this.skip) { processGlobalhooks(this); processHooks(this, this.module); } return hooks; }, finish: function finish() { config.current = this; // Release the test callback to ensure that anything referenced has been // released to be garbage collected. this.callback = undefined; if (this.steps.length) { var stepsList = this.steps.join(', '); this.pushFailure('Expected assert.verifySteps() to be called before end of test ' + "after using assert.step(). Unverified steps: ".concat(stepsList), this.stack); } if (config.requireExpects && this.expected === null) { this.pushFailure('Expected number of assertions to be defined, but expect() was ' + 'not called.', this.stack); } else if (this.expected !== null && this.expected !== this.assertions.length) { this.pushFailure('Expected ' + this.expected + ' assertions, but ' + this.assertions.length + ' were run', this.stack); } else if (this.expected === null && !this.assertions.length) { this.pushFailure('Expected at least one assertion, but none were run - call ' + 'expect(0) to accept zero assertions.', this.stack); } var module = this.module; var moduleName = module.name; var testName = this.testName; var skipped = !!this.skip; var todo = !!this.todo; var bad = 0; var storage = config.storage; this.runtime = Math.round(performance.now() - this.started); config.stats.all += this.assertions.length; config.stats.testCount += 1; module.stats.all += this.assertions.length; for (var i = 0; i < this.assertions.length; i++) { // A failing assertion will counts toward the HTML Reporter's // "X assertions, Y failed" line even if it was inside a todo. // Inverting this would be similarly confusing since all but the last // passing assertion inside a todo test should be considered as good. // These stats don't decide the outcome of anything, so counting them // as failing seems the most intuitive. if (!this.assertions[i].result) { bad++; config.stats.bad++; module.stats.bad++; } } if (skipped) { incrementTestsIgnored(module); } else { incrementTestsRun(module); } // Store result when possible. // Note that this also marks todo tests as bad, thus they get hoisted, // and always run first on refresh. if (storage) { if (bad) { storage.setItem('qunit-test-' + moduleName + '-' + testName, bad); } else { storage.removeItem('qunit-test-' + moduleName + '-' + testName); } } // After emitting the js-reporters event we cleanup the assertion data to // avoid leaking it. It is not used by the legacy testDone callbacks. emit('testEnd', this.testReport.end(true)); this.testReport.slimAssertions(); var test = this; return runLoggingCallbacks('testDone', { name: testName, module: moduleName, skipped: skipped, todo: todo, failed: bad, passed: this.assertions.length - bad, total: this.assertions.length, runtime: skipped ? 0 : this.runtime, // HTML Reporter use assertions: this.assertions, testId: this.testId, // Source of Test // generating stack trace is expensive, so using a getter will help defer this until we need it get source() { return test.stack; } }).then(function () { if (allTestsExecuted(module)) { var completedModules = [module]; // Check if the parent modules, iteratively, are done. If that the case, // we emit the `suiteEnd` event and trigger `moduleDone` callback. var parent = module.parentModule; while (parent && allTestsExecuted(parent)) { completedModules.push(parent); parent = parent.parentModule; } var moduleDoneChain = _Promise.resolve(); completedModules.forEach(function (completedModule) { moduleDoneChain = moduleDoneChain.then(function () { return logSuiteEnd(completedModule); }); }); return moduleDoneChain; } }).then(function () { config.current = undefined; }); function logSuiteEnd(module) { // Reset `module.hooks` to ensure that anything referenced in these hooks // has been released to be garbage collected. Descendant modules that were // entirely skipped, e.g. due to filtering, will never have this method // called for them, but might have hooks with references pinning data in // memory (even if the hooks weren't actually executed), so we reset the // hooks on all descendant modules here as well. This is safe because we // will never call this as long as any descendant modules still have tests // to run. This also means that in multi-tiered nesting scenarios we might // reset the hooks multiple times on some modules, but that's harmless. var modules = [module]; while (modules.length) { var nextModule = modules.shift(); nextModule.hooks = {}; modules.push.apply(modules, _toConsumableArray(nextModule.childModules)); } emit('suiteEnd', module.suiteReport.end(true)); return runLoggingCallbacks('moduleDone', { name: module.name, tests: module.tests, failed: module.stats.bad, passed: module.stats.all - module.stats.bad, total: module.stats.all, runtime: Math.round(performance.now() - module.stats.started) }); } }, preserveTestEnvironment: function preserveTestEnvironment() { if (this.preserveEnvironment) { this.module.testEnvironment = this.testEnvironment; this.testEnvironment = extend({}, this.module.testEnvironment); } }, queue: function queue() { var test = this; if (!this.valid()) { incrementTestsIgnored(this.module); return; } function runTest() { return [function () { return test.before(); }].concat(_toConsumableArray(test.hooks('before')), [function () { test.preserveTestEnvironment(); }], _toConsumableArray(test.hooks('beforeEach')), [function () { test.run(); }], _toConsumableArray(test.hooks('afterEach').reverse()), _toConsumableArray(test.hooks('after').reverse()), [function () { test.after(); }, function () { return test.finish(); }]); } var previousFailCount = config.storage && +config.storage.getItem('qunit-test-' + this.module.name + '-' + this.testName); // Prioritize previously failed tests, detected from storage var prioritize = config.reorder && !!previousFailCount; this.previousFailure = !!previousFailCount; ProcessingQueue.add(runTest, prioritize, config.seed); }, pushResult: function pushResult(resultInfo) { if (this !== config.current) { var message = resultInfo && resultInfo.message || ''; var testName = this && this.testName || ''; var error = 'Assertion occurred after test finished.\n' + '> Test: ' + testName + '\n' + '> Message: ' + message + '\n'; throw new Error(error); } // Destructure of resultInfo = { result, actual, expected, message, negative } var details = { module: this.module.name, name: this.testName, result: resultInfo.result, message: resultInfo.message, actual: resultInfo.actual, testId: this.testId, negative: resultInfo.negative || false, runtime: Math.round(performance.now() - this.started), todo: !!this.todo }; if (hasOwn$1.call(resultInfo, 'expected')) { details.expected = resultInfo.expected; } if (!resultInfo.result) { var source = resultInfo.source || sourceFromStacktrace(); if (source) { details.source = source; } } this.logAssertion(details); this.assertions.push({ result: !!resultInfo.result, message: resultInfo.message }); }, pushFailure: function pushFailure(message, source, actual) { if (!(this instanceof Test)) { throw new Error('pushFailure() assertion outside test context, was ' + sourceFromStacktrace(2)); } this.pushResult({ result: false, message: message || 'error', actual: actual || null, source: source }); }, /** * Log assertion details using both the old QUnit.log interface and * QUnit.on( "assertion" ) interface. * * @private */ logAssertion: function logAssertion(details) { runLoggingCallbacks('log', details); var assertion = { passed: details.result, actual: details.actual, expected: details.expected, message: details.message, stack: details.source, todo: details.todo }; this.testReport.pushAssertion(assertion); emit('assertion', assertion); }, /** * Reset config.timeout with a new timeout duration. * * @param {number} timeoutDuration */ internalResetTimeout: function internalResetTimeout(timeoutDuration) { clearTimeout(config.timeout); config.timeout = setTimeout$1(config.timeoutHandler(timeoutDuration), timeoutDuration); }, /** * Create a new async pause and return a new function that can release the pause. * * This mechanism is internally used by: * * - explicit async pauses, created by calling `assert.async()`, * - implicit async pauses, created when `QUnit.test()` or module hook callbacks * use async-await or otherwise return a Promise. * * Happy scenario: * * - Pause is created by calling internalStop(). * * Pause is released normally by invoking release() during the same test. * * The release() callback lets internal processing resume. * * Failure scenarios: * * - The test fails due to an uncaught exception. * * In this case, Test.run() will call internalRecover() which empties the clears all * async pauses and sets the cancelled flag, which means we silently ignore any * late calls to the resume() callback, as we will have moved on to a different * test by then, and we don't want to cause an extra "release during a different test" * errors that the developer isn't really responsible for. This can happen when a test * correctly schedules a call to release(), but also causes an uncaught error. The * uncaught error means we will no longer wait for the release (as it might not arrive). * * - Pause is never released, or called an insufficient number of times. * * Our timeout handler will kill the pause and resume test processing, basically * like internalRecover(), but for one pause instead of any/all. * * Here, too, any late calls to resume() will be silently ignored to avoid * extra errors. We tolerate this since the original test will have already been * marked as failure. * * TODO: QUnit 3 will enable timeouts by default , * but right now a test will hang indefinitely if async pauses are not released, * unless QUnit.config.testTimeout or assert.timeout() is used. * * - Pause is spontaneously released during a different test, * or when no test is currently running. * * This is close to impossible because this error only happens if the original test * succesfully finished first (since other failure scenarios kill pauses and ignore * late calls). It can happen if a test ended exactly as expected, but has some * external or shared state continuing to hold a reference to the release callback, * and either the same test scheduled another call to it in the future, or a later test * causes it to be called through some shared state. * * - Pause release() is called too often, during the same test. * * This simply throws an error, after which uncaught error handling picks it up * and processing resumes. * * @param {number} [requiredCalls=1] */ internalStop: function internalStop() { var requiredCalls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; config.blocking = true; var test = this; var pauseId = this.nextPauseId++; var pause = { cancelled: false, remaining: requiredCalls }; test.pauses.set(pauseId, pause); function release() { if (pause.cancelled) { return; } if (config.current === undefined) { throw new Error('Unexpected release of async pause after tests finished.\n' + "> Test: ".concat(test.testName, " [async #").concat(pauseId, "]")); } if (config.current !== test) { throw new Error('Unexpected release of async pause during a different test.\n' + "> Test: ".concat(test.testName, " [async #").concat(pauseId, "]")); } if (pause.remaining <= 0) { throw new Error('Tried to release async pause that was already released.\n' + "> Test: ".concat(test.testName, " [async #").concat(pauseId, "]")); } // The `requiredCalls` parameter exists to support `assert.async(count)` pause.remaining--; if (pause.remaining === 0) { test.pauses.delete(pauseId); } internalStart(test); } // Set a recovery timeout, if so configured. if (setTimeout$1) { var timeoutDuration; if (typeof test.timeout === 'number') { timeoutDuration = test.timeout; } else if (typeof config.testTimeout === 'number') { timeoutDuration = config.testTimeout; } if (typeof timeoutDuration === 'number' && timeoutDuration > 0) { config.timeoutHandler = function (timeout) { return function () { config.timeout = null; pause.cancelled = true; test.pauses.delete(pauseId); test.pushFailure("Test took longer than ".concat(timeout, "ms; test timed out."), sourceFromStacktrace(2)); internalStart(test); }; }; clearTimeout(config.timeout); config.timeout = setTimeout$1(config.timeoutHandler(timeoutDuration), timeoutDuration); } } return release; }, resolvePromise: function resolvePromise(promise, phase) { if (promise != null) { var _test = this; var then = promise.then; if (typeof then === 'function') { var resume = _test.internalStop(); var resolve = function resolve() { resume(); }; if (config.notrycatch) { then.call(promise, resolve); } else { var reject = function reject(error) { var message = 'Promise rejected ' + (!phase ? 'during' : phase.replace(/Each$/, '')) + ' "' + _test.testName + '": ' + (error && error.message || error); _test.pushFailure(message, extractStacktrace(error, 0)); // Else next test will carry the responsibility saveGlobal(); // Unblock internalRecover(_test); }; then.call(promise, resolve, reject); } } } }, valid: function valid() { // Internally-generated tests are always valid if (this.callback && this.callback.validTest) { return true; } function moduleChainIdMatch(testModule, selectedId) { return ( // undefined or empty array !selectedId || !selectedId.length || inArray(testModule.moduleId, selectedId) || testModule.parentModule && moduleChainIdMatch(testModule.parentModule, selectedId) ); } if (!moduleChainIdMatch(this.module, config.moduleId)) { return false; } if (config.testId && config.testId.length && !inArray(this.testId, config.testId)) { return false; } function moduleChainNameMatch(testModule, selectedModule) { if (!selectedModule) { // undefined or empty string return true; } var testModuleName = testModule.name ? testModule.name.toLowerCase() : null; if (testModuleName === selectedModule) { return true; } else if (testModule.parentModule) { return moduleChainNameMatch(testModule.parentModule, selectedModule); } else { return false; } } var selectedModule = config.module && config.module.toLowerCase(); if (!moduleChainNameMatch(this.module, selectedModule)) { return false; } var filter = config.filter; if (!filter) { return true; } var regexFilter = /^(!?)\/([\w\W]*)\/(i?$)/.exec(filter); var fullName = this.module.name + ': ' + this.testName; return regexFilter ? this.regexFilter(!!regexFilter[1], regexFilter[2], regexFilter[3], fullName) : this.stringFilter(filter, fullName); }, regexFilter: function regexFilter(exclude, pattern, flags, fullName) { var regex = new RegExp(pattern, flags); var match = regex.test(fullName); return match !== exclude; }, stringFilter: function stringFilter(filter, fullName) { filter = filter.toLowerCase(); fullName = fullName.toLowerCase(); var include = filter.charAt(0) !== '!'; if (!include) { filter = filter.slice(1); } // If the filter matches, we need to honour include if (fullName.indexOf(filter) !== -1) { return include; } // Otherwise, do the opposite return !include; } }; function pushFailure() { if (!config.current) { throw new Error('pushFailure() assertion outside test context, in ' + sourceFromStacktrace(2)); } // Gets current test obj var currentTest = config.current; return currentTest.pushFailure.apply(currentTest, arguments); } function saveGlobal() { config.pollution = []; if (config.noglobals) { for (var key in g) { if (hasOwn$1.call(g, key)) { // In Opera sometimes DOM element ids show up here, ignore them if (/^qunit-test-output/.test(key)) { continue; } config.pollution.push(key); } } } } function checkPollution() { var old = config.pollution; saveGlobal(); var newGlobals = diff(config.pollution, old); if (newGlobals.length > 0) { pushFailure('Introduced global variable(s): ' + newGlobals.join(', ')); } var deletedGlobals = diff(old, config.pollution); if (deletedGlobals.length > 0) { pushFailure('Deleted global variable(s): ' + deletedGlobals.join(', ')); } } var focused = false; // indicates that the "only" filter was used function addTest(settings) { if (focused || config.currentModule.ignored) { return; } var newTest = new Test(settings); newTest.queue(); } function addOnlyTest(settings) { if (config.currentModule.ignored) { return; } if (!focused) { config.queue.length = 0; focused = true; } var newTest = new Test(settings); newTest.queue(); } // Will be exposed as QUnit.test function test(testName, callback) { addTest({ testName: testName, callback: callback }); } function makeEachTestName(testName, argument) { return "".concat(testName, " [").concat(argument, "]"); } function runEach(data, eachFn) { if (Array.isArray(data)) { for (var i = 0; i < data.length; i++) { eachFn(data[i], i); } } else if (_typeof(data) === 'object' && data !== null) { for (var key in data) { eachFn(data[key], key); } } else { throw new Error("test.each() expects an array or object as input, but\nfound ".concat(_typeof(data), " instead.")); } } extend(test, { todo: function todo(testName, callback) { addTest({ testName: testName, callback: callback, todo: true }); }, skip: function skip(testName) { addTest({ testName: testName, skip: true }); }, only: function only(testName, callback) { addOnlyTest({ testName: testName, callback: callback }); }, each: function each(testName, dataset, callback) { runEach(dataset, function (data, testKey) { addTest({ testName: makeEachTestName(testName, testKey), callback: callback, withData: true, stackOffset: 5, data: data }); }); } }); test.todo.each = function (testName, dataset, callback) { runEach(dataset, function (data, testKey) { addTest({ testName: makeEachTestName(testName, testKey), callback: callback, todo: true, withData: true, stackOffset: 5, data: data }); }); }; test.skip.each = function (testName, dataset) { runEach(dataset, function (_, testKey) { addTest({ testName: makeEachTestName(testName, testKey), stackOffset: 5, skip: true }); }); }; test.only.each = function (testName, dataset, callback) { runEach(dataset, function (data, testKey) { addOnlyTest({ testName: makeEachTestName(testName, testKey), callback: callback, withData: true, stackOffset: 5, data: data }); }); }; // Forcefully release all processing holds. function internalRecover(test) { test.pauses.forEach(function (pause) { pause.cancelled = true; }); test.pauses.clear(); internalStart(test); } // Release a processing hold, scheduling a resumption attempt if no holds remain. function internalStart(test) { // Ignore if other async pauses still exist. if (test.pauses.size > 0) { return; } // Add a slight delay to allow more assertions etc. if (setTimeout$1) { clearTimeout(config.timeout); config.timeout = setTimeout$1(function () { if (test.pauses.size > 0) { return; } clearTimeout(config.timeout); config.timeout = null; config.blocking = false; ProcessingQueue.advance(); }); } else { config.blocking = false; ProcessingQueue.advance(); } } function collectTests(module) { var tests = [].concat(module.tests); var modules = _toConsumableArray(module.childModules); // Do a breadth-first traversal of the child modules while (modules.length) { var nextModule = modules.shift(); tests.push.apply(tests, nextModule.tests); modules.push.apply(modules, _toConsumableArray(nextModule.childModules)); } return tests; } // This returns true after all executable and skippable tests // in a module have been proccessed, and informs 'suiteEnd' // and moduleDone(). function allTestsExecuted(module) { return module.testsRun + module.testsIgnored === collectTests(module).length; } // This returns true during the last executable non-skipped test // within a module, and informs the running of the 'after' hook // for a given module. This runs only once for a given module, // but must run during the last non-skipped test. When it runs, // there may be non-zero skipped tests left. function lastTestWithinModuleExecuted(module) { return module.testsRun === collectTests(module).filter(function (test) { return !test.skip; }).length - 1; } function incrementTestsRun(module) { module.testsRun++; while (module = module.parentModule) { module.testsRun++; } } function incrementTestsIgnored(module) { module.testsIgnored++; while (module = module.parentModule) { module.testsIgnored++; } } /* global module, exports, define */ function exportQUnit(QUnit) { var exportedModule = false; if (window$1 && document) { // QUnit may be defined when it is preconfigured but then only QUnit and QUnit.config may be defined. if (window$1.QUnit && window$1.QUnit.version) { throw new Error('QUnit has already been defined.'); } window$1.QUnit = QUnit; exportedModule = true; } // For Node.js if (typeof module !== 'undefined' && module && module.exports) { module.exports = QUnit; // For consistency with CommonJS environments' exports module.exports.QUnit = QUnit; exportedModule = true; } // For CommonJS with exports, but without module.exports, like Rhino if (typeof exports !== 'undefined' && exports) { exports.QUnit = QUnit; exportedModule = true; } // For AMD if (typeof define === 'function' && define.amd) { define(function () { return QUnit; }); QUnit.config.autostart = false; exportedModule = true; } // For other environments, including Web Workers (globalThis === self), // SpiderMonkey (mozjs), and other embedded JavaScript engines if (!exportedModule) { g.QUnit = QUnit; } } var ConsoleReporter = /*#__PURE__*/function () { function ConsoleReporter(runner) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; _classCallCheck(this, ConsoleReporter); // Cache references to console methods to ensure we can report failures // from tests tests that mock the console object itself. // https://github.com/qunitjs/qunit/issues/1340 // Support IE 9: Function#bind is supported, but no console.log.bind(). this.log = options.log || Function.prototype.bind.call(console$1.log, console$1); runner.on('error', this.onError.bind(this)); runner.on('runStart', this.onRunStart.bind(this)); runner.on('testStart', this.onTestStart.bind(this)); runner.on('testEnd', this.onTestEnd.bind(this)); runner.on('runEnd', this.onRunEnd.bind(this)); } _createClass(ConsoleReporter, [{ key: "onError", value: function onError(error) { this.log('error', error); } }, { key: "onRunStart", value: function onRunStart(runStart) { this.log('runStart', runStart); } }, { key: "onTestStart", value: function onTestStart(test) { this.log('testStart', test); } }, { key: "onTestEnd", value: function onTestEnd(test) { this.log('testEnd', test); } }, { key: "onRunEnd", value: function onRunEnd(runEnd) { this.log('runEnd', runEnd); } }], [{ key: "init", value: function init(runner, options) { return new ConsoleReporter(runner, options); } }]); return ConsoleReporter; }(); var FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY = true; if (typeof process !== 'undefined') { var _ref = process.env || {}; FORCE_COLOR = _ref.FORCE_COLOR; NODE_DISABLE_COLORS = _ref.NODE_DISABLE_COLORS; NO_COLOR = _ref.NO_COLOR; TERM = _ref.TERM; isTTY = process.stdout && process.stdout.isTTY; } var $ = { enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && (FORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY), // modifiers reset: init(0, 0), bold: init(1, 22), dim: init(2, 22), italic: init(3, 23), underline: init(4, 24), inverse: init(7, 27), hidden: init(8, 28), strikethrough: init(9, 29), // colors black: init(30, 39), red: init(31, 39), green: init(32, 39), yellow: init(33, 39), blue: init(34, 39), magenta: init(35, 39), cyan: init(36, 39), white: init(37, 39), gray: init(90, 39), grey: init(90, 39), // background colors bgBlack: init(40, 49), bgRed: init(41, 49), bgGreen: init(42, 49), bgYellow: init(43, 49), bgBlue: init(44, 49), bgMagenta: init(45, 49), bgCyan: init(46, 49), bgWhite: init(47, 49) }; function run(arr, str) { var i = 0, tmp, beg = '', end = ''; for (; i < arr.length; i++) { tmp = arr[i]; beg += tmp.open; end += tmp.close; if (!!~str.indexOf(tmp.close)) { str = str.replace(tmp.rgx, tmp.close + tmp.open); } } return beg + str + end; } function chain(has, keys) { var ctx = { has: has, keys: keys }; ctx.reset = $.reset.bind(ctx); ctx.bold = $.bold.bind(ctx); ctx.dim = $.dim.bind(ctx); ctx.italic = $.italic.bind(ctx); ctx.underline = $.underline.bind(ctx); ctx.inverse = $.inverse.bind(ctx); ctx.hidden = $.hidden.bind(ctx); ctx.strikethrough = $.strikethrough.bind(ctx); ctx.black = $.black.bind(ctx); ctx.red = $.red.bind(ctx); ctx.green = $.green.bind(ctx); ctx.yellow = $.yellow.bind(ctx); ctx.blue = $.blue.bind(ctx); ctx.magenta = $.magenta.bind(ctx); ctx.cyan = $.cyan.bind(ctx); ctx.white = $.white.bind(ctx); ctx.gray = $.gray.bind(ctx); ctx.grey = $.grey.bind(ctx); ctx.bgBlack = $.bgBlack.bind(ctx); ctx.bgRed = $.bgRed.bind(ctx); ctx.bgGreen = $.bgGreen.bind(ctx); ctx.bgYellow = $.bgYellow.bind(ctx); ctx.bgBlue = $.bgBlue.bind(ctx); ctx.bgMagenta = $.bgMagenta.bind(ctx); ctx.bgCyan = $.bgCyan.bind(ctx); ctx.bgWhite = $.bgWhite.bind(ctx); return ctx; } function init(open, close) { var blk = { open: "\x1B[".concat(open, "m"), close: "\x1B[".concat(close, "m"), rgx: new RegExp("\\x1b\\[".concat(close, "m"), 'g') }; return function (txt) { if (this !== void 0 && this.has !== void 0) { !!~this.has.indexOf(open) || (this.has.push(open), this.keys.push(blk)); return txt === void 0 ? this : $.enabled ? run(this.keys, txt + '') : txt + ''; } return txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt + '') : txt + ''; }; } var hasOwn = Object.prototype.hasOwnProperty; /** * Format a given value into YAML. * * YAML is a superset of JSON that supports all the same data * types and syntax, and more. As such, it is always possible * to fallback to JSON.stringfify, but we generally avoid * that to make output easier to read for humans. * * Supported data types: * * - null * - boolean * - number * - string * - array * - object * * Anything else (including NaN, Infinity, and undefined) * must be described in strings, for display purposes. * * Note that quotes are optional in YAML strings if the * strings are "simple", and as such we generally prefer * that for improved readability. We output strings in * one of three ways: * * - bare unquoted text, for simple one-line strings. * - JSON (quoted text), for complex one-line strings. * - YAML Block, for complex multi-line strings. * * Objects with cyclical references will be stringifed as * "[Circular]" as they cannot otherwise be represented. */ function prettyYamlValue(value) { var indent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4; if (value === undefined) { // Not supported in JSON/YAML, turn into string // and let the below output it as bare string. value = String(value); } // Support IE 9-11: Use isFinite instead of ES6 Number.isFinite if (typeof value === 'number' && !isFinite(value)) { // Turn NaN and Infinity into simple strings. // Paranoia: Don't return directly just in case there's // a way to add special characters here. value = String(value); } if (typeof value === 'number') { // Simple numbers return JSON.stringify(value); } if (typeof value === 'string') { // If any of these match, then we can't output it // as bare unquoted text, because that would either // cause data loss or invalid YAML syntax. // // - Quotes, escapes, line breaks, or JSON-like stuff. var rSpecialJson = /['"\\/[{}\]\r\n]/; // - Characters that are special at the start of a YAML value var rSpecialYaml = /[-?:,[\]{}#&*!|=>'"%@`]/; // - Leading or trailing whitespace. var rUntrimmed = /(^\s|\s$)/; // - Ambiguous as YAML number, e.g. '2', '-1.2', '.2', or '2_000' var rNumerical = /^[\d._-]+$/; // - Ambiguous as YAML bool. // Use case-insensitive match, although technically only // fully-lower, fully-upper, or uppercase-first would be ambiguous. // e.g. true/True/TRUE, but not tRUe. var rBool = /^(true|false|y|n|yes|no|on|off)$/i; // Is this a complex string? if (value === '' || rSpecialJson.test(value) || rSpecialYaml.test(value[0]) || rUntrimmed.test(value) || rNumerical.test(value) || rBool.test(value)) { if (!/\n/.test(value)) { // Complex one-line string, use JSON (quoted string) return JSON.stringify(value); } // See also // Support IE 9-11: Avoid ES6 String#repeat var prefix = new Array(indent + 1).join(' '); var trailingLinebreakMatch = value.match(/\n+$/); var trailingLinebreaks = trailingLinebreakMatch ? trailingLinebreakMatch[0].length : 0; if (trailingLinebreaks === 1) { // Use the most straight-forward "Block" string in YAML // without any "Chomping" indicators. var lines = value // Ignore the last new line, since we'll get that one for free // with the straight-forward Block syntax. .replace(/\n$/, '').split('\n').map(function (line) { return prefix + line; }); return '|\n' + lines.join('\n'); } else { // This has either no trailing new lines, or more than 1. // Use |+ so that YAML parsers will preserve it exactly. var _lines = value.split('\n').map(function (line) { return prefix + line; }); return '|+\n' + _lines.join('\n'); } } else { // Simple string, use bare unquoted text return value; } } // Handle null, boolean, array, and object return JSON.stringify(decycledShallowClone(value), null, 2); } /** * Creates a shallow clone of an object where cycles have * been replaced with "[Circular]". */ function decycledShallowClone(object) { var ancestors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; if (ancestors.indexOf(object) !== -1) { return '[Circular]'; } var type = Object.prototype.toString.call(object).replace(/^\[.+\s(.+?)]$/, '$1').toLowerCase(); var clone; switch (type) { case 'array': ancestors.push(object); clone = object.map(function (element) { return decycledShallowClone(element, ancestors); }); ancestors.pop(); break; case 'object': ancestors.push(object); clone = {}; Object.keys(object).forEach(function (key) { clone[key] = decycledShallowClone(object[key], ancestors); }); ancestors.pop(); break; default: clone = object; } return clone; } var TapReporter = /*#__PURE__*/function () { function TapReporter(runner) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; _classCallCheck(this, TapReporter); // Cache references to console methods to ensure we can report failures // from tests tests that mock the console object itself. // https://github.com/qunitjs/qunit/issues/1340 // Support IE 9: Function#bind is supported, but no console.log.bind(). this.log = options.log || Function.prototype.bind.call(console$1.log, console$1); this.testCount = 0; this.ended = false; this.bailed = false; runner.on('error', this.onError.bind(this)); runner.on('runStart', this.onRunStart.bind(this)); runner.on('testEnd', this.onTestEnd.bind(this)); runner.on('runEnd', this.onRunEnd.bind(this)); } _createClass(TapReporter, [{ key: "onRunStart", value: function onRunStart(_runSuite) { this.log('TAP version 13'); } }, { key: "onError", value: function onError(error) { if (this.bailed) { return; } this.bailed = true; // Imitate onTestEnd // Skip this if we're past "runEnd" as it would look odd if (!this.ended) { this.testCount = this.testCount + 1; this.log($.red("not ok ".concat(this.testCount, " global failure"))); this.logError(error); } this.log('Bail out! ' + errorString(error).split('\n')[0]); if (this.ended) { this.logError(error); } } }, { key: "onTestEnd", value: function onTestEnd(test) { var _this = this; this.testCount = this.testCount + 1; if (test.status === 'passed') { this.log("ok ".concat(this.testCount, " ").concat(test.fullName.join(' > '))); } else if (test.status === 'skipped') { this.log($.yellow("ok ".concat(this.testCount, " # SKIP ").concat(test.fullName.join(' > ')))); } else if (test.status === 'todo') { this.log($.cyan("not ok ".concat(this.testCount, " # TODO ").concat(test.fullName.join(' > ')))); test.errors.forEach(function (error) { return _this.logAssertion(error, 'todo'); }); } else { this.log($.red("not ok ".concat(this.testCount, " ").concat(test.fullName.join(' > ')))); test.errors.forEach(function (error) { return _this.logAssertion(error); }); } } }, { key: "onRunEnd", value: function onRunEnd(runSuite) { this.ended = true; this.log("1..".concat(runSuite.testCounts.total)); this.log("# pass ".concat(runSuite.testCounts.passed)); this.log($.yellow("# skip ".concat(runSuite.testCounts.skipped))); this.log($.cyan("# todo ".concat(runSuite.testCounts.todo))); this.log($.red("# fail ".concat(runSuite.testCounts.failed))); } }, { key: "logAssertion", value: function logAssertion(error, severity) { var out = ' ---'; out += "\n message: ".concat(prettyYamlValue(error.message || 'failed')); out += "\n severity: ".concat(prettyYamlValue(severity || 'failed')); if (hasOwn.call(error, 'actual')) { out += "\n actual : ".concat(prettyYamlValue(error.actual)); } if (hasOwn.call(error, 'expected')) { out += "\n expected: ".concat(prettyYamlValue(error.expected)); } if (error.stack) { // Since stacks aren't user generated, take a bit of liberty by // adding a trailing new line to allow a straight-forward YAML Blocks. out += "\n stack: ".concat(prettyYamlValue(error.stack + '\n')); } out += '\n ...'; this.log(out); } }, { key: "logError", value: function logError(error) { var out = ' ---'; out += "\n message: ".concat(prettyYamlValue(errorString(error))); out += "\n severity: ".concat(prettyYamlValue('failed')); if (error && error.stack) { out += "\n stack: ".concat(prettyYamlValue(error.stack + '\n')); } out += '\n ...'; this.log(out); } }], [{ key: "init", value: function init(runner, options) { return new TapReporter(runner, options); } }]); return TapReporter; }(); var reporters = { console: ConsoleReporter, tap: TapReporter }; function makeAddGlobalHook(hookName) { return function addGlobalHook(callback) { if (!config.globalHooks[hookName]) { config.globalHooks[hookName] = []; } config.globalHooks[hookName].push(callback); }; } var hooks = { beforeEach: makeAddGlobalHook('beforeEach'), afterEach: makeAddGlobalHook('afterEach') }; /** * Handle a global error that should result in a failed test run. * * Summary: * * - If we're strictly inside a test (or one if its module hooks), the exception * becomes a failed assertion. * * This has the important side-effect that uncaught exceptions (such as * calling an undefined function) during a "todo" test do NOT result in * a failed test run. * * - If we're anywhere outside a test (be it in early event callbacks, or * internally between tests, or somewhere after "runEnd" if the process is * still alive for some reason), then send an "error" event to the reporters. * * @since 2.17.0 * @param {Error|any} error */ function onUncaughtException(error) { if (config.current) { config.current.assert.pushResult({ result: false, message: "global failure: ".concat(errorString(error)), // We could let callers specify an offset to subtract a number of frames via // sourceFromStacktrace, in case they are a wrapper further away from the error // handler, and thus reduce some noise in the stack trace. However, we're not // doing this right now because it would almost never be used in practice given // the vast majority of error values will be Error objects, and thus have their // own stack trace already. source: error && error.stack || sourceFromStacktrace(2) }); } else { // The "error" event was added in QUnit 2.17. // Increase "bad assertion" stats despite no longer pushing an assertion in this case. // This ensures "runEnd" and "QUnit.done()" handlers behave as expected, since the "bad" // count is typically how reporters decide on the boolean outcome of the test run. runSuite.globalFailureCount++; config.stats.bad++; config.stats.all++; emit('error', error); } } /** * Handle a window.onerror error. * * If there is a current test that sets the internal `ignoreGlobalErrors` field * (such as during `assert.throws()`), then the error is ignored and native * error reporting is suppressed as well. This is because in browsers, an error * can sometimes end up in `window.onerror` instead of in the local try/catch. * This ignoring of errors does not apply to our general onUncaughtException * method, nor to our `unhandledRejection` handlers, as those are not meant * to receive an "expected" error during `assert.throws()`. * * @see * @deprecated since 2.17.0 Use QUnit.onUncaughtException instead. * @param {Object} details * @param {string} details.message * @param {string} details.fileName * @param {number} details.lineNumber * @param {string|undefined} [details.stacktrace] * @return {bool} True if native error reporting should be suppressed. */ function onWindowError(details) { Logger.warn('QUnit.onError is deprecated and will be removed in QUnit 3.0.' + ' Please use QUnit.onUncaughtException instead.'); if (config.current && config.current.ignoreGlobalErrors) { return true; } var err = new Error(details.message); err.stack = details.stacktrace || details.fileName + ':' + details.lineNumber; onUncaughtException(err); return false; } var QUnit = {}; // The "currentModule" object would ideally be defined using the createModule() // function. Since it isn't, add the missing suiteReport property to it now that // we have loaded all source code required to do so. // // TODO: Consider defining currentModule in core.js or module.js in its entirely // rather than partly in config.js and partly here. config.currentModule.suiteReport = runSuite; var globalStartCalled = false; var runStarted = false; // Figure out if we're running the tests from a server or not QUnit.isLocal = window$1 && window$1.location && window$1.location.protocol === 'file:'; // Expose the current QUnit version QUnit.version = '2.19.3'; extend(QUnit, { config: config, dump: dump, equiv: equiv, reporters: reporters, hooks: hooks, is: is, objectType: objectType, on: on, onError: onWindowError, onUncaughtException: onUncaughtException, pushFailure: pushFailure, assert: Assert.prototype, module: module$1, test: test, // alias other test flavors for easy access todo: test.todo, skip: test.skip, only: test.only, start: function start(count) { if (config.current) { throw new Error('QUnit.start cannot be called inside a test context.'); } var globalStartAlreadyCalled = globalStartCalled; globalStartCalled = true; if (runStarted) { throw new Error('Called start() while test already started running'); } if (globalStartAlreadyCalled || count > 1) { throw new Error('Called start() outside of a test context too many times'); } if (config.autostart) { throw new Error('Called start() outside of a test context when ' + 'QUnit.config.autostart was true'); } if (!config.pageLoaded) { // The page isn't completely loaded yet, so we set autostart and then // load if we're in Node or wait for the browser's load event. config.autostart = true; // Starts from Node even if .load was not previously called. We still return // early otherwise we'll wind up "beginning" twice. if (!document) { QUnit.load(); } return; } scheduleBegin(); }, onUnhandledRejection: function onUnhandledRejection(reason) { Logger.warn('QUnit.onUnhandledRejection is deprecated and will be removed in QUnit 3.0.' + ' Please use QUnit.onUncaughtException instead.'); onUncaughtException(reason); }, extend: function extend$1() { Logger.warn('QUnit.extend is deprecated and will be removed in QUnit 3.0.' + ' Please use Object.assign instead.'); // delegate to utility implementation, which does not warn and can be used elsewhere internally for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return extend.apply(this, args); }, load: function load() { config.pageLoaded = true; // Initialize the configuration options extend(config, { started: 0, updateRate: 1000, autostart: true, filter: '' }, true); if (!runStarted) { config.blocking = false; if (config.autostart) { scheduleBegin(); } } }, stack: function stack(offset) { offset = (offset || 0) + 2; return sourceFromStacktrace(offset); } }); registerLoggingCallbacks(QUnit); function scheduleBegin() { runStarted = true; // Add a slight delay to allow definition of more modules and tests. if (setTimeout$1) { setTimeout$1(function () { begin(); }); } else { begin(); } } function unblockAndAdvanceQueue() { config.blocking = false; ProcessingQueue.advance(); } function begin() { if (config.started) { unblockAndAdvanceQueue(); return; } // The test run hasn't officially begun yet // Record the time of the test run's beginning config.started = performance.now(); // Delete the loose unnamed module if unused. if (config.modules[0].name === '' && config.modules[0].tests.length === 0) { config.modules.shift(); } var modulesLog = []; for (var i = 0; i < config.modules.length; i++) { // Don't expose the unnamed global test module to plugins. if (config.modules[i].name !== '') { modulesLog.push({ name: config.modules[i].name, moduleId: config.modules[i].moduleId, // Added in QUnit 1.16.0 for internal use by html-reporter, // but no longer used since QUnit 2.7.0. // @deprecated Kept unofficially to be removed in QUnit 3.0. tests: config.modules[i].tests }); } } // The test run is officially beginning now emit('runStart', runSuite.start(true)); runLoggingCallbacks('begin', { totalTests: Test.count, modules: modulesLog }).then(unblockAndAdvanceQueue); } exportQUnit(QUnit); (function () { if (!window$1 || !document) { return; } var config = QUnit.config; var hasOwn = Object.prototype.hasOwnProperty; // Stores fixture HTML for resetting later function storeFixture() { // Avoid overwriting user-defined values if (hasOwn.call(config, 'fixture')) { return; } var fixture = document.getElementById('qunit-fixture'); if (fixture) { config.fixture = fixture.cloneNode(true); } } QUnit.begin(storeFixture); // Resets the fixture DOM element if available. function resetFixture() { if (config.fixture == null) { return; } var fixture = document.getElementById('qunit-fixture'); var resetFixtureType = _typeof(config.fixture); if (resetFixtureType === 'string') { // support user defined values for `config.fixture` var newFixture = document.createElement('div'); newFixture.setAttribute('id', 'qunit-fixture'); newFixture.innerHTML = config.fixture; fixture.parentNode.replaceChild(newFixture, fixture); } else { var clonedFixture = config.fixture.cloneNode(true); fixture.parentNode.replaceChild(clonedFixture, fixture); } } QUnit.testStart(resetFixture); })(); (function () { // Only interact with URLs via window.location var location = typeof window$1 !== 'undefined' && window$1.location; if (!location) { return; } var urlParams = getUrlParams(); QUnit.urlParams = urlParams; QUnit.config.filter = urlParams.filter; QUnit.config.module = urlParams.module; QUnit.config.moduleId = [].concat(urlParams.moduleId || []); QUnit.config.testId = [].concat(urlParams.testId || []); // Test order randomization if (urlParams.seed === true) { // Generate a random seed if the option is specified without a value QUnit.config.seed = Math.random().toString(36).slice(2); } else if (urlParams.seed) { QUnit.config.seed = urlParams.seed; } // Add URL-parameter-mapped config values with UI form rendering data QUnit.config.urlConfig.push({ id: 'hidepassed', label: 'Hide passed tests', tooltip: 'Only show tests and assertions that fail. Stored as query-strings.' }, { id: 'noglobals', label: 'Check for Globals', tooltip: 'Enabling this will test if any test introduces new properties on the ' + 'global object (`window` in Browsers). Stored as query-strings.' }, { id: 'notrycatch', label: 'No try-catch', tooltip: 'Enabling this will run tests outside of a try-catch block. Makes debugging ' + 'exceptions in IE reasonable. Stored as query-strings.' }); QUnit.begin(function () { var urlConfig = QUnit.config.urlConfig; for (var i = 0; i < urlConfig.length; i++) { // Options can be either strings or objects with nonempty "id" properties var option = QUnit.config.urlConfig[i]; if (typeof option !== 'string') { option = option.id; } if (QUnit.config[option] === undefined) { QUnit.config[option] = urlParams[option]; } } }); function getUrlParams() { var urlParams = Object.create(null); var params = location.search.slice(1).split('&'); var length = params.length; for (var i = 0; i < length; i++) { if (params[i]) { var param = params[i].split('='); var name = decodeQueryParam(param[0]); // Allow just a key to turn on a flag, e.g., test.html?noglobals var value = param.length === 1 || decodeQueryParam(param.slice(1).join('=')); if (name in urlParams) { urlParams[name] = [].concat(urlParams[name], value); } else { urlParams[name] = value; } } } return urlParams; } function decodeQueryParam(param) { return decodeURIComponent(param.replace(/\+/g, '%20')); } })(); var fuzzysort$1 = {exports: {}}; (function (module) { (function (root, UMD) { if (module.exports) module.exports = UMD();else root.fuzzysort = UMD(); })(commonjsGlobal, function UMD() { function fuzzysortNew(instanceOptions) { var fuzzysort = { single: function single(search, target, options) { if (search == 'farzher') return { target: "farzher was here (^-^*)/", score: 0, indexes: [0, 1, 2, 3, 4, 5, 6] }; if (!search) return null; if (!isObj(search)) search = fuzzysort.getPreparedSearch(search); if (!target) return null; if (!isObj(target)) target = fuzzysort.getPrepared(target); var allowTypo = options && options.allowTypo !== undefined ? options.allowTypo : instanceOptions && instanceOptions.allowTypo !== undefined ? instanceOptions.allowTypo : true; var algorithm = allowTypo ? fuzzysort.algorithm : fuzzysort.algorithmNoTypo; return algorithm(search, target, search[0]); }, go: function go(search, targets, options) { if (search == 'farzher') return [{ target: "farzher was here (^-^*)/", score: 0, indexes: [0, 1, 2, 3, 4, 5, 6], obj: targets ? targets[0] : null }]; if (!search) return noResults; search = fuzzysort.prepareSearch(search); var searchLowerCode = search[0]; var threshold = options && options.threshold || instanceOptions && instanceOptions.threshold || -9007199254740991; var limit = options && options.limit || instanceOptions && instanceOptions.limit || 9007199254740991; var allowTypo = options && options.allowTypo !== undefined ? options.allowTypo : instanceOptions && instanceOptions.allowTypo !== undefined ? instanceOptions.allowTypo : true; var algorithm = allowTypo ? fuzzysort.algorithm : fuzzysort.algorithmNoTypo; var resultsLen = 0; var limitedCount = 0; var targetsLen = targets.length; // This code is copy/pasted 3 times for performance reasons [options.keys, options.key, no keys] // options.keys if (options && options.keys) { var scoreFn = options.scoreFn || defaultScoreFn; var keys = options.keys; var keysLen = keys.length; for (var i = targetsLen - 1; i >= 0; --i) { var obj = targets[i]; var objResults = new Array(keysLen); for (var keyI = keysLen - 1; keyI >= 0; --keyI) { var key = keys[keyI]; var target = getValue(obj, key); if (!target) { objResults[keyI] = null; continue; } if (!isObj(target)) target = fuzzysort.getPrepared(target); objResults[keyI] = algorithm(search, target, searchLowerCode); } objResults.obj = obj; // before scoreFn so scoreFn can use it var score = scoreFn(objResults); if (score === null) continue; if (score < threshold) continue; objResults.score = score; if (resultsLen < limit) { q.add(objResults); ++resultsLen; } else { ++limitedCount; if (score > q.peek().score) q.replaceTop(objResults); } } // options.key } else if (options && options.key) { var key = options.key; for (var i = targetsLen - 1; i >= 0; --i) { var obj = targets[i]; var target = getValue(obj, key); if (!target) continue; if (!isObj(target)) target = fuzzysort.getPrepared(target); var result = algorithm(search, target, searchLowerCode); if (result === null) continue; if (result.score < threshold) continue; // have to clone result so duplicate targets from different obj can each reference the correct obj result = { target: result.target, _targetLowerCodes: null, _nextBeginningIndexes: null, score: result.score, indexes: result.indexes, obj: obj }; // hidden if (resultsLen < limit) { q.add(result); ++resultsLen; } else { ++limitedCount; if (result.score > q.peek().score) q.replaceTop(result); } } // no keys } else { for (var i = targetsLen - 1; i >= 0; --i) { var target = targets[i]; if (!target) continue; if (!isObj(target)) target = fuzzysort.getPrepared(target); var result = algorithm(search, target, searchLowerCode); if (result === null) continue; if (result.score < threshold) continue; if (resultsLen < limit) { q.add(result); ++resultsLen; } else { ++limitedCount; if (result.score > q.peek().score) q.replaceTop(result); } } } if (resultsLen === 0) return noResults; var results = new Array(resultsLen); for (var i = resultsLen - 1; i >= 0; --i) { results[i] = q.poll(); } results.total = resultsLen + limitedCount; return results; }, goAsync: function goAsync(search, targets, options) { var canceled = false; var p = new Promise(function (resolve, reject) { if (search == 'farzher') return resolve([{ target: "farzher was here (^-^*)/", score: 0, indexes: [0, 1, 2, 3, 4, 5, 6], obj: targets ? targets[0] : null }]); if (!search) return resolve(noResults); search = fuzzysort.prepareSearch(search); var searchLowerCode = search[0]; var q = fastpriorityqueue(); var iCurrent = targets.length - 1; var threshold = options && options.threshold || instanceOptions && instanceOptions.threshold || -9007199254740991; var limit = options && options.limit || instanceOptions && instanceOptions.limit || 9007199254740991; var allowTypo = options && options.allowTypo !== undefined ? options.allowTypo : instanceOptions && instanceOptions.allowTypo !== undefined ? instanceOptions.allowTypo : true; var algorithm = allowTypo ? fuzzysort.algorithm : fuzzysort.algorithmNoTypo; var resultsLen = 0; var limitedCount = 0; function step() { if (canceled) return reject('canceled'); var startMs = Date.now(); // This code is copy/pasted 3 times for performance reasons [options.keys, options.key, no keys] // options.keys if (options && options.keys) { var scoreFn = options.scoreFn || defaultScoreFn; var keys = options.keys; var keysLen = keys.length; for (; iCurrent >= 0; --iCurrent) { if (iCurrent % 1000 /*itemsPerCheck*/ === 0) { if (Date.now() - startMs >= 10 /*asyncInterval*/) { isNode ? setImmediate(step) : setTimeout(step); return; } } var obj = targets[iCurrent]; var objResults = new Array(keysLen); for (var keyI = keysLen - 1; keyI >= 0; --keyI) { var key = keys[keyI]; var target = getValue(obj, key); if (!target) { objResults[keyI] = null; continue; } if (!isObj(target)) target = fuzzysort.getPrepared(target); objResults[keyI] = algorithm(search, target, searchLowerCode); } objResults.obj = obj; // before scoreFn so scoreFn can use it var score = scoreFn(objResults); if (score === null) continue; if (score < threshold) continue; objResults.score = score; if (resultsLen < limit) { q.add(objResults); ++resultsLen; } else { ++limitedCount; if (score > q.peek().score) q.replaceTop(objResults); } } // options.key } else if (options && options.key) { var key = options.key; for (; iCurrent >= 0; --iCurrent) { if (iCurrent % 1000 /*itemsPerCheck*/ === 0) { if (Date.now() - startMs >= 10 /*asyncInterval*/) { isNode ? setImmediate(step) : setTimeout(step); return; } } var obj = targets[iCurrent]; var target = getValue(obj, key); if (!target) continue; if (!isObj(target)) target = fuzzysort.getPrepared(target); var result = algorithm(search, target, searchLowerCode); if (result === null) continue; if (result.score < threshold) continue; // have to clone result so duplicate targets from different obj can each reference the correct obj result = { target: result.target, _targetLowerCodes: null, _nextBeginningIndexes: null, score: result.score, indexes: result.indexes, obj: obj }; // hidden if (resultsLen < limit) { q.add(result); ++resultsLen; } else { ++limitedCount; if (result.score > q.peek().score) q.replaceTop(result); } } // no keys } else { for (; iCurrent >= 0; --iCurrent) { if (iCurrent % 1000 /*itemsPerCheck*/ === 0) { if (Date.now() - startMs >= 10 /*asyncInterval*/) { isNode ? setImmediate(step) : setTimeout(step); return; } } var target = targets[iCurrent]; if (!target) continue; if (!isObj(target)) target = fuzzysort.getPrepared(target); var result = algorithm(search, target, searchLowerCode); if (result === null) continue; if (result.score < threshold) continue; if (resultsLen < limit) { q.add(result); ++resultsLen; } else { ++limitedCount; if (result.score > q.peek().score) q.replaceTop(result); } } } if (resultsLen === 0) return resolve(noResults); var results = new Array(resultsLen); for (var i = resultsLen - 1; i >= 0; --i) { results[i] = q.poll(); } results.total = resultsLen + limitedCount; resolve(results); } isNode ? setImmediate(step) : step(); //setTimeout here is too slow }); p.cancel = function () { canceled = true; }; return p; }, highlight: function highlight(result, hOpen, hClose) { if (typeof hOpen == 'function') return fuzzysort.highlightCallback(result, hOpen); if (result === null) return null; if (hOpen === undefined) hOpen = ''; if (hClose === undefined) hClose = ''; var highlighted = ''; var matchesIndex = 0; var opened = false; var target = result.target; var targetLen = target.length; var matchesBest = result.indexes; for (var i = 0; i < targetLen; ++i) { var char = target[i]; if (matchesBest[matchesIndex] === i) { ++matchesIndex; if (!opened) { opened = true; highlighted += hOpen; } if (matchesIndex === matchesBest.length) { highlighted += char + hClose + target.substr(i + 1); break; } } else { if (opened) { opened = false; highlighted += hClose; } } highlighted += char; } return highlighted; }, highlightCallback: function highlightCallback(result, cb) { if (result === null) return null; var target = result.target; var targetLen = target.length; var indexes = result.indexes; var highlighted = ''; var matchI = 0; var indexesI = 0; var opened = false; var result = []; for (var i = 0; i < targetLen; ++i) { var char = target[i]; if (indexes[indexesI] === i) { ++indexesI; if (!opened) { opened = true; result.push(highlighted); highlighted = ''; } if (indexesI === indexes.length) { highlighted += char; result.push(cb(highlighted, matchI++)); highlighted = ''; result.push(target.substr(i + 1)); break; } } else { if (opened) { opened = false; result.push(cb(highlighted, matchI++)); highlighted = ''; } } highlighted += char; } return result; }, prepare: function prepare(target) { if (!target) return { target: '', _targetLowerCodes: [0 /*this 0 doesn't make sense. here because an empty array causes the algorithm to deoptimize and run 50% slower!*/], _nextBeginningIndexes: null, score: null, indexes: null, obj: null }; // hidden return { target: target, _targetLowerCodes: fuzzysort.prepareLowerCodes(target), _nextBeginningIndexes: null, score: null, indexes: null, obj: null }; // hidden }, prepareSlow: function prepareSlow(target) { if (!target) return { target: '', _targetLowerCodes: [0 /*this 0 doesn't make sense. here because an empty array causes the algorithm to deoptimize and run 50% slower!*/], _nextBeginningIndexes: null, score: null, indexes: null, obj: null }; // hidden return { target: target, _targetLowerCodes: fuzzysort.prepareLowerCodes(target), _nextBeginningIndexes: fuzzysort.prepareNextBeginningIndexes(target), score: null, indexes: null, obj: null }; // hidden }, prepareSearch: function prepareSearch(search) { if (!search) search = ''; return fuzzysort.prepareLowerCodes(search); }, // Below this point is only internal code // Below this point is only internal code // Below this point is only internal code // Below this point is only internal code getPrepared: function getPrepared(target) { if (target.length > 999) return fuzzysort.prepare(target); // don't cache huge targets var targetPrepared = preparedCache.get(target); if (targetPrepared !== undefined) return targetPrepared; targetPrepared = fuzzysort.prepare(target); preparedCache.set(target, targetPrepared); return targetPrepared; }, getPreparedSearch: function getPreparedSearch(search) { if (search.length > 999) return fuzzysort.prepareSearch(search); // don't cache huge searches var searchPrepared = preparedSearchCache.get(search); if (searchPrepared !== undefined) return searchPrepared; searchPrepared = fuzzysort.prepareSearch(search); preparedSearchCache.set(search, searchPrepared); return searchPrepared; }, algorithm: function algorithm(searchLowerCodes, prepared, searchLowerCode) { var targetLowerCodes = prepared._targetLowerCodes; var searchLen = searchLowerCodes.length; var targetLen = targetLowerCodes.length; var searchI = 0; // where we at var targetI = 0; // where you at var typoSimpleI = 0; var matchesSimpleLen = 0; // very basic fuzzy match; to remove non-matching targets ASAP! // walk through target. find sequential matches. // if all chars aren't found then exit for (;;) { var isMatch = searchLowerCode === targetLowerCodes[targetI]; if (isMatch) { matchesSimple[matchesSimpleLen++] = targetI; ++searchI; if (searchI === searchLen) break; searchLowerCode = searchLowerCodes[typoSimpleI === 0 ? searchI : typoSimpleI === searchI ? searchI + 1 : typoSimpleI === searchI - 1 ? searchI - 1 : searchI]; } ++targetI; if (targetI >= targetLen) { // Failed to find searchI // Check for typo or exit // we go as far as possible before trying to transpose // then we transpose backwards until we reach the beginning for (;;) { if (searchI <= 1) return null; // not allowed to transpose first char if (typoSimpleI === 0) { // we haven't tried to transpose yet --searchI; var searchLowerCodeNew = searchLowerCodes[searchI]; if (searchLowerCode === searchLowerCodeNew) continue; // doesn't make sense to transpose a repeat char typoSimpleI = searchI; } else { if (typoSimpleI === 1) return null; // reached the end of the line for transposing --typoSimpleI; searchI = typoSimpleI; searchLowerCode = searchLowerCodes[searchI + 1]; var searchLowerCodeNew = searchLowerCodes[searchI]; if (searchLowerCode === searchLowerCodeNew) continue; // doesn't make sense to transpose a repeat char } matchesSimpleLen = searchI; targetI = matchesSimple[matchesSimpleLen - 1] + 1; break; } } } var searchI = 0; var typoStrictI = 0; var successStrict = false; var matchesStrictLen = 0; var nextBeginningIndexes = prepared._nextBeginningIndexes; if (nextBeginningIndexes === null) nextBeginningIndexes = prepared._nextBeginningIndexes = fuzzysort.prepareNextBeginningIndexes(prepared.target); var firstPossibleI = targetI = matchesSimple[0] === 0 ? 0 : nextBeginningIndexes[matchesSimple[0] - 1]; // Our target string successfully matched all characters in sequence! // Let's try a more advanced and strict test to improve the score // only count it as a match if it's consecutive or a beginning character! if (targetI !== targetLen) for (;;) { if (targetI >= targetLen) { // We failed to find a good spot for this search char, go back to the previous search char and force it forward if (searchI <= 0) { // We failed to push chars forward for a better match // transpose, starting from the beginning ++typoStrictI; if (typoStrictI > searchLen - 2) break; if (searchLowerCodes[typoStrictI] === searchLowerCodes[typoStrictI + 1]) continue; // doesn't make sense to transpose a repeat char targetI = firstPossibleI; continue; } --searchI; var lastMatch = matchesStrict[--matchesStrictLen]; targetI = nextBeginningIndexes[lastMatch]; } else { var isMatch = searchLowerCodes[typoStrictI === 0 ? searchI : typoStrictI === searchI ? searchI + 1 : typoStrictI === searchI - 1 ? searchI - 1 : searchI] === targetLowerCodes[targetI]; if (isMatch) { matchesStrict[matchesStrictLen++] = targetI; ++searchI; if (searchI === searchLen) { successStrict = true; break; } ++targetI; } else { targetI = nextBeginningIndexes[targetI]; } } } { // tally up the score & keep track of matches for highlighting later if (successStrict) { var matchesBest = matchesStrict; var matchesBestLen = matchesStrictLen; } else { var matchesBest = matchesSimple; var matchesBestLen = matchesSimpleLen; } var score = 0; var lastTargetI = -1; for (var i = 0; i < searchLen; ++i) { var targetI = matchesBest[i]; // score only goes down if they're not consecutive if (lastTargetI !== targetI - 1) score -= targetI; lastTargetI = targetI; } if (!successStrict) { score *= 1000; if (typoSimpleI !== 0) score += -20; /*typoPenalty*/ } else { if (typoStrictI !== 0) score += -20; /*typoPenalty*/ } score -= targetLen - searchLen; prepared.score = score; prepared.indexes = new Array(matchesBestLen); for (var i = matchesBestLen - 1; i >= 0; --i) { prepared.indexes[i] = matchesBest[i]; } return prepared; } }, algorithmNoTypo: function algorithmNoTypo(searchLowerCodes, prepared, searchLowerCode) { var targetLowerCodes = prepared._targetLowerCodes; var searchLen = searchLowerCodes.length; var targetLen = targetLowerCodes.length; var searchI = 0; // where we at var targetI = 0; // where you at var matchesSimpleLen = 0; // very basic fuzzy match; to remove non-matching targets ASAP! // walk through target. find sequential matches. // if all chars aren't found then exit for (;;) { var isMatch = searchLowerCode === targetLowerCodes[targetI]; if (isMatch) { matchesSimple[matchesSimpleLen++] = targetI; ++searchI; if (searchI === searchLen) break; searchLowerCode = searchLowerCodes[searchI]; } ++targetI; if (targetI >= targetLen) return null; // Failed to find searchI } var searchI = 0; var successStrict = false; var matchesStrictLen = 0; var nextBeginningIndexes = prepared._nextBeginningIndexes; if (nextBeginningIndexes === null) nextBeginningIndexes = prepared._nextBeginningIndexes = fuzzysort.prepareNextBeginningIndexes(prepared.target); targetI = matchesSimple[0] === 0 ? 0 : nextBeginningIndexes[matchesSimple[0] - 1]; // Our target string successfully matched all characters in sequence! // Let's try a more advanced and strict test to improve the score // only count it as a match if it's consecutive or a beginning character! if (targetI !== targetLen) for (;;) { if (targetI >= targetLen) { // We failed to find a good spot for this search char, go back to the previous search char and force it forward if (searchI <= 0) break; // We failed to push chars forward for a better match --searchI; var lastMatch = matchesStrict[--matchesStrictLen]; targetI = nextBeginningIndexes[lastMatch]; } else { var isMatch = searchLowerCodes[searchI] === targetLowerCodes[targetI]; if (isMatch) { matchesStrict[matchesStrictLen++] = targetI; ++searchI; if (searchI === searchLen) { successStrict = true; break; } ++targetI; } else { targetI = nextBeginningIndexes[targetI]; } } } { // tally up the score & keep track of matches for highlighting later if (successStrict) { var matchesBest = matchesStrict; var matchesBestLen = matchesStrictLen; } else { var matchesBest = matchesSimple; var matchesBestLen = matchesSimpleLen; } var score = 0; var lastTargetI = -1; for (var i = 0; i < searchLen; ++i) { var targetI = matchesBest[i]; // score only goes down if they're not consecutive if (lastTargetI !== targetI - 1) score -= targetI; lastTargetI = targetI; } if (!successStrict) score *= 1000; score -= targetLen - searchLen; prepared.score = score; prepared.indexes = new Array(matchesBestLen); for (var i = matchesBestLen - 1; i >= 0; --i) { prepared.indexes[i] = matchesBest[i]; } return prepared; } }, prepareLowerCodes: function prepareLowerCodes(str) { var strLen = str.length; var lowerCodes = []; // new Array(strLen) sparse array is too slow var lower = str.toLowerCase(); for (var i = 0; i < strLen; ++i) { lowerCodes[i] = lower.charCodeAt(i); } return lowerCodes; }, prepareBeginningIndexes: function prepareBeginningIndexes(target) { var targetLen = target.length; var beginningIndexes = []; var beginningIndexesLen = 0; var wasUpper = false; var wasAlphanum = false; for (var i = 0; i < targetLen; ++i) { var targetCode = target.charCodeAt(i); var isUpper = targetCode >= 65 && targetCode <= 90; var isAlphanum = isUpper || targetCode >= 97 && targetCode <= 122 || targetCode >= 48 && targetCode <= 57; var isBeginning = isUpper && !wasUpper || !wasAlphanum || !isAlphanum; wasUpper = isUpper; wasAlphanum = isAlphanum; if (isBeginning) beginningIndexes[beginningIndexesLen++] = i; } return beginningIndexes; }, prepareNextBeginningIndexes: function prepareNextBeginningIndexes(target) { var targetLen = target.length; var beginningIndexes = fuzzysort.prepareBeginningIndexes(target); var nextBeginningIndexes = []; // new Array(targetLen) sparse array is too slow var lastIsBeginning = beginningIndexes[0]; var lastIsBeginningI = 0; for (var i = 0; i < targetLen; ++i) { if (lastIsBeginning > i) { nextBeginningIndexes[i] = lastIsBeginning; } else { lastIsBeginning = beginningIndexes[++lastIsBeginningI]; nextBeginningIndexes[i] = lastIsBeginning === undefined ? targetLen : lastIsBeginning; } } return nextBeginningIndexes; }, cleanup: cleanup, new: fuzzysortNew }; return fuzzysort; } // fuzzysortNew // This stuff is outside fuzzysortNew, because it's shared with instances of fuzzysort.new() var isNode = typeof commonjsRequire !== 'undefined' && typeof window === 'undefined'; var MyMap = typeof Map === 'function' ? Map : function () { var s = Object.create(null); this.get = function (k) { return s[k]; }; this.set = function (k, val) { s[k] = val; return this; }; this.clear = function () { s = Object.create(null); }; }; var preparedCache = new MyMap(); var preparedSearchCache = new MyMap(); var noResults = []; noResults.total = 0; var matchesSimple = []; var matchesStrict = []; function cleanup() { preparedCache.clear(); preparedSearchCache.clear(); matchesSimple = []; matchesStrict = []; } function defaultScoreFn(a) { var max = -9007199254740991; for (var i = a.length - 1; i >= 0; --i) { var result = a[i]; if (result === null) continue; var score = result.score; if (score > max) max = score; } if (max === -9007199254740991) return null; return max; } // prop = 'key' 2.5ms optimized for this case, seems to be about as fast as direct obj[prop] // prop = 'key1.key2' 10ms // prop = ['key1', 'key2'] 27ms function getValue(obj, prop) { var tmp = obj[prop]; if (tmp !== undefined) return tmp; var segs = prop; if (!Array.isArray(prop)) segs = prop.split('.'); var len = segs.length; var i = -1; while (obj && ++i < len) { obj = obj[segs[i]]; } return obj; } function isObj(x) { return _typeof(x) === 'object'; } // faster as a function // Hacked version of https://github.com/lemire/FastPriorityQueue.js var fastpriorityqueue = function fastpriorityqueue() { var r = [], o = 0, e = {}; function n() { for (var e = 0, n = r[e], c = 1; c < o;) { var f = c + 1; e = c, f < o && r[f].score < r[c].score && (e = f), r[e - 1 >> 1] = r[e], c = 1 + (e << 1); } for (var a = e - 1 >> 1; e > 0 && n.score < r[a].score; a = (e = a) - 1 >> 1) { r[e] = r[a]; } r[e] = n; } return e.add = function (e) { var n = o; r[o++] = e; for (var c = n - 1 >> 1; n > 0 && e.score < r[c].score; c = (n = c) - 1 >> 1) { r[n] = r[c]; } r[n] = e; }, e.poll = function () { if (0 !== o) { var e = r[0]; return r[0] = r[--o], n(), e; } }, e.peek = function (e) { if (0 !== o) return r[0]; }, e.replaceTop = function (o) { r[0] = o, n(); }, e; }; var q = fastpriorityqueue(); // reuse this, except for async, it needs to make its own return fuzzysortNew(); }); // UMD // TODO: (performance) wasm version!? // TODO: (performance) threads? // TODO: (performance) avoid cache misses // TODO: (performance) preparedCache is a memory leak // TODO: (like sublime) backslash === forwardslash // TODO: (like sublime) spaces: "a b" should do 2 searches 1 for a and 1 for b // TODO: (scoring) garbage in targets that allows most searches to strict match need a penality // TODO: (performance) idk if allowTypo is optimized })(fuzzysort$1); var fuzzysort = fuzzysort$1.exports; var stats = { failedTests: [], defined: 0, completed: 0 }; // Escape text for attribute or text content. function escapeText(str) { if (!str) { return ''; } // Both single quotes and double quotes (for attributes) return ('' + str).replace(/['"<>&]/g, function (s) { switch (s) { case "'": return '''; case '"': return '"'; case '<': return '<'; case '>': return '>'; case '&': return '&'; } }); } (function () { // Don't load the HTML Reporter on non-browser environments if (!window$1 || !document) { return; } var config = QUnit.config; var hiddenTests = []; var collapseNext = false; var hasOwn = Object.prototype.hasOwnProperty; var unfilteredUrl = setUrl({ filter: undefined, module: undefined, moduleId: undefined, testId: undefined }); var dropdownData = null; function trim(string) { if (typeof string.trim === 'function') { return string.trim(); } else { return string.replace(/^\s+|\s+$/g, ''); } } function addEvent(elem, type, fn) { elem.addEventListener(type, fn, false); } function removeEvent(elem, type, fn) { elem.removeEventListener(type, fn, false); } function addEvents(elems, type, fn) { var i = elems.length; while (i--) { addEvent(elems[i], type, fn); } } function hasClass(elem, name) { return (' ' + elem.className + ' ').indexOf(' ' + name + ' ') >= 0; } function addClass(elem, name) { if (!hasClass(elem, name)) { elem.className += (elem.className ? ' ' : '') + name; } } function toggleClass(elem, name, force) { if (force || typeof force === 'undefined' && !hasClass(elem, name)) { addClass(elem, name); } else { removeClass(elem, name); } } function removeClass(elem, name) { var set = ' ' + elem.className + ' '; // Class name may appear multiple times while (set.indexOf(' ' + name + ' ') >= 0) { set = set.replace(' ' + name + ' ', ' '); } // Trim for prettiness elem.className = trim(set); } function id(name) { return document.getElementById && document.getElementById(name); } function abortTests() { var abortButton = id('qunit-abort-tests-button'); if (abortButton) { abortButton.disabled = true; abortButton.innerHTML = 'Aborting...'; } QUnit.config.queue.length = 0; return false; } function interceptNavigation(ev) { // Trim potential accidental whitespace so that QUnit doesn't throw an error about no tests matching the filter. var filterInputElem = id('qunit-filter-input'); filterInputElem.value = trim(filterInputElem.value); applyUrlParams(); if (ev && ev.preventDefault) { ev.preventDefault(); } return false; } function getUrlConfigHtml() { var selection = false; var urlConfig = config.urlConfig; var urlConfigHtml = ''; for (var i = 0; i < urlConfig.length; i++) { // Options can be either strings or objects with nonempty "id" properties var val = config.urlConfig[i]; if (typeof val === 'string') { val = { id: val, label: val }; } var escaped = escapeText(val.id); var escapedTooltip = escapeText(val.tooltip); if (!val.value || typeof val.value === 'string') { urlConfigHtml += "'; } else { urlConfigHtml += "'; } } return urlConfigHtml; } // Handle "click" events on toolbar checkboxes and "change" for select menus. // Updates the URL with the new state of `config.urlConfig` values. function toolbarChanged() { var field = this; var params = {}; // Detect if field is a select menu or a checkbox var value; if ('selectedIndex' in field) { value = field.options[field.selectedIndex].value || undefined; } else { value = field.checked ? field.defaultValue || true : undefined; } params[field.name] = value; var updatedUrl = setUrl(params); // Check if we can apply the change without a page refresh if (field.name === 'hidepassed' && 'replaceState' in window$1.history) { QUnit.urlParams[field.name] = value; config[field.name] = value || false; var tests = id('qunit-tests'); if (tests) { var length = tests.children.length; var children = tests.children; if (field.checked) { for (var i = 0; i < length; i++) { var test = children[i]; var className = test ? test.className : ''; var classNameHasPass = className.indexOf('pass') > -1; var classNameHasSkipped = className.indexOf('skipped') > -1; if (classNameHasPass || classNameHasSkipped) { hiddenTests.push(test); } } var _iterator = _createForOfIteratorHelper(hiddenTests), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var hiddenTest = _step.value; tests.removeChild(hiddenTest); } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } } else { var _test; while ((_test = hiddenTests.pop()) != null) { tests.appendChild(_test); } } } window$1.history.replaceState(null, '', updatedUrl); } else { window$1.location = updatedUrl; } } function setUrl(params) { var querystring = '?'; var location = window$1.location; params = extend(extend({}, QUnit.urlParams), params); for (var key in params) { // Skip inherited or undefined properties if (hasOwn.call(params, key) && params[key] !== undefined) { // Output a parameter for each value of this key // (but usually just one) var arrValue = [].concat(params[key]); for (var i = 0; i < arrValue.length; i++) { querystring += encodeURIComponent(key); if (arrValue[i] !== true) { querystring += '=' + encodeURIComponent(arrValue[i]); } querystring += '&'; } } } return location.protocol + '//' + location.host + location.pathname + querystring.slice(0, -1); } function applyUrlParams() { var filter = id('qunit-filter-input').value; window$1.location = setUrl({ filter: filter === '' ? undefined : filter, moduleId: _toConsumableArray(dropdownData.selectedMap.keys()), // Remove module and testId filter module: undefined, testId: undefined }); } function toolbarUrlConfigContainer() { var urlConfigContainer = document.createElement('span'); urlConfigContainer.innerHTML = getUrlConfigHtml(); addClass(urlConfigContainer, 'qunit-url-config'); addEvents(urlConfigContainer.getElementsByTagName('input'), 'change', toolbarChanged); addEvents(urlConfigContainer.getElementsByTagName('select'), 'change', toolbarChanged); return urlConfigContainer; } function abortTestsButton() { var button = document.createElement('button'); button.id = 'qunit-abort-tests-button'; button.innerHTML = 'Abort'; addEvent(button, 'click', abortTests); return button; } function toolbarLooseFilter() { var filter = document.createElement('form'); var label = document.createElement('label'); var input = document.createElement('input'); var button = document.createElement('button'); addClass(filter, 'qunit-filter'); label.innerHTML = 'Filter: '; input.type = 'text'; input.value = config.filter || ''; input.name = 'filter'; input.id = 'qunit-filter-input'; button.innerHTML = 'Go'; label.appendChild(input); filter.appendChild(label); filter.appendChild(document.createTextNode(' ')); filter.appendChild(button); addEvent(filter, 'submit', interceptNavigation); return filter; } function createModuleListItem(moduleId, name, checked) { return '
      1. '; } /** * @param {Array} Results from fuzzysort * @return {string} HTML */ function moduleListHtml(results) { var html = ''; // Hoist the already selected items, and show them always // even if not matched by the current search. dropdownData.selectedMap.forEach(function (name, moduleId) { html += createModuleListItem(moduleId, name, true); }); for (var i = 0; i < results.length; i++) { var mod = results[i].obj; if (!dropdownData.selectedMap.has(mod.moduleId)) { html += createModuleListItem(mod.moduleId, mod.name, false); } } return html; } function toolbarModuleFilter(beginDetails) { var initialSelected = null; dropdownData = { options: beginDetails.modules.slice(), selectedMap: new StringMap(), isDirty: function isDirty() { return _toConsumableArray(dropdownData.selectedMap.keys()).sort().join(',') !== _toConsumableArray(initialSelected.keys()).sort().join(','); } }; if (config.moduleId.length) { // The module dropdown is seeded with the runtime configuration of the last run. // // We don't reference `config.moduleId` directly after this and keep our own // copy because: // 1. This naturaly filters out unknown moduleIds. // 2. Gives us a place to manage and remember unsubmitted checkbox changes. // 3. Gives us an efficient way to map a selected moduleId to module name // during rendering. for (var i = 0; i < beginDetails.modules.length; i++) { var mod = beginDetails.modules[i]; if (config.moduleId.indexOf(mod.moduleId) !== -1) { dropdownData.selectedMap.set(mod.moduleId, mod.name); } } } initialSelected = new StringMap(dropdownData.selectedMap); var moduleSearch = document.createElement('input'); moduleSearch.id = 'qunit-modulefilter-search'; moduleSearch.autocomplete = 'off'; addEvent(moduleSearch, 'input', searchInput); addEvent(moduleSearch, 'input', searchFocus); addEvent(moduleSearch, 'focus', searchFocus); addEvent(moduleSearch, 'click', searchFocus); var label = document.createElement('label'); label.htmlFor = 'qunit-modulefilter-search'; label.textContent = 'Module:'; var searchContainer = document.createElement('span'); searchContainer.id = 'qunit-modulefilter-search-container'; searchContainer.appendChild(moduleSearch); var applyButton = document.createElement('button'); applyButton.textContent = 'Apply'; applyButton.title = 'Re-run the selected test modules'; addEvent(applyButton, 'click', applyUrlParams); var resetButton = document.createElement('button'); resetButton.textContent = 'Reset'; resetButton.type = 'reset'; resetButton.title = 'Restore the previous module selection'; var clearButton = document.createElement('button'); clearButton.textContent = 'Select none'; clearButton.type = 'button'; clearButton.title = 'Clear the current module selection'; addEvent(clearButton, 'click', function () { dropdownData.selectedMap.clear(); selectionChange(); searchInput(); }); var actions = document.createElement('span'); actions.id = 'qunit-modulefilter-actions'; actions.appendChild(applyButton); actions.appendChild(resetButton); if (initialSelected.size) { // Only show clear button if functionally different from reset actions.appendChild(clearButton); } var dropDownList = document.createElement('ul'); dropDownList.id = 'qunit-modulefilter-dropdown-list'; var dropDown = document.createElement('div'); dropDown.id = 'qunit-modulefilter-dropdown'; dropDown.style.display = 'none'; dropDown.appendChild(actions); dropDown.appendChild(dropDownList); addEvent(dropDown, 'change', selectionChange); searchContainer.appendChild(dropDown); // Set initial moduleSearch.placeholder and clearButton/resetButton. selectionChange(); var moduleFilter = document.createElement('form'); moduleFilter.id = 'qunit-modulefilter'; moduleFilter.appendChild(label); moduleFilter.appendChild(document.createTextNode(' ')); moduleFilter.appendChild(searchContainer); addEvent(moduleFilter, 'submit', interceptNavigation); addEvent(moduleFilter, 'reset', function () { dropdownData.selectedMap = new StringMap(initialSelected); // Set moduleSearch.placeholder and reflect non-dirty state selectionChange(); searchInput(); }); // Enables show/hide for the dropdown function searchFocus() { if (dropDown.style.display !== 'none') { return; } // Optimization: Defer rendering options until focussed. // https://github.com/qunitjs/qunit/issues/1664 searchInput(); dropDown.style.display = 'block'; // Hide on Escape keydown or on click outside the container addEvent(document, 'click', hideHandler); addEvent(document, 'keydown', hideHandler); function hideHandler(e) { var inContainer = moduleFilter.contains(e.target); if (e.keyCode === 27 || !inContainer) { if (e.keyCode === 27 && inContainer) { moduleSearch.focus(); } dropDown.style.display = 'none'; removeEvent(document, 'click', hideHandler); removeEvent(document, 'keydown', hideHandler); moduleSearch.value = ''; searchInput(); } } } /** * @param {string} searchText * @return {string} HTML */ function filterModules(searchText) { var results; if (searchText === '') { // Improve on-boarding experience by having an immediate display of // module names, indicating how the interface works. This also makes // for a quicker interaction in the common case of small projects. // Don't mandate typing just to get the menu. results = dropdownData.options.slice(0, 20).map(function (obj) { // Fake empty results. https://github.com/farzher/fuzzysort/issues/41 return { obj: obj }; }); } else { results = fuzzysort.go(searchText, dropdownData.options, { limit: 20, key: 'name', allowTypo: true }); } return moduleListHtml(results); } // Processes module search box input var searchInputTimeout; function searchInput() { // Use a debounce with a ~0ms timeout. This is effectively instantaneous, // but is better than undebounced because it avoids an ever-growing // backlog of unprocessed now-outdated input events if fuzzysearch or // drodown DOM is slow (e.g. very large test suite). window$1.clearTimeout(searchInputTimeout); searchInputTimeout = window$1.setTimeout(function () { dropDownList.innerHTML = filterModules(moduleSearch.value); }); } // Processes checkbox change, or a generic render (initial render, or after reset event) // Avoid any dropdown rendering here as this is used by toolbarModuleFilter() // during the initial render, which should not delay test execution. function selectionChange(evt) { var checkbox = evt && evt.target || null; if (checkbox) { // Update internal state if (checkbox.checked) { dropdownData.selectedMap.set(checkbox.value, checkbox.parentNode.textContent); } else { dropdownData.selectedMap.delete(checkbox.value); } // Update UI state toggleClass(checkbox.parentNode, 'checked', checkbox.checked); } var textForm = dropdownData.selectedMap.size ? dropdownData.selectedMap.size + ' ' + (dropdownData.selectedMap.size === 1 ? 'module' : 'modules') : 'All modules'; moduleSearch.placeholder = textForm; moduleSearch.title = 'Type to search through and reduce the list.'; resetButton.disabled = !dropdownData.isDirty(); clearButton.style.display = dropdownData.selectedMap.size ? '' : 'none'; } return moduleFilter; } function appendToolbar(beginDetails) { var toolbar = id('qunit-testrunner-toolbar'); if (toolbar) { toolbar.appendChild(toolbarUrlConfigContainer()); var toolbarFilters = document.createElement('span'); toolbarFilters.id = 'qunit-toolbar-filters'; toolbarFilters.appendChild(toolbarLooseFilter()); toolbarFilters.appendChild(toolbarModuleFilter(beginDetails)); var clearfix = document.createElement('div'); clearfix.className = 'clearfix'; toolbar.appendChild(toolbarFilters); toolbar.appendChild(clearfix); } } function appendHeader() { var header = id('qunit-header'); if (header) { header.innerHTML = "" + header.innerHTML + ' '; } } function appendBanner() { var banner = id('qunit-banner'); if (banner) { banner.className = ''; } } function appendTestResults() { var tests = id('qunit-tests'); var result = id('qunit-testresult'); var controls; if (result) { result.parentNode.removeChild(result); } if (tests) { tests.innerHTML = ''; result = document.createElement('p'); result.id = 'qunit-testresult'; result.className = 'result'; tests.parentNode.insertBefore(result, tests); result.innerHTML = '
        Running...
         
        ' + '
        ' + '
        '; controls = id('qunit-testresult-controls'); } if (controls) { controls.appendChild(abortTestsButton()); } } function appendFilteredTest() { var testId = QUnit.config.testId; if (!testId || testId.length <= 0) { return ''; } return "
        Rerunning selected tests: " + escapeText(testId.join(', ')) + " Run all tests
        "; } function appendUserAgent() { var userAgent = id('qunit-userAgent'); if (userAgent) { userAgent.innerHTML = ''; userAgent.appendChild(document.createTextNode('QUnit ' + QUnit.version + '; ' + navigator.userAgent)); } } function appendInterface(beginDetails) { var qunit = id('qunit'); // For compat with QUnit 1.2, and to support fully custom theme HTML, // we will use any existing elements if no id="qunit" element exists. // // Note that we don't fail or fallback to creating it ourselves, // because not having id="qunit" (and not having the below elements) // simply means QUnit acts headless, allowing users to use their own // reporters, or for a test runner to listen for events directly without // having the HTML reporter actively render anything. if (qunit) { qunit.setAttribute('role', 'main'); // Since QUnit 1.3, these are created automatically if the page // contains id="qunit". qunit.innerHTML = "

        " + escapeText(document.title) + '

        ' + "

        " + "" + appendFilteredTest() + "

        " + "
          "; } appendHeader(); appendBanner(); appendTestResults(); appendUserAgent(); appendToolbar(beginDetails); } function appendTest(name, testId, moduleName) { var tests = id('qunit-tests'); if (!tests) { return; } var title = document.createElement('strong'); title.innerHTML = getNameHtml(name, moduleName); var testBlock = document.createElement('li'); testBlock.appendChild(title); // No ID or rerun link for "global failure" blocks if (testId !== undefined) { var rerunTrigger = document.createElement('a'); rerunTrigger.innerHTML = 'Rerun'; rerunTrigger.href = setUrl({ testId: testId }); testBlock.id = 'qunit-test-output-' + testId; testBlock.appendChild(rerunTrigger); } var assertList = document.createElement('ol'); assertList.className = 'qunit-assert-list'; testBlock.appendChild(assertList); tests.appendChild(testBlock); return testBlock; } // HTML Reporter initialization and load QUnit.on('runStart', function (runStart) { stats.defined = runStart.testCounts.total; }); QUnit.begin(function (beginDetails) { // Initialize QUnit elements // This is done from begin() instead of runStart, because // urlparams.js uses begin(), which we need to wait for. // urlparams.js in turn uses begin() to allow plugins to // add entries to QUnit.config.urlConfig, which may be done // asynchronously. // appendInterface(beginDetails); }); function getRerunFailedHtml(failedTests) { if (failedTests.length === 0) { return ''; } var href = setUrl({ testId: failedTests }); return ["
          ", failedTests.length === 1 ? 'Rerun 1 failed test' : 'Rerun ' + failedTests.length + ' failed tests', ''].join(''); } QUnit.on('runEnd', function (runEnd) { var banner = id('qunit-banner'); var tests = id('qunit-tests'); var abortButton = id('qunit-abort-tests-button'); var assertPassed = config.stats.all - config.stats.bad; var html = [runEnd.testCounts.total, ' tests completed in ', runEnd.runtime, ' milliseconds, with ', runEnd.testCounts.failed, ' failed, ', runEnd.testCounts.skipped, ' skipped, and ', runEnd.testCounts.todo, ' todo.
          ', "", assertPassed, " assertions of ", config.stats.all, " passed, ", config.stats.bad, ' failed.', getRerunFailedHtml(stats.failedTests)].join(''); var test; var assertLi; var assertList; // Update remaining tests to aborted if (abortButton && abortButton.disabled) { html = 'Tests aborted after ' + runEnd.runtime + ' milliseconds.'; for (var i = 0; i < tests.children.length; i++) { test = tests.children[i]; if (test.className === '' || test.className === 'running') { test.className = 'aborted'; assertList = test.getElementsByTagName('ol')[0]; assertLi = document.createElement('li'); assertLi.className = 'fail'; assertLi.innerHTML = 'Test aborted.'; assertList.appendChild(assertLi); } } } if (banner && (!abortButton || abortButton.disabled === false)) { banner.className = runEnd.status === 'failed' ? 'qunit-fail' : 'qunit-pass'; } if (abortButton) { abortButton.parentNode.removeChild(abortButton); } if (tests) { id('qunit-testresult-display').innerHTML = html; } if (config.altertitle && document.title) { // Show ✖ for good, ✔ for bad suite result in title // use escape sequences in case file gets loaded with non-utf-8 // charset document.title = [runEnd.status === 'failed' ? "\u2716" : "\u2714", document.title.replace(/^[\u2714\u2716] /i, '')].join(' '); } // Scroll back to top to show results if (config.scrolltop && window$1.scrollTo) { window$1.scrollTo(0, 0); } }); function getNameHtml(name, module) { var nameHtml = ''; if (module) { nameHtml = "" + escapeText(module) + ': '; } nameHtml += "" + escapeText(name) + ''; return nameHtml; } function getProgressHtml(stats) { return [stats.completed, ' / ', stats.defined, ' tests completed.
          '].join(''); } QUnit.testStart(function (details) { var running, bad; appendTest(details.name, details.testId, details.module); running = id('qunit-testresult-display'); if (running) { addClass(running, 'running'); bad = QUnit.config.reorder && details.previousFailure; running.innerHTML = [getProgressHtml(stats), bad ? 'Rerunning previously failed test:
          ' : 'Running: ', getNameHtml(details.name, details.module), getRerunFailedHtml(stats.failedTests)].join(''); } }); function stripHtml(string) { // Strip tags, html entity and whitespaces return string.replace(/<\/?[^>]+(>|$)/g, '').replace(/"/g, '').replace(/\s+/g, ''); } QUnit.log(function (details) { var testItem = id('qunit-test-output-' + details.testId); if (!testItem) { return; } var message = escapeText(details.message) || (details.result ? 'okay' : 'failed'); message = "" + message + ''; message += "@ " + details.runtime + ' ms'; var expected; var actual; var diff; var showDiff = false; // The pushFailure doesn't provide details.expected // when it calls, it's implicit to also not show expected and diff stuff // Also, we need to check details.expected existence, as it can exist and be undefined if (!details.result && hasOwn.call(details, 'expected')) { if (details.negative) { expected = 'NOT ' + QUnit.dump.parse(details.expected); } else { expected = QUnit.dump.parse(details.expected); } actual = QUnit.dump.parse(details.actual); message += "'; if (actual !== expected) { message += "'; if (typeof details.actual === 'number' && typeof details.expected === 'number') { if (!isNaN(details.actual) && !isNaN(details.expected)) { showDiff = true; diff = details.actual - details.expected; diff = (diff > 0 ? '+' : '') + diff; } } else if (typeof details.actual !== 'boolean' && typeof details.expected !== 'boolean') { diff = QUnit.diff(expected, actual); // don't show diff if there is zero overlap showDiff = stripHtml(diff).length !== stripHtml(expected).length + stripHtml(actual).length; } if (showDiff) { message += "'; } } else if (expected.indexOf('[object Array]') !== -1 || expected.indexOf('[object Object]') !== -1) { message += "'; } else { message += "'; } if (details.source) { message += "'; } message += '
          Expected:
          " + escapeText(expected) + '
          Result:
          " + escapeText(actual) + '
          Diff:
          " + diff + '
          Message: " + 'Diff suppressed as the depth of object is more than current max depth (' + QUnit.config.maxDepth + ').

          Hint: Use QUnit.dump.maxDepth to ' + " run with a higher max depth or " + 'Rerun without max depth.

          Message: " + 'Diff suppressed as the expected and actual results have an equivalent' + ' serialization
          Source:
          " + escapeText(details.source) + '
          '; // This occurs when pushFailure is set and we have an extracted stack trace } else if (!details.result && details.source) { message += '' + "' + '
          Source:
          " + escapeText(details.source) + '
          '; } var assertList = testItem.getElementsByTagName('ol')[0]; var assertLi = document.createElement('li'); assertLi.className = details.result ? 'pass' : 'fail'; assertLi.innerHTML = message; assertList.appendChild(assertLi); }); QUnit.testDone(function (details) { var tests = id('qunit-tests'); var testItem = id('qunit-test-output-' + details.testId); if (!tests || !testItem) { return; } removeClass(testItem, 'running'); var status; if (details.failed > 0) { status = 'failed'; } else if (details.todo) { status = 'todo'; } else { status = details.skipped ? 'skipped' : 'passed'; } var assertList = testItem.getElementsByTagName('ol')[0]; var good = details.passed; var bad = details.failed; // This test passed if it has no unexpected failed assertions var testPassed = details.failed > 0 ? details.todo : !details.todo; if (testPassed) { // Collapse the passing tests addClass(assertList, 'qunit-collapsed'); } else { stats.failedTests.push(details.testId); if (config.collapse) { if (!collapseNext) { // Skip collapsing the first failing test collapseNext = true; } else { // Collapse remaining tests addClass(assertList, 'qunit-collapsed'); } } } // The testItem.firstChild is the test name var testTitle = testItem.firstChild; var testCounts = bad ? "" + bad + ', ' + "" + good + ', ' : ''; testTitle.innerHTML += " (" + testCounts + details.assertions.length + ')'; stats.completed++; if (details.skipped) { testItem.className = 'skipped'; var skipped = document.createElement('em'); skipped.className = 'qunit-skipped-label'; skipped.innerHTML = 'skipped'; testItem.insertBefore(skipped, testTitle); } else { addEvent(testTitle, 'click', function () { toggleClass(assertList, 'qunit-collapsed'); }); testItem.className = testPassed ? 'pass' : 'fail'; if (details.todo) { var todoLabel = document.createElement('em'); todoLabel.className = 'qunit-todo-label'; todoLabel.innerHTML = 'todo'; testItem.className += ' todo'; testItem.insertBefore(todoLabel, testTitle); } var time = document.createElement('span'); time.className = 'runtime'; time.innerHTML = details.runtime + ' ms'; testItem.insertBefore(time, assertList); } // Show the source of the test when showing assertions if (details.source) { var sourceName = document.createElement('p'); sourceName.innerHTML = 'Source: ' + escapeText(details.source); addClass(sourceName, 'qunit-source'); if (testPassed) { addClass(sourceName, 'qunit-collapsed'); } addEvent(testTitle, 'click', function () { toggleClass(sourceName, 'qunit-collapsed'); }); testItem.appendChild(sourceName); } if (config.hidepassed && (status === 'passed' || details.skipped)) { // use removeChild instead of remove because of support hiddenTests.push(testItem); tests.removeChild(testItem); } }); QUnit.on('error', function (error) { var testItem = appendTest('global failure'); if (!testItem) { // HTML Reporter is probably disabled or not yet initialized. return; } // Render similar to a failed assertion (see above QUnit.log callback) var message = escapeText(errorString(error)); message = "" + message + ''; if (error && error.stack) { message += '' + "' + '
          Source:
          " + escapeText(error.stack) + '
          '; } var assertList = testItem.getElementsByTagName('ol')[0]; var assertLi = document.createElement('li'); assertLi.className = 'fail'; assertLi.innerHTML = message; assertList.appendChild(assertLi); // Make it visible testItem.className = 'fail'; }); // Avoid readyState issue with phantomjs // Ref: #818 var usingPhantom = function (p) { return p && p.version && p.version.major > 0; }(window$1.phantom); if (usingPhantom) { console$1.warn('Support for PhantomJS is deprecated and will be removed in QUnit 3.0.'); } if (!usingPhantom && document.readyState === 'complete') { QUnit.load(); } else { addEvent(window$1, 'load', QUnit.load); } // Wrap window.onerror. We will call the original window.onerror to see if // the existing handler fully handles the error; if not, we will call the // QUnit.onError function. var originalWindowOnError = window$1.onerror; // Cover uncaught exceptions // Returning true will suppress the default browser handler, // returning false will let it run. window$1.onerror = function (message, fileName, lineNumber, columnNumber, errorObj) { var ret = false; if (originalWindowOnError) { for (var _len = arguments.length, args = new Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { args[_key - 5] = arguments[_key]; } ret = originalWindowOnError.call.apply(originalWindowOnError, [this, message, fileName, lineNumber, columnNumber, errorObj].concat(args)); } // Treat return value as window.onerror itself does, // Only do our handling if not suppressed. if (ret !== true) { // If there is a current test that sets the internal `ignoreGlobalErrors` field // (such as during `assert.throws()`), then the error is ignored and native // error reporting is suppressed as well. This is because in browsers, an error // can sometimes end up in `window.onerror` instead of in the local try/catch. // This ignoring of errors does not apply to our general onUncaughtException // method, nor to our `unhandledRejection` handlers, as those are not meant // to receive an "expected" error during `assert.throws()`. if (config.current && config.current.ignoreGlobalErrors) { return true; } // According to // https://blog.sentry.io/2016/01/04/client-javascript-reporting-window-onerror, // most modern browsers support an errorObj argument; use that to // get a full stack trace if it's available. var error = errorObj || new Error(message); if (!error.stack && fileName && lineNumber) { error.stack = "".concat(fileName, ":").concat(lineNumber); } QUnit.onUncaughtException(error); } return ret; }; window$1.addEventListener('unhandledrejection', function (event) { QUnit.onUncaughtException(event.reason); }); })(); /* * This file is a modified version of google-diff-match-patch's JavaScript implementation * (https://code.google.com/p/google-diff-match-patch/source/browse/trunk/javascript/diff_match_patch_uncompressed.js), * modifications are licensed as more fully set forth in LICENSE.txt. * * The original source of google-diff-match-patch is attributable and licensed as follows: * * Copyright 2006 Google Inc. * https://code.google.com/p/google-diff-match-patch/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * More Info: * https://code.google.com/p/google-diff-match-patch/ * * Usage: QUnit.diff(expected, actual) * */ QUnit.diff = function () { function DiffMatchPatch() {} // DIFF FUNCTIONS /** * The data structure representing a diff is an array of tuples: * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] * which means: delete 'Hello', add 'Goodbye' and keep ' world.' */ var DIFF_DELETE = -1; var DIFF_INSERT = 1; var DIFF_EQUAL = 0; var hasOwn = Object.prototype.hasOwnProperty; /** * Find the differences between two texts. Simplifies the problem by stripping * any common prefix or suffix off the texts before diffing. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {boolean=} optChecklines Optional speedup flag. If present and false, * then don't run a line-level diff first to identify the changed areas. * Defaults to true, which does a faster, slightly less optimal diff. * @return {!Array.} Array of diff tuples. */ DiffMatchPatch.prototype.DiffMain = function (text1, text2, optChecklines) { // The diff must be complete in up to 1 second. var deadline = Date.now() + 1000; // Check for null inputs. if (text1 === null || text2 === null) { throw new Error('Cannot diff null input.'); } // Check for equality (speedup). if (text1 === text2) { if (text1) { return [[DIFF_EQUAL, text1]]; } return []; } if (typeof optChecklines === 'undefined') { optChecklines = true; } // Trim off common prefix (speedup). var commonlength = this.diffCommonPrefix(text1, text2); var commonprefix = text1.substring(0, commonlength); text1 = text1.substring(commonlength); text2 = text2.substring(commonlength); // Trim off common suffix (speedup). commonlength = this.diffCommonSuffix(text1, text2); var commonsuffix = text1.substring(text1.length - commonlength); text1 = text1.substring(0, text1.length - commonlength); text2 = text2.substring(0, text2.length - commonlength); // Compute the diff on the middle block. var diffs = this.diffCompute(text1, text2, optChecklines, deadline); // Restore the prefix and suffix. if (commonprefix) { diffs.unshift([DIFF_EQUAL, commonprefix]); } if (commonsuffix) { diffs.push([DIFF_EQUAL, commonsuffix]); } this.diffCleanupMerge(diffs); return diffs; }; /** * Reduce the number of edits by eliminating operationally trivial equalities. * @param {!Array.} diffs Array of diff tuples. */ DiffMatchPatch.prototype.diffCleanupEfficiency = function (diffs) { var changes, equalities, equalitiesLength, lastequality, pointer, preIns, preDel, postIns, postDel; changes = false; equalities = []; // Stack of indices where equalities are found. equalitiesLength = 0; // Keeping our own length var is faster in JS. /** @type {?string} */ lastequality = null; // Always equal to diffs[equalities[equalitiesLength - 1]][1] pointer = 0; // Index of current position. // Is there an insertion operation before the last equality. preIns = false; // Is there a deletion operation before the last equality. preDel = false; // Is there an insertion operation after the last equality. postIns = false; // Is there a deletion operation after the last equality. postDel = false; while (pointer < diffs.length) { // Equality found. if (diffs[pointer][0] === DIFF_EQUAL) { if (diffs[pointer][1].length < 4 && (postIns || postDel)) { // Candidate found. equalities[equalitiesLength++] = pointer; preIns = postIns; preDel = postDel; lastequality = diffs[pointer][1]; } else { // Not a candidate, and can never become one. equalitiesLength = 0; lastequality = null; } postIns = postDel = false; // An insertion or deletion. } else { if (diffs[pointer][0] === DIFF_DELETE) { postDel = true; } else { postIns = true; } /* * Five types to be split: * ABXYCD * AXCD * ABXC * AXCD * ABXC */ if (lastequality && (preIns && preDel && postIns && postDel || lastequality.length < 2 && preIns + preDel + postIns + postDel === 3)) { // Duplicate record. diffs.splice(equalities[equalitiesLength - 1], 0, [DIFF_DELETE, lastequality]); // Change second copy to insert. diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT; equalitiesLength--; // Throw away the equality we just deleted; lastequality = null; if (preIns && preDel) { // No changes made which could affect previous entry, keep going. postIns = postDel = true; equalitiesLength = 0; } else { equalitiesLength--; // Throw away the previous equality. pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1; postIns = postDel = false; } changes = true; } } pointer++; } if (changes) { this.diffCleanupMerge(diffs); } }; /** * Convert a diff array into a pretty HTML report. * @param {!Array.} diffs Array of diff tuples. * @param {integer} string to be beautified. * @return {string} HTML representation. */ DiffMatchPatch.prototype.diffPrettyHtml = function (diffs) { var html = []; for (var x = 0; x < diffs.length; x++) { var op = diffs[x][0]; // Operation (insert, delete, equal) var data = diffs[x][1]; // Text of change. switch (op) { case DIFF_INSERT: html[x] = '' + escapeText(data) + ''; break; case DIFF_DELETE: html[x] = '' + escapeText(data) + ''; break; case DIFF_EQUAL: html[x] = '' + escapeText(data) + ''; break; } } return html.join(''); }; /** * Determine the common prefix of two strings. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {number} The number of characters common to the start of each * string. */ DiffMatchPatch.prototype.diffCommonPrefix = function (text1, text2) { var pointermid, pointermax, pointermin, pointerstart; // Quick check for common null cases. if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) { return 0; } // Binary search. // Performance analysis: https://neil.fraser.name/news/2007/10/09/ pointermin = 0; pointermax = Math.min(text1.length, text2.length); pointermid = pointermax; pointerstart = 0; while (pointermin < pointermid) { if (text1.substring(pointerstart, pointermid) === text2.substring(pointerstart, pointermid)) { pointermin = pointermid; pointerstart = pointermin; } else { pointermax = pointermid; } pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); } return pointermid; }; /** * Determine the common suffix of two strings. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {number} The number of characters common to the end of each string. */ DiffMatchPatch.prototype.diffCommonSuffix = function (text1, text2) { var pointermid, pointermax, pointermin, pointerend; // Quick check for common null cases. if (!text1 || !text2 || text1.charAt(text1.length - 1) !== text2.charAt(text2.length - 1)) { return 0; } // Binary search. // Performance analysis: https://neil.fraser.name/news/2007/10/09/ pointermin = 0; pointermax = Math.min(text1.length, text2.length); pointermid = pointermax; pointerend = 0; while (pointermin < pointermid) { if (text1.substring(text1.length - pointermid, text1.length - pointerend) === text2.substring(text2.length - pointermid, text2.length - pointerend)) { pointermin = pointermid; pointerend = pointermin; } else { pointermax = pointermid; } pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); } return pointermid; }; /** * Find the differences between two texts. Assumes that the texts do not * have any common prefix or suffix. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {boolean} checklines Speedup flag. If false, then don't run a * line-level diff first to identify the changed areas. * If true, then run a faster, slightly less optimal diff. * @param {number} deadline Time when the diff should be complete by. * @return {!Array.} Array of diff tuples. * @private */ DiffMatchPatch.prototype.diffCompute = function (text1, text2, checklines, deadline) { var diffs, longtext, shorttext, i, hm, text1A, text2A, text1B, text2B, midCommon, diffsA, diffsB; if (!text1) { // Just add some text (speedup). return [[DIFF_INSERT, text2]]; } if (!text2) { // Just delete some text (speedup). return [[DIFF_DELETE, text1]]; } longtext = text1.length > text2.length ? text1 : text2; shorttext = text1.length > text2.length ? text2 : text1; i = longtext.indexOf(shorttext); if (i !== -1) { // Shorter text is inside the longer text (speedup). diffs = [[DIFF_INSERT, longtext.substring(0, i)], [DIFF_EQUAL, shorttext], [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; // Swap insertions for deletions if diff is reversed. if (text1.length > text2.length) { diffs[0][0] = diffs[2][0] = DIFF_DELETE; } return diffs; } if (shorttext.length === 1) { // Single character string. // After the previous speedup, the character can't be an equality. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; } // Check to see if the problem can be split in two. hm = this.diffHalfMatch(text1, text2); if (hm) { // A half-match was found, sort out the return data. text1A = hm[0]; text1B = hm[1]; text2A = hm[2]; text2B = hm[3]; midCommon = hm[4]; // Send both pairs off for separate processing. diffsA = this.DiffMain(text1A, text2A, checklines, deadline); diffsB = this.DiffMain(text1B, text2B, checklines, deadline); // Merge the results. return diffsA.concat([[DIFF_EQUAL, midCommon]], diffsB); } if (checklines && text1.length > 100 && text2.length > 100) { return this.diffLineMode(text1, text2, deadline); } return this.diffBisect(text1, text2, deadline); }; /** * Do the two texts share a substring which is at least half the length of the * longer text? * This speedup can produce non-minimal diffs. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {Array.} Five element Array, containing the prefix of * text1, the suffix of text1, the prefix of text2, the suffix of * text2 and the common middle. Or null if there was no match. * @private */ DiffMatchPatch.prototype.diffHalfMatch = function (text1, text2) { var longtext, shorttext, dmp, text1A, text2B, text2A, text1B, midCommon, hm1, hm2, hm; longtext = text1.length > text2.length ? text1 : text2; shorttext = text1.length > text2.length ? text2 : text1; if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { return null; // Pointless. } dmp = this; // 'this' becomes 'window' in a closure. /** * Does a substring of shorttext exist within longtext such that the substring * is at least half the length of longtext? * Closure, but does not reference any external variables. * @param {string} longtext Longer string. * @param {string} shorttext Shorter string. * @param {number} i Start index of quarter length substring within longtext. * @return {Array.} Five element Array, containing the prefix of * longtext, the suffix of longtext, the prefix of shorttext, the suffix * of shorttext and the common middle. Or null if there was no match. * @private */ function diffHalfMatchI(longtext, shorttext, i) { var seed, j, bestCommon, prefixLength, suffixLength, bestLongtextA, bestLongtextB, bestShorttextA, bestShorttextB; // Start with a 1/4 length substring at position i as a seed. seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); j = -1; bestCommon = ''; while ((j = shorttext.indexOf(seed, j + 1)) !== -1) { prefixLength = dmp.diffCommonPrefix(longtext.substring(i), shorttext.substring(j)); suffixLength = dmp.diffCommonSuffix(longtext.substring(0, i), shorttext.substring(0, j)); if (bestCommon.length < suffixLength + prefixLength) { bestCommon = shorttext.substring(j - suffixLength, j) + shorttext.substring(j, j + prefixLength); bestLongtextA = longtext.substring(0, i - suffixLength); bestLongtextB = longtext.substring(i + prefixLength); bestShorttextA = shorttext.substring(0, j - suffixLength); bestShorttextB = shorttext.substring(j + prefixLength); } } if (bestCommon.length * 2 >= longtext.length) { return [bestLongtextA, bestLongtextB, bestShorttextA, bestShorttextB, bestCommon]; } else { return null; } } // First check if the second quarter is the seed for a half-match. hm1 = diffHalfMatchI(longtext, shorttext, Math.ceil(longtext.length / 4)); // Check again based on the third quarter. hm2 = diffHalfMatchI(longtext, shorttext, Math.ceil(longtext.length / 2)); if (!hm1 && !hm2) { return null; } else if (!hm2) { hm = hm1; } else if (!hm1) { hm = hm2; } else { // Both matched. Select the longest. hm = hm1[4].length > hm2[4].length ? hm1 : hm2; } // A half-match was found, sort out the return data. if (text1.length > text2.length) { text1A = hm[0]; text1B = hm[1]; text2A = hm[2]; text2B = hm[3]; } else { text2A = hm[0]; text2B = hm[1]; text1A = hm[2]; text1B = hm[3]; } midCommon = hm[4]; return [text1A, text1B, text2A, text2B, midCommon]; }; /** * Do a quick line-level diff on both strings, then rediff the parts for * greater accuracy. * This speedup can produce non-minimal diffs. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {number} deadline Time when the diff should be complete by. * @return {!Array.} Array of diff tuples. * @private */ DiffMatchPatch.prototype.diffLineMode = function (text1, text2, deadline) { var a, diffs, linearray, pointer, countInsert, countDelete, textInsert, textDelete, j; // Scan the text on a line-by-line basis first. a = this.diffLinesToChars(text1, text2); text1 = a.chars1; text2 = a.chars2; linearray = a.lineArray; diffs = this.DiffMain(text1, text2, false, deadline); // Convert the diff back to original text. this.diffCharsToLines(diffs, linearray); // Eliminate freak matches (e.g. blank lines) this.diffCleanupSemantic(diffs); // Rediff any replacement blocks, this time character-by-character. // Add a dummy entry at the end. diffs.push([DIFF_EQUAL, '']); pointer = 0; countDelete = 0; countInsert = 0; textDelete = ''; textInsert = ''; while (pointer < diffs.length) { switch (diffs[pointer][0]) { case DIFF_INSERT: countInsert++; textInsert += diffs[pointer][1]; break; case DIFF_DELETE: countDelete++; textDelete += diffs[pointer][1]; break; case DIFF_EQUAL: // Upon reaching an equality, check for prior redundancies. if (countDelete >= 1 && countInsert >= 1) { // Delete the offending records and add the merged ones. diffs.splice(pointer - countDelete - countInsert, countDelete + countInsert); pointer = pointer - countDelete - countInsert; a = this.DiffMain(textDelete, textInsert, false, deadline); for (j = a.length - 1; j >= 0; j--) { diffs.splice(pointer, 0, a[j]); } pointer = pointer + a.length; } countInsert = 0; countDelete = 0; textDelete = ''; textInsert = ''; break; } pointer++; } diffs.pop(); // Remove the dummy entry at the end. return diffs; }; /** * Find the 'middle snake' of a diff, split the problem in two * and return the recursively constructed diff. * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {number} deadline Time at which to bail if not yet complete. * @return {!Array.} Array of diff tuples. * @private */ DiffMatchPatch.prototype.diffBisect = function (text1, text2, deadline) { var text1Length, text2Length, maxD, vOffset, vLength, v1, v2, x, delta, front, k1start, k1end, k2start, k2end, k2Offset, k1Offset, x1, x2, y1, y2, d, k1, k2; // Cache the text lengths to prevent multiple calls. text1Length = text1.length; text2Length = text2.length; maxD = Math.ceil((text1Length + text2Length) / 2); vOffset = maxD; vLength = 2 * maxD; v1 = new Array(vLength); v2 = new Array(vLength); // Setting all elements to -1 is faster in Chrome & Firefox than mixing // integers and undefined. for (x = 0; x < vLength; x++) { v1[x] = -1; v2[x] = -1; } v1[vOffset + 1] = 0; v2[vOffset + 1] = 0; delta = text1Length - text2Length; // If the total number of characters is odd, then the front path will collide // with the reverse path. front = delta % 2 !== 0; // Offsets for start and end of k loop. // Prevents mapping of space beyond the grid. k1start = 0; k1end = 0; k2start = 0; k2end = 0; for (d = 0; d < maxD; d++) { // Bail out if deadline is reached. if (Date.now() > deadline) { break; } // Walk the front path one step. for (k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { k1Offset = vOffset + k1; if (k1 === -d || k1 !== d && v1[k1Offset - 1] < v1[k1Offset + 1]) { x1 = v1[k1Offset + 1]; } else { x1 = v1[k1Offset - 1] + 1; } y1 = x1 - k1; while (x1 < text1Length && y1 < text2Length && text1.charAt(x1) === text2.charAt(y1)) { x1++; y1++; } v1[k1Offset] = x1; if (x1 > text1Length) { // Ran off the right of the graph. k1end += 2; } else if (y1 > text2Length) { // Ran off the bottom of the graph. k1start += 2; } else if (front) { k2Offset = vOffset + delta - k1; if (k2Offset >= 0 && k2Offset < vLength && v2[k2Offset] !== -1) { // Mirror x2 onto top-left coordinate system. x2 = text1Length - v2[k2Offset]; if (x1 >= x2) { // Overlap detected. return this.diffBisectSplit(text1, text2, x1, y1, deadline); } } } } // Walk the reverse path one step. for (k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { k2Offset = vOffset + k2; if (k2 === -d || k2 !== d && v2[k2Offset - 1] < v2[k2Offset + 1]) { x2 = v2[k2Offset + 1]; } else { x2 = v2[k2Offset - 1] + 1; } y2 = x2 - k2; while (x2 < text1Length && y2 < text2Length && text1.charAt(text1Length - x2 - 1) === text2.charAt(text2Length - y2 - 1)) { x2++; y2++; } v2[k2Offset] = x2; if (x2 > text1Length) { // Ran off the left of the graph. k2end += 2; } else if (y2 > text2Length) { // Ran off the top of the graph. k2start += 2; } else if (!front) { k1Offset = vOffset + delta - k2; if (k1Offset >= 0 && k1Offset < vLength && v1[k1Offset] !== -1) { x1 = v1[k1Offset]; y1 = vOffset + x1 - k1Offset; // Mirror x2 onto top-left coordinate system. x2 = text1Length - x2; if (x1 >= x2) { // Overlap detected. return this.diffBisectSplit(text1, text2, x1, y1, deadline); } } } } } // Diff took too long and hit the deadline or // number of diffs equals number of characters, no commonality at all. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; }; /** * Given the location of the 'middle snake', split the diff in two parts * and recurse. * @param {string} text1 Old string to be diffed. * @param {string} text2 New string to be diffed. * @param {number} x Index of split point in text1. * @param {number} y Index of split point in text2. * @param {number} deadline Time at which to bail if not yet complete. * @return {!Array.} Array of diff tuples. * @private */ DiffMatchPatch.prototype.diffBisectSplit = function (text1, text2, x, y, deadline) { var text1a, text1b, text2a, text2b, diffs, diffsb; text1a = text1.substring(0, x); text2a = text2.substring(0, y); text1b = text1.substring(x); text2b = text2.substring(y); // Compute both diffs serially. diffs = this.DiffMain(text1a, text2a, false, deadline); diffsb = this.DiffMain(text1b, text2b, false, deadline); return diffs.concat(diffsb); }; /** * Reduce the number of edits by eliminating semantically trivial equalities. * @param {!Array.} diffs Array of diff tuples. */ DiffMatchPatch.prototype.diffCleanupSemantic = function (diffs) { var changes = false; var equalities = []; // Stack of indices where equalities are found. var equalitiesLength = 0; // Keeping our own length var is faster in JS. /** @type {?string} */ var lastequality = null; // Always equal to diffs[equalities[equalitiesLength - 1]][1] var pointer = 0; // Index of current position. // Number of characters that changed prior to the equality. var lengthInsertions1 = 0; var lengthDeletions1 = 0; // Number of characters that changed after the equality. var lengthInsertions2 = 0; var lengthDeletions2 = 0; while (pointer < diffs.length) { if (diffs[pointer][0] === DIFF_EQUAL) { // Equality found. equalities[equalitiesLength++] = pointer; lengthInsertions1 = lengthInsertions2; lengthDeletions1 = lengthDeletions2; lengthInsertions2 = 0; lengthDeletions2 = 0; lastequality = diffs[pointer][1]; } else { // An insertion or deletion. if (diffs[pointer][0] === DIFF_INSERT) { lengthInsertions2 += diffs[pointer][1].length; } else { lengthDeletions2 += diffs[pointer][1].length; } // Eliminate an equality that is smaller or equal to the edits on both // sides of it. if (lastequality && lastequality.length <= Math.max(lengthInsertions1, lengthDeletions1) && lastequality.length <= Math.max(lengthInsertions2, lengthDeletions2)) { // Duplicate record. diffs.splice(equalities[equalitiesLength - 1], 0, [DIFF_DELETE, lastequality]); // Change second copy to insert. diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT; // Throw away the equality we just deleted. equalitiesLength--; // Throw away the previous equality (it needs to be reevaluated). equalitiesLength--; pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1; // Reset the counters. lengthInsertions1 = 0; lengthDeletions1 = 0; lengthInsertions2 = 0; lengthDeletions2 = 0; lastequality = null; changes = true; } } pointer++; } // Normalize the diff. if (changes) { this.diffCleanupMerge(diffs); } var deletion, insertion, overlapLength1, overlapLength2; // Find any overlaps between deletions and insertions. // e.g: abcxxxxxxdef // -> abcxxxdef // e.g: xxxabcdefxxx // -> defxxxabc // Only extract an overlap if it is as big as the edit ahead or behind it. pointer = 1; while (pointer < diffs.length) { if (diffs[pointer - 1][0] === DIFF_DELETE && diffs[pointer][0] === DIFF_INSERT) { deletion = diffs[pointer - 1][1]; insertion = diffs[pointer][1]; overlapLength1 = this.diffCommonOverlap(deletion, insertion); overlapLength2 = this.diffCommonOverlap(insertion, deletion); if (overlapLength1 >= overlapLength2) { if (overlapLength1 >= deletion.length / 2 || overlapLength1 >= insertion.length / 2) { // Overlap found. Insert an equality and trim the surrounding edits. diffs.splice(pointer, 0, [DIFF_EQUAL, insertion.substring(0, overlapLength1)]); diffs[pointer - 1][1] = deletion.substring(0, deletion.length - overlapLength1); diffs[pointer + 1][1] = insertion.substring(overlapLength1); pointer++; } } else { if (overlapLength2 >= deletion.length / 2 || overlapLength2 >= insertion.length / 2) { // Reverse overlap found. // Insert an equality and swap and trim the surrounding edits. diffs.splice(pointer, 0, [DIFF_EQUAL, deletion.substring(0, overlapLength2)]); diffs[pointer - 1][0] = DIFF_INSERT; diffs[pointer - 1][1] = insertion.substring(0, insertion.length - overlapLength2); diffs[pointer + 1][0] = DIFF_DELETE; diffs[pointer + 1][1] = deletion.substring(overlapLength2); pointer++; } } pointer++; } pointer++; } }; /** * Determine if the suffix of one string is the prefix of another. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {number} The number of characters common to the end of the first * string and the start of the second string. * @private */ DiffMatchPatch.prototype.diffCommonOverlap = function (text1, text2) { // Cache the text lengths to prevent multiple calls. var text1Length = text1.length; var text2Length = text2.length; // Eliminate the null case. if (text1Length === 0 || text2Length === 0) { return 0; } // Truncate the longer string. if (text1Length > text2Length) { text1 = text1.substring(text1Length - text2Length); } else if (text1Length < text2Length) { text2 = text2.substring(0, text1Length); } var textLength = Math.min(text1Length, text2Length); // Quick check for the worst case. if (text1 === text2) { return textLength; } // Start by looking for a single character match // and increase length until no match is found. // Performance analysis: https://neil.fraser.name/news/2010/11/04/ var best = 0; var length = 1; while (true) { var pattern = text1.substring(textLength - length); var found = text2.indexOf(pattern); if (found === -1) { return best; } length += found; if (found === 0 || text1.substring(textLength - length) === text2.substring(0, length)) { best = length; length++; } } }; /** * Split two texts into an array of strings. Reduce the texts to a string of * hashes where each Unicode character represents one line. * @param {string} text1 First string. * @param {string} text2 Second string. * @return {{chars1: string, chars2: string, lineArray: !Array.}} * An object containing the encoded text1, the encoded text2 and * the array of unique strings. * The zeroth element of the array of unique strings is intentionally blank. * @private */ DiffMatchPatch.prototype.diffLinesToChars = function (text1, text2) { var lineArray = []; // E.g. lineArray[4] === 'Hello\n' var lineHash = {}; // E.g. lineHash['Hello\n'] === 4 // '\x00' is a valid character, but various debuggers don't like it. // So we'll insert a junk entry to avoid generating a null character. lineArray[0] = ''; /** * Split a text into an array of strings. Reduce the texts to a string of * hashes where each Unicode character represents one line. * Modifies linearray and linehash through being a closure. * @param {string} text String to encode. * @return {string} Encoded string. * @private */ function diffLinesToCharsMunge(text) { var chars = ''; // Walk the text, pulling out a substring for each line. // text.split('\n') would would temporarily double our memory footprint. // Modifying text would create many large strings to garbage collect. var lineStart = 0; var lineEnd = -1; // Keeping our own length variable is faster than looking it up. var lineArrayLength = lineArray.length; while (lineEnd < text.length - 1) { lineEnd = text.indexOf('\n', lineStart); if (lineEnd === -1) { lineEnd = text.length - 1; } var line = text.substring(lineStart, lineEnd + 1); lineStart = lineEnd + 1; if (hasOwn.call(lineHash, line)) { chars += String.fromCharCode(lineHash[line]); } else { chars += String.fromCharCode(lineArrayLength); lineHash[line] = lineArrayLength; lineArray[lineArrayLength++] = line; } } return chars; } var chars1 = diffLinesToCharsMunge(text1); var chars2 = diffLinesToCharsMunge(text2); return { chars1: chars1, chars2: chars2, lineArray: lineArray }; }; /** * Rehydrate the text in a diff from a string of line hashes to real lines of * text. * @param {!Array.} diffs Array of diff tuples. * @param {!Array.} lineArray Array of unique strings. * @private */ DiffMatchPatch.prototype.diffCharsToLines = function (diffs, lineArray) { for (var x = 0; x < diffs.length; x++) { var chars = diffs[x][1]; var text = []; for (var y = 0; y < chars.length; y++) { text[y] = lineArray[chars.charCodeAt(y)]; } diffs[x][1] = text.join(''); } }; /** * Reorder and merge like edit sections. Merge equalities. * Any edit section can move as long as it doesn't cross an equality. * @param {!Array.} diffs Array of diff tuples. */ DiffMatchPatch.prototype.diffCleanupMerge = function (diffs) { diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. var pointer = 0; var countDelete = 0; var countInsert = 0; var textDelete = ''; var textInsert = ''; while (pointer < diffs.length) { switch (diffs[pointer][0]) { case DIFF_INSERT: countInsert++; textInsert += diffs[pointer][1]; pointer++; break; case DIFF_DELETE: countDelete++; textDelete += diffs[pointer][1]; pointer++; break; case DIFF_EQUAL: // Upon reaching an equality, check for prior redundancies. if (countDelete + countInsert > 1) { if (countDelete !== 0 && countInsert !== 0) { // Factor out any common prefixes. var commonlength = this.diffCommonPrefix(textInsert, textDelete); if (commonlength !== 0) { if (pointer - countDelete - countInsert > 0 && diffs[pointer - countDelete - countInsert - 1][0] === DIFF_EQUAL) { diffs[pointer - countDelete - countInsert - 1][1] += textInsert.substring(0, commonlength); } else { diffs.splice(0, 0, [DIFF_EQUAL, textInsert.substring(0, commonlength)]); pointer++; } textInsert = textInsert.substring(commonlength); textDelete = textDelete.substring(commonlength); } // Factor out any common suffixies. commonlength = this.diffCommonSuffix(textInsert, textDelete); if (commonlength !== 0) { diffs[pointer][1] = textInsert.substring(textInsert.length - commonlength) + diffs[pointer][1]; textInsert = textInsert.substring(0, textInsert.length - commonlength); textDelete = textDelete.substring(0, textDelete.length - commonlength); } } // Delete the offending records and add the merged ones. if (countDelete === 0) { diffs.splice(pointer - countInsert, countDelete + countInsert, [DIFF_INSERT, textInsert]); } else if (countInsert === 0) { diffs.splice(pointer - countDelete, countDelete + countInsert, [DIFF_DELETE, textDelete]); } else { diffs.splice(pointer - countDelete - countInsert, countDelete + countInsert, [DIFF_DELETE, textDelete], [DIFF_INSERT, textInsert]); } pointer = pointer - countDelete - countInsert + (countDelete ? 1 : 0) + (countInsert ? 1 : 0) + 1; } else if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) { // Merge this equality with the previous one. diffs[pointer - 1][1] += diffs[pointer][1]; diffs.splice(pointer, 1); } else { pointer++; } countInsert = 0; countDelete = 0; textDelete = ''; textInsert = ''; break; } } if (diffs[diffs.length - 1][1] === '') { diffs.pop(); // Remove the dummy entry at the end. } // Second pass: look for single edits surrounded on both sides by equalities // which can be shifted sideways to eliminate an equality. // e.g: ABAC -> ABAC var changes = false; pointer = 1; // Intentionally ignore the first and last element (don't need checking). while (pointer < diffs.length - 1) { if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) { var diffPointer = diffs[pointer][1]; var position = diffPointer.substring(diffPointer.length - diffs[pointer - 1][1].length); // This is a single edit surrounded by equalities. if (position === diffs[pointer - 1][1]) { // Shift the edit over the previous equality. diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length); diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]; diffs.splice(pointer - 1, 1); changes = true; } else if (diffPointer.substring(0, diffs[pointer + 1][1].length) === diffs[pointer + 1][1]) { // Shift the edit over the next equality. diffs[pointer - 1][1] += diffs[pointer + 1][1]; diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1]; diffs.splice(pointer + 1, 1); changes = true; } } pointer++; } // If shifts were made, the diff needs reordering and another shift sweep. if (changes) { this.diffCleanupMerge(diffs); } }; return function (o, n) { var diff, output, text; diff = new DiffMatchPatch(); output = diff.DiffMain(o, n); diff.diffCleanupEfficiency(output); text = diff.diffPrettyHtml(output); return text; }; }(); })(); ================================================ FILE: common/Tests/External/qunit.d.ts ================================================ // Type definitions for QUnit 1.10 // Project: http://qunitjs.com/ // Definitions by: Diullei Gomes // DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped interface DoneCallbackObject { /** * The number of failed assertions */ failed: number; /** * The number of passed assertions */ passed: number; /** * The total number of assertions */ total: number; /** * The time in milliseconds it took tests to run from start to finish. */ runtime: number; } interface LogCallbackObject { /** * The boolean result of an assertion, true means passed, false means failed. */ result: boolean; /** * One side of a comparision assertion. Can be undefined when ok() is used. */ actual: Object; /** * One side of a comparision assertion. Can be undefined when ok() is used. */ expected: Object; /** * A string description provided by the assertion. */ message: string; /** * The associated stacktrace, either from an exception or pointing to the source * of the assertion. Depends on browser support for providing stacktraces, so can be * undefined. */ source: string; } interface ModuleStartCallbackObject { /** * Name of the next module to run */ name: string; } interface ModuleDoneCallbackObject { /** * Name of this module */ name: string; /** * The number of failed assertions */ failed: number; /** * The number of passed assertions */ passed: number; /** * The total number of assertions */ total: number; } interface TestDoneCallbackObject { /** * TName of the next test to run */ name: string; /** * Name of the current module */ module: string; /** * The number of failed assertions */ failed: number; /** * The number of passed assertions */ passed: number; /** * The total number of assertions */ total: number; /** * The total runtime, including setup and teardown */ duration: number; } interface TestStartCallbackObject { /** * Name of the next test to run */ name: string; /** * Name of the current module */ module: string; } interface Config { altertitle: boolean; autostart: boolean; current: Object; reorder: boolean; requireExpects: boolean; testTimeout: number; urlConfig: Array; done: any; } interface URLConfigItem { id: string; label: string; tooltip: string; } interface LifecycleObject { /** * Runs before each test */ setup?: () => any; /** * Runs after each test */ teardown?: () => any; } interface QUnitAssert { /* ASSERT */ assert: any; current_testEnvironment: any; jsDump: any; /** * A deep recursive comparison assertion, working on primitive types, arrays, objects, * regular expressions, dates and functions. * * The deepEqual() assertion can be used just like equal() when comparing the value of * objects, such that { key: value } is equal to { key: value }. For non-scalar values, * identity will be disregarded by deepEqual. * * @param actual - Object or Expression being tested * @param expected - Known comparison value * @param message - A short description of the assertion */ deepEqual(actual: any, expected: any, message?: string): any; /** * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. * * The equal assertion uses the simple comparison operator (==) to compare the actual * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. * When it fails, both actual and expected values are displayed in the test result, * in addition to a given message. * * @param actual - Expression being tested * @param expected - Known comparison value * @param message - A short description of the assertion */ equal(actual: any, expected: any, message?: string): any; /** * An inverted deep recursive comparison assertion, working on primitive types, * arrays, objects, regular expressions, dates and functions. * * The notDeepEqual() assertion can be used just like equal() when comparing the * value of objects, such that { key: value } is equal to { key: value }. For non-scalar * values, identity will be disregarded by notDeepEqual. * * @param actual - Object or Expression being tested * @param expected - Known comparison value * @param message - A short description of the assertion */ notDeepEqual(actual: any, expected: any, message?: string): any; /** * A non-strict comparison assertion, checking for inequality. * * The notEqual assertion uses the simple inverted comparison operator (!=) to compare * the actual and expected arguments. When they aren't equal, the assertion passes: any; * otherwise, it fails. When it fails, both actual and expected values are displayed * in the test result, in addition to a given message. * * @param actual - Expression being tested * @param expected - Known comparison value * @param message - A short description of the assertion */ notEqual(actual: any, expected: any, message?: string): any; notPropEqual(actual: any, expected: any, message?: string): any; propEqual(actual: any, expected: any, message?: string): any; /** * A non-strict comparison assertion, checking for inequality. * * The notStrictEqual assertion uses the strict inverted comparison operator (!==) * to compare the actual and expected arguments. When they aren't equal, the assertion * passes: any; otherwise, it fails. When it fails, both actual and expected values are * displayed in the test result, in addition to a given message. * * @param actual - Expression being tested * @param expected - Known comparison value * @param message - A short description of the assertion */ notStrictEqual(actual: any, expected: any, message?: string): any; /** * A boolean assertion, equivalent to CommonJS’s assert.ok() and JUnit’s assertTrue(). * Passes if the first argument is truthy. * * The most basic assertion in QUnit, ok() requires just one argument. If the argument * evaluates to true, the assertion passes; otherwise, it fails. If a second message * argument is provided, it will be displayed in place of the result. * * @param state - Expression being tested * @param message - A short description of the assertion */ ok(state: any, message?: string): any; /** * A strict type and value comparison assertion. * * The strictEqual() assertion provides the most rigid comparison of type and value with * the strict equality operator (===) * * @param actual - Expression being tested * @param expected - Known comparison value * @param message - A short description of the assertion */ strictEqual(actual: any, expected: any, message?: string): any; /** * Assertion to test if a callback throws an exception when run. * * When testing code that is expected to throw an exception based on a specific set of * circumstances, use throws() to catch the error object for testing and comparison. * * @param block - Function to execute * @param expected - Error Object to compare * @param message - A short description of the assertion */ throws(block: () => any, expected: any, message?: string): any; /** * @param block - Function to execute * @param message - A short description of the assertion */ throws(block: () => any, message?: string): any; } interface QUnitStatic extends QUnitAssert{ /* ASYNC CONTROL */ /** * Start running tests again after the testrunner was stopped. See stop(). * * When your async test has multiple exit points, call start() for the corresponding number of stop() increments. * * @param decrement - Optional argument to merge multiple start() calls into one. Use with multiple corrsponding stop() calls. */ start(decrement?: number): any; /** * Stop the testrunner to wait for async tests to run. Call start() to continue. * * When your async test has multiple exit points, call stop() with the increment argument, corresponding to the number of start() calls you need. * * On Blackberry 5.0, window.stop is a native read-only function. If you deal with that browser, use QUnit.stop() instead, which will work anywhere. * * @param decrement - Optional argument to merge multiple stop() calls into one. Use with multiple corrsponding start() calls. */ stop(increment? : number): any; /* CALLBACKS */ /** * Register a callback to fire whenever the test suite begins. * * QUnit.begin() is called once before running any tests. (a better would've been QUnit.start, * but thats already in use elsewhere and can't be changed.) * * @param callback - Callback to execute */ begin(callback: () => any): any; /** * Register a callback to fire whenever the test suite ends. * * @param callback - Callback to execute. */ done(callback: (details: DoneCallbackObject) => any): any; /** * Register a callback to fire whenever an assertion completes. * * This is one of several callbacks QUnit provides. Its intended for integration scenarios like * PhantomJS or Jenkins. The properties of the details argument are listed below as options. * * @param callback - Callback to execute. */ log(callback: (details: LogCallbackObject) => any): any; /** * Register a callback to fire whenever a module ends. * * @param callback - Callback to execute. */ moduleDone(callback: (details: ModuleDoneCallbackObject) => any): any; /** * Register a callback to fire whenever a module begins. * * @param callback - Callback to execute. */ moduleStart(callback: (details: ModuleStartCallbackObject) => any): any; /** * Register a callback to fire whenever a test ends. * * @param callback - Callback to execute. */ testDone(callback: (details: TestDoneCallbackObject) => any): any; /** * Register a callback to fire whenever a test begins. * * @param callback - Callback to execute. */ testStart(callback: (details: TestStartCallbackObject) => any): any; /* CONFIGURATION */ /** * QUnit has a bunch of internal configuration defaults, some of which are * useful to override. Check the description for each option for details. */ config: Config; /* TEST */ /** * Add an asynchronous test to run. The test must include a call to start(). * * For testing asynchronous code, asyncTest will automatically stop the test runner * and wait for your code to call start() to continue. * * @param name - Title of unit being tested * @param expected - Number of assertions in this test * @param test - Function to close over assertions */ asyncTest(name: string, expected: number, test: () => any): any; /** * Add an asynchronous test to run. The test must include a call to start(). * * For testing asynchronous code, asyncTest will automatically stop the test runner * and wait for your code to call start() to continue. * * @param name - Title of unit being tested * @param test - Function to close over assertions */ asyncTest(name: string, test: () => any): any; /** * Specify how many assertions are expected to run within a test. * * To ensure that an explicit number of assertions are run within any test, use * expect( number ) to register an expected count. If the number of assertions * run does not match the expected count, the test will fail. * * @param amount - Number of assertions in this test. */ expect(amount: number): any; /** * Group related tests under a single label. * * All tests that occur after a call to module() will be grouped into that module. * The test names will all be preceded by the module name in the test results. * You can then use that module name to select tests to run. * * @param name - Label for this group of tests * @param lifecycle - Callbacks to run before and after each test */ module(name: string, lifecycle?: LifecycleObject): any; /** * Add a test to run. * * When testing the most common, synchronous code, use test(). * The assert argument to the callback contains all of QUnit's assertion methods. * If you are avoiding using any of QUnit's globals, you can use the assert * argument instead. * * @param title - Title of unit being tested * @param expected - Number of assertions in this test * @param test - Function to close over assertions */ test(title: string, expected: number, test: (assert: QUnitAssert) => any): any; /** * @param title - Title of unit being tested * @param test - Function to close over assertions */ test(title: string, test: (assert: QUnitAssert) => any): any; /** * https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L1568 */ equiv(a: any, b: any): any; // https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L661 raises: any; /** * https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L897 */ push(result: any, actual: any, expected: any, message: string): any; /** * https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L839 */ reset(): any; } /* ASSERT */ /** * A deep recursive comparison assertion, working on primitive types, arrays, objects, * regular expressions, dates and functions. * * The deepEqual() assertion can be used just like equal() when comparing the value of * objects, such that { key: value } is equal to { key: value }. For non-scalar values, * identity will be disregarded by deepEqual. * * @param actual - Object or Expression being tested * @param expected - Known comparison value * @param message - A short description of the assertion */ declare function deepEqual(actual: any, expected: any, message?: string): any; /** * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. * * The equal assertion uses the simple comparison operator (==) to compare the actual * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. * When it fails, both actual and expected values are displayed in the test result, * in addition to a given message. * * @param actual - Expression being tested * @param expected - Known comparison value * @param message - A short description of the assertion */ declare function equal(actual: any, expected: any, message?: string): any; /** * An inverted deep recursive comparison assertion, working on primitive types, * arrays, objects, regular expressions, dates and functions. * * The notDeepEqual() assertion can be used just like equal() when comparing the * value of objects, such that { key: value } is equal to { key: value }. For non-scalar * values, identity will be disregarded by notDeepEqual. * * @param actual - Object or Expression being tested * @param expected - Known comparison value * @param message - A short description of the assertion */ declare function notDeepEqual(actual: any, expected: any, message?: string): any; /** * A non-strict comparison assertion, checking for inequality. * * The notEqual assertion uses the simple inverted comparison operator (!=) to compare * the actual and expected arguments. When they aren't equal, the assertion passes; * otherwise, it fails. When it fails, both actual and expected values are displayed * in the test result, in addition to a given message. * * @param actual - Expression being tested * @param expected - Known comparison value * @param message - A short description of the assertion */ declare function notEqual(actual: any, expected: any, message?: string): any; /** * A non-strict comparison assertion, checking for inequality. * * The notStrictEqual assertion uses the strict inverted comparison operator (!==) * to compare the actual and expected arguments. When they aren't equal, the assertion * passes; otherwise, it fails. When it fails, both actual and expected values are * displayed in the test result, in addition to a given message. * * @param actual - Expression being tested * @param expected - Known comparison value * @param message - A short description of the assertion */ declare function notStrictEqual(actual: any, expected: any, message?: string): any; /** * A boolean assertion, equivalent to CommonJS’s assert.ok() and JUnit’s assertTrue(). * Passes if the first argument is truthy. * * The most basic assertion in QUnit, ok() requires just one argument. If the argument * evaluates to true, the assertion passes; otherwise, it fails. If a second message * argument is provided, it will be displayed in place of the result. * * @param state - Expression being tested * @param message - A short description of the assertion */ declare function ok(state: any, message?: string): any; /** * A strict type and value comparison assertion. * * The strictEqual() assertion provides the most rigid comparison of type and value with * the strict equality operator (===) * * @param actual - Expression being tested * @param expected - Known comparison value * @param message - A short description of the assertion */ declare function strictEqual(actual: any, expected: any, message?: string): any; /** * Assertion to test if a callback throws an exception when run. * * When testing code that is expected to throw an exception based on a specific set of * circumstances, use throws() to catch the error object for testing and comparison. * * @param block - Function to execute * @param expected - Error Object to compare * @param message - A short description of the assertion */ declare function throws(block: () => any, expected: any, message?: string): any; /** * @param block - Function to execute * @param message - A short description of the assertion */ declare function throws(block: () => any, message?: string): any; /* ASYNC CONTROL */ /** * Start running tests again after the testrunner was stopped. See stop(). * * When your async test has multiple exit points, call start() for the corresponding number of stop() increments. * * @param decrement - Optional argument to merge multiple start() calls into one. Use with multiple corrsponding stop() calls. */ declare function start(decrement?: number): any; /** * Stop the testrunner to wait for async tests to run. Call start() to continue. * * When your async test has multiple exit points, call stop() with the increment argument, corresponding to the number of start() calls you need. * * On Blackberry 5.0, window.stop is a native read-only function. If you deal with that browser, use QUnit.stop() instead, which will work anywhere. * * @param decrement - Optional argument to merge multiple stop() calls into one. Use with multiple corrsponding start() calls. */ declare function stop(increment? : number): any; /* CALLBACKS */ /** * Register a callback to fire whenever the test suite begins. * * QUnit.begin() is called once before running any tests. (a better would've been QUnit.start, * but thats already in use elsewhere and can't be changed.) * * @param callback - Callback to execute */ declare function begin(callback: () => any): any; /** * Register a callback to fire whenever the test suite ends. * * @param callback - Callback to execute. */ declare function done(callback: (details: DoneCallbackObject) => any): any; /** * Register a callback to fire whenever an assertion completes. * * This is one of several callbacks QUnit provides. Its intended for integration scenarios like * PhantomJS or Jenkins. The properties of the details argument are listed below as options. * * @param callback - Callback to execute. */ declare function log(callback: (details: LogCallbackObject) => any): any; /** * Register a callback to fire whenever a module ends. * * @param callback - Callback to execute. */ declare function moduleDone(callback: (details: ModuleDoneCallbackObject) => any): any; /** * Register a callback to fire whenever a module begins. * * @param callback - Callback to execute. */ declare function moduleStart(callback: (name: string) => any): any; /** * Register a callback to fire whenever a test ends. * * @param callback - Callback to execute. */ declare function testDone(callback: (details: TestDoneCallbackObject) => any): any; /** * Register a callback to fire whenever a test begins. * * @param callback - Callback to execute. */ declare function testStart(callback: (details: TestStartCallbackObject) => any): any; /* TEST */ /** * Add an asynchronous test to run. The test must include a call to start(). * * For testing asynchronous code, asyncTest will automatically stop the test runner * and wait for your code to call start() to continue. * * @param name - Title of unit being tested * @param expected - Number of assertions in this test * @param test - Function to close over assertions */ declare function asyncTest(name: string, expected?: any, test?: () => any): any; /** * Add an asynchronous test to run. The test must include a call to start(). * * For testing asynchronous code, asyncTest will automatically stop the test runner * and wait for your code to call start() to continue. * * @param name - Title of unit being tested * @param test - Function to close over assertions */ declare function asyncTest(name: string, test: () => any): any; /** * Specify how many assertions are expected to run within a test. * * To ensure that an explicit number of assertions are run within any test, use * expect( number ) to register an expected count. If the number of assertions * run does not match the expected count, the test will fail. * * @param amount - Number of assertions in this test. */ declare function expect(amount: number): any; // ** conflict with TypeScript module keyword. Must be used on QUnit namespace //declare var module: (name: string, lifecycle?: LifecycleObject) => any; /** * Add a test to run. * * When testing the most common, synchronous code, use test(). * The assert argument to the callback contains all of QUnit's assertion methods. * If you are avoiding using any of QUnit's globals, you can use the assert * argument instead. * * @param title - Title of unit being tested * @param expected - Number of assertions in this test * @param test - Function to close over assertions */ declare function test(title: string, expected: number, test: (assert?: QUnitAssert) => any): any; /** * @param title - Title of unit being tested * @param test - Function to close over assertions */ declare function test(title: string, test: (assert?: QUnitAssert) => any): any; declare function notPropEqual(actual: any, expected: any, message?: string): any; declare function propEqual(actual: any, expected: any, message?: string): any; // https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L1568 declare function equiv(a: any, b: any): any; // https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L661 declare var raises: any; /* QUNIT */ declare var QUnit: QUnitStatic; ================================================ FILE: common/Tests/External/require-2.2.0.js ================================================ /** vim: et:ts=4:sw=4:sts=4 * @license RequireJS 2.2.0 Copyright jQuery Foundation and other contributors. * Released under MIT license, http://github.com/requirejs/requirejs/LICENSE */ //Not using strict: uneven strict support in browsers, #392, and causes //problems with requirejs.exec()/transpiler plugins that may not be strict. /*jslint regexp: true, nomen: true, sloppy: true */ /*global window, navigator, document, importScripts, setTimeout, opera */ var requirejs, require, define; (function (global) { var req, s, head, baseElement, dataMain, src, interactiveScript, currentlyAddingScript, mainScript, subPath, version = '2.2.0', commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, jsSuffixRegExp = /\.js$/, currDirRegExp = /^\.\//, op = Object.prototype, ostring = op.toString, hasOwn = op.hasOwnProperty, isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document), isWebWorker = !isBrowser && typeof importScripts !== 'undefined', //PS3 indicates loaded and complete, but need to wait for complete //specifically. Sequence is 'loading', 'loaded', execution, // then 'complete'. The UA check is unfortunate, but not sure how //to feature test w/o causing perf issues. readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? /^complete$/ : /^(complete|loaded)$/, defContextName = '_', //Oh the tragedy, detecting opera. See the usage of isOpera for reason. isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]', contexts = {}, cfg = {}, globalDefQueue = [], useInteractive = false; //Could match something like ')//comment', do not lose the prefix to comment. function commentReplace(match, multi, multiText, singlePrefix) { return singlePrefix || ''; } function isFunction(it) { return ostring.call(it) === '[object Function]'; } function isArray(it) { return ostring.call(it) === '[object Array]'; } /** * Helper function for iterating over an array. If the func returns * a true value, it will break out of the loop. */ function each(ary, func) { if (ary) { var i; for (i = 0; i < ary.length; i += 1) { if (ary[i] && func(ary[i], i, ary)) { break; } } } } /** * Helper function for iterating over an array backwards. If the func * returns a true value, it will break out of the loop. */ function eachReverse(ary, func) { if (ary) { var i; for (i = ary.length - 1; i > -1; i -= 1) { if (ary[i] && func(ary[i], i, ary)) { break; } } } } function hasProp(obj, prop) { return hasOwn.call(obj, prop); } function getOwn(obj, prop) { return hasProp(obj, prop) && obj[prop]; } /** * Cycles over properties in an object and calls a function for each * property value. If the function returns a truthy value, then the * iteration is stopped. */ function eachProp(obj, func) { var prop; for (prop in obj) { if (hasProp(obj, prop)) { if (func(obj[prop], prop)) { break; } } } } /** * Simple function to mix in properties from source into target, * but only if target does not already have a property of the same name. */ function mixin(target, source, force, deepStringMixin) { if (source) { eachProp(source, function (value, prop) { if (force || !hasProp(target, prop)) { if (deepStringMixin && typeof value === 'object' && value && !isArray(value) && !isFunction(value) && !(value instanceof RegExp)) { if (!target[prop]) { target[prop] = {}; } mixin(target[prop], value, force, deepStringMixin); } else { target[prop] = value; } } }); } return target; } //Similar to Function.prototype.bind, but the 'this' object is specified //first, since it is easier to read/figure out what 'this' will be. function bind(obj, fn) { return function () { return fn.apply(obj, arguments); }; } function scripts() { return document.getElementsByTagName('script'); } function defaultOnError(err) { throw err; } //Allow getting a global that is expressed in //dot notation, like 'a.b.c'. function getGlobal(value) { if (!value) { return value; } var g = global; each(value.split('.'), function (part) { g = g[part]; }); return g; } /** * Constructs an error with a pointer to an URL with more information. * @param {String} id the error ID that maps to an ID on a web page. * @param {String} message human readable error. * @param {Error} [err] the original error, if there is one. * * @returns {Error} */ function makeError(id, msg, err, requireModules) { var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id); e.requireType = id; e.requireModules = requireModules; if (err) { e.originalError = err; } return e; } if (typeof define !== 'undefined') { //If a define is already in play via another AMD loader, //do not overwrite. return; } if (typeof requirejs !== 'undefined') { if (isFunction(requirejs)) { //Do not overwrite an existing requirejs instance. return; } cfg = requirejs; requirejs = undefined; } //Allow for a require config object if (typeof require !== 'undefined' && !isFunction(require)) { //assume it is a config object. cfg = require; require = undefined; } function newContext(contextName) { var inCheckLoaded, Module, context, handlers, checkLoadedTimeoutId, config = { //Defaults. Do not set a default for map //config to speed up normalize(), which //will run faster if there is no default. waitSeconds: 7, baseUrl: './', paths: {}, bundles: {}, pkgs: {}, shim: {}, config: {} }, registry = {}, //registry of just enabled modules, to speed //cycle breaking code when lots of modules //are registered, but not activated. enabledRegistry = {}, undefEvents = {}, defQueue = [], defined = {}, urlFetched = {}, bundlesMap = {}, requireCounter = 1, unnormalizedCounter = 1; /** * Trims the . and .. from an array of path segments. * It will keep a leading path segment if a .. will become * the first path segment, to help with module name lookups, * which act like paths, but can be remapped. But the end result, * all paths that use this function should look normalized. * NOTE: this method MODIFIES the input array. * @param {Array} ary the array of path segments. */ function trimDots(ary) { var i, part; for (i = 0; i < ary.length; i++) { part = ary[i]; if (part === '.') { ary.splice(i, 1); i -= 1; } else if (part === '..') { // If at the start, or previous value is still .., // keep them so that when converted to a path it may // still work when converted to a path, even though // as an ID it is less than ideal. In larger point // releases, may be better to just kick out an error. if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') { continue; } else if (i > 0) { ary.splice(i - 1, 2); i -= 2; } } } } /** * Given a relative module name, like ./something, normalize it to * a real name that can be mapped to a path. * @param {String} name the relative name * @param {String} baseName a real name that the name arg is relative * to. * @param {Boolean} applyMap apply the map config to the value. Should * only be done if this normalization is for a dependency ID. * @returns {String} normalized name */ function normalize(name, baseName, applyMap) { var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex, foundMap, foundI, foundStarMap, starI, normalizedBaseParts, baseParts = (baseName && baseName.split('/')), map = config.map, starMap = map && map['*']; //Adjust any relative paths. if (name) { name = name.split('/'); lastIndex = name.length - 1; // If wanting node ID compatibility, strip .js from end // of IDs. Have to do this here, and not in nameToUrl // because node allows either .js or non .js to map // to same file. if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); } // Starts with a '.' so need the baseName if (name[0].charAt(0) === '.' && baseParts) { //Convert baseName to array, and lop off the last part, //so that . matches that 'directory' and not name of the baseName's //module. For instance, baseName of 'one/two/three', maps to //'one/two/three.js', but we want the directory, 'one/two' for //this normalization. normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); name = normalizedBaseParts.concat(name); } trimDots(name); name = name.join('/'); } //Apply map config if available. if (applyMap && map && (baseParts || starMap)) { nameParts = name.split('/'); outerLoop: for (i = nameParts.length; i > 0; i -= 1) { nameSegment = nameParts.slice(0, i).join('/'); if (baseParts) { //Find the longest baseName segment match in the config. //So, do joins on the biggest to smallest lengths of baseParts. for (j = baseParts.length; j > 0; j -= 1) { mapValue = getOwn(map, baseParts.slice(0, j).join('/')); //baseName segment has config, find if it has one for //this name. if (mapValue) { mapValue = getOwn(mapValue, nameSegment); if (mapValue) { //Match, update name to the new value. foundMap = mapValue; foundI = i; break outerLoop; } } } } //Check for a star map match, but just hold on to it, //if there is a shorter segment match later in a matching //config, then favor over this star map. if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) { foundStarMap = getOwn(starMap, nameSegment); starI = i; } } if (!foundMap && foundStarMap) { foundMap = foundStarMap; foundI = starI; } if (foundMap) { nameParts.splice(0, foundI, foundMap); name = nameParts.join('/'); } } // If the name points to a package's name, use // the package main instead. pkgMain = getOwn(config.pkgs, name); return pkgMain ? pkgMain : name; } function removeScript(name) { if (isBrowser) { each(scripts(), function (scriptNode) { if (scriptNode.getAttribute('data-requiremodule') === name && scriptNode.getAttribute('data-requirecontext') === context.contextName) { scriptNode.parentNode.removeChild(scriptNode); return true; } }); } } function hasPathFallback(id) { var pathConfig = getOwn(config.paths, id); if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) { //Pop off the first array value, since it failed, and //retry pathConfig.shift(); context.require.undef(id); //Custom require that does not do map translation, since //ID is "absolute", already mapped/resolved. context.makeRequire(null, { skipMap: true })([id]); return true; } } //Turns a plugin!resource to [plugin, resource] //with the plugin being undefined if the name //did not have a plugin prefix. function splitPrefix(name) { var prefix, index = name ? name.indexOf('!') : -1; if (index > -1) { prefix = name.substring(0, index); name = name.substring(index + 1, name.length); } return [prefix, name]; } /** * Creates a module mapping that includes plugin prefix, module * name, and path. If parentModuleMap is provided it will * also normalize the name via require.normalize() * * @param {String} name the module name * @param {String} [parentModuleMap] parent module map * for the module name, used to resolve relative names. * @param {Boolean} isNormalized: is the ID already normalized. * This is true if this call is done for a define() module ID. * @param {Boolean} applyMap: apply the map config to the ID. * Should only be true if this map is for a dependency. * * @returns {Object} */ function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { var url, pluginModule, suffix, nameParts, prefix = null, parentName = parentModuleMap ? parentModuleMap.name : null, originalName = name, isDefine = true, normalizedName = ''; //If no name, then it means it is a require call, generate an //internal name. if (!name) { isDefine = false; name = '_@r' + (requireCounter += 1); } nameParts = splitPrefix(name); prefix = nameParts[0]; name = nameParts[1]; if (prefix) { prefix = normalize(prefix, parentName, applyMap); pluginModule = getOwn(defined, prefix); } //Account for relative paths if there is a base name. if (name) { if (prefix) { if (pluginModule && pluginModule.normalize) { //Plugin is loaded, use its normalize method. normalizedName = pluginModule.normalize(name, function (name) { return normalize(name, parentName, applyMap); }); } else { // If nested plugin references, then do not try to // normalize, as it will not normalize correctly. This // places a restriction on resourceIds, and the longer // term solution is not to normalize until plugins are // loaded and all normalizations to allow for async // loading of a loader plugin. But for now, fixes the // common uses. Details in #1131 normalizedName = name.indexOf('!') === -1 ? normalize(name, parentName, applyMap) : name; } } else { //A regular module. normalizedName = normalize(name, parentName, applyMap); //Normalized name may be a plugin ID due to map config //application in normalize. The map config values must //already be normalized, so do not need to redo that part. nameParts = splitPrefix(normalizedName); prefix = nameParts[0]; normalizedName = nameParts[1]; isNormalized = true; url = context.nameToUrl(normalizedName); } } //If the id is a plugin id that cannot be determined if it needs //normalization, stamp it with a unique ID so two matching relative //ids that may conflict can be separate. suffix = prefix && !pluginModule && !isNormalized ? '_unnormalized' + (unnormalizedCounter += 1) : ''; return { prefix: prefix, name: normalizedName, parentMap: parentModuleMap, unnormalized: !!suffix, url: url, originalName: originalName, isDefine: isDefine, id: (prefix ? prefix + '!' + normalizedName : normalizedName) + suffix }; } function getModule(depMap) { var id = depMap.id, mod = getOwn(registry, id); if (!mod) { mod = registry[id] = new context.Module(depMap); } return mod; } function on(depMap, name, fn) { var id = depMap.id, mod = getOwn(registry, id); if (hasProp(defined, id) && (!mod || mod.defineEmitComplete)) { if (name === 'defined') { fn(defined[id]); } } else { mod = getModule(depMap); if (mod.error && name === 'error') { fn(mod.error); } else { mod.on(name, fn); } } } function onError(err, errback) { var ids = err.requireModules, notified = false; if (errback) { errback(err); } else { each(ids, function (id) { var mod = getOwn(registry, id); if (mod) { //Set error on module, so it skips timeout checks. mod.error = err; if (mod.events.error) { notified = true; mod.emit('error', err); } } }); if (!notified) { req.onError(err); } } } /** * Internal method to transfer globalQueue items to this context's * defQueue. */ function takeGlobalQueue() { //Push all the globalDefQueue items into the context's defQueue if (globalDefQueue.length) { each(globalDefQueue, function(queueItem) { var id = queueItem[0]; if (typeof id === 'string') { context.defQueueMap[id] = true; } defQueue.push(queueItem); }); globalDefQueue = []; } } handlers = { 'require': function (mod) { if (mod.require) { return mod.require; } else { return (mod.require = context.makeRequire(mod.map)); } }, 'exports': function (mod) { mod.usingExports = true; if (mod.map.isDefine) { if (mod.exports) { return (defined[mod.map.id] = mod.exports); } else { return (mod.exports = defined[mod.map.id] = {}); } } }, 'module': function (mod) { if (mod.module) { return mod.module; } else { return (mod.module = { id: mod.map.id, uri: mod.map.url, config: function () { return getOwn(config.config, mod.map.id) || {}; }, exports: mod.exports || (mod.exports = {}) }); } } }; function cleanRegistry(id) { //Clean up machinery used for waiting modules. delete registry[id]; delete enabledRegistry[id]; } function breakCycle(mod, traced, processed) { var id = mod.map.id; if (mod.error) { mod.emit('error', mod.error); } else { traced[id] = true; each(mod.depMaps, function (depMap, i) { var depId = depMap.id, dep = getOwn(registry, depId); //Only force things that have not completed //being defined, so still in the registry, //and only if it has not been matched up //in the module already. if (dep && !mod.depMatched[i] && !processed[depId]) { if (getOwn(traced, depId)) { mod.defineDep(i, defined[depId]); mod.check(); //pass false? } else { breakCycle(dep, traced, processed); } } }); processed[id] = true; } } function checkLoaded() { var err, usingPathFallback, waitInterval = config.waitSeconds * 1000, //It is possible to disable the wait interval by using waitSeconds of 0. expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), noLoads = [], reqCalls = [], stillLoading = false, needCycleCheck = true; //Do not bother if this call was a result of a cycle break. if (inCheckLoaded) { return; } inCheckLoaded = true; //Figure out the state of all the modules. eachProp(enabledRegistry, function (mod) { var map = mod.map, modId = map.id; //Skip things that are not enabled or in error state. if (!mod.enabled) { return; } if (!map.isDefine) { reqCalls.push(mod); } if (!mod.error) { //If the module should be executed, and it has not //been inited and time is up, remember it. if (!mod.inited && expired) { if (hasPathFallback(modId)) { usingPathFallback = true; stillLoading = true; } else { noLoads.push(modId); removeScript(modId); } } else if (!mod.inited && mod.fetched && map.isDefine) { stillLoading = true; if (!map.prefix) { //No reason to keep looking for unfinished //loading. If the only stillLoading is a //plugin resource though, keep going, //because it may be that a plugin resource //is waiting on a non-plugin cycle. return (needCycleCheck = false); } } } }); if (expired && noLoads.length) { //If wait time expired, throw error of unloaded modules. err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads); err.contextName = context.contextName; return onError(err); } //Not expired, check for a cycle. if (needCycleCheck) { each(reqCalls, function (mod) { breakCycle(mod, {}, {}); }); } //If still waiting on loads, and the waiting load is something //other than a plugin resource, or there are still outstanding //scripts, then just try back later. if ((!expired || usingPathFallback) && stillLoading) { //Something is still waiting to load. Wait for it, but only //if a timeout is not already in effect. if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { checkLoadedTimeoutId = setTimeout(function () { checkLoadedTimeoutId = 0; checkLoaded(); }, 50); } } inCheckLoaded = false; } Module = function (map) { this.events = getOwn(undefEvents, map.id) || {}; this.map = map; this.shim = getOwn(config.shim, map.id); this.depExports = []; this.depMaps = []; this.depMatched = []; this.pluginMaps = {}; this.depCount = 0; /* this.exports this.factory this.depMaps = [], this.enabled, this.fetched */ }; Module.prototype = { init: function (depMaps, factory, errback, options) { options = options || {}; //Do not do more inits if already done. Can happen if there //are multiple define calls for the same module. That is not //a normal, common case, but it is also not unexpected. if (this.inited) { return; } this.factory = factory; if (errback) { //Register for errors on this module. this.on('error', errback); } else if (this.events.error) { //If no errback already, but there are error listeners //on this module, set up an errback to pass to the deps. errback = bind(this, function (err) { this.emit('error', err); }); } //Do a copy of the dependency array, so that //source inputs are not modified. For example //"shim" deps are passed in here directly, and //doing a direct modification of the depMaps array //would affect that config. this.depMaps = depMaps && depMaps.slice(0); this.errback = errback; //Indicate this module has be initialized this.inited = true; this.ignore = options.ignore; //Could have option to init this module in enabled mode, //or could have been previously marked as enabled. However, //the dependencies are not known until init is called. So //if enabled previously, now trigger dependencies as enabled. if (options.enabled || this.enabled) { //Enable this module and dependencies. //Will call this.check() this.enable(); } else { this.check(); } }, defineDep: function (i, depExports) { //Because of cycles, defined callback for a given //export can be called more than once. if (!this.depMatched[i]) { this.depMatched[i] = true; this.depCount -= 1; this.depExports[i] = depExports; } }, fetch: function () { if (this.fetched) { return; } this.fetched = true; context.startTime = (new Date()).getTime(); var map = this.map; //If the manager is for a plugin managed resource, //ask the plugin to load it now. if (this.shim) { context.makeRequire(this.map, { enableBuildCallback: true })(this.shim.deps || [], bind(this, function () { return map.prefix ? this.callPlugin() : this.load(); })); } else { //Regular dependency. return map.prefix ? this.callPlugin() : this.load(); } }, load: function () { var url = this.map.url; //Regular dependency. if (!urlFetched[url]) { urlFetched[url] = true; context.load(this.map.id, url); } }, /** * Checks if the module is ready to define itself, and if so, * define it. */ check: function () { if (!this.enabled || this.enabling) { return; } var err, cjsModule, id = this.map.id, depExports = this.depExports, exports = this.exports, factory = this.factory; if (!this.inited) { // Only fetch if not already in the defQueue. if (!hasProp(context.defQueueMap, id)) { this.fetch(); } } else if (this.error) { this.emit('error', this.error); } else if (!this.defining) { //The factory could trigger another require call //that would result in checking this module to //define itself again. If already in the process //of doing that, skip this work. this.defining = true; if (this.depCount < 1 && !this.defined) { if (isFunction(factory)) { //If there is an error listener, favor passing //to that instead of throwing an error. However, //only do it for define()'d modules. require //errbacks should not be called for failures in //their callbacks (#699). However if a global //onError is set, use that. if ((this.events.error && this.map.isDefine) || req.onError !== defaultOnError) { try { exports = context.execCb(id, factory, depExports, exports); } catch (e) { err = e; } } else { exports = context.execCb(id, factory, depExports, exports); } // Favor return value over exports. If node/cjs in play, // then will not have a return value anyway. Favor // module.exports assignment over exports object. if (this.map.isDefine && exports === undefined) { cjsModule = this.module; if (cjsModule) { exports = cjsModule.exports; } else if (this.usingExports) { //exports already set the defined value. exports = this.exports; } } if (err) { err.requireMap = this.map; err.requireModules = this.map.isDefine ? [this.map.id] : null; err.requireType = this.map.isDefine ? 'define' : 'require'; return onError((this.error = err)); } } else { //Just a literal value exports = factory; } this.exports = exports; if (this.map.isDefine && !this.ignore) { defined[id] = exports; if (req.onResourceLoad) { var resLoadMaps = []; each(this.depMaps, function (depMap) { resLoadMaps.push(depMap.normalizedMap || depMap); }); req.onResourceLoad(context, this.map, resLoadMaps); } } //Clean up cleanRegistry(id); this.defined = true; } //Finished the define stage. Allow calling check again //to allow define notifications below in the case of a //cycle. this.defining = false; if (this.defined && !this.defineEmitted) { this.defineEmitted = true; this.emit('defined', this.exports); this.defineEmitComplete = true; } } }, callPlugin: function () { var map = this.map, id = map.id, //Map already normalized the prefix. pluginMap = makeModuleMap(map.prefix); //Mark this as a dependency for this plugin, so it //can be traced for cycles. this.depMaps.push(pluginMap); on(pluginMap, 'defined', bind(this, function (plugin) { var load, normalizedMap, normalizedMod, bundleId = getOwn(bundlesMap, this.map.id), name = this.map.name, parentName = this.map.parentMap ? this.map.parentMap.name : null, localRequire = context.makeRequire(map.parentMap, { enableBuildCallback: true }); //If current map is not normalized, wait for that //normalized name to load instead of continuing. if (this.map.unnormalized) { //Normalize the ID if the plugin allows it. if (plugin.normalize) { name = plugin.normalize(name, function (name) { return normalize(name, parentName, true); }) || ''; } //prefix and name should already be normalized, no need //for applying map config again either. normalizedMap = makeModuleMap(map.prefix + '!' + name, this.map.parentMap); on(normalizedMap, 'defined', bind(this, function (value) { this.map.normalizedMap = normalizedMap; this.init([], function () { return value; }, null, { enabled: true, ignore: true }); })); normalizedMod = getOwn(registry, normalizedMap.id); if (normalizedMod) { //Mark this as a dependency for this plugin, so it //can be traced for cycles. this.depMaps.push(normalizedMap); if (this.events.error) { normalizedMod.on('error', bind(this, function (err) { this.emit('error', err); })); } normalizedMod.enable(); } return; } //If a paths config, then just load that file instead to //resolve the plugin, as it is built into that paths layer. if (bundleId) { this.map.url = context.nameToUrl(bundleId); this.load(); return; } load = bind(this, function (value) { this.init([], function () { return value; }, null, { enabled: true }); }); load.error = bind(this, function (err) { this.inited = true; this.error = err; err.requireModules = [id]; //Remove temp unnormalized modules for this module, //since they will never be resolved otherwise now. eachProp(registry, function (mod) { if (mod.map.id.indexOf(id + '_unnormalized') === 0) { cleanRegistry(mod.map.id); } }); onError(err); }); //Allow plugins to load other code without having to know the //context or how to 'complete' the load. load.fromText = bind(this, function (text, textAlt) { /*jslint evil: true */ var moduleName = map.name, moduleMap = makeModuleMap(moduleName), hasInteractive = useInteractive; //As of 2.1.0, support just passing the text, to reinforce //fromText only being called once per resource. Still //support old style of passing moduleName but discard //that moduleName in favor of the internal ref. if (textAlt) { text = textAlt; } //Turn off interactive script matching for IE for any define //calls in the text, then turn it back on at the end. if (hasInteractive) { useInteractive = false; } //Prime the system by creating a module instance for //it. getModule(moduleMap); //Transfer any config to this other module. if (hasProp(config.config, id)) { config.config[moduleName] = config.config[id]; } try { req.exec(text); } catch (e) { return onError(makeError('fromtexteval', 'fromText eval for ' + id + ' failed: ' + e, e, [id])); } if (hasInteractive) { useInteractive = true; } //Mark this as a dependency for the plugin //resource this.depMaps.push(moduleMap); //Support anonymous modules. context.completeLoad(moduleName); //Bind the value of that module to the value for this //resource ID. localRequire([moduleName], load); }); //Use parentName here since the plugin's name is not reliable, //could be some weird string with no path that actually wants to //reference the parentName's path. plugin.load(map.name, localRequire, load, config); })); context.enable(pluginMap, this); this.pluginMaps[pluginMap.id] = pluginMap; }, enable: function () { enabledRegistry[this.map.id] = this; this.enabled = true; //Set flag mentioning that the module is enabling, //so that immediate calls to the defined callbacks //for dependencies do not trigger inadvertent load //with the depCount still being zero. this.enabling = true; //Enable each dependency each(this.depMaps, bind(this, function (depMap, i) { var id, mod, handler; if (typeof depMap === 'string') { //Dependency needs to be converted to a depMap //and wired up to this module. depMap = makeModuleMap(depMap, (this.map.isDefine ? this.map : this.map.parentMap), false, !this.skipMap); this.depMaps[i] = depMap; handler = getOwn(handlers, depMap.id); if (handler) { this.depExports[i] = handler(this); return; } this.depCount += 1; on(depMap, 'defined', bind(this, function (depExports) { if (this.undefed) { return; } this.defineDep(i, depExports); this.check(); })); if (this.errback) { on(depMap, 'error', bind(this, this.errback)); } else if (this.events.error) { // No direct errback on this module, but something // else is listening for errors, so be sure to // propagate the error correctly. on(depMap, 'error', bind(this, function(err) { this.emit('error', err); })); } } id = depMap.id; mod = registry[id]; //Skip special modules like 'require', 'exports', 'module' //Also, don't call enable if it is already enabled, //important in circular dependency cases. if (!hasProp(handlers, id) && mod && !mod.enabled) { context.enable(depMap, this); } })); //Enable each plugin that is used in //a dependency eachProp(this.pluginMaps, bind(this, function (pluginMap) { var mod = getOwn(registry, pluginMap.id); if (mod && !mod.enabled) { context.enable(pluginMap, this); } })); this.enabling = false; this.check(); }, on: function (name, cb) { var cbs = this.events[name]; if (!cbs) { cbs = this.events[name] = []; } cbs.push(cb); }, emit: function (name, evt) { each(this.events[name], function (cb) { cb(evt); }); if (name === 'error') { //Now that the error handler was triggered, remove //the listeners, since this broken Module instance //can stay around for a while in the registry. delete this.events[name]; } } }; function callGetModule(args) { //Skip modules already defined. if (!hasProp(defined, args[0])) { getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]); } } function removeListener(node, func, name, ieName) { //Favor detachEvent because of IE9 //issue, see attachEvent/addEventListener comment elsewhere //in this file. if (node.detachEvent && !isOpera) { //Probably IE. If not it will throw an error, which will be //useful to know. if (ieName) { node.detachEvent(ieName, func); } } else { node.removeEventListener(name, func, false); } } /** * Given an event from a script node, get the requirejs info from it, * and then removes the event listeners on the node. * @param {Event} evt * @returns {Object} */ function getScriptData(evt) { //Using currentTarget instead of target for Firefox 2.0's sake. Not //all old browsers will be supported, but this one was easy enough //to support and still makes sense. var node = evt.currentTarget || evt.srcElement; //Remove the listeners once here. removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange'); removeListener(node, context.onScriptError, 'error'); return { node: node, id: node && node.getAttribute('data-requiremodule') }; } function intakeDefines() { var args; //Any defined modules in the global queue, intake them now. takeGlobalQueue(); //Make sure any remaining defQueue items get properly processed. while (defQueue.length) { args = defQueue.shift(); if (args[0] === null) { return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])); } else { //args are id, deps, factory. Should be normalized by the //define() function. callGetModule(args); } } context.defQueueMap = {}; } context = { config: config, contextName: contextName, registry: registry, defined: defined, urlFetched: urlFetched, defQueue: defQueue, defQueueMap: {}, Module: Module, makeModuleMap: makeModuleMap, nextTick: req.nextTick, onError: onError, /** * Set a configuration for the context. * @param {Object} cfg config object to integrate. */ configure: function (cfg) { //Make sure the baseUrl ends in a slash. if (cfg.baseUrl) { if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { cfg.baseUrl += '/'; } } // Convert old style urlArgs string to a function. if (typeof cfg.urlArgs === 'string') { var urlArgs = cfg.urlArgs; cfg.urlArgs = function(id, url) { return (url.indexOf('?') === -1 ? '?' : '&') + urlArgs; }; } //Save off the paths since they require special processing, //they are additive. var shim = config.shim, objs = { paths: true, bundles: true, config: true, map: true }; eachProp(cfg, function (value, prop) { if (objs[prop]) { if (!config[prop]) { config[prop] = {}; } mixin(config[prop], value, true, true); } else { config[prop] = value; } }); //Reverse map the bundles if (cfg.bundles) { eachProp(cfg.bundles, function (value, prop) { each(value, function (v) { if (v !== prop) { bundlesMap[v] = prop; } }); }); } //Merge shim if (cfg.shim) { eachProp(cfg.shim, function (value, id) { //Normalize the structure if (isArray(value)) { value = { deps: value }; } if ((value.exports || value.init) && !value.exportsFn) { value.exportsFn = context.makeShimExports(value); } shim[id] = value; }); config.shim = shim; } //Adjust packages if necessary. if (cfg.packages) { each(cfg.packages, function (pkgObj) { var location, name; pkgObj = typeof pkgObj === 'string' ? {name: pkgObj} : pkgObj; name = pkgObj.name; location = pkgObj.location; if (location) { config.paths[name] = pkgObj.location; } //Save pointer to main module ID for pkg name. //Remove leading dot in main, so main paths are normalized, //and remove any trailing .js, since different package //envs have different conventions: some use a module name, //some use a file name. config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main') .replace(currDirRegExp, '') .replace(jsSuffixRegExp, ''); }); } //If there are any "waiting to execute" modules in the registry, //update the maps for them, since their info, like URLs to load, //may have changed. eachProp(registry, function (mod, id) { //If module already has init called, since it is too //late to modify them, and ignore unnormalized ones //since they are transient. if (!mod.inited && !mod.map.unnormalized) { mod.map = makeModuleMap(id, null, true); } }); //If a deps array or a config callback is specified, then call //require with those args. This is useful when require is defined as a //config object before require.js is loaded. if (cfg.deps || cfg.callback) { context.require(cfg.deps || [], cfg.callback); } }, makeShimExports: function (value) { function fn() { var ret; if (value.init) { ret = value.init.apply(global, arguments); } return ret || (value.exports && getGlobal(value.exports)); } return fn; }, makeRequire: function (relMap, options) { options = options || {}; function localRequire(deps, callback, errback) { var id, map, requireMod; if (options.enableBuildCallback && callback && isFunction(callback)) { callback.__requireJsBuild = true; } if (typeof deps === 'string') { if (isFunction(callback)) { //Invalid call return onError(makeError('requireargs', 'Invalid require call'), errback); } //If require|exports|module are requested, get the //value for them from the special handlers. Caveat: //this only works while module is being defined. if (relMap && hasProp(handlers, deps)) { return handlers[deps](registry[relMap.id]); } //Synchronous access to one module. If require.get is //available (as in the Node adapter), prefer that. if (req.get) { return req.get(context, deps, relMap, localRequire); } //Normalize module name, if it contains . or .. map = makeModuleMap(deps, relMap, false, true); id = map.id; if (!hasProp(defined, id)) { return onError(makeError('notloaded', 'Module name "' + id + '" has not been loaded yet for context: ' + contextName + (relMap ? '' : '. Use require([])'))); } return defined[id]; } //Grab defines waiting in the global queue. intakeDefines(); //Mark all the dependencies as needing to be loaded. context.nextTick(function () { //Some defines could have been added since the //require call, collect them. intakeDefines(); requireMod = getModule(makeModuleMap(null, relMap)); //Store if map config should be applied to this require //call for dependencies. requireMod.skipMap = options.skipMap; requireMod.init(deps, callback, errback, { enabled: true }); checkLoaded(); }); return localRequire; } mixin(localRequire, { isBrowser: isBrowser, /** * Converts a module name + .extension into an URL path. * *Requires* the use of a module name. It does not support using * plain URLs like nameToUrl. */ toUrl: function (moduleNamePlusExt) { var ext, index = moduleNamePlusExt.lastIndexOf('.'), segment = moduleNamePlusExt.split('/')[0], isRelative = segment === '.' || segment === '..'; //Have a file extension alias, and it is not the //dots from a relative path. if (index !== -1 && (!isRelative || index > 1)) { ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); moduleNamePlusExt = moduleNamePlusExt.substring(0, index); } return context.nameToUrl(normalize(moduleNamePlusExt, relMap && relMap.id, true), ext, true); }, defined: function (id) { return hasProp(defined, makeModuleMap(id, relMap, false, true).id); }, specified: function (id) { id = makeModuleMap(id, relMap, false, true).id; return hasProp(defined, id) || hasProp(registry, id); } }); //Only allow undef on top level require calls if (!relMap) { localRequire.undef = function (id) { //Bind any waiting define() calls to this context, //fix for #408 takeGlobalQueue(); var map = makeModuleMap(id, relMap, true), mod = getOwn(registry, id); mod.undefed = true; removeScript(id); delete defined[id]; delete urlFetched[map.url]; delete undefEvents[id]; //Clean queued defines too. Go backwards //in array so that the splices do not //mess up the iteration. eachReverse(defQueue, function(args, i) { if (args[0] === id) { defQueue.splice(i, 1); } }); delete context.defQueueMap[id]; if (mod) { //Hold on to listeners in case the //module will be attempted to be reloaded //using a different config. if (mod.events.defined) { undefEvents[id] = mod.events; } cleanRegistry(id); } }; } return localRequire; }, /** * Called to enable a module if it is still in the registry * awaiting enablement. A second arg, parent, the parent module, * is passed in for context, when this method is overridden by * the optimizer. Not shown here to keep code compact. */ enable: function (depMap) { var mod = getOwn(registry, depMap.id); if (mod) { getModule(depMap).enable(); } }, /** * Internal method used by environment adapters to complete a load event. * A load event could be a script load or just a load pass from a synchronous * load call. * @param {String} moduleName the name of the module to potentially complete. */ completeLoad: function (moduleName) { var found, args, mod, shim = getOwn(config.shim, moduleName) || {}, shExports = shim.exports; takeGlobalQueue(); while (defQueue.length) { args = defQueue.shift(); if (args[0] === null) { args[0] = moduleName; //If already found an anonymous module and bound it //to this name, then this is some other anon module //waiting for its completeLoad to fire. if (found) { break; } found = true; } else if (args[0] === moduleName) { //Found matching define call for this script! found = true; } callGetModule(args); } context.defQueueMap = {}; //Do this after the cycle of callGetModule in case the result //of those calls/init calls changes the registry. mod = getOwn(registry, moduleName); if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) { if (config.enforceDefine && (!shExports || !getGlobal(shExports))) { if (hasPathFallback(moduleName)) { return; } else { return onError(makeError('nodefine', 'No define call for ' + moduleName, null, [moduleName])); } } else { //A script that does not call define(), so just simulate //the call for it. callGetModule([moduleName, (shim.deps || []), shim.exportsFn]); } } checkLoaded(); }, /** * Converts a module name to a file path. Supports cases where * moduleName may actually be just an URL. * Note that it **does not** call normalize on the moduleName, * it is assumed to have already been normalized. This is an * internal API, not a public one. Use toUrl for the public API. */ nameToUrl: function (moduleName, ext, skipExt) { var paths, syms, i, parentModule, url, parentPath, bundleId, pkgMain = getOwn(config.pkgs, moduleName); if (pkgMain) { moduleName = pkgMain; } bundleId = getOwn(bundlesMap, moduleName); if (bundleId) { return context.nameToUrl(bundleId, ext, skipExt); } //If a colon is in the URL, it indicates a protocol is used and it is just //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) //or ends with .js, then assume the user meant to use an url and not a module id. //The slash is important for protocol-less URLs as well as full paths. if (req.jsExtRegExp.test(moduleName)) { //Just a plain path, not module name lookup, so just return it. //Add extension if it is included. This is a bit wonky, only non-.js things pass //an extension, this method probably needs to be reworked. url = moduleName + (ext || ''); } else { //A module that needs to be converted to a path. paths = config.paths; syms = moduleName.split('/'); //For each module name segment, see if there is a path //registered for it. Start with most specific name //and work up from it. for (i = syms.length; i > 0; i -= 1) { parentModule = syms.slice(0, i).join('/'); parentPath = getOwn(paths, parentModule); if (parentPath) { //If an array, it means there are a few choices, //Choose the one that is desired if (isArray(parentPath)) { parentPath = parentPath[0]; } syms.splice(0, i, parentPath); break; } } //Join the path parts together, then figure out if baseUrl is needed. url = syms.join('/'); url += (ext || (/^data\:|^blob\:|\?/.test(url) || skipExt ? '' : '.js')); url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url; } return config.urlArgs && !/^blob\:/.test(url) ? url + config.urlArgs(moduleName, url) : url; }, //Delegates to req.load. Broken out as a separate function to //allow overriding in the optimizer. load: function (id, url) { req.load(context, id, url); }, /** * Executes a module callback function. Broken out as a separate function * solely to allow the build system to sequence the files in the built * layer in the right sequence. * * @private */ execCb: function (name, callback, args, exports) { return callback.apply(exports, args); }, /** * callback for script loads, used to check status of loading. * * @param {Event} evt the event from the browser for the script * that was loaded. */ onScriptLoad: function (evt) { //Using currentTarget instead of target for Firefox 2.0's sake. Not //all old browsers will be supported, but this one was easy enough //to support and still makes sense. if (evt.type === 'load' || (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) { //Reset interactive script so a script node is not held onto for //to long. interactiveScript = null; //Pull out the name of the module and the context. var data = getScriptData(evt); context.completeLoad(data.id); } }, /** * Callback for script errors. */ onScriptError: function (evt) { var data = getScriptData(evt); if (!hasPathFallback(data.id)) { var parents = []; eachProp(registry, function(value, key) { if (key.indexOf('_@r') !== 0) { each(value.depMaps, function(depMap) { if (depMap.id === data.id) { parents.push(key); return true; } }); } }); return onError(makeError('scripterror', 'Script error for "' + data.id + (parents.length ? '", needed by: ' + parents.join(', ') : '"'), evt, [data.id])); } } }; context.require = context.makeRequire(); return context; } /** * Main entry point. * * If the only argument to require is a string, then the module that * is represented by that string is fetched for the appropriate context. * * If the first argument is an array, then it will be treated as an array * of dependency string names to fetch. An optional function callback can * be specified to execute when all of those dependencies are available. * * Make a local req variable to help Caja compliance (it assumes things * on a require that are not standardized), and to give a short * name for minification/local scope use. */ req = requirejs = function (deps, callback, errback, optional) { //Find the right context, use default var context, config, contextName = defContextName; // Determine if have config object in the call. if (!isArray(deps) && typeof deps !== 'string') { // deps is a config object config = deps; if (isArray(callback)) { // Adjust args if there are dependencies deps = callback; callback = errback; errback = optional; } else { deps = []; } } if (config && config.context) { contextName = config.context; } context = getOwn(contexts, contextName); if (!context) { context = contexts[contextName] = req.s.newContext(contextName); } if (config) { context.configure(config); } return context.require(deps, callback, errback); }; /** * Support require.config() to make it easier to cooperate with other * AMD loaders on globally agreed names. */ req.config = function (config) { return req(config); }; /** * Execute something after the current tick * of the event loop. Override for other envs * that have a better solution than setTimeout. * @param {Function} fn function to execute later. */ req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) { setTimeout(fn, 4); } : function (fn) { fn(); }; /** * Export require as a global, but only if it does not already exist. */ if (!require) { require = req; } req.version = version; //Used to filter out dependencies that are already paths. req.jsExtRegExp = /^\/|:|\?|\.js$/; req.isBrowser = isBrowser; s = req.s = { contexts: contexts, newContext: newContext }; //Create default context. req({}); //Exports some context-sensitive methods on global require. each([ 'toUrl', 'undef', 'defined', 'specified' ], function (prop) { //Reference from contexts instead of early binding to default context, //so that during builds, the latest instance of the default context //with its config gets used. req[prop] = function () { var ctx = contexts[defContextName]; return ctx.require[prop].apply(ctx, arguments); }; }); if (isBrowser) { head = s.head = document.getElementsByTagName('head')[0]; //If BASE tag is in play, using appendChild is a problem for IE6. //When that browser dies, this can be removed. Details in this jQuery bug: //http://dev.jquery.com/ticket/2709 baseElement = document.getElementsByTagName('base')[0]; if (baseElement) { head = s.head = baseElement.parentNode; } } /** * Any errors that require explicitly generates will be passed to this * function. Intercept/override it if you want custom error handling. * @param {Error} err the error object. */ req.onError = defaultOnError; /** * Creates the node for the load command. Only used in browser envs. */ req.createNode = function (config, moduleName, url) { var node = config.xhtml ? document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') : document.createElement('script'); node.type = config.scriptType || 'text/javascript'; node.charset = 'utf-8'; node.async = true; return node; }; /** * Does the request to load a module for the browser case. * Make this a separate function to allow other environments * to override it. * * @param {Object} context the require context to find state. * @param {String} moduleName the name of the module. * @param {Object} url the URL to the module. */ req.load = function (context, moduleName, url) { var config = (context && context.config) || {}, node; if (isBrowser) { //In the browser so use a script tag node = req.createNode(config, moduleName, url); node.setAttribute('data-requirecontext', context.contextName); node.setAttribute('data-requiremodule', moduleName); //Set up load listener. Test attachEvent first because IE9 has //a subtle issue in its addEventListener and script onload firings //that do not match the behavior of all other browsers with //addEventListener support, which fire the onload event for a //script right after the script execution. See: //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution //UNFORTUNATELY Opera implements attachEvent but does not follow the script //script execution mode. if (node.attachEvent && //Check if node.attachEvent is artificially added by custom script or //natively supported by browser //read https://github.com/requirejs/requirejs/issues/187 //if we can NOT find [native code] then it must NOT natively supported. //in IE8, node.attachEvent does not have toString() //Note the test for "[native code" with no closing brace, see: //https://github.com/requirejs/requirejs/issues/273 !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && !isOpera) { //Probably IE. IE (at least 6-8) do not fire //script onload right after executing the script, so //we cannot tie the anonymous define call to a name. //However, IE reports the script as being in 'interactive' //readyState at the time of the define call. useInteractive = true; node.attachEvent('onreadystatechange', context.onScriptLoad); //It would be great to add an error handler here to catch //404s in IE9+. However, onreadystatechange will fire before //the error handler, so that does not help. If addEventListener //is used, then IE will fire error before load, but we cannot //use that pathway given the connect.microsoft.com issue //mentioned above about not doing the 'script execute, //then fire the script load event listener before execute //next script' that other browsers do. //Best hope: IE10 fixes the issues, //and then destroys all installs of IE 6-9. //node.attachEvent('onerror', context.onScriptError); } else { node.addEventListener('load', context.onScriptLoad, false); node.addEventListener('error', context.onScriptError, false); } node.src = url; //Calling onNodeCreated after all properties on the node have been //set, but before it is placed in the DOM. if (config.onNodeCreated) { config.onNodeCreated(node, config, moduleName, url); } //For some cache cases in IE 6-8, the script executes before the end //of the appendChild execution, so to tie an anonymous define //call to the module name (which is stored on the node), hold on //to a reference to this node, but clear after the DOM insertion. currentlyAddingScript = node; if (baseElement) { head.insertBefore(node, baseElement); } else { head.appendChild(node); } currentlyAddingScript = null; return node; } else if (isWebWorker) { try { //In a web worker, use importScripts. This is not a very //efficient use of importScripts, importScripts will block until //its script is downloaded and evaluated. However, if web workers //are in play, the expectation is that a build has been done so //that only one script needs to be loaded anyway. This may need //to be reevaluated if other use cases become common. // Post a task to the event loop to work around a bug in WebKit // where the worker gets garbage-collected after calling // importScripts(): https://webkit.org/b/153317 setTimeout(function() {}, 0); importScripts(url); //Account for anonymous modules context.completeLoad(moduleName); } catch (e) { context.onError(makeError('importscripts', 'importScripts failed for ' + moduleName + ' at ' + url, e, [moduleName])); } } }; function getInteractiveScript() { if (interactiveScript && interactiveScript.readyState === 'interactive') { return interactiveScript; } eachReverse(scripts(), function (script) { if (script.readyState === 'interactive') { return (interactiveScript = script); } }); return interactiveScript; } //Look for a data-main script attribute, which could also adjust the baseUrl. if (isBrowser && !cfg.skipDataMain) { //Figure out baseUrl. Get it from the script tag with require.js in it. eachReverse(scripts(), function (script) { //Set the 'head' where we can append children by //using the script's parent. if (!head) { head = script.parentNode; } //Look for a data-main attribute to set main script for the page //to load. If it is there, the path to data main becomes the //baseUrl, if it is not already set. dataMain = script.getAttribute('data-main'); if (dataMain) { //Preserve dataMain in case it is a path (i.e. contains '?') mainScript = dataMain; //Set final baseUrl if there is not already an explicit one, //but only do so if the data-main value is not a loader plugin //module ID. if (!cfg.baseUrl && mainScript.indexOf('!') === -1) { //Pull off the directory of data-main for use as the //baseUrl. src = mainScript.split('/'); mainScript = src.pop(); subPath = src.length ? src.join('/') + '/' : './'; cfg.baseUrl = subPath; } //Strip off any trailing .js since mainScript is now //like a module name. mainScript = mainScript.replace(jsSuffixRegExp, ''); //If mainScript is still a path, fall back to dataMain if (req.jsExtRegExp.test(mainScript)) { mainScript = dataMain; } //Put the data-main script in the files to load. cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript]; return true; } }); } /** * The function that handles definitions of modules. Differs from * require() in that a string for the module should be the first argument, * and the function to execute after dependencies are loaded should * return a value to define the module corresponding to the first argument's * name. */ define = function (name, deps, callback) { var node, context; //Allow for anonymous modules if (typeof name !== 'string') { //Adjust args appropriately callback = deps; deps = name; name = null; } //This module may not have dependencies if (!isArray(deps)) { callback = deps; deps = null; } //If no name, and callback is a function, then figure out if it a //CommonJS thing with dependencies. if (!deps && isFunction(callback)) { deps = []; //Remove comments from the callback string, //look for require calls, and pull them into the dependencies, //but only if there are function args. if (callback.length) { callback .toString() .replace(commentRegExp, commentReplace) .replace(cjsRequireRegExp, function (match, dep) { deps.push(dep); }); //May be a CommonJS thing even without require calls, but still //could use exports, and module. Avoid doing exports and module //work though if it just needs require. //REQUIRES the function to expect the CommonJS variables in the //order listed below. deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps); } } //If in IE 6-8 and hit an anonymous define() call, do the interactive //work. if (useInteractive) { node = currentlyAddingScript || getInteractiveScript(); if (node) { if (!name) { name = node.getAttribute('data-requiremodule'); } context = contexts[node.getAttribute('data-requirecontext')]; } } //Always save off evaluating the def call until the script onload handler. //This allows multiple modules to be in a file without prematurely //tracing dependencies, and allows for anonymous module support, //where the module name is not known until the script onload event //occurs. If no context, use the global queue, and get it processed //in the onscript load callback. if (context) { context.defQueue.push([name, deps, callback]); context.defQueueMap[name] = true; } else { globalDefQueue.push([name, deps, callback]); } }; define.amd = { jQuery: true }; /** * Executes the text. Normally just uses eval, but can be modified * to use a better, environment-specific call. Only used for transpiling * loader plugins, not for plain JS modules. * @param {String} text the text to execute/evaluate. */ req.exec = function (text) { /*jslint evil: true */ return eval(text); }; //Set up with config info. req(cfg); }(this)); ================================================ FILE: common/Tests/External/require-2.3.6.js ================================================ /** vim: et:ts=4:sw=4:sts=4 * @license RequireJS 2.3.6 Copyright jQuery Foundation and other contributors. * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE */ var requirejs,require,define;!function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.6",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var i;if(e)for(i=0;i= 0; } if (typeof matcher === "number") { return matcher === object; } if (typeof matcher === "boolean") { return matcher === object; } if (typeof (matcher) === "undefined") { return typeof (object) === "undefined"; } if (matcher === null) { return object === null; } if (getClass(object) === "Array" && getClass(matcher) === "Array") { return arrayContains(object, matcher); } if (matcher && typeof matcher === "object") { if (matcher === object) { return true; } var prop; for (prop in matcher) { var value = object[prop]; if (typeof value === "undefined" && typeof object.getAttribute === "function") { value = object.getAttribute(prop); } if (matcher[prop] === null || typeof matcher[prop] === 'undefined') { if (value !== matcher[prop]) { return false; } } else if (typeof value === "undefined" || !match(value, matcher[prop])) { return false; } } return true; } throw new Error("Matcher was not a string, a number, a " + "function, a boolean or an object"); }; return { isArguments: isArguments, isElement: isElement, isDate: isDate, isNegZero: isNegZero, identical: identical, deepEqual: deepEqualCyclic, match: match, keys: keys }; }); ((typeof define === "function" && define.amd && function (m) { define("formatio", ["samsam"], m); }) || (typeof module === "object" && function (m) { module.exports = m(require("samsam")); }) || function (m) { this.formatio = m(this.samsam); } )(function (samsam) { var formatio = { excludeConstructors: ["Object", /^.$/], quoteStrings: true, limitChildrenCount: 0 }; var hasOwn = Object.prototype.hasOwnProperty; var specialObjects = []; if (typeof global !== "undefined") { specialObjects.push({ object: global, value: "[object global]" }); } if (typeof document !== "undefined") { specialObjects.push({ object: document, value: "[object HTMLDocument]" }); } if (typeof window !== "undefined") { specialObjects.push({ object: window, value: "[object Window]" }); } function functionName(func) { if (!func) { return ""; } if (func.displayName) { return func.displayName; } if (func.name) { return func.name; } var matches = func.toString().match(/function\s+([^\(]+)/m); return (matches && matches[1]) || ""; } function constructorName(f, object) { var name = functionName(object && object.constructor); var excludes = f.excludeConstructors || formatio.excludeConstructors || []; var i, l; for (i = 0, l = excludes.length; i < l; ++i) { if (typeof excludes[i] === "string" && excludes[i] === name) { return ""; } else if (excludes[i].test && excludes[i].test(name)) { return ""; } } return name; } function isCircular(object, objects) { if (typeof object !== "object") { return false; } var i, l; for (i = 0, l = objects.length; i < l; ++i) { if (objects[i] === object) { return true; } } return false; } function ascii(f, object, processed, indent) { if (typeof object === "string") { var qs = f.quoteStrings; var quote = typeof qs !== "boolean" || qs; return processed || quote ? '"' + object + '"' : object; } if (typeof object === "function" && !(object instanceof RegExp)) { return ascii.func(object); } processed = processed || []; if (isCircular(object, processed)) { return "[Circular]"; } if (Object.prototype.toString.call(object) === "[object Array]") { return ascii.array.call(f, object, processed); } if (!object) { return String((1 / object) === -Infinity ? "-0" : object); } if (samsam.isElement(object)) { return ascii.element(object); } if (typeof object.toString === "function" && object.toString !== Object.prototype.toString) { return object.toString(); } var i, l; for (i = 0, l = specialObjects.length; i < l; i++) { if (object === specialObjects[i].object) { return specialObjects[i].value; } } return ascii.object.call(f, object, processed, indent); } ascii.func = function (func) { return "function " + functionName(func) + "() {}"; }; ascii.array = function (array, processed) { processed = processed || []; processed.push(array); var pieces = []; var i, l; l = (this.limitChildrenCount > 0) ? Math.min(this.limitChildrenCount, array.length) : array.length; for (i = 0; i < l; ++i) { pieces.push(ascii(this, array[i], processed)); } if (l < array.length) pieces.push("[... " + (array.length - l) + " more elements]"); return "[" + pieces.join(", ") + "]"; }; ascii.object = function (object, processed, indent) { processed = processed || []; processed.push(object); indent = indent || 0; var pieces = [], properties = samsam.keys(object).sort(); var length = 3; var prop, str, obj, i, k, l; l = (this.limitChildrenCount > 0) ? Math.min(this.limitChildrenCount, properties.length) : properties.length; for (i = 0; i < l; ++i) { prop = properties[i]; obj = object[prop]; if (isCircular(obj, processed)) { str = "[Circular]"; } else { str = ascii(this, obj, processed, indent + 2); } str = (/\s/.test(prop) ? '"' + prop + '"' : prop) + ": " + str; length += str.length; pieces.push(str); } var cons = constructorName(this, object); var prefix = cons ? "[" + cons + "] " : ""; var is = ""; for (i = 0, k = indent; i < k; ++i) { is += " "; } if (l < properties.length) pieces.push("[... " + (properties.length - l) + " more elements]"); if (length + indent > 80) { return prefix + "{\n " + is + pieces.join(",\n " + is) + "\n" + is + "}"; } return prefix + "{ " + pieces.join(", ") + " }"; }; ascii.element = function (element) { var tagName = element.tagName.toLowerCase(); var attrs = element.attributes, attr, pairs = [], attrName, i, l, val; for (i = 0, l = attrs.length; i < l; ++i) { attr = attrs.item(i); attrName = attr.nodeName.toLowerCase().replace("html:", ""); val = attr.nodeValue; if (attrName !== "contenteditable" || val !== "inherit") { if (!!val) { pairs.push(attrName + "=\"" + val + "\""); } } } var formatted = "<" + tagName + (pairs.length > 0 ? " " : ""); var content = element.innerHTML; if (content.length > 20) { content = content.substr(0, 20) + "[...]"; } var res = formatted + pairs.join(" ") + ">" + content + ""; return res.replace(/ contentEditable="inherit"/, ""); }; function Formatio(options) { for (var opt in options) { this[opt] = options[opt]; } } Formatio.prototype = { functionName: functionName, configure: function (options) { return new Formatio(options); }, constructorName: function (object) { return constructorName(this, object); }, ascii: function (object, processed, indent) { return ascii(this, object, processed, indent); } }; return Formatio.prototype; }); !function (e) { if ("object" == typeof exports && "undefined" != typeof module) module.exports = e(); else if ("function" == typeof define && define.amd) define([], e); else { var f; "undefined" != typeof window ? f = window : "undefined" != typeof global ? f = global : "undefined" != typeof self && (f = self), f.lolex = e() } }(function () { var define, module, exports; return (function e(t, n, r) { function s(o, u) { if (!n[o]) { if (!t[o]) { var a = typeof require == "function" && require; if (!u && a) return a(o, !0); if (i) return i(o, !0); var f = new Error("Cannot find module '" + o + "'"); throw f.code = "MODULE_NOT_FOUND", f } var l = n[o] = { exports: {} }; t[o][0].call(l.exports, function (e) { var n = t[o][1][e]; return s(n ? n : e) }, l, l.exports, e, t, n, r) } return n[o].exports } var i = typeof require == "function" && require; for (var o = 0; o < r.length; o++) s(r[o]); return s })({ 1: [function (require, module, exports) { (function (global) { /*global global, window*/ /** * @author Christian Johansen (christian@cjohansen.no) and contributors * @license BSD * * Copyright (c) 2010-2014 Christian Johansen */ (function (global) { // Make properties writable in IE, as per // http://www.adequatelygood.com/Replacing-setTimeout-Globally.html // JSLint being anal var glbl = global; global.setTimeout = glbl.setTimeout; global.clearTimeout = glbl.clearTimeout; global.setInterval = glbl.setInterval; global.clearInterval = glbl.clearInterval; global.Date = glbl.Date; // setImmediate is not a standard function // avoid adding the prop to the window object if not present if ('setImmediate' in global) { global.setImmediate = glbl.setImmediate; global.clearImmediate = glbl.clearImmediate; } // node expects setTimeout/setInterval to return a fn object w/ .ref()/.unref() // browsers, a number. // see https://github.com/cjohansen/Sinon.JS/pull/436 var NOOP = function () { return undefined; }; var timeoutResult = setTimeout(NOOP, 0); var addTimerReturnsObject = typeof timeoutResult === "object"; clearTimeout(timeoutResult); var NativeDate = Date; var uniqueTimerId = 1; /** * Parse strings like "01:10:00" (meaning 1 hour, 10 minutes, 0 seconds) into * number of milliseconds. This is used to support human-readable strings passed * to clock.tick() */ function parseTime(str) { if (!str) { return 0; } var strings = str.split(":"); var l = strings.length, i = l; var ms = 0, parsed; if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) { throw new Error("tick only understands numbers and 'h:m:s'"); } while (i--) { parsed = parseInt(strings[i], 10); if (parsed >= 60) { throw new Error("Invalid time " + str); } ms += parsed * Math.pow(60, (l - i - 1)); } return ms * 1000; } /** * Used to grok the `now` parameter to createClock. */ function getEpoch(epoch) { if (!epoch) { return 0; } if (typeof epoch.getTime === "function") { return epoch.getTime(); } if (typeof epoch === "number") { return epoch; } throw new TypeError("now should be milliseconds since UNIX epoch"); } function inRange(from, to, timer) { return timer && timer.callAt >= from && timer.callAt <= to; } function mirrorDateProperties(target, source) { var prop; for (prop in source) { if (source.hasOwnProperty(prop)) { target[prop] = source[prop]; } } // set special now implementation if (source.now) { target.now = function now() { return target.clock.now; }; } else { delete target.now; } // set special toSource implementation if (source.toSource) { target.toSource = function toSource() { return source.toSource(); }; } else { delete target.toSource; } // set special toString implementation target.toString = function toString() { return source.toString(); }; target.prototype = source.prototype; target.parse = source.parse; target.UTC = source.UTC; target.prototype.toUTCString = source.prototype.toUTCString; return target; } function createDate() { function ClockDate(year, month, date, hour, minute, second, ms) { // Defensive and verbose to avoid potential harm in passing // explicit undefined when user does not pass argument switch (arguments.length) { case 0: return new NativeDate(ClockDate.clock.now); case 1: return new NativeDate(year); case 2: return new NativeDate(year, month); case 3: return new NativeDate(year, month, date); case 4: return new NativeDate(year, month, date, hour); case 5: return new NativeDate(year, month, date, hour, minute); case 6: return new NativeDate(year, month, date, hour, minute, second); default: return new NativeDate(year, month, date, hour, minute, second, ms); } } return mirrorDateProperties(ClockDate, NativeDate); } function addTimer(clock, timer) { if (timer.func === undefined) { throw new Error("Callback must be provided to timer calls"); } if (!clock.timers) { clock.timers = {}; } timer.id = uniqueTimerId++; timer.createdAt = clock.now; timer.callAt = clock.now + (timer.delay || (clock.duringTick ? 1 : 0)); clock.timers[timer.id] = timer; if (addTimerReturnsObject) { return { id: timer.id, ref: NOOP, unref: NOOP }; } return timer.id; } function compareTimers(a, b) { // Sort first by absolute timing if (a.callAt < b.callAt) { return -1; } if (a.callAt > b.callAt) { return 1; } // Sort next by immediate, immediate timers take precedence if (a.immediate && !b.immediate) { return -1; } if (!a.immediate && b.immediate) { return 1; } // Sort next by creation time, earlier-created timers take precedence if (a.createdAt < b.createdAt) { return -1; } if (a.createdAt > b.createdAt) { return 1; } // Sort next by id, lower-id timers take precedence if (a.id < b.id) { return -1; } if (a.id > b.id) { return 1; } // As timer ids are unique, no fallback `0` is necessary } function firstTimerInRange(clock, from, to) { var timers = clock.timers, timer = null, id, isInRange; for (id in timers) { if (timers.hasOwnProperty(id)) { isInRange = inRange(from, to, timers[id]); if (isInRange && (!timer || compareTimers(timer, timers[id]) === 1)) { timer = timers[id]; } } } return timer; } function callTimer(clock, timer) { var exception; if (typeof timer.interval === "number") { clock.timers[timer.id].callAt += timer.interval; } else { delete clock.timers[timer.id]; } try { if (typeof timer.func === "function") { timer.func.apply(null, timer.args); } else { eval(timer.func); } } catch (e) { exception = e; } if (!clock.timers[timer.id]) { if (exception) { throw exception; } return; } if (exception) { throw exception; } } function timerType(timer) { if (timer.immediate) { return "Immediate"; } else if (typeof timer.interval !== "undefined") { return "Interval"; } else { return "Timeout"; } } function clearTimer(clock, timerId, ttype) { if (!timerId) { // null appears to be allowed in most browsers, and appears to be // relied upon by some libraries, like Bootstrap carousel return; } if (!clock.timers) { clock.timers = []; } // in Node, timerId is an object with .ref()/.unref(), and // its .id field is the actual timer id. if (typeof timerId === "object") { timerId = timerId.id; } if (clock.timers.hasOwnProperty(timerId)) { // check that the ID matches a timer of the correct type var timer = clock.timers[timerId]; if (timerType(timer) === ttype) { delete clock.timers[timerId]; } else { throw new Error("Cannot clear timer: timer created with set" + ttype + "() but cleared with clear" + timerType(timer) + "()"); } } } function uninstall(clock, target) { var method, i, l; for (i = 0, l = clock.methods.length; i < l; i++) { method = clock.methods[i]; if (target[method].hadOwnProperty) { target[method] = clock["_" + method]; } else { try { delete target[method]; } catch (ignore) { } } } // Prevent multiple executions which will completely remove these props clock.methods = []; } function hijackMethod(target, method, clock) { var prop; clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call(target, method); clock["_" + method] = target[method]; if (method === "Date") { var date = mirrorDateProperties(clock[method], target[method]); target[method] = date; } else { target[method] = function () { return clock[method].apply(clock, arguments); }; for (prop in clock[method]) { if (clock[method].hasOwnProperty(prop)) { target[method][prop] = clock[method][prop]; } } } target[method].clock = clock; } var timers = { setTimeout: setTimeout, clearTimeout: clearTimeout, setImmediate: global.setImmediate, clearImmediate: global.clearImmediate, setInterval: setInterval, clearInterval: clearInterval, Date: Date }; var keys = Object.keys || function (obj) { var ks = [], key; for (key in obj) { if (obj.hasOwnProperty(key)) { ks.push(key); } } return ks; }; exports.timers = timers; function createClock(now) { var clock = { now: getEpoch(now), timeouts: {}, Date: createDate() }; clock.Date.clock = clock; clock.setTimeout = function setTimeout(func, timeout) { return addTimer(clock, { func: func, args: Array.prototype.slice.call(arguments, 2), delay: timeout }); }; clock.clearTimeout = function clearTimeout(timerId) { return clearTimer(clock, timerId, "Timeout"); }; clock.setInterval = function setInterval(func, timeout) { return addTimer(clock, { func: func, args: Array.prototype.slice.call(arguments, 2), delay: timeout, interval: timeout }); }; clock.clearInterval = function clearInterval(timerId) { return clearTimer(clock, timerId, "Interval"); }; clock.setImmediate = function setImmediate(func) { return addTimer(clock, { func: func, args: Array.prototype.slice.call(arguments, 1), immediate: true }); }; clock.clearImmediate = function clearImmediate(timerId) { return clearTimer(clock, timerId, "Immediate"); }; clock.tick = function tick(ms) { ms = typeof ms === "number" ? ms : parseTime(ms); var tickFrom = clock.now, tickTo = clock.now + ms, previous = clock.now; var timer = firstTimerInRange(clock, tickFrom, tickTo); var oldNow; clock.duringTick = true; var firstException; while (timer && tickFrom <= tickTo) { if (clock.timers[timer.id]) { tickFrom = clock.now = timer.callAt; try { oldNow = clock.now; callTimer(clock, timer); // compensate for any setSystemTime() call during timer callback if (oldNow !== clock.now) { tickFrom += clock.now - oldNow; tickTo += clock.now - oldNow; previous += clock.now - oldNow; } } catch (e) { firstException = firstException || e; } } timer = firstTimerInRange(clock, previous, tickTo); previous = tickFrom; } clock.duringTick = false; clock.now = tickTo; if (firstException) { throw firstException; } return clock.now; }; clock.reset = function reset() { clock.timers = {}; }; clock.setSystemTime = function setSystemTime(now) { // determine time difference var newNow = getEpoch(now); var difference = newNow - clock.now; // update 'system clock' clock.now = newNow; // update timers and intervals to keep them stable for (var id in clock.timers) { if (clock.timers.hasOwnProperty(id)) { var timer = clock.timers[id]; timer.createdAt += difference; timer.callAt += difference; } } }; return clock; } exports.createClock = createClock; exports.install = function install(target, now, toFake) { var i, l; if (typeof target === "number") { toFake = now; now = target; target = null; } if (!target) { target = global; } var clock = createClock(now); clock.uninstall = function () { uninstall(clock, target); }; clock.methods = toFake || []; if (clock.methods.length === 0) { clock.methods = keys(timers); } for (i = 0, l = clock.methods.length; i < l; i++) { hijackMethod(target, clock.methods[i], clock); } return clock; }; }(global || this)); }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }, {}] }, {}, [1])(1) }); })(); var define; /** * Sinon core utilities. For internal use only. * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ var sinon = (function () { "use strict"; // eslint-disable-line no-unused-vars var sinonModule; var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { sinonModule = module.exports = require("./sinon/util/core"); require("./sinon/extend"); require("./sinon/walk"); require("./sinon/typeOf"); require("./sinon/times_in_words"); require("./sinon/spy"); require("./sinon/call"); require("./sinon/behavior"); require("./sinon/stub"); require("./sinon/mock"); require("./sinon/collection"); require("./sinon/assert"); require("./sinon/sandbox"); require("./sinon/test"); require("./sinon/test_case"); require("./sinon/match"); require("./sinon/format"); require("./sinon/log_error"); } if (isAMD) { define(loadDependencies); } else if (isNode) { loadDependencies(require, module.exports, module); sinonModule = module.exports; } else { sinonModule = {}; } return sinonModule; }()); /** * @depend ../../sinon.js */ /** * Sinon core utilities. For internal use only. * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function (sinonGlobal) { var div = typeof document !== "undefined" && document.createElement("div"); var hasOwn = Object.prototype.hasOwnProperty; function isDOMNode(obj) { var success = false; try { obj.appendChild(div); success = div.parentNode === obj; } catch (e) { return false; } finally { try { obj.removeChild(div); } catch (e) { // Remove failed, not much we can do about that } } return success; } function isElement(obj) { return div && obj && obj.nodeType === 1 && isDOMNode(obj); } function isFunction(obj) { return typeof obj === "function" || !!(obj && obj.constructor && obj.call && obj.apply); } function isReallyNaN(val) { return typeof val === "number" && isNaN(val); } function mirrorProperties(target, source) { for (var prop in source) { if (!hasOwn.call(target, prop)) { target[prop] = source[prop]; } } } function isRestorable(obj) { return typeof obj === "function" && typeof obj.restore === "function" && obj.restore.sinon; } // Cheap way to detect if we have ES5 support. var hasES5Support = "keys" in Object; function makeApi(sinon) { sinon.wrapMethod = function wrapMethod(object, property, method) { if (!object) { throw new TypeError("Should wrap property of object"); } if (typeof method !== "function" && typeof method !== "object") { throw new TypeError("Method wrapper should be a function or a property descriptor"); } function checkWrappedMethod(wrappedMethod) { var error; if (!isFunction(wrappedMethod)) { error = new TypeError("Attempted to wrap " + (typeof wrappedMethod) + " property " + property + " as function"); } else if (wrappedMethod.restore && wrappedMethod.restore.sinon) { error = new TypeError("Attempted to wrap " + property + " which is already wrapped"); } else if (wrappedMethod.calledBefore) { var verb = wrappedMethod.returns ? "stubbed" : "spied on"; error = new TypeError("Attempted to wrap " + property + " which is already " + verb); } if (error) { if (wrappedMethod && wrappedMethod.stackTrace) { error.stack += "\n--------------\n" + wrappedMethod.stackTrace; } throw error; } } var error, wrappedMethod, i; // IE 8 does not support hasOwnProperty on the window object and Firefox has a problem // when using hasOwn.call on objects from other frames. var owned = object.hasOwnProperty ? object.hasOwnProperty(property) : hasOwn.call(object, property); if (hasES5Support) { var methodDesc = (typeof method === "function") ? { value: method } : method; var wrappedMethodDesc = sinon.getPropertyDescriptor(object, property); if (!wrappedMethodDesc) { error = new TypeError("Attempted to wrap " + (typeof wrappedMethod) + " property " + property + " as function"); } else if (wrappedMethodDesc.restore && wrappedMethodDesc.restore.sinon) { error = new TypeError("Attempted to wrap " + property + " which is already wrapped"); } if (error) { if (wrappedMethodDesc && wrappedMethodDesc.stackTrace) { error.stack += "\n--------------\n" + wrappedMethodDesc.stackTrace; } throw error; } var types = sinon.objectKeys(methodDesc); for (i = 0; i < types.length; i++) { wrappedMethod = wrappedMethodDesc[types[i]]; checkWrappedMethod(wrappedMethod); } mirrorProperties(methodDesc, wrappedMethodDesc); for (i = 0; i < types.length; i++) { mirrorProperties(methodDesc[types[i]], wrappedMethodDesc[types[i]]); } Object.defineProperty(object, property, methodDesc); } else { wrappedMethod = object[property]; checkWrappedMethod(wrappedMethod); object[property] = method; method.displayName = property; } method.displayName = property; // Set up a stack trace which can be used later to find what line of // code the original method was created on. method.stackTrace = (new Error("Stack Trace for original")).stack; method.restore = function () { // For prototype properties try to reset by delete first. // If this fails (ex: localStorage on mobile safari) then force a reset // via direct assignment. if (!owned) { // In some cases `delete` may throw an error try { delete object[property]; } catch (e) { } // eslint-disable-line no-empty // For native code functions `delete` fails without throwing an error // on Chrome < 43, PhantomJS, etc. } else if (hasES5Support) { Object.defineProperty(object, property, wrappedMethodDesc); } // Use strict equality comparison to check failures then force a reset // via direct assignment. if (object[property] === method) { object[property] = wrappedMethod; } }; method.restore.sinon = true; if (!hasES5Support) { mirrorProperties(method, wrappedMethod); } return method; }; sinon.create = function create(proto) { var F = function () { }; F.prototype = proto; return new F(); }; sinon.deepEqual = function deepEqual(a, b) { if (sinon.match && sinon.match.isMatcher(a)) { return a.test(b); } if (typeof a !== "object" || typeof b !== "object") { return isReallyNaN(a) && isReallyNaN(b) || a === b; } if (isElement(a) || isElement(b)) { return a === b; } if (a === b) { return true; } if ((a === null && b !== null) || (a !== null && b === null)) { return false; } if (a instanceof RegExp && b instanceof RegExp) { return (a.source === b.source) && (a.global === b.global) && (a.ignoreCase === b.ignoreCase) && (a.multiline === b.multiline); } var aString = Object.prototype.toString.call(a); if (aString !== Object.prototype.toString.call(b)) { return false; } if (aString === "[object Date]") { return a.valueOf() === b.valueOf(); } var prop; var aLength = 0; var bLength = 0; if (aString === "[object Array]" && a.length !== b.length) { return false; } for (prop in a) { if (a.hasOwnProperty(prop)) { aLength += 1; if (!(prop in b)) { return false; } if (!deepEqual(a[prop], b[prop])) { return false; } } } for (prop in b) { if (b.hasOwnProperty(prop)) { bLength += 1; } } return aLength === bLength; }; sinon.functionName = function functionName(func) { var name = func.displayName || func.name; // Use function decomposition as a last resort to get function // name. Does not rely on function decomposition to work - if it // doesn't debugging will be slightly less informative // (i.e. toString will say 'spy' rather than 'myFunc'). if (!name) { var matches = func.toString().match(/function ([^\s\(]+)/); name = matches && matches[1]; } return name; }; sinon.functionToString = function toString() { if (this.getCall && this.callCount) { var thisValue, prop; var i = this.callCount; while (i--) { thisValue = this.getCall(i).thisValue; for (prop in thisValue) { if (thisValue[prop] === this) { return prop; } } } } return this.displayName || "sinon fake"; }; sinon.objectKeys = function objectKeys(obj) { if (obj !== Object(obj)) { throw new TypeError("sinon.objectKeys called on a non-object"); } var keys = []; var key; for (key in obj) { if (hasOwn.call(obj, key)) { keys.push(key); } } return keys; }; sinon.getPropertyDescriptor = function getPropertyDescriptor(object, property) { var proto = object; var descriptor; while (proto && !(descriptor = Object.getOwnPropertyDescriptor(proto, property))) { proto = Object.getPrototypeOf(proto); } return descriptor; }; sinon.getConfig = function (custom) { var config = {}; custom = custom || {}; var defaults = sinon.defaultConfig; for (var prop in defaults) { if (defaults.hasOwnProperty(prop)) { config[prop] = custom.hasOwnProperty(prop) ? custom[prop] : defaults[prop]; } } return config; }; sinon.defaultConfig = { injectIntoThis: true, injectInto: null, properties: ["spy", "stub", "mock", "clock", "server", "requests"], useFakeTimers: true, useFakeServer: true }; sinon.timesInWords = function timesInWords(count) { return count === 1 && "once" || count === 2 && "twice" || count === 3 && "thrice" || (count || 0) + " times"; }; sinon.calledInOrder = function (spies) { for (var i = 1, l = spies.length; i < l; i++) { if (!spies[i - 1].calledBefore(spies[i]) || !spies[i].called) { return false; } } return true; }; sinon.orderByFirstCall = function (spies) { return spies.sort(function (a, b) { // uuid, won't ever be equal var aCall = a.getCall(0); var bCall = b.getCall(0); var aId = aCall && aCall.callId || -1; var bId = bCall && bCall.callId || -1; return aId < bId ? -1 : 1; }); }; sinon.createStubInstance = function (constructor) { if (typeof constructor !== "function") { throw new TypeError("The constructor should be a function."); } return sinon.stub(sinon.create(constructor.prototype)); }; sinon.restore = function (object) { if (object !== null && typeof object === "object") { for (var prop in object) { if (isRestorable(object[prop])) { object[prop].restore(); } } } else if (isRestorable(object)) { object.restore(); } }; return sinon; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports) { makeApi(exports); } if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend util/core.js */ (function (sinonGlobal) { function makeApi(sinon) { // Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug var hasDontEnumBug = (function () { var obj = { constructor: function () { return "0"; }, toString: function () { return "1"; }, valueOf: function () { return "2"; }, toLocaleString: function () { return "3"; }, prototype: function () { return "4"; }, isPrototypeOf: function () { return "5"; }, propertyIsEnumerable: function () { return "6"; }, hasOwnProperty: function () { return "7"; }, length: function () { return "8"; }, unique: function () { return "9"; } }; var result = []; for (var prop in obj) { if (obj.hasOwnProperty(prop)) { result.push(obj[prop]()); } } return result.join("") !== "0123456789"; })(); /* Public: Extend target in place with all (own) properties from sources in-order. Thus, last source will * override properties in previous sources. * * target - The Object to extend * sources - Objects to copy properties from. * * Returns the extended target */ function extend(target /*, sources */) { var sources = Array.prototype.slice.call(arguments, 1); var source, i, prop; for (i = 0; i < sources.length; i++) { source = sources[i]; for (prop in source) { if (source.hasOwnProperty(prop)) { target[prop] = source[prop]; } } // Make sure we copy (own) toString method even when in JScript with DontEnum bug // See https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug if (hasDontEnumBug && source.hasOwnProperty("toString") && source.toString !== target.toString) { target.toString = source.toString; } } return target; } sinon.extend = extend; return sinon.extend; } function loadDependencies(require, exports, module) { var sinon = require("./util/core"); module.exports = makeApi(sinon); } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend util/core.js */ (function (sinonGlobal) { function makeApi(sinon) { function timesInWords(count) { switch (count) { case 1: return "once"; case 2: return "twice"; case 3: return "thrice"; default: return (count || 0) + " times"; } } sinon.timesInWords = timesInWords; return sinon.timesInWords; } function loadDependencies(require, exports, module) { var core = require("./util/core"); module.exports = makeApi(core); } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend util/core.js */ /** * Format functions * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2014 Christian Johansen */ (function (sinonGlobal) { function makeApi(sinon) { function typeOf(value) { if (value === null) { return "null"; } else if (value === undefined) { return "undefined"; } var string = Object.prototype.toString.call(value); return string.substring(8, string.length - 1).toLowerCase(); } sinon.typeOf = typeOf; return sinon.typeOf; } function loadDependencies(require, exports, module) { var core = require("./util/core"); module.exports = makeApi(core); } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend util/core.js * @depend typeOf.js */ /*jslint eqeqeq: false, onevar: false, plusplus: false*/ /*global module, require, sinon*/ /** * Match functions * * @author Maximilian Antoni (mail@maxantoni.de) * @license BSD * * Copyright (c) 2012 Maximilian Antoni */ (function (sinonGlobal) { function makeApi(sinon) { function assertType(value, type, name) { var actual = sinon.typeOf(value); if (actual !== type) { throw new TypeError("Expected type of " + name + " to be " + type + ", but was " + actual); } } var matcher = { toString: function () { return this.message; } }; function isMatcher(object) { return matcher.isPrototypeOf(object); } function matchObject(expectation, actual) { if (actual === null || actual === undefined) { return false; } for (var key in expectation) { if (expectation.hasOwnProperty(key)) { var exp = expectation[key]; var act = actual[key]; if (isMatcher(exp)) { if (!exp.test(act)) { return false; } } else if (sinon.typeOf(exp) === "object") { if (!matchObject(exp, act)) { return false; } } else if (!sinon.deepEqual(exp, act)) { return false; } } } return true; } function match(expectation, message) { var m = sinon.create(matcher); var type = sinon.typeOf(expectation); switch (type) { case "object": if (typeof expectation.test === "function") { m.test = function (actual) { return expectation.test(actual) === true; }; m.message = "match(" + sinon.functionName(expectation.test) + ")"; return m; } var str = []; for (var key in expectation) { if (expectation.hasOwnProperty(key)) { str.push(key + ": " + expectation[key]); } } m.test = function (actual) { return matchObject(expectation, actual); }; m.message = "match(" + str.join(", ") + ")"; break; case "number": m.test = function (actual) { // we need type coercion here return expectation == actual; // eslint-disable-line eqeqeq }; break; case "string": m.test = function (actual) { if (typeof actual !== "string") { return false; } return actual.indexOf(expectation) !== -1; }; m.message = "match(\"" + expectation + "\")"; break; case "regexp": m.test = function (actual) { if (typeof actual !== "string") { return false; } return expectation.test(actual); }; break; case "function": m.test = expectation; if (message) { m.message = message; } else { m.message = "match(" + sinon.functionName(expectation) + ")"; } break; default: m.test = function (actual) { return sinon.deepEqual(expectation, actual); }; } if (!m.message) { m.message = "match(" + expectation + ")"; } return m; } matcher.or = function (m2) { if (!arguments.length) { throw new TypeError("Matcher expected"); } else if (!isMatcher(m2)) { m2 = match(m2); } var m1 = this; var or = sinon.create(matcher); or.test = function (actual) { return m1.test(actual) || m2.test(actual); }; or.message = m1.message + ".or(" + m2.message + ")"; return or; }; matcher.and = function (m2) { if (!arguments.length) { throw new TypeError("Matcher expected"); } else if (!isMatcher(m2)) { m2 = match(m2); } var m1 = this; var and = sinon.create(matcher); and.test = function (actual) { return m1.test(actual) && m2.test(actual); }; and.message = m1.message + ".and(" + m2.message + ")"; return and; }; match.isMatcher = isMatcher; match.any = match(function () { return true; }, "any"); match.defined = match(function (actual) { return actual !== null && actual !== undefined; }, "defined"); match.truthy = match(function (actual) { return !!actual; }, "truthy"); match.falsy = match(function (actual) { return !actual; }, "falsy"); match.same = function (expectation) { return match(function (actual) { return expectation === actual; }, "same(" + expectation + ")"); }; match.typeOf = function (type) { assertType(type, "string", "type"); return match(function (actual) { return sinon.typeOf(actual) === type; }, "typeOf(\"" + type + "\")"); }; match.instanceOf = function (type) { assertType(type, "function", "type"); return match(function (actual) { return actual instanceof type; }, "instanceOf(" + sinon.functionName(type) + ")"); }; function createPropertyMatcher(propertyTest, messagePrefix) { return function (property, value) { assertType(property, "string", "property"); var onlyProperty = arguments.length === 1; var message = messagePrefix + "(\"" + property + "\""; if (!onlyProperty) { message += ", " + value; } message += ")"; return match(function (actual) { if (actual === undefined || actual === null || !propertyTest(actual, property)) { return false; } return onlyProperty || sinon.deepEqual(value, actual[property]); }, message); }; } match.has = createPropertyMatcher(function (actual, property) { if (typeof actual === "object") { return property in actual; } return actual[property] !== undefined; }, "has"); match.hasOwn = createPropertyMatcher(function (actual, property) { return actual.hasOwnProperty(property); }, "hasOwn"); match.bool = match.typeOf("boolean"); match.number = match.typeOf("number"); match.string = match.typeOf("string"); match.object = match.typeOf("object"); match.func = match.typeOf("function"); match.array = match.typeOf("array"); match.regexp = match.typeOf("regexp"); match.date = match.typeOf("date"); sinon.match = match; return match; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var sinon = require("./util/core"); require("./typeOf"); module.exports = makeApi(sinon); } if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend util/core.js */ /** * Format functions * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2014 Christian Johansen */ (function (sinonGlobal, formatio) { function makeApi(sinon) { function valueFormatter(value) { return "" + value; } function getFormatioFormatter() { var formatter = formatio.configure({ quoteStrings: false, limitChildrenCount: 250 }); function format() { return formatter.ascii.apply(formatter, arguments); } return format; } function getNodeFormatter() { try { var util = require("util"); } catch (e) { /* Node, but no util module - would be very old, but better safe than sorry */ } function format(v) { var isObjectWithNativeToString = typeof v === "object" && v.toString === Object.prototype.toString; return isObjectWithNativeToString ? util.inspect(v) : v; } return util ? format : valueFormatter; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var formatter; if (isNode) { try { formatio = require("formatio"); } catch (e) { } // eslint-disable-line no-empty } if (formatio) { formatter = getFormatioFormatter(); } else if (isNode) { formatter = getNodeFormatter(); } else { formatter = valueFormatter; } sinon.format = formatter; return sinon.format; } function loadDependencies(require, exports, module) { var sinon = require("./util/core"); module.exports = makeApi(sinon); } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon, // eslint-disable-line no-undef typeof formatio === "object" && formatio // eslint-disable-line no-undef )); /** * @depend util/core.js * @depend match.js * @depend format.js */ /** * Spy calls * * @author Christian Johansen (christian@cjohansen.no) * @author Maximilian Antoni (mail@maxantoni.de) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen * Copyright (c) 2013 Maximilian Antoni */ (function (sinonGlobal) { var slice = Array.prototype.slice; function makeApi(sinon) { function throwYieldError(proxy, text, args) { var msg = sinon.functionName(proxy) + text; if (args.length) { msg += " Received [" + slice.call(args).join(", ") + "]"; } throw new Error(msg); } var callProto = { calledOn: function calledOn(thisValue) { if (sinon.match && sinon.match.isMatcher(thisValue)) { return thisValue.test(this.thisValue); } return this.thisValue === thisValue; }, calledWith: function calledWith() { var l = arguments.length; if (l > this.args.length) { return false; } for (var i = 0; i < l; i += 1) { if (!sinon.deepEqual(arguments[i], this.args[i])) { return false; } } return true; }, calledWithMatch: function calledWithMatch() { var l = arguments.length; if (l > this.args.length) { return false; } for (var i = 0; i < l; i += 1) { var actual = this.args[i]; var expectation = arguments[i]; if (!sinon.match || !sinon.match(expectation).test(actual)) { return false; } } return true; }, calledWithExactly: function calledWithExactly() { return arguments.length === this.args.length && this.calledWith.apply(this, arguments); }, notCalledWith: function notCalledWith() { return !this.calledWith.apply(this, arguments); }, notCalledWithMatch: function notCalledWithMatch() { return !this.calledWithMatch.apply(this, arguments); }, returned: function returned(value) { return sinon.deepEqual(value, this.returnValue); }, threw: function threw(error) { if (typeof error === "undefined" || !this.exception) { return !!this.exception; } return this.exception === error || this.exception.name === error; }, calledWithNew: function calledWithNew() { return this.proxy.prototype && this.thisValue instanceof this.proxy; }, calledBefore: function (other) { return this.callId < other.callId; }, calledAfter: function (other) { return this.callId > other.callId; }, callArg: function (pos) { this.args[pos](); }, callArgOn: function (pos, thisValue) { this.args[pos].apply(thisValue); }, callArgWith: function (pos) { this.callArgOnWith.apply(this, [pos, null].concat(slice.call(arguments, 1))); }, callArgOnWith: function (pos, thisValue) { var args = slice.call(arguments, 2); this.args[pos].apply(thisValue, args); }, "yield": function () { this.yieldOn.apply(this, [null].concat(slice.call(arguments, 0))); }, yieldOn: function (thisValue) { var args = this.args; for (var i = 0, l = args.length; i < l; ++i) { if (typeof args[i] === "function") { args[i].apply(thisValue, slice.call(arguments, 1)); return; } } throwYieldError(this.proxy, " cannot yield since no callback was passed.", args); }, yieldTo: function (prop) { this.yieldToOn.apply(this, [prop, null].concat(slice.call(arguments, 1))); }, yieldToOn: function (prop, thisValue) { var args = this.args; for (var i = 0, l = args.length; i < l; ++i) { if (args[i] && typeof args[i][prop] === "function") { args[i][prop].apply(thisValue, slice.call(arguments, 2)); return; } } throwYieldError(this.proxy, " cannot yield to '" + prop + "' since no callback was passed.", args); }, getStackFrames: function () { // Omit the error message and the two top stack frames in sinon itself: return this.stack && this.stack.split("\n").slice(3); }, toString: function () { var callStr = this.proxy.toString() + "("; var args = []; for (var i = 0, l = this.args.length; i < l; ++i) { args.push(sinon.format(this.args[i])); } callStr = callStr + args.join(", ") + ")"; if (typeof this.returnValue !== "undefined") { callStr += " => " + sinon.format(this.returnValue); } if (this.exception) { callStr += " !" + this.exception.name; if (this.exception.message) { callStr += "(" + this.exception.message + ")"; } } if (this.stack) { callStr += this.getStackFrames()[0].replace(/^\s*(?:at\s+|@)?/, " at "); } return callStr; } }; callProto.invokeCallback = callProto.yield; function createSpyCall(spy, thisValue, args, returnValue, exception, id, stack) { if (typeof id !== "number") { throw new TypeError("Call id is not a number"); } var proxyCall = sinon.create(callProto); proxyCall.proxy = spy; proxyCall.thisValue = thisValue; proxyCall.args = args; proxyCall.returnValue = returnValue; proxyCall.exception = exception; proxyCall.callId = id; proxyCall.stack = stack; return proxyCall; } createSpyCall.toString = callProto.toString; // used by mocks sinon.spyCall = createSpyCall; return createSpyCall; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var sinon = require("./util/core"); require("./match"); require("./format"); module.exports = makeApi(sinon); } if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend times_in_words.js * @depend util/core.js * @depend extend.js * @depend call.js * @depend format.js */ /** * Spy functions * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function (sinonGlobal) { function makeApi(sinon) { var push = Array.prototype.push; var slice = Array.prototype.slice; var callId = 0; function spy(object, property, types) { if (!property && typeof object === "function") { return spy.create(object); } if (!object && !property) { return spy.create(function () { }); } if (types) { var methodDesc = sinon.getPropertyDescriptor(object, property); for (var i = 0; i < types.length; i++) { methodDesc[types[i]] = spy.create(methodDesc[types[i]]); } return sinon.wrapMethod(object, property, methodDesc); } return sinon.wrapMethod(object, property, spy.create(object[property])); } function matchingFake(fakes, args, strict) { if (!fakes) { return undefined; } for (var i = 0, l = fakes.length; i < l; i++) { if (fakes[i].matches(args, strict)) { return fakes[i]; } } } function incrementCallCount() { this.called = true; this.callCount += 1; this.notCalled = false; this.calledOnce = this.callCount === 1; this.calledTwice = this.callCount === 2; this.calledThrice = this.callCount === 3; } function createCallProperties() { this.firstCall = this.getCall(0); this.secondCall = this.getCall(1); this.thirdCall = this.getCall(2); this.lastCall = this.getCall(this.callCount - 1); } var vars = "a,b,c,d,e,f,g,h,i,j,k,l"; function createProxy(func, proxyLength) { // Retain the function length: var p; if (proxyLength) { eval("p = (function proxy(" + vars.substring(0, proxyLength * 2 - 1) + // eslint-disable-line no-eval ") { return p.invoke(func, this, slice.call(arguments)); });"); } else { p = function proxy() { return p.invoke(func, this, slice.call(arguments)); }; } p.isSinonProxy = true; return p; } var uuid = 0; // Public API var spyApi = { reset: function () { if (this.invoking) { var err = new Error("Cannot reset Sinon function while invoking it. " + "Move the call to .reset outside of the callback."); err.name = "InvalidResetException"; throw err; } this.called = false; this.notCalled = true; this.calledOnce = false; this.calledTwice = false; this.calledThrice = false; this.callCount = 0; this.firstCall = null; this.secondCall = null; this.thirdCall = null; this.lastCall = null; this.args = []; this.returnValues = []; this.thisValues = []; this.exceptions = []; this.callIds = []; this.stacks = []; if (this.fakes) { for (var i = 0; i < this.fakes.length; i++) { this.fakes[i].reset(); } } return this; }, create: function create(func, spyLength) { var name; if (typeof func !== "function") { func = function () { }; } else { name = sinon.functionName(func); } if (!spyLength) { spyLength = func.length; } var proxy = createProxy(func, spyLength); sinon.extend(proxy, spy); delete proxy.create; sinon.extend(proxy, func); proxy.reset(); proxy.prototype = func.prototype; proxy.displayName = name || "spy"; proxy.toString = sinon.functionToString; proxy.instantiateFake = sinon.spy.create; proxy.id = "spy#" + uuid++; return proxy; }, invoke: function invoke(func, thisValue, args) { var matching = matchingFake(this.fakes, args); var exception, returnValue; incrementCallCount.call(this); push.call(this.thisValues, thisValue); push.call(this.args, args); push.call(this.callIds, callId++); // Make call properties available from within the spied function: createCallProperties.call(this); try { this.invoking = true; if (matching) { returnValue = matching.invoke(func, thisValue, args); } else { returnValue = (this.func || func).apply(thisValue, args); } var thisCall = this.getCall(this.callCount - 1); if (thisCall.calledWithNew() && typeof returnValue !== "object") { returnValue = thisValue; } } catch (e) { exception = e; } finally { delete this.invoking; } push.call(this.exceptions, exception); push.call(this.returnValues, returnValue); push.call(this.stacks, new Error().stack); // Make return value and exception available in the calls: createCallProperties.call(this); if (exception !== undefined) { throw exception; } return returnValue; }, named: function named(name) { this.displayName = name; return this; }, getCall: function getCall(i) { if (i < 0 || i >= this.callCount) { return null; } return sinon.spyCall(this, this.thisValues[i], this.args[i], this.returnValues[i], this.exceptions[i], this.callIds[i], this.stacks[i]); }, getCalls: function () { var calls = []; var i; for (i = 0; i < this.callCount; i++) { calls.push(this.getCall(i)); } return calls; }, calledBefore: function calledBefore(spyFn) { if (!this.called) { return false; } if (!spyFn.called) { return true; } return this.callIds[0] < spyFn.callIds[spyFn.callIds.length - 1]; }, calledAfter: function calledAfter(spyFn) { if (!this.called || !spyFn.called) { return false; } return this.callIds[this.callCount - 1] > spyFn.callIds[spyFn.callCount - 1]; }, withArgs: function () { var args = slice.call(arguments); if (this.fakes) { var match = matchingFake(this.fakes, args, true); if (match) { return match; } } else { this.fakes = []; } var original = this; var fake = this.instantiateFake(); fake.matchingAguments = args; fake.parent = this; push.call(this.fakes, fake); fake.withArgs = function () { return original.withArgs.apply(original, arguments); }; for (var i = 0; i < this.args.length; i++) { if (fake.matches(this.args[i])) { incrementCallCount.call(fake); push.call(fake.thisValues, this.thisValues[i]); push.call(fake.args, this.args[i]); push.call(fake.returnValues, this.returnValues[i]); push.call(fake.exceptions, this.exceptions[i]); push.call(fake.callIds, this.callIds[i]); } } createCallProperties.call(fake); return fake; }, matches: function (args, strict) { var margs = this.matchingAguments; if (margs.length <= args.length && sinon.deepEqual(margs, args.slice(0, margs.length))) { return !strict || margs.length === args.length; } }, printf: function (format) { var spyInstance = this; var args = slice.call(arguments, 1); var formatter; return (format || "").replace(/%(.)/g, function (match, specifyer) { formatter = spyApi.formatters[specifyer]; if (typeof formatter === "function") { return formatter.call(null, spyInstance, args); } else if (!isNaN(parseInt(specifyer, 10))) { return sinon.format(args[specifyer - 1]); } return "%" + specifyer; }); } }; function delegateToCalls(method, matchAny, actual, notCalled) { spyApi[method] = function () { if (!this.called) { if (notCalled) { return notCalled.apply(this, arguments); } return false; } var currentCall; var matches = 0; for (var i = 0, l = this.callCount; i < l; i += 1) { currentCall = this.getCall(i); if (currentCall[actual || method].apply(currentCall, arguments)) { matches += 1; if (matchAny) { return true; } } } return matches === this.callCount; }; } delegateToCalls("calledOn", true); delegateToCalls("alwaysCalledOn", false, "calledOn"); delegateToCalls("calledWith", true); delegateToCalls("calledWithMatch", true); delegateToCalls("alwaysCalledWith", false, "calledWith"); delegateToCalls("alwaysCalledWithMatch", false, "calledWithMatch"); delegateToCalls("calledWithExactly", true); delegateToCalls("alwaysCalledWithExactly", false, "calledWithExactly"); delegateToCalls("neverCalledWith", false, "notCalledWith", function () { return true; }); delegateToCalls("neverCalledWithMatch", false, "notCalledWithMatch", function () { return true; }); delegateToCalls("threw", true); delegateToCalls("alwaysThrew", false, "threw"); delegateToCalls("returned", true); delegateToCalls("alwaysReturned", false, "returned"); delegateToCalls("calledWithNew", true); delegateToCalls("alwaysCalledWithNew", false, "calledWithNew"); delegateToCalls("callArg", false, "callArgWith", function () { throw new Error(this.toString() + " cannot call arg since it was not yet invoked."); }); spyApi.callArgWith = spyApi.callArg; delegateToCalls("callArgOn", false, "callArgOnWith", function () { throw new Error(this.toString() + " cannot call arg since it was not yet invoked."); }); spyApi.callArgOnWith = spyApi.callArgOn; delegateToCalls("yield", false, "yield", function () { throw new Error(this.toString() + " cannot yield since it was not yet invoked."); }); // "invokeCallback" is an alias for "yield" since "yield" is invalid in strict mode. spyApi.invokeCallback = spyApi.yield; delegateToCalls("yieldOn", false, "yieldOn", function () { throw new Error(this.toString() + " cannot yield since it was not yet invoked."); }); delegateToCalls("yieldTo", false, "yieldTo", function (property) { throw new Error(this.toString() + " cannot yield to '" + property + "' since it was not yet invoked."); }); delegateToCalls("yieldToOn", false, "yieldToOn", function (property) { throw new Error(this.toString() + " cannot yield to '" + property + "' since it was not yet invoked."); }); spyApi.formatters = { c: function (spyInstance) { return sinon.timesInWords(spyInstance.callCount); }, n: function (spyInstance) { return spyInstance.toString(); }, C: function (spyInstance) { var calls = []; for (var i = 0, l = spyInstance.callCount; i < l; ++i) { var stringifiedCall = " " + spyInstance.getCall(i).toString(); if (/\n/.test(calls[i - 1])) { stringifiedCall = "\n" + stringifiedCall; } push.call(calls, stringifiedCall); } return calls.length > 0 ? "\n" + calls.join("\n") : ""; }, t: function (spyInstance) { var objects = []; for (var i = 0, l = spyInstance.callCount; i < l; ++i) { push.call(objects, sinon.format(spyInstance.thisValues[i])); } return objects.join(", "); }, "*": function (spyInstance, args) { var formatted = []; for (var i = 0, l = args.length; i < l; ++i) { push.call(formatted, sinon.format(args[i])); } return formatted.join(", "); } }; sinon.extend(spy, spyApi); spy.spyCall = sinon.spyCall; sinon.spy = spy; return spy; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var core = require("./util/core"); require("./call"); require("./extend"); require("./times_in_words"); require("./format"); module.exports = makeApi(core); } if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend util/core.js * @depend extend.js */ /** * Stub behavior * * @author Christian Johansen (christian@cjohansen.no) * @author Tim Fischbach (mail@timfischbach.de) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function (sinonGlobal) { var slice = Array.prototype.slice; var join = Array.prototype.join; var useLeftMostCallback = -1; var useRightMostCallback = -2; var nextTick = (function () { if (typeof process === "object" && typeof process.nextTick === "function") { return process.nextTick; } if (typeof setImmediate === "function") { return setImmediate; } return function (callback) { setTimeout(callback, 0); }; })(); function throwsException(error, message) { if (typeof error === "string") { this.exception = new Error(message || ""); this.exception.name = error; } else if (!error) { this.exception = new Error("Error"); } else { this.exception = error; } return this; } function getCallback(behavior, args) { var callArgAt = behavior.callArgAt; if (callArgAt >= 0) { return args[callArgAt]; } var argumentList; if (callArgAt === useLeftMostCallback) { argumentList = args; } if (callArgAt === useRightMostCallback) { argumentList = slice.call(args).reverse(); } var callArgProp = behavior.callArgProp; for (var i = 0, l = argumentList.length; i < l; ++i) { if (!callArgProp && typeof argumentList[i] === "function") { return argumentList[i]; } if (callArgProp && argumentList[i] && typeof argumentList[i][callArgProp] === "function") { return argumentList[i][callArgProp]; } } return null; } function makeApi(sinon) { function getCallbackError(behavior, func, args) { if (behavior.callArgAt < 0) { var msg; if (behavior.callArgProp) { msg = sinon.functionName(behavior.stub) + " expected to yield to '" + behavior.callArgProp + "', but no object with such a property was passed."; } else { msg = sinon.functionName(behavior.stub) + " expected to yield, but no callback was passed."; } if (args.length > 0) { msg += " Received [" + join.call(args, ", ") + "]"; } return msg; } return "argument at index " + behavior.callArgAt + " is not a function: " + func; } function callCallback(behavior, args) { if (typeof behavior.callArgAt === "number") { var func = getCallback(behavior, args); if (typeof func !== "function") { throw new TypeError(getCallbackError(behavior, func, args)); } if (behavior.callbackAsync) { nextTick(function () { func.apply(behavior.callbackContext, behavior.callbackArguments); }); } else { func.apply(behavior.callbackContext, behavior.callbackArguments); } } } var proto = { create: function create(stub) { var behavior = sinon.extend({}, sinon.behavior); delete behavior.create; behavior.stub = stub; return behavior; }, isPresent: function isPresent() { return (typeof this.callArgAt === "number" || this.exception || typeof this.returnArgAt === "number" || this.returnThis || this.returnValueDefined); }, invoke: function invoke(context, args) { callCallback(this, args); if (this.exception) { throw this.exception; } else if (typeof this.returnArgAt === "number") { return args[this.returnArgAt]; } else if (this.returnThis) { return context; } return this.returnValue; }, onCall: function onCall(index) { return this.stub.onCall(index); }, onFirstCall: function onFirstCall() { return this.stub.onFirstCall(); }, onSecondCall: function onSecondCall() { return this.stub.onSecondCall(); }, onThirdCall: function onThirdCall() { return this.stub.onThirdCall(); }, withArgs: function withArgs(/* arguments */) { throw new Error( "Defining a stub by invoking \"stub.onCall(...).withArgs(...)\" " + "is not supported. Use \"stub.withArgs(...).onCall(...)\" " + "to define sequential behavior for calls with certain arguments." ); }, callsArg: function callsArg(pos) { if (typeof pos !== "number") { throw new TypeError("argument index is not number"); } this.callArgAt = pos; this.callbackArguments = []; this.callbackContext = undefined; this.callArgProp = undefined; this.callbackAsync = false; return this; }, callsArgOn: function callsArgOn(pos, context) { if (typeof pos !== "number") { throw new TypeError("argument index is not number"); } if (typeof context !== "object") { throw new TypeError("argument context is not an object"); } this.callArgAt = pos; this.callbackArguments = []; this.callbackContext = context; this.callArgProp = undefined; this.callbackAsync = false; return this; }, callsArgWith: function callsArgWith(pos) { if (typeof pos !== "number") { throw new TypeError("argument index is not number"); } this.callArgAt = pos; this.callbackArguments = slice.call(arguments, 1); this.callbackContext = undefined; this.callArgProp = undefined; this.callbackAsync = false; return this; }, callsArgOnWith: function callsArgWith(pos, context) { if (typeof pos !== "number") { throw new TypeError("argument index is not number"); } if (typeof context !== "object") { throw new TypeError("argument context is not an object"); } this.callArgAt = pos; this.callbackArguments = slice.call(arguments, 2); this.callbackContext = context; this.callArgProp = undefined; this.callbackAsync = false; return this; }, yields: function () { this.callArgAt = useLeftMostCallback; this.callbackArguments = slice.call(arguments, 0); this.callbackContext = undefined; this.callArgProp = undefined; this.callbackAsync = false; return this; }, yieldsRight: function () { this.callArgAt = useRightMostCallback; this.callbackArguments = slice.call(arguments, 0); this.callbackContext = undefined; this.callArgProp = undefined; this.callbackAsync = false; return this; }, yieldsOn: function (context) { if (typeof context !== "object") { throw new TypeError("argument context is not an object"); } this.callArgAt = useLeftMostCallback; this.callbackArguments = slice.call(arguments, 1); this.callbackContext = context; this.callArgProp = undefined; this.callbackAsync = false; return this; }, yieldsTo: function (prop) { this.callArgAt = useLeftMostCallback; this.callbackArguments = slice.call(arguments, 1); this.callbackContext = undefined; this.callArgProp = prop; this.callbackAsync = false; return this; }, yieldsToOn: function (prop, context) { if (typeof context !== "object") { throw new TypeError("argument context is not an object"); } this.callArgAt = useLeftMostCallback; this.callbackArguments = slice.call(arguments, 2); this.callbackContext = context; this.callArgProp = prop; this.callbackAsync = false; return this; }, throws: throwsException, throwsException: throwsException, returns: function returns(value) { this.returnValue = value; this.returnValueDefined = true; this.exception = undefined; return this; }, returnsArg: function returnsArg(pos) { if (typeof pos !== "number") { throw new TypeError("argument index is not number"); } this.returnArgAt = pos; return this; }, returnsThis: function returnsThis() { this.returnThis = true; return this; } }; function createAsyncVersion(syncFnName) { return function () { var result = this[syncFnName].apply(this, arguments); this.callbackAsync = true; return result; }; } // create asynchronous versions of callsArg* and yields* methods for (var method in proto) { // need to avoid creating anotherasync versions of the newly added async methods if (proto.hasOwnProperty(method) && method.match(/^(callsArg|yields)/) && !method.match(/Async/)) { proto[method + "Async"] = createAsyncVersion(method); } } sinon.behavior = proto; return proto; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var sinon = require("./util/core"); require("./extend"); module.exports = makeApi(sinon); } if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend util/core.js */ (function (sinonGlobal) { function makeApi(sinon) { function walkInternal(obj, iterator, context, originalObj, seen) { var proto, prop; if (typeof Object.getOwnPropertyNames !== "function") { // We explicitly want to enumerate through all of the prototype's properties // in this case, therefore we deliberately leave out an own property check. /* eslint-disable guard-for-in */ for (prop in obj) { iterator.call(context, obj[prop], prop, obj); } /* eslint-enable guard-for-in */ return; } Object.getOwnPropertyNames(obj).forEach(function (k) { if (!seen[k]) { seen[k] = true; var target = typeof Object.getOwnPropertyDescriptor(obj, k).get === "function" ? originalObj : obj; iterator.call(context, target[k], k, target); } }); proto = Object.getPrototypeOf(obj); if (proto) { walkInternal(proto, iterator, context, originalObj, seen); } } /* Public: walks the prototype chain of an object and iterates over every own property * name encountered. The iterator is called in the same fashion that Array.prototype.forEach * works, where it is passed the value, key, and own object as the 1st, 2nd, and 3rd positional * argument, respectively. In cases where Object.getOwnPropertyNames is not available, walk will * default to using a simple for..in loop. * * obj - The object to walk the prototype chain for. * iterator - The function to be called on each pass of the walk. * context - (Optional) When given, the iterator will be called with this object as the receiver. */ function walk(obj, iterator, context) { return walkInternal(obj, iterator, context, obj, {}); } sinon.walk = walk; return sinon.walk; } function loadDependencies(require, exports, module) { var sinon = require("./util/core"); module.exports = makeApi(sinon); } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend util/core.js * @depend extend.js * @depend spy.js * @depend behavior.js * @depend walk.js */ /** * Stub functions * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function (sinonGlobal) { function makeApi(sinon) { function stub(object, property, func) { if (!!func && typeof func !== "function" && typeof func !== "object") { throw new TypeError("Custom stub should be a function or a property descriptor"); } var wrapper; if (func) { if (typeof func === "function") { wrapper = sinon.spy && sinon.spy.create ? sinon.spy.create(func) : func; } else { wrapper = func; if (sinon.spy && sinon.spy.create) { var types = sinon.objectKeys(wrapper); for (var i = 0; i < types.length; i++) { wrapper[types[i]] = sinon.spy.create(wrapper[types[i]]); } } } } else { var stubLength = 0; if (typeof object === "object" && typeof object[property] === "function") { stubLength = object[property].length; } wrapper = stub.create(stubLength); } if (!object && typeof property === "undefined") { return sinon.stub.create(); } if (typeof property === "undefined" && typeof object === "object") { sinon.walk(object || {}, function (value, prop, propOwner) { // we don't want to stub things like toString(), valueOf(), etc. so we only stub if the object // is not Object.prototype if ( propOwner !== Object.prototype && prop !== "constructor" && typeof sinon.getPropertyDescriptor(propOwner, prop).value === "function" ) { stub(object, prop); } }); return object; } return sinon.wrapMethod(object, property, wrapper); } /*eslint-disable no-use-before-define*/ function getParentBehaviour(stubInstance) { return (stubInstance.parent && getCurrentBehavior(stubInstance.parent)); } function getDefaultBehavior(stubInstance) { return stubInstance.defaultBehavior || getParentBehaviour(stubInstance) || sinon.behavior.create(stubInstance); } function getCurrentBehavior(stubInstance) { var behavior = stubInstance.behaviors[stubInstance.callCount - 1]; return behavior && behavior.isPresent() ? behavior : getDefaultBehavior(stubInstance); } /*eslint-enable no-use-before-define*/ var uuid = 0; var proto = { create: function create(stubLength) { var functionStub = function () { return getCurrentBehavior(functionStub).invoke(this, arguments); }; functionStub.id = "stub#" + uuid++; var orig = functionStub; functionStub = sinon.spy.create(functionStub, stubLength); functionStub.func = orig; sinon.extend(functionStub, stub); functionStub.instantiateFake = sinon.stub.create; functionStub.displayName = "stub"; functionStub.toString = sinon.functionToString; functionStub.defaultBehavior = null; functionStub.behaviors = []; return functionStub; }, resetBehavior: function () { var i; this.defaultBehavior = null; this.behaviors = []; delete this.returnValue; delete this.returnArgAt; this.returnThis = false; if (this.fakes) { for (i = 0; i < this.fakes.length; i++) { this.fakes[i].resetBehavior(); } } }, onCall: function onCall(index) { if (!this.behaviors[index]) { this.behaviors[index] = sinon.behavior.create(this); } return this.behaviors[index]; }, onFirstCall: function onFirstCall() { return this.onCall(0); }, onSecondCall: function onSecondCall() { return this.onCall(1); }, onThirdCall: function onThirdCall() { return this.onCall(2); } }; function createBehavior(behaviorMethod) { return function () { this.defaultBehavior = this.defaultBehavior || sinon.behavior.create(this); this.defaultBehavior[behaviorMethod].apply(this.defaultBehavior, arguments); return this; }; } for (var method in sinon.behavior) { if (sinon.behavior.hasOwnProperty(method) && !proto.hasOwnProperty(method) && method !== "create" && method !== "withArgs" && method !== "invoke") { proto[method] = createBehavior(method); } } sinon.extend(stub, proto); sinon.stub = stub; return stub; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var core = require("./util/core"); require("./behavior"); require("./spy"); require("./extend"); module.exports = makeApi(core); } if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend times_in_words.js * @depend util/core.js * @depend call.js * @depend extend.js * @depend match.js * @depend spy.js * @depend stub.js * @depend format.js */ /** * Mock functions. * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function (sinonGlobal) { function makeApi(sinon) { var push = [].push; var match = sinon.match; function mock(object) { // if (typeof console !== undefined && console.warn) { // console.warn("mock will be removed from Sinon.JS v2.0"); // } if (!object) { return sinon.expectation.create("Anonymous mock"); } return mock.create(object); } function each(collection, callback) { if (!collection) { return; } for (var i = 0, l = collection.length; i < l; i += 1) { callback(collection[i]); } } function arrayEquals(arr1, arr2, compareLength) { if (compareLength && (arr1.length !== arr2.length)) { return false; } for (var i = 0, l = arr1.length; i < l; i++) { if (!sinon.deepEqual(arr1[i], arr2[i])) { return false; } } return true; } sinon.extend(mock, { create: function create(object) { if (!object) { throw new TypeError("object is null"); } var mockObject = sinon.extend({}, mock); mockObject.object = object; delete mockObject.create; return mockObject; }, expects: function expects(method) { if (!method) { throw new TypeError("method is falsy"); } if (!this.expectations) { this.expectations = {}; this.proxies = []; } if (!this.expectations[method]) { this.expectations[method] = []; var mockObject = this; sinon.wrapMethod(this.object, method, function () { return mockObject.invokeMethod(method, this, arguments); }); push.call(this.proxies, method); } var expectation = sinon.expectation.create(method); push.call(this.expectations[method], expectation); return expectation; }, restore: function restore() { var object = this.object; each(this.proxies, function (proxy) { if (typeof object[proxy].restore === "function") { object[proxy].restore(); } }); }, verify: function verify() { var expectations = this.expectations || {}; var messages = []; var met = []; each(this.proxies, function (proxy) { each(expectations[proxy], function (expectation) { if (!expectation.met()) { push.call(messages, expectation.toString()); } else { push.call(met, expectation.toString()); } }); }); this.restore(); if (messages.length > 0) { sinon.expectation.fail(messages.concat(met).join("\n")); } else if (met.length > 0) { sinon.expectation.pass(messages.concat(met).join("\n")); } return true; }, invokeMethod: function invokeMethod(method, thisValue, args) { var expectations = this.expectations && this.expectations[method] ? this.expectations[method] : []; var expectationsWithMatchingArgs = []; var currentArgs = args || []; var i, available; for (i = 0; i < expectations.length; i += 1) { var expectedArgs = expectations[i].expectedArguments || []; if (arrayEquals(expectedArgs, currentArgs, expectations[i].expectsExactArgCount)) { expectationsWithMatchingArgs.push(expectations[i]); } } for (i = 0; i < expectationsWithMatchingArgs.length; i += 1) { if (!expectationsWithMatchingArgs[i].met() && expectationsWithMatchingArgs[i].allowsCall(thisValue, args)) { return expectationsWithMatchingArgs[i].apply(thisValue, args); } } var messages = []; var exhausted = 0; for (i = 0; i < expectationsWithMatchingArgs.length; i += 1) { if (expectationsWithMatchingArgs[i].allowsCall(thisValue, args)) { available = available || expectationsWithMatchingArgs[i]; } else { exhausted += 1; } } if (available && exhausted === 0) { return available.apply(thisValue, args); } for (i = 0; i < expectations.length; i += 1) { push.call(messages, " " + expectations[i].toString()); } messages.unshift("Unexpected call: " + sinon.spyCall.toString.call({ proxy: method, args: args })); sinon.expectation.fail(messages.join("\n")); } }); var times = sinon.timesInWords; var slice = Array.prototype.slice; function callCountInWords(callCount) { if (callCount === 0) { return "never called"; } return "called " + times(callCount); } function expectedCallCountInWords(expectation) { var min = expectation.minCalls; var max = expectation.maxCalls; if (typeof min === "number" && typeof max === "number") { var str = times(min); if (min !== max) { str = "at least " + str + " and at most " + times(max); } return str; } if (typeof min === "number") { return "at least " + times(min); } return "at most " + times(max); } function receivedMinCalls(expectation) { var hasMinLimit = typeof expectation.minCalls === "number"; return !hasMinLimit || expectation.callCount >= expectation.minCalls; } function receivedMaxCalls(expectation) { if (typeof expectation.maxCalls !== "number") { return false; } return expectation.callCount === expectation.maxCalls; } function verifyMatcher(possibleMatcher, arg) { var isMatcher = match && match.isMatcher(possibleMatcher); return isMatcher && possibleMatcher.test(arg) || true; } sinon.expectation = { minCalls: 1, maxCalls: 1, create: function create(methodName) { var expectation = sinon.extend(sinon.stub.create(), sinon.expectation); delete expectation.create; expectation.method = methodName; return expectation; }, invoke: function invoke(func, thisValue, args) { this.verifyCallAllowed(thisValue, args); return sinon.spy.invoke.apply(this, arguments); }, atLeast: function atLeast(num) { if (typeof num !== "number") { throw new TypeError("'" + num + "' is not number"); } if (!this.limitsSet) { this.maxCalls = null; this.limitsSet = true; } this.minCalls = num; return this; }, atMost: function atMost(num) { if (typeof num !== "number") { throw new TypeError("'" + num + "' is not number"); } if (!this.limitsSet) { this.minCalls = null; this.limitsSet = true; } this.maxCalls = num; return this; }, never: function never() { return this.exactly(0); }, once: function once() { return this.exactly(1); }, twice: function twice() { return this.exactly(2); }, thrice: function thrice() { return this.exactly(3); }, exactly: function exactly(num) { if (typeof num !== "number") { throw new TypeError("'" + num + "' is not a number"); } this.atLeast(num); return this.atMost(num); }, met: function met() { return !this.failed && receivedMinCalls(this); }, verifyCallAllowed: function verifyCallAllowed(thisValue, args) { if (receivedMaxCalls(this)) { this.failed = true; sinon.expectation.fail(this.method + " already called " + times(this.maxCalls)); } if ("expectedThis" in this && this.expectedThis !== thisValue) { sinon.expectation.fail(this.method + " called with " + thisValue + " as thisValue, expected " + this.expectedThis); } if (!("expectedArguments" in this)) { return; } if (!args) { sinon.expectation.fail(this.method + " received no arguments, expected " + sinon.format(this.expectedArguments)); } if (args.length < this.expectedArguments.length) { sinon.expectation.fail(this.method + " received too few arguments (" + sinon.format(args) + "), expected " + sinon.format(this.expectedArguments)); } if (this.expectsExactArgCount && args.length !== this.expectedArguments.length) { sinon.expectation.fail(this.method + " received too many arguments (" + sinon.format(args) + "), expected " + sinon.format(this.expectedArguments)); } for (var i = 0, l = this.expectedArguments.length; i < l; i += 1) { if (!verifyMatcher(this.expectedArguments[i], args[i])) { sinon.expectation.fail(this.method + " received wrong arguments " + sinon.format(args) + ", didn't match " + this.expectedArguments.toString()); } if (!sinon.deepEqual(this.expectedArguments[i], args[i])) { sinon.expectation.fail(this.method + " received wrong arguments " + sinon.format(args) + ", expected " + sinon.format(this.expectedArguments)); } } }, allowsCall: function allowsCall(thisValue, args) { if (this.met() && receivedMaxCalls(this)) { return false; } if ("expectedThis" in this && this.expectedThis !== thisValue) { return false; } if (!("expectedArguments" in this)) { return true; } args = args || []; if (args.length < this.expectedArguments.length) { return false; } if (this.expectsExactArgCount && args.length !== this.expectedArguments.length) { return false; } for (var i = 0, l = this.expectedArguments.length; i < l; i += 1) { if (!verifyMatcher(this.expectedArguments[i], args[i])) { return false; } if (!sinon.deepEqual(this.expectedArguments[i], args[i])) { return false; } } return true; }, withArgs: function withArgs() { this.expectedArguments = slice.call(arguments); return this; }, withExactArgs: function withExactArgs() { this.withArgs.apply(this, arguments); this.expectsExactArgCount = true; return this; }, on: function on(thisValue) { this.expectedThis = thisValue; return this; }, toString: function () { var args = (this.expectedArguments || []).slice(); if (!this.expectsExactArgCount) { push.call(args, "[...]"); } var callStr = sinon.spyCall.toString.call({ proxy: this.method || "anonymous mock expectation", args: args }); var message = callStr.replace(", [...", "[, ...") + " " + expectedCallCountInWords(this); if (this.met()) { return "Expectation met: " + message; } return "Expected " + message + " (" + callCountInWords(this.callCount) + ")"; }, verify: function verify() { if (!this.met()) { sinon.expectation.fail(this.toString()); } else { sinon.expectation.pass(this.toString()); } return true; }, pass: function pass(message) { sinon.assert.pass(message); }, fail: function fail(message) { var exception = new Error(message); exception.name = "ExpectationError"; throw exception; } }; sinon.mock = mock; return mock; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var sinon = require("./util/core"); require("./times_in_words"); require("./call"); require("./extend"); require("./match"); require("./spy"); require("./stub"); require("./format"); module.exports = makeApi(sinon); } if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend util/core.js * @depend spy.js * @depend stub.js * @depend mock.js */ /** * Collections of stubs, spies and mocks. * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function (sinonGlobal) { var push = [].push; var hasOwnProperty = Object.prototype.hasOwnProperty; function getFakes(fakeCollection) { if (!fakeCollection.fakes) { fakeCollection.fakes = []; } return fakeCollection.fakes; } function each(fakeCollection, method) { var fakes = getFakes(fakeCollection); for (var i = 0, l = fakes.length; i < l; i += 1) { if (typeof fakes[i][method] === "function") { fakes[i][method](); } } } function compact(fakeCollection) { var fakes = getFakes(fakeCollection); var i = 0; while (i < fakes.length) { fakes.splice(i, 1); } } function makeApi(sinon) { var collection = { verify: function resolve() { each(this, "verify"); }, restore: function restore() { each(this, "restore"); compact(this); }, reset: function restore() { each(this, "reset"); }, verifyAndRestore: function verifyAndRestore() { var exception; try { this.verify(); } catch (e) { exception = e; } this.restore(); if (exception) { throw exception; } }, add: function add(fake) { push.call(getFakes(this), fake); return fake; }, spy: function spy() { return this.add(sinon.spy.apply(sinon, arguments)); }, stub: function stub(object, property, value) { if (property) { var original = object[property]; if (typeof original !== "function") { if (!hasOwnProperty.call(object, property)) { throw new TypeError("Cannot stub non-existent own property " + property); } object[property] = value; return this.add({ restore: function () { object[property] = original; } }); } } if (!property && !!object && typeof object === "object") { var stubbedObj = sinon.stub.apply(sinon, arguments); for (var prop in stubbedObj) { if (typeof stubbedObj[prop] === "function") { this.add(stubbedObj[prop]); } } return stubbedObj; } return this.add(sinon.stub.apply(sinon, arguments)); }, mock: function mock() { return this.add(sinon.mock.apply(sinon, arguments)); }, inject: function inject(obj) { var col = this; obj.spy = function () { return col.spy.apply(col, arguments); }; obj.stub = function () { return col.stub.apply(col, arguments); }; obj.mock = function () { return col.mock.apply(col, arguments); }; return obj; } }; sinon.collection = collection; return collection; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var sinon = require("./util/core"); require("./mock"); require("./spy"); require("./stub"); module.exports = makeApi(sinon); } if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * Fake timer API * setTimeout * setInterval * clearTimeout * clearInterval * tick * reset * Date * * Inspired by jsUnitMockTimeOut from JsUnit * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function () { function makeApi(s, lol) { /*global lolex */ var llx = typeof lolex !== "undefined" ? lolex : lol; s.useFakeTimers = function () { var now; var methods = Array.prototype.slice.call(arguments); if (typeof methods[0] === "string") { now = 0; } else { now = methods.shift(); } var clock = llx.install(now || 0, methods); clock.restore = clock.uninstall; return clock; }; s.clock = { create: function (now) { return llx.createClock(now); } }; s.timers = { setTimeout: setTimeout, clearTimeout: clearTimeout, setImmediate: (typeof setImmediate !== "undefined" ? setImmediate : undefined), clearImmediate: (typeof clearImmediate !== "undefined" ? clearImmediate : undefined), setInterval: setInterval, clearInterval: clearInterval, Date: Date }; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, epxorts, module, lolex) { var core = require("./core"); makeApi(core, lolex); module.exports = core; } if (isAMD) { define(loadDependencies); } else if (isNode) { loadDependencies(require, module.exports, module, require("lolex")); } else { makeApi(sinon); // eslint-disable-line no-undef } }()); /** * Minimal Event interface implementation * * Original implementation by Sven Fuchs: https://gist.github.com/995028 * Modifications and tests by Christian Johansen. * * @author Sven Fuchs (svenfuchs@artweb-design.de) * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2011 Sven Fuchs, Christian Johansen */ if (typeof sinon === "undefined") { this.sinon = {}; } (function () { var push = [].push; function makeApi(sinon) { sinon.Event = function Event(type, bubbles, cancelable, target) { this.initEvent(type, bubbles, cancelable, target); }; sinon.Event.prototype = { initEvent: function (type, bubbles, cancelable, target) { this.type = type; this.bubbles = bubbles; this.cancelable = cancelable; this.target = target; }, stopPropagation: function () { }, preventDefault: function () { this.defaultPrevented = true; } }; sinon.ProgressEvent = function ProgressEvent(type, progressEventRaw, target) { this.initEvent(type, false, false, target); this.loaded = progressEventRaw.loaded || null; this.total = progressEventRaw.total || null; this.lengthComputable = !!progressEventRaw.total; }; sinon.ProgressEvent.prototype = new sinon.Event(); sinon.ProgressEvent.prototype.constructor = sinon.ProgressEvent; sinon.CustomEvent = function CustomEvent(type, customData, target) { this.initEvent(type, false, false, target); this.detail = customData.detail || null; }; sinon.CustomEvent.prototype = new sinon.Event(); sinon.CustomEvent.prototype.constructor = sinon.CustomEvent; sinon.EventTarget = { addEventListener: function addEventListener(event, listener) { this.eventListeners = this.eventListeners || {}; this.eventListeners[event] = this.eventListeners[event] || []; push.call(this.eventListeners[event], listener); }, removeEventListener: function removeEventListener(event, listener) { var listeners = this.eventListeners && this.eventListeners[event] || []; for (var i = 0, l = listeners.length; i < l; ++i) { if (listeners[i] === listener) { return listeners.splice(i, 1); } } }, dispatchEvent: function dispatchEvent(event) { var type = event.type; var listeners = this.eventListeners && this.eventListeners[type] || []; for (var i = 0; i < listeners.length; i++) { if (typeof listeners[i] === "function") { listeners[i].call(this, event); } else { listeners[i].handleEvent(event); } } return !!event.defaultPrevented; } }; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require) { var sinon = require("./core"); makeApi(sinon); } if (isAMD) { define(loadDependencies); } else if (isNode) { loadDependencies(require); } else { makeApi(sinon); // eslint-disable-line no-undef } }()); /** * @depend util/core.js */ /** * Logs errors * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2014 Christian Johansen */ (function (sinonGlobal) { // cache a reference to setTimeout, so that our reference won't be stubbed out // when using fake timers and errors will still get logged // https://github.com/cjohansen/Sinon.JS/issues/381 var realSetTimeout = setTimeout; function makeApi(sinon) { function log() { } function logError(label, err) { var msg = label + " threw exception: "; function throwLoggedError() { err.message = msg + err.message; throw err; } sinon.log(msg + "[" + err.name + "] " + err.message); if (err.stack) { sinon.log(err.stack); } if (logError.useImmediateExceptions) { throwLoggedError(); } else { logError.setTimeout(throwLoggedError, 0); } } // When set to true, any errors logged will be thrown immediately; // If set to false, the errors will be thrown in separate execution frame. logError.useImmediateExceptions = false; // wrap realSetTimeout with something we can stub in tests logError.setTimeout = function (func, timeout) { realSetTimeout(func, timeout); }; var exports = {}; exports.log = sinon.log = log; exports.logError = sinon.logError = logError; return exports; } function loadDependencies(require, exports, module) { var sinon = require("./util/core"); module.exports = makeApi(sinon); } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend core.js * @depend ../extend.js * @depend event.js * @depend ../log_error.js */ /** * Fake XDomainRequest object */ if (typeof sinon === "undefined") { this.sinon = {}; } // wrapper for global (function (global) { var xdr = { XDomainRequest: global.XDomainRequest }; xdr.GlobalXDomainRequest = global.XDomainRequest; xdr.supportsXDR = typeof xdr.GlobalXDomainRequest !== "undefined"; xdr.workingXDR = xdr.supportsXDR ? xdr.GlobalXDomainRequest : false; function makeApi(sinon) { sinon.xdr = xdr; function FakeXDomainRequest() { this.readyState = FakeXDomainRequest.UNSENT; this.requestBody = null; this.requestHeaders = {}; this.status = 0; this.timeout = null; if (typeof FakeXDomainRequest.onCreate === "function") { FakeXDomainRequest.onCreate(this); } } function verifyState(x) { if (x.readyState !== FakeXDomainRequest.OPENED) { throw new Error("INVALID_STATE_ERR"); } if (x.sendFlag) { throw new Error("INVALID_STATE_ERR"); } } function verifyRequestSent(x) { if (x.readyState === FakeXDomainRequest.UNSENT) { throw new Error("Request not sent"); } if (x.readyState === FakeXDomainRequest.DONE) { throw new Error("Request done"); } } function verifyResponseBodyType(body) { if (typeof body !== "string") { var error = new Error("Attempted to respond to fake XDomainRequest with " + body + ", which is not a string."); error.name = "InvalidBodyException"; throw error; } } sinon.extend(FakeXDomainRequest.prototype, sinon.EventTarget, { open: function open(method, url) { this.method = method; this.url = url; this.responseText = null; this.sendFlag = false; this.readyStateChange(FakeXDomainRequest.OPENED); }, readyStateChange: function readyStateChange(state) { this.readyState = state; var eventName = ""; switch (this.readyState) { case FakeXDomainRequest.UNSENT: break; case FakeXDomainRequest.OPENED: break; case FakeXDomainRequest.LOADING: if (this.sendFlag) { //raise the progress event eventName = "onprogress"; } break; case FakeXDomainRequest.DONE: if (this.isTimeout) { eventName = "ontimeout"; } else if (this.errorFlag || (this.status < 200 || this.status > 299)) { eventName = "onerror"; } else { eventName = "onload"; } break; } // raising event (if defined) if (eventName) { if (typeof this[eventName] === "function") { try { this[eventName](); } catch (e) { sinon.logError("Fake XHR " + eventName + " handler", e); } } } }, send: function send(data) { verifyState(this); if (!/^(get|head)$/i.test(this.method)) { this.requestBody = data; } this.requestHeaders["Content-Type"] = "text/plain;charset=utf-8"; this.errorFlag = false; this.sendFlag = true; this.readyStateChange(FakeXDomainRequest.OPENED); if (typeof this.onSend === "function") { this.onSend(this); } }, abort: function abort() { this.aborted = true; this.responseText = null; this.errorFlag = true; if (this.readyState > sinon.FakeXDomainRequest.UNSENT && this.sendFlag) { this.readyStateChange(sinon.FakeXDomainRequest.DONE); this.sendFlag = false; } }, setResponseBody: function setResponseBody(body) { verifyRequestSent(this); verifyResponseBodyType(body); var chunkSize = this.chunkSize || 10; var index = 0; this.responseText = ""; do { this.readyStateChange(FakeXDomainRequest.LOADING); this.responseText += body.substring(index, index + chunkSize); index += chunkSize; } while (index < body.length); this.readyStateChange(FakeXDomainRequest.DONE); }, respond: function respond(status, contentType, body) { // content-type ignored, since XDomainRequest does not carry this // we keep the same syntax for respond(...) as for FakeXMLHttpRequest to ease // test integration across browsers this.status = typeof status === "number" ? status : 200; this.setResponseBody(body || ""); }, simulatetimeout: function simulatetimeout() { this.status = 0; this.isTimeout = true; // Access to this should actually throw an error this.responseText = undefined; this.readyStateChange(FakeXDomainRequest.DONE); } }); sinon.extend(FakeXDomainRequest, { UNSENT: 0, OPENED: 1, LOADING: 3, DONE: 4 }); sinon.useFakeXDomainRequest = function useFakeXDomainRequest() { sinon.FakeXDomainRequest.restore = function restore(keepOnCreate) { if (xdr.supportsXDR) { global.XDomainRequest = xdr.GlobalXDomainRequest; } delete sinon.FakeXDomainRequest.restore; if (keepOnCreate !== true) { delete sinon.FakeXDomainRequest.onCreate; } }; if (xdr.supportsXDR) { global.XDomainRequest = sinon.FakeXDomainRequest; } return sinon.FakeXDomainRequest; }; sinon.FakeXDomainRequest = FakeXDomainRequest; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var sinon = require("./core"); require("../extend"); require("./event"); require("../log_error"); makeApi(sinon); module.exports = sinon; } if (isAMD) { define(loadDependencies); } else if (isNode) { loadDependencies(require, module.exports, module); } else { makeApi(sinon); // eslint-disable-line no-undef } })(typeof global !== "undefined" ? global : self); /** * @depend core.js * @depend ../extend.js * @depend event.js * @depend ../log_error.js */ /** * Fake XMLHttpRequest object * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function (sinonGlobal, global) { function getWorkingXHR(globalScope) { var supportsXHR = typeof globalScope.XMLHttpRequest !== "undefined"; if (supportsXHR) { return globalScope.XMLHttpRequest; } var supportsActiveX = typeof globalScope.ActiveXObject !== "undefined"; if (supportsActiveX) { return function () { return new globalScope.ActiveXObject("MSXML2.XMLHTTP.3.0"); }; } return false; } var supportsProgress = typeof ProgressEvent !== "undefined"; var supportsCustomEvent = typeof CustomEvent !== "undefined"; var supportsFormData = typeof FormData !== "undefined"; var supportsArrayBuffer = typeof ArrayBuffer !== "undefined"; var supportsBlob = typeof Blob === "function"; var sinonXhr = { XMLHttpRequest: global.XMLHttpRequest }; sinonXhr.GlobalXMLHttpRequest = global.XMLHttpRequest; sinonXhr.GlobalActiveXObject = global.ActiveXObject; sinonXhr.supportsActiveX = typeof sinonXhr.GlobalActiveXObject !== "undefined"; sinonXhr.supportsXHR = typeof sinonXhr.GlobalXMLHttpRequest !== "undefined"; sinonXhr.workingXHR = getWorkingXHR(global); sinonXhr.supportsCORS = sinonXhr.supportsXHR && "withCredentials" in (new sinonXhr.GlobalXMLHttpRequest()); var unsafeHeaders = { "Accept-Charset": true, "Accept-Encoding": true, Connection: true, "Content-Length": true, Cookie: true, Cookie2: true, "Content-Transfer-Encoding": true, Date: true, Expect: true, Host: true, "Keep-Alive": true, Referer: true, TE: true, Trailer: true, "Transfer-Encoding": true, Upgrade: true, "User-Agent": true, Via: true }; // An upload object is created for each // FakeXMLHttpRequest and allows upload // events to be simulated using uploadProgress // and uploadError. function UploadProgress() { this.eventListeners = { progress: [], load: [], abort: [], error: [] }; } UploadProgress.prototype.addEventListener = function addEventListener(event, listener) { this.eventListeners[event].push(listener); }; UploadProgress.prototype.removeEventListener = function removeEventListener(event, listener) { var listeners = this.eventListeners[event] || []; for (var i = 0, l = listeners.length; i < l; ++i) { if (listeners[i] === listener) { return listeners.splice(i, 1); } } }; UploadProgress.prototype.dispatchEvent = function dispatchEvent(event) { var listeners = this.eventListeners[event.type] || []; for (var i = 0, listener; (listener = listeners[i]) != null; i++) { listener(event); } }; // Note that for FakeXMLHttpRequest to work pre ES5 // we lose some of the alignment with the spec. // To ensure as close a match as possible, // set responseType before calling open, send or respond; function FakeXMLHttpRequest() { this.readyState = FakeXMLHttpRequest.UNSENT; this.requestHeaders = {}; this.requestBody = null; this.status = 0; this.statusText = ""; this.upload = new UploadProgress(); this.responseType = ""; this.response = ""; if (sinonXhr.supportsCORS) { this.withCredentials = false; } var xhr = this; var events = ["loadstart", "load", "abort", "loadend"]; function addEventListener(eventName) { xhr.addEventListener(eventName, function (event) { var listener = xhr["on" + eventName]; if (listener && typeof listener === "function") { listener.call(this, event); } }); } for (var i = events.length - 1; i >= 0; i--) { addEventListener(events[i]); } if (typeof FakeXMLHttpRequest.onCreate === "function") { FakeXMLHttpRequest.onCreate(this); } } function verifyState(xhr) { if (xhr.readyState !== FakeXMLHttpRequest.OPENED) { throw new Error("INVALID_STATE_ERR"); } if (xhr.sendFlag) { throw new Error("INVALID_STATE_ERR"); } } function getHeader(headers, header) { header = header.toLowerCase(); for (var h in headers) { if (h.toLowerCase() === header) { return h; } } return null; } // filtering to enable a white-list version of Sinon FakeXhr, // where whitelisted requests are passed through to real XHR function each(collection, callback) { if (!collection) { return; } for (var i = 0, l = collection.length; i < l; i += 1) { callback(collection[i]); } } function some(collection, callback) { for (var index = 0; index < collection.length; index++) { if (callback(collection[index]) === true) { return true; } } return false; } // largest arity in XHR is 5 - XHR#open var apply = function (obj, method, args) { switch (args.length) { case 0: return obj[method](); case 1: return obj[method](args[0]); case 2: return obj[method](args[0], args[1]); case 3: return obj[method](args[0], args[1], args[2]); case 4: return obj[method](args[0], args[1], args[2], args[3]); case 5: return obj[method](args[0], args[1], args[2], args[3], args[4]); } }; FakeXMLHttpRequest.filters = []; FakeXMLHttpRequest.addFilter = function addFilter(fn) { this.filters.push(fn); }; var IE6Re = /MSIE 6/; FakeXMLHttpRequest.defake = function defake(fakeXhr, xhrArgs) { var xhr = new sinonXhr.workingXHR(); // eslint-disable-line new-cap each([ "open", "setRequestHeader", "send", "abort", "getResponseHeader", "getAllResponseHeaders", "addEventListener", "overrideMimeType", "removeEventListener" ], function (method) { fakeXhr[method] = function () { return apply(xhr, method, arguments); }; }); var copyAttrs = function (args) { each(args, function (attr) { try { fakeXhr[attr] = xhr[attr]; } catch (e) { if (!IE6Re.test(navigator.userAgent)) { throw e; } } }); }; var stateChange = function stateChange() { fakeXhr.readyState = xhr.readyState; if (xhr.readyState >= FakeXMLHttpRequest.HEADERS_RECEIVED) { copyAttrs(["status", "statusText"]); } if (xhr.readyState >= FakeXMLHttpRequest.LOADING) { copyAttrs(["responseText", "response"]); } if (xhr.readyState === FakeXMLHttpRequest.DONE) { copyAttrs(["responseXML"]); } if (fakeXhr.onreadystatechange) { fakeXhr.onreadystatechange.call(fakeXhr, { target: fakeXhr }); } }; if (xhr.addEventListener) { for (var event in fakeXhr.eventListeners) { if (fakeXhr.eventListeners.hasOwnProperty(event)) { /*eslint-disable no-loop-func*/ each(fakeXhr.eventListeners[event], function (handler) { xhr.addEventListener(event, handler); }); /*eslint-enable no-loop-func*/ } } xhr.addEventListener("readystatechange", stateChange); } else { xhr.onreadystatechange = stateChange; } apply(xhr, "open", xhrArgs); }; FakeXMLHttpRequest.useFilters = false; function verifyRequestOpened(xhr) { if (xhr.readyState !== FakeXMLHttpRequest.OPENED) { throw new Error("INVALID_STATE_ERR - " + xhr.readyState); } } function verifyRequestSent(xhr) { if (xhr.readyState === FakeXMLHttpRequest.DONE) { throw new Error("Request done"); } } function verifyHeadersReceived(xhr) { if (xhr.async && xhr.readyState !== FakeXMLHttpRequest.HEADERS_RECEIVED) { throw new Error("No headers received"); } } function verifyResponseBodyType(body) { if (typeof body !== "string") { var error = new Error("Attempted to respond to fake XMLHttpRequest with " + body + ", which is not a string."); error.name = "InvalidBodyException"; throw error; } } function convertToArrayBuffer(body) { var buffer = new ArrayBuffer(body.length); var view = new Uint8Array(buffer); for (var i = 0; i < body.length; i++) { var charCode = body.charCodeAt(i); if (charCode >= 256) { throw new TypeError("arraybuffer or blob responseTypes require binary string, " + "invalid character " + body[i] + " found."); } view[i] = charCode; } return buffer; } function isXmlContentType(contentType) { return !contentType || /(text\/xml)|(application\/xml)|(\+xml)/.test(contentType); } function convertResponseBody(responseType, contentType, body) { if (responseType === "" || responseType === "text") { return body; } else if (supportsArrayBuffer && responseType === "arraybuffer") { return convertToArrayBuffer(body); } else if (responseType === "json") { try { return JSON.parse(body); } catch (e) { // Return parsing failure as null return null; } } else if (supportsBlob && responseType === "blob") { var blobOptions = {}; if (contentType) { blobOptions.type = contentType; } return new Blob([convertToArrayBuffer(body)], blobOptions); } else if (responseType === "document") { if (isXmlContentType(contentType)) { return FakeXMLHttpRequest.parseXML(body); } return null; } throw new Error("Invalid responseType " + responseType); } function clearResponse(xhr) { if (xhr.responseType === "" || xhr.responseType === "text") { xhr.response = xhr.responseText = ""; } else { xhr.response = xhr.responseText = null; } xhr.responseXML = null; } FakeXMLHttpRequest.parseXML = function parseXML(text) { // Treat empty string as parsing failure if (text !== "") { try { if (typeof DOMParser !== "undefined") { var parser = new DOMParser(); return parser.parseFromString(text, "text/xml"); } var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = "false"; xmlDoc.loadXML(text); return xmlDoc; } catch (e) { // Unable to parse XML - no biggie } } return null; }; FakeXMLHttpRequest.statusCodes = { 100: "Continue", 101: "Switching Protocols", 200: "OK", 201: "Created", 202: "Accepted", 203: "Non-Authoritative Information", 204: "No Content", 205: "Reset Content", 206: "Partial Content", 207: "Multi-Status", 300: "Multiple Choice", 301: "Moved Permanently", 302: "Found", 303: "See Other", 304: "Not Modified", 305: "Use Proxy", 307: "Temporary Redirect", 400: "Bad Request", 401: "Unauthorized", 402: "Payment Required", 403: "Forbidden", 404: "Not Found", 405: "Method Not Allowed", 406: "Not Acceptable", 407: "Proxy Authentication Required", 408: "Request Timeout", 409: "Conflict", 410: "Gone", 411: "Length Required", 412: "Precondition Failed", 413: "Request Entity Too Large", 414: "Request-URI Too Long", 415: "Unsupported Media Type", 416: "Requested Range Not Satisfiable", 417: "Expectation Failed", 422: "Unprocessable Entity", 500: "Internal Server Error", 501: "Not Implemented", 502: "Bad Gateway", 503: "Service Unavailable", 504: "Gateway Timeout", 505: "HTTP Version Not Supported" }; function makeApi(sinon) { sinon.xhr = sinonXhr; sinon.extend(FakeXMLHttpRequest.prototype, sinon.EventTarget, { async: true, open: function open(method, url, async, username, password) { this.method = method; this.url = url; this.async = typeof async === "boolean" ? async : true; this.username = username; this.password = password; clearResponse(this); this.requestHeaders = {}; this.sendFlag = false; if (FakeXMLHttpRequest.useFilters === true) { var xhrArgs = arguments; var defake = some(FakeXMLHttpRequest.filters, function (filter) { return filter.apply(this, xhrArgs); }); if (defake) { return FakeXMLHttpRequest.defake(this, arguments); } } this.readyStateChange(FakeXMLHttpRequest.OPENED); }, readyStateChange: function readyStateChange(state) { this.readyState = state; var readyStateChangeEvent = new sinon.Event("readystatechange", false, false, this); if (typeof this.onreadystatechange === "function") { try { this.onreadystatechange(readyStateChangeEvent); } catch (e) { sinon.logError("Fake XHR onreadystatechange handler", e); } } switch (this.readyState) { case FakeXMLHttpRequest.DONE: if (supportsProgress) { this.upload.dispatchEvent(new sinon.ProgressEvent("progress", { loaded: 100, total: 100 })); this.dispatchEvent(new sinon.ProgressEvent("progress", { loaded: 100, total: 100 })); } this.upload.dispatchEvent(new sinon.Event("load", false, false, this)); this.dispatchEvent(new sinon.Event("load", false, false, this)); this.dispatchEvent(new sinon.Event("loadend", false, false, this)); break; } this.dispatchEvent(readyStateChangeEvent); }, setRequestHeader: function setRequestHeader(header, value) { verifyState(this); if (unsafeHeaders[header] || /^(Sec-|Proxy-)/.test(header)) { throw new Error("Refused to set unsafe header \"" + header + "\""); } if (this.requestHeaders[header]) { this.requestHeaders[header] += "," + value; } else { this.requestHeaders[header] = value; } }, // Helps testing setResponseHeaders: function setResponseHeaders(headers) { verifyRequestOpened(this); this.responseHeaders = {}; for (var header in headers) { if (headers.hasOwnProperty(header)) { this.responseHeaders[header] = headers[header]; } } if (this.async) { this.readyStateChange(FakeXMLHttpRequest.HEADERS_RECEIVED); } else { this.readyState = FakeXMLHttpRequest.HEADERS_RECEIVED; } }, // Currently treats ALL data as a DOMString (i.e. no Document) send: function send(data) { verifyState(this); if (!/^(get|head)$/i.test(this.method)) { var contentType = getHeader(this.requestHeaders, "Content-Type"); if (this.requestHeaders[contentType]) { var value = this.requestHeaders[contentType].split(";"); this.requestHeaders[contentType] = value[0] + ";charset=utf-8"; } else if (supportsFormData && !(data instanceof FormData)) { this.requestHeaders["Content-Type"] = "text/plain;charset=utf-8"; } this.requestBody = data; } this.errorFlag = false; this.sendFlag = this.async; clearResponse(this); this.readyStateChange(FakeXMLHttpRequest.OPENED); if (typeof this.onSend === "function") { this.onSend(this); } this.dispatchEvent(new sinon.Event("loadstart", false, false, this)); }, abort: function abort() { this.aborted = true; clearResponse(this); this.errorFlag = true; this.requestHeaders = {}; this.responseHeaders = {}; if (this.readyState > FakeXMLHttpRequest.UNSENT && this.sendFlag) { this.readyStateChange(FakeXMLHttpRequest.DONE); this.sendFlag = false; } this.readyState = FakeXMLHttpRequest.UNSENT; this.dispatchEvent(new sinon.Event("abort", false, false, this)); this.upload.dispatchEvent(new sinon.Event("abort", false, false, this)); if (typeof this.onerror === "function") { this.onerror(); } }, getResponseHeader: function getResponseHeader(header) { if (this.readyState < FakeXMLHttpRequest.HEADERS_RECEIVED) { return null; } if (/^Set-Cookie2?$/i.test(header)) { return null; } header = getHeader(this.responseHeaders, header); return this.responseHeaders[header] || null; }, getAllResponseHeaders: function getAllResponseHeaders() { if (this.readyState < FakeXMLHttpRequest.HEADERS_RECEIVED) { return ""; } var headers = ""; for (var header in this.responseHeaders) { if (this.responseHeaders.hasOwnProperty(header) && !/^Set-Cookie2?$/i.test(header)) { headers += header + ": " + this.responseHeaders[header] + "\r\n"; } } return headers; }, setResponseBody: function setResponseBody(body) { verifyRequestSent(this); verifyHeadersReceived(this); verifyResponseBodyType(body); var contentType = this.getResponseHeader("Content-Type"); var isTextResponse = this.responseType === "" || this.responseType === "text"; clearResponse(this); if (this.async) { var chunkSize = this.chunkSize || 10; var index = 0; do { this.readyStateChange(FakeXMLHttpRequest.LOADING); if (isTextResponse) { this.responseText = this.response += body.substring(index, index + chunkSize); } index += chunkSize; } while (index < body.length); } this.response = convertResponseBody(this.responseType, contentType, body); if (isTextResponse) { this.responseText = this.response; } if (this.responseType === "document") { this.responseXML = this.response; } else if (this.responseType === "" && isXmlContentType(contentType)) { this.responseXML = FakeXMLHttpRequest.parseXML(this.responseText); } this.readyStateChange(FakeXMLHttpRequest.DONE); }, respond: function respond(status, headers, body) { this.status = typeof status === "number" ? status : 200; this.statusText = FakeXMLHttpRequest.statusCodes[this.status]; this.setResponseHeaders(headers || {}); this.setResponseBody(body || ""); }, uploadProgress: function uploadProgress(progressEventRaw) { if (supportsProgress) { this.upload.dispatchEvent(new sinon.ProgressEvent("progress", progressEventRaw)); } }, downloadProgress: function downloadProgress(progressEventRaw) { if (supportsProgress) { this.dispatchEvent(new sinon.ProgressEvent("progress", progressEventRaw)); } }, uploadError: function uploadError(error) { if (supportsCustomEvent) { this.upload.dispatchEvent(new sinon.CustomEvent("error", { detail: error })); } } }); sinon.extend(FakeXMLHttpRequest, { UNSENT: 0, OPENED: 1, HEADERS_RECEIVED: 2, LOADING: 3, DONE: 4 }); sinon.useFakeXMLHttpRequest = function () { FakeXMLHttpRequest.restore = function restore(keepOnCreate) { if (sinonXhr.supportsXHR) { global.XMLHttpRequest = sinonXhr.GlobalXMLHttpRequest; } if (sinonXhr.supportsActiveX) { global.ActiveXObject = sinonXhr.GlobalActiveXObject; } delete FakeXMLHttpRequest.restore; if (keepOnCreate !== true) { delete FakeXMLHttpRequest.onCreate; } }; if (sinonXhr.supportsXHR) { global.XMLHttpRequest = FakeXMLHttpRequest; } if (sinonXhr.supportsActiveX) { global.ActiveXObject = function ActiveXObject(objId) { if (objId === "Microsoft.XMLHTTP" || /^Msxml2\.XMLHTTP/i.test(objId)) { return new FakeXMLHttpRequest(); } return new sinonXhr.GlobalActiveXObject(objId); }; } return FakeXMLHttpRequest; }; sinon.FakeXMLHttpRequest = FakeXMLHttpRequest; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var sinon = require("./core"); require("../extend"); require("./event"); require("../log_error"); makeApi(sinon); module.exports = sinon; } if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon, // eslint-disable-line no-undef typeof global !== "undefined" ? global : self )); /** * @depend fake_xdomain_request.js * @depend fake_xml_http_request.js * @depend ../format.js * @depend ../log_error.js */ /** * The Sinon "server" mimics a web server that receives requests from * sinon.FakeXMLHttpRequest and provides an API to respond to those requests, * both synchronously and asynchronously. To respond synchronuously, canned * answers have to be provided upfront. * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function () { var push = [].push; function responseArray(handler) { var response = handler; if (Object.prototype.toString.call(handler) !== "[object Array]") { response = [200, {}, handler]; } if (typeof response[2] !== "string") { throw new TypeError("Fake server response body should be string, but was " + typeof response[2]); } return response; } var wloc = typeof window !== "undefined" ? window.location : {}; var rCurrLoc = new RegExp("^" + wloc.protocol + "//" + wloc.host); function matchOne(response, reqMethod, reqUrl) { var rmeth = response.method; var matchMethod = !rmeth || rmeth.toLowerCase() === reqMethod.toLowerCase(); var url = response.url; var matchUrl = !url || url === reqUrl || (typeof url.test === "function" && url.test(reqUrl)); return matchMethod && matchUrl; } function match(response, request) { var requestUrl = request.url; if (!/^https?:\/\//.test(requestUrl) || rCurrLoc.test(requestUrl)) { requestUrl = requestUrl.replace(rCurrLoc, ""); } if (matchOne(response, this.getHTTPMethod(request), requestUrl)) { if (typeof response.response === "function") { var ru = response.url; var args = [request].concat(ru && typeof ru.exec === "function" ? ru.exec(requestUrl).slice(1) : []); return response.response.apply(response, args); } return true; } return false; } function makeApi(sinon) { sinon.fakeServer = { create: function (config) { var server = sinon.create(this); server.configure(config); if (!sinon.xhr.supportsCORS) { this.xhr = sinon.useFakeXDomainRequest(); } else { this.xhr = sinon.useFakeXMLHttpRequest(); } server.requests = []; this.xhr.onCreate = function (xhrObj) { server.addRequest(xhrObj); }; return server; }, configure: function (config) { var whitelist = { "autoRespond": true, "autoRespondAfter": true, "respondImmediately": true, "fakeHTTPMethods": true }; var setting; config = config || {}; for (setting in config) { if (whitelist.hasOwnProperty(setting) && config.hasOwnProperty(setting)) { this[setting] = config[setting]; } } }, addRequest: function addRequest(xhrObj) { var server = this; push.call(this.requests, xhrObj); xhrObj.onSend = function () { server.handleRequest(this); if (server.respondImmediately) { server.respond(); } else if (server.autoRespond && !server.responding) { setTimeout(function () { server.responding = false; server.respond(); }, server.autoRespondAfter || 10); server.responding = true; } }; }, getHTTPMethod: function getHTTPMethod(request) { if (this.fakeHTTPMethods && /post/i.test(request.method)) { var matches = (request.requestBody || "").match(/_method=([^\b;]+)/); return matches ? matches[1] : request.method; } return request.method; }, handleRequest: function handleRequest(xhr) { if (xhr.async) { if (!this.queue) { this.queue = []; } push.call(this.queue, xhr); } else { this.processRequest(xhr); } }, log: function log(response, request) { var str; str = "Request:\n" + sinon.format(request) + "\n\n"; str += "Response:\n" + sinon.format(response) + "\n\n"; sinon.log(str); }, respondWith: function respondWith(method, url, body) { if (arguments.length === 1 && typeof method !== "function") { this.response = responseArray(method); return; } if (!this.responses) { this.responses = []; } if (arguments.length === 1) { body = method; url = method = null; } if (arguments.length === 2) { body = url; url = method; method = null; } push.call(this.responses, { method: method, url: url, response: typeof body === "function" ? body : responseArray(body) }); }, respond: function respond() { if (arguments.length > 0) { this.respondWith.apply(this, arguments); } var queue = this.queue || []; var requests = queue.splice(0, queue.length); for (var i = 0; i < requests.length; i++) { this.processRequest(requests[i]); } }, processRequest: function processRequest(request) { try { if (request.aborted) { return; } var response = this.response || [404, {}, ""]; if (this.responses) { for (var l = this.responses.length, i = l - 1; i >= 0; i--) { if (match.call(this, this.responses[i], request)) { response = this.responses[i].response; break; } } } if (request.readyState !== 4) { this.log(response, request); request.respond(response[0], response[1], response[2]); } } catch (e) { sinon.logError("Fake server request processing", e); } }, restore: function restore() { return this.xhr.restore && this.xhr.restore.apply(this.xhr, arguments); } }; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var sinon = require("./core"); require("./fake_xdomain_request"); require("./fake_xml_http_request"); require("../format"); makeApi(sinon); module.exports = sinon; } if (isAMD) { define(loadDependencies); } else if (isNode) { loadDependencies(require, module.exports, module); } else { makeApi(sinon); // eslint-disable-line no-undef } }()); /** * @depend fake_server.js * @depend fake_timers.js */ /** * Add-on for sinon.fakeServer that automatically handles a fake timer along with * the FakeXMLHttpRequest. The direct inspiration for this add-on is jQuery * 1.3.x, which does not use xhr object's onreadystatehandler at all - instead, * it polls the object for completion with setInterval. Dispite the direct * motivation, there is nothing jQuery-specific in this file, so it can be used * in any environment where the ajax implementation depends on setInterval or * setTimeout. * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function () { function makeApi(sinon) { function Server() { } Server.prototype = sinon.fakeServer; sinon.fakeServerWithClock = new Server(); sinon.fakeServerWithClock.addRequest = function addRequest(xhr) { if (xhr.async) { if (typeof setTimeout.clock === "object") { this.clock = setTimeout.clock; } else { this.clock = sinon.useFakeTimers(); this.resetClock = true; } if (!this.longestTimeout) { var clockSetTimeout = this.clock.setTimeout; var clockSetInterval = this.clock.setInterval; var server = this; this.clock.setTimeout = function (fn, timeout) { server.longestTimeout = Math.max(timeout, server.longestTimeout || 0); return clockSetTimeout.apply(this, arguments); }; this.clock.setInterval = function (fn, timeout) { server.longestTimeout = Math.max(timeout, server.longestTimeout || 0); return clockSetInterval.apply(this, arguments); }; } } return sinon.fakeServer.addRequest.call(this, xhr); }; sinon.fakeServerWithClock.respond = function respond() { var returnVal = sinon.fakeServer.respond.apply(this, arguments); if (this.clock) { this.clock.tick(this.longestTimeout || 0); this.longestTimeout = 0; if (this.resetClock) { this.clock.restore(); this.resetClock = false; } } return returnVal; }; sinon.fakeServerWithClock.restore = function restore() { if (this.clock) { this.clock.restore(); } return sinon.fakeServer.restore.apply(this, arguments); }; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require) { var sinon = require("./core"); require("./fake_server"); require("./fake_timers"); makeApi(sinon); } if (isAMD) { define(loadDependencies); } else if (isNode) { loadDependencies(require); } else { makeApi(sinon); // eslint-disable-line no-undef } }()); /** * @depend util/core.js * @depend extend.js * @depend collection.js * @depend util/fake_timers.js * @depend util/fake_server_with_clock.js */ /** * Manages fake collections as well as fake utilities such as Sinon's * timers and fake XHR implementation in one convenient object. * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function (sinonGlobal) { function makeApi(sinon) { var push = [].push; function exposeValue(sandbox, config, key, value) { if (!value) { return; } if (config.injectInto && !(key in config.injectInto)) { config.injectInto[key] = value; sandbox.injectedKeys.push(key); } else { push.call(sandbox.args, value); } } function prepareSandboxFromConfig(config) { var sandbox = sinon.create(sinon.sandbox); if (config.useFakeServer) { if (typeof config.useFakeServer === "object") { sandbox.serverPrototype = config.useFakeServer; } sandbox.useFakeServer(); } if (config.useFakeTimers) { if (typeof config.useFakeTimers === "object") { sandbox.useFakeTimers.apply(sandbox, config.useFakeTimers); } else { sandbox.useFakeTimers(); } } return sandbox; } sinon.sandbox = sinon.extend(sinon.create(sinon.collection), { useFakeTimers: function useFakeTimers() { this.clock = sinon.useFakeTimers.apply(sinon, arguments); return this.add(this.clock); }, serverPrototype: sinon.fakeServer, useFakeServer: function useFakeServer() { var proto = this.serverPrototype || sinon.fakeServer; if (!proto || !proto.create) { return null; } this.server = proto.create(); return this.add(this.server); }, inject: function (obj) { sinon.collection.inject.call(this, obj); if (this.clock) { obj.clock = this.clock; } if (this.server) { obj.server = this.server; obj.requests = this.server.requests; } obj.match = sinon.match; return obj; }, restore: function () { sinon.collection.restore.apply(this, arguments); this.restoreContext(); }, restoreContext: function () { if (this.injectedKeys) { for (var i = 0, j = this.injectedKeys.length; i < j; i++) { delete this.injectInto[this.injectedKeys[i]]; } this.injectedKeys = []; } }, create: function (config) { if (!config) { return sinon.create(sinon.sandbox); } var sandbox = prepareSandboxFromConfig(config); sandbox.args = sandbox.args || []; sandbox.injectedKeys = []; sandbox.injectInto = config.injectInto; var prop, value; var exposed = sandbox.inject({}); if (config.properties) { for (var i = 0, l = config.properties.length; i < l; i++) { prop = config.properties[i]; value = exposed[prop] || prop === "sandbox" && sandbox; exposeValue(sandbox, config, prop, value); } } else { exposeValue(sandbox, config, "sandbox", value); } return sandbox; }, match: sinon.match }); sinon.sandbox.useFakeXMLHttpRequest = sinon.sandbox.useFakeServer; return sinon.sandbox; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var sinon = require("./util/core"); require("./extend"); require("./util/fake_server_with_clock"); require("./util/fake_timers"); require("./collection"); module.exports = makeApi(sinon); } if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend util/core.js * @depend sandbox.js */ /** * Test function, sandboxes fakes * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function (sinonGlobal) { function makeApi(sinon) { var slice = Array.prototype.slice; function test(callback) { var type = typeof callback; if (type !== "function") { throw new TypeError("sinon.test needs to wrap a test function, got " + type); } function sinonSandboxedTest() { var config = sinon.getConfig(sinon.config); config.injectInto = config.injectIntoThis && this || config.injectInto; var sandbox = sinon.sandbox.create(config); var args = slice.call(arguments); var oldDone = args.length && args[args.length - 1]; var exception, result; if (typeof oldDone === "function") { args[args.length - 1] = function sinonDone(res) { if (res) { sandbox.restore(); } else { sandbox.verifyAndRestore(); } oldDone(res); }; } try { result = callback.apply(this, args.concat(sandbox.args)); } catch (e) { exception = e; } if (typeof oldDone !== "function") { if (typeof exception !== "undefined") { sandbox.restore(); throw exception; } else { sandbox.verifyAndRestore(); } } return result; } if (callback.length) { return function sinonAsyncSandboxedTest(done) { // eslint-disable-line no-unused-vars return sinonSandboxedTest.apply(this, arguments); }; } return sinonSandboxedTest; } test.config = { injectIntoThis: true, injectInto: null, properties: ["spy", "stub", "mock", "clock", "server", "requests"], useFakeTimers: true, useFakeServer: true }; sinon.test = test; return test; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var core = require("./util/core"); require("./sandbox"); module.exports = makeApi(core); } if (isAMD) { define(loadDependencies); } else if (isNode) { loadDependencies(require, module.exports, module); } else if (sinonGlobal) { makeApi(sinonGlobal); } }(typeof sinon === "object" && sinon || null)); // eslint-disable-line no-undef /** * @depend util/core.js * @depend test.js */ /** * Test case, sandboxes all test functions * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function (sinonGlobal) { function createTest(property, setUp, tearDown) { return function () { if (setUp) { setUp.apply(this, arguments); } var exception, result; try { result = property.apply(this, arguments); } catch (e) { exception = e; } if (tearDown) { tearDown.apply(this, arguments); } if (exception) { throw exception; } return result; }; } function makeApi(sinon) { function testCase(tests, prefix) { if (!tests || typeof tests !== "object") { throw new TypeError("sinon.testCase needs an object with test functions"); } prefix = prefix || "test"; var rPrefix = new RegExp("^" + prefix); var methods = {}; var setUp = tests.setUp; var tearDown = tests.tearDown; var testName, property, method; for (testName in tests) { if (tests.hasOwnProperty(testName) && !/^(setUp|tearDown)$/.test(testName)) { property = tests[testName]; if (typeof property === "function" && rPrefix.test(testName)) { method = property; if (setUp || tearDown) { method = createTest(property, setUp, tearDown); } methods[testName] = sinon.test(method); } else { methods[testName] = tests[testName]; } } } return methods; } sinon.testCase = testCase; return testCase; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var core = require("./util/core"); require("./test"); module.exports = makeApi(core); } if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon // eslint-disable-line no-undef )); /** * @depend times_in_words.js * @depend util/core.js * @depend match.js * @depend format.js */ /** * Assertions matching the test spy retrieval interface. * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function (sinonGlobal, global) { var slice = Array.prototype.slice; function makeApi(sinon) { var assert; function verifyIsStub() { var method; for (var i = 0, l = arguments.length; i < l; ++i) { method = arguments[i]; if (!method) { assert.fail("fake is not a spy"); } if (method.proxy && method.proxy.isSinonProxy) { verifyIsStub(method.proxy); } else { if (typeof method !== "function") { assert.fail(method + " is not a function"); } if (typeof method.getCall !== "function") { assert.fail(method + " is not stubbed"); } } } } function failAssertion(object, msg) { object = object || global; var failMethod = object.fail || assert.fail; failMethod.call(object, msg); } function mirrorPropAsAssertion(name, method, message) { if (arguments.length === 2) { message = method; method = name; } assert[name] = function (fake) { verifyIsStub(fake); var args = slice.call(arguments, 1); var failed = false; if (typeof method === "function") { failed = !method(fake); } else { failed = typeof fake[method] === "function" ? !fake[method].apply(fake, args) : !fake[method]; } if (failed) { failAssertion(this, (fake.printf || fake.proxy.printf).apply(fake, [message].concat(args))); } else { assert.pass(name); } }; } function exposedName(prefix, prop) { return !prefix || /^fail/.test(prop) ? prop : prefix + prop.slice(0, 1).toUpperCase() + prop.slice(1); } assert = { failException: "AssertError", fail: function fail(message) { var error = new Error(message); error.name = this.failException || assert.failException; throw error; }, pass: function pass() { }, callOrder: function assertCallOrder() { verifyIsStub.apply(null, arguments); var expected = ""; var actual = ""; if (!sinon.calledInOrder(arguments)) { try { expected = [].join.call(arguments, ", "); var calls = slice.call(arguments); var i = calls.length; while (i) { if (!calls[--i].called) { calls.splice(i, 1); } } actual = sinon.orderByFirstCall(calls).join(", "); } catch (e) { // If this fails, we'll just fall back to the blank string } failAssertion(this, "expected " + expected + " to be " + "called in order but were called as " + actual); } else { assert.pass("callOrder"); } }, callCount: function assertCallCount(method, count) { verifyIsStub(method); if (method.callCount !== count) { var msg = "expected %n to be called " + sinon.timesInWords(count) + " but was called %c%C"; failAssertion(this, method.printf(msg)); } else { assert.pass("callCount"); } }, expose: function expose(target, options) { if (!target) { throw new TypeError("target is null or undefined"); } var o = options || {}; var prefix = typeof o.prefix === "undefined" && "assert" || o.prefix; var includeFail = typeof o.includeFail === "undefined" || !!o.includeFail; for (var method in this) { if (method !== "expose" && (includeFail || !/^(fail)/.test(method))) { target[exposedName(prefix, method)] = this[method]; } } return target; }, match: function match(actual, expectation) { var matcher = sinon.match(expectation); if (matcher.test(actual)) { assert.pass("match"); } else { var formatted = [ "expected value to match", " expected = " + sinon.format(expectation), " actual = " + sinon.format(actual) ]; failAssertion(this, formatted.join("\n")); } } }; mirrorPropAsAssertion("called", "expected %n to have been called at least once but was never called"); mirrorPropAsAssertion("notCalled", function (spy) { return !spy.called; }, "expected %n to not have been called but was called %c%C"); mirrorPropAsAssertion("calledOnce", "expected %n to be called once but was called %c%C"); mirrorPropAsAssertion("calledTwice", "expected %n to be called twice but was called %c%C"); mirrorPropAsAssertion("calledThrice", "expected %n to be called thrice but was called %c%C"); mirrorPropAsAssertion("calledOn", "expected %n to be called with %1 as this but was called with %t"); mirrorPropAsAssertion( "alwaysCalledOn", "expected %n to always be called with %1 as this but was called with %t" ); mirrorPropAsAssertion("calledWithNew", "expected %n to be called with new"); mirrorPropAsAssertion("alwaysCalledWithNew", "expected %n to always be called with new"); mirrorPropAsAssertion("calledWith", "expected %n to be called with arguments %*%C"); mirrorPropAsAssertion("calledWithMatch", "expected %n to be called with match %*%C"); mirrorPropAsAssertion("alwaysCalledWith", "expected %n to always be called with arguments %*%C"); mirrorPropAsAssertion("alwaysCalledWithMatch", "expected %n to always be called with match %*%C"); mirrorPropAsAssertion("calledWithExactly", "expected %n to be called with exact arguments %*%C"); mirrorPropAsAssertion("alwaysCalledWithExactly", "expected %n to always be called with exact arguments %*%C"); mirrorPropAsAssertion("neverCalledWith", "expected %n to never be called with arguments %*%C"); mirrorPropAsAssertion("neverCalledWithMatch", "expected %n to never be called with match %*%C"); mirrorPropAsAssertion("threw", "%n did not throw exception%C"); mirrorPropAsAssertion("alwaysThrew", "%n did not always throw exception%C"); sinon.assert = assert; return assert; } var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; function loadDependencies(require, exports, module) { var sinon = require("./util/core"); require("./match"); require("./format"); module.exports = makeApi(sinon); } if (isAMD) { define(loadDependencies); return; } if (isNode) { loadDependencies(require, module.exports, module); return; } if (sinonGlobal) { makeApi(sinonGlobal); } }( typeof sinon === "object" && sinon, // eslint-disable-line no-undef typeof global !== "undefined" ? global : self )); return sinon; })); ================================================ FILE: common/Tests/External/sinon-2.3.8.js ================================================ /* Sinon.JS 2.3.8, 2017-07-13, @license BSD-3 */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.sinon = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0) { return args[callArgAt]; } var argumentList; if (callArgAt === useLeftMostCallback) { argumentList = args; } if (callArgAt === useRightMostCallback) { argumentList = slice.call(args).reverse(); } var callArgProp = behavior.callArgProp; for (var i = 0, l = argumentList.length; i < l; ++i) { if (!callArgProp && typeof argumentList[i] === "function") { return argumentList[i]; } if (callArgProp && argumentList[i] && typeof argumentList[i][callArgProp] === "function") { return argumentList[i][callArgProp]; } } return null; } function getCallbackError(behavior, func, args) { if (behavior.callArgAt < 0) { var msg; if (behavior.callArgProp) { msg = functionName(behavior.stub) + " expected to yield to '" + valueToString(behavior.callArgProp) + "', but no object with such a property was passed."; } else { msg = functionName(behavior.stub) + " expected to yield, but no callback was passed."; } if (args.length > 0) { msg += " Received [" + join.call(args, ", ") + "]"; } return msg; } return "argument at index " + behavior.callArgAt + " is not a function: " + func; } function callCallback(behavior, args) { if (typeof behavior.callArgAt === "number") { var func = getCallback(behavior, args); if (typeof func !== "function") { throw new TypeError(getCallbackError(behavior, func, args)); } if (behavior.callbackAsync) { nextTick(function () { func.apply(behavior.callbackContext, behavior.callbackArguments); }); } else { func.apply(behavior.callbackContext, behavior.callbackArguments); } } } var proto = { create: function create(stub) { var behavior = extend({}, proto); delete behavior.create; delete behavior.addBehavior; delete behavior.createBehavior; behavior.stub = stub; if (stub.defaultBehavior && stub.defaultBehavior.promiseLibrary) { behavior.promiseLibrary = stub.defaultBehavior.promiseLibrary; } return behavior; }, isPresent: function isPresent() { return (typeof this.callArgAt === "number" || this.exception || typeof this.returnArgAt === "number" || this.returnThis || typeof this.throwArgAt === "number" || this.fakeFn || this.returnValueDefined); }, invoke: function invoke(context, args) { callCallback(this, args); if (this.exception) { throw this.exception; } else if (typeof this.returnArgAt === "number") { return args[this.returnArgAt]; } else if (this.returnThis) { return context; } else if (typeof this.throwArgAt === "number") { if (args.length < this.throwArgAt) { throw new TypeError( "throwArgs failed: " + this.throwArgAt + " arguments required but only " + args.length + " present" ); } throw args[this.throwArgAt]; } else if (this.fakeFn) { return this.fakeFn.apply(context, args); } else if (this.resolve) { return (this.promiseLibrary || Promise).resolve(this.returnValue); } else if (this.reject) { return (this.promiseLibrary || Promise).reject(this.returnValue); } else if (this.callsThrough) { return this.stub.wrappedMethod.apply(context, args); } return this.returnValue; }, onCall: function onCall(index) { return this.stub.onCall(index); }, onFirstCall: function onFirstCall() { return this.stub.onFirstCall(); }, onSecondCall: function onSecondCall() { return this.stub.onSecondCall(); }, onThirdCall: function onThirdCall() { return this.stub.onThirdCall(); }, withArgs: function withArgs(/* arguments */) { throw new Error( "Defining a stub by invoking \"stub.onCall(...).withArgs(...)\" " + "is not supported. Use \"stub.withArgs(...).onCall(...)\" " + "to define sequential behavior for calls with certain arguments." ); } }; function createAsyncVersion(syncFnName) { return function () { var result = this[syncFnName].apply(this, arguments); this.callbackAsync = true; return result; }; } // create asynchronous versions of callsArg* and yields* methods Object.keys(proto).forEach(function (method) { // need to avoid creating anotherasync versions of the newly added async methods if (method.match(/^(callsArg|yields)/) && !method.match(/Async/)) { proto[method + "Async"] = createAsyncVersion(method); } }); function createBehavior(behaviorMethod) { return function () { this.defaultBehavior = this.defaultBehavior || proto.create(this); this.defaultBehavior[behaviorMethod].apply(this.defaultBehavior, arguments); return this; }; } function addBehavior(stub, name, fn) { proto[name] = function () { fn.apply(this, [this].concat([].slice.call(arguments))); return this.stub || this; }; stub[name] = createBehavior(name); } proto.addBehavior = addBehavior; proto.createBehavior = createBehavior; module.exports = proto; }).call(this,require('_process')) },{"./util/core/extend":27,"./util/core/function-name":29,"./util/core/value-to-string":40,"_process":53}],4:[function(require,module,exports){ /*global Blob */ "use strict"; exports.isSupported = (function () { try { return !!new Blob(); } catch (e) { return false; } }()); },{}],5:[function(require,module,exports){ "use strict"; var sinonMatch = require("./match"); var deepEqual = require("./util/core/deep-equal").use(sinonMatch); var functionName = require("./util/core/function-name"); var sinonFormat = require("./util/core/format"); var valueToString = require("./util/core/value-to-string"); var slice = Array.prototype.slice; function throwYieldError(proxy, text, args) { var msg = functionName(proxy) + text; if (args.length) { msg += " Received [" + slice.call(args).join(", ") + "]"; } throw new Error(msg); } var callProto = { calledOn: function calledOn(thisValue) { if (sinonMatch && sinonMatch.isMatcher(thisValue)) { return thisValue.test(this.thisValue); } return this.thisValue === thisValue; }, calledWith: function calledWith() { var self = this; var calledWithArgs = slice.call(arguments); if (calledWithArgs.length > self.args.length) { return false; } return calledWithArgs.reduce(function (prev, arg, i) { return prev && deepEqual(arg, self.args[i]); }, true); }, calledWithMatch: function calledWithMatch() { var self = this; var calledWithMatchArgs = slice.call(arguments); if (calledWithMatchArgs.length > self.args.length) { return false; } return calledWithMatchArgs.reduce(function (prev, expectation, i) { var actual = self.args[i]; return prev && (sinonMatch && sinonMatch(expectation).test(actual)); }, true); }, calledWithExactly: function calledWithExactly() { return arguments.length === this.args.length && this.calledWith.apply(this, arguments); }, notCalledWith: function notCalledWith() { return !this.calledWith.apply(this, arguments); }, notCalledWithMatch: function notCalledWithMatch() { return !this.calledWithMatch.apply(this, arguments); }, returned: function returned(value) { return deepEqual(value, this.returnValue); }, threw: function threw(error) { if (typeof error === "undefined" || !this.exception) { return !!this.exception; } return this.exception === error || this.exception.name === error; }, calledWithNew: function calledWithNew() { return this.proxy.prototype && this.thisValue instanceof this.proxy; }, calledBefore: function (other) { return this.callId < other.callId; }, calledAfter: function (other) { return this.callId > other.callId; }, calledImmediatelyBefore: function (other) { return this.callId === other.callId - 1; }, calledImmediatelyAfter: function (other) { return this.callId === other.callId + 1; }, callArg: function (pos) { this.args[pos](); }, callArgOn: function (pos, thisValue) { this.args[pos].apply(thisValue); }, callArgWith: function (pos) { this.callArgOnWith.apply(this, [pos, null].concat(slice.call(arguments, 1))); }, callArgOnWith: function (pos, thisValue) { var args = slice.call(arguments, 2); this.args[pos].apply(thisValue, args); }, throwArg: function (pos) { if (pos > this.args.length) { throw new TypeError( "Not enough arguments: " + pos + " required but only " + this.args.length + " present" ); } throw this.args[pos]; }, "yield": function () { this.yieldOn.apply(this, [null].concat(slice.call(arguments, 0))); }, yieldOn: function (thisValue) { var args = slice.call(this.args); var yieldFn = args.filter(function (arg) { return typeof arg === "function"; })[0]; if (!yieldFn) { throwYieldError(this.proxy, " cannot yield since no callback was passed.", args); } yieldFn.apply(thisValue, slice.call(arguments, 1)); }, yieldTo: function (prop) { this.yieldToOn.apply(this, [prop, null].concat(slice.call(arguments, 1))); }, yieldToOn: function (prop, thisValue) { var args = slice.call(this.args); var yieldArg = args.filter(function (arg) { return arg && typeof arg[prop] === "function"; })[0]; var yieldFn = yieldArg && yieldArg[prop]; if (!yieldFn) { throwYieldError(this.proxy, " cannot yield to '" + valueToString(prop) + "' since no callback was passed.", args); } yieldFn.apply(thisValue, slice.call(arguments, 2)); }, toString: function () { var callStr = this.proxy ? this.proxy.toString() + "(" : ""; var formattedArgs; if (!this.args) { return ":("; } formattedArgs = slice.call(this.args).map(function (arg) { return sinonFormat(arg); }); callStr = callStr + formattedArgs.join(", ") + ")"; if (typeof this.returnValue !== "undefined") { callStr += " => " + sinonFormat(this.returnValue); } if (this.exception) { callStr += " !" + this.exception.name; if (this.exception.message) { callStr += "(" + this.exception.message + ")"; } } if (this.stack) { // Omit the error message and the two top stack frames in sinon itself: callStr += ( this.stack.split("\n")[3] || "unknown" ).replace(/^\s*(?:at\s+|@)?/, " at "); } return callStr; } }; Object.defineProperty(callProto, "stack", { enumerable: true, configurable: true, get: function () { return this.errorWithCallStack && this.errorWithCallStack.stack || ""; } }); callProto.invokeCallback = callProto.yield; function createSpyCall(spy, thisValue, args, returnValue, exception, id, errorWithCallStack) { if (typeof id !== "number") { throw new TypeError("Call id is not a number"); } var proxyCall = Object.create(callProto); proxyCall.proxy = spy; proxyCall.thisValue = thisValue; proxyCall.args = args; proxyCall.returnValue = returnValue; proxyCall.exception = exception; proxyCall.callId = id; proxyCall.errorWithCallStack = errorWithCallStack; return proxyCall; } createSpyCall.toString = callProto.toString; // used by mocks module.exports = createSpyCall; },{"./match":10,"./util/core/deep-equal":23,"./util/core/format":28,"./util/core/function-name":29,"./util/core/value-to-string":40}],6:[function(require,module,exports){ "use strict"; var walk = require("./util/core/walk"); var getPropertyDescriptor = require("./util/core/get-property-descriptor"); function collectMethod(methods, object, prop, propOwner) { if ( typeof getPropertyDescriptor(propOwner, prop).value === "function" && object.hasOwnProperty(prop) ) { methods.push(object[prop]); } } // This function returns an array of all the own methods on the passed object function collectOwnMethods(object) { var methods = []; walk(object, collectMethod.bind(null, methods, object)); return methods; } module.exports = collectOwnMethods; },{"./util/core/get-property-descriptor":32,"./util/core/walk":41}],7:[function(require,module,exports){ "use strict"; var sinonSpy = require("./spy"); var sinonStub = require("./stub"); var sinonMock = require("./mock"); var sandboxStub = require("./sandbox-stub"); var collectOwnMethods = require("./collect-own-methods"); var push = [].push; function getFakes(fakeCollection) { if (!fakeCollection.fakes) { fakeCollection.fakes = []; } return fakeCollection.fakes; } function each(fakeCollection, method) { var fakes = getFakes(fakeCollection); var matchingFakes = fakes.filter(function (fake) { return typeof fake[method] === "function"; }); matchingFakes.forEach(function (fake) { fake[method](); }); } var collection = { verify: function verify() { each(this, "verify"); }, restore: function restore() { each(this, "restore"); this.fakes = []; }, reset: function reset() { each(this, "reset"); }, resetBehavior: function resetBehavior() { each(this, "resetBehavior"); }, resetHistory: function resetHistory() { getFakes(this).forEach(function (fake) { var method = fake.resetHistory || fake.reset; if (method) { method.call(fake); } }); }, verifyAndRestore: function verifyAndRestore() { var exception; try { this.verify(); } catch (e) { exception = e; } this.restore(); if (exception) { throw exception; } }, add: function add(fake) { push.call(getFakes(this), fake); return fake; }, addUsingPromise: function (fake) { fake.usingPromise(this.promiseLibrary); return fake; }, spy: function spy() { return this.add(sinonSpy.apply(sinonSpy, arguments)); }, stub: function stub(object, property/*, value*/) { if (arguments.length > 2) { return sandboxStub.apply(this, arguments); } var stubbed = sinonStub.apply(null, arguments); var isStubbingEntireObject = typeof property === "undefined" && typeof object === "object"; if (isStubbingEntireObject) { var ownMethods = collectOwnMethods(stubbed); ownMethods.forEach(this.add.bind(this)); if (this.promiseLibrary) { ownMethods.forEach(this.addUsingPromise.bind(this)); } } else { this.add(stubbed); if (this.promiseLibrary) { stubbed.usingPromise(this.promiseLibrary); } } return stubbed; }, mock: function mock() { return this.add(sinonMock.apply(null, arguments)); }, inject: function inject(obj) { var col = this; obj.spy = function () { return col.spy.apply(col, arguments); }; obj.stub = function () { return col.stub.apply(col, arguments); }; obj.mock = function () { return col.mock.apply(col, arguments); }; return obj; } }; module.exports = collection; },{"./collect-own-methods":6,"./mock":12,"./sandbox-stub":13,"./spy":16,"./stub":20}],8:[function(require,module,exports){ (function (process){ "use strict"; var canColor = typeof process !== "undefined"; function colorize(str, color) { if (!canColor) { return str; } return "\x1b[" + color + "m" + str + "\x1b[0m"; } exports.red = function (str) { return colorize(str, 31); }; exports.green = function (str) { return colorize(str, 32); }; }).call(this,require('_process')) },{"_process":53}],9:[function(require,module,exports){ "use strict"; var getPropertyDescriptor = require("./util/core/get-property-descriptor"); var slice = [].slice; var useLeftMostCallback = -1; var useRightMostCallback = -2; function throwsException(fake, error, message) { if (typeof error === "string") { fake.exception = new Error(message || ""); fake.exception.name = error; } else if (!error) { fake.exception = new Error("Error"); } else { fake.exception = error; } } function isPropertyConfigurable(obj, propName) { var propertyDescriptor = getPropertyDescriptor(obj, propName); return propertyDescriptor ? propertyDescriptor.configurable : true; } module.exports = { callsFake: function callsFake(fake, fn) { fake.fakeFn = fn; }, callsArg: function callsArg(fake, pos) { if (typeof pos !== "number") { throw new TypeError("argument index is not number"); } fake.callArgAt = pos; fake.callbackArguments = []; fake.callbackContext = undefined; fake.callArgProp = undefined; fake.callbackAsync = false; }, callsArgOn: function callsArgOn(fake, pos, context) { if (typeof pos !== "number") { throw new TypeError("argument index is not number"); } fake.callArgAt = pos; fake.callbackArguments = []; fake.callbackContext = context; fake.callArgProp = undefined; fake.callbackAsync = false; }, callsArgWith: function callsArgWith(fake, pos) { if (typeof pos !== "number") { throw new TypeError("argument index is not number"); } fake.callArgAt = pos; fake.callbackArguments = slice.call(arguments, 2); fake.callbackContext = undefined; fake.callArgProp = undefined; fake.callbackAsync = false; }, callsArgOnWith: function callsArgWith(fake, pos, context) { if (typeof pos !== "number") { throw new TypeError("argument index is not number"); } fake.callArgAt = pos; fake.callbackArguments = slice.call(arguments, 3); fake.callbackContext = context; fake.callArgProp = undefined; fake.callbackAsync = false; }, usingPromise: function usingPromise(fake, promiseLibrary) { fake.promiseLibrary = promiseLibrary; }, yields: function (fake) { fake.callArgAt = useLeftMostCallback; fake.callbackArguments = slice.call(arguments, 1); fake.callbackContext = undefined; fake.callArgProp = undefined; fake.callbackAsync = false; }, yieldsRight: function (fake) { fake.callArgAt = useRightMostCallback; fake.callbackArguments = slice.call(arguments, 1); fake.callbackContext = undefined; fake.callArgProp = undefined; fake.callbackAsync = false; }, yieldsOn: function (fake, context) { fake.callArgAt = useLeftMostCallback; fake.callbackArguments = slice.call(arguments, 2); fake.callbackContext = context; fake.callArgProp = undefined; fake.callbackAsync = false; }, yieldsTo: function (fake, prop) { fake.callArgAt = useLeftMostCallback; fake.callbackArguments = slice.call(arguments, 2); fake.callbackContext = undefined; fake.callArgProp = prop; fake.callbackAsync = false; }, yieldsToOn: function (fake, prop, context) { fake.callArgAt = useLeftMostCallback; fake.callbackArguments = slice.call(arguments, 3); fake.callbackContext = context; fake.callArgProp = prop; fake.callbackAsync = false; }, throws: throwsException, throwsException: throwsException, returns: function returns(fake, value) { fake.returnValue = value; fake.resolve = false; fake.reject = false; fake.returnValueDefined = true; fake.exception = undefined; fake.fakeFn = undefined; }, returnsArg: function returnsArg(fake, pos) { if (typeof pos !== "number") { throw new TypeError("argument index is not number"); } fake.returnArgAt = pos; }, throwsArg: function throwsArg(fake, pos) { if (typeof pos !== "number") { throw new TypeError("argument index is not number"); } fake.throwArgAt = pos; }, returnsThis: function returnsThis(fake) { fake.returnThis = true; }, resolves: function resolves(fake, value) { fake.returnValue = value; fake.resolve = true; fake.reject = false; fake.returnValueDefined = true; fake.exception = undefined; fake.fakeFn = undefined; }, rejects: function rejects(fake, error, message) { var reason; if (typeof error === "string") { reason = new Error(message || ""); reason.name = error; } else if (!error) { reason = new Error("Error"); } else { reason = error; } fake.returnValue = reason; fake.resolve = false; fake.reject = true; fake.returnValueDefined = true; fake.exception = undefined; fake.fakeFn = undefined; return fake; }, callThrough: function callThrough(fake) { fake.callsThrough = true; }, get: function get(fake, getterFunction) { var rootStub = fake.stub || fake; Object.defineProperty(rootStub.rootObj, rootStub.propName, { get: getterFunction, configurable: isPropertyConfigurable(rootStub.rootObj, rootStub.propName) }); return fake; }, set: function set(fake, setterFunction) { var rootStub = fake.stub || fake; Object.defineProperty(rootStub.rootObj, rootStub.propName, { // eslint-disable-line accessor-pairs set: setterFunction, configurable: isPropertyConfigurable(rootStub.rootObj, rootStub.propName) }); return fake; }, value: function value(fake, newVal) { var rootStub = fake.stub || fake; Object.defineProperty(rootStub.rootObj, rootStub.propName, { value: newVal, enumerable: true, configurable: isPropertyConfigurable(rootStub.rootObj, rootStub.propName) }); return fake; } }; function createAsyncVersion(syncFnName) { return function () { var result = module.exports[syncFnName].apply(this, arguments); this.callbackAsync = true; return result; }; } // create asynchronous versions of callsArg* and yields* methods Object.keys(module.exports).forEach(function (method) { // need to avoid creating anotherasync versions of the newly added async methods if (method.match(/^(callsArg|yields)/) && !method.match(/Async/)) { module.exports[method + "Async"] = createAsyncVersion(method); } }); },{"./util/core/get-property-descriptor":32}],10:[function(require,module,exports){ "use strict"; var deepEqual = require("./util/core/deep-equal").use(match); // eslint-disable-line no-use-before-define var every = require("./util/core/every"); var functionName = require("./util/core/function-name"); var iterableToString = require("./util/core/iterable-to-string"); var typeOf = require("./util/core/typeOf"); var valueToString = require("./util/core/value-to-string"); var indexOf = Array.prototype.indexOf; function assertType(value, type, name) { var actual = typeOf(value); if (actual !== type) { throw new TypeError("Expected type of " + name + " to be " + type + ", but was " + actual); } } var matcher = { toString: function () { return this.message; } }; function isMatcher(object) { return matcher.isPrototypeOf(object); } function matchObject(expectation, actual) { if (actual === null || actual === undefined) { return false; } return Object.keys(expectation).every(function (key) { var exp = expectation[key]; var act = actual[key]; if (isMatcher(exp)) { if (!exp.test(act)) { return false; } } else if (typeOf(exp) === "object") { if (!matchObject(exp, act)) { return false; } } else if (!deepEqual(exp, act)) { return false; } return true; }); } var TYPE_MAP = { "function": function (m, expectation, message) { m.test = expectation; m.message = message || "match(" + functionName(expectation) + ")"; }, number: function (m, expectation) { m.test = function (actual) { // we need type coercion here return expectation == actual; // eslint-disable-line eqeqeq }; }, object: function (m, expectation) { var array = []; if (typeof expectation.test === "function") { m.test = function (actual) { return expectation.test(actual) === true; }; m.message = "match(" + functionName(expectation.test) + ")"; return m; } array = Object.keys(expectation).map(function (key) { return key + ": " + valueToString(expectation[key]); }); m.test = function (actual) { return matchObject(expectation, actual); }; m.message = "match(" + array.join(", ") + ")"; return m; }, regexp: function (m, expectation) { m.test = function (actual) { return typeof actual === "string" && expectation.test(actual); }; }, string: function (m, expectation) { m.test = function (actual) { return typeof actual === "string" && actual.indexOf(expectation) !== -1; }; m.message = "match(\"" + expectation + "\")"; } }; function match(expectation, message) { var m = Object.create(matcher); var type = typeOf(expectation); if (type in TYPE_MAP) { TYPE_MAP[type](m, expectation, message); } else { m.test = function (actual) { return deepEqual(expectation, actual); }; } if (!m.message) { m.message = "match(" + valueToString(expectation) + ")"; } return m; } matcher.or = function (m2) { if (!arguments.length) { throw new TypeError("Matcher expected"); } else if (!isMatcher(m2)) { m2 = match(m2); } var m1 = this; var or = Object.create(matcher); or.test = function (actual) { return m1.test(actual) || m2.test(actual); }; or.message = m1.message + ".or(" + m2.message + ")"; return or; }; matcher.and = function (m2) { if (!arguments.length) { throw new TypeError("Matcher expected"); } else if (!isMatcher(m2)) { m2 = match(m2); } var m1 = this; var and = Object.create(matcher); and.test = function (actual) { return m1.test(actual) && m2.test(actual); }; and.message = m1.message + ".and(" + m2.message + ")"; return and; }; match.isMatcher = isMatcher; match.any = match(function () { return true; }, "any"); match.defined = match(function (actual) { return actual !== null && actual !== undefined; }, "defined"); match.truthy = match(function (actual) { return !!actual; }, "truthy"); match.falsy = match(function (actual) { return !actual; }, "falsy"); match.same = function (expectation) { return match(function (actual) { return expectation === actual; }, "same(" + valueToString(expectation) + ")"); }; match.typeOf = function (type) { assertType(type, "string", "type"); return match(function (actual) { return typeOf(actual) === type; }, "typeOf(\"" + type + "\")"); }; match.instanceOf = function (type) { assertType(type, "function", "type"); return match(function (actual) { return actual instanceof type; }, "instanceOf(" + functionName(type) + ")"); }; function createPropertyMatcher(propertyTest, messagePrefix) { return function (property, value) { assertType(property, "string", "property"); var onlyProperty = arguments.length === 1; var message = messagePrefix + "(\"" + property + "\""; if (!onlyProperty) { message += ", " + valueToString(value); } message += ")"; return match(function (actual) { if (actual === undefined || actual === null || !propertyTest(actual, property)) { return false; } return onlyProperty || deepEqual(value, actual[property]); }, message); }; } match.has = createPropertyMatcher(function (actual, property) { if (typeof actual === "object") { return property in actual; } return actual[property] !== undefined; }, "has"); match.hasOwn = createPropertyMatcher(function (actual, property) { return actual.hasOwnProperty(property); }, "hasOwn"); match.array = match.typeOf("array"); match.array.deepEquals = function (expectation) { return match(function (actual) { // Comparing lengths is the fastest way to spot a difference before iterating through every item var sameLength = actual.length === expectation.length; return typeOf(actual) === "array" && sameLength && every(actual, function (element, index) { return expectation[index] === element; }); }, "deepEquals([" + iterableToString(expectation) + "])"); }; match.array.startsWith = function (expectation) { return match(function (actual) { return typeOf(actual) === "array" && every(expectation, function (expectedElement, index) { return actual[index] === expectedElement; }); }, "startsWith([" + iterableToString(expectation) + "])"); }; match.array.endsWith = function (expectation) { return match(function (actual) { // This indicates the index in which we should start matching var offset = actual.length - expectation.length; return typeOf(actual) === "array" && every(expectation, function (expectedElement, index) { return actual[offset + index] === expectedElement; }); }, "endsWith([" + iterableToString(expectation) + "])"); }; match.array.contains = function (expectation) { return match(function (actual) { return typeOf(actual) === "array" && every(expectation, function (expectedElement) { return indexOf.call(actual, expectedElement) !== -1; }); }, "contains([" + iterableToString(expectation) + "])"); }; match.map = match.typeOf("map"); match.map.deepEquals = function mapDeepEquals(expectation) { return match(function (actual) { // Comparing lengths is the fastest way to spot a difference before iterating through every item var sameLength = actual.size === expectation.size; return typeOf(actual) === "map" && sameLength && every(actual, function (element, key) { return expectation.has(key) && expectation.get(key) === element; }); }, "deepEquals(Map[" + iterableToString(expectation) + "])"); }; match.map.contains = function mapContains(expectation) { return match(function (actual) { return typeOf(actual) === "map" && every(expectation, function (element, key) { return actual.has(key) && actual.get(key) === element; }); }, "contains(Map[" + iterableToString(expectation) + "])"); }; match.set = match.typeOf("set"); match.set.deepEquals = function setDeepEquals(expectation) { return match(function (actual) { // Comparing lengths is the fastest way to spot a difference before iterating through every item var sameLength = actual.size === expectation.size; return typeOf(actual) === "set" && sameLength && every(actual, function (element) { return expectation.has(element); }); }, "deepEquals(Set[" + iterableToString(expectation) + "])"); }; match.set.contains = function setContains(expectation) { return match(function (actual) { return typeOf(actual) === "set" && every(expectation, function (element) { return actual.has(element); }); }, "contains(Set[" + iterableToString(expectation) + "])"); }; match.bool = match.typeOf("boolean"); match.number = match.typeOf("number"); match.string = match.typeOf("string"); match.object = match.typeOf("object"); match.func = match.typeOf("function"); match.regexp = match.typeOf("regexp"); match.date = match.typeOf("date"); match.symbol = match.typeOf("symbol"); module.exports = match; },{"./util/core/deep-equal":23,"./util/core/every":26,"./util/core/function-name":29,"./util/core/iterable-to-string":34,"./util/core/typeOf":39,"./util/core/value-to-string":40}],11:[function(require,module,exports){ "use strict"; var spyInvoke = require("./spy").invoke; var spyCallToString = require("./call").toString; var timesInWords = require("./util/core/times-in-words"); var extend = require("./util/core/extend"); var match = require("./match"); var stub = require("./stub"); var assert = require("./assert"); var deepEqual = require("./util/core/deep-equal").use(match); var format = require("./util/core/format"); var valueToString = require("./util/core/value-to-string"); var slice = Array.prototype.slice; var push = Array.prototype.push; function callCountInWords(callCount) { if (callCount === 0) { return "never called"; } return "called " + timesInWords(callCount); } function expectedCallCountInWords(expectation) { var min = expectation.minCalls; var max = expectation.maxCalls; if (typeof min === "number" && typeof max === "number") { var str = timesInWords(min); if (min !== max) { str = "at least " + str + " and at most " + timesInWords(max); } return str; } if (typeof min === "number") { return "at least " + timesInWords(min); } return "at most " + timesInWords(max); } function receivedMinCalls(expectation) { var hasMinLimit = typeof expectation.minCalls === "number"; return !hasMinLimit || expectation.callCount >= expectation.minCalls; } function receivedMaxCalls(expectation) { if (typeof expectation.maxCalls !== "number") { return false; } return expectation.callCount === expectation.maxCalls; } function verifyMatcher(possibleMatcher, arg) { var isMatcher = match && match.isMatcher(possibleMatcher); return isMatcher && possibleMatcher.test(arg) || true; } var mockExpectation = { minCalls: 1, maxCalls: 1, create: function create(methodName) { var expectation = extend(stub.create(), mockExpectation); delete expectation.create; expectation.method = methodName; return expectation; }, invoke: function invoke(func, thisValue, args) { this.verifyCallAllowed(thisValue, args); return spyInvoke.apply(this, arguments); }, atLeast: function atLeast(num) { if (typeof num !== "number") { throw new TypeError("'" + valueToString(num) + "' is not number"); } if (!this.limitsSet) { this.maxCalls = null; this.limitsSet = true; } this.minCalls = num; return this; }, atMost: function atMost(num) { if (typeof num !== "number") { throw new TypeError("'" + valueToString(num) + "' is not number"); } if (!this.limitsSet) { this.minCalls = null; this.limitsSet = true; } this.maxCalls = num; return this; }, never: function never() { return this.exactly(0); }, once: function once() { return this.exactly(1); }, twice: function twice() { return this.exactly(2); }, thrice: function thrice() { return this.exactly(3); }, exactly: function exactly(num) { if (typeof num !== "number") { throw new TypeError("'" + valueToString(num) + "' is not a number"); } this.atLeast(num); return this.atMost(num); }, met: function met() { return !this.failed && receivedMinCalls(this); }, verifyCallAllowed: function verifyCallAllowed(thisValue, args) { var expectedArguments = this.expectedArguments; if (receivedMaxCalls(this)) { this.failed = true; mockExpectation.fail(this.method + " already called " + timesInWords(this.maxCalls)); } if ("expectedThis" in this && this.expectedThis !== thisValue) { mockExpectation.fail(this.method + " called with " + valueToString(thisValue) + " as thisValue, expected " + valueToString(this.expectedThis)); } if (!("expectedArguments" in this)) { return; } if (!args) { mockExpectation.fail(this.method + " received no arguments, expected " + format(expectedArguments)); } if (args.length < expectedArguments.length) { mockExpectation.fail(this.method + " received too few arguments (" + format(args) + "), expected " + format(expectedArguments)); } if (this.expectsExactArgCount && args.length !== expectedArguments.length) { mockExpectation.fail(this.method + " received too many arguments (" + format(args) + "), expected " + format(expectedArguments)); } expectedArguments.forEach(function (expectedArgument, i) { if (!verifyMatcher(expectedArgument, args[i])) { mockExpectation.fail(this.method + " received wrong arguments " + format(args) + ", didn't match " + expectedArguments.toString()); } if (!deepEqual(expectedArgument, args[i])) { mockExpectation.fail(this.method + " received wrong arguments " + format(args) + ", expected " + format(expectedArguments)); } }, this); }, allowsCall: function allowsCall(thisValue, args) { var expectedArguments = this.expectedArguments; if (this.met() && receivedMaxCalls(this)) { return false; } if ("expectedThis" in this && this.expectedThis !== thisValue) { return false; } if (!("expectedArguments" in this)) { return true; } args = args || []; if (args.length < expectedArguments.length) { return false; } if (this.expectsExactArgCount && args.length !== expectedArguments.length) { return false; } return expectedArguments.every(function (expectedArgument, i) { if (!verifyMatcher(expectedArgument, args[i])) { return false; } if (!deepEqual(expectedArgument, args[i])) { return false; } return true; }); }, withArgs: function withArgs() { this.expectedArguments = slice.call(arguments); return this; }, withExactArgs: function withExactArgs() { this.withArgs.apply(this, arguments); this.expectsExactArgCount = true; return this; }, on: function on(thisValue) { this.expectedThis = thisValue; return this; }, toString: function () { var args = (this.expectedArguments || []).slice(); if (!this.expectsExactArgCount) { push.call(args, "[...]"); } var callStr = spyCallToString.call({ proxy: this.method || "anonymous mock expectation", args: args }); var message = callStr.replace(", [...", "[, ...") + " " + expectedCallCountInWords(this); if (this.met()) { return "Expectation met: " + message; } return "Expected " + message + " (" + callCountInWords(this.callCount) + ")"; }, verify: function verify() { if (!this.met()) { mockExpectation.fail(this.toString()); } else { mockExpectation.pass(this.toString()); } return true; }, pass: function pass(message) { assert.pass(message); }, fail: function fail(message) { var exception = new Error(message); exception.name = "ExpectationError"; throw exception; } }; module.exports = mockExpectation; },{"./assert":2,"./call":5,"./match":10,"./spy":16,"./stub":20,"./util/core/deep-equal":23,"./util/core/extend":27,"./util/core/format":28,"./util/core/times-in-words":38,"./util/core/value-to-string":40}],12:[function(require,module,exports){ "use strict"; var mockExpectation = require("./mock-expectation"); var spyCallToString = require("./call").toString; var extend = require("./util/core/extend"); var match = require("./match"); var deepEqual = require("./util/core/deep-equal").use(match); var wrapMethod = require("./util/core/wrap-method"); var push = Array.prototype.push; function mock(object) { if (!object) { return mockExpectation.create("Anonymous mock"); } return mock.create(object); } function each(collection, callback) { var col = collection || []; col.forEach(callback); } function arrayEquals(arr1, arr2, compareLength) { if (compareLength && (arr1.length !== arr2.length)) { return false; } return arr1.every(function (element, i) { return deepEqual(element, arr2[i]); }); } extend(mock, { create: function create(object) { if (!object) { throw new TypeError("object is null"); } var mockObject = extend({}, mock); mockObject.object = object; delete mockObject.create; return mockObject; }, expects: function expects(method) { if (!method) { throw new TypeError("method is falsy"); } if (!this.expectations) { this.expectations = {}; this.proxies = []; this.failures = []; } if (!this.expectations[method]) { this.expectations[method] = []; var mockObject = this; wrapMethod(this.object, method, function () { return mockObject.invokeMethod(method, this, arguments); }); push.call(this.proxies, method); } var expectation = mockExpectation.create(method); push.call(this.expectations[method], expectation); return expectation; }, restore: function restore() { var object = this.object; each(this.proxies, function (proxy) { if (typeof object[proxy].restore === "function") { object[proxy].restore(); } }); }, verify: function verify() { var expectations = this.expectations || {}; var messages = this.failures ? this.failures.slice() : []; var met = []; each(this.proxies, function (proxy) { each(expectations[proxy], function (expectation) { if (!expectation.met()) { push.call(messages, expectation.toString()); } else { push.call(met, expectation.toString()); } }); }); this.restore(); if (messages.length > 0) { mockExpectation.fail(messages.concat(met).join("\n")); } else if (met.length > 0) { mockExpectation.pass(messages.concat(met).join("\n")); } return true; }, invokeMethod: function invokeMethod(method, thisValue, args) { /* if we cannot find any matching files we will explicitly call mockExpection#fail with error messages */ /* eslint consistent-return: "off" */ var expectations = this.expectations && this.expectations[method] ? this.expectations[method] : []; var currentArgs = args || []; var available; var expectationsWithMatchingArgs = expectations.filter(function (expectation) { var expectedArgs = expectation.expectedArguments || []; return arrayEquals(expectedArgs, currentArgs, expectation.expectsExactArgCount); }); var expectationsToApply = expectationsWithMatchingArgs.filter(function (expectation) { return !expectation.met() && expectation.allowsCall(thisValue, args); }); if (expectationsToApply.length > 0) { return expectationsToApply[0].apply(thisValue, args); } var messages = []; var exhausted = 0; expectationsWithMatchingArgs.forEach(function (expectation) { if (expectation.allowsCall(thisValue, args)) { available = available || expectation; } else { exhausted += 1; } }); if (available && exhausted === 0) { return available.apply(thisValue, args); } expectations.forEach(function (expectation) { push.call(messages, " " + expectation.toString()); }); messages.unshift("Unexpected call: " + spyCallToString.call({ proxy: method, args: args })); var err = new Error(); if (!err.stack) { // PhantomJS does not serialize the stack trace until the error has been thrown try { throw err; } catch (e) {/* empty */} } this.failures.push("Unexpected call: " + spyCallToString.call({ proxy: method, args: args, stack: err.stack })); mockExpectation.fail(messages.join("\n")); } }); module.exports = mock; },{"./call":5,"./match":10,"./mock-expectation":11,"./util/core/deep-equal":23,"./util/core/extend":27,"./util/core/wrap-method":42}],13:[function(require,module,exports){ "use strict"; var collectOwnMethods = require("./collect-own-methods"); var deprecated = require("./util/core/deprecated"); var getPropertyDescriptor = require("./util/core/get-property-descriptor"); var stubNonFunctionProperty = require("./stub-non-function-property"); var sinonStub = require("./stub"); var throwOnFalsyObject = require("./throw-on-falsy-object"); // This is deprecated and will be removed in a future version of sinon. // We will only consider pull requests that fix serious bugs in the implementation function sandboxStub(object, property/*, value*/) { deprecated.printWarning( "sandbox.stub(obj, 'meth', val) is deprecated and will be removed from " + "the public API in a future version of sinon." + "\n Use sandbox.stub(obj, 'meth').callsFake(fn) instead in order to stub a function." + "\n Use sandbox.stub(obj, 'meth').value(fn) instead in order to stub a non-function value." ); throwOnFalsyObject.apply(null, arguments); var actualDescriptor = getPropertyDescriptor(object, property); var isStubbingEntireObject = typeof property === "undefined" && typeof object === "object"; var isStubbingNonFuncProperty = typeof object === "object" && typeof property !== "undefined" && (typeof actualDescriptor === "undefined" || typeof actualDescriptor.value !== "function"); // When passing a value as third argument it will be applied to stubNonFunctionProperty var stubbed = isStubbingNonFuncProperty ? stubNonFunctionProperty.apply(null, arguments) : sinonStub.apply(null, arguments); if (isStubbingEntireObject) { var ownMethods = collectOwnMethods(stubbed); ownMethods.forEach(this.add.bind(this)); if (this.promiseLibrary) { ownMethods.forEach(this.addUsingPromise.bind(this)); } } else { this.add(stubbed); if (this.promiseLibrary) { stubbed.usingPromise(this.promiseLibrary); } } return stubbed; } module.exports = sandboxStub; },{"./collect-own-methods":6,"./stub":20,"./stub-non-function-property":19,"./throw-on-falsy-object":21,"./util/core/deprecated":25,"./util/core/get-property-descriptor":32}],14:[function(require,module,exports){ "use strict"; var extend = require("./util/core/extend"); var sinonCollection = require("./collection"); var sinonMatch = require("./match"); var sinonAssert = require("./assert"); var sinonClock = require("./util/fake_timers"); var fakeServer = require("./util/fake_server"); var fakeXhr = require("./util/fake_xml_http_request"); var fakeServerWithClock = require("./util/fake_server_with_clock"); var push = [].push; var sinonSandbox = Object.create(sinonCollection); function exposeValue(sandbox, config, key, value) { if (!value) { return; } if (config.injectInto && !(key in config.injectInto)) { config.injectInto[key] = value; sandbox.injectedKeys.push(key); } else { push.call(sandbox.args, value); } } function prepareSandboxFromConfig(config) { var sandbox = Object.create(sinonSandbox); if (config.useFakeServer) { if (typeof config.useFakeServer === "object") { sandbox.serverPrototype = config.useFakeServer; } sandbox.useFakeServer(); } if (config.useFakeTimers) { if (typeof config.useFakeTimers === "object") { sandbox.useFakeTimers.apply(sandbox, config.useFakeTimers); } else { sandbox.useFakeTimers(); } } return sandbox; } extend(sinonSandbox, { useFakeTimers: function useFakeTimers() { this.clock = sinonClock.useFakeTimers.apply(null, arguments); return this.add(this.clock); }, serverPrototype: fakeServerWithClock, useFakeServer: function useFakeServer() { var proto = this.serverPrototype || fakeServer; if (!proto || !proto.create) { return null; } this.server = proto.create(); return this.add(this.server); }, useFakeXMLHttpRequest: function useFakeXMLHttpRequest() { var xhr = fakeXhr.useFakeXMLHttpRequest(); return this.add(xhr); }, inject: function (obj) { sinonCollection.inject.call(this, obj); if (this.clock) { obj.clock = this.clock; } if (this.server) { obj.server = this.server; obj.requests = this.server.requests; } obj.match = sinonMatch; return obj; }, usingPromise: function (promiseLibrary) { this.promiseLibrary = promiseLibrary; return this; }, restore: function () { if (arguments.length) { throw new Error("sandbox.restore() does not take any parameters. Perhaps you meant stub.restore()"); } sinonCollection.restore.apply(this, arguments); this.restoreContext(); }, restoreContext: function () { var injectedKeys = this.injectedKeys; var injectInto = this.injectInto; if (!injectedKeys) { return; } injectedKeys.forEach(function (injectedKey) { delete injectInto[injectedKey]; }); injectedKeys = []; }, create: function (config) { if (!config) { return Object.create(sinonSandbox); } var sandbox = prepareSandboxFromConfig(config); sandbox.args = sandbox.args || []; sandbox.injectedKeys = []; sandbox.injectInto = config.injectInto; var exposed = sandbox.inject({}); if (config.properties) { config.properties.forEach(function (prop) { var value = exposed[prop] || prop === "sandbox" && sandbox; exposeValue(sandbox, config, prop, value); }); } else { exposeValue(sandbox, config, "sandbox"); } return sandbox; }, match: sinonMatch, assert: sinonAssert }); module.exports = sinonSandbox; },{"./assert":2,"./collection":7,"./match":10,"./util/core/extend":27,"./util/fake_server":44,"./util/fake_server_with_clock":45,"./util/fake_timers":46,"./util/fake_xml_http_request":47}],15:[function(require,module,exports){ "use strict"; var color = require("./color"); var timesInWords = require("./util/core/times-in-words"); var sinonFormat = require("./util/core/format"); var sinonMatch = require("./match"); var jsDiff = require("diff"); var push = Array.prototype.push; function colorSinonMatchText(matcher, calledArg, calledArgMessage) { if (!matcher.test(calledArg)) { matcher.message = color.red(matcher.message); if (calledArgMessage) { calledArgMessage = color.green(calledArgMessage); } } return calledArgMessage + " " + matcher.message; } function colorDiffText(diff) { var objects = diff.map(function (part) { var text = part.value; if (part.added) { text = color.green(text); } else if (part.removed) { text = color.red(text); } if (diff.length === 2) { text += " "; // format simple diffs } return text; }); return objects.join(""); } module.exports = { c: function (spyInstance) { return timesInWords(spyInstance.callCount); }, n: function (spyInstance) { return spyInstance.toString(); }, D: function (spyInstance, args) { var message = ""; for (var i = 0, l = spyInstance.callCount; i < l; ++i) { // describe multiple calls if (l > 1) { if (i > 0) { message += "\n"; } message += "Call " + (i + 1) + ":"; } var calledArgs = spyInstance.getCall(i).args; for (var j = 0; j < calledArgs.length || j < args.length; ++j) { message += "\n"; var calledArgMessage = j < calledArgs.length ? sinonFormat(calledArgs[j]) : ""; if (sinonMatch.isMatcher(args[j])) { message += colorSinonMatchText(args[j], calledArgs[j], calledArgMessage); } else { var expectedArgMessage = j < args.length ? sinonFormat(args[j]) : ""; var diff = jsDiff.diffJson(calledArgMessage, expectedArgMessage); message += colorDiffText(diff); } } } return message; }, C: function (spyInstance) { var calls = []; for (var i = 0, l = spyInstance.callCount; i < l; ++i) { var stringifiedCall = " " + spyInstance.getCall(i).toString(); if (/\n/.test(calls[i - 1])) { stringifiedCall = "\n" + stringifiedCall; } push.call(calls, stringifiedCall); } return calls.length > 0 ? "\n" + calls.join("\n") : ""; }, t: function (spyInstance) { var objects = []; for (var i = 0, l = spyInstance.callCount; i < l; ++i) { push.call(objects, sinonFormat(spyInstance.thisValues[i])); } return objects.join(", "); }, "*": function (spyInstance, args) { return args.map(function (arg) { return sinonFormat(arg); }).join(", "); } }; },{"./color":8,"./match":10,"./util/core/format":28,"./util/core/times-in-words":38,"diff":48}],16:[function(require,module,exports){ "use strict"; var extend = require("./util/core/extend"); var functionName = require("./util/core/function-name"); var functionToString = require("./util/core/function-to-string"); var getPropertyDescriptor = require("./util/core/get-property-descriptor"); var sinonMatch = require("./match"); var deepEqual = require("./util/core/deep-equal").use(sinonMatch); var spyCall = require("./call"); var wrapMethod = require("./util/core/wrap-method"); var sinonFormat = require("./util/core/format"); var valueToString = require("./util/core/value-to-string"); var push = Array.prototype.push; var slice = Array.prototype.slice; var callId = 0; var ErrorConstructor = Error.prototype.constructor; function spy(object, property, types) { var descriptor, methodDesc; if (!property && typeof object === "function") { return spy.create(object); } if (!object && !property) { return spy.create(function () { }); } if (!types) { return wrapMethod(object, property, spy.create(object[property])); } descriptor = {}; methodDesc = getPropertyDescriptor(object, property); types.forEach(function (type) { descriptor[type] = spy.create(methodDesc[type]); }); return wrapMethod(object, property, descriptor); } function incrementCallCount() { this.called = true; this.callCount += 1; this.notCalled = false; this.calledOnce = this.callCount === 1; this.calledTwice = this.callCount === 2; this.calledThrice = this.callCount === 3; } function createCallProperties() { this.firstCall = this.getCall(0); this.secondCall = this.getCall(1); this.thirdCall = this.getCall(2); this.lastCall = this.getCall(this.callCount - 1); } function createProxy(func, proxyLength) { // Retain the function length: var p; if (proxyLength) { // Do not change this to use an eval. Projects that depend on sinon block the use of eval. // ref: https://github.com/sinonjs/sinon/issues/710 switch (proxyLength) { /*eslint-disable no-unused-vars, max-len*/ case 1: p = function proxy(a) { return p.invoke(func, this, slice.call(arguments)); }; break; case 2: p = function proxy(a, b) { return p.invoke(func, this, slice.call(arguments)); }; break; case 3: p = function proxy(a, b, c) { return p.invoke(func, this, slice.call(arguments)); }; break; case 4: p = function proxy(a, b, c, d) { return p.invoke(func, this, slice.call(arguments)); }; break; case 5: p = function proxy(a, b, c, d, e) { return p.invoke(func, this, slice.call(arguments)); }; break; case 6: p = function proxy(a, b, c, d, e, f) { return p.invoke(func, this, slice.call(arguments)); }; break; case 7: p = function proxy(a, b, c, d, e, f, g) { return p.invoke(func, this, slice.call(arguments)); }; break; case 8: p = function proxy(a, b, c, d, e, f, g, h) { return p.invoke(func, this, slice.call(arguments)); }; break; case 9: p = function proxy(a, b, c, d, e, f, g, h, i) { return p.invoke(func, this, slice.call(arguments)); }; break; case 10: p = function proxy(a, b, c, d, e, f, g, h, i, j) { return p.invoke(func, this, slice.call(arguments)); }; break; case 11: p = function proxy(a, b, c, d, e, f, g, h, i, j, k) { return p.invoke(func, this, slice.call(arguments)); }; break; case 12: p = function proxy(a, b, c, d, e, f, g, h, i, j, k, l) { return p.invoke(func, this, slice.call(arguments)); }; break; default: p = function proxy() { return p.invoke(func, this, slice.call(arguments)); }; break; /*eslint-enable*/ } } else { p = function proxy() { return p.invoke(func, this, slice.call(arguments)); }; } p.isSinonProxy = true; return p; } var uuid = 0; // Public API var spyApi = { formatters: require("./spy-formatters"), reset: function () { if (this.invoking) { var err = new Error("Cannot reset Sinon function while invoking it. " + "Move the call to .reset outside of the callback."); err.name = "InvalidResetException"; throw err; } this.called = false; this.notCalled = true; this.calledOnce = false; this.calledTwice = false; this.calledThrice = false; this.callCount = 0; this.firstCall = null; this.secondCall = null; this.thirdCall = null; this.lastCall = null; this.args = []; this.returnValues = []; this.thisValues = []; this.exceptions = []; this.callIds = []; this.errorsWithCallStack = []; if (this.fakes) { this.fakes.forEach(function (fake) { if (fake.resetHistory) { fake.resetHistory(); } else { fake.reset(); } }); } return this; }, create: function create(func, spyLength) { var name; if (typeof func !== "function") { func = function () { }; } else { name = functionName(func); } if (!spyLength) { spyLength = func.length; } var proxy = createProxy(func, spyLength); extend(proxy, spy); delete proxy.create; extend(proxy, func); proxy.reset(); proxy.prototype = func.prototype; proxy.displayName = name || "spy"; proxy.toString = functionToString; proxy.instantiateFake = spy.create; proxy.id = "spy#" + uuid++; return proxy; }, invoke: function invoke(func, thisValue, args) { var matchings = this.matchingFakes(args); var currentCallId = callId++; var exception, returnValue; incrementCallCount.call(this); push.call(this.thisValues, thisValue); push.call(this.args, args); push.call(this.callIds, currentCallId); matchings.forEach(function (matching) { incrementCallCount.call(matching); push.call(matching.thisValues, thisValue); push.call(matching.args, args); push.call(matching.callIds, currentCallId); }); // Make call properties available from within the spied function: createCallProperties.call(this); matchings.forEach(function (matching) { createCallProperties.call(matching); }); try { this.invoking = true; returnValue = (this.func || func).apply(thisValue, args); var thisCall = this.getCall(this.callCount - 1); if (thisCall.calledWithNew() && typeof returnValue !== "object") { returnValue = thisValue; } } catch (e) { exception = e; } finally { delete this.invoking; } push.call(this.exceptions, exception); push.call(this.returnValues, returnValue); matchings.forEach(function (matching) { push.call(matching.exceptions, exception); push.call(matching.returnValues, returnValue); }); var err = new ErrorConstructor(); // 1. Please do not get stack at this point. It may be so very slow, and not actually used // 2. PhantomJS does not serialize the stack trace until the error has been thrown: // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack try { throw err; } catch (e) {/* empty */} push.call(this.errorsWithCallStack, err); matchings.forEach(function (matching) { push.call(matching.errorsWithCallStack, err); }); // Make return value and exception available in the calls: createCallProperties.call(this); if (exception !== undefined) { throw exception; } return returnValue; }, named: function named(name) { this.displayName = name; return this; }, getCall: function getCall(i) { if (i < 0 || i >= this.callCount) { return null; } return spyCall(this, this.thisValues[i], this.args[i], this.returnValues[i], this.exceptions[i], this.callIds[i], this.errorsWithCallStack[i]); }, getCalls: function () { var calls = []; var i; for (i = 0; i < this.callCount; i++) { calls.push(this.getCall(i)); } return calls; }, calledBefore: function calledBefore(spyFn) { if (!this.called) { return false; } if (!spyFn.called) { return true; } return this.callIds[0] < spyFn.callIds[spyFn.callIds.length - 1]; }, calledAfter: function calledAfter(spyFn) { if (!this.called || !spyFn.called) { return false; } return this.callIds[this.callCount - 1] > spyFn.callIds[0]; }, calledImmediatelyBefore: function calledImmediatelyBefore(spyFn) { if (!this.called || !spyFn.called) { return false; } return this.callIds[this.callCount - 1] === spyFn.callIds[spyFn.callCount - 1] - 1; }, calledImmediatelyAfter: function calledImmediatelyAfter(spyFn) { if (!this.called || !spyFn.called) { return false; } return this.callIds[this.callCount - 1] === spyFn.callIds[spyFn.callCount - 1] + 1; }, withArgs: function () { var args = slice.call(arguments); if (this.fakes) { var matching = this.matchingFakes(args, true).pop(); if (matching) { return matching; } } else { this.fakes = []; } var original = this; var fake = this.instantiateFake(); fake.matchingArguments = args; fake.parent = this; push.call(this.fakes, fake); fake.withArgs = function () { return original.withArgs.apply(original, arguments); }; original.args.forEach(function (arg, i) { if (!fake.matches(arg)) { return; } incrementCallCount.call(fake); push.call(fake.thisValues, original.thisValues[i]); push.call(fake.args, arg); push.call(fake.returnValues, original.returnValues[i]); push.call(fake.exceptions, original.exceptions[i]); push.call(fake.callIds, original.callIds[i]); }); createCallProperties.call(fake); return fake; }, matchingFakes: function (args, strict) { return (this.fakes || []).filter(function (fake) { return fake.matches(args, strict); }); }, matches: function (args, strict) { var margs = this.matchingArguments; if (margs.length <= args.length && deepEqual(margs, args.slice(0, margs.length))) { return !strict || margs.length === args.length; } return undefined; }, printf: function (format) { var spyInstance = this; var args = slice.call(arguments, 1); var formatter; return (format || "").replace(/%(.)/g, function (match, specifyer) { formatter = spyApi.formatters[specifyer]; if (typeof formatter === "function") { return formatter.call(null, spyInstance, args); } else if (!isNaN(parseInt(specifyer, 10))) { return sinonFormat(args[specifyer - 1]); } return "%" + specifyer; }); } }; function delegateToCalls(method, matchAny, actual, notCalled) { spyApi[method] = function () { if (!this.called) { if (notCalled) { return notCalled.apply(this, arguments); } return false; } var currentCall; var matches = 0; for (var i = 0, l = this.callCount; i < l; i += 1) { currentCall = this.getCall(i); if (currentCall[actual || method].apply(currentCall, arguments)) { matches += 1; if (matchAny) { return true; } } } return matches === this.callCount; }; } delegateToCalls("calledOn", true); delegateToCalls("alwaysCalledOn", false, "calledOn"); delegateToCalls("calledWith", true); delegateToCalls("calledWithMatch", true); delegateToCalls("alwaysCalledWith", false, "calledWith"); delegateToCalls("alwaysCalledWithMatch", false, "calledWithMatch"); delegateToCalls("calledWithExactly", true); delegateToCalls("alwaysCalledWithExactly", false, "calledWithExactly"); delegateToCalls("neverCalledWith", false, "notCalledWith", function () { return true; }); delegateToCalls("neverCalledWithMatch", false, "notCalledWithMatch", function () { return true; }); delegateToCalls("threw", true); delegateToCalls("alwaysThrew", false, "threw"); delegateToCalls("returned", true); delegateToCalls("alwaysReturned", false, "returned"); delegateToCalls("calledWithNew", true); delegateToCalls("alwaysCalledWithNew", false, "calledWithNew"); delegateToCalls("callArg", false, "callArgWith", function () { throw new Error(this.toString() + " cannot call arg since it was not yet invoked."); }); spyApi.callArgWith = spyApi.callArg; delegateToCalls("callArgOn", false, "callArgOnWith", function () { throw new Error(this.toString() + " cannot call arg since it was not yet invoked."); }); spyApi.callArgOnWith = spyApi.callArgOn; delegateToCalls("throwArg", false, "throwArg", function () { throw new Error(this.toString() + " cannot throw arg since it was not yet invoked."); }); delegateToCalls("yield", false, "yield", function () { throw new Error(this.toString() + " cannot yield since it was not yet invoked."); }); // "invokeCallback" is an alias for "yield" since "yield" is invalid in strict mode. spyApi.invokeCallback = spyApi.yield; delegateToCalls("yieldOn", false, "yieldOn", function () { throw new Error(this.toString() + " cannot yield since it was not yet invoked."); }); delegateToCalls("yieldTo", false, "yieldTo", function (property) { throw new Error(this.toString() + " cannot yield to '" + valueToString(property) + "' since it was not yet invoked."); }); delegateToCalls("yieldToOn", false, "yieldToOn", function (property) { throw new Error(this.toString() + " cannot yield to '" + valueToString(property) + "' since it was not yet invoked."); }); extend(spy, spyApi); spy.spyCall = spyCall; module.exports = spy; },{"./call":5,"./match":10,"./spy-formatters":15,"./util/core/deep-equal":23,"./util/core/extend":27,"./util/core/format":28,"./util/core/function-name":29,"./util/core/function-to-string":30,"./util/core/get-property-descriptor":32,"./util/core/value-to-string":40,"./util/core/wrap-method":42}],17:[function(require,module,exports){ "use strict"; var deprecated = require("./util/core/deprecated"); var spy = require("./spy"); var wrapMethod = require("./util/core/wrap-method"); // This is deprecated and will be removed in a future version of sinon. // We will only consider pull requests that fix serious bugs in the implementation function stubDescriptor(object, property, descriptor) { var wrapper; deprecated.printWarning( "sinon.stub(obj, 'meth', fn) is deprecated and will be removed from " + "the public API in a future version of sinon." + "\n Use stub(obj, 'meth').callsFake(fn)." + "\n Codemod available at https://github.com/hurrymaplelad/sinon-codemod" ); if (!!descriptor && typeof descriptor !== "function" && typeof descriptor !== "object") { throw new TypeError("Custom stub should be a property descriptor"); } if (typeof descriptor === "object" && Object.keys(descriptor).length === 0) { throw new TypeError("Expected property descriptor to have at least one key"); } if (typeof descriptor === "function") { wrapper = spy && spy.create ? spy.create(descriptor) : descriptor; } else { wrapper = descriptor; if (spy && spy.create) { Object.keys(wrapper).forEach(function (type) { wrapper[type] = spy.create(wrapper[type]); }); } } return wrapMethod(object, property, wrapper); } module.exports = stubDescriptor; },{"./spy":16,"./util/core/deprecated":25,"./util/core/wrap-method":42}],18:[function(require,module,exports){ "use strict"; var getPropertyDescriptor = require("./util/core/get-property-descriptor"); var walk = require("./util/core/walk"); function stubEntireObject(stub, object) { walk(object || {}, function (prop, propOwner) { // we don't want to stub things like toString(), valueOf(), etc. so we only stub if the object // is not Object.prototype if ( propOwner !== Object.prototype && prop !== "constructor" && typeof getPropertyDescriptor(propOwner, prop).value === "function" ) { stub(object, prop); } }); return object; } module.exports = stubEntireObject; },{"./util/core/get-property-descriptor":32,"./util/core/walk":41}],19:[function(require,module,exports){ "use strict"; var valueToString = require("./util/core/value-to-string"); var hasOwnProperty = Object.prototype.hasOwnProperty; function stubNonFunctionProperty(object, property, value) { var original = object[property]; if (!hasOwnProperty.call(object, property)) { throw new TypeError("Cannot stub non-existent own property " + valueToString(property)); } object[property] = value; return { restore: function restore() { object[property] = original; } }; } module.exports = stubNonFunctionProperty; },{"./util/core/value-to-string":40}],20:[function(require,module,exports){ "use strict"; var behavior = require("./behavior"); var behaviors = require("./default-behaviors"); var spy = require("./spy"); var extend = require("./util/core/extend"); var functionToString = require("./util/core/function-to-string"); var getPropertyDescriptor = require("./util/core/get-property-descriptor"); var wrapMethod = require("./util/core/wrap-method"); var stubEntireObject = require("./stub-entire-object"); var stubDescriptor = require("./stub-descriptor"); var throwOnFalsyObject = require("./throw-on-falsy-object"); var slice = Array.prototype.slice; function stub(object, property, descriptor) { throwOnFalsyObject.apply(null, arguments); var actualDescriptor = getPropertyDescriptor(object, property); var isStubbingEntireObject = typeof property === "undefined" && typeof object === "object"; var isCreatingNewStub = !object && typeof property === "undefined"; var isStubbingDescriptor = object && property && Boolean(descriptor); var isStubbingNonFuncProperty = (typeof object === "object" || typeof object === "function") && typeof property !== "undefined" && (typeof actualDescriptor === "undefined" || typeof actualDescriptor.value !== "function") && typeof descriptor === "undefined"; var isStubbingExistingMethod = !isStubbingDescriptor && typeof object === "object" && typeof actualDescriptor !== "undefined" && typeof actualDescriptor.value === "function"; var arity = isStubbingExistingMethod ? object[property].length : 0; if (isStubbingEntireObject) { return stubEntireObject(stub, object); } if (isStubbingDescriptor) { return stubDescriptor.apply(null, arguments); } if (isCreatingNewStub) { return stub.create(); } var s = stub.create(arity); s.rootObj = object; s.propName = property; s.restore = function restore() { if (actualDescriptor !== undefined) { Object.defineProperty(object, property, actualDescriptor); return; } delete object[property]; }; return isStubbingNonFuncProperty ? s : wrapMethod(object, property, s); } stub.createStubInstance = function (constructor) { if (typeof constructor !== "function") { throw new TypeError("The constructor should be a function."); } return stub(Object.create(constructor.prototype)); }; /*eslint-disable no-use-before-define*/ function getParentBehaviour(stubInstance) { return (stubInstance.parent && getCurrentBehavior(stubInstance.parent)); } function getDefaultBehavior(stubInstance) { return stubInstance.defaultBehavior || getParentBehaviour(stubInstance) || behavior.create(stubInstance); } function getCurrentBehavior(stubInstance) { var currentBehavior = stubInstance.behaviors[stubInstance.callCount - 1]; return currentBehavior && currentBehavior.isPresent() ? currentBehavior : getDefaultBehavior(stubInstance); } /*eslint-enable no-use-before-define*/ var uuid = 0; var proto = { create: function create(stubLength) { var functionStub = function () { var args = slice.call(arguments); var matchings = functionStub.matchingFakes(args); var fnStub = matchings.sort(function (a, b) { return a.matchingArguments.length - b.matchingArguments.length; }).pop() || functionStub; return getCurrentBehavior(fnStub).invoke(this, arguments); }; functionStub.id = "stub#" + uuid++; var orig = functionStub; functionStub = spy.create(functionStub, stubLength); functionStub.func = orig; extend(functionStub, stub); functionStub.instantiateFake = stub.create; functionStub.displayName = "stub"; functionStub.toString = functionToString; functionStub.defaultBehavior = null; functionStub.behaviors = []; return functionStub; }, resetBehavior: function () { var fakes = this.fakes || []; this.defaultBehavior = null; this.behaviors = []; delete this.returnValue; delete this.returnArgAt; delete this.throwArgAt; delete this.fakeFn; this.returnThis = false; fakes.forEach(function (fake) { fake.resetBehavior(); }); }, resetHistory: spy.reset, reset: function () { this.resetHistory(); this.resetBehavior(); }, onCall: function onCall(index) { if (!this.behaviors[index]) { this.behaviors[index] = behavior.create(this); } return this.behaviors[index]; }, onFirstCall: function onFirstCall() { return this.onCall(0); }, onSecondCall: function onSecondCall() { return this.onCall(1); }, onThirdCall: function onThirdCall() { return this.onCall(2); } }; Object.keys(behavior).forEach(function (method) { if (behavior.hasOwnProperty(method) && !proto.hasOwnProperty(method) && method !== "create" && method !== "withArgs" && method !== "invoke") { proto[method] = behavior.createBehavior(method); } }); Object.keys(behaviors).forEach(function (method) { if (behaviors.hasOwnProperty(method) && !proto.hasOwnProperty(method)) { behavior.addBehavior(stub, method, behaviors[method]); } }); extend(stub, proto); module.exports = stub; },{"./behavior":3,"./default-behaviors":9,"./spy":16,"./stub-descriptor":17,"./stub-entire-object":18,"./throw-on-falsy-object":21,"./util/core/extend":27,"./util/core/function-to-string":30,"./util/core/get-property-descriptor":32,"./util/core/wrap-method":42}],21:[function(require,module,exports){ "use strict"; var valueToString = require("./util/core/value-to-string"); function throwOnFalsyObject(object, property) { if (property && !object) { var type = object === null ? "null" : "undefined"; throw new Error("Trying to stub property '" + valueToString(property) + "' of " + type); } } module.exports = throwOnFalsyObject; },{"./util/core/value-to-string":40}],22:[function(require,module,exports){ "use strict"; var every = Array.prototype.every; module.exports = function calledInOrder(spies) { var callMap = {}; function hasCallsLeft(spy) { if (callMap[spy.id] === undefined) { callMap[spy.id] = 0; } return callMap[spy.id] < spy.callCount; } if (arguments.length > 1) { spies = arguments; } return every.call(spies, function checkAdjacentCalls(spy, i) { var calledBeforeNext = true; if (i !== spies.length - 1) { calledBeforeNext = spy.calledBefore(spies[i + 1]); } if (hasCallsLeft(spy) && calledBeforeNext) { callMap[spy.id] += 1; return true; } return false; }); }; },{}],23:[function(require,module,exports){ "use strict"; var div = typeof document !== "undefined" && document.createElement("div"); function isReallyNaN(val) { return val !== val; } function isDOMNode(obj) { var success = false; try { obj.appendChild(div); success = div.parentNode === obj; } catch (e) { return false; } finally { try { obj.removeChild(div); } catch (e) { // Remove failed, not much we can do about that } } return success; } function isElement(obj) { return div && obj && obj.nodeType === 1 && isDOMNode(obj); } var deepEqual = module.exports = function deepEqual(a, b) { if (typeof a !== "object" || typeof b !== "object") { return isReallyNaN(a) && isReallyNaN(b) || a === b; } if (isElement(a) || isElement(b)) { return a === b; } if (a === b) { return true; } if ((a === null && b !== null) || (a !== null && b === null)) { return false; } if (a instanceof RegExp && b instanceof RegExp) { return (a.source === b.source) && (a.global === b.global) && (a.ignoreCase === b.ignoreCase) && (a.multiline === b.multiline); } if (a instanceof Error && b instanceof Error) { return a === b; } var aString = Object.prototype.toString.call(a); if (aString !== Object.prototype.toString.call(b)) { return false; } if (aString === "[object Date]") { return a.valueOf() === b.valueOf(); } var prop; var aLength = 0; var bLength = 0; if (aString === "[object Array]" && a.length !== b.length) { return false; } for (prop in a) { if (Object.prototype.hasOwnProperty.call(a, prop)) { aLength += 1; if (!(prop in b)) { return false; } // allow alternative function for recursion if (!(arguments[2] || deepEqual)(a[prop], b[prop])) { return false; } } } for (prop in b) { if (Object.prototype.hasOwnProperty.call(b, prop)) { bLength += 1; } } return aLength === bLength; }; deepEqual.use = function (match) { return function deepEqual$matcher(a, b) { // If both are matchers they must be the same instance in order to be considered equal // If we didn't do that we would end up running one matcher against the other if (match.isMatcher(a)) { if (match.isMatcher(b)) { return a === b; } return a.test(b); } return deepEqual(a, b, deepEqual$matcher); }; }; },{}],24:[function(require,module,exports){ "use strict"; module.exports = { injectIntoThis: true, injectInto: null, properties: ["spy", "stub", "mock", "clock", "server", "requests"], useFakeTimers: true, useFakeServer: true }; },{}],25:[function(require,module,exports){ /*eslint no-console: 0 */ "use strict"; // wrap returns a function that will invoke the supplied function and print a deprecation warning to the console each // time it is called. exports.wrap = function (func, msg) { var wrapped = function () { exports.printWarning(msg); return func.apply(this, arguments); }; if (func.prototype) { wrapped.prototype = func.prototype; } return wrapped; }; // defaultMsg returns a string which can be supplied to `wrap()` to notify the user that a particular part of the // sinon API has been deprecated. exports.defaultMsg = function (funcName) { return "sinon." + funcName + " is deprecated and will be removed from the public API in a future version of sinon."; }; exports.printWarning = function (msg) { // Watch out for IE7 and below! :( if (typeof console !== "undefined") { if (console.info) { console.info(msg); } else { console.log(msg); } } }; },{}],26:[function(require,module,exports){ "use strict"; // This is an `every` implementation that works for all iterables module.exports = function every(obj, fn) { var pass = true; try { obj.forEach(function () { if (!fn.apply(this, arguments)) { // Throwing an error is the only way to break `forEach` throw new Error(); } }); } catch (e) { pass = false; } return pass; }; },{}],27:[function(require,module,exports){ "use strict"; // Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug var hasDontEnumBug = (function () { var obj = { constructor: function () { return "0"; }, toString: function () { return "1"; }, valueOf: function () { return "2"; }, toLocaleString: function () { return "3"; }, prototype: function () { return "4"; }, isPrototypeOf: function () { return "5"; }, propertyIsEnumerable: function () { return "6"; }, hasOwnProperty: function () { return "7"; }, length: function () { return "8"; }, unique: function () { return "9"; } }; var result = []; for (var prop in obj) { if (obj.hasOwnProperty(prop)) { result.push(obj[prop]()); } } return result.join("") !== "0123456789"; })(); /* Public: Extend target in place with all (own) properties from sources in-order. Thus, last source will * override properties in previous sources. * * target - The Object to extend * sources - Objects to copy properties from. * * Returns the extended target */ module.exports = function extend(target /*, sources */) { var sources = Array.prototype.slice.call(arguments, 1); var source, i, prop; for (i = 0; i < sources.length; i++) { source = sources[i]; for (prop in source) { if (source.hasOwnProperty(prop)) { target[prop] = source[prop]; } } // Make sure we copy (own) toString method even when in JScript with DontEnum bug // See https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug if (hasDontEnumBug && source.hasOwnProperty("toString") && source.toString !== target.toString) { target.toString = source.toString; } } return target; }; },{}],28:[function(require,module,exports){ "use strict"; var formatio = require("formatio"); var formatter = formatio.configure({ quoteStrings: false, limitChildrenCount: 250 }); module.exports = function format() { return formatter.ascii.apply(formatter, arguments); }; },{"formatio":49}],29:[function(require,module,exports){ "use strict"; module.exports = function functionName(func) { var name = func.displayName || func.name; var matches; // Use function decomposition as a last resort to get function // name. Does not rely on function decomposition to work - if it // doesn't debugging will be slightly less informative // (i.e. toString will say 'spy' rather than 'myFunc'). if (!name && (matches = func.toString().match(/function ([^\s\(]+)/))) { name = matches[1]; } return name; }; },{}],30:[function(require,module,exports){ "use strict"; module.exports = function toString() { var i, prop, thisValue; if (this.getCall && this.callCount) { i = this.callCount; while (i--) { thisValue = this.getCall(i).thisValue; for (prop in thisValue) { if (thisValue[prop] === this) { return prop; } } } } return this.displayName || "sinon fake"; }; },{}],31:[function(require,module,exports){ "use strict"; var defaultConfig = require("./default-config"); module.exports = function getConfig(custom) { var config = {}; var prop; custom = custom || {}; for (prop in defaultConfig) { if (defaultConfig.hasOwnProperty(prop)) { config[prop] = custom.hasOwnProperty(prop) ? custom[prop] : defaultConfig[prop]; } } return config; }; },{"./default-config":24}],32:[function(require,module,exports){ "use strict"; module.exports = function getPropertyDescriptor(object, property) { var proto = object; var descriptor; while (proto && !(descriptor = Object.getOwnPropertyDescriptor(proto, property))) { proto = Object.getPrototypeOf(proto); } return descriptor; }; },{}],33:[function(require,module,exports){ "use strict"; module.exports = { calledInOrder: require("./called-in-order"), configureLogError: require("./log_error"), defaultConfig: require("./default-config"), deepEqual: require("./deep-equal"), every: require("./every"), extend: require("./extend"), format: require("./format"), functionName: require("./function-name"), functionToString: require("./function-to-string"), getConfig: require("./get-config"), getPropertyDescriptor: require("./get-property-descriptor"), iterableToString: require("./iterable-to-string"), orderByFirstCall: require("./order-by-first-call"), restore: require("./restore"), timesInWords: require("./times-in-words"), typeOf: require("./typeOf"), walk: require("./walk"), wrapMethod: require("./wrap-method") }; },{"./called-in-order":22,"./deep-equal":23,"./default-config":24,"./every":26,"./extend":27,"./format":28,"./function-name":29,"./function-to-string":30,"./get-config":31,"./get-property-descriptor":32,"./iterable-to-string":34,"./log_error":35,"./order-by-first-call":36,"./restore":37,"./times-in-words":38,"./typeOf":39,"./walk":41,"./wrap-method":42}],34:[function(require,module,exports){ "use strict"; var typeOf = require("./typeOf"); module.exports = function iterableToString(obj) { var representation = ""; function stringify(item) { return typeof item === "string" ? "'" + item + "'" : String(item); } function mapToString(map) { map.forEach(function (value, key) { representation += "[" + stringify(key) + "," + stringify(value) + "],"; }); representation = representation.slice(0, -1); return representation; } function genericIterableToString(iterable) { iterable.forEach(function (value) { representation += stringify(value) + ","; }); representation = representation.slice(0, -1); return representation; } if (typeOf(obj) === "map") { return mapToString(obj); } return genericIterableToString(obj); }; },{"./typeOf":39}],35:[function(require,module,exports){ "use strict"; // cache a reference to setTimeout, so that our reference won't be stubbed out // when using fake timers and errors will still get logged // https://github.com/cjohansen/Sinon.JS/issues/381 var realSetTimeout = setTimeout; function configure(config) { config = config || {}; // Function which prints errors. if (!config.hasOwnProperty("logger")) { config.logger = function () { }; } // When set to true, any errors logged will be thrown immediately; // If set to false, the errors will be thrown in separate execution frame. if (!config.hasOwnProperty("useImmediateExceptions")) { config.useImmediateExceptions = true; } // wrap realSetTimeout with something we can stub in tests if (!config.hasOwnProperty("setTimeout")) { config.setTimeout = realSetTimeout; } return function logError(label, e) { var msg = label + " threw exception: "; var err = { name: e.name || label, message: e.message || e.toString(), stack: e.stack }; function throwLoggedError() { err.message = msg + err.message; throw err; } config.logger(msg + "[" + err.name + "] " + err.message); if (err.stack) { config.logger(err.stack); } if (config.useImmediateExceptions) { throwLoggedError(); } else { config.setTimeout(throwLoggedError, 0); } }; } module.exports = configure; },{}],36:[function(require,module,exports){ "use strict"; module.exports = function orderByFirstCall(spies) { return spies.sort(function (a, b) { // uuid, won't ever be equal var aCall = a.getCall(0); var bCall = b.getCall(0); var aId = aCall && aCall.callId || -1; var bId = bCall && bCall.callId || -1; return aId < bId ? -1 : 1; }); }; },{}],37:[function(require,module,exports){ "use strict"; var walk = require("./walk"); function isRestorable(obj) { return typeof obj === "function" && typeof obj.restore === "function" && obj.restore.sinon; } module.exports = function restore(object) { if (object !== null && typeof object === "object") { walk(object, function (prop) { if (isRestorable(object[prop])) { object[prop].restore(); } }); } else if (isRestorable(object)) { object.restore(); } }; },{"./walk":41}],38:[function(require,module,exports){ "use strict"; var array = [null, "once", "twice", "thrice"]; module.exports = function timesInWords(count) { return array[count] || (count || 0) + " times"; }; },{}],39:[function(require,module,exports){ "use strict"; var type = require("type-detect"); module.exports = function typeOf(value) { return type(value).toLowerCase(); }; },{"type-detect":58}],40:[function(require,module,exports){ "use strict"; module.exports = function (value) { if (value && value.toString) { return value.toString(); } return String(value); }; },{}],41:[function(require,module,exports){ "use strict"; function walkInternal(obj, iterator, context, originalObj, seen) { var proto, prop; if (typeof Object.getOwnPropertyNames !== "function") { // We explicitly want to enumerate through all of the prototype's properties // in this case, therefore we deliberately leave out an own property check. /* eslint-disable guard-for-in */ for (prop in obj) { iterator.call(context, obj[prop], prop, obj); } /* eslint-enable guard-for-in */ return; } Object.getOwnPropertyNames(obj).forEach(function (k) { if (seen[k] !== true) { seen[k] = true; var target = typeof Object.getOwnPropertyDescriptor(obj, k).get === "function" ? originalObj : obj; iterator.call(context, k, target); } }); proto = Object.getPrototypeOf(obj); if (proto) { walkInternal(proto, iterator, context, originalObj, seen); } } /* Walks the prototype chain of an object and iterates over every own property * name encountered. The iterator is called in the same fashion that Array.prototype.forEach * works, where it is passed the value, key, and own object as the 1st, 2nd, and 3rd positional * argument, respectively. In cases where Object.getOwnPropertyNames is not available, walk will * default to using a simple for..in loop. * * obj - The object to walk the prototype chain for. * iterator - The function to be called on each pass of the walk. * context - (Optional) When given, the iterator will be called with this object as the receiver. */ module.exports = function walk(obj, iterator, context) { return walkInternal(obj, iterator, context, obj, {}); }; },{}],42:[function(require,module,exports){ "use strict"; var getPropertyDescriptor = require("./get-property-descriptor"); var valueToString = require("./value-to-string"); var hasOwn = Object.prototype.hasOwnProperty; function isFunction(obj) { return typeof obj === "function" || !!(obj && obj.constructor && obj.call && obj.apply); } function mirrorProperties(target, source) { for (var prop in source) { if (!hasOwn.call(target, prop)) { target[prop] = source[prop]; } } } // Cheap way to detect if we have ES5 support. var hasES5Support = "keys" in Object; module.exports = function wrapMethod(object, property, method) { if (!object) { throw new TypeError("Should wrap property of object"); } if (typeof method !== "function" && typeof method !== "object") { throw new TypeError("Method wrapper should be a function or a property descriptor"); } function checkWrappedMethod(wrappedMethod) { var error; if (!isFunction(wrappedMethod)) { error = new TypeError("Attempted to wrap " + (typeof wrappedMethod) + " property " + valueToString(property) + " as function"); } else if (wrappedMethod.restore && wrappedMethod.restore.sinon) { error = new TypeError("Attempted to wrap " + valueToString(property) + " which is already wrapped"); } else if (wrappedMethod.calledBefore) { var verb = wrappedMethod.returns ? "stubbed" : "spied on"; error = new TypeError("Attempted to wrap " + valueToString(property) + " which is already " + verb); } if (error) { if (wrappedMethod && wrappedMethod.stackTrace) { error.stack += "\n--------------\n" + wrappedMethod.stackTrace; } throw error; } } var error, wrappedMethod, i; function simplePropertyAssignment() { wrappedMethod = object[property]; checkWrappedMethod(wrappedMethod); object[property] = method; method.displayName = property; } // Firefox has a problem when using hasOwn.call on objects from other frames. var owned = object.hasOwnProperty ? object.hasOwnProperty(property) : hasOwn.call(object, property); if (hasES5Support) { var methodDesc = (typeof method === "function") ? {value: method} : method; var wrappedMethodDesc = getPropertyDescriptor(object, property); if (!wrappedMethodDesc) { error = new TypeError("Attempted to wrap " + (typeof wrappedMethod) + " property " + property + " as function"); } else if (wrappedMethodDesc.restore && wrappedMethodDesc.restore.sinon) { error = new TypeError("Attempted to wrap " + property + " which is already wrapped"); } if (error) { if (wrappedMethodDesc && wrappedMethodDesc.stackTrace) { error.stack += "\n--------------\n" + wrappedMethodDesc.stackTrace; } throw error; } var types = Object.keys(methodDesc); for (i = 0; i < types.length; i++) { wrappedMethod = wrappedMethodDesc[types[i]]; checkWrappedMethod(wrappedMethod); } mirrorProperties(methodDesc, wrappedMethodDesc); for (i = 0; i < types.length; i++) { mirrorProperties(methodDesc[types[i]], wrappedMethodDesc[types[i]]); } Object.defineProperty(object, property, methodDesc); // catch failing assignment // this is the converse of the check in `.restore` below if ( typeof method === "function" && object[property] !== method ) { // correct any wrongdoings caused by the defineProperty call above, // such as adding new items (if object was a Storage object) delete object[property]; simplePropertyAssignment(); } } else { simplePropertyAssignment(); } method.displayName = property; // Set up a stack trace which can be used later to find what line of // code the original method was created on. method.stackTrace = (new Error("Stack Trace for original")).stack; method.restore = function () { // For prototype properties try to reset by delete first. // If this fails (ex: localStorage on mobile safari) then force a reset // via direct assignment. if (!owned) { // In some cases `delete` may throw an error try { delete object[property]; } catch (e) {} // eslint-disable-line no-empty // For native code functions `delete` fails without throwing an error // on Chrome < 43, PhantomJS, etc. } else if (hasES5Support) { Object.defineProperty(object, property, wrappedMethodDesc); } if (hasES5Support) { var descriptor = getPropertyDescriptor(object, property); if (descriptor && descriptor.value === method) { object[property] = wrappedMethod; } } else { // Use strict equality comparison to check failures then force a reset // via direct assignment. if (object[property] === method) { object[property] = wrappedMethod; } } }; method.wrappedMethod = wrappedMethod; method.restore.sinon = true; if (!hasES5Support) { mirrorProperties(method, wrappedMethod); } return method; }; },{"./get-property-descriptor":32,"./value-to-string":40}],43:[function(require,module,exports){ "use strict"; var push = [].push; function Event(type, bubbles, cancelable, target) { this.initEvent(type, bubbles, cancelable, target); } Event.prototype = { initEvent: function (type, bubbles, cancelable, target) { this.type = type; this.bubbles = bubbles; this.cancelable = cancelable; this.target = target; }, stopPropagation: function () {}, preventDefault: function () { this.defaultPrevented = true; } }; function ProgressEvent(type, progressEventRaw, target) { this.initEvent(type, false, false, target); this.loaded = typeof progressEventRaw.loaded === "number" ? progressEventRaw.loaded : null; this.total = typeof progressEventRaw.total === "number" ? progressEventRaw.total : null; this.lengthComputable = !!progressEventRaw.total; } ProgressEvent.prototype = new Event(); ProgressEvent.prototype.constructor = ProgressEvent; function CustomEvent(type, customData, target) { this.initEvent(type, false, false, target); this.detail = customData.detail || null; } CustomEvent.prototype = new Event(); CustomEvent.prototype.constructor = CustomEvent; var EventTarget = { addEventListener: function addEventListener(event, listener) { this.eventListeners = this.eventListeners || {}; this.eventListeners[event] = this.eventListeners[event] || []; push.call(this.eventListeners[event], listener); }, removeEventListener: function removeEventListener(event, listener) { var listeners = this.eventListeners && this.eventListeners[event] || []; var index = listeners.indexOf(listener); if (index === -1) { return; } listeners.splice(index, 1); }, dispatchEvent: function dispatchEvent(event) { var self = this; var type = event.type; var listeners = self.eventListeners && self.eventListeners[type] || []; listeners.forEach(function (listener) { if (typeof listener === "function") { listener.call(self, event); } else { listener.handleEvent(event); } }); return !!event.defaultPrevented; } }; module.exports = { Event: Event, ProgressEvent: ProgressEvent, CustomEvent: CustomEvent, EventTarget: EventTarget }; },{}],44:[function(require,module,exports){ "use strict"; var fakeXhr = require("./fake_xml_http_request"); var push = [].push; var format = require("./core/format"); var configureLogError = require("./core/log_error"); var pathToRegexp = require("path-to-regexp"); function responseArray(handler) { var response = handler; if (Object.prototype.toString.call(handler) !== "[object Array]") { response = [200, {}, handler]; } if (typeof response[2] !== "string") { throw new TypeError("Fake server response body should be string, but was " + typeof response[2]); } return response; } function getDefaultWindowLocation() { return { "host": "localhost", "protocol": "http" }; } function getWindowLocation() { if (typeof window === "undefined") { // Fallback return getDefaultWindowLocation(); } if (typeof window.location !== "undefined") { // Browsers place location on window return window.location; } if ((typeof window.window !== "undefined") && (typeof window.window.location !== "undefined")) { // React Native on Android places location on window.window return window.window.location; } return getDefaultWindowLocation(); } var wloc = getWindowLocation(); var rCurrLoc = new RegExp("^" + wloc.protocol + "//" + wloc.host); function matchOne(response, reqMethod, reqUrl) { var rmeth = response.method; var matchMethod = !rmeth || rmeth.toLowerCase() === reqMethod.toLowerCase(); var url = response.url; var matchUrl = !url || url === reqUrl || (typeof url.test === "function" && url.test(reqUrl)); return matchMethod && matchUrl; } function match(response, request) { var requestUrl = request.url; if (!/^https?:\/\//.test(requestUrl) || rCurrLoc.test(requestUrl)) { requestUrl = requestUrl.replace(rCurrLoc, ""); } if (matchOne(response, this.getHTTPMethod(request), requestUrl)) { if (typeof response.response === "function") { var ru = response.url; var args = [request].concat(ru && typeof ru.exec === "function" ? ru.exec(requestUrl).slice(1) : []); return response.response.apply(response, args); } return true; } return false; } function incrementRequestCount() { var count = ++this.requestCount; this.requested = true; this.requestedOnce = count === 1; this.requestedTwice = count === 2; this.requestedThrice = count === 3; this.firstRequest = this.getRequest(0); this.secondRequest = this.getRequest(1); this.thirdRequest = this.getRequest(2); this.lastRequest = this.getRequest(count - 1); } var fakeServer = { create: function (config) { var server = Object.create(this); server.configure(config); this.xhr = fakeXhr.useFakeXMLHttpRequest(); server.requests = []; server.requestCount = 0; server.queue = []; server.responses = []; this.xhr.onCreate = function (xhrObj) { xhrObj.unsafeHeadersEnabled = function () { return !(server.unsafeHeadersEnabled === false); }; server.addRequest(xhrObj); }; return server; }, configure: function (config) { var self = this; var whitelist = { "autoRespond": true, "autoRespondAfter": true, "respondImmediately": true, "fakeHTTPMethods": true, "logger": true, "unsafeHeadersEnabled": true }; config = config || {}; Object.keys(config).forEach(function (setting) { if (setting in whitelist) { self[setting] = config[setting]; } }); self.logError = configureLogError(config); }, addRequest: function addRequest(xhrObj) { var server = this; push.call(this.requests, xhrObj); incrementRequestCount.call(this); xhrObj.onSend = function () { server.handleRequest(this); if (server.respondImmediately) { server.respond(); } else if (server.autoRespond && !server.responding) { setTimeout(function () { server.responding = false; server.respond(); }, server.autoRespondAfter || 10); server.responding = true; } }; }, getHTTPMethod: function getHTTPMethod(request) { if (this.fakeHTTPMethods && /post/i.test(request.method)) { var matches = (request.requestBody || "").match(/_method=([^\b;]+)/); return matches ? matches[1] : request.method; } return request.method; }, handleRequest: function handleRequest(xhr) { if (xhr.async) { push.call(this.queue, xhr); } else { this.processRequest(xhr); } }, logger: function () { // no-op; override via configure() }, logError: configureLogError({}), log: function log(response, request) { var str; str = "Request:\n" + format(request) + "\n\n"; str += "Response:\n" + format(response) + "\n\n"; if (typeof this.logger === "function") { this.logger(str); } }, respondWith: function respondWith(method, url, body) { if (arguments.length === 1 && typeof method !== "function") { this.response = responseArray(method); return; } if (arguments.length === 1) { body = method; url = method = null; } if (arguments.length === 2) { body = url; url = method; method = null; } push.call(this.responses, { method: method, url: typeof url === "string" && url !== "" ? pathToRegexp(url) : url, response: typeof body === "function" ? body : responseArray(body) }); }, respond: function respond() { if (arguments.length > 0) { this.respondWith.apply(this, arguments); } var queue = this.queue || []; var requests = queue.splice(0, queue.length); var self = this; requests.forEach(function (request) { self.processRequest(request); }); }, processRequest: function processRequest(request) { try { if (request.aborted) { return; } var response = this.response || [404, {}, ""]; if (this.responses) { for (var l = this.responses.length, i = l - 1; i >= 0; i--) { if (match.call(this, this.responses[i], request)) { response = this.responses[i].response; break; } } } if (request.readyState !== 4) { this.log(response, request); request.respond(response[0], response[1], response[2]); } } catch (e) { this.logError("Fake server request processing", e); } }, restore: function restore() { return this.xhr.restore && this.xhr.restore.apply(this.xhr, arguments); }, getRequest: function getRequest(index) { return this.requests[index] || null; }, reset: function reset() { this.resetBehavior(); this.resetHistory(); }, resetBehavior: function resetBehavior() { this.responses.length = this.queue.length = 0; }, resetHistory: function resetHistory() { this.requests.length = this.requestCount = 0; this.requestedOnce = this.requestedTwice = this.requestedThrice = this.requested = false; this.firstRequest = this.secondRequest = this.thirdRequest = this.lastRequest = null; } }; module.exports = fakeServer; },{"./core/format":28,"./core/log_error":35,"./fake_xml_http_request":47,"path-to-regexp":52}],45:[function(require,module,exports){ "use strict"; var fakeServer = require("./fake_server"); var fakeTimers = require("./fake_timers"); function Server() {} Server.prototype = fakeServer; var fakeServerWithClock = new Server(); fakeServerWithClock.addRequest = function addRequest(xhr) { if (xhr.async) { if (typeof setTimeout.clock === "object") { this.clock = setTimeout.clock; } else { this.clock = fakeTimers.useFakeTimers(); this.resetClock = true; } if (!this.longestTimeout) { var clockSetTimeout = this.clock.setTimeout; var clockSetInterval = this.clock.setInterval; var server = this; this.clock.setTimeout = function (fn, timeout) { server.longestTimeout = Math.max(timeout, server.longestTimeout || 0); return clockSetTimeout.apply(this, arguments); }; this.clock.setInterval = function (fn, timeout) { server.longestTimeout = Math.max(timeout, server.longestTimeout || 0); return clockSetInterval.apply(this, arguments); }; } } return fakeServer.addRequest.call(this, xhr); }; fakeServerWithClock.respond = function respond() { var returnVal = fakeServer.respond.apply(this, arguments); if (this.clock) { this.clock.tick(this.longestTimeout || 0); this.longestTimeout = 0; if (this.resetClock) { this.clock.restore(); this.resetClock = false; } } return returnVal; }; fakeServerWithClock.restore = function restore() { if (this.clock) { this.clock.restore(); } return fakeServer.restore.apply(this, arguments); }; module.exports = fakeServerWithClock; },{"./fake_server":44,"./fake_timers":46}],46:[function(require,module,exports){ "use strict"; var llx = require("lolex"); exports.useFakeTimers = function () { var now; var methods = Array.prototype.slice.call(arguments); if (typeof methods[0] === "string") { now = 0; } else { now = methods.shift(); } var clock = llx.install(now || 0, methods); clock.restore = clock.uninstall; return clock; }; exports.clock = { create: function (now) { return llx.createClock(now); } }; exports.timers = { setTimeout: setTimeout, clearTimeout: clearTimeout, setImmediate: (typeof setImmediate !== "undefined" ? setImmediate : undefined), clearImmediate: (typeof clearImmediate !== "undefined" ? clearImmediate : undefined), setInterval: setInterval, clearInterval: clearInterval, Date: Date }; },{"lolex":51}],47:[function(require,module,exports){ (function (global){ "use strict"; var TextEncoder = require("text-encoding").TextEncoder; var configureLogError = require("./core/log_error"); var sinonEvent = require("./event"); var extend = require("./core/extend"); function getWorkingXHR(globalScope) { var supportsXHR = typeof globalScope.XMLHttpRequest !== "undefined"; if (supportsXHR) { return globalScope.XMLHttpRequest; } var supportsActiveX = typeof globalScope.ActiveXObject !== "undefined"; if (supportsActiveX) { return function () { return new globalScope.ActiveXObject("MSXML2.XMLHTTP.3.0"); }; } return false; } var supportsProgress = typeof ProgressEvent !== "undefined"; var supportsCustomEvent = typeof CustomEvent !== "undefined"; var supportsFormData = typeof FormData !== "undefined"; var supportsArrayBuffer = typeof ArrayBuffer !== "undefined"; var supportsBlob = require("../blob").isSupported; var isReactNative = global.navigator && global.navigator.product === "ReactNative"; var sinonXhr = { XMLHttpRequest: global.XMLHttpRequest }; sinonXhr.GlobalXMLHttpRequest = global.XMLHttpRequest; sinonXhr.GlobalActiveXObject = global.ActiveXObject; sinonXhr.supportsActiveX = typeof sinonXhr.GlobalActiveXObject !== "undefined"; sinonXhr.supportsXHR = typeof sinonXhr.GlobalXMLHttpRequest !== "undefined"; sinonXhr.workingXHR = getWorkingXHR(global); sinonXhr.supportsCORS = isReactNative || (sinonXhr.supportsXHR && "withCredentials" in (new sinonXhr.GlobalXMLHttpRequest())); var unsafeHeaders = { "Accept-Charset": true, "Accept-Encoding": true, "Connection": true, "Content-Length": true, "Cookie": true, "Cookie2": true, "Content-Transfer-Encoding": true, "Date": true, "Expect": true, "Host": true, "Keep-Alive": true, "Referer": true, "TE": true, "Trailer": true, "Transfer-Encoding": true, "Upgrade": true, "User-Agent": true, "Via": true }; function EventTargetHandler() { var self = this; var events = ["loadstart", "progress", "abort", "error", "load", "timeout", "loadend"]; function addEventListener(eventName) { self.addEventListener(eventName, function (event) { var listener = self["on" + eventName]; if (listener && typeof listener === "function") { listener.call(this, event); } }); } events.forEach(addEventListener); } EventTargetHandler.prototype = sinonEvent.EventTarget; // Note that for FakeXMLHttpRequest to work pre ES5 // we lose some of the alignment with the spec. // To ensure as close a match as possible, // set responseType before calling open, send or respond; function FakeXMLHttpRequest(config) { EventTargetHandler.call(this); this.readyState = FakeXMLHttpRequest.UNSENT; this.requestHeaders = {}; this.requestBody = null; this.status = 0; this.statusText = ""; this.upload = new EventTargetHandler(); this.responseType = ""; this.response = ""; this.logError = configureLogError(config); if (sinonXhr.supportsCORS) { this.withCredentials = false; } if (typeof FakeXMLHttpRequest.onCreate === "function") { FakeXMLHttpRequest.onCreate(this); } } function verifyState(xhr) { if (xhr.readyState !== FakeXMLHttpRequest.OPENED) { throw new Error("INVALID_STATE_ERR"); } if (xhr.sendFlag) { throw new Error("INVALID_STATE_ERR"); } } function getHeader(headers, header) { var foundHeader = Object.keys(headers).filter(function (h) { return h.toLowerCase() === header.toLowerCase(); }); return foundHeader[0] || null; } function excludeSetCookie2Header(header) { return !/^Set-Cookie2?$/i.test(header); } // largest arity in XHR is 5 - XHR#open var apply = function (obj, method, args) { switch (args.length) { case 0: return obj[method](); case 1: return obj[method](args[0]); case 2: return obj[method](args[0], args[1]); case 3: return obj[method](args[0], args[1], args[2]); case 4: return obj[method](args[0], args[1], args[2], args[3]); case 5: return obj[method](args[0], args[1], args[2], args[3], args[4]); default: throw new Error("Unhandled case"); } }; FakeXMLHttpRequest.filters = []; FakeXMLHttpRequest.addFilter = function addFilter(fn) { this.filters.push(fn); }; FakeXMLHttpRequest.defake = function defake(fakeXhr, xhrArgs) { var xhr = new sinonXhr.workingXHR(); // eslint-disable-line new-cap [ "open", "setRequestHeader", "send", "abort", "getResponseHeader", "getAllResponseHeaders", "addEventListener", "overrideMimeType", "removeEventListener" ].forEach(function (method) { fakeXhr[method] = function () { return apply(xhr, method, arguments); }; }); var copyAttrs = function (args) { args.forEach(function (attr) { fakeXhr[attr] = xhr[attr]; }); }; var stateChange = function stateChange() { fakeXhr.readyState = xhr.readyState; if (xhr.readyState >= FakeXMLHttpRequest.HEADERS_RECEIVED) { copyAttrs(["status", "statusText"]); } if (xhr.readyState >= FakeXMLHttpRequest.LOADING) { copyAttrs(["responseText", "response"]); } if (xhr.readyState === FakeXMLHttpRequest.DONE) { copyAttrs(["responseXML"]); } if (fakeXhr.onreadystatechange) { fakeXhr.onreadystatechange.call(fakeXhr, { target: fakeXhr }); } }; if (xhr.addEventListener) { Object.keys(fakeXhr.eventListeners).forEach(function (event) { /*eslint-disable no-loop-func*/ fakeXhr.eventListeners[event].forEach(function (handler) { xhr.addEventListener(event, handler); }); /*eslint-enable no-loop-func*/ }); xhr.addEventListener("readystatechange", stateChange); } else { xhr.onreadystatechange = stateChange; } apply(xhr, "open", xhrArgs); }; FakeXMLHttpRequest.useFilters = false; function verifyRequestOpened(xhr) { if (xhr.readyState !== FakeXMLHttpRequest.OPENED) { throw new Error("INVALID_STATE_ERR - " + xhr.readyState); } } function verifyRequestSent(xhr) { if (xhr.readyState === FakeXMLHttpRequest.DONE) { throw new Error("Request done"); } } function verifyHeadersReceived(xhr) { if (xhr.async && xhr.readyState !== FakeXMLHttpRequest.HEADERS_RECEIVED) { throw new Error("No headers received"); } } function verifyResponseBodyType(body) { if (typeof body !== "string") { var error = new Error("Attempted to respond to fake XMLHttpRequest with " + body + ", which is not a string."); error.name = "InvalidBodyException"; throw error; } } function convertToArrayBuffer(body, encoding) { return new TextEncoder(encoding || "utf-8").encode(body).buffer; } function isXmlContentType(contentType) { return !contentType || /(text\/xml)|(application\/xml)|(\+xml)/.test(contentType); } function convertResponseBody(responseType, contentType, body) { if (responseType === "" || responseType === "text") { return body; } else if (supportsArrayBuffer && responseType === "arraybuffer") { return convertToArrayBuffer(body); } else if (responseType === "json") { try { return JSON.parse(body); } catch (e) { // Return parsing failure as null return null; } } else if (supportsBlob && responseType === "blob") { var blobOptions = {}; if (contentType) { blobOptions.type = contentType; } return new Blob([convertToArrayBuffer(body)], blobOptions); } else if (responseType === "document") { if (isXmlContentType(contentType)) { return FakeXMLHttpRequest.parseXML(body); } return null; } throw new Error("Invalid responseType " + responseType); } function clearResponse(xhr) { if (xhr.responseType === "" || xhr.responseType === "text") { xhr.response = xhr.responseText = ""; } else { xhr.response = xhr.responseText = null; } xhr.responseXML = null; } FakeXMLHttpRequest.parseXML = function parseXML(text) { // Treat empty string as parsing failure if (text !== "") { try { if (typeof DOMParser !== "undefined") { var parser = new DOMParser(); return parser.parseFromString(text, "text/xml"); } var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = "false"; xmlDoc.loadXML(text); return xmlDoc; } catch (e) { // Unable to parse XML - no biggie } } return null; }; FakeXMLHttpRequest.statusCodes = { 100: "Continue", 101: "Switching Protocols", 200: "OK", 201: "Created", 202: "Accepted", 203: "Non-Authoritative Information", 204: "No Content", 205: "Reset Content", 206: "Partial Content", 207: "Multi-Status", 300: "Multiple Choice", 301: "Moved Permanently", 302: "Found", 303: "See Other", 304: "Not Modified", 305: "Use Proxy", 307: "Temporary Redirect", 400: "Bad Request", 401: "Unauthorized", 402: "Payment Required", 403: "Forbidden", 404: "Not Found", 405: "Method Not Allowed", 406: "Not Acceptable", 407: "Proxy Authentication Required", 408: "Request Timeout", 409: "Conflict", 410: "Gone", 411: "Length Required", 412: "Precondition Failed", 413: "Request Entity Too Large", 414: "Request-URI Too Long", 415: "Unsupported Media Type", 416: "Requested Range Not Satisfiable", 417: "Expectation Failed", 422: "Unprocessable Entity", 500: "Internal Server Error", 501: "Not Implemented", 502: "Bad Gateway", 503: "Service Unavailable", 504: "Gateway Timeout", 505: "HTTP Version Not Supported" }; extend(FakeXMLHttpRequest.prototype, sinonEvent.EventTarget, { async: true, open: function open(method, url, async, username, password) { this.method = method; this.url = url; this.async = typeof async === "boolean" ? async : true; this.username = username; this.password = password; clearResponse(this); this.requestHeaders = {}; this.sendFlag = false; if (FakeXMLHttpRequest.useFilters === true) { var xhrArgs = arguments; var defake = FakeXMLHttpRequest.filters.some(function (filter) { return filter.apply(this, xhrArgs); }); if (defake) { FakeXMLHttpRequest.defake(this, arguments); return; } } this.readyStateChange(FakeXMLHttpRequest.OPENED); }, readyStateChange: function readyStateChange(state) { this.readyState = state; var readyStateChangeEvent = new sinonEvent.Event("readystatechange", false, false, this); var event, progress; if (typeof this.onreadystatechange === "function") { try { this.onreadystatechange(readyStateChangeEvent); } catch (e) { this.logError("Fake XHR onreadystatechange handler", e); } } if (this.readyState === FakeXMLHttpRequest.DONE) { if (this.aborted || this.status === 0) { progress = {loaded: 0, total: 0}; event = this.aborted ? "abort" : "error"; } else { progress = {loaded: 100, total: 100}; event = "load"; } if (supportsProgress) { this.upload.dispatchEvent(new sinonEvent.ProgressEvent("progress", progress, this)); this.upload.dispatchEvent(new sinonEvent.ProgressEvent(event, progress, this)); this.upload.dispatchEvent(new sinonEvent.ProgressEvent("loadend", progress, this)); } this.dispatchEvent(new sinonEvent.ProgressEvent("progress", progress, this)); this.dispatchEvent(new sinonEvent.ProgressEvent(event, progress, this)); this.dispatchEvent(new sinonEvent.ProgressEvent("loadend", progress, this)); } this.dispatchEvent(readyStateChangeEvent); }, setRequestHeader: function setRequestHeader(header, value) { verifyState(this); var checkUnsafeHeaders = true; if (typeof this.unsafeHeadersEnabled === "function") { checkUnsafeHeaders = this.unsafeHeadersEnabled(); } if (checkUnsafeHeaders && (unsafeHeaders[header] || /^(Sec-|Proxy-)/.test(header))) { throw new Error("Refused to set unsafe header \"" + header + "\""); } if (this.requestHeaders[header]) { this.requestHeaders[header] += "," + value; } else { this.requestHeaders[header] = value; } }, setStatus: function setStatus(status) { var sanitizedStatus = typeof status === "number" ? status : 200; verifyRequestOpened(this); this.status = sanitizedStatus; this.statusText = FakeXMLHttpRequest.statusCodes[sanitizedStatus]; }, // Helps testing setResponseHeaders: function setResponseHeaders(headers) { verifyRequestOpened(this); var responseHeaders = this.responseHeaders = {}; Object.keys(headers).forEach(function (header) { responseHeaders[header] = headers[header]; }); if (this.async) { this.readyStateChange(FakeXMLHttpRequest.HEADERS_RECEIVED); } else { this.readyState = FakeXMLHttpRequest.HEADERS_RECEIVED; } }, // Currently treats ALL data as a DOMString (i.e. no Document) send: function send(data) { verifyState(this); if (!/^(head)$/i.test(this.method)) { var contentType = getHeader(this.requestHeaders, "Content-Type"); if (this.requestHeaders[contentType]) { var value = this.requestHeaders[contentType].split(";"); this.requestHeaders[contentType] = value[0] + ";charset=utf-8"; } else if (supportsFormData && !(data instanceof FormData)) { this.requestHeaders["Content-Type"] = "text/plain;charset=utf-8"; } this.requestBody = data; } this.errorFlag = false; this.sendFlag = this.async; clearResponse(this); this.readyStateChange(FakeXMLHttpRequest.OPENED); if (typeof this.onSend === "function") { this.onSend(this); } this.dispatchEvent(new sinonEvent.Event("loadstart", false, false, this)); }, abort: function abort() { this.aborted = true; clearResponse(this); this.errorFlag = true; this.requestHeaders = {}; this.responseHeaders = {}; if (this.readyState !== FakeXMLHttpRequest.UNSENT && this.sendFlag && this.readyState !== FakeXMLHttpRequest.DONE) { this.readyStateChange(FakeXMLHttpRequest.DONE); this.sendFlag = false; } this.readyState = FakeXMLHttpRequest.UNSENT; }, error: function () { clearResponse(this); this.errorFlag = true; this.requestHeaders = {}; this.responseHeaders = {}; this.readyStateChange(FakeXMLHttpRequest.DONE); }, getResponseHeader: function getResponseHeader(header) { if (this.readyState < FakeXMLHttpRequest.HEADERS_RECEIVED) { return null; } if (/^Set-Cookie2?$/i.test(header)) { return null; } header = getHeader(this.responseHeaders, header); return this.responseHeaders[header] || null; }, getAllResponseHeaders: function getAllResponseHeaders() { if (this.readyState < FakeXMLHttpRequest.HEADERS_RECEIVED) { return ""; } var responseHeaders = this.responseHeaders; var headers = Object.keys(responseHeaders) .filter(excludeSetCookie2Header) .reduce(function (prev, header) { var value = responseHeaders[header]; return prev + (header + ": " + value + "\r\n"); }, ""); return headers; }, setResponseBody: function setResponseBody(body) { verifyRequestSent(this); verifyHeadersReceived(this); verifyResponseBodyType(body); var contentType = this.overriddenMimeType || this.getResponseHeader("Content-Type"); var isTextResponse = this.responseType === "" || this.responseType === "text"; clearResponse(this); if (this.async) { var chunkSize = this.chunkSize || 10; var index = 0; do { this.readyStateChange(FakeXMLHttpRequest.LOADING); if (isTextResponse) { this.responseText = this.response += body.substring(index, index + chunkSize); } index += chunkSize; } while (index < body.length); } this.response = convertResponseBody(this.responseType, contentType, body); if (isTextResponse) { this.responseText = this.response; } if (this.responseType === "document") { this.responseXML = this.response; } else if (this.responseType === "" && isXmlContentType(contentType)) { this.responseXML = FakeXMLHttpRequest.parseXML(this.responseText); } this.readyStateChange(FakeXMLHttpRequest.DONE); }, respond: function respond(status, headers, body) { this.setStatus(status); this.setResponseHeaders(headers || {}); this.setResponseBody(body || ""); }, uploadProgress: function uploadProgress(progressEventRaw) { if (supportsProgress) { this.upload.dispatchEvent(new sinonEvent.ProgressEvent("progress", progressEventRaw)); } }, downloadProgress: function downloadProgress(progressEventRaw) { if (supportsProgress) { this.dispatchEvent(new sinonEvent.ProgressEvent("progress", progressEventRaw)); } }, uploadError: function uploadError(error) { if (supportsCustomEvent) { this.upload.dispatchEvent(new sinonEvent.CustomEvent("error", {detail: error})); } }, overrideMimeType: function overrideMimeType(type) { if (this.readyState >= FakeXMLHttpRequest.LOADING) { throw new Error("INVALID_STATE_ERR"); } this.overriddenMimeType = type; } }); var states = { UNSENT: 0, OPENED: 1, HEADERS_RECEIVED: 2, LOADING: 3, DONE: 4 }; extend(FakeXMLHttpRequest, states); extend(FakeXMLHttpRequest.prototype, states); function useFakeXMLHttpRequest() { FakeXMLHttpRequest.restore = function restore(keepOnCreate) { if (sinonXhr.supportsXHR) { global.XMLHttpRequest = sinonXhr.GlobalXMLHttpRequest; } if (sinonXhr.supportsActiveX) { global.ActiveXObject = sinonXhr.GlobalActiveXObject; } delete FakeXMLHttpRequest.restore; if (keepOnCreate !== true) { delete FakeXMLHttpRequest.onCreate; } }; if (sinonXhr.supportsXHR) { global.XMLHttpRequest = FakeXMLHttpRequest; } if (sinonXhr.supportsActiveX) { global.ActiveXObject = function ActiveXObject(objId) { if (objId === "Microsoft.XMLHTTP" || /^Msxml2\.XMLHTTP/i.test(objId)) { return new FakeXMLHttpRequest(); } return new sinonXhr.GlobalActiveXObject(objId); }; } return FakeXMLHttpRequest; } module.exports = { xhr: sinonXhr, FakeXMLHttpRequest: FakeXMLHttpRequest, useFakeXMLHttpRequest: useFakeXMLHttpRequest }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../blob":4,"./core/extend":27,"./core/log_error":35,"./event":43,"text-encoding":55}],48:[function(require,module,exports){ /*! diff v3.3.0 Software License Agreement (BSD License) Copyright (c) 2009-2015, Kevin Decker All rights reserved. Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Kevin Decker nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @license */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["JsDiff"] = factory(); else root["JsDiff"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.canonicalize = exports.convertChangesToXML = exports.convertChangesToDMP = exports.merge = exports.parsePatch = exports.applyPatches = exports.applyPatch = exports.createPatch = exports.createTwoFilesPatch = exports.structuredPatch = exports.diffArrays = exports.diffJson = exports.diffCss = exports.diffSentences = exports.diffTrimmedLines = exports.diffLines = exports.diffWordsWithSpace = exports.diffWords = exports.diffChars = exports.Diff = undefined; /*istanbul ignore end*/ var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/ var _base2 = _interopRequireDefault(_base); /*istanbul ignore end*/ var /*istanbul ignore start*/_character = __webpack_require__(2) /*istanbul ignore end*/; var /*istanbul ignore start*/_word = __webpack_require__(3) /*istanbul ignore end*/; var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/; var /*istanbul ignore start*/_sentence = __webpack_require__(6) /*istanbul ignore end*/; var /*istanbul ignore start*/_css = __webpack_require__(7) /*istanbul ignore end*/; var /*istanbul ignore start*/_json = __webpack_require__(8) /*istanbul ignore end*/; var /*istanbul ignore start*/_array = __webpack_require__(9) /*istanbul ignore end*/; var /*istanbul ignore start*/_apply = __webpack_require__(10) /*istanbul ignore end*/; var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/; var /*istanbul ignore start*/_merge = __webpack_require__(13) /*istanbul ignore end*/; var /*istanbul ignore start*/_create = __webpack_require__(14) /*istanbul ignore end*/; var /*istanbul ignore start*/_dmp = __webpack_require__(16) /*istanbul ignore end*/; var /*istanbul ignore start*/_xml = __webpack_require__(17) /*istanbul ignore end*/; /*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /* See LICENSE file for terms of use */ /* * Text diff implementation. * * This library supports the following APIS: * JsDiff.diffChars: Character by character diff * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace * JsDiff.diffLines: Line based diff * * JsDiff.diffCss: Diff targeted at CSS content * * These methods are based on the implementation proposed in * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 */ exports. /*istanbul ignore end*/Diff = _base2['default']; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffChars = _character.diffChars; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWords = _word.diffWords; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = _word.diffWordsWithSpace; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffLines = _line.diffLines; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = _line.diffTrimmedLines; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffSentences = _sentence.diffSentences; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffCss = _css.diffCss; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffJson = _json.diffJson; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffArrays = _array.diffArrays; /*istanbul ignore start*/exports. /*istanbul ignore end*/structuredPatch = _create.structuredPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = _create.createTwoFilesPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = _create.createPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatch = _apply.applyPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = _apply.applyPatches; /*istanbul ignore start*/exports. /*istanbul ignore end*/parsePatch = _parse.parsePatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = _merge.merge; /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToDMP = _dmp.convertChangesToDMP; /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToXML = _xml.convertChangesToXML; /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = _json.canonicalize; /***/ }, /* 1 */ /***/ function(module, exports) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports['default'] = /*istanbul ignore end*/Diff; function Diff() {} Diff.prototype = { /*istanbul ignore start*/ /*istanbul ignore end*/diff: function diff(oldString, newString) { /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; var callback = options.callback; if (typeof options === 'function') { callback = options; options = {}; } this.options = options; var self = this; function done(value) { if (callback) { setTimeout(function () { callback(undefined, value); }, 0); return true; } else { return value; } } // Allow subclasses to massage the input prior to running oldString = this.castInput(oldString); newString = this.castInput(newString); oldString = this.removeEmpty(this.tokenize(oldString)); newString = this.removeEmpty(this.tokenize(newString)); var newLen = newString.length, oldLen = oldString.length; var editLength = 1; var maxEditLength = newLen + oldLen; var bestPath = [{ newPos: -1, components: [] }]; // Seed editLength = 0, i.e. the content starts with the same values var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { // Identity per the equality and tokenizer return done([{ value: this.join(newString), count: newString.length }]); } // Main worker method. checks all permutations of a given edit length for acceptance. function execEditLength() { for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; if (addPath) { // No one else is going to attempt to use this value, clear it bestPath[diagonalPath - 1] = undefined; } var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; if (!canAdd && !canRemove) { // If this path is a terminal then prune bestPath[diagonalPath] = undefined; continue; } // Select the diagonal that we want to branch from. We select the prior // path whose position in the new string is the farthest from the origin // and does not pass the bounds of the diff graph if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { basePath = clonePath(removePath); self.pushComponent(basePath.components, undefined, true); } else { basePath = addPath; // No need to clone, we've pulled it from the list basePath.newPos++; self.pushComponent(basePath.components, true, undefined); } _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); } else { // Otherwise track this path as a potential candidate and continue. bestPath[diagonalPath] = basePath; } } editLength++; } // Performs the length of edit iteration. Is a bit fugly as this has to support the // sync and async mode which is never fun. Loops over execEditLength until a value // is produced. if (callback) { (function exec() { setTimeout(function () { // This should not happen, but we want to be safe. /* istanbul ignore next */ if (editLength > maxEditLength) { return callback(); } if (!execEditLength()) { exec(); } }, 0); })(); } else { while (editLength <= maxEditLength) { var ret = execEditLength(); if (ret) { return ret; } } } }, /*istanbul ignore start*/ /*istanbul ignore end*/pushComponent: function pushComponent(components, added, removed) { var last = components[components.length - 1]; if (last && last.added === added && last.removed === removed) { // We need to clone here as the component clone operation is just // as shallow array clone components[components.length - 1] = { count: last.count + 1, added: added, removed: removed }; } else { components.push({ count: 1, added: added, removed: removed }); } }, /*istanbul ignore start*/ /*istanbul ignore end*/extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0; while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { newPos++; oldPos++; commonCount++; } if (commonCount) { basePath.components.push({ count: commonCount }); } basePath.newPos = newPos; return oldPos; }, /*istanbul ignore start*/ /*istanbul ignore end*/equals: function equals(left, right) { return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); }, /*istanbul ignore start*/ /*istanbul ignore end*/removeEmpty: function removeEmpty(array) { var ret = []; for (var i = 0; i < array.length; i++) { if (array[i]) { ret.push(array[i]); } } return ret; }, /*istanbul ignore start*/ /*istanbul ignore end*/castInput: function castInput(value) { return value; }, /*istanbul ignore start*/ /*istanbul ignore end*/tokenize: function tokenize(value) { return value.split(''); }, /*istanbul ignore start*/ /*istanbul ignore end*/join: function join(chars) { return chars.join(''); } }; function buildValues(diff, components, newString, oldString, useLongestToken) { var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; for (; componentPos < componentLen; componentPos++) { var component = components[componentPos]; if (!component.removed) { if (!component.added && useLongestToken) { var value = newString.slice(newPos, newPos + component.count); value = value.map(function (value, i) { var oldValue = oldString[oldPos + i]; return oldValue.length > value.length ? oldValue : value; }); component.value = diff.join(value); } else { component.value = diff.join(newString.slice(newPos, newPos + component.count)); } newPos += component.count; // Common case if (!component.added) { oldPos += component.count; } } else { component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); oldPos += component.count; // Reverse add and remove so removes are output first to match common convention // The diffing algorithm is tied to add then remove output and this is the simplest // route to get the desired output with minimal overhead. if (componentPos && components[componentPos - 1].added) { var tmp = components[componentPos - 1]; components[componentPos - 1] = components[componentPos]; components[componentPos] = tmp; } } } // Special case handle for when one terminal is ignored. For this case we merge the // terminal into the prior string and drop the change. var lastComponent = components[componentLen - 1]; if (componentLen > 1 && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { components[componentLen - 2].value += lastComponent.value; components.pop(); } return components; } function clonePath(path) { return { newPos: path.newPos, components: path.components.slice(0) }; } /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.characterDiff = undefined; exports. /*istanbul ignore end*/diffChars = diffChars; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/ var _base2 = _interopRequireDefault(_base); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/var characterDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/characterDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/; function diffChars(oldStr, newStr, options) { return characterDiff.diff(oldStr, newStr, options); } /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.wordDiff = undefined; exports. /*istanbul ignore end*/diffWords = diffWords; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = diffWordsWithSpace; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/ var _base2 = _interopRequireDefault(_base); /*istanbul ignore end*/ var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/; /*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/ // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode // // Ranges and exceptions: // Latin-1 Supplement, 0080–00FF // - U+00D7 × Multiplication sign // - U+00F7 ÷ Division sign // Latin Extended-A, 0100–017F // Latin Extended-B, 0180–024F // IPA Extensions, 0250–02AF // Spacing Modifier Letters, 02B0–02FF // - U+02C7 ˇ ˇ Caron // - U+02D8 ˘ ˘ Breve // - U+02D9 ˙ ˙ Dot Above // - U+02DA ˚ ˚ Ring Above // - U+02DB ˛ ˛ Ogonek // - U+02DC ˜ ˜ Small Tilde // - U+02DD ˝ ˝ Double Acute Accent // Latin Extended Additional, 1E00–1EFF var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; var reWhitespace = /\S/; var wordDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/wordDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/; wordDiff.equals = function (left, right) { if (this.options.ignoreCase) { left = left.toLowerCase(); right = right.toLowerCase(); } return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); }; wordDiff.tokenize = function (value) { var tokens = value.split(/(\s+|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set. for (var i = 0; i < tokens.length - 1; i++) { // If we have an empty string in the next field and we have only word chars before and after, merge if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { tokens[i] += tokens[i + 2]; tokens.splice(i + 1, 2); i--; } } return tokens; }; function diffWords(oldStr, newStr, options) { options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(options, { ignoreWhitespace: true }); return wordDiff.diff(oldStr, newStr, options); } function diffWordsWithSpace(oldStr, newStr, options) { return wordDiff.diff(oldStr, newStr, options); } /***/ }, /* 4 */ /***/ function(module, exports) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports. /*istanbul ignore end*/generateOptions = generateOptions; function generateOptions(options, defaults) { if (typeof options === 'function') { defaults.callback = options; } else if (options) { for (var name in options) { /* istanbul ignore else */ if (options.hasOwnProperty(name)) { defaults[name] = options[name]; } } } return defaults; } /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.lineDiff = undefined; exports. /*istanbul ignore end*/diffLines = diffLines; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = diffTrimmedLines; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/ var _base2 = _interopRequireDefault(_base); /*istanbul ignore end*/ var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/; /*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/var lineDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/lineDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/; lineDiff.tokenize = function (value) { var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line if (!linesAndNewlines[linesAndNewlines.length - 1]) { linesAndNewlines.pop(); } // Merge the content and line separators into single tokens for (var i = 0; i < linesAndNewlines.length; i++) { var line = linesAndNewlines[i]; if (i % 2 && !this.options.newlineIsToken) { retLines[retLines.length - 1] += line; } else { if (this.options.ignoreWhitespace) { line = line.trim(); } retLines.push(line); } } return retLines; }; function diffLines(oldStr, newStr, callback) { return lineDiff.diff(oldStr, newStr, callback); } function diffTrimmedLines(oldStr, newStr, callback) { var options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(callback, { ignoreWhitespace: true }); return lineDiff.diff(oldStr, newStr, options); } /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.sentenceDiff = undefined; exports. /*istanbul ignore end*/diffSentences = diffSentences; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/ var _base2 = _interopRequireDefault(_base); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/var sentenceDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/sentenceDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/; sentenceDiff.tokenize = function (value) { return value.split(/(\S.+?[.!?])(?=\s+|$)/); }; function diffSentences(oldStr, newStr, callback) { return sentenceDiff.diff(oldStr, newStr, callback); } /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.cssDiff = undefined; exports. /*istanbul ignore end*/diffCss = diffCss; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/ var _base2 = _interopRequireDefault(_base); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/var cssDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/cssDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/; cssDiff.tokenize = function (value) { return value.split(/([{}:;,]|\s+)/); }; function diffCss(oldStr, newStr, callback) { return cssDiff.diff(oldStr, newStr, callback); } /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.jsonDiff = undefined; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; exports. /*istanbul ignore end*/diffJson = diffJson; /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = canonicalize; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/ var _base2 = _interopRequireDefault(_base); /*istanbul ignore end*/ var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/; /*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/ var objectPrototypeToString = Object.prototype.toString; var jsonDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/jsonDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/; // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: jsonDiff.useLongestToken = true; jsonDiff.tokenize = /*istanbul ignore start*/_line.lineDiff. /*istanbul ignore end*/tokenize; jsonDiff.castInput = function (value) { /*istanbul ignore start*/var /*istanbul ignore end*/undefinedReplacement = this.options.undefinedReplacement; return typeof value === 'string' ? value : JSON.stringify(canonicalize(value), function (k, v) { if (typeof v === 'undefined') { return undefinedReplacement; } return v; }, ' '); }; jsonDiff.equals = function (left, right) { return (/*istanbul ignore start*/_base2['default']. /*istanbul ignore end*/prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1')) ); }; function diffJson(oldObj, newObj, options) { return jsonDiff.diff(oldObj, newObj, options); } // This function handles the presence of circular references by bailing out when encountering an // object that is already on the "stack" of items being processed. function canonicalize(obj, stack, replacementStack) { stack = stack || []; replacementStack = replacementStack || []; var i = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; for (i = 0; i < stack.length; i += 1) { if (stack[i] === obj) { return replacementStack[i]; } } var canonicalizedObj = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; if ('[object Array]' === objectPrototypeToString.call(obj)) { stack.push(obj); canonicalizedObj = new Array(obj.length); replacementStack.push(canonicalizedObj); for (i = 0; i < obj.length; i += 1) { canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack); } stack.pop(); replacementStack.pop(); return canonicalizedObj; } if (obj && obj.toJSON) { obj = obj.toJSON(); } if ( /*istanbul ignore start*/(typeof /*istanbul ignore end*/obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null) { stack.push(obj); canonicalizedObj = {}; replacementStack.push(canonicalizedObj); var sortedKeys = [], key = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; for (key in obj) { /* istanbul ignore else */ if (obj.hasOwnProperty(key)) { sortedKeys.push(key); } } sortedKeys.sort(); for (i = 0; i < sortedKeys.length; i += 1) { key = sortedKeys[i]; canonicalizedObj[key] = canonicalize(obj[key], stack, replacementStack); } stack.pop(); replacementStack.pop(); } else { canonicalizedObj = obj; } return canonicalizedObj; } /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.arrayDiff = undefined; exports. /*istanbul ignore end*/diffArrays = diffArrays; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/ var _base2 = _interopRequireDefault(_base); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/var arrayDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/; arrayDiff.tokenize = arrayDiff.join = function (value) { return value.slice(); }; function diffArrays(oldArr, newArr, callback) { return arrayDiff.diff(oldArr, newArr, callback); } /***/ }, /* 10 */ /***/ function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports. /*istanbul ignore end*/applyPatch = applyPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = applyPatches; var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/; var /*istanbul ignore start*/_distanceIterator = __webpack_require__(12) /*istanbul ignore end*/; /*istanbul ignore start*/ var _distanceIterator2 = _interopRequireDefault(_distanceIterator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/function applyPatch(source, uniDiff) { /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; if (typeof uniDiff === 'string') { uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff); } if (Array.isArray(uniDiff)) { if (uniDiff.length > 1) { throw new Error('applyPatch only works with a single input.'); } uniDiff = uniDiff[0]; } // Apply the diff to the input var lines = source.split(/\r\n|[\n\v\f\r\x85]/), delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], hunks = uniDiff.hunks, compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) /*istanbul ignore start*/{ return (/*istanbul ignore end*/line === patchContent ); }, errorCount = 0, fuzzFactor = options.fuzzFactor || 0, minLine = 0, offset = 0, removeEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/, addEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; /** * Checks if the hunk exactly fits on the provided location */ function hunkFits(hunk, toPos) { for (var j = 0; j < hunk.lines.length; j++) { var line = hunk.lines[j], operation = line[0], content = line.substr(1); if (operation === ' ' || operation === '-') { // Context sanity check if (!compareLine(toPos + 1, lines[toPos], operation, content)) { errorCount++; if (errorCount > fuzzFactor) { return false; } } toPos++; } } return true; } // Search best fit offsets for each hunk based on the previous ones for (var i = 0; i < hunks.length; i++) { var hunk = hunks[i], maxLine = lines.length - hunk.oldLines, localOffset = 0, toPos = offset + hunk.oldStart - 1; var iterator = /*istanbul ignore start*/(0, _distanceIterator2['default']) /*istanbul ignore end*/(toPos, minLine, maxLine); for (; localOffset !== undefined; localOffset = iterator()) { if (hunkFits(hunk, toPos + localOffset)) { hunk.offset = offset += localOffset; break; } } if (localOffset === undefined) { return false; } // Set lower text limit to end of the current hunk, so next ones don't try // to fit over already patched text minLine = hunk.offset + hunk.oldStart + hunk.oldLines; } // Apply patch hunks var diffOffset = 0; for (var _i = 0; _i < hunks.length; _i++) { var _hunk = hunks[_i], _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1; diffOffset += _hunk.newLines - _hunk.oldLines; for (var j = 0; j < _hunk.lines.length; j++) { var line = _hunk.lines[j], operation = line[0], content = line.substr(1), delimiter = _hunk.linedelimiters[j]; if (operation === ' ') { _toPos++; } else if (operation === '-') { lines.splice(_toPos, 1); delimiters.splice(_toPos, 1); /* istanbul ignore else */ } else if (operation === '+') { lines.splice(_toPos, 0, content); delimiters.splice(_toPos, 0, delimiter); _toPos++; } else if (operation === '\\') { var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null; if (previousOperation === '+') { removeEOFNL = true; } else if (previousOperation === '-') { addEOFNL = true; } } } } // Handle EOFNL insertion/removal if (removeEOFNL) { while (!lines[lines.length - 1]) { lines.pop(); delimiters.pop(); } } else if (addEOFNL) { lines.push(''); delimiters.push('\n'); } for (var _k = 0; _k < lines.length - 1; _k++) { lines[_k] = lines[_k] + delimiters[_k]; } return lines.join(''); } // Wrapper that supports multiple file patches via callbacks. function applyPatches(uniDiff, options) { if (typeof uniDiff === 'string') { uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff); } var currentIndex = 0; function processIndex() { var index = uniDiff[currentIndex++]; if (!index) { return options.complete(); } options.loadFile(index, function (err, data) { if (err) { return options.complete(err); } var updatedContent = applyPatch(data, index, options); options.patched(index, updatedContent, function (err) { if (err) { return options.complete(err); } processIndex(); }); }); } processIndex(); } /***/ }, /* 11 */ /***/ function(module, exports) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports. /*istanbul ignore end*/parsePatch = parsePatch; function parsePatch(uniDiff) { /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], list = [], i = 0; function parseIndex() { var index = {}; list.push(index); // Parse diff metadata while (i < diffstr.length) { var line = diffstr[i]; // File header found, end parsing diff metadata if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { break; } // Diff index var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); if (header) { index.index = header[1]; } i++; } // Parse file headers if they are defined. Unified diff requires them, but // there's no technical issues to have an isolated hunk without file header parseFileHeader(index); parseFileHeader(index); // Parse hunks index.hunks = []; while (i < diffstr.length) { var _line = diffstr[i]; if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { break; } else if (/^@@/.test(_line)) { index.hunks.push(parseHunk()); } else if (_line && options.strict) { // Ignore unexpected content unless in strict mode throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); } else { i++; } } } // Parses the --- and +++ headers, if none are found, no lines // are consumed. function parseFileHeader(index) { var headerPattern = /^(---|\+\+\+)\s+([\S ]*)(?:\t(.*?)\s*)?$/; var fileHeader = headerPattern.exec(diffstr[i]); if (fileHeader) { var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; var fileName = fileHeader[2].replace(/\\\\/g, '\\'); if (/^".*"$/.test(fileName)) { fileName = fileName.substr(1, fileName.length - 2); } index[keyPrefix + 'FileName'] = fileName; index[keyPrefix + 'Header'] = fileHeader[3]; i++; } } // Parses a hunk // This assumes that we are at the start of a hunk. function parseHunk() { var chunkHeaderIndex = i, chunkHeaderLine = diffstr[i++], chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); var hunk = { oldStart: +chunkHeader[1], oldLines: +chunkHeader[2] || 1, newStart: +chunkHeader[3], newLines: +chunkHeader[4] || 1, lines: [], linedelimiters: [] }; var addCount = 0, removeCount = 0; for (; i < diffstr.length; i++) { // Lines starting with '---' could be mistaken for the "remove line" operation // But they could be the header for the next file. Therefore prune such cases out. if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) { break; } var operation = diffstr[i][0]; if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { hunk.lines.push(diffstr[i]); hunk.linedelimiters.push(delimiters[i] || '\n'); if (operation === '+') { addCount++; } else if (operation === '-') { removeCount++; } else if (operation === ' ') { addCount++; removeCount++; } } else { break; } } // Handle the empty block count case if (!addCount && hunk.newLines === 1) { hunk.newLines = 0; } if (!removeCount && hunk.oldLines === 1) { hunk.oldLines = 0; } // Perform optional sanity checking if (options.strict) { if (addCount !== hunk.newLines) { throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); } if (removeCount !== hunk.oldLines) { throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); } } return hunk; } while (i < diffstr.length) { parseIndex(); } return list; } /***/ }, /* 12 */ /***/ function(module, exports) { /*istanbul ignore start*/"use strict"; exports.__esModule = true; exports["default"] = /*istanbul ignore end*/function (start, minLine, maxLine) { var wantForward = true, backwardExhausted = false, forwardExhausted = false, localOffset = 1; return function iterator() { if (wantForward && !forwardExhausted) { if (backwardExhausted) { localOffset++; } else { wantForward = false; } // Check if trying to fit beyond text length, and if not, check it fits // after offset location (or desired location on first iteration) if (start + localOffset <= maxLine) { return localOffset; } forwardExhausted = true; } if (!backwardExhausted) { if (!forwardExhausted) { wantForward = true; } // Check if trying to fit before text beginning, and if not, check it fits // before offset location if (minLine <= start - localOffset) { return -localOffset++; } backwardExhausted = true; return iterator(); } // We tried to fit hunk before text beginning and beyond text lenght, then // hunk can't fit on the text. Return undefined }; }; /***/ }, /* 13 */ /***/ function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports. /*istanbul ignore end*/calcLineCount = calcLineCount; /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = merge; var /*istanbul ignore start*/_create = __webpack_require__(14) /*istanbul ignore end*/; var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/; var /*istanbul ignore start*/_array = __webpack_require__(15) /*istanbul ignore end*/; /*istanbul ignore start*/ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } /*istanbul ignore end*/function calcLineCount(hunk) { var conflicted = false; hunk.oldLines = 0; hunk.newLines = 0; hunk.lines.forEach(function (line) { if (typeof line !== 'string') { conflicted = true; return; } if (line[0] === '+' || line[0] === ' ') { hunk.newLines++; } if (line[0] === '-' || line[0] === ' ') { hunk.oldLines++; } }); if (conflicted) { delete hunk.oldLines; delete hunk.newLines; } } function merge(mine, theirs, base) { mine = loadPatch(mine, base); theirs = loadPatch(theirs, base); var ret = {}; // For index we just let it pass through as it doesn't have any necessary meaning. // Leaving sanity checks on this to the API consumer that may know more about the // meaning in their own context. if (mine.index || theirs.index) { ret.index = mine.index || theirs.index; } if (mine.newFileName || theirs.newFileName) { if (!fileNameChanged(mine)) { // No header or no change in ours, use theirs (and ours if theirs does not exist) ret.oldFileName = theirs.oldFileName || mine.oldFileName; ret.newFileName = theirs.newFileName || mine.newFileName; ret.oldHeader = theirs.oldHeader || mine.oldHeader; ret.newHeader = theirs.newHeader || mine.newHeader; } else if (!fileNameChanged(theirs)) { // No header or no change in theirs, use ours ret.oldFileName = mine.oldFileName; ret.newFileName = mine.newFileName; ret.oldHeader = mine.oldHeader; ret.newHeader = mine.newHeader; } else { // Both changed... figure it out ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); } } ret.hunks = []; var mineIndex = 0, theirsIndex = 0, mineOffset = 0, theirsOffset = 0; while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { var mineCurrent = mine.hunks[mineIndex] || { oldStart: Infinity }, theirsCurrent = theirs.hunks[theirsIndex] || { oldStart: Infinity }; if (hunkBefore(mineCurrent, theirsCurrent)) { // This patch does not overlap with any of the others, yay. ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); mineIndex++; theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; } else if (hunkBefore(theirsCurrent, mineCurrent)) { // This patch does not overlap with any of the others, yay. ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); theirsIndex++; mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; } else { // Overlap, merge as best we can var mergedHunk = { oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), oldLines: 0, newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), newLines: 0, lines: [] }; mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); theirsIndex++; mineIndex++; ret.hunks.push(mergedHunk); } } return ret; } function loadPatch(param, base) { if (typeof param === 'string') { if (/^@@/m.test(param) || /^Index:/m.test(param)) { return (/*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(param)[0] ); } if (!base) { throw new Error('Must provide a base reference or pass in a patch'); } return (/*istanbul ignore start*/(0, _create.structuredPatch) /*istanbul ignore end*/(undefined, undefined, base, param) ); } return param; } function fileNameChanged(patch) { return patch.newFileName && patch.newFileName !== patch.oldFileName; } function selectField(index, mine, theirs) { if (mine === theirs) { return mine; } else { index.conflict = true; return { mine: mine, theirs: theirs }; } } function hunkBefore(test, check) { return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; } function cloneHunk(hunk, offset) { return { oldStart: hunk.oldStart, oldLines: hunk.oldLines, newStart: hunk.newStart + offset, newLines: hunk.newLines, lines: hunk.lines }; } function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { // This will generally result in a conflicted hunk, but there are cases where the context // is the only overlap where we can successfully merge the content here. var mine = { offset: mineOffset, lines: mineLines, index: 0 }, their = { offset: theirOffset, lines: theirLines, index: 0 }; // Handle any leading content insertLeading(hunk, mine, their); insertLeading(hunk, their, mine); // Now in the overlap content. Scan through and select the best changes from each. while (mine.index < mine.lines.length && their.index < their.lines.length) { var mineCurrent = mine.lines[mine.index], theirCurrent = their.lines[their.index]; if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) { // Both modified ... mutualChange(hunk, mine, their); } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') { /*istanbul ignore start*/ var _hunk$lines; /*istanbul ignore end*/ // Mine inserted /*istanbul ignore start*/(_hunk$lines = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(mine))); } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') { /*istanbul ignore start*/ var _hunk$lines2; /*istanbul ignore end*/ // Theirs inserted /*istanbul ignore start*/(_hunk$lines2 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(their))); } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') { // Mine removed or edited removal(hunk, mine, their); } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') { // Their removed or edited removal(hunk, their, mine, true); } else if (mineCurrent === theirCurrent) { // Context identity hunk.lines.push(mineCurrent); mine.index++; their.index++; } else { // Context mismatch conflict(hunk, collectChange(mine), collectChange(their)); } } // Now push anything that may be remaining insertTrailing(hunk, mine); insertTrailing(hunk, their); calcLineCount(hunk); } function mutualChange(hunk, mine, their) { var myChanges = collectChange(mine), theirChanges = collectChange(their); if (allRemoves(myChanges) && allRemoves(theirChanges)) { // Special case for remove changes that are supersets of one another if ( /*istanbul ignore start*/(0, _array.arrayStartsWith) /*istanbul ignore end*/(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { /*istanbul ignore start*/ var _hunk$lines3; /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines3 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges)); return; } else if ( /*istanbul ignore start*/(0, _array.arrayStartsWith) /*istanbul ignore end*/(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { /*istanbul ignore start*/ var _hunk$lines4; /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines4 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines4 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges)); return; } } else if ( /*istanbul ignore start*/(0, _array.arrayEqual) /*istanbul ignore end*/(myChanges, theirChanges)) { /*istanbul ignore start*/ var _hunk$lines5; /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines5 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines5 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges)); return; } conflict(hunk, myChanges, theirChanges); } function removal(hunk, mine, their, swap) { var myChanges = collectChange(mine), theirChanges = collectContext(their, myChanges); if (theirChanges.merged) { /*istanbul ignore start*/ var _hunk$lines6; /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines6 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines6 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges.merged)); } else { conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); } } function conflict(hunk, mine, their) { hunk.conflict = true; hunk.lines.push({ conflict: true, mine: mine, theirs: their }); } function insertLeading(hunk, insert, their) { while (insert.offset < their.offset && insert.index < insert.lines.length) { var line = insert.lines[insert.index++]; hunk.lines.push(line); insert.offset++; } } function insertTrailing(hunk, insert) { while (insert.index < insert.lines.length) { var line = insert.lines[insert.index++]; hunk.lines.push(line); } } function collectChange(state) { var ret = [], operation = state.lines[state.index][0]; while (state.index < state.lines.length) { var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one "atomic" modify change. if (operation === '-' && line[0] === '+') { operation = '+'; } if (operation === line[0]) { ret.push(line); state.index++; } else { break; } } return ret; } function collectContext(state, matchChanges) { var changes = [], merged = [], matchIndex = 0, contextChanges = false, conflicted = false; while (matchIndex < matchChanges.length && state.index < state.lines.length) { var change = state.lines[state.index], match = matchChanges[matchIndex]; // Once we've hit our add, then we are done if (match[0] === '+') { break; } contextChanges = contextChanges || change[0] !== ' '; merged.push(match); matchIndex++; // Consume any additions in the other block as a conflict to attempt // to pull in the remaining context after this if (change[0] === '+') { conflicted = true; while (change[0] === '+') { changes.push(change); change = state.lines[++state.index]; } } if (match.substr(1) === change.substr(1)) { changes.push(change); state.index++; } else { conflicted = true; } } if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) { conflicted = true; } if (conflicted) { return changes; } while (matchIndex < matchChanges.length) { merged.push(matchChanges[matchIndex++]); } return { merged: merged, changes: changes }; } function allRemoves(changes) { return changes.reduce(function (prev, change) { return prev && change[0] === '-'; }, true); } function skipRemoveSuperset(state, removeChanges, delta) { for (var i = 0; i < delta; i++) { var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); if (state.lines[state.index + i] !== ' ' + changeContent) { return false; } } state.index += delta; return true; } /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports. /*istanbul ignore end*/structuredPatch = structuredPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = createTwoFilesPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = createPatch; var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/; /*istanbul ignore start*/ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } /*istanbul ignore end*/function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { if (!options) { options = {}; } if (typeof options.context === 'undefined') { options.context = 4; } var diff = /*istanbul ignore start*/(0, _line.diffLines) /*istanbul ignore end*/(oldStr, newStr, options); diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier function contextLines(lines) { return lines.map(function (entry) { return ' ' + entry; }); } var hunks = []; var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; /*istanbul ignore start*/ var _loop = function _loop( /*istanbul ignore end*/i) { var current = diff[i], lines = current.lines || current.value.replace(/\n$/, '').split('\n'); current.lines = lines; if (current.added || current.removed) { /*istanbul ignore start*/ var _curRange; /*istanbul ignore end*/ // If we have previous context, start with that if (!oldRangeStart) { var prev = diff[i - 1]; oldRangeStart = oldLine; newRangeStart = newLine; if (prev) { curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; oldRangeStart -= curRange.length; newRangeStart -= curRange.length; } } // Output our changes /*istanbul ignore start*/(_curRange = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/lines.map(function (entry) { return (current.added ? '+' : '-') + entry; }))); // Track the updated file position if (current.added) { newLine += lines.length; } else { oldLine += lines.length; } } else { // Identical context lines. Track line changes if (oldRangeStart) { // Close out any changes that have been output (or join overlapping) if (lines.length <= options.context * 2 && i < diff.length - 2) { /*istanbul ignore start*/ var _curRange2; /*istanbul ignore end*/ // Overlapping /*istanbul ignore start*/(_curRange2 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines))); } else { /*istanbul ignore start*/ var _curRange3; /*istanbul ignore end*/ // end the range and output var contextSize = Math.min(lines.length, options.context); /*istanbul ignore start*/(_curRange3 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines.slice(0, contextSize)))); var hunk = { oldStart: oldRangeStart, oldLines: oldLine - oldRangeStart + contextSize, newStart: newRangeStart, newLines: newLine - newRangeStart + contextSize, lines: curRange }; if (i >= diff.length - 2 && lines.length <= options.context) { // EOF is inside this hunk var oldEOFNewline = /\n$/.test(oldStr); var newEOFNewline = /\n$/.test(newStr); if (lines.length == 0 && !oldEOFNewline) { // special case: old has no eol and no trailing context; no-nl can end up before adds curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file'); } else if (!oldEOFNewline || !newEOFNewline) { curRange.push('\\ No newline at end of file'); } } hunks.push(hunk); oldRangeStart = 0; newRangeStart = 0; curRange = []; } } oldLine += lines.length; newLine += lines.length; } }; for (var i = 0; i < diff.length; i++) { /*istanbul ignore start*/ _loop( /*istanbul ignore end*/i); } return { oldFileName: oldFileName, newFileName: newFileName, oldHeader: oldHeader, newHeader: newHeader, hunks: hunks }; } function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); var ret = []; if (oldFileName == newFileName) { ret.push('Index: ' + oldFileName); } ret.push('==================================================================='); ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); for (var i = 0; i < diff.hunks.length; i++) { var hunk = diff.hunks[i]; ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); ret.push.apply(ret, hunk.lines); } return ret.join('\n') + '\n'; } function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); } /***/ }, /* 15 */ /***/ function(module, exports) { /*istanbul ignore start*/"use strict"; exports.__esModule = true; exports. /*istanbul ignore end*/arrayEqual = arrayEqual; /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayStartsWith = arrayStartsWith; function arrayEqual(a, b) { if (a.length !== b.length) { return false; } return arrayStartsWith(a, b); } function arrayStartsWith(array, start) { if (start.length > array.length) { return false; } for (var i = 0; i < start.length; i++) { if (start[i] !== array[i]) { return false; } } return true; } /***/ }, /* 16 */ /***/ function(module, exports) { /*istanbul ignore start*/"use strict"; exports.__esModule = true; exports. /*istanbul ignore end*/convertChangesToDMP = convertChangesToDMP; // See: http://code.google.com/p/google-diff-match-patch/wiki/API function convertChangesToDMP(changes) { var ret = [], change = /*istanbul ignore start*/void 0 /*istanbul ignore end*/, operation = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; for (var i = 0; i < changes.length; i++) { change = changes[i]; if (change.added) { operation = 1; } else if (change.removed) { operation = -1; } else { operation = 0; } ret.push([operation, change.value]); } return ret; } /***/ }, /* 17 */ /***/ function(module, exports) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports. /*istanbul ignore end*/convertChangesToXML = convertChangesToXML; function convertChangesToXML(changes) { var ret = []; for (var i = 0; i < changes.length; i++) { var change = changes[i]; if (change.added) { ret.push(''); } else if (change.removed) { ret.push(''); } ret.push(escapeHTML(change.value)); if (change.added) { ret.push(''); } else if (change.removed) { ret.push(''); } } return ret.join(''); } function escapeHTML(s) { var n = s; n = n.replace(/&/g, '&'); n = n.replace(//g, '>'); n = n.replace(/"/g, '"'); return n; } /***/ } /******/ ]) }); ; },{}],49:[function(require,module,exports){ (function (global){ ((typeof define === "function" && define.amd && function (m) { define("formatio", ["samsam"], m); }) || (typeof module === "object" && function (m) { module.exports = m(require("samsam")); }) || function (m) { this.formatio = m(this.samsam); } )(function (samsam) { "use strict"; var formatio = { excludeConstructors: ["Object", /^.$/], quoteStrings: true, limitChildrenCount: 0 }; var hasOwn = Object.prototype.hasOwnProperty; var specialObjects = []; if (typeof global !== "undefined") { specialObjects.push({ object: global, value: "[object global]" }); } if (typeof document !== "undefined") { specialObjects.push({ object: document, value: "[object HTMLDocument]" }); } if (typeof window !== "undefined") { specialObjects.push({ object: window, value: "[object Window]" }); } function functionName(func) { if (!func) { return ""; } if (func.displayName) { return func.displayName; } if (func.name) { return func.name; } var matches = func.toString().match(/function\s+([^\(]+)/m); return (matches && matches[1]) || ""; } function constructorName(f, object) { var name = functionName(object && object.constructor); var excludes = f.excludeConstructors || formatio.excludeConstructors || []; var i, l; for (i = 0, l = excludes.length; i < l; ++i) { if (typeof excludes[i] === "string" && excludes[i] === name) { return ""; } else if (excludes[i].test && excludes[i].test(name)) { return ""; } } return name; } function isCircular(object, objects) { if (typeof object !== "object") { return false; } var i, l; for (i = 0, l = objects.length; i < l; ++i) { if (objects[i] === object) { return true; } } return false; } function ascii(f, object, processed, indent) { if (typeof object === "string") { if (object.length === 0) { return "(empty string)"; } var qs = f.quoteStrings; var quote = typeof qs !== "boolean" || qs; return processed || quote ? '"' + object + '"' : object; } if (typeof object === "function" && !(object instanceof RegExp)) { return ascii.func(object); } processed = processed || []; if (isCircular(object, processed)) { return "[Circular]"; } if (Object.prototype.toString.call(object) === "[object Array]") { return ascii.array.call(f, object, processed); } if (!object) { return String((1/object) === -Infinity ? "-0" : object); } if (samsam.isElement(object)) { return ascii.element(object); } if (typeof object.toString === "function" && object.toString !== Object.prototype.toString) { return object.toString(); } var i, l; for (i = 0, l = specialObjects.length; i < l; i++) { if (object === specialObjects[i].object) { return specialObjects[i].value; } } if (typeof Set !== 'undefined' && object instanceof Set) { return ascii.set.call(f, object, processed); } return ascii.object.call(f, object, processed, indent); } ascii.func = function (func) { return "function " + functionName(func) + "() {}"; }; function delimit(str, delimiters) { delimiters = delimiters || ["[", "]"]; return delimiters[0] + str + delimiters[1]; } ascii.array = function (array, processed, delimiters) { processed = processed || []; processed.push(array); var pieces = []; var i, l; l = (this.limitChildrenCount > 0) ? Math.min(this.limitChildrenCount, array.length) : array.length; for (i = 0; i < l; ++i) { pieces.push(ascii(this, array[i], processed)); } if (l < array.length) { pieces.push("[... " + (array.length - l) + " more elements]"); } return delimit(pieces.join(", "), delimiters); }; ascii.set = function (set, processed) { return ascii.array.call(this, Array.from(set), processed, ['Set {', '}']); }; ascii.object = function (object, processed, indent) { processed = processed || []; processed.push(object); indent = indent || 0; var pieces = [], properties = samsam.keys(object).sort(); var length = 3; var prop, str, obj, i, k, l; l = (this.limitChildrenCount > 0) ? Math.min(this.limitChildrenCount, properties.length) : properties.length; for (i = 0; i < l; ++i) { prop = properties[i]; obj = object[prop]; if (isCircular(obj, processed)) { str = "[Circular]"; } else { str = ascii(this, obj, processed, indent + 2); } str = (/\s/.test(prop) ? '"' + prop + '"' : prop) + ": " + str; length += str.length; pieces.push(str); } var cons = constructorName(this, object); var prefix = cons ? "[" + cons + "] " : ""; var is = ""; for (i = 0, k = indent; i < k; ++i) { is += " "; } if(l < properties.length) pieces.push("[... " + (properties.length - l) + " more elements]"); if (length + indent > 80) { return prefix + "{\n " + is + pieces.join(",\n " + is) + "\n" + is + "}"; } return prefix + "{ " + pieces.join(", ") + " }"; }; ascii.element = function (element) { var tagName = element.tagName.toLowerCase(); var attrs = element.attributes, attr, pairs = [], attrName, i, l, val; for (i = 0, l = attrs.length; i < l; ++i) { attr = attrs.item(i); attrName = attr.nodeName.toLowerCase().replace("html:", ""); val = attr.nodeValue; if (attrName !== "contenteditable" || val !== "inherit") { if (!!val) { pairs.push(attrName + "=\"" + val + "\""); } } } var formatted = "<" + tagName + (pairs.length > 0 ? " " : ""); // SVG elements have undefined innerHTML var content = element.innerHTML || ''; if (content.length > 20) { content = content.substr(0, 20) + "[...]"; } var res = formatted + pairs.join(" ") + ">" + content + ""; return res.replace(/ contentEditable="inherit"/, ""); }; function Formatio(options) { for (var opt in options) { this[opt] = options[opt]; } } Formatio.prototype = { functionName: functionName, configure: function (options) { return new Formatio(options); }, constructorName: function (object) { return constructorName(this, object); }, ascii: function (object, processed, indent) { return ascii(this, object, processed, indent); } }; return Formatio.prototype; }); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"samsam":54}],50:[function(require,module,exports){ module.exports = Array.isArray || function (arr) { return Object.prototype.toString.call(arr) == '[object Array]'; }; },{}],51:[function(require,module,exports){ (function (global){ "use strict"; var userAgent = global.navigator && global.navigator.userAgent; var isRunningInIE = userAgent && userAgent.indexOf("MSIE ") > -1; // Make properties writable in IE, as per // http://www.adequatelygood.com/Replacing-setTimeout-Globally.html if (isRunningInIE) { global.setTimeout = global.setTimeout; global.clearTimeout = global.clearTimeout; global.setInterval = global.setInterval; global.clearInterval = global.clearInterval; global.Date = global.Date; } // setImmediate is not a standard function // avoid adding the prop to the window object if not present if (global.setImmediate !== undefined) { global.setImmediate = global.setImmediate; global.clearImmediate = global.clearImmediate; } // node expects setTimeout/setInterval to return a fn object w/ .ref()/.unref() // browsers, a number. // see https://github.com/cjohansen/Sinon.JS/pull/436 var NOOP = function () { return undefined; }; var timeoutResult = setTimeout(NOOP, 0); var addTimerReturnsObject = typeof timeoutResult === "object"; var hrtimePresent = (global.process && typeof global.process.hrtime === "function"); clearTimeout(timeoutResult); var NativeDate = Date; var uniqueTimerId = 1; /** * Parse strings like "01:10:00" (meaning 1 hour, 10 minutes, 0 seconds) into * number of milliseconds. This is used to support human-readable strings passed * to clock.tick() */ function parseTime(str) { if (!str) { return 0; } var strings = str.split(":"); var l = strings.length; var i = l; var ms = 0; var parsed; if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) { throw new Error("tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits"); } while (i--) { parsed = parseInt(strings[i], 10); if (parsed >= 60) { throw new Error("Invalid time " + str); } ms += parsed * Math.pow(60, (l - i - 1)); } return ms * 1000; } /** * Floor function that also works for negative numbers */ function fixedFloor(n) { return (n >= 0 ? Math.floor(n) : Math.ceil(n)); } /** * % operator that also works for negative numbers */ function fixedModulo(n, m) { return ((n % m) + m) % m; } /** * Used to grok the `now` parameter to createClock. */ function getEpoch(epoch) { if (!epoch) { return 0; } if (typeof epoch.getTime === "function") { return epoch.getTime(); } if (typeof epoch === "number") { return epoch; } throw new TypeError("now should be milliseconds since UNIX epoch"); } function inRange(from, to, timer) { return timer && timer.callAt >= from && timer.callAt <= to; } function mirrorDateProperties(target, source) { var prop; for (prop in source) { if (source.hasOwnProperty(prop)) { target[prop] = source[prop]; } } // set special now implementation if (source.now) { target.now = function now() { return target.clock.now; }; } else { delete target.now; } // set special toSource implementation if (source.toSource) { target.toSource = function toSource() { return source.toSource(); }; } else { delete target.toSource; } // set special toString implementation target.toString = function toString() { return source.toString(); }; target.prototype = source.prototype; target.parse = source.parse; target.UTC = source.UTC; target.prototype.toUTCString = source.prototype.toUTCString; return target; } function createDate() { function ClockDate(year, month, date, hour, minute, second, ms) { // Defensive and verbose to avoid potential harm in passing // explicit undefined when user does not pass argument switch (arguments.length) { case 0: return new NativeDate(ClockDate.clock.now); case 1: return new NativeDate(year); case 2: return new NativeDate(year, month); case 3: return new NativeDate(year, month, date); case 4: return new NativeDate(year, month, date, hour); case 5: return new NativeDate(year, month, date, hour, minute); case 6: return new NativeDate(year, month, date, hour, minute, second); default: return new NativeDate(year, month, date, hour, minute, second, ms); } } return mirrorDateProperties(ClockDate, NativeDate); } function addTimer(clock, timer) { if (timer.func === undefined) { throw new Error("Callback must be provided to timer calls"); } if (!clock.timers) { clock.timers = {}; } timer.id = uniqueTimerId++; timer.createdAt = clock.now; timer.callAt = clock.now + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0)); clock.timers[timer.id] = timer; if (addTimerReturnsObject) { return { id: timer.id, ref: NOOP, unref: NOOP }; } return timer.id; } /* eslint consistent-return: "off" */ function compareTimers(a, b) { // Sort first by absolute timing if (a.callAt < b.callAt) { return -1; } if (a.callAt > b.callAt) { return 1; } // Sort next by immediate, immediate timers take precedence if (a.immediate && !b.immediate) { return -1; } if (!a.immediate && b.immediate) { return 1; } // Sort next by creation time, earlier-created timers take precedence if (a.createdAt < b.createdAt) { return -1; } if (a.createdAt > b.createdAt) { return 1; } // Sort next by id, lower-id timers take precedence if (a.id < b.id) { return -1; } if (a.id > b.id) { return 1; } // As timer ids are unique, no fallback `0` is necessary } function firstTimerInRange(clock, from, to) { var timers = clock.timers; var timer = null; var id, isInRange; for (id in timers) { if (timers.hasOwnProperty(id)) { isInRange = inRange(from, to, timers[id]); if (isInRange && (!timer || compareTimers(timer, timers[id]) === 1)) { timer = timers[id]; } } } return timer; } function firstTimer(clock) { var timers = clock.timers; var timer = null; var id; for (id in timers) { if (timers.hasOwnProperty(id)) { if (!timer || compareTimers(timer, timers[id]) === 1) { timer = timers[id]; } } } return timer; } function lastTimer(clock) { var timers = clock.timers; var timer = null; var id; for (id in timers) { if (timers.hasOwnProperty(id)) { if (!timer || compareTimers(timer, timers[id]) === -1) { timer = timers[id]; } } } return timer; } function callTimer(clock, timer) { var exception; if (typeof timer.interval === "number") { clock.timers[timer.id].callAt += timer.interval; } else { delete clock.timers[timer.id]; } try { if (typeof timer.func === "function") { timer.func.apply(null, timer.args); } else { /* eslint no-eval: "off" */ eval(timer.func); } } catch (e) { exception = e; } if (!clock.timers[timer.id]) { if (exception) { throw exception; } return; } if (exception) { throw exception; } } function timerType(timer) { if (timer.immediate) { return "Immediate"; } if (timer.interval !== undefined) { return "Interval"; } return "Timeout"; } function clearTimer(clock, timerId, ttype) { if (!timerId) { // null appears to be allowed in most browsers, and appears to be // relied upon by some libraries, like Bootstrap carousel return; } if (!clock.timers) { clock.timers = []; } // in Node, timerId is an object with .ref()/.unref(), and // its .id field is the actual timer id. if (typeof timerId === "object") { timerId = timerId.id; } if (clock.timers.hasOwnProperty(timerId)) { // check that the ID matches a timer of the correct type var timer = clock.timers[timerId]; if (timerType(timer) === ttype) { delete clock.timers[timerId]; } else { throw new Error("Cannot clear timer: timer created with set" + timerType(timer) + "() but cleared with clear" + ttype + "()"); } } } function uninstall(clock, target) { var method, i, l; var installedHrTime = "_hrtime"; for (i = 0, l = clock.methods.length; i < l; i++) { method = clock.methods[i]; if (method === "hrtime" && target.process) { target.process.hrtime = clock[installedHrTime]; } else { if (target[method] && target[method].hadOwnProperty) { target[method] = clock["_" + method]; } else { try { delete target[method]; } catch (ignore) { /* eslint empty-block: "off" */ } } } } // Prevent multiple executions which will completely remove these props clock.methods = []; } function hijackMethod(target, method, clock) { var prop; clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call(target, method); clock["_" + method] = target[method]; if (method === "Date") { var date = mirrorDateProperties(clock[method], target[method]); target[method] = date; } else { target[method] = function () { return clock[method].apply(clock, arguments); }; for (prop in clock[method]) { if (clock[method].hasOwnProperty(prop)) { target[method][prop] = clock[method][prop]; } } } target[method].clock = clock; } var timers = { setTimeout: setTimeout, clearTimeout: clearTimeout, setImmediate: global.setImmediate, clearImmediate: global.clearImmediate, setInterval: setInterval, clearInterval: clearInterval, Date: Date }; if (hrtimePresent) { timers.hrtime = global.process.hrtime; } var keys = Object.keys || function (obj) { var ks = []; var key; for (key in obj) { if (obj.hasOwnProperty(key)) { ks.push(key); } } return ks; }; exports.timers = timers; function createClock(now, loopLimit) { loopLimit = loopLimit || 1000; var clock = { now: getEpoch(now), hrNow: 0, timeouts: {}, Date: createDate(), loopLimit: loopLimit }; clock.Date.clock = clock; clock.setTimeout = function setTimeout(func, timeout) { return addTimer(clock, { func: func, args: Array.prototype.slice.call(arguments, 2), delay: timeout }); }; clock.clearTimeout = function clearTimeout(timerId) { return clearTimer(clock, timerId, "Timeout"); }; clock.setInterval = function setInterval(func, timeout) { return addTimer(clock, { func: func, args: Array.prototype.slice.call(arguments, 2), delay: timeout, interval: timeout }); }; clock.clearInterval = function clearInterval(timerId) { return clearTimer(clock, timerId, "Interval"); }; clock.setImmediate = function setImmediate(func) { return addTimer(clock, { func: func, args: Array.prototype.slice.call(arguments, 1), immediate: true }); }; clock.clearImmediate = function clearImmediate(timerId) { return clearTimer(clock, timerId, "Immediate"); }; clock.tick = function tick(ms) { ms = typeof ms === "number" ? ms : parseTime(ms); var tickFrom = clock.now; var tickTo = clock.now + ms; var previous = clock.now; var timer = firstTimerInRange(clock, tickFrom, tickTo); var oldNow, firstException; clock.duringTick = true; function updateHrTime(newNow) { clock.hrNow += (newNow - clock.now); } while (timer && tickFrom <= tickTo) { if (clock.timers[timer.id]) { updateHrTime(timer.callAt); tickFrom = timer.callAt; clock.now = timer.callAt; try { oldNow = clock.now; callTimer(clock, timer); // compensate for any setSystemTime() call during timer callback if (oldNow !== clock.now) { tickFrom += clock.now - oldNow; tickTo += clock.now - oldNow; previous += clock.now - oldNow; } } catch (e) { firstException = firstException || e; } } timer = firstTimerInRange(clock, previous, tickTo); previous = tickFrom; } clock.duringTick = false; updateHrTime(tickTo); clock.now = tickTo; if (firstException) { throw firstException; } return clock.now; }; clock.next = function next() { var timer = firstTimer(clock); if (!timer) { return clock.now; } clock.duringTick = true; try { clock.now = timer.callAt; callTimer(clock, timer); return clock.now; } finally { clock.duringTick = false; } }; clock.runAll = function runAll() { var numTimers, i; for (i = 0; i < clock.loopLimit; i++) { if (!clock.timers) { return clock.now; } numTimers = Object.keys(clock.timers).length; if (numTimers === 0) { return clock.now; } clock.next(); } throw new Error("Aborting after running " + clock.loopLimit + " timers, assuming an infinite loop!"); }; clock.runToLast = function runToLast() { var timer = lastTimer(clock); if (!timer) { return clock.now; } return clock.tick(timer.callAt); }; clock.reset = function reset() { clock.timers = {}; }; clock.setSystemTime = function setSystemTime(systemTime) { // determine time difference var newNow = getEpoch(systemTime); var difference = newNow - clock.now; var id, timer; // update 'system clock' clock.now = newNow; // update timers and intervals to keep them stable for (id in clock.timers) { if (clock.timers.hasOwnProperty(id)) { timer = clock.timers[id]; timer.createdAt += difference; timer.callAt += difference; } } }; if (hrtimePresent) { clock.hrtime = function (prev) { if (Array.isArray(prev)) { var oldSecs = (prev[0] + prev[1] / 1e9); var newSecs = (clock.hrNow / 1000); var difference = (newSecs - oldSecs); var secs = fixedFloor(difference); var nanosecs = fixedModulo(difference * 1e9, 1e9); return [ secs, nanosecs ]; } return [ fixedFloor(clock.hrNow / 1000), fixedModulo(clock.hrNow * 1e6, 1e9) ]; }; } return clock; } exports.createClock = createClock; exports.install = function install(target, now, toFake, loopLimit) { var i, l; if (target instanceof Date) { toFake = now; now = target.getTime(); target = null; } if (typeof target === "number") { toFake = now; now = target; target = null; } if (!target) { target = global; } var clock = createClock(now, loopLimit); clock.uninstall = function () { uninstall(clock, target); }; clock.methods = toFake || []; if (clock.methods.length === 0) { clock.methods = keys(timers); } for (i = 0, l = clock.methods.length; i < l; i++) { if (clock.methods[i] === "hrtime") { if (target.process && typeof target.process.hrtime === "function") { hijackMethod(target.process, clock.methods[i], clock); } } else { hijackMethod(target, clock.methods[i], clock); } } return clock; }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],52:[function(require,module,exports){ var isarray = require('isarray') /** * Expose `pathToRegexp`. */ module.exports = pathToRegexp module.exports.parse = parse module.exports.compile = compile module.exports.tokensToFunction = tokensToFunction module.exports.tokensToRegExp = tokensToRegExp /** * The main path matching regexp utility. * * @type {RegExp} */ var PATH_REGEXP = new RegExp([ // Match escaped characters that would otherwise appear in future matches. // This allows the user to escape special characters that won't transform. '(\\\\.)', // Match Express-style parameters and un-named parameters with a prefix // and optional suffixes. Matches appear as: // // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' ].join('|'), 'g') /** * Parse a string for the raw tokens. * * @param {string} str * @param {Object=} options * @return {!Array} */ function parse (str, options) { var tokens = [] var key = 0 var index = 0 var path = '' var defaultDelimiter = options && options.delimiter || '/' var res while ((res = PATH_REGEXP.exec(str)) != null) { var m = res[0] var escaped = res[1] var offset = res.index path += str.slice(index, offset) index = offset + m.length // Ignore already escaped sequences. if (escaped) { path += escaped[1] continue } var next = str[index] var prefix = res[2] var name = res[3] var capture = res[4] var group = res[5] var modifier = res[6] var asterisk = res[7] // Push the current path onto the tokens. if (path) { tokens.push(path) path = '' } var partial = prefix != null && next != null && next !== prefix var repeat = modifier === '+' || modifier === '*' var optional = modifier === '?' || modifier === '*' var delimiter = res[2] || defaultDelimiter var pattern = capture || group tokens.push({ name: name || key++, prefix: prefix || '', delimiter: delimiter, optional: optional, repeat: repeat, partial: partial, asterisk: !!asterisk, pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') }) } // Match any characters still remaining. if (index < str.length) { path += str.substr(index) } // If the path exists, push it onto the end. if (path) { tokens.push(path) } return tokens } /** * Compile a string to a template function for the path. * * @param {string} str * @param {Object=} options * @return {!function(Object=, Object=)} */ function compile (str, options) { return tokensToFunction(parse(str, options)) } /** * Prettier encoding of URI path segments. * * @param {string} * @return {string} */ function encodeURIComponentPretty (str) { return encodeURI(str).replace(/[\/?#]/g, function (c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase() }) } /** * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. * * @param {string} * @return {string} */ function encodeAsterisk (str) { return encodeURI(str).replace(/[?#]/g, function (c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase() }) } /** * Expose a method for transforming tokens into the path function. */ function tokensToFunction (tokens) { // Compile all the tokens into regexps. var matches = new Array(tokens.length) // Compile all the patterns before compilation. for (var i = 0; i < tokens.length; i++) { if (typeof tokens[i] === 'object') { matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$') } } return function (obj, opts) { var path = '' var data = obj || {} var options = opts || {} var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent for (var i = 0; i < tokens.length; i++) { var token = tokens[i] if (typeof token === 'string') { path += token continue } var value = data[token.name] var segment if (value == null) { if (token.optional) { // Prepend partial segment prefixes. if (token.partial) { path += token.prefix } continue } else { throw new TypeError('Expected "' + token.name + '" to be defined') } } if (isarray(value)) { if (!token.repeat) { throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') } if (value.length === 0) { if (token.optional) { continue } else { throw new TypeError('Expected "' + token.name + '" to not be empty') } } for (var j = 0; j < value.length; j++) { segment = encode(value[j]) if (!matches[i].test(segment)) { throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') } path += (j === 0 ? token.prefix : token.delimiter) + segment } continue } segment = token.asterisk ? encodeAsterisk(value) : encode(value) if (!matches[i].test(segment)) { throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') } path += token.prefix + segment } return path } } /** * Escape a regular expression string. * * @param {string} str * @return {string} */ function escapeString (str) { return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') } /** * Escape the capturing group by escaping special characters and meaning. * * @param {string} group * @return {string} */ function escapeGroup (group) { return group.replace(/([=!:$\/()])/g, '\\$1') } /** * Attach the keys as a property of the regexp. * * @param {!RegExp} re * @param {Array} keys * @return {!RegExp} */ function attachKeys (re, keys) { re.keys = keys return re } /** * Get the flags for a regexp from the options. * * @param {Object} options * @return {string} */ function flags (options) { return options.sensitive ? '' : 'i' } /** * Pull out keys from a regexp. * * @param {!RegExp} path * @param {!Array} keys * @return {!RegExp} */ function regexpToRegexp (path, keys) { // Use a negative lookahead to match only capturing groups. var groups = path.source.match(/\((?!\?)/g) if (groups) { for (var i = 0; i < groups.length; i++) { keys.push({ name: i, prefix: null, delimiter: null, optional: false, repeat: false, partial: false, asterisk: false, pattern: null }) } } return attachKeys(path, keys) } /** * Transform an array into a regexp. * * @param {!Array} path * @param {Array} keys * @param {!Object} options * @return {!RegExp} */ function arrayToRegexp (path, keys, options) { var parts = [] for (var i = 0; i < path.length; i++) { parts.push(pathToRegexp(path[i], keys, options).source) } var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)) return attachKeys(regexp, keys) } /** * Create a path regexp from string input. * * @param {string} path * @param {!Array} keys * @param {!Object} options * @return {!RegExp} */ function stringToRegexp (path, keys, options) { return tokensToRegExp(parse(path, options), keys, options) } /** * Expose a function for taking tokens and returning a RegExp. * * @param {!Array} tokens * @param {(Array|Object)=} keys * @param {Object=} options * @return {!RegExp} */ function tokensToRegExp (tokens, keys, options) { if (!isarray(keys)) { options = /** @type {!Object} */ (keys || options) keys = [] } options = options || {} var strict = options.strict var end = options.end !== false var route = '' // Iterate over the tokens and create our regexp string. for (var i = 0; i < tokens.length; i++) { var token = tokens[i] if (typeof token === 'string') { route += escapeString(token) } else { var prefix = escapeString(token.prefix) var capture = '(?:' + token.pattern + ')' keys.push(token) if (token.repeat) { capture += '(?:' + prefix + capture + ')*' } if (token.optional) { if (!token.partial) { capture = '(?:' + prefix + '(' + capture + '))?' } else { capture = prefix + '(' + capture + ')?' } } else { capture = prefix + '(' + capture + ')' } route += capture } } var delimiter = escapeString(options.delimiter || '/') var endsWithDelimiter = route.slice(-delimiter.length) === delimiter // In non-strict mode we allow a slash at the end of match. If the path to // match already ends with a slash, we remove it for consistency. The slash // is valid at the end of a path match, not in the middle. This is important // in non-ending mode, where "/test/" shouldn't match "/test//route". if (!strict) { route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?' } if (end) { route += '$' } else { // In non-ending mode, we need the capturing groups to match as much as // possible by using a positive lookahead to the end or next path segment. route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)' } return attachKeys(new RegExp('^' + route, flags(options)), keys) } /** * Normalize the given path string, returning a regular expression. * * An empty array can be passed in for the keys, which will hold the * placeholder key descriptions. For example, using `/user/:id`, `keys` will * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. * * @param {(string|RegExp|Array)} path * @param {(Array|Object)=} keys * @param {Object=} options * @return {!RegExp} */ function pathToRegexp (path, keys, options) { if (!isarray(keys)) { options = /** @type {!Object} */ (keys || options) keys = [] } options = options || {} if (path instanceof RegExp) { return regexpToRegexp(path, /** @type {!Array} */ (keys)) } if (isarray(path)) { return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) } return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) } },{"isarray":50}],53:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; },{}],54:[function(require,module,exports){ ((typeof define === "function" && define.amd && function (m) { define("samsam", m); }) || (typeof module === "object" && function (m) { module.exports = m(); }) || // Node function (m) { this.samsam = m(); } // Browser globals )(function () { var o = Object.prototype; var div = typeof document !== "undefined" && document.createElement("div"); function isNaN(value) { // Unlike global isNaN, this avoids type coercion // typeof check avoids IE host object issues, hat tip to // lodash var val = value; // JsLint thinks value !== value is "weird" return typeof value === "number" && value !== val; } function getClass(value) { // Returns the internal [[Class]] by calling Object.prototype.toString // with the provided value as this. Return value is a string, naming the // internal class, e.g. "Array" return o.toString.call(value).split(/[ \]]/)[1]; } /** * @name samsam.isArguments * @param Object object * * Returns ``true`` if ``object`` is an ``arguments`` object, * ``false`` otherwise. */ function isArguments(object) { if (getClass(object) === 'Arguments') { return true; } if (typeof object !== "object" || typeof object.length !== "number" || getClass(object) === "Array") { return false; } if (typeof object.callee == "function") { return true; } try { object[object.length] = 6; delete object[object.length]; } catch (e) { return true; } return false; } /** * @name samsam.isElement * @param Object object * * Returns ``true`` if ``object`` is a DOM element node. Unlike * Underscore.js/lodash, this function will return ``false`` if ``object`` * is an *element-like* object, i.e. a regular object with a ``nodeType`` * property that holds the value ``1``. */ function isElement(object) { if (!object || object.nodeType !== 1 || !div) { return false; } try { object.appendChild(div); object.removeChild(div); } catch (e) { return false; } return true; } /** * @name samsam.keys * @param Object object * * Return an array of own property names. */ function keys(object) { var ks = [], prop; for (prop in object) { if (o.hasOwnProperty.call(object, prop)) { ks.push(prop); } } return ks; } /** * @name samsam.isDate * @param Object value * * Returns true if the object is a ``Date``, or *date-like*. Duck typing * of date objects work by checking that the object has a ``getTime`` * function whose return value equals the return value from the object's * ``valueOf``. */ function isDate(value) { return typeof value.getTime == "function" && value.getTime() == value.valueOf(); } /** * @name samsam.isNegZero * @param Object value * * Returns ``true`` if ``value`` is ``-0``. */ function isNegZero(value) { return value === 0 && 1 / value === -Infinity; } /** * @name samsam.equal * @param Object obj1 * @param Object obj2 * * Returns ``true`` if two objects are strictly equal. Compared to * ``===`` there are two exceptions: * * - NaN is considered equal to NaN * - -0 and +0 are not considered equal */ function identical(obj1, obj2) { if (obj1 === obj2 || (isNaN(obj1) && isNaN(obj2))) { return obj1 !== 0 || isNegZero(obj1) === isNegZero(obj2); } } function isSet(val) { if (typeof Set !== 'undefined' && val instanceof Set) { return true; } } function isSubset(s1, s2, compare) { var values1 = Array.from(s1); var values2 = Array.from(s2); for (var i = 0; i < values1.length; i++) { var includes = false; for (var j = 0; j < values2.length; j++) { if (compare(values2[j], values1[i])) { includes = true; break; } } if (!includes) { return false; } } return true; } /** * @name samsam.deepEqual * @param Object obj1 * @param Object obj2 * * Deep equal comparison. Two values are "deep equal" if: * * - They are equal, according to samsam.identical * - They are both date objects representing the same time * - They are both arrays containing elements that are all deepEqual * - They are objects with the same set of properties, and each property * in ``obj1`` is deepEqual to the corresponding property in ``obj2`` * * Supports cyclic objects. */ function deepEqualCyclic(obj1, obj2) { // used for cyclic comparison // contain already visited objects var objects1 = [], objects2 = [], // contain pathes (position in the object structure) // of the already visited objects // indexes same as in objects arrays paths1 = [], paths2 = [], // contains combinations of already compared objects // in the manner: { "$1['ref']$2['ref']": true } compared = {}; /** * used to check, if the value of a property is an object * (cyclic logic is only needed for objects) * only needed for cyclic logic */ function isObject(value) { if (typeof value === 'object' && value !== null && !(value instanceof Boolean) && !(value instanceof Date) && !(value instanceof Number) && !(value instanceof RegExp) && !(value instanceof String)) { return true; } return false; } /** * returns the index of the given object in the * given objects array, -1 if not contained * only needed for cyclic logic */ function getIndex(objects, obj) { var i; for (i = 0; i < objects.length; i++) { if (objects[i] === obj) { return i; } } return -1; } // does the recursion for the deep equal check return (function deepEqual(obj1, obj2, path1, path2) { var type1 = typeof obj1; var type2 = typeof obj2; // == null also matches undefined if (obj1 === obj2 || isNaN(obj1) || isNaN(obj2) || obj1 == null || obj2 == null || type1 !== "object" || type2 !== "object") { return identical(obj1, obj2); } // Elements are only equal if identical(expected, actual) if (isElement(obj1) || isElement(obj2)) { return false; } var isDate1 = isDate(obj1), isDate2 = isDate(obj2); if (isDate1 || isDate2) { if (!isDate1 || !isDate2 || obj1.getTime() !== obj2.getTime()) { return false; } } if (obj1 instanceof RegExp && obj2 instanceof RegExp) { if (obj1.toString() !== obj2.toString()) { return false; } } var class1 = getClass(obj1); var class2 = getClass(obj2); var keys1 = keys(obj1); var keys2 = keys(obj2); if (isArguments(obj1) || isArguments(obj2)) { if (obj1.length !== obj2.length) { return false; } } else { if (type1 !== type2 || class1 !== class2 || keys1.length !== keys2.length) { return false; } } if (isSet(obj1) || isSet(obj2)) { if (!isSet(obj1) || !isSet(obj2) || obj1.size !== obj2.size) { return false; } return isSubset(obj1, obj2, deepEqual); } var key, i, l, // following vars are used for the cyclic logic value1, value2, isObject1, isObject2, index1, index2, newPath1, newPath2; for (i = 0, l = keys1.length; i < l; i++) { key = keys1[i]; if (!o.hasOwnProperty.call(obj2, key)) { return false; } // Start of the cyclic logic value1 = obj1[key]; value2 = obj2[key]; isObject1 = isObject(value1); isObject2 = isObject(value2); // determine, if the objects were already visited // (it's faster to check for isObject first, than to // get -1 from getIndex for non objects) index1 = isObject1 ? getIndex(objects1, value1) : -1; index2 = isObject2 ? getIndex(objects2, value2) : -1; // determine the new pathes of the objects // - for non cyclic objects the current path will be extended // by current property name // - for cyclic objects the stored path is taken newPath1 = index1 !== -1 ? paths1[index1] : path1 + '[' + JSON.stringify(key) + ']'; newPath2 = index2 !== -1 ? paths2[index2] : path2 + '[' + JSON.stringify(key) + ']'; // stop recursion if current objects are already compared if (compared[newPath1 + newPath2]) { return true; } // remember the current objects and their pathes if (index1 === -1 && isObject1) { objects1.push(value1); paths1.push(newPath1); } if (index2 === -1 && isObject2) { objects2.push(value2); paths2.push(newPath2); } // remember that the current objects are already compared if (isObject1 && isObject2) { compared[newPath1 + newPath2] = true; } // End of cyclic logic // neither value1 nor value2 is a cycle // continue with next level if (!deepEqual(value1, value2, newPath1, newPath2)) { return false; } } return true; }(obj1, obj2, '$1', '$2')); } function arrayContains(array, subset, compare) { if (subset.length === 0) { return true; } var i, l, j, k; for (i = 0, l = array.length; i < l; ++i) { if (compare(array[i], subset[0])) { for (j = 0, k = subset.length; j < k; ++j) { if ((i + j) >= l) { return false; } if (!compare(array[i + j], subset[j])) { return false; } } return true; } } return false; } /** * @name samsam.match * @param Object object * @param Object matcher * * Compare arbitrary value ``object`` with matcher. */ function match(object, matcher) { if (matcher && typeof matcher.test === "function") { return matcher.test(object); } if (typeof matcher === "function") { return matcher(object) === true; } if (typeof matcher === "string") { matcher = matcher.toLowerCase(); var notNull = typeof object === "string" || !!object; return notNull && (String(object)).toLowerCase().indexOf(matcher) >= 0; } if (typeof matcher === "number") { return matcher === object; } if (typeof matcher === "boolean") { return matcher === object; } if (typeof(matcher) === "undefined") { return typeof(object) === "undefined"; } if (matcher === null) { return object === null; } if (isSet(object)) { return isSubset(matcher, object, match); } if (getClass(object) === "Array" && getClass(matcher) === "Array") { return arrayContains(object, matcher, match); } if (matcher && typeof matcher === "object") { if (matcher === object) { return true; } var prop; for (prop in matcher) { var value = object[prop]; if (typeof value === "undefined" && typeof object.getAttribute === "function") { value = object.getAttribute(prop); } if (matcher[prop] === null || typeof matcher[prop] === 'undefined') { if (value !== matcher[prop]) { return false; } } else if (typeof value === "undefined" || !match(value, matcher[prop])) { return false; } } return true; } throw new Error("Matcher was not a string, a number, a " + "function, a boolean or an object"); } return { isArguments: isArguments, isElement: isElement, isDate: isDate, isNegZero: isNegZero, identical: identical, deepEqual: deepEqualCyclic, match: match, keys: keys }; }); },{}],55:[function(require,module,exports){ // This is free and unencumbered software released into the public domain. // See LICENSE.md for more information. var encoding = require("./lib/encoding.js"); module.exports = { TextEncoder: encoding.TextEncoder, TextDecoder: encoding.TextDecoder, }; },{"./lib/encoding.js":57}],56:[function(require,module,exports){ (function(global) { 'use strict'; if (typeof module !== "undefined" && module.exports) { module.exports = global; } global["encoding-indexes"] = { "big5":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,17392,19506,17923,17830,17784,160359,19831,17843,162993,19682,163013,15253,18230,18244,19527,19520,148159,144919,160594,159371,159954,19543,172881,18255,17882,19589,162924,19719,19108,18081,158499,29221,154196,137827,146950,147297,26189,22267,null,32149,22813,166841,15860,38708,162799,23515,138590,23204,13861,171696,23249,23479,23804,26478,34195,170309,29793,29853,14453,138579,145054,155681,16108,153822,15093,31484,40855,147809,166157,143850,133770,143966,17162,33924,40854,37935,18736,34323,22678,38730,37400,31184,31282,26208,27177,34973,29772,31685,26498,31276,21071,36934,13542,29636,155065,29894,40903,22451,18735,21580,16689,145038,22552,31346,162661,35727,18094,159368,16769,155033,31662,140476,40904,140481,140489,140492,40905,34052,144827,16564,40906,17633,175615,25281,28782,40907,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,12736,12737,12738,12739,12740,131340,12741,131281,131277,12742,12743,131275,139240,12744,131274,12745,12746,12747,12748,131342,12749,12750,256,193,461,192,274,201,282,200,332,211,465,210,null,7870,null,7872,202,257,225,462,224,593,275,233,283,232,299,237,464,236,333,243,466,242,363,250,468,249,470,472,474,476,252,null,7871,null,7873,234,609,9178,9179,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,172969,135493,null,25866,null,null,20029,28381,40270,37343,null,null,161589,25745,20250,20264,20392,20822,20852,20892,20964,21153,21160,21307,21326,21457,21464,22242,22768,22788,22791,22834,22836,23398,23454,23455,23706,24198,24635,25993,26622,26628,26725,27982,28860,30005,32420,32428,32442,32455,32463,32479,32518,32567,33402,33487,33647,35270,35774,35810,36710,36711,36718,29713,31996,32205,26950,31433,21031,null,null,null,null,37260,30904,37214,32956,null,36107,33014,133607,null,null,32927,40647,19661,40393,40460,19518,171510,159758,40458,172339,13761,null,28314,33342,29977,null,18705,39532,39567,40857,31111,164972,138698,132560,142054,20004,20097,20096,20103,20159,20203,20279,13388,20413,15944,20483,20616,13437,13459,13477,20870,22789,20955,20988,20997,20105,21113,21136,21287,13767,21417,13649,21424,13651,21442,21539,13677,13682,13953,21651,21667,21684,21689,21712,21743,21784,21795,21800,13720,21823,13733,13759,21975,13765,163204,21797,null,134210,134421,151851,21904,142534,14828,131905,36422,150968,169189,16467,164030,30586,142392,14900,18389,164189,158194,151018,25821,134524,135092,134357,135412,25741,36478,134806,134155,135012,142505,164438,148691,null,134470,170573,164073,18420,151207,142530,39602,14951,169460,16365,13574,152263,169940,161992,142660,40302,38933,null,17369,155813,25780,21731,142668,142282,135287,14843,135279,157402,157462,162208,25834,151634,134211,36456,139681,166732,132913,null,18443,131497,16378,22643,142733,null,148936,132348,155799,134988,134550,21881,16571,17338,null,19124,141926,135325,33194,39157,134556,25465,14846,141173,36288,22177,25724,15939,null,173569,134665,142031,142537,null,135368,145858,14738,14854,164507,13688,155209,139463,22098,134961,142514,169760,13500,27709,151099,null,null,161140,142987,139784,173659,167117,134778,134196,157724,32659,135375,141315,141625,13819,152035,134796,135053,134826,16275,134960,134471,135503,134732,null,134827,134057,134472,135360,135485,16377,140950,25650,135085,144372,161337,142286,134526,134527,142417,142421,14872,134808,135367,134958,173618,158544,167122,167321,167114,38314,21708,33476,21945,null,171715,39974,39606,161630,142830,28992,33133,33004,23580,157042,33076,14231,21343,164029,37302,134906,134671,134775,134907,13789,151019,13833,134358,22191,141237,135369,134672,134776,135288,135496,164359,136277,134777,151120,142756,23124,135197,135198,135413,135414,22428,134673,161428,164557,135093,134779,151934,14083,135094,135552,152280,172733,149978,137274,147831,164476,22681,21096,13850,153405,31666,23400,18432,19244,40743,18919,39967,39821,154484,143677,22011,13810,22153,20008,22786,138177,194680,38737,131206,20059,20155,13630,23587,24401,24516,14586,25164,25909,27514,27701,27706,28780,29227,20012,29357,149737,32594,31035,31993,32595,156266,13505,null,156491,32770,32896,157202,158033,21341,34916,35265,161970,35744,36125,38021,38264,38271,38376,167439,38886,39029,39118,39134,39267,170000,40060,40479,40644,27503,63751,20023,131207,38429,25143,38050,null,20539,28158,171123,40870,15817,34959,147790,28791,23797,19232,152013,13657,154928,24866,166450,36775,37366,29073,26393,29626,144001,172295,15499,137600,19216,30948,29698,20910,165647,16393,27235,172730,16931,34319,133743,31274,170311,166634,38741,28749,21284,139390,37876,30425,166371,40871,30685,20131,20464,20668,20015,20247,40872,21556,32139,22674,22736,138678,24210,24217,24514,141074,25995,144377,26905,27203,146531,27903,null,29184,148741,29580,16091,150035,23317,29881,35715,154788,153237,31379,31724,31939,32364,33528,34199,40873,34960,40874,36537,40875,36815,34143,39392,37409,40876,167353,136255,16497,17058,23066,null,null,null,39016,26475,17014,22333,null,34262,149883,33471,160013,19585,159092,23931,158485,159678,40877,40878,23446,40879,26343,32347,28247,31178,15752,17603,143958,141206,17306,17718,null,23765,146202,35577,23672,15634,144721,23928,40882,29015,17752,147692,138787,19575,14712,13386,131492,158785,35532,20404,131641,22975,33132,38998,170234,24379,134047,null,139713,166253,16642,18107,168057,16135,40883,172469,16632,14294,18167,158790,16764,165554,160767,17773,14548,152730,17761,17691,19849,19579,19830,17898,16328,150287,13921,17630,17597,16877,23870,23880,23894,15868,14351,23972,23993,14368,14392,24130,24253,24357,24451,14600,14612,14655,14669,24791,24893,23781,14729,25015,25017,25039,14776,25132,25232,25317,25368,14840,22193,14851,25570,25595,25607,25690,14923,25792,23829,22049,40863,14999,25990,15037,26111,26195,15090,26258,15138,26390,15170,26532,26624,15192,26698,26756,15218,15217,15227,26889,26947,29276,26980,27039,27013,15292,27094,15325,27237,27252,27249,27266,15340,27289,15346,27307,27317,27348,27382,27521,27585,27626,27765,27818,15563,27906,27910,27942,28033,15599,28068,28081,28181,28184,28201,28294,166336,28347,28386,28378,40831,28392,28393,28452,28468,15686,147265,28545,28606,15722,15733,29111,23705,15754,28716,15761,28752,28756,28783,28799,28809,131877,17345,13809,134872,147159,22462,159443,28990,153568,13902,27042,166889,23412,31305,153825,169177,31333,31357,154028,31419,31408,31426,31427,29137,156813,16842,31450,31453,31466,16879,21682,154625,31499,31573,31529,152334,154878,31650,31599,33692,154548,158847,31696,33825,31634,31672,154912,15789,154725,33938,31738,31750,31797,154817,31812,31875,149634,31910,26237,148856,31945,31943,31974,31860,31987,31989,31950,32359,17693,159300,32093,159446,29837,32137,32171,28981,32179,32210,147543,155689,32228,15635,32245,137209,32229,164717,32285,155937,155994,32366,32402,17195,37996,32295,32576,32577,32583,31030,156368,39393,32663,156497,32675,136801,131176,17756,145254,17667,164666,32762,156809,32773,32776,32797,32808,32815,172167,158915,32827,32828,32865,141076,18825,157222,146915,157416,26405,32935,166472,33031,33050,22704,141046,27775,156824,151480,25831,136330,33304,137310,27219,150117,150165,17530,33321,133901,158290,146814,20473,136445,34018,33634,158474,149927,144688,137075,146936,33450,26907,194964,16859,34123,33488,33562,134678,137140,14017,143741,144730,33403,33506,33560,147083,159139,158469,158615,144846,15807,33565,21996,33669,17675,159141,33708,33729,33747,13438,159444,27223,34138,13462,159298,143087,33880,154596,33905,15827,17636,27303,33866,146613,31064,33960,158614,159351,159299,34014,33807,33681,17568,33939,34020,154769,16960,154816,17731,34100,23282,159385,17703,34163,17686,26559,34326,165413,165435,34241,159880,34306,136578,159949,194994,17770,34344,13896,137378,21495,160666,34430,34673,172280,34798,142375,34737,34778,34831,22113,34412,26710,17935,34885,34886,161248,146873,161252,34910,34972,18011,34996,34997,25537,35013,30583,161551,35207,35210,35238,35241,35239,35260,166437,35303,162084,162493,35484,30611,37374,35472,162393,31465,162618,147343,18195,162616,29052,35596,35615,152624,152933,35647,35660,35661,35497,150138,35728,35739,35503,136927,17941,34895,35995,163156,163215,195028,14117,163155,36054,163224,163261,36114,36099,137488,36059,28764,36113,150729,16080,36215,36265,163842,135188,149898,15228,164284,160012,31463,36525,36534,36547,37588,36633,36653,164709,164882,36773,37635,172703,133712,36787,18730,166366,165181,146875,24312,143970,36857,172052,165564,165121,140069,14720,159447,36919,165180,162494,36961,165228,165387,37032,165651,37060,165606,37038,37117,37223,15088,37289,37316,31916,166195,138889,37390,27807,37441,37474,153017,37561,166598,146587,166668,153051,134449,37676,37739,166625,166891,28815,23235,166626,166629,18789,37444,166892,166969,166911,37747,37979,36540,38277,38310,37926,38304,28662,17081,140922,165592,135804,146990,18911,27676,38523,38550,16748,38563,159445,25050,38582,30965,166624,38589,21452,18849,158904,131700,156688,168111,168165,150225,137493,144138,38705,34370,38710,18959,17725,17797,150249,28789,23361,38683,38748,168405,38743,23370,168427,38751,37925,20688,143543,143548,38793,38815,38833,38846,38848,38866,38880,152684,38894,29724,169011,38911,38901,168989,162170,19153,38964,38963,38987,39014,15118,160117,15697,132656,147804,153350,39114,39095,39112,39111,19199,159015,136915,21936,39137,39142,39148,37752,39225,150057,19314,170071,170245,39413,39436,39483,39440,39512,153381,14020,168113,170965,39648,39650,170757,39668,19470,39700,39725,165376,20532,39732,158120,14531,143485,39760,39744,171326,23109,137315,39822,148043,39938,39935,39948,171624,40404,171959,172434,172459,172257,172323,172511,40318,40323,172340,40462,26760,40388,139611,172435,172576,137531,172595,40249,172217,172724,40592,40597,40606,40610,19764,40618,40623,148324,40641,15200,14821,15645,20274,14270,166955,40706,40712,19350,37924,159138,40727,40726,40761,22175,22154,40773,39352,168075,38898,33919,40802,40809,31452,40846,29206,19390,149877,149947,29047,150008,148296,150097,29598,166874,137466,31135,166270,167478,37737,37875,166468,37612,37761,37835,166252,148665,29207,16107,30578,31299,28880,148595,148472,29054,137199,28835,137406,144793,16071,137349,152623,137208,14114,136955,137273,14049,137076,137425,155467,14115,136896,22363,150053,136190,135848,136134,136374,34051,145062,34051,33877,149908,160101,146993,152924,147195,159826,17652,145134,170397,159526,26617,14131,15381,15847,22636,137506,26640,16471,145215,147681,147595,147727,158753,21707,22174,157361,22162,135135,134056,134669,37830,166675,37788,20216,20779,14361,148534,20156,132197,131967,20299,20362,153169,23144,131499,132043,14745,131850,132116,13365,20265,131776,167603,131701,35546,131596,20120,20685,20749,20386,20227,150030,147082,20290,20526,20588,20609,20428,20453,20568,20732,20825,20827,20829,20830,28278,144789,147001,147135,28018,137348,147081,20904,20931,132576,17629,132259,132242,132241,36218,166556,132878,21081,21156,133235,21217,37742,18042,29068,148364,134176,149932,135396,27089,134685,29817,16094,29849,29716,29782,29592,19342,150204,147597,21456,13700,29199,147657,21940,131909,21709,134086,22301,37469,38644,37734,22493,22413,22399,13886,22731,23193,166470,136954,137071,136976,23084,22968,37519,23166,23247,23058,153926,137715,137313,148117,14069,27909,29763,23073,155267,23169,166871,132115,37856,29836,135939,28933,18802,37896,166395,37821,14240,23582,23710,24158,24136,137622,137596,146158,24269,23375,137475,137476,14081,137376,14045,136958,14035,33066,166471,138682,144498,166312,24332,24334,137511,137131,23147,137019,23364,34324,161277,34912,24702,141408,140843,24539,16056,140719,140734,168072,159603,25024,131134,131142,140827,24985,24984,24693,142491,142599,149204,168269,25713,149093,142186,14889,142114,144464,170218,142968,25399,173147,25782,25393,25553,149987,142695,25252,142497,25659,25963,26994,15348,143502,144045,149897,144043,21773,144096,137433,169023,26318,144009,143795,15072,16784,152964,166690,152975,136956,152923,152613,30958,143619,137258,143924,13412,143887,143746,148169,26254,159012,26219,19347,26160,161904,138731,26211,144082,144097,26142,153714,14545,145466,145340,15257,145314,144382,29904,15254,26511,149034,26806,26654,15300,27326,14435,145365,148615,27187,27218,27337,27397,137490,25873,26776,27212,15319,27258,27479,147392,146586,37792,37618,166890,166603,37513,163870,166364,37991,28069,28427,149996,28007,147327,15759,28164,147516,23101,28170,22599,27940,30786,28987,148250,148086,28913,29264,29319,29332,149391,149285,20857,150180,132587,29818,147192,144991,150090,149783,155617,16134,16049,150239,166947,147253,24743,16115,29900,29756,37767,29751,17567,159210,17745,30083,16227,150745,150790,16216,30037,30323,173510,15129,29800,166604,149931,149902,15099,15821,150094,16127,149957,149747,37370,22322,37698,166627,137316,20703,152097,152039,30584,143922,30478,30479,30587,149143,145281,14942,149744,29752,29851,16063,150202,150215,16584,150166,156078,37639,152961,30750,30861,30856,30930,29648,31065,161601,153315,16654,31131,33942,31141,27181,147194,31290,31220,16750,136934,16690,37429,31217,134476,149900,131737,146874,137070,13719,21867,13680,13994,131540,134157,31458,23129,141045,154287,154268,23053,131675,30960,23082,154566,31486,16889,31837,31853,16913,154547,155324,155302,31949,150009,137136,31886,31868,31918,27314,32220,32263,32211,32590,156257,155996,162632,32151,155266,17002,158581,133398,26582,131150,144847,22468,156690,156664,149858,32733,31527,133164,154345,154947,31500,155150,39398,34373,39523,27164,144447,14818,150007,157101,39455,157088,33920,160039,158929,17642,33079,17410,32966,33033,33090,157620,39107,158274,33378,33381,158289,33875,159143,34320,160283,23174,16767,137280,23339,137377,23268,137432,34464,195004,146831,34861,160802,23042,34926,20293,34951,35007,35046,35173,35149,153219,35156,161669,161668,166901,166873,166812,166393,16045,33955,18165,18127,14322,35389,35356,169032,24397,37419,148100,26068,28969,28868,137285,40301,35999,36073,163292,22938,30659,23024,17262,14036,36394,36519,150537,36656,36682,17140,27736,28603,140065,18587,28537,28299,137178,39913,14005,149807,37051,37015,21873,18694,37307,37892,166475,16482,166652,37927,166941,166971,34021,35371,38297,38311,38295,38294,167220,29765,16066,149759,150082,148458,16103,143909,38543,167655,167526,167525,16076,149997,150136,147438,29714,29803,16124,38721,168112,26695,18973,168083,153567,38749,37736,166281,166950,166703,156606,37562,23313,35689,18748,29689,147995,38811,38769,39224,134950,24001,166853,150194,38943,169178,37622,169431,37349,17600,166736,150119,166756,39132,166469,16128,37418,18725,33812,39227,39245,162566,15869,39323,19311,39338,39516,166757,153800,27279,39457,23294,39471,170225,19344,170312,39356,19389,19351,37757,22642,135938,22562,149944,136424,30788,141087,146872,26821,15741,37976,14631,24912,141185,141675,24839,40015,40019,40059,39989,39952,39807,39887,171565,39839,172533,172286,40225,19630,147716,40472,19632,40204,172468,172269,172275,170287,40357,33981,159250,159711,158594,34300,17715,159140,159364,159216,33824,34286,159232,145367,155748,31202,144796,144960,18733,149982,15714,37851,37566,37704,131775,30905,37495,37965,20452,13376,36964,152925,30781,30804,30902,30795,137047,143817,149825,13978,20338,28634,28633,28702,28702,21524,147893,22459,22771,22410,40214,22487,28980,13487,147884,29163,158784,151447,23336,137141,166473,24844,23246,23051,17084,148616,14124,19323,166396,37819,37816,137430,134941,33906,158912,136211,148218,142374,148417,22932,146871,157505,32168,155995,155812,149945,149899,166394,37605,29666,16105,29876,166755,137375,16097,150195,27352,29683,29691,16086,150078,150164,137177,150118,132007,136228,149989,29768,149782,28837,149878,37508,29670,37727,132350,37681,166606,166422,37766,166887,153045,18741,166530,29035,149827,134399,22180,132634,134123,134328,21762,31172,137210,32254,136898,150096,137298,17710,37889,14090,166592,149933,22960,137407,137347,160900,23201,14050,146779,14000,37471,23161,166529,137314,37748,15565,133812,19094,14730,20724,15721,15692,136092,29045,17147,164376,28175,168164,17643,27991,163407,28775,27823,15574,147437,146989,28162,28428,15727,132085,30033,14012,13512,18048,16090,18545,22980,37486,18750,36673,166940,158656,22546,22472,14038,136274,28926,148322,150129,143331,135856,140221,26809,26983,136088,144613,162804,145119,166531,145366,144378,150687,27162,145069,158903,33854,17631,17614,159014,159057,158850,159710,28439,160009,33597,137018,33773,158848,159827,137179,22921,23170,137139,23137,23153,137477,147964,14125,23023,137020,14023,29070,37776,26266,148133,23150,23083,148115,27179,147193,161590,148571,148170,28957,148057,166369,20400,159016,23746,148686,163405,148413,27148,148054,135940,28838,28979,148457,15781,27871,194597,150095,32357,23019,23855,15859,24412,150109,137183,32164,33830,21637,146170,144128,131604,22398,133333,132633,16357,139166,172726,28675,168283,23920,29583,31955,166489,168992,20424,32743,29389,29456,162548,29496,29497,153334,29505,29512,16041,162584,36972,29173,149746,29665,33270,16074,30476,16081,27810,22269,29721,29726,29727,16098,16112,16116,16122,29907,16142,16211,30018,30061,30066,30093,16252,30152,30172,16320,30285,16343,30324,16348,30330,151388,29064,22051,35200,22633,16413,30531,16441,26465,16453,13787,30616,16490,16495,23646,30654,30667,22770,30744,28857,30748,16552,30777,30791,30801,30822,33864,152885,31027,26627,31026,16643,16649,31121,31129,36795,31238,36796,16743,31377,16818,31420,33401,16836,31439,31451,16847,20001,31586,31596,31611,31762,31771,16992,17018,31867,31900,17036,31928,17044,31981,36755,28864,134351,32207,32212,32208,32253,32686,32692,29343,17303,32800,32805,31545,32814,32817,32852,15820,22452,28832,32951,33001,17389,33036,29482,33038,33042,30048,33044,17409,15161,33110,33113,33114,17427,22586,33148,33156,17445,33171,17453,33189,22511,33217,33252,33364,17551,33446,33398,33482,33496,33535,17584,33623,38505,27018,33797,28917,33892,24803,33928,17668,33982,34017,34040,34064,34104,34130,17723,34159,34160,34272,17783,34418,34450,34482,34543,38469,34699,17926,17943,34990,35071,35108,35143,35217,162151,35369,35384,35476,35508,35921,36052,36082,36124,18328,22623,36291,18413,20206,36410,21976,22356,36465,22005,36528,18487,36558,36578,36580,36589,36594,36791,36801,36810,36812,36915,39364,18605,39136,37395,18718,37416,37464,37483,37553,37550,37567,37603,37611,37619,37620,37629,37699,37764,37805,18757,18769,40639,37911,21249,37917,37933,37950,18794,37972,38009,38189,38306,18855,38388,38451,18917,26528,18980,38720,18997,38834,38850,22100,19172,24808,39097,19225,39153,22596,39182,39193,20916,39196,39223,39234,39261,39266,19312,39365,19357,39484,39695,31363,39785,39809,39901,39921,39924,19565,39968,14191,138178,40265,39994,40702,22096,40339,40381,40384,40444,38134,36790,40571,40620,40625,40637,40646,38108,40674,40689,40696,31432,40772,131220,131767,132000,26906,38083,22956,132311,22592,38081,14265,132565,132629,132726,136890,22359,29043,133826,133837,134079,21610,194619,134091,21662,134139,134203,134227,134245,134268,24807,134285,22138,134325,134365,134381,134511,134578,134600,26965,39983,34725,134660,134670,134871,135056,134957,134771,23584,135100,24075,135260,135247,135286,26398,135291,135304,135318,13895,135359,135379,135471,135483,21348,33965,135907,136053,135990,35713,136567,136729,137155,137159,20088,28859,137261,137578,137773,137797,138282,138352,138412,138952,25283,138965,139029,29080,26709,139333,27113,14024,139900,140247,140282,141098,141425,141647,33533,141671,141715,142037,35237,142056,36768,142094,38840,142143,38983,39613,142412,null,142472,142519,154600,142600,142610,142775,142741,142914,143220,143308,143411,143462,144159,144350,24497,26184,26303,162425,144743,144883,29185,149946,30679,144922,145174,32391,131910,22709,26382,26904,146087,161367,155618,146961,147129,161278,139418,18640,19128,147737,166554,148206,148237,147515,148276,148374,150085,132554,20946,132625,22943,138920,15294,146687,148484,148694,22408,149108,14747,149295,165352,170441,14178,139715,35678,166734,39382,149522,149755,150037,29193,150208,134264,22885,151205,151430,132985,36570,151596,21135,22335,29041,152217,152601,147274,150183,21948,152646,152686,158546,37332,13427,152895,161330,152926,18200,152930,152934,153543,149823,153693,20582,13563,144332,24798,153859,18300,166216,154286,154505,154630,138640,22433,29009,28598,155906,162834,36950,156082,151450,35682,156674,156746,23899,158711,36662,156804,137500,35562,150006,156808,147439,156946,19392,157119,157365,141083,37989,153569,24981,23079,194765,20411,22201,148769,157436,20074,149812,38486,28047,158909,13848,35191,157593,157806,156689,157790,29151,157895,31554,168128,133649,157990,37124,158009,31301,40432,158202,39462,158253,13919,156777,131105,31107,158260,158555,23852,144665,33743,158621,18128,158884,30011,34917,159150,22710,14108,140685,159819,160205,15444,160384,160389,37505,139642,160395,37680,160486,149968,27705,38047,160848,134904,34855,35061,141606,164979,137137,28344,150058,137248,14756,14009,23568,31203,17727,26294,171181,170148,35139,161740,161880,22230,16607,136714,14753,145199,164072,136133,29101,33638,162269,168360,23143,19639,159919,166315,162301,162314,162571,163174,147834,31555,31102,163849,28597,172767,27139,164632,21410,159239,37823,26678,38749,164207,163875,158133,136173,143919,163912,23941,166960,163971,22293,38947,166217,23979,149896,26046,27093,21458,150181,147329,15377,26422,163984,164084,164142,139169,164175,164233,164271,164378,164614,164655,164746,13770,164968,165546,18682,25574,166230,30728,37461,166328,17394,166375,17375,166376,166726,166868,23032,166921,36619,167877,168172,31569,168208,168252,15863,168286,150218,36816,29327,22155,169191,169449,169392,169400,169778,170193,170313,170346,170435,170536,170766,171354,171419,32415,171768,171811,19620,38215,172691,29090,172799,19857,36882,173515,19868,134300,36798,21953,36794,140464,36793,150163,17673,32383,28502,27313,20202,13540,166700,161949,14138,36480,137205,163876,166764,166809,162366,157359,15851,161365,146615,153141,153942,20122,155265,156248,22207,134765,36366,23405,147080,150686,25566,25296,137206,137339,25904,22061,154698,21530,152337,15814,171416,19581,22050,22046,32585,155352,22901,146752,34672,19996,135146,134473,145082,33047,40286,36120,30267,40005,30286,30649,37701,21554,33096,33527,22053,33074,33816,32957,21994,31074,22083,21526,134813,13774,22021,22001,26353,164578,13869,30004,22000,21946,21655,21874,134209,134294,24272,151880,134774,142434,134818,40619,32090,21982,135285,25245,38765,21652,36045,29174,37238,25596,25529,25598,21865,142147,40050,143027,20890,13535,134567,20903,21581,21790,21779,30310,36397,157834,30129,32950,34820,34694,35015,33206,33820,135361,17644,29444,149254,23440,33547,157843,22139,141044,163119,147875,163187,159440,160438,37232,135641,37384,146684,173737,134828,134905,29286,138402,18254,151490,163833,135147,16634,40029,25887,142752,18675,149472,171388,135148,134666,24674,161187,135149,null,155720,135559,29091,32398,40272,19994,19972,13687,23309,27826,21351,13996,14812,21373,13989,149016,22682,150382,33325,21579,22442,154261,133497,null,14930,140389,29556,171692,19721,39917,146686,171824,19547,151465,169374,171998,33884,146870,160434,157619,145184,25390,32037,147191,146988,14890,36872,21196,15988,13946,17897,132238,30272,23280,134838,30842,163630,22695,16575,22140,39819,23924,30292,173108,40581,19681,30201,14331,24857,143578,148466,null,22109,135849,22439,149859,171526,21044,159918,13741,27722,40316,31830,39737,22494,137068,23635,25811,169168,156469,160100,34477,134440,159010,150242,134513,null,20990,139023,23950,38659,138705,40577,36940,31519,39682,23761,31651,25192,25397,39679,31695,39722,31870,39726,31810,31878,39957,31740,39689,40727,39963,149822,40794,21875,23491,20477,40600,20466,21088,15878,21201,22375,20566,22967,24082,38856,40363,36700,21609,38836,39232,38842,21292,24880,26924,21466,39946,40194,19515,38465,27008,20646,30022,137069,39386,21107,null,37209,38529,37212,null,37201,167575,25471,159011,27338,22033,37262,30074,25221,132092,29519,31856,154657,146685,null,149785,30422,39837,20010,134356,33726,34882,null,23626,27072,20717,22394,21023,24053,20174,27697,131570,20281,21660,21722,21146,36226,13822,24332,13811,null,27474,37244,40869,39831,38958,39092,39610,40616,40580,29050,31508,null,27642,34840,32632,null,22048,173642,36471,40787,null,36308,36431,40476,36353,25218,164733,36392,36469,31443,150135,31294,30936,27882,35431,30215,166490,40742,27854,34774,30147,172722,30803,194624,36108,29410,29553,35629,29442,29937,36075,150203,34351,24506,34976,17591,null,137275,159237,null,35454,140571,null,24829,30311,39639,40260,37742,39823,34805,null,34831,36087,29484,38689,39856,13782,29362,19463,31825,39242,155993,24921,19460,40598,24957,null,22367,24943,25254,25145,25294,14940,25058,21418,144373,25444,26626,13778,23895,166850,36826,167481,null,20697,138566,30982,21298,38456,134971,16485,null,30718,null,31938,155418,31962,31277,32870,32867,32077,29957,29938,35220,33306,26380,32866,160902,32859,29936,33027,30500,35209,157644,30035,159441,34729,34766,33224,34700,35401,36013,35651,30507,29944,34010,13877,27058,36262,null,35241,29800,28089,34753,147473,29927,15835,29046,24740,24988,15569,29026,24695,null,32625,166701,29264,24809,19326,21024,15384,146631,155351,161366,152881,137540,135934,170243,159196,159917,23745,156077,166415,145015,131310,157766,151310,17762,23327,156492,40784,40614,156267,12288,65292,12289,12290,65294,8231,65307,65306,65311,65281,65072,8230,8229,65104,65105,65106,183,65108,65109,65110,65111,65372,8211,65073,8212,65075,9588,65076,65103,65288,65289,65077,65078,65371,65373,65079,65080,12308,12309,65081,65082,12304,12305,65083,65084,12298,12299,65085,65086,12296,12297,65087,65088,12300,12301,65089,65090,12302,12303,65091,65092,65113,65114,65115,65116,65117,65118,8216,8217,8220,8221,12317,12318,8245,8242,65283,65286,65290,8251,167,12291,9675,9679,9651,9650,9678,9734,9733,9671,9670,9633,9632,9661,9660,12963,8453,175,65507,65343,717,65097,65098,65101,65102,65099,65100,65119,65120,65121,65291,65293,215,247,177,8730,65308,65310,65309,8806,8807,8800,8734,8786,8801,65122,65123,65124,65125,65126,65374,8745,8746,8869,8736,8735,8895,13266,13265,8747,8750,8757,8756,9792,9794,8853,8857,8593,8595,8592,8594,8598,8599,8601,8600,8741,8739,65295,65340,8725,65128,65284,65509,12306,65504,65505,65285,65312,8451,8457,65129,65130,65131,13269,13212,13213,13214,13262,13217,13198,13199,13252,176,20825,20827,20830,20829,20833,20835,21991,29929,31950,9601,9602,9603,9604,9605,9606,9607,9608,9615,9614,9613,9612,9611,9610,9609,9532,9524,9516,9508,9500,9620,9472,9474,9621,9484,9488,9492,9496,9581,9582,9584,9583,9552,9566,9578,9569,9698,9699,9701,9700,9585,9586,9587,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,12321,12322,12323,12324,12325,12326,12327,12328,12329,21313,21316,21317,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,729,713,714,711,715,9216,9217,9218,9219,9220,9221,9222,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,9246,9247,9249,8364,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,19968,20057,19969,19971,20035,20061,20102,20108,20154,20799,20837,20843,20960,20992,20993,21147,21269,21313,21340,21448,19977,19979,19976,19978,20011,20024,20961,20037,20040,20063,20062,20110,20129,20800,20995,21242,21315,21449,21475,22303,22763,22805,22823,22899,23376,23377,23379,23544,23567,23586,23608,23665,24029,24037,24049,24050,24051,24062,24178,24318,24331,24339,25165,19985,19984,19981,20013,20016,20025,20043,23609,20104,20113,20117,20114,20116,20130,20161,20160,20163,20166,20167,20173,20170,20171,20164,20803,20801,20839,20845,20846,20844,20887,20982,20998,20999,21000,21243,21246,21247,21270,21305,21320,21319,21317,21342,21380,21451,21450,21453,22764,22825,22827,22826,22829,23380,23569,23588,23610,23663,24052,24187,24319,24340,24341,24515,25096,25142,25163,25166,25903,25991,26007,26020,26041,26085,26352,26376,26408,27424,27490,27513,27595,27604,27611,27663,27700,28779,29226,29238,29243,29255,29273,29275,29356,29579,19993,19990,19989,19988,19992,20027,20045,20047,20046,20197,20184,20180,20181,20182,20183,20195,20196,20185,20190,20805,20804,20873,20874,20908,20985,20986,20984,21002,21152,21151,21253,21254,21271,21277,20191,21322,21321,21345,21344,21359,21358,21435,21487,21476,21491,21484,21486,21481,21480,21500,21496,21493,21483,21478,21482,21490,21489,21488,21477,21485,21499,22235,22234,22806,22830,22833,22900,22902,23381,23427,23612,24040,24039,24038,24066,24067,24179,24188,24321,24344,24343,24517,25098,25171,25172,25170,25169,26021,26086,26414,26412,26410,26411,26413,27491,27597,27665,27664,27704,27713,27712,27710,29359,29572,29577,29916,29926,29976,29983,29992,29993,30000,30001,30002,30003,30091,30333,30382,30399,30446,30683,30690,30707,31034,31166,31348,31435,19998,19999,20050,20051,20073,20121,20132,20134,20133,20223,20233,20249,20234,20245,20237,20240,20241,20239,20210,20214,20219,20208,20211,20221,20225,20235,20809,20807,20806,20808,20840,20849,20877,20912,21015,21009,21010,21006,21014,21155,21256,21281,21280,21360,21361,21513,21519,21516,21514,21520,21505,21515,21508,21521,21517,21512,21507,21518,21510,21522,22240,22238,22237,22323,22320,22312,22317,22316,22319,22313,22809,22810,22839,22840,22916,22904,22915,22909,22905,22914,22913,23383,23384,23431,23432,23429,23433,23546,23574,23673,24030,24070,24182,24180,24335,24347,24537,24534,25102,25100,25101,25104,25187,25179,25176,25910,26089,26088,26092,26093,26354,26355,26377,26429,26420,26417,26421,27425,27492,27515,27670,27741,27735,27737,27743,27744,27728,27733,27745,27739,27725,27726,28784,29279,29277,30334,31481,31859,31992,32566,32650,32701,32769,32771,32780,32786,32819,32895,32905,32907,32908,33251,33258,33267,33276,33292,33307,33311,33390,33394,33406,34411,34880,34892,34915,35199,38433,20018,20136,20301,20303,20295,20311,20318,20276,20315,20309,20272,20304,20305,20285,20282,20280,20291,20308,20284,20294,20323,20316,20320,20271,20302,20278,20313,20317,20296,20314,20812,20811,20813,20853,20918,20919,21029,21028,21033,21034,21032,21163,21161,21162,21164,21283,21363,21365,21533,21549,21534,21566,21542,21582,21543,21574,21571,21555,21576,21570,21531,21545,21578,21561,21563,21560,21550,21557,21558,21536,21564,21568,21553,21547,21535,21548,22250,22256,22244,22251,22346,22353,22336,22349,22343,22350,22334,22352,22351,22331,22767,22846,22941,22930,22952,22942,22947,22937,22934,22925,22948,22931,22922,22949,23389,23388,23386,23387,23436,23435,23439,23596,23616,23617,23615,23614,23696,23697,23700,23692,24043,24076,24207,24199,24202,24311,24324,24351,24420,24418,24439,24441,24536,24524,24535,24525,24561,24555,24568,24554,25106,25105,25220,25239,25238,25216,25206,25225,25197,25226,25212,25214,25209,25203,25234,25199,25240,25198,25237,25235,25233,25222,25913,25915,25912,26097,26356,26463,26446,26447,26448,26449,26460,26454,26462,26441,26438,26464,26451,26455,27493,27599,27714,27742,27801,27777,27784,27785,27781,27803,27754,27770,27792,27760,27788,27752,27798,27794,27773,27779,27762,27774,27764,27782,27766,27789,27796,27800,27778,28790,28796,28797,28792,29282,29281,29280,29380,29378,29590,29996,29995,30007,30008,30338,30447,30691,31169,31168,31167,31350,31995,32597,32918,32915,32925,32920,32923,32922,32946,33391,33426,33419,33421,35211,35282,35328,35895,35910,35925,35997,36196,36208,36275,36523,36554,36763,36784,36802,36806,36805,36804,24033,37009,37026,37034,37030,37027,37193,37318,37324,38450,38446,38449,38442,38444,20006,20054,20083,20107,20123,20126,20139,20140,20335,20381,20365,20339,20351,20332,20379,20363,20358,20355,20336,20341,20360,20329,20347,20374,20350,20367,20369,20346,20820,20818,20821,20841,20855,20854,20856,20925,20989,21051,21048,21047,21050,21040,21038,21046,21057,21182,21179,21330,21332,21331,21329,21350,21367,21368,21369,21462,21460,21463,21619,21621,21654,21624,21653,21632,21627,21623,21636,21650,21638,21628,21648,21617,21622,21644,21658,21602,21608,21643,21629,21646,22266,22403,22391,22378,22377,22369,22374,22372,22396,22812,22857,22855,22856,22852,22868,22974,22971,22996,22969,22958,22993,22982,22992,22989,22987,22995,22986,22959,22963,22994,22981,23391,23396,23395,23447,23450,23448,23452,23449,23451,23578,23624,23621,23622,23735,23713,23736,23721,23723,23729,23731,24088,24090,24086,24085,24091,24081,24184,24218,24215,24220,24213,24214,24310,24358,24359,24361,24448,24449,24447,24444,24541,24544,24573,24565,24575,24591,24596,24623,24629,24598,24618,24597,24609,24615,24617,24619,24603,25110,25109,25151,25150,25152,25215,25289,25292,25284,25279,25282,25273,25298,25307,25259,25299,25300,25291,25288,25256,25277,25276,25296,25305,25287,25293,25269,25306,25265,25304,25302,25303,25286,25260,25294,25918,26023,26044,26106,26132,26131,26124,26118,26114,26126,26112,26127,26133,26122,26119,26381,26379,26477,26507,26517,26481,26524,26483,26487,26503,26525,26519,26479,26480,26495,26505,26494,26512,26485,26522,26515,26492,26474,26482,27427,27494,27495,27519,27667,27675,27875,27880,27891,27825,27852,27877,27827,27837,27838,27836,27874,27819,27861,27859,27832,27844,27833,27841,27822,27863,27845,27889,27839,27835,27873,27867,27850,27820,27887,27868,27862,27872,28821,28814,28818,28810,28825,29228,29229,29240,29256,29287,29289,29376,29390,29401,29399,29392,29609,29608,29599,29611,29605,30013,30109,30105,30106,30340,30402,30450,30452,30693,30717,31038,31040,31041,31177,31176,31354,31353,31482,31998,32596,32652,32651,32773,32954,32933,32930,32945,32929,32939,32937,32948,32938,32943,33253,33278,33293,33459,33437,33433,33453,33469,33439,33465,33457,33452,33445,33455,33464,33443,33456,33470,33463,34382,34417,21021,34920,36555,36814,36820,36817,37045,37048,37041,37046,37319,37329,38263,38272,38428,38464,38463,38459,38468,38466,38585,38632,38738,38750,20127,20141,20142,20449,20405,20399,20415,20448,20433,20431,20445,20419,20406,20440,20447,20426,20439,20398,20432,20420,20418,20442,20430,20446,20407,20823,20882,20881,20896,21070,21059,21066,21069,21068,21067,21063,21191,21193,21187,21185,21261,21335,21371,21402,21467,21676,21696,21672,21710,21705,21688,21670,21683,21703,21698,21693,21674,21697,21700,21704,21679,21675,21681,21691,21673,21671,21695,22271,22402,22411,22432,22435,22434,22478,22446,22419,22869,22865,22863,22862,22864,23004,23000,23039,23011,23016,23043,23013,23018,23002,23014,23041,23035,23401,23459,23462,23460,23458,23461,23553,23630,23631,23629,23627,23769,23762,24055,24093,24101,24095,24189,24224,24230,24314,24328,24365,24421,24456,24453,24458,24459,24455,24460,24457,24594,24605,24608,24613,24590,24616,24653,24688,24680,24674,24646,24643,24684,24683,24682,24676,25153,25308,25366,25353,25340,25325,25345,25326,25341,25351,25329,25335,25327,25324,25342,25332,25361,25346,25919,25925,26027,26045,26082,26149,26157,26144,26151,26159,26143,26152,26161,26148,26359,26623,26579,26609,26580,26576,26604,26550,26543,26613,26601,26607,26564,26577,26548,26586,26597,26552,26575,26590,26611,26544,26585,26594,26589,26578,27498,27523,27526,27573,27602,27607,27679,27849,27915,27954,27946,27969,27941,27916,27953,27934,27927,27963,27965,27966,27958,27931,27893,27961,27943,27960,27945,27950,27957,27918,27947,28843,28858,28851,28844,28847,28845,28856,28846,28836,29232,29298,29295,29300,29417,29408,29409,29623,29642,29627,29618,29645,29632,29619,29978,29997,30031,30028,30030,30027,30123,30116,30117,30114,30115,30328,30342,30343,30344,30408,30406,30403,30405,30465,30457,30456,30473,30475,30462,30460,30471,30684,30722,30740,30732,30733,31046,31049,31048,31047,31161,31162,31185,31186,31179,31359,31361,31487,31485,31869,32002,32005,32000,32009,32007,32004,32006,32568,32654,32703,32772,32784,32781,32785,32822,32982,32997,32986,32963,32964,32972,32993,32987,32974,32990,32996,32989,33268,33314,33511,33539,33541,33507,33499,33510,33540,33509,33538,33545,33490,33495,33521,33537,33500,33492,33489,33502,33491,33503,33519,33542,34384,34425,34427,34426,34893,34923,35201,35284,35336,35330,35331,35998,36000,36212,36211,36276,36557,36556,36848,36838,36834,36842,36837,36845,36843,36836,36840,37066,37070,37057,37059,37195,37194,37325,38274,38480,38475,38476,38477,38754,38761,38859,38893,38899,38913,39080,39131,39135,39318,39321,20056,20147,20492,20493,20515,20463,20518,20517,20472,20521,20502,20486,20540,20511,20506,20498,20497,20474,20480,20500,20520,20465,20513,20491,20505,20504,20467,20462,20525,20522,20478,20523,20489,20860,20900,20901,20898,20941,20940,20934,20939,21078,21084,21076,21083,21085,21290,21375,21407,21405,21471,21736,21776,21761,21815,21756,21733,21746,21766,21754,21780,21737,21741,21729,21769,21742,21738,21734,21799,21767,21757,21775,22275,22276,22466,22484,22475,22467,22537,22799,22871,22872,22874,23057,23064,23068,23071,23067,23059,23020,23072,23075,23081,23077,23052,23049,23403,23640,23472,23475,23478,23476,23470,23477,23481,23480,23556,23633,23637,23632,23789,23805,23803,23786,23784,23792,23798,23809,23796,24046,24109,24107,24235,24237,24231,24369,24466,24465,24464,24665,24675,24677,24656,24661,24685,24681,24687,24708,24735,24730,24717,24724,24716,24709,24726,25159,25331,25352,25343,25422,25406,25391,25429,25410,25414,25423,25417,25402,25424,25405,25386,25387,25384,25421,25420,25928,25929,26009,26049,26053,26178,26185,26191,26179,26194,26188,26181,26177,26360,26388,26389,26391,26657,26680,26696,26694,26707,26681,26690,26708,26665,26803,26647,26700,26705,26685,26612,26704,26688,26684,26691,26666,26693,26643,26648,26689,27530,27529,27575,27683,27687,27688,27686,27684,27888,28010,28053,28040,28039,28006,28024,28023,27993,28051,28012,28041,28014,27994,28020,28009,28044,28042,28025,28037,28005,28052,28874,28888,28900,28889,28872,28879,29241,29305,29436,29433,29437,29432,29431,29574,29677,29705,29678,29664,29674,29662,30036,30045,30044,30042,30041,30142,30149,30151,30130,30131,30141,30140,30137,30146,30136,30347,30384,30410,30413,30414,30505,30495,30496,30504,30697,30768,30759,30776,30749,30772,30775,30757,30765,30752,30751,30770,31061,31056,31072,31071,31062,31070,31069,31063,31066,31204,31203,31207,31199,31206,31209,31192,31364,31368,31449,31494,31505,31881,32033,32023,32011,32010,32032,32034,32020,32016,32021,32026,32028,32013,32025,32027,32570,32607,32660,32709,32705,32774,32792,32789,32793,32791,32829,32831,33009,33026,33008,33029,33005,33012,33030,33016,33011,33032,33021,33034,33020,33007,33261,33260,33280,33296,33322,33323,33320,33324,33467,33579,33618,33620,33610,33592,33616,33609,33589,33588,33615,33586,33593,33590,33559,33600,33585,33576,33603,34388,34442,34474,34451,34468,34473,34444,34467,34460,34928,34935,34945,34946,34941,34937,35352,35344,35342,35340,35349,35338,35351,35347,35350,35343,35345,35912,35962,35961,36001,36002,36215,36524,36562,36564,36559,36785,36865,36870,36855,36864,36858,36852,36867,36861,36869,36856,37013,37089,37085,37090,37202,37197,37196,37336,37341,37335,37340,37337,38275,38498,38499,38497,38491,38493,38500,38488,38494,38587,39138,39340,39592,39640,39717,39730,39740,20094,20602,20605,20572,20551,20547,20556,20570,20553,20581,20598,20558,20565,20597,20596,20599,20559,20495,20591,20589,20828,20885,20976,21098,21103,21202,21209,21208,21205,21264,21263,21273,21311,21312,21310,21443,26364,21830,21866,21862,21828,21854,21857,21827,21834,21809,21846,21839,21845,21807,21860,21816,21806,21852,21804,21859,21811,21825,21847,22280,22283,22281,22495,22533,22538,22534,22496,22500,22522,22530,22581,22519,22521,22816,22882,23094,23105,23113,23142,23146,23104,23100,23138,23130,23110,23114,23408,23495,23493,23492,23490,23487,23494,23561,23560,23559,23648,23644,23645,23815,23814,23822,23835,23830,23842,23825,23849,23828,23833,23844,23847,23831,24034,24120,24118,24115,24119,24247,24248,24246,24245,24254,24373,24375,24407,24428,24425,24427,24471,24473,24478,24472,24481,24480,24476,24703,24739,24713,24736,24744,24779,24756,24806,24765,24773,24763,24757,24796,24764,24792,24789,24774,24799,24760,24794,24775,25114,25115,25160,25504,25511,25458,25494,25506,25509,25463,25447,25496,25514,25457,25513,25481,25475,25499,25451,25512,25476,25480,25497,25505,25516,25490,25487,25472,25467,25449,25448,25466,25949,25942,25937,25945,25943,21855,25935,25944,25941,25940,26012,26011,26028,26063,26059,26060,26062,26205,26202,26212,26216,26214,26206,26361,21207,26395,26753,26799,26786,26771,26805,26751,26742,26801,26791,26775,26800,26755,26820,26797,26758,26757,26772,26781,26792,26783,26785,26754,27442,27578,27627,27628,27691,28046,28092,28147,28121,28082,28129,28108,28132,28155,28154,28165,28103,28107,28079,28113,28078,28126,28153,28088,28151,28149,28101,28114,28186,28085,28122,28139,28120,28138,28145,28142,28136,28102,28100,28074,28140,28095,28134,28921,28937,28938,28925,28911,29245,29309,29313,29468,29467,29462,29459,29465,29575,29701,29706,29699,29702,29694,29709,29920,29942,29943,29980,29986,30053,30054,30050,30064,30095,30164,30165,30133,30154,30157,30350,30420,30418,30427,30519,30526,30524,30518,30520,30522,30827,30787,30798,31077,31080,31085,31227,31378,31381,31520,31528,31515,31532,31526,31513,31518,31534,31890,31895,31893,32070,32067,32113,32046,32057,32060,32064,32048,32051,32068,32047,32066,32050,32049,32573,32670,32666,32716,32718,32722,32796,32842,32838,33071,33046,33059,33067,33065,33072,33060,33282,33333,33335,33334,33337,33678,33694,33688,33656,33698,33686,33725,33707,33682,33674,33683,33673,33696,33655,33659,33660,33670,33703,34389,24426,34503,34496,34486,34500,34485,34502,34507,34481,34479,34505,34899,34974,34952,34987,34962,34966,34957,34955,35219,35215,35370,35357,35363,35365,35377,35373,35359,35355,35362,35913,35930,36009,36012,36011,36008,36010,36007,36199,36198,36286,36282,36571,36575,36889,36877,36890,36887,36899,36895,36893,36880,36885,36894,36896,36879,36898,36886,36891,36884,37096,37101,37117,37207,37326,37365,37350,37347,37351,37357,37353,38281,38506,38517,38515,38520,38512,38516,38518,38519,38508,38592,38634,38633,31456,31455,38914,38915,39770,40165,40565,40575,40613,40635,20642,20621,20613,20633,20625,20608,20630,20632,20634,26368,20977,21106,21108,21109,21097,21214,21213,21211,21338,21413,21883,21888,21927,21884,21898,21917,21912,21890,21916,21930,21908,21895,21899,21891,21939,21934,21919,21822,21938,21914,21947,21932,21937,21886,21897,21931,21913,22285,22575,22570,22580,22564,22576,22577,22561,22557,22560,22777,22778,22880,23159,23194,23167,23186,23195,23207,23411,23409,23506,23500,23507,23504,23562,23563,23601,23884,23888,23860,23879,24061,24133,24125,24128,24131,24190,24266,24257,24258,24260,24380,24429,24489,24490,24488,24785,24801,24754,24758,24800,24860,24867,24826,24853,24816,24827,24820,24936,24817,24846,24822,24841,24832,24850,25119,25161,25507,25484,25551,25536,25577,25545,25542,25549,25554,25571,25552,25569,25558,25581,25582,25462,25588,25578,25563,25682,25562,25593,25950,25958,25954,25955,26001,26000,26031,26222,26224,26228,26230,26223,26257,26234,26238,26231,26366,26367,26399,26397,26874,26837,26848,26840,26839,26885,26847,26869,26862,26855,26873,26834,26866,26851,26827,26829,26893,26898,26894,26825,26842,26990,26875,27454,27450,27453,27544,27542,27580,27631,27694,27695,27692,28207,28216,28244,28193,28210,28263,28234,28192,28197,28195,28187,28251,28248,28196,28246,28270,28205,28198,28271,28212,28237,28218,28204,28227,28189,28222,28363,28297,28185,28238,28259,28228,28274,28265,28255,28953,28954,28966,28976,28961,28982,29038,28956,29260,29316,29312,29494,29477,29492,29481,29754,29738,29747,29730,29733,29749,29750,29748,29743,29723,29734,29736,29989,29990,30059,30058,30178,30171,30179,30169,30168,30174,30176,30331,30332,30358,30355,30388,30428,30543,30701,30813,30828,30831,31245,31240,31243,31237,31232,31384,31383,31382,31461,31459,31561,31574,31558,31568,31570,31572,31565,31563,31567,31569,31903,31909,32094,32080,32104,32085,32043,32110,32114,32097,32102,32098,32112,32115,21892,32724,32725,32779,32850,32901,33109,33108,33099,33105,33102,33081,33094,33086,33100,33107,33140,33298,33308,33769,33795,33784,33805,33760,33733,33803,33729,33775,33777,33780,33879,33802,33776,33804,33740,33789,33778,33738,33848,33806,33796,33756,33799,33748,33759,34395,34527,34521,34541,34516,34523,34532,34512,34526,34903,35009,35010,34993,35203,35222,35387,35424,35413,35422,35388,35393,35412,35419,35408,35398,35380,35386,35382,35414,35937,35970,36015,36028,36019,36029,36033,36027,36032,36020,36023,36022,36031,36024,36234,36229,36225,36302,36317,36299,36314,36305,36300,36315,36294,36603,36600,36604,36764,36910,36917,36913,36920,36914,36918,37122,37109,37129,37118,37219,37221,37327,37396,37397,37411,37385,37406,37389,37392,37383,37393,38292,38287,38283,38289,38291,38290,38286,38538,38542,38539,38525,38533,38534,38541,38514,38532,38593,38597,38596,38598,38599,38639,38642,38860,38917,38918,38920,39143,39146,39151,39145,39154,39149,39342,39341,40643,40653,40657,20098,20653,20661,20658,20659,20677,20670,20652,20663,20667,20655,20679,21119,21111,21117,21215,21222,21220,21218,21219,21295,21983,21992,21971,21990,21966,21980,21959,21969,21987,21988,21999,21978,21985,21957,21958,21989,21961,22290,22291,22622,22609,22616,22615,22618,22612,22635,22604,22637,22602,22626,22610,22603,22887,23233,23241,23244,23230,23229,23228,23219,23234,23218,23913,23919,24140,24185,24265,24264,24338,24409,24492,24494,24858,24847,24904,24863,24819,24859,24825,24833,24840,24910,24908,24900,24909,24894,24884,24871,24845,24838,24887,25121,25122,25619,25662,25630,25642,25645,25661,25644,25615,25628,25620,25613,25654,25622,25623,25606,25964,26015,26032,26263,26249,26247,26248,26262,26244,26264,26253,26371,27028,26989,26970,26999,26976,26964,26997,26928,27010,26954,26984,26987,26974,26963,27001,27014,26973,26979,26971,27463,27506,27584,27583,27603,27645,28322,28335,28371,28342,28354,28304,28317,28359,28357,28325,28312,28348,28346,28331,28369,28310,28316,28356,28372,28330,28327,28340,29006,29017,29033,29028,29001,29031,29020,29036,29030,29004,29029,29022,28998,29032,29014,29242,29266,29495,29509,29503,29502,29807,29786,29781,29791,29790,29761,29759,29785,29787,29788,30070,30072,30208,30192,30209,30194,30193,30202,30207,30196,30195,30430,30431,30555,30571,30566,30558,30563,30585,30570,30572,30556,30565,30568,30562,30702,30862,30896,30871,30872,30860,30857,30844,30865,30867,30847,31098,31103,31105,33836,31165,31260,31258,31264,31252,31263,31262,31391,31392,31607,31680,31584,31598,31591,31921,31923,31925,32147,32121,32145,32129,32143,32091,32622,32617,32618,32626,32681,32680,32676,32854,32856,32902,32900,33137,33136,33144,33125,33134,33139,33131,33145,33146,33126,33285,33351,33922,33911,33853,33841,33909,33894,33899,33865,33900,33883,33852,33845,33889,33891,33897,33901,33862,34398,34396,34399,34553,34579,34568,34567,34560,34558,34555,34562,34563,34566,34570,34905,35039,35028,35033,35036,35032,35037,35041,35018,35029,35026,35228,35299,35435,35442,35443,35430,35433,35440,35463,35452,35427,35488,35441,35461,35437,35426,35438,35436,35449,35451,35390,35432,35938,35978,35977,36042,36039,36040,36036,36018,36035,36034,36037,36321,36319,36328,36335,36339,36346,36330,36324,36326,36530,36611,36617,36606,36618,36767,36786,36939,36938,36947,36930,36948,36924,36949,36944,36935,36943,36942,36941,36945,36926,36929,37138,37143,37228,37226,37225,37321,37431,37463,37432,37437,37440,37438,37467,37451,37476,37457,37428,37449,37453,37445,37433,37439,37466,38296,38552,38548,38549,38605,38603,38601,38602,38647,38651,38649,38646,38742,38772,38774,38928,38929,38931,38922,38930,38924,39164,39156,39165,39166,39347,39345,39348,39649,40169,40578,40718,40723,40736,20711,20718,20709,20694,20717,20698,20693,20687,20689,20721,20686,20713,20834,20979,21123,21122,21297,21421,22014,22016,22043,22039,22013,22036,22022,22025,22029,22030,22007,22038,22047,22024,22032,22006,22296,22294,22645,22654,22659,22675,22666,22649,22661,22653,22781,22821,22818,22820,22890,22889,23265,23270,23273,23255,23254,23256,23267,23413,23518,23527,23521,23525,23526,23528,23522,23524,23519,23565,23650,23940,23943,24155,24163,24149,24151,24148,24275,24278,24330,24390,24432,24505,24903,24895,24907,24951,24930,24931,24927,24922,24920,24949,25130,25735,25688,25684,25764,25720,25695,25722,25681,25703,25652,25709,25723,25970,26017,26071,26070,26274,26280,26269,27036,27048,27029,27073,27054,27091,27083,27035,27063,27067,27051,27060,27088,27085,27053,27084,27046,27075,27043,27465,27468,27699,28467,28436,28414,28435,28404,28457,28478,28448,28460,28431,28418,28450,28415,28399,28422,28465,28472,28466,28451,28437,28459,28463,28552,28458,28396,28417,28402,28364,28407,29076,29081,29053,29066,29060,29074,29246,29330,29334,29508,29520,29796,29795,29802,29808,29805,29956,30097,30247,30221,30219,30217,30227,30433,30435,30596,30589,30591,30561,30913,30879,30887,30899,30889,30883,31118,31119,31117,31278,31281,31402,31401,31469,31471,31649,31637,31627,31605,31639,31645,31636,31631,31672,31623,31620,31929,31933,31934,32187,32176,32156,32189,32190,32160,32202,32180,32178,32177,32186,32162,32191,32181,32184,32173,32210,32199,32172,32624,32736,32737,32735,32862,32858,32903,33104,33152,33167,33160,33162,33151,33154,33255,33274,33287,33300,33310,33355,33993,33983,33990,33988,33945,33950,33970,33948,33995,33976,33984,34003,33936,33980,34001,33994,34623,34588,34619,34594,34597,34612,34584,34645,34615,34601,35059,35074,35060,35065,35064,35069,35048,35098,35055,35494,35468,35486,35491,35469,35489,35475,35492,35498,35493,35496,35480,35473,35482,35495,35946,35981,35980,36051,36049,36050,36203,36249,36245,36348,36628,36626,36629,36627,36771,36960,36952,36956,36963,36953,36958,36962,36957,36955,37145,37144,37150,37237,37240,37239,37236,37496,37504,37509,37528,37526,37499,37523,37532,37544,37500,37521,38305,38312,38313,38307,38309,38308,38553,38556,38555,38604,38610,38656,38780,38789,38902,38935,38936,39087,39089,39171,39173,39180,39177,39361,39599,39600,39654,39745,39746,40180,40182,40179,40636,40763,40778,20740,20736,20731,20725,20729,20738,20744,20745,20741,20956,21127,21128,21129,21133,21130,21232,21426,22062,22075,22073,22066,22079,22068,22057,22099,22094,22103,22132,22070,22063,22064,22656,22687,22686,22707,22684,22702,22697,22694,22893,23305,23291,23307,23285,23308,23304,23534,23532,23529,23531,23652,23653,23965,23956,24162,24159,24161,24290,24282,24287,24285,24291,24288,24392,24433,24503,24501,24950,24935,24942,24925,24917,24962,24956,24944,24939,24958,24999,24976,25003,24974,25004,24986,24996,24980,25006,25134,25705,25711,25721,25758,25778,25736,25744,25776,25765,25747,25749,25769,25746,25774,25773,25771,25754,25772,25753,25762,25779,25973,25975,25976,26286,26283,26292,26289,27171,27167,27112,27137,27166,27161,27133,27169,27155,27146,27123,27138,27141,27117,27153,27472,27470,27556,27589,27590,28479,28540,28548,28497,28518,28500,28550,28525,28507,28536,28526,28558,28538,28528,28516,28567,28504,28373,28527,28512,28511,29087,29100,29105,29096,29270,29339,29518,29527,29801,29835,29827,29822,29824,30079,30240,30249,30239,30244,30246,30241,30242,30362,30394,30436,30606,30599,30604,30609,30603,30923,30917,30906,30922,30910,30933,30908,30928,31295,31292,31296,31293,31287,31291,31407,31406,31661,31665,31684,31668,31686,31687,31681,31648,31692,31946,32224,32244,32239,32251,32216,32236,32221,32232,32227,32218,32222,32233,32158,32217,32242,32249,32629,32631,32687,32745,32806,33179,33180,33181,33184,33178,33176,34071,34109,34074,34030,34092,34093,34067,34065,34083,34081,34068,34028,34085,34047,34054,34690,34676,34678,34656,34662,34680,34664,34649,34647,34636,34643,34907,34909,35088,35079,35090,35091,35093,35082,35516,35538,35527,35524,35477,35531,35576,35506,35529,35522,35519,35504,35542,35533,35510,35513,35547,35916,35918,35948,36064,36062,36070,36068,36076,36077,36066,36067,36060,36074,36065,36205,36255,36259,36395,36368,36381,36386,36367,36393,36383,36385,36382,36538,36637,36635,36639,36649,36646,36650,36636,36638,36645,36969,36974,36968,36973,36983,37168,37165,37159,37169,37255,37257,37259,37251,37573,37563,37559,37610,37548,37604,37569,37555,37564,37586,37575,37616,37554,38317,38321,38660,38662,38663,38665,38752,38797,38795,38799,38945,38955,38940,39091,39178,39187,39186,39192,39389,39376,39391,39387,39377,39381,39378,39385,39607,39662,39663,39719,39749,39748,39799,39791,40198,40201,40195,40617,40638,40654,22696,40786,20754,20760,20756,20752,20757,20864,20906,20957,21137,21139,21235,22105,22123,22137,22121,22116,22136,22122,22120,22117,22129,22127,22124,22114,22134,22721,22718,22727,22725,22894,23325,23348,23416,23536,23566,24394,25010,24977,25001,24970,25037,25014,25022,25034,25032,25136,25797,25793,25803,25787,25788,25818,25796,25799,25794,25805,25791,25810,25812,25790,25972,26310,26313,26297,26308,26311,26296,27197,27192,27194,27225,27243,27224,27193,27204,27234,27233,27211,27207,27189,27231,27208,27481,27511,27653,28610,28593,28577,28611,28580,28609,28583,28595,28608,28601,28598,28582,28576,28596,29118,29129,29136,29138,29128,29141,29113,29134,29145,29148,29123,29124,29544,29852,29859,29848,29855,29854,29922,29964,29965,30260,30264,30266,30439,30437,30624,30622,30623,30629,30952,30938,30956,30951,31142,31309,31310,31302,31308,31307,31418,31705,31761,31689,31716,31707,31713,31721,31718,31957,31958,32266,32273,32264,32283,32291,32286,32285,32265,32272,32633,32690,32752,32753,32750,32808,33203,33193,33192,33275,33288,33368,33369,34122,34137,34120,34152,34153,34115,34121,34157,34154,34142,34691,34719,34718,34722,34701,34913,35114,35122,35109,35115,35105,35242,35238,35558,35578,35563,35569,35584,35548,35559,35566,35582,35585,35586,35575,35565,35571,35574,35580,35947,35949,35987,36084,36420,36401,36404,36418,36409,36405,36667,36655,36664,36659,36776,36774,36981,36980,36984,36978,36988,36986,37172,37266,37664,37686,37624,37683,37679,37666,37628,37675,37636,37658,37648,37670,37665,37653,37678,37657,38331,38567,38568,38570,38613,38670,38673,38678,38669,38675,38671,38747,38748,38758,38808,38960,38968,38971,38967,38957,38969,38948,39184,39208,39198,39195,39201,39194,39405,39394,39409,39608,39612,39675,39661,39720,39825,40213,40227,40230,40232,40210,40219,40664,40660,40845,40860,20778,20767,20769,20786,21237,22158,22144,22160,22149,22151,22159,22741,22739,22737,22734,23344,23338,23332,23418,23607,23656,23996,23994,23997,23992,24171,24396,24509,25033,25026,25031,25062,25035,25138,25140,25806,25802,25816,25824,25840,25830,25836,25841,25826,25837,25986,25987,26329,26326,27264,27284,27268,27298,27292,27355,27299,27262,27287,27280,27296,27484,27566,27610,27656,28632,28657,28639,28640,28635,28644,28651,28655,28544,28652,28641,28649,28629,28654,28656,29159,29151,29166,29158,29157,29165,29164,29172,29152,29237,29254,29552,29554,29865,29872,29862,29864,30278,30274,30284,30442,30643,30634,30640,30636,30631,30637,30703,30967,30970,30964,30959,30977,31143,31146,31319,31423,31751,31757,31742,31735,31756,31712,31968,31964,31966,31970,31967,31961,31965,32302,32318,32326,32311,32306,32323,32299,32317,32305,32325,32321,32308,32313,32328,32309,32319,32303,32580,32755,32764,32881,32882,32880,32879,32883,33222,33219,33210,33218,33216,33215,33213,33225,33214,33256,33289,33393,34218,34180,34174,34204,34193,34196,34223,34203,34183,34216,34186,34407,34752,34769,34739,34770,34758,34731,34747,34746,34760,34763,35131,35126,35140,35128,35133,35244,35598,35607,35609,35611,35594,35616,35613,35588,35600,35905,35903,35955,36090,36093,36092,36088,36091,36264,36425,36427,36424,36426,36676,36670,36674,36677,36671,36991,36989,36996,36993,36994,36992,37177,37283,37278,37276,37709,37762,37672,37749,37706,37733,37707,37656,37758,37740,37723,37744,37722,37716,38346,38347,38348,38344,38342,38577,38584,38614,38684,38686,38816,38867,38982,39094,39221,39425,39423,39854,39851,39850,39853,40251,40255,40587,40655,40670,40668,40669,40667,40766,40779,21474,22165,22190,22745,22744,23352,24413,25059,25139,25844,25842,25854,25862,25850,25851,25847,26039,26332,26406,27315,27308,27331,27323,27320,27330,27310,27311,27487,27512,27567,28681,28683,28670,28678,28666,28689,28687,29179,29180,29182,29176,29559,29557,29863,29887,29973,30294,30296,30290,30653,30655,30651,30652,30990,31150,31329,31330,31328,31428,31429,31787,31783,31786,31774,31779,31777,31975,32340,32341,32350,32346,32353,32338,32345,32584,32761,32763,32887,32886,33229,33231,33290,34255,34217,34253,34256,34249,34224,34234,34233,34214,34799,34796,34802,34784,35206,35250,35316,35624,35641,35628,35627,35920,36101,36441,36451,36454,36452,36447,36437,36544,36681,36685,36999,36995,37000,37291,37292,37328,37780,37770,37782,37794,37811,37806,37804,37808,37784,37786,37783,38356,38358,38352,38357,38626,38620,38617,38619,38622,38692,38819,38822,38829,38905,38989,38991,38988,38990,38995,39098,39230,39231,39229,39214,39333,39438,39617,39683,39686,39759,39758,39757,39882,39881,39933,39880,39872,40273,40285,40288,40672,40725,40748,20787,22181,22750,22751,22754,23541,40848,24300,25074,25079,25078,25077,25856,25871,26336,26333,27365,27357,27354,27347,28699,28703,28712,28698,28701,28693,28696,29190,29197,29272,29346,29560,29562,29885,29898,29923,30087,30086,30303,30305,30663,31001,31153,31339,31337,31806,31807,31800,31805,31799,31808,32363,32365,32377,32361,32362,32645,32371,32694,32697,32696,33240,34281,34269,34282,34261,34276,34277,34295,34811,34821,34829,34809,34814,35168,35167,35158,35166,35649,35676,35672,35657,35674,35662,35663,35654,35673,36104,36106,36476,36466,36487,36470,36460,36474,36468,36692,36686,36781,37002,37003,37297,37294,37857,37841,37855,37827,37832,37852,37853,37846,37858,37837,37848,37860,37847,37864,38364,38580,38627,38698,38695,38753,38876,38907,39006,39000,39003,39100,39237,39241,39446,39449,39693,39912,39911,39894,39899,40329,40289,40306,40298,40300,40594,40599,40595,40628,21240,22184,22199,22198,22196,22204,22756,23360,23363,23421,23542,24009,25080,25082,25880,25876,25881,26342,26407,27372,28734,28720,28722,29200,29563,29903,30306,30309,31014,31018,31020,31019,31431,31478,31820,31811,31821,31983,31984,36782,32381,32380,32386,32588,32768,33242,33382,34299,34297,34321,34298,34310,34315,34311,34314,34836,34837,35172,35258,35320,35696,35692,35686,35695,35679,35691,36111,36109,36489,36481,36485,36482,37300,37323,37912,37891,37885,38369,38704,39108,39250,39249,39336,39467,39472,39479,39477,39955,39949,40569,40629,40680,40751,40799,40803,40801,20791,20792,22209,22208,22210,22804,23660,24013,25084,25086,25885,25884,26005,26345,27387,27396,27386,27570,28748,29211,29351,29910,29908,30313,30675,31824,32399,32396,32700,34327,34349,34330,34851,34850,34849,34847,35178,35180,35261,35700,35703,35709,36115,36490,36493,36491,36703,36783,37306,37934,37939,37941,37946,37944,37938,37931,38370,38712,38713,38706,38911,39015,39013,39255,39493,39491,39488,39486,39631,39764,39761,39981,39973,40367,40372,40386,40376,40605,40687,40729,40796,40806,40807,20796,20795,22216,22218,22217,23423,24020,24018,24398,25087,25892,27402,27489,28753,28760,29568,29924,30090,30318,30316,31155,31840,31839,32894,32893,33247,35186,35183,35324,35712,36118,36119,36497,36499,36705,37192,37956,37969,37970,38717,38718,38851,38849,39019,39253,39509,39501,39634,39706,40009,39985,39998,39995,40403,40407,40756,40812,40810,40852,22220,24022,25088,25891,25899,25898,26348,27408,29914,31434,31844,31843,31845,32403,32406,32404,33250,34360,34367,34865,35722,37008,37007,37987,37984,37988,38760,39023,39260,39514,39515,39511,39635,39636,39633,40020,40023,40022,40421,40607,40692,22225,22761,25900,28766,30321,30322,30679,32592,32648,34870,34873,34914,35731,35730,35734,33399,36123,37312,37994,38722,38728,38724,38854,39024,39519,39714,39768,40031,40441,40442,40572,40573,40711,40823,40818,24307,27414,28771,31852,31854,34875,35264,36513,37313,38002,38000,39025,39262,39638,39715,40652,28772,30682,35738,38007,38857,39522,39525,32412,35740,36522,37317,38013,38014,38012,40055,40056,40695,35924,38015,40474,29224,39530,39729,40475,40478,31858,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,20022,20031,20101,20128,20866,20886,20907,21241,21304,21353,21430,22794,23424,24027,12083,24191,24308,24400,24417,25908,26080,30098,30326,36789,38582,168,710,12541,12542,12445,12446,12291,20189,12293,12294,12295,12540,65339,65341,10045,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8679,8632,8633,12751,131276,20058,131210,20994,17553,40880,20872,40881,161287,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,65506,65508,65287,65282,12849,8470,8481,12443,12444,11904,11908,11910,11911,11912,11914,11916,11917,11925,11932,11933,11941,11943,11946,11948,11950,11958,11964,11966,11974,11978,11980,11981,11983,11990,11991,11998,12003,null,null,null,643,592,603,596,629,339,248,331,650,618,20034,20060,20981,21274,21378,19975,19980,20039,20109,22231,64012,23662,24435,19983,20871,19982,20014,20115,20162,20169,20168,20888,21244,21356,21433,22304,22787,22828,23568,24063,26081,27571,27596,27668,29247,20017,20028,20200,20188,20201,20193,20189,20186,21004,21276,21324,22306,22307,22807,22831,23425,23428,23570,23611,23668,23667,24068,24192,24194,24521,25097,25168,27669,27702,27715,27711,27707,29358,29360,29578,31160,32906,38430,20238,20248,20268,20213,20244,20209,20224,20215,20232,20253,20226,20229,20258,20243,20228,20212,20242,20913,21011,21001,21008,21158,21282,21279,21325,21386,21511,22241,22239,22318,22314,22324,22844,22912,22908,22917,22907,22910,22903,22911,23382,23573,23589,23676,23674,23675,23678,24031,24181,24196,24322,24346,24436,24533,24532,24527,25180,25182,25188,25185,25190,25186,25177,25184,25178,25189,26095,26094,26430,26425,26424,26427,26426,26431,26428,26419,27672,27718,27730,27740,27727,27722,27732,27723,27724,28785,29278,29364,29365,29582,29994,30335,31349,32593,33400,33404,33408,33405,33407,34381,35198,37017,37015,37016,37019,37012,38434,38436,38432,38435,20310,20283,20322,20297,20307,20324,20286,20327,20306,20319,20289,20312,20269,20275,20287,20321,20879,20921,21020,21022,21025,21165,21166,21257,21347,21362,21390,21391,21552,21559,21546,21588,21573,21529,21532,21541,21528,21565,21583,21569,21544,21540,21575,22254,22247,22245,22337,22341,22348,22345,22347,22354,22790,22848,22950,22936,22944,22935,22926,22946,22928,22927,22951,22945,23438,23442,23592,23594,23693,23695,23688,23691,23689,23698,23690,23686,23699,23701,24032,24074,24078,24203,24201,24204,24200,24205,24325,24349,24440,24438,24530,24529,24528,24557,24552,24558,24563,24545,24548,24547,24570,24559,24567,24571,24576,24564,25146,25219,25228,25230,25231,25236,25223,25201,25211,25210,25200,25217,25224,25207,25213,25202,25204,25911,26096,26100,26099,26098,26101,26437,26439,26457,26453,26444,26440,26461,26445,26458,26443,27600,27673,27674,27768,27751,27755,27780,27787,27791,27761,27759,27753,27802,27757,27783,27797,27804,27750,27763,27749,27771,27790,28788,28794,29283,29375,29373,29379,29382,29377,29370,29381,29589,29591,29587,29588,29586,30010,30009,30100,30101,30337,31037,32820,32917,32921,32912,32914,32924,33424,33423,33413,33422,33425,33427,33418,33411,33412,35960,36809,36799,37023,37025,37029,37022,37031,37024,38448,38440,38447,38445,20019,20376,20348,20357,20349,20352,20359,20342,20340,20361,20356,20343,20300,20375,20330,20378,20345,20353,20344,20368,20380,20372,20382,20370,20354,20373,20331,20334,20894,20924,20926,21045,21042,21043,21062,21041,21180,21258,21259,21308,21394,21396,21639,21631,21633,21649,21634,21640,21611,21626,21630,21605,21612,21620,21606,21645,21615,21601,21600,21656,21603,21607,21604,22263,22265,22383,22386,22381,22379,22385,22384,22390,22400,22389,22395,22387,22388,22370,22376,22397,22796,22853,22965,22970,22991,22990,22962,22988,22977,22966,22972,22979,22998,22961,22973,22976,22984,22964,22983,23394,23397,23443,23445,23620,23623,23726,23716,23712,23733,23727,23720,23724,23711,23715,23725,23714,23722,23719,23709,23717,23734,23728,23718,24087,24084,24089,24360,24354,24355,24356,24404,24450,24446,24445,24542,24549,24621,24614,24601,24626,24587,24628,24586,24599,24627,24602,24606,24620,24610,24589,24592,24622,24595,24593,24588,24585,24604,25108,25149,25261,25268,25297,25278,25258,25270,25290,25262,25267,25263,25275,25257,25264,25272,25917,26024,26043,26121,26108,26116,26130,26120,26107,26115,26123,26125,26117,26109,26129,26128,26358,26378,26501,26476,26510,26514,26486,26491,26520,26502,26500,26484,26509,26508,26490,26527,26513,26521,26499,26493,26497,26488,26489,26516,27429,27520,27518,27614,27677,27795,27884,27883,27886,27865,27830,27860,27821,27879,27831,27856,27842,27834,27843,27846,27885,27890,27858,27869,27828,27786,27805,27776,27870,27840,27952,27853,27847,27824,27897,27855,27881,27857,28820,28824,28805,28819,28806,28804,28817,28822,28802,28826,28803,29290,29398,29387,29400,29385,29404,29394,29396,29402,29388,29393,29604,29601,29613,29606,29602,29600,29612,29597,29917,29928,30015,30016,30014,30092,30104,30383,30451,30449,30448,30453,30712,30716,30713,30715,30714,30711,31042,31039,31173,31352,31355,31483,31861,31997,32821,32911,32942,32931,32952,32949,32941,33312,33440,33472,33451,33434,33432,33435,33461,33447,33454,33468,33438,33466,33460,33448,33441,33449,33474,33444,33475,33462,33442,34416,34415,34413,34414,35926,36818,36811,36819,36813,36822,36821,36823,37042,37044,37039,37043,37040,38457,38461,38460,38458,38467,20429,20421,20435,20402,20425,20427,20417,20436,20444,20441,20411,20403,20443,20423,20438,20410,20416,20409,20460,21060,21065,21184,21186,21309,21372,21399,21398,21401,21400,21690,21665,21677,21669,21711,21699,33549,21687,21678,21718,21686,21701,21702,21664,21616,21692,21666,21694,21618,21726,21680,22453,22430,22431,22436,22412,22423,22429,22427,22420,22424,22415,22425,22437,22426,22421,22772,22797,22867,23009,23006,23022,23040,23025,23005,23034,23037,23036,23030,23012,23026,23031,23003,23017,23027,23029,23008,23038,23028,23021,23464,23628,23760,23768,23756,23767,23755,23771,23774,23770,23753,23751,23754,23766,23763,23764,23759,23752,23750,23758,23775,23800,24057,24097,24098,24099,24096,24100,24240,24228,24226,24219,24227,24229,24327,24366,24406,24454,24631,24633,24660,24690,24670,24645,24659,24647,24649,24667,24652,24640,24642,24671,24612,24644,24664,24678,24686,25154,25155,25295,25357,25355,25333,25358,25347,25323,25337,25359,25356,25336,25334,25344,25363,25364,25338,25365,25339,25328,25921,25923,26026,26047,26166,26145,26162,26165,26140,26150,26146,26163,26155,26170,26141,26164,26169,26158,26383,26384,26561,26610,26568,26554,26588,26555,26616,26584,26560,26551,26565,26603,26596,26591,26549,26573,26547,26615,26614,26606,26595,26562,26553,26574,26599,26608,26546,26620,26566,26605,26572,26542,26598,26587,26618,26569,26570,26563,26602,26571,27432,27522,27524,27574,27606,27608,27616,27680,27681,27944,27956,27949,27935,27964,27967,27922,27914,27866,27955,27908,27929,27962,27930,27921,27904,27933,27970,27905,27928,27959,27907,27919,27968,27911,27936,27948,27912,27938,27913,27920,28855,28831,28862,28849,28848,28833,28852,28853,28841,29249,29257,29258,29292,29296,29299,29294,29386,29412,29416,29419,29407,29418,29414,29411,29573,29644,29634,29640,29637,29625,29622,29621,29620,29675,29631,29639,29630,29635,29638,29624,29643,29932,29934,29998,30023,30024,30119,30122,30329,30404,30472,30467,30468,30469,30474,30455,30459,30458,30695,30696,30726,30737,30738,30725,30736,30735,30734,30729,30723,30739,31050,31052,31051,31045,31044,31189,31181,31183,31190,31182,31360,31358,31441,31488,31489,31866,31864,31865,31871,31872,31873,32003,32008,32001,32600,32657,32653,32702,32775,32782,32783,32788,32823,32984,32967,32992,32977,32968,32962,32976,32965,32995,32985,32988,32970,32981,32969,32975,32983,32998,32973,33279,33313,33428,33497,33534,33529,33543,33512,33536,33493,33594,33515,33494,33524,33516,33505,33522,33525,33548,33531,33526,33520,33514,33508,33504,33530,33523,33517,34423,34420,34428,34419,34881,34894,34919,34922,34921,35283,35332,35335,36210,36835,36833,36846,36832,37105,37053,37055,37077,37061,37054,37063,37067,37064,37332,37331,38484,38479,38481,38483,38474,38478,20510,20485,20487,20499,20514,20528,20507,20469,20468,20531,20535,20524,20470,20471,20503,20508,20512,20519,20533,20527,20529,20494,20826,20884,20883,20938,20932,20933,20936,20942,21089,21082,21074,21086,21087,21077,21090,21197,21262,21406,21798,21730,21783,21778,21735,21747,21732,21786,21759,21764,21768,21739,21777,21765,21745,21770,21755,21751,21752,21728,21774,21763,21771,22273,22274,22476,22578,22485,22482,22458,22470,22461,22460,22456,22454,22463,22471,22480,22457,22465,22798,22858,23065,23062,23085,23086,23061,23055,23063,23050,23070,23091,23404,23463,23469,23468,23555,23638,23636,23788,23807,23790,23793,23799,23808,23801,24105,24104,24232,24238,24234,24236,24371,24368,24423,24669,24666,24679,24641,24738,24712,24704,24722,24705,24733,24707,24725,24731,24727,24711,24732,24718,25113,25158,25330,25360,25430,25388,25412,25413,25398,25411,25572,25401,25419,25418,25404,25385,25409,25396,25432,25428,25433,25389,25415,25395,25434,25425,25400,25431,25408,25416,25930,25926,26054,26051,26052,26050,26186,26207,26183,26193,26386,26387,26655,26650,26697,26674,26675,26683,26699,26703,26646,26673,26652,26677,26667,26669,26671,26702,26692,26676,26653,26642,26644,26662,26664,26670,26701,26682,26661,26656,27436,27439,27437,27441,27444,27501,32898,27528,27622,27620,27624,27619,27618,27623,27685,28026,28003,28004,28022,27917,28001,28050,27992,28002,28013,28015,28049,28045,28143,28031,28038,27998,28007,28000,28055,28016,28028,27999,28034,28056,27951,28008,28043,28030,28032,28036,27926,28035,28027,28029,28021,28048,28892,28883,28881,28893,28875,32569,28898,28887,28882,28894,28896,28884,28877,28869,28870,28871,28890,28878,28897,29250,29304,29303,29302,29440,29434,29428,29438,29430,29427,29435,29441,29651,29657,29669,29654,29628,29671,29667,29673,29660,29650,29659,29652,29661,29658,29655,29656,29672,29918,29919,29940,29941,29985,30043,30047,30128,30145,30139,30148,30144,30143,30134,30138,30346,30409,30493,30491,30480,30483,30482,30499,30481,30485,30489,30490,30498,30503,30755,30764,30754,30773,30767,30760,30766,30763,30753,30761,30771,30762,30769,31060,31067,31055,31068,31059,31058,31057,31211,31212,31200,31214,31213,31210,31196,31198,31197,31366,31369,31365,31371,31372,31370,31367,31448,31504,31492,31507,31493,31503,31496,31498,31502,31497,31506,31876,31889,31882,31884,31880,31885,31877,32030,32029,32017,32014,32024,32022,32019,32031,32018,32015,32012,32604,32609,32606,32608,32605,32603,32662,32658,32707,32706,32704,32790,32830,32825,33018,33010,33017,33013,33025,33019,33024,33281,33327,33317,33587,33581,33604,33561,33617,33573,33622,33599,33601,33574,33564,33570,33602,33614,33563,33578,33544,33596,33613,33558,33572,33568,33591,33583,33577,33607,33605,33612,33619,33566,33580,33611,33575,33608,34387,34386,34466,34472,34454,34445,34449,34462,34439,34455,34438,34443,34458,34437,34469,34457,34465,34471,34453,34456,34446,34461,34448,34452,34883,34884,34925,34933,34934,34930,34944,34929,34943,34927,34947,34942,34932,34940,35346,35911,35927,35963,36004,36003,36214,36216,36277,36279,36278,36561,36563,36862,36853,36866,36863,36859,36868,36860,36854,37078,37088,37081,37082,37091,37087,37093,37080,37083,37079,37084,37092,37200,37198,37199,37333,37346,37338,38492,38495,38588,39139,39647,39727,20095,20592,20586,20577,20574,20576,20563,20555,20573,20594,20552,20557,20545,20571,20554,20578,20501,20549,20575,20585,20587,20579,20580,20550,20544,20590,20595,20567,20561,20944,21099,21101,21100,21102,21206,21203,21293,21404,21877,21878,21820,21837,21840,21812,21802,21841,21858,21814,21813,21808,21842,21829,21772,21810,21861,21838,21817,21832,21805,21819,21824,21835,22282,22279,22523,22548,22498,22518,22492,22516,22528,22509,22525,22536,22520,22539,22515,22479,22535,22510,22499,22514,22501,22508,22497,22542,22524,22544,22503,22529,22540,22513,22505,22512,22541,22532,22876,23136,23128,23125,23143,23134,23096,23093,23149,23120,23135,23141,23148,23123,23140,23127,23107,23133,23122,23108,23131,23112,23182,23102,23117,23097,23116,23152,23145,23111,23121,23126,23106,23132,23410,23406,23489,23488,23641,23838,23819,23837,23834,23840,23820,23848,23821,23846,23845,23823,23856,23826,23843,23839,23854,24126,24116,24241,24244,24249,24242,24243,24374,24376,24475,24470,24479,24714,24720,24710,24766,24752,24762,24787,24788,24783,24804,24793,24797,24776,24753,24795,24759,24778,24767,24771,24781,24768,25394,25445,25482,25474,25469,25533,25502,25517,25501,25495,25515,25486,25455,25479,25488,25454,25519,25461,25500,25453,25518,25468,25508,25403,25503,25464,25477,25473,25489,25485,25456,25939,26061,26213,26209,26203,26201,26204,26210,26392,26745,26759,26768,26780,26733,26734,26798,26795,26966,26735,26787,26796,26793,26741,26740,26802,26767,26743,26770,26748,26731,26738,26794,26752,26737,26750,26779,26774,26763,26784,26761,26788,26744,26747,26769,26764,26762,26749,27446,27443,27447,27448,27537,27535,27533,27534,27532,27690,28096,28075,28084,28083,28276,28076,28137,28130,28087,28150,28116,28160,28104,28128,28127,28118,28094,28133,28124,28125,28123,28148,28106,28093,28141,28144,28090,28117,28098,28111,28105,28112,28146,28115,28157,28119,28109,28131,28091,28922,28941,28919,28951,28916,28940,28912,28932,28915,28944,28924,28927,28934,28947,28928,28920,28918,28939,28930,28942,29310,29307,29308,29311,29469,29463,29447,29457,29464,29450,29448,29439,29455,29470,29576,29686,29688,29685,29700,29697,29693,29703,29696,29690,29692,29695,29708,29707,29684,29704,30052,30051,30158,30162,30159,30155,30156,30161,30160,30351,30345,30419,30521,30511,30509,30513,30514,30516,30515,30525,30501,30523,30517,30792,30802,30793,30797,30794,30796,30758,30789,30800,31076,31079,31081,31082,31075,31083,31073,31163,31226,31224,31222,31223,31375,31380,31376,31541,31559,31540,31525,31536,31522,31524,31539,31512,31530,31517,31537,31531,31533,31535,31538,31544,31514,31523,31892,31896,31894,31907,32053,32061,32056,32054,32058,32069,32044,32041,32065,32071,32062,32063,32074,32059,32040,32611,32661,32668,32669,32667,32714,32715,32717,32720,32721,32711,32719,32713,32799,32798,32795,32839,32835,32840,33048,33061,33049,33051,33069,33055,33068,33054,33057,33045,33063,33053,33058,33297,33336,33331,33338,33332,33330,33396,33680,33699,33704,33677,33658,33651,33700,33652,33679,33665,33685,33689,33653,33684,33705,33661,33667,33676,33693,33691,33706,33675,33662,33701,33711,33672,33687,33712,33663,33702,33671,33710,33654,33690,34393,34390,34495,34487,34498,34497,34501,34490,34480,34504,34489,34483,34488,34508,34484,34491,34492,34499,34493,34494,34898,34953,34965,34984,34978,34986,34970,34961,34977,34975,34968,34983,34969,34971,34967,34980,34988,34956,34963,34958,35202,35286,35289,35285,35376,35367,35372,35358,35897,35899,35932,35933,35965,36005,36221,36219,36217,36284,36290,36281,36287,36289,36568,36574,36573,36572,36567,36576,36577,36900,36875,36881,36892,36876,36897,37103,37098,37104,37108,37106,37107,37076,37099,37100,37097,37206,37208,37210,37203,37205,37356,37364,37361,37363,37368,37348,37369,37354,37355,37367,37352,37358,38266,38278,38280,38524,38509,38507,38513,38511,38591,38762,38916,39141,39319,20635,20629,20628,20638,20619,20643,20611,20620,20622,20637,20584,20636,20626,20610,20615,20831,20948,21266,21265,21412,21415,21905,21928,21925,21933,21879,22085,21922,21907,21896,21903,21941,21889,21923,21906,21924,21885,21900,21926,21887,21909,21921,21902,22284,22569,22583,22553,22558,22567,22563,22568,22517,22600,22565,22556,22555,22579,22591,22582,22574,22585,22584,22573,22572,22587,22881,23215,23188,23199,23162,23202,23198,23160,23206,23164,23205,23212,23189,23214,23095,23172,23178,23191,23171,23179,23209,23163,23165,23180,23196,23183,23187,23197,23530,23501,23499,23508,23505,23498,23502,23564,23600,23863,23875,23915,23873,23883,23871,23861,23889,23886,23893,23859,23866,23890,23869,23857,23897,23874,23865,23881,23864,23868,23858,23862,23872,23877,24132,24129,24408,24486,24485,24491,24777,24761,24780,24802,24782,24772,24852,24818,24842,24854,24837,24821,24851,24824,24828,24830,24769,24835,24856,24861,24848,24831,24836,24843,25162,25492,25521,25520,25550,25573,25576,25583,25539,25757,25587,25546,25568,25590,25557,25586,25589,25697,25567,25534,25565,25564,25540,25560,25555,25538,25543,25548,25547,25544,25584,25559,25561,25906,25959,25962,25956,25948,25960,25957,25996,26013,26014,26030,26064,26066,26236,26220,26235,26240,26225,26233,26218,26226,26369,26892,26835,26884,26844,26922,26860,26858,26865,26895,26838,26871,26859,26852,26870,26899,26896,26867,26849,26887,26828,26888,26992,26804,26897,26863,26822,26900,26872,26832,26877,26876,26856,26891,26890,26903,26830,26824,26845,26846,26854,26868,26833,26886,26836,26857,26901,26917,26823,27449,27451,27455,27452,27540,27543,27545,27541,27581,27632,27634,27635,27696,28156,28230,28231,28191,28233,28296,28220,28221,28229,28258,28203,28223,28225,28253,28275,28188,28211,28235,28224,28241,28219,28163,28206,28254,28264,28252,28257,28209,28200,28256,28273,28267,28217,28194,28208,28243,28261,28199,28280,28260,28279,28245,28281,28242,28262,28213,28214,28250,28960,28958,28975,28923,28974,28977,28963,28965,28962,28978,28959,28968,28986,28955,29259,29274,29320,29321,29318,29317,29323,29458,29451,29488,29474,29489,29491,29479,29490,29485,29478,29475,29493,29452,29742,29740,29744,29739,29718,29722,29729,29741,29745,29732,29731,29725,29737,29728,29746,29947,29999,30063,30060,30183,30170,30177,30182,30173,30175,30180,30167,30357,30354,30426,30534,30535,30532,30541,30533,30538,30542,30539,30540,30686,30700,30816,30820,30821,30812,30829,30833,30826,30830,30832,30825,30824,30814,30818,31092,31091,31090,31088,31234,31242,31235,31244,31236,31385,31462,31460,31562,31547,31556,31560,31564,31566,31552,31576,31557,31906,31902,31912,31905,32088,32111,32099,32083,32086,32103,32106,32079,32109,32092,32107,32082,32084,32105,32081,32095,32078,32574,32575,32613,32614,32674,32672,32673,32727,32849,32847,32848,33022,32980,33091,33098,33106,33103,33095,33085,33101,33082,33254,33262,33271,33272,33273,33284,33340,33341,33343,33397,33595,33743,33785,33827,33728,33768,33810,33767,33764,33788,33782,33808,33734,33736,33771,33763,33727,33793,33757,33765,33752,33791,33761,33739,33742,33750,33781,33737,33801,33807,33758,33809,33798,33730,33779,33749,33786,33735,33745,33770,33811,33731,33772,33774,33732,33787,33751,33762,33819,33755,33790,34520,34530,34534,34515,34531,34522,34538,34525,34539,34524,34540,34537,34519,34536,34513,34888,34902,34901,35002,35031,35001,35000,35008,35006,34998,35004,34999,35005,34994,35073,35017,35221,35224,35223,35293,35290,35291,35406,35405,35385,35417,35392,35415,35416,35396,35397,35410,35400,35409,35402,35404,35407,35935,35969,35968,36026,36030,36016,36025,36021,36228,36224,36233,36312,36307,36301,36295,36310,36316,36303,36309,36313,36296,36311,36293,36591,36599,36602,36601,36582,36590,36581,36597,36583,36584,36598,36587,36593,36588,36596,36585,36909,36916,36911,37126,37164,37124,37119,37116,37128,37113,37115,37121,37120,37127,37125,37123,37217,37220,37215,37218,37216,37377,37386,37413,37379,37402,37414,37391,37388,37376,37394,37375,37373,37382,37380,37415,37378,37404,37412,37401,37399,37381,37398,38267,38285,38284,38288,38535,38526,38536,38537,38531,38528,38594,38600,38595,38641,38640,38764,38768,38766,38919,39081,39147,40166,40697,20099,20100,20150,20669,20671,20678,20654,20676,20682,20660,20680,20674,20656,20673,20666,20657,20683,20681,20662,20664,20951,21114,21112,21115,21116,21955,21979,21964,21968,21963,21962,21981,21952,21972,21956,21993,21951,21970,21901,21967,21973,21986,21974,21960,22002,21965,21977,21954,22292,22611,22632,22628,22607,22605,22601,22639,22613,22606,22621,22617,22629,22619,22589,22627,22641,22780,23239,23236,23243,23226,23224,23217,23221,23216,23231,23240,23227,23238,23223,23232,23242,23220,23222,23245,23225,23184,23510,23512,23513,23583,23603,23921,23907,23882,23909,23922,23916,23902,23912,23911,23906,24048,24143,24142,24138,24141,24139,24261,24268,24262,24267,24263,24384,24495,24493,24823,24905,24906,24875,24901,24886,24882,24878,24902,24879,24911,24873,24896,25120,37224,25123,25125,25124,25541,25585,25579,25616,25618,25609,25632,25636,25651,25667,25631,25621,25624,25657,25655,25634,25635,25612,25638,25648,25640,25665,25653,25647,25610,25626,25664,25637,25639,25611,25575,25627,25646,25633,25614,25967,26002,26067,26246,26252,26261,26256,26251,26250,26265,26260,26232,26400,26982,26975,26936,26958,26978,26993,26943,26949,26986,26937,26946,26967,26969,27002,26952,26953,26933,26988,26931,26941,26981,26864,27000,26932,26985,26944,26991,26948,26998,26968,26945,26996,26956,26939,26955,26935,26972,26959,26961,26930,26962,26927,27003,26940,27462,27461,27459,27458,27464,27457,27547,64013,27643,27644,27641,27639,27640,28315,28374,28360,28303,28352,28319,28307,28308,28320,28337,28345,28358,28370,28349,28353,28318,28361,28343,28336,28365,28326,28367,28338,28350,28355,28380,28376,28313,28306,28302,28301,28324,28321,28351,28339,28368,28362,28311,28334,28323,28999,29012,29010,29027,29024,28993,29021,29026,29042,29048,29034,29025,28994,29016,28995,29003,29040,29023,29008,29011,28996,29005,29018,29263,29325,29324,29329,29328,29326,29500,29506,29499,29498,29504,29514,29513,29764,29770,29771,29778,29777,29783,29760,29775,29776,29774,29762,29766,29773,29780,29921,29951,29950,29949,29981,30073,30071,27011,30191,30223,30211,30199,30206,30204,30201,30200,30224,30203,30198,30189,30197,30205,30361,30389,30429,30549,30559,30560,30546,30550,30554,30569,30567,30548,30553,30573,30688,30855,30874,30868,30863,30852,30869,30853,30854,30881,30851,30841,30873,30848,30870,30843,31100,31106,31101,31097,31249,31256,31257,31250,31255,31253,31266,31251,31259,31248,31395,31394,31390,31467,31590,31588,31597,31604,31593,31602,31589,31603,31601,31600,31585,31608,31606,31587,31922,31924,31919,32136,32134,32128,32141,32127,32133,32122,32142,32123,32131,32124,32140,32148,32132,32125,32146,32621,32619,32615,32616,32620,32678,32677,32679,32731,32732,32801,33124,33120,33143,33116,33129,33115,33122,33138,26401,33118,33142,33127,33135,33092,33121,33309,33353,33348,33344,33346,33349,34033,33855,33878,33910,33913,33935,33933,33893,33873,33856,33926,33895,33840,33869,33917,33882,33881,33908,33907,33885,34055,33886,33847,33850,33844,33914,33859,33912,33842,33861,33833,33753,33867,33839,33858,33837,33887,33904,33849,33870,33868,33874,33903,33989,33934,33851,33863,33846,33843,33896,33918,33860,33835,33888,33876,33902,33872,34571,34564,34551,34572,34554,34518,34549,34637,34552,34574,34569,34561,34550,34573,34565,35030,35019,35021,35022,35038,35035,35034,35020,35024,35205,35227,35295,35301,35300,35297,35296,35298,35292,35302,35446,35462,35455,35425,35391,35447,35458,35460,35445,35459,35457,35444,35450,35900,35915,35914,35941,35940,35942,35974,35972,35973,36044,36200,36201,36241,36236,36238,36239,36237,36243,36244,36240,36242,36336,36320,36332,36337,36334,36304,36329,36323,36322,36327,36338,36331,36340,36614,36607,36609,36608,36613,36615,36616,36610,36619,36946,36927,36932,36937,36925,37136,37133,37135,37137,37142,37140,37131,37134,37230,37231,37448,37458,37424,37434,37478,37427,37477,37470,37507,37422,37450,37446,37485,37484,37455,37472,37479,37487,37430,37473,37488,37425,37460,37475,37456,37490,37454,37459,37452,37462,37426,38303,38300,38302,38299,38546,38547,38545,38551,38606,38650,38653,38648,38645,38771,38775,38776,38770,38927,38925,38926,39084,39158,39161,39343,39346,39344,39349,39597,39595,39771,40170,40173,40167,40576,40701,20710,20692,20695,20712,20723,20699,20714,20701,20708,20691,20716,20720,20719,20707,20704,20952,21120,21121,21225,21227,21296,21420,22055,22037,22028,22034,22012,22031,22044,22017,22035,22018,22010,22045,22020,22015,22009,22665,22652,22672,22680,22662,22657,22655,22644,22667,22650,22663,22673,22670,22646,22658,22664,22651,22676,22671,22782,22891,23260,23278,23269,23253,23274,23258,23277,23275,23283,23266,23264,23259,23276,23262,23261,23257,23272,23263,23415,23520,23523,23651,23938,23936,23933,23942,23930,23937,23927,23946,23945,23944,23934,23932,23949,23929,23935,24152,24153,24147,24280,24273,24279,24270,24284,24277,24281,24274,24276,24388,24387,24431,24502,24876,24872,24897,24926,24945,24947,24914,24915,24946,24940,24960,24948,24916,24954,24923,24933,24891,24938,24929,24918,25129,25127,25131,25643,25677,25691,25693,25716,25718,25714,25715,25725,25717,25702,25766,25678,25730,25694,25692,25675,25683,25696,25680,25727,25663,25708,25707,25689,25701,25719,25971,26016,26273,26272,26271,26373,26372,26402,27057,27062,27081,27040,27086,27030,27056,27052,27068,27025,27033,27022,27047,27021,27049,27070,27055,27071,27076,27069,27044,27092,27065,27082,27034,27087,27059,27027,27050,27041,27038,27097,27031,27024,27074,27061,27045,27078,27466,27469,27467,27550,27551,27552,27587,27588,27646,28366,28405,28401,28419,28453,28408,28471,28411,28462,28425,28494,28441,28442,28455,28440,28475,28434,28397,28426,28470,28531,28409,28398,28461,28480,28464,28476,28469,28395,28423,28430,28483,28421,28413,28406,28473,28444,28412,28474,28447,28429,28446,28424,28449,29063,29072,29065,29056,29061,29058,29071,29051,29062,29057,29079,29252,29267,29335,29333,29331,29507,29517,29521,29516,29794,29811,29809,29813,29810,29799,29806,29952,29954,29955,30077,30096,30230,30216,30220,30229,30225,30218,30228,30392,30593,30588,30597,30594,30574,30592,30575,30590,30595,30898,30890,30900,30893,30888,30846,30891,30878,30885,30880,30892,30882,30884,31128,31114,31115,31126,31125,31124,31123,31127,31112,31122,31120,31275,31306,31280,31279,31272,31270,31400,31403,31404,31470,31624,31644,31626,31633,31632,31638,31629,31628,31643,31630,31621,31640,21124,31641,31652,31618,31931,31935,31932,31930,32167,32183,32194,32163,32170,32193,32192,32197,32157,32206,32196,32198,32203,32204,32175,32185,32150,32188,32159,32166,32174,32169,32161,32201,32627,32738,32739,32741,32734,32804,32861,32860,33161,33158,33155,33159,33165,33164,33163,33301,33943,33956,33953,33951,33978,33998,33986,33964,33966,33963,33977,33972,33985,33997,33962,33946,33969,34000,33949,33959,33979,33954,33940,33991,33996,33947,33961,33967,33960,34006,33944,33974,33999,33952,34007,34004,34002,34011,33968,33937,34401,34611,34595,34600,34667,34624,34606,34590,34593,34585,34587,34627,34604,34625,34622,34630,34592,34610,34602,34605,34620,34578,34618,34609,34613,34626,34598,34599,34616,34596,34586,34608,34577,35063,35047,35057,35058,35066,35070,35054,35068,35062,35067,35056,35052,35051,35229,35233,35231,35230,35305,35307,35304,35499,35481,35467,35474,35471,35478,35901,35944,35945,36053,36047,36055,36246,36361,36354,36351,36365,36349,36362,36355,36359,36358,36357,36350,36352,36356,36624,36625,36622,36621,37155,37148,37152,37154,37151,37149,37146,37156,37153,37147,37242,37234,37241,37235,37541,37540,37494,37531,37498,37536,37524,37546,37517,37542,37530,37547,37497,37527,37503,37539,37614,37518,37506,37525,37538,37501,37512,37537,37514,37510,37516,37529,37543,37502,37511,37545,37533,37515,37421,38558,38561,38655,38744,38781,38778,38782,38787,38784,38786,38779,38788,38785,38783,38862,38861,38934,39085,39086,39170,39168,39175,39325,39324,39363,39353,39355,39354,39362,39357,39367,39601,39651,39655,39742,39743,39776,39777,39775,40177,40178,40181,40615,20735,20739,20784,20728,20742,20743,20726,20734,20747,20748,20733,20746,21131,21132,21233,21231,22088,22082,22092,22069,22081,22090,22089,22086,22104,22106,22080,22067,22077,22060,22078,22072,22058,22074,22298,22699,22685,22705,22688,22691,22703,22700,22693,22689,22783,23295,23284,23293,23287,23286,23299,23288,23298,23289,23297,23303,23301,23311,23655,23961,23959,23967,23954,23970,23955,23957,23968,23964,23969,23962,23966,24169,24157,24160,24156,32243,24283,24286,24289,24393,24498,24971,24963,24953,25009,25008,24994,24969,24987,24979,25007,25005,24991,24978,25002,24993,24973,24934,25011,25133,25710,25712,25750,25760,25733,25751,25756,25743,25739,25738,25740,25763,25759,25704,25777,25752,25974,25978,25977,25979,26034,26035,26293,26288,26281,26290,26295,26282,26287,27136,27142,27159,27109,27128,27157,27121,27108,27168,27135,27116,27106,27163,27165,27134,27175,27122,27118,27156,27127,27111,27200,27144,27110,27131,27149,27132,27115,27145,27140,27160,27173,27151,27126,27174,27143,27124,27158,27473,27557,27555,27554,27558,27649,27648,27647,27650,28481,28454,28542,28551,28614,28562,28557,28553,28556,28514,28495,28549,28506,28566,28534,28524,28546,28501,28530,28498,28496,28503,28564,28563,28509,28416,28513,28523,28541,28519,28560,28499,28555,28521,28543,28565,28515,28535,28522,28539,29106,29103,29083,29104,29088,29082,29097,29109,29085,29093,29086,29092,29089,29098,29084,29095,29107,29336,29338,29528,29522,29534,29535,29536,29533,29531,29537,29530,29529,29538,29831,29833,29834,29830,29825,29821,29829,29832,29820,29817,29960,29959,30078,30245,30238,30233,30237,30236,30243,30234,30248,30235,30364,30365,30366,30363,30605,30607,30601,30600,30925,30907,30927,30924,30929,30926,30932,30920,30915,30916,30921,31130,31137,31136,31132,31138,31131,27510,31289,31410,31412,31411,31671,31691,31678,31660,31694,31663,31673,31690,31669,31941,31944,31948,31947,32247,32219,32234,32231,32215,32225,32259,32250,32230,32246,32241,32240,32238,32223,32630,32684,32688,32685,32749,32747,32746,32748,32742,32744,32868,32871,33187,33183,33182,33173,33186,33177,33175,33302,33359,33363,33362,33360,33358,33361,34084,34107,34063,34048,34089,34062,34057,34061,34079,34058,34087,34076,34043,34091,34042,34056,34060,34036,34090,34034,34069,34039,34027,34035,34044,34066,34026,34025,34070,34046,34088,34077,34094,34050,34045,34078,34038,34097,34086,34023,34024,34032,34031,34041,34072,34080,34096,34059,34073,34095,34402,34646,34659,34660,34679,34785,34675,34648,34644,34651,34642,34657,34650,34641,34654,34669,34666,34640,34638,34655,34653,34671,34668,34682,34670,34652,34661,34639,34683,34677,34658,34663,34665,34906,35077,35084,35092,35083,35095,35096,35097,35078,35094,35089,35086,35081,35234,35236,35235,35309,35312,35308,35535,35526,35512,35539,35537,35540,35541,35515,35543,35518,35520,35525,35544,35523,35514,35517,35545,35902,35917,35983,36069,36063,36057,36072,36058,36061,36071,36256,36252,36257,36251,36384,36387,36389,36388,36398,36373,36379,36374,36369,36377,36390,36391,36372,36370,36376,36371,36380,36375,36378,36652,36644,36632,36634,36640,36643,36630,36631,36979,36976,36975,36967,36971,37167,37163,37161,37162,37170,37158,37166,37253,37254,37258,37249,37250,37252,37248,37584,37571,37572,37568,37593,37558,37583,37617,37599,37592,37609,37591,37597,37580,37615,37570,37608,37578,37576,37582,37606,37581,37589,37577,37600,37598,37607,37585,37587,37557,37601,37574,37556,38268,38316,38315,38318,38320,38564,38562,38611,38661,38664,38658,38746,38794,38798,38792,38864,38863,38942,38941,38950,38953,38952,38944,38939,38951,39090,39176,39162,39185,39188,39190,39191,39189,39388,39373,39375,39379,39380,39374,39369,39382,39384,39371,39383,39372,39603,39660,39659,39667,39666,39665,39750,39747,39783,39796,39793,39782,39798,39797,39792,39784,39780,39788,40188,40186,40189,40191,40183,40199,40192,40185,40187,40200,40197,40196,40579,40659,40719,40720,20764,20755,20759,20762,20753,20958,21300,21473,22128,22112,22126,22131,22118,22115,22125,22130,22110,22135,22300,22299,22728,22717,22729,22719,22714,22722,22716,22726,23319,23321,23323,23329,23316,23315,23312,23318,23336,23322,23328,23326,23535,23980,23985,23977,23975,23989,23984,23982,23978,23976,23986,23981,23983,23988,24167,24168,24166,24175,24297,24295,24294,24296,24293,24395,24508,24989,25000,24982,25029,25012,25030,25025,25036,25018,25023,25016,24972,25815,25814,25808,25807,25801,25789,25737,25795,25819,25843,25817,25907,25983,25980,26018,26312,26302,26304,26314,26315,26319,26301,26299,26298,26316,26403,27188,27238,27209,27239,27186,27240,27198,27229,27245,27254,27227,27217,27176,27226,27195,27199,27201,27242,27236,27216,27215,27220,27247,27241,27232,27196,27230,27222,27221,27213,27214,27206,27477,27476,27478,27559,27562,27563,27592,27591,27652,27651,27654,28589,28619,28579,28615,28604,28622,28616,28510,28612,28605,28574,28618,28584,28676,28581,28590,28602,28588,28586,28623,28607,28600,28578,28617,28587,28621,28591,28594,28592,29125,29122,29119,29112,29142,29120,29121,29131,29140,29130,29127,29135,29117,29144,29116,29126,29146,29147,29341,29342,29545,29542,29543,29548,29541,29547,29546,29823,29850,29856,29844,29842,29845,29857,29963,30080,30255,30253,30257,30269,30259,30268,30261,30258,30256,30395,30438,30618,30621,30625,30620,30619,30626,30627,30613,30617,30615,30941,30953,30949,30954,30942,30947,30939,30945,30946,30957,30943,30944,31140,31300,31304,31303,31414,31416,31413,31409,31415,31710,31715,31719,31709,31701,31717,31706,31720,31737,31700,31722,31714,31708,31723,31704,31711,31954,31956,31959,31952,31953,32274,32289,32279,32268,32287,32288,32275,32270,32284,32277,32282,32290,32267,32271,32278,32269,32276,32293,32292,32579,32635,32636,32634,32689,32751,32810,32809,32876,33201,33190,33198,33209,33205,33195,33200,33196,33204,33202,33207,33191,33266,33365,33366,33367,34134,34117,34155,34125,34131,34145,34136,34112,34118,34148,34113,34146,34116,34129,34119,34147,34110,34139,34161,34126,34158,34165,34133,34151,34144,34188,34150,34141,34132,34149,34156,34403,34405,34404,34715,34703,34711,34707,34706,34696,34689,34710,34712,34681,34695,34723,34693,34704,34705,34717,34692,34708,34716,34714,34697,35102,35110,35120,35117,35118,35111,35121,35106,35113,35107,35119,35116,35103,35313,35552,35554,35570,35572,35573,35549,35604,35556,35551,35568,35528,35550,35553,35560,35583,35567,35579,35985,35986,35984,36085,36078,36081,36080,36083,36204,36206,36261,36263,36403,36414,36408,36416,36421,36406,36412,36413,36417,36400,36415,36541,36662,36654,36661,36658,36665,36663,36660,36982,36985,36987,36998,37114,37171,37173,37174,37267,37264,37265,37261,37263,37671,37662,37640,37663,37638,37647,37754,37688,37692,37659,37667,37650,37633,37702,37677,37646,37645,37579,37661,37626,37669,37651,37625,37623,37684,37634,37668,37631,37673,37689,37685,37674,37652,37644,37643,37630,37641,37632,37627,37654,38332,38349,38334,38329,38330,38326,38335,38325,38333,38569,38612,38667,38674,38672,38809,38807,38804,38896,38904,38965,38959,38962,39204,39199,39207,39209,39326,39406,39404,39397,39396,39408,39395,39402,39401,39399,39609,39615,39604,39611,39670,39674,39673,39671,39731,39808,39813,39815,39804,39806,39803,39810,39827,39826,39824,39802,39829,39805,39816,40229,40215,40224,40222,40212,40233,40221,40216,40226,40208,40217,40223,40584,40582,40583,40622,40621,40661,40662,40698,40722,40765,20774,20773,20770,20772,20768,20777,21236,22163,22156,22157,22150,22148,22147,22142,22146,22143,22145,22742,22740,22735,22738,23341,23333,23346,23331,23340,23335,23334,23343,23342,23419,23537,23538,23991,24172,24170,24510,24507,25027,25013,25020,25063,25056,25061,25060,25064,25054,25839,25833,25827,25835,25828,25832,25985,25984,26038,26074,26322,27277,27286,27265,27301,27273,27295,27291,27297,27294,27271,27283,27278,27285,27267,27304,27300,27281,27263,27302,27290,27269,27276,27282,27483,27565,27657,28620,28585,28660,28628,28643,28636,28653,28647,28646,28638,28658,28637,28642,28648,29153,29169,29160,29170,29156,29168,29154,29555,29550,29551,29847,29874,29867,29840,29866,29869,29873,29861,29871,29968,29969,29970,29967,30084,30275,30280,30281,30279,30372,30441,30645,30635,30642,30647,30646,30644,30641,30632,30704,30963,30973,30978,30971,30972,30962,30981,30969,30974,30980,31147,31144,31324,31323,31318,31320,31316,31322,31422,31424,31425,31749,31759,31730,31744,31743,31739,31758,31732,31755,31731,31746,31753,31747,31745,31736,31741,31750,31728,31729,31760,31754,31976,32301,32316,32322,32307,38984,32312,32298,32329,32320,32327,32297,32332,32304,32315,32310,32324,32314,32581,32639,32638,32637,32756,32754,32812,33211,33220,33228,33226,33221,33223,33212,33257,33371,33370,33372,34179,34176,34191,34215,34197,34208,34187,34211,34171,34212,34202,34206,34167,34172,34185,34209,34170,34168,34135,34190,34198,34182,34189,34201,34205,34177,34210,34178,34184,34181,34169,34166,34200,34192,34207,34408,34750,34730,34733,34757,34736,34732,34745,34741,34748,34734,34761,34755,34754,34764,34743,34735,34756,34762,34740,34742,34751,34744,34749,34782,34738,35125,35123,35132,35134,35137,35154,35127,35138,35245,35247,35246,35314,35315,35614,35608,35606,35601,35589,35595,35618,35599,35602,35605,35591,35597,35592,35590,35612,35603,35610,35919,35952,35954,35953,35951,35989,35988,36089,36207,36430,36429,36435,36432,36428,36423,36675,36672,36997,36990,37176,37274,37282,37275,37273,37279,37281,37277,37280,37793,37763,37807,37732,37718,37703,37756,37720,37724,37750,37705,37712,37713,37728,37741,37775,37708,37738,37753,37719,37717,37714,37711,37745,37751,37755,37729,37726,37731,37735,37760,37710,37721,38343,38336,38345,38339,38341,38327,38574,38576,38572,38688,38687,38680,38685,38681,38810,38817,38812,38814,38813,38869,38868,38897,38977,38980,38986,38985,38981,38979,39205,39211,39212,39210,39219,39218,39215,39213,39217,39216,39320,39331,39329,39426,39418,39412,39415,39417,39416,39414,39419,39421,39422,39420,39427,39614,39678,39677,39681,39676,39752,39834,39848,39838,39835,39846,39841,39845,39844,39814,39842,39840,39855,40243,40257,40295,40246,40238,40239,40241,40248,40240,40261,40258,40259,40254,40247,40256,40253,32757,40237,40586,40585,40589,40624,40648,40666,40699,40703,40740,40739,40738,40788,40864,20785,20781,20782,22168,22172,22167,22170,22173,22169,22896,23356,23657,23658,24000,24173,24174,25048,25055,25069,25070,25073,25066,25072,25067,25046,25065,25855,25860,25853,25848,25857,25859,25852,26004,26075,26330,26331,26328,27333,27321,27325,27361,27334,27322,27318,27319,27335,27316,27309,27486,27593,27659,28679,28684,28685,28673,28677,28692,28686,28671,28672,28667,28710,28668,28663,28682,29185,29183,29177,29187,29181,29558,29880,29888,29877,29889,29886,29878,29883,29890,29972,29971,30300,30308,30297,30288,30291,30295,30298,30374,30397,30444,30658,30650,30975,30988,30995,30996,30985,30992,30994,30993,31149,31148,31327,31772,31785,31769,31776,31775,31789,31773,31782,31784,31778,31781,31792,32348,32336,32342,32355,32344,32354,32351,32337,32352,32343,32339,32693,32691,32759,32760,32885,33233,33234,33232,33375,33374,34228,34246,34240,34243,34242,34227,34229,34237,34247,34244,34239,34251,34254,34248,34245,34225,34230,34258,34340,34232,34231,34238,34409,34791,34790,34786,34779,34795,34794,34789,34783,34803,34788,34772,34780,34771,34797,34776,34787,34724,34775,34777,34817,34804,34792,34781,35155,35147,35151,35148,35142,35152,35153,35145,35626,35623,35619,35635,35632,35637,35655,35631,35644,35646,35633,35621,35639,35622,35638,35630,35620,35643,35645,35642,35906,35957,35993,35992,35991,36094,36100,36098,36096,36444,36450,36448,36439,36438,36446,36453,36455,36443,36442,36449,36445,36457,36436,36678,36679,36680,36683,37160,37178,37179,37182,37288,37285,37287,37295,37290,37813,37772,37778,37815,37787,37789,37769,37799,37774,37802,37790,37798,37781,37768,37785,37791,37773,37809,37777,37810,37796,37800,37812,37795,37797,38354,38355,38353,38579,38615,38618,24002,38623,38616,38621,38691,38690,38693,38828,38830,38824,38827,38820,38826,38818,38821,38871,38873,38870,38872,38906,38992,38993,38994,39096,39233,39228,39226,39439,39435,39433,39437,39428,39441,39434,39429,39431,39430,39616,39644,39688,39684,39685,39721,39733,39754,39756,39755,39879,39878,39875,39871,39873,39861,39864,39891,39862,39876,39865,39869,40284,40275,40271,40266,40283,40267,40281,40278,40268,40279,40274,40276,40287,40280,40282,40590,40588,40671,40705,40704,40726,40741,40747,40746,40745,40744,40780,40789,20788,20789,21142,21239,21428,22187,22189,22182,22183,22186,22188,22746,22749,22747,22802,23357,23358,23359,24003,24176,24511,25083,25863,25872,25869,25865,25868,25870,25988,26078,26077,26334,27367,27360,27340,27345,27353,27339,27359,27356,27344,27371,27343,27341,27358,27488,27568,27660,28697,28711,28704,28694,28715,28705,28706,28707,28713,28695,28708,28700,28714,29196,29194,29191,29186,29189,29349,29350,29348,29347,29345,29899,29893,29879,29891,29974,30304,30665,30666,30660,30705,31005,31003,31009,31004,30999,31006,31152,31335,31336,31795,31804,31801,31788,31803,31980,31978,32374,32373,32376,32368,32375,32367,32378,32370,32372,32360,32587,32586,32643,32646,32695,32765,32766,32888,33239,33237,33380,33377,33379,34283,34289,34285,34265,34273,34280,34266,34263,34284,34290,34296,34264,34271,34275,34268,34257,34288,34278,34287,34270,34274,34816,34810,34819,34806,34807,34825,34828,34827,34822,34812,34824,34815,34826,34818,35170,35162,35163,35159,35169,35164,35160,35165,35161,35208,35255,35254,35318,35664,35656,35658,35648,35667,35670,35668,35659,35669,35665,35650,35666,35671,35907,35959,35958,35994,36102,36103,36105,36268,36266,36269,36267,36461,36472,36467,36458,36463,36475,36546,36690,36689,36687,36688,36691,36788,37184,37183,37296,37293,37854,37831,37839,37826,37850,37840,37881,37868,37836,37849,37801,37862,37834,37844,37870,37859,37845,37828,37838,37824,37842,37863,38269,38362,38363,38625,38697,38699,38700,38696,38694,38835,38839,38838,38877,38878,38879,39004,39001,39005,38999,39103,39101,39099,39102,39240,39239,39235,39334,39335,39450,39445,39461,39453,39460,39451,39458,39456,39463,39459,39454,39452,39444,39618,39691,39690,39694,39692,39735,39914,39915,39904,39902,39908,39910,39906,39920,39892,39895,39916,39900,39897,39909,39893,39905,39898,40311,40321,40330,40324,40328,40305,40320,40312,40326,40331,40332,40317,40299,40308,40309,40304,40297,40325,40307,40315,40322,40303,40313,40319,40327,40296,40596,40593,40640,40700,40749,40768,40769,40781,40790,40791,40792,21303,22194,22197,22195,22755,23365,24006,24007,24302,24303,24512,24513,25081,25879,25878,25877,25875,26079,26344,26339,26340,27379,27376,27370,27368,27385,27377,27374,27375,28732,28725,28719,28727,28724,28721,28738,28728,28735,28730,28729,28736,28731,28723,28737,29203,29204,29352,29565,29564,29882,30379,30378,30398,30445,30668,30670,30671,30669,30706,31013,31011,31015,31016,31012,31017,31154,31342,31340,31341,31479,31817,31816,31818,31815,31813,31982,32379,32382,32385,32384,32698,32767,32889,33243,33241,33291,33384,33385,34338,34303,34305,34302,34331,34304,34294,34308,34313,34309,34316,34301,34841,34832,34833,34839,34835,34838,35171,35174,35257,35319,35680,35690,35677,35688,35683,35685,35687,35693,36270,36486,36488,36484,36697,36694,36695,36693,36696,36698,37005,37187,37185,37303,37301,37298,37299,37899,37907,37883,37920,37903,37908,37886,37909,37904,37928,37913,37901,37877,37888,37879,37895,37902,37910,37906,37882,37897,37880,37898,37887,37884,37900,37878,37905,37894,38366,38368,38367,38702,38703,38841,38843,38909,38910,39008,39010,39011,39007,39105,39106,39248,39246,39257,39244,39243,39251,39474,39476,39473,39468,39466,39478,39465,39470,39480,39469,39623,39626,39622,39696,39698,39697,39947,39944,39927,39941,39954,39928,40000,39943,39950,39942,39959,39956,39945,40351,40345,40356,40349,40338,40344,40336,40347,40352,40340,40348,40362,40343,40353,40346,40354,40360,40350,40355,40383,40361,40342,40358,40359,40601,40603,40602,40677,40676,40679,40678,40752,40750,40795,40800,40798,40797,40793,40849,20794,20793,21144,21143,22211,22205,22206,23368,23367,24011,24015,24305,25085,25883,27394,27388,27395,27384,27392,28739,28740,28746,28744,28745,28741,28742,29213,29210,29209,29566,29975,30314,30672,31021,31025,31023,31828,31827,31986,32394,32391,32392,32395,32390,32397,32589,32699,32816,33245,34328,34346,34342,34335,34339,34332,34329,34343,34350,34337,34336,34345,34334,34341,34857,34845,34843,34848,34852,34844,34859,34890,35181,35177,35182,35179,35322,35705,35704,35653,35706,35707,36112,36116,36271,36494,36492,36702,36699,36701,37190,37188,37189,37305,37951,37947,37942,37929,37949,37948,37936,37945,37930,37943,37932,37952,37937,38373,38372,38371,38709,38714,38847,38881,39012,39113,39110,39104,39256,39254,39481,39485,39494,39492,39490,39489,39482,39487,39629,39701,39703,39704,39702,39738,39762,39979,39965,39964,39980,39971,39976,39977,39972,39969,40375,40374,40380,40385,40391,40394,40399,40382,40389,40387,40379,40373,40398,40377,40378,40364,40392,40369,40365,40396,40371,40397,40370,40570,40604,40683,40686,40685,40731,40728,40730,40753,40782,40805,40804,40850,20153,22214,22213,22219,22897,23371,23372,24021,24017,24306,25889,25888,25894,25890,27403,27400,27401,27661,28757,28758,28759,28754,29214,29215,29353,29567,29912,29909,29913,29911,30317,30381,31029,31156,31344,31345,31831,31836,31833,31835,31834,31988,31985,32401,32591,32647,33246,33387,34356,34357,34355,34348,34354,34358,34860,34856,34854,34858,34853,35185,35263,35262,35323,35710,35716,35714,35718,35717,35711,36117,36501,36500,36506,36498,36496,36502,36503,36704,36706,37191,37964,37968,37962,37963,37967,37959,37957,37960,37961,37958,38719,38883,39018,39017,39115,39252,39259,39502,39507,39508,39500,39503,39496,39498,39497,39506,39504,39632,39705,39723,39739,39766,39765,40006,40008,39999,40004,39993,39987,40001,39996,39991,39988,39986,39997,39990,40411,40402,40414,40410,40395,40400,40412,40401,40415,40425,40409,40408,40406,40437,40405,40413,40630,40688,40757,40755,40754,40770,40811,40853,40866,20797,21145,22760,22759,22898,23373,24024,34863,24399,25089,25091,25092,25897,25893,26006,26347,27409,27410,27407,27594,28763,28762,29218,29570,29569,29571,30320,30676,31847,31846,32405,33388,34362,34368,34361,34364,34353,34363,34366,34864,34866,34862,34867,35190,35188,35187,35326,35724,35726,35723,35720,35909,36121,36504,36708,36707,37308,37986,37973,37981,37975,37982,38852,38853,38912,39510,39513,39710,39711,39712,40018,40024,40016,40010,40013,40011,40021,40025,40012,40014,40443,40439,40431,40419,40427,40440,40420,40438,40417,40430,40422,40434,40432,40418,40428,40436,40435,40424,40429,40642,40656,40690,40691,40710,40732,40760,40759,40758,40771,40783,40817,40816,40814,40815,22227,22221,23374,23661,25901,26349,26350,27411,28767,28769,28765,28768,29219,29915,29925,30677,31032,31159,31158,31850,32407,32649,33389,34371,34872,34871,34869,34891,35732,35733,36510,36511,36512,36509,37310,37309,37314,37995,37992,37993,38629,38726,38723,38727,38855,38885,39518,39637,39769,40035,40039,40038,40034,40030,40032,40450,40446,40455,40451,40454,40453,40448,40449,40457,40447,40445,40452,40608,40734,40774,40820,40821,40822,22228,25902,26040,27416,27417,27415,27418,28770,29222,29354,30680,30681,31033,31849,31851,31990,32410,32408,32411,32409,33248,33249,34374,34375,34376,35193,35194,35196,35195,35327,35736,35737,36517,36516,36515,37998,37997,37999,38001,38003,38729,39026,39263,40040,40046,40045,40459,40461,40464,40463,40466,40465,40609,40693,40713,40775,40824,40827,40826,40825,22302,28774,31855,34876,36274,36518,37315,38004,38008,38006,38005,39520,40052,40051,40049,40053,40468,40467,40694,40714,40868,28776,28773,31991,34410,34878,34877,34879,35742,35996,36521,36553,38731,39027,39028,39116,39265,39339,39524,39526,39527,39716,40469,40471,40776,25095,27422,29223,34380,36520,38018,38016,38017,39529,39528,39726,40473,29225,34379,35743,38019,40057,40631,30325,39531,40058,40477,28777,28778,40612,40830,40777,40856,30849,37561,35023,22715,24658,31911,23290,9556,9574,9559,9568,9580,9571,9562,9577,9565,9554,9572,9557,9566,9578,9569,9560,9575,9563,9555,9573,9558,9567,9579,9570,9561,9576,9564,9553,9552,9581,9582,9584,9583,65517,132423,37595,132575,147397,34124,17077,29679,20917,13897,149826,166372,37700,137691,33518,146632,30780,26436,25311,149811,166314,131744,158643,135941,20395,140525,20488,159017,162436,144896,150193,140563,20521,131966,24484,131968,131911,28379,132127,20605,20737,13434,20750,39020,14147,33814,149924,132231,20832,144308,20842,134143,139516,131813,140592,132494,143923,137603,23426,34685,132531,146585,20914,20920,40244,20937,20943,20945,15580,20947,150182,20915,20962,21314,20973,33741,26942,145197,24443,21003,21030,21052,21173,21079,21140,21177,21189,31765,34114,21216,34317,158483,21253,166622,21833,28377,147328,133460,147436,21299,21316,134114,27851,136998,26651,29653,24650,16042,14540,136936,29149,17570,21357,21364,165547,21374,21375,136598,136723,30694,21395,166555,21408,21419,21422,29607,153458,16217,29596,21441,21445,27721,20041,22526,21465,15019,134031,21472,147435,142755,21494,134263,21523,28793,21803,26199,27995,21613,158547,134516,21853,21647,21668,18342,136973,134877,15796,134477,166332,140952,21831,19693,21551,29719,21894,21929,22021,137431,147514,17746,148533,26291,135348,22071,26317,144010,26276,26285,22093,22095,30961,22257,38791,21502,22272,22255,22253,166758,13859,135759,22342,147877,27758,28811,22338,14001,158846,22502,136214,22531,136276,148323,22566,150517,22620,22698,13665,22752,22748,135740,22779,23551,22339,172368,148088,37843,13729,22815,26790,14019,28249,136766,23076,21843,136850,34053,22985,134478,158849,159018,137180,23001,137211,137138,159142,28017,137256,136917,23033,159301,23211,23139,14054,149929,23159,14088,23190,29797,23251,159649,140628,15749,137489,14130,136888,24195,21200,23414,25992,23420,162318,16388,18525,131588,23509,24928,137780,154060,132517,23539,23453,19728,23557,138052,23571,29646,23572,138405,158504,23625,18653,23685,23785,23791,23947,138745,138807,23824,23832,23878,138916,23738,24023,33532,14381,149761,139337,139635,33415,14390,15298,24110,27274,24181,24186,148668,134355,21414,20151,24272,21416,137073,24073,24308,164994,24313,24315,14496,24316,26686,37915,24333,131521,194708,15070,18606,135994,24378,157832,140240,24408,140401,24419,38845,159342,24434,37696,166454,24487,23990,15711,152144,139114,159992,140904,37334,131742,166441,24625,26245,137335,14691,15815,13881,22416,141236,31089,15936,24734,24740,24755,149890,149903,162387,29860,20705,23200,24932,33828,24898,194726,159442,24961,20980,132694,24967,23466,147383,141407,25043,166813,170333,25040,14642,141696,141505,24611,24924,25886,25483,131352,25285,137072,25301,142861,25452,149983,14871,25656,25592,136078,137212,25744,28554,142902,38932,147596,153373,25825,25829,38011,14950,25658,14935,25933,28438,150056,150051,25989,25965,25951,143486,26037,149824,19255,26065,16600,137257,26080,26083,24543,144384,26136,143863,143864,26180,143780,143781,26187,134773,26215,152038,26227,26228,138813,143921,165364,143816,152339,30661,141559,39332,26370,148380,150049,15147,27130,145346,26462,26471,26466,147917,168173,26583,17641,26658,28240,37436,26625,144358,159136,26717,144495,27105,27147,166623,26995,26819,144845,26881,26880,15666,14849,144956,15232,26540,26977,166474,17148,26934,27032,15265,132041,33635,20624,27129,144985,139562,27205,145155,27293,15347,26545,27336,168348,15373,27421,133411,24798,27445,27508,141261,28341,146139,132021,137560,14144,21537,146266,27617,147196,27612,27703,140427,149745,158545,27738,33318,27769,146876,17605,146877,147876,149772,149760,146633,14053,15595,134450,39811,143865,140433,32655,26679,159013,159137,159211,28054,27996,28284,28420,149887,147589,159346,34099,159604,20935,27804,28189,33838,166689,28207,146991,29779,147330,31180,28239,23185,143435,28664,14093,28573,146992,28410,136343,147517,17749,37872,28484,28508,15694,28532,168304,15675,28575,147780,28627,147601,147797,147513,147440,147380,147775,20959,147798,147799,147776,156125,28747,28798,28839,28801,28876,28885,28886,28895,16644,15848,29108,29078,148087,28971,28997,23176,29002,29038,23708,148325,29007,37730,148161,28972,148570,150055,150050,29114,166888,28861,29198,37954,29205,22801,37955,29220,37697,153093,29230,29248,149876,26813,29269,29271,15957,143428,26637,28477,29314,29482,29483,149539,165931,18669,165892,29480,29486,29647,29610,134202,158254,29641,29769,147938,136935,150052,26147,14021,149943,149901,150011,29687,29717,26883,150054,29753,132547,16087,29788,141485,29792,167602,29767,29668,29814,33721,29804,14128,29812,37873,27180,29826,18771,150156,147807,150137,166799,23366,166915,137374,29896,137608,29966,29929,29982,167641,137803,23511,167596,37765,30029,30026,30055,30062,151426,16132,150803,30094,29789,30110,30132,30210,30252,30289,30287,30319,30326,156661,30352,33263,14328,157969,157966,30369,30373,30391,30412,159647,33890,151709,151933,138780,30494,30502,30528,25775,152096,30552,144044,30639,166244,166248,136897,30708,30729,136054,150034,26826,30895,30919,30931,38565,31022,153056,30935,31028,30897,161292,36792,34948,166699,155779,140828,31110,35072,26882,31104,153687,31133,162617,31036,31145,28202,160038,16040,31174,168205,31188], "euc-kr":[44034,44035,44037,44038,44043,44044,44045,44046,44047,44056,44062,44063,44065,44066,44067,44069,44070,44071,44072,44073,44074,44075,44078,44082,44083,44084,null,null,null,null,null,null,44085,44086,44087,44090,44091,44093,44094,44095,44097,44098,44099,44100,44101,44102,44103,44104,44105,44106,44108,44110,44111,44112,44113,44114,44115,44117,null,null,null,null,null,null,44118,44119,44121,44122,44123,44125,44126,44127,44128,44129,44130,44131,44132,44133,44134,44135,44136,44137,44138,44139,44140,44141,44142,44143,44146,44147,44149,44150,44153,44155,44156,44157,44158,44159,44162,44167,44168,44173,44174,44175,44177,44178,44179,44181,44182,44183,44184,44185,44186,44187,44190,44194,44195,44196,44197,44198,44199,44203,44205,44206,44209,44210,44211,44212,44213,44214,44215,44218,44222,44223,44224,44226,44227,44229,44230,44231,44233,44234,44235,44237,44238,44239,44240,44241,44242,44243,44244,44246,44248,44249,44250,44251,44252,44253,44254,44255,44258,44259,44261,44262,44265,44267,44269,44270,44274,44276,44279,44280,44281,44282,44283,44286,44287,44289,44290,44291,44293,44295,44296,44297,44298,44299,44302,44304,44306,44307,44308,44309,44310,44311,44313,44314,44315,44317,44318,44319,44321,44322,44323,44324,44325,44326,44327,44328,44330,44331,44334,44335,44336,44337,44338,44339,null,null,null,null,null,null,44342,44343,44345,44346,44347,44349,44350,44351,44352,44353,44354,44355,44358,44360,44362,44363,44364,44365,44366,44367,44369,44370,44371,44373,44374,44375,null,null,null,null,null,null,44377,44378,44379,44380,44381,44382,44383,44384,44386,44388,44389,44390,44391,44392,44393,44394,44395,44398,44399,44401,44402,44407,44408,44409,44410,44414,44416,44419,44420,44421,44422,44423,44426,44427,44429,44430,44431,44433,44434,44435,44436,44437,44438,44439,44440,44441,44442,44443,44446,44447,44448,44449,44450,44451,44453,44454,44455,44456,44457,44458,44459,44460,44461,44462,44463,44464,44465,44466,44467,44468,44469,44470,44472,44473,44474,44475,44476,44477,44478,44479,44482,44483,44485,44486,44487,44489,44490,44491,44492,44493,44494,44495,44498,44500,44501,44502,44503,44504,44505,44506,44507,44509,44510,44511,44513,44514,44515,44517,44518,44519,44520,44521,44522,44523,44524,44525,44526,44527,44528,44529,44530,44531,44532,44533,44534,44535,44538,44539,44541,44542,44546,44547,44548,44549,44550,44551,44554,44556,44558,44559,44560,44561,44562,44563,44565,44566,44567,44568,44569,44570,44571,44572,null,null,null,null,null,null,44573,44574,44575,44576,44577,44578,44579,44580,44581,44582,44583,44584,44585,44586,44587,44588,44589,44590,44591,44594,44595,44597,44598,44601,44603,44604,null,null,null,null,null,null,44605,44606,44607,44610,44612,44615,44616,44617,44619,44623,44625,44626,44627,44629,44631,44632,44633,44634,44635,44638,44642,44643,44644,44646,44647,44650,44651,44653,44654,44655,44657,44658,44659,44660,44661,44662,44663,44666,44670,44671,44672,44673,44674,44675,44678,44679,44680,44681,44682,44683,44685,44686,44687,44688,44689,44690,44691,44692,44693,44694,44695,44696,44697,44698,44699,44700,44701,44702,44703,44704,44705,44706,44707,44708,44709,44710,44711,44712,44713,44714,44715,44716,44717,44718,44719,44720,44721,44722,44723,44724,44725,44726,44727,44728,44729,44730,44731,44735,44737,44738,44739,44741,44742,44743,44744,44745,44746,44747,44750,44754,44755,44756,44757,44758,44759,44762,44763,44765,44766,44767,44768,44769,44770,44771,44772,44773,44774,44775,44777,44778,44780,44782,44783,44784,44785,44786,44787,44789,44790,44791,44793,44794,44795,44797,44798,44799,44800,44801,44802,44803,44804,44805,null,null,null,null,null,null,44806,44809,44810,44811,44812,44814,44815,44817,44818,44819,44820,44821,44822,44823,44824,44825,44826,44827,44828,44829,44830,44831,44832,44833,44834,44835,null,null,null,null,null,null,44836,44837,44838,44839,44840,44841,44842,44843,44846,44847,44849,44851,44853,44854,44855,44856,44857,44858,44859,44862,44864,44868,44869,44870,44871,44874,44875,44876,44877,44878,44879,44881,44882,44883,44884,44885,44886,44887,44888,44889,44890,44891,44894,44895,44896,44897,44898,44899,44902,44903,44904,44905,44906,44907,44908,44909,44910,44911,44912,44913,44914,44915,44916,44917,44918,44919,44920,44922,44923,44924,44925,44926,44927,44929,44930,44931,44933,44934,44935,44937,44938,44939,44940,44941,44942,44943,44946,44947,44948,44950,44951,44952,44953,44954,44955,44957,44958,44959,44960,44961,44962,44963,44964,44965,44966,44967,44968,44969,44970,44971,44972,44973,44974,44975,44976,44977,44978,44979,44980,44981,44982,44983,44986,44987,44989,44990,44991,44993,44994,44995,44996,44997,44998,45002,45004,45007,45008,45009,45010,45011,45013,45014,45015,45016,45017,45018,45019,45021,45022,45023,45024,45025,null,null,null,null,null,null,45026,45027,45028,45029,45030,45031,45034,45035,45036,45037,45038,45039,45042,45043,45045,45046,45047,45049,45050,45051,45052,45053,45054,45055,45058,45059,null,null,null,null,null,null,45061,45062,45063,45064,45065,45066,45067,45069,45070,45071,45073,45074,45075,45077,45078,45079,45080,45081,45082,45083,45086,45087,45088,45089,45090,45091,45092,45093,45094,45095,45097,45098,45099,45100,45101,45102,45103,45104,45105,45106,45107,45108,45109,45110,45111,45112,45113,45114,45115,45116,45117,45118,45119,45120,45121,45122,45123,45126,45127,45129,45131,45133,45135,45136,45137,45138,45142,45144,45146,45147,45148,45150,45151,45152,45153,45154,45155,45156,45157,45158,45159,45160,45161,45162,45163,45164,45165,45166,45167,45168,45169,45170,45171,45172,45173,45174,45175,45176,45177,45178,45179,45182,45183,45185,45186,45187,45189,45190,45191,45192,45193,45194,45195,45198,45200,45202,45203,45204,45205,45206,45207,45211,45213,45214,45219,45220,45221,45222,45223,45226,45232,45234,45238,45239,45241,45242,45243,45245,45246,45247,45248,45249,45250,45251,45254,45258,45259,45260,45261,45262,45263,45266,null,null,null,null,null,null,45267,45269,45270,45271,45273,45274,45275,45276,45277,45278,45279,45281,45282,45283,45284,45286,45287,45288,45289,45290,45291,45292,45293,45294,45295,45296,null,null,null,null,null,null,45297,45298,45299,45300,45301,45302,45303,45304,45305,45306,45307,45308,45309,45310,45311,45312,45313,45314,45315,45316,45317,45318,45319,45322,45325,45326,45327,45329,45332,45333,45334,45335,45338,45342,45343,45344,45345,45346,45350,45351,45353,45354,45355,45357,45358,45359,45360,45361,45362,45363,45366,45370,45371,45372,45373,45374,45375,45378,45379,45381,45382,45383,45385,45386,45387,45388,45389,45390,45391,45394,45395,45398,45399,45401,45402,45403,45405,45406,45407,45409,45410,45411,45412,45413,45414,45415,45416,45417,45418,45419,45420,45421,45422,45423,45424,45425,45426,45427,45428,45429,45430,45431,45434,45435,45437,45438,45439,45441,45443,45444,45445,45446,45447,45450,45452,45454,45455,45456,45457,45461,45462,45463,45465,45466,45467,45469,45470,45471,45472,45473,45474,45475,45476,45477,45478,45479,45481,45482,45483,45484,45485,45486,45487,45488,45489,45490,45491,45492,45493,45494,45495,45496,null,null,null,null,null,null,45497,45498,45499,45500,45501,45502,45503,45504,45505,45506,45507,45508,45509,45510,45511,45512,45513,45514,45515,45517,45518,45519,45521,45522,45523,45525,null,null,null,null,null,null,45526,45527,45528,45529,45530,45531,45534,45536,45537,45538,45539,45540,45541,45542,45543,45546,45547,45549,45550,45551,45553,45554,45555,45556,45557,45558,45559,45560,45562,45564,45566,45567,45568,45569,45570,45571,45574,45575,45577,45578,45581,45582,45583,45584,45585,45586,45587,45590,45592,45594,45595,45596,45597,45598,45599,45601,45602,45603,45604,45605,45606,45607,45608,45609,45610,45611,45612,45613,45614,45615,45616,45617,45618,45619,45621,45622,45623,45624,45625,45626,45627,45629,45630,45631,45632,45633,45634,45635,45636,45637,45638,45639,45640,45641,45642,45643,45644,45645,45646,45647,45648,45649,45650,45651,45652,45653,45654,45655,45657,45658,45659,45661,45662,45663,45665,45666,45667,45668,45669,45670,45671,45674,45675,45676,45677,45678,45679,45680,45681,45682,45683,45686,45687,45688,45689,45690,45691,45693,45694,45695,45696,45697,45698,45699,45702,45703,45704,45706,45707,45708,45709,45710,null,null,null,null,null,null,45711,45714,45715,45717,45718,45719,45723,45724,45725,45726,45727,45730,45732,45735,45736,45737,45739,45741,45742,45743,45745,45746,45747,45749,45750,45751,null,null,null,null,null,null,45752,45753,45754,45755,45756,45757,45758,45759,45760,45761,45762,45763,45764,45765,45766,45767,45770,45771,45773,45774,45775,45777,45779,45780,45781,45782,45783,45786,45788,45790,45791,45792,45793,45795,45799,45801,45802,45808,45809,45810,45814,45820,45821,45822,45826,45827,45829,45830,45831,45833,45834,45835,45836,45837,45838,45839,45842,45846,45847,45848,45849,45850,45851,45853,45854,45855,45856,45857,45858,45859,45860,45861,45862,45863,45864,45865,45866,45867,45868,45869,45870,45871,45872,45873,45874,45875,45876,45877,45878,45879,45880,45881,45882,45883,45884,45885,45886,45887,45888,45889,45890,45891,45892,45893,45894,45895,45896,45897,45898,45899,45900,45901,45902,45903,45904,45905,45906,45907,45911,45913,45914,45917,45920,45921,45922,45923,45926,45928,45930,45932,45933,45935,45938,45939,45941,45942,45943,45945,45946,45947,45948,45949,45950,45951,45954,45958,45959,45960,45961,45962,45963,45965,null,null,null,null,null,null,45966,45967,45969,45970,45971,45973,45974,45975,45976,45977,45978,45979,45980,45981,45982,45983,45986,45987,45988,45989,45990,45991,45993,45994,45995,45997,null,null,null,null,null,null,45998,45999,46000,46001,46002,46003,46004,46005,46006,46007,46008,46009,46010,46011,46012,46013,46014,46015,46016,46017,46018,46019,46022,46023,46025,46026,46029,46031,46033,46034,46035,46038,46040,46042,46044,46046,46047,46049,46050,46051,46053,46054,46055,46057,46058,46059,46060,46061,46062,46063,46064,46065,46066,46067,46068,46069,46070,46071,46072,46073,46074,46075,46077,46078,46079,46080,46081,46082,46083,46084,46085,46086,46087,46088,46089,46090,46091,46092,46093,46094,46095,46097,46098,46099,46100,46101,46102,46103,46105,46106,46107,46109,46110,46111,46113,46114,46115,46116,46117,46118,46119,46122,46124,46125,46126,46127,46128,46129,46130,46131,46133,46134,46135,46136,46137,46138,46139,46140,46141,46142,46143,46144,46145,46146,46147,46148,46149,46150,46151,46152,46153,46154,46155,46156,46157,46158,46159,46162,46163,46165,46166,46167,46169,46170,46171,46172,46173,46174,46175,46178,46180,46182,null,null,null,null,null,null,46183,46184,46185,46186,46187,46189,46190,46191,46192,46193,46194,46195,46196,46197,46198,46199,46200,46201,46202,46203,46204,46205,46206,46207,46209,46210,null,null,null,null,null,null,46211,46212,46213,46214,46215,46217,46218,46219,46220,46221,46222,46223,46224,46225,46226,46227,46228,46229,46230,46231,46232,46233,46234,46235,46236,46238,46239,46240,46241,46242,46243,46245,46246,46247,46249,46250,46251,46253,46254,46255,46256,46257,46258,46259,46260,46262,46264,46266,46267,46268,46269,46270,46271,46273,46274,46275,46277,46278,46279,46281,46282,46283,46284,46285,46286,46287,46289,46290,46291,46292,46294,46295,46296,46297,46298,46299,46302,46303,46305,46306,46309,46311,46312,46313,46314,46315,46318,46320,46322,46323,46324,46325,46326,46327,46329,46330,46331,46332,46333,46334,46335,46336,46337,46338,46339,46340,46341,46342,46343,46344,46345,46346,46347,46348,46349,46350,46351,46352,46353,46354,46355,46358,46359,46361,46362,46365,46366,46367,46368,46369,46370,46371,46374,46379,46380,46381,46382,46383,46386,46387,46389,46390,46391,46393,46394,46395,46396,46397,46398,46399,46402,46406,null,null,null,null,null,null,46407,46408,46409,46410,46414,46415,46417,46418,46419,46421,46422,46423,46424,46425,46426,46427,46430,46434,46435,46436,46437,46438,46439,46440,46441,46442,null,null,null,null,null,null,46443,46444,46445,46446,46447,46448,46449,46450,46451,46452,46453,46454,46455,46456,46457,46458,46459,46460,46461,46462,46463,46464,46465,46466,46467,46468,46469,46470,46471,46472,46473,46474,46475,46476,46477,46478,46479,46480,46481,46482,46483,46484,46485,46486,46487,46488,46489,46490,46491,46492,46493,46494,46495,46498,46499,46501,46502,46503,46505,46508,46509,46510,46511,46514,46518,46519,46520,46521,46522,46526,46527,46529,46530,46531,46533,46534,46535,46536,46537,46538,46539,46542,46546,46547,46548,46549,46550,46551,46553,46554,46555,46556,46557,46558,46559,46560,46561,46562,46563,46564,46565,46566,46567,46568,46569,46570,46571,46573,46574,46575,46576,46577,46578,46579,46580,46581,46582,46583,46584,46585,46586,46587,46588,46589,46590,46591,46592,46593,46594,46595,46596,46597,46598,46599,46600,46601,46602,46603,46604,46605,46606,46607,46610,46611,46613,46614,46615,46617,46618,46619,46620,46621,null,null,null,null,null,null,46622,46623,46624,46625,46626,46627,46628,46630,46631,46632,46633,46634,46635,46637,46638,46639,46640,46641,46642,46643,46645,46646,46647,46648,46649,46650,null,null,null,null,null,null,46651,46652,46653,46654,46655,46656,46657,46658,46659,46660,46661,46662,46663,46665,46666,46667,46668,46669,46670,46671,46672,46673,46674,46675,46676,46677,46678,46679,46680,46681,46682,46683,46684,46685,46686,46687,46688,46689,46690,46691,46693,46694,46695,46697,46698,46699,46700,46701,46702,46703,46704,46705,46706,46707,46708,46709,46710,46711,46712,46713,46714,46715,46716,46717,46718,46719,46720,46721,46722,46723,46724,46725,46726,46727,46728,46729,46730,46731,46732,46733,46734,46735,46736,46737,46738,46739,46740,46741,46742,46743,46744,46745,46746,46747,46750,46751,46753,46754,46755,46757,46758,46759,46760,46761,46762,46765,46766,46767,46768,46770,46771,46772,46773,46774,46775,46776,46777,46778,46779,46780,46781,46782,46783,46784,46785,46786,46787,46788,46789,46790,46791,46792,46793,46794,46795,46796,46797,46798,46799,46800,46801,46802,46803,46805,46806,46807,46808,46809,46810,46811,46812,46813,null,null,null,null,null,null,46814,46815,46816,46817,46818,46819,46820,46821,46822,46823,46824,46825,46826,46827,46828,46829,46830,46831,46833,46834,46835,46837,46838,46839,46841,46842,null,null,null,null,null,null,46843,46844,46845,46846,46847,46850,46851,46852,46854,46855,46856,46857,46858,46859,46860,46861,46862,46863,46864,46865,46866,46867,46868,46869,46870,46871,46872,46873,46874,46875,46876,46877,46878,46879,46880,46881,46882,46883,46884,46885,46886,46887,46890,46891,46893,46894,46897,46898,46899,46900,46901,46902,46903,46906,46908,46909,46910,46911,46912,46913,46914,46915,46917,46918,46919,46921,46922,46923,46925,46926,46927,46928,46929,46930,46931,46934,46935,46936,46937,46938,46939,46940,46941,46942,46943,46945,46946,46947,46949,46950,46951,46953,46954,46955,46956,46957,46958,46959,46962,46964,46966,46967,46968,46969,46970,46971,46974,46975,46977,46978,46979,46981,46982,46983,46984,46985,46986,46987,46990,46995,46996,46997,47002,47003,47005,47006,47007,47009,47010,47011,47012,47013,47014,47015,47018,47022,47023,47024,47025,47026,47027,47030,47031,47033,47034,47035,47036,47037,47038,47039,47040,47041,null,null,null,null,null,null,47042,47043,47044,47045,47046,47048,47050,47051,47052,47053,47054,47055,47056,47057,47058,47059,47060,47061,47062,47063,47064,47065,47066,47067,47068,47069,null,null,null,null,null,null,47070,47071,47072,47073,47074,47075,47076,47077,47078,47079,47080,47081,47082,47083,47086,47087,47089,47090,47091,47093,47094,47095,47096,47097,47098,47099,47102,47106,47107,47108,47109,47110,47114,47115,47117,47118,47119,47121,47122,47123,47124,47125,47126,47127,47130,47132,47134,47135,47136,47137,47138,47139,47142,47143,47145,47146,47147,47149,47150,47151,47152,47153,47154,47155,47158,47162,47163,47164,47165,47166,47167,47169,47170,47171,47173,47174,47175,47176,47177,47178,47179,47180,47181,47182,47183,47184,47186,47188,47189,47190,47191,47192,47193,47194,47195,47198,47199,47201,47202,47203,47205,47206,47207,47208,47209,47210,47211,47214,47216,47218,47219,47220,47221,47222,47223,47225,47226,47227,47229,47230,47231,47232,47233,47234,47235,47236,47237,47238,47239,47240,47241,47242,47243,47244,47246,47247,47248,47249,47250,47251,47252,47253,47254,47255,47256,47257,47258,47259,47260,47261,47262,47263,null,null,null,null,null,null,47264,47265,47266,47267,47268,47269,47270,47271,47273,47274,47275,47276,47277,47278,47279,47281,47282,47283,47285,47286,47287,47289,47290,47291,47292,47293,null,null,null,null,null,null,47294,47295,47298,47300,47302,47303,47304,47305,47306,47307,47309,47310,47311,47313,47314,47315,47317,47318,47319,47320,47321,47322,47323,47324,47326,47328,47330,47331,47332,47333,47334,47335,47338,47339,47341,47342,47343,47345,47346,47347,47348,47349,47350,47351,47354,47356,47358,47359,47360,47361,47362,47363,47365,47366,47367,47368,47369,47370,47371,47372,47373,47374,47375,47376,47377,47378,47379,47380,47381,47382,47383,47385,47386,47387,47388,47389,47390,47391,47393,47394,47395,47396,47397,47398,47399,47400,47401,47402,47403,47404,47405,47406,47407,47408,47409,47410,47411,47412,47413,47414,47415,47416,47417,47418,47419,47422,47423,47425,47426,47427,47429,47430,47431,47432,47433,47434,47435,47437,47438,47440,47442,47443,47444,47445,47446,47447,47450,47451,47453,47454,47455,47457,47458,47459,47460,47461,47462,47463,47466,47468,47470,47471,47472,47473,47474,47475,47478,47479,47481,47482,47483,47485,null,null,null,null,null,null,47486,47487,47488,47489,47490,47491,47494,47496,47499,47500,47503,47504,47505,47506,47507,47508,47509,47510,47511,47512,47513,47514,47515,47516,47517,47518,null,null,null,null,null,null,47519,47520,47521,47522,47523,47524,47525,47526,47527,47528,47529,47530,47531,47534,47535,47537,47538,47539,47541,47542,47543,47544,47545,47546,47547,47550,47552,47554,47555,47556,47557,47558,47559,47562,47563,47565,47571,47572,47573,47574,47575,47578,47580,47583,47584,47586,47590,47591,47593,47594,47595,47597,47598,47599,47600,47601,47602,47603,47606,47611,47612,47613,47614,47615,47618,47619,47620,47621,47622,47623,47625,47626,47627,47628,47629,47630,47631,47632,47633,47634,47635,47636,47638,47639,47640,47641,47642,47643,47644,47645,47646,47647,47648,47649,47650,47651,47652,47653,47654,47655,47656,47657,47658,47659,47660,47661,47662,47663,47664,47665,47666,47667,47668,47669,47670,47671,47674,47675,47677,47678,47679,47681,47683,47684,47685,47686,47687,47690,47692,47695,47696,47697,47698,47702,47703,47705,47706,47707,47709,47710,47711,47712,47713,47714,47715,47718,47722,47723,47724,47725,47726,47727,null,null,null,null,null,null,47730,47731,47733,47734,47735,47737,47738,47739,47740,47741,47742,47743,47744,47745,47746,47750,47752,47753,47754,47755,47757,47758,47759,47760,47761,47762,null,null,null,null,null,null,47763,47764,47765,47766,47767,47768,47769,47770,47771,47772,47773,47774,47775,47776,47777,47778,47779,47780,47781,47782,47783,47786,47789,47790,47791,47793,47795,47796,47797,47798,47799,47802,47804,47806,47807,47808,47809,47810,47811,47813,47814,47815,47817,47818,47819,47820,47821,47822,47823,47824,47825,47826,47827,47828,47829,47830,47831,47834,47835,47836,47837,47838,47839,47840,47841,47842,47843,47844,47845,47846,47847,47848,47849,47850,47851,47852,47853,47854,47855,47856,47857,47858,47859,47860,47861,47862,47863,47864,47865,47866,47867,47869,47870,47871,47873,47874,47875,47877,47878,47879,47880,47881,47882,47883,47884,47886,47888,47890,47891,47892,47893,47894,47895,47897,47898,47899,47901,47902,47903,47905,47906,47907,47908,47909,47910,47911,47912,47914,47916,47917,47918,47919,47920,47921,47922,47923,47927,47929,47930,47935,47936,47937,47938,47939,47942,47944,47946,47947,47948,47950,47953,47954,null,null,null,null,null,null,47955,47957,47958,47959,47961,47962,47963,47964,47965,47966,47967,47968,47970,47972,47973,47974,47975,47976,47977,47978,47979,47981,47982,47983,47984,47985,null,null,null,null,null,null,47986,47987,47988,47989,47990,47991,47992,47993,47994,47995,47996,47997,47998,47999,48000,48001,48002,48003,48004,48005,48006,48007,48009,48010,48011,48013,48014,48015,48017,48018,48019,48020,48021,48022,48023,48024,48025,48026,48027,48028,48029,48030,48031,48032,48033,48034,48035,48037,48038,48039,48041,48042,48043,48045,48046,48047,48048,48049,48050,48051,48053,48054,48056,48057,48058,48059,48060,48061,48062,48063,48065,48066,48067,48069,48070,48071,48073,48074,48075,48076,48077,48078,48079,48081,48082,48084,48085,48086,48087,48088,48089,48090,48091,48092,48093,48094,48095,48096,48097,48098,48099,48100,48101,48102,48103,48104,48105,48106,48107,48108,48109,48110,48111,48112,48113,48114,48115,48116,48117,48118,48119,48122,48123,48125,48126,48129,48131,48132,48133,48134,48135,48138,48142,48144,48146,48147,48153,48154,48160,48161,48162,48163,48166,48168,48170,48171,48172,48174,48175,48178,48179,48181,null,null,null,null,null,null,48182,48183,48185,48186,48187,48188,48189,48190,48191,48194,48198,48199,48200,48202,48203,48206,48207,48209,48210,48211,48212,48213,48214,48215,48216,48217,null,null,null,null,null,null,48218,48219,48220,48222,48223,48224,48225,48226,48227,48228,48229,48230,48231,48232,48233,48234,48235,48236,48237,48238,48239,48240,48241,48242,48243,48244,48245,48246,48247,48248,48249,48250,48251,48252,48253,48254,48255,48256,48257,48258,48259,48262,48263,48265,48266,48269,48271,48272,48273,48274,48275,48278,48280,48283,48284,48285,48286,48287,48290,48291,48293,48294,48297,48298,48299,48300,48301,48302,48303,48306,48310,48311,48312,48313,48314,48315,48318,48319,48321,48322,48323,48325,48326,48327,48328,48329,48330,48331,48332,48334,48338,48339,48340,48342,48343,48345,48346,48347,48349,48350,48351,48352,48353,48354,48355,48356,48357,48358,48359,48360,48361,48362,48363,48364,48365,48366,48367,48368,48369,48370,48371,48375,48377,48378,48379,48381,48382,48383,48384,48385,48386,48387,48390,48392,48394,48395,48396,48397,48398,48399,48401,48402,48403,48405,48406,48407,48408,48409,48410,48411,48412,48413,null,null,null,null,null,null,48414,48415,48416,48417,48418,48419,48421,48422,48423,48424,48425,48426,48427,48429,48430,48431,48432,48433,48434,48435,48436,48437,48438,48439,48440,48441,null,null,null,null,null,null,48442,48443,48444,48445,48446,48447,48449,48450,48451,48452,48453,48454,48455,48458,48459,48461,48462,48463,48465,48466,48467,48468,48469,48470,48471,48474,48475,48476,48477,48478,48479,48480,48481,48482,48483,48485,48486,48487,48489,48490,48491,48492,48493,48494,48495,48496,48497,48498,48499,48500,48501,48502,48503,48504,48505,48506,48507,48508,48509,48510,48511,48514,48515,48517,48518,48523,48524,48525,48526,48527,48530,48532,48534,48535,48536,48539,48541,48542,48543,48544,48545,48546,48547,48549,48550,48551,48552,48553,48554,48555,48556,48557,48558,48559,48561,48562,48563,48564,48565,48566,48567,48569,48570,48571,48572,48573,48574,48575,48576,48577,48578,48579,48580,48581,48582,48583,48584,48585,48586,48587,48588,48589,48590,48591,48592,48593,48594,48595,48598,48599,48601,48602,48603,48605,48606,48607,48608,48609,48610,48611,48612,48613,48614,48615,48616,48618,48619,48620,48621,48622,48623,48625,null,null,null,null,null,null,48626,48627,48629,48630,48631,48633,48634,48635,48636,48637,48638,48639,48641,48642,48644,48646,48647,48648,48649,48650,48651,48654,48655,48657,48658,48659,null,null,null,null,null,null,48661,48662,48663,48664,48665,48666,48667,48670,48672,48673,48674,48675,48676,48677,48678,48679,48680,48681,48682,48683,48684,48685,48686,48687,48688,48689,48690,48691,48692,48693,48694,48695,48696,48697,48698,48699,48700,48701,48702,48703,48704,48705,48706,48707,48710,48711,48713,48714,48715,48717,48719,48720,48721,48722,48723,48726,48728,48732,48733,48734,48735,48738,48739,48741,48742,48743,48745,48747,48748,48749,48750,48751,48754,48758,48759,48760,48761,48762,48766,48767,48769,48770,48771,48773,48774,48775,48776,48777,48778,48779,48782,48786,48787,48788,48789,48790,48791,48794,48795,48796,48797,48798,48799,48800,48801,48802,48803,48804,48805,48806,48807,48809,48810,48811,48812,48813,48814,48815,48816,48817,48818,48819,48820,48821,48822,48823,48824,48825,48826,48827,48828,48829,48830,48831,48832,48833,48834,48835,48836,48837,48838,48839,48840,48841,48842,48843,48844,48845,48846,48847,48850,48851,null,null,null,null,null,null,48853,48854,48857,48858,48859,48860,48861,48862,48863,48865,48866,48870,48871,48872,48873,48874,48875,48877,48878,48879,48880,48881,48882,48883,48884,48885,null,null,null,null,null,null,48886,48887,48888,48889,48890,48891,48892,48893,48894,48895,48896,48898,48899,48900,48901,48902,48903,48906,48907,48908,48909,48910,48911,48912,48913,48914,48915,48916,48917,48918,48919,48922,48926,48927,48928,48929,48930,48931,48932,48933,48934,48935,48936,48937,48938,48939,48940,48941,48942,48943,48944,48945,48946,48947,48948,48949,48950,48951,48952,48953,48954,48955,48956,48957,48958,48959,48962,48963,48965,48966,48967,48969,48970,48971,48972,48973,48974,48975,48978,48979,48980,48982,48983,48984,48985,48986,48987,48988,48989,48990,48991,48992,48993,48994,48995,48996,48997,48998,48999,49000,49001,49002,49003,49004,49005,49006,49007,49008,49009,49010,49011,49012,49013,49014,49015,49016,49017,49018,49019,49020,49021,49022,49023,49024,49025,49026,49027,49028,49029,49030,49031,49032,49033,49034,49035,49036,49037,49038,49039,49040,49041,49042,49043,49045,49046,49047,49048,49049,49050,49051,49052,49053,null,null,null,null,null,null,49054,49055,49056,49057,49058,49059,49060,49061,49062,49063,49064,49065,49066,49067,49068,49069,49070,49071,49073,49074,49075,49076,49077,49078,49079,49080,null,null,null,null,null,null,49081,49082,49083,49084,49085,49086,49087,49088,49089,49090,49091,49092,49094,49095,49096,49097,49098,49099,49102,49103,49105,49106,49107,49109,49110,49111,49112,49113,49114,49115,49117,49118,49120,49122,49123,49124,49125,49126,49127,49128,49129,49130,49131,49132,49133,49134,49135,49136,49137,49138,49139,49140,49141,49142,49143,49144,49145,49146,49147,49148,49149,49150,49151,49152,49153,49154,49155,49156,49157,49158,49159,49160,49161,49162,49163,49164,49165,49166,49167,49168,49169,49170,49171,49172,49173,49174,49175,49176,49177,49178,49179,49180,49181,49182,49183,49184,49185,49186,49187,49188,49189,49190,49191,49192,49193,49194,49195,49196,49197,49198,49199,49200,49201,49202,49203,49204,49205,49206,49207,49208,49209,49210,49211,49213,49214,49215,49216,49217,49218,49219,49220,49221,49222,49223,49224,49225,49226,49227,49228,49229,49230,49231,49232,49234,49235,49236,49237,49238,49239,49241,49242,49243,null,null,null,null,null,null,49245,49246,49247,49249,49250,49251,49252,49253,49254,49255,49258,49259,49260,49261,49262,49263,49264,49265,49266,49267,49268,49269,49270,49271,49272,49273,null,null,null,null,null,null,49274,49275,49276,49277,49278,49279,49280,49281,49282,49283,49284,49285,49286,49287,49288,49289,49290,49291,49292,49293,49294,49295,49298,49299,49301,49302,49303,49305,49306,49307,49308,49309,49310,49311,49314,49316,49318,49319,49320,49321,49322,49323,49326,49329,49330,49335,49336,49337,49338,49339,49342,49346,49347,49348,49350,49351,49354,49355,49357,49358,49359,49361,49362,49363,49364,49365,49366,49367,49370,49374,49375,49376,49377,49378,49379,49382,49383,49385,49386,49387,49389,49390,49391,49392,49393,49394,49395,49398,49400,49402,49403,49404,49405,49406,49407,49409,49410,49411,49413,49414,49415,49417,49418,49419,49420,49421,49422,49423,49425,49426,49427,49428,49430,49431,49432,49433,49434,49435,49441,49442,49445,49448,49449,49450,49451,49454,49458,49459,49460,49461,49463,49466,49467,49469,49470,49471,49473,49474,49475,49476,49477,49478,49479,49482,49486,49487,49488,49489,49490,49491,49494,49495,null,null,null,null,null,null,49497,49498,49499,49501,49502,49503,49504,49505,49506,49507,49510,49514,49515,49516,49517,49518,49519,49521,49522,49523,49525,49526,49527,49529,49530,49531,null,null,null,null,null,null,49532,49533,49534,49535,49536,49537,49538,49539,49540,49542,49543,49544,49545,49546,49547,49551,49553,49554,49555,49557,49559,49560,49561,49562,49563,49566,49568,49570,49571,49572,49574,49575,49578,49579,49581,49582,49583,49585,49586,49587,49588,49589,49590,49591,49592,49593,49594,49595,49596,49598,49599,49600,49601,49602,49603,49605,49606,49607,49609,49610,49611,49613,49614,49615,49616,49617,49618,49619,49621,49622,49625,49626,49627,49628,49629,49630,49631,49633,49634,49635,49637,49638,49639,49641,49642,49643,49644,49645,49646,49647,49650,49652,49653,49654,49655,49656,49657,49658,49659,49662,49663,49665,49666,49667,49669,49670,49671,49672,49673,49674,49675,49678,49680,49682,49683,49684,49685,49686,49687,49690,49691,49693,49694,49697,49698,49699,49700,49701,49702,49703,49706,49708,49710,49712,49715,49717,49718,49719,49720,49721,49722,49723,49724,49725,49726,49727,49728,49729,49730,49731,49732,49733,null,null,null,null,null,null,49734,49735,49737,49738,49739,49740,49741,49742,49743,49746,49747,49749,49750,49751,49753,49754,49755,49756,49757,49758,49759,49761,49762,49763,49764,49766,null,null,null,null,null,null,49767,49768,49769,49770,49771,49774,49775,49777,49778,49779,49781,49782,49783,49784,49785,49786,49787,49790,49792,49794,49795,49796,49797,49798,49799,49802,49803,49804,49805,49806,49807,49809,49810,49811,49812,49813,49814,49815,49817,49818,49820,49822,49823,49824,49825,49826,49827,49830,49831,49833,49834,49835,49838,49839,49840,49841,49842,49843,49846,49848,49850,49851,49852,49853,49854,49855,49856,49857,49858,49859,49860,49861,49862,49863,49864,49865,49866,49867,49868,49869,49870,49871,49872,49873,49874,49875,49876,49877,49878,49879,49880,49881,49882,49883,49886,49887,49889,49890,49893,49894,49895,49896,49897,49898,49902,49904,49906,49907,49908,49909,49911,49914,49917,49918,49919,49921,49922,49923,49924,49925,49926,49927,49930,49931,49934,49935,49936,49937,49938,49942,49943,49945,49946,49947,49949,49950,49951,49952,49953,49954,49955,49958,49959,49962,49963,49964,49965,49966,49967,49968,49969,49970,null,null,null,null,null,null,49971,49972,49973,49974,49975,49976,49977,49978,49979,49980,49981,49982,49983,49984,49985,49986,49987,49988,49990,49991,49992,49993,49994,49995,49996,49997,null,null,null,null,null,null,49998,49999,50000,50001,50002,50003,50004,50005,50006,50007,50008,50009,50010,50011,50012,50013,50014,50015,50016,50017,50018,50019,50020,50021,50022,50023,50026,50027,50029,50030,50031,50033,50035,50036,50037,50038,50039,50042,50043,50046,50047,50048,50049,50050,50051,50053,50054,50055,50057,50058,50059,50061,50062,50063,50064,50065,50066,50067,50068,50069,50070,50071,50072,50073,50074,50075,50076,50077,50078,50079,50080,50081,50082,50083,50084,50085,50086,50087,50088,50089,50090,50091,50092,50093,50094,50095,50096,50097,50098,50099,50100,50101,50102,50103,50104,50105,50106,50107,50108,50109,50110,50111,50113,50114,50115,50116,50117,50118,50119,50120,50121,50122,50123,50124,50125,50126,50127,50128,50129,50130,50131,50132,50133,50134,50135,50138,50139,50141,50142,50145,50147,50148,50149,50150,50151,50154,50155,50156,50158,50159,50160,50161,50162,50163,50166,50167,50169,50170,50171,50172,50173,50174,null,null,null,null,null,null,50175,50176,50177,50178,50179,50180,50181,50182,50183,50185,50186,50187,50188,50189,50190,50191,50193,50194,50195,50196,50197,50198,50199,50200,50201,50202,null,null,null,null,null,null,50203,50204,50205,50206,50207,50208,50209,50210,50211,50213,50214,50215,50216,50217,50218,50219,50221,50222,50223,50225,50226,50227,50229,50230,50231,50232,50233,50234,50235,50238,50239,50240,50241,50242,50243,50244,50245,50246,50247,50249,50250,50251,50252,50253,50254,50255,50256,50257,50258,50259,50260,50261,50262,50263,50264,50265,50266,50267,50268,50269,50270,50271,50272,50273,50274,50275,50278,50279,50281,50282,50283,50285,50286,50287,50288,50289,50290,50291,50294,50295,50296,50298,50299,50300,50301,50302,50303,50305,50306,50307,50308,50309,50310,50311,50312,50313,50314,50315,50316,50317,50318,50319,50320,50321,50322,50323,50325,50326,50327,50328,50329,50330,50331,50333,50334,50335,50336,50337,50338,50339,50340,50341,50342,50343,50344,50345,50346,50347,50348,50349,50350,50351,50352,50353,50354,50355,50356,50357,50358,50359,50361,50362,50363,50365,50366,50367,50368,50369,50370,50371,50372,50373,null,null,null,null,null,null,50374,50375,50376,50377,50378,50379,50380,50381,50382,50383,50384,50385,50386,50387,50388,50389,50390,50391,50392,50393,50394,50395,50396,50397,50398,50399,null,null,null,null,null,null,50400,50401,50402,50403,50404,50405,50406,50407,50408,50410,50411,50412,50413,50414,50415,50418,50419,50421,50422,50423,50425,50427,50428,50429,50430,50434,50435,50436,50437,50438,50439,50440,50441,50442,50443,50445,50446,50447,50449,50450,50451,50453,50454,50455,50456,50457,50458,50459,50461,50462,50463,50464,50465,50466,50467,50468,50469,50470,50471,50474,50475,50477,50478,50479,50481,50482,50483,50484,50485,50486,50487,50490,50492,50494,50495,50496,50497,50498,50499,50502,50503,50507,50511,50512,50513,50514,50518,50522,50523,50524,50527,50530,50531,50533,50534,50535,50537,50538,50539,50540,50541,50542,50543,50546,50550,50551,50552,50553,50554,50555,50558,50559,50561,50562,50563,50565,50566,50568,50569,50570,50571,50574,50576,50578,50579,50580,50582,50585,50586,50587,50589,50590,50591,50593,50594,50595,50596,50597,50598,50599,50600,50602,50603,50604,50605,50606,50607,50608,50609,50610,50611,50614,null,null,null,null,null,null,50615,50618,50623,50624,50625,50626,50627,50635,50637,50639,50642,50643,50645,50646,50647,50649,50650,50651,50652,50653,50654,50655,50658,50660,50662,50663,null,null,null,null,null,null,50664,50665,50666,50667,50671,50673,50674,50675,50677,50680,50681,50682,50683,50690,50691,50692,50697,50698,50699,50701,50702,50703,50705,50706,50707,50708,50709,50710,50711,50714,50717,50718,50719,50720,50721,50722,50723,50726,50727,50729,50730,50731,50735,50737,50738,50742,50744,50746,50748,50749,50750,50751,50754,50755,50757,50758,50759,50761,50762,50763,50764,50765,50766,50767,50770,50774,50775,50776,50777,50778,50779,50782,50783,50785,50786,50787,50788,50789,50790,50791,50792,50793,50794,50795,50797,50798,50800,50802,50803,50804,50805,50806,50807,50810,50811,50813,50814,50815,50817,50818,50819,50820,50821,50822,50823,50826,50828,50830,50831,50832,50833,50834,50835,50838,50839,50841,50842,50843,50845,50846,50847,50848,50849,50850,50851,50854,50856,50858,50859,50860,50861,50862,50863,50866,50867,50869,50870,50871,50875,50876,50877,50878,50879,50882,50884,50886,50887,50888,50889,50890,50891,50894,null,null,null,null,null,null,50895,50897,50898,50899,50901,50902,50903,50904,50905,50906,50907,50910,50911,50914,50915,50916,50917,50918,50919,50922,50923,50925,50926,50927,50929,50930,null,null,null,null,null,null,50931,50932,50933,50934,50935,50938,50939,50940,50942,50943,50944,50945,50946,50947,50950,50951,50953,50954,50955,50957,50958,50959,50960,50961,50962,50963,50966,50968,50970,50971,50972,50973,50974,50975,50978,50979,50981,50982,50983,50985,50986,50987,50988,50989,50990,50991,50994,50996,50998,51000,51001,51002,51003,51006,51007,51009,51010,51011,51013,51014,51015,51016,51017,51019,51022,51024,51033,51034,51035,51037,51038,51039,51041,51042,51043,51044,51045,51046,51047,51049,51050,51052,51053,51054,51055,51056,51057,51058,51059,51062,51063,51065,51066,51067,51071,51072,51073,51074,51078,51083,51084,51085,51087,51090,51091,51093,51097,51099,51100,51101,51102,51103,51106,51111,51112,51113,51114,51115,51118,51119,51121,51122,51123,51125,51126,51127,51128,51129,51130,51131,51134,51138,51139,51140,51141,51142,51143,51146,51147,51149,51151,51153,51154,51155,51156,51157,51158,51159,51161,51162,51163,51164,null,null,null,null,null,null,51166,51167,51168,51169,51170,51171,51173,51174,51175,51177,51178,51179,51181,51182,51183,51184,51185,51186,51187,51188,51189,51190,51191,51192,51193,51194,null,null,null,null,null,null,51195,51196,51197,51198,51199,51202,51203,51205,51206,51207,51209,51211,51212,51213,51214,51215,51218,51220,51223,51224,51225,51226,51227,51230,51231,51233,51234,51235,51237,51238,51239,51240,51241,51242,51243,51246,51248,51250,51251,51252,51253,51254,51255,51257,51258,51259,51261,51262,51263,51265,51266,51267,51268,51269,51270,51271,51274,51275,51278,51279,51280,51281,51282,51283,51285,51286,51287,51288,51289,51290,51291,51292,51293,51294,51295,51296,51297,51298,51299,51300,51301,51302,51303,51304,51305,51306,51307,51308,51309,51310,51311,51314,51315,51317,51318,51319,51321,51323,51324,51325,51326,51327,51330,51332,51336,51337,51338,51342,51343,51344,51345,51346,51347,51349,51350,51351,51352,51353,51354,51355,51356,51358,51360,51362,51363,51364,51365,51366,51367,51369,51370,51371,51372,51373,51374,51375,51376,51377,51378,51379,51380,51381,51382,51383,51384,51385,51386,51387,51390,51391,51392,51393,null,null,null,null,null,null,51394,51395,51397,51398,51399,51401,51402,51403,51405,51406,51407,51408,51409,51410,51411,51414,51416,51418,51419,51420,51421,51422,51423,51426,51427,51429,null,null,null,null,null,null,51430,51431,51432,51433,51434,51435,51436,51437,51438,51439,51440,51441,51442,51443,51444,51446,51447,51448,51449,51450,51451,51454,51455,51457,51458,51459,51463,51464,51465,51466,51467,51470,12288,12289,12290,183,8229,8230,168,12291,173,8213,8741,65340,8764,8216,8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,177,215,247,8800,8804,8805,8734,8756,176,8242,8243,8451,8491,65504,65505,65509,9794,9792,8736,8869,8978,8706,8711,8801,8786,167,8251,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,8594,8592,8593,8595,8596,12307,8810,8811,8730,8765,8733,8757,8747,8748,8712,8715,8838,8839,8834,8835,8746,8745,8743,8744,65506,51472,51474,51475,51476,51477,51478,51479,51481,51482,51483,51484,51485,51486,51487,51488,51489,51490,51491,51492,51493,51494,51495,51496,51497,51498,51499,null,null,null,null,null,null,51501,51502,51503,51504,51505,51506,51507,51509,51510,51511,51512,51513,51514,51515,51516,51517,51518,51519,51520,51521,51522,51523,51524,51525,51526,51527,null,null,null,null,null,null,51528,51529,51530,51531,51532,51533,51534,51535,51538,51539,51541,51542,51543,51545,51546,51547,51548,51549,51550,51551,51554,51556,51557,51558,51559,51560,51561,51562,51563,51565,51566,51567,8658,8660,8704,8707,180,65374,711,728,733,730,729,184,731,161,191,720,8750,8721,8719,164,8457,8240,9665,9664,9655,9654,9828,9824,9825,9829,9831,9827,8857,9672,9635,9680,9681,9618,9636,9637,9640,9639,9638,9641,9832,9743,9742,9756,9758,182,8224,8225,8597,8599,8601,8598,8600,9837,9833,9834,9836,12927,12828,8470,13255,8482,13250,13272,8481,8364,174,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,51569,51570,51571,51573,51574,51575,51576,51577,51578,51579,51581,51582,51583,51584,51585,51586,51587,51588,51589,51590,51591,51594,51595,51597,51598,51599,null,null,null,null,null,null,51601,51602,51603,51604,51605,51606,51607,51610,51612,51614,51615,51616,51617,51618,51619,51620,51621,51622,51623,51624,51625,51626,51627,51628,51629,51630,null,null,null,null,null,null,51631,51632,51633,51634,51635,51636,51637,51638,51639,51640,51641,51642,51643,51644,51645,51646,51647,51650,51651,51653,51654,51657,51659,51660,51661,51662,51663,51666,51668,51671,51672,51675,65281,65282,65283,65284,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65339,65510,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,51678,51679,51681,51683,51685,51686,51688,51689,51690,51691,51694,51698,51699,51700,51701,51702,51703,51706,51707,51709,51710,51711,51713,51714,51715,51716,null,null,null,null,null,null,51717,51718,51719,51722,51726,51727,51728,51729,51730,51731,51733,51734,51735,51737,51738,51739,51740,51741,51742,51743,51744,51745,51746,51747,51748,51749,null,null,null,null,null,null,51750,51751,51752,51754,51755,51756,51757,51758,51759,51760,51761,51762,51763,51764,51765,51766,51767,51768,51769,51770,51771,51772,51773,51774,51775,51776,51777,51778,51779,51780,51781,51782,12593,12594,12595,12596,12597,12598,12599,12600,12601,12602,12603,12604,12605,12606,12607,12608,12609,12610,12611,12612,12613,12614,12615,12616,12617,12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,12629,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,12647,12648,12649,12650,12651,12652,12653,12654,12655,12656,12657,12658,12659,12660,12661,12662,12663,12664,12665,12666,12667,12668,12669,12670,12671,12672,12673,12674,12675,12676,12677,12678,12679,12680,12681,12682,12683,12684,12685,12686,51783,51784,51785,51786,51787,51790,51791,51793,51794,51795,51797,51798,51799,51800,51801,51802,51803,51806,51810,51811,51812,51813,51814,51815,51817,51818,null,null,null,null,null,null,51819,51820,51821,51822,51823,51824,51825,51826,51827,51828,51829,51830,51831,51832,51833,51834,51835,51836,51838,51839,51840,51841,51842,51843,51845,51846,null,null,null,null,null,null,51847,51848,51849,51850,51851,51852,51853,51854,51855,51856,51857,51858,51859,51860,51861,51862,51863,51865,51866,51867,51868,51869,51870,51871,51872,51873,51874,51875,51876,51877,51878,51879,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,null,null,null,null,null,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,null,null,null,null,null,null,null,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,null,null,null,null,null,null,null,null,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,null,null,null,null,null,null,51880,51881,51882,51883,51884,51885,51886,51887,51888,51889,51890,51891,51892,51893,51894,51895,51896,51897,51898,51899,51902,51903,51905,51906,51907,51909,null,null,null,null,null,null,51910,51911,51912,51913,51914,51915,51918,51920,51922,51924,51925,51926,51927,51930,51931,51932,51933,51934,51935,51937,51938,51939,51940,51941,51942,51943,null,null,null,null,null,null,51944,51945,51946,51947,51949,51950,51951,51952,51953,51954,51955,51957,51958,51959,51960,51961,51962,51963,51964,51965,51966,51967,51968,51969,51970,51971,51972,51973,51974,51975,51977,51978,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,9490,9489,9498,9497,9494,9493,9486,9485,9502,9503,9505,9506,9510,9511,9513,9514,9517,9518,9521,9522,9525,9526,9529,9530,9533,9534,9536,9537,9539,9540,9541,9542,9543,9544,9545,9546,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,51979,51980,51981,51982,51983,51985,51986,51987,51989,51990,51991,51993,51994,51995,51996,51997,51998,51999,52002,52003,52004,52005,52006,52007,52008,52009,null,null,null,null,null,null,52010,52011,52012,52013,52014,52015,52016,52017,52018,52019,52020,52021,52022,52023,52024,52025,52026,52027,52028,52029,52030,52031,52032,52034,52035,52036,null,null,null,null,null,null,52037,52038,52039,52042,52043,52045,52046,52047,52049,52050,52051,52052,52053,52054,52055,52058,52059,52060,52062,52063,52064,52065,52066,52067,52069,52070,52071,52072,52073,52074,52075,52076,13205,13206,13207,8467,13208,13252,13219,13220,13221,13222,13209,13210,13211,13212,13213,13214,13215,13216,13217,13218,13258,13197,13198,13199,13263,13192,13193,13256,13223,13224,13232,13233,13234,13235,13236,13237,13238,13239,13240,13241,13184,13185,13186,13187,13188,13242,13243,13244,13245,13246,13247,13200,13201,13202,13203,13204,8486,13248,13249,13194,13195,13196,13270,13253,13229,13230,13231,13275,13225,13226,13227,13228,13277,13264,13267,13251,13257,13276,13254,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52077,52078,52079,52080,52081,52082,52083,52084,52085,52086,52087,52090,52091,52092,52093,52094,52095,52096,52097,52098,52099,52100,52101,52102,52103,52104,null,null,null,null,null,null,52105,52106,52107,52108,52109,52110,52111,52112,52113,52114,52115,52116,52117,52118,52119,52120,52121,52122,52123,52125,52126,52127,52128,52129,52130,52131,null,null,null,null,null,null,52132,52133,52134,52135,52136,52137,52138,52139,52140,52141,52142,52143,52144,52145,52146,52147,52148,52149,52150,52151,52153,52154,52155,52156,52157,52158,52159,52160,52161,52162,52163,52164,198,208,170,294,null,306,null,319,321,216,338,186,222,358,330,null,12896,12897,12898,12899,12900,12901,12902,12903,12904,12905,12906,12907,12908,12909,12910,12911,12912,12913,12914,12915,12916,12917,12918,12919,12920,12921,12922,12923,9424,9425,9426,9427,9428,9429,9430,9431,9432,9433,9434,9435,9436,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,189,8531,8532,188,190,8539,8540,8541,8542,52165,52166,52167,52168,52169,52170,52171,52172,52173,52174,52175,52176,52177,52178,52179,52181,52182,52183,52184,52185,52186,52187,52188,52189,52190,52191,null,null,null,null,null,null,52192,52193,52194,52195,52197,52198,52200,52202,52203,52204,52205,52206,52207,52208,52209,52210,52211,52212,52213,52214,52215,52216,52217,52218,52219,52220,null,null,null,null,null,null,52221,52222,52223,52224,52225,52226,52227,52228,52229,52230,52231,52232,52233,52234,52235,52238,52239,52241,52242,52243,52245,52246,52247,52248,52249,52250,52251,52254,52255,52256,52259,52260,230,273,240,295,305,307,312,320,322,248,339,223,254,359,331,329,12800,12801,12802,12803,12804,12805,12806,12807,12808,12809,12810,12811,12812,12813,12814,12815,12816,12817,12818,12819,12820,12821,12822,12823,12824,12825,12826,12827,9372,9373,9374,9375,9376,9377,9378,9379,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,185,178,179,8308,8319,8321,8322,8323,8324,52261,52262,52266,52267,52269,52271,52273,52274,52275,52276,52277,52278,52279,52282,52287,52288,52289,52290,52291,52294,52295,52297,52298,52299,52301,52302,null,null,null,null,null,null,52303,52304,52305,52306,52307,52310,52314,52315,52316,52317,52318,52319,52321,52322,52323,52325,52327,52329,52330,52331,52332,52333,52334,52335,52337,52338,null,null,null,null,null,null,52339,52340,52342,52343,52344,52345,52346,52347,52348,52349,52350,52351,52352,52353,52354,52355,52356,52357,52358,52359,52360,52361,52362,52363,52364,52365,52366,52367,52368,52369,52370,52371,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,null,null,null,null,null,null,null,null,null,null,null,52372,52373,52374,52375,52378,52379,52381,52382,52383,52385,52386,52387,52388,52389,52390,52391,52394,52398,52399,52400,52401,52402,52403,52406,52407,52409,null,null,null,null,null,null,52410,52411,52413,52414,52415,52416,52417,52418,52419,52422,52424,52426,52427,52428,52429,52430,52431,52433,52434,52435,52437,52438,52439,52440,52441,52442,null,null,null,null,null,null,52443,52444,52445,52446,52447,52448,52449,52450,52451,52453,52454,52455,52456,52457,52458,52459,52461,52462,52463,52465,52466,52467,52468,52469,52470,52471,52472,52473,52474,52475,52476,52477,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,null,null,null,null,null,null,null,null,52478,52479,52480,52482,52483,52484,52485,52486,52487,52490,52491,52493,52494,52495,52497,52498,52499,52500,52501,52502,52503,52506,52508,52510,52511,52512,null,null,null,null,null,null,52513,52514,52515,52517,52518,52519,52521,52522,52523,52525,52526,52527,52528,52529,52530,52531,52532,52533,52534,52535,52536,52538,52539,52540,52541,52542,null,null,null,null,null,null,52543,52544,52545,52546,52547,52548,52549,52550,52551,52552,52553,52554,52555,52556,52557,52558,52559,52560,52561,52562,52563,52564,52565,52566,52567,52568,52569,52570,52571,52573,52574,52575,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,null,null,null,null,null,null,null,null,null,null,null,null,null,52577,52578,52579,52581,52582,52583,52584,52585,52586,52587,52590,52592,52594,52595,52596,52597,52598,52599,52601,52602,52603,52604,52605,52606,52607,52608,null,null,null,null,null,null,52609,52610,52611,52612,52613,52614,52615,52617,52618,52619,52620,52621,52622,52623,52624,52625,52626,52627,52630,52631,52633,52634,52635,52637,52638,52639,null,null,null,null,null,null,52640,52641,52642,52643,52646,52648,52650,52651,52652,52653,52654,52655,52657,52658,52659,52660,52661,52662,52663,52664,52665,52666,52667,52668,52669,52670,52671,52672,52673,52674,52675,52677,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52678,52679,52680,52681,52682,52683,52685,52686,52687,52689,52690,52691,52692,52693,52694,52695,52696,52697,52698,52699,52700,52701,52702,52703,52704,52705,null,null,null,null,null,null,52706,52707,52708,52709,52710,52711,52713,52714,52715,52717,52718,52719,52721,52722,52723,52724,52725,52726,52727,52730,52732,52734,52735,52736,52737,52738,null,null,null,null,null,null,52739,52741,52742,52743,52745,52746,52747,52749,52750,52751,52752,52753,52754,52755,52757,52758,52759,52760,52762,52763,52764,52765,52766,52767,52770,52771,52773,52774,52775,52777,52778,52779,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52780,52781,52782,52783,52786,52788,52790,52791,52792,52793,52794,52795,52796,52797,52798,52799,52800,52801,52802,52803,52804,52805,52806,52807,52808,52809,null,null,null,null,null,null,52810,52811,52812,52813,52814,52815,52816,52817,52818,52819,52820,52821,52822,52823,52826,52827,52829,52830,52834,52835,52836,52837,52838,52839,52842,52844,null,null,null,null,null,null,52846,52847,52848,52849,52850,52851,52854,52855,52857,52858,52859,52861,52862,52863,52864,52865,52866,52867,52870,52872,52874,52875,52876,52877,52878,52879,52882,52883,52885,52886,52887,52889,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52890,52891,52892,52893,52894,52895,52898,52902,52903,52904,52905,52906,52907,52910,52911,52912,52913,52914,52915,52916,52917,52918,52919,52920,52921,52922,null,null,null,null,null,null,52923,52924,52925,52926,52927,52928,52930,52931,52932,52933,52934,52935,52936,52937,52938,52939,52940,52941,52942,52943,52944,52945,52946,52947,52948,52949,null,null,null,null,null,null,52950,52951,52952,52953,52954,52955,52956,52957,52958,52959,52960,52961,52962,52963,52966,52967,52969,52970,52973,52974,52975,52976,52977,52978,52979,52982,52986,52987,52988,52989,52990,52991,44032,44033,44036,44039,44040,44041,44042,44048,44049,44050,44051,44052,44053,44054,44055,44057,44058,44059,44060,44061,44064,44068,44076,44077,44079,44080,44081,44088,44089,44092,44096,44107,44109,44116,44120,44124,44144,44145,44148,44151,44152,44154,44160,44161,44163,44164,44165,44166,44169,44170,44171,44172,44176,44180,44188,44189,44191,44192,44193,44200,44201,44202,44204,44207,44208,44216,44217,44219,44220,44221,44225,44228,44232,44236,44245,44247,44256,44257,44260,44263,44264,44266,44268,44271,44272,44273,44275,44277,44278,44284,44285,44288,44292,44294,52994,52995,52997,52998,52999,53001,53002,53003,53004,53005,53006,53007,53010,53012,53014,53015,53016,53017,53018,53019,53021,53022,53023,53025,53026,53027,null,null,null,null,null,null,53029,53030,53031,53032,53033,53034,53035,53038,53042,53043,53044,53045,53046,53047,53049,53050,53051,53052,53053,53054,53055,53056,53057,53058,53059,53060,null,null,null,null,null,null,53061,53062,53063,53064,53065,53066,53067,53068,53069,53070,53071,53072,53073,53074,53075,53078,53079,53081,53082,53083,53085,53086,53087,53088,53089,53090,53091,53094,53096,53098,53099,53100,44300,44301,44303,44305,44312,44316,44320,44329,44332,44333,44340,44341,44344,44348,44356,44357,44359,44361,44368,44372,44376,44385,44387,44396,44397,44400,44403,44404,44405,44406,44411,44412,44413,44415,44417,44418,44424,44425,44428,44432,44444,44445,44452,44471,44480,44481,44484,44488,44496,44497,44499,44508,44512,44516,44536,44537,44540,44543,44544,44545,44552,44553,44555,44557,44564,44592,44593,44596,44599,44600,44602,44608,44609,44611,44613,44614,44618,44620,44621,44622,44624,44628,44630,44636,44637,44639,44640,44641,44645,44648,44649,44652,44656,44664,53101,53102,53103,53106,53107,53109,53110,53111,53113,53114,53115,53116,53117,53118,53119,53121,53122,53123,53124,53126,53127,53128,53129,53130,53131,53133,null,null,null,null,null,null,53134,53135,53136,53137,53138,53139,53140,53141,53142,53143,53144,53145,53146,53147,53148,53149,53150,53151,53152,53154,53155,53156,53157,53158,53159,53161,null,null,null,null,null,null,53162,53163,53164,53165,53166,53167,53169,53170,53171,53172,53173,53174,53175,53176,53177,53178,53179,53180,53181,53182,53183,53184,53185,53186,53187,53189,53190,53191,53192,53193,53194,53195,44665,44667,44668,44669,44676,44677,44684,44732,44733,44734,44736,44740,44748,44749,44751,44752,44753,44760,44761,44764,44776,44779,44781,44788,44792,44796,44807,44808,44813,44816,44844,44845,44848,44850,44852,44860,44861,44863,44865,44866,44867,44872,44873,44880,44892,44893,44900,44901,44921,44928,44932,44936,44944,44945,44949,44956,44984,44985,44988,44992,44999,45000,45001,45003,45005,45006,45012,45020,45032,45033,45040,45041,45044,45048,45056,45057,45060,45068,45072,45076,45084,45085,45096,45124,45125,45128,45130,45132,45134,45139,45140,45141,45143,45145,53196,53197,53198,53199,53200,53201,53202,53203,53204,53205,53206,53207,53208,53209,53210,53211,53212,53213,53214,53215,53218,53219,53221,53222,53223,53225,null,null,null,null,null,null,53226,53227,53228,53229,53230,53231,53234,53236,53238,53239,53240,53241,53242,53243,53245,53246,53247,53249,53250,53251,53253,53254,53255,53256,53257,53258,null,null,null,null,null,null,53259,53260,53261,53262,53263,53264,53266,53267,53268,53269,53270,53271,53273,53274,53275,53276,53277,53278,53279,53280,53281,53282,53283,53284,53285,53286,53287,53288,53289,53290,53291,53292,45149,45180,45181,45184,45188,45196,45197,45199,45201,45208,45209,45210,45212,45215,45216,45217,45218,45224,45225,45227,45228,45229,45230,45231,45233,45235,45236,45237,45240,45244,45252,45253,45255,45256,45257,45264,45265,45268,45272,45280,45285,45320,45321,45323,45324,45328,45330,45331,45336,45337,45339,45340,45341,45347,45348,45349,45352,45356,45364,45365,45367,45368,45369,45376,45377,45380,45384,45392,45393,45396,45397,45400,45404,45408,45432,45433,45436,45440,45442,45448,45449,45451,45453,45458,45459,45460,45464,45468,45480,45516,45520,45524,45532,45533,53294,53295,53296,53297,53298,53299,53302,53303,53305,53306,53307,53309,53310,53311,53312,53313,53314,53315,53318,53320,53322,53323,53324,53325,53326,53327,null,null,null,null,null,null,53329,53330,53331,53333,53334,53335,53337,53338,53339,53340,53341,53342,53343,53345,53346,53347,53348,53349,53350,53351,53352,53353,53354,53355,53358,53359,null,null,null,null,null,null,53361,53362,53363,53365,53366,53367,53368,53369,53370,53371,53374,53375,53376,53378,53379,53380,53381,53382,53383,53384,53385,53386,53387,53388,53389,53390,53391,53392,53393,53394,53395,53396,45535,45544,45545,45548,45552,45561,45563,45565,45572,45573,45576,45579,45580,45588,45589,45591,45593,45600,45620,45628,45656,45660,45664,45672,45673,45684,45685,45692,45700,45701,45705,45712,45713,45716,45720,45721,45722,45728,45729,45731,45733,45734,45738,45740,45744,45748,45768,45769,45772,45776,45778,45784,45785,45787,45789,45794,45796,45797,45798,45800,45803,45804,45805,45806,45807,45811,45812,45813,45815,45816,45817,45818,45819,45823,45824,45825,45828,45832,45840,45841,45843,45844,45845,45852,45908,45909,45910,45912,45915,45916,45918,45919,45924,45925,53397,53398,53399,53400,53401,53402,53403,53404,53405,53406,53407,53408,53409,53410,53411,53414,53415,53417,53418,53419,53421,53422,53423,53424,53425,53426,null,null,null,null,null,null,53427,53430,53432,53434,53435,53436,53437,53438,53439,53442,53443,53445,53446,53447,53450,53451,53452,53453,53454,53455,53458,53462,53463,53464,53465,53466,null,null,null,null,null,null,53467,53470,53471,53473,53474,53475,53477,53478,53479,53480,53481,53482,53483,53486,53490,53491,53492,53493,53494,53495,53497,53498,53499,53500,53501,53502,53503,53504,53505,53506,53507,53508,45927,45929,45931,45934,45936,45937,45940,45944,45952,45953,45955,45956,45957,45964,45968,45972,45984,45985,45992,45996,46020,46021,46024,46027,46028,46030,46032,46036,46037,46039,46041,46043,46045,46048,46052,46056,46076,46096,46104,46108,46112,46120,46121,46123,46132,46160,46161,46164,46168,46176,46177,46179,46181,46188,46208,46216,46237,46244,46248,46252,46261,46263,46265,46272,46276,46280,46288,46293,46300,46301,46304,46307,46308,46310,46316,46317,46319,46321,46328,46356,46357,46360,46363,46364,46372,46373,46375,46376,46377,46378,46384,46385,46388,46392,53509,53510,53511,53512,53513,53514,53515,53516,53518,53519,53520,53521,53522,53523,53524,53525,53526,53527,53528,53529,53530,53531,53532,53533,53534,53535,null,null,null,null,null,null,53536,53537,53538,53539,53540,53541,53542,53543,53544,53545,53546,53547,53548,53549,53550,53551,53554,53555,53557,53558,53559,53561,53563,53564,53565,53566,null,null,null,null,null,null,53567,53570,53574,53575,53576,53577,53578,53579,53582,53583,53585,53586,53587,53589,53590,53591,53592,53593,53594,53595,53598,53600,53602,53603,53604,53605,53606,53607,53609,53610,53611,53613,46400,46401,46403,46404,46405,46411,46412,46413,46416,46420,46428,46429,46431,46432,46433,46496,46497,46500,46504,46506,46507,46512,46513,46515,46516,46517,46523,46524,46525,46528,46532,46540,46541,46543,46544,46545,46552,46572,46608,46609,46612,46616,46629,46636,46644,46664,46692,46696,46748,46749,46752,46756,46763,46764,46769,46804,46832,46836,46840,46848,46849,46853,46888,46889,46892,46895,46896,46904,46905,46907,46916,46920,46924,46932,46933,46944,46948,46952,46960,46961,46963,46965,46972,46973,46976,46980,46988,46989,46991,46992,46993,46994,46998,46999,53614,53615,53616,53617,53618,53619,53620,53621,53622,53623,53624,53625,53626,53627,53629,53630,53631,53632,53633,53634,53635,53637,53638,53639,53641,53642,null,null,null,null,null,null,53643,53644,53645,53646,53647,53648,53649,53650,53651,53652,53653,53654,53655,53656,53657,53658,53659,53660,53661,53662,53663,53666,53667,53669,53670,53671,null,null,null,null,null,null,53673,53674,53675,53676,53677,53678,53679,53682,53684,53686,53687,53688,53689,53691,53693,53694,53695,53697,53698,53699,53700,53701,53702,53703,53704,53705,53706,53707,53708,53709,53710,53711,47000,47001,47004,47008,47016,47017,47019,47020,47021,47028,47029,47032,47047,47049,47084,47085,47088,47092,47100,47101,47103,47104,47105,47111,47112,47113,47116,47120,47128,47129,47131,47133,47140,47141,47144,47148,47156,47157,47159,47160,47161,47168,47172,47185,47187,47196,47197,47200,47204,47212,47213,47215,47217,47224,47228,47245,47272,47280,47284,47288,47296,47297,47299,47301,47308,47312,47316,47325,47327,47329,47336,47337,47340,47344,47352,47353,47355,47357,47364,47384,47392,47420,47421,47424,47428,47436,47439,47441,47448,47449,47452,47456,47464,47465,53712,53713,53714,53715,53716,53717,53718,53719,53721,53722,53723,53724,53725,53726,53727,53728,53729,53730,53731,53732,53733,53734,53735,53736,53737,53738,null,null,null,null,null,null,53739,53740,53741,53742,53743,53744,53745,53746,53747,53749,53750,53751,53753,53754,53755,53756,53757,53758,53759,53760,53761,53762,53763,53764,53765,53766,null,null,null,null,null,null,53768,53770,53771,53772,53773,53774,53775,53777,53778,53779,53780,53781,53782,53783,53784,53785,53786,53787,53788,53789,53790,53791,53792,53793,53794,53795,53796,53797,53798,53799,53800,53801,47467,47469,47476,47477,47480,47484,47492,47493,47495,47497,47498,47501,47502,47532,47533,47536,47540,47548,47549,47551,47553,47560,47561,47564,47566,47567,47568,47569,47570,47576,47577,47579,47581,47582,47585,47587,47588,47589,47592,47596,47604,47605,47607,47608,47609,47610,47616,47617,47624,47637,47672,47673,47676,47680,47682,47688,47689,47691,47693,47694,47699,47700,47701,47704,47708,47716,47717,47719,47720,47721,47728,47729,47732,47736,47747,47748,47749,47751,47756,47784,47785,47787,47788,47792,47794,47800,47801,47803,47805,47812,47816,47832,47833,47868,53802,53803,53806,53807,53809,53810,53811,53813,53814,53815,53816,53817,53818,53819,53822,53824,53826,53827,53828,53829,53830,53831,53833,53834,53835,53836,null,null,null,null,null,null,53837,53838,53839,53840,53841,53842,53843,53844,53845,53846,53847,53848,53849,53850,53851,53853,53854,53855,53856,53857,53858,53859,53861,53862,53863,53864,null,null,null,null,null,null,53865,53866,53867,53868,53869,53870,53871,53872,53873,53874,53875,53876,53877,53878,53879,53880,53881,53882,53883,53884,53885,53886,53887,53890,53891,53893,53894,53895,53897,53898,53899,53900,47872,47876,47885,47887,47889,47896,47900,47904,47913,47915,47924,47925,47926,47928,47931,47932,47933,47934,47940,47941,47943,47945,47949,47951,47952,47956,47960,47969,47971,47980,48008,48012,48016,48036,48040,48044,48052,48055,48064,48068,48072,48080,48083,48120,48121,48124,48127,48128,48130,48136,48137,48139,48140,48141,48143,48145,48148,48149,48150,48151,48152,48155,48156,48157,48158,48159,48164,48165,48167,48169,48173,48176,48177,48180,48184,48192,48193,48195,48196,48197,48201,48204,48205,48208,48221,48260,48261,48264,48267,48268,48270,48276,48277,48279,53901,53902,53903,53906,53907,53908,53910,53911,53912,53913,53914,53915,53917,53918,53919,53921,53922,53923,53925,53926,53927,53928,53929,53930,53931,53933,null,null,null,null,null,null,53934,53935,53936,53938,53939,53940,53941,53942,53943,53946,53947,53949,53950,53953,53955,53956,53957,53958,53959,53962,53964,53965,53966,53967,53968,53969,null,null,null,null,null,null,53970,53971,53973,53974,53975,53977,53978,53979,53981,53982,53983,53984,53985,53986,53987,53990,53991,53992,53993,53994,53995,53996,53997,53998,53999,54002,54003,54005,54006,54007,54009,54010,48281,48282,48288,48289,48292,48295,48296,48304,48305,48307,48308,48309,48316,48317,48320,48324,48333,48335,48336,48337,48341,48344,48348,48372,48373,48374,48376,48380,48388,48389,48391,48393,48400,48404,48420,48428,48448,48456,48457,48460,48464,48472,48473,48484,48488,48512,48513,48516,48519,48520,48521,48522,48528,48529,48531,48533,48537,48538,48540,48548,48560,48568,48596,48597,48600,48604,48617,48624,48628,48632,48640,48643,48645,48652,48653,48656,48660,48668,48669,48671,48708,48709,48712,48716,48718,48724,48725,48727,48729,48730,48731,48736,48737,48740,54011,54012,54013,54014,54015,54018,54020,54022,54023,54024,54025,54026,54027,54031,54033,54034,54035,54037,54039,54040,54041,54042,54043,54046,54050,54051,null,null,null,null,null,null,54052,54054,54055,54058,54059,54061,54062,54063,54065,54066,54067,54068,54069,54070,54071,54074,54078,54079,54080,54081,54082,54083,54086,54087,54088,54089,null,null,null,null,null,null,54090,54091,54092,54093,54094,54095,54096,54097,54098,54099,54100,54101,54102,54103,54104,54105,54106,54107,54108,54109,54110,54111,54112,54113,54114,54115,54116,54117,54118,54119,54120,54121,48744,48746,48752,48753,48755,48756,48757,48763,48764,48765,48768,48772,48780,48781,48783,48784,48785,48792,48793,48808,48848,48849,48852,48855,48856,48864,48867,48868,48869,48876,48897,48904,48905,48920,48921,48923,48924,48925,48960,48961,48964,48968,48976,48977,48981,49044,49072,49093,49100,49101,49104,49108,49116,49119,49121,49212,49233,49240,49244,49248,49256,49257,49296,49297,49300,49304,49312,49313,49315,49317,49324,49325,49327,49328,49331,49332,49333,49334,49340,49341,49343,49344,49345,49349,49352,49353,49356,49360,49368,49369,49371,49372,49373,49380,54122,54123,54124,54125,54126,54127,54128,54129,54130,54131,54132,54133,54134,54135,54136,54137,54138,54139,54142,54143,54145,54146,54147,54149,54150,54151,null,null,null,null,null,null,54152,54153,54154,54155,54158,54162,54163,54164,54165,54166,54167,54170,54171,54173,54174,54175,54177,54178,54179,54180,54181,54182,54183,54186,54188,54190,null,null,null,null,null,null,54191,54192,54193,54194,54195,54197,54198,54199,54201,54202,54203,54205,54206,54207,54208,54209,54210,54211,54214,54215,54218,54219,54220,54221,54222,54223,54225,54226,54227,54228,54229,54230,49381,49384,49388,49396,49397,49399,49401,49408,49412,49416,49424,49429,49436,49437,49438,49439,49440,49443,49444,49446,49447,49452,49453,49455,49456,49457,49462,49464,49465,49468,49472,49480,49481,49483,49484,49485,49492,49493,49496,49500,49508,49509,49511,49512,49513,49520,49524,49528,49541,49548,49549,49550,49552,49556,49558,49564,49565,49567,49569,49573,49576,49577,49580,49584,49597,49604,49608,49612,49620,49623,49624,49632,49636,49640,49648,49649,49651,49660,49661,49664,49668,49676,49677,49679,49681,49688,49689,49692,49695,49696,49704,49705,49707,49709,54231,54233,54234,54235,54236,54237,54238,54239,54240,54242,54244,54245,54246,54247,54248,54249,54250,54251,54254,54255,54257,54258,54259,54261,54262,54263,null,null,null,null,null,null,54264,54265,54266,54267,54270,54272,54274,54275,54276,54277,54278,54279,54281,54282,54283,54284,54285,54286,54287,54288,54289,54290,54291,54292,54293,54294,null,null,null,null,null,null,54295,54296,54297,54298,54299,54300,54302,54303,54304,54305,54306,54307,54308,54309,54310,54311,54312,54313,54314,54315,54316,54317,54318,54319,54320,54321,54322,54323,54324,54325,54326,54327,49711,49713,49714,49716,49736,49744,49745,49748,49752,49760,49765,49772,49773,49776,49780,49788,49789,49791,49793,49800,49801,49808,49816,49819,49821,49828,49829,49832,49836,49837,49844,49845,49847,49849,49884,49885,49888,49891,49892,49899,49900,49901,49903,49905,49910,49912,49913,49915,49916,49920,49928,49929,49932,49933,49939,49940,49941,49944,49948,49956,49957,49960,49961,49989,50024,50025,50028,50032,50034,50040,50041,50044,50045,50052,50056,50060,50112,50136,50137,50140,50143,50144,50146,50152,50153,50157,50164,50165,50168,50184,50192,50212,50220,50224,54328,54329,54330,54331,54332,54333,54334,54335,54337,54338,54339,54341,54342,54343,54344,54345,54346,54347,54348,54349,54350,54351,54352,54353,54354,54355,null,null,null,null,null,null,54356,54357,54358,54359,54360,54361,54362,54363,54365,54366,54367,54369,54370,54371,54373,54374,54375,54376,54377,54378,54379,54380,54382,54384,54385,54386,null,null,null,null,null,null,54387,54388,54389,54390,54391,54394,54395,54397,54398,54401,54403,54404,54405,54406,54407,54410,54412,54414,54415,54416,54417,54418,54419,54421,54422,54423,54424,54425,54426,54427,54428,54429,50228,50236,50237,50248,50276,50277,50280,50284,50292,50293,50297,50304,50324,50332,50360,50364,50409,50416,50417,50420,50424,50426,50431,50432,50433,50444,50448,50452,50460,50472,50473,50476,50480,50488,50489,50491,50493,50500,50501,50504,50505,50506,50508,50509,50510,50515,50516,50517,50519,50520,50521,50525,50526,50528,50529,50532,50536,50544,50545,50547,50548,50549,50556,50557,50560,50564,50567,50572,50573,50575,50577,50581,50583,50584,50588,50592,50601,50612,50613,50616,50617,50619,50620,50621,50622,50628,50629,50630,50631,50632,50633,50634,50636,50638,54430,54431,54432,54433,54434,54435,54436,54437,54438,54439,54440,54442,54443,54444,54445,54446,54447,54448,54449,54450,54451,54452,54453,54454,54455,54456,null,null,null,null,null,null,54457,54458,54459,54460,54461,54462,54463,54464,54465,54466,54467,54468,54469,54470,54471,54472,54473,54474,54475,54477,54478,54479,54481,54482,54483,54485,null,null,null,null,null,null,54486,54487,54488,54489,54490,54491,54493,54494,54496,54497,54498,54499,54500,54501,54502,54503,54505,54506,54507,54509,54510,54511,54513,54514,54515,54516,54517,54518,54519,54521,54522,54524,50640,50641,50644,50648,50656,50657,50659,50661,50668,50669,50670,50672,50676,50678,50679,50684,50685,50686,50687,50688,50689,50693,50694,50695,50696,50700,50704,50712,50713,50715,50716,50724,50725,50728,50732,50733,50734,50736,50739,50740,50741,50743,50745,50747,50752,50753,50756,50760,50768,50769,50771,50772,50773,50780,50781,50784,50796,50799,50801,50808,50809,50812,50816,50824,50825,50827,50829,50836,50837,50840,50844,50852,50853,50855,50857,50864,50865,50868,50872,50873,50874,50880,50881,50883,50885,50892,50893,50896,50900,50908,50909,50912,50913,50920,54526,54527,54528,54529,54530,54531,54533,54534,54535,54537,54538,54539,54541,54542,54543,54544,54545,54546,54547,54550,54552,54553,54554,54555,54556,54557,null,null,null,null,null,null,54558,54559,54560,54561,54562,54563,54564,54565,54566,54567,54568,54569,54570,54571,54572,54573,54574,54575,54576,54577,54578,54579,54580,54581,54582,54583,null,null,null,null,null,null,54584,54585,54586,54587,54590,54591,54593,54594,54595,54597,54598,54599,54600,54601,54602,54603,54606,54608,54610,54611,54612,54613,54614,54615,54618,54619,54621,54622,54623,54625,54626,54627,50921,50924,50928,50936,50937,50941,50948,50949,50952,50956,50964,50965,50967,50969,50976,50977,50980,50984,50992,50993,50995,50997,50999,51004,51005,51008,51012,51018,51020,51021,51023,51025,51026,51027,51028,51029,51030,51031,51032,51036,51040,51048,51051,51060,51061,51064,51068,51069,51070,51075,51076,51077,51079,51080,51081,51082,51086,51088,51089,51092,51094,51095,51096,51098,51104,51105,51107,51108,51109,51110,51116,51117,51120,51124,51132,51133,51135,51136,51137,51144,51145,51148,51150,51152,51160,51165,51172,51176,51180,51200,51201,51204,51208,51210,54628,54630,54631,54634,54636,54638,54639,54640,54641,54642,54643,54646,54647,54649,54650,54651,54653,54654,54655,54656,54657,54658,54659,54662,54666,54667,null,null,null,null,null,null,54668,54669,54670,54671,54673,54674,54675,54676,54677,54678,54679,54680,54681,54682,54683,54684,54685,54686,54687,54688,54689,54690,54691,54692,54694,54695,null,null,null,null,null,null,54696,54697,54698,54699,54700,54701,54702,54703,54704,54705,54706,54707,54708,54709,54710,54711,54712,54713,54714,54715,54716,54717,54718,54719,54720,54721,54722,54723,54724,54725,54726,54727,51216,51217,51219,51221,51222,51228,51229,51232,51236,51244,51245,51247,51249,51256,51260,51264,51272,51273,51276,51277,51284,51312,51313,51316,51320,51322,51328,51329,51331,51333,51334,51335,51339,51340,51341,51348,51357,51359,51361,51368,51388,51389,51396,51400,51404,51412,51413,51415,51417,51424,51425,51428,51445,51452,51453,51456,51460,51461,51462,51468,51469,51471,51473,51480,51500,51508,51536,51537,51540,51544,51552,51553,51555,51564,51568,51572,51580,51592,51593,51596,51600,51608,51609,51611,51613,51648,51649,51652,51655,51656,51658,51664,51665,51667,54730,54731,54733,54734,54735,54737,54739,54740,54741,54742,54743,54746,54748,54750,54751,54752,54753,54754,54755,54758,54759,54761,54762,54763,54765,54766,null,null,null,null,null,null,54767,54768,54769,54770,54771,54774,54776,54778,54779,54780,54781,54782,54783,54786,54787,54789,54790,54791,54793,54794,54795,54796,54797,54798,54799,54802,null,null,null,null,null,null,54806,54807,54808,54809,54810,54811,54813,54814,54815,54817,54818,54819,54821,54822,54823,54824,54825,54826,54827,54828,54830,54831,54832,54833,54834,54835,54836,54837,54838,54839,54842,54843,51669,51670,51673,51674,51676,51677,51680,51682,51684,51687,51692,51693,51695,51696,51697,51704,51705,51708,51712,51720,51721,51723,51724,51725,51732,51736,51753,51788,51789,51792,51796,51804,51805,51807,51808,51809,51816,51837,51844,51864,51900,51901,51904,51908,51916,51917,51919,51921,51923,51928,51929,51936,51948,51956,51976,51984,51988,51992,52000,52001,52033,52040,52041,52044,52048,52056,52057,52061,52068,52088,52089,52124,52152,52180,52196,52199,52201,52236,52237,52240,52244,52252,52253,52257,52258,52263,52264,52265,52268,52270,52272,52280,52281,52283,54845,54846,54847,54849,54850,54851,54852,54854,54855,54858,54860,54862,54863,54864,54866,54867,54870,54871,54873,54874,54875,54877,54878,54879,54880,54881,null,null,null,null,null,null,54882,54883,54884,54885,54886,54888,54890,54891,54892,54893,54894,54895,54898,54899,54901,54902,54903,54904,54905,54906,54907,54908,54909,54910,54911,54912,null,null,null,null,null,null,54913,54914,54916,54918,54919,54920,54921,54922,54923,54926,54927,54929,54930,54931,54933,54934,54935,54936,54937,54938,54939,54940,54942,54944,54946,54947,54948,54949,54950,54951,54953,54954,52284,52285,52286,52292,52293,52296,52300,52308,52309,52311,52312,52313,52320,52324,52326,52328,52336,52341,52376,52377,52380,52384,52392,52393,52395,52396,52397,52404,52405,52408,52412,52420,52421,52423,52425,52432,52436,52452,52460,52464,52481,52488,52489,52492,52496,52504,52505,52507,52509,52516,52520,52524,52537,52572,52576,52580,52588,52589,52591,52593,52600,52616,52628,52629,52632,52636,52644,52645,52647,52649,52656,52676,52684,52688,52712,52716,52720,52728,52729,52731,52733,52740,52744,52748,52756,52761,52768,52769,52772,52776,52784,52785,52787,52789,54955,54957,54958,54959,54961,54962,54963,54964,54965,54966,54967,54968,54970,54972,54973,54974,54975,54976,54977,54978,54979,54982,54983,54985,54986,54987,null,null,null,null,null,null,54989,54990,54991,54992,54994,54995,54997,54998,55000,55002,55003,55004,55005,55006,55007,55009,55010,55011,55013,55014,55015,55017,55018,55019,55020,55021,null,null,null,null,null,null,55022,55023,55025,55026,55027,55028,55030,55031,55032,55033,55034,55035,55038,55039,55041,55042,55043,55045,55046,55047,55048,55049,55050,55051,55052,55053,55054,55055,55056,55058,55059,55060,52824,52825,52828,52831,52832,52833,52840,52841,52843,52845,52852,52853,52856,52860,52868,52869,52871,52873,52880,52881,52884,52888,52896,52897,52899,52900,52901,52908,52909,52929,52964,52965,52968,52971,52972,52980,52981,52983,52984,52985,52992,52993,52996,53000,53008,53009,53011,53013,53020,53024,53028,53036,53037,53039,53040,53041,53048,53076,53077,53080,53084,53092,53093,53095,53097,53104,53105,53108,53112,53120,53125,53132,53153,53160,53168,53188,53216,53217,53220,53224,53232,53233,53235,53237,53244,53248,53252,53265,53272,53293,53300,53301,53304,53308,55061,55062,55063,55066,55067,55069,55070,55071,55073,55074,55075,55076,55077,55078,55079,55082,55084,55086,55087,55088,55089,55090,55091,55094,55095,55097,null,null,null,null,null,null,55098,55099,55101,55102,55103,55104,55105,55106,55107,55109,55110,55112,55114,55115,55116,55117,55118,55119,55122,55123,55125,55130,55131,55132,55133,55134,null,null,null,null,null,null,55135,55138,55140,55142,55143,55144,55146,55147,55149,55150,55151,55153,55154,55155,55157,55158,55159,55160,55161,55162,55163,55166,55167,55168,55170,55171,55172,55173,55174,55175,55178,55179,53316,53317,53319,53321,53328,53332,53336,53344,53356,53357,53360,53364,53372,53373,53377,53412,53413,53416,53420,53428,53429,53431,53433,53440,53441,53444,53448,53449,53456,53457,53459,53460,53461,53468,53469,53472,53476,53484,53485,53487,53488,53489,53496,53517,53552,53553,53556,53560,53562,53568,53569,53571,53572,53573,53580,53581,53584,53588,53596,53597,53599,53601,53608,53612,53628,53636,53640,53664,53665,53668,53672,53680,53681,53683,53685,53690,53692,53696,53720,53748,53752,53767,53769,53776,53804,53805,53808,53812,53820,53821,53823,53825,53832,53852,55181,55182,55183,55185,55186,55187,55188,55189,55190,55191,55194,55196,55198,55199,55200,55201,55202,55203,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,53860,53888,53889,53892,53896,53904,53905,53909,53916,53920,53924,53932,53937,53944,53945,53948,53951,53952,53954,53960,53961,53963,53972,53976,53980,53988,53989,54000,54001,54004,54008,54016,54017,54019,54021,54028,54029,54030,54032,54036,54038,54044,54045,54047,54048,54049,54053,54056,54057,54060,54064,54072,54073,54075,54076,54077,54084,54085,54140,54141,54144,54148,54156,54157,54159,54160,54161,54168,54169,54172,54176,54184,54185,54187,54189,54196,54200,54204,54212,54213,54216,54217,54224,54232,54241,54243,54252,54253,54256,54260,54268,54269,54271,54273,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,54280,54301,54336,54340,54364,54368,54372,54381,54383,54392,54393,54396,54399,54400,54402,54408,54409,54411,54413,54420,54441,54476,54480,54484,54492,54495,54504,54508,54512,54520,54523,54525,54532,54536,54540,54548,54549,54551,54588,54589,54592,54596,54604,54605,54607,54609,54616,54617,54620,54624,54629,54632,54633,54635,54637,54644,54645,54648,54652,54660,54661,54663,54664,54665,54672,54693,54728,54729,54732,54736,54738,54744,54745,54747,54749,54756,54757,54760,54764,54772,54773,54775,54777,54784,54785,54788,54792,54800,54801,54803,54804,54805,54812,54816,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,54820,54829,54840,54841,54844,54848,54853,54856,54857,54859,54861,54865,54868,54869,54872,54876,54887,54889,54896,54897,54900,54915,54917,54924,54925,54928,54932,54941,54943,54945,54952,54956,54960,54969,54971,54980,54981,54984,54988,54993,54996,54999,55001,55008,55012,55016,55024,55029,55036,55037,55040,55044,55057,55064,55065,55068,55072,55080,55081,55083,55085,55092,55093,55096,55100,55108,55111,55113,55120,55121,55124,55126,55127,55128,55129,55136,55137,55139,55141,55145,55148,55152,55156,55164,55165,55169,55176,55177,55180,55184,55192,55193,55195,55197,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20285,20339,20551,20729,21152,21487,21621,21733,22025,23233,23478,26247,26550,26551,26607,27468,29634,30146,31292,33499,33540,34903,34952,35382,36040,36303,36603,36838,39381,21051,21364,21508,24682,24932,27580,29647,33050,35258,35282,38307,20355,21002,22718,22904,23014,24178,24185,25031,25536,26438,26604,26751,28567,30286,30475,30965,31240,31487,31777,32925,33390,33393,35563,38291,20075,21917,26359,28212,30883,31469,33883,35088,34638,38824,21208,22350,22570,23884,24863,25022,25121,25954,26577,27204,28187,29976,30131,30435,30640,32058,37039,37969,37970,40853,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21283,23724,30002,32987,37440,38296,21083,22536,23004,23713,23831,24247,24378,24394,24951,27743,30074,30086,31968,32115,32177,32652,33108,33313,34193,35137,35611,37628,38477,40007,20171,20215,20491,20977,22607,24887,24894,24936,25913,27114,28433,30117,30342,30422,31623,33445,33995,63744,37799,38283,21888,23458,22353,63745,31923,32697,37301,20520,21435,23621,24040,25298,25454,25818,25831,28192,28844,31067,36317,36382,63746,36989,37445,37624,20094,20214,20581,24062,24314,24838,26967,33137,34388,36423,37749,39467,20062,20625,26480,26688,20745,21133,21138,27298,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30652,37392,40660,21163,24623,36850,20552,25001,25581,25802,26684,27268,28608,33160,35233,38548,22533,29309,29356,29956,32121,32365,32937,35211,35700,36963,40273,25225,27770,28500,32080,32570,35363,20860,24906,31645,35609,37463,37772,20140,20435,20510,20670,20742,21185,21197,21375,22384,22659,24218,24465,24950,25004,25806,25964,26223,26299,26356,26775,28039,28805,28913,29855,29861,29898,30169,30828,30956,31455,31478,32069,32147,32789,32831,33051,33686,35686,36629,36885,37857,38915,38968,39514,39912,20418,21843,22586,22865,23395,23622,24760,25106,26690,26800,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26856,28330,30028,30328,30926,31293,31995,32363,32380,35336,35489,35903,38542,40388,21476,21481,21578,21617,22266,22993,23396,23611,24235,25335,25911,25925,25970,26272,26543,27073,27837,30204,30352,30590,31295,32660,32771,32929,33167,33510,33533,33776,34241,34865,34996,35493,63747,36764,37678,38599,39015,39640,40723,21741,26011,26354,26767,31296,35895,40288,22256,22372,23825,26118,26801,26829,28414,29736,34974,39908,27752,63748,39592,20379,20844,20849,21151,23380,24037,24656,24685,25329,25511,25915,29657,31354,34467,36002,38799,20018,23521,25096,26524,29916,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31185,33747,35463,35506,36328,36942,37707,38982,24275,27112,34303,37101,63749,20896,23448,23532,24931,26874,27454,28748,29743,29912,31649,32592,33733,35264,36011,38364,39208,21038,24669,25324,36866,20362,20809,21281,22745,24291,26336,27960,28826,29378,29654,31568,33009,37979,21350,25499,32619,20054,20608,22602,22750,24618,24871,25296,27088,39745,23439,32024,32945,36703,20132,20689,21676,21932,23308,23968,24039,25898,25934,26657,27211,29409,30350,30703,32094,32761,33184,34126,34527,36611,36686,37066,39171,39509,39851,19992,20037,20061,20167,20465,20855,21246,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21312,21475,21477,21646,22036,22389,22434,23495,23943,24272,25084,25304,25937,26552,26601,27083,27472,27590,27628,27714,28317,28792,29399,29590,29699,30655,30697,31350,32127,32777,33276,33285,33290,33503,34914,35635,36092,36544,36881,37041,37476,37558,39378,39493,40169,40407,40860,22283,23616,33738,38816,38827,40628,21531,31384,32676,35033,36557,37089,22528,23624,25496,31391,23470,24339,31353,31406,33422,36524,20518,21048,21240,21367,22280,25331,25458,27402,28099,30519,21413,29527,34152,36470,38357,26426,27331,28528,35437,36556,39243,63750,26231,27512,36020,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,39740,63751,21483,22317,22862,25542,27131,29674,30789,31418,31429,31998,33909,35215,36211,36917,38312,21243,22343,30023,31584,33740,37406,63752,27224,20811,21067,21127,25119,26840,26997,38553,20677,21156,21220,25027,26020,26681,27135,29822,31563,33465,33771,35250,35641,36817,39241,63753,20170,22935,25810,26129,27278,29748,31105,31165,33449,34942,34943,35167,63754,37670,20235,21450,24613,25201,27762,32026,32102,20120,20834,30684,32943,20225,20238,20854,20864,21980,22120,22331,22522,22524,22804,22855,22931,23492,23696,23822,24049,24190,24524,25216,26071,26083,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26398,26399,26462,26827,26820,27231,27450,27683,27773,27778,28103,29592,29734,29738,29826,29859,30072,30079,30849,30959,31041,31047,31048,31098,31637,32000,32186,32648,32774,32813,32908,35352,35663,35912,36215,37665,37668,39138,39249,39438,39439,39525,40594,32202,20342,21513,25326,26708,37329,21931,20794,63755,63756,23068,25062,63757,25295,25343,63758,63759,63760,63761,63762,63763,37027,63764,63765,63766,63767,63768,35582,63769,63770,63771,63772,26262,63773,29014,63774,63775,38627,63776,25423,25466,21335,63777,26511,26976,28275,63778,30007,63779,63780,63781,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32013,63782,63783,34930,22218,23064,63784,63785,63786,63787,63788,20035,63789,20839,22856,26608,32784,63790,22899,24180,25754,31178,24565,24684,25288,25467,23527,23511,21162,63791,22900,24361,24594,63792,63793,63794,29785,63795,63796,63797,63798,63799,63800,39377,63801,63802,63803,63804,63805,63806,63807,63808,63809,63810,63811,28611,63812,63813,33215,36786,24817,63814,63815,33126,63816,63817,23615,63818,63819,63820,63821,63822,63823,63824,63825,23273,35365,26491,32016,63826,63827,63828,63829,63830,63831,33021,63832,63833,23612,27877,21311,28346,22810,33590,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20025,20150,20294,21934,22296,22727,24406,26039,26086,27264,27573,28237,30701,31471,31774,32222,34507,34962,37170,37723,25787,28606,29562,30136,36948,21846,22349,25018,25812,26311,28129,28251,28525,28601,30192,32835,33213,34113,35203,35527,35674,37663,27795,30035,31572,36367,36957,21776,22530,22616,24162,25095,25758,26848,30070,31958,34739,40680,20195,22408,22382,22823,23565,23729,24118,24453,25140,25825,29619,33274,34955,36024,38538,40667,23429,24503,24755,20498,20992,21040,22294,22581,22615,23566,23648,23798,23947,24230,24466,24764,25361,25481,25623,26691,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26873,27330,28120,28193,28372,28644,29182,30428,30585,31153,31291,33796,35241,36077,36339,36424,36867,36884,36947,37117,37709,38518,38876,27602,28678,29272,29346,29544,30563,31167,31716,32411,35712,22697,24775,25958,26109,26302,27788,28958,29129,35930,38931,20077,31361,20189,20908,20941,21205,21516,24999,26481,26704,26847,27934,28540,30140,30643,31461,33012,33891,37509,20828,26007,26460,26515,30168,31431,33651,63834,35910,36887,38957,23663,33216,33434,36929,36975,37389,24471,23965,27225,29128,30331,31561,34276,35588,37159,39472,21895,25078,63835,30313,32645,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,34367,34746,35064,37007,63836,27931,28889,29662,32097,33853,63837,37226,39409,63838,20098,21365,27396,27410,28734,29211,34349,40478,21068,36771,23888,25829,25900,27414,28651,31811,32412,34253,35172,35261,25289,33240,34847,24266,26391,28010,29436,29701,29807,34690,37086,20358,23821,24480,33802,20919,25504,30053,20142,20486,20841,20937,26753,27153,31918,31921,31975,33391,35538,36635,37327,20406,20791,21237,21570,24300,24942,25150,26053,27354,28670,31018,34268,34851,38317,39522,39530,40599,40654,21147,26310,27511,28701,31019,36706,38722,24976,25088,25891,28451,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29001,29833,32244,32879,34030,36646,36899,37706,20925,21015,21155,27916,28872,35010,24265,25986,27566,28610,31806,29557,20196,20278,22265,63839,23738,23994,24604,29618,31533,32666,32718,32838,36894,37428,38646,38728,38936,40801,20363,28583,31150,37300,38583,21214,63840,25736,25796,27347,28510,28696,29200,30439,32769,34310,34396,36335,36613,38706,39791,40442,40565,30860,31103,32160,33737,37636,40575,40595,35542,22751,24324,26407,28711,29903,31840,32894,20769,28712,29282,30922,36034,36058,36084,38647,20102,20698,23534,24278,26009,29134,30274,30637,32842,34044,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36988,39719,40845,22744,23105,23650,27155,28122,28431,30267,32047,32311,34078,35128,37860,38475,21129,26066,26611,27060,27969,28316,28687,29705,29792,30041,30244,30827,35628,39006,20845,25134,38520,20374,20523,23833,28138,32184,36650,24459,24900,26647,63841,38534,21202,32907,20956,20940,26974,31260,32190,33777,38517,20442,21033,21400,21519,21774,23653,24743,26446,26792,28012,29313,29432,29702,29827,63842,30178,31852,32633,32696,33673,35023,35041,37324,37328,38626,39881,21533,28542,29136,29848,34298,36522,38563,40023,40607,26519,28107,29747,33256,38678,30764,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31435,31520,31890,25705,29802,30194,30908,30952,39340,39764,40635,23518,24149,28448,33180,33707,37000,19975,21325,23081,24018,24398,24930,25405,26217,26364,28415,28459,28771,30622,33836,34067,34875,36627,39237,39995,21788,25273,26411,27819,33545,35178,38778,20129,22916,24536,24537,26395,32178,32596,33426,33579,33725,36638,37017,22475,22969,23186,23504,26151,26522,26757,27599,29028,32629,36023,36067,36993,39749,33032,35978,38476,39488,40613,23391,27667,29467,30450,30431,33804,20906,35219,20813,20885,21193,26825,27796,30468,30496,32191,32236,38754,40629,28357,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,34065,20901,21517,21629,26126,26269,26919,28319,30399,30609,33559,33986,34719,37225,37528,40180,34946,20398,20882,21215,22982,24125,24917,25720,25721,26286,26576,27169,27597,27611,29279,29281,29761,30520,30683,32791,33468,33541,35584,35624,35980,26408,27792,29287,30446,30566,31302,40361,27519,27794,22818,26406,33945,21359,22675,22937,24287,25551,26164,26483,28218,29483,31447,33495,37672,21209,24043,25006,25035,25098,25287,25771,26080,26969,27494,27595,28961,29687,30045,32326,33310,33538,34154,35491,36031,38695,40289,22696,40664,20497,21006,21563,21839,25991,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,27766,32010,32011,32862,34442,38272,38639,21247,27797,29289,21619,23194,23614,23883,24396,24494,26410,26806,26979,28220,28228,30473,31859,32654,34183,35598,36855,38753,40692,23735,24758,24845,25003,25935,26107,26108,27665,27887,29599,29641,32225,38292,23494,34588,35600,21085,21338,25293,25615,25778,26420,27192,27850,29632,29854,31636,31893,32283,33162,33334,34180,36843,38649,39361,20276,21322,21453,21467,25292,25644,25856,26001,27075,27886,28504,29677,30036,30242,30436,30460,30928,30971,31020,32070,33324,34784,36820,38930,39151,21187,25300,25765,28196,28497,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30332,36299,37297,37474,39662,39747,20515,20621,22346,22952,23592,24135,24439,25151,25918,26041,26049,26121,26507,27036,28354,30917,32033,32938,33152,33323,33459,33953,34444,35370,35607,37030,38450,40848,20493,20467,63843,22521,24472,25308,25490,26479,28227,28953,30403,32972,32986,35060,35061,35097,36064,36649,37197,38506,20271,20336,24091,26575,26658,30333,30334,39748,24161,27146,29033,29140,30058,63844,32321,34115,34281,39132,20240,31567,32624,38309,20961,24070,26805,27710,27726,27867,29359,31684,33539,27861,29754,20731,21128,22721,25816,27287,29863,30294,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30887,34327,38370,38713,63845,21342,24321,35722,36776,36783,37002,21029,30629,40009,40712,19993,20482,20853,23643,24183,26142,26170,26564,26821,28851,29953,30149,31177,31453,36647,39200,39432,20445,22561,22577,23542,26222,27493,27921,28282,28541,29668,29995,33769,35036,35091,35676,36628,20239,20693,21264,21340,23443,24489,26381,31119,33145,33583,34068,35079,35206,36665,36667,39333,39954,26412,20086,20472,22857,23553,23791,23792,25447,26834,28925,29090,29739,32299,34028,34562,36898,37586,40179,19981,20184,20463,20613,21078,21103,21542,21648,22496,22827,23142,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,23386,23413,23500,24220,63846,25206,25975,26023,28014,28325,29238,31526,31807,32566,33104,33105,33178,33344,33433,33705,35331,36000,36070,36091,36212,36282,37096,37340,38428,38468,39385,40167,21271,20998,21545,22132,22707,22868,22894,24575,24996,25198,26128,27774,28954,30406,31881,31966,32027,33452,36033,38640,63847,20315,24343,24447,25282,23849,26379,26842,30844,32323,40300,19989,20633,21269,21290,21329,22915,23138,24199,24754,24970,25161,25209,26000,26503,27047,27604,27606,27607,27608,27832,63848,29749,30202,30738,30865,31189,31192,31875,32203,32737,32933,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,33086,33218,33778,34586,35048,35513,35692,36027,37145,38750,39131,40763,22188,23338,24428,25996,27315,27567,27996,28657,28693,29277,29613,36007,36051,38971,24977,27703,32856,39425,20045,20107,20123,20181,20282,20284,20351,20447,20735,21490,21496,21766,21987,22235,22763,22882,23057,23531,23546,23556,24051,24107,24473,24605,25448,26012,26031,26614,26619,26797,27515,27801,27863,28195,28681,29509,30722,31038,31040,31072,31169,31721,32023,32114,32902,33293,33678,34001,34503,35039,35408,35422,35613,36060,36198,36781,37034,39164,39391,40605,21066,63849,26388,63850,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20632,21034,23665,25955,27733,29642,29987,30109,31639,33948,37240,38704,20087,25746,27578,29022,34217,19977,63851,26441,26862,28183,33439,34072,34923,25591,28545,37394,39087,19978,20663,20687,20767,21830,21930,22039,23360,23577,23776,24120,24202,24224,24258,24819,26705,27233,28248,29245,29248,29376,30456,31077,31665,32724,35059,35316,35443,35937,36062,38684,22622,29885,36093,21959,63852,31329,32034,33394,29298,29983,29989,63853,31513,22661,22779,23996,24207,24246,24464,24661,25234,25471,25933,26257,26329,26360,26646,26866,29312,29790,31598,32110,32214,32626,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32997,33298,34223,35199,35475,36893,37604,40653,40736,22805,22893,24109,24796,26132,26227,26512,27728,28101,28511,30707,30889,33990,37323,37675,20185,20682,20808,21892,23307,23459,25159,25982,26059,28210,29053,29697,29764,29831,29887,30316,31146,32218,32341,32680,33146,33203,33337,34330,34796,35445,36323,36984,37521,37925,39245,39854,21352,23633,26964,27844,27945,28203,33292,34203,35131,35373,35498,38634,40807,21089,26297,27570,32406,34814,36109,38275,38493,25885,28041,29166,63854,22478,22995,23468,24615,24826,25104,26143,26207,29481,29689,30427,30465,31596,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32854,32882,33125,35488,37266,19990,21218,27506,27927,31237,31545,32048,63855,36016,21484,22063,22609,23477,23567,23569,24034,25152,25475,25620,26157,26803,27836,28040,28335,28703,28836,29138,29990,30095,30094,30233,31505,31712,31787,32032,32057,34092,34157,34311,35380,36877,36961,37045,37559,38902,39479,20439,23660,26463,28049,31903,32396,35606,36118,36895,23403,24061,25613,33984,36956,39137,29575,23435,24730,26494,28126,35359,35494,36865,38924,21047,63856,28753,30862,37782,34928,37335,20462,21463,22013,22234,22402,22781,23234,23432,23723,23744,24101,24833,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,25101,25163,25480,25628,25910,25976,27193,27530,27700,27929,28465,29159,29417,29560,29703,29874,30246,30561,31168,31319,31466,31929,32143,32172,32353,32670,33065,33585,33936,34010,34282,34966,35504,35728,36664,36930,36995,37228,37526,37561,38539,38567,38568,38614,38656,38920,39318,39635,39706,21460,22654,22809,23408,23487,28113,28506,29087,29729,29881,32901,33789,24033,24455,24490,24642,26092,26642,26991,27219,27529,27957,28147,29667,30462,30636,31565,32020,33059,33308,33600,34036,34147,35426,35524,37255,37662,38918,39348,25100,34899,36848,37477,23815,23847,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,23913,29791,33181,34664,28629,25342,32722,35126,35186,19998,20056,20711,21213,21319,25215,26119,32361,34821,38494,20365,21273,22070,22987,23204,23608,23630,23629,24066,24337,24643,26045,26159,26178,26558,26612,29468,30690,31034,32709,33940,33997,35222,35430,35433,35553,35925,35962,22516,23508,24335,24687,25325,26893,27542,28252,29060,31698,34645,35672,36606,39135,39166,20280,20353,20449,21627,23072,23480,24892,26032,26216,29180,30003,31070,32051,33102,33251,33688,34218,34254,34563,35338,36523,36763,63857,36805,22833,23460,23526,24713,23529,23563,24515,27777,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63858,28145,28683,29978,33455,35574,20160,21313,63859,38617,27663,20126,20420,20818,21854,23077,23784,25105,29273,33469,33706,34558,34905,35357,38463,38597,39187,40201,40285,22538,23731,23997,24132,24801,24853,25569,27138,28197,37122,37716,38990,39952,40823,23433,23736,25353,26191,26696,30524,38593,38797,38996,39839,26017,35585,36555,38332,21813,23721,24022,24245,26263,30284,33780,38343,22739,25276,29390,40232,20208,22830,24591,26171,27523,31207,40230,21395,21696,22467,23830,24859,26326,28079,30861,33406,38552,38724,21380,25212,25494,28082,32266,33099,38989,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,27387,32588,40367,40474,20063,20539,20918,22812,24825,25590,26928,29242,32822,63860,37326,24369,63861,63862,32004,33509,33903,33979,34277,36493,63863,20335,63864,63865,22756,23363,24665,25562,25880,25965,26264,63866,26954,27171,27915,28673,29036,30162,30221,31155,31344,63867,32650,63868,35140,63869,35731,37312,38525,63870,39178,22276,24481,26044,28417,30208,31142,35486,39341,39770,40812,20740,25014,25233,27277,33222,20547,22576,24422,28937,35328,35578,23420,34326,20474,20796,22196,22852,25513,28153,23978,26989,20870,20104,20313,63871,63872,63873,22914,63874,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63875,27487,27741,63876,29877,30998,63877,33287,33349,33593,36671,36701,63878,39192,63879,63880,63881,20134,63882,22495,24441,26131,63883,63884,30123,32377,35695,63885,36870,39515,22181,22567,23032,23071,23476,63886,24310,63887,63888,25424,25403,63889,26941,27783,27839,28046,28051,28149,28436,63890,28895,28982,29017,63891,29123,29141,63892,30799,30831,63893,31605,32227,63894,32303,63895,34893,36575,63896,63897,63898,37467,63899,40182,63900,63901,63902,24709,28037,63903,29105,63904,63905,38321,21421,63906,63907,63908,26579,63909,28814,28976,29744,33398,33490,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63910,38331,39653,40573,26308,63911,29121,33865,63912,63913,22603,63914,63915,23992,24433,63916,26144,26254,27001,27054,27704,27891,28214,28481,28634,28699,28719,29008,29151,29552,63917,29787,63918,29908,30408,31310,32403,63919,63920,33521,35424,36814,63921,37704,63922,38681,63923,63924,20034,20522,63925,21000,21473,26355,27757,28618,29450,30591,31330,33454,34269,34306,63926,35028,35427,35709,35947,63927,37555,63928,38675,38928,20116,20237,20425,20658,21320,21566,21555,21978,22626,22714,22887,23067,23524,24735,63929,25034,25942,26111,26212,26791,27738,28595,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,28879,29100,29522,31613,34568,35492,39986,40711,23627,27779,29508,29577,37434,28331,29797,30239,31337,32277,34314,20800,22725,25793,29934,29973,30320,32705,37013,38605,39252,28198,29926,31401,31402,33253,34521,34680,35355,23113,23436,23451,26785,26880,28003,29609,29715,29740,30871,32233,32747,33048,33109,33694,35916,38446,38929,26352,24448,26106,26505,27754,29579,20525,23043,27498,30702,22806,23916,24013,29477,30031,63930,63931,20709,20985,22575,22829,22934,23002,23525,63932,63933,23970,25303,25622,25747,25854,63934,26332,63935,27208,63936,29183,29796,63937,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31368,31407,32327,32350,32768,33136,63938,34799,35201,35616,36953,63939,36992,39250,24958,27442,28020,32287,35109,36785,20433,20653,20887,21191,22471,22665,23481,24248,24898,27029,28044,28263,28342,29076,29794,29992,29996,32883,33592,33993,36362,37780,37854,63940,20110,20305,20598,20778,21448,21451,21491,23431,23507,23588,24858,24962,26100,29275,29591,29760,30402,31056,31121,31161,32006,32701,33419,34261,34398,36802,36935,37109,37354,38533,38632,38633,21206,24423,26093,26161,26671,29020,31286,37057,38922,20113,63941,27218,27550,28560,29065,32792,33464,34131,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36939,38549,38642,38907,34074,39729,20112,29066,38596,20803,21407,21729,22291,22290,22435,23195,23236,23491,24616,24895,25588,27781,27961,28274,28304,29232,29503,29783,33489,34945,36677,36960,63942,38498,39000,40219,26376,36234,37470,20301,20553,20702,21361,22285,22996,23041,23561,24944,26256,28205,29234,29771,32239,32963,33806,33894,34111,34655,34907,35096,35586,36949,38859,39759,20083,20369,20754,20842,63943,21807,21929,23418,23461,24188,24189,24254,24736,24799,24840,24841,25540,25912,26377,63944,26580,26586,63945,26977,26978,27833,27943,63946,28216,63947,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,28641,29494,29495,63948,29788,30001,63949,30290,63950,63951,32173,33278,33848,35029,35480,35547,35565,36400,36418,36938,36926,36986,37193,37321,37742,63952,63953,22537,63954,27603,32905,32946,63955,63956,20801,22891,23609,63957,63958,28516,29607,32996,36103,63959,37399,38287,63960,63961,63962,63963,32895,25102,28700,32104,34701,63964,22432,24681,24903,27575,35518,37504,38577,20057,21535,28139,34093,38512,38899,39150,25558,27875,37009,20957,25033,33210,40441,20381,20506,20736,23452,24847,25087,25836,26885,27589,30097,30691,32681,33380,34191,34811,34915,35516,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,35696,37291,20108,20197,20234,63965,63966,22839,23016,63967,24050,24347,24411,24609,63968,63969,63970,63971,29246,29669,63972,30064,30157,63973,31227,63974,32780,32819,32900,33505,33617,63975,63976,36029,36019,36999,63977,63978,39156,39180,63979,63980,28727,30410,32714,32716,32764,35610,20154,20161,20995,21360,63981,21693,22240,23035,23493,24341,24525,28270,63982,63983,32106,33589,63984,34451,35469,63985,38765,38775,63986,63987,19968,20314,20350,22777,26085,28322,36920,37808,39353,20219,22764,22922,23001,24641,63988,63989,31252,63990,33615,36035,20837,21316,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63991,63992,63993,20173,21097,23381,33471,20180,21050,21672,22985,23039,23376,23383,23388,24675,24904,28363,28825,29038,29574,29943,30133,30913,32043,32773,33258,33576,34071,34249,35566,36039,38604,20316,21242,22204,26027,26152,28796,28856,29237,32189,33421,37196,38592,40306,23409,26855,27544,28538,30430,23697,26283,28507,31668,31786,34870,38620,19976,20183,21280,22580,22715,22767,22892,23559,24115,24196,24373,25484,26290,26454,27167,27299,27404,28479,29254,63994,29520,29835,31456,31911,33144,33247,33255,33674,33900,34083,34196,34255,35037,36115,37292,38263,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38556,20877,21705,22312,23472,25165,26448,26685,26771,28221,28371,28797,32289,35009,36001,36617,40779,40782,29229,31631,35533,37658,20295,20302,20786,21632,22992,24213,25269,26485,26990,27159,27822,28186,29401,29482,30141,31672,32053,33511,33785,33879,34295,35419,36015,36487,36889,37048,38606,40799,21219,21514,23265,23490,25688,25973,28404,29380,63995,30340,31309,31515,31821,32318,32735,33659,35627,36042,36196,36321,36447,36842,36857,36969,37841,20291,20346,20659,20840,20856,21069,21098,22625,22652,22880,23560,23637,24283,24731,25136,26643,27583,27656,28593,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29006,29728,30000,30008,30033,30322,31564,31627,31661,31686,32399,35438,36670,36681,37439,37523,37666,37931,38651,39002,39019,39198,20999,25130,25240,27993,30308,31434,31680,32118,21344,23742,24215,28472,28857,31896,38673,39822,40670,25509,25722,34678,19969,20117,20141,20572,20597,21576,22979,23450,24128,24237,24311,24449,24773,25402,25919,25972,26060,26230,26232,26622,26984,27273,27491,27712,28096,28136,28191,28254,28702,28833,29582,29693,30010,30555,30855,31118,31243,31357,31934,32142,33351,35330,35562,35998,37165,37194,37336,37478,37580,37664,38662,38742,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38748,38914,40718,21046,21137,21884,22564,24093,24351,24716,25552,26799,28639,31085,31532,33229,34234,35069,35576,36420,37261,38500,38555,38717,38988,40778,20430,20806,20939,21161,22066,24340,24427,25514,25805,26089,26177,26362,26361,26397,26781,26839,27133,28437,28526,29031,29157,29226,29866,30522,31062,31066,31199,31264,31381,31895,31967,32068,32368,32903,34299,34468,35412,35519,36249,36481,36896,36973,37347,38459,38613,40165,26063,31751,36275,37827,23384,23562,21330,25305,29469,20519,23447,24478,24752,24939,26837,28121,29742,31278,32066,32156,32305,33131,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36394,36405,37758,37912,20304,22352,24038,24231,25387,32618,20027,20303,20367,20570,23005,32964,21610,21608,22014,22863,23449,24030,24282,26205,26417,26609,26666,27880,27954,28234,28557,28855,29664,30087,31820,32002,32044,32162,33311,34523,35387,35461,36208,36490,36659,36913,37198,37202,37956,39376,31481,31909,20426,20737,20934,22472,23535,23803,26201,27197,27994,28310,28652,28940,30063,31459,34850,36897,36981,38603,39423,33537,20013,20210,34886,37325,21373,27355,26987,27713,33914,22686,24974,26366,25327,28893,29969,30151,32338,33976,35657,36104,20043,21482,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21675,22320,22336,24535,25345,25351,25711,25903,26088,26234,26525,26547,27490,27744,27802,28460,30693,30757,31049,31063,32025,32930,33026,33267,33437,33463,34584,35468,63996,36100,36286,36978,30452,31257,31287,32340,32887,21767,21972,22645,25391,25634,26185,26187,26733,27035,27524,27941,28337,29645,29800,29857,30043,30137,30433,30494,30603,31206,32265,32285,33275,34095,34967,35386,36049,36587,36784,36914,37805,38499,38515,38663,20356,21489,23018,23241,24089,26702,29894,30142,31209,31378,33187,34541,36074,36300,36845,26015,26389,63997,22519,28503,32221,36655,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,37878,38598,24501,25074,28548,19988,20376,20511,21449,21983,23919,24046,27425,27492,30923,31642,63998,36425,36554,36974,25417,25662,30528,31364,37679,38015,40810,25776,28591,29158,29864,29914,31428,31762,32386,31922,32408,35738,36106,38013,39184,39244,21049,23519,25830,26413,32046,20717,21443,22649,24920,24921,25082,26028,31449,35730,35734,20489,20513,21109,21809,23100,24288,24432,24884,25950,26124,26166,26274,27085,28356,28466,29462,30241,31379,33081,33369,33750,33980,20661,22512,23488,23528,24425,25505,30758,32181,33756,34081,37319,37365,20874,26613,31574,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36012,20932,22971,24765,34389,20508,63999,21076,23610,24957,25114,25299,25842,26021,28364,30240,33034,36448,38495,38587,20191,21315,21912,22825,24029,25797,27849,28154,29588,31359,33307,34214,36068,36368,36983,37351,38369,38433,38854,20984,21746,21894,24505,25764,28552,32180,36639,36685,37941,20681,23574,27838,28155,29979,30651,31805,31844,35449,35522,22558,22974,24086,25463,29266,30090,30571,35548,36028,36626,24307,26228,28152,32893,33729,35531,38737,39894,64000,21059,26367,28053,28399,32224,35558,36910,36958,39636,21021,21119,21736,24980,25220,25307,26786,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26898,26970,27189,28818,28966,30813,30977,30990,31186,31245,32918,33400,33493,33609,34121,35970,36229,37218,37259,37294,20419,22225,29165,30679,34560,35320,23544,24534,26449,37032,21474,22618,23541,24740,24961,25696,32317,32880,34085,37507,25774,20652,23828,26368,22684,25277,25512,26894,27000,27166,28267,30394,31179,33467,33833,35535,36264,36861,37138,37195,37276,37648,37656,37786,38619,39478,39949,19985,30044,31069,31482,31569,31689,32302,33988,36441,36468,36600,36880,26149,26943,29763,20986,26414,40668,20805,24544,27798,34802,34909,34935,24756,33205,33795,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36101,21462,21561,22068,23094,23601,28810,32736,32858,33030,33261,36259,37257,39519,40434,20596,20164,21408,24827,28204,23652,20360,20516,21988,23769,24159,24677,26772,27835,28100,29118,30164,30196,30305,31258,31305,32199,32251,32622,33268,34473,36636,38601,39347,40786,21063,21189,39149,35242,19971,26578,28422,20405,23522,26517,27784,28024,29723,30759,37341,37756,34756,31204,31281,24555,20182,21668,21822,22702,22949,24816,25171,25302,26422,26965,33333,38464,39345,39389,20524,21331,21828,22396,64001,25176,64002,25826,26219,26589,28609,28655,29730,29752,35351,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,37944,21585,22022,22374,24392,24986,27470,28760,28845,32187,35477,22890,33067,25506,30472,32829,36010,22612,25645,27067,23445,24081,28271,64003,34153,20812,21488,22826,24608,24907,27526,27760,27888,31518,32974,33492,36294,37040,39089,64004,25799,28580,25745,25860,20814,21520,22303,35342,24927,26742,64005,30171,31570,32113,36890,22534,27084,33151,35114,36864,38969,20600,22871,22956,25237,36879,39722,24925,29305,38358,22369,23110,24052,25226,25773,25850,26487,27874,27966,29228,29750,30772,32631,33453,36315,38935,21028,22338,26495,29256,29923,36009,36774,37393,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38442,20843,21485,25420,20329,21764,24726,25943,27803,28031,29260,29437,31255,35207,35997,24429,28558,28921,33192,24846,20415,20559,25153,29255,31687,32232,32745,36941,38829,39449,36022,22378,24179,26544,33805,35413,21536,23318,24163,24290,24330,25987,32954,34109,38281,38491,20296,21253,21261,21263,21638,21754,22275,24067,24598,25243,25265,25429,64006,27873,28006,30129,30770,32990,33071,33502,33889,33970,34957,35090,36875,37610,39165,39825,24133,26292,26333,28689,29190,64007,20469,21117,24426,24915,26451,27161,28418,29922,31080,34920,35961,39111,39108,39491,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21697,31263,26963,35575,35914,39080,39342,24444,25259,30130,30382,34987,36991,38466,21305,24380,24517,27852,29644,30050,30091,31558,33534,39325,20047,36924,19979,20309,21414,22799,24264,26160,27827,29781,33655,34662,36032,36944,38686,39957,22737,23416,34384,35604,40372,23506,24680,24717,26097,27735,28450,28579,28698,32597,32752,38289,38290,38480,38867,21106,36676,20989,21547,21688,21859,21898,27323,28085,32216,33382,37532,38519,40569,21512,21704,30418,34532,38308,38356,38492,20130,20233,23022,23270,24055,24658,25239,26477,26689,27782,28207,32568,32923,33322,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,64008,64009,38917,20133,20565,21683,22419,22874,23401,23475,25032,26999,28023,28707,34809,35299,35442,35559,36994,39405,39608,21182,26680,20502,24184,26447,33607,34892,20139,21521,22190,29670,37141,38911,39177,39255,39321,22099,22687,34395,35377,25010,27382,29563,36562,27463,38570,39511,22869,29184,36203,38761,20436,23796,24358,25080,26203,27883,28843,29572,29625,29694,30505,30541,32067,32098,32291,33335,34898,64010,36066,37449,39023,23377,31348,34880,38913,23244,20448,21332,22846,23805,25406,28025,29433,33029,33031,33698,37583,38960,20136,20804,21009,22411,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,24418,27842,28366,28677,28752,28847,29074,29673,29801,33610,34722,34913,36872,37026,37795,39336,20846,24407,24800,24935,26291,34137,36426,37295,38795,20046,20114,21628,22741,22778,22909,23733,24359,25142,25160,26122,26215,27627,28009,28111,28246,28408,28564,28640,28649,28765,29392,29733,29786,29920,30355,31068,31946,32286,32993,33446,33899,33983,34382,34399,34676,35703,35946,37804,38912,39013,24785,25110,37239,23130,26127,28151,28222,29759,39746,24573,24794,31503,21700,24344,27742,27859,27946,28888,32005,34425,35340,40251,21270,21644,23301,27194,28779,30069,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31117,31166,33457,33775,35441,35649,36008,38772,64011,25844,25899,30906,30907,31339,20024,21914,22864,23462,24187,24739,25563,27489,26213,26707,28185,29029,29872,32008,36996,39529,39973,27963,28369,29502,35905,38346,20976,24140,24488,24653,24822,24880,24908,26179,26180,27045,27841,28255,28361,28514,29004,29852,30343,31681,31783,33618,34647,36945,38541,40643,21295,22238,24315,24458,24674,24724,25079,26214,26371,27292,28142,28590,28784,29546,32362,33214,33588,34516,35496,36036,21123,29554,23446,27243,37892,21742,22150,23389,25928,25989,26313,26783,28045,28102,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29243,32948,37237,39501,20399,20505,21402,21518,21564,21897,21957,24127,24460,26429,29030,29661,36869,21211,21235,22628,22734,28932,29071,29179,34224,35347,26248,34216,21927,26244,29002,33841,21321,21913,27585,24409,24509,25582,26249,28999,35569,36637,40638,20241,25658,28875,30054,34407,24676,35662,40440,20807,20982,21256,27958,33016,40657,26133,27427,28824,30165,21507,23673,32007,35350,27424,27453,27462,21560,24688,27965,32725,33288,20694,20958,21916,22123,22221,23020,23305,24076,24985,24984,25137,26206,26342,29081,29113,29114,29351,31143,31232,32690,35440,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], "gb18030":[19970,19972,19973,19974,19983,19986,19991,19999,20000,20001,20003,20006,20009,20014,20015,20017,20019,20021,20023,20028,20032,20033,20034,20036,20038,20042,20049,20053,20055,20058,20059,20066,20067,20068,20069,20071,20072,20074,20075,20076,20077,20078,20079,20082,20084,20085,20086,20087,20088,20089,20090,20091,20092,20093,20095,20096,20097,20098,20099,20100,20101,20103,20106,20112,20118,20119,20121,20124,20125,20126,20131,20138,20143,20144,20145,20148,20150,20151,20152,20153,20156,20157,20158,20168,20172,20175,20176,20178,20186,20187,20188,20192,20194,20198,20199,20201,20205,20206,20207,20209,20212,20216,20217,20218,20220,20222,20224,20226,20227,20228,20229,20230,20231,20232,20235,20236,20242,20243,20244,20245,20246,20252,20253,20257,20259,20264,20265,20268,20269,20270,20273,20275,20277,20279,20281,20283,20286,20287,20288,20289,20290,20292,20293,20295,20296,20297,20298,20299,20300,20306,20308,20310,20321,20322,20326,20328,20330,20331,20333,20334,20337,20338,20341,20343,20344,20345,20346,20349,20352,20353,20354,20357,20358,20359,20362,20364,20366,20368,20370,20371,20373,20374,20376,20377,20378,20380,20382,20383,20385,20386,20388,20395,20397,20400,20401,20402,20403,20404,20406,20407,20408,20409,20410,20411,20412,20413,20414,20416,20417,20418,20422,20423,20424,20425,20427,20428,20429,20434,20435,20436,20437,20438,20441,20443,20448,20450,20452,20453,20455,20459,20460,20464,20466,20468,20469,20470,20471,20473,20475,20476,20477,20479,20480,20481,20482,20483,20484,20485,20486,20487,20488,20489,20490,20491,20494,20496,20497,20499,20501,20502,20503,20507,20509,20510,20512,20514,20515,20516,20519,20523,20527,20528,20529,20530,20531,20532,20533,20534,20535,20536,20537,20539,20541,20543,20544,20545,20546,20548,20549,20550,20553,20554,20555,20557,20560,20561,20562,20563,20564,20566,20567,20568,20569,20571,20573,20574,20575,20576,20577,20578,20579,20580,20582,20583,20584,20585,20586,20587,20589,20590,20591,20592,20593,20594,20595,20596,20597,20600,20601,20602,20604,20605,20609,20610,20611,20612,20614,20615,20617,20618,20619,20620,20622,20623,20624,20625,20626,20627,20628,20629,20630,20631,20632,20633,20634,20635,20636,20637,20638,20639,20640,20641,20642,20644,20646,20650,20651,20653,20654,20655,20656,20657,20659,20660,20661,20662,20663,20664,20665,20668,20669,20670,20671,20672,20673,20674,20675,20676,20677,20678,20679,20680,20681,20682,20683,20684,20685,20686,20688,20689,20690,20691,20692,20693,20695,20696,20697,20699,20700,20701,20702,20703,20704,20705,20706,20707,20708,20709,20712,20713,20714,20715,20719,20720,20721,20722,20724,20726,20727,20728,20729,20730,20732,20733,20734,20735,20736,20737,20738,20739,20740,20741,20744,20745,20746,20748,20749,20750,20751,20752,20753,20755,20756,20757,20758,20759,20760,20761,20762,20763,20764,20765,20766,20767,20768,20770,20771,20772,20773,20774,20775,20776,20777,20778,20779,20780,20781,20782,20783,20784,20785,20786,20787,20788,20789,20790,20791,20792,20793,20794,20795,20796,20797,20798,20802,20807,20810,20812,20814,20815,20816,20818,20819,20823,20824,20825,20827,20829,20830,20831,20832,20833,20835,20836,20838,20839,20841,20842,20847,20850,20858,20862,20863,20867,20868,20870,20871,20874,20875,20878,20879,20880,20881,20883,20884,20888,20890,20893,20894,20895,20897,20899,20902,20903,20904,20905,20906,20909,20910,20916,20920,20921,20922,20926,20927,20929,20930,20931,20933,20936,20938,20941,20942,20944,20946,20947,20948,20949,20950,20951,20952,20953,20954,20956,20958,20959,20962,20963,20965,20966,20967,20968,20969,20970,20972,20974,20977,20978,20980,20983,20990,20996,20997,21001,21003,21004,21007,21008,21011,21012,21013,21020,21022,21023,21025,21026,21027,21029,21030,21031,21034,21036,21039,21041,21042,21044,21045,21052,21054,21060,21061,21062,21063,21064,21065,21067,21070,21071,21074,21075,21077,21079,21080,21081,21082,21083,21085,21087,21088,21090,21091,21092,21094,21096,21099,21100,21101,21102,21104,21105,21107,21108,21109,21110,21111,21112,21113,21114,21115,21116,21118,21120,21123,21124,21125,21126,21127,21129,21130,21131,21132,21133,21134,21135,21137,21138,21140,21141,21142,21143,21144,21145,21146,21148,21156,21157,21158,21159,21166,21167,21168,21172,21173,21174,21175,21176,21177,21178,21179,21180,21181,21184,21185,21186,21188,21189,21190,21192,21194,21196,21197,21198,21199,21201,21203,21204,21205,21207,21209,21210,21211,21212,21213,21214,21216,21217,21218,21219,21221,21222,21223,21224,21225,21226,21227,21228,21229,21230,21231,21233,21234,21235,21236,21237,21238,21239,21240,21243,21244,21245,21249,21250,21251,21252,21255,21257,21258,21259,21260,21262,21265,21266,21267,21268,21272,21275,21276,21278,21279,21282,21284,21285,21287,21288,21289,21291,21292,21293,21295,21296,21297,21298,21299,21300,21301,21302,21303,21304,21308,21309,21312,21314,21316,21318,21323,21324,21325,21328,21332,21336,21337,21339,21341,21349,21352,21354,21356,21357,21362,21366,21369,21371,21372,21373,21374,21376,21377,21379,21383,21384,21386,21390,21391,21392,21393,21394,21395,21396,21398,21399,21401,21403,21404,21406,21408,21409,21412,21415,21418,21419,21420,21421,21423,21424,21425,21426,21427,21428,21429,21431,21432,21433,21434,21436,21437,21438,21440,21443,21444,21445,21446,21447,21454,21455,21456,21458,21459,21461,21466,21468,21469,21470,21473,21474,21479,21492,21498,21502,21503,21504,21506,21509,21511,21515,21524,21528,21529,21530,21532,21538,21540,21541,21546,21552,21555,21558,21559,21562,21565,21567,21569,21570,21572,21573,21575,21577,21580,21581,21582,21583,21585,21594,21597,21598,21599,21600,21601,21603,21605,21607,21609,21610,21611,21612,21613,21614,21615,21616,21620,21625,21626,21630,21631,21633,21635,21637,21639,21640,21641,21642,21645,21649,21651,21655,21656,21660,21662,21663,21664,21665,21666,21669,21678,21680,21682,21685,21686,21687,21689,21690,21692,21694,21699,21701,21706,21707,21718,21720,21723,21728,21729,21730,21731,21732,21739,21740,21743,21744,21745,21748,21749,21750,21751,21752,21753,21755,21758,21760,21762,21763,21764,21765,21768,21770,21771,21772,21773,21774,21778,21779,21781,21782,21783,21784,21785,21786,21788,21789,21790,21791,21793,21797,21798,21800,21801,21803,21805,21810,21812,21813,21814,21816,21817,21818,21819,21821,21824,21826,21829,21831,21832,21835,21836,21837,21838,21839,21841,21842,21843,21844,21847,21848,21849,21850,21851,21853,21854,21855,21856,21858,21859,21864,21865,21867,21871,21872,21873,21874,21875,21876,21881,21882,21885,21887,21893,21894,21900,21901,21902,21904,21906,21907,21909,21910,21911,21914,21915,21918,21920,21921,21922,21923,21924,21925,21926,21928,21929,21930,21931,21932,21933,21934,21935,21936,21938,21940,21942,21944,21946,21948,21951,21952,21953,21954,21955,21958,21959,21960,21962,21963,21966,21967,21968,21973,21975,21976,21977,21978,21979,21982,21984,21986,21991,21993,21997,21998,22000,22001,22004,22006,22008,22009,22010,22011,22012,22015,22018,22019,22020,22021,22022,22023,22026,22027,22029,22032,22033,22034,22035,22036,22037,22038,22039,22041,22042,22044,22045,22048,22049,22050,22053,22054,22056,22057,22058,22059,22062,22063,22064,22067,22069,22071,22072,22074,22076,22077,22078,22080,22081,22082,22083,22084,22085,22086,22087,22088,22089,22090,22091,22095,22096,22097,22098,22099,22101,22102,22106,22107,22109,22110,22111,22112,22113,22115,22117,22118,22119,22125,22126,22127,22128,22130,22131,22132,22133,22135,22136,22137,22138,22141,22142,22143,22144,22145,22146,22147,22148,22151,22152,22153,22154,22155,22156,22157,22160,22161,22162,22164,22165,22166,22167,22168,22169,22170,22171,22172,22173,22174,22175,22176,22177,22178,22180,22181,22182,22183,22184,22185,22186,22187,22188,22189,22190,22192,22193,22194,22195,22196,22197,22198,22200,22201,22202,22203,22205,22206,22207,22208,22209,22210,22211,22212,22213,22214,22215,22216,22217,22219,22220,22221,22222,22223,22224,22225,22226,22227,22229,22230,22232,22233,22236,22243,22245,22246,22247,22248,22249,22250,22252,22254,22255,22258,22259,22262,22263,22264,22267,22268,22272,22273,22274,22277,22279,22283,22284,22285,22286,22287,22288,22289,22290,22291,22292,22293,22294,22295,22296,22297,22298,22299,22301,22302,22304,22305,22306,22308,22309,22310,22311,22315,22321,22322,22324,22325,22326,22327,22328,22332,22333,22335,22337,22339,22340,22341,22342,22344,22345,22347,22354,22355,22356,22357,22358,22360,22361,22370,22371,22373,22375,22380,22382,22384,22385,22386,22388,22389,22392,22393,22394,22397,22398,22399,22400,22401,22407,22408,22409,22410,22413,22414,22415,22416,22417,22420,22421,22422,22423,22424,22425,22426,22428,22429,22430,22431,22437,22440,22442,22444,22447,22448,22449,22451,22453,22454,22455,22457,22458,22459,22460,22461,22462,22463,22464,22465,22468,22469,22470,22471,22472,22473,22474,22476,22477,22480,22481,22483,22486,22487,22491,22492,22494,22497,22498,22499,22501,22502,22503,22504,22505,22506,22507,22508,22510,22512,22513,22514,22515,22517,22518,22519,22523,22524,22526,22527,22529,22531,22532,22533,22536,22537,22538,22540,22542,22543,22544,22546,22547,22548,22550,22551,22552,22554,22555,22556,22557,22559,22562,22563,22565,22566,22567,22568,22569,22571,22572,22573,22574,22575,22577,22578,22579,22580,22582,22583,22584,22585,22586,22587,22588,22589,22590,22591,22592,22593,22594,22595,22597,22598,22599,22600,22601,22602,22603,22606,22607,22608,22610,22611,22613,22614,22615,22617,22618,22619,22620,22621,22623,22624,22625,22626,22627,22628,22630,22631,22632,22633,22634,22637,22638,22639,22640,22641,22642,22643,22644,22645,22646,22647,22648,22649,22650,22651,22652,22653,22655,22658,22660,22662,22663,22664,22666,22667,22668,22669,22670,22671,22672,22673,22676,22677,22678,22679,22680,22683,22684,22685,22688,22689,22690,22691,22692,22693,22694,22695,22698,22699,22700,22701,22702,22703,22704,22705,22706,22707,22708,22709,22710,22711,22712,22713,22714,22715,22717,22718,22719,22720,22722,22723,22724,22726,22727,22728,22729,22730,22731,22732,22733,22734,22735,22736,22738,22739,22740,22742,22743,22744,22745,22746,22747,22748,22749,22750,22751,22752,22753,22754,22755,22757,22758,22759,22760,22761,22762,22765,22767,22769,22770,22772,22773,22775,22776,22778,22779,22780,22781,22782,22783,22784,22785,22787,22789,22790,22792,22793,22794,22795,22796,22798,22800,22801,22802,22803,22807,22808,22811,22813,22814,22816,22817,22818,22819,22822,22824,22828,22832,22834,22835,22837,22838,22843,22845,22846,22847,22848,22851,22853,22854,22858,22860,22861,22864,22866,22867,22873,22875,22876,22877,22878,22879,22881,22883,22884,22886,22887,22888,22889,22890,22891,22892,22893,22894,22895,22896,22897,22898,22901,22903,22906,22907,22908,22910,22911,22912,22917,22921,22923,22924,22926,22927,22928,22929,22932,22933,22936,22938,22939,22940,22941,22943,22944,22945,22946,22950,22951,22956,22957,22960,22961,22963,22964,22965,22966,22967,22968,22970,22972,22973,22975,22976,22977,22978,22979,22980,22981,22983,22984,22985,22988,22989,22990,22991,22997,22998,23001,23003,23006,23007,23008,23009,23010,23012,23014,23015,23017,23018,23019,23021,23022,23023,23024,23025,23026,23027,23028,23029,23030,23031,23032,23034,23036,23037,23038,23040,23042,23050,23051,23053,23054,23055,23056,23058,23060,23061,23062,23063,23065,23066,23067,23069,23070,23073,23074,23076,23078,23079,23080,23082,23083,23084,23085,23086,23087,23088,23091,23093,23095,23096,23097,23098,23099,23101,23102,23103,23105,23106,23107,23108,23109,23111,23112,23115,23116,23117,23118,23119,23120,23121,23122,23123,23124,23126,23127,23128,23129,23131,23132,23133,23134,23135,23136,23137,23139,23140,23141,23142,23144,23145,23147,23148,23149,23150,23151,23152,23153,23154,23155,23160,23161,23163,23164,23165,23166,23168,23169,23170,23171,23172,23173,23174,23175,23176,23177,23178,23179,23180,23181,23182,23183,23184,23185,23187,23188,23189,23190,23191,23192,23193,23196,23197,23198,23199,23200,23201,23202,23203,23204,23205,23206,23207,23208,23209,23211,23212,23213,23214,23215,23216,23217,23220,23222,23223,23225,23226,23227,23228,23229,23231,23232,23235,23236,23237,23238,23239,23240,23242,23243,23245,23246,23247,23248,23249,23251,23253,23255,23257,23258,23259,23261,23262,23263,23266,23268,23269,23271,23272,23274,23276,23277,23278,23279,23280,23282,23283,23284,23285,23286,23287,23288,23289,23290,23291,23292,23293,23294,23295,23296,23297,23298,23299,23300,23301,23302,23303,23304,23306,23307,23308,23309,23310,23311,23312,23313,23314,23315,23316,23317,23320,23321,23322,23323,23324,23325,23326,23327,23328,23329,23330,23331,23332,23333,23334,23335,23336,23337,23338,23339,23340,23341,23342,23343,23344,23345,23347,23349,23350,23352,23353,23354,23355,23356,23357,23358,23359,23361,23362,23363,23364,23365,23366,23367,23368,23369,23370,23371,23372,23373,23374,23375,23378,23382,23390,23392,23393,23399,23400,23403,23405,23406,23407,23410,23412,23414,23415,23416,23417,23419,23420,23422,23423,23426,23430,23434,23437,23438,23440,23441,23442,23444,23446,23455,23463,23464,23465,23468,23469,23470,23471,23473,23474,23479,23482,23483,23484,23488,23489,23491,23496,23497,23498,23499,23501,23502,23503,23505,23508,23509,23510,23511,23512,23513,23514,23515,23516,23520,23522,23523,23526,23527,23529,23530,23531,23532,23533,23535,23537,23538,23539,23540,23541,23542,23543,23549,23550,23552,23554,23555,23557,23559,23560,23563,23564,23565,23566,23568,23570,23571,23575,23577,23579,23582,23583,23584,23585,23587,23590,23592,23593,23594,23595,23597,23598,23599,23600,23602,23603,23605,23606,23607,23619,23620,23622,23623,23628,23629,23634,23635,23636,23638,23639,23640,23642,23643,23644,23645,23647,23650,23652,23655,23656,23657,23658,23659,23660,23661,23664,23666,23667,23668,23669,23670,23671,23672,23675,23676,23677,23678,23680,23683,23684,23685,23686,23687,23689,23690,23691,23694,23695,23698,23699,23701,23709,23710,23711,23712,23713,23716,23717,23718,23719,23720,23722,23726,23727,23728,23730,23732,23734,23737,23738,23739,23740,23742,23744,23746,23747,23749,23750,23751,23752,23753,23754,23756,23757,23758,23759,23760,23761,23763,23764,23765,23766,23767,23768,23770,23771,23772,23773,23774,23775,23776,23778,23779,23783,23785,23787,23788,23790,23791,23793,23794,23795,23796,23797,23798,23799,23800,23801,23802,23804,23805,23806,23807,23808,23809,23812,23813,23816,23817,23818,23819,23820,23821,23823,23824,23825,23826,23827,23829,23831,23832,23833,23834,23836,23837,23839,23840,23841,23842,23843,23845,23848,23850,23851,23852,23855,23856,23857,23858,23859,23861,23862,23863,23864,23865,23866,23867,23868,23871,23872,23873,23874,23875,23876,23877,23878,23880,23881,23885,23886,23887,23888,23889,23890,23891,23892,23893,23894,23895,23897,23898,23900,23902,23903,23904,23905,23906,23907,23908,23909,23910,23911,23912,23914,23917,23918,23920,23921,23922,23923,23925,23926,23927,23928,23929,23930,23931,23932,23933,23934,23935,23936,23937,23939,23940,23941,23942,23943,23944,23945,23946,23947,23948,23949,23950,23951,23952,23953,23954,23955,23956,23957,23958,23959,23960,23962,23963,23964,23966,23967,23968,23969,23970,23971,23972,23973,23974,23975,23976,23977,23978,23979,23980,23981,23982,23983,23984,23985,23986,23987,23988,23989,23990,23992,23993,23994,23995,23996,23997,23998,23999,24000,24001,24002,24003,24004,24006,24007,24008,24009,24010,24011,24012,24014,24015,24016,24017,24018,24019,24020,24021,24022,24023,24024,24025,24026,24028,24031,24032,24035,24036,24042,24044,24045,24048,24053,24054,24056,24057,24058,24059,24060,24063,24064,24068,24071,24073,24074,24075,24077,24078,24082,24083,24087,24094,24095,24096,24097,24098,24099,24100,24101,24104,24105,24106,24107,24108,24111,24112,24114,24115,24116,24117,24118,24121,24122,24126,24127,24128,24129,24131,24134,24135,24136,24137,24138,24139,24141,24142,24143,24144,24145,24146,24147,24150,24151,24152,24153,24154,24156,24157,24159,24160,24163,24164,24165,24166,24167,24168,24169,24170,24171,24172,24173,24174,24175,24176,24177,24181,24183,24185,24190,24193,24194,24195,24197,24200,24201,24204,24205,24206,24210,24216,24219,24221,24225,24226,24227,24228,24232,24233,24234,24235,24236,24238,24239,24240,24241,24242,24244,24250,24251,24252,24253,24255,24256,24257,24258,24259,24260,24261,24262,24263,24264,24267,24268,24269,24270,24271,24272,24276,24277,24279,24280,24281,24282,24284,24285,24286,24287,24288,24289,24290,24291,24292,24293,24294,24295,24297,24299,24300,24301,24302,24303,24304,24305,24306,24307,24309,24312,24313,24315,24316,24317,24325,24326,24327,24329,24332,24333,24334,24336,24338,24340,24342,24345,24346,24348,24349,24350,24353,24354,24355,24356,24360,24363,24364,24366,24368,24370,24371,24372,24373,24374,24375,24376,24379,24381,24382,24383,24385,24386,24387,24388,24389,24390,24391,24392,24393,24394,24395,24396,24397,24398,24399,24401,24404,24409,24410,24411,24412,24414,24415,24416,24419,24421,24423,24424,24427,24430,24431,24434,24436,24437,24438,24440,24442,24445,24446,24447,24451,24454,24461,24462,24463,24465,24467,24468,24470,24474,24475,24477,24478,24479,24480,24482,24483,24484,24485,24486,24487,24489,24491,24492,24495,24496,24497,24498,24499,24500,24502,24504,24505,24506,24507,24510,24511,24512,24513,24514,24519,24520,24522,24523,24526,24531,24532,24533,24538,24539,24540,24542,24543,24546,24547,24549,24550,24552,24553,24556,24559,24560,24562,24563,24564,24566,24567,24569,24570,24572,24583,24584,24585,24587,24588,24592,24593,24595,24599,24600,24602,24606,24607,24610,24611,24612,24620,24621,24622,24624,24625,24626,24627,24628,24630,24631,24632,24633,24634,24637,24638,24640,24644,24645,24646,24647,24648,24649,24650,24652,24654,24655,24657,24659,24660,24662,24663,24664,24667,24668,24670,24671,24672,24673,24677,24678,24686,24689,24690,24692,24693,24695,24702,24704,24705,24706,24709,24710,24711,24712,24714,24715,24718,24719,24720,24721,24723,24725,24727,24728,24729,24732,24734,24737,24738,24740,24741,24743,24745,24746,24750,24752,24755,24757,24758,24759,24761,24762,24765,24766,24767,24768,24769,24770,24771,24772,24775,24776,24777,24780,24781,24782,24783,24784,24786,24787,24788,24790,24791,24793,24795,24798,24801,24802,24803,24804,24805,24810,24817,24818,24821,24823,24824,24827,24828,24829,24830,24831,24834,24835,24836,24837,24839,24842,24843,24844,24848,24849,24850,24851,24852,24854,24855,24856,24857,24859,24860,24861,24862,24865,24866,24869,24872,24873,24874,24876,24877,24878,24879,24880,24881,24882,24883,24884,24885,24886,24887,24888,24889,24890,24891,24892,24893,24894,24896,24897,24898,24899,24900,24901,24902,24903,24905,24907,24909,24911,24912,24914,24915,24916,24918,24919,24920,24921,24922,24923,24924,24926,24927,24928,24929,24931,24932,24933,24934,24937,24938,24939,24940,24941,24942,24943,24945,24946,24947,24948,24950,24952,24953,24954,24955,24956,24957,24958,24959,24960,24961,24962,24963,24964,24965,24966,24967,24968,24969,24970,24972,24973,24975,24976,24977,24978,24979,24981,24982,24983,24984,24985,24986,24987,24988,24990,24991,24992,24993,24994,24995,24996,24997,24998,25002,25003,25005,25006,25007,25008,25009,25010,25011,25012,25013,25014,25016,25017,25018,25019,25020,25021,25023,25024,25025,25027,25028,25029,25030,25031,25033,25036,25037,25038,25039,25040,25043,25045,25046,25047,25048,25049,25050,25051,25052,25053,25054,25055,25056,25057,25058,25059,25060,25061,25063,25064,25065,25066,25067,25068,25069,25070,25071,25072,25073,25074,25075,25076,25078,25079,25080,25081,25082,25083,25084,25085,25086,25088,25089,25090,25091,25092,25093,25095,25097,25107,25108,25113,25116,25117,25118,25120,25123,25126,25127,25128,25129,25131,25133,25135,25136,25137,25138,25141,25142,25144,25145,25146,25147,25148,25154,25156,25157,25158,25162,25167,25168,25173,25174,25175,25177,25178,25180,25181,25182,25183,25184,25185,25186,25188,25189,25192,25201,25202,25204,25205,25207,25208,25210,25211,25213,25217,25218,25219,25221,25222,25223,25224,25227,25228,25229,25230,25231,25232,25236,25241,25244,25245,25246,25251,25254,25255,25257,25258,25261,25262,25263,25264,25266,25267,25268,25270,25271,25272,25274,25278,25280,25281,25283,25291,25295,25297,25301,25309,25310,25312,25313,25316,25322,25323,25328,25330,25333,25336,25337,25338,25339,25344,25347,25348,25349,25350,25354,25355,25356,25357,25359,25360,25362,25363,25364,25365,25367,25368,25369,25372,25382,25383,25385,25388,25389,25390,25392,25393,25395,25396,25397,25398,25399,25400,25403,25404,25406,25407,25408,25409,25412,25415,25416,25418,25425,25426,25427,25428,25430,25431,25432,25433,25434,25435,25436,25437,25440,25444,25445,25446,25448,25450,25451,25452,25455,25456,25458,25459,25460,25461,25464,25465,25468,25469,25470,25471,25473,25475,25476,25477,25478,25483,25485,25489,25491,25492,25493,25495,25497,25498,25499,25500,25501,25502,25503,25505,25508,25510,25515,25519,25521,25522,25525,25526,25529,25531,25533,25535,25536,25537,25538,25539,25541,25543,25544,25546,25547,25548,25553,25555,25556,25557,25559,25560,25561,25562,25563,25564,25565,25567,25570,25572,25573,25574,25575,25576,25579,25580,25582,25583,25584,25585,25587,25589,25591,25593,25594,25595,25596,25598,25603,25604,25606,25607,25608,25609,25610,25613,25614,25617,25618,25621,25622,25623,25624,25625,25626,25629,25631,25634,25635,25636,25637,25639,25640,25641,25643,25646,25647,25648,25649,25650,25651,25653,25654,25655,25656,25657,25659,25660,25662,25664,25666,25667,25673,25675,25676,25677,25678,25679,25680,25681,25683,25685,25686,25687,25689,25690,25691,25692,25693,25695,25696,25697,25698,25699,25700,25701,25702,25704,25706,25707,25708,25710,25711,25712,25713,25714,25715,25716,25717,25718,25719,25723,25724,25725,25726,25727,25728,25729,25731,25734,25736,25737,25738,25739,25740,25741,25742,25743,25744,25747,25748,25751,25752,25754,25755,25756,25757,25759,25760,25761,25762,25763,25765,25766,25767,25768,25770,25771,25775,25777,25778,25779,25780,25782,25785,25787,25789,25790,25791,25793,25795,25796,25798,25799,25800,25801,25802,25803,25804,25807,25809,25811,25812,25813,25814,25817,25818,25819,25820,25821,25823,25824,25825,25827,25829,25831,25832,25833,25834,25835,25836,25837,25838,25839,25840,25841,25842,25843,25844,25845,25846,25847,25848,25849,25850,25851,25852,25853,25854,25855,25857,25858,25859,25860,25861,25862,25863,25864,25866,25867,25868,25869,25870,25871,25872,25873,25875,25876,25877,25878,25879,25881,25882,25883,25884,25885,25886,25887,25888,25889,25890,25891,25892,25894,25895,25896,25897,25898,25900,25901,25904,25905,25906,25907,25911,25914,25916,25917,25920,25921,25922,25923,25924,25926,25927,25930,25931,25933,25934,25936,25938,25939,25940,25943,25944,25946,25948,25951,25952,25953,25956,25957,25959,25960,25961,25962,25965,25966,25967,25969,25971,25973,25974,25976,25977,25978,25979,25980,25981,25982,25983,25984,25985,25986,25987,25988,25989,25990,25992,25993,25994,25997,25998,25999,26002,26004,26005,26006,26008,26010,26013,26014,26016,26018,26019,26022,26024,26026,26028,26030,26033,26034,26035,26036,26037,26038,26039,26040,26042,26043,26046,26047,26048,26050,26055,26056,26057,26058,26061,26064,26065,26067,26068,26069,26072,26073,26074,26075,26076,26077,26078,26079,26081,26083,26084,26090,26091,26098,26099,26100,26101,26104,26105,26107,26108,26109,26110,26111,26113,26116,26117,26119,26120,26121,26123,26125,26128,26129,26130,26134,26135,26136,26138,26139,26140,26142,26145,26146,26147,26148,26150,26153,26154,26155,26156,26158,26160,26162,26163,26167,26168,26169,26170,26171,26173,26175,26176,26178,26180,26181,26182,26183,26184,26185,26186,26189,26190,26192,26193,26200,26201,26203,26204,26205,26206,26208,26210,26211,26213,26215,26217,26218,26219,26220,26221,26225,26226,26227,26229,26232,26233,26235,26236,26237,26239,26240,26241,26243,26245,26246,26248,26249,26250,26251,26253,26254,26255,26256,26258,26259,26260,26261,26264,26265,26266,26267,26268,26270,26271,26272,26273,26274,26275,26276,26277,26278,26281,26282,26283,26284,26285,26287,26288,26289,26290,26291,26293,26294,26295,26296,26298,26299,26300,26301,26303,26304,26305,26306,26307,26308,26309,26310,26311,26312,26313,26314,26315,26316,26317,26318,26319,26320,26321,26322,26323,26324,26325,26326,26327,26328,26330,26334,26335,26336,26337,26338,26339,26340,26341,26343,26344,26346,26347,26348,26349,26350,26351,26353,26357,26358,26360,26362,26363,26365,26369,26370,26371,26372,26373,26374,26375,26380,26382,26383,26385,26386,26387,26390,26392,26393,26394,26396,26398,26400,26401,26402,26403,26404,26405,26407,26409,26414,26416,26418,26419,26422,26423,26424,26425,26427,26428,26430,26431,26433,26436,26437,26439,26442,26443,26445,26450,26452,26453,26455,26456,26457,26458,26459,26461,26466,26467,26468,26470,26471,26475,26476,26478,26481,26484,26486,26488,26489,26490,26491,26493,26496,26498,26499,26501,26502,26504,26506,26508,26509,26510,26511,26513,26514,26515,26516,26518,26521,26523,26527,26528,26529,26532,26534,26537,26540,26542,26545,26546,26548,26553,26554,26555,26556,26557,26558,26559,26560,26562,26565,26566,26567,26568,26569,26570,26571,26572,26573,26574,26581,26582,26583,26587,26591,26593,26595,26596,26598,26599,26600,26602,26603,26605,26606,26610,26613,26614,26615,26616,26617,26618,26619,26620,26622,26625,26626,26627,26628,26630,26637,26640,26642,26644,26645,26648,26649,26650,26651,26652,26654,26655,26656,26658,26659,26660,26661,26662,26663,26664,26667,26668,26669,26670,26671,26672,26673,26676,26677,26678,26682,26683,26687,26695,26699,26701,26703,26706,26710,26711,26712,26713,26714,26715,26716,26717,26718,26719,26730,26732,26733,26734,26735,26736,26737,26738,26739,26741,26744,26745,26746,26747,26748,26749,26750,26751,26752,26754,26756,26759,26760,26761,26762,26763,26764,26765,26766,26768,26769,26770,26772,26773,26774,26776,26777,26778,26779,26780,26781,26782,26783,26784,26785,26787,26788,26789,26793,26794,26795,26796,26798,26801,26802,26804,26806,26807,26808,26809,26810,26811,26812,26813,26814,26815,26817,26819,26820,26821,26822,26823,26824,26826,26828,26830,26831,26832,26833,26835,26836,26838,26839,26841,26843,26844,26845,26846,26847,26849,26850,26852,26853,26854,26855,26856,26857,26858,26859,26860,26861,26863,26866,26867,26868,26870,26871,26872,26875,26877,26878,26879,26880,26882,26883,26884,26886,26887,26888,26889,26890,26892,26895,26897,26899,26900,26901,26902,26903,26904,26905,26906,26907,26908,26909,26910,26913,26914,26915,26917,26918,26919,26920,26921,26922,26923,26924,26926,26927,26929,26930,26931,26933,26934,26935,26936,26938,26939,26940,26942,26944,26945,26947,26948,26949,26950,26951,26952,26953,26954,26955,26956,26957,26958,26959,26960,26961,26962,26963,26965,26966,26968,26969,26971,26972,26975,26977,26978,26980,26981,26983,26984,26985,26986,26988,26989,26991,26992,26994,26995,26996,26997,26998,27002,27003,27005,27006,27007,27009,27011,27013,27018,27019,27020,27022,27023,27024,27025,27026,27027,27030,27031,27033,27034,27037,27038,27039,27040,27041,27042,27043,27044,27045,27046,27049,27050,27052,27054,27055,27056,27058,27059,27061,27062,27064,27065,27066,27068,27069,27070,27071,27072,27074,27075,27076,27077,27078,27079,27080,27081,27083,27085,27087,27089,27090,27091,27093,27094,27095,27096,27097,27098,27100,27101,27102,27105,27106,27107,27108,27109,27110,27111,27112,27113,27114,27115,27116,27118,27119,27120,27121,27123,27124,27125,27126,27127,27128,27129,27130,27131,27132,27134,27136,27137,27138,27139,27140,27141,27142,27143,27144,27145,27147,27148,27149,27150,27151,27152,27153,27154,27155,27156,27157,27158,27161,27162,27163,27164,27165,27166,27168,27170,27171,27172,27173,27174,27175,27177,27179,27180,27181,27182,27184,27186,27187,27188,27190,27191,27192,27193,27194,27195,27196,27199,27200,27201,27202,27203,27205,27206,27208,27209,27210,27211,27212,27213,27214,27215,27217,27218,27219,27220,27221,27222,27223,27226,27228,27229,27230,27231,27232,27234,27235,27236,27238,27239,27240,27241,27242,27243,27244,27245,27246,27247,27248,27250,27251,27252,27253,27254,27255,27256,27258,27259,27261,27262,27263,27265,27266,27267,27269,27270,27271,27272,27273,27274,27275,27276,27277,27279,27282,27283,27284,27285,27286,27288,27289,27290,27291,27292,27293,27294,27295,27297,27298,27299,27300,27301,27302,27303,27304,27306,27309,27310,27311,27312,27313,27314,27315,27316,27317,27318,27319,27320,27321,27322,27323,27324,27325,27326,27327,27328,27329,27330,27331,27332,27333,27334,27335,27336,27337,27338,27339,27340,27341,27342,27343,27344,27345,27346,27347,27348,27349,27350,27351,27352,27353,27354,27355,27356,27357,27358,27359,27360,27361,27362,27363,27364,27365,27366,27367,27368,27369,27370,27371,27372,27373,27374,27375,27376,27377,27378,27379,27380,27381,27382,27383,27384,27385,27386,27387,27388,27389,27390,27391,27392,27393,27394,27395,27396,27397,27398,27399,27400,27401,27402,27403,27404,27405,27406,27407,27408,27409,27410,27411,27412,27413,27414,27415,27416,27417,27418,27419,27420,27421,27422,27423,27429,27430,27432,27433,27434,27435,27436,27437,27438,27439,27440,27441,27443,27444,27445,27446,27448,27451,27452,27453,27455,27456,27457,27458,27460,27461,27464,27466,27467,27469,27470,27471,27472,27473,27474,27475,27476,27477,27478,27479,27480,27482,27483,27484,27485,27486,27487,27488,27489,27496,27497,27499,27500,27501,27502,27503,27504,27505,27506,27507,27508,27509,27510,27511,27512,27514,27517,27518,27519,27520,27525,27528,27532,27534,27535,27536,27537,27540,27541,27543,27544,27545,27548,27549,27550,27551,27552,27554,27555,27556,27557,27558,27559,27560,27561,27563,27564,27565,27566,27567,27568,27569,27570,27574,27576,27577,27578,27579,27580,27581,27582,27584,27587,27588,27590,27591,27592,27593,27594,27596,27598,27600,27601,27608,27610,27612,27613,27614,27615,27616,27618,27619,27620,27621,27622,27623,27624,27625,27628,27629,27630,27632,27633,27634,27636,27638,27639,27640,27642,27643,27644,27646,27647,27648,27649,27650,27651,27652,27656,27657,27658,27659,27660,27662,27666,27671,27676,27677,27678,27680,27683,27685,27691,27692,27693,27697,27699,27702,27703,27705,27706,27707,27708,27710,27711,27715,27716,27717,27720,27723,27724,27725,27726,27727,27729,27730,27731,27734,27736,27737,27738,27746,27747,27749,27750,27751,27755,27756,27757,27758,27759,27761,27763,27765,27767,27768,27770,27771,27772,27775,27776,27780,27783,27786,27787,27789,27790,27793,27794,27797,27798,27799,27800,27802,27804,27805,27806,27808,27810,27816,27820,27823,27824,27828,27829,27830,27831,27834,27840,27841,27842,27843,27846,27847,27848,27851,27853,27854,27855,27857,27858,27864,27865,27866,27868,27869,27871,27876,27878,27879,27881,27884,27885,27890,27892,27897,27903,27904,27906,27907,27909,27910,27912,27913,27914,27917,27919,27920,27921,27923,27924,27925,27926,27928,27932,27933,27935,27936,27937,27938,27939,27940,27942,27944,27945,27948,27949,27951,27952,27956,27958,27959,27960,27962,27967,27968,27970,27972,27977,27980,27984,27989,27990,27991,27992,27995,27997,27999,28001,28002,28004,28005,28007,28008,28011,28012,28013,28016,28017,28018,28019,28021,28022,28025,28026,28027,28029,28030,28031,28032,28033,28035,28036,28038,28039,28042,28043,28045,28047,28048,28050,28054,28055,28056,28057,28058,28060,28066,28069,28076,28077,28080,28081,28083,28084,28086,28087,28089,28090,28091,28092,28093,28094,28097,28098,28099,28104,28105,28106,28109,28110,28111,28112,28114,28115,28116,28117,28119,28122,28123,28124,28127,28130,28131,28133,28135,28136,28137,28138,28141,28143,28144,28146,28148,28149,28150,28152,28154,28157,28158,28159,28160,28161,28162,28163,28164,28166,28167,28168,28169,28171,28175,28178,28179,28181,28184,28185,28187,28188,28190,28191,28194,28198,28199,28200,28202,28204,28206,28208,28209,28211,28213,28214,28215,28217,28219,28220,28221,28222,28223,28224,28225,28226,28229,28230,28231,28232,28233,28234,28235,28236,28239,28240,28241,28242,28245,28247,28249,28250,28252,28253,28254,28256,28257,28258,28259,28260,28261,28262,28263,28264,28265,28266,28268,28269,28271,28272,28273,28274,28275,28276,28277,28278,28279,28280,28281,28282,28283,28284,28285,28288,28289,28290,28292,28295,28296,28298,28299,28300,28301,28302,28305,28306,28307,28308,28309,28310,28311,28313,28314,28315,28317,28318,28320,28321,28323,28324,28326,28328,28329,28331,28332,28333,28334,28336,28339,28341,28344,28345,28348,28350,28351,28352,28355,28356,28357,28358,28360,28361,28362,28364,28365,28366,28368,28370,28374,28376,28377,28379,28380,28381,28387,28391,28394,28395,28396,28397,28398,28399,28400,28401,28402,28403,28405,28406,28407,28408,28410,28411,28412,28413,28414,28415,28416,28417,28419,28420,28421,28423,28424,28426,28427,28428,28429,28430,28432,28433,28434,28438,28439,28440,28441,28442,28443,28444,28445,28446,28447,28449,28450,28451,28453,28454,28455,28456,28460,28462,28464,28466,28468,28469,28471,28472,28473,28474,28475,28476,28477,28479,28480,28481,28482,28483,28484,28485,28488,28489,28490,28492,28494,28495,28496,28497,28498,28499,28500,28501,28502,28503,28505,28506,28507,28509,28511,28512,28513,28515,28516,28517,28519,28520,28521,28522,28523,28524,28527,28528,28529,28531,28533,28534,28535,28537,28539,28541,28542,28543,28544,28545,28546,28547,28549,28550,28551,28554,28555,28559,28560,28561,28562,28563,28564,28565,28566,28567,28568,28569,28570,28571,28573,28574,28575,28576,28578,28579,28580,28581,28582,28584,28585,28586,28587,28588,28589,28590,28591,28592,28593,28594,28596,28597,28599,28600,28602,28603,28604,28605,28606,28607,28609,28611,28612,28613,28614,28615,28616,28618,28619,28620,28621,28622,28623,28624,28627,28628,28629,28630,28631,28632,28633,28634,28635,28636,28637,28639,28642,28643,28644,28645,28646,28647,28648,28649,28650,28651,28652,28653,28656,28657,28658,28659,28660,28661,28662,28663,28664,28665,28666,28667,28668,28669,28670,28671,28672,28673,28674,28675,28676,28677,28678,28679,28680,28681,28682,28683,28684,28685,28686,28687,28688,28690,28691,28692,28693,28694,28695,28696,28697,28700,28701,28702,28703,28704,28705,28706,28708,28709,28710,28711,28712,28713,28714,28715,28716,28717,28718,28719,28720,28721,28722,28723,28724,28726,28727,28728,28730,28731,28732,28733,28734,28735,28736,28737,28738,28739,28740,28741,28742,28743,28744,28745,28746,28747,28749,28750,28752,28753,28754,28755,28756,28757,28758,28759,28760,28761,28762,28763,28764,28765,28767,28768,28769,28770,28771,28772,28773,28774,28775,28776,28777,28778,28782,28785,28786,28787,28788,28791,28793,28794,28795,28797,28801,28802,28803,28804,28806,28807,28808,28811,28812,28813,28815,28816,28817,28819,28823,28824,28826,28827,28830,28831,28832,28833,28834,28835,28836,28837,28838,28839,28840,28841,28842,28848,28850,28852,28853,28854,28858,28862,28863,28868,28869,28870,28871,28873,28875,28876,28877,28878,28879,28880,28881,28882,28883,28884,28885,28886,28887,28890,28892,28893,28894,28896,28897,28898,28899,28901,28906,28910,28912,28913,28914,28915,28916,28917,28918,28920,28922,28923,28924,28926,28927,28928,28929,28930,28931,28932,28933,28934,28935,28936,28939,28940,28941,28942,28943,28945,28946,28948,28951,28955,28956,28957,28958,28959,28960,28961,28962,28963,28964,28965,28967,28968,28969,28970,28971,28972,28973,28974,28978,28979,28980,28981,28983,28984,28985,28986,28987,28988,28989,28990,28991,28992,28993,28994,28995,28996,28998,28999,29000,29001,29003,29005,29007,29008,29009,29010,29011,29012,29013,29014,29015,29016,29017,29018,29019,29021,29023,29024,29025,29026,29027,29029,29033,29034,29035,29036,29037,29039,29040,29041,29044,29045,29046,29047,29049,29051,29052,29054,29055,29056,29057,29058,29059,29061,29062,29063,29064,29065,29067,29068,29069,29070,29072,29073,29074,29075,29077,29078,29079,29082,29083,29084,29085,29086,29089,29090,29091,29092,29093,29094,29095,29097,29098,29099,29101,29102,29103,29104,29105,29106,29108,29110,29111,29112,29114,29115,29116,29117,29118,29119,29120,29121,29122,29124,29125,29126,29127,29128,29129,29130,29131,29132,29133,29135,29136,29137,29138,29139,29142,29143,29144,29145,29146,29147,29148,29149,29150,29151,29153,29154,29155,29156,29158,29160,29161,29162,29163,29164,29165,29167,29168,29169,29170,29171,29172,29173,29174,29175,29176,29178,29179,29180,29181,29182,29183,29184,29185,29186,29187,29188,29189,29191,29192,29193,29194,29195,29196,29197,29198,29199,29200,29201,29202,29203,29204,29205,29206,29207,29208,29209,29210,29211,29212,29214,29215,29216,29217,29218,29219,29220,29221,29222,29223,29225,29227,29229,29230,29231,29234,29235,29236,29242,29244,29246,29248,29249,29250,29251,29252,29253,29254,29257,29258,29259,29262,29263,29264,29265,29267,29268,29269,29271,29272,29274,29276,29278,29280,29283,29284,29285,29288,29290,29291,29292,29293,29296,29297,29299,29300,29302,29303,29304,29307,29308,29309,29314,29315,29317,29318,29319,29320,29321,29324,29326,29328,29329,29331,29332,29333,29334,29335,29336,29337,29338,29339,29340,29341,29342,29344,29345,29346,29347,29348,29349,29350,29351,29352,29353,29354,29355,29358,29361,29362,29363,29365,29370,29371,29372,29373,29374,29375,29376,29381,29382,29383,29385,29386,29387,29388,29391,29393,29395,29396,29397,29398,29400,29402,29403,58566,58567,58568,58569,58570,58571,58572,58573,58574,58575,58576,58577,58578,58579,58580,58581,58582,58583,58584,58585,58586,58587,58588,58589,58590,58591,58592,58593,58594,58595,58596,58597,58598,58599,58600,58601,58602,58603,58604,58605,58606,58607,58608,58609,58610,58611,58612,58613,58614,58615,58616,58617,58618,58619,58620,58621,58622,58623,58624,58625,58626,58627,58628,58629,58630,58631,58632,58633,58634,58635,58636,58637,58638,58639,58640,58641,58642,58643,58644,58645,58646,58647,58648,58649,58650,58651,58652,58653,58654,58655,58656,58657,58658,58659,58660,58661,12288,12289,12290,183,713,711,168,12291,12293,8212,65374,8214,8230,8216,8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12310,12311,12304,12305,177,215,247,8758,8743,8744,8721,8719,8746,8745,8712,8759,8730,8869,8741,8736,8978,8857,8747,8750,8801,8780,8776,8765,8733,8800,8814,8815,8804,8805,8734,8757,8756,9794,9792,176,8242,8243,8451,65284,164,65504,65505,8240,167,8470,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,8251,8594,8592,8593,8595,12307,58662,58663,58664,58665,58666,58667,58668,58669,58670,58671,58672,58673,58674,58675,58676,58677,58678,58679,58680,58681,58682,58683,58684,58685,58686,58687,58688,58689,58690,58691,58692,58693,58694,58695,58696,58697,58698,58699,58700,58701,58702,58703,58704,58705,58706,58707,58708,58709,58710,58711,58712,58713,58714,58715,58716,58717,58718,58719,58720,58721,58722,58723,58724,58725,58726,58727,58728,58729,58730,58731,58732,58733,58734,58735,58736,58737,58738,58739,58740,58741,58742,58743,58744,58745,58746,58747,58748,58749,58750,58751,58752,58753,58754,58755,58756,58757,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,59238,59239,59240,59241,59242,59243,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,9350,9351,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,8364,59245,12832,12833,12834,12835,12836,12837,12838,12839,12840,12841,59246,59247,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,59248,59249,58758,58759,58760,58761,58762,58763,58764,58765,58766,58767,58768,58769,58770,58771,58772,58773,58774,58775,58776,58777,58778,58779,58780,58781,58782,58783,58784,58785,58786,58787,58788,58789,58790,58791,58792,58793,58794,58795,58796,58797,58798,58799,58800,58801,58802,58803,58804,58805,58806,58807,58808,58809,58810,58811,58812,58813,58814,58815,58816,58817,58818,58819,58820,58821,58822,58823,58824,58825,58826,58827,58828,58829,58830,58831,58832,58833,58834,58835,58836,58837,58838,58839,58840,58841,58842,58843,58844,58845,58846,58847,58848,58849,58850,58851,58852,12288,65281,65282,65283,65509,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65339,65340,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,58854,58855,58856,58857,58858,58859,58860,58861,58862,58863,58864,58865,58866,58867,58868,58869,58870,58871,58872,58873,58874,58875,58876,58877,58878,58879,58880,58881,58882,58883,58884,58885,58886,58887,58888,58889,58890,58891,58892,58893,58894,58895,58896,58897,58898,58899,58900,58901,58902,58903,58904,58905,58906,58907,58908,58909,58910,58911,58912,58913,58914,58915,58916,58917,58918,58919,58920,58921,58922,58923,58924,58925,58926,58927,58928,58929,58930,58931,58932,58933,58934,58935,58936,58937,58938,58939,58940,58941,58942,58943,58944,58945,58946,58947,58948,58949,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,59250,59251,59252,59253,59254,59255,59256,59257,59258,59259,59260,58950,58951,58952,58953,58954,58955,58956,58957,58958,58959,58960,58961,58962,58963,58964,58965,58966,58967,58968,58969,58970,58971,58972,58973,58974,58975,58976,58977,58978,58979,58980,58981,58982,58983,58984,58985,58986,58987,58988,58989,58990,58991,58992,58993,58994,58995,58996,58997,58998,58999,59000,59001,59002,59003,59004,59005,59006,59007,59008,59009,59010,59011,59012,59013,59014,59015,59016,59017,59018,59019,59020,59021,59022,59023,59024,59025,59026,59027,59028,59029,59030,59031,59032,59033,59034,59035,59036,59037,59038,59039,59040,59041,59042,59043,59044,59045,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,59261,59262,59263,59264,59265,59266,59267,59268,59046,59047,59048,59049,59050,59051,59052,59053,59054,59055,59056,59057,59058,59059,59060,59061,59062,59063,59064,59065,59066,59067,59068,59069,59070,59071,59072,59073,59074,59075,59076,59077,59078,59079,59080,59081,59082,59083,59084,59085,59086,59087,59088,59089,59090,59091,59092,59093,59094,59095,59096,59097,59098,59099,59100,59101,59102,59103,59104,59105,59106,59107,59108,59109,59110,59111,59112,59113,59114,59115,59116,59117,59118,59119,59120,59121,59122,59123,59124,59125,59126,59127,59128,59129,59130,59131,59132,59133,59134,59135,59136,59137,59138,59139,59140,59141,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,59269,59270,59271,59272,59273,59274,59275,59276,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,59277,59278,59279,59280,59281,59282,59283,65077,65078,65081,65082,65087,65088,65085,65086,65089,65090,65091,65092,59284,59285,65083,65084,65079,65080,65073,59286,65075,65076,59287,59288,59289,59290,59291,59292,59293,59294,59295,59142,59143,59144,59145,59146,59147,59148,59149,59150,59151,59152,59153,59154,59155,59156,59157,59158,59159,59160,59161,59162,59163,59164,59165,59166,59167,59168,59169,59170,59171,59172,59173,59174,59175,59176,59177,59178,59179,59180,59181,59182,59183,59184,59185,59186,59187,59188,59189,59190,59191,59192,59193,59194,59195,59196,59197,59198,59199,59200,59201,59202,59203,59204,59205,59206,59207,59208,59209,59210,59211,59212,59213,59214,59215,59216,59217,59218,59219,59220,59221,59222,59223,59224,59225,59226,59227,59228,59229,59230,59231,59232,59233,59234,59235,59236,59237,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,59296,59297,59298,59299,59300,59301,59302,59303,59304,59305,59306,59307,59308,59309,59310,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,59311,59312,59313,59314,59315,59316,59317,59318,59319,59320,59321,59322,59323,714,715,729,8211,8213,8229,8245,8453,8457,8598,8599,8600,8601,8725,8735,8739,8786,8806,8807,8895,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9601,9602,9603,9604,9605,9606,9607,9608,9609,9610,9611,9612,9613,9614,9615,9619,9620,9621,9660,9661,9698,9699,9700,9701,9737,8853,12306,12317,12318,59324,59325,59326,59327,59328,59329,59330,59331,59332,59333,59334,257,225,462,224,275,233,283,232,299,237,464,236,333,243,466,242,363,250,468,249,470,472,474,476,252,234,593,7743,324,328,505,609,59337,59338,59339,59340,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,59341,59342,59343,59344,59345,59346,59347,59348,59349,59350,59351,59352,59353,59354,59355,59356,59357,59358,59359,59360,59361,12321,12322,12323,12324,12325,12326,12327,12328,12329,12963,13198,13199,13212,13213,13214,13217,13252,13262,13265,13266,13269,65072,65506,65508,59362,8481,12849,59363,8208,59364,59365,59366,12540,12443,12444,12541,12542,12294,12445,12446,65097,65098,65099,65100,65101,65102,65103,65104,65105,65106,65108,65109,65110,65111,65113,65114,65115,65116,65117,65118,65119,65120,65121,65122,65123,65124,65125,65126,65128,65129,65130,65131,12350,12272,12273,12274,12275,12276,12277,12278,12279,12280,12281,12282,12283,12295,59380,59381,59382,59383,59384,59385,59386,59387,59388,59389,59390,59391,59392,9472,9473,9474,9475,9476,9477,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,59393,59394,59395,59396,59397,59398,59399,59400,59401,59402,59403,59404,59405,59406,59407,29404,29405,29407,29410,29411,29412,29413,29414,29415,29418,29419,29429,29430,29433,29437,29438,29439,29440,29442,29444,29445,29446,29447,29448,29449,29451,29452,29453,29455,29456,29457,29458,29460,29464,29465,29466,29471,29472,29475,29476,29478,29479,29480,29485,29487,29488,29490,29491,29493,29494,29498,29499,29500,29501,29504,29505,29506,29507,29508,29509,29510,29511,29512,29513,29514,29515,29516,29518,29519,29521,29523,29524,29525,29526,29528,29529,29530,29531,29532,29533,29534,29535,29537,29538,29539,29540,29541,29542,29543,29544,29545,29546,29547,29550,29552,29553,57344,57345,57346,57347,57348,57349,57350,57351,57352,57353,57354,57355,57356,57357,57358,57359,57360,57361,57362,57363,57364,57365,57366,57367,57368,57369,57370,57371,57372,57373,57374,57375,57376,57377,57378,57379,57380,57381,57382,57383,57384,57385,57386,57387,57388,57389,57390,57391,57392,57393,57394,57395,57396,57397,57398,57399,57400,57401,57402,57403,57404,57405,57406,57407,57408,57409,57410,57411,57412,57413,57414,57415,57416,57417,57418,57419,57420,57421,57422,57423,57424,57425,57426,57427,57428,57429,57430,57431,57432,57433,57434,57435,57436,57437,29554,29555,29556,29557,29558,29559,29560,29561,29562,29563,29564,29565,29567,29568,29569,29570,29571,29573,29574,29576,29578,29580,29581,29583,29584,29586,29587,29588,29589,29591,29592,29593,29594,29596,29597,29598,29600,29601,29603,29604,29605,29606,29607,29608,29610,29612,29613,29617,29620,29621,29622,29624,29625,29628,29629,29630,29631,29633,29635,29636,29637,29638,29639,29643,29644,29646,29650,29651,29652,29653,29654,29655,29656,29658,29659,29660,29661,29663,29665,29666,29667,29668,29670,29672,29674,29675,29676,29678,29679,29680,29681,29683,29684,29685,29686,29687,57438,57439,57440,57441,57442,57443,57444,57445,57446,57447,57448,57449,57450,57451,57452,57453,57454,57455,57456,57457,57458,57459,57460,57461,57462,57463,57464,57465,57466,57467,57468,57469,57470,57471,57472,57473,57474,57475,57476,57477,57478,57479,57480,57481,57482,57483,57484,57485,57486,57487,57488,57489,57490,57491,57492,57493,57494,57495,57496,57497,57498,57499,57500,57501,57502,57503,57504,57505,57506,57507,57508,57509,57510,57511,57512,57513,57514,57515,57516,57517,57518,57519,57520,57521,57522,57523,57524,57525,57526,57527,57528,57529,57530,57531,29688,29689,29690,29691,29692,29693,29694,29695,29696,29697,29698,29700,29703,29704,29707,29708,29709,29710,29713,29714,29715,29716,29717,29718,29719,29720,29721,29724,29725,29726,29727,29728,29729,29731,29732,29735,29737,29739,29741,29743,29745,29746,29751,29752,29753,29754,29755,29757,29758,29759,29760,29762,29763,29764,29765,29766,29767,29768,29769,29770,29771,29772,29773,29774,29775,29776,29777,29778,29779,29780,29782,29784,29789,29792,29793,29794,29795,29796,29797,29798,29799,29800,29801,29802,29803,29804,29806,29807,29809,29810,29811,29812,29813,29816,29817,29818,57532,57533,57534,57535,57536,57537,57538,57539,57540,57541,57542,57543,57544,57545,57546,57547,57548,57549,57550,57551,57552,57553,57554,57555,57556,57557,57558,57559,57560,57561,57562,57563,57564,57565,57566,57567,57568,57569,57570,57571,57572,57573,57574,57575,57576,57577,57578,57579,57580,57581,57582,57583,57584,57585,57586,57587,57588,57589,57590,57591,57592,57593,57594,57595,57596,57597,57598,57599,57600,57601,57602,57603,57604,57605,57606,57607,57608,57609,57610,57611,57612,57613,57614,57615,57616,57617,57618,57619,57620,57621,57622,57623,57624,57625,29819,29820,29821,29823,29826,29828,29829,29830,29832,29833,29834,29836,29837,29839,29841,29842,29843,29844,29845,29846,29847,29848,29849,29850,29851,29853,29855,29856,29857,29858,29859,29860,29861,29862,29866,29867,29868,29869,29870,29871,29872,29873,29874,29875,29876,29877,29878,29879,29880,29881,29883,29884,29885,29886,29887,29888,29889,29890,29891,29892,29893,29894,29895,29896,29897,29898,29899,29900,29901,29902,29903,29904,29905,29907,29908,29909,29910,29911,29912,29913,29914,29915,29917,29919,29921,29925,29927,29928,29929,29930,29931,29932,29933,29936,29937,29938,57626,57627,57628,57629,57630,57631,57632,57633,57634,57635,57636,57637,57638,57639,57640,57641,57642,57643,57644,57645,57646,57647,57648,57649,57650,57651,57652,57653,57654,57655,57656,57657,57658,57659,57660,57661,57662,57663,57664,57665,57666,57667,57668,57669,57670,57671,57672,57673,57674,57675,57676,57677,57678,57679,57680,57681,57682,57683,57684,57685,57686,57687,57688,57689,57690,57691,57692,57693,57694,57695,57696,57697,57698,57699,57700,57701,57702,57703,57704,57705,57706,57707,57708,57709,57710,57711,57712,57713,57714,57715,57716,57717,57718,57719,29939,29941,29944,29945,29946,29947,29948,29949,29950,29952,29953,29954,29955,29957,29958,29959,29960,29961,29962,29963,29964,29966,29968,29970,29972,29973,29974,29975,29979,29981,29982,29984,29985,29986,29987,29988,29990,29991,29994,29998,30004,30006,30009,30012,30013,30015,30017,30018,30019,30020,30022,30023,30025,30026,30029,30032,30033,30034,30035,30037,30038,30039,30040,30045,30046,30047,30048,30049,30050,30051,30052,30055,30056,30057,30059,30060,30061,30062,30063,30064,30065,30067,30069,30070,30071,30074,30075,30076,30077,30078,30080,30081,30082,30084,30085,30087,57720,57721,57722,57723,57724,57725,57726,57727,57728,57729,57730,57731,57732,57733,57734,57735,57736,57737,57738,57739,57740,57741,57742,57743,57744,57745,57746,57747,57748,57749,57750,57751,57752,57753,57754,57755,57756,57757,57758,57759,57760,57761,57762,57763,57764,57765,57766,57767,57768,57769,57770,57771,57772,57773,57774,57775,57776,57777,57778,57779,57780,57781,57782,57783,57784,57785,57786,57787,57788,57789,57790,57791,57792,57793,57794,57795,57796,57797,57798,57799,57800,57801,57802,57803,57804,57805,57806,57807,57808,57809,57810,57811,57812,57813,30088,30089,30090,30092,30093,30094,30096,30099,30101,30104,30107,30108,30110,30114,30118,30119,30120,30121,30122,30125,30134,30135,30138,30139,30143,30144,30145,30150,30155,30156,30158,30159,30160,30161,30163,30167,30169,30170,30172,30173,30175,30176,30177,30181,30185,30188,30189,30190,30191,30194,30195,30197,30198,30199,30200,30202,30203,30205,30206,30210,30212,30214,30215,30216,30217,30219,30221,30222,30223,30225,30226,30227,30228,30230,30234,30236,30237,30238,30241,30243,30247,30248,30252,30254,30255,30257,30258,30262,30263,30265,30266,30267,30269,30273,30274,30276,57814,57815,57816,57817,57818,57819,57820,57821,57822,57823,57824,57825,57826,57827,57828,57829,57830,57831,57832,57833,57834,57835,57836,57837,57838,57839,57840,57841,57842,57843,57844,57845,57846,57847,57848,57849,57850,57851,57852,57853,57854,57855,57856,57857,57858,57859,57860,57861,57862,57863,57864,57865,57866,57867,57868,57869,57870,57871,57872,57873,57874,57875,57876,57877,57878,57879,57880,57881,57882,57883,57884,57885,57886,57887,57888,57889,57890,57891,57892,57893,57894,57895,57896,57897,57898,57899,57900,57901,57902,57903,57904,57905,57906,57907,30277,30278,30279,30280,30281,30282,30283,30286,30287,30288,30289,30290,30291,30293,30295,30296,30297,30298,30299,30301,30303,30304,30305,30306,30308,30309,30310,30311,30312,30313,30314,30316,30317,30318,30320,30321,30322,30323,30324,30325,30326,30327,30329,30330,30332,30335,30336,30337,30339,30341,30345,30346,30348,30349,30351,30352,30354,30356,30357,30359,30360,30362,30363,30364,30365,30366,30367,30368,30369,30370,30371,30373,30374,30375,30376,30377,30378,30379,30380,30381,30383,30384,30387,30389,30390,30391,30392,30393,30394,30395,30396,30397,30398,30400,30401,30403,21834,38463,22467,25384,21710,21769,21696,30353,30284,34108,30702,33406,30861,29233,38552,38797,27688,23433,20474,25353,26263,23736,33018,26696,32942,26114,30414,20985,25942,29100,32753,34948,20658,22885,25034,28595,33453,25420,25170,21485,21543,31494,20843,30116,24052,25300,36299,38774,25226,32793,22365,38712,32610,29240,30333,26575,30334,25670,20336,36133,25308,31255,26001,29677,25644,25203,33324,39041,26495,29256,25198,25292,20276,29923,21322,21150,32458,37030,24110,26758,27036,33152,32465,26834,30917,34444,38225,20621,35876,33502,32990,21253,35090,21093,30404,30407,30409,30411,30412,30419,30421,30425,30426,30428,30429,30430,30432,30433,30434,30435,30436,30438,30439,30440,30441,30442,30443,30444,30445,30448,30451,30453,30454,30455,30458,30459,30461,30463,30464,30466,30467,30469,30470,30474,30476,30478,30479,30480,30481,30482,30483,30484,30485,30486,30487,30488,30491,30492,30493,30494,30497,30499,30500,30501,30503,30506,30507,30508,30510,30512,30513,30514,30515,30516,30521,30523,30525,30526,30527,30530,30532,30533,30534,30536,30537,30538,30539,30540,30541,30542,30543,30546,30547,30548,30549,30550,30551,30552,30553,30556,34180,38649,20445,22561,39281,23453,25265,25253,26292,35961,40077,29190,26479,30865,24754,21329,21271,36744,32972,36125,38049,20493,29384,22791,24811,28953,34987,22868,33519,26412,31528,23849,32503,29997,27893,36454,36856,36924,40763,27604,37145,31508,24444,30887,34006,34109,27605,27609,27606,24065,24199,30201,38381,25949,24330,24517,36767,22721,33218,36991,38491,38829,36793,32534,36140,25153,20415,21464,21342,36776,36777,36779,36941,26631,24426,33176,34920,40150,24971,21035,30250,24428,25996,28626,28392,23486,25672,20853,20912,26564,19993,31177,39292,28851,30557,30558,30559,30560,30564,30567,30569,30570,30573,30574,30575,30576,30577,30578,30579,30580,30581,30582,30583,30584,30586,30587,30588,30593,30594,30595,30598,30599,30600,30601,30602,30603,30607,30608,30611,30612,30613,30614,30615,30616,30617,30618,30619,30620,30621,30622,30625,30627,30628,30630,30632,30635,30637,30638,30639,30641,30642,30644,30646,30647,30648,30649,30650,30652,30654,30656,30657,30658,30659,30660,30661,30662,30663,30664,30665,30666,30667,30668,30670,30671,30672,30673,30674,30675,30676,30677,30678,30680,30681,30682,30685,30686,30687,30688,30689,30692,30149,24182,29627,33760,25773,25320,38069,27874,21338,21187,25615,38082,31636,20271,24091,33334,33046,33162,28196,27850,39539,25429,21340,21754,34917,22496,19981,24067,27493,31807,37096,24598,25830,29468,35009,26448,25165,36130,30572,36393,37319,24425,33756,34081,39184,21442,34453,27531,24813,24808,28799,33485,33329,20179,27815,34255,25805,31961,27133,26361,33609,21397,31574,20391,20876,27979,23618,36461,25554,21449,33580,33590,26597,30900,25661,23519,23700,24046,35815,25286,26612,35962,25600,25530,34633,39307,35863,32544,38130,20135,38416,39076,26124,29462,30694,30696,30698,30703,30704,30705,30706,30708,30709,30711,30713,30714,30715,30716,30723,30724,30725,30726,30727,30728,30730,30731,30734,30735,30736,30739,30741,30745,30747,30750,30752,30753,30754,30756,30760,30762,30763,30766,30767,30769,30770,30771,30773,30774,30781,30783,30785,30786,30787,30788,30790,30792,30793,30794,30795,30797,30799,30801,30803,30804,30808,30809,30810,30811,30812,30814,30815,30816,30817,30818,30819,30820,30821,30822,30823,30824,30825,30831,30832,30833,30834,30835,30836,30837,30838,30840,30841,30842,30843,30845,30846,30847,30848,30849,30850,30851,22330,23581,24120,38271,20607,32928,21378,25950,30021,21809,20513,36229,25220,38046,26397,22066,28526,24034,21557,28818,36710,25199,25764,25507,24443,28552,37108,33251,36784,23576,26216,24561,27785,38472,36225,34924,25745,31216,22478,27225,25104,21576,20056,31243,24809,28548,35802,25215,36894,39563,31204,21507,30196,25345,21273,27744,36831,24347,39536,32827,40831,20360,23610,36196,32709,26021,28861,20805,20914,34411,23815,23456,25277,37228,30068,36364,31264,24833,31609,20167,32504,30597,19985,33261,21021,20986,27249,21416,36487,38148,38607,28353,38500,26970,30852,30853,30854,30856,30858,30859,30863,30864,30866,30868,30869,30870,30873,30877,30878,30880,30882,30884,30886,30888,30889,30890,30891,30892,30893,30894,30895,30901,30902,30903,30904,30906,30907,30908,30909,30911,30912,30914,30915,30916,30918,30919,30920,30924,30925,30926,30927,30929,30930,30931,30934,30935,30936,30938,30939,30940,30941,30942,30943,30944,30945,30946,30947,30948,30949,30950,30951,30953,30954,30955,30957,30958,30959,30960,30961,30963,30965,30966,30968,30969,30971,30972,30973,30974,30975,30976,30978,30979,30980,30982,30983,30984,30985,30986,30987,30988,30784,20648,30679,25616,35302,22788,25571,24029,31359,26941,20256,33337,21912,20018,30126,31383,24162,24202,38383,21019,21561,28810,25462,38180,22402,26149,26943,37255,21767,28147,32431,34850,25139,32496,30133,33576,30913,38604,36766,24904,29943,35789,27492,21050,36176,27425,32874,33905,22257,21254,20174,19995,20945,31895,37259,31751,20419,36479,31713,31388,25703,23828,20652,33030,30209,31929,28140,32736,26449,23384,23544,30923,25774,25619,25514,25387,38169,25645,36798,31572,30249,25171,22823,21574,27513,20643,25140,24102,27526,20195,36151,34955,24453,36910,30989,30990,30991,30992,30993,30994,30996,30997,30998,30999,31000,31001,31002,31003,31004,31005,31007,31008,31009,31010,31011,31013,31014,31015,31016,31017,31018,31019,31020,31021,31022,31023,31024,31025,31026,31027,31029,31030,31031,31032,31033,31037,31039,31042,31043,31044,31045,31047,31050,31051,31052,31053,31054,31055,31056,31057,31058,31060,31061,31064,31065,31073,31075,31076,31078,31081,31082,31083,31084,31086,31088,31089,31090,31091,31092,31093,31094,31097,31099,31100,31101,31102,31103,31106,31107,31110,31111,31112,31113,31115,31116,31117,31118,31120,31121,31122,24608,32829,25285,20025,21333,37112,25528,32966,26086,27694,20294,24814,28129,35806,24377,34507,24403,25377,20826,33633,26723,20992,25443,36424,20498,23707,31095,23548,21040,31291,24764,36947,30423,24503,24471,30340,36460,28783,30331,31561,30634,20979,37011,22564,20302,28404,36842,25932,31515,29380,28068,32735,23265,25269,24213,22320,33922,31532,24093,24351,36882,32532,39072,25474,28359,30872,28857,20856,38747,22443,30005,20291,30008,24215,24806,22880,28096,27583,30857,21500,38613,20939,20993,25481,21514,38035,35843,36300,29241,30879,34678,36845,35853,21472,31123,31124,31125,31126,31127,31128,31129,31131,31132,31133,31134,31135,31136,31137,31138,31139,31140,31141,31142,31144,31145,31146,31147,31148,31149,31150,31151,31152,31153,31154,31156,31157,31158,31159,31160,31164,31167,31170,31172,31173,31175,31176,31178,31180,31182,31183,31184,31187,31188,31190,31191,31193,31194,31195,31196,31197,31198,31200,31201,31202,31205,31208,31210,31212,31214,31217,31218,31219,31220,31221,31222,31223,31225,31226,31228,31230,31231,31233,31236,31237,31239,31240,31241,31242,31244,31247,31248,31249,31250,31251,31253,31254,31256,31257,31259,31260,19969,30447,21486,38025,39030,40718,38189,23450,35746,20002,19996,20908,33891,25026,21160,26635,20375,24683,20923,27934,20828,25238,26007,38497,35910,36887,30168,37117,30563,27602,29322,29420,35835,22581,30585,36172,26460,38208,32922,24230,28193,22930,31471,30701,38203,27573,26029,32526,22534,20817,38431,23545,22697,21544,36466,25958,39039,22244,38045,30462,36929,25479,21702,22810,22842,22427,36530,26421,36346,33333,21057,24816,22549,34558,23784,40517,20420,39069,35769,23077,24694,21380,25212,36943,37122,39295,24681,32780,20799,32819,23572,39285,27953,20108,31261,31263,31265,31266,31268,31269,31270,31271,31272,31273,31274,31275,31276,31277,31278,31279,31280,31281,31282,31284,31285,31286,31288,31290,31294,31296,31297,31298,31299,31300,31301,31303,31304,31305,31306,31307,31308,31309,31310,31311,31312,31314,31315,31316,31317,31318,31320,31321,31322,31323,31324,31325,31326,31327,31328,31329,31330,31331,31332,31333,31334,31335,31336,31337,31338,31339,31340,31341,31342,31343,31345,31346,31347,31349,31355,31356,31357,31358,31362,31365,31367,31369,31370,31371,31372,31374,31375,31376,31379,31380,31385,31386,31387,31390,31393,31394,36144,21457,32602,31567,20240,20047,38400,27861,29648,34281,24070,30058,32763,27146,30718,38034,32321,20961,28902,21453,36820,33539,36137,29359,39277,27867,22346,33459,26041,32938,25151,38450,22952,20223,35775,32442,25918,33778,38750,21857,39134,32933,21290,35837,21536,32954,24223,27832,36153,33452,37210,21545,27675,20998,32439,22367,28954,27774,31881,22859,20221,24575,24868,31914,20016,23553,26539,34562,23792,38155,39118,30127,28925,36898,20911,32541,35773,22857,20964,20315,21542,22827,25975,32932,23413,25206,25282,36752,24133,27679,31526,20239,20440,26381,31395,31396,31399,31401,31402,31403,31406,31407,31408,31409,31410,31412,31413,31414,31415,31416,31417,31418,31419,31420,31421,31422,31424,31425,31426,31427,31428,31429,31430,31431,31432,31433,31434,31436,31437,31438,31439,31440,31441,31442,31443,31444,31445,31447,31448,31450,31451,31452,31453,31457,31458,31460,31463,31464,31465,31466,31467,31468,31470,31472,31473,31474,31475,31476,31477,31478,31479,31480,31483,31484,31486,31488,31489,31490,31493,31495,31497,31500,31501,31502,31504,31506,31507,31510,31511,31512,31514,31516,31517,31519,31521,31522,31523,31527,31529,31533,28014,28074,31119,34993,24343,29995,25242,36741,20463,37340,26023,33071,33105,24220,33104,36212,21103,35206,36171,22797,20613,20184,38428,29238,33145,36127,23500,35747,38468,22919,32538,21648,22134,22030,35813,25913,27010,38041,30422,28297,24178,29976,26438,26577,31487,32925,36214,24863,31174,25954,36195,20872,21018,38050,32568,32923,32434,23703,28207,26464,31705,30347,39640,33167,32660,31957,25630,38224,31295,21578,21733,27468,25601,25096,40509,33011,30105,21106,38761,33883,26684,34532,38401,38548,38124,20010,21508,32473,26681,36319,32789,26356,24218,32697,31535,31536,31538,31540,31541,31542,31543,31545,31547,31549,31551,31552,31553,31554,31555,31556,31558,31560,31562,31565,31566,31571,31573,31575,31577,31580,31582,31583,31585,31587,31588,31589,31590,31591,31592,31593,31594,31595,31596,31597,31599,31600,31603,31604,31606,31608,31610,31612,31613,31615,31617,31618,31619,31620,31622,31623,31624,31625,31626,31627,31628,31630,31631,31633,31634,31635,31638,31640,31641,31642,31643,31646,31647,31648,31651,31652,31653,31662,31663,31664,31666,31667,31669,31670,31671,31673,31674,31675,31676,31677,31678,31679,31680,31682,31683,31684,22466,32831,26775,24037,25915,21151,24685,40858,20379,36524,20844,23467,24339,24041,27742,25329,36129,20849,38057,21246,27807,33503,29399,22434,26500,36141,22815,36764,33735,21653,31629,20272,27837,23396,22993,40723,21476,34506,39592,35895,32929,25925,39038,22266,38599,21038,29916,21072,23521,25346,35074,20054,25296,24618,26874,20851,23448,20896,35266,31649,39302,32592,24815,28748,36143,20809,24191,36891,29808,35268,22317,30789,24402,40863,38394,36712,39740,35809,30328,26690,26588,36330,36149,21053,36746,28378,26829,38149,37101,22269,26524,35065,36807,21704,31685,31688,31689,31690,31691,31693,31694,31695,31696,31698,31700,31701,31702,31703,31704,31707,31708,31710,31711,31712,31714,31715,31716,31719,31720,31721,31723,31724,31725,31727,31728,31730,31731,31732,31733,31734,31736,31737,31738,31739,31741,31743,31744,31745,31746,31747,31748,31749,31750,31752,31753,31754,31757,31758,31760,31761,31762,31763,31764,31765,31767,31768,31769,31770,31771,31772,31773,31774,31776,31777,31778,31779,31780,31781,31784,31785,31787,31788,31789,31790,31791,31792,31793,31794,31795,31796,31797,31798,31799,31801,31802,31803,31804,31805,31806,31810,39608,23401,28023,27686,20133,23475,39559,37219,25000,37039,38889,21547,28085,23506,20989,21898,32597,32752,25788,25421,26097,25022,24717,28938,27735,27721,22831,26477,33322,22741,22158,35946,27627,37085,22909,32791,21495,28009,21621,21917,33655,33743,26680,31166,21644,20309,21512,30418,35977,38402,27827,28088,36203,35088,40548,36154,22079,40657,30165,24456,29408,24680,21756,20136,27178,34913,24658,36720,21700,28888,34425,40511,27946,23439,24344,32418,21897,20399,29492,21564,21402,20505,21518,21628,20046,24573,29786,22774,33899,32993,34676,29392,31946,28246,31811,31812,31813,31814,31815,31816,31817,31818,31819,31820,31822,31823,31824,31825,31826,31827,31828,31829,31830,31831,31832,31833,31834,31835,31836,31837,31838,31839,31840,31841,31842,31843,31844,31845,31846,31847,31848,31849,31850,31851,31852,31853,31854,31855,31856,31857,31858,31861,31862,31863,31864,31865,31866,31870,31871,31872,31873,31874,31875,31876,31877,31878,31879,31880,31882,31883,31884,31885,31886,31887,31888,31891,31892,31894,31897,31898,31899,31904,31905,31907,31910,31911,31912,31913,31915,31916,31917,31919,31920,31924,31925,31926,31927,31928,31930,31931,24359,34382,21804,25252,20114,27818,25143,33457,21719,21326,29502,28369,30011,21010,21270,35805,27088,24458,24576,28142,22351,27426,29615,26707,36824,32531,25442,24739,21796,30186,35938,28949,28067,23462,24187,33618,24908,40644,30970,34647,31783,30343,20976,24822,29004,26179,24140,24653,35854,28784,25381,36745,24509,24674,34516,22238,27585,24724,24935,21321,24800,26214,36159,31229,20250,28905,27719,35763,35826,32472,33636,26127,23130,39746,27985,28151,35905,27963,20249,28779,33719,25110,24785,38669,36135,31096,20987,22334,22522,26426,30072,31293,31215,31637,31935,31936,31938,31939,31940,31942,31945,31947,31950,31951,31952,31953,31954,31955,31956,31960,31962,31963,31965,31966,31969,31970,31971,31972,31973,31974,31975,31977,31978,31979,31980,31981,31982,31984,31985,31986,31987,31988,31989,31990,31991,31993,31994,31996,31997,31998,31999,32000,32001,32002,32003,32004,32005,32006,32007,32008,32009,32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32033,32035,32036,32037,32038,32040,32041,32042,32044,32045,32046,32048,32049,32050,32051,32052,32053,32054,32908,39269,36857,28608,35749,40481,23020,32489,32521,21513,26497,26840,36753,31821,38598,21450,24613,30142,27762,21363,23241,32423,25380,20960,33034,24049,34015,25216,20864,23395,20238,31085,21058,24760,27982,23492,23490,35745,35760,26082,24524,38469,22931,32487,32426,22025,26551,22841,20339,23478,21152,33626,39050,36158,30002,38078,20551,31292,20215,26550,39550,23233,27516,30417,22362,23574,31546,38388,29006,20860,32937,33392,22904,32516,33575,26816,26604,30897,30839,25315,25441,31616,20461,21098,20943,33616,27099,37492,36341,36145,35265,38190,31661,20214,32055,32056,32057,32058,32059,32060,32061,32062,32063,32064,32065,32066,32067,32068,32069,32070,32071,32072,32073,32074,32075,32076,32077,32078,32079,32080,32081,32082,32083,32084,32085,32086,32087,32088,32089,32090,32091,32092,32093,32094,32095,32096,32097,32098,32099,32100,32101,32102,32103,32104,32105,32106,32107,32108,32109,32111,32112,32113,32114,32115,32116,32117,32118,32120,32121,32122,32123,32124,32125,32126,32127,32128,32129,32130,32131,32132,32133,32134,32135,32136,32137,32138,32139,32140,32141,32142,32143,32144,32145,32146,32147,32148,32149,32150,32151,32152,20581,33328,21073,39279,28176,28293,28071,24314,20725,23004,23558,27974,27743,30086,33931,26728,22870,35762,21280,37233,38477,34121,26898,30977,28966,33014,20132,37066,27975,39556,23047,22204,25605,38128,30699,20389,33050,29409,35282,39290,32564,32478,21119,25945,37237,36735,36739,21483,31382,25581,25509,30342,31224,34903,38454,25130,21163,33410,26708,26480,25463,30571,31469,27905,32467,35299,22992,25106,34249,33445,30028,20511,20171,30117,35819,23626,24062,31563,26020,37329,20170,27941,35167,32039,38182,20165,35880,36827,38771,26187,31105,36817,28908,28024,32153,32154,32155,32156,32157,32158,32159,32160,32161,32162,32163,32164,32165,32167,32168,32169,32170,32171,32172,32173,32175,32176,32177,32178,32179,32180,32181,32182,32183,32184,32185,32186,32187,32188,32189,32190,32191,32192,32193,32194,32195,32196,32197,32198,32199,32200,32201,32202,32203,32204,32205,32206,32207,32208,32209,32210,32211,32212,32213,32214,32215,32216,32217,32218,32219,32220,32221,32222,32223,32224,32225,32226,32227,32228,32229,32230,32231,32232,32233,32234,32235,32236,32237,32238,32239,32240,32241,32242,32243,32244,32245,32246,32247,32248,32249,32250,23613,21170,33606,20834,33550,30555,26230,40120,20140,24778,31934,31923,32463,20117,35686,26223,39048,38745,22659,25964,38236,24452,30153,38742,31455,31454,20928,28847,31384,25578,31350,32416,29590,38893,20037,28792,20061,37202,21417,25937,26087,33276,33285,21646,23601,30106,38816,25304,29401,30141,23621,39545,33738,23616,21632,30697,20030,27822,32858,25298,25454,24040,20855,36317,36382,38191,20465,21477,24807,28844,21095,25424,40515,23071,20518,30519,21367,32482,25733,25899,25225,25496,20500,29237,35273,20915,35776,32477,22343,33740,38055,20891,21531,23803,32251,32252,32253,32254,32255,32256,32257,32258,32259,32260,32261,32262,32263,32264,32265,32266,32267,32268,32269,32270,32271,32272,32273,32274,32275,32276,32277,32278,32279,32280,32281,32282,32283,32284,32285,32286,32287,32288,32289,32290,32291,32292,32293,32294,32295,32296,32297,32298,32299,32300,32301,32302,32303,32304,32305,32306,32307,32308,32309,32310,32311,32312,32313,32314,32316,32317,32318,32319,32320,32322,32323,32324,32325,32326,32328,32329,32330,32331,32332,32333,32334,32335,32336,32337,32338,32339,32340,32341,32342,32343,32344,32345,32346,32347,32348,32349,20426,31459,27994,37089,39567,21888,21654,21345,21679,24320,25577,26999,20975,24936,21002,22570,21208,22350,30733,30475,24247,24951,31968,25179,25239,20130,28821,32771,25335,28900,38752,22391,33499,26607,26869,30933,39063,31185,22771,21683,21487,28212,20811,21051,23458,35838,32943,21827,22438,24691,22353,21549,31354,24656,23380,25511,25248,21475,25187,23495,26543,21741,31391,33510,37239,24211,35044,22840,22446,25358,36328,33007,22359,31607,20393,24555,23485,27454,21281,31568,29378,26694,30719,30518,26103,20917,20111,30420,23743,31397,33909,22862,39745,20608,32350,32351,32352,32353,32354,32355,32356,32357,32358,32359,32360,32361,32362,32363,32364,32365,32366,32367,32368,32369,32370,32371,32372,32373,32374,32375,32376,32377,32378,32379,32380,32381,32382,32383,32384,32385,32387,32388,32389,32390,32391,32392,32393,32394,32395,32396,32397,32398,32399,32400,32401,32402,32403,32404,32405,32406,32407,32408,32409,32410,32412,32413,32414,32430,32436,32443,32444,32470,32484,32492,32505,32522,32528,32542,32567,32569,32571,32572,32573,32574,32575,32576,32577,32579,32582,32583,32584,32585,32586,32587,32588,32589,32590,32591,32594,32595,39304,24871,28291,22372,26118,25414,22256,25324,25193,24275,38420,22403,25289,21895,34593,33098,36771,21862,33713,26469,36182,34013,23146,26639,25318,31726,38417,20848,28572,35888,25597,35272,25042,32518,28866,28389,29701,27028,29436,24266,37070,26391,28010,25438,21171,29282,32769,20332,23013,37226,28889,28061,21202,20048,38647,38253,34174,30922,32047,20769,22418,25794,32907,31867,27882,26865,26974,20919,21400,26792,29313,40654,31729,29432,31163,28435,29702,26446,37324,40100,31036,33673,33620,21519,26647,20029,21385,21169,30782,21382,21033,20616,20363,20432,32598,32601,32603,32604,32605,32606,32608,32611,32612,32613,32614,32615,32619,32620,32621,32623,32624,32627,32629,32630,32631,32632,32634,32635,32636,32637,32639,32640,32642,32643,32644,32645,32646,32647,32648,32649,32651,32653,32655,32656,32657,32658,32659,32661,32662,32663,32664,32665,32667,32668,32672,32674,32675,32677,32678,32680,32681,32682,32683,32684,32685,32686,32689,32691,32692,32693,32694,32695,32698,32699,32702,32704,32706,32707,32708,32710,32711,32712,32713,32715,32717,32719,32720,32721,32722,32723,32726,32727,32729,32730,32731,32732,32733,32734,32738,32739,30178,31435,31890,27813,38582,21147,29827,21737,20457,32852,33714,36830,38256,24265,24604,28063,24088,25947,33080,38142,24651,28860,32451,31918,20937,26753,31921,33391,20004,36742,37327,26238,20142,35845,25769,32842,20698,30103,29134,23525,36797,28518,20102,25730,38243,24278,26009,21015,35010,28872,21155,29454,29747,26519,30967,38678,20020,37051,40158,28107,20955,36161,21533,25294,29618,33777,38646,40836,38083,20278,32666,20940,28789,38517,23725,39046,21478,20196,28316,29705,27060,30827,39311,30041,21016,30244,27969,26611,20845,40857,32843,21657,31548,31423,32740,32743,32744,32746,32747,32748,32749,32751,32754,32756,32757,32758,32759,32760,32761,32762,32765,32766,32767,32770,32775,32776,32777,32778,32782,32783,32785,32787,32794,32795,32797,32798,32799,32801,32803,32804,32811,32812,32813,32814,32815,32816,32818,32820,32825,32826,32828,32830,32832,32833,32836,32837,32839,32840,32841,32846,32847,32848,32849,32851,32853,32854,32855,32857,32859,32860,32861,32862,32863,32864,32865,32866,32867,32868,32869,32870,32871,32872,32875,32876,32877,32878,32879,32880,32882,32883,32884,32885,32886,32887,32888,32889,32890,32891,32892,32893,38534,22404,25314,38471,27004,23044,25602,31699,28431,38475,33446,21346,39045,24208,28809,25523,21348,34383,40065,40595,30860,38706,36335,36162,40575,28510,31108,24405,38470,25134,39540,21525,38109,20387,26053,23653,23649,32533,34385,27695,24459,29575,28388,32511,23782,25371,23402,28390,21365,20081,25504,30053,25249,36718,20262,20177,27814,32438,35770,33821,34746,32599,36923,38179,31657,39585,35064,33853,27931,39558,32476,22920,40635,29595,30721,34434,39532,39554,22043,21527,22475,20080,40614,21334,36808,33033,30610,39314,34542,28385,34067,26364,24930,28459,32894,32897,32898,32901,32904,32906,32909,32910,32911,32912,32913,32914,32916,32917,32919,32921,32926,32931,32934,32935,32936,32940,32944,32947,32949,32950,32952,32953,32955,32965,32967,32968,32969,32970,32971,32975,32976,32977,32978,32979,32980,32981,32984,32991,32992,32994,32995,32998,33006,33013,33015,33017,33019,33022,33023,33024,33025,33027,33028,33029,33031,33032,33035,33036,33045,33047,33049,33051,33052,33053,33055,33056,33057,33058,33059,33060,33061,33062,33063,33064,33065,33066,33067,33069,33070,33072,33075,33076,33077,33079,33081,33082,33083,33084,33085,33087,35881,33426,33579,30450,27667,24537,33725,29483,33541,38170,27611,30683,38086,21359,33538,20882,24125,35980,36152,20040,29611,26522,26757,37238,38665,29028,27809,30473,23186,38209,27599,32654,26151,23504,22969,23194,38376,38391,20204,33804,33945,27308,30431,38192,29467,26790,23391,30511,37274,38753,31964,36855,35868,24357,31859,31192,35269,27852,34588,23494,24130,26825,30496,32501,20885,20813,21193,23081,32517,38754,33495,25551,30596,34256,31186,28218,24217,22937,34065,28781,27665,25279,30399,25935,24751,38397,26126,34719,40483,38125,21517,21629,35884,25720,33088,33089,33090,33091,33092,33093,33095,33097,33101,33102,33103,33106,33110,33111,33112,33115,33116,33117,33118,33119,33121,33122,33123,33124,33126,33128,33130,33131,33132,33135,33138,33139,33141,33142,33143,33144,33153,33155,33156,33157,33158,33159,33161,33163,33164,33165,33166,33168,33170,33171,33172,33173,33174,33175,33177,33178,33182,33183,33184,33185,33186,33188,33189,33191,33193,33195,33196,33197,33198,33199,33200,33201,33202,33204,33205,33206,33207,33208,33209,33212,33213,33214,33215,33220,33221,33223,33224,33225,33227,33229,33230,33231,33232,33233,33234,33235,25721,34321,27169,33180,30952,25705,39764,25273,26411,33707,22696,40664,27819,28448,23518,38476,35851,29279,26576,25287,29281,20137,22982,27597,22675,26286,24149,21215,24917,26408,30446,30566,29287,31302,25343,21738,21584,38048,37027,23068,32435,27670,20035,22902,32784,22856,21335,30007,38590,22218,25376,33041,24700,38393,28118,21602,39297,20869,23273,33021,22958,38675,20522,27877,23612,25311,20320,21311,33147,36870,28346,34091,25288,24180,30910,25781,25467,24565,23064,37247,40479,23615,25423,32834,23421,21870,38218,38221,28037,24744,26592,29406,20957,23425,33236,33237,33238,33239,33240,33241,33242,33243,33244,33245,33246,33247,33248,33249,33250,33252,33253,33254,33256,33257,33259,33262,33263,33264,33265,33266,33269,33270,33271,33272,33273,33274,33277,33279,33283,33287,33288,33289,33290,33291,33294,33295,33297,33299,33301,33302,33303,33304,33305,33306,33309,33312,33316,33317,33318,33319,33321,33326,33330,33338,33340,33341,33343,33344,33345,33346,33347,33349,33350,33352,33354,33356,33357,33358,33360,33361,33362,33363,33364,33365,33366,33367,33369,33371,33372,33373,33374,33376,33377,33378,33379,33380,33381,33382,33383,33385,25319,27870,29275,25197,38062,32445,33043,27987,20892,24324,22900,21162,24594,22899,26262,34384,30111,25386,25062,31983,35834,21734,27431,40485,27572,34261,21589,20598,27812,21866,36276,29228,24085,24597,29750,25293,25490,29260,24472,28227,27966,25856,28504,30424,30928,30460,30036,21028,21467,20051,24222,26049,32810,32982,25243,21638,21032,28846,34957,36305,27873,21624,32986,22521,35060,36180,38506,37197,20329,27803,21943,30406,30768,25256,28921,28558,24429,34028,26842,30844,31735,33192,26379,40527,25447,30896,22383,30738,38713,25209,25259,21128,29749,27607,33386,33387,33388,33389,33393,33397,33398,33399,33400,33403,33404,33408,33409,33411,33413,33414,33415,33417,33420,33424,33427,33428,33429,33430,33434,33435,33438,33440,33442,33443,33447,33458,33461,33462,33466,33467,33468,33471,33472,33474,33475,33477,33478,33481,33488,33494,33497,33498,33501,33506,33511,33512,33513,33514,33516,33517,33518,33520,33522,33523,33525,33526,33528,33530,33532,33533,33534,33535,33536,33546,33547,33549,33552,33554,33555,33558,33560,33561,33565,33566,33567,33568,33569,33570,33571,33572,33573,33574,33577,33578,33582,33584,33586,33591,33595,33597,21860,33086,30130,30382,21305,30174,20731,23617,35692,31687,20559,29255,39575,39128,28418,29922,31080,25735,30629,25340,39057,36139,21697,32856,20050,22378,33529,33805,24179,20973,29942,35780,23631,22369,27900,39047,23110,30772,39748,36843,31893,21078,25169,38138,20166,33670,33889,33769,33970,22484,26420,22275,26222,28006,35889,26333,28689,26399,27450,26646,25114,22971,19971,20932,28422,26578,27791,20854,26827,22855,27495,30054,23822,33040,40784,26071,31048,31041,39569,36215,23682,20062,20225,21551,22865,30732,22120,27668,36804,24323,27773,27875,35755,25488,33598,33599,33601,33602,33604,33605,33608,33610,33611,33612,33613,33614,33619,33621,33622,33623,33624,33625,33629,33634,33648,33649,33650,33651,33652,33653,33654,33657,33658,33662,33663,33664,33665,33666,33667,33668,33671,33672,33674,33675,33676,33677,33679,33680,33681,33684,33685,33686,33687,33689,33690,33693,33695,33697,33698,33699,33700,33701,33702,33703,33708,33709,33710,33711,33717,33723,33726,33727,33730,33731,33732,33734,33736,33737,33739,33741,33742,33744,33745,33746,33747,33749,33751,33753,33754,33755,33758,33762,33763,33764,33766,33767,33768,33771,33772,33773,24688,27965,29301,25190,38030,38085,21315,36801,31614,20191,35878,20094,40660,38065,38067,21069,28508,36963,27973,35892,22545,23884,27424,27465,26538,21595,33108,32652,22681,34103,24378,25250,27207,38201,25970,24708,26725,30631,20052,20392,24039,38808,25772,32728,23789,20431,31373,20999,33540,19988,24623,31363,38054,20405,20146,31206,29748,21220,33465,25810,31165,23517,27777,38738,36731,27682,20542,21375,28165,25806,26228,27696,24773,39031,35831,24198,29756,31351,31179,19992,37041,29699,27714,22234,37195,27845,36235,21306,34502,26354,36527,23624,39537,28192,33774,33775,33779,33780,33781,33782,33783,33786,33787,33788,33790,33791,33792,33794,33797,33799,33800,33801,33802,33808,33810,33811,33812,33813,33814,33815,33817,33818,33819,33822,33823,33824,33825,33826,33827,33833,33834,33835,33836,33837,33838,33839,33840,33842,33843,33844,33845,33846,33847,33849,33850,33851,33854,33855,33856,33857,33858,33859,33860,33861,33863,33864,33865,33866,33867,33868,33869,33870,33871,33872,33874,33875,33876,33877,33878,33880,33885,33886,33887,33888,33890,33892,33893,33894,33895,33896,33898,33902,33903,33904,33906,33908,33911,33913,33915,33916,21462,23094,40843,36259,21435,22280,39079,26435,37275,27849,20840,30154,25331,29356,21048,21149,32570,28820,30264,21364,40522,27063,30830,38592,35033,32676,28982,29123,20873,26579,29924,22756,25880,22199,35753,39286,25200,32469,24825,28909,22764,20161,20154,24525,38887,20219,35748,20995,22922,32427,25172,20173,26085,25102,33592,33993,33635,34701,29076,28342,23481,32466,20887,25545,26580,32905,33593,34837,20754,23418,22914,36785,20083,27741,20837,35109,36719,38446,34122,29790,38160,38384,28070,33509,24369,25746,27922,33832,33134,40131,22622,36187,19977,21441,33917,33918,33919,33920,33921,33923,33924,33925,33926,33930,33933,33935,33936,33937,33938,33939,33940,33941,33942,33944,33946,33947,33949,33950,33951,33952,33954,33955,33956,33957,33958,33959,33960,33961,33962,33963,33964,33965,33966,33968,33969,33971,33973,33974,33975,33979,33980,33982,33984,33986,33987,33989,33990,33991,33992,33995,33996,33998,33999,34002,34004,34005,34007,34008,34009,34010,34011,34012,34014,34017,34018,34020,34023,34024,34025,34026,34027,34029,34030,34031,34033,34034,34035,34036,34037,34038,34039,34040,34041,34042,34043,34045,34046,34048,34049,34050,20254,25955,26705,21971,20007,25620,39578,25195,23234,29791,33394,28073,26862,20711,33678,30722,26432,21049,27801,32433,20667,21861,29022,31579,26194,29642,33515,26441,23665,21024,29053,34923,38378,38485,25797,36193,33203,21892,27733,25159,32558,22674,20260,21830,36175,26188,19978,23578,35059,26786,25422,31245,28903,33421,21242,38902,23569,21736,37045,32461,22882,36170,34503,33292,33293,36198,25668,23556,24913,28041,31038,35774,30775,30003,21627,20280,36523,28145,23072,32453,31070,27784,23457,23158,29978,32958,24910,28183,22768,29983,29989,29298,21319,32499,34051,34052,34053,34054,34055,34056,34057,34058,34059,34061,34062,34063,34064,34066,34068,34069,34070,34072,34073,34075,34076,34077,34078,34080,34082,34083,34084,34085,34086,34087,34088,34089,34090,34093,34094,34095,34096,34097,34098,34099,34100,34101,34102,34110,34111,34112,34113,34114,34116,34117,34118,34119,34123,34124,34125,34126,34127,34128,34129,34130,34131,34132,34133,34135,34136,34138,34139,34140,34141,34143,34144,34145,34146,34147,34149,34150,34151,34153,34154,34155,34156,34157,34158,34159,34160,34161,34163,34165,34166,34167,34168,34172,34173,34175,34176,34177,30465,30427,21097,32988,22307,24072,22833,29422,26045,28287,35799,23608,34417,21313,30707,25342,26102,20160,39135,34432,23454,35782,21490,30690,20351,23630,39542,22987,24335,31034,22763,19990,26623,20107,25325,35475,36893,21183,26159,21980,22124,36866,20181,20365,37322,39280,27663,24066,24643,23460,35270,35797,25910,25163,39318,23432,23551,25480,21806,21463,30246,20861,34092,26530,26803,27530,25234,36755,21460,33298,28113,30095,20070,36174,23408,29087,34223,26257,26329,32626,34560,40653,40736,23646,26415,36848,26641,26463,25101,31446,22661,24246,25968,28465,34178,34179,34182,34184,34185,34186,34187,34188,34189,34190,34192,34193,34194,34195,34196,34197,34198,34199,34200,34201,34202,34205,34206,34207,34208,34209,34210,34211,34213,34214,34215,34217,34219,34220,34221,34225,34226,34227,34228,34229,34230,34232,34234,34235,34236,34237,34238,34239,34240,34242,34243,34244,34245,34246,34247,34248,34250,34251,34252,34253,34254,34257,34258,34260,34262,34263,34264,34265,34266,34267,34269,34270,34271,34272,34273,34274,34275,34277,34278,34279,34280,34282,34283,34284,34285,34286,34287,34288,34289,34290,34291,34292,34293,34294,34295,34296,24661,21047,32781,25684,34928,29993,24069,26643,25332,38684,21452,29245,35841,27700,30561,31246,21550,30636,39034,33308,35828,30805,26388,28865,26031,25749,22070,24605,31169,21496,19997,27515,32902,23546,21987,22235,20282,20284,39282,24051,26494,32824,24578,39042,36865,23435,35772,35829,25628,33368,25822,22013,33487,37221,20439,32032,36895,31903,20723,22609,28335,23487,35785,32899,37240,33948,31639,34429,38539,38543,32485,39635,30862,23681,31319,36930,38567,31071,23385,25439,31499,34001,26797,21766,32553,29712,32034,38145,25152,22604,20182,23427,22905,22612,34297,34298,34300,34301,34302,34304,34305,34306,34307,34308,34310,34311,34312,34313,34314,34315,34316,34317,34318,34319,34320,34322,34323,34324,34325,34327,34328,34329,34330,34331,34332,34333,34334,34335,34336,34337,34338,34339,34340,34341,34342,34344,34346,34347,34348,34349,34350,34351,34352,34353,34354,34355,34356,34357,34358,34359,34361,34362,34363,34365,34366,34367,34368,34369,34370,34371,34372,34373,34374,34375,34376,34377,34378,34379,34380,34386,34387,34389,34390,34391,34392,34393,34395,34396,34397,34399,34400,34401,34403,34404,34405,34406,34407,34408,34409,34410,29549,25374,36427,36367,32974,33492,25260,21488,27888,37214,22826,24577,27760,22349,25674,36138,30251,28393,22363,27264,30192,28525,35885,35848,22374,27631,34962,30899,25506,21497,28845,27748,22616,25642,22530,26848,33179,21776,31958,20504,36538,28108,36255,28907,25487,28059,28372,32486,33796,26691,36867,28120,38518,35752,22871,29305,34276,33150,30140,35466,26799,21076,36386,38161,25552,39064,36420,21884,20307,26367,22159,24789,28053,21059,23625,22825,28155,22635,30000,29980,24684,33300,33094,25361,26465,36834,30522,36339,36148,38081,24086,21381,21548,28867,34413,34415,34416,34418,34419,34420,34421,34422,34423,34424,34435,34436,34437,34438,34439,34440,34441,34446,34447,34448,34449,34450,34452,34454,34455,34456,34457,34458,34459,34462,34463,34464,34465,34466,34469,34470,34475,34477,34478,34482,34483,34487,34488,34489,34491,34492,34493,34494,34495,34497,34498,34499,34501,34504,34508,34509,34514,34515,34517,34518,34519,34522,34524,34525,34528,34529,34530,34531,34533,34534,34535,34536,34538,34539,34540,34543,34549,34550,34551,34554,34555,34556,34557,34559,34561,34564,34565,34566,34571,34572,34574,34575,34576,34577,34580,34582,27712,24311,20572,20141,24237,25402,33351,36890,26704,37230,30643,21516,38108,24420,31461,26742,25413,31570,32479,30171,20599,25237,22836,36879,20984,31171,31361,22270,24466,36884,28034,23648,22303,21520,20820,28237,22242,25512,39059,33151,34581,35114,36864,21534,23663,33216,25302,25176,33073,40501,38464,39534,39548,26925,22949,25299,21822,25366,21703,34521,27964,23043,29926,34972,27498,22806,35916,24367,28286,29609,39037,20024,28919,23436,30871,25405,26202,30358,24779,23451,23113,19975,33109,27754,29579,20129,26505,32593,24448,26106,26395,24536,22916,23041,34585,34587,34589,34591,34592,34596,34598,34599,34600,34602,34603,34604,34605,34607,34608,34610,34611,34613,34614,34616,34617,34618,34620,34621,34624,34625,34626,34627,34628,34629,34630,34634,34635,34637,34639,34640,34641,34642,34644,34645,34646,34648,34650,34651,34652,34653,34654,34655,34657,34658,34662,34663,34664,34665,34666,34667,34668,34669,34671,34673,34674,34675,34677,34679,34680,34681,34682,34687,34688,34689,34692,34694,34695,34697,34698,34700,34702,34703,34704,34705,34706,34708,34709,34710,34712,34713,34714,34715,34716,34717,34718,34720,34721,34722,34723,34724,24013,24494,21361,38886,36829,26693,22260,21807,24799,20026,28493,32500,33479,33806,22996,20255,20266,23614,32428,26410,34074,21619,30031,32963,21890,39759,20301,28205,35859,23561,24944,21355,30239,28201,34442,25991,38395,32441,21563,31283,32010,38382,21985,32705,29934,25373,34583,28065,31389,25105,26017,21351,25569,27779,24043,21596,38056,20044,27745,35820,23627,26080,33436,26791,21566,21556,27595,27494,20116,25410,21320,33310,20237,20398,22366,25098,38654,26212,29289,21247,21153,24735,35823,26132,29081,26512,35199,30802,30717,26224,22075,21560,38177,29306,34725,34726,34727,34729,34730,34734,34736,34737,34738,34740,34742,34743,34744,34745,34747,34748,34750,34751,34753,34754,34755,34756,34757,34759,34760,34761,34764,34765,34766,34767,34768,34772,34773,34774,34775,34776,34777,34778,34780,34781,34782,34783,34785,34786,34787,34788,34790,34791,34792,34793,34795,34796,34797,34799,34800,34801,34802,34803,34804,34805,34806,34807,34808,34810,34811,34812,34813,34815,34816,34817,34818,34820,34821,34822,34823,34824,34825,34827,34828,34829,34830,34831,34832,34833,34834,34836,34839,34840,34841,34842,34844,34845,34846,34847,34848,34851,31232,24687,24076,24713,33181,22805,24796,29060,28911,28330,27728,29312,27268,34989,24109,20064,23219,21916,38115,27927,31995,38553,25103,32454,30606,34430,21283,38686,36758,26247,23777,20384,29421,19979,21414,22799,21523,25472,38184,20808,20185,40092,32420,21688,36132,34900,33335,38386,28046,24358,23244,26174,38505,29616,29486,21439,33146,39301,32673,23466,38519,38480,32447,30456,21410,38262,39321,31665,35140,28248,20065,32724,31077,35814,24819,21709,20139,39033,24055,27233,20687,21521,35937,33831,30813,38660,21066,21742,22179,38144,28040,23477,28102,26195,34852,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34867,34868,34869,34870,34871,34872,34874,34875,34877,34878,34879,34881,34882,34883,34886,34887,34888,34889,34890,34891,34894,34895,34896,34897,34898,34899,34901,34902,34904,34906,34907,34908,34909,34910,34911,34912,34918,34919,34922,34925,34927,34929,34931,34932,34933,34934,34936,34937,34938,34939,34940,34944,34947,34950,34951,34953,34954,34956,34958,34959,34960,34961,34963,34964,34965,34967,34968,34969,34970,34971,34973,34974,34975,34976,34977,34979,34981,34982,34983,34984,34985,34986,23567,23389,26657,32918,21880,31505,25928,26964,20123,27463,34638,38795,21327,25375,25658,37034,26012,32961,35856,20889,26800,21368,34809,25032,27844,27899,35874,23633,34218,33455,38156,27427,36763,26032,24571,24515,20449,34885,26143,33125,29481,24826,20852,21009,22411,24418,37026,34892,37266,24184,26447,24615,22995,20804,20982,33016,21256,27769,38596,29066,20241,20462,32670,26429,21957,38152,31168,34966,32483,22687,25100,38656,34394,22040,39035,24464,35768,33988,37207,21465,26093,24207,30044,24676,32110,23167,32490,32493,36713,21927,23459,24748,26059,29572,34988,34990,34991,34992,34994,34995,34996,34997,34998,35000,35001,35002,35003,35005,35006,35007,35008,35011,35012,35015,35016,35018,35019,35020,35021,35023,35024,35025,35027,35030,35031,35034,35035,35036,35037,35038,35040,35041,35046,35047,35049,35050,35051,35052,35053,35054,35055,35058,35061,35062,35063,35066,35067,35069,35071,35072,35073,35075,35076,35077,35078,35079,35080,35081,35083,35084,35085,35086,35087,35089,35092,35093,35094,35095,35096,35100,35101,35102,35103,35104,35106,35107,35108,35110,35111,35112,35113,35116,35117,35118,35119,35121,35122,35123,35125,35127,36873,30307,30505,32474,38772,34203,23398,31348,38634,34880,21195,29071,24490,26092,35810,23547,39535,24033,27529,27739,35757,35759,36874,36805,21387,25276,40486,40493,21568,20011,33469,29273,34460,23830,34905,28079,38597,21713,20122,35766,28937,21693,38409,28895,28153,30416,20005,30740,34578,23721,24310,35328,39068,38414,28814,27839,22852,25513,30524,34893,28436,33395,22576,29141,21388,30746,38593,21761,24422,28976,23476,35866,39564,27523,22830,40495,31207,26472,25196,20335,30113,32650,27915,38451,27687,20208,30162,20859,26679,28478,36992,33136,22934,29814,35128,35129,35130,35131,35132,35133,35134,35135,35136,35138,35139,35141,35142,35143,35144,35145,35146,35147,35148,35149,35150,35151,35152,35153,35154,35155,35156,35157,35158,35159,35160,35161,35162,35163,35164,35165,35168,35169,35170,35171,35172,35173,35175,35176,35177,35178,35179,35180,35181,35182,35183,35184,35185,35186,35187,35188,35189,35190,35191,35192,35193,35194,35196,35197,35198,35200,35202,35204,35205,35207,35208,35209,35210,35211,35212,35213,35214,35215,35216,35217,35218,35219,35220,35221,35222,35223,35224,35225,35226,35227,35228,35229,35230,35231,35232,35233,25671,23591,36965,31377,35875,23002,21676,33280,33647,35201,32768,26928,22094,32822,29239,37326,20918,20063,39029,25494,19994,21494,26355,33099,22812,28082,19968,22777,21307,25558,38129,20381,20234,34915,39056,22839,36951,31227,20202,33008,30097,27778,23452,23016,24413,26885,34433,20506,24050,20057,30691,20197,33402,25233,26131,37009,23673,20159,24441,33222,36920,32900,30123,20134,35028,24847,27589,24518,20041,30410,28322,35811,35758,35850,35793,24322,32764,32716,32462,33589,33643,22240,27575,38899,38452,23035,21535,38134,28139,23493,39278,23609,24341,38544,35234,35235,35236,35237,35238,35239,35240,35241,35242,35243,35244,35245,35246,35247,35248,35249,35250,35251,35252,35253,35254,35255,35256,35257,35258,35259,35260,35261,35262,35263,35264,35267,35277,35283,35284,35285,35287,35288,35289,35291,35293,35295,35296,35297,35298,35300,35303,35304,35305,35306,35308,35309,35310,35312,35313,35314,35316,35317,35318,35319,35320,35321,35322,35323,35324,35325,35326,35327,35329,35330,35331,35332,35333,35334,35336,35337,35338,35339,35340,35341,35342,35343,35344,35345,35346,35347,35348,35349,35350,35351,35352,35353,35354,35355,35356,35357,21360,33521,27185,23156,40560,24212,32552,33721,33828,33829,33639,34631,36814,36194,30408,24433,39062,30828,26144,21727,25317,20323,33219,30152,24248,38605,36362,34553,21647,27891,28044,27704,24703,21191,29992,24189,20248,24736,24551,23588,30001,37038,38080,29369,27833,28216,37193,26377,21451,21491,20305,37321,35825,21448,24188,36802,28132,20110,30402,27014,34398,24858,33286,20313,20446,36926,40060,24841,28189,28180,38533,20104,23089,38632,19982,23679,31161,23431,35821,32701,29577,22495,33419,37057,21505,36935,21947,23786,24481,24840,27442,29425,32946,35465,35358,35359,35360,35361,35362,35363,35364,35365,35366,35367,35368,35369,35370,35371,35372,35373,35374,35375,35376,35377,35378,35379,35380,35381,35382,35383,35384,35385,35386,35387,35388,35389,35391,35392,35393,35394,35395,35396,35397,35398,35399,35401,35402,35403,35404,35405,35406,35407,35408,35409,35410,35411,35412,35413,35414,35415,35416,35417,35418,35419,35420,35421,35422,35423,35424,35425,35426,35427,35428,35429,35430,35431,35432,35433,35434,35435,35436,35437,35438,35439,35440,35441,35442,35443,35444,35445,35446,35447,35448,35450,35451,35452,35453,35454,35455,35456,28020,23507,35029,39044,35947,39533,40499,28170,20900,20803,22435,34945,21407,25588,36757,22253,21592,22278,29503,28304,32536,36828,33489,24895,24616,38498,26352,32422,36234,36291,38053,23731,31908,26376,24742,38405,32792,20113,37095,21248,38504,20801,36816,34164,37213,26197,38901,23381,21277,30776,26434,26685,21705,28798,23472,36733,20877,22312,21681,25874,26242,36190,36163,33039,33900,36973,31967,20991,34299,26531,26089,28577,34468,36481,22122,36896,30338,28790,29157,36131,25321,21017,27901,36156,24590,22686,24974,26366,36192,25166,21939,28195,26413,36711,35457,35458,35459,35460,35461,35462,35463,35464,35467,35468,35469,35470,35471,35472,35473,35474,35476,35477,35478,35479,35480,35481,35482,35483,35484,35485,35486,35487,35488,35489,35490,35491,35492,35493,35494,35495,35496,35497,35498,35499,35500,35501,35502,35503,35504,35505,35506,35507,35508,35509,35510,35511,35512,35513,35514,35515,35516,35517,35518,35519,35520,35521,35522,35523,35524,35525,35526,35527,35528,35529,35530,35531,35532,35533,35534,35535,35536,35537,35538,35539,35540,35541,35542,35543,35544,35545,35546,35547,35548,35549,35550,35551,35552,35553,35554,35555,38113,38392,30504,26629,27048,21643,20045,28856,35784,25688,25995,23429,31364,20538,23528,30651,27617,35449,31896,27838,30415,26025,36759,23853,23637,34360,26632,21344,25112,31449,28251,32509,27167,31456,24432,28467,24352,25484,28072,26454,19976,24080,36134,20183,32960,30260,38556,25307,26157,25214,27836,36213,29031,32617,20806,32903,21484,36974,25240,21746,34544,36761,32773,38167,34071,36825,27993,29645,26015,30495,29956,30759,33275,36126,38024,20390,26517,30137,35786,38663,25391,38215,38453,33976,25379,30529,24449,29424,20105,24596,25972,25327,27491,25919,35556,35557,35558,35559,35560,35561,35562,35563,35564,35565,35566,35567,35568,35569,35570,35571,35572,35573,35574,35575,35576,35577,35578,35579,35580,35581,35582,35583,35584,35585,35586,35587,35588,35589,35590,35592,35593,35594,35595,35596,35597,35598,35599,35600,35601,35602,35603,35604,35605,35606,35607,35608,35609,35610,35611,35612,35613,35614,35615,35616,35617,35618,35619,35620,35621,35623,35624,35625,35626,35627,35628,35629,35630,35631,35632,35633,35634,35635,35636,35637,35638,35639,35640,35641,35642,35643,35644,35645,35646,35647,35648,35649,35650,35651,35652,35653,24103,30151,37073,35777,33437,26525,25903,21553,34584,30693,32930,33026,27713,20043,32455,32844,30452,26893,27542,25191,20540,20356,22336,25351,27490,36286,21482,26088,32440,24535,25370,25527,33267,33268,32622,24092,23769,21046,26234,31209,31258,36136,28825,30164,28382,27835,31378,20013,30405,24544,38047,34935,32456,31181,32959,37325,20210,20247,33311,21608,24030,27954,35788,31909,36724,32920,24090,21650,30385,23449,26172,39588,29664,26666,34523,26417,29482,35832,35803,36880,31481,28891,29038,25284,30633,22065,20027,33879,26609,21161,34496,36142,38136,31569,35654,35655,35656,35657,35658,35659,35660,35661,35662,35663,35664,35665,35666,35667,35668,35669,35670,35671,35672,35673,35674,35675,35676,35677,35678,35679,35680,35681,35682,35683,35684,35685,35687,35688,35689,35690,35691,35693,35694,35695,35696,35697,35698,35699,35700,35701,35702,35703,35704,35705,35706,35707,35708,35709,35710,35711,35712,35713,35714,35715,35716,35717,35718,35719,35720,35721,35722,35723,35724,35725,35726,35727,35728,35729,35730,35731,35732,35733,35734,35735,35736,35737,35738,35739,35740,35741,35742,35743,35756,35761,35771,35783,35792,35818,35849,35870,20303,27880,31069,39547,25235,29226,25341,19987,30742,36716,25776,36186,31686,26729,24196,35013,22918,25758,22766,29366,26894,38181,36861,36184,22368,32512,35846,20934,25417,25305,21331,26700,29730,33537,37196,21828,30528,28796,27978,20857,21672,36164,23039,28363,28100,23388,32043,20180,31869,28371,23376,33258,28173,23383,39683,26837,36394,23447,32508,24635,32437,37049,36208,22863,25549,31199,36275,21330,26063,31062,35781,38459,32452,38075,32386,22068,37257,26368,32618,23562,36981,26152,24038,20304,26590,20570,20316,22352,24231,59408,59409,59410,59411,59412,35896,35897,35898,35899,35900,35901,35902,35903,35904,35906,35907,35908,35909,35912,35914,35915,35917,35918,35919,35920,35921,35922,35923,35924,35926,35927,35928,35929,35931,35932,35933,35934,35935,35936,35939,35940,35941,35942,35943,35944,35945,35948,35949,35950,35951,35952,35953,35954,35956,35957,35958,35959,35963,35964,35965,35966,35967,35968,35969,35971,35972,35974,35975,35976,35979,35981,35982,35983,35984,35985,35986,35987,35989,35990,35991,35993,35994,35995,35996,35997,35998,35999,36000,36001,36002,36003,36004,36005,36006,36007,36008,36009,36010,36011,36012,36013,20109,19980,20800,19984,24319,21317,19989,20120,19998,39730,23404,22121,20008,31162,20031,21269,20039,22829,29243,21358,27664,22239,32996,39319,27603,30590,40727,20022,20127,40720,20060,20073,20115,33416,23387,21868,22031,20164,21389,21405,21411,21413,21422,38757,36189,21274,21493,21286,21294,21310,36188,21350,21347,20994,21000,21006,21037,21043,21055,21056,21068,21086,21089,21084,33967,21117,21122,21121,21136,21139,20866,32596,20155,20163,20169,20162,20200,20193,20203,20190,20251,20211,20258,20324,20213,20261,20263,20233,20267,20318,20327,25912,20314,20317,36014,36015,36016,36017,36018,36019,36020,36021,36022,36023,36024,36025,36026,36027,36028,36029,36030,36031,36032,36033,36034,36035,36036,36037,36038,36039,36040,36041,36042,36043,36044,36045,36046,36047,36048,36049,36050,36051,36052,36053,36054,36055,36056,36057,36058,36059,36060,36061,36062,36063,36064,36065,36066,36067,36068,36069,36070,36071,36072,36073,36074,36075,36076,36077,36078,36079,36080,36081,36082,36083,36084,36085,36086,36087,36088,36089,36090,36091,36092,36093,36094,36095,36096,36097,36098,36099,36100,36101,36102,36103,36104,36105,36106,36107,36108,36109,20319,20311,20274,20285,20342,20340,20369,20361,20355,20367,20350,20347,20394,20348,20396,20372,20454,20456,20458,20421,20442,20451,20444,20433,20447,20472,20521,20556,20467,20524,20495,20526,20525,20478,20508,20492,20517,20520,20606,20547,20565,20552,20558,20588,20603,20645,20647,20649,20666,20694,20742,20717,20716,20710,20718,20743,20747,20189,27709,20312,20325,20430,40864,27718,31860,20846,24061,40649,39320,20865,22804,21241,21261,35335,21264,20971,22809,20821,20128,20822,20147,34926,34980,20149,33044,35026,31104,23348,34819,32696,20907,20913,20925,20924,36110,36111,36112,36113,36114,36115,36116,36117,36118,36119,36120,36121,36122,36123,36124,36128,36177,36178,36183,36191,36197,36200,36201,36202,36204,36206,36207,36209,36210,36216,36217,36218,36219,36220,36221,36222,36223,36224,36226,36227,36230,36231,36232,36233,36236,36237,36238,36239,36240,36242,36243,36245,36246,36247,36248,36249,36250,36251,36252,36253,36254,36256,36257,36258,36260,36261,36262,36263,36264,36265,36266,36267,36268,36269,36270,36271,36272,36274,36278,36279,36281,36283,36285,36288,36289,36290,36293,36295,36296,36297,36298,36301,36304,36306,36307,36308,20935,20886,20898,20901,35744,35750,35751,35754,35764,35765,35767,35778,35779,35787,35791,35790,35794,35795,35796,35798,35800,35801,35804,35807,35808,35812,35816,35817,35822,35824,35827,35830,35833,35836,35839,35840,35842,35844,35847,35852,35855,35857,35858,35860,35861,35862,35865,35867,35864,35869,35871,35872,35873,35877,35879,35882,35883,35886,35887,35890,35891,35893,35894,21353,21370,38429,38434,38433,38449,38442,38461,38460,38466,38473,38484,38495,38503,38508,38514,38516,38536,38541,38551,38576,37015,37019,37021,37017,37036,37025,37044,37043,37046,37050,36309,36312,36313,36316,36320,36321,36322,36325,36326,36327,36329,36333,36334,36336,36337,36338,36340,36342,36348,36350,36351,36352,36353,36354,36355,36356,36358,36359,36360,36363,36365,36366,36368,36369,36370,36371,36373,36374,36375,36376,36377,36378,36379,36380,36384,36385,36388,36389,36390,36391,36392,36395,36397,36400,36402,36403,36404,36406,36407,36408,36411,36412,36414,36415,36419,36421,36422,36428,36429,36430,36431,36432,36435,36436,36437,36438,36439,36440,36442,36443,36444,36445,36446,36447,36448,36449,36450,36451,36452,36453,36455,36456,36458,36459,36462,36465,37048,37040,37071,37061,37054,37072,37060,37063,37075,37094,37090,37084,37079,37083,37099,37103,37118,37124,37154,37150,37155,37169,37167,37177,37187,37190,21005,22850,21154,21164,21165,21182,21759,21200,21206,21232,21471,29166,30669,24308,20981,20988,39727,21430,24321,30042,24047,22348,22441,22433,22654,22716,22725,22737,22313,22316,22314,22323,22329,22318,22319,22364,22331,22338,22377,22405,22379,22406,22396,22395,22376,22381,22390,22387,22445,22436,22412,22450,22479,22439,22452,22419,22432,22485,22488,22490,22489,22482,22456,22516,22511,22520,22500,22493,36467,36469,36471,36472,36473,36474,36475,36477,36478,36480,36482,36483,36484,36486,36488,36489,36490,36491,36492,36493,36494,36497,36498,36499,36501,36502,36503,36504,36505,36506,36507,36509,36511,36512,36513,36514,36515,36516,36517,36518,36519,36520,36521,36522,36525,36526,36528,36529,36531,36532,36533,36534,36535,36536,36537,36539,36540,36541,36542,36543,36544,36545,36546,36547,36548,36549,36550,36551,36552,36553,36554,36555,36556,36557,36559,36560,36561,36562,36563,36564,36565,36566,36567,36568,36569,36570,36571,36572,36573,36574,36575,36576,36577,36578,36579,36580,22539,22541,22525,22509,22528,22558,22553,22596,22560,22629,22636,22657,22665,22682,22656,39336,40729,25087,33401,33405,33407,33423,33418,33448,33412,33422,33425,33431,33433,33451,33464,33470,33456,33480,33482,33507,33432,33463,33454,33483,33484,33473,33449,33460,33441,33450,33439,33476,33486,33444,33505,33545,33527,33508,33551,33543,33500,33524,33490,33496,33548,33531,33491,33553,33562,33542,33556,33557,33504,33493,33564,33617,33627,33628,33544,33682,33596,33588,33585,33691,33630,33583,33615,33607,33603,33631,33600,33559,33632,33581,33594,33587,33638,33637,36581,36582,36583,36584,36585,36586,36587,36588,36589,36590,36591,36592,36593,36594,36595,36596,36597,36598,36599,36600,36601,36602,36603,36604,36605,36606,36607,36608,36609,36610,36611,36612,36613,36614,36615,36616,36617,36618,36619,36620,36621,36622,36623,36624,36625,36626,36627,36628,36629,36630,36631,36632,36633,36634,36635,36636,36637,36638,36639,36640,36641,36642,36643,36644,36645,36646,36647,36648,36649,36650,36651,36652,36653,36654,36655,36656,36657,36658,36659,36660,36661,36662,36663,36664,36665,36666,36667,36668,36669,36670,36671,36672,36673,36674,36675,36676,33640,33563,33641,33644,33642,33645,33646,33712,33656,33715,33716,33696,33706,33683,33692,33669,33660,33718,33705,33661,33720,33659,33688,33694,33704,33722,33724,33729,33793,33765,33752,22535,33816,33803,33757,33789,33750,33820,33848,33809,33798,33748,33759,33807,33795,33784,33785,33770,33733,33728,33830,33776,33761,33884,33873,33882,33881,33907,33927,33928,33914,33929,33912,33852,33862,33897,33910,33932,33934,33841,33901,33985,33997,34000,34022,33981,34003,33994,33983,33978,34016,33953,33977,33972,33943,34021,34019,34060,29965,34104,34032,34105,34079,34106,36677,36678,36679,36680,36681,36682,36683,36684,36685,36686,36687,36688,36689,36690,36691,36692,36693,36694,36695,36696,36697,36698,36699,36700,36701,36702,36703,36704,36705,36706,36707,36708,36709,36714,36736,36748,36754,36765,36768,36769,36770,36772,36773,36774,36775,36778,36780,36781,36782,36783,36786,36787,36788,36789,36791,36792,36794,36795,36796,36799,36800,36803,36806,36809,36810,36811,36812,36813,36815,36818,36822,36823,36826,36832,36833,36835,36839,36844,36847,36849,36850,36852,36853,36854,36858,36859,36860,36862,36863,36871,36872,36876,36878,36883,36885,36888,34134,34107,34047,34044,34137,34120,34152,34148,34142,34170,30626,34115,34162,34171,34212,34216,34183,34191,34169,34222,34204,34181,34233,34231,34224,34259,34241,34268,34303,34343,34309,34345,34326,34364,24318,24328,22844,22849,32823,22869,22874,22872,21263,23586,23589,23596,23604,25164,25194,25247,25275,25290,25306,25303,25326,25378,25334,25401,25419,25411,25517,25590,25457,25466,25486,25524,25453,25516,25482,25449,25518,25532,25586,25592,25568,25599,25540,25566,25550,25682,25542,25534,25669,25665,25611,25627,25632,25612,25638,25633,25694,25732,25709,25750,36889,36892,36899,36900,36901,36903,36904,36905,36906,36907,36908,36912,36913,36914,36915,36916,36919,36921,36922,36925,36927,36928,36931,36933,36934,36936,36937,36938,36939,36940,36942,36948,36949,36950,36953,36954,36956,36957,36958,36959,36960,36961,36964,36966,36967,36969,36970,36971,36972,36975,36976,36977,36978,36979,36982,36983,36984,36985,36986,36987,36988,36990,36993,36996,36997,36998,36999,37001,37002,37004,37005,37006,37007,37008,37010,37012,37014,37016,37018,37020,37022,37023,37024,37028,37029,37031,37032,37033,37035,37037,37042,37047,37052,37053,37055,37056,25722,25783,25784,25753,25786,25792,25808,25815,25828,25826,25865,25893,25902,24331,24530,29977,24337,21343,21489,21501,21481,21480,21499,21522,21526,21510,21579,21586,21587,21588,21590,21571,21537,21591,21593,21539,21554,21634,21652,21623,21617,21604,21658,21659,21636,21622,21606,21661,21712,21677,21698,21684,21714,21671,21670,21715,21716,21618,21667,21717,21691,21695,21708,21721,21722,21724,21673,21674,21668,21725,21711,21726,21787,21735,21792,21757,21780,21747,21794,21795,21775,21777,21799,21802,21863,21903,21941,21833,21869,21825,21845,21823,21840,21820,37058,37059,37062,37064,37065,37067,37068,37069,37074,37076,37077,37078,37080,37081,37082,37086,37087,37088,37091,37092,37093,37097,37098,37100,37102,37104,37105,37106,37107,37109,37110,37111,37113,37114,37115,37116,37119,37120,37121,37123,37125,37126,37127,37128,37129,37130,37131,37132,37133,37134,37135,37136,37137,37138,37139,37140,37141,37142,37143,37144,37146,37147,37148,37149,37151,37152,37153,37156,37157,37158,37159,37160,37161,37162,37163,37164,37165,37166,37168,37170,37171,37172,37173,37174,37175,37176,37178,37179,37180,37181,37182,37183,37184,37185,37186,37188,21815,21846,21877,21878,21879,21811,21808,21852,21899,21970,21891,21937,21945,21896,21889,21919,21886,21974,21905,21883,21983,21949,21950,21908,21913,21994,22007,21961,22047,21969,21995,21996,21972,21990,21981,21956,21999,21989,22002,22003,21964,21965,21992,22005,21988,36756,22046,22024,22028,22017,22052,22051,22014,22016,22055,22061,22104,22073,22103,22060,22093,22114,22105,22108,22092,22100,22150,22116,22129,22123,22139,22140,22149,22163,22191,22228,22231,22237,22241,22261,22251,22265,22271,22276,22282,22281,22300,24079,24089,24084,24081,24113,24123,24124,37189,37191,37192,37201,37203,37204,37205,37206,37208,37209,37211,37212,37215,37216,37222,37223,37224,37227,37229,37235,37242,37243,37244,37248,37249,37250,37251,37252,37254,37256,37258,37262,37263,37267,37268,37269,37270,37271,37272,37273,37276,37277,37278,37279,37280,37281,37284,37285,37286,37287,37288,37289,37291,37292,37296,37297,37298,37299,37302,37303,37304,37305,37307,37308,37309,37310,37311,37312,37313,37314,37315,37316,37317,37318,37320,37323,37328,37330,37331,37332,37333,37334,37335,37336,37337,37338,37339,37341,37342,37343,37344,37345,37346,37347,37348,37349,24119,24132,24148,24155,24158,24161,23692,23674,23693,23696,23702,23688,23704,23705,23697,23706,23708,23733,23714,23741,23724,23723,23729,23715,23745,23735,23748,23762,23780,23755,23781,23810,23811,23847,23846,23854,23844,23838,23814,23835,23896,23870,23860,23869,23916,23899,23919,23901,23915,23883,23882,23913,23924,23938,23961,23965,35955,23991,24005,24435,24439,24450,24455,24457,24460,24469,24473,24476,24488,24493,24501,24508,34914,24417,29357,29360,29364,29367,29368,29379,29377,29390,29389,29394,29416,29423,29417,29426,29428,29431,29441,29427,29443,29434,37350,37351,37352,37353,37354,37355,37356,37357,37358,37359,37360,37361,37362,37363,37364,37365,37366,37367,37368,37369,37370,37371,37372,37373,37374,37375,37376,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37387,37388,37389,37390,37391,37392,37393,37394,37395,37396,37397,37398,37399,37400,37401,37402,37403,37404,37405,37406,37407,37408,37409,37410,37411,37412,37413,37414,37415,37416,37417,37418,37419,37420,37421,37422,37423,37424,37425,37426,37427,37428,37429,37430,37431,37432,37433,37434,37435,37436,37437,37438,37439,37440,37441,37442,37443,37444,37445,29435,29463,29459,29473,29450,29470,29469,29461,29474,29497,29477,29484,29496,29489,29520,29517,29527,29536,29548,29551,29566,33307,22821,39143,22820,22786,39267,39271,39272,39273,39274,39275,39276,39284,39287,39293,39296,39300,39303,39306,39309,39312,39313,39315,39316,39317,24192,24209,24203,24214,24229,24224,24249,24245,24254,24243,36179,24274,24273,24283,24296,24298,33210,24516,24521,24534,24527,24579,24558,24580,24545,24548,24574,24581,24582,24554,24557,24568,24601,24629,24614,24603,24591,24589,24617,24619,24586,24639,24609,24696,24697,24699,24698,24642,37446,37447,37448,37449,37450,37451,37452,37453,37454,37455,37456,37457,37458,37459,37460,37461,37462,37463,37464,37465,37466,37467,37468,37469,37470,37471,37472,37473,37474,37475,37476,37477,37478,37479,37480,37481,37482,37483,37484,37485,37486,37487,37488,37489,37490,37491,37493,37494,37495,37496,37497,37498,37499,37500,37501,37502,37503,37504,37505,37506,37507,37508,37509,37510,37511,37512,37513,37514,37515,37516,37517,37519,37520,37521,37522,37523,37524,37525,37526,37527,37528,37529,37530,37531,37532,37533,37534,37535,37536,37537,37538,37539,37540,37541,37542,37543,24682,24701,24726,24730,24749,24733,24707,24722,24716,24731,24812,24763,24753,24797,24792,24774,24794,24756,24864,24870,24853,24867,24820,24832,24846,24875,24906,24949,25004,24980,24999,25015,25044,25077,24541,38579,38377,38379,38385,38387,38389,38390,38396,38398,38403,38404,38406,38408,38410,38411,38412,38413,38415,38418,38421,38422,38423,38425,38426,20012,29247,25109,27701,27732,27740,27722,27811,27781,27792,27796,27788,27752,27753,27764,27766,27782,27817,27856,27860,27821,27895,27896,27889,27863,27826,27872,27862,27898,27883,27886,27825,27859,27887,27902,37544,37545,37546,37547,37548,37549,37551,37552,37553,37554,37555,37556,37557,37558,37559,37560,37561,37562,37563,37564,37565,37566,37567,37568,37569,37570,37571,37572,37573,37574,37575,37577,37578,37579,37580,37581,37582,37583,37584,37585,37586,37587,37588,37589,37590,37591,37592,37593,37594,37595,37596,37597,37598,37599,37600,37601,37602,37603,37604,37605,37606,37607,37608,37609,37610,37611,37612,37613,37614,37615,37616,37617,37618,37619,37620,37621,37622,37623,37624,37625,37626,37627,37628,37629,37630,37631,37632,37633,37634,37635,37636,37637,37638,37639,37640,37641,27961,27943,27916,27971,27976,27911,27908,27929,27918,27947,27981,27950,27957,27930,27983,27986,27988,27955,28049,28015,28062,28064,27998,28051,28052,27996,28000,28028,28003,28186,28103,28101,28126,28174,28095,28128,28177,28134,28125,28121,28182,28075,28172,28078,28203,28270,28238,28267,28338,28255,28294,28243,28244,28210,28197,28228,28383,28337,28312,28384,28461,28386,28325,28327,28349,28347,28343,28375,28340,28367,28303,28354,28319,28514,28486,28487,28452,28437,28409,28463,28470,28491,28532,28458,28425,28457,28553,28557,28556,28536,28530,28540,28538,28625,37642,37643,37644,37645,37646,37647,37648,37649,37650,37651,37652,37653,37654,37655,37656,37657,37658,37659,37660,37661,37662,37663,37664,37665,37666,37667,37668,37669,37670,37671,37672,37673,37674,37675,37676,37677,37678,37679,37680,37681,37682,37683,37684,37685,37686,37687,37688,37689,37690,37691,37692,37693,37695,37696,37697,37698,37699,37700,37701,37702,37703,37704,37705,37706,37707,37708,37709,37710,37711,37712,37713,37714,37715,37716,37717,37718,37719,37720,37721,37722,37723,37724,37725,37726,37727,37728,37729,37730,37731,37732,37733,37734,37735,37736,37737,37739,28617,28583,28601,28598,28610,28641,28654,28638,28640,28655,28698,28707,28699,28729,28725,28751,28766,23424,23428,23445,23443,23461,23480,29999,39582,25652,23524,23534,35120,23536,36423,35591,36790,36819,36821,36837,36846,36836,36841,36838,36851,36840,36869,36868,36875,36902,36881,36877,36886,36897,36917,36918,36909,36911,36932,36945,36946,36944,36968,36952,36962,36955,26297,36980,36989,36994,37000,36995,37003,24400,24407,24406,24408,23611,21675,23632,23641,23409,23651,23654,32700,24362,24361,24365,33396,24380,39739,23662,22913,22915,22925,22953,22954,22947,37740,37741,37742,37743,37744,37745,37746,37747,37748,37749,37750,37751,37752,37753,37754,37755,37756,37757,37758,37759,37760,37761,37762,37763,37764,37765,37766,37767,37768,37769,37770,37771,37772,37773,37774,37776,37777,37778,37779,37780,37781,37782,37783,37784,37785,37786,37787,37788,37789,37790,37791,37792,37793,37794,37795,37796,37797,37798,37799,37800,37801,37802,37803,37804,37805,37806,37807,37808,37809,37810,37811,37812,37813,37814,37815,37816,37817,37818,37819,37820,37821,37822,37823,37824,37825,37826,37827,37828,37829,37830,37831,37832,37833,37835,37836,37837,22935,22986,22955,22942,22948,22994,22962,22959,22999,22974,23045,23046,23005,23048,23011,23000,23033,23052,23049,23090,23092,23057,23075,23059,23104,23143,23114,23125,23100,23138,23157,33004,23210,23195,23159,23162,23230,23275,23218,23250,23252,23224,23264,23267,23281,23254,23270,23256,23260,23305,23319,23318,23346,23351,23360,23573,23580,23386,23397,23411,23377,23379,23394,39541,39543,39544,39546,39551,39549,39552,39553,39557,39560,39562,39568,39570,39571,39574,39576,39579,39580,39581,39583,39584,39586,39587,39589,39591,32415,32417,32419,32421,32424,32425,37838,37839,37840,37841,37842,37843,37844,37845,37847,37848,37849,37850,37851,37852,37853,37854,37855,37856,37857,37858,37859,37860,37861,37862,37863,37864,37865,37866,37867,37868,37869,37870,37871,37872,37873,37874,37875,37876,37877,37878,37879,37880,37881,37882,37883,37884,37885,37886,37887,37888,37889,37890,37891,37892,37893,37894,37895,37896,37897,37898,37899,37900,37901,37902,37903,37904,37905,37906,37907,37908,37909,37910,37911,37912,37913,37914,37915,37916,37917,37918,37919,37920,37921,37922,37923,37924,37925,37926,37927,37928,37929,37930,37931,37932,37933,37934,32429,32432,32446,32448,32449,32450,32457,32459,32460,32464,32468,32471,32475,32480,32481,32488,32491,32494,32495,32497,32498,32525,32502,32506,32507,32510,32513,32514,32515,32519,32520,32523,32524,32527,32529,32530,32535,32537,32540,32539,32543,32545,32546,32547,32548,32549,32550,32551,32554,32555,32556,32557,32559,32560,32561,32562,32563,32565,24186,30079,24027,30014,37013,29582,29585,29614,29602,29599,29647,29634,29649,29623,29619,29632,29641,29640,29669,29657,39036,29706,29673,29671,29662,29626,29682,29711,29738,29787,29734,29733,29736,29744,29742,29740,37935,37936,37937,37938,37939,37940,37941,37942,37943,37944,37945,37946,37947,37948,37949,37951,37952,37953,37954,37955,37956,37957,37958,37959,37960,37961,37962,37963,37964,37965,37966,37967,37968,37969,37970,37971,37972,37973,37974,37975,37976,37977,37978,37979,37980,37981,37982,37983,37984,37985,37986,37987,37988,37989,37990,37991,37992,37993,37994,37996,37997,37998,37999,38000,38001,38002,38003,38004,38005,38006,38007,38008,38009,38010,38011,38012,38013,38014,38015,38016,38017,38018,38019,38020,38033,38038,38040,38087,38095,38099,38100,38106,38118,38139,38172,38176,29723,29722,29761,29788,29783,29781,29785,29815,29805,29822,29852,29838,29824,29825,29831,29835,29854,29864,29865,29840,29863,29906,29882,38890,38891,38892,26444,26451,26462,26440,26473,26533,26503,26474,26483,26520,26535,26485,26536,26526,26541,26507,26487,26492,26608,26633,26584,26634,26601,26544,26636,26585,26549,26586,26547,26589,26624,26563,26552,26594,26638,26561,26621,26674,26675,26720,26721,26702,26722,26692,26724,26755,26653,26709,26726,26689,26727,26688,26686,26698,26697,26665,26805,26767,26740,26743,26771,26731,26818,26990,26876,26911,26912,26873,38183,38195,38205,38211,38216,38219,38229,38234,38240,38254,38260,38261,38263,38264,38265,38266,38267,38268,38269,38270,38272,38273,38274,38275,38276,38277,38278,38279,38280,38281,38282,38283,38284,38285,38286,38287,38288,38289,38290,38291,38292,38293,38294,38295,38296,38297,38298,38299,38300,38301,38302,38303,38304,38305,38306,38307,38308,38309,38310,38311,38312,38313,38314,38315,38316,38317,38318,38319,38320,38321,38322,38323,38324,38325,38326,38327,38328,38329,38330,38331,38332,38333,38334,38335,38336,38337,38338,38339,38340,38341,38342,38343,38344,38345,38346,38347,26916,26864,26891,26881,26967,26851,26896,26993,26937,26976,26946,26973,27012,26987,27008,27032,27000,26932,27084,27015,27016,27086,27017,26982,26979,27001,27035,27047,27067,27051,27053,27092,27057,27073,27082,27103,27029,27104,27021,27135,27183,27117,27159,27160,27237,27122,27204,27198,27296,27216,27227,27189,27278,27257,27197,27176,27224,27260,27281,27280,27305,27287,27307,29495,29522,27521,27522,27527,27524,27538,27539,27533,27546,27547,27553,27562,36715,36717,36721,36722,36723,36725,36726,36728,36727,36729,36730,36732,36734,36737,36738,36740,36743,36747,38348,38349,38350,38351,38352,38353,38354,38355,38356,38357,38358,38359,38360,38361,38362,38363,38364,38365,38366,38367,38368,38369,38370,38371,38372,38373,38374,38375,38380,38399,38407,38419,38424,38427,38430,38432,38435,38436,38437,38438,38439,38440,38441,38443,38444,38445,38447,38448,38455,38456,38457,38458,38462,38465,38467,38474,38478,38479,38481,38482,38483,38486,38487,38488,38489,38490,38492,38493,38494,38496,38499,38501,38502,38507,38509,38510,38511,38512,38513,38515,38520,38521,38522,38523,38524,38525,38526,38527,38528,38529,38530,38531,38532,38535,38537,38538,36749,36750,36751,36760,36762,36558,25099,25111,25115,25119,25122,25121,25125,25124,25132,33255,29935,29940,29951,29967,29969,29971,25908,26094,26095,26096,26122,26137,26482,26115,26133,26112,28805,26359,26141,26164,26161,26166,26165,32774,26207,26196,26177,26191,26198,26209,26199,26231,26244,26252,26279,26269,26302,26331,26332,26342,26345,36146,36147,36150,36155,36157,36160,36165,36166,36168,36169,36167,36173,36181,36185,35271,35274,35275,35276,35278,35279,35280,35281,29294,29343,29277,29286,29295,29310,29311,29316,29323,29325,29327,29330,25352,25394,25520,38540,38542,38545,38546,38547,38549,38550,38554,38555,38557,38558,38559,38560,38561,38562,38563,38564,38565,38566,38568,38569,38570,38571,38572,38573,38574,38575,38577,38578,38580,38581,38583,38584,38586,38587,38591,38594,38595,38600,38602,38603,38608,38609,38611,38612,38614,38615,38616,38617,38618,38619,38620,38621,38622,38623,38625,38626,38627,38628,38629,38630,38631,38635,38636,38637,38638,38640,38641,38642,38644,38645,38648,38650,38651,38652,38653,38655,38658,38659,38661,38666,38667,38668,38672,38673,38674,38676,38677,38679,38680,38681,38682,38683,38685,38687,38688,25663,25816,32772,27626,27635,27645,27637,27641,27653,27655,27654,27661,27669,27672,27673,27674,27681,27689,27684,27690,27698,25909,25941,25963,29261,29266,29270,29232,34402,21014,32927,32924,32915,32956,26378,32957,32945,32939,32941,32948,32951,32999,33000,33001,33002,32987,32962,32964,32985,32973,32983,26384,32989,33003,33009,33012,33005,33037,33038,33010,33020,26389,33042,35930,33078,33054,33068,33048,33074,33096,33100,33107,33140,33113,33114,33137,33120,33129,33148,33149,33133,33127,22605,23221,33160,33154,33169,28373,33187,33194,33228,26406,33226,33211,38689,38690,38691,38692,38693,38694,38695,38696,38697,38699,38700,38702,38703,38705,38707,38708,38709,38710,38711,38714,38715,38716,38717,38719,38720,38721,38722,38723,38724,38725,38726,38727,38728,38729,38730,38731,38732,38733,38734,38735,38736,38737,38740,38741,38743,38744,38746,38748,38749,38751,38755,38756,38758,38759,38760,38762,38763,38764,38765,38766,38767,38768,38769,38770,38773,38775,38776,38777,38778,38779,38781,38782,38783,38784,38785,38786,38787,38788,38790,38791,38792,38793,38794,38796,38798,38799,38800,38803,38805,38806,38807,38809,38810,38811,38812,38813,33217,33190,27428,27447,27449,27459,27462,27481,39121,39122,39123,39125,39129,39130,27571,24384,27586,35315,26000,40785,26003,26044,26054,26052,26051,26060,26062,26066,26070,28800,28828,28822,28829,28859,28864,28855,28843,28849,28904,28874,28944,28947,28950,28975,28977,29043,29020,29032,28997,29042,29002,29048,29050,29080,29107,29109,29096,29088,29152,29140,29159,29177,29213,29224,28780,28952,29030,29113,25150,25149,25155,25160,25161,31035,31040,31046,31049,31067,31068,31059,31066,31074,31063,31072,31087,31079,31098,31109,31114,31130,31143,31155,24529,24528,38814,38815,38817,38818,38820,38821,38822,38823,38824,38825,38826,38828,38830,38832,38833,38835,38837,38838,38839,38840,38841,38842,38843,38844,38845,38846,38847,38848,38849,38850,38851,38852,38853,38854,38855,38856,38857,38858,38859,38860,38861,38862,38863,38864,38865,38866,38867,38868,38869,38870,38871,38872,38873,38874,38875,38876,38877,38878,38879,38880,38881,38882,38883,38884,38885,38888,38894,38895,38896,38897,38898,38900,38903,38904,38905,38906,38907,38908,38909,38910,38911,38912,38913,38914,38915,38916,38917,38918,38919,38920,38921,38922,38923,38924,38925,38926,24636,24669,24666,24679,24641,24665,24675,24747,24838,24845,24925,25001,24989,25035,25041,25094,32896,32895,27795,27894,28156,30710,30712,30720,30729,30743,30744,30737,26027,30765,30748,30749,30777,30778,30779,30751,30780,30757,30764,30755,30761,30798,30829,30806,30807,30758,30800,30791,30796,30826,30875,30867,30874,30855,30876,30881,30883,30898,30905,30885,30932,30937,30921,30956,30962,30981,30964,30995,31012,31006,31028,40859,40697,40699,40700,30449,30468,30477,30457,30471,30472,30490,30498,30489,30509,30502,30517,30520,30544,30545,30535,30531,30554,30568,38927,38928,38929,38930,38931,38932,38933,38934,38935,38936,38937,38938,38939,38940,38941,38942,38943,38944,38945,38946,38947,38948,38949,38950,38951,38952,38953,38954,38955,38956,38957,38958,38959,38960,38961,38962,38963,38964,38965,38966,38967,38968,38969,38970,38971,38972,38973,38974,38975,38976,38977,38978,38979,38980,38981,38982,38983,38984,38985,38986,38987,38988,38989,38990,38991,38992,38993,38994,38995,38996,38997,38998,38999,39000,39001,39002,39003,39004,39005,39006,39007,39008,39009,39010,39011,39012,39013,39014,39015,39016,39017,39018,39019,39020,39021,39022,30562,30565,30591,30605,30589,30592,30604,30609,30623,30624,30640,30645,30653,30010,30016,30030,30027,30024,30043,30066,30073,30083,32600,32609,32607,35400,32616,32628,32625,32633,32641,32638,30413,30437,34866,38021,38022,38023,38027,38026,38028,38029,38031,38032,38036,38039,38037,38042,38043,38044,38051,38052,38059,38058,38061,38060,38063,38064,38066,38068,38070,38071,38072,38073,38074,38076,38077,38079,38084,38088,38089,38090,38091,38092,38093,38094,38096,38097,38098,38101,38102,38103,38105,38104,38107,38110,38111,38112,38114,38116,38117,38119,38120,38122,39023,39024,39025,39026,39027,39028,39051,39054,39058,39061,39065,39075,39080,39081,39082,39083,39084,39085,39086,39087,39088,39089,39090,39091,39092,39093,39094,39095,39096,39097,39098,39099,39100,39101,39102,39103,39104,39105,39106,39107,39108,39109,39110,39111,39112,39113,39114,39115,39116,39117,39119,39120,39124,39126,39127,39131,39132,39133,39136,39137,39138,39139,39140,39141,39142,39145,39146,39147,39148,39149,39150,39151,39152,39153,39154,39155,39156,39157,39158,39159,39160,39161,39162,39163,39164,39165,39166,39167,39168,39169,39170,39171,39172,39173,39174,39175,38121,38123,38126,38127,38131,38132,38133,38135,38137,38140,38141,38143,38147,38146,38150,38151,38153,38154,38157,38158,38159,38162,38163,38164,38165,38166,38168,38171,38173,38174,38175,38178,38186,38187,38185,38188,38193,38194,38196,38198,38199,38200,38204,38206,38207,38210,38197,38212,38213,38214,38217,38220,38222,38223,38226,38227,38228,38230,38231,38232,38233,38235,38238,38239,38237,38241,38242,38244,38245,38246,38247,38248,38249,38250,38251,38252,38255,38257,38258,38259,38202,30695,30700,38601,31189,31213,31203,31211,31238,23879,31235,31234,31262,31252,39176,39177,39178,39179,39180,39182,39183,39185,39186,39187,39188,39189,39190,39191,39192,39193,39194,39195,39196,39197,39198,39199,39200,39201,39202,39203,39204,39205,39206,39207,39208,39209,39210,39211,39212,39213,39215,39216,39217,39218,39219,39220,39221,39222,39223,39224,39225,39226,39227,39228,39229,39230,39231,39232,39233,39234,39235,39236,39237,39238,39239,39240,39241,39242,39243,39244,39245,39246,39247,39248,39249,39250,39251,39254,39255,39256,39257,39258,39259,39260,39261,39262,39263,39264,39265,39266,39268,39270,39283,39288,39289,39291,39294,39298,39299,39305,31289,31287,31313,40655,39333,31344,30344,30350,30355,30361,30372,29918,29920,29996,40480,40482,40488,40489,40490,40491,40492,40498,40497,40502,40504,40503,40505,40506,40510,40513,40514,40516,40518,40519,40520,40521,40523,40524,40526,40529,40533,40535,40538,40539,40540,40542,40547,40550,40551,40552,40553,40554,40555,40556,40561,40557,40563,30098,30100,30102,30112,30109,30124,30115,30131,30132,30136,30148,30129,30128,30147,30146,30166,30157,30179,30184,30182,30180,30187,30183,30211,30193,30204,30207,30224,30208,30213,30220,30231,30218,30245,30232,30229,30233,39308,39310,39322,39323,39324,39325,39326,39327,39328,39329,39330,39331,39332,39334,39335,39337,39338,39339,39340,39341,39342,39343,39344,39345,39346,39347,39348,39349,39350,39351,39352,39353,39354,39355,39356,39357,39358,39359,39360,39361,39362,39363,39364,39365,39366,39367,39368,39369,39370,39371,39372,39373,39374,39375,39376,39377,39378,39379,39380,39381,39382,39383,39384,39385,39386,39387,39388,39389,39390,39391,39392,39393,39394,39395,39396,39397,39398,39399,39400,39401,39402,39403,39404,39405,39406,39407,39408,39409,39410,39411,39412,39413,39414,39415,39416,39417,30235,30268,30242,30240,30272,30253,30256,30271,30261,30275,30270,30259,30285,30302,30292,30300,30294,30315,30319,32714,31462,31352,31353,31360,31366,31368,31381,31398,31392,31404,31400,31405,31411,34916,34921,34930,34941,34943,34946,34978,35014,34999,35004,35017,35042,35022,35043,35045,35057,35098,35068,35048,35070,35056,35105,35097,35091,35099,35082,35124,35115,35126,35137,35174,35195,30091,32997,30386,30388,30684,32786,32788,32790,32796,32800,32802,32805,32806,32807,32809,32808,32817,32779,32821,32835,32838,32845,32850,32873,32881,35203,39032,39040,39043,39418,39419,39420,39421,39422,39423,39424,39425,39426,39427,39428,39429,39430,39431,39432,39433,39434,39435,39436,39437,39438,39439,39440,39441,39442,39443,39444,39445,39446,39447,39448,39449,39450,39451,39452,39453,39454,39455,39456,39457,39458,39459,39460,39461,39462,39463,39464,39465,39466,39467,39468,39469,39470,39471,39472,39473,39474,39475,39476,39477,39478,39479,39480,39481,39482,39483,39484,39485,39486,39487,39488,39489,39490,39491,39492,39493,39494,39495,39496,39497,39498,39499,39500,39501,39502,39503,39504,39505,39506,39507,39508,39509,39510,39511,39512,39513,39049,39052,39053,39055,39060,39066,39067,39070,39071,39073,39074,39077,39078,34381,34388,34412,34414,34431,34426,34428,34427,34472,34445,34443,34476,34461,34471,34467,34474,34451,34473,34486,34500,34485,34510,34480,34490,34481,34479,34505,34511,34484,34537,34545,34546,34541,34547,34512,34579,34526,34548,34527,34520,34513,34563,34567,34552,34568,34570,34573,34569,34595,34619,34590,34597,34606,34586,34622,34632,34612,34609,34601,34615,34623,34690,34594,34685,34686,34683,34656,34672,34636,34670,34699,34643,34659,34684,34660,34649,34661,34707,34735,34728,34770,39514,39515,39516,39517,39518,39519,39520,39521,39522,39523,39524,39525,39526,39527,39528,39529,39530,39531,39538,39555,39561,39565,39566,39572,39573,39577,39590,39593,39594,39595,39596,39597,39598,39599,39602,39603,39604,39605,39609,39611,39613,39614,39615,39619,39620,39622,39623,39624,39625,39626,39629,39630,39631,39632,39634,39636,39637,39638,39639,39641,39642,39643,39644,39645,39646,39648,39650,39651,39652,39653,39655,39656,39657,39658,39660,39662,39664,39665,39666,39667,39668,39669,39670,39671,39672,39674,39676,39677,39678,39679,39680,39681,39682,39684,39685,39686,34758,34696,34693,34733,34711,34691,34731,34789,34732,34741,34739,34763,34771,34749,34769,34752,34762,34779,34794,34784,34798,34838,34835,34814,34826,34843,34849,34873,34876,32566,32578,32580,32581,33296,31482,31485,31496,31491,31492,31509,31498,31531,31503,31559,31544,31530,31513,31534,31537,31520,31525,31524,31539,31550,31518,31576,31578,31557,31605,31564,31581,31584,31598,31611,31586,31602,31601,31632,31654,31655,31672,31660,31645,31656,31621,31658,31644,31650,31659,31668,31697,31681,31692,31709,31706,31717,31718,31722,31756,31742,31740,31759,31766,31755,39687,39689,39690,39691,39692,39693,39694,39696,39697,39698,39700,39701,39702,39703,39704,39705,39706,39707,39708,39709,39710,39712,39713,39714,39716,39717,39718,39719,39720,39721,39722,39723,39724,39725,39726,39728,39729,39731,39732,39733,39734,39735,39736,39737,39738,39741,39742,39743,39744,39750,39754,39755,39756,39758,39760,39762,39763,39765,39766,39767,39768,39769,39770,39771,39772,39773,39774,39775,39776,39777,39778,39779,39780,39781,39782,39783,39784,39785,39786,39787,39788,39789,39790,39791,39792,39793,39794,39795,39796,39797,39798,39799,39800,39801,39802,39803,31775,31786,31782,31800,31809,31808,33278,33281,33282,33284,33260,34884,33313,33314,33315,33325,33327,33320,33323,33336,33339,33331,33332,33342,33348,33353,33355,33359,33370,33375,33384,34942,34949,34952,35032,35039,35166,32669,32671,32679,32687,32688,32690,31868,25929,31889,31901,31900,31902,31906,31922,31932,31933,31937,31943,31948,31949,31944,31941,31959,31976,33390,26280,32703,32718,32725,32741,32737,32742,32745,32750,32755,31992,32119,32166,32174,32327,32411,40632,40628,36211,36228,36244,36241,36273,36199,36205,35911,35913,37194,37200,37198,37199,37220,39804,39805,39806,39807,39808,39809,39810,39811,39812,39813,39814,39815,39816,39817,39818,39819,39820,39821,39822,39823,39824,39825,39826,39827,39828,39829,39830,39831,39832,39833,39834,39835,39836,39837,39838,39839,39840,39841,39842,39843,39844,39845,39846,39847,39848,39849,39850,39851,39852,39853,39854,39855,39856,39857,39858,39859,39860,39861,39862,39863,39864,39865,39866,39867,39868,39869,39870,39871,39872,39873,39874,39875,39876,39877,39878,39879,39880,39881,39882,39883,39884,39885,39886,39887,39888,39889,39890,39891,39892,39893,39894,39895,39896,39897,39898,39899,37218,37217,37232,37225,37231,37245,37246,37234,37236,37241,37260,37253,37264,37261,37265,37282,37283,37290,37293,37294,37295,37301,37300,37306,35925,40574,36280,36331,36357,36441,36457,36277,36287,36284,36282,36292,36310,36311,36314,36318,36302,36303,36315,36294,36332,36343,36344,36323,36345,36347,36324,36361,36349,36372,36381,36383,36396,36398,36387,36399,36410,36416,36409,36405,36413,36401,36425,36417,36418,36433,36434,36426,36464,36470,36476,36463,36468,36485,36495,36500,36496,36508,36510,35960,35970,35978,35973,35992,35988,26011,35286,35294,35290,35292,39900,39901,39902,39903,39904,39905,39906,39907,39908,39909,39910,39911,39912,39913,39914,39915,39916,39917,39918,39919,39920,39921,39922,39923,39924,39925,39926,39927,39928,39929,39930,39931,39932,39933,39934,39935,39936,39937,39938,39939,39940,39941,39942,39943,39944,39945,39946,39947,39948,39949,39950,39951,39952,39953,39954,39955,39956,39957,39958,39959,39960,39961,39962,39963,39964,39965,39966,39967,39968,39969,39970,39971,39972,39973,39974,39975,39976,39977,39978,39979,39980,39981,39982,39983,39984,39985,39986,39987,39988,39989,39990,39991,39992,39993,39994,39995,35301,35307,35311,35390,35622,38739,38633,38643,38639,38662,38657,38664,38671,38670,38698,38701,38704,38718,40832,40835,40837,40838,40839,40840,40841,40842,40844,40702,40715,40717,38585,38588,38589,38606,38610,30655,38624,37518,37550,37576,37694,37738,37834,37775,37950,37995,40063,40066,40069,40070,40071,40072,31267,40075,40078,40080,40081,40082,40084,40085,40090,40091,40094,40095,40096,40097,40098,40099,40101,40102,40103,40104,40105,40107,40109,40110,40112,40113,40114,40115,40116,40117,40118,40119,40122,40123,40124,40125,40132,40133,40134,40135,40138,40139,39996,39997,39998,39999,40000,40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040,40041,40042,40043,40044,40045,40046,40047,40048,40049,40050,40051,40052,40053,40054,40055,40056,40057,40058,40059,40061,40062,40064,40067,40068,40073,40074,40076,40079,40083,40086,40087,40088,40089,40093,40106,40108,40111,40121,40126,40127,40128,40129,40130,40136,40137,40145,40146,40154,40155,40160,40161,40140,40141,40142,40143,40144,40147,40148,40149,40151,40152,40153,40156,40157,40159,40162,38780,38789,38801,38802,38804,38831,38827,38819,38834,38836,39601,39600,39607,40536,39606,39610,39612,39617,39616,39621,39618,39627,39628,39633,39749,39747,39751,39753,39752,39757,39761,39144,39181,39214,39253,39252,39647,39649,39654,39663,39659,39675,39661,39673,39688,39695,39699,39711,39715,40637,40638,32315,40578,40583,40584,40587,40594,37846,40605,40607,40667,40668,40669,40672,40671,40674,40681,40679,40677,40682,40687,40738,40748,40751,40761,40759,40765,40766,40772,40163,40164,40165,40166,40167,40168,40169,40170,40171,40172,40173,40174,40175,40176,40177,40178,40179,40180,40181,40182,40183,40184,40185,40186,40187,40188,40189,40190,40191,40192,40193,40194,40195,40196,40197,40198,40199,40200,40201,40202,40203,40204,40205,40206,40207,40208,40209,40210,40211,40212,40213,40214,40215,40216,40217,40218,40219,40220,40221,40222,40223,40224,40225,40226,40227,40228,40229,40230,40231,40232,40233,40234,40235,40236,40237,40238,40239,40240,40241,40242,40243,40244,40245,40246,40247,40248,40249,40250,40251,40252,40253,40254,40255,40256,40257,40258,57908,57909,57910,57911,57912,57913,57914,57915,57916,57917,57918,57919,57920,57921,57922,57923,57924,57925,57926,57927,57928,57929,57930,57931,57932,57933,57934,57935,57936,57937,57938,57939,57940,57941,57942,57943,57944,57945,57946,57947,57948,57949,57950,57951,57952,57953,57954,57955,57956,57957,57958,57959,57960,57961,57962,57963,57964,57965,57966,57967,57968,57969,57970,57971,57972,57973,57974,57975,57976,57977,57978,57979,57980,57981,57982,57983,57984,57985,57986,57987,57988,57989,57990,57991,57992,57993,57994,57995,57996,57997,57998,57999,58000,58001,40259,40260,40261,40262,40263,40264,40265,40266,40267,40268,40269,40270,40271,40272,40273,40274,40275,40276,40277,40278,40279,40280,40281,40282,40283,40284,40285,40286,40287,40288,40289,40290,40291,40292,40293,40294,40295,40296,40297,40298,40299,40300,40301,40302,40303,40304,40305,40306,40307,40308,40309,40310,40311,40312,40313,40314,40315,40316,40317,40318,40319,40320,40321,40322,40323,40324,40325,40326,40327,40328,40329,40330,40331,40332,40333,40334,40335,40336,40337,40338,40339,40340,40341,40342,40343,40344,40345,40346,40347,40348,40349,40350,40351,40352,40353,40354,58002,58003,58004,58005,58006,58007,58008,58009,58010,58011,58012,58013,58014,58015,58016,58017,58018,58019,58020,58021,58022,58023,58024,58025,58026,58027,58028,58029,58030,58031,58032,58033,58034,58035,58036,58037,58038,58039,58040,58041,58042,58043,58044,58045,58046,58047,58048,58049,58050,58051,58052,58053,58054,58055,58056,58057,58058,58059,58060,58061,58062,58063,58064,58065,58066,58067,58068,58069,58070,58071,58072,58073,58074,58075,58076,58077,58078,58079,58080,58081,58082,58083,58084,58085,58086,58087,58088,58089,58090,58091,58092,58093,58094,58095,40355,40356,40357,40358,40359,40360,40361,40362,40363,40364,40365,40366,40367,40368,40369,40370,40371,40372,40373,40374,40375,40376,40377,40378,40379,40380,40381,40382,40383,40384,40385,40386,40387,40388,40389,40390,40391,40392,40393,40394,40395,40396,40397,40398,40399,40400,40401,40402,40403,40404,40405,40406,40407,40408,40409,40410,40411,40412,40413,40414,40415,40416,40417,40418,40419,40420,40421,40422,40423,40424,40425,40426,40427,40428,40429,40430,40431,40432,40433,40434,40435,40436,40437,40438,40439,40440,40441,40442,40443,40444,40445,40446,40447,40448,40449,40450,58096,58097,58098,58099,58100,58101,58102,58103,58104,58105,58106,58107,58108,58109,58110,58111,58112,58113,58114,58115,58116,58117,58118,58119,58120,58121,58122,58123,58124,58125,58126,58127,58128,58129,58130,58131,58132,58133,58134,58135,58136,58137,58138,58139,58140,58141,58142,58143,58144,58145,58146,58147,58148,58149,58150,58151,58152,58153,58154,58155,58156,58157,58158,58159,58160,58161,58162,58163,58164,58165,58166,58167,58168,58169,58170,58171,58172,58173,58174,58175,58176,58177,58178,58179,58180,58181,58182,58183,58184,58185,58186,58187,58188,58189,40451,40452,40453,40454,40455,40456,40457,40458,40459,40460,40461,40462,40463,40464,40465,40466,40467,40468,40469,40470,40471,40472,40473,40474,40475,40476,40477,40478,40484,40487,40494,40496,40500,40507,40508,40512,40525,40528,40530,40531,40532,40534,40537,40541,40543,40544,40545,40546,40549,40558,40559,40562,40564,40565,40566,40567,40568,40569,40570,40571,40572,40573,40576,40577,40579,40580,40581,40582,40585,40586,40588,40589,40590,40591,40592,40593,40596,40597,40598,40599,40600,40601,40602,40603,40604,40606,40608,40609,40610,40611,40612,40613,40615,40616,40617,40618,58190,58191,58192,58193,58194,58195,58196,58197,58198,58199,58200,58201,58202,58203,58204,58205,58206,58207,58208,58209,58210,58211,58212,58213,58214,58215,58216,58217,58218,58219,58220,58221,58222,58223,58224,58225,58226,58227,58228,58229,58230,58231,58232,58233,58234,58235,58236,58237,58238,58239,58240,58241,58242,58243,58244,58245,58246,58247,58248,58249,58250,58251,58252,58253,58254,58255,58256,58257,58258,58259,58260,58261,58262,58263,58264,58265,58266,58267,58268,58269,58270,58271,58272,58273,58274,58275,58276,58277,58278,58279,58280,58281,58282,58283,40619,40620,40621,40622,40623,40624,40625,40626,40627,40629,40630,40631,40633,40634,40636,40639,40640,40641,40642,40643,40645,40646,40647,40648,40650,40651,40652,40656,40658,40659,40661,40662,40663,40665,40666,40670,40673,40675,40676,40678,40680,40683,40684,40685,40686,40688,40689,40690,40691,40692,40693,40694,40695,40696,40698,40701,40703,40704,40705,40706,40707,40708,40709,40710,40711,40712,40713,40714,40716,40719,40721,40722,40724,40725,40726,40728,40730,40731,40732,40733,40734,40735,40737,40739,40740,40741,40742,40743,40744,40745,40746,40747,40749,40750,40752,40753,58284,58285,58286,58287,58288,58289,58290,58291,58292,58293,58294,58295,58296,58297,58298,58299,58300,58301,58302,58303,58304,58305,58306,58307,58308,58309,58310,58311,58312,58313,58314,58315,58316,58317,58318,58319,58320,58321,58322,58323,58324,58325,58326,58327,58328,58329,58330,58331,58332,58333,58334,58335,58336,58337,58338,58339,58340,58341,58342,58343,58344,58345,58346,58347,58348,58349,58350,58351,58352,58353,58354,58355,58356,58357,58358,58359,58360,58361,58362,58363,58364,58365,58366,58367,58368,58369,58370,58371,58372,58373,58374,58375,58376,58377,40754,40755,40756,40757,40758,40760,40762,40764,40767,40768,40769,40770,40771,40773,40774,40775,40776,40777,40778,40779,40780,40781,40782,40783,40786,40787,40788,40789,40790,40791,40792,40793,40794,40795,40796,40797,40798,40799,40800,40801,40802,40803,40804,40805,40806,40807,40808,40809,40810,40811,40812,40813,40814,40815,40816,40817,40818,40819,40820,40821,40822,40823,40824,40825,40826,40827,40828,40829,40830,40833,40834,40845,40846,40847,40848,40849,40850,40851,40852,40853,40854,40855,40856,40860,40861,40862,40865,40866,40867,40868,40869,63788,63865,63893,63975,63985,58378,58379,58380,58381,58382,58383,58384,58385,58386,58387,58388,58389,58390,58391,58392,58393,58394,58395,58396,58397,58398,58399,58400,58401,58402,58403,58404,58405,58406,58407,58408,58409,58410,58411,58412,58413,58414,58415,58416,58417,58418,58419,58420,58421,58422,58423,58424,58425,58426,58427,58428,58429,58430,58431,58432,58433,58434,58435,58436,58437,58438,58439,58440,58441,58442,58443,58444,58445,58446,58447,58448,58449,58450,58451,58452,58453,58454,58455,58456,58457,58458,58459,58460,58461,58462,58463,58464,58465,58466,58467,58468,58469,58470,58471,64012,64013,64014,64015,64017,64019,64020,64024,64031,64032,64033,64035,64036,64039,64040,64041,11905,59414,59415,59416,11908,13427,13383,11912,11915,59422,13726,13850,13838,11916,11927,14702,14616,59430,14799,14815,14963,14800,59435,59436,15182,15470,15584,11943,59441,59442,11946,16470,16735,11950,17207,11955,11958,11959,59451,17329,17324,11963,17373,17622,18017,17996,59459,18211,18217,18300,18317,11978,18759,18810,18813,18818,18819,18821,18822,18847,18843,18871,18870,59476,59477,19619,19615,19616,19617,19575,19618,19731,19732,19733,19734,19735,19736,19737,19886,59492,58472,58473,58474,58475,58476,58477,58478,58479,58480,58481,58482,58483,58484,58485,58486,58487,58488,58489,58490,58491,58492,58493,58494,58495,58496,58497,58498,58499,58500,58501,58502,58503,58504,58505,58506,58507,58508,58509,58510,58511,58512,58513,58514,58515,58516,58517,58518,58519,58520,58521,58522,58523,58524,58525,58526,58527,58528,58529,58530,58531,58532,58533,58534,58535,58536,58537,58538,58539,58540,58541,58542,58543,58544,58545,58546,58547,58548,58549,58550,58551,58552,58553,58554,58555,58556,58557,58558,58559,58560,58561,58562,58563,58564,58565], "gb18030-ranges":[[0,128],[36,165],[38,169],[45,178],[50,184],[81,216],[89,226],[95,235],[96,238],[100,244],[103,248],[104,251],[105,253],[109,258],[126,276],[133,284],[148,300],[172,325],[175,329],[179,334],[208,364],[306,463],[307,465],[308,467],[309,469],[310,471],[311,473],[312,475],[313,477],[341,506],[428,594],[443,610],[544,712],[545,716],[558,730],[741,930],[742,938],[749,962],[750,970],[805,1026],[819,1104],[820,1106],[7922,8209],[7924,8215],[7925,8218],[7927,8222],[7934,8231],[7943,8241],[7944,8244],[7945,8246],[7950,8252],[8062,8365],[8148,8452],[8149,8454],[8152,8458],[8164,8471],[8174,8482],[8236,8556],[8240,8570],[8262,8596],[8264,8602],[8374,8713],[8380,8720],[8381,8722],[8384,8726],[8388,8731],[8390,8737],[8392,8740],[8393,8742],[8394,8748],[8396,8751],[8401,8760],[8406,8766],[8416,8777],[8419,8781],[8424,8787],[8437,8802],[8439,8808],[8445,8816],[8482,8854],[8485,8858],[8496,8870],[8521,8896],[8603,8979],[8936,9322],[8946,9372],[9046,9548],[9050,9588],[9063,9616],[9066,9622],[9076,9634],[9092,9652],[9100,9662],[9108,9672],[9111,9676],[9113,9680],[9131,9702],[9162,9735],[9164,9738],[9218,9793],[9219,9795],[11329,11906],[11331,11909],[11334,11913],[11336,11917],[11346,11928],[11361,11944],[11363,11947],[11366,11951],[11370,11956],[11372,11960],[11375,11964],[11389,11979],[11682,12284],[11686,12292],[11687,12312],[11692,12319],[11694,12330],[11714,12351],[11716,12436],[11723,12447],[11725,12535],[11730,12543],[11736,12586],[11982,12842],[11989,12850],[12102,12964],[12336,13200],[12348,13215],[12350,13218],[12384,13253],[12393,13263],[12395,13267],[12397,13270],[12510,13384],[12553,13428],[12851,13727],[12962,13839],[12973,13851],[13738,14617],[13823,14703],[13919,14801],[13933,14816],[14080,14964],[14298,15183],[14585,15471],[14698,15585],[15583,16471],[15847,16736],[16318,17208],[16434,17325],[16438,17330],[16481,17374],[16729,17623],[17102,17997],[17122,18018],[17315,18212],[17320,18218],[17402,18301],[17418,18318],[17859,18760],[17909,18811],[17911,18814],[17915,18820],[17916,18823],[17936,18844],[17939,18848],[17961,18872],[18664,19576],[18703,19620],[18814,19738],[18962,19887],[19043,40870],[33469,59244],[33470,59336],[33471,59367],[33484,59413],[33485,59417],[33490,59423],[33497,59431],[33501,59437],[33505,59443],[33513,59452],[33520,59460],[33536,59478],[33550,59493],[37845,63789],[37921,63866],[37948,63894],[38029,63976],[38038,63986],[38064,64016],[38065,64018],[38066,64021],[38069,64025],[38075,64034],[38076,64037],[38078,64042],[39108,65074],[39109,65093],[39113,65107],[39114,65112],[39115,65127],[39116,65132],[39265,65375],[39394,65510],[189000,65536]], "jis0208":[12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293,12294,12295,12540,8213,8208,65295,65340,65374,8741,65372,8230,8229,8216,8217,8220,8221,65288,65289,12308,12309,65339,65341,65371,65373,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,65291,65293,177,215,247,65309,8800,65308,65310,8806,8807,8734,8756,9794,9792,176,8242,8243,8451,65509,65284,65504,65505,65285,65283,65286,65290,65312,167,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,8251,12306,8594,8592,8593,8595,12307,null,null,null,null,null,null,null,null,null,null,null,8712,8715,8838,8839,8834,8835,8746,8745,null,null,null,null,null,null,null,null,8743,8744,65506,8658,8660,8704,8707,null,null,null,null,null,null,null,null,null,null,null,8736,8869,8978,8706,8711,8801,8786,8810,8811,8730,8765,8733,8757,8747,8748,null,null,null,null,null,null,null,8491,8240,9839,9837,9834,8224,8225,182,null,null,null,null,9711,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,null,null,null,null,null,null,null,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,null,null,null,null,null,null,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,null,null,null,null,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,null,null,null,null,null,null,null,null,null,null,null,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,null,null,null,null,null,null,null,null,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,null,null,null,null,null,null,null,null,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,null,null,null,null,null,null,null,null,null,null,null,null,null,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,null,13129,13076,13090,13133,13080,13095,13059,13110,13137,13143,13069,13094,13091,13099,13130,13115,13212,13213,13214,13198,13199,13252,13217,null,null,null,null,null,null,null,null,13179,12317,12319,8470,13261,8481,12964,12965,12966,12967,12968,12849,12850,12857,13182,13181,13180,8786,8801,8747,8750,8721,8730,8869,8736,8735,8895,8757,8745,8746,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20124,21782,23043,38463,21696,24859,25384,23030,36898,33909,33564,31312,24746,25569,28197,26093,33894,33446,39925,26771,22311,26017,25201,23451,22992,34427,39156,32098,32190,39822,25110,31903,34999,23433,24245,25353,26263,26696,38343,38797,26447,20197,20234,20301,20381,20553,22258,22839,22996,23041,23561,24799,24847,24944,26131,26885,28858,30031,30064,31227,32173,32239,32963,33806,34915,35586,36949,36986,21307,20117,20133,22495,32946,37057,30959,19968,22769,28322,36920,31282,33576,33419,39983,20801,21360,21693,21729,22240,23035,24341,39154,28139,32996,34093,38498,38512,38560,38907,21515,21491,23431,28879,32701,36802,38632,21359,40284,31418,19985,30867,33276,28198,22040,21764,27421,34074,39995,23013,21417,28006,29916,38287,22082,20113,36939,38642,33615,39180,21473,21942,23344,24433,26144,26355,26628,27704,27891,27945,29787,30408,31310,38964,33521,34907,35424,37613,28082,30123,30410,39365,24742,35585,36234,38322,27022,21421,20870,22290,22576,22852,23476,24310,24616,25513,25588,27839,28436,28814,28948,29017,29141,29503,32257,33398,33489,34199,36960,37467,40219,22633,26044,27738,29989,20985,22830,22885,24448,24540,25276,26106,27178,27431,27572,29579,32705,35158,40236,40206,40644,23713,27798,33659,20740,23627,25014,33222,26742,29281,20057,20474,21368,24681,28201,31311,38899,19979,21270,20206,20309,20285,20385,20339,21152,21487,22025,22799,23233,23478,23521,31185,26247,26524,26550,27468,27827,28779,29634,31117,31166,31292,31623,33457,33499,33540,33655,33775,33747,34662,35506,22057,36008,36838,36942,38686,34442,20420,23784,25105,29273,30011,33253,33469,34558,36032,38597,39187,39381,20171,20250,35299,22238,22602,22730,24315,24555,24618,24724,24674,25040,25106,25296,25913,39745,26214,26800,28023,28784,30028,30342,32117,33445,34809,38283,38542,35997,20977,21182,22806,21683,23475,23830,24936,27010,28079,30861,33995,34903,35442,37799,39608,28012,39336,34521,22435,26623,34510,37390,21123,22151,21508,24275,25313,25785,26684,26680,27579,29554,30906,31339,35226,35282,36203,36611,37101,38307,38548,38761,23398,23731,27005,38989,38990,25499,31520,27179,27263,26806,39949,28511,21106,21917,24688,25324,27963,28167,28369,33883,35088,36676,19988,39993,21494,26907,27194,38788,26666,20828,31427,33970,37340,37772,22107,40232,26658,33541,33841,31909,21000,33477,29926,20094,20355,20896,23506,21002,21208,21223,24059,21914,22570,23014,23436,23448,23515,24178,24185,24739,24863,24931,25022,25563,25954,26577,26707,26874,27454,27475,27735,28450,28567,28485,29872,29976,30435,30475,31487,31649,31777,32233,32566,32752,32925,33382,33694,35251,35532,36011,36996,37969,38291,38289,38306,38501,38867,39208,33304,20024,21547,23736,24012,29609,30284,30524,23721,32747,36107,38593,38929,38996,39000,20225,20238,21361,21916,22120,22522,22855,23305,23492,23696,24076,24190,24524,25582,26426,26071,26082,26399,26827,26820,27231,24112,27589,27671,27773,30079,31048,23395,31232,32000,24509,35215,35352,36020,36215,36556,36637,39138,39438,39740,20096,20605,20736,22931,23452,25135,25216,25836,27450,29344,30097,31047,32681,34811,35516,35696,25516,33738,38816,21513,21507,21931,26708,27224,35440,30759,26485,40653,21364,23458,33050,34384,36870,19992,20037,20167,20241,21450,21560,23470,24339,24613,25937,26429,27714,27762,27875,28792,29699,31350,31406,31496,32026,31998,32102,26087,29275,21435,23621,24040,25298,25312,25369,28192,34394,35377,36317,37624,28417,31142,39770,20136,20139,20140,20379,20384,20689,20807,31478,20849,20982,21332,21281,21375,21483,21932,22659,23777,24375,24394,24623,24656,24685,25375,25945,27211,27841,29378,29421,30703,33016,33029,33288,34126,37111,37857,38911,39255,39514,20208,20957,23597,26241,26989,23616,26354,26997,29577,26704,31873,20677,21220,22343,24062,37670,26020,27427,27453,29748,31105,31165,31563,32202,33465,33740,34943,35167,35641,36817,37329,21535,37504,20061,20534,21477,21306,29399,29590,30697,33510,36527,39366,39368,39378,20855,24858,34398,21936,31354,20598,23507,36935,38533,20018,27355,37351,23633,23624,25496,31391,27795,38772,36705,31402,29066,38536,31874,26647,32368,26705,37740,21234,21531,34219,35347,32676,36557,37089,21350,34952,31041,20418,20670,21009,20804,21843,22317,29674,22411,22865,24418,24452,24693,24950,24935,25001,25522,25658,25964,26223,26690,28179,30054,31293,31995,32076,32153,32331,32619,33550,33610,34509,35336,35427,35686,36605,38938,40335,33464,36814,39912,21127,25119,25731,28608,38553,26689,20625,27424,27770,28500,31348,32080,34880,35363,26376,20214,20537,20518,20581,20860,21048,21091,21927,22287,22533,23244,24314,25010,25080,25331,25458,26908,27177,29309,29356,29486,30740,30831,32121,30476,32937,35211,35609,36066,36562,36963,37749,38522,38997,39443,40568,20803,21407,21427,24187,24358,28187,28304,29572,29694,32067,33335,35328,35578,38480,20046,20491,21476,21628,22266,22993,23396,24049,24235,24359,25144,25925,26543,28246,29392,31946,34996,32929,32993,33776,34382,35463,36328,37431,38599,39015,40723,20116,20114,20237,21320,21577,21566,23087,24460,24481,24735,26791,27278,29786,30849,35486,35492,35703,37264,20062,39881,20132,20348,20399,20505,20502,20809,20844,21151,21177,21246,21402,21475,21521,21518,21897,22353,22434,22909,23380,23389,23439,24037,24039,24055,24184,24195,24218,24247,24344,24658,24908,25239,25304,25511,25915,26114,26179,26356,26477,26657,26775,27083,27743,27946,28009,28207,28317,30002,30343,30828,31295,31968,32005,32024,32094,32177,32789,32771,32943,32945,33108,33167,33322,33618,34892,34913,35611,36002,36092,37066,37237,37489,30783,37628,38308,38477,38917,39321,39640,40251,21083,21163,21495,21512,22741,25335,28640,35946,36703,40633,20811,21051,21578,22269,31296,37239,40288,40658,29508,28425,33136,29969,24573,24794,39592,29403,36796,27492,38915,20170,22256,22372,22718,23130,24680,25031,26127,26118,26681,26801,28151,30165,32058,33390,39746,20123,20304,21449,21766,23919,24038,24046,26619,27801,29811,30722,35408,37782,35039,22352,24231,25387,20661,20652,20877,26368,21705,22622,22971,23472,24425,25165,25505,26685,27507,28168,28797,37319,29312,30741,30758,31085,25998,32048,33756,35009,36617,38555,21092,22312,26448,32618,36001,20916,22338,38442,22586,27018,32948,21682,23822,22524,30869,40442,20316,21066,21643,25662,26152,26388,26613,31364,31574,32034,37679,26716,39853,31545,21273,20874,21047,23519,25334,25774,25830,26413,27578,34217,38609,30352,39894,25420,37638,39851,30399,26194,19977,20632,21442,23665,24808,25746,25955,26719,29158,29642,29987,31639,32386,34453,35715,36059,37240,39184,26028,26283,27531,20181,20180,20282,20351,21050,21496,21490,21987,22235,22763,22987,22985,23039,23376,23629,24066,24107,24535,24605,25351,25903,23388,26031,26045,26088,26525,27490,27515,27663,29509,31049,31169,31992,32025,32043,32930,33026,33267,35222,35422,35433,35430,35468,35566,36039,36060,38604,39164,27503,20107,20284,20365,20816,23383,23546,24904,25345,26178,27425,28363,27835,29246,29885,30164,30913,31034,32780,32819,33258,33940,36766,27728,40575,24335,35672,40235,31482,36600,23437,38635,19971,21489,22519,22833,23241,23460,24713,28287,28422,30142,36074,23455,34048,31712,20594,26612,33437,23649,34122,32286,33294,20889,23556,25448,36198,26012,29038,31038,32023,32773,35613,36554,36974,34503,37034,20511,21242,23610,26451,28796,29237,37196,37320,37675,33509,23490,24369,24825,20027,21462,23432,25163,26417,27530,29417,29664,31278,33131,36259,37202,39318,20754,21463,21610,23551,25480,27193,32172,38656,22234,21454,21608,23447,23601,24030,20462,24833,25342,27954,31168,31179,32066,32333,32722,33261,33311,33936,34886,35186,35728,36468,36655,36913,37195,37228,38598,37276,20160,20303,20805,21313,24467,25102,26580,27713,28171,29539,32294,37325,37507,21460,22809,23487,28113,31069,32302,31899,22654,29087,20986,34899,36848,20426,23803,26149,30636,31459,33308,39423,20934,24490,26092,26991,27529,28147,28310,28516,30462,32020,24033,36981,37255,38918,20966,21021,25152,26257,26329,28186,24246,32210,32626,26360,34223,34295,35576,21161,21465,22899,24207,24464,24661,37604,38500,20663,20767,21213,21280,21319,21484,21736,21830,21809,22039,22888,22974,23100,23477,23558,23567,23569,23578,24196,24202,24288,24432,25215,25220,25307,25484,25463,26119,26124,26157,26230,26494,26786,27167,27189,27836,28040,28169,28248,28988,28966,29031,30151,30465,30813,30977,31077,31216,31456,31505,31911,32057,32918,33750,33931,34121,34909,35059,35359,35388,35412,35443,35937,36062,37284,37478,37758,37912,38556,38808,19978,19976,19998,20055,20887,21104,22478,22580,22732,23330,24120,24773,25854,26465,26454,27972,29366,30067,31331,33976,35698,37304,37664,22065,22516,39166,25325,26893,27542,29165,32340,32887,33394,35302,39135,34645,36785,23611,20280,20449,20405,21767,23072,23517,23529,24515,24910,25391,26032,26187,26862,27035,28024,28145,30003,30137,30495,31070,31206,32051,33251,33455,34218,35242,35386,36523,36763,36914,37341,38663,20154,20161,20995,22645,22764,23563,29978,23613,33102,35338,36805,38499,38765,31525,35535,38920,37218,22259,21416,36887,21561,22402,24101,25512,27700,28810,30561,31883,32736,34928,36930,37204,37648,37656,38543,29790,39620,23815,23913,25968,26530,36264,38619,25454,26441,26905,33733,38935,38592,35070,28548,25722,23544,19990,28716,30045,26159,20932,21046,21218,22995,24449,24615,25104,25919,25972,26143,26228,26866,26646,27491,28165,29298,29983,30427,31934,32854,22768,35069,35199,35488,35475,35531,36893,37266,38738,38745,25993,31246,33030,38587,24109,24796,25114,26021,26132,26512,30707,31309,31821,32318,33034,36012,36196,36321,36447,30889,20999,25305,25509,25666,25240,35373,31363,31680,35500,38634,32118,33292,34633,20185,20808,21315,21344,23459,23554,23574,24029,25126,25159,25776,26643,26676,27849,27973,27927,26579,28508,29006,29053,26059,31359,31661,32218,32330,32680,33146,33307,33337,34214,35438,36046,36341,36984,36983,37549,37521,38275,39854,21069,21892,28472,28982,20840,31109,32341,33203,31950,22092,22609,23720,25514,26366,26365,26970,29401,30095,30094,30990,31062,31199,31895,32032,32068,34311,35380,38459,36961,40736,20711,21109,21452,21474,20489,21930,22766,22863,29245,23435,23652,21277,24803,24819,25436,25475,25407,25531,25805,26089,26361,24035,27085,27133,28437,29157,20105,30185,30456,31379,31967,32207,32156,32865,33609,33624,33900,33980,34299,35013,36208,36865,36973,37783,38684,39442,20687,22679,24974,33235,34101,36104,36896,20419,20596,21063,21363,24687,25417,26463,28204,36275,36895,20439,23646,36042,26063,32154,21330,34966,20854,25539,23384,23403,23562,25613,26449,36956,20182,22810,22826,27760,35409,21822,22549,22949,24816,25171,26561,33333,26965,38464,39364,39464,20307,22534,23550,32784,23729,24111,24453,24608,24907,25140,26367,27888,28382,32974,33151,33492,34955,36024,36864,36910,38538,40667,39899,20195,21488,22823,31532,37261,38988,40441,28381,28711,21331,21828,23429,25176,25246,25299,27810,28655,29730,35351,37944,28609,35582,33592,20967,34552,21482,21481,20294,36948,36784,22890,33073,24061,31466,36799,26842,35895,29432,40008,27197,35504,20025,21336,22022,22374,25285,25506,26086,27470,28129,28251,28845,30701,31471,31658,32187,32829,32966,34507,35477,37723,22243,22727,24382,26029,26262,27264,27573,30007,35527,20516,30693,22320,24347,24677,26234,27744,30196,31258,32622,33268,34584,36933,39347,31689,30044,31481,31569,33988,36880,31209,31378,33590,23265,30528,20013,20210,23449,24544,25277,26172,26609,27880,34411,34935,35387,37198,37619,39376,27159,28710,29482,33511,33879,36015,19969,20806,20939,21899,23541,24086,24115,24193,24340,24373,24427,24500,25074,25361,26274,26397,28526,29266,30010,30522,32884,33081,33144,34678,35519,35548,36229,36339,37530,38263,38914,40165,21189,25431,30452,26389,27784,29645,36035,37806,38515,27941,22684,26894,27084,36861,37786,30171,36890,22618,26626,25524,27131,20291,28460,26584,36795,34086,32180,37716,26943,28528,22378,22775,23340,32044,29226,21514,37347,40372,20141,20302,20572,20597,21059,35998,21576,22564,23450,24093,24213,24237,24311,24351,24716,25269,25402,25552,26799,27712,30855,31118,31243,32224,33351,35330,35558,36420,36883,37048,37165,37336,40718,27877,25688,25826,25973,28404,30340,31515,36969,37841,28346,21746,24505,25764,36685,36845,37444,20856,22635,22825,23637,24215,28155,32399,29980,36028,36578,39003,28857,20253,27583,28593,30000,38651,20814,21520,22581,22615,22956,23648,24466,26007,26460,28193,30331,33759,36077,36884,37117,37709,30757,30778,21162,24230,22303,22900,24594,20498,20826,20908,20941,20992,21776,22612,22616,22871,23445,23798,23947,24764,25237,25645,26481,26691,26812,26847,30423,28120,28271,28059,28783,29128,24403,30168,31095,31561,31572,31570,31958,32113,21040,33891,34153,34276,35342,35588,35910,36367,36867,36879,37913,38518,38957,39472,38360,20685,21205,21516,22530,23566,24999,25758,27934,30643,31461,33012,33796,36947,37509,23776,40199,21311,24471,24499,28060,29305,30563,31167,31716,27602,29420,35501,26627,27233,20984,31361,26932,23626,40182,33515,23493,37193,28702,22136,23663,24775,25958,27788,35930,36929,38931,21585,26311,37389,22856,37027,20869,20045,20970,34201,35598,28760,25466,37707,26978,39348,32260,30071,21335,26976,36575,38627,27741,20108,23612,24336,36841,21250,36049,32905,34425,24319,26085,20083,20837,22914,23615,38894,20219,22922,24525,35469,28641,31152,31074,23527,33905,29483,29105,24180,24565,25467,25754,29123,31896,20035,24316,20043,22492,22178,24745,28611,32013,33021,33075,33215,36786,35223,34468,24052,25226,25773,35207,26487,27874,27966,29750,30772,23110,32629,33453,39340,20467,24259,25309,25490,25943,26479,30403,29260,32972,32954,36649,37197,20493,22521,23186,26757,26995,29028,29437,36023,22770,36064,38506,36889,34687,31204,30695,33833,20271,21093,21338,25293,26575,27850,30333,31636,31893,33334,34180,36843,26333,28448,29190,32283,33707,39361,40614,20989,31665,30834,31672,32903,31560,27368,24161,32908,30033,30048,20843,37474,28300,30330,37271,39658,20240,32624,25244,31567,38309,40169,22138,22617,34532,38588,20276,21028,21322,21453,21467,24070,25644,26001,26495,27710,27726,29256,29359,29677,30036,32321,33324,34281,36009,31684,37318,29033,38930,39151,25405,26217,30058,30436,30928,34115,34542,21290,21329,21542,22915,24199,24444,24754,25161,25209,25259,26000,27604,27852,30130,30382,30865,31192,32203,32631,32933,34987,35513,36027,36991,38750,39131,27147,31800,20633,23614,24494,26503,27608,29749,30473,32654,40763,26570,31255,21305,30091,39661,24422,33181,33777,32920,24380,24517,30050,31558,36924,26727,23019,23195,32016,30334,35628,20469,24426,27161,27703,28418,29922,31080,34920,35413,35961,24287,25551,30149,31186,33495,37672,37618,33948,34541,39981,21697,24428,25996,27996,28693,36007,36051,38971,25935,29942,19981,20184,22496,22827,23142,23500,20904,24067,24220,24598,25206,25975,26023,26222,28014,29238,31526,33104,33178,33433,35676,36000,36070,36212,38428,38468,20398,25771,27494,33310,33889,34154,37096,23553,26963,39080,33914,34135,20239,21103,24489,24133,26381,31119,33145,35079,35206,28149,24343,25173,27832,20175,29289,39826,20998,21563,22132,22707,24996,25198,28954,22894,31881,31966,32027,38640,25991,32862,19993,20341,20853,22592,24163,24179,24330,26564,20006,34109,38281,38491,31859,38913,20731,22721,30294,30887,21029,30629,34065,31622,20559,22793,29255,31687,32232,36794,36820,36941,20415,21193,23081,24321,38829,20445,33303,37610,22275,25429,27497,29995,35036,36628,31298,21215,22675,24917,25098,26286,27597,31807,33769,20515,20472,21253,21574,22577,22857,23453,23792,23791,23849,24214,25265,25447,25918,26041,26379,27861,27873,28921,30770,32299,32990,33459,33804,34028,34562,35090,35370,35914,37030,37586,39165,40179,40300,20047,20129,20621,21078,22346,22952,24125,24536,24537,25151,26292,26395,26576,26834,20882,32033,32938,33192,35584,35980,36031,37502,38450,21536,38956,21271,20693,21340,22696,25778,26420,29287,30566,31302,37350,21187,27809,27526,22528,24140,22868,26412,32763,20961,30406,25705,30952,39764,40635,22475,22969,26151,26522,27598,21737,27097,24149,33180,26517,39850,26622,40018,26717,20134,20451,21448,25273,26411,27819,36804,20397,32365,40639,19975,24930,28288,28459,34067,21619,26410,39749,24051,31637,23724,23494,34588,28234,34001,31252,33032,22937,31885,27665,30496,21209,22818,28961,29279,30683,38695,40289,26891,23167,23064,20901,21517,21629,26126,30431,36855,37528,40180,23018,29277,28357,20813,26825,32191,32236,38754,40634,25720,27169,33538,22916,23391,27611,29467,30450,32178,32791,33945,20786,26408,40665,30446,26466,21247,39173,23588,25147,31870,36016,21839,24758,32011,38272,21249,20063,20918,22812,29242,32822,37326,24357,30690,21380,24441,32004,34220,35379,36493,38742,26611,34222,37971,24841,24840,27833,30290,35565,36664,21807,20305,20778,21191,21451,23461,24189,24736,24962,25558,26377,26586,28263,28044,29494,29495,30001,31056,35029,35480,36938,37009,37109,38596,34701,22805,20104,20313,19982,35465,36671,38928,20653,24188,22934,23481,24248,25562,25594,25793,26332,26954,27096,27915,28342,29076,29992,31407,32650,32768,33865,33993,35201,35617,36362,36965,38525,39178,24958,25233,27442,27779,28020,32716,32764,28096,32645,34746,35064,26469,33713,38972,38647,27931,32097,33853,37226,20081,21365,23888,27396,28651,34253,34349,35239,21033,21519,23653,26446,26792,29702,29827,30178,35023,35041,37324,38626,38520,24459,29575,31435,33870,25504,30053,21129,27969,28316,29705,30041,30827,31890,38534,31452,40845,20406,24942,26053,34396,20102,20142,20698,20001,20940,23534,26009,26753,28092,29471,30274,30637,31260,31975,33391,35538,36988,37327,38517,38936,21147,32209,20523,21400,26519,28107,29136,29747,33256,36650,38563,40023,40607,29792,22593,28057,32047,39006,20196,20278,20363,20919,21169,23994,24604,29618,31036,33491,37428,38583,38646,38666,40599,40802,26278,27508,21015,21155,28872,35010,24265,24651,24976,28451,29001,31806,32244,32879,34030,36899,37676,21570,39791,27347,28809,36034,36335,38706,21172,23105,24266,24324,26391,27004,27028,28010,28431,29282,29436,31725,32769,32894,34635,37070,20845,40595,31108,32907,37682,35542,20525,21644,35441,27498,36036,33031,24785,26528,40434,20121,20120,39952,35435,34241,34152,26880,28286,30871,33109,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,24332,19984,19989,20010,20017,20022,20028,20031,20034,20054,20056,20098,20101,35947,20106,33298,24333,20110,20126,20127,20128,20130,20144,20147,20150,20174,20173,20164,20166,20162,20183,20190,20205,20191,20215,20233,20314,20272,20315,20317,20311,20295,20342,20360,20367,20376,20347,20329,20336,20369,20335,20358,20374,20760,20436,20447,20430,20440,20443,20433,20442,20432,20452,20453,20506,20520,20500,20522,20517,20485,20252,20470,20513,20521,20524,20478,20463,20497,20486,20547,20551,26371,20565,20560,20552,20570,20566,20588,20600,20608,20634,20613,20660,20658,20681,20682,20659,20674,20694,20702,20709,20717,20707,20718,20729,20725,20745,20737,20738,20758,20757,20756,20762,20769,20794,20791,20796,20795,20799,20800,20818,20812,20820,20834,31480,20841,20842,20846,20864,20866,22232,20876,20873,20879,20881,20883,20885,20886,20900,20902,20898,20905,20906,20907,20915,20913,20914,20912,20917,20925,20933,20937,20955,20960,34389,20969,20973,20976,20981,20990,20996,21003,21012,21006,21031,21034,21038,21043,21049,21071,21060,21067,21068,21086,21076,21098,21108,21097,21107,21119,21117,21133,21140,21138,21105,21128,21137,36776,36775,21164,21165,21180,21173,21185,21197,21207,21214,21219,21222,39149,21216,21235,21237,21240,21241,21254,21256,30008,21261,21264,21263,21269,21274,21283,21295,21297,21299,21304,21312,21318,21317,19991,21321,21325,20950,21342,21353,21358,22808,21371,21367,21378,21398,21408,21414,21413,21422,21424,21430,21443,31762,38617,21471,26364,29166,21486,21480,21485,21498,21505,21565,21568,21548,21549,21564,21550,21558,21545,21533,21582,21647,21621,21646,21599,21617,21623,21616,21650,21627,21632,21622,21636,21648,21638,21703,21666,21688,21669,21676,21700,21704,21672,21675,21698,21668,21694,21692,21720,21733,21734,21775,21780,21757,21742,21741,21754,21730,21817,21824,21859,21836,21806,21852,21829,21846,21847,21816,21811,21853,21913,21888,21679,21898,21919,21883,21886,21912,21918,21934,21884,21891,21929,21895,21928,21978,21957,21983,21956,21980,21988,21972,22036,22007,22038,22014,22013,22043,22009,22094,22096,29151,22068,22070,22066,22072,22123,22116,22063,22124,22122,22150,22144,22154,22176,22164,22159,22181,22190,22198,22196,22210,22204,22209,22211,22208,22216,22222,22225,22227,22231,22254,22265,22272,22271,22276,22281,22280,22283,22285,22291,22296,22294,21959,22300,22310,22327,22328,22350,22331,22336,22351,22377,22464,22408,22369,22399,22409,22419,22432,22451,22436,22442,22448,22467,22470,22484,22482,22483,22538,22486,22499,22539,22553,22557,22642,22561,22626,22603,22640,27584,22610,22589,22649,22661,22713,22687,22699,22714,22750,22715,22712,22702,22725,22739,22737,22743,22745,22744,22757,22748,22756,22751,22767,22778,22777,22779,22780,22781,22786,22794,22800,22811,26790,22821,22828,22829,22834,22840,22846,31442,22869,22864,22862,22874,22872,22882,22880,22887,22892,22889,22904,22913,22941,20318,20395,22947,22962,22982,23016,23004,22925,23001,23002,23077,23071,23057,23068,23049,23066,23104,23148,23113,23093,23094,23138,23146,23194,23228,23230,23243,23234,23229,23267,23255,23270,23273,23254,23290,23291,23308,23307,23318,23346,23248,23338,23350,23358,23363,23365,23360,23377,23381,23386,23387,23397,23401,23408,23411,23413,23416,25992,23418,23424,23427,23462,23480,23491,23495,23497,23508,23504,23524,23526,23522,23518,23525,23531,23536,23542,23539,23557,23559,23560,23565,23571,23584,23586,23592,23608,23609,23617,23622,23630,23635,23632,23631,23409,23660,23662,20066,23670,23673,23692,23697,23700,22939,23723,23739,23734,23740,23735,23749,23742,23751,23769,23785,23805,23802,23789,23948,23786,23819,23829,23831,23900,23839,23835,23825,23828,23842,23834,23833,23832,23884,23890,23886,23883,23916,23923,23926,23943,23940,23938,23970,23965,23980,23982,23997,23952,23991,23996,24009,24013,24019,24018,24022,24027,24043,24050,24053,24075,24090,24089,24081,24091,24118,24119,24132,24131,24128,24142,24151,24148,24159,24162,24164,24135,24181,24182,24186,40636,24191,24224,24257,24258,24264,24272,24271,24278,24291,24285,24282,24283,24290,24289,24296,24297,24300,24305,24307,24304,24308,24312,24318,24323,24329,24413,24412,24331,24337,24342,24361,24365,24376,24385,24392,24396,24398,24367,24401,24406,24407,24409,24417,24429,24435,24439,24451,24450,24447,24458,24456,24465,24455,24478,24473,24472,24480,24488,24493,24508,24534,24571,24548,24568,24561,24541,24755,24575,24609,24672,24601,24592,24617,24590,24625,24603,24597,24619,24614,24591,24634,24666,24641,24682,24695,24671,24650,24646,24653,24675,24643,24676,24642,24684,24683,24665,24705,24717,24807,24707,24730,24708,24731,24726,24727,24722,24743,24715,24801,24760,24800,24787,24756,24560,24765,24774,24757,24792,24909,24853,24838,24822,24823,24832,24820,24826,24835,24865,24827,24817,24845,24846,24903,24894,24872,24871,24906,24895,24892,24876,24884,24893,24898,24900,24947,24951,24920,24921,24922,24939,24948,24943,24933,24945,24927,24925,24915,24949,24985,24982,24967,25004,24980,24986,24970,24977,25003,25006,25036,25034,25033,25079,25032,25027,25030,25018,25035,32633,25037,25062,25059,25078,25082,25076,25087,25085,25084,25086,25088,25096,25097,25101,25100,25108,25115,25118,25121,25130,25134,25136,25138,25139,25153,25166,25182,25187,25179,25184,25192,25212,25218,25225,25214,25234,25235,25238,25300,25219,25236,25303,25297,25275,25295,25343,25286,25812,25288,25308,25292,25290,25282,25287,25243,25289,25356,25326,25329,25383,25346,25352,25327,25333,25424,25406,25421,25628,25423,25494,25486,25472,25515,25462,25507,25487,25481,25503,25525,25451,25449,25534,25577,25536,25542,25571,25545,25554,25590,25540,25622,25652,25606,25619,25638,25654,25885,25623,25640,25615,25703,25711,25718,25678,25898,25749,25747,25765,25769,25736,25788,25818,25810,25797,25799,25787,25816,25794,25841,25831,33289,25824,25825,25260,25827,25839,25900,25846,25844,25842,25850,25856,25853,25880,25884,25861,25892,25891,25899,25908,25909,25911,25910,25912,30027,25928,25942,25941,25933,25944,25950,25949,25970,25976,25986,25987,35722,26011,26015,26027,26039,26051,26054,26049,26052,26060,26066,26075,26073,26080,26081,26097,26482,26122,26115,26107,26483,26165,26166,26164,26140,26191,26180,26185,26177,26206,26205,26212,26215,26216,26207,26210,26224,26243,26248,26254,26249,26244,26264,26269,26305,26297,26313,26302,26300,26308,26296,26326,26330,26336,26175,26342,26345,26352,26357,26359,26383,26390,26398,26406,26407,38712,26414,26431,26422,26433,26424,26423,26438,26462,26464,26457,26467,26468,26505,26480,26537,26492,26474,26508,26507,26534,26529,26501,26551,26607,26548,26604,26547,26601,26552,26596,26590,26589,26594,26606,26553,26574,26566,26599,27292,26654,26694,26665,26688,26701,26674,26702,26803,26667,26713,26723,26743,26751,26783,26767,26797,26772,26781,26779,26755,27310,26809,26740,26805,26784,26810,26895,26765,26750,26881,26826,26888,26840,26914,26918,26849,26892,26829,26836,26855,26837,26934,26898,26884,26839,26851,26917,26873,26848,26863,26920,26922,26906,26915,26913,26822,27001,26999,26972,27000,26987,26964,27006,26990,26937,26996,26941,26969,26928,26977,26974,26973,27009,26986,27058,27054,27088,27071,27073,27091,27070,27086,23528,27082,27101,27067,27075,27047,27182,27025,27040,27036,27029,27060,27102,27112,27138,27163,27135,27402,27129,27122,27111,27141,27057,27166,27117,27156,27115,27146,27154,27329,27171,27155,27204,27148,27250,27190,27256,27207,27234,27225,27238,27208,27192,27170,27280,27277,27296,27268,27298,27299,27287,34327,27323,27331,27330,27320,27315,27308,27358,27345,27359,27306,27354,27370,27387,27397,34326,27386,27410,27414,39729,27423,27448,27447,30428,27449,39150,27463,27459,27465,27472,27481,27476,27483,27487,27489,27512,27513,27519,27520,27524,27523,27533,27544,27541,27550,27556,27562,27563,27567,27570,27569,27571,27575,27580,27590,27595,27603,27615,27628,27627,27635,27631,40638,27656,27667,27668,27675,27684,27683,27742,27733,27746,27754,27778,27789,27802,27777,27803,27774,27752,27763,27794,27792,27844,27889,27859,27837,27863,27845,27869,27822,27825,27838,27834,27867,27887,27865,27882,27935,34893,27958,27947,27965,27960,27929,27957,27955,27922,27916,28003,28051,28004,27994,28025,27993,28046,28053,28644,28037,28153,28181,28170,28085,28103,28134,28088,28102,28140,28126,28108,28136,28114,28101,28154,28121,28132,28117,28138,28142,28205,28270,28206,28185,28274,28255,28222,28195,28267,28203,28278,28237,28191,28227,28218,28238,28196,28415,28189,28216,28290,28330,28312,28361,28343,28371,28349,28335,28356,28338,28372,28373,28303,28325,28354,28319,28481,28433,28748,28396,28408,28414,28479,28402,28465,28399,28466,28364,28478,28435,28407,28550,28538,28536,28545,28544,28527,28507,28659,28525,28546,28540,28504,28558,28561,28610,28518,28595,28579,28577,28580,28601,28614,28586,28639,28629,28652,28628,28632,28657,28654,28635,28681,28683,28666,28689,28673,28687,28670,28699,28698,28532,28701,28696,28703,28720,28734,28722,28753,28771,28825,28818,28847,28913,28844,28856,28851,28846,28895,28875,28893,28889,28937,28925,28956,28953,29029,29013,29064,29030,29026,29004,29014,29036,29071,29179,29060,29077,29096,29100,29143,29113,29118,29138,29129,29140,29134,29152,29164,29159,29173,29180,29177,29183,29197,29200,29211,29224,29229,29228,29232,29234,29243,29244,29247,29248,29254,29259,29272,29300,29310,29314,29313,29319,29330,29334,29346,29351,29369,29362,29379,29382,29380,29390,29394,29410,29408,29409,29433,29431,20495,29463,29450,29468,29462,29469,29492,29487,29481,29477,29502,29518,29519,40664,29527,29546,29544,29552,29560,29557,29563,29562,29640,29619,29646,29627,29632,29669,29678,29662,29858,29701,29807,29733,29688,29746,29754,29781,29759,29791,29785,29761,29788,29801,29808,29795,29802,29814,29822,29835,29854,29863,29898,29903,29908,29681,29920,29923,29927,29929,29934,29938,29936,29937,29944,29943,29956,29955,29957,29964,29966,29965,29973,29971,29982,29990,29996,30012,30020,30029,30026,30025,30043,30022,30042,30057,30052,30055,30059,30061,30072,30070,30086,30087,30068,30090,30089,30082,30100,30106,30109,30117,30115,30146,30131,30147,30133,30141,30136,30140,30129,30157,30154,30162,30169,30179,30174,30206,30207,30204,30209,30192,30202,30194,30195,30219,30221,30217,30239,30247,30240,30241,30242,30244,30260,30256,30267,30279,30280,30278,30300,30296,30305,30306,30312,30313,30314,30311,30316,30320,30322,30326,30328,30332,30336,30339,30344,30347,30350,30358,30355,30361,30362,30384,30388,30392,30393,30394,30402,30413,30422,30418,30430,30433,30437,30439,30442,34351,30459,30472,30471,30468,30505,30500,30494,30501,30502,30491,30519,30520,30535,30554,30568,30571,30555,30565,30591,30590,30585,30606,30603,30609,30624,30622,30640,30646,30649,30655,30652,30653,30651,30663,30669,30679,30682,30684,30691,30702,30716,30732,30738,31014,30752,31018,30789,30862,30836,30854,30844,30874,30860,30883,30901,30890,30895,30929,30918,30923,30932,30910,30908,30917,30922,30956,30951,30938,30973,30964,30983,30994,30993,31001,31020,31019,31040,31072,31063,31071,31066,31061,31059,31098,31103,31114,31133,31143,40779,31146,31150,31155,31161,31162,31177,31189,31207,31212,31201,31203,31240,31245,31256,31257,31264,31263,31104,31281,31291,31294,31287,31299,31319,31305,31329,31330,31337,40861,31344,31353,31357,31368,31383,31381,31384,31382,31401,31432,31408,31414,31429,31428,31423,36995,31431,31434,31437,31439,31445,31443,31449,31450,31453,31457,31458,31462,31469,31472,31490,31503,31498,31494,31539,31512,31513,31518,31541,31528,31542,31568,31610,31492,31565,31499,31564,31557,31605,31589,31604,31591,31600,31601,31596,31598,31645,31640,31647,31629,31644,31642,31627,31634,31631,31581,31641,31691,31681,31692,31695,31668,31686,31709,31721,31761,31764,31718,31717,31840,31744,31751,31763,31731,31735,31767,31757,31734,31779,31783,31786,31775,31799,31787,31805,31820,31811,31828,31823,31808,31824,31832,31839,31844,31830,31845,31852,31861,31875,31888,31908,31917,31906,31915,31905,31912,31923,31922,31921,31918,31929,31933,31936,31941,31938,31960,31954,31964,31970,39739,31983,31986,31988,31990,31994,32006,32002,32028,32021,32010,32069,32075,32046,32050,32063,32053,32070,32115,32086,32078,32114,32104,32110,32079,32099,32147,32137,32091,32143,32125,32155,32186,32174,32163,32181,32199,32189,32171,32317,32162,32175,32220,32184,32159,32176,32216,32221,32228,32222,32251,32242,32225,32261,32266,32291,32289,32274,32305,32287,32265,32267,32290,32326,32358,32315,32309,32313,32323,32311,32306,32314,32359,32349,32342,32350,32345,32346,32377,32362,32361,32380,32379,32387,32213,32381,36782,32383,32392,32393,32396,32402,32400,32403,32404,32406,32398,32411,32412,32568,32570,32581,32588,32589,32590,32592,32593,32597,32596,32600,32607,32608,32616,32617,32615,32632,32642,32646,32643,32648,32647,32652,32660,32670,32669,32666,32675,32687,32690,32697,32686,32694,32696,35697,32709,32710,32714,32725,32724,32737,32742,32745,32755,32761,39132,32774,32772,32779,32786,32792,32793,32796,32801,32808,32831,32827,32842,32838,32850,32856,32858,32863,32866,32872,32883,32882,32880,32886,32889,32893,32895,32900,32902,32901,32923,32915,32922,32941,20880,32940,32987,32997,32985,32989,32964,32986,32982,33033,33007,33009,33051,33065,33059,33071,33099,38539,33094,33086,33107,33105,33020,33137,33134,33125,33126,33140,33155,33160,33162,33152,33154,33184,33173,33188,33187,33119,33171,33193,33200,33205,33214,33208,33213,33216,33218,33210,33225,33229,33233,33241,33240,33224,33242,33247,33248,33255,33274,33275,33278,33281,33282,33285,33287,33290,33293,33296,33302,33321,33323,33336,33331,33344,33369,33368,33373,33370,33375,33380,33378,33384,33386,33387,33326,33393,33399,33400,33406,33421,33426,33451,33439,33467,33452,33505,33507,33503,33490,33524,33523,33530,33683,33539,33531,33529,33502,33542,33500,33545,33497,33589,33588,33558,33586,33585,33600,33593,33616,33605,33583,33579,33559,33560,33669,33690,33706,33695,33698,33686,33571,33678,33671,33674,33660,33717,33651,33653,33696,33673,33704,33780,33811,33771,33742,33789,33795,33752,33803,33729,33783,33799,33760,33778,33805,33826,33824,33725,33848,34054,33787,33901,33834,33852,34138,33924,33911,33899,33965,33902,33922,33897,33862,33836,33903,33913,33845,33994,33890,33977,33983,33951,34009,33997,33979,34010,34000,33985,33990,34006,33953,34081,34047,34036,34071,34072,34092,34079,34069,34068,34044,34112,34147,34136,34120,34113,34306,34123,34133,34176,34212,34184,34193,34186,34216,34157,34196,34203,34282,34183,34204,34167,34174,34192,34249,34234,34255,34233,34256,34261,34269,34277,34268,34297,34314,34323,34315,34302,34298,34310,34338,34330,34352,34367,34381,20053,34388,34399,34407,34417,34451,34467,34473,34474,34443,34444,34486,34479,34500,34502,34480,34505,34851,34475,34516,34526,34537,34540,34527,34523,34543,34578,34566,34568,34560,34563,34555,34577,34569,34573,34553,34570,34612,34623,34615,34619,34597,34601,34586,34656,34655,34680,34636,34638,34676,34647,34664,34670,34649,34643,34659,34666,34821,34722,34719,34690,34735,34763,34749,34752,34768,38614,34731,34756,34739,34759,34758,34747,34799,34802,34784,34831,34829,34814,34806,34807,34830,34770,34833,34838,34837,34850,34849,34865,34870,34873,34855,34875,34884,34882,34898,34905,34910,34914,34923,34945,34942,34974,34933,34941,34997,34930,34946,34967,34962,34990,34969,34978,34957,34980,34992,35007,34993,35011,35012,35028,35032,35033,35037,35065,35074,35068,35060,35048,35058,35076,35084,35082,35091,35139,35102,35109,35114,35115,35137,35140,35131,35126,35128,35148,35101,35168,35166,35174,35172,35181,35178,35183,35188,35191,35198,35203,35208,35210,35219,35224,35233,35241,35238,35244,35247,35250,35258,35261,35263,35264,35290,35292,35293,35303,35316,35320,35331,35350,35344,35340,35355,35357,35365,35382,35393,35419,35410,35398,35400,35452,35437,35436,35426,35461,35458,35460,35496,35489,35473,35493,35494,35482,35491,35524,35533,35522,35546,35563,35571,35559,35556,35569,35604,35552,35554,35575,35550,35547,35596,35591,35610,35553,35606,35600,35607,35616,35635,38827,35622,35627,35646,35624,35649,35660,35663,35662,35657,35670,35675,35674,35691,35679,35692,35695,35700,35709,35712,35724,35726,35730,35731,35734,35737,35738,35898,35905,35903,35912,35916,35918,35920,35925,35938,35948,35960,35962,35970,35977,35973,35978,35981,35982,35988,35964,35992,25117,36013,36010,36029,36018,36019,36014,36022,36040,36033,36068,36067,36058,36093,36090,36091,36100,36101,36106,36103,36111,36109,36112,40782,36115,36045,36116,36118,36199,36205,36209,36211,36225,36249,36290,36286,36282,36303,36314,36310,36300,36315,36299,36330,36331,36319,36323,36348,36360,36361,36351,36381,36382,36368,36383,36418,36405,36400,36404,36426,36423,36425,36428,36432,36424,36441,36452,36448,36394,36451,36437,36470,36466,36476,36481,36487,36485,36484,36491,36490,36499,36497,36500,36505,36522,36513,36524,36528,36550,36529,36542,36549,36552,36555,36571,36579,36604,36603,36587,36606,36618,36613,36629,36626,36633,36627,36636,36639,36635,36620,36646,36659,36667,36665,36677,36674,36670,36684,36681,36678,36686,36695,36700,36706,36707,36708,36764,36767,36771,36781,36783,36791,36826,36837,36834,36842,36847,36999,36852,36869,36857,36858,36881,36885,36897,36877,36894,36886,36875,36903,36918,36917,36921,36856,36943,36944,36945,36946,36878,36937,36926,36950,36952,36958,36968,36975,36982,38568,36978,36994,36989,36993,36992,37002,37001,37007,37032,37039,37041,37045,37090,37092,25160,37083,37122,37138,37145,37170,37168,37194,37206,37208,37219,37221,37225,37235,37234,37259,37257,37250,37282,37291,37295,37290,37301,37300,37306,37312,37313,37321,37323,37328,37334,37343,37345,37339,37372,37365,37366,37406,37375,37396,37420,37397,37393,37470,37463,37445,37449,37476,37448,37525,37439,37451,37456,37532,37526,37523,37531,37466,37583,37561,37559,37609,37647,37626,37700,37678,37657,37666,37658,37667,37690,37685,37691,37724,37728,37756,37742,37718,37808,37804,37805,37780,37817,37846,37847,37864,37861,37848,37827,37853,37840,37832,37860,37914,37908,37907,37891,37895,37904,37942,37931,37941,37921,37946,37953,37970,37956,37979,37984,37986,37982,37994,37417,38000,38005,38007,38013,37978,38012,38014,38017,38015,38274,38279,38282,38292,38294,38296,38297,38304,38312,38311,38317,38332,38331,38329,38334,38346,28662,38339,38349,38348,38357,38356,38358,38364,38369,38373,38370,38433,38440,38446,38447,38466,38476,38479,38475,38519,38492,38494,38493,38495,38502,38514,38508,38541,38552,38549,38551,38570,38567,38577,38578,38576,38580,38582,38584,38585,38606,38603,38601,38605,35149,38620,38669,38613,38649,38660,38662,38664,38675,38670,38673,38671,38678,38681,38692,38698,38704,38713,38717,38718,38724,38726,38728,38722,38729,38748,38752,38756,38758,38760,21202,38763,38769,38777,38789,38780,38785,38778,38790,38795,38799,38800,38812,38824,38822,38819,38835,38836,38851,38854,38856,38859,38876,38893,40783,38898,31455,38902,38901,38927,38924,38968,38948,38945,38967,38973,38982,38991,38987,39019,39023,39024,39025,39028,39027,39082,39087,39089,39094,39108,39107,39110,39145,39147,39171,39177,39186,39188,39192,39201,39197,39198,39204,39200,39212,39214,39229,39230,39234,39241,39237,39248,39243,39249,39250,39244,39253,39319,39320,39333,39341,39342,39356,39391,39387,39389,39384,39377,39405,39406,39409,39410,39419,39416,39425,39439,39429,39394,39449,39467,39479,39493,39490,39488,39491,39486,39509,39501,39515,39511,39519,39522,39525,39524,39529,39531,39530,39597,39600,39612,39616,39631,39633,39635,39636,39646,39647,39650,39651,39654,39663,39659,39662,39668,39665,39671,39675,39686,39704,39706,39711,39714,39715,39717,39719,39720,39721,39722,39726,39727,39730,39748,39747,39759,39757,39758,39761,39768,39796,39827,39811,39825,39830,39831,39839,39840,39848,39860,39872,39882,39865,39878,39887,39889,39890,39907,39906,39908,39892,39905,39994,39922,39921,39920,39957,39956,39945,39955,39948,39942,39944,39954,39946,39940,39982,39963,39973,39972,39969,39984,40007,39986,40006,39998,40026,40032,40039,40054,40056,40167,40172,40176,40201,40200,40171,40195,40198,40234,40230,40367,40227,40223,40260,40213,40210,40257,40255,40254,40262,40264,40285,40286,40292,40273,40272,40281,40306,40329,40327,40363,40303,40314,40346,40356,40361,40370,40388,40385,40379,40376,40378,40390,40399,40386,40409,40403,40440,40422,40429,40431,40445,40474,40475,40478,40565,40569,40573,40577,40584,40587,40588,40594,40597,40593,40605,40613,40617,40632,40618,40621,38753,40652,40654,40655,40656,40660,40668,40670,40669,40672,40677,40680,40687,40692,40694,40695,40697,40699,40700,40701,40711,40712,30391,40725,40737,40748,40766,40778,40786,40788,40803,40799,40800,40801,40806,40807,40812,40810,40823,40818,40822,40853,40860,40864,22575,27079,36953,29796,20956,29081,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32394,35100,37704,37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,20220,20224,20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,20510,20550,20592,20546,20628,20724,20696,20810,20836,20893,20926,20972,21013,21148,21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,21642,21673,21759,21894,22361,22373,22444,22472,22471,64015,64016,22686,22706,22795,22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,23582,23718,23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,24372,24423,24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,24880,24984,25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,26158,26142,26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,26382,63785,26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,27106,27184,27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,27866,27908,28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,28220,28351,28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,28998,28999,64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,29667,29650,29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,30338,30364,30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,64024,64025,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,32092,32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,33864,33972,34131,34137,34155,64031,34224,64032,64033,34823,35061,35346,35383,35449,35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,64035,36559,64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,37358,37348,37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,37479,37543,37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,37665,37627,64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,37937,37957,37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,38737,38741,38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,39794,39823,39857,39867,39936,40304,40299,64045,40473,40657,null,null,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,65506,65508,65287,65282,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,65506,65508,65287,65282,12849,8470,8481,8757,32394,35100,37704,37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,20220,20224,20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,20510,20550,20592,20546,20628,20724,20696,20810,20836,20893,20926,20972,21013,21148,21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,21642,21673,21759,21894,22361,22373,22444,22472,22471,64015,64016,22686,22706,22795,22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,23582,23718,23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,24372,24423,24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,24880,24984,25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,26158,26142,26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,26382,63785,26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,27106,27184,27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,27866,27908,28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,28220,28351,28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,28998,28999,64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,29667,29650,29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,30338,30364,30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,64024,64025,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,32092,32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,33864,33972,34131,34137,34155,64031,34224,64032,64033,34823,35061,35346,35383,35449,35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,64035,36559,64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,37358,37348,37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,37479,37543,37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,37665,37627,64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,37937,37957,37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,38737,38741,38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,39794,39823,39857,39867,39936,40304,40299,64045,40473,40657,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], "jis0212":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,728,711,184,729,733,175,731,730,65374,900,901,null,null,null,null,null,null,null,null,161,166,191,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,186,170,169,174,8482,164,8470,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,902,904,905,906,938,null,908,null,910,939,null,911,null,null,null,null,940,941,942,943,970,912,972,962,973,971,944,974,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1038,1039,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1118,1119,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,198,272,null,294,null,306,null,321,319,null,330,216,338,null,358,222,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,230,273,240,295,305,307,312,322,320,329,331,248,339,223,359,254,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,193,192,196,194,258,461,256,260,197,195,262,264,268,199,266,270,201,200,203,202,282,278,274,280,null,284,286,290,288,292,205,204,207,206,463,304,298,302,296,308,310,313,317,315,323,327,325,209,211,210,214,212,465,336,332,213,340,344,342,346,348,352,350,356,354,218,217,220,219,364,467,368,362,370,366,360,471,475,473,469,372,221,376,374,377,381,379,null,null,null,null,null,null,null,225,224,228,226,259,462,257,261,229,227,263,265,269,231,267,271,233,232,235,234,283,279,275,281,501,285,287,null,289,293,237,236,239,238,464,null,299,303,297,309,311,314,318,316,324,328,326,241,243,242,246,244,466,337,333,245,341,345,343,347,349,353,351,357,355,250,249,252,251,365,468,369,363,371,367,361,472,476,474,470,373,253,255,375,378,382,380,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,19970,19972,19973,19980,19986,19999,20003,20004,20008,20011,20014,20015,20016,20021,20032,20033,20036,20039,20049,20058,20060,20067,20072,20073,20084,20085,20089,20095,20109,20118,20119,20125,20143,20153,20163,20176,20186,20187,20192,20193,20194,20200,20207,20209,20211,20213,20221,20222,20223,20224,20226,20227,20232,20235,20236,20242,20245,20246,20247,20249,20270,20273,20320,20275,20277,20279,20281,20283,20286,20288,20290,20296,20297,20299,20300,20306,20308,20310,20312,20319,20323,20330,20332,20334,20337,20343,20344,20345,20346,20349,20350,20353,20354,20356,20357,20361,20362,20364,20366,20368,20370,20371,20372,20375,20377,20378,20382,20383,20402,20407,20409,20411,20412,20413,20414,20416,20417,20421,20422,20424,20425,20427,20428,20429,20431,20434,20444,20448,20450,20464,20466,20476,20477,20479,20480,20481,20484,20487,20490,20492,20494,20496,20499,20503,20504,20507,20508,20509,20510,20514,20519,20526,20528,20530,20531,20533,20544,20545,20546,20549,20550,20554,20556,20558,20561,20562,20563,20567,20569,20575,20576,20578,20579,20582,20583,20586,20589,20592,20593,20539,20609,20611,20612,20614,20618,20622,20623,20624,20626,20627,20628,20630,20635,20636,20638,20639,20640,20641,20642,20650,20655,20656,20665,20666,20669,20672,20675,20676,20679,20684,20686,20688,20691,20692,20696,20700,20701,20703,20706,20708,20710,20712,20713,20719,20721,20726,20730,20734,20739,20742,20743,20744,20747,20748,20749,20750,20722,20752,20759,20761,20763,20764,20765,20766,20771,20775,20776,20780,20781,20783,20785,20787,20788,20789,20792,20793,20802,20810,20815,20819,20821,20823,20824,20831,20836,20838,20862,20867,20868,20875,20878,20888,20893,20897,20899,20909,20920,20922,20924,20926,20927,20930,20936,20943,20945,20946,20947,20949,20952,20958,20962,20965,20974,20978,20979,20980,20983,20993,20994,20997,21010,21011,21013,21014,21016,21026,21032,21041,21042,21045,21052,21061,21065,21077,21079,21080,21082,21084,21087,21088,21089,21094,21102,21111,21112,21113,21120,21122,21125,21130,21132,21139,21141,21142,21143,21144,21146,21148,21156,21157,21158,21159,21167,21168,21174,21175,21176,21178,21179,21181,21184,21188,21190,21192,21196,21199,21201,21204,21206,21211,21212,21217,21221,21224,21225,21226,21228,21232,21233,21236,21238,21239,21248,21251,21258,21259,21260,21265,21267,21272,21275,21276,21278,21279,21285,21287,21288,21289,21291,21292,21293,21296,21298,21301,21308,21309,21310,21314,21324,21323,21337,21339,21345,21347,21349,21356,21357,21362,21369,21374,21379,21383,21384,21390,21395,21396,21401,21405,21409,21412,21418,21419,21423,21426,21428,21429,21431,21432,21434,21437,21440,21445,21455,21458,21459,21461,21466,21469,21470,21472,21478,21479,21493,21506,21523,21530,21537,21543,21544,21546,21551,21553,21556,21557,21571,21572,21575,21581,21583,21598,21602,21604,21606,21607,21609,21611,21613,21614,21620,21631,21633,21635,21637,21640,21641,21645,21649,21653,21654,21660,21663,21665,21670,21671,21673,21674,21677,21678,21681,21687,21689,21690,21691,21695,21702,21706,21709,21710,21728,21738,21740,21743,21750,21756,21758,21759,21760,21761,21765,21768,21769,21772,21773,21774,21781,21802,21803,21810,21813,21814,21819,21820,21821,21825,21831,21833,21834,21837,21840,21841,21848,21850,21851,21854,21856,21857,21860,21862,21887,21889,21890,21894,21896,21902,21903,21905,21906,21907,21908,21911,21923,21924,21933,21938,21951,21953,21955,21958,21961,21963,21964,21966,21969,21970,21971,21975,21976,21979,21982,21986,21993,22006,22015,22021,22024,22026,22029,22030,22031,22032,22033,22034,22041,22060,22064,22067,22069,22071,22073,22075,22076,22077,22079,22080,22081,22083,22084,22086,22089,22091,22093,22095,22100,22110,22112,22113,22114,22115,22118,22121,22125,22127,22129,22130,22133,22148,22149,22152,22155,22156,22165,22169,22170,22173,22174,22175,22182,22183,22184,22185,22187,22188,22189,22193,22195,22199,22206,22213,22217,22218,22219,22223,22224,22220,22221,22233,22236,22237,22239,22241,22244,22245,22246,22247,22248,22257,22251,22253,22262,22263,22273,22274,22279,22282,22284,22289,22293,22298,22299,22301,22304,22306,22307,22308,22309,22313,22314,22316,22318,22319,22323,22324,22333,22334,22335,22341,22342,22348,22349,22354,22370,22373,22375,22376,22379,22381,22382,22383,22384,22385,22387,22388,22389,22391,22393,22394,22395,22396,22398,22401,22403,22412,22420,22423,22425,22426,22428,22429,22430,22431,22433,22421,22439,22440,22441,22444,22456,22461,22471,22472,22476,22479,22485,22493,22494,22500,22502,22503,22505,22509,22512,22517,22518,22520,22525,22526,22527,22531,22532,22536,22537,22497,22540,22541,22555,22558,22559,22560,22566,22567,22573,22578,22585,22591,22601,22604,22605,22607,22608,22613,22623,22625,22628,22631,22632,22648,22652,22655,22656,22657,22663,22664,22665,22666,22668,22669,22671,22672,22676,22678,22685,22688,22689,22690,22694,22697,22705,22706,22724,22716,22722,22728,22733,22734,22736,22738,22740,22742,22746,22749,22753,22754,22761,22771,22789,22790,22795,22796,22802,22803,22804,34369,22813,22817,22819,22820,22824,22831,22832,22835,22837,22838,22847,22851,22854,22866,22867,22873,22875,22877,22878,22879,22881,22883,22891,22893,22895,22898,22901,22902,22905,22907,22908,22923,22924,22926,22930,22933,22935,22943,22948,22951,22957,22958,22959,22960,22963,22967,22970,22972,22977,22979,22980,22984,22986,22989,22994,23005,23006,23007,23011,23012,23015,23022,23023,23025,23026,23028,23031,23040,23044,23052,23053,23054,23058,23059,23070,23075,23076,23079,23080,23082,23085,23088,23108,23109,23111,23112,23116,23120,23125,23134,23139,23141,23143,23149,23159,23162,23163,23166,23179,23184,23187,23190,23193,23196,23198,23199,23200,23202,23207,23212,23217,23218,23219,23221,23224,23226,23227,23231,23236,23238,23240,23247,23258,23260,23264,23269,23274,23278,23285,23286,23293,23296,23297,23304,23319,23348,23321,23323,23325,23329,23333,23341,23352,23361,23371,23372,23378,23382,23390,23400,23406,23407,23420,23421,23422,23423,23425,23428,23430,23434,23438,23440,23441,23443,23444,23446,23464,23465,23468,23469,23471,23473,23474,23479,23482,23484,23488,23489,23501,23503,23510,23511,23512,23513,23514,23520,23535,23537,23540,23549,23564,23575,23582,23583,23587,23590,23593,23595,23596,23598,23600,23602,23605,23606,23641,23642,23644,23650,23651,23655,23656,23657,23661,23664,23668,23669,23674,23675,23676,23677,23687,23688,23690,23695,23698,23709,23711,23712,23714,23715,23718,23722,23730,23732,23733,23738,23753,23755,23762,23773,23767,23790,23793,23794,23796,23809,23814,23821,23826,23851,23843,23844,23846,23847,23857,23860,23865,23869,23871,23874,23875,23878,23880,23893,23889,23897,23882,23903,23904,23905,23906,23908,23914,23917,23920,23929,23930,23934,23935,23937,23939,23944,23946,23954,23955,23956,23957,23961,23963,23967,23968,23975,23979,23984,23988,23992,23993,24003,24007,24011,24016,24014,24024,24025,24032,24036,24041,24056,24057,24064,24071,24077,24082,24084,24085,24088,24095,24096,24110,24104,24114,24117,24126,24139,24144,24137,24145,24150,24152,24155,24156,24158,24168,24170,24171,24172,24173,24174,24176,24192,24203,24206,24226,24228,24229,24232,24234,24236,24241,24243,24253,24254,24255,24262,24268,24267,24270,24273,24274,24276,24277,24284,24286,24293,24299,24322,24326,24327,24328,24334,24345,24348,24349,24353,24354,24355,24356,24360,24363,24364,24366,24368,24372,24374,24379,24381,24383,24384,24388,24389,24391,24397,24400,24404,24408,24411,24416,24419,24420,24423,24431,24434,24436,24437,24440,24442,24445,24446,24457,24461,24463,24470,24476,24477,24482,24487,24491,24484,24492,24495,24496,24497,24504,24516,24519,24520,24521,24523,24528,24529,24530,24531,24532,24542,24545,24546,24552,24553,24554,24556,24557,24558,24559,24562,24563,24566,24570,24572,24583,24586,24589,24595,24596,24599,24600,24602,24607,24612,24621,24627,24629,24640,24647,24648,24649,24652,24657,24660,24662,24663,24669,24673,24679,24689,24702,24703,24706,24710,24712,24714,24718,24721,24723,24725,24728,24733,24734,24738,24740,24741,24744,24752,24753,24759,24763,24766,24770,24772,24776,24777,24778,24779,24782,24783,24788,24789,24793,24795,24797,24798,24802,24805,24818,24821,24824,24828,24829,24834,24839,24842,24844,24848,24849,24850,24851,24852,24854,24855,24857,24860,24862,24866,24874,24875,24880,24881,24885,24886,24887,24889,24897,24901,24902,24905,24926,24928,24940,24946,24952,24955,24956,24959,24960,24961,24963,24964,24971,24973,24978,24979,24983,24984,24988,24989,24991,24992,24997,25000,25002,25005,25016,25017,25020,25024,25025,25026,25038,25039,25045,25052,25053,25054,25055,25057,25058,25063,25065,25061,25068,25069,25071,25089,25091,25092,25095,25107,25109,25116,25120,25122,25123,25127,25129,25131,25145,25149,25154,25155,25156,25158,25164,25168,25169,25170,25172,25174,25178,25180,25188,25197,25199,25203,25210,25213,25229,25230,25231,25232,25254,25256,25267,25270,25271,25274,25278,25279,25284,25294,25301,25302,25306,25322,25330,25332,25340,25341,25347,25348,25354,25355,25357,25360,25363,25366,25368,25385,25386,25389,25397,25398,25401,25404,25409,25410,25411,25412,25414,25418,25419,25422,25426,25427,25428,25432,25435,25445,25446,25452,25453,25457,25460,25461,25464,25468,25469,25471,25474,25476,25479,25482,25488,25492,25493,25497,25498,25502,25508,25510,25517,25518,25519,25533,25537,25541,25544,25550,25553,25555,25556,25557,25564,25568,25573,25578,25580,25586,25587,25589,25592,25593,25609,25610,25616,25618,25620,25624,25630,25632,25634,25636,25637,25641,25642,25647,25648,25653,25661,25663,25675,25679,25681,25682,25683,25684,25690,25691,25692,25693,25695,25696,25697,25699,25709,25715,25716,25723,25725,25733,25735,25743,25744,25745,25752,25753,25755,25757,25759,25761,25763,25766,25768,25772,25779,25789,25790,25791,25796,25801,25802,25803,25804,25806,25808,25809,25813,25815,25828,25829,25833,25834,25837,25840,25845,25847,25851,25855,25857,25860,25864,25865,25866,25871,25875,25876,25878,25881,25883,25886,25887,25890,25894,25897,25902,25905,25914,25916,25917,25923,25927,25929,25936,25938,25940,25951,25952,25959,25963,25978,25981,25985,25989,25994,26002,26005,26008,26013,26016,26019,26022,26030,26034,26035,26036,26047,26050,26056,26057,26062,26064,26068,26070,26072,26079,26096,26098,26100,26101,26105,26110,26111,26112,26116,26120,26121,26125,26129,26130,26133,26134,26141,26142,26145,26146,26147,26148,26150,26153,26154,26155,26156,26158,26160,26161,26163,26169,26167,26176,26181,26182,26186,26188,26193,26190,26199,26200,26201,26203,26204,26208,26209,26363,26218,26219,26220,26238,26227,26229,26239,26231,26232,26233,26235,26240,26236,26251,26252,26253,26256,26258,26265,26266,26267,26268,26271,26272,26276,26285,26289,26290,26293,26299,26303,26304,26306,26307,26312,26316,26318,26319,26324,26331,26335,26344,26347,26348,26350,26362,26373,26375,26382,26387,26393,26396,26400,26402,26419,26430,26437,26439,26440,26444,26452,26453,26461,26470,26476,26478,26484,26486,26491,26497,26500,26510,26511,26513,26515,26518,26520,26521,26523,26544,26545,26546,26549,26555,26556,26557,26617,26560,26562,26563,26565,26568,26569,26578,26583,26585,26588,26593,26598,26608,26610,26614,26615,26706,26644,26649,26653,26655,26664,26663,26668,26669,26671,26672,26673,26675,26683,26687,26692,26693,26698,26700,26709,26711,26712,26715,26731,26734,26735,26736,26737,26738,26741,26745,26746,26747,26748,26754,26756,26758,26760,26774,26776,26778,26780,26785,26787,26789,26793,26794,26798,26802,26811,26821,26824,26828,26831,26832,26833,26835,26838,26841,26844,26845,26853,26856,26858,26859,26860,26861,26864,26865,26869,26870,26875,26876,26877,26886,26889,26890,26896,26897,26899,26902,26903,26929,26931,26933,26936,26939,26946,26949,26953,26958,26967,26971,26979,26980,26981,26982,26984,26985,26988,26992,26993,26994,27002,27003,27007,27008,27021,27026,27030,27032,27041,27045,27046,27048,27051,27053,27055,27063,27064,27066,27068,27077,27080,27089,27094,27095,27106,27109,27118,27119,27121,27123,27125,27134,27136,27137,27139,27151,27153,27157,27162,27165,27168,27172,27176,27184,27186,27188,27191,27195,27198,27199,27205,27206,27209,27210,27214,27216,27217,27218,27221,27222,27227,27236,27239,27242,27249,27251,27262,27265,27267,27270,27271,27273,27275,27281,27291,27293,27294,27295,27301,27307,27311,27312,27313,27316,27325,27326,27327,27334,27337,27336,27340,27344,27348,27349,27350,27356,27357,27364,27367,27372,27376,27377,27378,27388,27389,27394,27395,27398,27399,27401,27407,27408,27409,27415,27419,27422,27428,27432,27435,27436,27439,27445,27446,27451,27455,27462,27466,27469,27474,27478,27480,27485,27488,27495,27499,27502,27504,27509,27517,27518,27522,27525,27543,27547,27551,27552,27554,27555,27560,27561,27564,27565,27566,27568,27576,27577,27581,27582,27587,27588,27593,27596,27606,27610,27617,27619,27622,27623,27630,27633,27639,27641,27647,27650,27652,27653,27657,27661,27662,27664,27666,27673,27679,27686,27687,27688,27692,27694,27699,27701,27702,27706,27707,27711,27722,27723,27725,27727,27730,27732,27737,27739,27740,27755,27757,27759,27764,27766,27768,27769,27771,27781,27782,27783,27785,27796,27797,27799,27800,27804,27807,27824,27826,27828,27842,27846,27853,27855,27856,27857,27858,27860,27862,27866,27868,27872,27879,27881,27883,27884,27886,27890,27892,27908,27911,27914,27918,27919,27921,27923,27930,27942,27943,27944,27751,27950,27951,27953,27961,27964,27967,27991,27998,27999,28001,28005,28007,28015,28016,28028,28034,28039,28049,28050,28052,28054,28055,28056,28074,28076,28084,28087,28089,28093,28095,28100,28104,28106,28110,28111,28118,28123,28125,28127,28128,28130,28133,28137,28143,28144,28148,28150,28156,28160,28164,28190,28194,28199,28210,28214,28217,28219,28220,28228,28229,28232,28233,28235,28239,28241,28242,28243,28244,28247,28252,28253,28254,28258,28259,28264,28275,28283,28285,28301,28307,28313,28320,28327,28333,28334,28337,28339,28347,28351,28352,28353,28355,28359,28360,28362,28365,28366,28367,28395,28397,28398,28409,28411,28413,28420,28424,28426,28428,28429,28438,28440,28442,28443,28454,28457,28458,28463,28464,28467,28470,28475,28476,28461,28495,28497,28498,28499,28503,28505,28506,28509,28510,28513,28514,28520,28524,28541,28542,28547,28551,28552,28555,28556,28557,28560,28562,28563,28564,28566,28570,28575,28576,28581,28582,28583,28584,28590,28591,28592,28597,28598,28604,28613,28615,28616,28618,28634,28638,28648,28649,28656,28661,28665,28668,28669,28672,28677,28678,28679,28685,28695,28704,28707,28719,28724,28727,28729,28732,28739,28740,28744,28745,28746,28747,28756,28757,28765,28766,28750,28772,28773,28780,28782,28789,28790,28798,28801,28805,28806,28820,28821,28822,28823,28824,28827,28836,28843,28848,28849,28852,28855,28874,28881,28883,28884,28885,28886,28888,28892,28900,28922,28931,28932,28933,28934,28935,28939,28940,28943,28958,28960,28971,28973,28975,28976,28977,28984,28993,28997,28998,28999,29002,29003,29008,29010,29015,29018,29020,29022,29024,29032,29049,29056,29061,29063,29068,29074,29082,29083,29088,29090,29103,29104,29106,29107,29114,29119,29120,29121,29124,29131,29132,29139,29142,29145,29146,29148,29176,29182,29184,29191,29192,29193,29203,29207,29210,29213,29215,29220,29227,29231,29236,29240,29241,29249,29250,29251,29253,29262,29263,29264,29267,29269,29270,29274,29276,29278,29280,29283,29288,29291,29294,29295,29297,29303,29304,29307,29308,29311,29316,29321,29325,29326,29331,29339,29352,29357,29358,29361,29364,29374,29377,29383,29385,29388,29397,29398,29400,29407,29413,29427,29428,29434,29435,29438,29442,29444,29445,29447,29451,29453,29458,29459,29464,29465,29470,29474,29476,29479,29480,29484,29489,29490,29493,29498,29499,29501,29507,29517,29520,29522,29526,29528,29533,29534,29535,29536,29542,29543,29545,29547,29548,29550,29551,29553,29559,29561,29564,29568,29569,29571,29573,29574,29582,29584,29587,29589,29591,29592,29596,29598,29599,29600,29602,29605,29606,29610,29611,29613,29621,29623,29625,29628,29629,29631,29637,29638,29641,29643,29644,29647,29650,29651,29654,29657,29661,29665,29667,29670,29671,29673,29684,29685,29687,29689,29690,29691,29693,29695,29696,29697,29700,29703,29706,29713,29722,29723,29732,29734,29736,29737,29738,29739,29740,29741,29742,29743,29744,29745,29753,29760,29763,29764,29766,29767,29771,29773,29777,29778,29783,29789,29794,29798,29799,29800,29803,29805,29806,29809,29810,29824,29825,29829,29830,29831,29833,29839,29840,29841,29842,29848,29849,29850,29852,29855,29856,29857,29859,29862,29864,29865,29866,29867,29870,29871,29873,29874,29877,29881,29883,29887,29896,29897,29900,29904,29907,29912,29914,29915,29918,29919,29924,29928,29930,29931,29935,29940,29946,29947,29948,29951,29958,29970,29974,29975,29984,29985,29988,29991,29993,29994,29999,30006,30009,30013,30014,30015,30016,30019,30023,30024,30030,30032,30034,30039,30046,30047,30049,30063,30065,30073,30074,30075,30076,30077,30078,30081,30085,30096,30098,30099,30101,30105,30108,30114,30116,30132,30138,30143,30144,30145,30148,30150,30156,30158,30159,30167,30172,30175,30176,30177,30180,30183,30188,30190,30191,30193,30201,30208,30210,30211,30212,30215,30216,30218,30220,30223,30226,30227,30229,30230,30233,30235,30236,30237,30238,30243,30245,30246,30249,30253,30258,30259,30261,30264,30265,30266,30268,30282,30272,30273,30275,30276,30277,30281,30283,30293,30297,30303,30308,30309,30317,30318,30319,30321,30324,30337,30341,30348,30349,30357,30363,30364,30365,30367,30368,30370,30371,30372,30373,30374,30375,30376,30378,30381,30397,30401,30405,30409,30411,30412,30414,30420,30425,30432,30438,30440,30444,30448,30449,30454,30457,30460,30464,30470,30474,30478,30482,30484,30485,30487,30489,30490,30492,30498,30504,30509,30510,30511,30516,30517,30518,30521,30525,30526,30530,30533,30534,30538,30541,30542,30543,30546,30550,30551,30556,30558,30559,30560,30562,30564,30567,30570,30572,30576,30578,30579,30580,30586,30589,30592,30596,30604,30605,30612,30613,30614,30618,30623,30626,30631,30634,30638,30639,30641,30645,30654,30659,30665,30673,30674,30677,30681,30686,30687,30688,30692,30694,30698,30700,30704,30705,30708,30712,30715,30725,30726,30729,30733,30734,30737,30749,30753,30754,30755,30765,30766,30768,30773,30775,30787,30788,30791,30792,30796,30798,30802,30812,30814,30816,30817,30819,30820,30824,30826,30830,30842,30846,30858,30863,30868,30872,30881,30877,30878,30879,30884,30888,30892,30893,30896,30897,30898,30899,30907,30909,30911,30919,30920,30921,30924,30926,30930,30931,30933,30934,30948,30939,30943,30944,30945,30950,30954,30962,30963,30976,30966,30967,30970,30971,30975,30982,30988,30992,31002,31004,31006,31007,31008,31013,31015,31017,31021,31025,31028,31029,31035,31037,31039,31044,31045,31046,31050,31051,31055,31057,31060,31064,31067,31068,31079,31081,31083,31090,31097,31099,31100,31102,31115,31116,31121,31123,31124,31125,31126,31128,31131,31132,31137,31144,31145,31147,31151,31153,31156,31160,31163,31170,31172,31175,31176,31178,31183,31188,31190,31194,31197,31198,31200,31202,31205,31210,31211,31213,31217,31224,31228,31234,31235,31239,31241,31242,31244,31249,31253,31259,31262,31265,31271,31275,31277,31279,31280,31284,31285,31288,31289,31290,31300,31301,31303,31304,31308,31317,31318,31321,31324,31325,31327,31328,31333,31335,31338,31341,31349,31352,31358,31360,31362,31365,31366,31370,31371,31376,31377,31380,31390,31392,31395,31404,31411,31413,31417,31419,31420,31430,31433,31436,31438,31441,31451,31464,31465,31467,31468,31473,31476,31483,31485,31486,31495,31508,31519,31523,31527,31529,31530,31531,31533,31534,31535,31536,31537,31540,31549,31551,31552,31553,31559,31566,31573,31584,31588,31590,31593,31594,31597,31599,31602,31603,31607,31620,31625,31630,31632,31633,31638,31643,31646,31648,31653,31660,31663,31664,31666,31669,31670,31674,31675,31676,31677,31682,31685,31688,31690,31700,31702,31703,31705,31706,31707,31720,31722,31730,31732,31733,31736,31737,31738,31740,31742,31745,31746,31747,31748,31750,31753,31755,31756,31758,31759,31769,31771,31776,31781,31782,31784,31788,31793,31795,31796,31798,31801,31802,31814,31818,31829,31825,31826,31827,31833,31834,31835,31836,31837,31838,31841,31843,31847,31849,31853,31854,31856,31858,31865,31868,31869,31878,31879,31887,31892,31902,31904,31910,31920,31926,31927,31930,31931,31932,31935,31940,31943,31944,31945,31949,31951,31955,31956,31957,31959,31961,31962,31965,31974,31977,31979,31989,32003,32007,32008,32009,32015,32017,32018,32019,32022,32029,32030,32035,32038,32042,32045,32049,32060,32061,32062,32064,32065,32071,32072,32077,32081,32083,32087,32089,32090,32092,32093,32101,32103,32106,32112,32120,32122,32123,32127,32129,32130,32131,32133,32134,32136,32139,32140,32141,32145,32150,32151,32157,32158,32166,32167,32170,32179,32182,32183,32185,32194,32195,32196,32197,32198,32204,32205,32206,32215,32217,32256,32226,32229,32230,32234,32235,32237,32241,32245,32246,32249,32250,32264,32272,32273,32277,32279,32284,32285,32288,32295,32296,32300,32301,32303,32307,32310,32319,32324,32325,32327,32334,32336,32338,32344,32351,32353,32354,32357,32363,32366,32367,32371,32376,32382,32385,32390,32391,32394,32397,32401,32405,32408,32410,32413,32414,32572,32571,32573,32574,32575,32579,32580,32583,32591,32594,32595,32603,32604,32605,32609,32611,32612,32613,32614,32621,32625,32637,32638,32639,32640,32651,32653,32655,32656,32657,32662,32663,32668,32673,32674,32678,32682,32685,32692,32700,32703,32704,32707,32712,32718,32719,32731,32735,32739,32741,32744,32748,32750,32751,32754,32762,32765,32766,32767,32775,32776,32778,32781,32782,32783,32785,32787,32788,32790,32797,32798,32799,32800,32804,32806,32812,32814,32816,32820,32821,32823,32825,32826,32828,32830,32832,32836,32864,32868,32870,32877,32881,32885,32897,32904,32910,32924,32926,32934,32935,32939,32952,32953,32968,32973,32975,32978,32980,32981,32983,32984,32992,33005,33006,33008,33010,33011,33014,33017,33018,33022,33027,33035,33046,33047,33048,33052,33054,33056,33060,33063,33068,33072,33077,33082,33084,33093,33095,33098,33100,33106,33111,33120,33121,33127,33128,33129,33133,33135,33143,33153,33168,33156,33157,33158,33163,33166,33174,33176,33179,33182,33186,33198,33202,33204,33211,33227,33219,33221,33226,33230,33231,33237,33239,33243,33245,33246,33249,33252,33259,33260,33264,33265,33266,33269,33270,33272,33273,33277,33279,33280,33283,33295,33299,33300,33305,33306,33309,33313,33314,33320,33330,33332,33338,33347,33348,33349,33350,33355,33358,33359,33361,33366,33372,33376,33379,33383,33389,33396,33403,33405,33407,33408,33409,33411,33412,33415,33417,33418,33422,33425,33428,33430,33432,33434,33435,33440,33441,33443,33444,33447,33448,33449,33450,33454,33456,33458,33460,33463,33466,33468,33470,33471,33478,33488,33493,33498,33504,33506,33508,33512,33514,33517,33519,33526,33527,33533,33534,33536,33537,33543,33544,33546,33547,33620,33563,33565,33566,33567,33569,33570,33580,33581,33582,33584,33587,33591,33594,33596,33597,33602,33603,33604,33607,33613,33614,33617,33621,33622,33623,33648,33656,33661,33663,33664,33666,33668,33670,33677,33682,33684,33685,33688,33689,33691,33692,33693,33702,33703,33705,33708,33726,33727,33728,33735,33737,33743,33744,33745,33748,33757,33619,33768,33770,33782,33784,33785,33788,33793,33798,33802,33807,33809,33813,33817,33709,33839,33849,33861,33863,33864,33866,33869,33871,33873,33874,33878,33880,33881,33882,33884,33888,33892,33893,33895,33898,33904,33907,33908,33910,33912,33916,33917,33921,33925,33938,33939,33941,33950,33958,33960,33961,33962,33967,33969,33972,33978,33981,33982,33984,33986,33991,33992,33996,33999,34003,34012,34023,34026,34031,34032,34033,34034,34039,34098,34042,34043,34045,34050,34051,34055,34060,34062,34064,34076,34078,34082,34083,34084,34085,34087,34090,34091,34095,34099,34100,34102,34111,34118,34127,34128,34129,34130,34131,34134,34137,34140,34141,34142,34143,34144,34145,34146,34148,34155,34159,34169,34170,34171,34173,34175,34177,34181,34182,34185,34187,34188,34191,34195,34200,34205,34207,34208,34210,34213,34215,34228,34230,34231,34232,34236,34237,34238,34239,34242,34247,34250,34251,34254,34221,34264,34266,34271,34272,34278,34280,34285,34291,34294,34300,34303,34304,34308,34309,34317,34318,34320,34321,34322,34328,34329,34331,34334,34337,34343,34345,34358,34360,34362,34364,34365,34368,34370,34374,34386,34387,34390,34391,34392,34393,34397,34400,34401,34402,34403,34404,34409,34412,34415,34421,34422,34423,34426,34445,34449,34454,34456,34458,34460,34465,34470,34471,34472,34477,34481,34483,34484,34485,34487,34488,34489,34495,34496,34497,34499,34501,34513,34514,34517,34519,34522,34524,34528,34531,34533,34535,34440,34554,34556,34557,34564,34565,34567,34571,34574,34575,34576,34579,34580,34585,34590,34591,34593,34595,34600,34606,34607,34609,34610,34617,34618,34620,34621,34622,34624,34627,34629,34637,34648,34653,34657,34660,34661,34671,34673,34674,34683,34691,34692,34693,34694,34695,34696,34697,34699,34700,34704,34707,34709,34711,34712,34713,34718,34720,34723,34727,34732,34733,34734,34737,34741,34750,34751,34753,34760,34761,34762,34766,34773,34774,34777,34778,34780,34783,34786,34787,34788,34794,34795,34797,34801,34803,34808,34810,34815,34817,34819,34822,34825,34826,34827,34832,34841,34834,34835,34836,34840,34842,34843,34844,34846,34847,34856,34861,34862,34864,34866,34869,34874,34876,34881,34883,34885,34888,34889,34890,34891,34894,34897,34901,34902,34904,34906,34908,34911,34912,34916,34921,34929,34937,34939,34944,34968,34970,34971,34972,34975,34976,34984,34986,35002,35005,35006,35008,35018,35019,35020,35021,35022,35025,35026,35027,35035,35038,35047,35055,35056,35057,35061,35063,35073,35078,35085,35086,35087,35093,35094,35096,35097,35098,35100,35104,35110,35111,35112,35120,35121,35122,35125,35129,35130,35134,35136,35138,35141,35142,35145,35151,35154,35159,35162,35163,35164,35169,35170,35171,35179,35182,35184,35187,35189,35194,35195,35196,35197,35209,35213,35216,35220,35221,35227,35228,35231,35232,35237,35248,35252,35253,35254,35255,35260,35284,35285,35286,35287,35288,35301,35305,35307,35309,35313,35315,35318,35321,35325,35327,35332,35333,35335,35343,35345,35346,35348,35349,35358,35360,35362,35364,35366,35371,35372,35375,35381,35383,35389,35390,35392,35395,35397,35399,35401,35405,35406,35411,35414,35415,35416,35420,35421,35425,35429,35431,35445,35446,35447,35449,35450,35451,35454,35455,35456,35459,35462,35467,35471,35472,35474,35478,35479,35481,35487,35495,35497,35502,35503,35507,35510,35511,35515,35518,35523,35526,35528,35529,35530,35537,35539,35540,35541,35543,35549,35551,35564,35568,35572,35573,35574,35580,35583,35589,35590,35595,35601,35612,35614,35615,35594,35629,35632,35639,35644,35650,35651,35652,35653,35654,35656,35666,35667,35668,35673,35661,35678,35683,35693,35702,35704,35705,35708,35710,35713,35716,35717,35723,35725,35727,35732,35733,35740,35742,35743,35896,35897,35901,35902,35909,35911,35913,35915,35919,35921,35923,35924,35927,35928,35931,35933,35929,35939,35940,35942,35944,35945,35949,35955,35957,35958,35963,35966,35974,35975,35979,35984,35986,35987,35993,35995,35996,36004,36025,36026,36037,36038,36041,36043,36047,36054,36053,36057,36061,36065,36072,36076,36079,36080,36082,36085,36087,36088,36094,36095,36097,36099,36105,36114,36119,36123,36197,36201,36204,36206,36223,36226,36228,36232,36237,36240,36241,36245,36254,36255,36256,36262,36267,36268,36271,36274,36277,36279,36281,36283,36288,36293,36294,36295,36296,36298,36302,36305,36308,36309,36311,36313,36324,36325,36327,36332,36336,36284,36337,36338,36340,36349,36353,36356,36357,36358,36363,36369,36372,36374,36384,36385,36386,36387,36390,36391,36401,36403,36406,36407,36408,36409,36413,36416,36417,36427,36429,36430,36431,36436,36443,36444,36445,36446,36449,36450,36457,36460,36461,36463,36464,36465,36473,36474,36475,36482,36483,36489,36496,36498,36501,36506,36507,36509,36510,36514,36519,36521,36525,36526,36531,36533,36538,36539,36544,36545,36547,36548,36551,36559,36561,36564,36572,36584,36590,36592,36593,36599,36601,36602,36589,36608,36610,36615,36616,36623,36624,36630,36631,36632,36638,36640,36641,36643,36645,36647,36648,36652,36653,36654,36660,36661,36662,36663,36666,36672,36673,36675,36679,36687,36689,36690,36691,36692,36693,36696,36701,36702,36709,36765,36768,36769,36772,36773,36774,36789,36790,36792,36798,36800,36801,36806,36810,36811,36813,36816,36818,36819,36821,36832,36835,36836,36840,36846,36849,36853,36854,36859,36862,36866,36868,36872,36876,36888,36891,36904,36905,36911,36906,36908,36909,36915,36916,36919,36927,36931,36932,36940,36955,36957,36962,36966,36967,36972,36976,36980,36985,36997,37000,37003,37004,37006,37008,37013,37015,37016,37017,37019,37024,37025,37026,37029,37040,37042,37043,37044,37046,37053,37068,37054,37059,37060,37061,37063,37064,37077,37079,37080,37081,37084,37085,37087,37093,37074,37110,37099,37103,37104,37108,37118,37119,37120,37124,37125,37126,37128,37133,37136,37140,37142,37143,37144,37146,37148,37150,37152,37157,37154,37155,37159,37161,37166,37167,37169,37172,37174,37175,37177,37178,37180,37181,37187,37191,37192,37199,37203,37207,37209,37210,37211,37217,37220,37223,37229,37236,37241,37242,37243,37249,37251,37253,37254,37258,37262,37265,37267,37268,37269,37272,37278,37281,37286,37288,37292,37293,37294,37296,37297,37298,37299,37302,37307,37308,37309,37311,37314,37315,37317,37331,37332,37335,37337,37338,37342,37348,37349,37353,37354,37356,37357,37358,37359,37360,37361,37367,37369,37371,37373,37376,37377,37380,37381,37382,37383,37385,37386,37388,37392,37394,37395,37398,37400,37404,37405,37411,37412,37413,37414,37416,37422,37423,37424,37427,37429,37430,37432,37433,37434,37436,37438,37440,37442,37443,37446,37447,37450,37453,37454,37455,37457,37464,37465,37468,37469,37472,37473,37477,37479,37480,37481,37486,37487,37488,37493,37494,37495,37496,37497,37499,37500,37501,37503,37512,37513,37514,37517,37518,37522,37527,37529,37535,37536,37540,37541,37543,37544,37547,37551,37554,37558,37560,37562,37563,37564,37565,37567,37568,37569,37570,37571,37573,37574,37575,37576,37579,37580,37581,37582,37584,37587,37589,37591,37592,37593,37596,37597,37599,37600,37601,37603,37605,37607,37608,37612,37614,37616,37625,37627,37631,37632,37634,37640,37645,37649,37652,37653,37660,37661,37662,37663,37665,37668,37669,37671,37673,37674,37683,37684,37686,37687,37703,37704,37705,37712,37713,37714,37717,37719,37720,37722,37726,37732,37733,37735,37737,37738,37741,37743,37744,37745,37747,37748,37750,37754,37757,37759,37760,37761,37762,37768,37770,37771,37773,37775,37778,37781,37784,37787,37790,37793,37795,37796,37798,37800,37803,37812,37813,37814,37818,37801,37825,37828,37829,37830,37831,37833,37834,37835,37836,37837,37843,37849,37852,37854,37855,37858,37862,37863,37881,37879,37880,37882,37883,37885,37889,37890,37892,37896,37897,37901,37902,37903,37909,37910,37911,37919,37934,37935,37937,37938,37939,37940,37947,37951,37949,37955,37957,37960,37962,37964,37973,37977,37980,37983,37985,37987,37992,37995,37997,37998,37999,38001,38002,38020,38019,38264,38265,38270,38276,38280,38284,38285,38286,38301,38302,38303,38305,38310,38313,38315,38316,38324,38326,38330,38333,38335,38342,38344,38345,38347,38352,38353,38354,38355,38361,38362,38365,38366,38367,38368,38372,38374,38429,38430,38434,38436,38437,38438,38444,38449,38451,38455,38456,38457,38458,38460,38461,38465,38482,38484,38486,38487,38488,38497,38510,38516,38523,38524,38526,38527,38529,38530,38531,38532,38537,38545,38550,38554,38557,38559,38564,38565,38566,38569,38574,38575,38579,38586,38602,38610,23986,38616,38618,38621,38622,38623,38633,38639,38641,38650,38658,38659,38661,38665,38682,38683,38685,38689,38690,38691,38696,38705,38707,38721,38723,38730,38734,38735,38741,38743,38744,38746,38747,38755,38759,38762,38766,38771,38774,38775,38776,38779,38781,38783,38784,38793,38805,38806,38807,38809,38810,38814,38815,38818,38828,38830,38833,38834,38837,38838,38840,38841,38842,38844,38846,38847,38849,38852,38853,38855,38857,38858,38860,38861,38862,38864,38865,38868,38871,38872,38873,38877,38878,38880,38875,38881,38884,38895,38897,38900,38903,38904,38906,38919,38922,38937,38925,38926,38932,38934,38940,38942,38944,38947,38950,38955,38958,38959,38960,38962,38963,38965,38949,38974,38980,38983,38986,38993,38994,38995,38998,38999,39001,39002,39010,39011,39013,39014,39018,39020,39083,39085,39086,39088,39092,39095,39096,39098,39099,39103,39106,39109,39112,39116,39137,39139,39141,39142,39143,39146,39155,39158,39170,39175,39176,39185,39189,39190,39191,39194,39195,39196,39199,39202,39206,39207,39211,39217,39218,39219,39220,39221,39225,39226,39227,39228,39232,39233,39238,39239,39240,39245,39246,39252,39256,39257,39259,39260,39262,39263,39264,39323,39325,39327,39334,39344,39345,39346,39349,39353,39354,39357,39359,39363,39369,39379,39380,39385,39386,39388,39390,39399,39402,39403,39404,39408,39412,39413,39417,39421,39422,39426,39427,39428,39435,39436,39440,39441,39446,39454,39456,39458,39459,39460,39463,39469,39470,39475,39477,39478,39480,39495,39489,39492,39498,39499,39500,39502,39505,39508,39510,39517,39594,39596,39598,39599,39602,39604,39605,39606,39609,39611,39614,39615,39617,39619,39622,39624,39630,39632,39634,39637,39638,39639,39643,39644,39648,39652,39653,39655,39657,39660,39666,39667,39669,39673,39674,39677,39679,39680,39681,39682,39683,39684,39685,39688,39689,39691,39692,39693,39694,39696,39698,39702,39705,39707,39708,39712,39718,39723,39725,39731,39732,39733,39735,39737,39738,39741,39752,39755,39756,39765,39766,39767,39771,39774,39777,39779,39781,39782,39784,39786,39787,39788,39789,39790,39795,39797,39799,39800,39801,39807,39808,39812,39813,39814,39815,39817,39818,39819,39821,39823,39824,39828,39834,39837,39838,39846,39847,39849,39852,39856,39857,39858,39863,39864,39867,39868,39870,39871,39873,39879,39880,39886,39888,39895,39896,39901,39903,39909,39911,39914,39915,39919,39923,39927,39928,39929,39930,39933,39935,39936,39938,39947,39951,39953,39958,39960,39961,39962,39964,39966,39970,39971,39974,39975,39976,39977,39978,39985,39989,39990,39991,39997,40001,40003,40004,40005,40009,40010,40014,40015,40016,40019,40020,40022,40024,40027,40029,40030,40031,40035,40041,40042,40028,40043,40040,40046,40048,40050,40053,40055,40059,40166,40178,40183,40185,40203,40194,40209,40215,40216,40220,40221,40222,40239,40240,40242,40243,40244,40250,40252,40261,40253,40258,40259,40263,40266,40275,40276,40287,40291,40290,40293,40297,40298,40299,40304,40310,40311,40315,40316,40318,40323,40324,40326,40330,40333,40334,40338,40339,40341,40342,40343,40344,40353,40362,40364,40366,40369,40373,40377,40380,40383,40387,40391,40393,40394,40404,40405,40406,40407,40410,40414,40415,40416,40421,40423,40425,40427,40430,40432,40435,40436,40446,40458,40450,40455,40462,40464,40465,40466,40469,40470,40473,40476,40477,40570,40571,40572,40576,40578,40579,40580,40581,40583,40590,40591,40598,40600,40603,40606,40612,40616,40620,40622,40623,40624,40627,40628,40629,40646,40648,40651,40661,40671,40676,40679,40684,40685,40686,40688,40689,40690,40693,40696,40703,40706,40707,40713,40719,40720,40721,40722,40724,40726,40727,40729,40730,40731,40735,40738,40742,40746,40747,40751,40753,40754,40756,40759,40761,40762,40764,40765,40767,40769,40771,40772,40773,40774,40775,40787,40789,40790,40791,40792,40794,40797,40798,40808,40809,40813,40814,40815,40816,40817,40819,40821,40826,40829,40847,40848,40849,40850,40852,40854,40855,40862,40865,40866,40867,40869,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], "ibm866":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160], "iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729], "iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729], "iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729], "iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119], "iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null], "iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null], "iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null], "iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312], "iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217], "iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255], "iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255], "iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255], "koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066], "koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066], "macintosh":[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711], "windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null], "windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729], "windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103], "windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255], "windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null], "windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255], "windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null], "windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746], "windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729], "windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255], "x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364] }; // For strict environments where `this` inside the global scope // is `undefined`, take a pure object instead }(this || {})); },{}],57:[function(require,module,exports){ // This is free and unencumbered software released into the public domain. // See LICENSE.md for more information. /** * @fileoverview Global |this| required for resolving indexes in node. * @suppress {globalThis} */ (function(global) { 'use strict'; // If we're in node require encoding-indexes and attach it to the global. if (typeof module !== "undefined" && module.exports && !global["encoding-indexes"]) { global["encoding-indexes"] = require("./encoding-indexes.js")["encoding-indexes"]; } // // Utilities // /** * @param {number} a The number to test. * @param {number} min The minimum value in the range, inclusive. * @param {number} max The maximum value in the range, inclusive. * @return {boolean} True if a >= min and a <= max. */ function inRange(a, min, max) { return min <= a && a <= max; } /** * @param {!Array.<*>} array The array to check. * @param {*} item The item to look for in the array. * @return {boolean} True if the item appears in the array. */ function includes(array, item) { return array.indexOf(item) !== -1; } var floor = Math.floor; /** * @param {*} o * @return {Object} */ function ToDictionary(o) { if (o === undefined) return {}; if (o === Object(o)) return o; throw TypeError('Could not convert argument to dictionary'); } /** * @param {string} string Input string of UTF-16 code units. * @return {!Array.} Code points. */ function stringToCodePoints(string) { // https://heycam.github.io/webidl/#dfn-obtain-unicode // 1. Let S be the DOMString value. var s = String(string); // 2. Let n be the length of S. var n = s.length; // 3. Initialize i to 0. var i = 0; // 4. Initialize U to be an empty sequence of Unicode characters. var u = []; // 5. While i < n: while (i < n) { // 1. Let c be the code unit in S at index i. var c = s.charCodeAt(i); // 2. Depending on the value of c: // c < 0xD800 or c > 0xDFFF if (c < 0xD800 || c > 0xDFFF) { // Append to U the Unicode character with code point c. u.push(c); } // 0xDC00 ≤ c ≤ 0xDFFF else if (0xDC00 <= c && c <= 0xDFFF) { // Append to U a U+FFFD REPLACEMENT CHARACTER. u.push(0xFFFD); } // 0xD800 ≤ c ≤ 0xDBFF else if (0xD800 <= c && c <= 0xDBFF) { // 1. If i = n−1, then append to U a U+FFFD REPLACEMENT // CHARACTER. if (i === n - 1) { u.push(0xFFFD); } // 2. Otherwise, i < n−1: else { // 1. Let d be the code unit in S at index i+1. var d = s.charCodeAt(i + 1); // 2. If 0xDC00 ≤ d ≤ 0xDFFF, then: if (0xDC00 <= d && d <= 0xDFFF) { // 1. Let a be c & 0x3FF. var a = c & 0x3FF; // 2. Let b be d & 0x3FF. var b = d & 0x3FF; // 3. Append to U the Unicode character with code point // 2^16+2^10*a+b. u.push(0x10000 + (a << 10) + b); // 4. Set i to i+1. i += 1; } // 3. Otherwise, d < 0xDC00 or d > 0xDFFF. Append to U a // U+FFFD REPLACEMENT CHARACTER. else { u.push(0xFFFD); } } } // 3. Set i to i+1. i += 1; } // 6. Return U. return u; } /** * @param {!Array.} code_points Array of code points. * @return {string} string String of UTF-16 code units. */ function codePointsToString(code_points) { var s = ''; for (var i = 0; i < code_points.length; ++i) { var cp = code_points[i]; if (cp <= 0xFFFF) { s += String.fromCharCode(cp); } else { cp -= 0x10000; s += String.fromCharCode((cp >> 10) + 0xD800, (cp & 0x3FF) + 0xDC00); } } return s; } // // Implementation of Encoding specification // https://encoding.spec.whatwg.org/ // // // 4. Terminology // /** * An ASCII byte is a byte in the range 0x00 to 0x7F, inclusive. * @param {number} a The number to test. * @return {boolean} True if a is in the range 0x00 to 0x7F, inclusive. */ function isASCIIByte(a) { return 0x00 <= a && a <= 0x7F; } /** * An ASCII code point is a code point in the range U+0000 to * U+007F, inclusive. */ var isASCIICodePoint = isASCIIByte; /** * End-of-stream is a special token that signifies no more tokens * are in the stream. * @const */ var end_of_stream = -1; /** * A stream represents an ordered sequence of tokens. * * @constructor * @param {!(Array.|Uint8Array)} tokens Array of tokens that provide * the stream. */ function Stream(tokens) { /** @type {!Array.} */ this.tokens = [].slice.call(tokens); // Reversed as push/pop is more efficient than shift/unshift. this.tokens.reverse(); } Stream.prototype = { /** * @return {boolean} True if end-of-stream has been hit. */ endOfStream: function() { return !this.tokens.length; }, /** * When a token is read from a stream, the first token in the * stream must be returned and subsequently removed, and * end-of-stream must be returned otherwise. * * @return {number} Get the next token from the stream, or * end_of_stream. */ read: function() { if (!this.tokens.length) return end_of_stream; return this.tokens.pop(); }, /** * When one or more tokens are prepended to a stream, those tokens * must be inserted, in given order, before the first token in the * stream. * * @param {(number|!Array.)} token The token(s) to prepend to the * stream. */ prepend: function(token) { if (Array.isArray(token)) { var tokens = /**@type {!Array.}*/(token); while (tokens.length) this.tokens.push(tokens.pop()); } else { this.tokens.push(token); } }, /** * When one or more tokens are pushed to a stream, those tokens * must be inserted, in given order, after the last token in the * stream. * * @param {(number|!Array.)} token The tokens(s) to push to the * stream. */ push: function(token) { if (Array.isArray(token)) { var tokens = /**@type {!Array.}*/(token); while (tokens.length) this.tokens.unshift(tokens.shift()); } else { this.tokens.unshift(token); } } }; // // 5. Encodings // // 5.1 Encoders and decoders /** @const */ var finished = -1; /** * @param {boolean} fatal If true, decoding errors raise an exception. * @param {number=} opt_code_point Override the standard fallback code point. * @return {number} The code point to insert on a decoding error. */ function decoderError(fatal, opt_code_point) { if (fatal) throw TypeError('Decoder error'); return opt_code_point || 0xFFFD; } /** * @param {number} code_point The code point that could not be encoded. * @return {number} Always throws, no value is actually returned. */ function encoderError(code_point) { throw TypeError('The code point ' + code_point + ' could not be encoded.'); } /** @interface */ function Decoder() {} Decoder.prototype = { /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point, or |finished|. */ handler: function(stream, bite) {} }; /** @interface */ function Encoder() {} Encoder.prototype = { /** * @param {Stream} stream The stream of code points being encoded. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit, or |finished|. */ handler: function(stream, code_point) {} }; // 5.2 Names and labels // TODO: Define @typedef for Encoding: {name:string,labels:Array.} // https://github.com/google/closure-compiler/issues/247 /** * @param {string} label The encoding label. * @return {?{name:string,labels:Array.}} */ function getEncoding(label) { // 1. Remove any leading and trailing ASCII whitespace from label. label = String(label).trim().toLowerCase(); // 2. If label is an ASCII case-insensitive match for any of the // labels listed in the table below, return the corresponding // encoding, and failure otherwise. if (Object.prototype.hasOwnProperty.call(label_to_encoding, label)) { return label_to_encoding[label]; } return null; } /** * Encodings table: https://encoding.spec.whatwg.org/encodings.json * @const * @type {!Array.<{ * heading: string, * encodings: Array.<{name:string,labels:Array.}> * }>} */ var encodings = [ { "encodings": [ { "labels": [ "unicode-1-1-utf-8", "utf-8", "utf8" ], "name": "UTF-8" } ], "heading": "The Encoding" }, { "encodings": [ { "labels": [ "866", "cp866", "csibm866", "ibm866" ], "name": "IBM866" }, { "labels": [ "csisolatin2", "iso-8859-2", "iso-ir-101", "iso8859-2", "iso88592", "iso_8859-2", "iso_8859-2:1987", "l2", "latin2" ], "name": "ISO-8859-2" }, { "labels": [ "csisolatin3", "iso-8859-3", "iso-ir-109", "iso8859-3", "iso88593", "iso_8859-3", "iso_8859-3:1988", "l3", "latin3" ], "name": "ISO-8859-3" }, { "labels": [ "csisolatin4", "iso-8859-4", "iso-ir-110", "iso8859-4", "iso88594", "iso_8859-4", "iso_8859-4:1988", "l4", "latin4" ], "name": "ISO-8859-4" }, { "labels": [ "csisolatincyrillic", "cyrillic", "iso-8859-5", "iso-ir-144", "iso8859-5", "iso88595", "iso_8859-5", "iso_8859-5:1988" ], "name": "ISO-8859-5" }, { "labels": [ "arabic", "asmo-708", "csiso88596e", "csiso88596i", "csisolatinarabic", "ecma-114", "iso-8859-6", "iso-8859-6-e", "iso-8859-6-i", "iso-ir-127", "iso8859-6", "iso88596", "iso_8859-6", "iso_8859-6:1987" ], "name": "ISO-8859-6" }, { "labels": [ "csisolatingreek", "ecma-118", "elot_928", "greek", "greek8", "iso-8859-7", "iso-ir-126", "iso8859-7", "iso88597", "iso_8859-7", "iso_8859-7:1987", "sun_eu_greek" ], "name": "ISO-8859-7" }, { "labels": [ "csiso88598e", "csisolatinhebrew", "hebrew", "iso-8859-8", "iso-8859-8-e", "iso-ir-138", "iso8859-8", "iso88598", "iso_8859-8", "iso_8859-8:1988", "visual" ], "name": "ISO-8859-8" }, { "labels": [ "csiso88598i", "iso-8859-8-i", "logical" ], "name": "ISO-8859-8-I" }, { "labels": [ "csisolatin6", "iso-8859-10", "iso-ir-157", "iso8859-10", "iso885910", "l6", "latin6" ], "name": "ISO-8859-10" }, { "labels": [ "iso-8859-13", "iso8859-13", "iso885913" ], "name": "ISO-8859-13" }, { "labels": [ "iso-8859-14", "iso8859-14", "iso885914" ], "name": "ISO-8859-14" }, { "labels": [ "csisolatin9", "iso-8859-15", "iso8859-15", "iso885915", "iso_8859-15", "l9" ], "name": "ISO-8859-15" }, { "labels": [ "iso-8859-16" ], "name": "ISO-8859-16" }, { "labels": [ "cskoi8r", "koi", "koi8", "koi8-r", "koi8_r" ], "name": "KOI8-R" }, { "labels": [ "koi8-ru", "koi8-u" ], "name": "KOI8-U" }, { "labels": [ "csmacintosh", "mac", "macintosh", "x-mac-roman" ], "name": "macintosh" }, { "labels": [ "dos-874", "iso-8859-11", "iso8859-11", "iso885911", "tis-620", "windows-874" ], "name": "windows-874" }, { "labels": [ "cp1250", "windows-1250", "x-cp1250" ], "name": "windows-1250" }, { "labels": [ "cp1251", "windows-1251", "x-cp1251" ], "name": "windows-1251" }, { "labels": [ "ansi_x3.4-1968", "ascii", "cp1252", "cp819", "csisolatin1", "ibm819", "iso-8859-1", "iso-ir-100", "iso8859-1", "iso88591", "iso_8859-1", "iso_8859-1:1987", "l1", "latin1", "us-ascii", "windows-1252", "x-cp1252" ], "name": "windows-1252" }, { "labels": [ "cp1253", "windows-1253", "x-cp1253" ], "name": "windows-1253" }, { "labels": [ "cp1254", "csisolatin5", "iso-8859-9", "iso-ir-148", "iso8859-9", "iso88599", "iso_8859-9", "iso_8859-9:1989", "l5", "latin5", "windows-1254", "x-cp1254" ], "name": "windows-1254" }, { "labels": [ "cp1255", "windows-1255", "x-cp1255" ], "name": "windows-1255" }, { "labels": [ "cp1256", "windows-1256", "x-cp1256" ], "name": "windows-1256" }, { "labels": [ "cp1257", "windows-1257", "x-cp1257" ], "name": "windows-1257" }, { "labels": [ "cp1258", "windows-1258", "x-cp1258" ], "name": "windows-1258" }, { "labels": [ "x-mac-cyrillic", "x-mac-ukrainian" ], "name": "x-mac-cyrillic" } ], "heading": "Legacy single-byte encodings" }, { "encodings": [ { "labels": [ "chinese", "csgb2312", "csiso58gb231280", "gb2312", "gb_2312", "gb_2312-80", "gbk", "iso-ir-58", "x-gbk" ], "name": "GBK" }, { "labels": [ "gb18030" ], "name": "gb18030" } ], "heading": "Legacy multi-byte Chinese (simplified) encodings" }, { "encodings": [ { "labels": [ "big5", "big5-hkscs", "cn-big5", "csbig5", "x-x-big5" ], "name": "Big5" } ], "heading": "Legacy multi-byte Chinese (traditional) encodings" }, { "encodings": [ { "labels": [ "cseucpkdfmtjapanese", "euc-jp", "x-euc-jp" ], "name": "EUC-JP" }, { "labels": [ "csiso2022jp", "iso-2022-jp" ], "name": "ISO-2022-JP" }, { "labels": [ "csshiftjis", "ms932", "ms_kanji", "shift-jis", "shift_jis", "sjis", "windows-31j", "x-sjis" ], "name": "Shift_JIS" } ], "heading": "Legacy multi-byte Japanese encodings" }, { "encodings": [ { "labels": [ "cseuckr", "csksc56011987", "euc-kr", "iso-ir-149", "korean", "ks_c_5601-1987", "ks_c_5601-1989", "ksc5601", "ksc_5601", "windows-949" ], "name": "EUC-KR" } ], "heading": "Legacy multi-byte Korean encodings" }, { "encodings": [ { "labels": [ "csiso2022kr", "hz-gb-2312", "iso-2022-cn", "iso-2022-cn-ext", "iso-2022-kr" ], "name": "replacement" }, { "labels": [ "utf-16be" ], "name": "UTF-16BE" }, { "labels": [ "utf-16", "utf-16le" ], "name": "UTF-16LE" }, { "labels": [ "x-user-defined" ], "name": "x-user-defined" } ], "heading": "Legacy miscellaneous encodings" } ]; // Label to encoding registry. /** @type {Object.}>} */ var label_to_encoding = {}; encodings.forEach(function(category) { category.encodings.forEach(function(encoding) { encoding.labels.forEach(function(label) { label_to_encoding[label] = encoding; }); }); }); // Registry of of encoder/decoder factories, by encoding name. /** @type {Object.} */ var encoders = {}; /** @type {Object.} */ var decoders = {}; // // 6. Indexes // /** * @param {number} pointer The |pointer| to search for. * @param {(!Array.|undefined)} index The |index| to search within. * @return {?number} The code point corresponding to |pointer| in |index|, * or null if |code point| is not in |index|. */ function indexCodePointFor(pointer, index) { if (!index) return null; return index[pointer] || null; } /** * @param {number} code_point The |code point| to search for. * @param {!Array.} index The |index| to search within. * @return {?number} The first pointer corresponding to |code point| in * |index|, or null if |code point| is not in |index|. */ function indexPointerFor(code_point, index) { var pointer = index.indexOf(code_point); return pointer === -1 ? null : pointer; } /** * @param {string} name Name of the index. * @return {(!Array.|!Array.>)} * */ function index(name) { if (!('encoding-indexes' in global)) { throw Error("Indexes missing." + " Did you forget to include encoding-indexes.js first?"); } return global['encoding-indexes'][name]; } /** * @param {number} pointer The |pointer| to search for in the gb18030 index. * @return {?number} The code point corresponding to |pointer| in |index|, * or null if |code point| is not in the gb18030 index. */ function indexGB18030RangesCodePointFor(pointer) { // 1. If pointer is greater than 39419 and less than 189000, or // pointer is greater than 1237575, return null. if ((pointer > 39419 && pointer < 189000) || (pointer > 1237575)) return null; // 2. If pointer is 7457, return code point U+E7C7. if (pointer === 7457) return 0xE7C7; // 3. Let offset be the last pointer in index gb18030 ranges that // is equal to or less than pointer and let code point offset be // its corresponding code point. var offset = 0; var code_point_offset = 0; var idx = index('gb18030-ranges'); var i; for (i = 0; i < idx.length; ++i) { /** @type {!Array.} */ var entry = idx[i]; if (entry[0] <= pointer) { offset = entry[0]; code_point_offset = entry[1]; } else { break; } } // 4. Return a code point whose value is code point offset + // pointer − offset. return code_point_offset + pointer - offset; } /** * @param {number} code_point The |code point| to locate in the gb18030 index. * @return {number} The first pointer corresponding to |code point| in the * gb18030 index. */ function indexGB18030RangesPointerFor(code_point) { // 1. If code point is U+E7C7, return pointer 7457. if (code_point === 0xE7C7) return 7457; // 2. Let offset be the last code point in index gb18030 ranges // that is equal to or less than code point and let pointer offset // be its corresponding pointer. var offset = 0; var pointer_offset = 0; var idx = index('gb18030-ranges'); var i; for (i = 0; i < idx.length; ++i) { /** @type {!Array.} */ var entry = idx[i]; if (entry[1] <= code_point) { offset = entry[1]; pointer_offset = entry[0]; } else { break; } } // 3. Return a pointer whose value is pointer offset + code point // − offset. return pointer_offset + code_point - offset; } /** * @param {number} code_point The |code_point| to search for in the Shift_JIS * index. * @return {?number} The code point corresponding to |pointer| in |index|, * or null if |code point| is not in the Shift_JIS index. */ function indexShiftJISPointerFor(code_point) { // 1. Let index be index jis0208 excluding all entries whose // pointer is in the range 8272 to 8835, inclusive. shift_jis_index = shift_jis_index || index('jis0208').map(function(code_point, pointer) { return inRange(pointer, 8272, 8835) ? null : code_point; }); var index_ = shift_jis_index; // 2. Return the index pointer for code point in index. return index_.indexOf(code_point); } var shift_jis_index; /** * @param {number} code_point The |code_point| to search for in the big5 * index. * @return {?number} The code point corresponding to |pointer| in |index|, * or null if |code point| is not in the big5 index. */ function indexBig5PointerFor(code_point) { // 1. Let index be index Big5 excluding all entries whose pointer big5_index_no_hkscs = big5_index_no_hkscs || index('big5').map(function(code_point, pointer) { return (pointer < (0xA1 - 0x81) * 157) ? null : code_point; }); var index_ = big5_index_no_hkscs; // 2. If code point is U+2550, U+255E, U+2561, U+256A, U+5341, or // U+5345, return the last pointer corresponding to code point in // index. if (code_point === 0x2550 || code_point === 0x255E || code_point === 0x2561 || code_point === 0x256A || code_point === 0x5341 || code_point === 0x5345) { return index_.lastIndexOf(code_point); } // 3. Return the index pointer for code point in index. return indexPointerFor(code_point, index_); } var big5_index_no_hkscs; // // 8. API // /** @const */ var DEFAULT_ENCODING = 'utf-8'; // 8.1 Interface TextDecoder /** * @constructor * @param {string=} label The label of the encoding; * defaults to 'utf-8'. * @param {Object=} options */ function TextDecoder(label, options) { // Web IDL conventions if (!(this instanceof TextDecoder)) throw TypeError('Called as a function. Did you forget \'new\'?'); label = label !== undefined ? String(label) : DEFAULT_ENCODING; options = ToDictionary(options); // A TextDecoder object has an associated encoding, decoder, // stream, ignore BOM flag (initially unset), BOM seen flag // (initially unset), error mode (initially replacement), and do // not flush flag (initially unset). /** @private */ this._encoding = null; /** @private @type {?Decoder} */ this._decoder = null; /** @private @type {boolean} */ this._ignoreBOM = false; /** @private @type {boolean} */ this._BOMseen = false; /** @private @type {string} */ this._error_mode = 'replacement'; /** @private @type {boolean} */ this._do_not_flush = false; // 1. Let encoding be the result of getting an encoding from // label. var encoding = getEncoding(label); // 2. If encoding is failure or replacement, throw a RangeError. if (encoding === null || encoding.name === 'replacement') throw RangeError('Unknown encoding: ' + label); if (!decoders[encoding.name]) { throw Error('Decoder not present.' + ' Did you forget to include encoding-indexes.js first?'); } // 3. Let dec be a new TextDecoder object. var dec = this; // 4. Set dec's encoding to encoding. dec._encoding = encoding; // 5. If options's fatal member is true, set dec's error mode to // fatal. if (Boolean(options['fatal'])) dec._error_mode = 'fatal'; // 6. If options's ignoreBOM member is true, set dec's ignore BOM // flag. if (Boolean(options['ignoreBOM'])) dec._ignoreBOM = true; // For pre-ES5 runtimes: if (!Object.defineProperty) { this.encoding = dec._encoding.name.toLowerCase(); this.fatal = dec._error_mode === 'fatal'; this.ignoreBOM = dec._ignoreBOM; } // 7. Return dec. return dec; } if (Object.defineProperty) { // The encoding attribute's getter must return encoding's name. Object.defineProperty(TextDecoder.prototype, 'encoding', { /** @this {TextDecoder} */ get: function() { return this._encoding.name.toLowerCase(); } }); // The fatal attribute's getter must return true if error mode // is fatal, and false otherwise. Object.defineProperty(TextDecoder.prototype, 'fatal', { /** @this {TextDecoder} */ get: function() { return this._error_mode === 'fatal'; } }); // The ignoreBOM attribute's getter must return true if ignore // BOM flag is set, and false otherwise. Object.defineProperty(TextDecoder.prototype, 'ignoreBOM', { /** @this {TextDecoder} */ get: function() { return this._ignoreBOM; } }); } /** * @param {BufferSource=} input The buffer of bytes to decode. * @param {Object=} options * @return {string} The decoded string. */ TextDecoder.prototype.decode = function decode(input, options) { var bytes; if (typeof input === 'object' && input instanceof ArrayBuffer) { bytes = new Uint8Array(input); } else if (typeof input === 'object' && 'buffer' in input && input.buffer instanceof ArrayBuffer) { bytes = new Uint8Array(input.buffer, input.byteOffset, input.byteLength); } else { bytes = new Uint8Array(0); } options = ToDictionary(options); // 1. If the do not flush flag is unset, set decoder to a new // encoding's decoder, set stream to a new stream, and unset the // BOM seen flag. if (!this._do_not_flush) { this._decoder = decoders[this._encoding.name]({ fatal: this._error_mode === 'fatal'}); this._BOMseen = false; } // 2. If options's stream is true, set the do not flush flag, and // unset the do not flush flag otherwise. this._do_not_flush = Boolean(options['stream']); // 3. If input is given, push a copy of input to stream. // TODO: Align with spec algorithm - maintain stream on instance. var input_stream = new Stream(bytes); // 4. Let output be a new stream. var output = []; /** @type {?(number|!Array.)} */ var result; // 5. While true: while (true) { // 1. Let token be the result of reading from stream. var token = input_stream.read(); // 2. If token is end-of-stream and the do not flush flag is // set, return output, serialized. // TODO: Align with spec algorithm. if (token === end_of_stream) break; // 3. Otherwise, run these subsubsteps: // 1. Let result be the result of processing token for decoder, // stream, output, and error mode. result = this._decoder.handler(input_stream, token); // 2. If result is finished, return output, serialized. if (result === finished) break; if (result !== null) { if (Array.isArray(result)) output.push.apply(output, /**@type {!Array.}*/(result)); else output.push(result); } // 3. Otherwise, if result is error, throw a TypeError. // (Thrown in handler) // 4. Otherwise, do nothing. } // TODO: Align with spec algorithm. if (!this._do_not_flush) { do { result = this._decoder.handler(input_stream, input_stream.read()); if (result === finished) break; if (result === null) continue; if (Array.isArray(result)) output.push.apply(output, /**@type {!Array.}*/(result)); else output.push(result); } while (!input_stream.endOfStream()); this._decoder = null; } // A TextDecoder object also has an associated serialize stream // algorithm... /** * @param {!Array.} stream * @return {string} * @this {TextDecoder} */ function serializeStream(stream) { // 1. Let token be the result of reading from stream. // (Done in-place on array, rather than as a stream) // 2. If encoding is UTF-8, UTF-16BE, or UTF-16LE, and ignore // BOM flag and BOM seen flag are unset, run these subsubsteps: if (includes(['UTF-8', 'UTF-16LE', 'UTF-16BE'], this._encoding.name) && !this._ignoreBOM && !this._BOMseen) { if (stream.length > 0 && stream[0] === 0xFEFF) { // 1. If token is U+FEFF, set BOM seen flag. this._BOMseen = true; stream.shift(); } else if (stream.length > 0) { // 2. Otherwise, if token is not end-of-stream, set BOM seen // flag and append token to stream. this._BOMseen = true; } else { // 3. Otherwise, if token is not end-of-stream, append token // to output. // (no-op) } } // 4. Otherwise, return output. return codePointsToString(stream); } return serializeStream.call(this, output); }; // 8.2 Interface TextEncoder /** * @constructor * @param {string=} label The label of the encoding. NONSTANDARD. * @param {Object=} options NONSTANDARD. */ function TextEncoder(label, options) { // Web IDL conventions if (!(this instanceof TextEncoder)) throw TypeError('Called as a function. Did you forget \'new\'?'); options = ToDictionary(options); // A TextEncoder object has an associated encoding and encoder. /** @private */ this._encoding = null; /** @private @type {?Encoder} */ this._encoder = null; // Non-standard /** @private @type {boolean} */ this._do_not_flush = false; /** @private @type {string} */ this._fatal = Boolean(options['fatal']) ? 'fatal' : 'replacement'; // 1. Let enc be a new TextEncoder object. var enc = this; // 2. Set enc's encoding to UTF-8's encoder. if (Boolean(options['NONSTANDARD_allowLegacyEncoding'])) { // NONSTANDARD behavior. label = label !== undefined ? String(label) : DEFAULT_ENCODING; var encoding = getEncoding(label); if (encoding === null || encoding.name === 'replacement') throw RangeError('Unknown encoding: ' + label); if (!encoders[encoding.name]) { throw Error('Encoder not present.' + ' Did you forget to include encoding-indexes.js first?'); } enc._encoding = encoding; } else { // Standard behavior. enc._encoding = getEncoding('utf-8'); if (label !== undefined && 'console' in global) { console.warn('TextEncoder constructor called with encoding label, ' + 'which is ignored.'); } } // For pre-ES5 runtimes: if (!Object.defineProperty) this.encoding = enc._encoding.name.toLowerCase(); // 3. Return enc. return enc; } if (Object.defineProperty) { // The encoding attribute's getter must return encoding's name. Object.defineProperty(TextEncoder.prototype, 'encoding', { /** @this {TextEncoder} */ get: function() { return this._encoding.name.toLowerCase(); } }); } /** * @param {string=} opt_string The string to encode. * @param {Object=} options * @return {!Uint8Array} Encoded bytes, as a Uint8Array. */ TextEncoder.prototype.encode = function encode(opt_string, options) { opt_string = opt_string === undefined ? '' : String(opt_string); options = ToDictionary(options); // NOTE: This option is nonstandard. None of the encodings // permitted for encoding (i.e. UTF-8, UTF-16) are stateful when // the input is a USVString so streaming is not necessary. if (!this._do_not_flush) this._encoder = encoders[this._encoding.name]({ fatal: this._fatal === 'fatal'}); this._do_not_flush = Boolean(options['stream']); // 1. Convert input to a stream. var input = new Stream(stringToCodePoints(opt_string)); // 2. Let output be a new stream var output = []; /** @type {?(number|!Array.)} */ var result; // 3. While true, run these substeps: while (true) { // 1. Let token be the result of reading from input. var token = input.read(); if (token === end_of_stream) break; // 2. Let result be the result of processing token for encoder, // input, output. result = this._encoder.handler(input, token); if (result === finished) break; if (Array.isArray(result)) output.push.apply(output, /**@type {!Array.}*/(result)); else output.push(result); } // TODO: Align with spec algorithm. if (!this._do_not_flush) { while (true) { result = this._encoder.handler(input, input.read()); if (result === finished) break; if (Array.isArray(result)) output.push.apply(output, /**@type {!Array.}*/(result)); else output.push(result); } this._encoder = null; } // 3. If result is finished, convert output into a byte sequence, // and then return a Uint8Array object wrapping an ArrayBuffer // containing output. return new Uint8Array(output); }; // // 9. The encoding // // 9.1 utf-8 // 9.1.1 utf-8 decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function UTF8Decoder(options) { var fatal = options.fatal; // utf-8's decoder's has an associated utf-8 code point, utf-8 // bytes seen, and utf-8 bytes needed (all initially 0), a utf-8 // lower boundary (initially 0x80), and a utf-8 upper boundary // (initially 0xBF). var /** @type {number} */ utf8_code_point = 0, /** @type {number} */ utf8_bytes_seen = 0, /** @type {number} */ utf8_bytes_needed = 0, /** @type {number} */ utf8_lower_boundary = 0x80, /** @type {number} */ utf8_upper_boundary = 0xBF; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and utf-8 bytes needed is not 0, // set utf-8 bytes needed to 0 and return error. if (bite === end_of_stream && utf8_bytes_needed !== 0) { utf8_bytes_needed = 0; return decoderError(fatal); } // 2. If byte is end-of-stream, return finished. if (bite === end_of_stream) return finished; // 3. If utf-8 bytes needed is 0, based on byte: if (utf8_bytes_needed === 0) { // 0x00 to 0x7F if (inRange(bite, 0x00, 0x7F)) { // Return a code point whose value is byte. return bite; } // 0xC2 to 0xDF else if (inRange(bite, 0xC2, 0xDF)) { // 1. Set utf-8 bytes needed to 1. utf8_bytes_needed = 1; // 2. Set UTF-8 code point to byte & 0x1F. utf8_code_point = bite & 0x1F; } // 0xE0 to 0xEF else if (inRange(bite, 0xE0, 0xEF)) { // 1. If byte is 0xE0, set utf-8 lower boundary to 0xA0. if (bite === 0xE0) utf8_lower_boundary = 0xA0; // 2. If byte is 0xED, set utf-8 upper boundary to 0x9F. if (bite === 0xED) utf8_upper_boundary = 0x9F; // 3. Set utf-8 bytes needed to 2. utf8_bytes_needed = 2; // 4. Set UTF-8 code point to byte & 0xF. utf8_code_point = bite & 0xF; } // 0xF0 to 0xF4 else if (inRange(bite, 0xF0, 0xF4)) { // 1. If byte is 0xF0, set utf-8 lower boundary to 0x90. if (bite === 0xF0) utf8_lower_boundary = 0x90; // 2. If byte is 0xF4, set utf-8 upper boundary to 0x8F. if (bite === 0xF4) utf8_upper_boundary = 0x8F; // 3. Set utf-8 bytes needed to 3. utf8_bytes_needed = 3; // 4. Set UTF-8 code point to byte & 0x7. utf8_code_point = bite & 0x7; } // Otherwise else { // Return error. return decoderError(fatal); } // Return continue. return null; } // 4. If byte is not in the range utf-8 lower boundary to utf-8 // upper boundary, inclusive, run these substeps: if (!inRange(bite, utf8_lower_boundary, utf8_upper_boundary)) { // 1. Set utf-8 code point, utf-8 bytes needed, and utf-8 // bytes seen to 0, set utf-8 lower boundary to 0x80, and set // utf-8 upper boundary to 0xBF. utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0; utf8_lower_boundary = 0x80; utf8_upper_boundary = 0xBF; // 2. Prepend byte to stream. stream.prepend(bite); // 3. Return error. return decoderError(fatal); } // 5. Set utf-8 lower boundary to 0x80 and utf-8 upper boundary // to 0xBF. utf8_lower_boundary = 0x80; utf8_upper_boundary = 0xBF; // 6. Set UTF-8 code point to (UTF-8 code point << 6) | (byte & // 0x3F) utf8_code_point = (utf8_code_point << 6) | (bite & 0x3F); // 7. Increase utf-8 bytes seen by one. utf8_bytes_seen += 1; // 8. If utf-8 bytes seen is not equal to utf-8 bytes needed, // continue. if (utf8_bytes_seen !== utf8_bytes_needed) return null; // 9. Let code point be utf-8 code point. var code_point = utf8_code_point; // 10. Set utf-8 code point, utf-8 bytes needed, and utf-8 bytes // seen to 0. utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0; // 11. Return a code point whose value is code point. return code_point; }; } // 9.1.2 utf-8 encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function UTF8Encoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. Set count and offset based on the range code point is in: var count, offset; // U+0080 to U+07FF, inclusive: if (inRange(code_point, 0x0080, 0x07FF)) { // 1 and 0xC0 count = 1; offset = 0xC0; } // U+0800 to U+FFFF, inclusive: else if (inRange(code_point, 0x0800, 0xFFFF)) { // 2 and 0xE0 count = 2; offset = 0xE0; } // U+10000 to U+10FFFF, inclusive: else if (inRange(code_point, 0x10000, 0x10FFFF)) { // 3 and 0xF0 count = 3; offset = 0xF0; } // 4. Let bytes be a byte sequence whose first byte is (code // point >> (6 × count)) + offset. var bytes = [(code_point >> (6 * count)) + offset]; // 5. Run these substeps while count is greater than 0: while (count > 0) { // 1. Set temp to code point >> (6 × (count − 1)). var temp = code_point >> (6 * (count - 1)); // 2. Append to bytes 0x80 | (temp & 0x3F). bytes.push(0x80 | (temp & 0x3F)); // 3. Decrease count by one. count -= 1; } // 6. Return bytes bytes, in order. return bytes; }; } /** @param {{fatal: boolean}} options */ encoders['UTF-8'] = function(options) { return new UTF8Encoder(options); }; /** @param {{fatal: boolean}} options */ decoders['UTF-8'] = function(options) { return new UTF8Decoder(options); }; // // 10. Legacy single-byte encodings // // 10.1 single-byte decoder /** * @constructor * @implements {Decoder} * @param {!Array.} index The encoding index. * @param {{fatal: boolean}} options */ function SingleByteDecoder(index, options) { var fatal = options.fatal; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream, return finished. if (bite === end_of_stream) return finished; // 2. If byte is an ASCII byte, return a code point whose value // is byte. if (isASCIIByte(bite)) return bite; // 3. Let code point be the index code point for byte − 0x80 in // index single-byte. var code_point = index[bite - 0x80]; // 4. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 5. Return a code point whose value is code point. return code_point; }; } // 10.2 single-byte encoder /** * @constructor * @implements {Encoder} * @param {!Array.} index The encoding index. * @param {{fatal: boolean}} options */ function SingleByteEncoder(index, options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. Let pointer be the index pointer for code point in index // single-byte. var pointer = indexPointerFor(code_point, index); // 4. If pointer is null, return error with code point. if (pointer === null) encoderError(code_point); // 5. Return a byte whose value is pointer + 0x80. return pointer + 0x80; }; } (function() { if (!('encoding-indexes' in global)) return; encodings.forEach(function(category) { if (category.heading !== 'Legacy single-byte encodings') return; category.encodings.forEach(function(encoding) { var name = encoding.name; var idx = index(name.toLowerCase()); /** @param {{fatal: boolean}} options */ decoders[name] = function(options) { return new SingleByteDecoder(idx, options); }; /** @param {{fatal: boolean}} options */ encoders[name] = function(options) { return new SingleByteEncoder(idx, options); }; }); }); }()); // // 11. Legacy multi-byte Chinese (simplified) encodings // // 11.1 gbk // 11.1.1 gbk decoder // gbk's decoder is gb18030's decoder. /** @param {{fatal: boolean}} options */ decoders['GBK'] = function(options) { return new GB18030Decoder(options); }; // 11.1.2 gbk encoder // gbk's encoder is gb18030's encoder with its gbk flag set. /** @param {{fatal: boolean}} options */ encoders['GBK'] = function(options) { return new GB18030Encoder(options, true); }; // 11.2 gb18030 // 11.2.1 gb18030 decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function GB18030Decoder(options) { var fatal = options.fatal; // gb18030's decoder has an associated gb18030 first, gb18030 // second, and gb18030 third (all initially 0x00). var /** @type {number} */ gb18030_first = 0x00, /** @type {number} */ gb18030_second = 0x00, /** @type {number} */ gb18030_third = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and gb18030 first, gb18030 // second, and gb18030 third are 0x00, return finished. if (bite === end_of_stream && gb18030_first === 0x00 && gb18030_second === 0x00 && gb18030_third === 0x00) { return finished; } // 2. If byte is end-of-stream, and gb18030 first, gb18030 // second, or gb18030 third is not 0x00, set gb18030 first, // gb18030 second, and gb18030 third to 0x00, and return error. if (bite === end_of_stream && (gb18030_first !== 0x00 || gb18030_second !== 0x00 || gb18030_third !== 0x00)) { gb18030_first = 0x00; gb18030_second = 0x00; gb18030_third = 0x00; decoderError(fatal); } var code_point; // 3. If gb18030 third is not 0x00, run these substeps: if (gb18030_third !== 0x00) { // 1. Let code point be null. code_point = null; // 2. If byte is in the range 0x30 to 0x39, inclusive, set // code point to the index gb18030 ranges code point for // (((gb18030 first − 0x81) × 10 + gb18030 second − 0x30) × // 126 + gb18030 third − 0x81) × 10 + byte − 0x30. if (inRange(bite, 0x30, 0x39)) { code_point = indexGB18030RangesCodePointFor( (((gb18030_first - 0x81) * 10 + gb18030_second - 0x30) * 126 + gb18030_third - 0x81) * 10 + bite - 0x30); } // 3. Let buffer be a byte sequence consisting of gb18030 // second, gb18030 third, and byte, in order. var buffer = [gb18030_second, gb18030_third, bite]; // 4. Set gb18030 first, gb18030 second, and gb18030 third to // 0x00. gb18030_first = 0x00; gb18030_second = 0x00; gb18030_third = 0x00; // 5. If code point is null, prepend buffer to stream and // return error. if (code_point === null) { stream.prepend(buffer); return decoderError(fatal); } // 6. Return a code point whose value is code point. return code_point; } // 4. If gb18030 second is not 0x00, run these substeps: if (gb18030_second !== 0x00) { // 1. If byte is in the range 0x81 to 0xFE, inclusive, set // gb18030 third to byte and return continue. if (inRange(bite, 0x81, 0xFE)) { gb18030_third = bite; return null; } // 2. Prepend gb18030 second followed by byte to stream, set // gb18030 first and gb18030 second to 0x00, and return error. stream.prepend([gb18030_second, bite]); gb18030_first = 0x00; gb18030_second = 0x00; return decoderError(fatal); } // 5. If gb18030 first is not 0x00, run these substeps: if (gb18030_first !== 0x00) { // 1. If byte is in the range 0x30 to 0x39, inclusive, set // gb18030 second to byte and return continue. if (inRange(bite, 0x30, 0x39)) { gb18030_second = bite; return null; } // 2. Let lead be gb18030 first, let pointer be null, and set // gb18030 first to 0x00. var lead = gb18030_first; var pointer = null; gb18030_first = 0x00; // 3. Let offset be 0x40 if byte is less than 0x7F and 0x41 // otherwise. var offset = bite < 0x7F ? 0x40 : 0x41; // 4. If byte is in the range 0x40 to 0x7E, inclusive, or 0x80 // to 0xFE, inclusive, set pointer to (lead − 0x81) × 190 + // (byte − offset). if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0x80, 0xFE)) pointer = (lead - 0x81) * 190 + (bite - offset); // 5. Let code point be null if pointer is null and the index // code point for pointer in index gb18030 otherwise. code_point = pointer === null ? null : indexCodePointFor(pointer, index('gb18030')); // 6. If code point is null and byte is an ASCII byte, prepend // byte to stream. if (code_point === null && isASCIIByte(bite)) stream.prepend(bite); // 7. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 8. Return a code point whose value is code point. return code_point; } // 6. If byte is an ASCII byte, return a code point whose value // is byte. if (isASCIIByte(bite)) return bite; // 7. If byte is 0x80, return code point U+20AC. if (bite === 0x80) return 0x20AC; // 8. If byte is in the range 0x81 to 0xFE, inclusive, set // gb18030 first to byte and return continue. if (inRange(bite, 0x81, 0xFE)) { gb18030_first = bite; return null; } // 9. Return error. return decoderError(fatal); }; } // 11.2.2 gb18030 encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options * @param {boolean=} gbk_flag */ function GB18030Encoder(options, gbk_flag) { var fatal = options.fatal; // gb18030's decoder has an associated gbk flag (initially unset). /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. If code point is U+E5E5, return error with code point. if (code_point === 0xE5E5) return encoderError(code_point); // 4. If the gbk flag is set and code point is U+20AC, return // byte 0x80. if (gbk_flag && code_point === 0x20AC) return 0x80; // 5. Let pointer be the index pointer for code point in index // gb18030. var pointer = indexPointerFor(code_point, index('gb18030')); // 6. If pointer is not null, run these substeps: if (pointer !== null) { // 1. Let lead be floor(pointer / 190) + 0x81. var lead = floor(pointer / 190) + 0x81; // 2. Let trail be pointer % 190. var trail = pointer % 190; // 3. Let offset be 0x40 if trail is less than 0x3F and 0x41 otherwise. var offset = trail < 0x3F ? 0x40 : 0x41; // 4. Return two bytes whose values are lead and trail + offset. return [lead, trail + offset]; } // 7. If gbk flag is set, return error with code point. if (gbk_flag) return encoderError(code_point); // 8. Set pointer to the index gb18030 ranges pointer for code // point. pointer = indexGB18030RangesPointerFor(code_point); // 9. Let byte1 be floor(pointer / 10 / 126 / 10). var byte1 = floor(pointer / 10 / 126 / 10); // 10. Set pointer to pointer − byte1 × 10 × 126 × 10. pointer = pointer - byte1 * 10 * 126 * 10; // 11. Let byte2 be floor(pointer / 10 / 126). var byte2 = floor(pointer / 10 / 126); // 12. Set pointer to pointer − byte2 × 10 × 126. pointer = pointer - byte2 * 10 * 126; // 13. Let byte3 be floor(pointer / 10). var byte3 = floor(pointer / 10); // 14. Let byte4 be pointer − byte3 × 10. var byte4 = pointer - byte3 * 10; // 15. Return four bytes whose values are byte1 + 0x81, byte2 + // 0x30, byte3 + 0x81, byte4 + 0x30. return [byte1 + 0x81, byte2 + 0x30, byte3 + 0x81, byte4 + 0x30]; }; } /** @param {{fatal: boolean}} options */ encoders['gb18030'] = function(options) { return new GB18030Encoder(options); }; /** @param {{fatal: boolean}} options */ decoders['gb18030'] = function(options) { return new GB18030Decoder(options); }; // // 12. Legacy multi-byte Chinese (traditional) encodings // // 12.1 Big5 // 12.1.1 Big5 decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function Big5Decoder(options) { var fatal = options.fatal; // Big5's decoder has an associated Big5 lead (initially 0x00). var /** @type {number} */ Big5_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and Big5 lead is not 0x00, set // Big5 lead to 0x00 and return error. if (bite === end_of_stream && Big5_lead !== 0x00) { Big5_lead = 0x00; return decoderError(fatal); } // 2. If byte is end-of-stream and Big5 lead is 0x00, return // finished. if (bite === end_of_stream && Big5_lead === 0x00) return finished; // 3. If Big5 lead is not 0x00, let lead be Big5 lead, let // pointer be null, set Big5 lead to 0x00, and then run these // substeps: if (Big5_lead !== 0x00) { var lead = Big5_lead; var pointer = null; Big5_lead = 0x00; // 1. Let offset be 0x40 if byte is less than 0x7F and 0x62 // otherwise. var offset = bite < 0x7F ? 0x40 : 0x62; // 2. If byte is in the range 0x40 to 0x7E, inclusive, or 0xA1 // to 0xFE, inclusive, set pointer to (lead − 0x81) × 157 + // (byte − offset). if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0xA1, 0xFE)) pointer = (lead - 0x81) * 157 + (bite - offset); // 3. If there is a row in the table below whose first column // is pointer, return the two code points listed in its second // column // Pointer | Code points // --------+-------------- // 1133 | U+00CA U+0304 // 1135 | U+00CA U+030C // 1164 | U+00EA U+0304 // 1166 | U+00EA U+030C switch (pointer) { case 1133: return [0x00CA, 0x0304]; case 1135: return [0x00CA, 0x030C]; case 1164: return [0x00EA, 0x0304]; case 1166: return [0x00EA, 0x030C]; } // 4. Let code point be null if pointer is null and the index // code point for pointer in index Big5 otherwise. var code_point = (pointer === null) ? null : indexCodePointFor(pointer, index('big5')); // 5. If code point is null and byte is an ASCII byte, prepend // byte to stream. if (code_point === null && isASCIIByte(bite)) stream.prepend(bite); // 6. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 7. Return a code point whose value is code point. return code_point; } // 4. If byte is an ASCII byte, return a code point whose value // is byte. if (isASCIIByte(bite)) return bite; // 5. If byte is in the range 0x81 to 0xFE, inclusive, set Big5 // lead to byte and return continue. if (inRange(bite, 0x81, 0xFE)) { Big5_lead = bite; return null; } // 6. Return error. return decoderError(fatal); }; } // 12.1.2 Big5 encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function Big5Encoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. Let pointer be the index Big5 pointer for code point. var pointer = indexBig5PointerFor(code_point); // 4. If pointer is null, return error with code point. if (pointer === null) return encoderError(code_point); // 5. Let lead be floor(pointer / 157) + 0x81. var lead = floor(pointer / 157) + 0x81; // 6. If lead is less than 0xA1, return error with code point. if (lead < 0xA1) return encoderError(code_point); // 7. Let trail be pointer % 157. var trail = pointer % 157; // 8. Let offset be 0x40 if trail is less than 0x3F and 0x62 // otherwise. var offset = trail < 0x3F ? 0x40 : 0x62; // Return two bytes whose values are lead and trail + offset. return [lead, trail + offset]; }; } /** @param {{fatal: boolean}} options */ encoders['Big5'] = function(options) { return new Big5Encoder(options); }; /** @param {{fatal: boolean}} options */ decoders['Big5'] = function(options) { return new Big5Decoder(options); }; // // 13. Legacy multi-byte Japanese encodings // // 13.1 euc-jp // 13.1.1 euc-jp decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function EUCJPDecoder(options) { var fatal = options.fatal; // euc-jp's decoder has an associated euc-jp jis0212 flag // (initially unset) and euc-jp lead (initially 0x00). var /** @type {boolean} */ eucjp_jis0212_flag = false, /** @type {number} */ eucjp_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and euc-jp lead is not 0x00, set // euc-jp lead to 0x00, and return error. if (bite === end_of_stream && eucjp_lead !== 0x00) { eucjp_lead = 0x00; return decoderError(fatal); } // 2. If byte is end-of-stream and euc-jp lead is 0x00, return // finished. if (bite === end_of_stream && eucjp_lead === 0x00) return finished; // 3. If euc-jp lead is 0x8E and byte is in the range 0xA1 to // 0xDF, inclusive, set euc-jp lead to 0x00 and return a code // point whose value is 0xFF61 − 0xA1 + byte. if (eucjp_lead === 0x8E && inRange(bite, 0xA1, 0xDF)) { eucjp_lead = 0x00; return 0xFF61 - 0xA1 + bite; } // 4. If euc-jp lead is 0x8F and byte is in the range 0xA1 to // 0xFE, inclusive, set the euc-jp jis0212 flag, set euc-jp lead // to byte, and return continue. if (eucjp_lead === 0x8F && inRange(bite, 0xA1, 0xFE)) { eucjp_jis0212_flag = true; eucjp_lead = bite; return null; } // 5. If euc-jp lead is not 0x00, let lead be euc-jp lead, set // euc-jp lead to 0x00, and run these substeps: if (eucjp_lead !== 0x00) { var lead = eucjp_lead; eucjp_lead = 0x00; // 1. Let code point be null. var code_point = null; // 2. If lead and byte are both in the range 0xA1 to 0xFE, // inclusive, set code point to the index code point for (lead // − 0xA1) × 94 + byte − 0xA1 in index jis0208 if the euc-jp // jis0212 flag is unset and in index jis0212 otherwise. if (inRange(lead, 0xA1, 0xFE) && inRange(bite, 0xA1, 0xFE)) { code_point = indexCodePointFor( (lead - 0xA1) * 94 + (bite - 0xA1), index(!eucjp_jis0212_flag ? 'jis0208' : 'jis0212')); } // 3. Unset the euc-jp jis0212 flag. eucjp_jis0212_flag = false; // 4. If byte is not in the range 0xA1 to 0xFE, inclusive, // prepend byte to stream. if (!inRange(bite, 0xA1, 0xFE)) stream.prepend(bite); // 5. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 6. Return a code point whose value is code point. return code_point; } // 6. If byte is an ASCII byte, return a code point whose value // is byte. if (isASCIIByte(bite)) return bite; // 7. If byte is 0x8E, 0x8F, or in the range 0xA1 to 0xFE, // inclusive, set euc-jp lead to byte and return continue. if (bite === 0x8E || bite === 0x8F || inRange(bite, 0xA1, 0xFE)) { eucjp_lead = bite; return null; } // 8. Return error. return decoderError(fatal); }; } // 13.1.2 euc-jp encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function EUCJPEncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. If code point is U+00A5, return byte 0x5C. if (code_point === 0x00A5) return 0x5C; // 4. If code point is U+203E, return byte 0x7E. if (code_point === 0x203E) return 0x7E; // 5. If code point is in the range U+FF61 to U+FF9F, inclusive, // return two bytes whose values are 0x8E and code point − // 0xFF61 + 0xA1. if (inRange(code_point, 0xFF61, 0xFF9F)) return [0x8E, code_point - 0xFF61 + 0xA1]; // 6. If code point is U+2212, set it to U+FF0D. if (code_point === 0x2212) code_point = 0xFF0D; // 7. Let pointer be the index pointer for code point in index // jis0208. var pointer = indexPointerFor(code_point, index('jis0208')); // 8. If pointer is null, return error with code point. if (pointer === null) return encoderError(code_point); // 9. Let lead be floor(pointer / 94) + 0xA1. var lead = floor(pointer / 94) + 0xA1; // 10. Let trail be pointer % 94 + 0xA1. var trail = pointer % 94 + 0xA1; // 11. Return two bytes whose values are lead and trail. return [lead, trail]; }; } /** @param {{fatal: boolean}} options */ encoders['EUC-JP'] = function(options) { return new EUCJPEncoder(options); }; /** @param {{fatal: boolean}} options */ decoders['EUC-JP'] = function(options) { return new EUCJPDecoder(options); }; // 13.2 iso-2022-jp // 13.2.1 iso-2022-jp decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function ISO2022JPDecoder(options) { var fatal = options.fatal; /** @enum */ var states = { ASCII: 0, Roman: 1, Katakana: 2, LeadByte: 3, TrailByte: 4, EscapeStart: 5, Escape: 6 }; // iso-2022-jp's decoder has an associated iso-2022-jp decoder // state (initially ASCII), iso-2022-jp decoder output state // (initially ASCII), iso-2022-jp lead (initially 0x00), and // iso-2022-jp output flag (initially unset). var /** @type {number} */ iso2022jp_decoder_state = states.ASCII, /** @type {number} */ iso2022jp_decoder_output_state = states.ASCII, /** @type {number} */ iso2022jp_lead = 0x00, /** @type {boolean} */ iso2022jp_output_flag = false; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // switching on iso-2022-jp decoder state: switch (iso2022jp_decoder_state) { default: case states.ASCII: // ASCII // Based on byte: // 0x1B if (bite === 0x1B) { // Set iso-2022-jp decoder state to escape start and return // continue. iso2022jp_decoder_state = states.EscapeStart; return null; } // 0x00 to 0x7F, excluding 0x0E, 0x0F, and 0x1B if (inRange(bite, 0x00, 0x7F) && bite !== 0x0E && bite !== 0x0F && bite !== 0x1B) { // Unset the iso-2022-jp output flag and return a code point // whose value is byte. iso2022jp_output_flag = false; return bite; } // end-of-stream if (bite === end_of_stream) { // Return finished. return finished; } // Otherwise // Unset the iso-2022-jp output flag and return error. iso2022jp_output_flag = false; return decoderError(fatal); case states.Roman: // Roman // Based on byte: // 0x1B if (bite === 0x1B) { // Set iso-2022-jp decoder state to escape start and return // continue. iso2022jp_decoder_state = states.EscapeStart; return null; } // 0x5C if (bite === 0x5C) { // Unset the iso-2022-jp output flag and return code point // U+00A5. iso2022jp_output_flag = false; return 0x00A5; } // 0x7E if (bite === 0x7E) { // Unset the iso-2022-jp output flag and return code point // U+203E. iso2022jp_output_flag = false; return 0x203E; } // 0x00 to 0x7F, excluding 0x0E, 0x0F, 0x1B, 0x5C, and 0x7E if (inRange(bite, 0x00, 0x7F) && bite !== 0x0E && bite !== 0x0F && bite !== 0x1B && bite !== 0x5C && bite !== 0x7E) { // Unset the iso-2022-jp output flag and return a code point // whose value is byte. iso2022jp_output_flag = false; return bite; } // end-of-stream if (bite === end_of_stream) { // Return finished. return finished; } // Otherwise // Unset the iso-2022-jp output flag and return error. iso2022jp_output_flag = false; return decoderError(fatal); case states.Katakana: // Katakana // Based on byte: // 0x1B if (bite === 0x1B) { // Set iso-2022-jp decoder state to escape start and return // continue. iso2022jp_decoder_state = states.EscapeStart; return null; } // 0x21 to 0x5F if (inRange(bite, 0x21, 0x5F)) { // Unset the iso-2022-jp output flag and return a code point // whose value is 0xFF61 − 0x21 + byte. iso2022jp_output_flag = false; return 0xFF61 - 0x21 + bite; } // end-of-stream if (bite === end_of_stream) { // Return finished. return finished; } // Otherwise // Unset the iso-2022-jp output flag and return error. iso2022jp_output_flag = false; return decoderError(fatal); case states.LeadByte: // Lead byte // Based on byte: // 0x1B if (bite === 0x1B) { // Set iso-2022-jp decoder state to escape start and return // continue. iso2022jp_decoder_state = states.EscapeStart; return null; } // 0x21 to 0x7E if (inRange(bite, 0x21, 0x7E)) { // Unset the iso-2022-jp output flag, set iso-2022-jp lead // to byte, iso-2022-jp decoder state to trail byte, and // return continue. iso2022jp_output_flag = false; iso2022jp_lead = bite; iso2022jp_decoder_state = states.TrailByte; return null; } // end-of-stream if (bite === end_of_stream) { // Return finished. return finished; } // Otherwise // Unset the iso-2022-jp output flag and return error. iso2022jp_output_flag = false; return decoderError(fatal); case states.TrailByte: // Trail byte // Based on byte: // 0x1B if (bite === 0x1B) { // Set iso-2022-jp decoder state to escape start and return // continue. iso2022jp_decoder_state = states.EscapeStart; return decoderError(fatal); } // 0x21 to 0x7E if (inRange(bite, 0x21, 0x7E)) { // 1. Set the iso-2022-jp decoder state to lead byte. iso2022jp_decoder_state = states.LeadByte; // 2. Let pointer be (iso-2022-jp lead − 0x21) × 94 + byte − 0x21. var pointer = (iso2022jp_lead - 0x21) * 94 + bite - 0x21; // 3. Let code point be the index code point for pointer in // index jis0208. var code_point = indexCodePointFor(pointer, index('jis0208')); // 4. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 5. Return a code point whose value is code point. return code_point; } // end-of-stream if (bite === end_of_stream) { // Set the iso-2022-jp decoder state to lead byte, prepend // byte to stream, and return error. iso2022jp_decoder_state = states.LeadByte; stream.prepend(bite); return decoderError(fatal); } // Otherwise // Set iso-2022-jp decoder state to lead byte and return // error. iso2022jp_decoder_state = states.LeadByte; return decoderError(fatal); case states.EscapeStart: // Escape start // 1. If byte is either 0x24 or 0x28, set iso-2022-jp lead to // byte, iso-2022-jp decoder state to escape, and return // continue. if (bite === 0x24 || bite === 0x28) { iso2022jp_lead = bite; iso2022jp_decoder_state = states.Escape; return null; } // 2. Prepend byte to stream. stream.prepend(bite); // 3. Unset the iso-2022-jp output flag, set iso-2022-jp // decoder state to iso-2022-jp decoder output state, and // return error. iso2022jp_output_flag = false; iso2022jp_decoder_state = iso2022jp_decoder_output_state; return decoderError(fatal); case states.Escape: // Escape // 1. Let lead be iso-2022-jp lead and set iso-2022-jp lead to // 0x00. var lead = iso2022jp_lead; iso2022jp_lead = 0x00; // 2. Let state be null. var state = null; // 3. If lead is 0x28 and byte is 0x42, set state to ASCII. if (lead === 0x28 && bite === 0x42) state = states.ASCII; // 4. If lead is 0x28 and byte is 0x4A, set state to Roman. if (lead === 0x28 && bite === 0x4A) state = states.Roman; // 5. If lead is 0x28 and byte is 0x49, set state to Katakana. if (lead === 0x28 && bite === 0x49) state = states.Katakana; // 6. If lead is 0x24 and byte is either 0x40 or 0x42, set // state to lead byte. if (lead === 0x24 && (bite === 0x40 || bite === 0x42)) state = states.LeadByte; // 7. If state is non-null, run these substeps: if (state !== null) { // 1. Set iso-2022-jp decoder state and iso-2022-jp decoder // output state to states. iso2022jp_decoder_state = iso2022jp_decoder_state = state; // 2. Let output flag be the iso-2022-jp output flag. var output_flag = iso2022jp_output_flag; // 3. Set the iso-2022-jp output flag. iso2022jp_output_flag = true; // 4. Return continue, if output flag is unset, and error // otherwise. return !output_flag ? null : decoderError(fatal); } // 8. Prepend lead and byte to stream. stream.prepend([lead, bite]); // 9. Unset the iso-2022-jp output flag, set iso-2022-jp // decoder state to iso-2022-jp decoder output state and // return error. iso2022jp_output_flag = false; iso2022jp_decoder_state = iso2022jp_decoder_output_state; return decoderError(fatal); } }; } // 13.2.2 iso-2022-jp encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function ISO2022JPEncoder(options) { var fatal = options.fatal; // iso-2022-jp's encoder has an associated iso-2022-jp encoder // state which is one of ASCII, Roman, and jis0208 (initially // ASCII). /** @enum */ var states = { ASCII: 0, Roman: 1, jis0208: 2 }; var /** @type {number} */ iso2022jp_state = states.ASCII; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream and iso-2022-jp encoder // state is not ASCII, prepend code point to stream, set // iso-2022-jp encoder state to ASCII, and return three bytes // 0x1B 0x28 0x42. if (code_point === end_of_stream && iso2022jp_state !== states.ASCII) { stream.prepend(code_point); iso2022jp_state = states.ASCII; return [0x1B, 0x28, 0x42]; } // 2. If code point is end-of-stream and iso-2022-jp encoder // state is ASCII, return finished. if (code_point === end_of_stream && iso2022jp_state === states.ASCII) return finished; // 3. If ISO-2022-JP encoder state is ASCII or Roman, and code // point is U+000E, U+000F, or U+001B, return error with U+FFFD. if ((iso2022jp_state === states.ASCII || iso2022jp_state === states.Roman) && (code_point === 0x000E || code_point === 0x000F || code_point === 0x001B)) { return encoderError(0xFFFD); } // 4. If iso-2022-jp encoder state is ASCII and code point is an // ASCII code point, return a byte whose value is code point. if (iso2022jp_state === states.ASCII && isASCIICodePoint(code_point)) return code_point; // 5. If iso-2022-jp encoder state is Roman and code point is an // ASCII code point, excluding U+005C and U+007E, or is U+00A5 // or U+203E, run these substeps: if (iso2022jp_state === states.Roman && ((isASCIICodePoint(code_point) && code_point !== 0x005C && code_point !== 0x007E) || (code_point == 0x00A5 || code_point == 0x203E))) { // 1. If code point is an ASCII code point, return a byte // whose value is code point. if (isASCIICodePoint(code_point)) return code_point; // 2. If code point is U+00A5, return byte 0x5C. if (code_point === 0x00A5) return 0x5C; // 3. If code point is U+203E, return byte 0x7E. if (code_point === 0x203E) return 0x7E; } // 6. If code point is an ASCII code point, and iso-2022-jp // encoder state is not ASCII, prepend code point to stream, set // iso-2022-jp encoder state to ASCII, and return three bytes // 0x1B 0x28 0x42. if (isASCIICodePoint(code_point) && iso2022jp_state !== states.ASCII) { stream.prepend(code_point); iso2022jp_state = states.ASCII; return [0x1B, 0x28, 0x42]; } // 7. If code point is either U+00A5 or U+203E, and iso-2022-jp // encoder state is not Roman, prepend code point to stream, set // iso-2022-jp encoder state to Roman, and return three bytes // 0x1B 0x28 0x4A. if ((code_point === 0x00A5 || code_point === 0x203E) && iso2022jp_state !== states.Roman) { stream.prepend(code_point); iso2022jp_state = states.Roman; return [0x1B, 0x28, 0x4A]; } // 8. If code point is U+2212, set it to U+FF0D. if (code_point === 0x2212) code_point = 0xFF0D; // 9. Let pointer be the index pointer for code point in index // jis0208. var pointer = indexPointerFor(code_point, index('jis0208')); // 10. If pointer is null, return error with code point. if (pointer === null) return encoderError(code_point); // 11. If iso-2022-jp encoder state is not jis0208, prepend code // point to stream, set iso-2022-jp encoder state to jis0208, // and return three bytes 0x1B 0x24 0x42. if (iso2022jp_state !== states.jis0208) { stream.prepend(code_point); iso2022jp_state = states.jis0208; return [0x1B, 0x24, 0x42]; } // 12. Let lead be floor(pointer / 94) + 0x21. var lead = floor(pointer / 94) + 0x21; // 13. Let trail be pointer % 94 + 0x21. var trail = pointer % 94 + 0x21; // 14. Return two bytes whose values are lead and trail. return [lead, trail]; }; } /** @param {{fatal: boolean}} options */ encoders['ISO-2022-JP'] = function(options) { return new ISO2022JPEncoder(options); }; /** @param {{fatal: boolean}} options */ decoders['ISO-2022-JP'] = function(options) { return new ISO2022JPDecoder(options); }; // 13.3 Shift_JIS // 13.3.1 Shift_JIS decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function ShiftJISDecoder(options) { var fatal = options.fatal; // Shift_JIS's decoder has an associated Shift_JIS lead (initially // 0x00). var /** @type {number} */ Shift_JIS_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and Shift_JIS lead is not 0x00, // set Shift_JIS lead to 0x00 and return error. if (bite === end_of_stream && Shift_JIS_lead !== 0x00) { Shift_JIS_lead = 0x00; return decoderError(fatal); } // 2. If byte is end-of-stream and Shift_JIS lead is 0x00, // return finished. if (bite === end_of_stream && Shift_JIS_lead === 0x00) return finished; // 3. If Shift_JIS lead is not 0x00, let lead be Shift_JIS lead, // let pointer be null, set Shift_JIS lead to 0x00, and then run // these substeps: if (Shift_JIS_lead !== 0x00) { var lead = Shift_JIS_lead; var pointer = null; Shift_JIS_lead = 0x00; // 1. Let offset be 0x40, if byte is less than 0x7F, and 0x41 // otherwise. var offset = (bite < 0x7F) ? 0x40 : 0x41; // 2. Let lead offset be 0x81, if lead is less than 0xA0, and // 0xC1 otherwise. var lead_offset = (lead < 0xA0) ? 0x81 : 0xC1; // 3. If byte is in the range 0x40 to 0x7E, inclusive, or 0x80 // to 0xFC, inclusive, set pointer to (lead − lead offset) × // 188 + byte − offset. if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0x80, 0xFC)) pointer = (lead - lead_offset) * 188 + bite - offset; // 4. If pointer is in the range 8836 to 10715, inclusive, // return a code point whose value is 0xE000 − 8836 + pointer. if (inRange(pointer, 8836, 10715)) return 0xE000 - 8836 + pointer; // 5. Let code point be null, if pointer is null, and the // index code point for pointer in index jis0208 otherwise. var code_point = (pointer === null) ? null : indexCodePointFor(pointer, index('jis0208')); // 6. If code point is null and byte is an ASCII byte, prepend // byte to stream. if (code_point === null && isASCIIByte(bite)) stream.prepend(bite); // 7. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 8. Return a code point whose value is code point. return code_point; } // 4. If byte is an ASCII byte or 0x80, return a code point // whose value is byte. if (isASCIIByte(bite) || bite === 0x80) return bite; // 5. If byte is in the range 0xA1 to 0xDF, inclusive, return a // code point whose value is 0xFF61 − 0xA1 + byte. if (inRange(bite, 0xA1, 0xDF)) return 0xFF61 - 0xA1 + bite; // 6. If byte is in the range 0x81 to 0x9F, inclusive, or 0xE0 // to 0xFC, inclusive, set Shift_JIS lead to byte and return // continue. if (inRange(bite, 0x81, 0x9F) || inRange(bite, 0xE0, 0xFC)) { Shift_JIS_lead = bite; return null; } // 7. Return error. return decoderError(fatal); }; } // 13.3.2 Shift_JIS encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function ShiftJISEncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point or U+0080, return a // byte whose value is code point. if (isASCIICodePoint(code_point) || code_point === 0x0080) return code_point; // 3. If code point is U+00A5, return byte 0x5C. if (code_point === 0x00A5) return 0x5C; // 4. If code point is U+203E, return byte 0x7E. if (code_point === 0x203E) return 0x7E; // 5. If code point is in the range U+FF61 to U+FF9F, inclusive, // return a byte whose value is code point − 0xFF61 + 0xA1. if (inRange(code_point, 0xFF61, 0xFF9F)) return code_point - 0xFF61 + 0xA1; // 6. If code point is U+2212, set it to U+FF0D. if (code_point === 0x2212) code_point = 0xFF0D; // 7. Let pointer be the index Shift_JIS pointer for code point. var pointer = indexShiftJISPointerFor(code_point); // 8. If pointer is null, return error with code point. if (pointer === null) return encoderError(code_point); // 9. Let lead be floor(pointer / 188). var lead = floor(pointer / 188); // 10. Let lead offset be 0x81, if lead is less than 0x1F, and // 0xC1 otherwise. var lead_offset = (lead < 0x1F) ? 0x81 : 0xC1; // 11. Let trail be pointer % 188. var trail = pointer % 188; // 12. Let offset be 0x40, if trail is less than 0x3F, and 0x41 // otherwise. var offset = (trail < 0x3F) ? 0x40 : 0x41; // 13. Return two bytes whose values are lead + lead offset and // trail + offset. return [lead + lead_offset, trail + offset]; }; } /** @param {{fatal: boolean}} options */ encoders['Shift_JIS'] = function(options) { return new ShiftJISEncoder(options); }; /** @param {{fatal: boolean}} options */ decoders['Shift_JIS'] = function(options) { return new ShiftJISDecoder(options); }; // // 14. Legacy multi-byte Korean encodings // // 14.1 euc-kr // 14.1.1 euc-kr decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function EUCKRDecoder(options) { var fatal = options.fatal; // euc-kr's decoder has an associated euc-kr lead (initially 0x00). var /** @type {number} */ euckr_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and euc-kr lead is not 0x00, set // euc-kr lead to 0x00 and return error. if (bite === end_of_stream && euckr_lead !== 0) { euckr_lead = 0x00; return decoderError(fatal); } // 2. If byte is end-of-stream and euc-kr lead is 0x00, return // finished. if (bite === end_of_stream && euckr_lead === 0) return finished; // 3. If euc-kr lead is not 0x00, let lead be euc-kr lead, let // pointer be null, set euc-kr lead to 0x00, and then run these // substeps: if (euckr_lead !== 0x00) { var lead = euckr_lead; var pointer = null; euckr_lead = 0x00; // 1. If byte is in the range 0x41 to 0xFE, inclusive, set // pointer to (lead − 0x81) × 190 + (byte − 0x41). if (inRange(bite, 0x41, 0xFE)) pointer = (lead - 0x81) * 190 + (bite - 0x41); // 2. Let code point be null, if pointer is null, and the // index code point for pointer in index euc-kr otherwise. var code_point = (pointer === null) ? null : indexCodePointFor(pointer, index('euc-kr')); // 3. If code point is null and byte is an ASCII byte, prepend // byte to stream. if (pointer === null && isASCIIByte(bite)) stream.prepend(bite); // 4. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 5. Return a code point whose value is code point. return code_point; } // 4. If byte is an ASCII byte, return a code point whose value // is byte. if (isASCIIByte(bite)) return bite; // 5. If byte is in the range 0x81 to 0xFE, inclusive, set // euc-kr lead to byte and return continue. if (inRange(bite, 0x81, 0xFE)) { euckr_lead = bite; return null; } // 6. Return error. return decoderError(fatal); }; } // 14.1.2 euc-kr encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function EUCKREncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. Let pointer be the index pointer for code point in index // euc-kr. var pointer = indexPointerFor(code_point, index('euc-kr')); // 4. If pointer is null, return error with code point. if (pointer === null) return encoderError(code_point); // 5. Let lead be floor(pointer / 190) + 0x81. var lead = floor(pointer / 190) + 0x81; // 6. Let trail be pointer % 190 + 0x41. var trail = (pointer % 190) + 0x41; // 7. Return two bytes whose values are lead and trail. return [lead, trail]; }; } /** @param {{fatal: boolean}} options */ encoders['EUC-KR'] = function(options) { return new EUCKREncoder(options); }; /** @param {{fatal: boolean}} options */ decoders['EUC-KR'] = function(options) { return new EUCKRDecoder(options); }; // // 15. Legacy miscellaneous encodings // // 15.1 replacement // Not needed - API throws RangeError // 15.2 Common infrastructure for utf-16be and utf-16le /** * @param {number} code_unit * @param {boolean} utf16be * @return {!Array.} bytes */ function convertCodeUnitToBytes(code_unit, utf16be) { // 1. Let byte1 be code unit >> 8. var byte1 = code_unit >> 8; // 2. Let byte2 be code unit & 0x00FF. var byte2 = code_unit & 0x00FF; // 3. Then return the bytes in order: // utf-16be flag is set: byte1, then byte2. if (utf16be) return [byte1, byte2]; // utf-16be flag is unset: byte2, then byte1. return [byte2, byte1]; } // 15.2.1 shared utf-16 decoder /** * @constructor * @implements {Decoder} * @param {boolean} utf16_be True if big-endian, false if little-endian. * @param {{fatal: boolean}} options */ function UTF16Decoder(utf16_be, options) { var fatal = options.fatal; var /** @type {?number} */ utf16_lead_byte = null, /** @type {?number} */ utf16_lead_surrogate = null; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and either utf-16 lead byte or // utf-16 lead surrogate is not null, set utf-16 lead byte and // utf-16 lead surrogate to null, and return error. if (bite === end_of_stream && (utf16_lead_byte !== null || utf16_lead_surrogate !== null)) { return decoderError(fatal); } // 2. If byte is end-of-stream and utf-16 lead byte and utf-16 // lead surrogate are null, return finished. if (bite === end_of_stream && utf16_lead_byte === null && utf16_lead_surrogate === null) { return finished; } // 3. If utf-16 lead byte is null, set utf-16 lead byte to byte // and return continue. if (utf16_lead_byte === null) { utf16_lead_byte = bite; return null; } // 4. Let code unit be the result of: var code_unit; if (utf16_be) { // utf-16be decoder flag is set // (utf-16 lead byte << 8) + byte. code_unit = (utf16_lead_byte << 8) + bite; } else { // utf-16be decoder flag is unset // (byte << 8) + utf-16 lead byte. code_unit = (bite << 8) + utf16_lead_byte; } // Then set utf-16 lead byte to null. utf16_lead_byte = null; // 5. If utf-16 lead surrogate is not null, let lead surrogate // be utf-16 lead surrogate, set utf-16 lead surrogate to null, // and then run these substeps: if (utf16_lead_surrogate !== null) { var lead_surrogate = utf16_lead_surrogate; utf16_lead_surrogate = null; // 1. If code unit is in the range U+DC00 to U+DFFF, // inclusive, return a code point whose value is 0x10000 + // ((lead surrogate − 0xD800) << 10) + (code unit − 0xDC00). if (inRange(code_unit, 0xDC00, 0xDFFF)) { return 0x10000 + (lead_surrogate - 0xD800) * 0x400 + (code_unit - 0xDC00); } // 2. Prepend the sequence resulting of converting code unit // to bytes using utf-16be decoder flag to stream and return // error. stream.prepend(convertCodeUnitToBytes(code_unit, utf16_be)); return decoderError(fatal); } // 6. If code unit is in the range U+D800 to U+DBFF, inclusive, // set utf-16 lead surrogate to code unit and return continue. if (inRange(code_unit, 0xD800, 0xDBFF)) { utf16_lead_surrogate = code_unit; return null; } // 7. If code unit is in the range U+DC00 to U+DFFF, inclusive, // return error. if (inRange(code_unit, 0xDC00, 0xDFFF)) return decoderError(fatal); // 8. Return code point code unit. return code_unit; }; } // 15.2.2 shared utf-16 encoder /** * @constructor * @implements {Encoder} * @param {boolean} utf16_be True if big-endian, false if little-endian. * @param {{fatal: boolean}} options */ function UTF16Encoder(utf16_be, options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is in the range U+0000 to U+FFFF, inclusive, // return the sequence resulting of converting code point to // bytes using utf-16be encoder flag. if (inRange(code_point, 0x0000, 0xFFFF)) return convertCodeUnitToBytes(code_point, utf16_be); // 3. Let lead be ((code point − 0x10000) >> 10) + 0xD800, // converted to bytes using utf-16be encoder flag. var lead = convertCodeUnitToBytes( ((code_point - 0x10000) >> 10) + 0xD800, utf16_be); // 4. Let trail be ((code point − 0x10000) & 0x3FF) + 0xDC00, // converted to bytes using utf-16be encoder flag. var trail = convertCodeUnitToBytes( ((code_point - 0x10000) & 0x3FF) + 0xDC00, utf16_be); // 5. Return a byte sequence of lead followed by trail. return lead.concat(trail); }; } // 15.3 utf-16be // 15.3.1 utf-16be decoder /** @param {{fatal: boolean}} options */ encoders['UTF-16BE'] = function(options) { return new UTF16Encoder(true, options); }; // 15.3.2 utf-16be encoder /** @param {{fatal: boolean}} options */ decoders['UTF-16BE'] = function(options) { return new UTF16Decoder(true, options); }; // 15.4 utf-16le // 15.4.1 utf-16le decoder /** @param {{fatal: boolean}} options */ encoders['UTF-16LE'] = function(options) { return new UTF16Encoder(false, options); }; // 15.4.2 utf-16le encoder /** @param {{fatal: boolean}} options */ decoders['UTF-16LE'] = function(options) { return new UTF16Decoder(false, options); }; // 15.5 x-user-defined // 15.5.1 x-user-defined decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function XUserDefinedDecoder(options) { var fatal = options.fatal; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream, return finished. if (bite === end_of_stream) return finished; // 2. If byte is an ASCII byte, return a code point whose value // is byte. if (isASCIIByte(bite)) return bite; // 3. Return a code point whose value is 0xF780 + byte − 0x80. return 0xF780 + bite - 0x80; }; } // 15.5.2 x-user-defined encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function XUserDefinedEncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1.If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. If code point is in the range U+F780 to U+F7FF, inclusive, // return a byte whose value is code point − 0xF780 + 0x80. if (inRange(code_point, 0xF780, 0xF7FF)) return code_point - 0xF780 + 0x80; // 4. Return error with code point. return encoderError(code_point); }; } /** @param {{fatal: boolean}} options */ encoders['x-user-defined'] = function(options) { return new XUserDefinedEncoder(options); }; /** @param {{fatal: boolean}} options */ decoders['x-user-defined'] = function(options) { return new XUserDefinedDecoder(options); }; if (!global['TextEncoder']) global['TextEncoder'] = TextEncoder; if (!global['TextDecoder']) global['TextDecoder'] = TextDecoder; if (typeof module !== "undefined" && module.exports) { module.exports = { TextEncoder: global['TextEncoder'], TextDecoder: global['TextDecoder'], EncodingIndexes: global["encoding-indexes"] }; } // For strict environments where `this` inside the global scope // is `undefined`, take a pure object instead }(this || {})); },{"./encoding-indexes.js":56}],58:[function(require,module,exports){ (function (global){ 'use strict'; /* ! * type-detect * Copyright(c) 2013 jake luer * MIT Licensed */ var promiseExists = typeof Promise === 'function'; var globalObject = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : self; // eslint-disable-line var isDom = 'location' in globalObject && 'document' in globalObject; var symbolExists = typeof Symbol !== 'undefined'; var mapExists = typeof Map !== 'undefined'; var setExists = typeof Set !== 'undefined'; var weakMapExists = typeof WeakMap !== 'undefined'; var weakSetExists = typeof WeakSet !== 'undefined'; var dataViewExists = typeof DataView !== 'undefined'; var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined'; var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined'; var setEntriesExists = setExists && typeof Set.prototype.entries === 'function'; var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function'; var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries()); var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries()); var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function'; var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]()); var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function'; var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]()); var toStringLeftSliceLength = 8; var toStringRightSliceLength = -1; /** * ### typeOf (obj) * * Uses `Object.prototype.toString` to determine the type of an object, * normalising behaviour across engine versions & well optimised. * * @param {Mixed} object * @return {String} object type * @api public */ module.exports = function typeDetect(obj) { /* ! Speed optimisation * Pre: * string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled) * boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled) * number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled) * undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled) * function x 2,556,769 ops/sec ±1.73% (77 runs sampled) * Post: * string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled) * boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled) * number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled) * undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled) * function x 31,296,870 ops/sec ±0.96% (83 runs sampled) */ var typeofObj = typeof obj; if (typeofObj !== 'object') { return typeofObj; } /* ! Speed optimisation * Pre: * null x 28,645,765 ops/sec ±1.17% (82 runs sampled) * Post: * null x 36,428,962 ops/sec ±1.37% (84 runs sampled) */ if (obj === null) { return 'null'; } /* ! Spec Conformance * Test: `Object.prototype.toString.call(window)`` * - Node === "[object global]" * - Chrome === "[object global]" * - Firefox === "[object Window]" * - PhantomJS === "[object Window]" * - Safari === "[object Window]" * - IE 11 === "[object Window]" * - IE Edge === "[object Window]" * Test: `Object.prototype.toString.call(this)`` * - Chrome Worker === "[object global]" * - Firefox Worker === "[object DedicatedWorkerGlobalScope]" * - Safari Worker === "[object DedicatedWorkerGlobalScope]" * - IE 11 Worker === "[object WorkerGlobalScope]" * - IE Edge Worker === "[object WorkerGlobalScope]" */ if (obj === globalObject) { return 'global'; } /* ! Speed optimisation * Pre: * array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled) * Post: * array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled) */ if ( Array.isArray(obj) && (symbolToStringTagExists === false || !(Symbol.toStringTag in obj)) ) { return 'Array'; } if (isDom) { /* ! Spec Conformance * (https://html.spec.whatwg.org/multipage/browsers.html#location) * WhatWG HTML$7.7.3 - The `Location` interface * Test: `Object.prototype.toString.call(window.location)`` * - IE <=11 === "[object Object]" * - IE Edge <=13 === "[object Object]" */ if (obj === globalObject.location) { return 'Location'; } /* ! Spec Conformance * (https://html.spec.whatwg.org/#document) * WhatWG HTML$3.1.1 - The `Document` object * Note: Most browsers currently adher to the W3C DOM Level 2 spec * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268) * which suggests that browsers should use HTMLTableCellElement for * both TD and TH elements. WhatWG separates these. * WhatWG HTML states: * > For historical reasons, Window objects must also have a * > writable, configurable, non-enumerable property named * > HTMLDocument whose value is the Document interface object. * Test: `Object.prototype.toString.call(document)`` * - Chrome === "[object HTMLDocument]" * - Firefox === "[object HTMLDocument]" * - Safari === "[object HTMLDocument]" * - IE <=10 === "[object Document]" * - IE 11 === "[object HTMLDocument]" * - IE Edge <=13 === "[object HTMLDocument]" */ if (obj === globalObject.document) { return 'Document'; } /* ! Spec Conformance * (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray) * WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray * Test: `Object.prototype.toString.call(navigator.mimeTypes)`` * - IE <=10 === "[object MSMimeTypesCollection]" */ if (obj === (globalObject.navigator || {}).mimeTypes) { return 'MimeTypeArray'; } /* ! Spec Conformance * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) * WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray * Test: `Object.prototype.toString.call(navigator.plugins)`` * - IE <=10 === "[object MSPluginsCollection]" */ if (obj === (globalObject.navigator || {}).plugins) { return 'PluginArray'; } /* ! Spec Conformance * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) * WhatWG HTML$4.4.4 - The `blockquote` element - Interface `HTMLQuoteElement` * Test: `Object.prototype.toString.call(document.createElement('blockquote'))`` * - IE <=10 === "[object HTMLBlockElement]" */ if (obj instanceof HTMLElement && obj.tagName === 'BLOCKQUOTE') { return 'HTMLQuoteElement'; } /* ! Spec Conformance * (https://html.spec.whatwg.org/#htmltabledatacellelement) * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableDataCellElement` * Note: Most browsers currently adher to the W3C DOM Level 2 spec * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) * which suggests that browsers should use HTMLTableCellElement for * both TD and TH elements. WhatWG separates these. * Test: Object.prototype.toString.call(document.createElement('td')) * - Chrome === "[object HTMLTableCellElement]" * - Firefox === "[object HTMLTableCellElement]" * - Safari === "[object HTMLTableCellElement]" */ if (obj instanceof HTMLElement && obj.tagName === 'TD') { return 'HTMLTableDataCellElement'; } /* ! Spec Conformance * (https://html.spec.whatwg.org/#htmltableheadercellelement) * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableHeaderCellElement` * Note: Most browsers currently adher to the W3C DOM Level 2 spec * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) * which suggests that browsers should use HTMLTableCellElement for * both TD and TH elements. WhatWG separates these. * Test: Object.prototype.toString.call(document.createElement('th')) * - Chrome === "[object HTMLTableCellElement]" * - Firefox === "[object HTMLTableCellElement]" * - Safari === "[object HTMLTableCellElement]" */ if (obj instanceof HTMLElement && obj.tagName === 'TH') { return 'HTMLTableHeaderCellElement'; } } /* ! Speed optimisation * Pre: * Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled) * Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled) * Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled) * Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled) * Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled) * Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled) * Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled) * Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled) * Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled) * Post: * Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled) * Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled) * Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled) * Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled) * Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled) * Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled) * Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled) * Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled) * Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled) */ var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]); if (typeof stringTag === 'string') { return stringTag; } var objPrototype = Object.getPrototypeOf(obj); /* ! Speed optimisation * Pre: * regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled) * regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled) * Post: * regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled) * regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled) */ if (objPrototype === RegExp.prototype) { return 'RegExp'; } /* ! Speed optimisation * Pre: * date x 2,130,074 ops/sec ±4.42% (68 runs sampled) * Post: * date x 3,953,779 ops/sec ±1.35% (77 runs sampled) */ if (objPrototype === Date.prototype) { return 'Date'; } /* ! Spec Conformance * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag) * ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise": * Test: `Object.prototype.toString.call(Promise.resolve())`` * - Chrome <=47 === "[object Object]" * - Edge <=20 === "[object Object]" * - Firefox 29-Latest === "[object Promise]" * - Safari 7.1-Latest === "[object Promise]" */ if (promiseExists && objPrototype === Promise.prototype) { return 'Promise'; } /* ! Speed optimisation * Pre: * set x 2,222,186 ops/sec ±1.31% (82 runs sampled) * Post: * set x 4,545,879 ops/sec ±1.13% (83 runs sampled) */ if (setExists && objPrototype === Set.prototype) { return 'Set'; } /* ! Speed optimisation * Pre: * map x 2,396,842 ops/sec ±1.59% (81 runs sampled) * Post: * map x 4,183,945 ops/sec ±6.59% (82 runs sampled) */ if (mapExists && objPrototype === Map.prototype) { return 'Map'; } /* ! Speed optimisation * Pre: * weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled) * Post: * weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled) */ if (weakSetExists && objPrototype === WeakSet.prototype) { return 'WeakSet'; } /* ! Speed optimisation * Pre: * weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled) * Post: * weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled) */ if (weakMapExists && objPrototype === WeakMap.prototype) { return 'WeakMap'; } /* ! Spec Conformance * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag) * ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView": * Test: `Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))`` * - Edge <=13 === "[object Object]" */ if (dataViewExists && objPrototype === DataView.prototype) { return 'DataView'; } /* ! Spec Conformance * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag) * ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator": * Test: `Object.prototype.toString.call(new Map().entries())`` * - Edge <=13 === "[object Object]" */ if (mapExists && objPrototype === mapIteratorPrototype) { return 'Map Iterator'; } /* ! Spec Conformance * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag) * ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator": * Test: `Object.prototype.toString.call(new Set().entries())`` * - Edge <=13 === "[object Object]" */ if (setExists && objPrototype === setIteratorPrototype) { return 'Set Iterator'; } /* ! Spec Conformance * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag) * ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator": * Test: `Object.prototype.toString.call([][Symbol.iterator]())`` * - Edge <=13 === "[object Object]" */ if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) { return 'Array Iterator'; } /* ! Spec Conformance * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag) * ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator": * Test: `Object.prototype.toString.call(''[Symbol.iterator]())`` * - Edge <=13 === "[object Object]" */ if (stringIteratorExists && objPrototype === stringIteratorPrototype) { return 'String Iterator'; } /* ! Speed optimisation * Pre: * object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled) * Post: * object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled) */ if (objPrototype === null) { return 'Object'; } return Object .prototype .toString .call(obj) .slice(toStringLeftSliceLength, toStringRightSliceLength); }; module.exports.typeDetect = module.exports; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}]},{},[1])(1) }); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJsaWIvc2lub24uanMiLCJsaWIvc2lub24vYXNzZXJ0LmpzIiwibGliL3Npbm9uL2JlaGF2aW9yLmpzIiwibGliL3Npbm9uL2Jsb2IuanMiLCJsaWIvc2lub24vY2FsbC5qcyIsImxpYi9zaW5vbi9jb2xsZWN0LW93bi1tZXRob2RzLmpzIiwibGliL3Npbm9uL2NvbGxlY3Rpb24uanMiLCJsaWIvc2lub24vY29sb3IuanMiLCJsaWIvc2lub24vZGVmYXVsdC1iZWhhdmlvcnMuanMiLCJsaWIvc2lub24vbWF0Y2guanMiLCJsaWIvc2lub24vbW9jay1leHBlY3RhdGlvbi5qcyIsImxpYi9zaW5vbi9tb2NrLmpzIiwibGliL3Npbm9uL3NhbmRib3gtc3R1Yi5qcyIsImxpYi9zaW5vbi9zYW5kYm94LmpzIiwibGliL3Npbm9uL3NweS1mb3JtYXR0ZXJzLmpzIiwibGliL3Npbm9uL3NweS5qcyIsImxpYi9zaW5vbi9zdHViLWRlc2NyaXB0b3IuanMiLCJsaWIvc2lub24vc3R1Yi1lbnRpcmUtb2JqZWN0LmpzIiwibGliL3Npbm9uL3N0dWItbm9uLWZ1bmN0aW9uLXByb3BlcnR5LmpzIiwibGliL3Npbm9uL3N0dWIuanMiLCJsaWIvc2lub24vdGhyb3ctb24tZmFsc3ktb2JqZWN0LmpzIiwibGliL3Npbm9uL3V0aWwvY29yZS9jYWxsZWQtaW4tb3JkZXIuanMiLCJsaWIvc2lub24vdXRpbC9jb3JlL2RlZXAtZXF1YWwuanMiLCJsaWIvc2lub24vdXRpbC9jb3JlL2RlZmF1bHQtY29uZmlnLmpzIiwibGliL3Npbm9uL3V0aWwvY29yZS9kZXByZWNhdGVkLmpzIiwibGliL3Npbm9uL3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1xuICAgICAgICAgICAgICAgIGV4cGVjdGVkID0gW10uam9pbi5jYWxsKGFyZ3VtZW50cywgXCIsIFwiKTtcbiAgICAgICAgICAgICAgICB2YXIgY2FsbHMgPSBzbGljZS5jYWxsKGFyZ3VtZW50cyk7XG4gICAgICAgICAgICAgICAgdmFyIGkgPSBjYWxscy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgd2hpbGUgKGkpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFjYWxsc1stLWldLmNhbGxlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FsbHMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFjdHVhbCA9IG9yZGVyQnlGaXJzdENhbGwoY2FsbHMpLmpvaW4oXCIsIFwiKTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAvLyBJZiB0aGlzIGZhaWxzLCB3ZSdsbCBqdXN0IGZhbGwgYmFjayB0byB0aGUgYmxhbmsgc3RyaW5nXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZhaWxBc3NlcnRpb24odGhpcywgXCJleHBlY3RlZCBcIiArIGV4cGVjdGVkICsgXCIgdG8gYmUgXCIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgXCJjYWxsZWQgaW4gb3JkZXIgYnV0IHdlcmUgY2FsbGVkIGFzIFwiICsgYWN0dWFsKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGFzc2VydC5wYXNzKFwiY2FsbE9yZGVyXCIpO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIGNhbGxDb3VudDogZnVuY3Rpb24gYXNzZXJ0Q2FsbENvdW50KG1ldGhvZCwgY291bnQpIHtcbiAgICAgICAgdmVyaWZ5SXNTdHViKG1ldGhvZCk7XG5cbiAgICAgICAgaWYgKG1ldGhvZC5jYWxsQ291bnQgIT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FxuXG4gICAgaXNQcmVzZW50OiBmdW5jdGlvbiBpc1ByZXNlbnQoKSB7XG4gICAgICAgIHJldHVybiAodHlwZW9mIHRoaXMuY2FsbEFyZ0F0ID09PSBcIm51bWJlclwiIHx8XG4gICAgICAgICAgICAgICAgdGhpcy5leGNlcHRpb24gfHxcbiAgICAgICAgICAgICAgICB0eXBlb2YgdGhpcy5yZXR1cm5BcmdBdCA9PT0gXCJudW1iZXJcIiB8fFxuICAgICAgICAgICAgICAgIHRoaXMucmV0dXJuVGhpcyB8fFxuICAgICAgICAgICAgICAgIHR5cGVvZiB0aGlzLnRocm93QXJnQXQgPT09IFwibnVtYmVyXCIgfHxcbiAgICAgICAgICAgICAgICB0aGlzLmZha2VGbiB8fFxuICAgICAgICAgICAgICAgIHRoaXMucmV0dXJuVmFsdWVEZWZpbmVkKTtcbiAgICB9LFxuXG4gICAgaW52b2tlOiBmdW5jdGlvbiBpbnZva2UoY29udGV4dCwgYXJncykge1xuICAgICAgICBjYWxsQ2FsbGJhY2sodGhpcywgYXJncyk7XG5cbiAgICAgICAgaWYgKHRoaXMuZXhjZXB0aW9uKSB7XG4gICAgICAgICAgICB0aHJvdyB0aGlzLmV4Y2VwdGlvbjtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgdGhpcy5yZXR1cm5BcmdBdCA9PT0gXCJudW1iZXJcIikge1xuICAgICAgICAgICAgcmV0dXJuIGFyZ3NbdGhpcy5yZXR1cm5BcmdBdF07XG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5yZXR1cm5UaGlzKSB7XG4gICAgICAgICAgICByZXR1cm4gY29udGV4dDtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgdGhpcy50aHJvd0FyZ0F0ID09PSBcIm51bWJlclwiKSB7XG4gICAgICAgICAgICBpZiAoYXJncy5sZW5ndGggPCB0aGlzLnRocm93QXJnQXQpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKFxuICAgICAgICAgICAgICAgICAgICBcInRocm93QXJncyBmYWlsZWQ6IFwiICsgdGhpcy50aHJvd0FyZ0F0XG4gICAgICAgICAgICAgICAgICAgICsgXCIgYXJndW1lbnRzIHJlcXVpcmVkIGJ1dCBvbmx5IFwiICsgYXJncy5sZW5ndGhcbiAgICAgICAgICAgICAgICAgICAgKyBcIiBwcmVzZW50XCJcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgYXJnc1t0aGlzLnRocm93QXJnQXRdO1xuICAgICAgICB9IGVsc2UgaWYgKHRoaXMuZmFrZUZuKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5mYWtlRm4uYXBwbHkoY29udGV4dCwgYXJncyk7XG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5yZXNvbHZlKSB7XG4gICAgICAgICAgICByZXR1cm4gKHRoaXMucHJvbWlzZUxpYnJhcnkgfHwgUHJvbWlzZSkucmVzb2x2ZSh0aGlzLnJldHVyblZhbHVlKTtcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLnJlamVjdCkge1xuICAgICAgICAgICAgcmV0dXJuICh0aGlzLnByb21pc2VMaWJyYXJ5IHx8IFByb21pc2UpLnJlamVjdCh0aGlzLnJldHVyblZhbHVlKTtcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLmNhbGxzVGhyb3VnaCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3R1Yi53cmFwcGVkTWV0aG9kLmFwcGx5KGNvbnRleHQsIGFyZ3MpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnJldHVyblZhbHVlO1xuICAgIH0sXG5cbiAgICBvbkNhbGw6IGZ1bmN0aW9uIG9uQ2FsbChpbmRleCkge1xuICAgICAgICByZXR1cm4gdGhpcy5zdHViLm9uQ2FsbChpbmRleCk7XG4gICAgfSxcblxuICAgIG9uRmlyc3RDYWxsOiBmdW5jdGlvbiBvbkZpcnN0Q2FsbC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Yi5hcHBseShudWxsLCBhcmd1bWVudHMpO1xuICAgICAgICB2YXIgaXNTdHViYmluZ0VudGlyZU9iamVjdCA9IHR5cGVvZiBwcm9wZXJ0eSA9PT0gXCJ1bmRlZmluZWRcIiAmJiB0eXBlb2Ygb2JqZWN0ID09PSBcIm9iamVjdFwiO1xuXG4gICAgICAgIGlmIChpc1N0dWJiaW5nRW50aXJlT2JqZWN0KSB7XG4gICAgICAgICAgICB2YXIgb3duTWV0aG9kcyA9IGNvbGxlY3RPd25NZXRob2RzKHN0dWJiZWQpO1xuICAgICAgICAgICAgb3duTWV0aG9kcy5mb3JFYWNoKHRoaXMuYWRkLmJpbmQodGhpcykpO1xuICAgICAgICAgICAgaWYgKHRoaXMucHJvbWlzZUxpYnJhcnkpIHtcbiAgICAgICAgICAgICAgICBvd25NZXRob2RzLmZvckVhY2godGhpcy5hZGRVc2luZ1Byb21pc2UuYmluZCh0aGlzKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmFkZChzdHViYmVkKTtcbiAgICAgICAgICAgIGlmICh0aGlzLnByb21pc2VMaWJyYXJ5KSB7XG4gICAgICAgICAgICAgICAgc3R1YmJlZC51c2luZ1Byb21pc2UodGhpcy5wcm9taXNlTGlicmFyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gc3R1YmJlZDtcbiAgICB9LFxuXG4gICAgbW9jazogZnVuY3Rpb24gbW9jaygpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYWRkKHNpbm9uTW9jay5hcHBseShudWxsLCBhcmd1bWVudHMpKTtcbiAgICB9LFxuXG4gICAgaW5qZWN0OiBmdW5jdGlvbiBpbmplY3Qob2JqKSB7XG4gICAgICAgIHZhciBjb2wgPSB0aGlzO1xuXG4gICAgICAgIG9iai5zcHkgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gY29sLnNweS5hcHBseShj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JndW1lbnQgaW5kZXggaXMgbm90IG51bWJlclwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZha2UucmV0dXJuQXJnQXQgPSBwb3M7XG4gICAgfSxcblxuICAgIHRocm93c0FyZzogZnVuY3Rpb24gdGhyb3dzQXJnKGZha2UsIHBvcykge1xuICAgICAgICBpZiAodHlwZW9mIHBvcyAhPT0gXCJudW1iZXJcIikge1xuICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcImFyZ3VtZW50IGluZGV4IGlzIG5vdCBudW1iZXJcIik7XG4gICAgICAgIH1cblxuICAgICAgICBmYWtlLnRocm93QXJnQXQgPSBwb3M7XG4gICAgfSxcblxuICAgIHJldHVybnNUaGlzOiBmdW5jdGlvbiByZXR1cm5zVGhpcyhmYWtlKSB7XG4gICAgICAgIGZha2UucmV0dXJuVGhpcyA9IHRydWU7XG4gICAgfSxcblxuICAgIHJlc29sdmVzOiBmdW5jdGlvbiByZXNvbHZlcyhmYWtlLCB2YWx1ZSkge1xuICAgICAgICBmYWtlLnJldHVyblZhbHVlID0gdmFsdWU7XG4gICAgICAgIGZha2UucmVzb2x2ZSA9IHRydWU7XG4gICAgICAgIGZha2UucmVqZWN0ID0gZmFsc2U7XG4gICAgICAgIGZha2UucmV0dXJuVmFsdWVEZWZpbmVkID0gdHJ1ZTtcbiAgICAgICAgZmFrZS5leGNlcHRpb24gPSB1bmRlZmluZWQ7XG4gICAgICAgIGZha2UuZmFrZUZuID0gdW5kZWZpbmVkO1xuICAgIH0sXG5cbiAgICByZWplY3RzOiBmdW5jdGlvbiByZWplY3RzKGZha2UsIGVycm9yLCBtZXNzYWdlKSB7XG4gICAgICAgIHZhciByZWFzb247XG4gICAgICAgIGlmICh0eXBlb2YgZXJyb3IgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgIHJlYXNvbiA9IG5ldyBFcnJvcihtZXNzYWdlIHx8IFwiXCIpO1xuICAgICAgICAgICAgcmVhc29uLm5hbWUgPSB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gICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIShcImV4cGVjdGVkQXJndW1lbnRzXCIgaW4gdGhpcykpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgYXJncyA9IGFyZ3MgfHwgW107XG5cbiAgICAgICAgaWYgKGFyZ3MubGVuZ3RoIDwgZXhwZWN0ZWRBcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5leHBlY3RzRXhhY3RBcmdDb3VudCAmJlxuICAgICAgICAgICAgYXJncy5sZW5ndGggIT09IGV4cGVjdGVkQXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGV4cGVjdGVkQXJndW1lbnRzLmV2ZXJ5KGZ1bmN0aW9uIChleHBlY3RlZEFyZ3VtZW50LCBpKSB7XG4gICAgICAgICAgICBpZiAoIXZlcmlmeU1hdGNoZXIoZXhwZWN0ZWRBcmd1bWVudCwgYXJnc1tpXSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICghZGVlcEVxdWFsKGV4cGVjdGVkQXJndW1lbnQsIGFyZ3NbaV0pKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfSk7XG4gICAgfSxcblxuICAgIHdpdGhBcmdzOiBmdW5jdGlvbiB3aXRoQXJncygpIHtcbiAgICAgICAgdGhpcy5leHBlY3RlZEFyZ3VtZW50cyA9IHNsaWNlLmNhbGwoYXJndW1lbnRzKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfSxcbl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gICAgICB2YXIgbW9ja09iamVjdCA9IGV4dGVuZCh7fSwgbW9jayk7XG4gICAgICAgIG1vY2tPYmplY3Qub2JqZWN0ID0gb2JqZWN0O1xuICAgICAgICBkZWxldGUgbW9ja09iamVjdC5jcmVhdGU7XG5cbiAgICAgICAgcmV0dXJuIG1vY2tPYmplY3Q7XG4gICAgfSxcblxuICAgIGV4cGVjdHM6IGZ1bmN0aW9uIGV4cGVjdHMobWV0aG9kKSB7XG4gICAgICAgIGlmICghbWV0aG9kKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKFwibWV0aG9kIGlzIGZhbHN5XCIpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCF0aGlzLmV4cGVjdGF0aW9ucykge1xuICAgICAgICAgICAgdGhpcy5leHBlY3RhdGlvbnMgPSB7fTtcbiAgICAgICAgICAgIHRoaXMucHJveGllcyA9IFtdO1xuICAgICAgICAgICAgdGhpcy5mYWlsdXJlcyA9IFtdO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCF0aGlzLmV4cGVjdGF0aW9uc1ttZXRob2RdKSB7XG4gICAgICAgICAgICB0aGlzLmV4cGVjdGF0aW9uc1ttZXRob2RdID0gW107XG4gICAgICAgICAgICB2YXIgbW9ja09iamVjdCA9IHRoaXM7XG5cbiAgICAgICAgICAgIHdyYXBNZXRob2QodGhpcy5vYmplY3QsIG1ldGhvZCwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBtb2NrT2JqZWN0Lmludm9rZU1ldGhvZChtZXRob2QsIHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgcHVzaC5jYWxsKHRoaXMucHJveGllcywgbWV0aG9kKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBleHBlY3RhdGlvbiA9IG1vY2tFeHBlY3RhdGlvbi5jcmVhdGUobWV0aG9kKTtcbiAgICAgICAgcHVzaC5jYWxsKHRoaXMuZXhwZWN0YXRpb25zW21ldGhvZF0sIGV4cGVjdGF0aW9uKTtcblxuICAgICAgICByZXR1cm4gZXhwZWN0YXRpb247XG4gICAgfSxcblxuICAgIHJlc3RvcmU6IGZ1bmN0aW9uIHJlc3RvcmUoKSB7XG4gICAgICAgIHZhciBvYmplY3QgPSB0aGlzLm9iamVjdDtcblxuICAgICAgICBlYWNoKHRoaXMucHJveGllcywgZnVuY3Rpb24gKHByb3h5KSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIG9iamVjdFtwcm94eV0ucmVzdG9yZSA9PT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgb2JqZWN0W3Byb3h5XS5yZXN0b3JlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH0sXG5cbiAgICB2ZXJpZnk6IGZ1bmN0aW9uIHZlcmlmeSgpIHtcbiAgICAgICAgdmFyIGV4cGVjdGF0aW9ucyA9IHRoaXMuZXhwZWN0YXRpb25zIHx8IHt9O1xuICAgICAgICB2YXIgbWVzc2FnZXMgPSB0aGlzLmZhaWx1cmVzID8gdGhpcy5mYWlsdXJlcy5zbGljZSgpIDogW107XG4gICAgICAgIHZhciBtZXQgPSBbXTtcblxuICAgICAgICBlYWNoKHRoaXMucHJveGllcywgZnVuY3Rpb24gKHByb3h5KSB7XG4gICAgICAgICAgICBlYWNoKGV4cGVjdGF0aW9uc1twcm94eV0sIGZ1bmN0aW9uIChleHBlY3RhdGlvbikge1xuICAgICAgICAgICAgICAgIGlmICghZXhwZWN0YXRpb24ubWV0KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcHVzaC5jYWxsKG1lc3NhZ2VzLCBleHBlY3RhdGlvbi50b1N0cmluZygpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwdXNoLmNhbGwobWV0LCBleHBlY3RhdGlvbi50b1N0cmluZygpKTtcbiAgICAgICAgICAgICAgICB9XG4g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gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgc2FuZGJveC5zZXJ2ZXJQcm90b3R5cGUgPSBjb25maWcudXNlRmFrZVNlcnZlcjtcbiAgICAgICAgfVxuXG4gICAgICAgIHNhbmRib3gudXNlRmFrZVNlcnZlcigpO1xuICAgIH1cblxuICAgIGlmIChjb25maWcudXNlRmFrZVRpbWVycykge1xuICAgICAgICBpZiAodHlwZW9mIGNvbmZpZy51c2VGYWtlVGltZXJzID09PSBcIm9iamVjdFwiKSB7XG4gICAgICAgICAgICBzYW5kYm94LnVzZUZha2VUaW1lcnMuYXBwbHkoc2FuZGJveCwgY29uZmlnLnVzZUZha2VUaW1lcnMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc2FuZGJveC51c2VGYWtlVGltZXJzKCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gc2FuZGJveDtcbn1cblxuZXh0ZW5kKHNpbm9uU2FuZGJveCwge1xuICAgIHVzZUZha2VUaW1lcnM6IGZ1bmN0aW9uIHVzZUZha2VUaW1lcnMoKSB7XG4gICAgICAgIHRoaXMuY2xvY2sgPSBzaW5vbkNsb2NrLnVzZUZha2VUaW1lcnMuYXBwbHkobnVsbCwgYXJndW1lbnRzKTtcblxuICAgICAgICByZXR1cm4gdGhpcy5hZGQodGhpcy5jbG9jayk7XG4gICAgfSxcblxuICAgIHNlcnZlclByb3RvdHlwZTogZmFrZVNlcnZlcldpdGhDbG9jayxcblxuICAgIHVzZUZha2VTZXJ2ZXI6IGZ1bmN0aW9uIHVzZUZha2VTZXJ2ZXIoKSB7XG4gICAgICAgIHZhciBwcm90byA9IHRoaXMuc2VydmVyUHJvdG90eXBlIHx8IGZha2VTZXJ2ZXI7XG5cbiAgICAgICAgaWYgKCFwcm90byB8fCAhcHJvdG8uY3JlYXRlKSB7XG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuc2VydmVyID0gcHJv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QZXJoYXBzIHlvdSBtZWFudCBzdHViLnJlc3RvcmUoKVwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHNpbm9uQ29sbGVjdGlvbi5yZXN0b3JlLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgIHRoaXMucmVzdG9yZUNvbnRleHQoKTtcbiAgICB9LFxuXG4gICAgcmVzdG9yZUNvbnRleHQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIGluamVjdGVkS2V5cyA9IHRoaXMuaW5qZWN0ZWRLZXlzO1xuICAgICAgICB2YXIgaW5qZWN0SW50byA9IHRoaXMuaW5qZWN0SW50bztcblxuICAgICAgICBpZiAoIWluamVjdGVkS2V5cykge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgaW5qZWN0ZWRLZXlzLmZvckVhY2goZnVuY3Rpb24gKGluamVjdGVkS2V5KSB7XG4gICAgICAgICAgICBkZWxldGUgaW5qZWN0SW50b1tpbmplY3RlZEtleV07XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGluamVjdGVkS2V5cyA9IFtdO1xuICAgIH0sXG5cbiAgICBjcmVhdGU6IGZ1bmN0aW9uIChjb25maWcpIHtcbiAgICAgICAgaWYgKCFjb25maWcpIHtcbiAgICAgICAgICAgIHJldHVybiBPYmplY3QuY3JlYXRlKHNpbm9uU2FuZGJveCk7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgc2FuZGJveCA9IHByZXBhcmVTYW5kYm94RnJvbUNvbmZpZyhjb25maWcpO1xuICAgICAgICBzYW5kYm94LmFyZ3MgPSBzYW5kYm94LmFyZ3MgfHwgW107XG4gICAgICAgIHNhbmRib3guaW5qZWN0ZWRLZXlzID0gW107XG4gICAgICAgIHNhbmRib3guaW5qZWN0SW50byA9IGNvbmZpZy5pbmplY3RJbnRvO1xuICAgICAgICB2YXIgZXhwb3NlZCA9IHNhbmRib3guaW5qZWN0KHt9KTtcblxuICAgICAg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ICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBleHBlY3RlZEFyZ01lc3NhZ2UgPSBqIDwgYXJncy5sZW5ndGggPyBzaW5vbkZvcm1hdChhcmdzW2pdKSA6IFwiXCI7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkaWZmID0ganNEaWZmLmRpZmZKc29uKGNhbGxlZEFyZ01lc3NhZ2UsIGV4cGVjdGVkQXJnTWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgKz0gY29sb3JEaWZmVGV4dChkaWZmKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbWVzc2FnZTtcbiAgICB9LFxuXG4gICAgQzogZnVuY3Rpb24gKHNweUluc3RhbmNlKSB7XG4gICAgICAgIHZhciBjYWxscyA9IFtdO1xuXG4gICAgICAgIGZvciAodmFyIGkgPSAwLCBsID0gc3B5SW5zdGFuY2UuY2FsbENvdW50OyBpIDwgbDsgKytpKSB7XG4gICAgICAgICAgICB2YXIgc3RyaW5naWZpZWRDYWxsID0gXCIgICAgXCIgKyBzcHlJbnN0YW5jZS5nZXRDYWxsKGkpLnRvU3RyaW5nKCk7XG4gICAgICAgICAgICBpZiAoL1xcbi8udGVzdChjYWxsc1tpIC0gMV0pKSB7XG4gICAgICAgICAgICAgICAgc3RyaW5naWZpZWRDYWxsID0gXCJcXG5cIiArIHN0cmluZ2lmaWVkQ2FsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHB1c2guY2FsbChjYWxscywgc3RyaW5naWZpZWRDYWxsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBjYWxscy5sZW5ndGggPiAwID8gXCJcXG5cIiArIGNhbGxzLmpvaW4oXCJcXG5cIikgOiBcIlwiO1xuICAgIH0sXG5cbiAgICB0OiBmdW5jdGlvbiAoc3B5SW5zdGFuY2UpIHtcbiAgICAg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FyZ3VtZW50cykpOyB9OyBicmVhaztcbiAgICAgICAgICAgIC8qZXNsaW50LWVuYWJsZSovXG4gICAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgICBwID0gZnVuY3Rpb24gcHJveHkoKSB7XG4gICAgICAgICAgICByZXR1cm4gcC5pbnZva2UoZnVuYywgdGhpcywgc2xpY2UuY2FsbChhcmd1bWVudHMpKTtcbiAgICAgICAgfTtcbiAgICB9XG4gICAgcC5pc1Npbm9uUHJveHkgPSB0cnVlO1xuICAgIHJldHVybiBwO1xufVxuXG52YXIgdXVpZCA9IDA7XG5cbi8vIFB1YmxpYyBBUElcbnZhciBzcHlBcGkgPSB7XG4gICAgZm9ybWF0dGVyczogcmVxdWlyZShcIi4vc3B5LWZvcm1hdHRlcnNcIiksXG5cbiAgICByZXNldDogZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5pbnZva2luZykge1xuICAgICAgICAgICAgdmFyIGVyciA9IG5ldyBFcnJvcihcIkNhbm5vdCByZXNldCBTaW5vbiBmdW5jdGlvbiB3aGlsZSBpbnZva2luZyBpdC4gXCIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIk1vdmUgdGhlIGNhbGwgdG8gLnJlc2V0IG91dHNpZGUgb2YgdGhlIGNhbGxiYWNrLlwiKTtcbiAgICAgICAgICAgIGVyci5uYW1lID0gXCJJbnZhbGlkUmVzZXRFeGNlcHRpb25cIjtcbiAgICAgICAgICAgIHRocm93IGVycjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuY2FsbGVkID0gZmFsc2U7XG4gICAgICAgIHRoaXMubm90Q2FsbGVkID0gdHJ1ZTtcbiAgICAgICAgdGhpcy5jYWxsZWRPbmNlID0gZmFsc2U7XG4gICAgICAgIHRoaXMuY2FsbGVkVHdpY2UgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5jYWxsZWRUaHJpY2UgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5jYWxsQ291b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Z5ZXIsIDEwKSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gc2lub25Gb3JtYXQoYXJnc1tzcGVjaWZ5ZXIgLSAxXSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBcIiVcIiArIHNwZWNpZnllcjtcbiAgICAgICAgfSk7XG4gICAgfVxufTtcblxuZnVuY3Rpb24gZGVsZWdhdGVUb0NhbGxzKG1ldGhvZCwgbWF0Y2hBbnksIGFjdHVhbCwgbm90Q2FsbGVkKSB7XG4gICAgc3B5QXBpW21ldGhvZF0gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICghdGhpcy5jYWxsZWQpIHtcbiAgICAgICAgICAgIGlmIChub3RDYWxsZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm90Q2FsbGVkLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgY3VycmVudENhbGw7XG4gICAgICAgIHZhciBtYXRjaGVzID0gMDtcblxuICAgICAgICBmb3IgKHZhciBpID0gMCwgbCA9IHRoaXMuY2FsbENvdW50OyBpIDwgbDsgaSArPSAxKSB7XG4gICAgICAgICAgICBjdXJyZW50Q2FsbCA9IHRoaXMuZ2V0Q2FsbChpKTtcblxuICAgICAgICAgICAgaWYgKGN1cnJlbnRDYWxsW2FjdHVhbCB8fCBtZXRob2RdLmFwcGx5KGN1cnJlbnRDYWxsLCBhcmd1bWVudHMpKSB7XG4gICAgICAgICAgICAgICAgbWF0Y2hlcyArPSAxO1xuXG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoQW55KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBtYXRjaGVzID09PSB0aGlzLmNhbG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gICAgICAgICAgICAgICAgICAmJiB0eXBlb2YgcHJvcGVydHkgIT09IFwidW5kZWZpbmVkXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICh0eXBlb2YgYWN0dWFsRGVzY3JpcHRvciA9PT0gXCJ1bmRlZmluZWRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgdHlwZW9mIGFjdHVhbERlc2NyaXB0b3IudmFsdWUgIT09IFwiZnVuY3Rpb25cIilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHR5cGVvZiBkZXNjcmlwdG9yID09PSBcInVuZGVmaW5lZFwiO1xuICAgIHZhciBpc1N0dWJiaW5nRXhpc3RpbmdNZXRob2QgPSAhaXNTdHViYmluZ0Rlc2NyaXB0b3JcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHR5cGVvZiBvYmplY3QgPT09IFwib2JqZWN0XCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHR5cGVvZiBhY3R1YWxEZXNjcmlwdG9yICE9PSBcInVuZGVmaW5lZFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB0eXBlb2YgYWN0dWFsRGVzY3JpcHRvci52YWx1ZSA9PT0gXCJmdW5jdGlvblwiO1xuICAgIHZhciBhcml0eSA9IGlzU3R1YmJpbmdFeGlzdGluZ01ldGhvZCA/IG9iamVjdFtwcm9wZXJ0eV0ubGVuZ3RoIDogMDtcblxuICAgIGlmIChpc1N0dWJiaW5nRW50aXJlT2JqZWN0KSB7XG4gICAgICAgIHJldHVybiBzdHViRW50aXJlT2JqZWN0KHN0dWIsIG9iamVjdCk7XG4gICAgfVxuXG4gICAgaWYgKGlzU3R1YmJpbmdEZXNjcmlwdG9yKSB7XG4gICAgICAgIHJldHVybiBzdHViRGVzY3JpcHRvci5hcHBseShudWxsLCBhcmd1bWVudHMpO1xuICAgIH1cblxu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ZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIFwiMVwiO1xuICAgICAgICB9LFxuICAgICAgICB2YWx1ZU9mOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gXCIyXCI7XG4gICAgICAgIH0sXG4gICAgICAgIHRvTG9jYWxlU3RyaW5nOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gXCIzXCI7XG4gICAgICAgIH0sXG4gICAgICAgIHByb3RvdHlwZTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIFwiNFwiO1xuICAgICAgICB9LFxuICAgICAgICBpc1Byb3RvdHlwZU9mOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gXCI1XCI7XG4gICAgICAgIH0sXG4gICAgICAgIHByb3BlcnR5SXNFbnVtZXJhYmxlOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gXCI2XCI7XG4gICAgICAgIH0sXG4gICAgICAgIGhhc093blByb3BlcnR5OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gXCI3XCI7XG4gICAgICAgIH0sXG4gICAgICAgIGxlbmd0aDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIFwiOFwiO1xuICAgICAgICB9LFxuICAgICAgICB1bmlxdWU6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiBcIjlcIjtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICB2YXIgcmVzdWx0ID0gW107XG4gICAgZm9yICh2YXIgcHJvcCBpbiBvYmopIHtcbiAgICAgICAgaWYgKG9iai5oYXNPd25Qcm9wZXJ0eShwcm9wKSkge1xuICAgICAgICAgICAgcmVzdWx0LnB1c2gob2JqW3Byb3BdKCkpO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZXN1bHQuam9pbihcIlwiKSAhPT0gXCIwMTIzNDU2Nz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mdW5jdGlvbiAoKSB7XG4gICAgICAgIC8vIEZvciBwcm90b3R5cGUgcHJvcGVydGllcyB0cnkgdG8gcmVzZXQgYnkgZGVsZXRlIGZpcnN0LlxuICAgICAgICAvLyBJZiB0aGlzIGZhaWxzIChleDogbG9jYWxTdG9yYWdlIG9uIG1vYmlsZSBzYWZhcmkpIHRoZW4gZm9yY2UgYSByZXNldFxuICAgICAgICAvLyB2aWEgZGlyZWN0IGFzc2lnbm1lbnQuXG4gICAgICAgIGlmICghb3duZWQpIHtcbiAgICAgICAgICAgIC8vIEluIHNvbWUgY2FzZXMgYGRlbGV0ZWAgbWF5IHRocm93IGFuIGVycm9yXG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIGRlbGV0ZSBvYmplY3RbcHJvcGVydHldO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge30gLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby1lbXB0eVxuICAgICAgICAgICAgLy8gRm9yIG5hdGl2ZSBjb2RlIGZ1bmN0aW9ucyBgZGVsZXRlYCBmYWlscyB3aXRob3V0IHRocm93aW5nIGFuIGVycm9yXG4gICAgICAgICAgICAvLyBvbiBDaHJvbWUgPCA0MywgUGhhbnRvbUpTLCBldGMuXG4gICAgICAgIH0gZWxzZSBpZiAoaGFzRVM1U3VwcG9ydCkge1xuICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KG9iamVjdCwgcHJvcGVydHksIHdyYXBwZWRNZXRob2REZXNjKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChoYXNFUzVTdXBwb3J0KSB7XG4gICAgICAgICAgICB2YXIgZGVzY3JpcHRvciA9IGdldFByb3BlcnR5RGVzY3JpcHRvcihvYmplY3QsIHByb3BlcnR5KTtcbiAgICAgICAgICAgIGlmIChkZXNjcmlwdG9yICYmIGRlc2NyaXB0b3IudmFsdWUgPT09IG1ldGhvZCkge1xuICAgICAgICAgICAgICAgIG9iamVjdFtwcm9wZXJ0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m4gLTE7XG4gICAgfVxuICAgIGlmIChhLmNyZWF0ZWRBdCA+IGIuY3JlYXRlZEF0KSB7XG4gICAgICAgIHJldHVybiAxO1xuICAgIH1cblxuICAgIC8vIFNvcnQgbmV4dCBieSBpZCwgbG93ZXItaWQgdGltZXJzIHRha2UgcHJlY2VkZW5jZVxuICAgIGlmIChhLmlkIDwgYi5pZCkge1xuICAgICAgICByZXR1cm4gLTE7XG4gICAgfVxuICAgIGlmIChhLmlkID4gYi5pZCkge1xuICAgICAgICByZXR1cm4gMTtcbiAgICB9XG5cbiAgICAvLyBBcyB0aW1lciBpZHMgYXJlIHVuaXF1ZSwgbm8gZmFsbGJhY2sgYDBgIGlzIG5lY2Vzc2FyeVxufVxuXG5mdW5jdGlvbiBmaXJzdFRpbWVySW5SYW5nZShjbG9jaywgZnJvbSwgdG8pIHtcbiAgICB2YXIgdGltZXJzID0gY2xvY2sudGltZXJzO1xuICAgIHZhciB0aW1lciA9IG51bGw7XG4gICAgdmFyIGlkLCBpc0luUmFuZ2U7XG5cbiAgICBmb3IgKGlkIGluIHRpbWVycykge1xuICAgICAgICBpZiAodGltZXJzLmhhc093blByb3BlcnR5KGlkKSkge1xuICAgICAgICAgICAgaXNJblJhbmdlID0gaW5SYW5nZShmcm9tLCB0bywgdGltZXJzW2lkXSk7XG5cbiAgICAgICAgICAgIGlmIChpc0luUmFuZ2UgJiYgKCF0aW1lciB8fCBjb21wYXJlVGltZXJzKHRpbWVyLCB0aW1lcnNbaWRdKSA9PT0gMSkpIHtcbiAgICAgICAgICAgICAgICB0aW1lciA9IHRpbWVyc1tpZF07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gdGltZXI7XG59XG5cbmZ1bmN0aW9uIGZpcnN0VGltZXIoY2xvY2spIHtcbiAgICB2YXIgdGltZXJzID0gY2xvY2sudGltZXJzO1xuICAgIHZhciB0aW1lciA9IG51bGw7XG4gICAgdmFyIGlkO1xuXG4gICAgZm9yIChpZCBpbiB0aW1lcnMpIHtcbiAgICAgICAgaWYgKHRpbWVycy5oYXNPd25Qcm9wZXJ0eShpZCkpIHtcbiAgICAgICAgICAgIGlmICghdGltZXIgfHwgY29tcGFyZVRpbWVycyh0aW1lciwgdGltZXJzW2lkXSkgPT09IDEpIHtcbiAgICAgICAgICAgICAgICB0aW1lciA9IHRpbWVyc1tpZF07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gdGltZXI7XG59XG5cbmZ1bmN0aW9uIGxhc3RUaW1lcihjbG9jaykge1xuICAgIHZhciB0aW1lcnMgPSBjbG9jay50aW1lcnM7XG4gICAgdmFyIHRpbWVyID0gbnVsbDtcbiAgICB2YXIgaWQ7XG5cbiAgICBmb3IgKGlkIGluIHRpbWVycykge1xuICAgICAgICBpZiAodGltZXJzLmhhc093blByb3BlcnR5KGlkKSkge1xuICAgICAgICAgICAgaWYgKCF0aW1lciB8fCBjb21wYXJlVGltZXJzKHRpbWVyLCB0aW1lcnNbaWRdKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICB0aW1lciA9IHRpbWVyc1tpZF07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gdGltZXI7XG59XG5cbmZ1bmN0aW9uIGNhbGxUaW1lcihjbG9jaywgdGltZXIpIHtcbiAgICB2YXIgZXhjZXB0aW9uO1xuXG4gICAgaWYgKHR5cGVvZiB0aW1lci5pbnRlcnZhbCA9PT0gXCJudW1iZXJcIikge1xuICAgICAgICBjbG9jay50aW1lcnNbdGltZXIuaWRdLmNhbGxBdCArPSB0aW1lci5pbnRlcnZhbDtcbiAgICB9IGVsc2Uge1xuICAgICAgICBkZWxldGUgY2xvY2sudGltZXJzW3RpbWVyLmlkXTtcbiAgICB9XG5cbiAgICB0cnkge1xuICAgICAgICBpZiAodHlwZW9mIHRpbWVyLmZ1bmMgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgdGltZXIuZnVuYy5hcHBseShudWxsLCB0aW1lci5hcmdzKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8qIGVzbGludCBuby1ldmFsOiBcIm9mZlwiICovXG4gICAgICAgICAgICBldmFsKHRpbWVyLmZ1bmMpO1xuICAgICAgICB9XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgICBleGNlcHRpb24gPSBlO1xuICAgIH1cblxuICAgIGlmICghY2xvY2sudGltZXJzW3RpbWVyLmlkXSkge1xuICAgICAgICBpZiAoZXhjZXB0aW9uKSB7XG4gICAgICAgICAgICB0aHJvdyBleGNlcHRpb247XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuO1xuICAgIH1cblxuICAgIGlmIChleGNlcHRpb24pIHtcbiAgICAgICAgdGhyb3cgZXhjZXB0aW9uO1xuICAgIH1cbn1cblxuZnVuY3Rpb24gdGltZXJUeXBlKHRpbWVyKSB7XG4gICAgaWYgKHRpbWVyLmltbWVkaWF0ZSkge1xuICAgICAgICByZXR1cm4gXCJJbW1lZGlhdGVcIjtcbiAgICB9XG4gICAgaWYgKHRpbWVyLmludGVydmFsICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgcmV0dXJuIFwiSW50ZXJ2YWxcIjtcbiAgICB9XG4gICAgcmV0dXJuIFwiVGltZW91dFwiO1xufVxuXG5mdW5jdGlvbiBjbGVhclRpbWVyKGNsb2NrLCB0aW1lcklkLCB0dHlwZSkge1xuICAgIGlmICghdGltZXJJZCkge1xuICAgICAgICAvLyBudWxsIGFwcGVhcnMgdG8gYmUgYWxsb3dlZCBpbiBtb3N0IGJyb3dzZXJzLCBhbmQgYXBwZWFycyB0byBiZVxuICAgICAgICAvLyByZWxpZWQgdXBvbiBieSBzb21lIGxpYnJhcmllcywgbGlrZSBCb290c3RyYXAgY2Fyb3VzZWxcbiAgICAgICAgcmV0dXJuO1xuICAgIH1cblxuICAgIGlmICghY2xvY2sudGltZXJzKSB7XG4g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uY3Rpb24gKG9iaikge1xuICAgIHZhciBrcyA9IFtdO1xuICAgIHZhciBrZXk7XG5cbiAgICBmb3IgKGtleSBpbiBvYmopIHtcbiAgICAgICAgaWYgKG9iai5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICAgICAgICBrcy5wdXNoKGtleSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4ga3M7XG59O1xuXG5leHBvcnRzLnRpbWVycyA9IHRpbWVycztcblxuZnVuY3Rpb24gY3JlYXRlQ2xvY2sobm93LCBsb29wTGltaXQpIHtcbiAgICBsb29wTGltaXQgPSBsb29wTGltaXQgfHwgMTAwMDtcblxuICAgIHZhciBjbG9jayA9IHtcbiAgICAgICAgbm93OiBnZXRFcG9jaChub3cpLFxuICAgICAgICBock5vdzogMCxcbiAgICAgICAgdGltZW91dHM6IHt9LFxuICAgICAgICBEYXRlOiBjcmVhdGVEYXRlKCksXG4gICAgICAgIGxvb3BMaW1pdDogbG9vcExpbWl0XG4gICAgfTtcblxuICAgIGNsb2NrLkRhdGUuY2xvY2sgPSBjbG9jaztcblxuICAgIGNsb2NrLnNldFRpbWVvdXQgPSBmdW5jdGlvbiBzZXRUaW1lb3V0KGZ1bmMsIHRpbWVvdXQpIHtcbiAgICAgICAgcmV0dXJuIGFkZFRpbWVyKGNsb2NrLCB7XG4gICAgICAgICAgICBmdW5jOiBmdW5jLFxuICAgICAgICAgICAgYXJnczogQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJndW1lbnRzLCAyKSxcbiAgICAgICAgICAgIGRlbGF5OiB0aW1lb3V0XG4gICAgICAgIH0pO1xuICAgIH07XG5cbiAgICBjbG9jay5jbGVhclRpbWVvdXQgPSBmdW5jdGlvbiBjbGVhclRpbWVvdXQodGltZXJJZCkge1xuICAgICAgICByZXR1cm4gY2xlYXJUaW1lcihjbG9jaywgdGltZXJJZCwgXCJUaW1lb3V0XCIpO1xuICAgIH07XG5cbiAgICBjbG9jay5z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O1xuICAgICAgICB2YXIgdGlja0Zyb20gPSBjbG9jay5ub3c7XG4gICAgICAgIHZhciB0aWNrVG8gPSBjbG9jay5ub3cgKyBtcztcbiAgICAgICAgdmFyIHByZXZpb3VzID0gY2xvY2subm93O1xuICAgICAgICB2YXIgdGltZXIgPSBmaXJzdFRpbWVySW5SYW5nZShjbG9jaywgdGlja0Zyb20sIHRpY2tUbyk7XG4gICAgICAgIHZhciBvbGROb3csIGZpcnN0RXhjZXB0aW9uO1xuXG4gICAgICAgIGNsb2NrLmR1cmluZ1RpY2sgPSB0cnVlO1xuXG4gICAgICAgIGZ1bmN0aW9uIHVwZGF0ZUhyVGltZShuZXdOb3cpIHtcbiAgICAgICAgICAgIGNsb2NrLmhyTm93ICs9IChuZXdOb3cgLSBjbG9jay5ub3cpO1xuICAgICAgICB9XG5cbiAgICAgICAgd2hpbGUgKHRpbWVyICYmIHRpY2tGcm9tIDw9IHRpY2tUbykge1xuICAgICAgICAgICAgaWYgKGNsb2NrLnRpbWVyc1t0aW1lci5pZF0pIHtcbiAgICAgICAgICAgICAgICB1cGRhdGVIclRpbWUodGltZXIuY2FsbEF0KTtcbiAgICAgICAgICAgICAgICB0aWNrRnJvbSA9IHRpbWVyLmNhbGxBdDtcbiAgICAgICAgICAgICAgICBjbG9jay5ub3cgPSB0aW1lci5jYWxsQXQ7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgb2xkTm93ID0gY2xvY2subm93O1xuICAgICAgICAgICAgICAgICAgICBjYWxsVGltZXIoY2xvY2ssIHRpbWVyKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gY29tcGVuc2F0ZSBmb3IgYW55IHNldFN5c3RlbVRpbWUoKSBjYWxsIGR1cmluZyB0aW1lciBjYWxsYmFja1xuICAgICAgICAgICAgICAgICAgICBpZiAob2xkTm93ICE9PSBjbG9jay5ub3cpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tGcm9tICs9IGNsb2NrLm5vdyAtIG9sZE5vdztcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tUbyArPSBjbG9jay5ub3cgLSBvbGROb3c7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcmV2aW91cyArPSBjbG9jay5ub3cgLSBvbGROb3c7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpcnN0RXhjZXB0aW9uID0gZmlyc3RFeGNlcHRpb24gfHwgZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRpbWVyID0gZmlyc3RUaW1lckluUmFuZ2UoY2xvY2ssIHByZXZpb3VzLCB0aWNrVG8pO1xuICAgICAgICAgICAgcHJldmlvdXMgPSB0aWNrRnJvbTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNsb2NrLmR1cmluZ1RpY2sgPSBmYWxzZTtcbiAgICAgICAgdXBkYXRlSHJUaW1lKHRpY2tUbyk7XG4gICAgICAgIGNsb2NrLm5vdyA9IHRpY2tUbztcblxuICAgICAgICBpZiAoZmlyc3RFeGNlcHRpb24pIHtcbiAgICAgICAgICAgIHRocm93IGZpcnN0RXhjZXB0aW9uO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGNsb2NrLm5vdztcbiAgICB9O1xuXG4gICAgY2xvY2submV4dCA9IGZ1bmN0aW9uIG5leHQoKSB7XG4gICAgICAgIHZhciB0aW1lciA9IGZpcnN0VGltZXIoY2xvY2spO1xuICAgICAgICBpZiAoIXRpbWVyKSB7XG4gICAgICAgICAgICByZXR1cm4gY2xvY2subm93O1xuICAgICAgICB9XG5cbiAgICAgICAgY2xvY2suZHVyaW5nVGljayA9IHRydWU7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBjbG9jay5ub3cgPSB0aW1lci5jYWxsQXQ7XG4gICAgICAgICAgICBjYWxsVGltZXIoY2xvY2ssIHRpbWVyKTtcbiAgICAgICAgICAgIHJldHVybiBjbG9jay5ub3c7XG4gICAgICAgIH0gZmluYWxseSB7XG4gICAgICAgICAgICBjbG9jay5kdXJpbmdUaWNrID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgY2xvY2sucnVuQWxsID0gZnVuY3Rpb24gcnVuQWxsKCkge1xuICAgICAgICB2YXIgbnVtVGltZXJzLCBpO1xuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY2xvY2subG9vcExpbWl0OyBpKyspIHtcbiAgICAgICAgICAgIGlmICghY2xvY2sudGltZXJzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNsb2NrLm5vdztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbnVtVGltZXJzID0gT2JqZWN0LmtleXMoY2xvY2sudGltZXJzKS5sZW5ndGg7XG4gICAgICAgICAgICBpZiAobnVtVGltZXJzID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNsb2NrLm5vdztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY2xvY2submV4dCgpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiQWJvcnRpbmcgYWZ0ZXIgcnVubmluZyBcIiArIGNsb2NrLmxvb3BMaW1pdCArIFwiIHRpbWVycywgYXNzdW1pbmcgYW4gaW5maW5pdGUgbG9vcCFcIik7XG4gICAgfTtcblxuICAgIGNsb2NrLnJ1blRvTGFzdCA9IGZ1bmN0aW9uIHJ1blRvTGFzdCgpIHtcbiAgICAgICAgdmFyIHRpbWVyID0gbGFzdFRpbWVyKGNsb2NrKTtcbiAgICAgICAgaWYgKCF0aW1lcikge1xuICAgICAgICAgICAgcmV0dXJuIGNsb2NrLm5vdztcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBjbG9jay50aWNrKHRpbWVyLmNhbGxBdCk7XG4gICAgfTtcblxuICAgIGNsb2NrLnJlc2V0ID0gZnVuY3Rpb24gcmVzZXQoKSB7XG4gICAgICAgIGNsb2NrLnRpbWVycyA9IHt9O1xuICAgIH07XG5cbiAgICBjbG9jay5zZXRTeXN0ZW1UaW1lID0gZnVuY3Rpb24gc2V0U3lzdGVtVGltZShzeXN0ZW1UaW1lKSB7XG4gICAgICAgIC8vIGRldGVybWluZSB0aW1lIGRpZmZlcmVuY2VcbiAgICAgICAgdmFyIG5ld05vdyA9IGdldEVwb2NoKHN5c3RlbVRpbWUpO1xuICAgICAgICB2YXIgZGlmZmVyZW5jZSA9IG5ld05vdyAtIGNsb2NrLm5vdztcbiAgICAgICAgdmFyIGlkLCB0aW1lcjtcblxuICAgICAgICAvLyB1cGRhdGUgJ3N5c3RlbSBjbG9jaydcbiAgICAgICAgY2xvY2subm93ID0gbmV3Tm93O1xuXG4gICAgICAgIC8vIHVwZGF0ZSB0aW1lcnMgYW5kIGludGVydmFscyB0byBrZWVwIHRoZW0gc3RhYmxlXG4gICAgICAgIGZvciAoaWQgaW4gY2xvY2sudGltZXJzKSB7XG4gICAgICAgICAgICBpZiAoY2xvY2sudGltZXJzLmhhc093blByb3BlcnR5KGlkKSkge1xuICAgICAgICAgICAgICAgIHRpbWVyID0gY2xvY2sudGltZXJzW2lkXTtcbiAgICAgICAgICAgICAgICB0aW1lci5jcmVhdGVkQXQgKz0gZGlmZmVyZW5jZTtcbiAgICAgICAgICAgICAgICB0aW1lci5jYWxsQXQgKz0gZGlmZmVyZW5jZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBpZiAoaHJ0aW1lUHJlc2VudCkge1xuICAgICAgICBjbG9jay5ocnRpbWUgPSBmdW5jdGlvbiAocHJldikge1xuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkocHJldikpIHtcbiAgICAgICAgICAgICAgICB2YXIgb2xkU2VjcyA9IChwcmV2WzBdICsgcHJldlsxXSAvIDFlOSk7XG4gICAgICAgICAgICAgICAgdmFyIG5ld1NlY3MgPSAoY2xvY2suaHJOb3cgLyAxMDAwKTtcbiAgICAgICAgICAgICAgICB2YXIgZGlmZmVyZW5jZSA9IChuZXdTZWNzIC0gb2xkU2Vjcyk7XG4gICAgICAgICAgICAgICAgdmFyIHNlY3MgPSBmaXhlZEZsb29yKGRpZmZlcmVuY2UpO1xuICAgICAgICAgICAgICAgIHZhciBuYW5vc2VjcyA9IGZpeGVkTW9kdWxvKGRpZmZlcmVuY2UgKiAxZTksIDFlOSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgICAgICAgc2VjcyxcbiAgICAgICAgICAgICAgICAgICAgbmFub3NlY3NcbiAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgICBmaXhlZEZsb29yKGNsb2NrLmhyTm93IC8gMTAwMCksXG4gICAgICAgICAgICAgICAgZml4ZWRNb2R1bG8oY2xvY2suaHJOb3cgKiAxZTYsIDFlOSlcbiAgICAgICAgICAgIF07XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcmV0dXJuIGNsb2NrO1xufVxuZXhwb3J0cy5jcmVhdGVDbG9jayA9IGNyZWF0ZUNsb2NrO1xuXG5leHBvcnRzLmluc3RhbGwgPSBmdW5jdGlvbiBpbnN0YWxsKHRhcmdldCwgbm93LCB0b0Zha2UsIGxvb3BMaW1pdCkge1xuICAgIHZhciBpLCBsO1xuXG4gICAgaWYgKHRhcmdldCBpbnN0YW5jZW9mIERhdGUpIHtcbiAgICAgICAgdG9GYWtlID0gbm93O1xuICAgICAgICBub3cgPSB0YXJnZXQuZ2V0VGltZSgpO1xuICAgICAgICB0YXJnZXQgPSBudWxsO1xuICAgIH1cblxuICAgIGlmICh0eXBlb2YgdGFyZ2V0ID09PSBcIm51bWJlclwiKSB7XG4gICAgICAgIHRvRmFrZSA9IG5vdztcbiAgICAgICAgbm93ID0gdGFyZ2V0O1xuICAgICAgICB0YXJnZXQgPSBudWxsO1xuICAgIH1cblxuICAgIGlmICghdGFyZ2V0KSB7XG4gICAgICAgIHRhcmdldCA9IGdsb2JhbDtcbiAgICB9XG5cbiAgICB2YXIgY2xvY2sgPSBjcmVhdGVDbG9jayhub3csIGxvb3BMaW1pdCk7XG5cbiAgICBjbG9jay51bmluc3RhbGwgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHVuaW5zdGFsbChjbG9jaywgdGFyZ2V0KTtcbiAgICB9O1xuXG4gICAgY2xvY2subWV0aG9kcyA9IHRvRmFrZSB8fCBbXTtcblxuICAgIGlmIChjbG9jay5tZXRob2RzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICBjbG9jay5tZXRob2RzID0ga2V5cyh0aW1lcnMpO1xuICAgIH1cblxuICAgIGZvciAoaSA9IDAsIGwgPSBjbG9jay5tZXRob2RzLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgICAgICBpZiAoY2xvY2subWV0aG9kc1tpXSA9PT0gXCJocnRpbWVcIikge1xuICAgICAgICAgICAgaWYgKHRhcmdldC5wcm9jZXNzICYmIHR5cGVvZiB0YXJnZXQucHJvY2Vzcy5ocnRpbWUgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgICAgIGhpamFja01ldGhvZCh0YXJnZXQucHJvY2VzcywgY2xvY2subWV0aG9kc1tpXSwgY2xvY2spO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaGlqYWNrTWV0aG9kKHRhcmdldCwgY2xvY2subWV0aG9kc1tpXSwgY2xvY2spO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGNsb2NrO1xufTtcbiIsInZhciBpc2FycmF5ID0gcmVxdWlyZSgnaXNhcnJheScpXG5cbi8qKlxuICogRXhwb3NlIGBwYXRoVG9SZWdleHBgLlxuICovXG5tb2R1bGUuZXhwb3J0cyA9IHBhdGhUb1JlZ2V4cFxubW9kdWxlLmV4cG9ydHMucGFyc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iB8fCB7fVxuICAgIHZhciBvcHRpb25zID0gb3B0cyB8fCB7fVxuICAgIHZhciBlbmNvZGUgPSBvcHRpb25zLnByZXR0eSA/IGVuY29kZVVSSUNvbXBvbmVudFByZXR0eSA6IGVuY29kZVVSSUNvbXBvbmVudFxuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0b2tlbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgIHZhciB0b2tlbiA9IHRva2Vuc1tpXVxuXG4gICAgICBpZiAodHlwZW9mIHRva2VuID09PSAnc3RyaW5nJykge1xuICAgICAgICBwYXRoICs9IHRva2VuXG5cbiAgICAgICAgY29udGludWVcbiAgICAgIH1cblxuICAgICAgdmFyIHZhbHVlID0gZGF0YVt0b2tlbi5uYW1lXVxuICAgICAgdmFyIHNlZ21lbnRcblxuICAgICAgaWYgKHZhbHVlID09IG51bGwpIHtcbiAgICAgICAgaWYgKHRva2VuLm9wdGlvbmFsKSB7XG4gICAgICAgICAgLy8gUHJlcGVuZCBwYXJ0aWFsIHNlZ21lbnQgcHJlZml4ZXMuXG4gICAgICAgICAgaWYgKHRva2VuLnBhcnRpYWwpIHtcbiAgICAgICAgICAgIHBhdGggKz0gdG9rZW4ucHJlZml4XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY29udGludWVcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdFeHBlY3RlZCBcIicgKyB0b2tlbi5uYW1lICsgJ1wiIHRvIGJlIGRlZmluZWQnKVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChpc2FycmF5KHZhbHVlKSkge1xuICAgICAgICBpZiAoIXRva2VuLnJlcGVhdCkge1xuICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ0V4cGVjdGVkIFwiJyArIHRva2VuLm5hbWUgKyAnXCIgdG8gbm90IHJlcGVhdCwgYnV0IHJlY2VpdmVkIGAnICsgSlNPTi5zdHJpbmdpZnkodmFsdWUpICsgJ2AnKVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHZhbHVlLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgIGlmICh0b2tlbi5vcHRpb25hbCkge1xuICAgICAgICAgICAgY29udGludWVcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignRXhwZWN0ZWQgXCInICsgdG9rZW4ubmFtZSArICdcIiB0byBub3QgYmUgZW1wdHknKVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgdmFsdWUubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICBzZWdtZW50ID0gZW5jb2RlKHZhbHVlW2pdKVxuXG4gICAgICAgICAgaWYgKCFtYXRjaGVzW2ldLnRlc3Qoc2VnbWVudCkpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ0V4cGVjdGVkIGFsbCBcIicgKyB0b2tlbi5uYW1lICsgJ1wiIHRvIG1hdGNoIFwiJyArIHRva2VuLnBhdHRlcm4gKyAnXCIsIGJ1dCByZWNlaXZlZCBgJyArIEpTT04uc3RyaW5naWZ5KHNlZ21lbnQpICsgJ2AnKVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHBhdGggKz0gKGogPT09IDAgPyB0b2tlbi5wcmVmaXggOiB0b2tlbi5kZWxpbWl0ZXIpICsgc2VnbWVudFxuICAgICAgICB9XG5cbiAgICAgICAgY29udGludWVcbiAgICAgIH1cblxuICAgICAgc2VnbWVudCA9IHRva2VuLmFzdGVyaXNrID8gZW5jb2RlQXN0ZXJpc2sodmFsdWUpIDogZW5jb2RlKHZhbHVlKVxuXG4gICAgICBpZiAoIW1hdGNoZXNbaV0udGVzdChzZWdtZW50KSkge1xuICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdFeHBlY3RlZCBcIicgKyB0b2tlbi5uYW1lICsgJ1wiIHRv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NpZGVyZWQgZXF1YWxcbiAgICAgKi9cbiAgICBmdW5jdGlvbiBpZGVudGljYWwob2JqMSwgb2JqMikge1xuICAgICAgICBpZiAob2JqMSA9PT0gb2JqMiB8fCAoaXNOYU4ob2JqMSkgJiYgaXNOYU4ob2JqMikpKSB7XG4gICAgICAgICAgICByZXR1cm4gb2JqMSAhPT0gMCB8fCBpc05lZ1plcm8ob2JqMSkgPT09IGlzTmVnWmVybyhvYmoyKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzU2V0KHZhbCkge1xuICAgICAgICBpZiAodHlwZW9mIFNldCAhPT0gJ3VuZGVmaW5lZCcgJiYgdmFsIGluc3RhbmNlb2YgU2V0KSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzU3Vic2V0KHMxLCBzMiwgY29tcGFyZSkge1xuICAgICAgICB2YXIgdmFsdWVzMSA9IEFycmF5LmZyb20oczEpO1xuICAgICAgICB2YXIgdmFsdWVzMiA9IEFycmF5LmZyb20oczIpO1xuXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdmFsdWVzMS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIGluY2x1ZGVzID0gZmFsc2U7XG5cbiAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgdmFsdWVzMi5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIGlmIChjb21wYXJlKHZhbHVlczJbal0sIHZhbHVlczFbaV0pKSB7XG4gICAgICAgICAgICAgICAgICAgIGluY2x1ZGVzID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIWluY2x1ZGVzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxu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ICAgICAgICAgICAgICAgISh2YWx1ZSBpbnN0YW5jZW9mIFN0cmluZykpIHtcblxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogcmV0dXJucyB0aGUgaW5kZXggb2YgdGhlIGdpdmVuIG9iamVjdCBpbiB0aGVcbiAgICAgICAgICogZ2l2ZW4gb2JqZWN0cyBhcnJheSwgLTEgaWYgbm90IGNvbnRhaW5lZFxuICAgICAgICAgKiBvbmx5IG5lZWRlZCBmb3IgY3ljbGljIGxvZ2ljXG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiBnZXRJbmRleChvYmplY3RzLCBvYmopIHtcblxuICAgICAgICAgICAgdmFyIGk7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgb2JqZWN0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmIChvYmplY3RzW2ldID09PSBvYmopIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBkb2VzIHRoZSByZWN1cnNpb24gZm9yIHRoZSBkZWVwIGVxdWFsIGNoZWNrXG4gICAgICAgIHJldHVybiAoZnVuY3Rpb24gZGVlcEVxdWFsKG9iajEsIG9iajIsIHBhdGgxLCBwYXRoMikge1xuICAgICAgICAgICAgdmFyIHR5cGUxID0gdHlwZW9mIG9iajE7XG4gICAgICAgICAgICB2YXIgdHlwZTIgPSB0eXBlb2Ygb2JqMjtcblxuICAgICAgICAgICAgLy8gPT0gbnVsbCBhbHNvIG1hdGNoZXMgdW5kZWZpbmVkXG4gICAgICAgICAgICBpZiAob2JqMSA9PT0gb2JqMiB8fFxuICAgICAgICAgICAgICAgICAgICBpc05hTihvYmoxKSB8fCBpc05hTihvYmoyKSB8fFxuICAgICAgICAgICAgICAgICAgICBvYmoxID09IG51bGwgfHwgb2JqMiA9PSBudWxsIHx8XG4gICAgICAgICAgICAgICAgICAgIHR5cGUxICE9PSBcIm9iamVjdFwiIHx8IHR5cGUyICE9PSBcIm9iamVjdFwiKSB7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gaWRlbnRpY2FsKG9iajEsIG9iajIpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBFbGVtZW50cyBhcmUgb25seSBlcXVhbCBpZiBpZGVudGljYWwoZXhwZWN0ZWQsIGFjdHVhbClcbiAgICAgICAgICAgIGlmIChpc0VsZW1lbnQob2JqMSkgfHwgaXNFbGVtZW50KG9iajIpKSB7IHJldHVybiBmYWxzZTsgfVxuXG4gICAgICAgICAgICB2YXIgaXNEYXRlMSA9IGlzRGF0ZShvYmoxKSwgaXNEYXRlMiA9IGlzRGF0ZShvYmoyKTtcbiAgICAgICAgICAgIGlmIChpc0RhdGUxIHx8IGlzRGF0ZTIpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWlzRGF0ZTEgfHwgIWlzRGF0ZTIgfHwgb2JqMS5nZXRUaW1lKCkgIT09IG9iajIuZ2V0VGltZSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChvYmoxIGluc3RhbmNlb2YgUmVnRXhwICYmIG9iajIgaW5zdGFuY2VvZiBSZWdFeHApIHtcbiAgICAgICAgICAgICAgICBpZiAob2JqMS50b1N0cmluZygpICE9PSBvYmoyLnRvU3RyaW5nKCkpIHsgcmV0dXJuIGZhbHNlOyB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBjbGFzczEgPSBnZXRDbGFzcyhvYmoxKTtcbiAgICAgICAgICAgIHZhciBjbGFzczIgPSBnZXRDbGFzcyhvYmoyKTtcbiAgICAgICAgICAgIHZhciBrZXlzMSA9IGtleXMob2JqMSk7XG4gICAgICAgICAgICB2YXIga2V5czIgPSBrZXlzKG9iajIpO1xuXG4gICAgICAgICAgICBpZiAoaXNBcmd1bWVudHMob2JqMSkgfHwgaXNBcmd1bWVudHMob2JqMikpIHtcbiAgICAgICAgICAgICAgICBpZiAob2JqMS5sZW5ndGggIT09IG9iajIubGVuZ3RoKSB7IHJldHVybiBmYWxzZTsgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZTEgIT09IHR5cGUyIHx8IGNsYXNzMSAhPT0gY2xhc3MyIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICBrZXlzMS5sZW5ndGggIT09IGtleXMyLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoaXNTZXQob2JqMSkgfHwgaXNTZXQob2JqMikpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWlzU2V0KG9iajEpIHx8ICFpc1NldChvYmoyKSB8fCBvYmoxLnNpemUgIT09IG9iajIuc2l6ZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzU3Vic2V0KG9iajEsIG9iajIsIGRlZXBFcXVhbCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBrZXksIGksIGwsXG4gICAgICAgICAgICAgICAgLy8gZm9sbG93aW5nIHZhcnMgYXJlIHVzZWQgZm9yIHRoZSBjeWNsaWMgbG9naWNcbiAgICAgICAgICAgICAgICB2YWx1ZTEsIHZhbHVlMixcbiAgICAgICAgICAgICAgICBpc09iamVjdDEsIGlzT2JqZWN0MixcbiAgICAgICAgICAgICAgICBpbmRleDEsIGluZGV4MixcbiAgICAgICAgICAgICAgICBuZXdQYXRoMSwgbmV3UGF0aDI7XG5cbiAgICAgICAgICAgIGZvciAoaSA9IDAsIGwgPSBrZXlzMS5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICAgICAgICAgICAgICBrZXkgPSBrZXlzMVtpXTtcbiAgICAgICAgICAgICAgICBpZiAoIW8uaGFzT3duUHJvcGVydHkuY2FsbChvYmoyLCBrZXkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBTdGFydCBvZiB0aGUgY3ljbGljIGxvZ2ljXG5cbiAgICAgICAgICAgICAgICB2YWx1ZTEgPSBvYmoxW2tleV07XG4gICAgICAgICAgICAgICAgdmFsdWUyID0gb2JqMltrZXldO1xuXG4gICAgICAgICAgICAgICAgaXNPYmplY3QxID0gaXNPYmplY3QodmFsdWUxKTtcbiAgICAgICAgICAgICAgICBpc09iamVjdDIgPSBpc09iamVjdCh2YWx1ZTIpO1xuXG4gICAgICAgICAgICAgICAgLy8gZGV0ZXJtaW5lLCBpZiB0aGUgb2JqZWN0cyB3ZXJlIGFscmVhZHkgdmlzaXRlZFxuICAgICAgICAgICAgICAgIC8vIChpdCdzIGZhc3RlciB0byBjaGVjayBmb3IgaXNPYmplY3QgZmlyc3QsIHRoYW4gdG9cbiAgICAgICAgICAgICAgICAvLyBnZXQgLTEgZnJvbSBnZXRJbmRleCBmb3Igbm9uIG9iamVjdHMpXG4gICAgICAgICAgICAgICAgaW5kZXgxID0gaXNPYmplY3QxID8gZ2V0SW5kZXgob2JqZWN0czEsIHZhbHVlMSkgOiAtMTtcbiAgICAgICAgICAgICAgICBpbmRleDIgPSBpc09iamVjdDIgPyBnZXRJbmRleChvYmplY3RzMiwgdmFsdWUyKSA6IC0xO1xuXG4gICAgICAgICAgICAgICAgLy8gZGV0ZXJtaW5lIHRoZSBuZXcgcGF0aGVzIG9mIHRoZSBvYmplY3RzXG4gICAgICAgICAgICAgICAgLy8gLSBmb3Igbm9uIGN5Y2xpYyBvYmplY3RzIHRoZSBjdXJyZW50IHBhdGggd2lsbCBiZSBleHRlbmRlZFxuICAgICAgICAgICAgICAgIC8vICAgYnkgY3VycmVudCBwcm9wZXJ0eSBuYW1lXG4gICAgICAgICAgICAgICAgLy8gLSBmb3IgY3ljbGljIG9iamVjdHMgdGhlIHN0b3JlZCBwYXRoIGlzIHRha2VuXG4gICAgICAgICAgICAgICAgbmV3UGF0aDEgPSBpbmRleDEgIT09IC0xXG4gICAgICAgICAgICAgICAgICAgID8gcGF0aHMxW2luZGV4MV1cbiAgICAgICAgICAgICAgICAgICAgOiBwYXRoMSArICdbJyArIEpTT04uc3RyaW5naWZ5KGtleSkgKyAnXSc7XG4gICAgICAgICAgICAgICAgbmV3UGF0aDIgPSBpbmRleDIgIT09IC0xXG4gICAgICAgICAgICAgICAgICAgID8gcGF0aHMyW2luZGV4Ml1cbiAgICAgICAgICAgICAgICAgICAgOiBwYXRoMiArICdbJyArIEpTT04uc3RyaW5naWZ5KGtleSkgKyAnXSc7XG5cbiAgICAgICAgICAgICAgICAvLyBzdG9wIHJlY3Vyc2lvbiBpZiBjdXJyZW50IG9iamVjdHMgYXJlIGFscmVhZHkgY29tcGFyZWRcbiAgICAgICAgICAgICAgICBpZiAoY29tcGFyZWRbbmV3UGF0aDEgKyBuZXdQYXRoMl0pIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gcmVtZW1iZXIgdGhlIGN1cnJlbnQgb2JqZWN0cyBhbmQgdGhlaXIgcGF0aGVzXG4gICAgICAgICAgICAgICAgaWYgKGluZGV4MSA9PT0gLTEgJiYgaXNPYmplY3QxKSB7XG4gICAgICAgICAgICAgICAgICAgIG9iamVjdHMxLnB1c2godmFsdWUxKTtcbiAgICAgICAgICAgICAgICAgICAgcGF0aHMxLnB1c2gobmV3UGF0aDEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaW5kZXgyID09PSAtMSAmJiBpc09iamVjdDIpIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqZWN0czIucHVzaCh2YWx1ZTIpO1xuICAgICAgICAgICAgICAgICAgICBwYXRoczIucHVzaChuZXdQYXRoMik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gcmVtZW1iZXIgdGhhdCB0aGUgY3VycmVudCBvYmplY3RzIGFyZSBhbHJlYWR5IGNvbXBhcmVkXG4gICAgICAgICAgICAgICAgaWYgKGlzT2JqZWN0MSAmJiBpc09iamVjdDIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tcGFyZWRbbmV3UGF0aDEgKyBuZXdQYXRoMl0gPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIEVuZCBvZiBjeWNsaWMgbG9naWNcblxuICAgICAgICAgICAgICAgIC8vIG5laXRoZXIgdmFsdWUxIG5vciB2YWx1ZTIgaXMgYSBjeWNsZVxuICAgICAgICAgICAgICAgIC8vIGNvbnRpbnVlIHdpdGggbmV4dCBsZXZlbFxuICAgICAgICAgICAgICAgIGlmICghZGVlcEVxdWFsKHZhbHVlMSwgdmFsdWUyLCBuZXdQYXRoMSwgbmV3UGF0aDIpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuXG4gICAgICAgIH0ob2JqMSwgb2JqMiwgJyQxJywgJyQyJykpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGFycmF5Q29udGFpbnMoYXJyYXksIHN1YnNldCwgY29tcGFyZSkge1xuICAgICAgICBpZiAoc3Vic2V0Lmxlbmd0aCA9PT0gMCkgeyByZXR1cm4gdHJ1ZTsgfVxuICAgICAgICB2YXIgaSwgbCwgaiwgaztcbiAgICAgICAgZm9yIChpID0gMCwgbCA9IGFycmF5Lmxlbmd0aDsgaSA8IGw7ICsraSkge1xuICAgICAgICAgICAgaWYgKGNvbXBhcmUoYXJyYXlbaV0sIHN1YnNldFswXSkpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGogPSAwLCBrID0gc3Vic2V0Lmxlbmd0aDsgaiA8IGs7ICsraikge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGkgKyBqKSA+PSBsKSB7IHJldHVybiBmYWxzZTsgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbXBhcmUoYXJyYXlbaSArIGpdLCBzdWJzZXRbal0pKSB7IHJldHVybiBmYWxzZTsgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQG5hbWUgc2Ftc2FtLm1hdGNoXG4gICAgICogQHBhcmFtIE9iamVjdCBvYmplY3RcbiAgICAgKiBAcGFyYW0gT2JqZWN0IG1hdGNoZXJcbiAgICAgKlxuICAgICAqIENvbXBhcmUgYXJiaXRyYXJ5IHZhbHVlIGBgb2JqZWN0YGAgd2l0aCBtYXRjaGVyLlxuICAgICAqL1xuICAgIGZ1bmN0aW9uIG1hdGNoKG9iamVjdCwgbWF0Y2hlcikge1xuICAgICAgICBpZiAobWF0Y2hlciAmJiB0eXBlb2YgbWF0Y2hlci50ZXN0ID09PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgICAgICAgIHJldHVybiBtYXRjaGVyLnRlc3Qob2JqZWN0KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlb2YgbWF0Y2hlciA9PT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICByZXR1cm4gbWF0Y2hlcihvYmplY3QpID09PSB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHR5cGVvZiBtYXRjaGVyID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICBtYXRjaGVyID0gbWF0Y2hlci50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgdmFyIG5vdE51bGwgPSB0eXBlb2Ygb2JqZWN0ID09PSBcInN0cmluZ1wiIHx8ICEhb2JqZWN0O1xuICAgICAgICAgICAgcmV0dXJuIG5vdE51bGwgJiZcbiAgICAgICAgICAgICAgICAoU3RyaW5nKG9iamVjdCkpLnRvTG93ZXJDYXNlKCkuaW5kZXhPZihtYXRjaGVyKSA+PSAwO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHR5cGVvZiBtYXRjaGVyID09PSBcIm51bWJlclwiKSB7XG4gICAgICAgICAgICByZXR1cm4gbWF0Y2hlciA9PT0gb2JqZWN0O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHR5cGVvZiBtYXRjaGVyID09PSBcImJvb2xlYW5cIikge1xuICAgICAgICAgICAgcmV0dXJuIG1hdGNoZXIgPT09IG9iamVjdDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlb2YobWF0Y2hlcikgPT09IFwidW5kZWZpbmVkXCIpIHtcbiAgICAgICAgICAgIHJldHVybiB0eXBlb2Yob2JqZWN0KSA9PT0gXCJ1bmRlZmluZWRcIjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChtYXRjaGVyID09PSBudWxsKSB7XG4gICAgICAgICAgICByZXR1cm4gb2JqZWN0ID09PSBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlzU2V0KG9iamVjdCkpIHtcbiAgICAgICAgICAgIHJldHVybiBpc1N1YnNldChtYXRjaGVyLCBvYmplY3QsIG1hdGNoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChnZXRDbGFzcyhvYmplY3QpID09PSBcIkFycmF5XCIgJiYgZ2V0Q2xhc3MobWF0Y2hlcikgPT09IFwiQXJyYXlcIikge1xuICAgICAgICAgICAgcmV0dXJuIGFycmF5Q29udGFpbnMob2JqZWN0LCBtYXRjaGVyLCBtYXRjaCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobWF0Y2hlciAmJiB0eXBlb2YgbWF0Y2hlciA9PT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgaWYgKG1hdGNoZXIgPT09IG9iamVjdCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHByb3A7XG4gICAgICAgICAgICBmb3IgKHByb3AgaW4gbWF0Y2hlcikge1xuICAgICAgICAgICAgICAgIHZhciB2YWx1ZSA9IG9iamVjdFtwcm9wXTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHZhbHVlID09PSBcInVuZGVmaW5lZFwiICYmXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlb2Ygb2JqZWN0LmdldEF0dHJpYnV0ZSA9PT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gb2JqZWN0LmdldEF0dHJpYnV0ZShwcm9wKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoZXJbcHJvcF0gPT09IG51bGwgfHwgdHlwZW9mIG1hdGNoZXJbcHJvcF0gPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAhPT0gbWF0Y2hlcltwcm9wXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgIHZhbHVlID09PSBcInVuZGVmaW5lZFwiIHx8ICFtYXRjaCh2YWx1ZSwgbWF0Y2hlcltwcm9wXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbH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YmIG1vZHVsZS5leHBvcnRzKSB7XG4gICAgbW9kdWxlLmV4cG9ydHMgPSBnbG9iYWw7XG4gIH1cblxuICBnbG9iYWxbXCJlbmNvZGluZy1pbmRleGVzXCJdID1cbntcbiAgXCJiaWc1XCI6W251bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsL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sLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxud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MCwyNzkyMSwyNzkyMywyNzkyNCwyNzkyNSwyNzkyNiwyNzkyOCwyNzkzMiwyNzkzMywyNzkzNSwyNzkzNiwyNzkzNywyNzkzOCwyNzkzOSwyNzk0MCwyNzk0MiwyNzk0NCwyNzk0NSwyNzk0OCwyNzk0OSwyNzk1MSwyNzk1MiwyNzk1NiwyNzk1OCwyNzk1OSwyNzk2MCwyNzk2MiwyNzk2NywyNzk2OCwyNzk3MCwyNzk3MiwyNzk3NywyNzk4MCwyNzk4NCwyNzk4OSwyNzk5MCwyNzk5MSwyNzk5MiwyNzk5NSwyNzk5NywyNzk5OSwyODAwMSwyODAwMiwyODAwNCwyODAwNSwyODAwNywyODAwOCwyODAxMSwyODAxMiwyODAxMywyODAxNiwyODAxNywyODAxOCwyODAxOSwyODAyMSwyODAyMiwyODAyNSwyODAyNiwyODAyNywyODAyOSwyODAzMCwyODAzMSwyODAzMiwyODAzMywyODAzNSwyODAzNiwyODAzOCwyODAzOSwyODA0MiwyODA0MywyODA0NSwyODA0NywyODA0OCwyODA1MCwyODA1NCwyODA1NSwyODA1NiwyODA1NywyODA1OCwyODA2MCwyODA2NiwyODA2OSwyODA3NiwyODA3NywyODA4MCwyODA4MSwyODA4MywyODA4NCwyODA4NiwyODA4NywyODA4OSwyODA5MCwyODA5MSwyODA5MiwyODA5MywyODA5NCwyODA5NywyODA5OCwyODA5OSwyODEwNCwyODEwNSwyODEwNiwyODEwOSwyODExMCwyODExMSwyODExMiwyODExNCwyODExNSwyODExNiwyODExNywyODExOSwyODEyMiwyODEyMywyODEyNCwyODEyNywyODEzMCwyODEzMSwyODEzMywyODEzNSwyODEzNiwyODEzNywyODEzOCwyODE0MSwyODE0MywyODE0NCwyODE0NiwyODE0OCwyODE0OSwyODE1MCwyODE1MiwyODE1NCwyODE1NywyODE1OCwyODE1OSwyODE2MCwyODE2MSwyODE2MiwyODE2MywyODE2NCwyODE2NiwyODE2NywyODE2OCwyODE2OSwyODE3MSwyODE3NSwyODE3OCwyODE3OSwyODE4MSwyODE4NCwyODE4NSwyODE4NywyODE4OCwyODE5MCwyODE5MSwyODE5NCwyODE5OCwyODE5OSwyODIwMCwyODIwMiwyODIwNCwyODIwNiwyODIwOCwyODIwOSwyODIxMSwyODIxMywyODIxNCwyODIxNSwyODIxNywyODIxOSwyODIyMCwyODIyMSwyODIyMiwyODIyMywyODIyNCwyODIyNSwyODIyNiwyODIyOSwyODIzMCwyODIzMSwyODIzMiwyODIzMywyODIzNCwyODIzNSwyODIzNiwyODIzOSwyODI0MCwyODI0MSwyODI0MiwyODI0NSwyODI0NywyODI0OSwyODI1MCwyODI1MiwyODI1MywyODI1NCwyODI1NiwyODI1NywyODI1OCwyODI1OSwyODI2MCwyODI2MSwyODI2MiwyODI2MywyODI2NCwyODI2NSwyODI2NiwyODI2OCwyODI2OSwyODI3MSwyODI3MiwyODI3MywyODI3NCwyODI3NSwyODI3NiwyODI3NywyODI3OCwyODI3OSwyODI4MCwyODI4MSwyODI4MiwyODI4MywyODI4NCwyODI4NSwyODI4OCwyODI4OSwyODI5MCwyODI5MiwyODI5NSwyODI5NiwyODI5OCwyODI5OSwyODMwMCwyODMwMSwyODMwMiwyODMwNSwyODMwNiwyODMwNywyODMwOCwyODMwOSwyODMxMCwyODMxMSwyODMxMywyODMxNCwyODMxNSwyODMxNywyODMxOCwyODMyMCwyODMyMSwyODMyMywyODMyNCwyODMyNiwyODMyOCwyODMyOSwyODMzMSwyODMzMiwyODMzMywyODMzNCwyODMzNiwyODMzOSwyODM0MSwyODM0NCwyODM0NSwyODM0OCwyODM1MCwyODM1MSwyODM1MiwyODM1NSwyODM1NiwyODM1NywyODM1OCwyODM2MCwyODM2MSwyODM2MiwyODM2NCwyODM2NSwyODM2NiwyODM2OCwyODM3MCwyODM3NCwyODM3NiwyODM3NywyODM3OSwyODM4MCwyODM4MSwyODM4NywyODM5MSwyODM5NCwyODM5NSwyODM5NiwyODM5NywyODM5OCwyODM5OSwyODQwMCwyODQwMSwyODQwMiwyODQwMywyODQwNSwyODQwNiwyODQwNywyODQwOCwyODQxMCwyODQxMSwyODQxMiwyODQxMywyODQxNCwyODQxNSwyODQxNiwyODQxNywyODQxOSwyODQyMCwyODQyMSwyODQyMywyODQyNCwyODQyNiwyODQyNywyODQyOCwyODQyOSwyODQzMCwyODQzMiwyODQzMywyODQzNCwyODQzOCwyODQzOSwyODQ0MCwyODQ0MSwyODQ0MiwyODQ0MywyODQ0NCwyODQ0NSwyODQ0NiwyODQ0NywyODQ0OSwyODQ1MCwyODQ1MSwyODQ1MywyODQ1NCwyODQ1NSwyODQ1NiwyODQ2MCwyODQ2MiwyODQ2NCwyODQ2NiwyODQ2OCwyODQ2OSwyODQ3MSwyODQ3MiwyODQ3MywyODQ3NCwyODQ3NSwyODQ3NiwyODQ3NywyODQ3OSwyODQ4MCwyODQ4MSwyODQ4MiwyODQ4MywyODQ4NCwyODQ4NSwyODQ4OCwyODQ4OSwyODQ5MCwyODQ5MiwyODQ5NCwyODQ5NSwyODQ5NiwyODQ5NywyODQ5OCwyODQ5OSwyODUwMCwyODUwMSwyODUwMiwyODUwMywyODUwNSwyODUwNiwyODUwNywyODUwOSwyODUxMSwyODUxMiwyODUxMywyODUxNSwyODUxNiwyODUxNywyODUxOSwyODUyMCwyODUyMSwyODUyMiwyODUyMywyODUyNCwyODUyNywyODUyOCwyODUyOSwyODUzMSwyODUzMywyODUzNCwyODUzNSwyODUzNywyODUzOSwyODU0MSwyODU0MiwyODU0MywyODU0NCwyODU0NSwyODU0NiwyODU0NywyODU0OSwyODU1MCwyODU1MSwyODU1NCwyODU1NSwyODU1OSwyODU2MCwyODU2MSwyODU2MiwyODU2MywyODU2NCwyODU2NSwyODU2NiwyODU2NywyODU2OCwyODU2OSwyODU3MCwyODU3MSwyODU3MywyODU3NCwyODU3NSwyODU3NiwyODU3OCwyODU3OSwyODU4MCwyODU4MSwyODU4MiwyODU4NCwyODU4NSwyODU4NiwyODU4NywyODU4OCwyODU4OSwyODU5MCwyODU5MSwyODU5MiwyODU5MywyODU5NCwyODU5NiwyODU5NywyODU5OSwyODYwMCwyODYwMiwyODYwMywyODYwNCwyODYwNSwyODYwNiwyODYwNywyODYwOSwyODYxMSwyODYxMiwyODYxMywyODYxNCwyODYxNSwyODYxNiwyODYxOCwyODYxOSwyODYyMCwyODYyMSwyODYyMiwyODYyMywyODYyNCwyODYyNywyODYyOCwyODYyOSwyODYzMCwyODYzMSwyODYzMiwyODYzMywyODYzNCwyODYzNSwyODYzNiwyODYzNywyODYzOSwyODY0MiwyODY0MywyODY0NCwyODY0NSwyODY0NiwyODY0NywyODY0OCwyODY0OSwyODY1MCwyODY1MSwyODY1MiwyODY1MywyODY1NiwyODY1NywyODY1OCwyODY1OSwyODY2MCwyODY2MSwyODY2MiwyODY2MywyODY2NCwyODY2NSwyODY2NiwyODY2NywyODY2OCwyODY2OSwyODY3MCwyODY3MSwyODY3MiwyODY3MywyODY3NCwyODY3NSwyODY3NiwyODY3NywyODY3OCwyODY3OSwyODY4MCwyODY4MSwyODY4MiwyODY4MywyODY4NCwyODY4NSwyODY4NiwyODY4NywyODY4OCwyODY5MCwyODY5MSwyODY5MiwyODY5MywyODY5NCwyODY5NSwyODY5NiwyODY5NywyODcwMCwyODcwMSwyODcwMiwyODcwMywyODcwNCwyODcwNSwyODcwNiwyODcwOCwyODcwOSwyODcxMCwyODcxMSwyODcxMiwyODcxMywyODcxNCwyODcxNSwyODcxNiwyODcxNywyODcxOCwyODcxOSwyODcyMCwyODcyMSwyODcyMiwyODcyMywyODcyNCwyODcyNiwyODcyNywyODcyOCwyODczMCwyODczMSwyODczMiwyODczMywyODczNCwyODczNSwyODczNiwyODczNywyODczOCwyODczOSwyODc0MCwyODc0MSwyODc0MiwyODc0MywyODc0NCwyODc0NSwyODc0NiwyODc0NywyODc0OSwyODc1MCwyODc1MiwyODc1MywyODc1NCwyODc1NSwyODc1NiwyODc1NywyODc1OCwyODc1OSwyODc2MCwyODc2MSwyODc2MiwyODc2MywyODc2NCwyODc2NSwyODc2NywyODc2OCwyODc2OSwyODc3MCwyODc3MSwyODc3MiwyODc3MywyODc3NCwyODc3NSwyODc3NiwyODc3NywyODc3OCwyODc4MiwyODc4NSwyODc4NiwyODc4NywyODc4OCwyODc5MSwyODc5MywyODc5NCwyODc5NSwyODc5NywyODgwMSwyODgwMiwyODgwMywyODgwNCwyODgwNiwyODgwNywyODgwOCwyODgxMSwyODgxMiwyODgxMywyODgxNSwyODgxNiwyODgxNywyODgxOSwyODgyMywyODgyNCwyODgyNiwyODgyNywyODgzMCwyODgzMSwyODgzMiwyODgzMywyODgzNCwyODgzNSwyODgzNiwyODgzNywyODgzOCwyODgzOSwyODg0MCwyODg0MSwyODg0MiwyODg0OCwyODg1MCwyODg1MiwyODg1MywyODg1NCwyODg1OCwyODg2MiwyODg2MywyODg2OCwyODg2OSwyODg3MCwyODg3MSwyODg3MywyODg3NSwyODg3NiwyODg3NywyODg3OCwyODg3OSwyODg4MCwyODg4MSwyODg4MiwyODg4MywyODg4NCwyODg4NSwyODg4NiwyODg4NywyODg5MCwyODg5MiwyODg5MywyODg5NCwyODg5NiwyODg5NywyODg5OCwyODg5OSwyODkwMSwyODkwNiwyODkxMCwyODkxMiwyODkxMywyODkxNCwyODkxNSwyODkxNiwyODkxNywyODkxOCwyODkyMCwyODkyMiwyODkyMywyODkyNCwyODkyNiwyODkyNywyODkyOCwyODkyOSwyODkzMCwyODkzMSwyODkzMiwyODkzMywyODkzNCwyODkzNSwyODkzNiwyODkzOSwyODk0MCwyODk0MSwyODk0MiwyODk0MywyODk0NSwyODk0NiwyODk0OCwyODk1MSwyODk1NSwyODk1NiwyODk1NywyODk1OCwyODk1OSwyODk2MCwyODk2MSwyODk2MiwyODk2MywyODk2NCwyODk2NSwyODk2NywyODk2OCwyODk2OSwyODk3MCwyODk3MSwyODk3MiwyODk3MywyODk3NCwyODk3OCwyODk3OSwyODk4MCwyODk4MSwyODk4MywyODk4NCwyODk4NSwyODk4NiwyODk4NywyODk4OCwyODk4OSw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bCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGws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bnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bG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yNzY2OCwyNzY3NSwyNzY4NCwyNzY4MywyNzc0MiwyNzczMywyNzc0NiwyNzc1NCwyNzc3OCwyNzc4OSwyNzgwMiwyNzc3NywyNzgwMywyNzc3NCwyNzc1MiwyNzc2MywyNzc5NCwyNzc5MiwyNzg0NCwyNzg4OSwyNzg1OSwyNzgzNywyNzg2MywyNzg0NSwyNzg2OSwyNzgyMiwyNzgyNSwyNzgzOCwyNzgzNCwyNzg2NywyNzg4NywyNzg2NSwyNzg4MiwyNzkzNSwzNDg5MywyNzk1OCwyNzk0NywyNzk2NSwyNzk2MCwyNzkyOSwyNzk1NywyNzk1NSwyNzkyMiwyNzkxNiwyODAwMywyODA1MSwyODAwNCwyNzk5NCwyODAyNSwyNzk5MywyODA0NiwyODA1MywyODY0NCwyODAzNywyODE1MywyODE4MSwyODE3MCwyODA4NSwyODEwMywyODEzNCwyODA4OCwyODEwMiwyODE0MCwyODEyNiwyODEwOCwyODEzNiwyODExNCwyODEwMSwyODE1NCwyODEyMSwyODEzMiwyODExNywyODEzOCwyODE0MiwyODIwNSwyODI3MCwyODIwNiwyODE4NSwyODI3NCwyODI1NSwyODIyMiwyODE5NSwyODI2NywyODIwMywyODI3OCwyODIzNywyODE5MSwyODIyNywyODIxOCwyODIzOCwyODE5NiwyODQxNSwyODE4OSwyODIxNiwyODI5MCwyODMzMCwyODMxMiwyODM2MSwyODM0MywyODM3MSwyODM0OSwyODMzNSwyODM1NiwyODMzOCwyODM3MiwyODM3MywyODMwMywyODMyNSwyODM1NCwyODMxOSwyODQ4MSwyODQzMywyODc0OCwyODM5NiwyODQwOCwyODQxNCwyODQ3OSwyODQwMiwyODQ2NSwyODM5OSwyODQ2NiwyODM2NCwyODQ3OCwyODQzNSwyODQwNywyODU1MCwyODUzOCwyODUzNiwyODU0NSwyODU0NCwyODUyNywyODUwNywyODY1OSwyODUyNSwyODU0NiwyODU0MCwyODUwNCwyODU1OCwyODU2MSwyODYxMCwyODUxOCwyODU5NSwyODU3OSwyODU3N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zODUwOCwzODU0MSwzODU1MiwzODU0OSwzODU1MSwzODU3MCwzODU2NywzODU3NywzODU3OCwzODU3NiwzODU4MCwzODU4MiwzODU4NCwzODU4NSwzODYwNiwzODYwMywzODYwMSwzODYwNSwzNTE0OSwzODYyMCwzODY2OSwzODYxMywzODY0OSwzODY2MCwzODY2MiwzODY2NCwzODY3NSwzODY3MCwzODY3MywzODY3MSwzODY3OCwzODY4MSwzODY5MiwzODY5OCwzODcwNCwzODcxMywzODcxNywzODcxOCwzODcyNCwzODcyNiwzODcyOCwzODcyMiwzODcyOSwzODc0OCwzODc1MiwzODc1NiwzODc1OCwzODc2MCwyMTIwMiwzODc2MywzODc2OSwzODc3NywzODc4OSwzODc4MCwzODc4NSwzODc3OCwzODc5MCwzODc5NSwzODc5OSwzODgwMCwzODgxMiwzODgyNCwzODgyMiwzODgxOSwzODgzNSwzODgzNiwzODg1MSwzODg1NCwzODg1NiwzODg1OSwzODg3NiwzODg5Myw0MDc4MywzODg5OCwzMTQ1NSwzODkwMiwzODkwMSwzODkyNywzODkyNCwzODk2OCwzODk0OCwzODk0NSwzODk2NywzODk3MywzODk4MiwzODk5MSwzODk4NywzOTAxOSwzOTAyMywzOTAyNCwzOTAyNSwzOTAyOCwzOTAyNywzOTA4MiwzOTA4NywzOTA4OSwzOTA5NCwzOTEwOCwzOTEwNywzOTExMCwzOTE0NSwzOTE0NywzOTE3MSwzOTE3NywzOTE4NiwzOTE4OCwzOTE5MiwzOTIwMSwzOTE5NywzOTE5OCwzOTIwNCwzOTIwMCwzOTIxMiwzOTIxNCwzOTIyOSwzOTIzMCwzOTIzNCwzOTI0MSwzOTIzNywzOTI0OCwzOTI0MywzOTI0OSwzOTI1MCwzOTI0NCwzOTI1MywzOTMxOSwzOTMyMCwzOTMzMywzOTM0MSwzOTM0MiwzOTM1NiwzOTM5MSwzOTM4NywzOTM4OSwzOTM4NCwzOTM3NywzOTQwNSwzOTQwNiwzOTQwOSwzOTQxMCwzOTQxOSwzOTQxN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VsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bG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udWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnV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GwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsXSxcbiAgXCJqaXMwMjEyXCI6W251bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxud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sLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCw5MDIsOTA0LDkwNSw5MDYsOTM4LG51bGwsOTA4LG51bGwsOTEwLDkzOSxudWxsLDkxMSxudWxsLG51bGwsbnVsbCxudWxsLDk0MCw5NDEsOTQyLDk0Myw5NzAsOTEyLDk3Miw5NjIsOTczLDk3MSw5NDQsOTc0LG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVs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xsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCx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c2NiwyNzc2OCwyNzc2OSwyNzc3MSwyNzc4MSwyNzc4MiwyNzc4MywyNzc4NSwyNzc5NiwyNzc5NywyNzc5OSwyNzgwMCwyNzgwNCwyNzgwNywyNzgyNCwyNzgyNiwyNzgyOCwyNzg0MiwyNzg0NiwyNzg1MywyNzg1NSwyNzg1NiwyNzg1NywyNzg1OCwyNzg2MCwyNzg2MiwyNzg2NiwyNzg2OCwyNzg3MiwyNzg3OSwyNzg4MSwyNzg4MywyNzg4NCwyNzg4NiwyNzg5MCwyNzg5MiwyNzkwOCwyNzkxMSwyNzkxNCwyNzkxOCwyNzkxOSwyNzkyMSwyNzkyMywyNzkzMCwyNzk0MiwyNzk0MywyNzk0NCwyNzc1MSwyNzk1MCwyNzk1MSwyNzk1MywyNzk2MSwyNzk2NCwyNzk2NywyNzk5MSwyNzk5OCwyNzk5OSwyODAwMSwyODAwNSwyODAwNywyODAxNSwyODAxNiwyODAyOCwyODAzNCwyODAzOSwyODA0OSwyODA1MCwyODA1MiwyODA1NCwyODA1NSwyODA1NiwyODA3NCwyODA3NiwyODA4NCwyODA4NywyODA4OSwyODA5MywyODA5NSwyODEwMCwyODEwNCwyODEwNiwyODExMCwyODExMSwyODExOCwyODEyMywyODEyNSwyODEyNywyODEyOCwyODEzMCwyODEzMywyODEzNywyODE0MywyODE0NCwyODE0OCwyODE1MCwyODE1NiwyODE2MCwyODE2NCwyODE5MCwyODE5NCwyODE5OSwyODIxMCwyODIxNCwyODIxNywyODIxOSwyODIyMCwyODIyOCwyODIyOSwyODIzMiwyODIzMywyODIzNSwyODIzOSwyODI0MSwyODI0MiwyODI0MywyODI0NCwyODI0NywyODI1MiwyODI1MywyODI1NCwyODI1OCwyODI1OSwyODI2NCwyODI3NSwyODI4MywyODI4NSwyODMwMSwyODMwNywyODMxMywyODMyMCwyODMyNywyODMzMywyODMzNCwyODMzNywyODMzOSwyODM0NywyODM1MSwyODM1MiwyODM1MywyODM1NSwyODM1OSwyODM2MCwyODM2MiwyODM2NSwyODM2NiwyODM2NywyODM5NSwyODM5NywyODM5OCwyODQwOSwyODQxMSwyODQxMywyODQyMCwyODQyNCwyODQyNiwyODQyOCwyODQyOSwyODQzOCwyODQ0MCwyODQ0MiwyODQ0MywyODQ1NCwyODQ1NywyODQ1OCwyODQ2MywyODQ2NCwyODQ2NywyODQ3MCwyODQ3NSwyODQ3NiwyODQ2MSwyODQ5NSwyODQ5NywyODQ5OCwyODQ5OSwyODUwMywyODUwNSwyODUwNiwyODUwOSwyODUxMCwyODUxMywyODUxNCwyODUyMCwyODUyNCwyODU0MSwyODU0MiwyODU0NywyODU1MSwyODU1MiwyODU1NSwyODU1NiwyODU1NywyODU2MCwyODU2MiwyODU2MywyODU2NCwyODU2NiwyODU3MCwyODU3NSwyODU3NiwyODU4MSwyODU4MiwyODU4MywyODU4NCwyODU5MCwyODU5MSwyODU5MiwyODU5NywyODU5OCwyODYwNCwyODYxMywyODYxNSwyODYxNiwyODYxOCwyODYzNCwyODYzOCwyODY0OCwyODY0OSwyODY1NiwyODY2MSwyODY2NSwyODY2OCwyODY2OSwyODY3MiwyODY3NywyODY3OCwyODY3OSwyODY4NSwyODY5NSwyODcwNCwyODcwNywyODcxOSwyODcyNCwyODcyNywyODcyOSwyODczMiwyODczOSwyODc0MCwyODc0NCwyODc0NSwyODc0NiwyODc0NywyODc1NiwyODc1NywyODc2NSwyODc2NiwyODc1MCwyODc3MiwyODc3MywyODc4MCwyODc4MiwyODc4OSwyODc5MCwyODc5OCwyODgwMSwyODgwNSwyODgwNiwyODgyMCwyODgyMSwyODgyMiwyODgyMywyODgyNCwyODgyNywyODgzNiwyODg0MywyODg0OCwyODg0OSwyODg1MiwyODg1NSwyODg3NCwyODg4MSwyODg4MywyODg4NCwyODg4NSwyODg4NiwyODg4OCwyODg5MiwyODkwMCwyODkyMiwyODkzMSwyODkzMiwyODkzMywyODkzNCwyODkzNSwyODkzOSwyODk0MCwyODk0MywyODk1OCwyODk2MCwyODk3MSwyODk3MywyODk3N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SwzNzkxOSwzNzkzNCwzNzkzNSwzNzkzNywzNzkzOCwzNzkzOSwzNzk0MCwzNzk0NywzNzk1MSwzNzk0OSwzNzk1NSwzNzk1NywzNzk2MCwzNzk2MiwzNzk2NCwzNzk3MywzNzk3NywzNzk4MCwzNzk4MywzNzk4NSwzNzk4NywzNzk5MiwzNzk5NSwzNzk5NywzNzk5OCwzNzk5OSwzODAwMSwzODAwMiwzODAyMCwzODAxOSwzODI2NCwzODI2NSwzODI3MCwzODI3NiwzODI4MCwzODI4NCwzODI4NSwzODI4NiwzODMwMSwzODMwMiwzODMwMywzODMwNSwzODMxMCwzODMxMywzODMxNSwzODMxNiwzODMyNCwzODMyNiwzODMzMCwzODMzMywzODMzNSwzODM0MiwzODM0NCwzODM0NSwzODM0NywzODM1MiwzODM1MywzODM1NCwzODM1NSwzODM2MSwzODM2MiwzODM2NSwzODM2NiwzODM2NywzODM2OCwzODM3MiwzODM3NCwzODQyOSwzODQzMCwzODQzNCwzODQzNiwzODQzNywzODQzOCwzODQ0NCwzODQ0OSwzODQ1MSwzODQ1NSwzODQ1NiwzODQ1NywzODQ1OCwzODQ2MCwzODQ2MSwzODQ2NSwzODQ4MiwzODQ4NCwzODQ4NiwzODQ4NywzODQ4OCwzODQ5NywzODUxMCwzODUxNiwzODUyMywzODUyNCwzODUyNiwzODUyNywzODUyOSwzODUzMCwzODUzMSwzODUzMiwzODUzNywzODU0NSwzODU1MCwzODU1NCwzODU1NywzODU1OSwzODU2NCwzODU2NSwzODU2NiwzODU2OSwzODU3NCwzODU3NSwzODU3OSwzODU4NiwzODYwMiwzODYxMCwyMzk4NiwzODYxNiwzODYxOCwzODYyMSwzODYyMiwzODYyMywzODYzMywzODYzOSwzODY0MSwzODY1MCwzODY1OCwzODY1OSwzODY2MSwzODY2NSwzODY4MiwzODY4MywzODY4NSwzODY4OSwzODY5MCwzODY5MSwzODY5NiwzODcwNSwzODcwNywzODcyMSwzODcyMywzODczMCwzODczNCwzODczNSwzODc0MSwzODc0MywzODc0NCwzODc0NiwzODc0NywzODc1NSwzODc1OSwzODc2MiwzODc2NiwzODc3MSwzODc3NCwzODc3NSwzODc3NiwzODc3OSwzODc4MSwzODc4MywzODc4NCwzODc5MywzODgwNSwzODgwNiwzODgwNywzODgwOSwzODgxMCwzODgxNCwzODgxNSwzODgxOCwzODgyOCwzODgzMCwzODgzMywzODgzNCwzODgzNywzODgzOCwzODg0MCwzODg0MSwzODg0MiwzODg0NCwzODg0NiwzODg0NywzODg0OSwzODg1MiwzODg1MywzODg1NSwzODg1NywzODg1OCwzODg2MCwzODg2MSwzODg2MiwzODg2NCwzODg2NSwzODg2OCwzODg3MSwzODg3MiwzODg3MywzODg3NywzODg3OCwzODg4MCwzODg3NSwzODg4MSwzODg4NCwzODg5NSwzODg5NywzODkwMCwzODkwMywzODkwNCwzODkwNiwzODkxOSwzODkyMiwzODkzNywzODkyNSwzODkyNiwzODkzMiwzODkzNCwzODk0MCwzODk0MiwzODk0NCwzODk0NywzODk1MCwzODk1NSwzODk1OCwzODk1OSwzODk2MCwzODk2MiwzODk2MywzODk2NSwzODk0OSwzODk3NCwzODk4MCwzODk4MywzODk4NiwzODk5MywzODk5NCwzODk5NSwzODk5OCwzODk5OSwzOTAwMSwzOTAwMiwzOTAxMCwzOTAxMSwzOTAxMywzOTAxNCwzOTAxOCwzOTAyMCwzOTA4MywzOTA4NSwzOTA4NiwzOTA4OCwzOTA5MiwzOTA5NSwzOTA5NiwzOTA5OCwzOTA5OSwzOTEwMywzOTEwNiwzOTEwOSwzOTExMiwzOTExNiwzOTEzNywzOTEzOSwzOTE0MSwzOTE0MiwzOTE0MywzOTE0NiwzOTE1NSwzOTE1OCwzOTE3MCwzOTE3NSwzOTE3NiwzOTE4NSwzOTE4OSwzOTE5MCwzOTE5MSwzOTE5NCwzOTE5NSwzOTE5NiwzOTE5OSwzOTIwMiwzOTIwNiwzOTIwNywzOTIxMSwzOTIxNywzOTIxOCwzOTIxOSwzOTIyMCwzOTIyMSwzO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nVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsLG51bGwsb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YiBiZSBkICYgMHgzRkYuXG4gICAgICAgICAgICB2YXIgYiA9IGQgJiAweDNGRjtcblxuICAgICAgICAgICAgLy8gMy4gQXBwZW5kIHRvIFUgdGhlIFVuaWNvZGUgY2hhcmFjdGVyIHdpdGggY29kZSBwb2ludFxuICAgICAgICAgICAgLy8gMl4xNisyXjEwKmErYi5cbiAgICAgICAgICAgIHUucHVzaCgweDEwMDAwICsgKGEgPDwgMTApICsgYik7XG5cbiAgICAgICAgICAgIC8vIDQuIFNldCBpIHRvIGkrMS5cbiAgICAgICAgICAgIGkgKz0gMTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvLyAzLiBPdGhlcndpc2UsIGQgPCAweERDMDAgb3IgZCA+IDB4REZGRi4gQXBwZW5kIHRvIFUgYVxuICAgICAgICAgIC8vIFUrRkZGRCBSRVBMQUNFTUVOVCBDSEFSQUNURVIuXG4gICAgICAgICAgZWxzZSAge1xuICAgICAgICAgICAgdS5wdXNoKDB4RkZGRCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIC8vIDMuIFNldCBpIHRvIGkrMS5cbiAgICAgIGkgKz0gMTtcbiAgICB9XG5cbiAgICAvLyA2LiBSZXR1cm4gVS5cbiAgICByZXR1cm4gdTtcbiAgfVxuXG4gIC8qKlxuICAgKiBAcGFyYW0geyFBcnJheS48bnVtYmVyPn0gY29kZV9wb2ludHMgQXJyYXkgb2YgY29kZSBwb2ludHMuXG4gICAqIEByZXR1cm4ge3N0cmluZ30gc3RyaW5nIFN0cmluZyBvZiBVVEYtMTYgY29kZSB1bml0cy5cbiAgICovXG4gIGZ1bmN0aW9uIGNvZGVQb2ludHNUb1N0cmluZyhjb2RlX3BvaW50cykge1xuICAgIHZhciBzID0gJyc7XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb2RlX3BvaW50cy5sZW5ndGg7ICsraSkge1xuICAgICAgdmFyIGNwID0gY29kZV9wb2ludHNbaV07XG4gICAgICBpZ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sYWJlbHNcIjogW1xuICAgICAgICAgICAgXCJ1bmljb2RlLTEtMS11dGYtOFwiLFxuICAgICAgICAgICAgXCJ1dGYtOFwiLFxuICAgICAgICAgICAgXCJ1dGY4XCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcIlVURi04XCJcbiAgICAgICAgfVxuICAgICAgXSxcbiAgICAgIFwiaGVhZGluZ1wiOiBcIlRoZSBFbmNvZGluZ1wiXG4gICAgfSxcbiAgICB7XG4gICAgICBcImVuY29kaW5nc1wiOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcIjg2NlwiLFxuICAgICAgICAgICAgXCJjcDg2NlwiLFxuICAgICAgICAgICAgXCJjc2libTg2NlwiLFxuICAgICAgICAgICAgXCJpYm04NjZcIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwiSUJNODY2XCJcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwiY3Npc29sYXRpbjJcIixcbiAgICAgICAgICAgIFwiaXNvLTg4NTktMlwiLFxuICAgICAgICAgICAgXCJpc28taXItMTAxXCIsXG4gICAgICAgICAgICBcImlzbzg4NTktMlwiLFxuICAgICAgICAgICAgXCJpc284ODU5MlwiLFxuICAgICAgICAgICAgXCJpc29fODg1OS0yXCIsXG4gICAgICAgICAgICBcImlzb184ODU5LTI6MTk4N1wiLFxuICAgICAgICAgICAgXCJsMlwiLFxuICAgICAgICAgICAgXCJsYXRpbjJcIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwiSVNPLTg4NTktMlwiXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcImNzaXNvbGF0aW4zXCIsXG4gICAgICAgICAgICBcImlzby04ODU5LTNcIixcbiAgICAgICAgICAgIFwiaXNvLWlyLTEwOVwiLFxuICAgICAgICAgICAgXCJpc284ODU5LTNcIixcbiAgICAgICAgICAgIFwiaXNvODg1OTNcIixcbiAgICAgICAgICAgIFwiaXNvXzg4NTktM1wiLFxuICAgICAgICAgICAgXCJpc29fODg1OS0zOjE5ODhcIixcbiAgICAgICAgICAgIFwibDNcIixcbiAgICAgICAgICAgIFwibGF0aW4zXCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcIklTTy04ODU5LTNcIlxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgXCJsYWJlbHNcIjogW1xuICAgICAgICAgICAgXCJjc2lzb2xhdGluNFwiLFxuICAgICAgICAgICAgXCJpc28tODg1OS00XCIsXG4gICAgICAgICAgICBcImlzby1pci0xMTBcIixcbiAgICAgICAgICAgIFwiaXNvODg1OS00XCIsXG4gICAgICAgICAgICBcImlzbzg4NTk0XCIsXG4gICAgICAgICAgICBcImlzb184ODU5LTRcIixcbiAgICAgICAgICAgIFwiaXNvXzg4NTktNDoxOTg4XCIsXG4gICAgICAgICAgICBcImw0XCIsXG4gICAgICAgICAgICBcImxhdGluNFwiXG4gICAgICAgICAgXSxcbiAgICAgICAgICBcIm5hbWVcIjogXCJJU08tODg1OS00XCJcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwiY3Npc29sYXRpbmN5cmlsbGljXCIsXG4gICAgICAgICAgICBcImN5cmlsbGljXCIsXG4gICAgICAgICAgICBcImlzby04ODU5LTVcIixcbiAgICAgICAgICAgIFwiaXNvLWlyLTE0NFwiLFxuICAgICAgICAgICAgXCJpc284ODU5LTVcIixcbiAgICAgICAgICAgIFwiaXNvODg1OTVcIixcbiAgICAgICAgICAgIFwiaXNvXzg4NTktNVwiLFxuICAgICAgICAgICAgXCJpc29fODg1OS01OjE5ODhcIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwiSVNPLTg4NTktNVwiXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcImFyYWJpY1wiLFxuICAgICAgICAgICAgXCJhc21vLTcwOFwiLFxuICAgICAgICAgICAgXCJjc2lzbzg4NTk2ZVwiLFxuICAgICAgICAgICAgXCJjc2lzbzg4NTk2aVwiLFxuICAgICAgICAgICAgXCJjc2lzb2xhdGluYXJhYmljXCIsXG4gICAgICAgICAgICBcImVjbWEtMTE0XCIsXG4gICAgICAgICAgICBcImlzby04ODU5LTZcIixcbiAgICAgICAgICAgIFwiaXNvLTg4NTktNi1lXCIsXG4gICAgICAgICAgICBcImlzby04ODU5LTYtaVwiLFxuICAgICAgICAgICAgXCJpc28taXItMTI3XCIsXG4gICAgICAgICAgICBcImlzbzg4NTktNlwiLFxuICAgICAgICAgICAgXCJpc284ODU5NlwiLFxuICAgICAgICAgICAgXCJpc29fODg1OS02XCIsXG4gICAgICAgICAgICBcImlzb184ODU5LTY6MTk4N1wiXG4gICAgICAgICAgXSxcbiAgICAgICAgICBcIm5hbWVcIjogXCJJU08tODg1OS02XCJcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwiY3Npc29sYXRpbmdyZWVrXCIsXG4gICAgICAgICAgICBcImVjbWEtMTE4XCIsXG4gICAgICAgICAgICBcImVsb3RfOTI4XCIsXG4gICAgICAgICAgICBcImdyZWVrXCIsXG4gICAgICAgICAgICBcImdyZWVrOFwiLFxuICAgICAgICAgICAgXCJpc28tODg1OS03XCIsXG4gICAgICAgICAgICBcImlzby1pci0xMjZcIixcbiAgICAgICAgICAgIFwiaXNvODg1OS03XCIsXG4gICAgICAgICAgICBcImlzbzg4NTk3XCIsXG4gICAgICAgICAgICBcImlzb184ODU5LTdcIixcbiAgICAgICAgICAgIFwiaXNvXzg4NTktNzoxOTg3XCIsXG4gICAgICAgICAgICBcInN1bl9ldV9ncmVla1wiXG4gICAgICAgICAgXSxcbiAgICAgICAgICBcIm5hbWVcIjogXCJJU08tODg1OS03XCJcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwiY3Npc284ODU5OGVcIixcbiAgICAgICAgICAgIFwiY3Npc29sYXRpbmhlYnJld1wiLFxuICAgICAgICAgICAgXCJoZWJyZXdcIixcbiAgICAgICAgICAgIFwiaXNvLTg4NTktOFwiLFxuICAgICAgICAgICAgXCJpc28tODg1OS04LWVcIixcbiAgICAgICAgICAgIFwiaXNvLWlyLTEzOFwiLFxuICAgICAgICAgICAgXCJpc284ODU5LThcIixcbiAgICAgICAgICAgIFwiaXNvODg1OThcIixcbiAgICAgICAgICAgIFwiaXNvXzg4NTktOFwiLFxuICAgICAgICAgICAgXCJpc29fODg1OS04OjE5ODhcIixcbiAgICAgICAgICAgIFwidmlzdWFsXCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcIklTTy04ODU5LThcIlxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgXCJsYWJlbHNcIjogW1xuICAgICAgICAgICAgXCJjc2lzbzg4NTk4aVwiLFxuICAgICAgICAgICAgXCJpc28tODg1OS04LWlcIixcbiAgICAgICAgICAgIFwibG9naWNhbFwiXG4gICAgICAgICAgXSxcbiAgICAgICAgICBcIm5hbWVcIjogXCJJU08tODg1OS04LUlcIlxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgXCJsYWJlbHNcIjogW1xuICAgICAgICAgICAgXCJjc2lzb2xhdGluNlwiLFxuICAgICAgICAgICAgXCJpc28tODg1OS0xMFwiLFxuICAgICAgICAgICAgXCJpc28taXItMTU3XCIsXG4gICAgICAgICAgICBcImlzbzg4NTktMTBcIixcbiAgICAgICAgICAgIFwiaXNvODg1OTEwXCIsXG4gICAgICAgICAgICBcImw2XCIsXG4gICAgICAgICAgICBcImxhdGluNlwiXG4gICAgICAgICAgXSxcbiAgICAgICAgICBcIm5hbWVcIjogXCJJU08tODg1OS0xMFwiXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcImlzby04ODU5LTEzXCIsXG4gICAgICAgICAgICBcImlzbzg4NTktMTNcIixcbiAgICAgICAgICAgIFwiaXNvODg1OTEzXCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcIklTTy04ODU5LTEzXCJcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwiaXNvLTg4NTktMTRcIixcbiAgICAgICAgICAgIFwiaXNvODg1OS0xNFwiLFxuICAgICAgICAgICAgXCJpc284ODU5MTRcIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwiSVNPLTg4NTktMTRcIlxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgXCJsYWJlbHNcIjogW1xuICAgICAgICAgICAgXCJjc2lzb2xhdGluOVwiLFxuICAgICAgICAgICAgXCJpc28tODg1OS0xNVwiLFxuICAgICAgICAgICAgXCJpc284ODU5LTE1XCIsXG4gICAgICAgICAgICBcImlzbzg4NTkxNVwiLFxuICAgICAgICAgICAgXCJpc29fODg1OS0xNVwiLFxuICAgICAgICAgICAgXCJsOVwiXG4gICAgICAgICAgXSxcbiAgICAgICAgICBcIm5hbWVcIjogXCJJU08tODg1OS0xNVwiXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcImlzby04ODU5LTE2XCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcIklTTy04ODU5LTE2XCJcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwiY3Nrb2k4clwiLFxuICAgICAgICAgICAgXCJrb2lcIixcbiAgICAgICAgICAgIFwia29pOFwiLFxuICAgICAgICAgICAgXCJrb2k4LXJcIixcbiAgICAgICAgICAgIFwia29pOF9yXCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcIktPSTgtUlwiXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcImtvaTgtcnVcIixcbiAgICAgICAgICAgIFwia29pOC11XCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcIktPSTgtVVwiXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcImNzbWFjaW50b3NoXCIsXG4gICAgICAgICAgICBcIm1hY1wiLFxuICAgICAgICAgICAgXCJtYWNpbnRvc2hcIixcbiAgICAgICAgICAgIFwieC1tYWMtcm9tYW5cIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwibWFjaW50b3NoXCJcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwiZG9zLTg3NFwiLFxuICAgICAgICAgICAgXCJpc28tODg1OS0xMVwiLFxuICAgICAgICAgICAgXCJpc284ODU5LTExXCIsXG4gICAgICAgICAgICBcImlzbzg4NTkxMVwiLFxuICAgICAgICAgICAgXCJ0aXMtNjIwXCIsXG4gICAgICAgICAgICBcIndpbmRvd3MtODc0XCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcIndpbmRvd3MtODc0XCJcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwiY3AxMjUwXCIsXG4gICAgICAgICAgICBcIndpbmRvd3MtMTI1MFwiLFxuICAgICAgICAgICAgXCJ4LWNwMTI1MFwiXG4gICAgICAgICAgXSxcbiAgICAgICAgICBcIm5hbWVcIjogXCJ3aW5kb3dzLTEyNTBcIlxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgXCJsYWJlbHNcIjogW1xuICAgICAgICAgICAgXCJjcDEyNTFcIixcbiAgICAgICAgICAgIFwid2luZG93cy0xMjUxXCIsXG4gICAgICAgICAgICBcIngtY3AxMjUxXCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcIndpbmRvd3MtMTI1MVwiXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcImFuc2lfeDMuNC0xOTY4XCIsXG4gICAgICAgICAgICBcImFzY2lpXCIsXG4gICAgICAgICAgICBcImNwMTI1MlwiLFxuICAgICAgICAgICAgXCJjcDgxOVwiLFxuICAgICAgICAgICAgXCJjc2lzb2xhdGluMVwiLFxuICAgICAgICAgICAgXCJpYm04MTlcIixcbiAgICAgICAgICAgIFwiaXNvLTg4NTktMVwiLFxuICAgICAgICAgICAgXCJpc28taXItMTAwXCIsXG4gICAgICAgICAgICBcImlzbzg4NTktMVwiLFxuICAgICAgICAgICAgXCJpc284ODU5MVwiLFxuICAgICAgICAgICAgXCJpc29fODg1OS0xXCIsXG4gICAgICAgICAgICBcImlzb184ODU5LTE6MTk4N1wiLFxuICAgICAgICAgICAgXCJsMVwiLFxuICAgICAgICAgICAgXCJsYXRpbjFcIixcbiAgICAgICAgICAgIFwidXMtYXNjaWlcIixcbiAgICAgICAgICAgIFwid2luZG93cy0xMjUyXCIsXG4gICAgICAgICAgICBcIngtY3AxMjUyXCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcIndpbmRvd3MtMTI1MlwiXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcImNwMTI1M1wiLFxuICAgICAgICAgICAgXCJ3aW5kb3dzLTEyNTNcIixcbiAgICAgICAgICAgIFwieC1jcDEyNTNcIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwid2luZG93cy0xMjUzXCJcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwiY3AxMjU0XCIsXG4gICAgICAgICAgICBcImNzaXNvbGF0aW41XCIsXG4gICAgICAgICAgICBcImlzby04ODU5LTlcIixcbiAgICAgICAgICAgIFwiaXNvLWlyLTE0OFwiLFxuICAgICAgICAgICAgXCJpc284ODU5LTlcIixcbiAgICAgICAgICAgIFwiaXNvODg1OTlcIixcbiAgICAgICAgICAgIFwiaXNvXzg4NTktOVwiLFxuICAgICAgICAgICAgXCJpc29fODg1OS05OjE5ODlcIixcbiAgICAgICAgICAgIFwibDVcIixcbiAgICAgICAgICAgIFwibGF0aW41XCIsXG4gICAgICAgICAgICBcIndpbmRvd3MtMTI1NFwiLFxuICAgICAgICAgICAgXCJ4LWNwMTI1NFwiXG4gICAgICAgICAgXSxcbiAgICAgICAgICBcIm5hbWVcIjogXCJ3aW5kb3dzLTEyNTRcIlxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgXCJsYWJlbHNcIjogW1xuICAgICAgICAgICAgXCJjcDEyNTVcIixcbiAgICAgICAgICAgIFwid2luZG93cy0xMjU1XCIsXG4gICAgICAgICAgICBcIngtY3AxMjU1XCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcIndpbmRvd3MtMTI1NVwiXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcImNwMTI1NlwiLFxuICAgICAgICAgICAgXCJ3aW5kb3dzLTEyNTZcIixcbiAgICAgICAgICAgIFwieC1jcDEyNTZcIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwid2luZG93cy0xMjU2XCJcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwiY3AxMjU3XCIsXG4gICAgICAgICAgICBcIndpbmRvd3MtMTI1N1wiLFxuICAgICAgICAgICAgXCJ4LWNwMTI1N1wiXG4gICAgICAgICAgXSxcbiAgICAgICAgICBcIm5hbWVcIjogXCJ3aW5kb3dzLTEyNTdcIlxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgXCJsYWJlbHNcIjogW1xuICAgICAgICAgICAgXCJjcDEyNThcIixcbiAgICAgICAgICAgIFwid2luZG93cy0xMjU4XCIsXG4gICAgICAgICAgICBcIngtY3AxMjU4XCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcIndpbmRvd3MtMTI1OFwiXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcIngtbWFjLWN5cmlsbGljXCIsXG4gICAgICAgICAgICBcIngtbWFjLXVrcmFpbmlhblwiXG4gICAgICAgICAgXSxcbiAgICAgICAgICBcIm5hbWVcIjogXCJ4LW1hYy1jeXJpbGxpY1wiXG4gICAgICAgIH1cbiAgICAgIF0sXG4gICAgICBcImhlYWRpbmdcIjogXCJMZWdhY3kgc2luZ2xlLWJ5dGUgZW5jb2RpbmdzXCJcbiAgICB9LFxuICAgIHtcbiAgICAgIFwiZW5jb2RpbmdzXCI6IFtcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwiY2hpbmVzZVwiLFxuICAgICAgICAgICAgXCJjc2diMjMxMlwiLFxuICAgICAgICAgICAgXCJjc2lzbzU4Z2IyMzEyODBcIixcbiAgICAgICAgICAgIFwiZ2IyMzEyXCIsXG4gICAgICAgICAgICBcImdiXzIzMTJcIixcbiAgICAgICAgICAgIFwiZ2JfMjMxMi04MFwiLFxuICAgICAgICAgICAgXCJnYmtcIixcbiAgICAgICAgICAgIFwiaXNvLWlyLTU4XCIsXG4gICAgICAgICAgICBcIngtZ2JrXCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcIkdCS1wiXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcImdiMTgwMzBcIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwiZ2IxODAzMFwiXG4gICAgICAgIH1cbiAgICAgIF0sXG4gICAgICBcImhlYWRpbmdcIjogXCJMZWdhY3kgbXVsdGktYnl0ZSBDaGluZXNlIChzaW1wbGlmaWVkKSBlbmNvZGluZ3NcIlxuICAgIH0sXG4gICAge1xuICAgICAgXCJlbmNvZGluZ3NcIjogW1xuICAgICAgICB7XG4gICAgICAgICAgXCJsYWJlbHNcIjogW1xuICAgICAgICAgICAgXCJiaWc1XCIsXG4gICAgICAgICAgICBcImJpZzUtaGtzY3NcIixcbiAgICAgICAgICAgIFwiY24tYmlnNVwiLFxuICAgICAgICAgICAgXCJjc2JpZzVcIixcbiAgICAgICAgICAgIFwieC14LWJpZzVcIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwiQmlnNVwiXG4gICAgICAgIH1cbiAgICAgIF0sXG4gICAgICBcImhlYWRpbmdcIjogXCJMZWdhY3kgbXVsdGktYnl0ZSBDaGluZXNlICh0cmFkaXRpb25hbCkgZW5jb2RpbmdzXCJcbiAgICB9LFxuICAgIHtcbiAgICAgIFwiZW5jb2RpbmdzXCI6IFtcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwiY3NldWNwa2RmbXRqYXBhbmVzZVwiLFxuICAgICAgICAgICAgXCJldWMtanBcIixcbiAgICAgICAgICAgIFwieC1ldWMtanBcIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwiRVVDLUpQXCJcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwiY3Npc28yMDIyanBcIixcbiAgICAgICAgICAgIFwiaXNvLTIwMjItanBcIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwiSVNPLTIwMjItSlBcIlxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgXCJsYWJlbHNcIjogW1xuICAgICAgICAgICAgXCJjc3NoaWZ0amlzXCIsXG4gICAgICAgICAgICBcIm1zOTMyXCIsXG4gICAgICAgICAgICBcIm1zX2thbmppXCIsXG4gICAgICAgICAgICBcInNoaWZ0LWppc1wiLFxuICAgICAgICAgICAgXCJzaGlmdF9qaXNcIixcbiAgICAgICAgICAgIFwic2ppc1wiLFxuICAgICAgICAgICAgXCJ3aW5kb3dzLTMxalwiLFxuICAgICAgICAgICAgXCJ4LXNqaXNcIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwiU2hpZnRfSklTXCJcbiAgICAgICAgfVxuICAgICAgXSxcbiAgICAgIFwiaGVhZGluZ1wiOiBcIkxlZ2FjeSBtdWx0aS1ieXRlIEphcGFuZXNlIGVuY29kaW5nc1wiXG4gICAgfSxcbiAgICB7XG4gICAgICBcImVuY29kaW5nc1wiOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcImNzZXVja3JcIixcbiAgICAgICAgICAgIFwiY3Nrc2M1NjAxMTk4N1wiLFxuICAgICAgICAgICAgXCJldWMta3JcIixcbiAgICAgICAgICAgIFwiaXNvLWlyLTE0OVwiLFxuICAgICAgICAgICAgXCJrb3JlYW5cIixcbiAgICAgICAgICAgIFwia3NfY181NjAxLTE5ODdcIixcbiAgICAgICAgICAgIFwia3NfY181NjAxLTE5ODlcIixcbiAgICAgICAgICAgIFwia3NjNTYwMVwiLFxuICAgICAgICAgICAgXCJrc2NfNTYwMVwiLFxuICAgICAgICAgICAgXCJ3aW5kb3dzLTk0OVwiXG4gICAgICAgICAgXSxcbiAgICAgICAgICBcIm5hbWVcIjogXCJFVUMtS1JcIlxuICAgICAgICB9XG4gICAgICBdLFxuICAgICAgXCJoZWFkaW5nXCI6IFwiTGVnYWN5IG11bHRpLWJ5dGUgS29yZWFuIGVuY29kaW5nc1wiXG4gICAgfSxcbiAgICB7XG4gICAgICBcImVuY29kaW5nc1wiOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBcImxhYmVsc1wiOiBbXG4gICAgICAgICAgICBcImNzaXNvMjAyMmtyXCIsXG4gICAgICAgICAgICBcImh6LWdiLTIzMTJcIixcbiAgICAgICAgICAgIFwiaXNvLTIwMjItY25cIixcbiAgICAgICAgICAgIFwiaXNvLTIwMjItY24tZXh0XCIsXG4gICAgICAgICAgICBcImlzby0yMDIyLWtyXCJcbiAgICAgICAgICBdLFxuICAgICAgICAgIFwibmFtZVwiOiBcInJlcGxhY2VtZW50XCJcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIFwibGFiZWxzXCI6IFtcbiAgICAgICAgICAgIFwidXRmLTE2YmVcIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwiVVRGLTE2QkVcIlxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgXCJsYWJlbHNcIjogW1xuICAgICAgICAgICAgXCJ1dGYtMTZcIixcbiAgICAgICAgICAgIFwidXRmLTE2bGVcIlxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJuYW1lXCI6IFwiVVRGLTE2TEVcIlxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgXCJsYWJlbHNcIjogW1xuICAgICAgICAgICAgXCJ4LXVzZXItZGVmaW5lZFwiXG4gICAgICAgICAgXSxcbiAgICAgICAgICBcIm5hbWVcIjogXCJ4LXVzZXItZGVmaW5lZFwiXG4gICAgICAgI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XZpb3IuXG4gICAgICBsYWJlbCA9IGxhYmVsICE9PSB1bmRlZmluZWQgPyBTdHJpbmcobGFiZWwpIDogREVGQVVMVF9FTkNPRElORztcbiAgICAgIHZhciBlbmNvZGluZyA9IGdldEVuY29kaW5nKGxhYmVsKTtcbiAgICAgIGlmIChlbmNvZGluZyA9PT0gbnVsbCB8fCBlbmNvZGluZy5uYW1lID09PSAncmVwbGFjZW1lbnQnKVxuICAgICAgICB0aHJvdyBSYW5nZUVycm9yKCdVbmtub3duIGVuY29kaW5nOiAnICsgbGFiZWwpO1xuICAgICAgaWYgKCFlbmNvZGVyc1tlbmNvZGluZy5uYW1lXSkge1xuICAgICAgICB0aHJvdyBFcnJvcignRW5jb2RlciBub3QgcHJlc2VudC4nICtcbiAgICAgICAgICAgICAgICAgICAgJyBEaWQgeW91IGZvcmdldCB0byBpbmNsdWRlIGVuY29kaW5nLWluZGV4ZXMuanMgZmlyc3Q/Jyk7XG4gICAgICB9XG4gICAgICBlbmMuX2VuY29kaW5nID0gZW5jb2Rpbmc7XG4gICAgfSBlbHNlIHtcbiAgICAgIC8vIFN0YW5kYXJkIGJlaGF2aW9yLlxuICAgICAgZW5jLl9lbmNvZGluZyA9IGdldEVuY29kaW5nKCd1dGYtOCcpO1xuXG4gICAgICBpZiAobGFiZWwgIT09IHVuZGVmaW5lZCAmJiAnY29uc29sZScgaW4gZ2xvYmFsKSB7XG4gICAgICAgIGNvbnNvbGUud2FybignVGV4dEVuY29kZXIgY29uc3RydWN0b3IgY2FsbGVkIHdpdGggZW5jb2RpbmcgbGFiZWwsICdcbiAgICAgICAgICAgICAgICAgICAgICsgJ3doaWNoIGlzIGlnbm9yZWQuJyk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgLy8gRm9yIHByZS1FUzUgcnVudGltZXM6XG4gICAgaWYgKCFPYmplY3QuZGVmaW5lUHJvcGVydHkpXG4gICAgICB0aGlzLmVuY29kaW5nID0gZW5jLl9lbmNvZGluZy5uYW1lLnRvTG93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mlzaGVkLlxuICAgICAgICAgIHJldHVybiBmaW5pc2hlZDtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIE90aGVyd2lzZVxuICAgICAgICAvLyBVbnNldCB0aGUgaXNvLTIwMjItanAgb3V0cHV0IGZsYWcgYW5kIHJldHVybiBlcnJvci5cbiAgICAgICAgaXNvMjAyMmpwX291dHB1dF9mbGFnID0gZmFsc2U7XG4gICAgICAgIHJldHVybiBkZWNvZGVyRXJyb3IoZmF0YWwpO1xuXG4gICAgICBjYXNlIHN0YXRlcy5Sb21hbjpcbiAgICAgICAgLy8gUm9tYW5cbiAgICAgICAgLy8gQmFzZWQgb24gYnl0ZTpcblxuICAgICAgICAvLyAweDFCXG4gICAgICAgIGlmIChiaXRlID09PSAweDFCKSB7XG4gICAgICAgICAgLy8gU2V0IGlzby0yMDIyLWpwIGRlY29kZXIgc3RhdGUgdG8gZXNjYXBlIHN0YXJ0IGFuZCByZXR1cm5cbiAgICAgICAgICAvLyBjb250aW51ZS5cbiAgICAgICAgICBpc28yMDIyanBfZGVjb2Rlcl9zdGF0ZSA9IHN0YXRlcy5Fc2NhcGVTdGFydDtcbiAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIDB4NUNcbiAgICAgICAgaWYgKGJpdGUgPT09IDB4NUMpIHtcbiAgICAgICAgICAvLyBVbnNldCB0aGUgaXNvLTIwMjItanAgb3V0cHV0IGZsYWcgYW5kIHJldHVybiBjb2RlIHBvaW50XG4gICAgICAgICAgLy8gVSswMEE1LlxuICAgICAgICAgIGlzbzIwMjJqcF9vdXRwdXRfZmxhZyA9IGZhbHNlO1xuICAgICAgICAgIHJldHVybiAweDAwQTU7XG4gICAgICAgIH1cblxuICAgICAgICAvLyAweDdFXG4gICAgICAgIGlmIChiaXRlID09PSAweDdFKSB7XG4gICAgICAgICAgLy8gVW5zZXQgdGhlIGlzby0yMDIyLWpwIG91dHB1dCBmbGFnIGFuZCByZXR1cm4gY29k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lwZVxuICAgIC50b1N0cmluZ1xuICAgIC5jYWxsKG9iailcbiAgICAuc2xpY2UodG9TdHJpbmdMZWZ0U2xpY2VMZW5ndGgsIHRvU3RyaW5nUmlnaHRTbGljZUxlbmd0aCk7XG59O1xuXG5tb2R1bGUuZXhwb3J0cy50eXBlRGV0ZWN0ID0gbW9kdWxlLmV4cG9ydHM7XG4iXX0= ================================================ FILE: common/Tests/External/sinon-7.3.1.js ================================================ /* Sinon.JS 7.3.1, 2019-03-27, @license BSD-3 */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.sinon = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0) { return args[callArgAt]; } var argumentList; if (callArgAt === useLeftMostCallback) { argumentList = args; } if (callArgAt === useRightMostCallback) { argumentList = reverse(slice(args)); } var callArgProp = behavior.callArgProp; for (var i = 0, l = argumentList.length; i < l; ++i) { if (!callArgProp && typeof argumentList[i] === "function") { return argumentList[i]; } if (callArgProp && argumentList[i] && typeof argumentList[i][callArgProp] === "function") { return argumentList[i][callArgProp]; } } return null; } function getCallbackError(behavior, func, args) { if (behavior.callArgAt < 0) { var msg; if (behavior.callArgProp) { msg = functionName(behavior.stub) + " expected to yield to '" + valueToString(behavior.callArgProp) + "', but no object with such a property was passed."; } else { msg = functionName(behavior.stub) + " expected to yield, but no callback was passed."; } if (args.length > 0) { msg += " Received [" + join(args, ", ") + "]"; } return msg; } return "argument at index " + behavior.callArgAt + " is not a function: " + func; } function ensureArgs(name, behavior, args) { // map function name to internal property // callsArg => callArgAt var property = name.replace(/sArg/, "ArgAt"); var index = behavior[property]; if (index >= args.length) { throw new TypeError( name + " failed: " + (index + 1) + " arguments required but only " + args.length + " present" ); } } function callCallback(behavior, args) { if (typeof behavior.callArgAt === "number") { ensureArgs("callsArg", behavior, args); var func = getCallback(behavior, args); if (typeof func !== "function") { throw new TypeError(getCallbackError(behavior, func, args)); } if (behavior.callbackAsync) { nextTick(function() { func.apply(behavior.callbackContext, behavior.callbackArguments); }); } else { return func.apply(behavior.callbackContext, behavior.callbackArguments); } } return undefined; } var proto = { create: function create(stub) { var behavior = extend({}, proto); delete behavior.create; delete behavior.addBehavior; delete behavior.createBehavior; behavior.stub = stub; if (stub.defaultBehavior && stub.defaultBehavior.promiseLibrary) { behavior.promiseLibrary = stub.defaultBehavior.promiseLibrary; } return behavior; }, isPresent: function isPresent() { return ( typeof this.callArgAt === "number" || this.exception || this.exceptionCreator || typeof this.returnArgAt === "number" || this.returnThis || typeof this.resolveArgAt === "number" || this.resolveThis || typeof this.throwArgAt === "number" || this.fakeFn || this.returnValueDefined ); }, invoke: function invoke(context, args) { /* * callCallback (conditionally) calls ensureArgs * * Note: callCallback intentionally happens before * everything else and cannot be moved lower */ var returnValue = callCallback(this, args); if (this.exception) { throw this.exception; } else if (this.exceptionCreator) { this.exception = this.exceptionCreator(); this.exceptionCreator = undefined; throw this.exception; } else if (typeof this.returnArgAt === "number") { ensureArgs("returnsArg", this, args); return args[this.returnArgAt]; } else if (this.returnThis) { return context; } else if (typeof this.throwArgAt === "number") { ensureArgs("throwsArg", this, args); throw args[this.throwArgAt]; } else if (this.fakeFn) { return this.fakeFn.apply(context, args); } else if (typeof this.resolveArgAt === "number") { ensureArgs("resolvesArg", this, args); return (this.promiseLibrary || Promise).resolve(args[this.resolveArgAt]); } else if (this.resolveThis) { return (this.promiseLibrary || Promise).resolve(context); } else if (this.resolve) { return (this.promiseLibrary || Promise).resolve(this.returnValue); } else if (this.reject) { return (this.promiseLibrary || Promise).reject(this.returnValue); } else if (this.callsThrough) { return this.stub.wrappedMethod.apply(context, args); } else if (typeof this.returnValue !== "undefined") { return this.returnValue; } else if (typeof this.callArgAt === "number") { return returnValue; } return this.returnValue; }, onCall: function onCall(index) { return this.stub.onCall(index); }, onFirstCall: function onFirstCall() { return this.stub.onFirstCall(); }, onSecondCall: function onSecondCall() { return this.stub.onSecondCall(); }, onThirdCall: function onThirdCall() { return this.stub.onThirdCall(); }, withArgs: function withArgs(/* arguments */) { throw new Error( 'Defining a stub by invoking "stub.onCall(...).withArgs(...)" ' + 'is not supported. Use "stub.withArgs(...).onCall(...)" ' + "to define sequential behavior for calls with certain arguments." ); } }; function createBehavior(behaviorMethod) { return function() { this.defaultBehavior = this.defaultBehavior || proto.create(this); this.defaultBehavior[behaviorMethod].apply(this.defaultBehavior, arguments); return this; }; } function addBehavior(stub, name, fn) { proto[name] = function() { fn.apply(this, concat([this], slice(arguments))); return this.stub || this; }; stub[name] = createBehavior(name); } proto.addBehavior = addBehavior; proto.createBehavior = createBehavior; var asyncBehaviors = exportAsyncBehaviors(proto); module.exports = extend.nonEnum({}, proto, asyncBehaviors); },{"./util/core/export-async-behaviors":19,"./util/core/extend":20,"./util/core/next-tick":28,"@sinonjs/commons":39}],4:[function(require,module,exports){ "use strict"; var arrayProto = require("@sinonjs/commons").prototypes.array; var match = require("@sinonjs/samsam").createMatcher; var deepEqual = require("@sinonjs/samsam").deepEqual; var functionName = require("@sinonjs/commons").functionName; var sinonFormat = require("./util/core/format"); var valueToString = require("@sinonjs/commons").valueToString; var concat = arrayProto.concat; var filter = arrayProto.filter; var join = arrayProto.join; var map = arrayProto.map; var reduce = arrayProto.reduce; var slice = arrayProto.slice; function throwYieldError(proxy, text, args) { var msg = functionName(proxy) + text; if (args.length) { msg += " Received [" + join(slice(args), ", ") + "]"; } throw new Error(msg); } var callProto = { calledOn: function calledOn(thisValue) { if (match.isMatcher(thisValue)) { return thisValue.test(this.thisValue); } return this.thisValue === thisValue; }, calledWith: function calledWith() { var self = this; var calledWithArgs = slice(arguments); if (calledWithArgs.length > self.args.length) { return false; } return reduce( calledWithArgs, function(prev, arg, i) { return prev && deepEqual(self.args[i], arg); }, true ); }, calledWithMatch: function calledWithMatch() { var self = this; var calledWithMatchArgs = slice(arguments); if (calledWithMatchArgs.length > self.args.length) { return false; } return reduce( calledWithMatchArgs, function(prev, expectation, i) { var actual = self.args[i]; return prev && match(expectation).test(actual); }, true ); }, calledWithExactly: function calledWithExactly() { return arguments.length === this.args.length && this.calledWith.apply(this, arguments); }, notCalledWith: function notCalledWith() { return !this.calledWith.apply(this, arguments); }, notCalledWithMatch: function notCalledWithMatch() { return !this.calledWithMatch.apply(this, arguments); }, returned: function returned(value) { return deepEqual(this.returnValue, value); }, threw: function threw(error) { if (typeof error === "undefined" || !this.exception) { return Boolean(this.exception); } return this.exception === error || this.exception.name === error; }, calledWithNew: function calledWithNew() { return this.proxy.prototype && this.thisValue instanceof this.proxy; }, calledBefore: function(other) { return this.callId < other.callId; }, calledAfter: function(other) { return this.callId > other.callId; }, calledImmediatelyBefore: function(other) { return this.callId === other.callId - 1; }, calledImmediatelyAfter: function(other) { return this.callId === other.callId + 1; }, callArg: function(pos) { this.ensureArgIsAFunction(pos); return this.args[pos](); }, callArgOn: function(pos, thisValue) { this.ensureArgIsAFunction(pos); return this.args[pos].apply(thisValue); }, callArgWith: function(pos) { return this.callArgOnWith.apply(this, concat([pos, null], slice(arguments, 1))); }, callArgOnWith: function(pos, thisValue) { this.ensureArgIsAFunction(pos); var args = slice(arguments, 2); return this.args[pos].apply(thisValue, args); }, throwArg: function(pos) { if (pos > this.args.length) { throw new TypeError("Not enough arguments: " + pos + " required but only " + this.args.length + " present"); } throw this.args[pos]; }, yield: function() { return this.yieldOn.apply(this, concat([null], slice(arguments, 0))); }, yieldOn: function(thisValue) { var args = slice(this.args); var yieldFn = filter(args, function(arg) { return typeof arg === "function"; })[0]; if (!yieldFn) { throwYieldError(this.proxy, " cannot yield since no callback was passed.", args); } return yieldFn.apply(thisValue, slice(arguments, 1)); }, yieldTo: function(prop) { return this.yieldToOn.apply(this, concat([prop, null], slice(arguments, 1))); }, yieldToOn: function(prop, thisValue) { var args = slice(this.args); var yieldArg = filter(args, function(arg) { return arg && typeof arg[prop] === "function"; })[0]; var yieldFn = yieldArg && yieldArg[prop]; if (!yieldFn) { throwYieldError( this.proxy, " cannot yield to '" + valueToString(prop) + "' since no callback was passed.", args ); } return yieldFn.apply(thisValue, slice(arguments, 2)); }, toString: function() { var callStr = this.proxy ? String(this.proxy) + "(" : ""; var formattedArgs; if (!this.args) { return ":("; } formattedArgs = map(this.args, function(arg) { return sinonFormat(arg); }); callStr = callStr + join(formattedArgs, ", ") + ")"; if (typeof this.returnValue !== "undefined") { callStr += " => " + sinonFormat(this.returnValue); } if (this.exception) { callStr += " !" + this.exception.name; if (this.exception.message) { callStr += "(" + this.exception.message + ")"; } } if (this.stack) { // Omit the error message and the two top stack frames in sinon itself: callStr += (this.stack.split("\n")[3] || "unknown").replace(/^\s*(?:at\s+|@)?/, " at "); } return callStr; }, ensureArgIsAFunction: function(pos) { if (typeof this.args[pos] !== "function") { throw new TypeError( "Expected argument at position " + pos + " to be a Function, but was " + typeof this.args[pos] ); } } }; Object.defineProperty(callProto, "stack", { enumerable: true, configurable: true, get: function() { return (this.errorWithCallStack && this.errorWithCallStack.stack) || ""; } }); callProto.invokeCallback = callProto.yield; function createSpyCall(spy, thisValue, args, returnValue, exception, id, errorWithCallStack) { if (typeof id !== "number") { throw new TypeError("Call id is not a number"); } var proxyCall = Object.create(callProto); var lastArg = (args.length > 0 && args[args.length - 1]) || undefined; var callback = lastArg && typeof lastArg === "function" ? lastArg : undefined; proxyCall.proxy = spy; proxyCall.thisValue = thisValue; proxyCall.args = args; proxyCall.lastArg = lastArg; proxyCall.callback = callback; proxyCall.returnValue = returnValue; proxyCall.exception = exception; proxyCall.callId = id; proxyCall.errorWithCallStack = errorWithCallStack; return proxyCall; } createSpyCall.toString = callProto.toString; // used by mocks module.exports = createSpyCall; },{"./util/core/format":21,"@sinonjs/commons":39,"@sinonjs/samsam":65}],5:[function(require,module,exports){ "use strict"; var walk = require("./util/core/walk"); var getPropertyDescriptor = require("./util/core/get-property-descriptor"); var hasOwnProperty = require("@sinonjs/commons").prototypes.object.hasOwnProperty; var push = require("@sinonjs/commons").prototypes.array.push; function collectMethod(methods, object, prop, propOwner) { if (typeof getPropertyDescriptor(propOwner, prop).value === "function" && hasOwnProperty(object, prop)) { push(methods, object[prop]); } } // This function returns an array of all the own methods on the passed object function collectOwnMethods(object) { var methods = []; walk(object, collectMethod.bind(null, methods, object)); return methods; } module.exports = collectOwnMethods; },{"./util/core/get-property-descriptor":24,"./util/core/walk":31,"@sinonjs/commons":39}],6:[function(require,module,exports){ "use strict"; var supportsColor = require("supports-color"); function colorize(str, color) { if (supportsColor.stdout === false) { return str; } return "\x1b[" + color + "m" + str + "\x1b[0m"; } exports.red = function(str) { return colorize(str, 31); }; exports.green = function(str) { return colorize(str, 32); }; exports.cyan = function(str) { return colorize(str, 96); }; exports.white = function(str) { return colorize(str, 39); }; exports.bold = function(str) { return colorize(str, 1); }; },{"supports-color":88}],7:[function(require,module,exports){ "use strict"; var arrayProto = require("@sinonjs/commons").prototypes.array; var Sandbox = require("./sandbox"); var forEach = arrayProto.forEach; var push = arrayProto.push; function prepareSandboxFromConfig(config) { var sandbox = new Sandbox(); if (config.useFakeServer) { if (typeof config.useFakeServer === "object") { sandbox.serverPrototype = config.useFakeServer; } sandbox.useFakeServer(); } if (config.useFakeTimers) { if (typeof config.useFakeTimers === "object") { sandbox.useFakeTimers(config.useFakeTimers); } else { sandbox.useFakeTimers(); } } return sandbox; } function exposeValue(sandbox, config, key, value) { if (!value) { return; } if (config.injectInto && !(key in config.injectInto)) { config.injectInto[key] = value; push(sandbox.injectedKeys, key); } else { push(sandbox.args, value); } } function createSandbox(config) { if (!config) { return new Sandbox(); } var configuredSandbox = prepareSandboxFromConfig(config); configuredSandbox.args = configuredSandbox.args || []; configuredSandbox.injectedKeys = []; configuredSandbox.injectInto = config.injectInto; var exposed = configuredSandbox.inject({}); if (config.properties) { forEach(config.properties, function(prop) { var value = exposed[prop] || (prop === "sandbox" && configuredSandbox); exposeValue(configuredSandbox, config, prop, value); }); } else { exposeValue(configuredSandbox, config, "sandbox"); } return configuredSandbox; } module.exports = createSandbox; },{"./sandbox":12,"@sinonjs/commons":39}],8:[function(require,module,exports){ "use strict"; var arrayProto = require("@sinonjs/commons").prototypes.array; var isPropertyConfigurable = require("./util/core/is-property-configurable"); var exportAsyncBehaviors = require("./util/core/export-async-behaviors"); var extend = require("./util/core/extend"); var slice = arrayProto.slice; var useLeftMostCallback = -1; var useRightMostCallback = -2; function throwsException(fake, error, message) { if (typeof error === "function") { fake.exceptionCreator = error; } else if (typeof error === "string") { fake.exceptionCreator = function() { var newException = new Error(message || ""); newException.name = error; return newException; }; } else if (!error) { fake.exceptionCreator = function() { return new Error("Error"); }; } else { fake.exception = error; } } var defaultBehaviors = { callsFake: function callsFake(fake, fn) { fake.fakeFn = fn; }, callsArg: function callsArg(fake, index) { if (typeof index !== "number") { throw new TypeError("argument index is not number"); } fake.callArgAt = index; fake.callbackArguments = []; fake.callbackContext = undefined; fake.callArgProp = undefined; fake.callbackAsync = false; }, callsArgOn: function callsArgOn(fake, index, context) { if (typeof index !== "number") { throw new TypeError("argument index is not number"); } fake.callArgAt = index; fake.callbackArguments = []; fake.callbackContext = context; fake.callArgProp = undefined; fake.callbackAsync = false; }, callsArgWith: function callsArgWith(fake, index) { if (typeof index !== "number") { throw new TypeError("argument index is not number"); } fake.callArgAt = index; fake.callbackArguments = slice(arguments, 2); fake.callbackContext = undefined; fake.callArgProp = undefined; fake.callbackAsync = false; }, callsArgOnWith: function callsArgWith(fake, index, context) { if (typeof index !== "number") { throw new TypeError("argument index is not number"); } fake.callArgAt = index; fake.callbackArguments = slice(arguments, 3); fake.callbackContext = context; fake.callArgProp = undefined; fake.callbackAsync = false; }, usingPromise: function usingPromise(fake, promiseLibrary) { fake.promiseLibrary = promiseLibrary; }, yields: function(fake) { fake.callArgAt = useLeftMostCallback; fake.callbackArguments = slice(arguments, 1); fake.callbackContext = undefined; fake.callArgProp = undefined; fake.callbackAsync = false; }, yieldsRight: function(fake) { fake.callArgAt = useRightMostCallback; fake.callbackArguments = slice(arguments, 1); fake.callbackContext = undefined; fake.callArgProp = undefined; fake.callbackAsync = false; }, yieldsOn: function(fake, context) { fake.callArgAt = useLeftMostCallback; fake.callbackArguments = slice(arguments, 2); fake.callbackContext = context; fake.callArgProp = undefined; fake.callbackAsync = false; }, yieldsTo: function(fake, prop) { fake.callArgAt = useLeftMostCallback; fake.callbackArguments = slice(arguments, 2); fake.callbackContext = undefined; fake.callArgProp = prop; fake.callbackAsync = false; }, yieldsToOn: function(fake, prop, context) { fake.callArgAt = useLeftMostCallback; fake.callbackArguments = slice(arguments, 3); fake.callbackContext = context; fake.callArgProp = prop; fake.callbackAsync = false; }, throws: throwsException, throwsException: throwsException, returns: function returns(fake, value) { fake.returnValue = value; fake.resolve = false; fake.reject = false; fake.returnValueDefined = true; fake.exception = undefined; fake.exceptionCreator = undefined; fake.fakeFn = undefined; }, returnsArg: function returnsArg(fake, index) { if (typeof index !== "number") { throw new TypeError("argument index is not number"); } fake.returnArgAt = index; }, throwsArg: function throwsArg(fake, index) { if (typeof index !== "number") { throw new TypeError("argument index is not number"); } fake.throwArgAt = index; }, returnsThis: function returnsThis(fake) { fake.returnThis = true; }, resolves: function resolves(fake, value) { fake.returnValue = value; fake.resolve = true; fake.resolveThis = false; fake.reject = false; fake.returnValueDefined = true; fake.exception = undefined; fake.exceptionCreator = undefined; fake.fakeFn = undefined; }, resolvesArg: function resolvesArg(fake, index) { if (typeof index !== "number") { throw new TypeError("argument index is not number"); } fake.resolveArgAt = index; fake.returnValue = undefined; fake.resolve = true; fake.resolveThis = false; fake.reject = false; fake.returnValueDefined = false; fake.exception = undefined; fake.exceptionCreator = undefined; fake.fakeFn = undefined; }, rejects: function rejects(fake, error, message) { var reason; if (typeof error === "string") { reason = new Error(message || ""); reason.name = error; } else if (!error) { reason = new Error("Error"); } else { reason = error; } fake.returnValue = reason; fake.resolve = false; fake.resolveThis = false; fake.reject = true; fake.returnValueDefined = true; fake.exception = undefined; fake.exceptionCreator = undefined; fake.fakeFn = undefined; return fake; }, resolvesThis: function resolvesThis(fake) { fake.returnValue = undefined; fake.resolve = false; fake.resolveThis = true; fake.reject = false; fake.returnValueDefined = false; fake.exception = undefined; fake.exceptionCreator = undefined; fake.fakeFn = undefined; }, callThrough: function callThrough(fake) { fake.callsThrough = true; }, get: function get(fake, getterFunction) { var rootStub = fake.stub || fake; Object.defineProperty(rootStub.rootObj, rootStub.propName, { get: getterFunction, configurable: isPropertyConfigurable(rootStub.rootObj, rootStub.propName) }); return fake; }, set: function set(fake, setterFunction) { var rootStub = fake.stub || fake; Object.defineProperty( rootStub.rootObj, rootStub.propName, // eslint-disable-next-line accessor-pairs { set: setterFunction, configurable: isPropertyConfigurable(rootStub.rootObj, rootStub.propName) } ); return fake; }, value: function value(fake, newVal) { var rootStub = fake.stub || fake; Object.defineProperty(rootStub.rootObj, rootStub.propName, { value: newVal, enumerable: true, configurable: isPropertyConfigurable(rootStub.rootObj, rootStub.propName) }); return fake; } }; var asyncBehaviors = exportAsyncBehaviors(defaultBehaviors); module.exports = extend({}, defaultBehaviors, asyncBehaviors); },{"./util/core/export-async-behaviors":19,"./util/core/extend":20,"./util/core/is-property-configurable":27,"@sinonjs/commons":39}],9:[function(require,module,exports){ "use strict"; var arrayProto = require("@sinonjs/commons").prototypes.array; var spy = require("./spy"); var nextTick = require("./util/core/next-tick"); var forEach = arrayProto.forEach; var slice = arrayProto.slice; function getError(value) { return value instanceof Error ? value : new Error(value); } function cleanProxy(f) { var undesirableProperties = [ "instantiateFake", "callArg", "callArgOn", "callArgOnWith", "callArgWith", "invokeCallback", "throwArg", "withArgs", "yield", "yieldOn", "yieldTo", "yieldToOn" ]; forEach(undesirableProperties, function(key) { delete f[key]; }); return f; } var uuid = 0; function wrapFunc(f) { var fakeInstance = function() { var lastArg = arguments.length > 0 ? arguments[arguments.length - 1] : undefined; var callback = lastArg && typeof lastArg === "function" ? lastArg : undefined; /* eslint-disable no-use-before-define */ p.lastArg = lastArg; p.callback = callback; /* eslint-enable no-use-before-define */ return f && f.apply(this, arguments); }; var p = cleanProxy(spy(fakeInstance)); p.displayName = "fake"; p.id = "fake#" + uuid++; return p; } function fake(f) { if (arguments.length > 0 && typeof f !== "function") { throw new TypeError("Expected f argument to be a Function"); } return wrapFunc(f); } fake.returns = function returns(value) { function f() { return value; } return wrapFunc(f); }; fake.throws = function throws(value) { function f() { throw getError(value); } return wrapFunc(f); }; fake.resolves = function resolves(value) { function f() { return Promise.resolve(value); } return wrapFunc(f); }; fake.rejects = function rejects(value) { function f() { return Promise.reject(getError(value)); } return wrapFunc(f); }; function yieldInternal(async, values) { function f() { var callback = arguments[arguments.length - 1]; if (typeof callback !== "function") { throw new TypeError("Expected last argument to be a function"); } if (async) { nextTick(function() { callback.apply(null, values); }); } else { callback.apply(null, values); } } return wrapFunc(f); } fake.yields = function yields() { return yieldInternal(false, slice(arguments)); }; fake.yieldsAsync = function yieldsAsync() { return yieldInternal(true, slice(arguments)); }; module.exports = fake; },{"./spy":14,"./util/core/next-tick":28,"@sinonjs/commons":39}],10:[function(require,module,exports){ "use strict"; var arrayProto = require("@sinonjs/commons").prototypes.array; var spyInvoke = require("./spy").invoke; var spyCallToString = require("./call").toString; var timesInWords = require("./util/core/times-in-words"); var extend = require("./util/core/extend"); var match = require("@sinonjs/samsam").createMatcher; var stub = require("./stub"); var assert = require("./assert"); var deepEqual = require("@sinonjs/samsam").deepEqual; var format = require("./util/core/format"); var valueToString = require("@sinonjs/commons").valueToString; var every = arrayProto.every; var forEach = arrayProto.forEach; var push = arrayProto.push; var slice = arrayProto.slice; function callCountInWords(callCount) { if (callCount === 0) { return "never called"; } return "called " + timesInWords(callCount); } function expectedCallCountInWords(expectation) { var min = expectation.minCalls; var max = expectation.maxCalls; if (typeof min === "number" && typeof max === "number") { var str = timesInWords(min); if (min !== max) { str = "at least " + str + " and at most " + timesInWords(max); } return str; } if (typeof min === "number") { return "at least " + timesInWords(min); } return "at most " + timesInWords(max); } function receivedMinCalls(expectation) { var hasMinLimit = typeof expectation.minCalls === "number"; return !hasMinLimit || expectation.callCount >= expectation.minCalls; } function receivedMaxCalls(expectation) { if (typeof expectation.maxCalls !== "number") { return false; } return expectation.callCount === expectation.maxCalls; } function verifyMatcher(possibleMatcher, arg) { var isMatcher = match.isMatcher(possibleMatcher); return (isMatcher && possibleMatcher.test(arg)) || true; } var mockExpectation = { minCalls: 1, maxCalls: 1, create: function create(methodName) { var expectation = extend.nonEnum(stub.create(), mockExpectation); delete expectation.create; expectation.method = methodName; return expectation; }, invoke: function invoke(func, thisValue, args) { this.verifyCallAllowed(thisValue, args); return spyInvoke.apply(this, arguments); }, atLeast: function atLeast(num) { if (typeof num !== "number") { throw new TypeError("'" + valueToString(num) + "' is not number"); } if (!this.limitsSet) { this.maxCalls = null; this.limitsSet = true; } this.minCalls = num; return this; }, atMost: function atMost(num) { if (typeof num !== "number") { throw new TypeError("'" + valueToString(num) + "' is not number"); } if (!this.limitsSet) { this.minCalls = null; this.limitsSet = true; } this.maxCalls = num; return this; }, never: function never() { return this.exactly(0); }, once: function once() { return this.exactly(1); }, twice: function twice() { return this.exactly(2); }, thrice: function thrice() { return this.exactly(3); }, exactly: function exactly(num) { if (typeof num !== "number") { throw new TypeError("'" + valueToString(num) + "' is not a number"); } this.atLeast(num); return this.atMost(num); }, met: function met() { return !this.failed && receivedMinCalls(this); }, verifyCallAllowed: function verifyCallAllowed(thisValue, args) { var expectedArguments = this.expectedArguments; if (receivedMaxCalls(this)) { this.failed = true; mockExpectation.fail(this.method + " already called " + timesInWords(this.maxCalls)); } if ("expectedThis" in this && this.expectedThis !== thisValue) { mockExpectation.fail( this.method + " called with " + valueToString(thisValue) + " as thisValue, expected " + valueToString(this.expectedThis) ); } if (!("expectedArguments" in this)) { return; } if (!args) { mockExpectation.fail(this.method + " received no arguments, expected " + format(expectedArguments)); } if (args.length < expectedArguments.length) { mockExpectation.fail( this.method + " received too few arguments (" + format(args) + "), expected " + format(expectedArguments) ); } if (this.expectsExactArgCount && args.length !== expectedArguments.length) { mockExpectation.fail( this.method + " received too many arguments (" + format(args) + "), expected " + format(expectedArguments) ); } forEach( expectedArguments, function(expectedArgument, i) { if (!verifyMatcher(expectedArgument, args[i])) { mockExpectation.fail( this.method + " received wrong arguments " + format(args) + ", didn't match " + String(expectedArguments) ); } if (!deepEqual(args[i], expectedArgument)) { mockExpectation.fail( this.method + " received wrong arguments " + format(args) + ", expected " + format(expectedArguments) ); } }, this ); }, allowsCall: function allowsCall(thisValue, args) { var expectedArguments = this.expectedArguments; if (this.met() && receivedMaxCalls(this)) { return false; } if ("expectedThis" in this && this.expectedThis !== thisValue) { return false; } if (!("expectedArguments" in this)) { return true; } // eslint-disable-next-line no-underscore-dangle var _args = args || []; if (_args.length < expectedArguments.length) { return false; } if (this.expectsExactArgCount && _args.length !== expectedArguments.length) { return false; } return every(expectedArguments, function(expectedArgument, i) { if (!verifyMatcher(expectedArgument, _args[i])) { return false; } if (!deepEqual(_args[i], expectedArgument)) { return false; } return true; }); }, withArgs: function withArgs() { this.expectedArguments = slice(arguments); return this; }, withExactArgs: function withExactArgs() { this.withArgs.apply(this, arguments); this.expectsExactArgCount = true; return this; }, on: function on(thisValue) { this.expectedThis = thisValue; return this; }, toString: function() { var args = slice(this.expectedArguments || []); if (!this.expectsExactArgCount) { push(args, "[...]"); } var callStr = spyCallToString.call({ proxy: this.method || "anonymous mock expectation", args: args }); var message = callStr.replace(", [...", "[, ...") + " " + expectedCallCountInWords(this); if (this.met()) { return "Expectation met: " + message; } return "Expected " + message + " (" + callCountInWords(this.callCount) + ")"; }, verify: function verify() { if (!this.met()) { mockExpectation.fail(String(this)); } else { mockExpectation.pass(String(this)); } return true; }, pass: function pass(message) { assert.pass(message); }, fail: function fail(message) { var exception = new Error(message); exception.name = "ExpectationError"; throw exception; } }; module.exports = mockExpectation; },{"./assert":2,"./call":4,"./spy":14,"./stub":16,"./util/core/extend":20,"./util/core/format":21,"./util/core/times-in-words":29,"@sinonjs/commons":39,"@sinonjs/samsam":65}],11:[function(require,module,exports){ "use strict"; var arrayProto = require("@sinonjs/commons").prototypes.array; var mockExpectation = require("./mock-expectation"); var spyCallToString = require("./call").toString; var extend = require("./util/core/extend"); var deepEqual = require("@sinonjs/samsam").deepEqual; var wrapMethod = require("./util/core/wrap-method"); var usePromiseLibrary = require("./util/core/use-promise-library"); var concat = arrayProto.concat; var filter = arrayProto.filter; var forEach = arrayProto.forEach; var every = arrayProto.every; var join = arrayProto.join; var push = arrayProto.push; var slice = arrayProto.slice; var unshift = arrayProto.unshift; function mock(object) { if (!object || typeof object === "string") { return mockExpectation.create(object ? object : "Anonymous mock"); } return mock.create(object); } function each(collection, callback) { var col = collection || []; forEach(col, callback); } function arrayEquals(arr1, arr2, compareLength) { if (compareLength && arr1.length !== arr2.length) { return false; } return every(arr1, function(element, i) { return deepEqual(arr2[i], element); }); } extend(mock, { create: function create(object) { if (!object) { throw new TypeError("object is null"); } var mockObject = extend.nonEnum({}, mock, { object: object }); delete mockObject.create; return mockObject; }, expects: function expects(method) { if (!method) { throw new TypeError("method is falsy"); } if (!this.expectations) { this.expectations = {}; this.proxies = []; this.failures = []; } if (!this.expectations[method]) { this.expectations[method] = []; var mockObject = this; wrapMethod(this.object, method, function() { return mockObject.invokeMethod(method, this, arguments); }); push(this.proxies, method); } var expectation = mockExpectation.create(method); extend.nonEnum(expectation, this.object[method]); push(this.expectations[method], expectation); usePromiseLibrary(this.promiseLibrary, expectation); return expectation; }, restore: function restore() { var object = this.object; each(this.proxies, function(proxy) { if (typeof object[proxy].restore === "function") { object[proxy].restore(); } }); }, verify: function verify() { var expectations = this.expectations || {}; var messages = this.failures ? slice(this.failures) : []; var met = []; each(this.proxies, function(proxy) { each(expectations[proxy], function(expectation) { if (!expectation.met()) { push(messages, String(expectation)); } else { push(met, String(expectation)); } }); }); this.restore(); if (messages.length > 0) { mockExpectation.fail(join(concat(messages, met), "\n")); } else if (met.length > 0) { mockExpectation.pass(join(concat(messages, met), "\n")); } return true; }, usingPromise: function usingPromise(promiseLibrary) { this.promiseLibrary = promiseLibrary; return this; }, invokeMethod: function invokeMethod(method, thisValue, args) { /* if we cannot find any matching files we will explicitly call mockExpection#fail with error messages */ /* eslint consistent-return: "off" */ var expectations = this.expectations && this.expectations[method] ? this.expectations[method] : []; var currentArgs = args || []; var available; var expectationsWithMatchingArgs = filter(expectations, function(expectation) { var expectedArgs = expectation.expectedArguments || []; return arrayEquals(expectedArgs, currentArgs, expectation.expectsExactArgCount); }); var expectationsToApply = filter(expectationsWithMatchingArgs, function(expectation) { return !expectation.met() && expectation.allowsCall(thisValue, args); }); if (expectationsToApply.length > 0) { return expectationsToApply[0].apply(thisValue, args); } var messages = []; var exhausted = 0; forEach(expectationsWithMatchingArgs, function(expectation) { if (expectation.allowsCall(thisValue, args)) { available = available || expectation; } else { exhausted += 1; } }); if (available && exhausted === 0) { return available.apply(thisValue, args); } forEach(expectations, function(expectation) { push(messages, " " + String(expectation)); }); unshift( messages, "Unexpected call: " + spyCallToString.call({ proxy: method, args: args }) ); var err = new Error(); if (!err.stack) { // PhantomJS does not serialize the stack trace until the error has been thrown try { throw err; } catch (e) { /* empty */ } } push( this.failures, "Unexpected call: " + spyCallToString.call({ proxy: method, args: args, stack: err.stack }) ); mockExpectation.fail(join(messages, "\n")); } }); module.exports = mock; },{"./call":4,"./mock-expectation":10,"./util/core/extend":20,"./util/core/use-promise-library":30,"./util/core/wrap-method":32,"@sinonjs/commons":39,"@sinonjs/samsam":65}],12:[function(require,module,exports){ "use strict"; var arrayProto = require("@sinonjs/commons").prototypes.array; var collectOwnMethods = require("./collect-own-methods"); var getPropertyDescriptor = require("./util/core/get-property-descriptor"); var isEsModule = require("./util/core/is-es-module"); var isPropertyConfigurable = require("./util/core/is-property-configurable"); var isNonExistentOwnProperty = require("./util/core/is-non-existent-own-property"); var match = require("@sinonjs/samsam").createMatcher; var sinonAssert = require("./assert"); var sinonClock = require("./util/fake-timers"); var sinonMock = require("./mock"); var sinonSpy = require("./spy"); var sinonStub = require("./stub"); var sinonFake = require("./fake"); var valueToString = require("@sinonjs/commons").valueToString; var fakeServer = require("nise").fakeServer; var fakeXhr = require("nise").fakeXhr; var usePromiseLibrary = require("./util/core/use-promise-library"); var filter = arrayProto.filter; var forEach = arrayProto.filter; var push = arrayProto.push; var reverse = arrayProto.reverse; function applyOnEach(fakes, method) { var matchingFakes = filter(fakes, function(fake) { return typeof fake[method] === "function"; }); forEach(matchingFakes, function(fake) { fake[method](); }); } function Sandbox() { var sandbox = this; var collection = []; var fakeRestorers = []; var promiseLib; sandbox.serverPrototype = fakeServer; // this is for testing only sandbox.getFakes = function getFakes() { return collection; }; // this is for testing only sandbox.getRestorers = function() { return fakeRestorers; }; sandbox.createStubInstance = function createStubInstance(constructor) { if (typeof constructor !== "function") { throw new TypeError("The constructor should be a function."); } return this.stub(Object.create(constructor.prototype)); }; sandbox.inject = function inject(obj) { obj.spy = function() { return sandbox.spy.apply(null, arguments); }; obj.stub = function() { return sandbox.stub.apply(null, arguments); }; obj.mock = function() { return sandbox.mock.apply(null, arguments); }; obj.createStubInstance = function() { return sandbox.createStubInstance.apply(sandbox, arguments); }; obj.fake = function() { return sandbox.fake.apply(null, arguments); }; obj.replace = function() { return sandbox.replace.apply(null, arguments); }; obj.replaceSetter = function() { return sandbox.replaceSetter.apply(null, arguments); }; obj.replaceGetter = function() { return sandbox.replaceGetter.apply(null, arguments); }; if (sandbox.clock) { obj.clock = sandbox.clock; } if (sandbox.server) { obj.server = sandbox.server; obj.requests = sandbox.server.requests; } obj.match = match; return obj; }; sandbox.mock = function mock() { var m = sinonMock.apply(null, arguments); push(collection, m); usePromiseLibrary(promiseLib, m); return m; }; sandbox.reset = function reset() { applyOnEach(collection, "reset"); applyOnEach(collection, "resetHistory"); }; sandbox.resetBehavior = function resetBehavior() { applyOnEach(collection, "resetBehavior"); }; sandbox.resetHistory = function resetHistory() { function privateResetHistory(f) { var method = f.resetHistory || f.reset; if (method) { method.call(f); } } forEach(collection, function(fake) { if (typeof fake === "function") { privateResetHistory(fake); return; } var methods = []; if (fake.get) { push(methods, fake.get); } if (fake.set) { push(methods, fake.set); } forEach(methods, privateResetHistory); }); }; sandbox.restore = function restore() { if (arguments.length) { throw new Error("sandbox.restore() does not take any parameters. Perhaps you meant stub.restore()"); } reverse(collection); applyOnEach(collection, "restore"); collection = []; forEach(fakeRestorers, function(restorer) { restorer(); }); fakeRestorers = []; sandbox.restoreContext(); }; sandbox.restoreContext = function restoreContext() { var injectedKeys = sandbox.injectedKeys; var injectInto = sandbox.injectInto; if (!injectedKeys) { return; } forEach(injectedKeys, function(injectedKey) { delete injectInto[injectedKey]; }); injectedKeys = []; }; function getFakeRestorer(object, property) { var descriptor = getPropertyDescriptor(object, property); function restorer() { Object.defineProperty(object, property, descriptor); } restorer.object = object; restorer.property = property; return restorer; } function verifyNotReplaced(object, property) { forEach(fakeRestorers, function(fakeRestorer) { if (fakeRestorer.object === object && fakeRestorer.property === property) { throw new TypeError("Attempted to replace " + property + " which is already replaced"); } }); } sandbox.replace = function replace(object, property, replacement) { var descriptor = getPropertyDescriptor(object, property); if (typeof descriptor === "undefined") { throw new TypeError("Cannot replace non-existent own property " + valueToString(property)); } if (typeof replacement === "undefined") { throw new TypeError("Expected replacement argument to be defined"); } if (typeof descriptor.get === "function") { throw new Error("Use sandbox.replaceGetter for replacing getters"); } if (typeof descriptor.set === "function") { throw new Error("Use sandbox.replaceSetter for replacing setters"); } if (typeof object[property] !== typeof replacement) { throw new TypeError("Cannot replace " + typeof object[property] + " with " + typeof replacement); } verifyNotReplaced(object, property); // store a function for restoring the replaced property push(fakeRestorers, getFakeRestorer(object, property)); object[property] = replacement; return replacement; }; sandbox.replaceGetter = function replaceGetter(object, property, replacement) { var descriptor = getPropertyDescriptor(object, property); if (typeof descriptor === "undefined") { throw new TypeError("Cannot replace non-existent own property " + valueToString(property)); } if (typeof replacement !== "function") { throw new TypeError("Expected replacement argument to be a function"); } if (typeof descriptor.get !== "function") { throw new Error("`object.property` is not a getter"); } verifyNotReplaced(object, property); // store a function for restoring the replaced property push(fakeRestorers, getFakeRestorer(object, property)); Object.defineProperty(object, property, { get: replacement, configurable: isPropertyConfigurable(object, property) }); return replacement; }; sandbox.replaceSetter = function replaceSetter(object, property, replacement) { var descriptor = getPropertyDescriptor(object, property); if (typeof descriptor === "undefined") { throw new TypeError("Cannot replace non-existent own property " + valueToString(property)); } if (typeof replacement !== "function") { throw new TypeError("Expected replacement argument to be a function"); } if (typeof descriptor.set !== "function") { throw new Error("`object.property` is not a setter"); } verifyNotReplaced(object, property); // store a function for restoring the replaced property push(fakeRestorers, getFakeRestorer(object, property)); // eslint-disable-next-line accessor-pairs Object.defineProperty(object, property, { set: replacement, configurable: isPropertyConfigurable(object, property) }); return replacement; }; sandbox.spy = function spy() { var s = sinonSpy.apply(sinonSpy, arguments); push(collection, s); return s; }; sandbox.stub = function stub(object, property) { if (isEsModule(object)) { throw new TypeError("ES Modules cannot be stubbed"); } if (isNonExistentOwnProperty(object, property)) { throw new TypeError("Cannot stub non-existent own property " + valueToString(property)); } var stubbed = sinonStub.apply(null, arguments); var isStubbingEntireObject = typeof property === "undefined" && typeof object === "object"; if (isStubbingEntireObject) { var ownMethods = collectOwnMethods(stubbed); forEach(ownMethods, function(method) { push(collection, method); }); usePromiseLibrary(promiseLib, ownMethods); } else { push(collection, stubbed); usePromiseLibrary(promiseLib, stubbed); } return stubbed; }; // eslint-disable-next-line no-unused-vars sandbox.fake = function fake(f) { var s = sinonFake.apply(sinonFake, arguments); push(collection, s); return s; }; forEach(Object.keys(sinonFake), function(key) { var fakeBehavior = sinonFake[key]; if (typeof fakeBehavior === "function") { sandbox.fake[key] = function() { var s = fakeBehavior.apply(fakeBehavior, arguments); push(collection, s); return s; }; } }); sandbox.useFakeTimers = function useFakeTimers(args) { var clock = sinonClock.useFakeTimers.call(null, args); sandbox.clock = clock; push(collection, clock); return clock; }; sandbox.verify = function verify() { applyOnEach(collection, "verify"); }; sandbox.verifyAndRestore = function verifyAndRestore() { var exception; try { sandbox.verify(); } catch (e) { exception = e; } sandbox.restore(); if (exception) { throw exception; } }; sandbox.useFakeServer = function useFakeServer() { var proto = sandbox.serverPrototype || fakeServer; if (!proto || !proto.create) { return null; } sandbox.server = proto.create(); push(collection, sandbox.server); return sandbox.server; }; sandbox.useFakeXMLHttpRequest = function useFakeXMLHttpRequest() { var xhr = fakeXhr.useFakeXMLHttpRequest(); push(collection, xhr); return xhr; }; sandbox.usingPromise = function usingPromise(promiseLibrary) { promiseLib = promiseLibrary; collection.promiseLibrary = promiseLibrary; return sandbox; }; } Sandbox.prototype.assert = sinonAssert; Sandbox.prototype.match = match; module.exports = Sandbox; },{"./assert":2,"./collect-own-methods":5,"./fake":9,"./mock":11,"./spy":14,"./stub":16,"./util/core/get-property-descriptor":24,"./util/core/is-es-module":25,"./util/core/is-non-existent-own-property":26,"./util/core/is-property-configurable":27,"./util/core/use-promise-library":30,"./util/fake-timers":33,"@sinonjs/commons":39,"@sinonjs/samsam":65,"nise":85}],13:[function(require,module,exports){ "use strict"; var arrayProto = require("@sinonjs/commons").prototypes.array; var color = require("./color"); var match = require("@sinonjs/samsam").createMatcher; var timesInWords = require("./util/core/times-in-words"); var sinonFormat = require("./util/core/format"); var jsDiff = require("diff"); var join = arrayProto.join; var map = arrayProto.map; var push = arrayProto.push; function colorSinonMatchText(matcher, calledArg, calledArgMessage) { var calledArgumentMessage = calledArgMessage; if (!matcher.test(calledArg)) { matcher.message = color.red(matcher.message); if (calledArgumentMessage) { calledArgumentMessage = color.green(calledArgumentMessage); } } return calledArgumentMessage + " " + matcher.message; } function colorDiffText(diff) { var objects = map(diff, function(part) { var text = part.value; if (part.added) { text = color.green(text); } else if (part.removed) { text = color.red(text); } if (diff.length === 2) { text += " "; // format simple diffs } return text; }); return join(objects, ""); } module.exports = { c: function(spyInstance) { return timesInWords(spyInstance.callCount); }, n: function(spyInstance) { // eslint-disable-next-line local-rules/no-prototype-methods return spyInstance.toString(); }, D: function(spyInstance, args) { var message = ""; for (var i = 0, l = spyInstance.callCount; i < l; ++i) { // describe multiple calls if (l > 1) { message += "\nCall " + (i + 1) + ":"; } var calledArgs = spyInstance.getCall(i).args; for (var j = 0; j < calledArgs.length || j < args.length; ++j) { message += "\n"; var calledArgMessage = j < calledArgs.length ? sinonFormat(calledArgs[j]) : ""; if (match.isMatcher(args[j])) { message += colorSinonMatchText(args[j], calledArgs[j], calledArgMessage); } else { var expectedArgMessage = j < args.length ? sinonFormat(args[j]) : ""; var diff = jsDiff.diffJson(calledArgMessage, expectedArgMessage); message += colorDiffText(diff); } } } return message; }, C: function(spyInstance) { var calls = []; for (var i = 0, l = spyInstance.callCount; i < l; ++i) { // eslint-disable-next-line local-rules/no-prototype-methods var stringifiedCall = " " + spyInstance.getCall(i).toString(); if (/\n/.test(calls[i - 1])) { stringifiedCall = "\n" + stringifiedCall; } push(calls, stringifiedCall); } return calls.length > 0 ? "\n" + join(calls, "\n") : ""; }, t: function(spyInstance) { var objects = []; for (var i = 0, l = spyInstance.callCount; i < l; ++i) { push(objects, sinonFormat(spyInstance.thisValues[i])); } return join(objects, ", "); }, "*": function(spyInstance, args) { return join( map(args, function(arg) { return sinonFormat(arg); }), ", " ); } }; },{"./color":6,"./util/core/format":21,"./util/core/times-in-words":29,"@sinonjs/commons":39,"@sinonjs/samsam":65,"diff":69}],14:[function(require,module,exports){ "use strict"; var arrayProto = require("@sinonjs/commons").prototypes.array; var createBehavior = require("./behavior").create; var extend = require("./util/core/extend"); var functionName = require("@sinonjs/commons").functionName; var functionToString = require("./util/core/function-to-string"); var getPropertyDescriptor = require("./util/core/get-property-descriptor"); var deepEqual = require("@sinonjs/samsam").deepEqual; var isEsModule = require("./util/core/is-es-module"); var spyCall = require("./call"); var wrapMethod = require("./util/core/wrap-method"); var sinonFormat = require("./util/core/format"); var valueToString = require("@sinonjs/commons").valueToString; /* cache references to library methods so that they also can be stubbed without problems */ var concat = arrayProto.concat; var forEach = arrayProto.forEach; var pop = arrayProto.pop; var push = arrayProto.push; var slice = arrayProto.slice; var filter = Array.prototype.filter; var ErrorConstructor = Error.prototype.constructor; var bind = Function.prototype.bind; var callId = 0; function spy(object, property, types) { var descriptor, methodDesc; if (isEsModule(object)) { throw new TypeError("ES Modules cannot be spied"); } if (!property && typeof object === "function") { return spy.create(object); } if (!object && !property) { return spy.create(function() { return; }); } if (!types) { return wrapMethod(object, property, spy.create(object[property])); } descriptor = {}; methodDesc = getPropertyDescriptor(object, property); forEach(types, function(type) { descriptor[type] = spy.create(methodDesc[type]); }); return wrapMethod(object, property, descriptor); } function incrementCallCount() { this.called = true; this.callCount += 1; this.notCalled = false; this.calledOnce = this.callCount === 1; this.calledTwice = this.callCount === 2; this.calledThrice = this.callCount === 3; } function createCallProperties() { this.firstCall = this.getCall(0); this.secondCall = this.getCall(1); this.thirdCall = this.getCall(2); this.lastCall = this.getCall(this.callCount - 1); } function createProxy(func, proxyLength) { // Retain the function length: var p; if (proxyLength) { // Do not change this to use an eval. Projects that depend on sinon block the use of eval. // ref: https://github.com/sinonjs/sinon/issues/710 switch (proxyLength) { /*eslint-disable no-unused-vars, max-len*/ case 1: p = function proxy(a) { return p.invoke(func, this, slice(arguments)); }; break; case 2: p = function proxy(a, b) { return p.invoke(func, this, slice(arguments)); }; break; case 3: p = function proxy(a, b, c) { return p.invoke(func, this, slice(arguments)); }; break; case 4: p = function proxy(a, b, c, d) { return p.invoke(func, this, slice(arguments)); }; break; case 5: p = function proxy(a, b, c, d, e) { return p.invoke(func, this, slice(arguments)); }; break; case 6: p = function proxy(a, b, c, d, e, f) { return p.invoke(func, this, slice(arguments)); }; break; case 7: p = function proxy(a, b, c, d, e, f, g) { return p.invoke(func, this, slice(arguments)); }; break; case 8: p = function proxy(a, b, c, d, e, f, g, h) { return p.invoke(func, this, slice(arguments)); }; break; case 9: p = function proxy(a, b, c, d, e, f, g, h, i) { return p.invoke(func, this, slice(arguments)); }; break; case 10: p = function proxy(a, b, c, d, e, f, g, h, i, j) { return p.invoke(func, this, slice(arguments)); }; break; case 11: p = function proxy(a, b, c, d, e, f, g, h, i, j, k) { return p.invoke(func, this, slice(arguments)); }; break; case 12: p = function proxy(a, b, c, d, e, f, g, h, i, j, k, l) { return p.invoke(func, this, slice(arguments)); }; break; default: p = function proxy() { return p.invoke(func, this, slice(arguments)); }; break; /*eslint-enable*/ } } else { p = function proxy() { return p.invoke(func, this, slice(arguments)); }; } var nameDescriptor = Object.getOwnPropertyDescriptor(func, "name"); if (nameDescriptor && nameDescriptor.configurable) { // IE 11 functions don't have a name. // Safari 9 has names that are not configurable. Object.defineProperty(p, "name", nameDescriptor); } extend.nonEnum(p, { isSinonProxy: true, called: false, notCalled: true, calledOnce: false, calledTwice: false, calledThrice: false, callCount: 0, firstCall: null, secondCall: null, thirdCall: null, lastCall: null, args: [], returnValues: [], thisValues: [], exceptions: [], callIds: [], errorsWithCallStack: [] }); return p; } var uuid = 0; // Public API var spyApi = { formatters: require("./spy-formatters"), resetHistory: function() { if (this.invoking) { var err = new Error( "Cannot reset Sinon function while invoking it. " + "Move the call to .resetHistory outside of the callback." ); err.name = "InvalidResetException"; throw err; } this.called = false; this.notCalled = true; this.calledOnce = false; this.calledTwice = false; this.calledThrice = false; this.callCount = 0; this.firstCall = null; this.secondCall = null; this.thirdCall = null; this.lastCall = null; this.args = []; this.returnValues = []; this.thisValues = []; this.exceptions = []; this.callIds = []; this.errorsWithCallStack = []; if (this.fakes) { forEach(this.fakes, function(fake) { if (fake.resetHistory) { fake.resetHistory(); } else { fake.reset(); } }); } return this; }, create: function create(func, spyLength) { var name; var funk = func; if (typeof funk !== "function") { funk = function() { return; }; } else { name = functionName(funk); } var length = spyLength || funk.length; var proxy = createProxy(funk, length); extend.nonEnum(proxy, spy); delete proxy.create; extend(proxy, funk); proxy.resetHistory(); proxy.prototype = funk.prototype; extend.nonEnum(proxy, { displayName: name || "spy", toString: functionToString, instantiateFake: spy.create, id: "spy#" + uuid++ }); return proxy; }, invoke: function invoke(func, thisValue, args) { var matchings = this.matchingFakes(args); var currentCallId = callId++; var exception, returnValue; incrementCallCount.call(this); push(this.thisValues, thisValue); push(this.args, args); push(this.callIds, currentCallId); forEach(matchings, function(matching) { incrementCallCount.call(matching); push(matching.thisValues, thisValue); push(matching.args, args); push(matching.callIds, currentCallId); }); // Make call properties available from within the spied function: createCallProperties.call(this); forEach(matchings, function(matching) { createCallProperties.call(matching); }); try { this.invoking = true; var thisCall = this.getCall(this.callCount - 1); if (thisCall.calledWithNew()) { // Call through with `new` returnValue = new (bind.apply(this.func || func, concat([thisValue], args)))(); if (typeof returnValue !== "object") { returnValue = thisValue; } } else { returnValue = (this.func || func).apply(thisValue, args); } } catch (e) { exception = e; } finally { delete this.invoking; } push(this.exceptions, exception); push(this.returnValues, returnValue); forEach(matchings, function(matching) { push(matching.exceptions, exception); push(matching.returnValues, returnValue); }); var err = new ErrorConstructor(); // 1. Please do not get stack at this point. It may be so very slow, and not actually used // 2. PhantomJS does not serialize the stack trace until the error has been thrown: // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack try { throw err; } catch (e) { /* empty */ } push(this.errorsWithCallStack, err); forEach(matchings, function(matching) { push(matching.errorsWithCallStack, err); }); // Make return value and exception available in the calls: createCallProperties.call(this); forEach(matchings, function(matching) { createCallProperties.call(matching); }); if (exception !== undefined) { throw exception; } return returnValue; }, named: function named(name) { this.displayName = name; var nameDescriptor = Object.getOwnPropertyDescriptor(this, "name"); if (nameDescriptor && nameDescriptor.configurable) { // IE 11 functions don't have a name. // Safari 9 has names that are not configurable. nameDescriptor.value = name; Object.defineProperty(this, "name", nameDescriptor); } return this; }, getCall: function getCall(i) { if (i < 0 || i >= this.callCount) { return null; } return spyCall( this, this.thisValues[i], this.args[i], this.returnValues[i], this.exceptions[i], this.callIds[i], this.errorsWithCallStack[i] ); }, getCalls: function() { var calls = []; var i; for (i = 0; i < this.callCount; i++) { push(calls, this.getCall(i)); } return calls; }, calledBefore: function calledBefore(spyFn) { if (!this.called) { return false; } if (!spyFn.called) { return true; } return this.callIds[0] < spyFn.callIds[spyFn.callIds.length - 1]; }, calledAfter: function calledAfter(spyFn) { if (!this.called || !spyFn.called) { return false; } return this.callIds[this.callCount - 1] > spyFn.callIds[0]; }, calledImmediatelyBefore: function calledImmediatelyBefore(spyFn) { if (!this.called || !spyFn.called) { return false; } return this.callIds[this.callCount - 1] === spyFn.callIds[spyFn.callCount - 1] - 1; }, calledImmediatelyAfter: function calledImmediatelyAfter(spyFn) { if (!this.called || !spyFn.called) { return false; } return this.callIds[this.callCount - 1] === spyFn.callIds[spyFn.callCount - 1] + 1; }, withArgs: function() { var args = slice(arguments); if (this.fakes) { var matching = pop(this.matchingFakes(args, true)); if (matching) { return matching; } } else { extend.nonEnum(this, { fakes: [] }); } var original = this; var fake = this.instantiateFake(); fake.matchingArguments = args; fake.parent = this; push(this.fakes, fake); if (original.defaultBehavior && original.defaultBehavior.promiseLibrary) { fake.defaultBehavior = fake.defaultBehavior || createBehavior(fake); fake.defaultBehavior.promiseLibrary = original.defaultBehavior.promiseLibrary; } fake.withArgs = function() { return original.withArgs.apply(original, arguments); }; forEach(original.args, function(arg, i) { if (!fake.matches(arg)) { return; } incrementCallCount.call(fake); push(fake.thisValues, original.thisValues[i]); push(fake.args, arg); push(fake.returnValues, original.returnValues[i]); push(fake.exceptions, original.exceptions[i]); push(fake.callIds, original.callIds[i]); }); createCallProperties.call(fake); return fake; }, matchingFakes: function(args, strict) { return filter.call(this.fakes || [], function(fake) { return fake.matches(args, strict); }); }, matches: function(args, strict) { var margs = this.matchingArguments; if (margs.length <= args.length && deepEqual(slice(args, 0, margs.length), margs)) { return !strict || margs.length === args.length; } return undefined; }, printf: function(format) { var spyInstance = this; var args = slice(arguments, 1); var formatter; return (format || "").replace(/%(.)/g, function(match, specifyer) { formatter = spyApi.formatters[specifyer]; if (typeof formatter === "function") { return String(formatter(spyInstance, args)); } else if (!isNaN(parseInt(specifyer, 10))) { return sinonFormat(args[specifyer - 1]); } return "%" + specifyer; }); } }; function delegateToCalls(method, matchAny, actual, returnsValues, notCalled, totalCallCount) { spyApi[method] = function() { if (!this.called) { if (notCalled) { return notCalled.apply(this, arguments); } return false; } if (totalCallCount !== undefined && this.callCount !== totalCallCount) { return false; } var currentCall; var matches = 0; var returnValues = []; for (var i = 0, l = this.callCount; i < l; i += 1) { currentCall = this.getCall(i); var returnValue = currentCall[actual || method].apply(currentCall, arguments); push(returnValues, returnValue); if (returnValue) { matches += 1; if (matchAny) { return true; } } } if (returnsValues) { return returnValues; } return matches === this.callCount; }; } delegateToCalls("calledOn", true); delegateToCalls("alwaysCalledOn", false, "calledOn"); delegateToCalls("calledWith", true); delegateToCalls("calledOnceWith", true, "calledWith", false, undefined, 1); delegateToCalls("calledWithMatch", true); delegateToCalls("alwaysCalledWith", false, "calledWith"); delegateToCalls("alwaysCalledWithMatch", false, "calledWithMatch"); delegateToCalls("calledWithExactly", true); delegateToCalls("calledOnceWithExactly", true, "calledWithExactly", false, undefined, 1); delegateToCalls("alwaysCalledWithExactly", false, "calledWithExactly"); delegateToCalls("neverCalledWith", false, "notCalledWith", false, function() { return true; }); delegateToCalls("neverCalledWithMatch", false, "notCalledWithMatch", false, function() { return true; }); delegateToCalls("threw", true); delegateToCalls("alwaysThrew", false, "threw"); delegateToCalls("returned", true); delegateToCalls("alwaysReturned", false, "returned"); delegateToCalls("calledWithNew", true); delegateToCalls("alwaysCalledWithNew", false, "calledWithNew"); /* eslint-disable local-rules/no-prototype-methods */ delegateToCalls("callArg", false, "callArgWith", true, function() { throw new Error(this.toString() + " cannot call arg since it was not yet invoked."); }); spyApi.callArgWith = spyApi.callArg; delegateToCalls("callArgOn", false, "callArgOnWith", true, function() { throw new Error(this.toString() + " cannot call arg since it was not yet invoked."); }); spyApi.callArgOnWith = spyApi.callArgOn; delegateToCalls("throwArg", false, "throwArg", false, function() { throw new Error(this.toString() + " cannot throw arg since it was not yet invoked."); }); delegateToCalls("yield", false, "yield", true, function() { throw new Error(this.toString() + " cannot yield since it was not yet invoked."); }); // "invokeCallback" is an alias for "yield" since "yield" is invalid in strict mode. spyApi.invokeCallback = spyApi.yield; delegateToCalls("yieldOn", false, "yieldOn", true, function() { throw new Error(this.toString() + " cannot yield since it was not yet invoked."); }); delegateToCalls("yieldTo", false, "yieldTo", true, function(property) { throw new Error( this.toString() + " cannot yield to '" + valueToString(property) + "' since it was not yet invoked." ); }); delegateToCalls("yieldToOn", false, "yieldToOn", true, function(property) { throw new Error( this.toString() + " cannot yield to '" + valueToString(property) + "' since it was not yet invoked." ); }); /* eslint-enable local-rules/no-prototype-methods */ extend(spy, spyApi); spy.spyCall = spyCall; module.exports = spy; },{"./behavior":3,"./call":4,"./spy-formatters":13,"./util/core/extend":20,"./util/core/format":21,"./util/core/function-to-string":22,"./util/core/get-property-descriptor":24,"./util/core/is-es-module":25,"./util/core/wrap-method":32,"@sinonjs/commons":39,"@sinonjs/samsam":65}],15:[function(require,module,exports){ "use strict"; var getPropertyDescriptor = require("./util/core/get-property-descriptor"); var walk = require("./util/core/walk"); function stubEntireObject(stub, object) { walk(object || {}, function(prop, propOwner) { // we don't want to stub things like toString(), valueOf(), etc. so we only stub if the object // is not Object.prototype if ( propOwner !== Object.prototype && prop !== "constructor" && typeof getPropertyDescriptor(propOwner, prop).value === "function" ) { stub(object, prop); } }); return object; } module.exports = stubEntireObject; },{"./util/core/get-property-descriptor":24,"./util/core/walk":31}],16:[function(require,module,exports){ "use strict"; var arrayProto = require("@sinonjs/commons").prototypes.array; var behavior = require("./behavior"); var behaviors = require("./default-behaviors"); var hasOwnProperty = require("@sinonjs/commons").prototypes.object.hasOwnProperty; var isNonExistentOwnProperty = require("./util/core/is-non-existent-own-property"); var spy = require("./spy"); var extend = require("./util/core/extend"); var functionToString = require("./util/core/function-to-string"); var getPropertyDescriptor = require("./util/core/get-property-descriptor"); var isEsModule = require("./util/core/is-es-module"); var wrapMethod = require("./util/core/wrap-method"); var stubEntireObject = require("./stub-entire-object"); var throwOnFalsyObject = require("./throw-on-falsy-object"); var valueToString = require("@sinonjs/commons").valueToString; var forEach = arrayProto.forEach; var pop = arrayProto.pop; var slice = arrayProto.slice; var sort = arrayProto.sort; function stub(object, property) { if (arguments.length > 2) { throw new TypeError("stub(obj, 'meth', fn) has been removed, see documentation"); } if (isEsModule(object)) { throw new TypeError("ES Modules cannot be stubbed"); } throwOnFalsyObject.apply(null, arguments); if (isNonExistentOwnProperty(object, property)) { throw new TypeError("Cannot stub non-existent own property " + valueToString(property)); } var actualDescriptor = getPropertyDescriptor(object, property); var isObject = typeof object === "object" || typeof object === "function"; var isStubbingEntireObject = typeof property === "undefined" && isObject; var isCreatingNewStub = !object && typeof property === "undefined"; var isStubbingNonFuncProperty = isObject && typeof property !== "undefined" && (typeof actualDescriptor === "undefined" || typeof actualDescriptor.value !== "function") && typeof descriptor === "undefined"; var isStubbingExistingMethod = typeof object === "object" && typeof actualDescriptor !== "undefined" && typeof actualDescriptor.value === "function"; var arity = isStubbingExistingMethod ? object[property].length : 0; if (isStubbingEntireObject) { return stubEntireObject(stub, object); } if (isCreatingNewStub) { return stub.create(); } var s = stub.create(arity); extend.nonEnum(s, { rootObj: object, propName: property, restore: function restore() { if (actualDescriptor !== undefined) { Object.defineProperty(object, property, actualDescriptor); return; } delete object[property]; } }); return isStubbingNonFuncProperty ? s : wrapMethod(object, property, s); } stub.createStubInstance = function(constructor, overrides) { if (typeof constructor !== "function") { throw new TypeError("The constructor should be a function."); } var stubbedObject = stub(Object.create(constructor.prototype)); forEach(Object.keys(overrides || {}), function(propertyName) { if (propertyName in stubbedObject) { var value = overrides[propertyName]; if (value && value.createStubInstance) { stubbedObject[propertyName] = value; } else { stubbedObject[propertyName].returns(value); } } else { throw new Error("Cannot stub " + propertyName + ". Property does not exist!"); } }); return stubbedObject; }; /*eslint-disable no-use-before-define*/ function getParentBehaviour(stubInstance) { return stubInstance.parent && getCurrentBehavior(stubInstance.parent); } function getDefaultBehavior(stubInstance) { return stubInstance.defaultBehavior || getParentBehaviour(stubInstance) || behavior.create(stubInstance); } function getCurrentBehavior(stubInstance) { var currentBehavior = stubInstance.behaviors[stubInstance.callCount - 1]; return currentBehavior && currentBehavior.isPresent() ? currentBehavior : getDefaultBehavior(stubInstance); } /*eslint-enable no-use-before-define*/ var uuid = 0; var proto = { create: function create(stubLength) { var functionStub = function() { var args = slice(arguments); var matchings = functionStub.matchingFakes(args); var fnStub = pop( sort(matchings, function(a, b) { return a.matchingArguments.length - b.matchingArguments.length; }) ) || functionStub; return getCurrentBehavior(fnStub).invoke(this, arguments); }; var orig = functionStub; functionStub = spy.create(functionStub, stubLength); extend.nonEnum(functionStub, { id: "stub#" + uuid++, func: orig }); extend(functionStub, stub); extend.nonEnum(functionStub, { instantiateFake: stub.create, displayName: "stub", toString: functionToString, defaultBehavior: null, behaviors: [] }); return functionStub; }, resetBehavior: function() { var fakes = this.fakes || []; this.defaultBehavior = null; this.behaviors = []; delete this.returnValue; delete this.returnArgAt; delete this.throwArgAt; delete this.resolveArgAt; delete this.fakeFn; this.returnThis = false; this.resolveThis = false; forEach(fakes, function(fake) { fake.resetBehavior(); }); }, resetHistory: spy.resetHistory, reset: function() { this.resetHistory(); this.resetBehavior(); }, onCall: function onCall(index) { if (!this.behaviors[index]) { this.behaviors[index] = behavior.create(this); } return this.behaviors[index]; }, onFirstCall: function onFirstCall() { return this.onCall(0); }, onSecondCall: function onSecondCall() { return this.onCall(1); }, onThirdCall: function onThirdCall() { return this.onCall(2); } }; forEach(Object.keys(behavior), function(method) { if ( hasOwnProperty(behavior, method) && !hasOwnProperty(proto, method) && method !== "create" && method !== "withArgs" && method !== "invoke" ) { proto[method] = behavior.createBehavior(method); } }); forEach(Object.keys(behaviors), function(method) { if (hasOwnProperty(behaviors, method) && !hasOwnProperty(proto, method)) { behavior.addBehavior(stub, method, behaviors[method]); } }); extend(stub, proto); module.exports = stub; },{"./behavior":3,"./default-behaviors":8,"./spy":14,"./stub-entire-object":15,"./throw-on-falsy-object":17,"./util/core/extend":20,"./util/core/function-to-string":22,"./util/core/get-property-descriptor":24,"./util/core/is-es-module":25,"./util/core/is-non-existent-own-property":26,"./util/core/wrap-method":32,"@sinonjs/commons":39}],17:[function(require,module,exports){ "use strict"; var valueToString = require("@sinonjs/commons").valueToString; function throwOnFalsyObject(object, property) { if (property && !object) { var type = object === null ? "null" : "undefined"; throw new Error("Trying to stub property '" + valueToString(property) + "' of " + type); } } module.exports = throwOnFalsyObject; },{"@sinonjs/commons":39}],18:[function(require,module,exports){ "use strict"; module.exports = { injectInto: null, properties: [ "spy", "stub", "mock", "clock", "server", "requests", "fake", "replace", "replaceSetter", "replaceGetter", "createStubInstance" ], useFakeTimers: true, useFakeServer: true }; },{}],19:[function(require,module,exports){ "use strict"; var arrayProto = require("@sinonjs/commons").prototypes.array; var reduce = arrayProto.reduce; module.exports = function exportAsyncBehaviors(behaviorMethods) { return reduce( Object.keys(behaviorMethods), function(acc, method) { // need to avoid creating another async versions of the newly added async methods if (method.match(/^(callsArg|yields)/) && !method.match(/Async/)) { acc[method + "Async"] = function() { var result = behaviorMethods[method].apply(this, arguments); this.callbackAsync = true; return result; }; } return acc; }, {} ); }; },{"@sinonjs/commons":39}],20:[function(require,module,exports){ "use strict"; var arrayProto = require("@sinonjs/commons").prototypes.array; var hasOwnProperty = require("@sinonjs/commons").prototypes.object.hasOwnProperty; var join = arrayProto.join; var push = arrayProto.push; var slice = arrayProto.slice; // Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug var hasDontEnumBug = (function() { var obj = { constructor: function() { return "0"; }, toString: function() { return "1"; }, valueOf: function() { return "2"; }, toLocaleString: function() { return "3"; }, prototype: function() { return "4"; }, isPrototypeOf: function() { return "5"; }, propertyIsEnumerable: function() { return "6"; }, hasOwnProperty: function() { return "7"; }, length: function() { return "8"; }, unique: function() { return "9"; } }; var result = []; for (var prop in obj) { if (hasOwnProperty(obj, prop)) { push(result, obj[prop]()); } } return join(result, "") !== "0123456789"; })(); function extendCommon(target, sources, doCopy) { var source, i, prop; for (i = 0; i < sources.length; i++) { source = sources[i]; for (prop in source) { if (hasOwnProperty(source, prop)) { doCopy(target, source, prop); } } // Make sure we copy (own) toString method even when in JScript with DontEnum bug // See https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug if (hasDontEnumBug && hasOwnProperty(source, "toString") && source.toString !== target.toString) { target.toString = source.toString; } } return target; } /** Public: Extend target in place with all (own) properties from sources in-order. Thus, last source will * override properties in previous sources. * * @arg {Object} target - The Object to extend * @arg {Object[]} sources - Objects to copy properties from. * * @returns {Object} the extended target */ module.exports = function extend(target /*, sources */) { var sources = slice(arguments, 1); return extendCommon(target, sources, function copyValue(dest, source, prop) { dest[prop] = source[prop]; }); }; /** Public: Extend target in place with all (own) properties from sources in-order. Thus, last source will * override properties in previous sources. Define the properties as non enumerable. * * @arg {Object} target - The Object to extend * @arg {Object[]} sources - Objects to copy properties from. * * @returns {Object} the extended target */ module.exports.nonEnum = function extendNonEnum(target /*, sources */) { var sources = slice(arguments, 1); return extendCommon(target, sources, function copyProperty(dest, source, prop) { Object.defineProperty(dest, prop, { value: source[prop], enumerable: false, configurable: true, writable: true }); }); }; },{"@sinonjs/commons":39}],21:[function(require,module,exports){ "use strict"; var formatio = require("@sinonjs/formatio"); var formatter = formatio.configure({ quoteStrings: false, limitChildrenCount: 250 }); var customFormatter; function format() { if (customFormatter) { return customFormatter.apply(null, arguments); } return formatter.ascii.apply(formatter, arguments); } format.setFormatter = function(aCustomFormatter) { if (typeof aCustomFormatter !== "function") { throw new Error("format.setFormatter must be called with a function"); } customFormatter = aCustomFormatter; }; module.exports = format; },{"@sinonjs/formatio":49}],22:[function(require,module,exports){ "use strict"; module.exports = function toString() { var i, prop, thisValue; if (this.getCall && this.callCount) { i = this.callCount; while (i--) { thisValue = this.getCall(i).thisValue; for (prop in thisValue) { if (thisValue[prop] === this) { return prop; } } } } return this.displayName || "sinon fake"; }; },{}],23:[function(require,module,exports){ "use strict"; /* istanbul ignore next : not testing that setTimeout works */ function nextTick(callback) { setTimeout(callback, 0); } module.exports = function getNextTick(process, setImmediate) { if (typeof process === "object" && typeof process.nextTick === "function") { return process.nextTick; } if (typeof setImmediate === "function") { return setImmediate; } return nextTick; }; },{}],24:[function(require,module,exports){ "use strict"; module.exports = function getPropertyDescriptor(object, property) { var proto = object; var descriptor; while (proto && !(descriptor = Object.getOwnPropertyDescriptor(proto, property))) { proto = Object.getPrototypeOf(proto); } return descriptor; }; },{}],25:[function(require,module,exports){ "use strict"; /** * Verify if an object is a ECMAScript Module * * As the exports from a module is immutable we cannot alter the exports * using spies or stubs. Let the consumer know this to avoid bug reports * on weird error messages. * * @param {Object} object The object to examine * * @returns {Boolean} true when the object is a module */ module.exports = function(object) { return ( object && typeof Symbol !== "undefined" && object[Symbol.toStringTag] === "Module" && Object.isSealed(object) ); }; },{}],26:[function(require,module,exports){ "use strict"; function isNonExistentOwnProperty(object, property) { return object && typeof property !== "undefined" && !(property in object); } module.exports = isNonExistentOwnProperty; },{}],27:[function(require,module,exports){ "use strict"; var getPropertyDescriptor = require("./get-property-descriptor"); function isPropertyConfigurable(obj, propName) { var propertyDescriptor = getPropertyDescriptor(obj, propName); return propertyDescriptor ? propertyDescriptor.configurable : true; } module.exports = isPropertyConfigurable; },{"./get-property-descriptor":24}],28:[function(require,module,exports){ (function (global){ "use strict"; var getNextTick = require("./get-next-tick"); /* istanbul ignore next */ var root = typeof window !== "undefined" ? window : global; module.exports = getNextTick(root.process, root.setImmediate); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./get-next-tick":23}],29:[function(require,module,exports){ "use strict"; var array = [null, "once", "twice", "thrice"]; module.exports = function timesInWords(count) { return array[count] || (count || 0) + " times"; }; },{}],30:[function(require,module,exports){ "use strict"; var forEach = Array.prototype.forEach; function usePromiseLibrary(library, fakes) { if (typeof library === "undefined") { return; } if (Array.isArray(fakes)) { forEach.call(fakes, usePromiseLibrary.bind(null, library)); return; } if (typeof fakes.usingPromise === "function") { fakes.usingPromise(library); } } module.exports = usePromiseLibrary; },{}],31:[function(require,module,exports){ "use strict"; var forEach = require("@sinonjs/commons").prototypes.array.forEach; function walkInternal(obj, iterator, context, originalObj, seen) { var proto, prop; if (typeof Object.getOwnPropertyNames !== "function") { // We explicitly want to enumerate through all of the prototype's properties // in this case, therefore we deliberately leave out an own property check. /* eslint-disable-next-line guard-for-in */ for (prop in obj) { iterator.call(context, obj[prop], prop, obj); } return; } forEach(Object.getOwnPropertyNames(obj), function(k) { if (seen[k] !== true) { seen[k] = true; var target = typeof Object.getOwnPropertyDescriptor(obj, k).get === "function" ? originalObj : obj; iterator.call(context, k, target); } }); proto = Object.getPrototypeOf(obj); if (proto) { walkInternal(proto, iterator, context, originalObj, seen); } } /* Walks the prototype chain of an object and iterates over every own property * name encountered. The iterator is called in the same fashion that Array.prototype.forEach * works, where it is passed the value, key, and own object as the 1st, 2nd, and 3rd positional * argument, respectively. In cases where Object.getOwnPropertyNames is not available, walk will * default to using a simple for..in loop. * * obj - The object to walk the prototype chain for. * iterator - The function to be called on each pass of the walk. * context - (Optional) When given, the iterator will be called with this object as the receiver. */ module.exports = function walk(obj, iterator, context) { return walkInternal(obj, iterator, context, obj, {}); }; },{"@sinonjs/commons":39}],32:[function(require,module,exports){ "use strict"; var getPropertyDescriptor = require("./get-property-descriptor"); var extend = require("./extend"); var hasOwnProperty = require("@sinonjs/commons").prototypes.object.hasOwnProperty; var valueToString = require("@sinonjs/commons").valueToString; function isFunction(obj) { return typeof obj === "function" || Boolean(obj && obj.constructor && obj.call && obj.apply); } function mirrorProperties(target, source) { for (var prop in source) { if (!hasOwnProperty(target, prop)) { target[prop] = source[prop]; } } } // Cheap way to detect if we have ES5 support. var hasES5Support = "keys" in Object; module.exports = function wrapMethod(object, property, method) { if (!object) { throw new TypeError("Should wrap property of object"); } if (typeof method !== "function" && typeof method !== "object") { throw new TypeError("Method wrapper should be a function or a property descriptor"); } function checkWrappedMethod(wrappedMethod) { var error; if (!isFunction(wrappedMethod)) { error = new TypeError( "Attempted to wrap " + typeof wrappedMethod + " property " + valueToString(property) + " as function" ); } else if (wrappedMethod.restore && wrappedMethod.restore.sinon) { error = new TypeError("Attempted to wrap " + valueToString(property) + " which is already wrapped"); } else if (wrappedMethod.calledBefore) { var verb = wrappedMethod.returns ? "stubbed" : "spied on"; error = new TypeError("Attempted to wrap " + valueToString(property) + " which is already " + verb); } if (error) { if (wrappedMethod && wrappedMethod.stackTraceError) { error.stack += "\n--------------\n" + wrappedMethod.stackTraceError.stack; } throw error; } } var error, wrappedMethod, i, wrappedMethodDesc; function simplePropertyAssignment() { wrappedMethod = object[property]; checkWrappedMethod(wrappedMethod); object[property] = method; method.displayName = property; } // Firefox has a problem when using hasOwn.call on objects from other frames. /* eslint-disable-next-line local-rules/no-prototype-methods */ var owned = object.hasOwnProperty ? object.hasOwnProperty(property) : hasOwnProperty(object, property); if (hasES5Support) { var methodDesc = typeof method === "function" ? { value: method } : method; wrappedMethodDesc = getPropertyDescriptor(object, property); if (!wrappedMethodDesc) { error = new TypeError( "Attempted to wrap " + typeof wrappedMethod + " property " + property + " as function" ); } else if (wrappedMethodDesc.restore && wrappedMethodDesc.restore.sinon) { error = new TypeError("Attempted to wrap " + property + " which is already wrapped"); } if (error) { if (wrappedMethodDesc && wrappedMethodDesc.stackTraceError) { error.stack += "\n--------------\n" + wrappedMethodDesc.stackTraceError.stack; } throw error; } var types = Object.keys(methodDesc); for (i = 0; i < types.length; i++) { wrappedMethod = wrappedMethodDesc[types[i]]; checkWrappedMethod(wrappedMethod); } mirrorProperties(methodDesc, wrappedMethodDesc); for (i = 0; i < types.length; i++) { mirrorProperties(methodDesc[types[i]], wrappedMethodDesc[types[i]]); } Object.defineProperty(object, property, methodDesc); // catch failing assignment // this is the converse of the check in `.restore` below if (typeof method === "function" && object[property] !== method) { // correct any wrongdoings caused by the defineProperty call above, // such as adding new items (if object was a Storage object) delete object[property]; simplePropertyAssignment(); } } else { simplePropertyAssignment(); } extend.nonEnum(method, { displayName: property, // Set up an Error object for a stack trace which can be used later to find what line of // code the original method was created on. stackTraceError: new Error("Stack Trace for original"), restore: function() { // For prototype properties try to reset by delete first. // If this fails (ex: localStorage on mobile safari) then force a reset // via direct assignment. if (!owned) { // In some cases `delete` may throw an error try { delete object[property]; } catch (e) {} // eslint-disable-line no-empty // For native code functions `delete` fails without throwing an error // on Chrome < 43, PhantomJS, etc. } else if (hasES5Support) { Object.defineProperty(object, property, wrappedMethodDesc); } if (hasES5Support) { var descriptor = getPropertyDescriptor(object, property); if (descriptor && descriptor.value === method) { object[property] = wrappedMethod; } } else { // Use strict equality comparison to check failures then force a reset // via direct assignment. if (object[property] === method) { object[property] = wrappedMethod; } } } }); method.wrappedMethod = wrappedMethod; method.restore.sinon = true; if (!hasES5Support) { mirrorProperties(method, wrappedMethod); } return method; }; },{"./extend":20,"./get-property-descriptor":24,"@sinonjs/commons":39}],33:[function(require,module,exports){ "use strict"; var extend = require("./core/extend"); var llx = require("lolex"); function createClock(config, globalCtx) { var llxCtx = llx; if (globalCtx !== null && typeof globalCtx === "object") { llxCtx = llx.withGlobal(globalCtx); } var clock = llxCtx.install(config); clock.restore = clock.uninstall; return clock; } /** * @param {number|Date|Object} dateOrConfig The unix epoch value to install with (default 0) * @returns {Object} Returns a lolex clock instance */ exports.useFakeTimers = function(dateOrConfig) { var hasArguments = typeof dateOrConfig !== "undefined"; var argumentIsDateLike = (typeof dateOrConfig === "number" || dateOrConfig instanceof Date) && arguments.length === 1; var argumentIsObject = dateOrConfig !== null && typeof dateOrConfig === "object" && arguments.length === 1; if (!hasArguments) { return createClock({ now: 0 }); } if (argumentIsDateLike) { return createClock({ now: dateOrConfig }); } if (argumentIsObject) { var config = extend.nonEnum({}, dateOrConfig); var globalCtx = config.global; delete config.global; return createClock(config, globalCtx); } throw new TypeError("useFakeTimers expected epoch or config object. See https://github.com/sinonjs/sinon"); }; exports.clock = { create: function(now) { return llx.createClock(now); } }; exports.timers = { setTimeout: setTimeout, clearTimeout: clearTimeout, setImmediate: typeof setImmediate !== "undefined" ? setImmediate : undefined, clearImmediate: typeof clearImmediate !== "undefined" ? clearImmediate : undefined, setInterval: setInterval, clearInterval: clearInterval, Date: Date }; },{"./core/extend":20,"lolex":73}],34:[function(require,module,exports){ "use strict"; var every = require("./prototypes/array").every; function hasCallsLeft(callMap, spy) { if (callMap[spy.id] === undefined) { callMap[spy.id] = 0; } return callMap[spy.id] < spy.callCount; } function checkAdjacentCalls(callMap, spy, index, spies) { var calledBeforeNext = true; if (index !== spies.length - 1) { calledBeforeNext = spy.calledBefore(spies[index + 1]); } if (hasCallsLeft(callMap, spy) && calledBeforeNext) { callMap[spy.id] += 1; return true; } return false; } module.exports = function calledInOrder(spies) { var callMap = {}; // eslint-disable-next-line no-underscore-dangle var _spies = arguments.length > 1 ? arguments : spies; return every(_spies, checkAdjacentCalls.bind(null, callMap)); }; },{"./prototypes/array":41}],35:[function(require,module,exports){ "use strict"; var functionName = require("./function-name"); module.exports = function className(value) { return ( (value.constructor && value.constructor.name) || // The next branch is for IE11 support only: // Because the name property is not set on the prototype // of the Function object, we finally try to grab the // name from its definition. This will never be reached // in node, so we are not able to test this properly. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name (typeof value.constructor === "function" && /* istanbul ignore next */ functionName(value.constructor)) || null ); }; },{"./function-name":38}],36:[function(require,module,exports){ /* eslint-disable no-console */ "use strict"; // wrap returns a function that will invoke the supplied function and print a deprecation warning to the console each // time it is called. exports.wrap = function(func, msg) { var wrapped = function() { exports.printWarning(msg); return func.apply(this, arguments); }; if (func.prototype) { wrapped.prototype = func.prototype; } return wrapped; }; // defaultMsg returns a string which can be supplied to `wrap()` to notify the user that a particular part of the // sinon API has been deprecated. exports.defaultMsg = function(packageName, funcName) { return ( packageName + "." + funcName + " is deprecated and will be removed from the public API in a future version of " + packageName + "." ); }; exports.printWarning = function(msg) { // Watch out for IE7 and below! :( /* istanbul ignore next */ if (typeof console !== "undefined") { if (console.info) { console.info(msg); } else { console.log(msg); } } }; },{}],37:[function(require,module,exports){ "use strict"; // This is an `every` implementation that works for all iterables module.exports = function every(obj, fn) { var pass = true; try { /* eslint-disable-next-line local-rules/no-prototype-methods */ obj.forEach(function() { if (!fn.apply(this, arguments)) { // Throwing an error is the only way to break `forEach` throw new Error(); } }); } catch (e) { pass = false; } return pass; }; },{}],38:[function(require,module,exports){ "use strict"; module.exports = function functionName(func) { if (!func) { return ""; } return ( func.displayName || func.name || // Use function decomposition as a last resort to get function // name. Does not rely on function decomposition to work - if it // doesn't debugging will be slightly less informative // (i.e. toString will say 'spy' rather than 'myFunc'). (String(func).match(/function ([^\s(]+)/) || [])[1] ); }; },{}],39:[function(require,module,exports){ "use strict"; module.exports = { calledInOrder: require("./called-in-order"), className: require("./class-name"), deprecated: require("./deprecated"), every: require("./every"), functionName: require("./function-name"), orderByFirstCall: require("./order-by-first-call"), prototypes: require("./prototypes"), typeOf: require("./type-of"), valueToString: require("./value-to-string") }; },{"./called-in-order":34,"./class-name":35,"./deprecated":36,"./every":37,"./function-name":38,"./order-by-first-call":40,"./prototypes":44,"./type-of":47,"./value-to-string":48}],40:[function(require,module,exports){ "use strict"; var sort = require("./prototypes/array").sort; var slice = require("./prototypes/array").slice; function comparator(a, b) { // uuid, won't ever be equal var aCall = a.getCall(0); var bCall = b.getCall(0); var aId = (aCall && aCall.callId) || -1; var bId = (bCall && bCall.callId) || -1; return aId < bId ? -1 : 1; } module.exports = function orderByFirstCall(spies) { return sort(slice(spies), comparator); }; },{"./prototypes/array":41}],41:[function(require,module,exports){ "use strict"; var copyPrototype = require("./copy-prototype"); module.exports = copyPrototype(Array.prototype); },{"./copy-prototype":42}],42:[function(require,module,exports){ "use strict"; var call = Function.call; module.exports = function copyPrototypeMethods(prototype) { /* eslint-disable local-rules/no-prototype-methods */ return Object.getOwnPropertyNames(prototype).reduce(function(result, name) { // ignore size because it throws from Map if ( name !== "size" && name !== "caller" && name !== "callee" && name !== "arguments" && typeof prototype[name] === "function" ) { result[name] = call.bind(prototype[name]); } return result; }, Object.create(null)); }; },{}],43:[function(require,module,exports){ "use strict"; var copyPrototype = require("./copy-prototype"); module.exports = copyPrototype(Function.prototype); },{"./copy-prototype":42}],44:[function(require,module,exports){ "use strict"; module.exports = { array: require("./array"), function: require("./function"), object: require("./object"), string: require("./string") }; },{"./array":41,"./function":43,"./object":45,"./string":46}],45:[function(require,module,exports){ "use strict"; var copyPrototype = require("./copy-prototype"); module.exports = copyPrototype(Object.prototype); },{"./copy-prototype":42}],46:[function(require,module,exports){ "use strict"; var copyPrototype = require("./copy-prototype"); module.exports = copyPrototype(String.prototype); },{"./copy-prototype":42}],47:[function(require,module,exports){ "use strict"; var type = require("type-detect"); module.exports = function typeOf(value) { return type(value).toLowerCase(); }; },{"type-detect":89}],48:[function(require,module,exports){ "use strict"; function valueToString(value) { if (value && value.toString) { /* eslint-disable-next-line local-rules/no-prototype-methods */ return value.toString(); } return String(value); } module.exports = valueToString; },{}],49:[function(require,module,exports){ (function (global){ "use strict"; var samsam = require("@sinonjs/samsam"); var functionName = require("@sinonjs/commons").functionName; var typeOf = require("@sinonjs/commons").typeOf; var formatio = { excludeConstructors: ["Object", /^.$/], quoteStrings: true, limitChildrenCount: 0 }; var specialObjects = []; if (typeof global !== "undefined") { specialObjects.push({ object: global, value: "[object global]" }); } if (typeof document !== "undefined") { specialObjects.push({ object: document, value: "[object HTMLDocument]" }); } if (typeof window !== "undefined") { specialObjects.push({ object: window, value: "[object Window]" }); } function constructorName(f, object) { var name = functionName(object && object.constructor); var excludes = f.excludeConstructors || formatio.excludeConstructors || []; var i, l; for (i = 0, l = excludes.length; i < l; ++i) { if (typeof excludes[i] === "string" && excludes[i] === name) { return ""; } else if (excludes[i].test && excludes[i].test(name)) { return ""; } } return name; } function isCircular(object, objects) { if (typeof object !== "object") { return false; } var i, l; for (i = 0, l = objects.length; i < l; ++i) { if (objects[i] === object) { return true; } } return false; } function ascii(f, object, processed, indent) { if (typeof object === "string") { if (object.length === 0) { return "(empty string)"; } var qs = f.quoteStrings; var quote = typeof qs !== "boolean" || qs; return processed || quote ? "\"" + object + "\"" : object; } if (typeof object === "symbol") { return object.toString(); } if (typeof object === "function" && !(object instanceof RegExp)) { return ascii.func(object); } processed = processed || []; if (isCircular(object, processed)) { return "[Circular]"; } if (typeOf(object) === "array") { return ascii.array.call(f, object, processed); } if (!object) { return String((1 / object) === -Infinity ? "-0" : object); } if (samsam.isElement(object)) { return ascii.element(object); } if (typeof object.toString === "function" && object.toString !== Object.prototype.toString) { return object.toString(); } var i, l; for (i = 0, l = specialObjects.length; i < l; i++) { if (object === specialObjects[i].object) { return specialObjects[i].value; } } if (samsam.isSet(object)) { return ascii.set.call(f, object, processed); } return ascii.object.call(f, object, processed, indent); } ascii.func = function (func) { var funcName = functionName(func) || ""; return "function " + funcName + "() {}"; }; function delimit(str, delimiters) { delimiters = delimiters || ["[", "]"]; return delimiters[0] + str + delimiters[1]; } ascii.array = function (array, processed, delimiters) { processed = processed || []; processed.push(array); var pieces = []; var i, l; l = (this.limitChildrenCount > 0) ? Math.min(this.limitChildrenCount, array.length) : array.length; for (i = 0; i < l; ++i) { pieces.push(ascii(this, array[i], processed)); } if (l < array.length) { pieces.push("[... " + (array.length - l) + " more elements]"); } return delimit(pieces.join(", "), delimiters); }; ascii.set = function (set, processed) { return ascii.array.call(this, Array.from(set), processed, ["Set {", "}"]); }; ascii.object = function (object, processed, indent) { processed = processed || []; processed.push(object); indent = indent || 0; var pieces = []; var symbols = typeof Object.getOwnPropertySymbols === "function" ? Object.getOwnPropertySymbols(object) : []; var properties = Object.keys(object).sort().concat(symbols); var length = 3; var prop, str, obj, i, k, l; l = (this.limitChildrenCount > 0) ? Math.min(this.limitChildrenCount, properties.length) : properties.length; for (i = 0; i < l; ++i) { prop = properties[i]; obj = object[prop]; if (isCircular(obj, processed)) { str = "[Circular]"; } else { str = ascii(this, obj, processed, indent + 2); } str = ( typeof prop === "string" && /\s/.test(prop) ? "\"" + prop + "\"" : prop.toString() ) + ": " + str; length += str.length; pieces.push(str); } var cons = constructorName(this, object); var prefix = cons ? "[" + cons + "] " : ""; var is = ""; for (i = 0, k = indent; i < k; ++i) { is += " "; } if (l < properties.length) {pieces.push("[... " + (properties.length - l) + " more elements]");} if (length + indent > 80) { return prefix + "{\n " + is + pieces.join(",\n " + is) + "\n" + is + "}"; } return prefix + "{ " + pieces.join(", ") + " }"; }; ascii.element = function (element) { var tagName = element.tagName.toLowerCase(); var attrs = element.attributes; var pairs = []; var attr, attrName, i, l, val; for (i = 0, l = attrs.length; i < l; ++i) { attr = attrs.item(i); attrName = attr.nodeName.toLowerCase().replace("html:", ""); val = attr.nodeValue; if (attrName !== "contenteditable" || val !== "inherit") { if (val) { pairs.push(attrName + "=\"" + val + "\""); } } } var formatted = "<" + tagName + (pairs.length > 0 ? " " : ""); // SVG elements have undefined innerHTML var content = element.innerHTML || ""; if (content.length > 20) { content = content.substr(0, 20) + "[...]"; } var res = formatted + pairs.join(" ") + ">" + content + ""; return res.replace(/ contentEditable="inherit"/, ""); }; function Formatio(options) { // eslint-disable-next-line guard-for-in for (var opt in options) { this[opt] = options[opt]; } } Formatio.prototype = { functionName: functionName, configure: function (options) { return new Formatio(options); }, constructorName: function (object) { return constructorName(this, object); }, ascii: function (object, processed, indent) { return ascii(this, object, processed, indent); } }; module.exports = Formatio.prototype; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"@sinonjs/commons":39,"@sinonjs/samsam":65}],50:[function(require,module,exports){ "use strict"; var valueToString = require("@sinonjs/commons").valueToString; var getClass = require("./get-class"); var identical = require("./identical"); var isArguments = require("./is-arguments"); var isDate = require("./is-date"); var isElement = require("./is-element"); var isNaN = require("./is-nan"); var isObject = require("./is-object"); var isSet = require("./is-set"); var isSubset = require("./is-subset"); var getClassName = require("./get-class-name"); var every = Array.prototype.every; var getTime = Date.prototype.getTime; var hasOwnProperty = Object.prototype.hasOwnProperty; var indexOf = Array.prototype.indexOf; var keys = Object.keys; var getOwnPropertySymbols = Object.getOwnPropertySymbols; /** * @name samsam.deepEqual * @param Object actual * @param Object expectation * * Deep equal comparison. Two values are "deep equal" if: * * - They are equal, according to samsam.identical * - They are both date objects representing the same time * - They are both arrays containing elements that are all deepEqual * - They are objects with the same set of properties, and each property * in ``actual`` is deepEqual to the corresponding property in ``expectation`` * * Supports cyclic objects. */ function deepEqualCyclic(actual, expectation, match) { // used for cyclic comparison // contain already visited objects var actualObjects = []; var expectationObjects = []; // contain pathes (position in the object structure) // of the already visited objects // indexes same as in objects arrays var actualPaths = []; var expectationPaths = []; // contains combinations of already compared objects // in the manner: { "$1['ref']$2['ref']": true } var compared = {}; // does the recursion for the deep equal check return (function deepEqual( actualObj, expectationObj, actualPath, expectationPath ) { // If both are matchers they must be the same instance in order to be // considered equal If we didn't do that we would end up running one // matcher against the other if (match && match.isMatcher(expectationObj)) { if (match.isMatcher(actualObj)) { return actualObj === expectationObj; } return expectationObj.test(actualObj); } var actualType = typeof actualObj; var expectationType = typeof expectationObj; // == null also matches undefined if ( actualObj === expectationObj || isNaN(actualObj) || isNaN(expectationObj) || actualObj == null || expectationObj == null || actualType !== "object" || expectationType !== "object" ) { return identical(actualObj, expectationObj); } // Elements are only equal if identical(expected, actual) if (isElement(actualObj) || isElement(expectationObj)) { return false; } var isActualDate = isDate(actualObj); var isExpectationDate = isDate(expectationObj); if (isActualDate || isExpectationDate) { if ( !isActualDate || !isExpectationDate || getTime.call(actualObj) !== getTime.call(expectationObj) ) { return false; } } if (actualObj instanceof RegExp && expectationObj instanceof RegExp) { if (valueToString(actualObj) !== valueToString(expectationObj)) { return false; } } if (actualObj instanceof Error && expectationObj instanceof Error) { return actualObj === expectationObj; } var actualClass = getClass(actualObj); var expectationClass = getClass(expectationObj); var actualKeys = keys(actualObj); var expectationKeys = keys(expectationObj); var actualName = getClassName(actualObj); var expectationName = getClassName(expectationObj); var expectationSymbols = typeof getOwnPropertySymbols === "function" ? getOwnPropertySymbols(expectationObj) : []; var expectationKeysAndSymbols = expectationKeys.concat( expectationSymbols ); if (isArguments(actualObj) || isArguments(expectationObj)) { if (actualObj.length !== expectationObj.length) { return false; } } else { if ( actualType !== expectationType || actualClass !== expectationClass || actualKeys.length !== expectationKeys.length || (actualName && expectationName && actualName !== expectationName) ) { return false; } } if (isSet(actualObj) || isSet(expectationObj)) { if ( !isSet(actualObj) || !isSet(expectationObj) || actualObj.size !== expectationObj.size ) { return false; } return isSubset(actualObj, expectationObj, deepEqual); } return every.call(expectationKeysAndSymbols, function(key) { if (!hasOwnProperty.call(actualObj, key)) { return false; } var actualValue = actualObj[key]; var expectationValue = expectationObj[key]; var actualObject = isObject(actualValue); var expectationObject = isObject(expectationValue); // determines, if the objects were already visited // (it's faster to check for isObject first, than to // get -1 from getIndex for non objects) var actualIndex = actualObject ? indexOf.call(actualObjects, actualValue) : -1; var expectationIndex = expectationObject ? indexOf.call(expectationObjects, expectationValue) : -1; // determines the new paths of the objects // - for non cyclic objects the current path will be extended // by current property name // - for cyclic objects the stored path is taken var newActualPath = actualIndex !== -1 ? actualPaths[actualIndex] : actualPath + "[" + JSON.stringify(key) + "]"; var newExpectationPath = expectationIndex !== -1 ? expectationPaths[expectationIndex] : expectationPath + "[" + JSON.stringify(key) + "]"; var combinedPath = newActualPath + newExpectationPath; // stop recursion if current objects are already compared if (compared[combinedPath]) { return true; } // remember the current objects and their paths if (actualIndex === -1 && actualObject) { actualObjects.push(actualValue); actualPaths.push(newActualPath); } if (expectationIndex === -1 && expectationObject) { expectationObjects.push(expectationValue); expectationPaths.push(newExpectationPath); } // remember that the current objects are already compared if (actualObject && expectationObject) { compared[combinedPath] = true; } // End of cyclic logic // neither actualValue nor expectationValue is a cycle // continue with next level return deepEqual( actualValue, expectationValue, newActualPath, newExpectationPath ); }); })(actual, expectation, "$1", "$2"); } deepEqualCyclic.use = function(match) { return function(a, b) { return deepEqualCyclic(a, b, match); }; }; module.exports = deepEqualCyclic; },{"./get-class":52,"./get-class-name":51,"./identical":53,"./is-arguments":54,"./is-date":55,"./is-element":56,"./is-nan":57,"./is-object":59,"./is-set":60,"./is-subset":61,"@sinonjs/commons":39}],51:[function(require,module,exports){ "use strict"; var valueToString = require("@sinonjs/commons").valueToString; var re = /function (\w+)\s*\(/; function getClassName(value) { if (value.constructor && "name" in value.constructor) { return value.constructor.name; } if (typeof value.constructor === "function") { var match = valueToString(value.constructor).match(re); if (match.length > 1) { return match[1]; } } return null; } module.exports = getClassName; },{"@sinonjs/commons":39}],52:[function(require,module,exports){ "use strict"; var o = Object.prototype; function getClass(value) { // Returns the internal [[Class]] by calling Object.prototype.toString // with the provided value as this. Return value is a string, naming the // internal class, e.g. "Array" return o.toString.call(value).split(/[ \]]/)[1]; } module.exports = getClass; },{}],53:[function(require,module,exports){ "use strict"; var isNaN = require("./is-nan"); var isNegZero = require("./is-neg-zero"); /** * @name samsam.equal * @param Object obj1 * @param Object obj2 * * Returns ``true`` if two objects are strictly equal. Compared to * ``===`` there are two exceptions: * * - NaN is considered equal to NaN * - -0 and +0 are not considered equal */ function identical(obj1, obj2) { if (obj1 === obj2 || (isNaN(obj1) && isNaN(obj2))) { return obj1 !== 0 || isNegZero(obj1) === isNegZero(obj2); } return false; } module.exports = identical; },{"./is-nan":57,"./is-neg-zero":58}],54:[function(require,module,exports){ "use strict"; var getClass = require("./get-class"); /** * @name samsam.isArguments * @param Object object * * Returns ``true`` if ``object`` is an ``arguments`` object, * ``false`` otherwise. */ function isArguments(object) { if (getClass(object) === "Arguments") { return true; } if ( typeof object !== "object" || typeof object.length !== "number" || getClass(object) === "Array" ) { return false; } if (typeof object.callee === "function") { return true; } try { object[object.length] = 6; delete object[object.length]; } catch (e) { return true; } return false; } module.exports = isArguments; },{"./get-class":52}],55:[function(require,module,exports){ "use strict"; function isDate(value) { return value instanceof Date; } module.exports = isDate; },{}],56:[function(require,module,exports){ "use strict"; var div = typeof document !== "undefined" && document.createElement("div"); /** * @name samsam.isElement * @param Object object * * Returns ``true`` if ``object`` is a DOM element node. Unlike * Underscore.js/lodash, this function will return ``false`` if ``object`` * is an *element-like* object, i.e. a regular object with a ``nodeType`` * property that holds the value ``1``. */ function isElement(object) { if (!object || object.nodeType !== 1 || !div) { return false; } try { object.appendChild(div); object.removeChild(div); } catch (e) { return false; } return true; } module.exports = isElement; },{}],57:[function(require,module,exports){ "use strict"; function isNaN(value) { // Unlike global isNaN, this avoids type coercion // typeof check avoids IE host object issues, hat tip to // lodash var val = value; // JsLint thinks value !== value is "weird" return typeof value === "number" && value !== val; } module.exports = isNaN; },{}],58:[function(require,module,exports){ "use strict"; /** * @name samsam.isNegZero * @param Object value * * Returns ``true`` if ``value`` is ``-0``. */ function isNegZero(value) { return value === 0 && 1 / value === -Infinity; } module.exports = isNegZero; },{}],59:[function(require,module,exports){ "use strict"; // Returns true when the value is a regular Object and not a specialized Object // // This helps speeding up deepEqual cyclic checks // The premise is that only Objects are stored in the visited array. // So if this function returns false, we don't have to do the // expensive operation of searching for the value in the the array of already // visited objects function isObject(value) { return ( typeof value === "object" && value !== null && // none of these are collection objects, so we can return false !(value instanceof Boolean) && !(value instanceof Date) && !(value instanceof Error) && !(value instanceof Number) && !(value instanceof RegExp) && !(value instanceof String) ); } module.exports = isObject; },{}],60:[function(require,module,exports){ "use strict"; function isSet(val) { return (typeof Set !== "undefined" && val instanceof Set) || false; } module.exports = isSet; },{}],61:[function(require,module,exports){ "use strict"; function isSubset(s1, s2, compare) { var allContained = true; s1.forEach(function(v1) { var includes = false; s2.forEach(function(v2) { if (compare(v2, v1)) { includes = true; } }); allContained = allContained && includes; }); return allContained; } module.exports = isSubset; },{}],62:[function(require,module,exports){ "use strict"; var slice = require("@sinonjs/commons").prototypes.string.slice; var typeOf = require("@sinonjs/commons").typeOf; var valueToString = require("@sinonjs/commons").valueToString; module.exports = function iterableToString(obj) { var representation = ""; function stringify(item) { return typeof item === "string" ? "'" + item + "'" : valueToString(item); } function mapToString(map) { /* eslint-disable-next-line local-rules/no-prototype-methods */ map.forEach(function(value, key) { representation += "[" + stringify(key) + "," + stringify(value) + "],"; }); representation = slice(representation, 0, -1); return representation; } function genericIterableToString(iterable) { /* eslint-disable-next-line local-rules/no-prototype-methods */ iterable.forEach(function(value) { representation += stringify(value) + ","; }); representation = slice(representation, 0, -1); return representation; } if (typeOf(obj) === "map") { return mapToString(obj); } return genericIterableToString(obj); }; },{"@sinonjs/commons":39}],63:[function(require,module,exports){ "use strict"; var valueToString = require("@sinonjs/commons").valueToString; var deepEqual = require("./deep-equal").use(match); // eslint-disable-line no-use-before-define var getClass = require("./get-class"); var isDate = require("./is-date"); var isSet = require("./is-set"); var isSubset = require("./is-subset"); var createMatcher = require("./matcher"); function arrayContains(array, subset, compare) { if (subset.length === 0) { return true; } var i, l, j, k; for (i = 0, l = array.length; i < l; ++i) { if (compare(array[i], subset[0])) { for (j = 0, k = subset.length; j < k; ++j) { if (i + j >= l) { return false; } if (!compare(array[i + j], subset[j])) { return false; } } return true; } } return false; } /** * @name samsam.match * @param Object object * @param Object matcher * * Compare arbitrary value ``object`` with matcher. */ function match(object, matcher) { if (matcher && typeof matcher.test === "function") { return matcher.test(object); } if (typeof matcher === "function") { return matcher(object) === true; } if (typeof matcher === "string") { matcher = matcher.toLowerCase(); var notNull = typeof object === "string" || !!object; return ( notNull && valueToString(object) .toLowerCase() .indexOf(matcher) >= 0 ); } if (typeof matcher === "number") { return matcher === object; } if (typeof matcher === "boolean") { return matcher === object; } if (typeof matcher === "undefined") { return typeof object === "undefined"; } if (matcher === null) { return object === null; } if (object === null) { return false; } if (isSet(object)) { return isSubset(matcher, object, match); } if (getClass(object) === "Array" && getClass(matcher) === "Array") { return arrayContains(object, matcher, match); } if (isDate(matcher)) { return isDate(object) && object.getTime() === matcher.getTime(); } if (matcher && typeof matcher === "object") { if (matcher === object) { return true; } if (typeof object !== "object") { return false; } var prop; // eslint-disable-next-line guard-for-in for (prop in matcher) { var value = object[prop]; if ( typeof value === "undefined" && typeof object.getAttribute === "function" ) { value = object.getAttribute(prop); } if ( matcher[prop] === null || typeof matcher[prop] === "undefined" ) { if (value !== matcher[prop]) { return false; } } else if ( typeof value === "undefined" || !deepEqual(value, matcher[prop]) ) { return false; } } return true; } throw new Error( "Matcher was not a string, a number, a " + "function, a boolean or an object" ); } Object.keys(createMatcher).forEach(function(key) { match[key] = createMatcher[key]; }); module.exports = match; },{"./deep-equal":50,"./get-class":52,"./is-date":55,"./is-set":60,"./is-subset":61,"./matcher":64,"@sinonjs/commons":39}],64:[function(require,module,exports){ "use strict"; var arrayProto = require("@sinonjs/commons").prototypes.array; var deepEqual = require("./deep-equal").use(match); // eslint-disable-line no-use-before-define var every = require("@sinonjs/commons").every; var functionName = require("@sinonjs/commons").functionName; var get = require("lodash").get; var iterableToString = require("./iterable-to-string"); var objectProto = require("@sinonjs/commons").prototypes.object; var stringProto = require("@sinonjs/commons").prototypes.string; var typeOf = require("@sinonjs/commons").typeOf; var valueToString = require("@sinonjs/commons").valueToString; var arrayIndexOf = arrayProto.indexOf; var arrayEvery = arrayProto.every; var join = arrayProto.join; var map = arrayProto.map; var some = arrayProto.some; var hasOwnProperty = objectProto.hasOwnProperty; var isPrototypeOf = objectProto.isPrototypeOf; var stringIndexOf = stringProto.indexOf; function assertType(value, type, name) { var actual = typeOf(value); if (actual !== type) { throw new TypeError( "Expected type of " + name + " to be " + type + ", but was " + actual ); } } function assertMethodExists(value, method, name, methodPath) { if (value[method] == null) { throw new TypeError( "Expected " + name + " to have method " + methodPath ); } } var matcher = { toString: function() { return this.message; } }; function isMatcher(object) { return isPrototypeOf(matcher, object); } function matchObject(actual, expectation) { if (actual === null || actual === undefined) { return false; } return arrayEvery(Object.keys(expectation), function(key) { var exp = expectation[key]; var act = actual[key]; if (isMatcher(exp)) { if (!exp.test(act)) { return false; } } else if (typeOf(exp) === "object") { if (!matchObject(act, exp)) { return false; } } else if (!deepEqual(act, exp)) { return false; } return true; }); } var TYPE_MAP = { function: function(m, expectation, message) { m.test = expectation; m.message = message || "match(" + functionName(expectation) + ")"; }, number: function(m, expectation) { m.test = function(actual) { // we need type coercion here return expectation == actual; // eslint-disable-line eqeqeq }; }, object: function(m, expectation) { var array = []; if (typeof expectation.test === "function") { m.test = function(actual) { return expectation.test(actual) === true; }; m.message = "match(" + functionName(expectation.test) + ")"; return m; } array = map(Object.keys(expectation), function(key) { return key + ": " + valueToString(expectation[key]); }); m.test = function(actual) { return matchObject(actual, expectation); }; m.message = "match(" + join(array, ", ") + ")"; return m; }, regexp: function(m, expectation) { m.test = function(actual) { return typeof actual === "string" && expectation.test(actual); }; }, string: function(m, expectation) { m.test = function(actual) { return ( typeof actual === "string" && stringIndexOf(actual, expectation) !== -1 ); }; m.message = 'match("' + expectation + '")'; } }; function match(expectation, message) { var m = Object.create(matcher); var type = typeOf(expectation); if (message !== undefined && typeof message !== "string") { throw new TypeError("Message should be a string"); } if (arguments.length > 2) { throw new TypeError( "Expected 1 or 2 arguments, received " + arguments.length ); } if (type in TYPE_MAP) { TYPE_MAP[type](m, expectation, message); } else { m.test = function(actual) { return deepEqual(actual, expectation); }; } if (!m.message) { m.message = "match(" + valueToString(expectation) + ")"; } return m; } matcher.or = function(m2) { if (!arguments.length) { throw new TypeError("Matcher expected"); } else if (!isMatcher(m2)) { m2 = match(m2); } var m1 = this; var or = Object.create(matcher); or.test = function(actual) { return m1.test(actual) || m2.test(actual); }; or.message = m1.message + ".or(" + m2.message + ")"; return or; }; matcher.and = function(m2) { if (!arguments.length) { throw new TypeError("Matcher expected"); } else if (!isMatcher(m2)) { m2 = match(m2); } var m1 = this; var and = Object.create(matcher); and.test = function(actual) { return m1.test(actual) && m2.test(actual); }; and.message = m1.message + ".and(" + m2.message + ")"; return and; }; match.isMatcher = isMatcher; match.any = match(function() { return true; }, "any"); match.defined = match(function(actual) { return actual !== null && actual !== undefined; }, "defined"); match.truthy = match(function(actual) { return !!actual; }, "truthy"); match.falsy = match(function(actual) { return !actual; }, "falsy"); match.same = function(expectation) { return match(function(actual) { return expectation === actual; }, "same(" + valueToString(expectation) + ")"); }; match.in = function(arrayOfExpectations) { if (typeOf(arrayOfExpectations) !== "array") { throw new TypeError("array expected"); } return match(function(actual) { return some(arrayOfExpectations, function(expectation) { return expectation === actual; }); }, "in(" + valueToString(arrayOfExpectations) + ")"); }; match.typeOf = function(type) { assertType(type, "string", "type"); return match(function(actual) { return typeOf(actual) === type; }, 'typeOf("' + type + '")'); }; match.instanceOf = function(type) { if ( typeof Symbol === "undefined" || typeof Symbol.hasInstance === "undefined" ) { assertType(type, "function", "type"); } else { assertMethodExists( type, Symbol.hasInstance, "type", "[Symbol.hasInstance]" ); } return match(function(actual) { return actual instanceof type; }, "instanceOf(" + (functionName(type) || Object.prototype.toString.call(type)) + ")"); }; function createPropertyMatcher(propertyTest, messagePrefix) { return function(property, value) { assertType(property, "string", "property"); var onlyProperty = arguments.length === 1; var message = messagePrefix + '("' + property + '"'; if (!onlyProperty) { message += ", " + valueToString(value); } message += ")"; return match(function(actual) { if ( actual === undefined || actual === null || !propertyTest(actual, property) ) { return false; } return onlyProperty || deepEqual(actual[property], value); }, message); }; } match.has = createPropertyMatcher(function(actual, property) { if (typeof actual === "object") { return property in actual; } return actual[property] !== undefined; }, "has"); match.hasOwn = createPropertyMatcher(function(actual, property) { return hasOwnProperty(actual, property); }, "hasOwn"); match.hasNested = function(property, value) { assertType(property, "string", "property"); var onlyProperty = arguments.length === 1; var message = 'hasNested("' + property + '"'; if (!onlyProperty) { message += ", " + valueToString(value); } message += ")"; return match(function(actual) { if ( actual === undefined || actual === null || get(actual, property) === undefined ) { return false; } return onlyProperty || deepEqual(get(actual, property), value); }, message); }; match.every = function(predicate) { if (!isMatcher(predicate)) { throw new TypeError("Matcher expected"); } return match(function(actual) { if (typeOf(actual) === "object") { return every(Object.keys(actual), function(key) { return predicate.test(actual[key]); }); } return ( !!actual && typeOf(actual.forEach) === "function" && every(actual, function(element) { return predicate.test(element); }) ); }, "every(" + predicate.message + ")"); }; match.some = function(predicate) { if (!isMatcher(predicate)) { throw new TypeError("Matcher expected"); } return match(function(actual) { if (typeOf(actual) === "object") { return !every(Object.keys(actual), function(key) { return !predicate.test(actual[key]); }); } return ( !!actual && typeOf(actual.forEach) === "function" && !every(actual, function(element) { return !predicate.test(element); }) ); }, "some(" + predicate.message + ")"); }; match.array = match.typeOf("array"); match.array.deepEquals = function(expectation) { return match(function(actual) { // Comparing lengths is the fastest way to spot a difference before iterating through every item var sameLength = actual.length === expectation.length; return ( typeOf(actual) === "array" && sameLength && every(actual, function(element, index) { var expected = expectation[index]; return typeOf(expected) === "array" && typeOf(element) === "array" ? match.array.deepEquals(expected).test(element) : deepEqual(expected, element); }) ); }, "deepEquals([" + iterableToString(expectation) + "])"); }; match.array.startsWith = function(expectation) { return match(function(actual) { return ( typeOf(actual) === "array" && every(expectation, function(expectedElement, index) { return actual[index] === expectedElement; }) ); }, "startsWith([" + iterableToString(expectation) + "])"); }; match.array.endsWith = function(expectation) { return match(function(actual) { // This indicates the index in which we should start matching var offset = actual.length - expectation.length; return ( typeOf(actual) === "array" && every(expectation, function(expectedElement, index) { return actual[offset + index] === expectedElement; }) ); }, "endsWith([" + iterableToString(expectation) + "])"); }; match.array.contains = function(expectation) { return match(function(actual) { return ( typeOf(actual) === "array" && every(expectation, function(expectedElement) { return arrayIndexOf(actual, expectedElement) !== -1; }) ); }, "contains([" + iterableToString(expectation) + "])"); }; match.map = match.typeOf("map"); match.map.deepEquals = function mapDeepEquals(expectation) { return match(function(actual) { // Comparing lengths is the fastest way to spot a difference before iterating through every item var sameLength = actual.size === expectation.size; return ( typeOf(actual) === "map" && sameLength && every(actual, function(element, key) { return expectation.has(key) && expectation.get(key) === element; }) ); }, "deepEquals(Map[" + iterableToString(expectation) + "])"); }; match.map.contains = function mapContains(expectation) { return match(function(actual) { return ( typeOf(actual) === "map" && every(expectation, function(element, key) { return actual.has(key) && actual.get(key) === element; }) ); }, "contains(Map[" + iterableToString(expectation) + "])"); }; match.set = match.typeOf("set"); match.set.deepEquals = function setDeepEquals(expectation) { return match(function(actual) { // Comparing lengths is the fastest way to spot a difference before iterating through every item var sameLength = actual.size === expectation.size; return ( typeOf(actual) === "set" && sameLength && every(actual, function(element) { return expectation.has(element); }) ); }, "deepEquals(Set[" + iterableToString(expectation) + "])"); }; match.set.contains = function setContains(expectation) { return match(function(actual) { return ( typeOf(actual) === "set" && every(expectation, function(element) { return actual.has(element); }) ); }, "contains(Set[" + iterableToString(expectation) + "])"); }; match.bool = match.typeOf("boolean"); match.number = match.typeOf("number"); match.string = match.typeOf("string"); match.object = match.typeOf("object"); match.func = match.typeOf("function"); match.regexp = match.typeOf("regexp"); match.date = match.typeOf("date"); match.symbol = match.typeOf("symbol"); module.exports = match; },{"./deep-equal":50,"./iterable-to-string":62,"@sinonjs/commons":39,"lodash":72}],65:[function(require,module,exports){ "use strict"; var identical = require("./identical"); var isArguments = require("./is-arguments"); var isElement = require("./is-element"); var isNegZero = require("./is-neg-zero"); var isSet = require("./is-set"); var match = require("./match"); var deepEqualCyclic = require("./deep-equal").use(match); var createMatcher = require("./matcher"); module.exports = { createMatcher: createMatcher, deepEqual: deepEqualCyclic, identical: identical, isArguments: isArguments, isElement: isElement, isNegZero: isNegZero, isSet: isSet, match: match }; },{"./deep-equal":50,"./identical":53,"./is-arguments":54,"./is-element":56,"./is-neg-zero":58,"./is-set":60,"./match":63,"./matcher":64}],66:[function(require,module,exports){ // This is free and unencumbered software released into the public domain. // See LICENSE.md for more information. var encoding = require("./lib/encoding.js"); module.exports = { TextEncoder: encoding.TextEncoder, TextDecoder: encoding.TextDecoder, }; },{"./lib/encoding.js":68}],67:[function(require,module,exports){ (function(global) { 'use strict'; if (typeof module !== "undefined" && module.exports) { module.exports = global; } global["encoding-indexes"] = { "big5":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,17392,19506,17923,17830,17784,160359,19831,17843,162993,19682,163013,15253,18230,18244,19527,19520,148159,144919,160594,159371,159954,19543,172881,18255,17882,19589,162924,19719,19108,18081,158499,29221,154196,137827,146950,147297,26189,22267,null,32149,22813,166841,15860,38708,162799,23515,138590,23204,13861,171696,23249,23479,23804,26478,34195,170309,29793,29853,14453,138579,145054,155681,16108,153822,15093,31484,40855,147809,166157,143850,133770,143966,17162,33924,40854,37935,18736,34323,22678,38730,37400,31184,31282,26208,27177,34973,29772,31685,26498,31276,21071,36934,13542,29636,155065,29894,40903,22451,18735,21580,16689,145038,22552,31346,162661,35727,18094,159368,16769,155033,31662,140476,40904,140481,140489,140492,40905,34052,144827,16564,40906,17633,175615,25281,28782,40907,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,12736,12737,12738,12739,12740,131340,12741,131281,131277,12742,12743,131275,139240,12744,131274,12745,12746,12747,12748,131342,12749,12750,256,193,461,192,274,201,282,200,332,211,465,210,null,7870,null,7872,202,257,225,462,224,593,275,233,283,232,299,237,464,236,333,243,466,242,363,250,468,249,470,472,474,476,252,null,7871,null,7873,234,609,9178,9179,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,172969,135493,null,25866,null,null,20029,28381,40270,37343,null,null,161589,25745,20250,20264,20392,20822,20852,20892,20964,21153,21160,21307,21326,21457,21464,22242,22768,22788,22791,22834,22836,23398,23454,23455,23706,24198,24635,25993,26622,26628,26725,27982,28860,30005,32420,32428,32442,32455,32463,32479,32518,32567,33402,33487,33647,35270,35774,35810,36710,36711,36718,29713,31996,32205,26950,31433,21031,null,null,null,null,37260,30904,37214,32956,null,36107,33014,133607,null,null,32927,40647,19661,40393,40460,19518,171510,159758,40458,172339,13761,null,28314,33342,29977,null,18705,39532,39567,40857,31111,164972,138698,132560,142054,20004,20097,20096,20103,20159,20203,20279,13388,20413,15944,20483,20616,13437,13459,13477,20870,22789,20955,20988,20997,20105,21113,21136,21287,13767,21417,13649,21424,13651,21442,21539,13677,13682,13953,21651,21667,21684,21689,21712,21743,21784,21795,21800,13720,21823,13733,13759,21975,13765,163204,21797,null,134210,134421,151851,21904,142534,14828,131905,36422,150968,169189,16467,164030,30586,142392,14900,18389,164189,158194,151018,25821,134524,135092,134357,135412,25741,36478,134806,134155,135012,142505,164438,148691,null,134470,170573,164073,18420,151207,142530,39602,14951,169460,16365,13574,152263,169940,161992,142660,40302,38933,null,17369,155813,25780,21731,142668,142282,135287,14843,135279,157402,157462,162208,25834,151634,134211,36456,139681,166732,132913,null,18443,131497,16378,22643,142733,null,148936,132348,155799,134988,134550,21881,16571,17338,null,19124,141926,135325,33194,39157,134556,25465,14846,141173,36288,22177,25724,15939,null,173569,134665,142031,142537,null,135368,145858,14738,14854,164507,13688,155209,139463,22098,134961,142514,169760,13500,27709,151099,null,null,161140,142987,139784,173659,167117,134778,134196,157724,32659,135375,141315,141625,13819,152035,134796,135053,134826,16275,134960,134471,135503,134732,null,134827,134057,134472,135360,135485,16377,140950,25650,135085,144372,161337,142286,134526,134527,142417,142421,14872,134808,135367,134958,173618,158544,167122,167321,167114,38314,21708,33476,21945,null,171715,39974,39606,161630,142830,28992,33133,33004,23580,157042,33076,14231,21343,164029,37302,134906,134671,134775,134907,13789,151019,13833,134358,22191,141237,135369,134672,134776,135288,135496,164359,136277,134777,151120,142756,23124,135197,135198,135413,135414,22428,134673,161428,164557,135093,134779,151934,14083,135094,135552,152280,172733,149978,137274,147831,164476,22681,21096,13850,153405,31666,23400,18432,19244,40743,18919,39967,39821,154484,143677,22011,13810,22153,20008,22786,138177,194680,38737,131206,20059,20155,13630,23587,24401,24516,14586,25164,25909,27514,27701,27706,28780,29227,20012,29357,149737,32594,31035,31993,32595,156266,13505,null,156491,32770,32896,157202,158033,21341,34916,35265,161970,35744,36125,38021,38264,38271,38376,167439,38886,39029,39118,39134,39267,170000,40060,40479,40644,27503,63751,20023,131207,38429,25143,38050,null,20539,28158,171123,40870,15817,34959,147790,28791,23797,19232,152013,13657,154928,24866,166450,36775,37366,29073,26393,29626,144001,172295,15499,137600,19216,30948,29698,20910,165647,16393,27235,172730,16931,34319,133743,31274,170311,166634,38741,28749,21284,139390,37876,30425,166371,40871,30685,20131,20464,20668,20015,20247,40872,21556,32139,22674,22736,138678,24210,24217,24514,141074,25995,144377,26905,27203,146531,27903,null,29184,148741,29580,16091,150035,23317,29881,35715,154788,153237,31379,31724,31939,32364,33528,34199,40873,34960,40874,36537,40875,36815,34143,39392,37409,40876,167353,136255,16497,17058,23066,null,null,null,39016,26475,17014,22333,null,34262,149883,33471,160013,19585,159092,23931,158485,159678,40877,40878,23446,40879,26343,32347,28247,31178,15752,17603,143958,141206,17306,17718,null,23765,146202,35577,23672,15634,144721,23928,40882,29015,17752,147692,138787,19575,14712,13386,131492,158785,35532,20404,131641,22975,33132,38998,170234,24379,134047,null,139713,166253,16642,18107,168057,16135,40883,172469,16632,14294,18167,158790,16764,165554,160767,17773,14548,152730,17761,17691,19849,19579,19830,17898,16328,150287,13921,17630,17597,16877,23870,23880,23894,15868,14351,23972,23993,14368,14392,24130,24253,24357,24451,14600,14612,14655,14669,24791,24893,23781,14729,25015,25017,25039,14776,25132,25232,25317,25368,14840,22193,14851,25570,25595,25607,25690,14923,25792,23829,22049,40863,14999,25990,15037,26111,26195,15090,26258,15138,26390,15170,26532,26624,15192,26698,26756,15218,15217,15227,26889,26947,29276,26980,27039,27013,15292,27094,15325,27237,27252,27249,27266,15340,27289,15346,27307,27317,27348,27382,27521,27585,27626,27765,27818,15563,27906,27910,27942,28033,15599,28068,28081,28181,28184,28201,28294,166336,28347,28386,28378,40831,28392,28393,28452,28468,15686,147265,28545,28606,15722,15733,29111,23705,15754,28716,15761,28752,28756,28783,28799,28809,131877,17345,13809,134872,147159,22462,159443,28990,153568,13902,27042,166889,23412,31305,153825,169177,31333,31357,154028,31419,31408,31426,31427,29137,156813,16842,31450,31453,31466,16879,21682,154625,31499,31573,31529,152334,154878,31650,31599,33692,154548,158847,31696,33825,31634,31672,154912,15789,154725,33938,31738,31750,31797,154817,31812,31875,149634,31910,26237,148856,31945,31943,31974,31860,31987,31989,31950,32359,17693,159300,32093,159446,29837,32137,32171,28981,32179,32210,147543,155689,32228,15635,32245,137209,32229,164717,32285,155937,155994,32366,32402,17195,37996,32295,32576,32577,32583,31030,156368,39393,32663,156497,32675,136801,131176,17756,145254,17667,164666,32762,156809,32773,32776,32797,32808,32815,172167,158915,32827,32828,32865,141076,18825,157222,146915,157416,26405,32935,166472,33031,33050,22704,141046,27775,156824,151480,25831,136330,33304,137310,27219,150117,150165,17530,33321,133901,158290,146814,20473,136445,34018,33634,158474,149927,144688,137075,146936,33450,26907,194964,16859,34123,33488,33562,134678,137140,14017,143741,144730,33403,33506,33560,147083,159139,158469,158615,144846,15807,33565,21996,33669,17675,159141,33708,33729,33747,13438,159444,27223,34138,13462,159298,143087,33880,154596,33905,15827,17636,27303,33866,146613,31064,33960,158614,159351,159299,34014,33807,33681,17568,33939,34020,154769,16960,154816,17731,34100,23282,159385,17703,34163,17686,26559,34326,165413,165435,34241,159880,34306,136578,159949,194994,17770,34344,13896,137378,21495,160666,34430,34673,172280,34798,142375,34737,34778,34831,22113,34412,26710,17935,34885,34886,161248,146873,161252,34910,34972,18011,34996,34997,25537,35013,30583,161551,35207,35210,35238,35241,35239,35260,166437,35303,162084,162493,35484,30611,37374,35472,162393,31465,162618,147343,18195,162616,29052,35596,35615,152624,152933,35647,35660,35661,35497,150138,35728,35739,35503,136927,17941,34895,35995,163156,163215,195028,14117,163155,36054,163224,163261,36114,36099,137488,36059,28764,36113,150729,16080,36215,36265,163842,135188,149898,15228,164284,160012,31463,36525,36534,36547,37588,36633,36653,164709,164882,36773,37635,172703,133712,36787,18730,166366,165181,146875,24312,143970,36857,172052,165564,165121,140069,14720,159447,36919,165180,162494,36961,165228,165387,37032,165651,37060,165606,37038,37117,37223,15088,37289,37316,31916,166195,138889,37390,27807,37441,37474,153017,37561,166598,146587,166668,153051,134449,37676,37739,166625,166891,28815,23235,166626,166629,18789,37444,166892,166969,166911,37747,37979,36540,38277,38310,37926,38304,28662,17081,140922,165592,135804,146990,18911,27676,38523,38550,16748,38563,159445,25050,38582,30965,166624,38589,21452,18849,158904,131700,156688,168111,168165,150225,137493,144138,38705,34370,38710,18959,17725,17797,150249,28789,23361,38683,38748,168405,38743,23370,168427,38751,37925,20688,143543,143548,38793,38815,38833,38846,38848,38866,38880,152684,38894,29724,169011,38911,38901,168989,162170,19153,38964,38963,38987,39014,15118,160117,15697,132656,147804,153350,39114,39095,39112,39111,19199,159015,136915,21936,39137,39142,39148,37752,39225,150057,19314,170071,170245,39413,39436,39483,39440,39512,153381,14020,168113,170965,39648,39650,170757,39668,19470,39700,39725,165376,20532,39732,158120,14531,143485,39760,39744,171326,23109,137315,39822,148043,39938,39935,39948,171624,40404,171959,172434,172459,172257,172323,172511,40318,40323,172340,40462,26760,40388,139611,172435,172576,137531,172595,40249,172217,172724,40592,40597,40606,40610,19764,40618,40623,148324,40641,15200,14821,15645,20274,14270,166955,40706,40712,19350,37924,159138,40727,40726,40761,22175,22154,40773,39352,168075,38898,33919,40802,40809,31452,40846,29206,19390,149877,149947,29047,150008,148296,150097,29598,166874,137466,31135,166270,167478,37737,37875,166468,37612,37761,37835,166252,148665,29207,16107,30578,31299,28880,148595,148472,29054,137199,28835,137406,144793,16071,137349,152623,137208,14114,136955,137273,14049,137076,137425,155467,14115,136896,22363,150053,136190,135848,136134,136374,34051,145062,34051,33877,149908,160101,146993,152924,147195,159826,17652,145134,170397,159526,26617,14131,15381,15847,22636,137506,26640,16471,145215,147681,147595,147727,158753,21707,22174,157361,22162,135135,134056,134669,37830,166675,37788,20216,20779,14361,148534,20156,132197,131967,20299,20362,153169,23144,131499,132043,14745,131850,132116,13365,20265,131776,167603,131701,35546,131596,20120,20685,20749,20386,20227,150030,147082,20290,20526,20588,20609,20428,20453,20568,20732,20825,20827,20829,20830,28278,144789,147001,147135,28018,137348,147081,20904,20931,132576,17629,132259,132242,132241,36218,166556,132878,21081,21156,133235,21217,37742,18042,29068,148364,134176,149932,135396,27089,134685,29817,16094,29849,29716,29782,29592,19342,150204,147597,21456,13700,29199,147657,21940,131909,21709,134086,22301,37469,38644,37734,22493,22413,22399,13886,22731,23193,166470,136954,137071,136976,23084,22968,37519,23166,23247,23058,153926,137715,137313,148117,14069,27909,29763,23073,155267,23169,166871,132115,37856,29836,135939,28933,18802,37896,166395,37821,14240,23582,23710,24158,24136,137622,137596,146158,24269,23375,137475,137476,14081,137376,14045,136958,14035,33066,166471,138682,144498,166312,24332,24334,137511,137131,23147,137019,23364,34324,161277,34912,24702,141408,140843,24539,16056,140719,140734,168072,159603,25024,131134,131142,140827,24985,24984,24693,142491,142599,149204,168269,25713,149093,142186,14889,142114,144464,170218,142968,25399,173147,25782,25393,25553,149987,142695,25252,142497,25659,25963,26994,15348,143502,144045,149897,144043,21773,144096,137433,169023,26318,144009,143795,15072,16784,152964,166690,152975,136956,152923,152613,30958,143619,137258,143924,13412,143887,143746,148169,26254,159012,26219,19347,26160,161904,138731,26211,144082,144097,26142,153714,14545,145466,145340,15257,145314,144382,29904,15254,26511,149034,26806,26654,15300,27326,14435,145365,148615,27187,27218,27337,27397,137490,25873,26776,27212,15319,27258,27479,147392,146586,37792,37618,166890,166603,37513,163870,166364,37991,28069,28427,149996,28007,147327,15759,28164,147516,23101,28170,22599,27940,30786,28987,148250,148086,28913,29264,29319,29332,149391,149285,20857,150180,132587,29818,147192,144991,150090,149783,155617,16134,16049,150239,166947,147253,24743,16115,29900,29756,37767,29751,17567,159210,17745,30083,16227,150745,150790,16216,30037,30323,173510,15129,29800,166604,149931,149902,15099,15821,150094,16127,149957,149747,37370,22322,37698,166627,137316,20703,152097,152039,30584,143922,30478,30479,30587,149143,145281,14942,149744,29752,29851,16063,150202,150215,16584,150166,156078,37639,152961,30750,30861,30856,30930,29648,31065,161601,153315,16654,31131,33942,31141,27181,147194,31290,31220,16750,136934,16690,37429,31217,134476,149900,131737,146874,137070,13719,21867,13680,13994,131540,134157,31458,23129,141045,154287,154268,23053,131675,30960,23082,154566,31486,16889,31837,31853,16913,154547,155324,155302,31949,150009,137136,31886,31868,31918,27314,32220,32263,32211,32590,156257,155996,162632,32151,155266,17002,158581,133398,26582,131150,144847,22468,156690,156664,149858,32733,31527,133164,154345,154947,31500,155150,39398,34373,39523,27164,144447,14818,150007,157101,39455,157088,33920,160039,158929,17642,33079,17410,32966,33033,33090,157620,39107,158274,33378,33381,158289,33875,159143,34320,160283,23174,16767,137280,23339,137377,23268,137432,34464,195004,146831,34861,160802,23042,34926,20293,34951,35007,35046,35173,35149,153219,35156,161669,161668,166901,166873,166812,166393,16045,33955,18165,18127,14322,35389,35356,169032,24397,37419,148100,26068,28969,28868,137285,40301,35999,36073,163292,22938,30659,23024,17262,14036,36394,36519,150537,36656,36682,17140,27736,28603,140065,18587,28537,28299,137178,39913,14005,149807,37051,37015,21873,18694,37307,37892,166475,16482,166652,37927,166941,166971,34021,35371,38297,38311,38295,38294,167220,29765,16066,149759,150082,148458,16103,143909,38543,167655,167526,167525,16076,149997,150136,147438,29714,29803,16124,38721,168112,26695,18973,168083,153567,38749,37736,166281,166950,166703,156606,37562,23313,35689,18748,29689,147995,38811,38769,39224,134950,24001,166853,150194,38943,169178,37622,169431,37349,17600,166736,150119,166756,39132,166469,16128,37418,18725,33812,39227,39245,162566,15869,39323,19311,39338,39516,166757,153800,27279,39457,23294,39471,170225,19344,170312,39356,19389,19351,37757,22642,135938,22562,149944,136424,30788,141087,146872,26821,15741,37976,14631,24912,141185,141675,24839,40015,40019,40059,39989,39952,39807,39887,171565,39839,172533,172286,40225,19630,147716,40472,19632,40204,172468,172269,172275,170287,40357,33981,159250,159711,158594,34300,17715,159140,159364,159216,33824,34286,159232,145367,155748,31202,144796,144960,18733,149982,15714,37851,37566,37704,131775,30905,37495,37965,20452,13376,36964,152925,30781,30804,30902,30795,137047,143817,149825,13978,20338,28634,28633,28702,28702,21524,147893,22459,22771,22410,40214,22487,28980,13487,147884,29163,158784,151447,23336,137141,166473,24844,23246,23051,17084,148616,14124,19323,166396,37819,37816,137430,134941,33906,158912,136211,148218,142374,148417,22932,146871,157505,32168,155995,155812,149945,149899,166394,37605,29666,16105,29876,166755,137375,16097,150195,27352,29683,29691,16086,150078,150164,137177,150118,132007,136228,149989,29768,149782,28837,149878,37508,29670,37727,132350,37681,166606,166422,37766,166887,153045,18741,166530,29035,149827,134399,22180,132634,134123,134328,21762,31172,137210,32254,136898,150096,137298,17710,37889,14090,166592,149933,22960,137407,137347,160900,23201,14050,146779,14000,37471,23161,166529,137314,37748,15565,133812,19094,14730,20724,15721,15692,136092,29045,17147,164376,28175,168164,17643,27991,163407,28775,27823,15574,147437,146989,28162,28428,15727,132085,30033,14012,13512,18048,16090,18545,22980,37486,18750,36673,166940,158656,22546,22472,14038,136274,28926,148322,150129,143331,135856,140221,26809,26983,136088,144613,162804,145119,166531,145366,144378,150687,27162,145069,158903,33854,17631,17614,159014,159057,158850,159710,28439,160009,33597,137018,33773,158848,159827,137179,22921,23170,137139,23137,23153,137477,147964,14125,23023,137020,14023,29070,37776,26266,148133,23150,23083,148115,27179,147193,161590,148571,148170,28957,148057,166369,20400,159016,23746,148686,163405,148413,27148,148054,135940,28838,28979,148457,15781,27871,194597,150095,32357,23019,23855,15859,24412,150109,137183,32164,33830,21637,146170,144128,131604,22398,133333,132633,16357,139166,172726,28675,168283,23920,29583,31955,166489,168992,20424,32743,29389,29456,162548,29496,29497,153334,29505,29512,16041,162584,36972,29173,149746,29665,33270,16074,30476,16081,27810,22269,29721,29726,29727,16098,16112,16116,16122,29907,16142,16211,30018,30061,30066,30093,16252,30152,30172,16320,30285,16343,30324,16348,30330,151388,29064,22051,35200,22633,16413,30531,16441,26465,16453,13787,30616,16490,16495,23646,30654,30667,22770,30744,28857,30748,16552,30777,30791,30801,30822,33864,152885,31027,26627,31026,16643,16649,31121,31129,36795,31238,36796,16743,31377,16818,31420,33401,16836,31439,31451,16847,20001,31586,31596,31611,31762,31771,16992,17018,31867,31900,17036,31928,17044,31981,36755,28864,134351,32207,32212,32208,32253,32686,32692,29343,17303,32800,32805,31545,32814,32817,32852,15820,22452,28832,32951,33001,17389,33036,29482,33038,33042,30048,33044,17409,15161,33110,33113,33114,17427,22586,33148,33156,17445,33171,17453,33189,22511,33217,33252,33364,17551,33446,33398,33482,33496,33535,17584,33623,38505,27018,33797,28917,33892,24803,33928,17668,33982,34017,34040,34064,34104,34130,17723,34159,34160,34272,17783,34418,34450,34482,34543,38469,34699,17926,17943,34990,35071,35108,35143,35217,162151,35369,35384,35476,35508,35921,36052,36082,36124,18328,22623,36291,18413,20206,36410,21976,22356,36465,22005,36528,18487,36558,36578,36580,36589,36594,36791,36801,36810,36812,36915,39364,18605,39136,37395,18718,37416,37464,37483,37553,37550,37567,37603,37611,37619,37620,37629,37699,37764,37805,18757,18769,40639,37911,21249,37917,37933,37950,18794,37972,38009,38189,38306,18855,38388,38451,18917,26528,18980,38720,18997,38834,38850,22100,19172,24808,39097,19225,39153,22596,39182,39193,20916,39196,39223,39234,39261,39266,19312,39365,19357,39484,39695,31363,39785,39809,39901,39921,39924,19565,39968,14191,138178,40265,39994,40702,22096,40339,40381,40384,40444,38134,36790,40571,40620,40625,40637,40646,38108,40674,40689,40696,31432,40772,131220,131767,132000,26906,38083,22956,132311,22592,38081,14265,132565,132629,132726,136890,22359,29043,133826,133837,134079,21610,194619,134091,21662,134139,134203,134227,134245,134268,24807,134285,22138,134325,134365,134381,134511,134578,134600,26965,39983,34725,134660,134670,134871,135056,134957,134771,23584,135100,24075,135260,135247,135286,26398,135291,135304,135318,13895,135359,135379,135471,135483,21348,33965,135907,136053,135990,35713,136567,136729,137155,137159,20088,28859,137261,137578,137773,137797,138282,138352,138412,138952,25283,138965,139029,29080,26709,139333,27113,14024,139900,140247,140282,141098,141425,141647,33533,141671,141715,142037,35237,142056,36768,142094,38840,142143,38983,39613,142412,null,142472,142519,154600,142600,142610,142775,142741,142914,143220,143308,143411,143462,144159,144350,24497,26184,26303,162425,144743,144883,29185,149946,30679,144922,145174,32391,131910,22709,26382,26904,146087,161367,155618,146961,147129,161278,139418,18640,19128,147737,166554,148206,148237,147515,148276,148374,150085,132554,20946,132625,22943,138920,15294,146687,148484,148694,22408,149108,14747,149295,165352,170441,14178,139715,35678,166734,39382,149522,149755,150037,29193,150208,134264,22885,151205,151430,132985,36570,151596,21135,22335,29041,152217,152601,147274,150183,21948,152646,152686,158546,37332,13427,152895,161330,152926,18200,152930,152934,153543,149823,153693,20582,13563,144332,24798,153859,18300,166216,154286,154505,154630,138640,22433,29009,28598,155906,162834,36950,156082,151450,35682,156674,156746,23899,158711,36662,156804,137500,35562,150006,156808,147439,156946,19392,157119,157365,141083,37989,153569,24981,23079,194765,20411,22201,148769,157436,20074,149812,38486,28047,158909,13848,35191,157593,157806,156689,157790,29151,157895,31554,168128,133649,157990,37124,158009,31301,40432,158202,39462,158253,13919,156777,131105,31107,158260,158555,23852,144665,33743,158621,18128,158884,30011,34917,159150,22710,14108,140685,159819,160205,15444,160384,160389,37505,139642,160395,37680,160486,149968,27705,38047,160848,134904,34855,35061,141606,164979,137137,28344,150058,137248,14756,14009,23568,31203,17727,26294,171181,170148,35139,161740,161880,22230,16607,136714,14753,145199,164072,136133,29101,33638,162269,168360,23143,19639,159919,166315,162301,162314,162571,163174,147834,31555,31102,163849,28597,172767,27139,164632,21410,159239,37823,26678,38749,164207,163875,158133,136173,143919,163912,23941,166960,163971,22293,38947,166217,23979,149896,26046,27093,21458,150181,147329,15377,26422,163984,164084,164142,139169,164175,164233,164271,164378,164614,164655,164746,13770,164968,165546,18682,25574,166230,30728,37461,166328,17394,166375,17375,166376,166726,166868,23032,166921,36619,167877,168172,31569,168208,168252,15863,168286,150218,36816,29327,22155,169191,169449,169392,169400,169778,170193,170313,170346,170435,170536,170766,171354,171419,32415,171768,171811,19620,38215,172691,29090,172799,19857,36882,173515,19868,134300,36798,21953,36794,140464,36793,150163,17673,32383,28502,27313,20202,13540,166700,161949,14138,36480,137205,163876,166764,166809,162366,157359,15851,161365,146615,153141,153942,20122,155265,156248,22207,134765,36366,23405,147080,150686,25566,25296,137206,137339,25904,22061,154698,21530,152337,15814,171416,19581,22050,22046,32585,155352,22901,146752,34672,19996,135146,134473,145082,33047,40286,36120,30267,40005,30286,30649,37701,21554,33096,33527,22053,33074,33816,32957,21994,31074,22083,21526,134813,13774,22021,22001,26353,164578,13869,30004,22000,21946,21655,21874,134209,134294,24272,151880,134774,142434,134818,40619,32090,21982,135285,25245,38765,21652,36045,29174,37238,25596,25529,25598,21865,142147,40050,143027,20890,13535,134567,20903,21581,21790,21779,30310,36397,157834,30129,32950,34820,34694,35015,33206,33820,135361,17644,29444,149254,23440,33547,157843,22139,141044,163119,147875,163187,159440,160438,37232,135641,37384,146684,173737,134828,134905,29286,138402,18254,151490,163833,135147,16634,40029,25887,142752,18675,149472,171388,135148,134666,24674,161187,135149,null,155720,135559,29091,32398,40272,19994,19972,13687,23309,27826,21351,13996,14812,21373,13989,149016,22682,150382,33325,21579,22442,154261,133497,null,14930,140389,29556,171692,19721,39917,146686,171824,19547,151465,169374,171998,33884,146870,160434,157619,145184,25390,32037,147191,146988,14890,36872,21196,15988,13946,17897,132238,30272,23280,134838,30842,163630,22695,16575,22140,39819,23924,30292,173108,40581,19681,30201,14331,24857,143578,148466,null,22109,135849,22439,149859,171526,21044,159918,13741,27722,40316,31830,39737,22494,137068,23635,25811,169168,156469,160100,34477,134440,159010,150242,134513,null,20990,139023,23950,38659,138705,40577,36940,31519,39682,23761,31651,25192,25397,39679,31695,39722,31870,39726,31810,31878,39957,31740,39689,40727,39963,149822,40794,21875,23491,20477,40600,20466,21088,15878,21201,22375,20566,22967,24082,38856,40363,36700,21609,38836,39232,38842,21292,24880,26924,21466,39946,40194,19515,38465,27008,20646,30022,137069,39386,21107,null,37209,38529,37212,null,37201,167575,25471,159011,27338,22033,37262,30074,25221,132092,29519,31856,154657,146685,null,149785,30422,39837,20010,134356,33726,34882,null,23626,27072,20717,22394,21023,24053,20174,27697,131570,20281,21660,21722,21146,36226,13822,24332,13811,null,27474,37244,40869,39831,38958,39092,39610,40616,40580,29050,31508,null,27642,34840,32632,null,22048,173642,36471,40787,null,36308,36431,40476,36353,25218,164733,36392,36469,31443,150135,31294,30936,27882,35431,30215,166490,40742,27854,34774,30147,172722,30803,194624,36108,29410,29553,35629,29442,29937,36075,150203,34351,24506,34976,17591,null,137275,159237,null,35454,140571,null,24829,30311,39639,40260,37742,39823,34805,null,34831,36087,29484,38689,39856,13782,29362,19463,31825,39242,155993,24921,19460,40598,24957,null,22367,24943,25254,25145,25294,14940,25058,21418,144373,25444,26626,13778,23895,166850,36826,167481,null,20697,138566,30982,21298,38456,134971,16485,null,30718,null,31938,155418,31962,31277,32870,32867,32077,29957,29938,35220,33306,26380,32866,160902,32859,29936,33027,30500,35209,157644,30035,159441,34729,34766,33224,34700,35401,36013,35651,30507,29944,34010,13877,27058,36262,null,35241,29800,28089,34753,147473,29927,15835,29046,24740,24988,15569,29026,24695,null,32625,166701,29264,24809,19326,21024,15384,146631,155351,161366,152881,137540,135934,170243,159196,159917,23745,156077,166415,145015,131310,157766,151310,17762,23327,156492,40784,40614,156267,12288,65292,12289,12290,65294,8231,65307,65306,65311,65281,65072,8230,8229,65104,65105,65106,183,65108,65109,65110,65111,65372,8211,65073,8212,65075,9588,65076,65103,65288,65289,65077,65078,65371,65373,65079,65080,12308,12309,65081,65082,12304,12305,65083,65084,12298,12299,65085,65086,12296,12297,65087,65088,12300,12301,65089,65090,12302,12303,65091,65092,65113,65114,65115,65116,65117,65118,8216,8217,8220,8221,12317,12318,8245,8242,65283,65286,65290,8251,167,12291,9675,9679,9651,9650,9678,9734,9733,9671,9670,9633,9632,9661,9660,12963,8453,175,65507,65343,717,65097,65098,65101,65102,65099,65100,65119,65120,65121,65291,65293,215,247,177,8730,65308,65310,65309,8806,8807,8800,8734,8786,8801,65122,65123,65124,65125,65126,65374,8745,8746,8869,8736,8735,8895,13266,13265,8747,8750,8757,8756,9792,9794,8853,8857,8593,8595,8592,8594,8598,8599,8601,8600,8741,8739,65295,65340,8725,65128,65284,65509,12306,65504,65505,65285,65312,8451,8457,65129,65130,65131,13269,13212,13213,13214,13262,13217,13198,13199,13252,176,20825,20827,20830,20829,20833,20835,21991,29929,31950,9601,9602,9603,9604,9605,9606,9607,9608,9615,9614,9613,9612,9611,9610,9609,9532,9524,9516,9508,9500,9620,9472,9474,9621,9484,9488,9492,9496,9581,9582,9584,9583,9552,9566,9578,9569,9698,9699,9701,9700,9585,9586,9587,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,12321,12322,12323,12324,12325,12326,12327,12328,12329,21313,21316,21317,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,729,713,714,711,715,9216,9217,9218,9219,9220,9221,9222,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,9246,9247,9249,8364,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,19968,20057,19969,19971,20035,20061,20102,20108,20154,20799,20837,20843,20960,20992,20993,21147,21269,21313,21340,21448,19977,19979,19976,19978,20011,20024,20961,20037,20040,20063,20062,20110,20129,20800,20995,21242,21315,21449,21475,22303,22763,22805,22823,22899,23376,23377,23379,23544,23567,23586,23608,23665,24029,24037,24049,24050,24051,24062,24178,24318,24331,24339,25165,19985,19984,19981,20013,20016,20025,20043,23609,20104,20113,20117,20114,20116,20130,20161,20160,20163,20166,20167,20173,20170,20171,20164,20803,20801,20839,20845,20846,20844,20887,20982,20998,20999,21000,21243,21246,21247,21270,21305,21320,21319,21317,21342,21380,21451,21450,21453,22764,22825,22827,22826,22829,23380,23569,23588,23610,23663,24052,24187,24319,24340,24341,24515,25096,25142,25163,25166,25903,25991,26007,26020,26041,26085,26352,26376,26408,27424,27490,27513,27595,27604,27611,27663,27700,28779,29226,29238,29243,29255,29273,29275,29356,29579,19993,19990,19989,19988,19992,20027,20045,20047,20046,20197,20184,20180,20181,20182,20183,20195,20196,20185,20190,20805,20804,20873,20874,20908,20985,20986,20984,21002,21152,21151,21253,21254,21271,21277,20191,21322,21321,21345,21344,21359,21358,21435,21487,21476,21491,21484,21486,21481,21480,21500,21496,21493,21483,21478,21482,21490,21489,21488,21477,21485,21499,22235,22234,22806,22830,22833,22900,22902,23381,23427,23612,24040,24039,24038,24066,24067,24179,24188,24321,24344,24343,24517,25098,25171,25172,25170,25169,26021,26086,26414,26412,26410,26411,26413,27491,27597,27665,27664,27704,27713,27712,27710,29359,29572,29577,29916,29926,29976,29983,29992,29993,30000,30001,30002,30003,30091,30333,30382,30399,30446,30683,30690,30707,31034,31166,31348,31435,19998,19999,20050,20051,20073,20121,20132,20134,20133,20223,20233,20249,20234,20245,20237,20240,20241,20239,20210,20214,20219,20208,20211,20221,20225,20235,20809,20807,20806,20808,20840,20849,20877,20912,21015,21009,21010,21006,21014,21155,21256,21281,21280,21360,21361,21513,21519,21516,21514,21520,21505,21515,21508,21521,21517,21512,21507,21518,21510,21522,22240,22238,22237,22323,22320,22312,22317,22316,22319,22313,22809,22810,22839,22840,22916,22904,22915,22909,22905,22914,22913,23383,23384,23431,23432,23429,23433,23546,23574,23673,24030,24070,24182,24180,24335,24347,24537,24534,25102,25100,25101,25104,25187,25179,25176,25910,26089,26088,26092,26093,26354,26355,26377,26429,26420,26417,26421,27425,27492,27515,27670,27741,27735,27737,27743,27744,27728,27733,27745,27739,27725,27726,28784,29279,29277,30334,31481,31859,31992,32566,32650,32701,32769,32771,32780,32786,32819,32895,32905,32907,32908,33251,33258,33267,33276,33292,33307,33311,33390,33394,33406,34411,34880,34892,34915,35199,38433,20018,20136,20301,20303,20295,20311,20318,20276,20315,20309,20272,20304,20305,20285,20282,20280,20291,20308,20284,20294,20323,20316,20320,20271,20302,20278,20313,20317,20296,20314,20812,20811,20813,20853,20918,20919,21029,21028,21033,21034,21032,21163,21161,21162,21164,21283,21363,21365,21533,21549,21534,21566,21542,21582,21543,21574,21571,21555,21576,21570,21531,21545,21578,21561,21563,21560,21550,21557,21558,21536,21564,21568,21553,21547,21535,21548,22250,22256,22244,22251,22346,22353,22336,22349,22343,22350,22334,22352,22351,22331,22767,22846,22941,22930,22952,22942,22947,22937,22934,22925,22948,22931,22922,22949,23389,23388,23386,23387,23436,23435,23439,23596,23616,23617,23615,23614,23696,23697,23700,23692,24043,24076,24207,24199,24202,24311,24324,24351,24420,24418,24439,24441,24536,24524,24535,24525,24561,24555,24568,24554,25106,25105,25220,25239,25238,25216,25206,25225,25197,25226,25212,25214,25209,25203,25234,25199,25240,25198,25237,25235,25233,25222,25913,25915,25912,26097,26356,26463,26446,26447,26448,26449,26460,26454,26462,26441,26438,26464,26451,26455,27493,27599,27714,27742,27801,27777,27784,27785,27781,27803,27754,27770,27792,27760,27788,27752,27798,27794,27773,27779,27762,27774,27764,27782,27766,27789,27796,27800,27778,28790,28796,28797,28792,29282,29281,29280,29380,29378,29590,29996,29995,30007,30008,30338,30447,30691,31169,31168,31167,31350,31995,32597,32918,32915,32925,32920,32923,32922,32946,33391,33426,33419,33421,35211,35282,35328,35895,35910,35925,35997,36196,36208,36275,36523,36554,36763,36784,36802,36806,36805,36804,24033,37009,37026,37034,37030,37027,37193,37318,37324,38450,38446,38449,38442,38444,20006,20054,20083,20107,20123,20126,20139,20140,20335,20381,20365,20339,20351,20332,20379,20363,20358,20355,20336,20341,20360,20329,20347,20374,20350,20367,20369,20346,20820,20818,20821,20841,20855,20854,20856,20925,20989,21051,21048,21047,21050,21040,21038,21046,21057,21182,21179,21330,21332,21331,21329,21350,21367,21368,21369,21462,21460,21463,21619,21621,21654,21624,21653,21632,21627,21623,21636,21650,21638,21628,21648,21617,21622,21644,21658,21602,21608,21643,21629,21646,22266,22403,22391,22378,22377,22369,22374,22372,22396,22812,22857,22855,22856,22852,22868,22974,22971,22996,22969,22958,22993,22982,22992,22989,22987,22995,22986,22959,22963,22994,22981,23391,23396,23395,23447,23450,23448,23452,23449,23451,23578,23624,23621,23622,23735,23713,23736,23721,23723,23729,23731,24088,24090,24086,24085,24091,24081,24184,24218,24215,24220,24213,24214,24310,24358,24359,24361,24448,24449,24447,24444,24541,24544,24573,24565,24575,24591,24596,24623,24629,24598,24618,24597,24609,24615,24617,24619,24603,25110,25109,25151,25150,25152,25215,25289,25292,25284,25279,25282,25273,25298,25307,25259,25299,25300,25291,25288,25256,25277,25276,25296,25305,25287,25293,25269,25306,25265,25304,25302,25303,25286,25260,25294,25918,26023,26044,26106,26132,26131,26124,26118,26114,26126,26112,26127,26133,26122,26119,26381,26379,26477,26507,26517,26481,26524,26483,26487,26503,26525,26519,26479,26480,26495,26505,26494,26512,26485,26522,26515,26492,26474,26482,27427,27494,27495,27519,27667,27675,27875,27880,27891,27825,27852,27877,27827,27837,27838,27836,27874,27819,27861,27859,27832,27844,27833,27841,27822,27863,27845,27889,27839,27835,27873,27867,27850,27820,27887,27868,27862,27872,28821,28814,28818,28810,28825,29228,29229,29240,29256,29287,29289,29376,29390,29401,29399,29392,29609,29608,29599,29611,29605,30013,30109,30105,30106,30340,30402,30450,30452,30693,30717,31038,31040,31041,31177,31176,31354,31353,31482,31998,32596,32652,32651,32773,32954,32933,32930,32945,32929,32939,32937,32948,32938,32943,33253,33278,33293,33459,33437,33433,33453,33469,33439,33465,33457,33452,33445,33455,33464,33443,33456,33470,33463,34382,34417,21021,34920,36555,36814,36820,36817,37045,37048,37041,37046,37319,37329,38263,38272,38428,38464,38463,38459,38468,38466,38585,38632,38738,38750,20127,20141,20142,20449,20405,20399,20415,20448,20433,20431,20445,20419,20406,20440,20447,20426,20439,20398,20432,20420,20418,20442,20430,20446,20407,20823,20882,20881,20896,21070,21059,21066,21069,21068,21067,21063,21191,21193,21187,21185,21261,21335,21371,21402,21467,21676,21696,21672,21710,21705,21688,21670,21683,21703,21698,21693,21674,21697,21700,21704,21679,21675,21681,21691,21673,21671,21695,22271,22402,22411,22432,22435,22434,22478,22446,22419,22869,22865,22863,22862,22864,23004,23000,23039,23011,23016,23043,23013,23018,23002,23014,23041,23035,23401,23459,23462,23460,23458,23461,23553,23630,23631,23629,23627,23769,23762,24055,24093,24101,24095,24189,24224,24230,24314,24328,24365,24421,24456,24453,24458,24459,24455,24460,24457,24594,24605,24608,24613,24590,24616,24653,24688,24680,24674,24646,24643,24684,24683,24682,24676,25153,25308,25366,25353,25340,25325,25345,25326,25341,25351,25329,25335,25327,25324,25342,25332,25361,25346,25919,25925,26027,26045,26082,26149,26157,26144,26151,26159,26143,26152,26161,26148,26359,26623,26579,26609,26580,26576,26604,26550,26543,26613,26601,26607,26564,26577,26548,26586,26597,26552,26575,26590,26611,26544,26585,26594,26589,26578,27498,27523,27526,27573,27602,27607,27679,27849,27915,27954,27946,27969,27941,27916,27953,27934,27927,27963,27965,27966,27958,27931,27893,27961,27943,27960,27945,27950,27957,27918,27947,28843,28858,28851,28844,28847,28845,28856,28846,28836,29232,29298,29295,29300,29417,29408,29409,29623,29642,29627,29618,29645,29632,29619,29978,29997,30031,30028,30030,30027,30123,30116,30117,30114,30115,30328,30342,30343,30344,30408,30406,30403,30405,30465,30457,30456,30473,30475,30462,30460,30471,30684,30722,30740,30732,30733,31046,31049,31048,31047,31161,31162,31185,31186,31179,31359,31361,31487,31485,31869,32002,32005,32000,32009,32007,32004,32006,32568,32654,32703,32772,32784,32781,32785,32822,32982,32997,32986,32963,32964,32972,32993,32987,32974,32990,32996,32989,33268,33314,33511,33539,33541,33507,33499,33510,33540,33509,33538,33545,33490,33495,33521,33537,33500,33492,33489,33502,33491,33503,33519,33542,34384,34425,34427,34426,34893,34923,35201,35284,35336,35330,35331,35998,36000,36212,36211,36276,36557,36556,36848,36838,36834,36842,36837,36845,36843,36836,36840,37066,37070,37057,37059,37195,37194,37325,38274,38480,38475,38476,38477,38754,38761,38859,38893,38899,38913,39080,39131,39135,39318,39321,20056,20147,20492,20493,20515,20463,20518,20517,20472,20521,20502,20486,20540,20511,20506,20498,20497,20474,20480,20500,20520,20465,20513,20491,20505,20504,20467,20462,20525,20522,20478,20523,20489,20860,20900,20901,20898,20941,20940,20934,20939,21078,21084,21076,21083,21085,21290,21375,21407,21405,21471,21736,21776,21761,21815,21756,21733,21746,21766,21754,21780,21737,21741,21729,21769,21742,21738,21734,21799,21767,21757,21775,22275,22276,22466,22484,22475,22467,22537,22799,22871,22872,22874,23057,23064,23068,23071,23067,23059,23020,23072,23075,23081,23077,23052,23049,23403,23640,23472,23475,23478,23476,23470,23477,23481,23480,23556,23633,23637,23632,23789,23805,23803,23786,23784,23792,23798,23809,23796,24046,24109,24107,24235,24237,24231,24369,24466,24465,24464,24665,24675,24677,24656,24661,24685,24681,24687,24708,24735,24730,24717,24724,24716,24709,24726,25159,25331,25352,25343,25422,25406,25391,25429,25410,25414,25423,25417,25402,25424,25405,25386,25387,25384,25421,25420,25928,25929,26009,26049,26053,26178,26185,26191,26179,26194,26188,26181,26177,26360,26388,26389,26391,26657,26680,26696,26694,26707,26681,26690,26708,26665,26803,26647,26700,26705,26685,26612,26704,26688,26684,26691,26666,26693,26643,26648,26689,27530,27529,27575,27683,27687,27688,27686,27684,27888,28010,28053,28040,28039,28006,28024,28023,27993,28051,28012,28041,28014,27994,28020,28009,28044,28042,28025,28037,28005,28052,28874,28888,28900,28889,28872,28879,29241,29305,29436,29433,29437,29432,29431,29574,29677,29705,29678,29664,29674,29662,30036,30045,30044,30042,30041,30142,30149,30151,30130,30131,30141,30140,30137,30146,30136,30347,30384,30410,30413,30414,30505,30495,30496,30504,30697,30768,30759,30776,30749,30772,30775,30757,30765,30752,30751,30770,31061,31056,31072,31071,31062,31070,31069,31063,31066,31204,31203,31207,31199,31206,31209,31192,31364,31368,31449,31494,31505,31881,32033,32023,32011,32010,32032,32034,32020,32016,32021,32026,32028,32013,32025,32027,32570,32607,32660,32709,32705,32774,32792,32789,32793,32791,32829,32831,33009,33026,33008,33029,33005,33012,33030,33016,33011,33032,33021,33034,33020,33007,33261,33260,33280,33296,33322,33323,33320,33324,33467,33579,33618,33620,33610,33592,33616,33609,33589,33588,33615,33586,33593,33590,33559,33600,33585,33576,33603,34388,34442,34474,34451,34468,34473,34444,34467,34460,34928,34935,34945,34946,34941,34937,35352,35344,35342,35340,35349,35338,35351,35347,35350,35343,35345,35912,35962,35961,36001,36002,36215,36524,36562,36564,36559,36785,36865,36870,36855,36864,36858,36852,36867,36861,36869,36856,37013,37089,37085,37090,37202,37197,37196,37336,37341,37335,37340,37337,38275,38498,38499,38497,38491,38493,38500,38488,38494,38587,39138,39340,39592,39640,39717,39730,39740,20094,20602,20605,20572,20551,20547,20556,20570,20553,20581,20598,20558,20565,20597,20596,20599,20559,20495,20591,20589,20828,20885,20976,21098,21103,21202,21209,21208,21205,21264,21263,21273,21311,21312,21310,21443,26364,21830,21866,21862,21828,21854,21857,21827,21834,21809,21846,21839,21845,21807,21860,21816,21806,21852,21804,21859,21811,21825,21847,22280,22283,22281,22495,22533,22538,22534,22496,22500,22522,22530,22581,22519,22521,22816,22882,23094,23105,23113,23142,23146,23104,23100,23138,23130,23110,23114,23408,23495,23493,23492,23490,23487,23494,23561,23560,23559,23648,23644,23645,23815,23814,23822,23835,23830,23842,23825,23849,23828,23833,23844,23847,23831,24034,24120,24118,24115,24119,24247,24248,24246,24245,24254,24373,24375,24407,24428,24425,24427,24471,24473,24478,24472,24481,24480,24476,24703,24739,24713,24736,24744,24779,24756,24806,24765,24773,24763,24757,24796,24764,24792,24789,24774,24799,24760,24794,24775,25114,25115,25160,25504,25511,25458,25494,25506,25509,25463,25447,25496,25514,25457,25513,25481,25475,25499,25451,25512,25476,25480,25497,25505,25516,25490,25487,25472,25467,25449,25448,25466,25949,25942,25937,25945,25943,21855,25935,25944,25941,25940,26012,26011,26028,26063,26059,26060,26062,26205,26202,26212,26216,26214,26206,26361,21207,26395,26753,26799,26786,26771,26805,26751,26742,26801,26791,26775,26800,26755,26820,26797,26758,26757,26772,26781,26792,26783,26785,26754,27442,27578,27627,27628,27691,28046,28092,28147,28121,28082,28129,28108,28132,28155,28154,28165,28103,28107,28079,28113,28078,28126,28153,28088,28151,28149,28101,28114,28186,28085,28122,28139,28120,28138,28145,28142,28136,28102,28100,28074,28140,28095,28134,28921,28937,28938,28925,28911,29245,29309,29313,29468,29467,29462,29459,29465,29575,29701,29706,29699,29702,29694,29709,29920,29942,29943,29980,29986,30053,30054,30050,30064,30095,30164,30165,30133,30154,30157,30350,30420,30418,30427,30519,30526,30524,30518,30520,30522,30827,30787,30798,31077,31080,31085,31227,31378,31381,31520,31528,31515,31532,31526,31513,31518,31534,31890,31895,31893,32070,32067,32113,32046,32057,32060,32064,32048,32051,32068,32047,32066,32050,32049,32573,32670,32666,32716,32718,32722,32796,32842,32838,33071,33046,33059,33067,33065,33072,33060,33282,33333,33335,33334,33337,33678,33694,33688,33656,33698,33686,33725,33707,33682,33674,33683,33673,33696,33655,33659,33660,33670,33703,34389,24426,34503,34496,34486,34500,34485,34502,34507,34481,34479,34505,34899,34974,34952,34987,34962,34966,34957,34955,35219,35215,35370,35357,35363,35365,35377,35373,35359,35355,35362,35913,35930,36009,36012,36011,36008,36010,36007,36199,36198,36286,36282,36571,36575,36889,36877,36890,36887,36899,36895,36893,36880,36885,36894,36896,36879,36898,36886,36891,36884,37096,37101,37117,37207,37326,37365,37350,37347,37351,37357,37353,38281,38506,38517,38515,38520,38512,38516,38518,38519,38508,38592,38634,38633,31456,31455,38914,38915,39770,40165,40565,40575,40613,40635,20642,20621,20613,20633,20625,20608,20630,20632,20634,26368,20977,21106,21108,21109,21097,21214,21213,21211,21338,21413,21883,21888,21927,21884,21898,21917,21912,21890,21916,21930,21908,21895,21899,21891,21939,21934,21919,21822,21938,21914,21947,21932,21937,21886,21897,21931,21913,22285,22575,22570,22580,22564,22576,22577,22561,22557,22560,22777,22778,22880,23159,23194,23167,23186,23195,23207,23411,23409,23506,23500,23507,23504,23562,23563,23601,23884,23888,23860,23879,24061,24133,24125,24128,24131,24190,24266,24257,24258,24260,24380,24429,24489,24490,24488,24785,24801,24754,24758,24800,24860,24867,24826,24853,24816,24827,24820,24936,24817,24846,24822,24841,24832,24850,25119,25161,25507,25484,25551,25536,25577,25545,25542,25549,25554,25571,25552,25569,25558,25581,25582,25462,25588,25578,25563,25682,25562,25593,25950,25958,25954,25955,26001,26000,26031,26222,26224,26228,26230,26223,26257,26234,26238,26231,26366,26367,26399,26397,26874,26837,26848,26840,26839,26885,26847,26869,26862,26855,26873,26834,26866,26851,26827,26829,26893,26898,26894,26825,26842,26990,26875,27454,27450,27453,27544,27542,27580,27631,27694,27695,27692,28207,28216,28244,28193,28210,28263,28234,28192,28197,28195,28187,28251,28248,28196,28246,28270,28205,28198,28271,28212,28237,28218,28204,28227,28189,28222,28363,28297,28185,28238,28259,28228,28274,28265,28255,28953,28954,28966,28976,28961,28982,29038,28956,29260,29316,29312,29494,29477,29492,29481,29754,29738,29747,29730,29733,29749,29750,29748,29743,29723,29734,29736,29989,29990,30059,30058,30178,30171,30179,30169,30168,30174,30176,30331,30332,30358,30355,30388,30428,30543,30701,30813,30828,30831,31245,31240,31243,31237,31232,31384,31383,31382,31461,31459,31561,31574,31558,31568,31570,31572,31565,31563,31567,31569,31903,31909,32094,32080,32104,32085,32043,32110,32114,32097,32102,32098,32112,32115,21892,32724,32725,32779,32850,32901,33109,33108,33099,33105,33102,33081,33094,33086,33100,33107,33140,33298,33308,33769,33795,33784,33805,33760,33733,33803,33729,33775,33777,33780,33879,33802,33776,33804,33740,33789,33778,33738,33848,33806,33796,33756,33799,33748,33759,34395,34527,34521,34541,34516,34523,34532,34512,34526,34903,35009,35010,34993,35203,35222,35387,35424,35413,35422,35388,35393,35412,35419,35408,35398,35380,35386,35382,35414,35937,35970,36015,36028,36019,36029,36033,36027,36032,36020,36023,36022,36031,36024,36234,36229,36225,36302,36317,36299,36314,36305,36300,36315,36294,36603,36600,36604,36764,36910,36917,36913,36920,36914,36918,37122,37109,37129,37118,37219,37221,37327,37396,37397,37411,37385,37406,37389,37392,37383,37393,38292,38287,38283,38289,38291,38290,38286,38538,38542,38539,38525,38533,38534,38541,38514,38532,38593,38597,38596,38598,38599,38639,38642,38860,38917,38918,38920,39143,39146,39151,39145,39154,39149,39342,39341,40643,40653,40657,20098,20653,20661,20658,20659,20677,20670,20652,20663,20667,20655,20679,21119,21111,21117,21215,21222,21220,21218,21219,21295,21983,21992,21971,21990,21966,21980,21959,21969,21987,21988,21999,21978,21985,21957,21958,21989,21961,22290,22291,22622,22609,22616,22615,22618,22612,22635,22604,22637,22602,22626,22610,22603,22887,23233,23241,23244,23230,23229,23228,23219,23234,23218,23913,23919,24140,24185,24265,24264,24338,24409,24492,24494,24858,24847,24904,24863,24819,24859,24825,24833,24840,24910,24908,24900,24909,24894,24884,24871,24845,24838,24887,25121,25122,25619,25662,25630,25642,25645,25661,25644,25615,25628,25620,25613,25654,25622,25623,25606,25964,26015,26032,26263,26249,26247,26248,26262,26244,26264,26253,26371,27028,26989,26970,26999,26976,26964,26997,26928,27010,26954,26984,26987,26974,26963,27001,27014,26973,26979,26971,27463,27506,27584,27583,27603,27645,28322,28335,28371,28342,28354,28304,28317,28359,28357,28325,28312,28348,28346,28331,28369,28310,28316,28356,28372,28330,28327,28340,29006,29017,29033,29028,29001,29031,29020,29036,29030,29004,29029,29022,28998,29032,29014,29242,29266,29495,29509,29503,29502,29807,29786,29781,29791,29790,29761,29759,29785,29787,29788,30070,30072,30208,30192,30209,30194,30193,30202,30207,30196,30195,30430,30431,30555,30571,30566,30558,30563,30585,30570,30572,30556,30565,30568,30562,30702,30862,30896,30871,30872,30860,30857,30844,30865,30867,30847,31098,31103,31105,33836,31165,31260,31258,31264,31252,31263,31262,31391,31392,31607,31680,31584,31598,31591,31921,31923,31925,32147,32121,32145,32129,32143,32091,32622,32617,32618,32626,32681,32680,32676,32854,32856,32902,32900,33137,33136,33144,33125,33134,33139,33131,33145,33146,33126,33285,33351,33922,33911,33853,33841,33909,33894,33899,33865,33900,33883,33852,33845,33889,33891,33897,33901,33862,34398,34396,34399,34553,34579,34568,34567,34560,34558,34555,34562,34563,34566,34570,34905,35039,35028,35033,35036,35032,35037,35041,35018,35029,35026,35228,35299,35435,35442,35443,35430,35433,35440,35463,35452,35427,35488,35441,35461,35437,35426,35438,35436,35449,35451,35390,35432,35938,35978,35977,36042,36039,36040,36036,36018,36035,36034,36037,36321,36319,36328,36335,36339,36346,36330,36324,36326,36530,36611,36617,36606,36618,36767,36786,36939,36938,36947,36930,36948,36924,36949,36944,36935,36943,36942,36941,36945,36926,36929,37138,37143,37228,37226,37225,37321,37431,37463,37432,37437,37440,37438,37467,37451,37476,37457,37428,37449,37453,37445,37433,37439,37466,38296,38552,38548,38549,38605,38603,38601,38602,38647,38651,38649,38646,38742,38772,38774,38928,38929,38931,38922,38930,38924,39164,39156,39165,39166,39347,39345,39348,39649,40169,40578,40718,40723,40736,20711,20718,20709,20694,20717,20698,20693,20687,20689,20721,20686,20713,20834,20979,21123,21122,21297,21421,22014,22016,22043,22039,22013,22036,22022,22025,22029,22030,22007,22038,22047,22024,22032,22006,22296,22294,22645,22654,22659,22675,22666,22649,22661,22653,22781,22821,22818,22820,22890,22889,23265,23270,23273,23255,23254,23256,23267,23413,23518,23527,23521,23525,23526,23528,23522,23524,23519,23565,23650,23940,23943,24155,24163,24149,24151,24148,24275,24278,24330,24390,24432,24505,24903,24895,24907,24951,24930,24931,24927,24922,24920,24949,25130,25735,25688,25684,25764,25720,25695,25722,25681,25703,25652,25709,25723,25970,26017,26071,26070,26274,26280,26269,27036,27048,27029,27073,27054,27091,27083,27035,27063,27067,27051,27060,27088,27085,27053,27084,27046,27075,27043,27465,27468,27699,28467,28436,28414,28435,28404,28457,28478,28448,28460,28431,28418,28450,28415,28399,28422,28465,28472,28466,28451,28437,28459,28463,28552,28458,28396,28417,28402,28364,28407,29076,29081,29053,29066,29060,29074,29246,29330,29334,29508,29520,29796,29795,29802,29808,29805,29956,30097,30247,30221,30219,30217,30227,30433,30435,30596,30589,30591,30561,30913,30879,30887,30899,30889,30883,31118,31119,31117,31278,31281,31402,31401,31469,31471,31649,31637,31627,31605,31639,31645,31636,31631,31672,31623,31620,31929,31933,31934,32187,32176,32156,32189,32190,32160,32202,32180,32178,32177,32186,32162,32191,32181,32184,32173,32210,32199,32172,32624,32736,32737,32735,32862,32858,32903,33104,33152,33167,33160,33162,33151,33154,33255,33274,33287,33300,33310,33355,33993,33983,33990,33988,33945,33950,33970,33948,33995,33976,33984,34003,33936,33980,34001,33994,34623,34588,34619,34594,34597,34612,34584,34645,34615,34601,35059,35074,35060,35065,35064,35069,35048,35098,35055,35494,35468,35486,35491,35469,35489,35475,35492,35498,35493,35496,35480,35473,35482,35495,35946,35981,35980,36051,36049,36050,36203,36249,36245,36348,36628,36626,36629,36627,36771,36960,36952,36956,36963,36953,36958,36962,36957,36955,37145,37144,37150,37237,37240,37239,37236,37496,37504,37509,37528,37526,37499,37523,37532,37544,37500,37521,38305,38312,38313,38307,38309,38308,38553,38556,38555,38604,38610,38656,38780,38789,38902,38935,38936,39087,39089,39171,39173,39180,39177,39361,39599,39600,39654,39745,39746,40180,40182,40179,40636,40763,40778,20740,20736,20731,20725,20729,20738,20744,20745,20741,20956,21127,21128,21129,21133,21130,21232,21426,22062,22075,22073,22066,22079,22068,22057,22099,22094,22103,22132,22070,22063,22064,22656,22687,22686,22707,22684,22702,22697,22694,22893,23305,23291,23307,23285,23308,23304,23534,23532,23529,23531,23652,23653,23965,23956,24162,24159,24161,24290,24282,24287,24285,24291,24288,24392,24433,24503,24501,24950,24935,24942,24925,24917,24962,24956,24944,24939,24958,24999,24976,25003,24974,25004,24986,24996,24980,25006,25134,25705,25711,25721,25758,25778,25736,25744,25776,25765,25747,25749,25769,25746,25774,25773,25771,25754,25772,25753,25762,25779,25973,25975,25976,26286,26283,26292,26289,27171,27167,27112,27137,27166,27161,27133,27169,27155,27146,27123,27138,27141,27117,27153,27472,27470,27556,27589,27590,28479,28540,28548,28497,28518,28500,28550,28525,28507,28536,28526,28558,28538,28528,28516,28567,28504,28373,28527,28512,28511,29087,29100,29105,29096,29270,29339,29518,29527,29801,29835,29827,29822,29824,30079,30240,30249,30239,30244,30246,30241,30242,30362,30394,30436,30606,30599,30604,30609,30603,30923,30917,30906,30922,30910,30933,30908,30928,31295,31292,31296,31293,31287,31291,31407,31406,31661,31665,31684,31668,31686,31687,31681,31648,31692,31946,32224,32244,32239,32251,32216,32236,32221,32232,32227,32218,32222,32233,32158,32217,32242,32249,32629,32631,32687,32745,32806,33179,33180,33181,33184,33178,33176,34071,34109,34074,34030,34092,34093,34067,34065,34083,34081,34068,34028,34085,34047,34054,34690,34676,34678,34656,34662,34680,34664,34649,34647,34636,34643,34907,34909,35088,35079,35090,35091,35093,35082,35516,35538,35527,35524,35477,35531,35576,35506,35529,35522,35519,35504,35542,35533,35510,35513,35547,35916,35918,35948,36064,36062,36070,36068,36076,36077,36066,36067,36060,36074,36065,36205,36255,36259,36395,36368,36381,36386,36367,36393,36383,36385,36382,36538,36637,36635,36639,36649,36646,36650,36636,36638,36645,36969,36974,36968,36973,36983,37168,37165,37159,37169,37255,37257,37259,37251,37573,37563,37559,37610,37548,37604,37569,37555,37564,37586,37575,37616,37554,38317,38321,38660,38662,38663,38665,38752,38797,38795,38799,38945,38955,38940,39091,39178,39187,39186,39192,39389,39376,39391,39387,39377,39381,39378,39385,39607,39662,39663,39719,39749,39748,39799,39791,40198,40201,40195,40617,40638,40654,22696,40786,20754,20760,20756,20752,20757,20864,20906,20957,21137,21139,21235,22105,22123,22137,22121,22116,22136,22122,22120,22117,22129,22127,22124,22114,22134,22721,22718,22727,22725,22894,23325,23348,23416,23536,23566,24394,25010,24977,25001,24970,25037,25014,25022,25034,25032,25136,25797,25793,25803,25787,25788,25818,25796,25799,25794,25805,25791,25810,25812,25790,25972,26310,26313,26297,26308,26311,26296,27197,27192,27194,27225,27243,27224,27193,27204,27234,27233,27211,27207,27189,27231,27208,27481,27511,27653,28610,28593,28577,28611,28580,28609,28583,28595,28608,28601,28598,28582,28576,28596,29118,29129,29136,29138,29128,29141,29113,29134,29145,29148,29123,29124,29544,29852,29859,29848,29855,29854,29922,29964,29965,30260,30264,30266,30439,30437,30624,30622,30623,30629,30952,30938,30956,30951,31142,31309,31310,31302,31308,31307,31418,31705,31761,31689,31716,31707,31713,31721,31718,31957,31958,32266,32273,32264,32283,32291,32286,32285,32265,32272,32633,32690,32752,32753,32750,32808,33203,33193,33192,33275,33288,33368,33369,34122,34137,34120,34152,34153,34115,34121,34157,34154,34142,34691,34719,34718,34722,34701,34913,35114,35122,35109,35115,35105,35242,35238,35558,35578,35563,35569,35584,35548,35559,35566,35582,35585,35586,35575,35565,35571,35574,35580,35947,35949,35987,36084,36420,36401,36404,36418,36409,36405,36667,36655,36664,36659,36776,36774,36981,36980,36984,36978,36988,36986,37172,37266,37664,37686,37624,37683,37679,37666,37628,37675,37636,37658,37648,37670,37665,37653,37678,37657,38331,38567,38568,38570,38613,38670,38673,38678,38669,38675,38671,38747,38748,38758,38808,38960,38968,38971,38967,38957,38969,38948,39184,39208,39198,39195,39201,39194,39405,39394,39409,39608,39612,39675,39661,39720,39825,40213,40227,40230,40232,40210,40219,40664,40660,40845,40860,20778,20767,20769,20786,21237,22158,22144,22160,22149,22151,22159,22741,22739,22737,22734,23344,23338,23332,23418,23607,23656,23996,23994,23997,23992,24171,24396,24509,25033,25026,25031,25062,25035,25138,25140,25806,25802,25816,25824,25840,25830,25836,25841,25826,25837,25986,25987,26329,26326,27264,27284,27268,27298,27292,27355,27299,27262,27287,27280,27296,27484,27566,27610,27656,28632,28657,28639,28640,28635,28644,28651,28655,28544,28652,28641,28649,28629,28654,28656,29159,29151,29166,29158,29157,29165,29164,29172,29152,29237,29254,29552,29554,29865,29872,29862,29864,30278,30274,30284,30442,30643,30634,30640,30636,30631,30637,30703,30967,30970,30964,30959,30977,31143,31146,31319,31423,31751,31757,31742,31735,31756,31712,31968,31964,31966,31970,31967,31961,31965,32302,32318,32326,32311,32306,32323,32299,32317,32305,32325,32321,32308,32313,32328,32309,32319,32303,32580,32755,32764,32881,32882,32880,32879,32883,33222,33219,33210,33218,33216,33215,33213,33225,33214,33256,33289,33393,34218,34180,34174,34204,34193,34196,34223,34203,34183,34216,34186,34407,34752,34769,34739,34770,34758,34731,34747,34746,34760,34763,35131,35126,35140,35128,35133,35244,35598,35607,35609,35611,35594,35616,35613,35588,35600,35905,35903,35955,36090,36093,36092,36088,36091,36264,36425,36427,36424,36426,36676,36670,36674,36677,36671,36991,36989,36996,36993,36994,36992,37177,37283,37278,37276,37709,37762,37672,37749,37706,37733,37707,37656,37758,37740,37723,37744,37722,37716,38346,38347,38348,38344,38342,38577,38584,38614,38684,38686,38816,38867,38982,39094,39221,39425,39423,39854,39851,39850,39853,40251,40255,40587,40655,40670,40668,40669,40667,40766,40779,21474,22165,22190,22745,22744,23352,24413,25059,25139,25844,25842,25854,25862,25850,25851,25847,26039,26332,26406,27315,27308,27331,27323,27320,27330,27310,27311,27487,27512,27567,28681,28683,28670,28678,28666,28689,28687,29179,29180,29182,29176,29559,29557,29863,29887,29973,30294,30296,30290,30653,30655,30651,30652,30990,31150,31329,31330,31328,31428,31429,31787,31783,31786,31774,31779,31777,31975,32340,32341,32350,32346,32353,32338,32345,32584,32761,32763,32887,32886,33229,33231,33290,34255,34217,34253,34256,34249,34224,34234,34233,34214,34799,34796,34802,34784,35206,35250,35316,35624,35641,35628,35627,35920,36101,36441,36451,36454,36452,36447,36437,36544,36681,36685,36999,36995,37000,37291,37292,37328,37780,37770,37782,37794,37811,37806,37804,37808,37784,37786,37783,38356,38358,38352,38357,38626,38620,38617,38619,38622,38692,38819,38822,38829,38905,38989,38991,38988,38990,38995,39098,39230,39231,39229,39214,39333,39438,39617,39683,39686,39759,39758,39757,39882,39881,39933,39880,39872,40273,40285,40288,40672,40725,40748,20787,22181,22750,22751,22754,23541,40848,24300,25074,25079,25078,25077,25856,25871,26336,26333,27365,27357,27354,27347,28699,28703,28712,28698,28701,28693,28696,29190,29197,29272,29346,29560,29562,29885,29898,29923,30087,30086,30303,30305,30663,31001,31153,31339,31337,31806,31807,31800,31805,31799,31808,32363,32365,32377,32361,32362,32645,32371,32694,32697,32696,33240,34281,34269,34282,34261,34276,34277,34295,34811,34821,34829,34809,34814,35168,35167,35158,35166,35649,35676,35672,35657,35674,35662,35663,35654,35673,36104,36106,36476,36466,36487,36470,36460,36474,36468,36692,36686,36781,37002,37003,37297,37294,37857,37841,37855,37827,37832,37852,37853,37846,37858,37837,37848,37860,37847,37864,38364,38580,38627,38698,38695,38753,38876,38907,39006,39000,39003,39100,39237,39241,39446,39449,39693,39912,39911,39894,39899,40329,40289,40306,40298,40300,40594,40599,40595,40628,21240,22184,22199,22198,22196,22204,22756,23360,23363,23421,23542,24009,25080,25082,25880,25876,25881,26342,26407,27372,28734,28720,28722,29200,29563,29903,30306,30309,31014,31018,31020,31019,31431,31478,31820,31811,31821,31983,31984,36782,32381,32380,32386,32588,32768,33242,33382,34299,34297,34321,34298,34310,34315,34311,34314,34836,34837,35172,35258,35320,35696,35692,35686,35695,35679,35691,36111,36109,36489,36481,36485,36482,37300,37323,37912,37891,37885,38369,38704,39108,39250,39249,39336,39467,39472,39479,39477,39955,39949,40569,40629,40680,40751,40799,40803,40801,20791,20792,22209,22208,22210,22804,23660,24013,25084,25086,25885,25884,26005,26345,27387,27396,27386,27570,28748,29211,29351,29910,29908,30313,30675,31824,32399,32396,32700,34327,34349,34330,34851,34850,34849,34847,35178,35180,35261,35700,35703,35709,36115,36490,36493,36491,36703,36783,37306,37934,37939,37941,37946,37944,37938,37931,38370,38712,38713,38706,38911,39015,39013,39255,39493,39491,39488,39486,39631,39764,39761,39981,39973,40367,40372,40386,40376,40605,40687,40729,40796,40806,40807,20796,20795,22216,22218,22217,23423,24020,24018,24398,25087,25892,27402,27489,28753,28760,29568,29924,30090,30318,30316,31155,31840,31839,32894,32893,33247,35186,35183,35324,35712,36118,36119,36497,36499,36705,37192,37956,37969,37970,38717,38718,38851,38849,39019,39253,39509,39501,39634,39706,40009,39985,39998,39995,40403,40407,40756,40812,40810,40852,22220,24022,25088,25891,25899,25898,26348,27408,29914,31434,31844,31843,31845,32403,32406,32404,33250,34360,34367,34865,35722,37008,37007,37987,37984,37988,38760,39023,39260,39514,39515,39511,39635,39636,39633,40020,40023,40022,40421,40607,40692,22225,22761,25900,28766,30321,30322,30679,32592,32648,34870,34873,34914,35731,35730,35734,33399,36123,37312,37994,38722,38728,38724,38854,39024,39519,39714,39768,40031,40441,40442,40572,40573,40711,40823,40818,24307,27414,28771,31852,31854,34875,35264,36513,37313,38002,38000,39025,39262,39638,39715,40652,28772,30682,35738,38007,38857,39522,39525,32412,35740,36522,37317,38013,38014,38012,40055,40056,40695,35924,38015,40474,29224,39530,39729,40475,40478,31858,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,20022,20031,20101,20128,20866,20886,20907,21241,21304,21353,21430,22794,23424,24027,12083,24191,24308,24400,24417,25908,26080,30098,30326,36789,38582,168,710,12541,12542,12445,12446,12291,20189,12293,12294,12295,12540,65339,65341,10045,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8679,8632,8633,12751,131276,20058,131210,20994,17553,40880,20872,40881,161287,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,65506,65508,65287,65282,12849,8470,8481,12443,12444,11904,11908,11910,11911,11912,11914,11916,11917,11925,11932,11933,11941,11943,11946,11948,11950,11958,11964,11966,11974,11978,11980,11981,11983,11990,11991,11998,12003,null,null,null,643,592,603,596,629,339,248,331,650,618,20034,20060,20981,21274,21378,19975,19980,20039,20109,22231,64012,23662,24435,19983,20871,19982,20014,20115,20162,20169,20168,20888,21244,21356,21433,22304,22787,22828,23568,24063,26081,27571,27596,27668,29247,20017,20028,20200,20188,20201,20193,20189,20186,21004,21276,21324,22306,22307,22807,22831,23425,23428,23570,23611,23668,23667,24068,24192,24194,24521,25097,25168,27669,27702,27715,27711,27707,29358,29360,29578,31160,32906,38430,20238,20248,20268,20213,20244,20209,20224,20215,20232,20253,20226,20229,20258,20243,20228,20212,20242,20913,21011,21001,21008,21158,21282,21279,21325,21386,21511,22241,22239,22318,22314,22324,22844,22912,22908,22917,22907,22910,22903,22911,23382,23573,23589,23676,23674,23675,23678,24031,24181,24196,24322,24346,24436,24533,24532,24527,25180,25182,25188,25185,25190,25186,25177,25184,25178,25189,26095,26094,26430,26425,26424,26427,26426,26431,26428,26419,27672,27718,27730,27740,27727,27722,27732,27723,27724,28785,29278,29364,29365,29582,29994,30335,31349,32593,33400,33404,33408,33405,33407,34381,35198,37017,37015,37016,37019,37012,38434,38436,38432,38435,20310,20283,20322,20297,20307,20324,20286,20327,20306,20319,20289,20312,20269,20275,20287,20321,20879,20921,21020,21022,21025,21165,21166,21257,21347,21362,21390,21391,21552,21559,21546,21588,21573,21529,21532,21541,21528,21565,21583,21569,21544,21540,21575,22254,22247,22245,22337,22341,22348,22345,22347,22354,22790,22848,22950,22936,22944,22935,22926,22946,22928,22927,22951,22945,23438,23442,23592,23594,23693,23695,23688,23691,23689,23698,23690,23686,23699,23701,24032,24074,24078,24203,24201,24204,24200,24205,24325,24349,24440,24438,24530,24529,24528,24557,24552,24558,24563,24545,24548,24547,24570,24559,24567,24571,24576,24564,25146,25219,25228,25230,25231,25236,25223,25201,25211,25210,25200,25217,25224,25207,25213,25202,25204,25911,26096,26100,26099,26098,26101,26437,26439,26457,26453,26444,26440,26461,26445,26458,26443,27600,27673,27674,27768,27751,27755,27780,27787,27791,27761,27759,27753,27802,27757,27783,27797,27804,27750,27763,27749,27771,27790,28788,28794,29283,29375,29373,29379,29382,29377,29370,29381,29589,29591,29587,29588,29586,30010,30009,30100,30101,30337,31037,32820,32917,32921,32912,32914,32924,33424,33423,33413,33422,33425,33427,33418,33411,33412,35960,36809,36799,37023,37025,37029,37022,37031,37024,38448,38440,38447,38445,20019,20376,20348,20357,20349,20352,20359,20342,20340,20361,20356,20343,20300,20375,20330,20378,20345,20353,20344,20368,20380,20372,20382,20370,20354,20373,20331,20334,20894,20924,20926,21045,21042,21043,21062,21041,21180,21258,21259,21308,21394,21396,21639,21631,21633,21649,21634,21640,21611,21626,21630,21605,21612,21620,21606,21645,21615,21601,21600,21656,21603,21607,21604,22263,22265,22383,22386,22381,22379,22385,22384,22390,22400,22389,22395,22387,22388,22370,22376,22397,22796,22853,22965,22970,22991,22990,22962,22988,22977,22966,22972,22979,22998,22961,22973,22976,22984,22964,22983,23394,23397,23443,23445,23620,23623,23726,23716,23712,23733,23727,23720,23724,23711,23715,23725,23714,23722,23719,23709,23717,23734,23728,23718,24087,24084,24089,24360,24354,24355,24356,24404,24450,24446,24445,24542,24549,24621,24614,24601,24626,24587,24628,24586,24599,24627,24602,24606,24620,24610,24589,24592,24622,24595,24593,24588,24585,24604,25108,25149,25261,25268,25297,25278,25258,25270,25290,25262,25267,25263,25275,25257,25264,25272,25917,26024,26043,26121,26108,26116,26130,26120,26107,26115,26123,26125,26117,26109,26129,26128,26358,26378,26501,26476,26510,26514,26486,26491,26520,26502,26500,26484,26509,26508,26490,26527,26513,26521,26499,26493,26497,26488,26489,26516,27429,27520,27518,27614,27677,27795,27884,27883,27886,27865,27830,27860,27821,27879,27831,27856,27842,27834,27843,27846,27885,27890,27858,27869,27828,27786,27805,27776,27870,27840,27952,27853,27847,27824,27897,27855,27881,27857,28820,28824,28805,28819,28806,28804,28817,28822,28802,28826,28803,29290,29398,29387,29400,29385,29404,29394,29396,29402,29388,29393,29604,29601,29613,29606,29602,29600,29612,29597,29917,29928,30015,30016,30014,30092,30104,30383,30451,30449,30448,30453,30712,30716,30713,30715,30714,30711,31042,31039,31173,31352,31355,31483,31861,31997,32821,32911,32942,32931,32952,32949,32941,33312,33440,33472,33451,33434,33432,33435,33461,33447,33454,33468,33438,33466,33460,33448,33441,33449,33474,33444,33475,33462,33442,34416,34415,34413,34414,35926,36818,36811,36819,36813,36822,36821,36823,37042,37044,37039,37043,37040,38457,38461,38460,38458,38467,20429,20421,20435,20402,20425,20427,20417,20436,20444,20441,20411,20403,20443,20423,20438,20410,20416,20409,20460,21060,21065,21184,21186,21309,21372,21399,21398,21401,21400,21690,21665,21677,21669,21711,21699,33549,21687,21678,21718,21686,21701,21702,21664,21616,21692,21666,21694,21618,21726,21680,22453,22430,22431,22436,22412,22423,22429,22427,22420,22424,22415,22425,22437,22426,22421,22772,22797,22867,23009,23006,23022,23040,23025,23005,23034,23037,23036,23030,23012,23026,23031,23003,23017,23027,23029,23008,23038,23028,23021,23464,23628,23760,23768,23756,23767,23755,23771,23774,23770,23753,23751,23754,23766,23763,23764,23759,23752,23750,23758,23775,23800,24057,24097,24098,24099,24096,24100,24240,24228,24226,24219,24227,24229,24327,24366,24406,24454,24631,24633,24660,24690,24670,24645,24659,24647,24649,24667,24652,24640,24642,24671,24612,24644,24664,24678,24686,25154,25155,25295,25357,25355,25333,25358,25347,25323,25337,25359,25356,25336,25334,25344,25363,25364,25338,25365,25339,25328,25921,25923,26026,26047,26166,26145,26162,26165,26140,26150,26146,26163,26155,26170,26141,26164,26169,26158,26383,26384,26561,26610,26568,26554,26588,26555,26616,26584,26560,26551,26565,26603,26596,26591,26549,26573,26547,26615,26614,26606,26595,26562,26553,26574,26599,26608,26546,26620,26566,26605,26572,26542,26598,26587,26618,26569,26570,26563,26602,26571,27432,27522,27524,27574,27606,27608,27616,27680,27681,27944,27956,27949,27935,27964,27967,27922,27914,27866,27955,27908,27929,27962,27930,27921,27904,27933,27970,27905,27928,27959,27907,27919,27968,27911,27936,27948,27912,27938,27913,27920,28855,28831,28862,28849,28848,28833,28852,28853,28841,29249,29257,29258,29292,29296,29299,29294,29386,29412,29416,29419,29407,29418,29414,29411,29573,29644,29634,29640,29637,29625,29622,29621,29620,29675,29631,29639,29630,29635,29638,29624,29643,29932,29934,29998,30023,30024,30119,30122,30329,30404,30472,30467,30468,30469,30474,30455,30459,30458,30695,30696,30726,30737,30738,30725,30736,30735,30734,30729,30723,30739,31050,31052,31051,31045,31044,31189,31181,31183,31190,31182,31360,31358,31441,31488,31489,31866,31864,31865,31871,31872,31873,32003,32008,32001,32600,32657,32653,32702,32775,32782,32783,32788,32823,32984,32967,32992,32977,32968,32962,32976,32965,32995,32985,32988,32970,32981,32969,32975,32983,32998,32973,33279,33313,33428,33497,33534,33529,33543,33512,33536,33493,33594,33515,33494,33524,33516,33505,33522,33525,33548,33531,33526,33520,33514,33508,33504,33530,33523,33517,34423,34420,34428,34419,34881,34894,34919,34922,34921,35283,35332,35335,36210,36835,36833,36846,36832,37105,37053,37055,37077,37061,37054,37063,37067,37064,37332,37331,38484,38479,38481,38483,38474,38478,20510,20485,20487,20499,20514,20528,20507,20469,20468,20531,20535,20524,20470,20471,20503,20508,20512,20519,20533,20527,20529,20494,20826,20884,20883,20938,20932,20933,20936,20942,21089,21082,21074,21086,21087,21077,21090,21197,21262,21406,21798,21730,21783,21778,21735,21747,21732,21786,21759,21764,21768,21739,21777,21765,21745,21770,21755,21751,21752,21728,21774,21763,21771,22273,22274,22476,22578,22485,22482,22458,22470,22461,22460,22456,22454,22463,22471,22480,22457,22465,22798,22858,23065,23062,23085,23086,23061,23055,23063,23050,23070,23091,23404,23463,23469,23468,23555,23638,23636,23788,23807,23790,23793,23799,23808,23801,24105,24104,24232,24238,24234,24236,24371,24368,24423,24669,24666,24679,24641,24738,24712,24704,24722,24705,24733,24707,24725,24731,24727,24711,24732,24718,25113,25158,25330,25360,25430,25388,25412,25413,25398,25411,25572,25401,25419,25418,25404,25385,25409,25396,25432,25428,25433,25389,25415,25395,25434,25425,25400,25431,25408,25416,25930,25926,26054,26051,26052,26050,26186,26207,26183,26193,26386,26387,26655,26650,26697,26674,26675,26683,26699,26703,26646,26673,26652,26677,26667,26669,26671,26702,26692,26676,26653,26642,26644,26662,26664,26670,26701,26682,26661,26656,27436,27439,27437,27441,27444,27501,32898,27528,27622,27620,27624,27619,27618,27623,27685,28026,28003,28004,28022,27917,28001,28050,27992,28002,28013,28015,28049,28045,28143,28031,28038,27998,28007,28000,28055,28016,28028,27999,28034,28056,27951,28008,28043,28030,28032,28036,27926,28035,28027,28029,28021,28048,28892,28883,28881,28893,28875,32569,28898,28887,28882,28894,28896,28884,28877,28869,28870,28871,28890,28878,28897,29250,29304,29303,29302,29440,29434,29428,29438,29430,29427,29435,29441,29651,29657,29669,29654,29628,29671,29667,29673,29660,29650,29659,29652,29661,29658,29655,29656,29672,29918,29919,29940,29941,29985,30043,30047,30128,30145,30139,30148,30144,30143,30134,30138,30346,30409,30493,30491,30480,30483,30482,30499,30481,30485,30489,30490,30498,30503,30755,30764,30754,30773,30767,30760,30766,30763,30753,30761,30771,30762,30769,31060,31067,31055,31068,31059,31058,31057,31211,31212,31200,31214,31213,31210,31196,31198,31197,31366,31369,31365,31371,31372,31370,31367,31448,31504,31492,31507,31493,31503,31496,31498,31502,31497,31506,31876,31889,31882,31884,31880,31885,31877,32030,32029,32017,32014,32024,32022,32019,32031,32018,32015,32012,32604,32609,32606,32608,32605,32603,32662,32658,32707,32706,32704,32790,32830,32825,33018,33010,33017,33013,33025,33019,33024,33281,33327,33317,33587,33581,33604,33561,33617,33573,33622,33599,33601,33574,33564,33570,33602,33614,33563,33578,33544,33596,33613,33558,33572,33568,33591,33583,33577,33607,33605,33612,33619,33566,33580,33611,33575,33608,34387,34386,34466,34472,34454,34445,34449,34462,34439,34455,34438,34443,34458,34437,34469,34457,34465,34471,34453,34456,34446,34461,34448,34452,34883,34884,34925,34933,34934,34930,34944,34929,34943,34927,34947,34942,34932,34940,35346,35911,35927,35963,36004,36003,36214,36216,36277,36279,36278,36561,36563,36862,36853,36866,36863,36859,36868,36860,36854,37078,37088,37081,37082,37091,37087,37093,37080,37083,37079,37084,37092,37200,37198,37199,37333,37346,37338,38492,38495,38588,39139,39647,39727,20095,20592,20586,20577,20574,20576,20563,20555,20573,20594,20552,20557,20545,20571,20554,20578,20501,20549,20575,20585,20587,20579,20580,20550,20544,20590,20595,20567,20561,20944,21099,21101,21100,21102,21206,21203,21293,21404,21877,21878,21820,21837,21840,21812,21802,21841,21858,21814,21813,21808,21842,21829,21772,21810,21861,21838,21817,21832,21805,21819,21824,21835,22282,22279,22523,22548,22498,22518,22492,22516,22528,22509,22525,22536,22520,22539,22515,22479,22535,22510,22499,22514,22501,22508,22497,22542,22524,22544,22503,22529,22540,22513,22505,22512,22541,22532,22876,23136,23128,23125,23143,23134,23096,23093,23149,23120,23135,23141,23148,23123,23140,23127,23107,23133,23122,23108,23131,23112,23182,23102,23117,23097,23116,23152,23145,23111,23121,23126,23106,23132,23410,23406,23489,23488,23641,23838,23819,23837,23834,23840,23820,23848,23821,23846,23845,23823,23856,23826,23843,23839,23854,24126,24116,24241,24244,24249,24242,24243,24374,24376,24475,24470,24479,24714,24720,24710,24766,24752,24762,24787,24788,24783,24804,24793,24797,24776,24753,24795,24759,24778,24767,24771,24781,24768,25394,25445,25482,25474,25469,25533,25502,25517,25501,25495,25515,25486,25455,25479,25488,25454,25519,25461,25500,25453,25518,25468,25508,25403,25503,25464,25477,25473,25489,25485,25456,25939,26061,26213,26209,26203,26201,26204,26210,26392,26745,26759,26768,26780,26733,26734,26798,26795,26966,26735,26787,26796,26793,26741,26740,26802,26767,26743,26770,26748,26731,26738,26794,26752,26737,26750,26779,26774,26763,26784,26761,26788,26744,26747,26769,26764,26762,26749,27446,27443,27447,27448,27537,27535,27533,27534,27532,27690,28096,28075,28084,28083,28276,28076,28137,28130,28087,28150,28116,28160,28104,28128,28127,28118,28094,28133,28124,28125,28123,28148,28106,28093,28141,28144,28090,28117,28098,28111,28105,28112,28146,28115,28157,28119,28109,28131,28091,28922,28941,28919,28951,28916,28940,28912,28932,28915,28944,28924,28927,28934,28947,28928,28920,28918,28939,28930,28942,29310,29307,29308,29311,29469,29463,29447,29457,29464,29450,29448,29439,29455,29470,29576,29686,29688,29685,29700,29697,29693,29703,29696,29690,29692,29695,29708,29707,29684,29704,30052,30051,30158,30162,30159,30155,30156,30161,30160,30351,30345,30419,30521,30511,30509,30513,30514,30516,30515,30525,30501,30523,30517,30792,30802,30793,30797,30794,30796,30758,30789,30800,31076,31079,31081,31082,31075,31083,31073,31163,31226,31224,31222,31223,31375,31380,31376,31541,31559,31540,31525,31536,31522,31524,31539,31512,31530,31517,31537,31531,31533,31535,31538,31544,31514,31523,31892,31896,31894,31907,32053,32061,32056,32054,32058,32069,32044,32041,32065,32071,32062,32063,32074,32059,32040,32611,32661,32668,32669,32667,32714,32715,32717,32720,32721,32711,32719,32713,32799,32798,32795,32839,32835,32840,33048,33061,33049,33051,33069,33055,33068,33054,33057,33045,33063,33053,33058,33297,33336,33331,33338,33332,33330,33396,33680,33699,33704,33677,33658,33651,33700,33652,33679,33665,33685,33689,33653,33684,33705,33661,33667,33676,33693,33691,33706,33675,33662,33701,33711,33672,33687,33712,33663,33702,33671,33710,33654,33690,34393,34390,34495,34487,34498,34497,34501,34490,34480,34504,34489,34483,34488,34508,34484,34491,34492,34499,34493,34494,34898,34953,34965,34984,34978,34986,34970,34961,34977,34975,34968,34983,34969,34971,34967,34980,34988,34956,34963,34958,35202,35286,35289,35285,35376,35367,35372,35358,35897,35899,35932,35933,35965,36005,36221,36219,36217,36284,36290,36281,36287,36289,36568,36574,36573,36572,36567,36576,36577,36900,36875,36881,36892,36876,36897,37103,37098,37104,37108,37106,37107,37076,37099,37100,37097,37206,37208,37210,37203,37205,37356,37364,37361,37363,37368,37348,37369,37354,37355,37367,37352,37358,38266,38278,38280,38524,38509,38507,38513,38511,38591,38762,38916,39141,39319,20635,20629,20628,20638,20619,20643,20611,20620,20622,20637,20584,20636,20626,20610,20615,20831,20948,21266,21265,21412,21415,21905,21928,21925,21933,21879,22085,21922,21907,21896,21903,21941,21889,21923,21906,21924,21885,21900,21926,21887,21909,21921,21902,22284,22569,22583,22553,22558,22567,22563,22568,22517,22600,22565,22556,22555,22579,22591,22582,22574,22585,22584,22573,22572,22587,22881,23215,23188,23199,23162,23202,23198,23160,23206,23164,23205,23212,23189,23214,23095,23172,23178,23191,23171,23179,23209,23163,23165,23180,23196,23183,23187,23197,23530,23501,23499,23508,23505,23498,23502,23564,23600,23863,23875,23915,23873,23883,23871,23861,23889,23886,23893,23859,23866,23890,23869,23857,23897,23874,23865,23881,23864,23868,23858,23862,23872,23877,24132,24129,24408,24486,24485,24491,24777,24761,24780,24802,24782,24772,24852,24818,24842,24854,24837,24821,24851,24824,24828,24830,24769,24835,24856,24861,24848,24831,24836,24843,25162,25492,25521,25520,25550,25573,25576,25583,25539,25757,25587,25546,25568,25590,25557,25586,25589,25697,25567,25534,25565,25564,25540,25560,25555,25538,25543,25548,25547,25544,25584,25559,25561,25906,25959,25962,25956,25948,25960,25957,25996,26013,26014,26030,26064,26066,26236,26220,26235,26240,26225,26233,26218,26226,26369,26892,26835,26884,26844,26922,26860,26858,26865,26895,26838,26871,26859,26852,26870,26899,26896,26867,26849,26887,26828,26888,26992,26804,26897,26863,26822,26900,26872,26832,26877,26876,26856,26891,26890,26903,26830,26824,26845,26846,26854,26868,26833,26886,26836,26857,26901,26917,26823,27449,27451,27455,27452,27540,27543,27545,27541,27581,27632,27634,27635,27696,28156,28230,28231,28191,28233,28296,28220,28221,28229,28258,28203,28223,28225,28253,28275,28188,28211,28235,28224,28241,28219,28163,28206,28254,28264,28252,28257,28209,28200,28256,28273,28267,28217,28194,28208,28243,28261,28199,28280,28260,28279,28245,28281,28242,28262,28213,28214,28250,28960,28958,28975,28923,28974,28977,28963,28965,28962,28978,28959,28968,28986,28955,29259,29274,29320,29321,29318,29317,29323,29458,29451,29488,29474,29489,29491,29479,29490,29485,29478,29475,29493,29452,29742,29740,29744,29739,29718,29722,29729,29741,29745,29732,29731,29725,29737,29728,29746,29947,29999,30063,30060,30183,30170,30177,30182,30173,30175,30180,30167,30357,30354,30426,30534,30535,30532,30541,30533,30538,30542,30539,30540,30686,30700,30816,30820,30821,30812,30829,30833,30826,30830,30832,30825,30824,30814,30818,31092,31091,31090,31088,31234,31242,31235,31244,31236,31385,31462,31460,31562,31547,31556,31560,31564,31566,31552,31576,31557,31906,31902,31912,31905,32088,32111,32099,32083,32086,32103,32106,32079,32109,32092,32107,32082,32084,32105,32081,32095,32078,32574,32575,32613,32614,32674,32672,32673,32727,32849,32847,32848,33022,32980,33091,33098,33106,33103,33095,33085,33101,33082,33254,33262,33271,33272,33273,33284,33340,33341,33343,33397,33595,33743,33785,33827,33728,33768,33810,33767,33764,33788,33782,33808,33734,33736,33771,33763,33727,33793,33757,33765,33752,33791,33761,33739,33742,33750,33781,33737,33801,33807,33758,33809,33798,33730,33779,33749,33786,33735,33745,33770,33811,33731,33772,33774,33732,33787,33751,33762,33819,33755,33790,34520,34530,34534,34515,34531,34522,34538,34525,34539,34524,34540,34537,34519,34536,34513,34888,34902,34901,35002,35031,35001,35000,35008,35006,34998,35004,34999,35005,34994,35073,35017,35221,35224,35223,35293,35290,35291,35406,35405,35385,35417,35392,35415,35416,35396,35397,35410,35400,35409,35402,35404,35407,35935,35969,35968,36026,36030,36016,36025,36021,36228,36224,36233,36312,36307,36301,36295,36310,36316,36303,36309,36313,36296,36311,36293,36591,36599,36602,36601,36582,36590,36581,36597,36583,36584,36598,36587,36593,36588,36596,36585,36909,36916,36911,37126,37164,37124,37119,37116,37128,37113,37115,37121,37120,37127,37125,37123,37217,37220,37215,37218,37216,37377,37386,37413,37379,37402,37414,37391,37388,37376,37394,37375,37373,37382,37380,37415,37378,37404,37412,37401,37399,37381,37398,38267,38285,38284,38288,38535,38526,38536,38537,38531,38528,38594,38600,38595,38641,38640,38764,38768,38766,38919,39081,39147,40166,40697,20099,20100,20150,20669,20671,20678,20654,20676,20682,20660,20680,20674,20656,20673,20666,20657,20683,20681,20662,20664,20951,21114,21112,21115,21116,21955,21979,21964,21968,21963,21962,21981,21952,21972,21956,21993,21951,21970,21901,21967,21973,21986,21974,21960,22002,21965,21977,21954,22292,22611,22632,22628,22607,22605,22601,22639,22613,22606,22621,22617,22629,22619,22589,22627,22641,22780,23239,23236,23243,23226,23224,23217,23221,23216,23231,23240,23227,23238,23223,23232,23242,23220,23222,23245,23225,23184,23510,23512,23513,23583,23603,23921,23907,23882,23909,23922,23916,23902,23912,23911,23906,24048,24143,24142,24138,24141,24139,24261,24268,24262,24267,24263,24384,24495,24493,24823,24905,24906,24875,24901,24886,24882,24878,24902,24879,24911,24873,24896,25120,37224,25123,25125,25124,25541,25585,25579,25616,25618,25609,25632,25636,25651,25667,25631,25621,25624,25657,25655,25634,25635,25612,25638,25648,25640,25665,25653,25647,25610,25626,25664,25637,25639,25611,25575,25627,25646,25633,25614,25967,26002,26067,26246,26252,26261,26256,26251,26250,26265,26260,26232,26400,26982,26975,26936,26958,26978,26993,26943,26949,26986,26937,26946,26967,26969,27002,26952,26953,26933,26988,26931,26941,26981,26864,27000,26932,26985,26944,26991,26948,26998,26968,26945,26996,26956,26939,26955,26935,26972,26959,26961,26930,26962,26927,27003,26940,27462,27461,27459,27458,27464,27457,27547,64013,27643,27644,27641,27639,27640,28315,28374,28360,28303,28352,28319,28307,28308,28320,28337,28345,28358,28370,28349,28353,28318,28361,28343,28336,28365,28326,28367,28338,28350,28355,28380,28376,28313,28306,28302,28301,28324,28321,28351,28339,28368,28362,28311,28334,28323,28999,29012,29010,29027,29024,28993,29021,29026,29042,29048,29034,29025,28994,29016,28995,29003,29040,29023,29008,29011,28996,29005,29018,29263,29325,29324,29329,29328,29326,29500,29506,29499,29498,29504,29514,29513,29764,29770,29771,29778,29777,29783,29760,29775,29776,29774,29762,29766,29773,29780,29921,29951,29950,29949,29981,30073,30071,27011,30191,30223,30211,30199,30206,30204,30201,30200,30224,30203,30198,30189,30197,30205,30361,30389,30429,30549,30559,30560,30546,30550,30554,30569,30567,30548,30553,30573,30688,30855,30874,30868,30863,30852,30869,30853,30854,30881,30851,30841,30873,30848,30870,30843,31100,31106,31101,31097,31249,31256,31257,31250,31255,31253,31266,31251,31259,31248,31395,31394,31390,31467,31590,31588,31597,31604,31593,31602,31589,31603,31601,31600,31585,31608,31606,31587,31922,31924,31919,32136,32134,32128,32141,32127,32133,32122,32142,32123,32131,32124,32140,32148,32132,32125,32146,32621,32619,32615,32616,32620,32678,32677,32679,32731,32732,32801,33124,33120,33143,33116,33129,33115,33122,33138,26401,33118,33142,33127,33135,33092,33121,33309,33353,33348,33344,33346,33349,34033,33855,33878,33910,33913,33935,33933,33893,33873,33856,33926,33895,33840,33869,33917,33882,33881,33908,33907,33885,34055,33886,33847,33850,33844,33914,33859,33912,33842,33861,33833,33753,33867,33839,33858,33837,33887,33904,33849,33870,33868,33874,33903,33989,33934,33851,33863,33846,33843,33896,33918,33860,33835,33888,33876,33902,33872,34571,34564,34551,34572,34554,34518,34549,34637,34552,34574,34569,34561,34550,34573,34565,35030,35019,35021,35022,35038,35035,35034,35020,35024,35205,35227,35295,35301,35300,35297,35296,35298,35292,35302,35446,35462,35455,35425,35391,35447,35458,35460,35445,35459,35457,35444,35450,35900,35915,35914,35941,35940,35942,35974,35972,35973,36044,36200,36201,36241,36236,36238,36239,36237,36243,36244,36240,36242,36336,36320,36332,36337,36334,36304,36329,36323,36322,36327,36338,36331,36340,36614,36607,36609,36608,36613,36615,36616,36610,36619,36946,36927,36932,36937,36925,37136,37133,37135,37137,37142,37140,37131,37134,37230,37231,37448,37458,37424,37434,37478,37427,37477,37470,37507,37422,37450,37446,37485,37484,37455,37472,37479,37487,37430,37473,37488,37425,37460,37475,37456,37490,37454,37459,37452,37462,37426,38303,38300,38302,38299,38546,38547,38545,38551,38606,38650,38653,38648,38645,38771,38775,38776,38770,38927,38925,38926,39084,39158,39161,39343,39346,39344,39349,39597,39595,39771,40170,40173,40167,40576,40701,20710,20692,20695,20712,20723,20699,20714,20701,20708,20691,20716,20720,20719,20707,20704,20952,21120,21121,21225,21227,21296,21420,22055,22037,22028,22034,22012,22031,22044,22017,22035,22018,22010,22045,22020,22015,22009,22665,22652,22672,22680,22662,22657,22655,22644,22667,22650,22663,22673,22670,22646,22658,22664,22651,22676,22671,22782,22891,23260,23278,23269,23253,23274,23258,23277,23275,23283,23266,23264,23259,23276,23262,23261,23257,23272,23263,23415,23520,23523,23651,23938,23936,23933,23942,23930,23937,23927,23946,23945,23944,23934,23932,23949,23929,23935,24152,24153,24147,24280,24273,24279,24270,24284,24277,24281,24274,24276,24388,24387,24431,24502,24876,24872,24897,24926,24945,24947,24914,24915,24946,24940,24960,24948,24916,24954,24923,24933,24891,24938,24929,24918,25129,25127,25131,25643,25677,25691,25693,25716,25718,25714,25715,25725,25717,25702,25766,25678,25730,25694,25692,25675,25683,25696,25680,25727,25663,25708,25707,25689,25701,25719,25971,26016,26273,26272,26271,26373,26372,26402,27057,27062,27081,27040,27086,27030,27056,27052,27068,27025,27033,27022,27047,27021,27049,27070,27055,27071,27076,27069,27044,27092,27065,27082,27034,27087,27059,27027,27050,27041,27038,27097,27031,27024,27074,27061,27045,27078,27466,27469,27467,27550,27551,27552,27587,27588,27646,28366,28405,28401,28419,28453,28408,28471,28411,28462,28425,28494,28441,28442,28455,28440,28475,28434,28397,28426,28470,28531,28409,28398,28461,28480,28464,28476,28469,28395,28423,28430,28483,28421,28413,28406,28473,28444,28412,28474,28447,28429,28446,28424,28449,29063,29072,29065,29056,29061,29058,29071,29051,29062,29057,29079,29252,29267,29335,29333,29331,29507,29517,29521,29516,29794,29811,29809,29813,29810,29799,29806,29952,29954,29955,30077,30096,30230,30216,30220,30229,30225,30218,30228,30392,30593,30588,30597,30594,30574,30592,30575,30590,30595,30898,30890,30900,30893,30888,30846,30891,30878,30885,30880,30892,30882,30884,31128,31114,31115,31126,31125,31124,31123,31127,31112,31122,31120,31275,31306,31280,31279,31272,31270,31400,31403,31404,31470,31624,31644,31626,31633,31632,31638,31629,31628,31643,31630,31621,31640,21124,31641,31652,31618,31931,31935,31932,31930,32167,32183,32194,32163,32170,32193,32192,32197,32157,32206,32196,32198,32203,32204,32175,32185,32150,32188,32159,32166,32174,32169,32161,32201,32627,32738,32739,32741,32734,32804,32861,32860,33161,33158,33155,33159,33165,33164,33163,33301,33943,33956,33953,33951,33978,33998,33986,33964,33966,33963,33977,33972,33985,33997,33962,33946,33969,34000,33949,33959,33979,33954,33940,33991,33996,33947,33961,33967,33960,34006,33944,33974,33999,33952,34007,34004,34002,34011,33968,33937,34401,34611,34595,34600,34667,34624,34606,34590,34593,34585,34587,34627,34604,34625,34622,34630,34592,34610,34602,34605,34620,34578,34618,34609,34613,34626,34598,34599,34616,34596,34586,34608,34577,35063,35047,35057,35058,35066,35070,35054,35068,35062,35067,35056,35052,35051,35229,35233,35231,35230,35305,35307,35304,35499,35481,35467,35474,35471,35478,35901,35944,35945,36053,36047,36055,36246,36361,36354,36351,36365,36349,36362,36355,36359,36358,36357,36350,36352,36356,36624,36625,36622,36621,37155,37148,37152,37154,37151,37149,37146,37156,37153,37147,37242,37234,37241,37235,37541,37540,37494,37531,37498,37536,37524,37546,37517,37542,37530,37547,37497,37527,37503,37539,37614,37518,37506,37525,37538,37501,37512,37537,37514,37510,37516,37529,37543,37502,37511,37545,37533,37515,37421,38558,38561,38655,38744,38781,38778,38782,38787,38784,38786,38779,38788,38785,38783,38862,38861,38934,39085,39086,39170,39168,39175,39325,39324,39363,39353,39355,39354,39362,39357,39367,39601,39651,39655,39742,39743,39776,39777,39775,40177,40178,40181,40615,20735,20739,20784,20728,20742,20743,20726,20734,20747,20748,20733,20746,21131,21132,21233,21231,22088,22082,22092,22069,22081,22090,22089,22086,22104,22106,22080,22067,22077,22060,22078,22072,22058,22074,22298,22699,22685,22705,22688,22691,22703,22700,22693,22689,22783,23295,23284,23293,23287,23286,23299,23288,23298,23289,23297,23303,23301,23311,23655,23961,23959,23967,23954,23970,23955,23957,23968,23964,23969,23962,23966,24169,24157,24160,24156,32243,24283,24286,24289,24393,24498,24971,24963,24953,25009,25008,24994,24969,24987,24979,25007,25005,24991,24978,25002,24993,24973,24934,25011,25133,25710,25712,25750,25760,25733,25751,25756,25743,25739,25738,25740,25763,25759,25704,25777,25752,25974,25978,25977,25979,26034,26035,26293,26288,26281,26290,26295,26282,26287,27136,27142,27159,27109,27128,27157,27121,27108,27168,27135,27116,27106,27163,27165,27134,27175,27122,27118,27156,27127,27111,27200,27144,27110,27131,27149,27132,27115,27145,27140,27160,27173,27151,27126,27174,27143,27124,27158,27473,27557,27555,27554,27558,27649,27648,27647,27650,28481,28454,28542,28551,28614,28562,28557,28553,28556,28514,28495,28549,28506,28566,28534,28524,28546,28501,28530,28498,28496,28503,28564,28563,28509,28416,28513,28523,28541,28519,28560,28499,28555,28521,28543,28565,28515,28535,28522,28539,29106,29103,29083,29104,29088,29082,29097,29109,29085,29093,29086,29092,29089,29098,29084,29095,29107,29336,29338,29528,29522,29534,29535,29536,29533,29531,29537,29530,29529,29538,29831,29833,29834,29830,29825,29821,29829,29832,29820,29817,29960,29959,30078,30245,30238,30233,30237,30236,30243,30234,30248,30235,30364,30365,30366,30363,30605,30607,30601,30600,30925,30907,30927,30924,30929,30926,30932,30920,30915,30916,30921,31130,31137,31136,31132,31138,31131,27510,31289,31410,31412,31411,31671,31691,31678,31660,31694,31663,31673,31690,31669,31941,31944,31948,31947,32247,32219,32234,32231,32215,32225,32259,32250,32230,32246,32241,32240,32238,32223,32630,32684,32688,32685,32749,32747,32746,32748,32742,32744,32868,32871,33187,33183,33182,33173,33186,33177,33175,33302,33359,33363,33362,33360,33358,33361,34084,34107,34063,34048,34089,34062,34057,34061,34079,34058,34087,34076,34043,34091,34042,34056,34060,34036,34090,34034,34069,34039,34027,34035,34044,34066,34026,34025,34070,34046,34088,34077,34094,34050,34045,34078,34038,34097,34086,34023,34024,34032,34031,34041,34072,34080,34096,34059,34073,34095,34402,34646,34659,34660,34679,34785,34675,34648,34644,34651,34642,34657,34650,34641,34654,34669,34666,34640,34638,34655,34653,34671,34668,34682,34670,34652,34661,34639,34683,34677,34658,34663,34665,34906,35077,35084,35092,35083,35095,35096,35097,35078,35094,35089,35086,35081,35234,35236,35235,35309,35312,35308,35535,35526,35512,35539,35537,35540,35541,35515,35543,35518,35520,35525,35544,35523,35514,35517,35545,35902,35917,35983,36069,36063,36057,36072,36058,36061,36071,36256,36252,36257,36251,36384,36387,36389,36388,36398,36373,36379,36374,36369,36377,36390,36391,36372,36370,36376,36371,36380,36375,36378,36652,36644,36632,36634,36640,36643,36630,36631,36979,36976,36975,36967,36971,37167,37163,37161,37162,37170,37158,37166,37253,37254,37258,37249,37250,37252,37248,37584,37571,37572,37568,37593,37558,37583,37617,37599,37592,37609,37591,37597,37580,37615,37570,37608,37578,37576,37582,37606,37581,37589,37577,37600,37598,37607,37585,37587,37557,37601,37574,37556,38268,38316,38315,38318,38320,38564,38562,38611,38661,38664,38658,38746,38794,38798,38792,38864,38863,38942,38941,38950,38953,38952,38944,38939,38951,39090,39176,39162,39185,39188,39190,39191,39189,39388,39373,39375,39379,39380,39374,39369,39382,39384,39371,39383,39372,39603,39660,39659,39667,39666,39665,39750,39747,39783,39796,39793,39782,39798,39797,39792,39784,39780,39788,40188,40186,40189,40191,40183,40199,40192,40185,40187,40200,40197,40196,40579,40659,40719,40720,20764,20755,20759,20762,20753,20958,21300,21473,22128,22112,22126,22131,22118,22115,22125,22130,22110,22135,22300,22299,22728,22717,22729,22719,22714,22722,22716,22726,23319,23321,23323,23329,23316,23315,23312,23318,23336,23322,23328,23326,23535,23980,23985,23977,23975,23989,23984,23982,23978,23976,23986,23981,23983,23988,24167,24168,24166,24175,24297,24295,24294,24296,24293,24395,24508,24989,25000,24982,25029,25012,25030,25025,25036,25018,25023,25016,24972,25815,25814,25808,25807,25801,25789,25737,25795,25819,25843,25817,25907,25983,25980,26018,26312,26302,26304,26314,26315,26319,26301,26299,26298,26316,26403,27188,27238,27209,27239,27186,27240,27198,27229,27245,27254,27227,27217,27176,27226,27195,27199,27201,27242,27236,27216,27215,27220,27247,27241,27232,27196,27230,27222,27221,27213,27214,27206,27477,27476,27478,27559,27562,27563,27592,27591,27652,27651,27654,28589,28619,28579,28615,28604,28622,28616,28510,28612,28605,28574,28618,28584,28676,28581,28590,28602,28588,28586,28623,28607,28600,28578,28617,28587,28621,28591,28594,28592,29125,29122,29119,29112,29142,29120,29121,29131,29140,29130,29127,29135,29117,29144,29116,29126,29146,29147,29341,29342,29545,29542,29543,29548,29541,29547,29546,29823,29850,29856,29844,29842,29845,29857,29963,30080,30255,30253,30257,30269,30259,30268,30261,30258,30256,30395,30438,30618,30621,30625,30620,30619,30626,30627,30613,30617,30615,30941,30953,30949,30954,30942,30947,30939,30945,30946,30957,30943,30944,31140,31300,31304,31303,31414,31416,31413,31409,31415,31710,31715,31719,31709,31701,31717,31706,31720,31737,31700,31722,31714,31708,31723,31704,31711,31954,31956,31959,31952,31953,32274,32289,32279,32268,32287,32288,32275,32270,32284,32277,32282,32290,32267,32271,32278,32269,32276,32293,32292,32579,32635,32636,32634,32689,32751,32810,32809,32876,33201,33190,33198,33209,33205,33195,33200,33196,33204,33202,33207,33191,33266,33365,33366,33367,34134,34117,34155,34125,34131,34145,34136,34112,34118,34148,34113,34146,34116,34129,34119,34147,34110,34139,34161,34126,34158,34165,34133,34151,34144,34188,34150,34141,34132,34149,34156,34403,34405,34404,34715,34703,34711,34707,34706,34696,34689,34710,34712,34681,34695,34723,34693,34704,34705,34717,34692,34708,34716,34714,34697,35102,35110,35120,35117,35118,35111,35121,35106,35113,35107,35119,35116,35103,35313,35552,35554,35570,35572,35573,35549,35604,35556,35551,35568,35528,35550,35553,35560,35583,35567,35579,35985,35986,35984,36085,36078,36081,36080,36083,36204,36206,36261,36263,36403,36414,36408,36416,36421,36406,36412,36413,36417,36400,36415,36541,36662,36654,36661,36658,36665,36663,36660,36982,36985,36987,36998,37114,37171,37173,37174,37267,37264,37265,37261,37263,37671,37662,37640,37663,37638,37647,37754,37688,37692,37659,37667,37650,37633,37702,37677,37646,37645,37579,37661,37626,37669,37651,37625,37623,37684,37634,37668,37631,37673,37689,37685,37674,37652,37644,37643,37630,37641,37632,37627,37654,38332,38349,38334,38329,38330,38326,38335,38325,38333,38569,38612,38667,38674,38672,38809,38807,38804,38896,38904,38965,38959,38962,39204,39199,39207,39209,39326,39406,39404,39397,39396,39408,39395,39402,39401,39399,39609,39615,39604,39611,39670,39674,39673,39671,39731,39808,39813,39815,39804,39806,39803,39810,39827,39826,39824,39802,39829,39805,39816,40229,40215,40224,40222,40212,40233,40221,40216,40226,40208,40217,40223,40584,40582,40583,40622,40621,40661,40662,40698,40722,40765,20774,20773,20770,20772,20768,20777,21236,22163,22156,22157,22150,22148,22147,22142,22146,22143,22145,22742,22740,22735,22738,23341,23333,23346,23331,23340,23335,23334,23343,23342,23419,23537,23538,23991,24172,24170,24510,24507,25027,25013,25020,25063,25056,25061,25060,25064,25054,25839,25833,25827,25835,25828,25832,25985,25984,26038,26074,26322,27277,27286,27265,27301,27273,27295,27291,27297,27294,27271,27283,27278,27285,27267,27304,27300,27281,27263,27302,27290,27269,27276,27282,27483,27565,27657,28620,28585,28660,28628,28643,28636,28653,28647,28646,28638,28658,28637,28642,28648,29153,29169,29160,29170,29156,29168,29154,29555,29550,29551,29847,29874,29867,29840,29866,29869,29873,29861,29871,29968,29969,29970,29967,30084,30275,30280,30281,30279,30372,30441,30645,30635,30642,30647,30646,30644,30641,30632,30704,30963,30973,30978,30971,30972,30962,30981,30969,30974,30980,31147,31144,31324,31323,31318,31320,31316,31322,31422,31424,31425,31749,31759,31730,31744,31743,31739,31758,31732,31755,31731,31746,31753,31747,31745,31736,31741,31750,31728,31729,31760,31754,31976,32301,32316,32322,32307,38984,32312,32298,32329,32320,32327,32297,32332,32304,32315,32310,32324,32314,32581,32639,32638,32637,32756,32754,32812,33211,33220,33228,33226,33221,33223,33212,33257,33371,33370,33372,34179,34176,34191,34215,34197,34208,34187,34211,34171,34212,34202,34206,34167,34172,34185,34209,34170,34168,34135,34190,34198,34182,34189,34201,34205,34177,34210,34178,34184,34181,34169,34166,34200,34192,34207,34408,34750,34730,34733,34757,34736,34732,34745,34741,34748,34734,34761,34755,34754,34764,34743,34735,34756,34762,34740,34742,34751,34744,34749,34782,34738,35125,35123,35132,35134,35137,35154,35127,35138,35245,35247,35246,35314,35315,35614,35608,35606,35601,35589,35595,35618,35599,35602,35605,35591,35597,35592,35590,35612,35603,35610,35919,35952,35954,35953,35951,35989,35988,36089,36207,36430,36429,36435,36432,36428,36423,36675,36672,36997,36990,37176,37274,37282,37275,37273,37279,37281,37277,37280,37793,37763,37807,37732,37718,37703,37756,37720,37724,37750,37705,37712,37713,37728,37741,37775,37708,37738,37753,37719,37717,37714,37711,37745,37751,37755,37729,37726,37731,37735,37760,37710,37721,38343,38336,38345,38339,38341,38327,38574,38576,38572,38688,38687,38680,38685,38681,38810,38817,38812,38814,38813,38869,38868,38897,38977,38980,38986,38985,38981,38979,39205,39211,39212,39210,39219,39218,39215,39213,39217,39216,39320,39331,39329,39426,39418,39412,39415,39417,39416,39414,39419,39421,39422,39420,39427,39614,39678,39677,39681,39676,39752,39834,39848,39838,39835,39846,39841,39845,39844,39814,39842,39840,39855,40243,40257,40295,40246,40238,40239,40241,40248,40240,40261,40258,40259,40254,40247,40256,40253,32757,40237,40586,40585,40589,40624,40648,40666,40699,40703,40740,40739,40738,40788,40864,20785,20781,20782,22168,22172,22167,22170,22173,22169,22896,23356,23657,23658,24000,24173,24174,25048,25055,25069,25070,25073,25066,25072,25067,25046,25065,25855,25860,25853,25848,25857,25859,25852,26004,26075,26330,26331,26328,27333,27321,27325,27361,27334,27322,27318,27319,27335,27316,27309,27486,27593,27659,28679,28684,28685,28673,28677,28692,28686,28671,28672,28667,28710,28668,28663,28682,29185,29183,29177,29187,29181,29558,29880,29888,29877,29889,29886,29878,29883,29890,29972,29971,30300,30308,30297,30288,30291,30295,30298,30374,30397,30444,30658,30650,30975,30988,30995,30996,30985,30992,30994,30993,31149,31148,31327,31772,31785,31769,31776,31775,31789,31773,31782,31784,31778,31781,31792,32348,32336,32342,32355,32344,32354,32351,32337,32352,32343,32339,32693,32691,32759,32760,32885,33233,33234,33232,33375,33374,34228,34246,34240,34243,34242,34227,34229,34237,34247,34244,34239,34251,34254,34248,34245,34225,34230,34258,34340,34232,34231,34238,34409,34791,34790,34786,34779,34795,34794,34789,34783,34803,34788,34772,34780,34771,34797,34776,34787,34724,34775,34777,34817,34804,34792,34781,35155,35147,35151,35148,35142,35152,35153,35145,35626,35623,35619,35635,35632,35637,35655,35631,35644,35646,35633,35621,35639,35622,35638,35630,35620,35643,35645,35642,35906,35957,35993,35992,35991,36094,36100,36098,36096,36444,36450,36448,36439,36438,36446,36453,36455,36443,36442,36449,36445,36457,36436,36678,36679,36680,36683,37160,37178,37179,37182,37288,37285,37287,37295,37290,37813,37772,37778,37815,37787,37789,37769,37799,37774,37802,37790,37798,37781,37768,37785,37791,37773,37809,37777,37810,37796,37800,37812,37795,37797,38354,38355,38353,38579,38615,38618,24002,38623,38616,38621,38691,38690,38693,38828,38830,38824,38827,38820,38826,38818,38821,38871,38873,38870,38872,38906,38992,38993,38994,39096,39233,39228,39226,39439,39435,39433,39437,39428,39441,39434,39429,39431,39430,39616,39644,39688,39684,39685,39721,39733,39754,39756,39755,39879,39878,39875,39871,39873,39861,39864,39891,39862,39876,39865,39869,40284,40275,40271,40266,40283,40267,40281,40278,40268,40279,40274,40276,40287,40280,40282,40590,40588,40671,40705,40704,40726,40741,40747,40746,40745,40744,40780,40789,20788,20789,21142,21239,21428,22187,22189,22182,22183,22186,22188,22746,22749,22747,22802,23357,23358,23359,24003,24176,24511,25083,25863,25872,25869,25865,25868,25870,25988,26078,26077,26334,27367,27360,27340,27345,27353,27339,27359,27356,27344,27371,27343,27341,27358,27488,27568,27660,28697,28711,28704,28694,28715,28705,28706,28707,28713,28695,28708,28700,28714,29196,29194,29191,29186,29189,29349,29350,29348,29347,29345,29899,29893,29879,29891,29974,30304,30665,30666,30660,30705,31005,31003,31009,31004,30999,31006,31152,31335,31336,31795,31804,31801,31788,31803,31980,31978,32374,32373,32376,32368,32375,32367,32378,32370,32372,32360,32587,32586,32643,32646,32695,32765,32766,32888,33239,33237,33380,33377,33379,34283,34289,34285,34265,34273,34280,34266,34263,34284,34290,34296,34264,34271,34275,34268,34257,34288,34278,34287,34270,34274,34816,34810,34819,34806,34807,34825,34828,34827,34822,34812,34824,34815,34826,34818,35170,35162,35163,35159,35169,35164,35160,35165,35161,35208,35255,35254,35318,35664,35656,35658,35648,35667,35670,35668,35659,35669,35665,35650,35666,35671,35907,35959,35958,35994,36102,36103,36105,36268,36266,36269,36267,36461,36472,36467,36458,36463,36475,36546,36690,36689,36687,36688,36691,36788,37184,37183,37296,37293,37854,37831,37839,37826,37850,37840,37881,37868,37836,37849,37801,37862,37834,37844,37870,37859,37845,37828,37838,37824,37842,37863,38269,38362,38363,38625,38697,38699,38700,38696,38694,38835,38839,38838,38877,38878,38879,39004,39001,39005,38999,39103,39101,39099,39102,39240,39239,39235,39334,39335,39450,39445,39461,39453,39460,39451,39458,39456,39463,39459,39454,39452,39444,39618,39691,39690,39694,39692,39735,39914,39915,39904,39902,39908,39910,39906,39920,39892,39895,39916,39900,39897,39909,39893,39905,39898,40311,40321,40330,40324,40328,40305,40320,40312,40326,40331,40332,40317,40299,40308,40309,40304,40297,40325,40307,40315,40322,40303,40313,40319,40327,40296,40596,40593,40640,40700,40749,40768,40769,40781,40790,40791,40792,21303,22194,22197,22195,22755,23365,24006,24007,24302,24303,24512,24513,25081,25879,25878,25877,25875,26079,26344,26339,26340,27379,27376,27370,27368,27385,27377,27374,27375,28732,28725,28719,28727,28724,28721,28738,28728,28735,28730,28729,28736,28731,28723,28737,29203,29204,29352,29565,29564,29882,30379,30378,30398,30445,30668,30670,30671,30669,30706,31013,31011,31015,31016,31012,31017,31154,31342,31340,31341,31479,31817,31816,31818,31815,31813,31982,32379,32382,32385,32384,32698,32767,32889,33243,33241,33291,33384,33385,34338,34303,34305,34302,34331,34304,34294,34308,34313,34309,34316,34301,34841,34832,34833,34839,34835,34838,35171,35174,35257,35319,35680,35690,35677,35688,35683,35685,35687,35693,36270,36486,36488,36484,36697,36694,36695,36693,36696,36698,37005,37187,37185,37303,37301,37298,37299,37899,37907,37883,37920,37903,37908,37886,37909,37904,37928,37913,37901,37877,37888,37879,37895,37902,37910,37906,37882,37897,37880,37898,37887,37884,37900,37878,37905,37894,38366,38368,38367,38702,38703,38841,38843,38909,38910,39008,39010,39011,39007,39105,39106,39248,39246,39257,39244,39243,39251,39474,39476,39473,39468,39466,39478,39465,39470,39480,39469,39623,39626,39622,39696,39698,39697,39947,39944,39927,39941,39954,39928,40000,39943,39950,39942,39959,39956,39945,40351,40345,40356,40349,40338,40344,40336,40347,40352,40340,40348,40362,40343,40353,40346,40354,40360,40350,40355,40383,40361,40342,40358,40359,40601,40603,40602,40677,40676,40679,40678,40752,40750,40795,40800,40798,40797,40793,40849,20794,20793,21144,21143,22211,22205,22206,23368,23367,24011,24015,24305,25085,25883,27394,27388,27395,27384,27392,28739,28740,28746,28744,28745,28741,28742,29213,29210,29209,29566,29975,30314,30672,31021,31025,31023,31828,31827,31986,32394,32391,32392,32395,32390,32397,32589,32699,32816,33245,34328,34346,34342,34335,34339,34332,34329,34343,34350,34337,34336,34345,34334,34341,34857,34845,34843,34848,34852,34844,34859,34890,35181,35177,35182,35179,35322,35705,35704,35653,35706,35707,36112,36116,36271,36494,36492,36702,36699,36701,37190,37188,37189,37305,37951,37947,37942,37929,37949,37948,37936,37945,37930,37943,37932,37952,37937,38373,38372,38371,38709,38714,38847,38881,39012,39113,39110,39104,39256,39254,39481,39485,39494,39492,39490,39489,39482,39487,39629,39701,39703,39704,39702,39738,39762,39979,39965,39964,39980,39971,39976,39977,39972,39969,40375,40374,40380,40385,40391,40394,40399,40382,40389,40387,40379,40373,40398,40377,40378,40364,40392,40369,40365,40396,40371,40397,40370,40570,40604,40683,40686,40685,40731,40728,40730,40753,40782,40805,40804,40850,20153,22214,22213,22219,22897,23371,23372,24021,24017,24306,25889,25888,25894,25890,27403,27400,27401,27661,28757,28758,28759,28754,29214,29215,29353,29567,29912,29909,29913,29911,30317,30381,31029,31156,31344,31345,31831,31836,31833,31835,31834,31988,31985,32401,32591,32647,33246,33387,34356,34357,34355,34348,34354,34358,34860,34856,34854,34858,34853,35185,35263,35262,35323,35710,35716,35714,35718,35717,35711,36117,36501,36500,36506,36498,36496,36502,36503,36704,36706,37191,37964,37968,37962,37963,37967,37959,37957,37960,37961,37958,38719,38883,39018,39017,39115,39252,39259,39502,39507,39508,39500,39503,39496,39498,39497,39506,39504,39632,39705,39723,39739,39766,39765,40006,40008,39999,40004,39993,39987,40001,39996,39991,39988,39986,39997,39990,40411,40402,40414,40410,40395,40400,40412,40401,40415,40425,40409,40408,40406,40437,40405,40413,40630,40688,40757,40755,40754,40770,40811,40853,40866,20797,21145,22760,22759,22898,23373,24024,34863,24399,25089,25091,25092,25897,25893,26006,26347,27409,27410,27407,27594,28763,28762,29218,29570,29569,29571,30320,30676,31847,31846,32405,33388,34362,34368,34361,34364,34353,34363,34366,34864,34866,34862,34867,35190,35188,35187,35326,35724,35726,35723,35720,35909,36121,36504,36708,36707,37308,37986,37973,37981,37975,37982,38852,38853,38912,39510,39513,39710,39711,39712,40018,40024,40016,40010,40013,40011,40021,40025,40012,40014,40443,40439,40431,40419,40427,40440,40420,40438,40417,40430,40422,40434,40432,40418,40428,40436,40435,40424,40429,40642,40656,40690,40691,40710,40732,40760,40759,40758,40771,40783,40817,40816,40814,40815,22227,22221,23374,23661,25901,26349,26350,27411,28767,28769,28765,28768,29219,29915,29925,30677,31032,31159,31158,31850,32407,32649,33389,34371,34872,34871,34869,34891,35732,35733,36510,36511,36512,36509,37310,37309,37314,37995,37992,37993,38629,38726,38723,38727,38855,38885,39518,39637,39769,40035,40039,40038,40034,40030,40032,40450,40446,40455,40451,40454,40453,40448,40449,40457,40447,40445,40452,40608,40734,40774,40820,40821,40822,22228,25902,26040,27416,27417,27415,27418,28770,29222,29354,30680,30681,31033,31849,31851,31990,32410,32408,32411,32409,33248,33249,34374,34375,34376,35193,35194,35196,35195,35327,35736,35737,36517,36516,36515,37998,37997,37999,38001,38003,38729,39026,39263,40040,40046,40045,40459,40461,40464,40463,40466,40465,40609,40693,40713,40775,40824,40827,40826,40825,22302,28774,31855,34876,36274,36518,37315,38004,38008,38006,38005,39520,40052,40051,40049,40053,40468,40467,40694,40714,40868,28776,28773,31991,34410,34878,34877,34879,35742,35996,36521,36553,38731,39027,39028,39116,39265,39339,39524,39526,39527,39716,40469,40471,40776,25095,27422,29223,34380,36520,38018,38016,38017,39529,39528,39726,40473,29225,34379,35743,38019,40057,40631,30325,39531,40058,40477,28777,28778,40612,40830,40777,40856,30849,37561,35023,22715,24658,31911,23290,9556,9574,9559,9568,9580,9571,9562,9577,9565,9554,9572,9557,9566,9578,9569,9560,9575,9563,9555,9573,9558,9567,9579,9570,9561,9576,9564,9553,9552,9581,9582,9584,9583,65517,132423,37595,132575,147397,34124,17077,29679,20917,13897,149826,166372,37700,137691,33518,146632,30780,26436,25311,149811,166314,131744,158643,135941,20395,140525,20488,159017,162436,144896,150193,140563,20521,131966,24484,131968,131911,28379,132127,20605,20737,13434,20750,39020,14147,33814,149924,132231,20832,144308,20842,134143,139516,131813,140592,132494,143923,137603,23426,34685,132531,146585,20914,20920,40244,20937,20943,20945,15580,20947,150182,20915,20962,21314,20973,33741,26942,145197,24443,21003,21030,21052,21173,21079,21140,21177,21189,31765,34114,21216,34317,158483,21253,166622,21833,28377,147328,133460,147436,21299,21316,134114,27851,136998,26651,29653,24650,16042,14540,136936,29149,17570,21357,21364,165547,21374,21375,136598,136723,30694,21395,166555,21408,21419,21422,29607,153458,16217,29596,21441,21445,27721,20041,22526,21465,15019,134031,21472,147435,142755,21494,134263,21523,28793,21803,26199,27995,21613,158547,134516,21853,21647,21668,18342,136973,134877,15796,134477,166332,140952,21831,19693,21551,29719,21894,21929,22021,137431,147514,17746,148533,26291,135348,22071,26317,144010,26276,26285,22093,22095,30961,22257,38791,21502,22272,22255,22253,166758,13859,135759,22342,147877,27758,28811,22338,14001,158846,22502,136214,22531,136276,148323,22566,150517,22620,22698,13665,22752,22748,135740,22779,23551,22339,172368,148088,37843,13729,22815,26790,14019,28249,136766,23076,21843,136850,34053,22985,134478,158849,159018,137180,23001,137211,137138,159142,28017,137256,136917,23033,159301,23211,23139,14054,149929,23159,14088,23190,29797,23251,159649,140628,15749,137489,14130,136888,24195,21200,23414,25992,23420,162318,16388,18525,131588,23509,24928,137780,154060,132517,23539,23453,19728,23557,138052,23571,29646,23572,138405,158504,23625,18653,23685,23785,23791,23947,138745,138807,23824,23832,23878,138916,23738,24023,33532,14381,149761,139337,139635,33415,14390,15298,24110,27274,24181,24186,148668,134355,21414,20151,24272,21416,137073,24073,24308,164994,24313,24315,14496,24316,26686,37915,24333,131521,194708,15070,18606,135994,24378,157832,140240,24408,140401,24419,38845,159342,24434,37696,166454,24487,23990,15711,152144,139114,159992,140904,37334,131742,166441,24625,26245,137335,14691,15815,13881,22416,141236,31089,15936,24734,24740,24755,149890,149903,162387,29860,20705,23200,24932,33828,24898,194726,159442,24961,20980,132694,24967,23466,147383,141407,25043,166813,170333,25040,14642,141696,141505,24611,24924,25886,25483,131352,25285,137072,25301,142861,25452,149983,14871,25656,25592,136078,137212,25744,28554,142902,38932,147596,153373,25825,25829,38011,14950,25658,14935,25933,28438,150056,150051,25989,25965,25951,143486,26037,149824,19255,26065,16600,137257,26080,26083,24543,144384,26136,143863,143864,26180,143780,143781,26187,134773,26215,152038,26227,26228,138813,143921,165364,143816,152339,30661,141559,39332,26370,148380,150049,15147,27130,145346,26462,26471,26466,147917,168173,26583,17641,26658,28240,37436,26625,144358,159136,26717,144495,27105,27147,166623,26995,26819,144845,26881,26880,15666,14849,144956,15232,26540,26977,166474,17148,26934,27032,15265,132041,33635,20624,27129,144985,139562,27205,145155,27293,15347,26545,27336,168348,15373,27421,133411,24798,27445,27508,141261,28341,146139,132021,137560,14144,21537,146266,27617,147196,27612,27703,140427,149745,158545,27738,33318,27769,146876,17605,146877,147876,149772,149760,146633,14053,15595,134450,39811,143865,140433,32655,26679,159013,159137,159211,28054,27996,28284,28420,149887,147589,159346,34099,159604,20935,27804,28189,33838,166689,28207,146991,29779,147330,31180,28239,23185,143435,28664,14093,28573,146992,28410,136343,147517,17749,37872,28484,28508,15694,28532,168304,15675,28575,147780,28627,147601,147797,147513,147440,147380,147775,20959,147798,147799,147776,156125,28747,28798,28839,28801,28876,28885,28886,28895,16644,15848,29108,29078,148087,28971,28997,23176,29002,29038,23708,148325,29007,37730,148161,28972,148570,150055,150050,29114,166888,28861,29198,37954,29205,22801,37955,29220,37697,153093,29230,29248,149876,26813,29269,29271,15957,143428,26637,28477,29314,29482,29483,149539,165931,18669,165892,29480,29486,29647,29610,134202,158254,29641,29769,147938,136935,150052,26147,14021,149943,149901,150011,29687,29717,26883,150054,29753,132547,16087,29788,141485,29792,167602,29767,29668,29814,33721,29804,14128,29812,37873,27180,29826,18771,150156,147807,150137,166799,23366,166915,137374,29896,137608,29966,29929,29982,167641,137803,23511,167596,37765,30029,30026,30055,30062,151426,16132,150803,30094,29789,30110,30132,30210,30252,30289,30287,30319,30326,156661,30352,33263,14328,157969,157966,30369,30373,30391,30412,159647,33890,151709,151933,138780,30494,30502,30528,25775,152096,30552,144044,30639,166244,166248,136897,30708,30729,136054,150034,26826,30895,30919,30931,38565,31022,153056,30935,31028,30897,161292,36792,34948,166699,155779,140828,31110,35072,26882,31104,153687,31133,162617,31036,31145,28202,160038,16040,31174,168205,31188], "euc-kr":[44034,44035,44037,44038,44043,44044,44045,44046,44047,44056,44062,44063,44065,44066,44067,44069,44070,44071,44072,44073,44074,44075,44078,44082,44083,44084,null,null,null,null,null,null,44085,44086,44087,44090,44091,44093,44094,44095,44097,44098,44099,44100,44101,44102,44103,44104,44105,44106,44108,44110,44111,44112,44113,44114,44115,44117,null,null,null,null,null,null,44118,44119,44121,44122,44123,44125,44126,44127,44128,44129,44130,44131,44132,44133,44134,44135,44136,44137,44138,44139,44140,44141,44142,44143,44146,44147,44149,44150,44153,44155,44156,44157,44158,44159,44162,44167,44168,44173,44174,44175,44177,44178,44179,44181,44182,44183,44184,44185,44186,44187,44190,44194,44195,44196,44197,44198,44199,44203,44205,44206,44209,44210,44211,44212,44213,44214,44215,44218,44222,44223,44224,44226,44227,44229,44230,44231,44233,44234,44235,44237,44238,44239,44240,44241,44242,44243,44244,44246,44248,44249,44250,44251,44252,44253,44254,44255,44258,44259,44261,44262,44265,44267,44269,44270,44274,44276,44279,44280,44281,44282,44283,44286,44287,44289,44290,44291,44293,44295,44296,44297,44298,44299,44302,44304,44306,44307,44308,44309,44310,44311,44313,44314,44315,44317,44318,44319,44321,44322,44323,44324,44325,44326,44327,44328,44330,44331,44334,44335,44336,44337,44338,44339,null,null,null,null,null,null,44342,44343,44345,44346,44347,44349,44350,44351,44352,44353,44354,44355,44358,44360,44362,44363,44364,44365,44366,44367,44369,44370,44371,44373,44374,44375,null,null,null,null,null,null,44377,44378,44379,44380,44381,44382,44383,44384,44386,44388,44389,44390,44391,44392,44393,44394,44395,44398,44399,44401,44402,44407,44408,44409,44410,44414,44416,44419,44420,44421,44422,44423,44426,44427,44429,44430,44431,44433,44434,44435,44436,44437,44438,44439,44440,44441,44442,44443,44446,44447,44448,44449,44450,44451,44453,44454,44455,44456,44457,44458,44459,44460,44461,44462,44463,44464,44465,44466,44467,44468,44469,44470,44472,44473,44474,44475,44476,44477,44478,44479,44482,44483,44485,44486,44487,44489,44490,44491,44492,44493,44494,44495,44498,44500,44501,44502,44503,44504,44505,44506,44507,44509,44510,44511,44513,44514,44515,44517,44518,44519,44520,44521,44522,44523,44524,44525,44526,44527,44528,44529,44530,44531,44532,44533,44534,44535,44538,44539,44541,44542,44546,44547,44548,44549,44550,44551,44554,44556,44558,44559,44560,44561,44562,44563,44565,44566,44567,44568,44569,44570,44571,44572,null,null,null,null,null,null,44573,44574,44575,44576,44577,44578,44579,44580,44581,44582,44583,44584,44585,44586,44587,44588,44589,44590,44591,44594,44595,44597,44598,44601,44603,44604,null,null,null,null,null,null,44605,44606,44607,44610,44612,44615,44616,44617,44619,44623,44625,44626,44627,44629,44631,44632,44633,44634,44635,44638,44642,44643,44644,44646,44647,44650,44651,44653,44654,44655,44657,44658,44659,44660,44661,44662,44663,44666,44670,44671,44672,44673,44674,44675,44678,44679,44680,44681,44682,44683,44685,44686,44687,44688,44689,44690,44691,44692,44693,44694,44695,44696,44697,44698,44699,44700,44701,44702,44703,44704,44705,44706,44707,44708,44709,44710,44711,44712,44713,44714,44715,44716,44717,44718,44719,44720,44721,44722,44723,44724,44725,44726,44727,44728,44729,44730,44731,44735,44737,44738,44739,44741,44742,44743,44744,44745,44746,44747,44750,44754,44755,44756,44757,44758,44759,44762,44763,44765,44766,44767,44768,44769,44770,44771,44772,44773,44774,44775,44777,44778,44780,44782,44783,44784,44785,44786,44787,44789,44790,44791,44793,44794,44795,44797,44798,44799,44800,44801,44802,44803,44804,44805,null,null,null,null,null,null,44806,44809,44810,44811,44812,44814,44815,44817,44818,44819,44820,44821,44822,44823,44824,44825,44826,44827,44828,44829,44830,44831,44832,44833,44834,44835,null,null,null,null,null,null,44836,44837,44838,44839,44840,44841,44842,44843,44846,44847,44849,44851,44853,44854,44855,44856,44857,44858,44859,44862,44864,44868,44869,44870,44871,44874,44875,44876,44877,44878,44879,44881,44882,44883,44884,44885,44886,44887,44888,44889,44890,44891,44894,44895,44896,44897,44898,44899,44902,44903,44904,44905,44906,44907,44908,44909,44910,44911,44912,44913,44914,44915,44916,44917,44918,44919,44920,44922,44923,44924,44925,44926,44927,44929,44930,44931,44933,44934,44935,44937,44938,44939,44940,44941,44942,44943,44946,44947,44948,44950,44951,44952,44953,44954,44955,44957,44958,44959,44960,44961,44962,44963,44964,44965,44966,44967,44968,44969,44970,44971,44972,44973,44974,44975,44976,44977,44978,44979,44980,44981,44982,44983,44986,44987,44989,44990,44991,44993,44994,44995,44996,44997,44998,45002,45004,45007,45008,45009,45010,45011,45013,45014,45015,45016,45017,45018,45019,45021,45022,45023,45024,45025,null,null,null,null,null,null,45026,45027,45028,45029,45030,45031,45034,45035,45036,45037,45038,45039,45042,45043,45045,45046,45047,45049,45050,45051,45052,45053,45054,45055,45058,45059,null,null,null,null,null,null,45061,45062,45063,45064,45065,45066,45067,45069,45070,45071,45073,45074,45075,45077,45078,45079,45080,45081,45082,45083,45086,45087,45088,45089,45090,45091,45092,45093,45094,45095,45097,45098,45099,45100,45101,45102,45103,45104,45105,45106,45107,45108,45109,45110,45111,45112,45113,45114,45115,45116,45117,45118,45119,45120,45121,45122,45123,45126,45127,45129,45131,45133,45135,45136,45137,45138,45142,45144,45146,45147,45148,45150,45151,45152,45153,45154,45155,45156,45157,45158,45159,45160,45161,45162,45163,45164,45165,45166,45167,45168,45169,45170,45171,45172,45173,45174,45175,45176,45177,45178,45179,45182,45183,45185,45186,45187,45189,45190,45191,45192,45193,45194,45195,45198,45200,45202,45203,45204,45205,45206,45207,45211,45213,45214,45219,45220,45221,45222,45223,45226,45232,45234,45238,45239,45241,45242,45243,45245,45246,45247,45248,45249,45250,45251,45254,45258,45259,45260,45261,45262,45263,45266,null,null,null,null,null,null,45267,45269,45270,45271,45273,45274,45275,45276,45277,45278,45279,45281,45282,45283,45284,45286,45287,45288,45289,45290,45291,45292,45293,45294,45295,45296,null,null,null,null,null,null,45297,45298,45299,45300,45301,45302,45303,45304,45305,45306,45307,45308,45309,45310,45311,45312,45313,45314,45315,45316,45317,45318,45319,45322,45325,45326,45327,45329,45332,45333,45334,45335,45338,45342,45343,45344,45345,45346,45350,45351,45353,45354,45355,45357,45358,45359,45360,45361,45362,45363,45366,45370,45371,45372,45373,45374,45375,45378,45379,45381,45382,45383,45385,45386,45387,45388,45389,45390,45391,45394,45395,45398,45399,45401,45402,45403,45405,45406,45407,45409,45410,45411,45412,45413,45414,45415,45416,45417,45418,45419,45420,45421,45422,45423,45424,45425,45426,45427,45428,45429,45430,45431,45434,45435,45437,45438,45439,45441,45443,45444,45445,45446,45447,45450,45452,45454,45455,45456,45457,45461,45462,45463,45465,45466,45467,45469,45470,45471,45472,45473,45474,45475,45476,45477,45478,45479,45481,45482,45483,45484,45485,45486,45487,45488,45489,45490,45491,45492,45493,45494,45495,45496,null,null,null,null,null,null,45497,45498,45499,45500,45501,45502,45503,45504,45505,45506,45507,45508,45509,45510,45511,45512,45513,45514,45515,45517,45518,45519,45521,45522,45523,45525,null,null,null,null,null,null,45526,45527,45528,45529,45530,45531,45534,45536,45537,45538,45539,45540,45541,45542,45543,45546,45547,45549,45550,45551,45553,45554,45555,45556,45557,45558,45559,45560,45562,45564,45566,45567,45568,45569,45570,45571,45574,45575,45577,45578,45581,45582,45583,45584,45585,45586,45587,45590,45592,45594,45595,45596,45597,45598,45599,45601,45602,45603,45604,45605,45606,45607,45608,45609,45610,45611,45612,45613,45614,45615,45616,45617,45618,45619,45621,45622,45623,45624,45625,45626,45627,45629,45630,45631,45632,45633,45634,45635,45636,45637,45638,45639,45640,45641,45642,45643,45644,45645,45646,45647,45648,45649,45650,45651,45652,45653,45654,45655,45657,45658,45659,45661,45662,45663,45665,45666,45667,45668,45669,45670,45671,45674,45675,45676,45677,45678,45679,45680,45681,45682,45683,45686,45687,45688,45689,45690,45691,45693,45694,45695,45696,45697,45698,45699,45702,45703,45704,45706,45707,45708,45709,45710,null,null,null,null,null,null,45711,45714,45715,45717,45718,45719,45723,45724,45725,45726,45727,45730,45732,45735,45736,45737,45739,45741,45742,45743,45745,45746,45747,45749,45750,45751,null,null,null,null,null,null,45752,45753,45754,45755,45756,45757,45758,45759,45760,45761,45762,45763,45764,45765,45766,45767,45770,45771,45773,45774,45775,45777,45779,45780,45781,45782,45783,45786,45788,45790,45791,45792,45793,45795,45799,45801,45802,45808,45809,45810,45814,45820,45821,45822,45826,45827,45829,45830,45831,45833,45834,45835,45836,45837,45838,45839,45842,45846,45847,45848,45849,45850,45851,45853,45854,45855,45856,45857,45858,45859,45860,45861,45862,45863,45864,45865,45866,45867,45868,45869,45870,45871,45872,45873,45874,45875,45876,45877,45878,45879,45880,45881,45882,45883,45884,45885,45886,45887,45888,45889,45890,45891,45892,45893,45894,45895,45896,45897,45898,45899,45900,45901,45902,45903,45904,45905,45906,45907,45911,45913,45914,45917,45920,45921,45922,45923,45926,45928,45930,45932,45933,45935,45938,45939,45941,45942,45943,45945,45946,45947,45948,45949,45950,45951,45954,45958,45959,45960,45961,45962,45963,45965,null,null,null,null,null,null,45966,45967,45969,45970,45971,45973,45974,45975,45976,45977,45978,45979,45980,45981,45982,45983,45986,45987,45988,45989,45990,45991,45993,45994,45995,45997,null,null,null,null,null,null,45998,45999,46000,46001,46002,46003,46004,46005,46006,46007,46008,46009,46010,46011,46012,46013,46014,46015,46016,46017,46018,46019,46022,46023,46025,46026,46029,46031,46033,46034,46035,46038,46040,46042,46044,46046,46047,46049,46050,46051,46053,46054,46055,46057,46058,46059,46060,46061,46062,46063,46064,46065,46066,46067,46068,46069,46070,46071,46072,46073,46074,46075,46077,46078,46079,46080,46081,46082,46083,46084,46085,46086,46087,46088,46089,46090,46091,46092,46093,46094,46095,46097,46098,46099,46100,46101,46102,46103,46105,46106,46107,46109,46110,46111,46113,46114,46115,46116,46117,46118,46119,46122,46124,46125,46126,46127,46128,46129,46130,46131,46133,46134,46135,46136,46137,46138,46139,46140,46141,46142,46143,46144,46145,46146,46147,46148,46149,46150,46151,46152,46153,46154,46155,46156,46157,46158,46159,46162,46163,46165,46166,46167,46169,46170,46171,46172,46173,46174,46175,46178,46180,46182,null,null,null,null,null,null,46183,46184,46185,46186,46187,46189,46190,46191,46192,46193,46194,46195,46196,46197,46198,46199,46200,46201,46202,46203,46204,46205,46206,46207,46209,46210,null,null,null,null,null,null,46211,46212,46213,46214,46215,46217,46218,46219,46220,46221,46222,46223,46224,46225,46226,46227,46228,46229,46230,46231,46232,46233,46234,46235,46236,46238,46239,46240,46241,46242,46243,46245,46246,46247,46249,46250,46251,46253,46254,46255,46256,46257,46258,46259,46260,46262,46264,46266,46267,46268,46269,46270,46271,46273,46274,46275,46277,46278,46279,46281,46282,46283,46284,46285,46286,46287,46289,46290,46291,46292,46294,46295,46296,46297,46298,46299,46302,46303,46305,46306,46309,46311,46312,46313,46314,46315,46318,46320,46322,46323,46324,46325,46326,46327,46329,46330,46331,46332,46333,46334,46335,46336,46337,46338,46339,46340,46341,46342,46343,46344,46345,46346,46347,46348,46349,46350,46351,46352,46353,46354,46355,46358,46359,46361,46362,46365,46366,46367,46368,46369,46370,46371,46374,46379,46380,46381,46382,46383,46386,46387,46389,46390,46391,46393,46394,46395,46396,46397,46398,46399,46402,46406,null,null,null,null,null,null,46407,46408,46409,46410,46414,46415,46417,46418,46419,46421,46422,46423,46424,46425,46426,46427,46430,46434,46435,46436,46437,46438,46439,46440,46441,46442,null,null,null,null,null,null,46443,46444,46445,46446,46447,46448,46449,46450,46451,46452,46453,46454,46455,46456,46457,46458,46459,46460,46461,46462,46463,46464,46465,46466,46467,46468,46469,46470,46471,46472,46473,46474,46475,46476,46477,46478,46479,46480,46481,46482,46483,46484,46485,46486,46487,46488,46489,46490,46491,46492,46493,46494,46495,46498,46499,46501,46502,46503,46505,46508,46509,46510,46511,46514,46518,46519,46520,46521,46522,46526,46527,46529,46530,46531,46533,46534,46535,46536,46537,46538,46539,46542,46546,46547,46548,46549,46550,46551,46553,46554,46555,46556,46557,46558,46559,46560,46561,46562,46563,46564,46565,46566,46567,46568,46569,46570,46571,46573,46574,46575,46576,46577,46578,46579,46580,46581,46582,46583,46584,46585,46586,46587,46588,46589,46590,46591,46592,46593,46594,46595,46596,46597,46598,46599,46600,46601,46602,46603,46604,46605,46606,46607,46610,46611,46613,46614,46615,46617,46618,46619,46620,46621,null,null,null,null,null,null,46622,46623,46624,46625,46626,46627,46628,46630,46631,46632,46633,46634,46635,46637,46638,46639,46640,46641,46642,46643,46645,46646,46647,46648,46649,46650,null,null,null,null,null,null,46651,46652,46653,46654,46655,46656,46657,46658,46659,46660,46661,46662,46663,46665,46666,46667,46668,46669,46670,46671,46672,46673,46674,46675,46676,46677,46678,46679,46680,46681,46682,46683,46684,46685,46686,46687,46688,46689,46690,46691,46693,46694,46695,46697,46698,46699,46700,46701,46702,46703,46704,46705,46706,46707,46708,46709,46710,46711,46712,46713,46714,46715,46716,46717,46718,46719,46720,46721,46722,46723,46724,46725,46726,46727,46728,46729,46730,46731,46732,46733,46734,46735,46736,46737,46738,46739,46740,46741,46742,46743,46744,46745,46746,46747,46750,46751,46753,46754,46755,46757,46758,46759,46760,46761,46762,46765,46766,46767,46768,46770,46771,46772,46773,46774,46775,46776,46777,46778,46779,46780,46781,46782,46783,46784,46785,46786,46787,46788,46789,46790,46791,46792,46793,46794,46795,46796,46797,46798,46799,46800,46801,46802,46803,46805,46806,46807,46808,46809,46810,46811,46812,46813,null,null,null,null,null,null,46814,46815,46816,46817,46818,46819,46820,46821,46822,46823,46824,46825,46826,46827,46828,46829,46830,46831,46833,46834,46835,46837,46838,46839,46841,46842,null,null,null,null,null,null,46843,46844,46845,46846,46847,46850,46851,46852,46854,46855,46856,46857,46858,46859,46860,46861,46862,46863,46864,46865,46866,46867,46868,46869,46870,46871,46872,46873,46874,46875,46876,46877,46878,46879,46880,46881,46882,46883,46884,46885,46886,46887,46890,46891,46893,46894,46897,46898,46899,46900,46901,46902,46903,46906,46908,46909,46910,46911,46912,46913,46914,46915,46917,46918,46919,46921,46922,46923,46925,46926,46927,46928,46929,46930,46931,46934,46935,46936,46937,46938,46939,46940,46941,46942,46943,46945,46946,46947,46949,46950,46951,46953,46954,46955,46956,46957,46958,46959,46962,46964,46966,46967,46968,46969,46970,46971,46974,46975,46977,46978,46979,46981,46982,46983,46984,46985,46986,46987,46990,46995,46996,46997,47002,47003,47005,47006,47007,47009,47010,47011,47012,47013,47014,47015,47018,47022,47023,47024,47025,47026,47027,47030,47031,47033,47034,47035,47036,47037,47038,47039,47040,47041,null,null,null,null,null,null,47042,47043,47044,47045,47046,47048,47050,47051,47052,47053,47054,47055,47056,47057,47058,47059,47060,47061,47062,47063,47064,47065,47066,47067,47068,47069,null,null,null,null,null,null,47070,47071,47072,47073,47074,47075,47076,47077,47078,47079,47080,47081,47082,47083,47086,47087,47089,47090,47091,47093,47094,47095,47096,47097,47098,47099,47102,47106,47107,47108,47109,47110,47114,47115,47117,47118,47119,47121,47122,47123,47124,47125,47126,47127,47130,47132,47134,47135,47136,47137,47138,47139,47142,47143,47145,47146,47147,47149,47150,47151,47152,47153,47154,47155,47158,47162,47163,47164,47165,47166,47167,47169,47170,47171,47173,47174,47175,47176,47177,47178,47179,47180,47181,47182,47183,47184,47186,47188,47189,47190,47191,47192,47193,47194,47195,47198,47199,47201,47202,47203,47205,47206,47207,47208,47209,47210,47211,47214,47216,47218,47219,47220,47221,47222,47223,47225,47226,47227,47229,47230,47231,47232,47233,47234,47235,47236,47237,47238,47239,47240,47241,47242,47243,47244,47246,47247,47248,47249,47250,47251,47252,47253,47254,47255,47256,47257,47258,47259,47260,47261,47262,47263,null,null,null,null,null,null,47264,47265,47266,47267,47268,47269,47270,47271,47273,47274,47275,47276,47277,47278,47279,47281,47282,47283,47285,47286,47287,47289,47290,47291,47292,47293,null,null,null,null,null,null,47294,47295,47298,47300,47302,47303,47304,47305,47306,47307,47309,47310,47311,47313,47314,47315,47317,47318,47319,47320,47321,47322,47323,47324,47326,47328,47330,47331,47332,47333,47334,47335,47338,47339,47341,47342,47343,47345,47346,47347,47348,47349,47350,47351,47354,47356,47358,47359,47360,47361,47362,47363,47365,47366,47367,47368,47369,47370,47371,47372,47373,47374,47375,47376,47377,47378,47379,47380,47381,47382,47383,47385,47386,47387,47388,47389,47390,47391,47393,47394,47395,47396,47397,47398,47399,47400,47401,47402,47403,47404,47405,47406,47407,47408,47409,47410,47411,47412,47413,47414,47415,47416,47417,47418,47419,47422,47423,47425,47426,47427,47429,47430,47431,47432,47433,47434,47435,47437,47438,47440,47442,47443,47444,47445,47446,47447,47450,47451,47453,47454,47455,47457,47458,47459,47460,47461,47462,47463,47466,47468,47470,47471,47472,47473,47474,47475,47478,47479,47481,47482,47483,47485,null,null,null,null,null,null,47486,47487,47488,47489,47490,47491,47494,47496,47499,47500,47503,47504,47505,47506,47507,47508,47509,47510,47511,47512,47513,47514,47515,47516,47517,47518,null,null,null,null,null,null,47519,47520,47521,47522,47523,47524,47525,47526,47527,47528,47529,47530,47531,47534,47535,47537,47538,47539,47541,47542,47543,47544,47545,47546,47547,47550,47552,47554,47555,47556,47557,47558,47559,47562,47563,47565,47571,47572,47573,47574,47575,47578,47580,47583,47584,47586,47590,47591,47593,47594,47595,47597,47598,47599,47600,47601,47602,47603,47606,47611,47612,47613,47614,47615,47618,47619,47620,47621,47622,47623,47625,47626,47627,47628,47629,47630,47631,47632,47633,47634,47635,47636,47638,47639,47640,47641,47642,47643,47644,47645,47646,47647,47648,47649,47650,47651,47652,47653,47654,47655,47656,47657,47658,47659,47660,47661,47662,47663,47664,47665,47666,47667,47668,47669,47670,47671,47674,47675,47677,47678,47679,47681,47683,47684,47685,47686,47687,47690,47692,47695,47696,47697,47698,47702,47703,47705,47706,47707,47709,47710,47711,47712,47713,47714,47715,47718,47722,47723,47724,47725,47726,47727,null,null,null,null,null,null,47730,47731,47733,47734,47735,47737,47738,47739,47740,47741,47742,47743,47744,47745,47746,47750,47752,47753,47754,47755,47757,47758,47759,47760,47761,47762,null,null,null,null,null,null,47763,47764,47765,47766,47767,47768,47769,47770,47771,47772,47773,47774,47775,47776,47777,47778,47779,47780,47781,47782,47783,47786,47789,47790,47791,47793,47795,47796,47797,47798,47799,47802,47804,47806,47807,47808,47809,47810,47811,47813,47814,47815,47817,47818,47819,47820,47821,47822,47823,47824,47825,47826,47827,47828,47829,47830,47831,47834,47835,47836,47837,47838,47839,47840,47841,47842,47843,47844,47845,47846,47847,47848,47849,47850,47851,47852,47853,47854,47855,47856,47857,47858,47859,47860,47861,47862,47863,47864,47865,47866,47867,47869,47870,47871,47873,47874,47875,47877,47878,47879,47880,47881,47882,47883,47884,47886,47888,47890,47891,47892,47893,47894,47895,47897,47898,47899,47901,47902,47903,47905,47906,47907,47908,47909,47910,47911,47912,47914,47916,47917,47918,47919,47920,47921,47922,47923,47927,47929,47930,47935,47936,47937,47938,47939,47942,47944,47946,47947,47948,47950,47953,47954,null,null,null,null,null,null,47955,47957,47958,47959,47961,47962,47963,47964,47965,47966,47967,47968,47970,47972,47973,47974,47975,47976,47977,47978,47979,47981,47982,47983,47984,47985,null,null,null,null,null,null,47986,47987,47988,47989,47990,47991,47992,47993,47994,47995,47996,47997,47998,47999,48000,48001,48002,48003,48004,48005,48006,48007,48009,48010,48011,48013,48014,48015,48017,48018,48019,48020,48021,48022,48023,48024,48025,48026,48027,48028,48029,48030,48031,48032,48033,48034,48035,48037,48038,48039,48041,48042,48043,48045,48046,48047,48048,48049,48050,48051,48053,48054,48056,48057,48058,48059,48060,48061,48062,48063,48065,48066,48067,48069,48070,48071,48073,48074,48075,48076,48077,48078,48079,48081,48082,48084,48085,48086,48087,48088,48089,48090,48091,48092,48093,48094,48095,48096,48097,48098,48099,48100,48101,48102,48103,48104,48105,48106,48107,48108,48109,48110,48111,48112,48113,48114,48115,48116,48117,48118,48119,48122,48123,48125,48126,48129,48131,48132,48133,48134,48135,48138,48142,48144,48146,48147,48153,48154,48160,48161,48162,48163,48166,48168,48170,48171,48172,48174,48175,48178,48179,48181,null,null,null,null,null,null,48182,48183,48185,48186,48187,48188,48189,48190,48191,48194,48198,48199,48200,48202,48203,48206,48207,48209,48210,48211,48212,48213,48214,48215,48216,48217,null,null,null,null,null,null,48218,48219,48220,48222,48223,48224,48225,48226,48227,48228,48229,48230,48231,48232,48233,48234,48235,48236,48237,48238,48239,48240,48241,48242,48243,48244,48245,48246,48247,48248,48249,48250,48251,48252,48253,48254,48255,48256,48257,48258,48259,48262,48263,48265,48266,48269,48271,48272,48273,48274,48275,48278,48280,48283,48284,48285,48286,48287,48290,48291,48293,48294,48297,48298,48299,48300,48301,48302,48303,48306,48310,48311,48312,48313,48314,48315,48318,48319,48321,48322,48323,48325,48326,48327,48328,48329,48330,48331,48332,48334,48338,48339,48340,48342,48343,48345,48346,48347,48349,48350,48351,48352,48353,48354,48355,48356,48357,48358,48359,48360,48361,48362,48363,48364,48365,48366,48367,48368,48369,48370,48371,48375,48377,48378,48379,48381,48382,48383,48384,48385,48386,48387,48390,48392,48394,48395,48396,48397,48398,48399,48401,48402,48403,48405,48406,48407,48408,48409,48410,48411,48412,48413,null,null,null,null,null,null,48414,48415,48416,48417,48418,48419,48421,48422,48423,48424,48425,48426,48427,48429,48430,48431,48432,48433,48434,48435,48436,48437,48438,48439,48440,48441,null,null,null,null,null,null,48442,48443,48444,48445,48446,48447,48449,48450,48451,48452,48453,48454,48455,48458,48459,48461,48462,48463,48465,48466,48467,48468,48469,48470,48471,48474,48475,48476,48477,48478,48479,48480,48481,48482,48483,48485,48486,48487,48489,48490,48491,48492,48493,48494,48495,48496,48497,48498,48499,48500,48501,48502,48503,48504,48505,48506,48507,48508,48509,48510,48511,48514,48515,48517,48518,48523,48524,48525,48526,48527,48530,48532,48534,48535,48536,48539,48541,48542,48543,48544,48545,48546,48547,48549,48550,48551,48552,48553,48554,48555,48556,48557,48558,48559,48561,48562,48563,48564,48565,48566,48567,48569,48570,48571,48572,48573,48574,48575,48576,48577,48578,48579,48580,48581,48582,48583,48584,48585,48586,48587,48588,48589,48590,48591,48592,48593,48594,48595,48598,48599,48601,48602,48603,48605,48606,48607,48608,48609,48610,48611,48612,48613,48614,48615,48616,48618,48619,48620,48621,48622,48623,48625,null,null,null,null,null,null,48626,48627,48629,48630,48631,48633,48634,48635,48636,48637,48638,48639,48641,48642,48644,48646,48647,48648,48649,48650,48651,48654,48655,48657,48658,48659,null,null,null,null,null,null,48661,48662,48663,48664,48665,48666,48667,48670,48672,48673,48674,48675,48676,48677,48678,48679,48680,48681,48682,48683,48684,48685,48686,48687,48688,48689,48690,48691,48692,48693,48694,48695,48696,48697,48698,48699,48700,48701,48702,48703,48704,48705,48706,48707,48710,48711,48713,48714,48715,48717,48719,48720,48721,48722,48723,48726,48728,48732,48733,48734,48735,48738,48739,48741,48742,48743,48745,48747,48748,48749,48750,48751,48754,48758,48759,48760,48761,48762,48766,48767,48769,48770,48771,48773,48774,48775,48776,48777,48778,48779,48782,48786,48787,48788,48789,48790,48791,48794,48795,48796,48797,48798,48799,48800,48801,48802,48803,48804,48805,48806,48807,48809,48810,48811,48812,48813,48814,48815,48816,48817,48818,48819,48820,48821,48822,48823,48824,48825,48826,48827,48828,48829,48830,48831,48832,48833,48834,48835,48836,48837,48838,48839,48840,48841,48842,48843,48844,48845,48846,48847,48850,48851,null,null,null,null,null,null,48853,48854,48857,48858,48859,48860,48861,48862,48863,48865,48866,48870,48871,48872,48873,48874,48875,48877,48878,48879,48880,48881,48882,48883,48884,48885,null,null,null,null,null,null,48886,48887,48888,48889,48890,48891,48892,48893,48894,48895,48896,48898,48899,48900,48901,48902,48903,48906,48907,48908,48909,48910,48911,48912,48913,48914,48915,48916,48917,48918,48919,48922,48926,48927,48928,48929,48930,48931,48932,48933,48934,48935,48936,48937,48938,48939,48940,48941,48942,48943,48944,48945,48946,48947,48948,48949,48950,48951,48952,48953,48954,48955,48956,48957,48958,48959,48962,48963,48965,48966,48967,48969,48970,48971,48972,48973,48974,48975,48978,48979,48980,48982,48983,48984,48985,48986,48987,48988,48989,48990,48991,48992,48993,48994,48995,48996,48997,48998,48999,49000,49001,49002,49003,49004,49005,49006,49007,49008,49009,49010,49011,49012,49013,49014,49015,49016,49017,49018,49019,49020,49021,49022,49023,49024,49025,49026,49027,49028,49029,49030,49031,49032,49033,49034,49035,49036,49037,49038,49039,49040,49041,49042,49043,49045,49046,49047,49048,49049,49050,49051,49052,49053,null,null,null,null,null,null,49054,49055,49056,49057,49058,49059,49060,49061,49062,49063,49064,49065,49066,49067,49068,49069,49070,49071,49073,49074,49075,49076,49077,49078,49079,49080,null,null,null,null,null,null,49081,49082,49083,49084,49085,49086,49087,49088,49089,49090,49091,49092,49094,49095,49096,49097,49098,49099,49102,49103,49105,49106,49107,49109,49110,49111,49112,49113,49114,49115,49117,49118,49120,49122,49123,49124,49125,49126,49127,49128,49129,49130,49131,49132,49133,49134,49135,49136,49137,49138,49139,49140,49141,49142,49143,49144,49145,49146,49147,49148,49149,49150,49151,49152,49153,49154,49155,49156,49157,49158,49159,49160,49161,49162,49163,49164,49165,49166,49167,49168,49169,49170,49171,49172,49173,49174,49175,49176,49177,49178,49179,49180,49181,49182,49183,49184,49185,49186,49187,49188,49189,49190,49191,49192,49193,49194,49195,49196,49197,49198,49199,49200,49201,49202,49203,49204,49205,49206,49207,49208,49209,49210,49211,49213,49214,49215,49216,49217,49218,49219,49220,49221,49222,49223,49224,49225,49226,49227,49228,49229,49230,49231,49232,49234,49235,49236,49237,49238,49239,49241,49242,49243,null,null,null,null,null,null,49245,49246,49247,49249,49250,49251,49252,49253,49254,49255,49258,49259,49260,49261,49262,49263,49264,49265,49266,49267,49268,49269,49270,49271,49272,49273,null,null,null,null,null,null,49274,49275,49276,49277,49278,49279,49280,49281,49282,49283,49284,49285,49286,49287,49288,49289,49290,49291,49292,49293,49294,49295,49298,49299,49301,49302,49303,49305,49306,49307,49308,49309,49310,49311,49314,49316,49318,49319,49320,49321,49322,49323,49326,49329,49330,49335,49336,49337,49338,49339,49342,49346,49347,49348,49350,49351,49354,49355,49357,49358,49359,49361,49362,49363,49364,49365,49366,49367,49370,49374,49375,49376,49377,49378,49379,49382,49383,49385,49386,49387,49389,49390,49391,49392,49393,49394,49395,49398,49400,49402,49403,49404,49405,49406,49407,49409,49410,49411,49413,49414,49415,49417,49418,49419,49420,49421,49422,49423,49425,49426,49427,49428,49430,49431,49432,49433,49434,49435,49441,49442,49445,49448,49449,49450,49451,49454,49458,49459,49460,49461,49463,49466,49467,49469,49470,49471,49473,49474,49475,49476,49477,49478,49479,49482,49486,49487,49488,49489,49490,49491,49494,49495,null,null,null,null,null,null,49497,49498,49499,49501,49502,49503,49504,49505,49506,49507,49510,49514,49515,49516,49517,49518,49519,49521,49522,49523,49525,49526,49527,49529,49530,49531,null,null,null,null,null,null,49532,49533,49534,49535,49536,49537,49538,49539,49540,49542,49543,49544,49545,49546,49547,49551,49553,49554,49555,49557,49559,49560,49561,49562,49563,49566,49568,49570,49571,49572,49574,49575,49578,49579,49581,49582,49583,49585,49586,49587,49588,49589,49590,49591,49592,49593,49594,49595,49596,49598,49599,49600,49601,49602,49603,49605,49606,49607,49609,49610,49611,49613,49614,49615,49616,49617,49618,49619,49621,49622,49625,49626,49627,49628,49629,49630,49631,49633,49634,49635,49637,49638,49639,49641,49642,49643,49644,49645,49646,49647,49650,49652,49653,49654,49655,49656,49657,49658,49659,49662,49663,49665,49666,49667,49669,49670,49671,49672,49673,49674,49675,49678,49680,49682,49683,49684,49685,49686,49687,49690,49691,49693,49694,49697,49698,49699,49700,49701,49702,49703,49706,49708,49710,49712,49715,49717,49718,49719,49720,49721,49722,49723,49724,49725,49726,49727,49728,49729,49730,49731,49732,49733,null,null,null,null,null,null,49734,49735,49737,49738,49739,49740,49741,49742,49743,49746,49747,49749,49750,49751,49753,49754,49755,49756,49757,49758,49759,49761,49762,49763,49764,49766,null,null,null,null,null,null,49767,49768,49769,49770,49771,49774,49775,49777,49778,49779,49781,49782,49783,49784,49785,49786,49787,49790,49792,49794,49795,49796,49797,49798,49799,49802,49803,49804,49805,49806,49807,49809,49810,49811,49812,49813,49814,49815,49817,49818,49820,49822,49823,49824,49825,49826,49827,49830,49831,49833,49834,49835,49838,49839,49840,49841,49842,49843,49846,49848,49850,49851,49852,49853,49854,49855,49856,49857,49858,49859,49860,49861,49862,49863,49864,49865,49866,49867,49868,49869,49870,49871,49872,49873,49874,49875,49876,49877,49878,49879,49880,49881,49882,49883,49886,49887,49889,49890,49893,49894,49895,49896,49897,49898,49902,49904,49906,49907,49908,49909,49911,49914,49917,49918,49919,49921,49922,49923,49924,49925,49926,49927,49930,49931,49934,49935,49936,49937,49938,49942,49943,49945,49946,49947,49949,49950,49951,49952,49953,49954,49955,49958,49959,49962,49963,49964,49965,49966,49967,49968,49969,49970,null,null,null,null,null,null,49971,49972,49973,49974,49975,49976,49977,49978,49979,49980,49981,49982,49983,49984,49985,49986,49987,49988,49990,49991,49992,49993,49994,49995,49996,49997,null,null,null,null,null,null,49998,49999,50000,50001,50002,50003,50004,50005,50006,50007,50008,50009,50010,50011,50012,50013,50014,50015,50016,50017,50018,50019,50020,50021,50022,50023,50026,50027,50029,50030,50031,50033,50035,50036,50037,50038,50039,50042,50043,50046,50047,50048,50049,50050,50051,50053,50054,50055,50057,50058,50059,50061,50062,50063,50064,50065,50066,50067,50068,50069,50070,50071,50072,50073,50074,50075,50076,50077,50078,50079,50080,50081,50082,50083,50084,50085,50086,50087,50088,50089,50090,50091,50092,50093,50094,50095,50096,50097,50098,50099,50100,50101,50102,50103,50104,50105,50106,50107,50108,50109,50110,50111,50113,50114,50115,50116,50117,50118,50119,50120,50121,50122,50123,50124,50125,50126,50127,50128,50129,50130,50131,50132,50133,50134,50135,50138,50139,50141,50142,50145,50147,50148,50149,50150,50151,50154,50155,50156,50158,50159,50160,50161,50162,50163,50166,50167,50169,50170,50171,50172,50173,50174,null,null,null,null,null,null,50175,50176,50177,50178,50179,50180,50181,50182,50183,50185,50186,50187,50188,50189,50190,50191,50193,50194,50195,50196,50197,50198,50199,50200,50201,50202,null,null,null,null,null,null,50203,50204,50205,50206,50207,50208,50209,50210,50211,50213,50214,50215,50216,50217,50218,50219,50221,50222,50223,50225,50226,50227,50229,50230,50231,50232,50233,50234,50235,50238,50239,50240,50241,50242,50243,50244,50245,50246,50247,50249,50250,50251,50252,50253,50254,50255,50256,50257,50258,50259,50260,50261,50262,50263,50264,50265,50266,50267,50268,50269,50270,50271,50272,50273,50274,50275,50278,50279,50281,50282,50283,50285,50286,50287,50288,50289,50290,50291,50294,50295,50296,50298,50299,50300,50301,50302,50303,50305,50306,50307,50308,50309,50310,50311,50312,50313,50314,50315,50316,50317,50318,50319,50320,50321,50322,50323,50325,50326,50327,50328,50329,50330,50331,50333,50334,50335,50336,50337,50338,50339,50340,50341,50342,50343,50344,50345,50346,50347,50348,50349,50350,50351,50352,50353,50354,50355,50356,50357,50358,50359,50361,50362,50363,50365,50366,50367,50368,50369,50370,50371,50372,50373,null,null,null,null,null,null,50374,50375,50376,50377,50378,50379,50380,50381,50382,50383,50384,50385,50386,50387,50388,50389,50390,50391,50392,50393,50394,50395,50396,50397,50398,50399,null,null,null,null,null,null,50400,50401,50402,50403,50404,50405,50406,50407,50408,50410,50411,50412,50413,50414,50415,50418,50419,50421,50422,50423,50425,50427,50428,50429,50430,50434,50435,50436,50437,50438,50439,50440,50441,50442,50443,50445,50446,50447,50449,50450,50451,50453,50454,50455,50456,50457,50458,50459,50461,50462,50463,50464,50465,50466,50467,50468,50469,50470,50471,50474,50475,50477,50478,50479,50481,50482,50483,50484,50485,50486,50487,50490,50492,50494,50495,50496,50497,50498,50499,50502,50503,50507,50511,50512,50513,50514,50518,50522,50523,50524,50527,50530,50531,50533,50534,50535,50537,50538,50539,50540,50541,50542,50543,50546,50550,50551,50552,50553,50554,50555,50558,50559,50561,50562,50563,50565,50566,50568,50569,50570,50571,50574,50576,50578,50579,50580,50582,50585,50586,50587,50589,50590,50591,50593,50594,50595,50596,50597,50598,50599,50600,50602,50603,50604,50605,50606,50607,50608,50609,50610,50611,50614,null,null,null,null,null,null,50615,50618,50623,50624,50625,50626,50627,50635,50637,50639,50642,50643,50645,50646,50647,50649,50650,50651,50652,50653,50654,50655,50658,50660,50662,50663,null,null,null,null,null,null,50664,50665,50666,50667,50671,50673,50674,50675,50677,50680,50681,50682,50683,50690,50691,50692,50697,50698,50699,50701,50702,50703,50705,50706,50707,50708,50709,50710,50711,50714,50717,50718,50719,50720,50721,50722,50723,50726,50727,50729,50730,50731,50735,50737,50738,50742,50744,50746,50748,50749,50750,50751,50754,50755,50757,50758,50759,50761,50762,50763,50764,50765,50766,50767,50770,50774,50775,50776,50777,50778,50779,50782,50783,50785,50786,50787,50788,50789,50790,50791,50792,50793,50794,50795,50797,50798,50800,50802,50803,50804,50805,50806,50807,50810,50811,50813,50814,50815,50817,50818,50819,50820,50821,50822,50823,50826,50828,50830,50831,50832,50833,50834,50835,50838,50839,50841,50842,50843,50845,50846,50847,50848,50849,50850,50851,50854,50856,50858,50859,50860,50861,50862,50863,50866,50867,50869,50870,50871,50875,50876,50877,50878,50879,50882,50884,50886,50887,50888,50889,50890,50891,50894,null,null,null,null,null,null,50895,50897,50898,50899,50901,50902,50903,50904,50905,50906,50907,50910,50911,50914,50915,50916,50917,50918,50919,50922,50923,50925,50926,50927,50929,50930,null,null,null,null,null,null,50931,50932,50933,50934,50935,50938,50939,50940,50942,50943,50944,50945,50946,50947,50950,50951,50953,50954,50955,50957,50958,50959,50960,50961,50962,50963,50966,50968,50970,50971,50972,50973,50974,50975,50978,50979,50981,50982,50983,50985,50986,50987,50988,50989,50990,50991,50994,50996,50998,51000,51001,51002,51003,51006,51007,51009,51010,51011,51013,51014,51015,51016,51017,51019,51022,51024,51033,51034,51035,51037,51038,51039,51041,51042,51043,51044,51045,51046,51047,51049,51050,51052,51053,51054,51055,51056,51057,51058,51059,51062,51063,51065,51066,51067,51071,51072,51073,51074,51078,51083,51084,51085,51087,51090,51091,51093,51097,51099,51100,51101,51102,51103,51106,51111,51112,51113,51114,51115,51118,51119,51121,51122,51123,51125,51126,51127,51128,51129,51130,51131,51134,51138,51139,51140,51141,51142,51143,51146,51147,51149,51151,51153,51154,51155,51156,51157,51158,51159,51161,51162,51163,51164,null,null,null,null,null,null,51166,51167,51168,51169,51170,51171,51173,51174,51175,51177,51178,51179,51181,51182,51183,51184,51185,51186,51187,51188,51189,51190,51191,51192,51193,51194,null,null,null,null,null,null,51195,51196,51197,51198,51199,51202,51203,51205,51206,51207,51209,51211,51212,51213,51214,51215,51218,51220,51223,51224,51225,51226,51227,51230,51231,51233,51234,51235,51237,51238,51239,51240,51241,51242,51243,51246,51248,51250,51251,51252,51253,51254,51255,51257,51258,51259,51261,51262,51263,51265,51266,51267,51268,51269,51270,51271,51274,51275,51278,51279,51280,51281,51282,51283,51285,51286,51287,51288,51289,51290,51291,51292,51293,51294,51295,51296,51297,51298,51299,51300,51301,51302,51303,51304,51305,51306,51307,51308,51309,51310,51311,51314,51315,51317,51318,51319,51321,51323,51324,51325,51326,51327,51330,51332,51336,51337,51338,51342,51343,51344,51345,51346,51347,51349,51350,51351,51352,51353,51354,51355,51356,51358,51360,51362,51363,51364,51365,51366,51367,51369,51370,51371,51372,51373,51374,51375,51376,51377,51378,51379,51380,51381,51382,51383,51384,51385,51386,51387,51390,51391,51392,51393,null,null,null,null,null,null,51394,51395,51397,51398,51399,51401,51402,51403,51405,51406,51407,51408,51409,51410,51411,51414,51416,51418,51419,51420,51421,51422,51423,51426,51427,51429,null,null,null,null,null,null,51430,51431,51432,51433,51434,51435,51436,51437,51438,51439,51440,51441,51442,51443,51444,51446,51447,51448,51449,51450,51451,51454,51455,51457,51458,51459,51463,51464,51465,51466,51467,51470,12288,12289,12290,183,8229,8230,168,12291,173,8213,8741,65340,8764,8216,8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,177,215,247,8800,8804,8805,8734,8756,176,8242,8243,8451,8491,65504,65505,65509,9794,9792,8736,8869,8978,8706,8711,8801,8786,167,8251,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,8594,8592,8593,8595,8596,12307,8810,8811,8730,8765,8733,8757,8747,8748,8712,8715,8838,8839,8834,8835,8746,8745,8743,8744,65506,51472,51474,51475,51476,51477,51478,51479,51481,51482,51483,51484,51485,51486,51487,51488,51489,51490,51491,51492,51493,51494,51495,51496,51497,51498,51499,null,null,null,null,null,null,51501,51502,51503,51504,51505,51506,51507,51509,51510,51511,51512,51513,51514,51515,51516,51517,51518,51519,51520,51521,51522,51523,51524,51525,51526,51527,null,null,null,null,null,null,51528,51529,51530,51531,51532,51533,51534,51535,51538,51539,51541,51542,51543,51545,51546,51547,51548,51549,51550,51551,51554,51556,51557,51558,51559,51560,51561,51562,51563,51565,51566,51567,8658,8660,8704,8707,180,65374,711,728,733,730,729,184,731,161,191,720,8750,8721,8719,164,8457,8240,9665,9664,9655,9654,9828,9824,9825,9829,9831,9827,8857,9672,9635,9680,9681,9618,9636,9637,9640,9639,9638,9641,9832,9743,9742,9756,9758,182,8224,8225,8597,8599,8601,8598,8600,9837,9833,9834,9836,12927,12828,8470,13255,8482,13250,13272,8481,8364,174,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,51569,51570,51571,51573,51574,51575,51576,51577,51578,51579,51581,51582,51583,51584,51585,51586,51587,51588,51589,51590,51591,51594,51595,51597,51598,51599,null,null,null,null,null,null,51601,51602,51603,51604,51605,51606,51607,51610,51612,51614,51615,51616,51617,51618,51619,51620,51621,51622,51623,51624,51625,51626,51627,51628,51629,51630,null,null,null,null,null,null,51631,51632,51633,51634,51635,51636,51637,51638,51639,51640,51641,51642,51643,51644,51645,51646,51647,51650,51651,51653,51654,51657,51659,51660,51661,51662,51663,51666,51668,51671,51672,51675,65281,65282,65283,65284,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65339,65510,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,51678,51679,51681,51683,51685,51686,51688,51689,51690,51691,51694,51698,51699,51700,51701,51702,51703,51706,51707,51709,51710,51711,51713,51714,51715,51716,null,null,null,null,null,null,51717,51718,51719,51722,51726,51727,51728,51729,51730,51731,51733,51734,51735,51737,51738,51739,51740,51741,51742,51743,51744,51745,51746,51747,51748,51749,null,null,null,null,null,null,51750,51751,51752,51754,51755,51756,51757,51758,51759,51760,51761,51762,51763,51764,51765,51766,51767,51768,51769,51770,51771,51772,51773,51774,51775,51776,51777,51778,51779,51780,51781,51782,12593,12594,12595,12596,12597,12598,12599,12600,12601,12602,12603,12604,12605,12606,12607,12608,12609,12610,12611,12612,12613,12614,12615,12616,12617,12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,12629,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,12647,12648,12649,12650,12651,12652,12653,12654,12655,12656,12657,12658,12659,12660,12661,12662,12663,12664,12665,12666,12667,12668,12669,12670,12671,12672,12673,12674,12675,12676,12677,12678,12679,12680,12681,12682,12683,12684,12685,12686,51783,51784,51785,51786,51787,51790,51791,51793,51794,51795,51797,51798,51799,51800,51801,51802,51803,51806,51810,51811,51812,51813,51814,51815,51817,51818,null,null,null,null,null,null,51819,51820,51821,51822,51823,51824,51825,51826,51827,51828,51829,51830,51831,51832,51833,51834,51835,51836,51838,51839,51840,51841,51842,51843,51845,51846,null,null,null,null,null,null,51847,51848,51849,51850,51851,51852,51853,51854,51855,51856,51857,51858,51859,51860,51861,51862,51863,51865,51866,51867,51868,51869,51870,51871,51872,51873,51874,51875,51876,51877,51878,51879,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,null,null,null,null,null,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,null,null,null,null,null,null,null,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,null,null,null,null,null,null,null,null,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,null,null,null,null,null,null,51880,51881,51882,51883,51884,51885,51886,51887,51888,51889,51890,51891,51892,51893,51894,51895,51896,51897,51898,51899,51902,51903,51905,51906,51907,51909,null,null,null,null,null,null,51910,51911,51912,51913,51914,51915,51918,51920,51922,51924,51925,51926,51927,51930,51931,51932,51933,51934,51935,51937,51938,51939,51940,51941,51942,51943,null,null,null,null,null,null,51944,51945,51946,51947,51949,51950,51951,51952,51953,51954,51955,51957,51958,51959,51960,51961,51962,51963,51964,51965,51966,51967,51968,51969,51970,51971,51972,51973,51974,51975,51977,51978,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,9490,9489,9498,9497,9494,9493,9486,9485,9502,9503,9505,9506,9510,9511,9513,9514,9517,9518,9521,9522,9525,9526,9529,9530,9533,9534,9536,9537,9539,9540,9541,9542,9543,9544,9545,9546,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,51979,51980,51981,51982,51983,51985,51986,51987,51989,51990,51991,51993,51994,51995,51996,51997,51998,51999,52002,52003,52004,52005,52006,52007,52008,52009,null,null,null,null,null,null,52010,52011,52012,52013,52014,52015,52016,52017,52018,52019,52020,52021,52022,52023,52024,52025,52026,52027,52028,52029,52030,52031,52032,52034,52035,52036,null,null,null,null,null,null,52037,52038,52039,52042,52043,52045,52046,52047,52049,52050,52051,52052,52053,52054,52055,52058,52059,52060,52062,52063,52064,52065,52066,52067,52069,52070,52071,52072,52073,52074,52075,52076,13205,13206,13207,8467,13208,13252,13219,13220,13221,13222,13209,13210,13211,13212,13213,13214,13215,13216,13217,13218,13258,13197,13198,13199,13263,13192,13193,13256,13223,13224,13232,13233,13234,13235,13236,13237,13238,13239,13240,13241,13184,13185,13186,13187,13188,13242,13243,13244,13245,13246,13247,13200,13201,13202,13203,13204,8486,13248,13249,13194,13195,13196,13270,13253,13229,13230,13231,13275,13225,13226,13227,13228,13277,13264,13267,13251,13257,13276,13254,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52077,52078,52079,52080,52081,52082,52083,52084,52085,52086,52087,52090,52091,52092,52093,52094,52095,52096,52097,52098,52099,52100,52101,52102,52103,52104,null,null,null,null,null,null,52105,52106,52107,52108,52109,52110,52111,52112,52113,52114,52115,52116,52117,52118,52119,52120,52121,52122,52123,52125,52126,52127,52128,52129,52130,52131,null,null,null,null,null,null,52132,52133,52134,52135,52136,52137,52138,52139,52140,52141,52142,52143,52144,52145,52146,52147,52148,52149,52150,52151,52153,52154,52155,52156,52157,52158,52159,52160,52161,52162,52163,52164,198,208,170,294,null,306,null,319,321,216,338,186,222,358,330,null,12896,12897,12898,12899,12900,12901,12902,12903,12904,12905,12906,12907,12908,12909,12910,12911,12912,12913,12914,12915,12916,12917,12918,12919,12920,12921,12922,12923,9424,9425,9426,9427,9428,9429,9430,9431,9432,9433,9434,9435,9436,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,189,8531,8532,188,190,8539,8540,8541,8542,52165,52166,52167,52168,52169,52170,52171,52172,52173,52174,52175,52176,52177,52178,52179,52181,52182,52183,52184,52185,52186,52187,52188,52189,52190,52191,null,null,null,null,null,null,52192,52193,52194,52195,52197,52198,52200,52202,52203,52204,52205,52206,52207,52208,52209,52210,52211,52212,52213,52214,52215,52216,52217,52218,52219,52220,null,null,null,null,null,null,52221,52222,52223,52224,52225,52226,52227,52228,52229,52230,52231,52232,52233,52234,52235,52238,52239,52241,52242,52243,52245,52246,52247,52248,52249,52250,52251,52254,52255,52256,52259,52260,230,273,240,295,305,307,312,320,322,248,339,223,254,359,331,329,12800,12801,12802,12803,12804,12805,12806,12807,12808,12809,12810,12811,12812,12813,12814,12815,12816,12817,12818,12819,12820,12821,12822,12823,12824,12825,12826,12827,9372,9373,9374,9375,9376,9377,9378,9379,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,185,178,179,8308,8319,8321,8322,8323,8324,52261,52262,52266,52267,52269,52271,52273,52274,52275,52276,52277,52278,52279,52282,52287,52288,52289,52290,52291,52294,52295,52297,52298,52299,52301,52302,null,null,null,null,null,null,52303,52304,52305,52306,52307,52310,52314,52315,52316,52317,52318,52319,52321,52322,52323,52325,52327,52329,52330,52331,52332,52333,52334,52335,52337,52338,null,null,null,null,null,null,52339,52340,52342,52343,52344,52345,52346,52347,52348,52349,52350,52351,52352,52353,52354,52355,52356,52357,52358,52359,52360,52361,52362,52363,52364,52365,52366,52367,52368,52369,52370,52371,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,null,null,null,null,null,null,null,null,null,null,null,52372,52373,52374,52375,52378,52379,52381,52382,52383,52385,52386,52387,52388,52389,52390,52391,52394,52398,52399,52400,52401,52402,52403,52406,52407,52409,null,null,null,null,null,null,52410,52411,52413,52414,52415,52416,52417,52418,52419,52422,52424,52426,52427,52428,52429,52430,52431,52433,52434,52435,52437,52438,52439,52440,52441,52442,null,null,null,null,null,null,52443,52444,52445,52446,52447,52448,52449,52450,52451,52453,52454,52455,52456,52457,52458,52459,52461,52462,52463,52465,52466,52467,52468,52469,52470,52471,52472,52473,52474,52475,52476,52477,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,null,null,null,null,null,null,null,null,52478,52479,52480,52482,52483,52484,52485,52486,52487,52490,52491,52493,52494,52495,52497,52498,52499,52500,52501,52502,52503,52506,52508,52510,52511,52512,null,null,null,null,null,null,52513,52514,52515,52517,52518,52519,52521,52522,52523,52525,52526,52527,52528,52529,52530,52531,52532,52533,52534,52535,52536,52538,52539,52540,52541,52542,null,null,null,null,null,null,52543,52544,52545,52546,52547,52548,52549,52550,52551,52552,52553,52554,52555,52556,52557,52558,52559,52560,52561,52562,52563,52564,52565,52566,52567,52568,52569,52570,52571,52573,52574,52575,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,null,null,null,null,null,null,null,null,null,null,null,null,null,52577,52578,52579,52581,52582,52583,52584,52585,52586,52587,52590,52592,52594,52595,52596,52597,52598,52599,52601,52602,52603,52604,52605,52606,52607,52608,null,null,null,null,null,null,52609,52610,52611,52612,52613,52614,52615,52617,52618,52619,52620,52621,52622,52623,52624,52625,52626,52627,52630,52631,52633,52634,52635,52637,52638,52639,null,null,null,null,null,null,52640,52641,52642,52643,52646,52648,52650,52651,52652,52653,52654,52655,52657,52658,52659,52660,52661,52662,52663,52664,52665,52666,52667,52668,52669,52670,52671,52672,52673,52674,52675,52677,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52678,52679,52680,52681,52682,52683,52685,52686,52687,52689,52690,52691,52692,52693,52694,52695,52696,52697,52698,52699,52700,52701,52702,52703,52704,52705,null,null,null,null,null,null,52706,52707,52708,52709,52710,52711,52713,52714,52715,52717,52718,52719,52721,52722,52723,52724,52725,52726,52727,52730,52732,52734,52735,52736,52737,52738,null,null,null,null,null,null,52739,52741,52742,52743,52745,52746,52747,52749,52750,52751,52752,52753,52754,52755,52757,52758,52759,52760,52762,52763,52764,52765,52766,52767,52770,52771,52773,52774,52775,52777,52778,52779,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52780,52781,52782,52783,52786,52788,52790,52791,52792,52793,52794,52795,52796,52797,52798,52799,52800,52801,52802,52803,52804,52805,52806,52807,52808,52809,null,null,null,null,null,null,52810,52811,52812,52813,52814,52815,52816,52817,52818,52819,52820,52821,52822,52823,52826,52827,52829,52830,52834,52835,52836,52837,52838,52839,52842,52844,null,null,null,null,null,null,52846,52847,52848,52849,52850,52851,52854,52855,52857,52858,52859,52861,52862,52863,52864,52865,52866,52867,52870,52872,52874,52875,52876,52877,52878,52879,52882,52883,52885,52886,52887,52889,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52890,52891,52892,52893,52894,52895,52898,52902,52903,52904,52905,52906,52907,52910,52911,52912,52913,52914,52915,52916,52917,52918,52919,52920,52921,52922,null,null,null,null,null,null,52923,52924,52925,52926,52927,52928,52930,52931,52932,52933,52934,52935,52936,52937,52938,52939,52940,52941,52942,52943,52944,52945,52946,52947,52948,52949,null,null,null,null,null,null,52950,52951,52952,52953,52954,52955,52956,52957,52958,52959,52960,52961,52962,52963,52966,52967,52969,52970,52973,52974,52975,52976,52977,52978,52979,52982,52986,52987,52988,52989,52990,52991,44032,44033,44036,44039,44040,44041,44042,44048,44049,44050,44051,44052,44053,44054,44055,44057,44058,44059,44060,44061,44064,44068,44076,44077,44079,44080,44081,44088,44089,44092,44096,44107,44109,44116,44120,44124,44144,44145,44148,44151,44152,44154,44160,44161,44163,44164,44165,44166,44169,44170,44171,44172,44176,44180,44188,44189,44191,44192,44193,44200,44201,44202,44204,44207,44208,44216,44217,44219,44220,44221,44225,44228,44232,44236,44245,44247,44256,44257,44260,44263,44264,44266,44268,44271,44272,44273,44275,44277,44278,44284,44285,44288,44292,44294,52994,52995,52997,52998,52999,53001,53002,53003,53004,53005,53006,53007,53010,53012,53014,53015,53016,53017,53018,53019,53021,53022,53023,53025,53026,53027,null,null,null,null,null,null,53029,53030,53031,53032,53033,53034,53035,53038,53042,53043,53044,53045,53046,53047,53049,53050,53051,53052,53053,53054,53055,53056,53057,53058,53059,53060,null,null,null,null,null,null,53061,53062,53063,53064,53065,53066,53067,53068,53069,53070,53071,53072,53073,53074,53075,53078,53079,53081,53082,53083,53085,53086,53087,53088,53089,53090,53091,53094,53096,53098,53099,53100,44300,44301,44303,44305,44312,44316,44320,44329,44332,44333,44340,44341,44344,44348,44356,44357,44359,44361,44368,44372,44376,44385,44387,44396,44397,44400,44403,44404,44405,44406,44411,44412,44413,44415,44417,44418,44424,44425,44428,44432,44444,44445,44452,44471,44480,44481,44484,44488,44496,44497,44499,44508,44512,44516,44536,44537,44540,44543,44544,44545,44552,44553,44555,44557,44564,44592,44593,44596,44599,44600,44602,44608,44609,44611,44613,44614,44618,44620,44621,44622,44624,44628,44630,44636,44637,44639,44640,44641,44645,44648,44649,44652,44656,44664,53101,53102,53103,53106,53107,53109,53110,53111,53113,53114,53115,53116,53117,53118,53119,53121,53122,53123,53124,53126,53127,53128,53129,53130,53131,53133,null,null,null,null,null,null,53134,53135,53136,53137,53138,53139,53140,53141,53142,53143,53144,53145,53146,53147,53148,53149,53150,53151,53152,53154,53155,53156,53157,53158,53159,53161,null,null,null,null,null,null,53162,53163,53164,53165,53166,53167,53169,53170,53171,53172,53173,53174,53175,53176,53177,53178,53179,53180,53181,53182,53183,53184,53185,53186,53187,53189,53190,53191,53192,53193,53194,53195,44665,44667,44668,44669,44676,44677,44684,44732,44733,44734,44736,44740,44748,44749,44751,44752,44753,44760,44761,44764,44776,44779,44781,44788,44792,44796,44807,44808,44813,44816,44844,44845,44848,44850,44852,44860,44861,44863,44865,44866,44867,44872,44873,44880,44892,44893,44900,44901,44921,44928,44932,44936,44944,44945,44949,44956,44984,44985,44988,44992,44999,45000,45001,45003,45005,45006,45012,45020,45032,45033,45040,45041,45044,45048,45056,45057,45060,45068,45072,45076,45084,45085,45096,45124,45125,45128,45130,45132,45134,45139,45140,45141,45143,45145,53196,53197,53198,53199,53200,53201,53202,53203,53204,53205,53206,53207,53208,53209,53210,53211,53212,53213,53214,53215,53218,53219,53221,53222,53223,53225,null,null,null,null,null,null,53226,53227,53228,53229,53230,53231,53234,53236,53238,53239,53240,53241,53242,53243,53245,53246,53247,53249,53250,53251,53253,53254,53255,53256,53257,53258,null,null,null,null,null,null,53259,53260,53261,53262,53263,53264,53266,53267,53268,53269,53270,53271,53273,53274,53275,53276,53277,53278,53279,53280,53281,53282,53283,53284,53285,53286,53287,53288,53289,53290,53291,53292,45149,45180,45181,45184,45188,45196,45197,45199,45201,45208,45209,45210,45212,45215,45216,45217,45218,45224,45225,45227,45228,45229,45230,45231,45233,45235,45236,45237,45240,45244,45252,45253,45255,45256,45257,45264,45265,45268,45272,45280,45285,45320,45321,45323,45324,45328,45330,45331,45336,45337,45339,45340,45341,45347,45348,45349,45352,45356,45364,45365,45367,45368,45369,45376,45377,45380,45384,45392,45393,45396,45397,45400,45404,45408,45432,45433,45436,45440,45442,45448,45449,45451,45453,45458,45459,45460,45464,45468,45480,45516,45520,45524,45532,45533,53294,53295,53296,53297,53298,53299,53302,53303,53305,53306,53307,53309,53310,53311,53312,53313,53314,53315,53318,53320,53322,53323,53324,53325,53326,53327,null,null,null,null,null,null,53329,53330,53331,53333,53334,53335,53337,53338,53339,53340,53341,53342,53343,53345,53346,53347,53348,53349,53350,53351,53352,53353,53354,53355,53358,53359,null,null,null,null,null,null,53361,53362,53363,53365,53366,53367,53368,53369,53370,53371,53374,53375,53376,53378,53379,53380,53381,53382,53383,53384,53385,53386,53387,53388,53389,53390,53391,53392,53393,53394,53395,53396,45535,45544,45545,45548,45552,45561,45563,45565,45572,45573,45576,45579,45580,45588,45589,45591,45593,45600,45620,45628,45656,45660,45664,45672,45673,45684,45685,45692,45700,45701,45705,45712,45713,45716,45720,45721,45722,45728,45729,45731,45733,45734,45738,45740,45744,45748,45768,45769,45772,45776,45778,45784,45785,45787,45789,45794,45796,45797,45798,45800,45803,45804,45805,45806,45807,45811,45812,45813,45815,45816,45817,45818,45819,45823,45824,45825,45828,45832,45840,45841,45843,45844,45845,45852,45908,45909,45910,45912,45915,45916,45918,45919,45924,45925,53397,53398,53399,53400,53401,53402,53403,53404,53405,53406,53407,53408,53409,53410,53411,53414,53415,53417,53418,53419,53421,53422,53423,53424,53425,53426,null,null,null,null,null,null,53427,53430,53432,53434,53435,53436,53437,53438,53439,53442,53443,53445,53446,53447,53450,53451,53452,53453,53454,53455,53458,53462,53463,53464,53465,53466,null,null,null,null,null,null,53467,53470,53471,53473,53474,53475,53477,53478,53479,53480,53481,53482,53483,53486,53490,53491,53492,53493,53494,53495,53497,53498,53499,53500,53501,53502,53503,53504,53505,53506,53507,53508,45927,45929,45931,45934,45936,45937,45940,45944,45952,45953,45955,45956,45957,45964,45968,45972,45984,45985,45992,45996,46020,46021,46024,46027,46028,46030,46032,46036,46037,46039,46041,46043,46045,46048,46052,46056,46076,46096,46104,46108,46112,46120,46121,46123,46132,46160,46161,46164,46168,46176,46177,46179,46181,46188,46208,46216,46237,46244,46248,46252,46261,46263,46265,46272,46276,46280,46288,46293,46300,46301,46304,46307,46308,46310,46316,46317,46319,46321,46328,46356,46357,46360,46363,46364,46372,46373,46375,46376,46377,46378,46384,46385,46388,46392,53509,53510,53511,53512,53513,53514,53515,53516,53518,53519,53520,53521,53522,53523,53524,53525,53526,53527,53528,53529,53530,53531,53532,53533,53534,53535,null,null,null,null,null,null,53536,53537,53538,53539,53540,53541,53542,53543,53544,53545,53546,53547,53548,53549,53550,53551,53554,53555,53557,53558,53559,53561,53563,53564,53565,53566,null,null,null,null,null,null,53567,53570,53574,53575,53576,53577,53578,53579,53582,53583,53585,53586,53587,53589,53590,53591,53592,53593,53594,53595,53598,53600,53602,53603,53604,53605,53606,53607,53609,53610,53611,53613,46400,46401,46403,46404,46405,46411,46412,46413,46416,46420,46428,46429,46431,46432,46433,46496,46497,46500,46504,46506,46507,46512,46513,46515,46516,46517,46523,46524,46525,46528,46532,46540,46541,46543,46544,46545,46552,46572,46608,46609,46612,46616,46629,46636,46644,46664,46692,46696,46748,46749,46752,46756,46763,46764,46769,46804,46832,46836,46840,46848,46849,46853,46888,46889,46892,46895,46896,46904,46905,46907,46916,46920,46924,46932,46933,46944,46948,46952,46960,46961,46963,46965,46972,46973,46976,46980,46988,46989,46991,46992,46993,46994,46998,46999,53614,53615,53616,53617,53618,53619,53620,53621,53622,53623,53624,53625,53626,53627,53629,53630,53631,53632,53633,53634,53635,53637,53638,53639,53641,53642,null,null,null,null,null,null,53643,53644,53645,53646,53647,53648,53649,53650,53651,53652,53653,53654,53655,53656,53657,53658,53659,53660,53661,53662,53663,53666,53667,53669,53670,53671,null,null,null,null,null,null,53673,53674,53675,53676,53677,53678,53679,53682,53684,53686,53687,53688,53689,53691,53693,53694,53695,53697,53698,53699,53700,53701,53702,53703,53704,53705,53706,53707,53708,53709,53710,53711,47000,47001,47004,47008,47016,47017,47019,47020,47021,47028,47029,47032,47047,47049,47084,47085,47088,47092,47100,47101,47103,47104,47105,47111,47112,47113,47116,47120,47128,47129,47131,47133,47140,47141,47144,47148,47156,47157,47159,47160,47161,47168,47172,47185,47187,47196,47197,47200,47204,47212,47213,47215,47217,47224,47228,47245,47272,47280,47284,47288,47296,47297,47299,47301,47308,47312,47316,47325,47327,47329,47336,47337,47340,47344,47352,47353,47355,47357,47364,47384,47392,47420,47421,47424,47428,47436,47439,47441,47448,47449,47452,47456,47464,47465,53712,53713,53714,53715,53716,53717,53718,53719,53721,53722,53723,53724,53725,53726,53727,53728,53729,53730,53731,53732,53733,53734,53735,53736,53737,53738,null,null,null,null,null,null,53739,53740,53741,53742,53743,53744,53745,53746,53747,53749,53750,53751,53753,53754,53755,53756,53757,53758,53759,53760,53761,53762,53763,53764,53765,53766,null,null,null,null,null,null,53768,53770,53771,53772,53773,53774,53775,53777,53778,53779,53780,53781,53782,53783,53784,53785,53786,53787,53788,53789,53790,53791,53792,53793,53794,53795,53796,53797,53798,53799,53800,53801,47467,47469,47476,47477,47480,47484,47492,47493,47495,47497,47498,47501,47502,47532,47533,47536,47540,47548,47549,47551,47553,47560,47561,47564,47566,47567,47568,47569,47570,47576,47577,47579,47581,47582,47585,47587,47588,47589,47592,47596,47604,47605,47607,47608,47609,47610,47616,47617,47624,47637,47672,47673,47676,47680,47682,47688,47689,47691,47693,47694,47699,47700,47701,47704,47708,47716,47717,47719,47720,47721,47728,47729,47732,47736,47747,47748,47749,47751,47756,47784,47785,47787,47788,47792,47794,47800,47801,47803,47805,47812,47816,47832,47833,47868,53802,53803,53806,53807,53809,53810,53811,53813,53814,53815,53816,53817,53818,53819,53822,53824,53826,53827,53828,53829,53830,53831,53833,53834,53835,53836,null,null,null,null,null,null,53837,53838,53839,53840,53841,53842,53843,53844,53845,53846,53847,53848,53849,53850,53851,53853,53854,53855,53856,53857,53858,53859,53861,53862,53863,53864,null,null,null,null,null,null,53865,53866,53867,53868,53869,53870,53871,53872,53873,53874,53875,53876,53877,53878,53879,53880,53881,53882,53883,53884,53885,53886,53887,53890,53891,53893,53894,53895,53897,53898,53899,53900,47872,47876,47885,47887,47889,47896,47900,47904,47913,47915,47924,47925,47926,47928,47931,47932,47933,47934,47940,47941,47943,47945,47949,47951,47952,47956,47960,47969,47971,47980,48008,48012,48016,48036,48040,48044,48052,48055,48064,48068,48072,48080,48083,48120,48121,48124,48127,48128,48130,48136,48137,48139,48140,48141,48143,48145,48148,48149,48150,48151,48152,48155,48156,48157,48158,48159,48164,48165,48167,48169,48173,48176,48177,48180,48184,48192,48193,48195,48196,48197,48201,48204,48205,48208,48221,48260,48261,48264,48267,48268,48270,48276,48277,48279,53901,53902,53903,53906,53907,53908,53910,53911,53912,53913,53914,53915,53917,53918,53919,53921,53922,53923,53925,53926,53927,53928,53929,53930,53931,53933,null,null,null,null,null,null,53934,53935,53936,53938,53939,53940,53941,53942,53943,53946,53947,53949,53950,53953,53955,53956,53957,53958,53959,53962,53964,53965,53966,53967,53968,53969,null,null,null,null,null,null,53970,53971,53973,53974,53975,53977,53978,53979,53981,53982,53983,53984,53985,53986,53987,53990,53991,53992,53993,53994,53995,53996,53997,53998,53999,54002,54003,54005,54006,54007,54009,54010,48281,48282,48288,48289,48292,48295,48296,48304,48305,48307,48308,48309,48316,48317,48320,48324,48333,48335,48336,48337,48341,48344,48348,48372,48373,48374,48376,48380,48388,48389,48391,48393,48400,48404,48420,48428,48448,48456,48457,48460,48464,48472,48473,48484,48488,48512,48513,48516,48519,48520,48521,48522,48528,48529,48531,48533,48537,48538,48540,48548,48560,48568,48596,48597,48600,48604,48617,48624,48628,48632,48640,48643,48645,48652,48653,48656,48660,48668,48669,48671,48708,48709,48712,48716,48718,48724,48725,48727,48729,48730,48731,48736,48737,48740,54011,54012,54013,54014,54015,54018,54020,54022,54023,54024,54025,54026,54027,54031,54033,54034,54035,54037,54039,54040,54041,54042,54043,54046,54050,54051,null,null,null,null,null,null,54052,54054,54055,54058,54059,54061,54062,54063,54065,54066,54067,54068,54069,54070,54071,54074,54078,54079,54080,54081,54082,54083,54086,54087,54088,54089,null,null,null,null,null,null,54090,54091,54092,54093,54094,54095,54096,54097,54098,54099,54100,54101,54102,54103,54104,54105,54106,54107,54108,54109,54110,54111,54112,54113,54114,54115,54116,54117,54118,54119,54120,54121,48744,48746,48752,48753,48755,48756,48757,48763,48764,48765,48768,48772,48780,48781,48783,48784,48785,48792,48793,48808,48848,48849,48852,48855,48856,48864,48867,48868,48869,48876,48897,48904,48905,48920,48921,48923,48924,48925,48960,48961,48964,48968,48976,48977,48981,49044,49072,49093,49100,49101,49104,49108,49116,49119,49121,49212,49233,49240,49244,49248,49256,49257,49296,49297,49300,49304,49312,49313,49315,49317,49324,49325,49327,49328,49331,49332,49333,49334,49340,49341,49343,49344,49345,49349,49352,49353,49356,49360,49368,49369,49371,49372,49373,49380,54122,54123,54124,54125,54126,54127,54128,54129,54130,54131,54132,54133,54134,54135,54136,54137,54138,54139,54142,54143,54145,54146,54147,54149,54150,54151,null,null,null,null,null,null,54152,54153,54154,54155,54158,54162,54163,54164,54165,54166,54167,54170,54171,54173,54174,54175,54177,54178,54179,54180,54181,54182,54183,54186,54188,54190,null,null,null,null,null,null,54191,54192,54193,54194,54195,54197,54198,54199,54201,54202,54203,54205,54206,54207,54208,54209,54210,54211,54214,54215,54218,54219,54220,54221,54222,54223,54225,54226,54227,54228,54229,54230,49381,49384,49388,49396,49397,49399,49401,49408,49412,49416,49424,49429,49436,49437,49438,49439,49440,49443,49444,49446,49447,49452,49453,49455,49456,49457,49462,49464,49465,49468,49472,49480,49481,49483,49484,49485,49492,49493,49496,49500,49508,49509,49511,49512,49513,49520,49524,49528,49541,49548,49549,49550,49552,49556,49558,49564,49565,49567,49569,49573,49576,49577,49580,49584,49597,49604,49608,49612,49620,49623,49624,49632,49636,49640,49648,49649,49651,49660,49661,49664,49668,49676,49677,49679,49681,49688,49689,49692,49695,49696,49704,49705,49707,49709,54231,54233,54234,54235,54236,54237,54238,54239,54240,54242,54244,54245,54246,54247,54248,54249,54250,54251,54254,54255,54257,54258,54259,54261,54262,54263,null,null,null,null,null,null,54264,54265,54266,54267,54270,54272,54274,54275,54276,54277,54278,54279,54281,54282,54283,54284,54285,54286,54287,54288,54289,54290,54291,54292,54293,54294,null,null,null,null,null,null,54295,54296,54297,54298,54299,54300,54302,54303,54304,54305,54306,54307,54308,54309,54310,54311,54312,54313,54314,54315,54316,54317,54318,54319,54320,54321,54322,54323,54324,54325,54326,54327,49711,49713,49714,49716,49736,49744,49745,49748,49752,49760,49765,49772,49773,49776,49780,49788,49789,49791,49793,49800,49801,49808,49816,49819,49821,49828,49829,49832,49836,49837,49844,49845,49847,49849,49884,49885,49888,49891,49892,49899,49900,49901,49903,49905,49910,49912,49913,49915,49916,49920,49928,49929,49932,49933,49939,49940,49941,49944,49948,49956,49957,49960,49961,49989,50024,50025,50028,50032,50034,50040,50041,50044,50045,50052,50056,50060,50112,50136,50137,50140,50143,50144,50146,50152,50153,50157,50164,50165,50168,50184,50192,50212,50220,50224,54328,54329,54330,54331,54332,54333,54334,54335,54337,54338,54339,54341,54342,54343,54344,54345,54346,54347,54348,54349,54350,54351,54352,54353,54354,54355,null,null,null,null,null,null,54356,54357,54358,54359,54360,54361,54362,54363,54365,54366,54367,54369,54370,54371,54373,54374,54375,54376,54377,54378,54379,54380,54382,54384,54385,54386,null,null,null,null,null,null,54387,54388,54389,54390,54391,54394,54395,54397,54398,54401,54403,54404,54405,54406,54407,54410,54412,54414,54415,54416,54417,54418,54419,54421,54422,54423,54424,54425,54426,54427,54428,54429,50228,50236,50237,50248,50276,50277,50280,50284,50292,50293,50297,50304,50324,50332,50360,50364,50409,50416,50417,50420,50424,50426,50431,50432,50433,50444,50448,50452,50460,50472,50473,50476,50480,50488,50489,50491,50493,50500,50501,50504,50505,50506,50508,50509,50510,50515,50516,50517,50519,50520,50521,50525,50526,50528,50529,50532,50536,50544,50545,50547,50548,50549,50556,50557,50560,50564,50567,50572,50573,50575,50577,50581,50583,50584,50588,50592,50601,50612,50613,50616,50617,50619,50620,50621,50622,50628,50629,50630,50631,50632,50633,50634,50636,50638,54430,54431,54432,54433,54434,54435,54436,54437,54438,54439,54440,54442,54443,54444,54445,54446,54447,54448,54449,54450,54451,54452,54453,54454,54455,54456,null,null,null,null,null,null,54457,54458,54459,54460,54461,54462,54463,54464,54465,54466,54467,54468,54469,54470,54471,54472,54473,54474,54475,54477,54478,54479,54481,54482,54483,54485,null,null,null,null,null,null,54486,54487,54488,54489,54490,54491,54493,54494,54496,54497,54498,54499,54500,54501,54502,54503,54505,54506,54507,54509,54510,54511,54513,54514,54515,54516,54517,54518,54519,54521,54522,54524,50640,50641,50644,50648,50656,50657,50659,50661,50668,50669,50670,50672,50676,50678,50679,50684,50685,50686,50687,50688,50689,50693,50694,50695,50696,50700,50704,50712,50713,50715,50716,50724,50725,50728,50732,50733,50734,50736,50739,50740,50741,50743,50745,50747,50752,50753,50756,50760,50768,50769,50771,50772,50773,50780,50781,50784,50796,50799,50801,50808,50809,50812,50816,50824,50825,50827,50829,50836,50837,50840,50844,50852,50853,50855,50857,50864,50865,50868,50872,50873,50874,50880,50881,50883,50885,50892,50893,50896,50900,50908,50909,50912,50913,50920,54526,54527,54528,54529,54530,54531,54533,54534,54535,54537,54538,54539,54541,54542,54543,54544,54545,54546,54547,54550,54552,54553,54554,54555,54556,54557,null,null,null,null,null,null,54558,54559,54560,54561,54562,54563,54564,54565,54566,54567,54568,54569,54570,54571,54572,54573,54574,54575,54576,54577,54578,54579,54580,54581,54582,54583,null,null,null,null,null,null,54584,54585,54586,54587,54590,54591,54593,54594,54595,54597,54598,54599,54600,54601,54602,54603,54606,54608,54610,54611,54612,54613,54614,54615,54618,54619,54621,54622,54623,54625,54626,54627,50921,50924,50928,50936,50937,50941,50948,50949,50952,50956,50964,50965,50967,50969,50976,50977,50980,50984,50992,50993,50995,50997,50999,51004,51005,51008,51012,51018,51020,51021,51023,51025,51026,51027,51028,51029,51030,51031,51032,51036,51040,51048,51051,51060,51061,51064,51068,51069,51070,51075,51076,51077,51079,51080,51081,51082,51086,51088,51089,51092,51094,51095,51096,51098,51104,51105,51107,51108,51109,51110,51116,51117,51120,51124,51132,51133,51135,51136,51137,51144,51145,51148,51150,51152,51160,51165,51172,51176,51180,51200,51201,51204,51208,51210,54628,54630,54631,54634,54636,54638,54639,54640,54641,54642,54643,54646,54647,54649,54650,54651,54653,54654,54655,54656,54657,54658,54659,54662,54666,54667,null,null,null,null,null,null,54668,54669,54670,54671,54673,54674,54675,54676,54677,54678,54679,54680,54681,54682,54683,54684,54685,54686,54687,54688,54689,54690,54691,54692,54694,54695,null,null,null,null,null,null,54696,54697,54698,54699,54700,54701,54702,54703,54704,54705,54706,54707,54708,54709,54710,54711,54712,54713,54714,54715,54716,54717,54718,54719,54720,54721,54722,54723,54724,54725,54726,54727,51216,51217,51219,51221,51222,51228,51229,51232,51236,51244,51245,51247,51249,51256,51260,51264,51272,51273,51276,51277,51284,51312,51313,51316,51320,51322,51328,51329,51331,51333,51334,51335,51339,51340,51341,51348,51357,51359,51361,51368,51388,51389,51396,51400,51404,51412,51413,51415,51417,51424,51425,51428,51445,51452,51453,51456,51460,51461,51462,51468,51469,51471,51473,51480,51500,51508,51536,51537,51540,51544,51552,51553,51555,51564,51568,51572,51580,51592,51593,51596,51600,51608,51609,51611,51613,51648,51649,51652,51655,51656,51658,51664,51665,51667,54730,54731,54733,54734,54735,54737,54739,54740,54741,54742,54743,54746,54748,54750,54751,54752,54753,54754,54755,54758,54759,54761,54762,54763,54765,54766,null,null,null,null,null,null,54767,54768,54769,54770,54771,54774,54776,54778,54779,54780,54781,54782,54783,54786,54787,54789,54790,54791,54793,54794,54795,54796,54797,54798,54799,54802,null,null,null,null,null,null,54806,54807,54808,54809,54810,54811,54813,54814,54815,54817,54818,54819,54821,54822,54823,54824,54825,54826,54827,54828,54830,54831,54832,54833,54834,54835,54836,54837,54838,54839,54842,54843,51669,51670,51673,51674,51676,51677,51680,51682,51684,51687,51692,51693,51695,51696,51697,51704,51705,51708,51712,51720,51721,51723,51724,51725,51732,51736,51753,51788,51789,51792,51796,51804,51805,51807,51808,51809,51816,51837,51844,51864,51900,51901,51904,51908,51916,51917,51919,51921,51923,51928,51929,51936,51948,51956,51976,51984,51988,51992,52000,52001,52033,52040,52041,52044,52048,52056,52057,52061,52068,52088,52089,52124,52152,52180,52196,52199,52201,52236,52237,52240,52244,52252,52253,52257,52258,52263,52264,52265,52268,52270,52272,52280,52281,52283,54845,54846,54847,54849,54850,54851,54852,54854,54855,54858,54860,54862,54863,54864,54866,54867,54870,54871,54873,54874,54875,54877,54878,54879,54880,54881,null,null,null,null,null,null,54882,54883,54884,54885,54886,54888,54890,54891,54892,54893,54894,54895,54898,54899,54901,54902,54903,54904,54905,54906,54907,54908,54909,54910,54911,54912,null,null,null,null,null,null,54913,54914,54916,54918,54919,54920,54921,54922,54923,54926,54927,54929,54930,54931,54933,54934,54935,54936,54937,54938,54939,54940,54942,54944,54946,54947,54948,54949,54950,54951,54953,54954,52284,52285,52286,52292,52293,52296,52300,52308,52309,52311,52312,52313,52320,52324,52326,52328,52336,52341,52376,52377,52380,52384,52392,52393,52395,52396,52397,52404,52405,52408,52412,52420,52421,52423,52425,52432,52436,52452,52460,52464,52481,52488,52489,52492,52496,52504,52505,52507,52509,52516,52520,52524,52537,52572,52576,52580,52588,52589,52591,52593,52600,52616,52628,52629,52632,52636,52644,52645,52647,52649,52656,52676,52684,52688,52712,52716,52720,52728,52729,52731,52733,52740,52744,52748,52756,52761,52768,52769,52772,52776,52784,52785,52787,52789,54955,54957,54958,54959,54961,54962,54963,54964,54965,54966,54967,54968,54970,54972,54973,54974,54975,54976,54977,54978,54979,54982,54983,54985,54986,54987,null,null,null,null,null,null,54989,54990,54991,54992,54994,54995,54997,54998,55000,55002,55003,55004,55005,55006,55007,55009,55010,55011,55013,55014,55015,55017,55018,55019,55020,55021,null,null,null,null,null,null,55022,55023,55025,55026,55027,55028,55030,55031,55032,55033,55034,55035,55038,55039,55041,55042,55043,55045,55046,55047,55048,55049,55050,55051,55052,55053,55054,55055,55056,55058,55059,55060,52824,52825,52828,52831,52832,52833,52840,52841,52843,52845,52852,52853,52856,52860,52868,52869,52871,52873,52880,52881,52884,52888,52896,52897,52899,52900,52901,52908,52909,52929,52964,52965,52968,52971,52972,52980,52981,52983,52984,52985,52992,52993,52996,53000,53008,53009,53011,53013,53020,53024,53028,53036,53037,53039,53040,53041,53048,53076,53077,53080,53084,53092,53093,53095,53097,53104,53105,53108,53112,53120,53125,53132,53153,53160,53168,53188,53216,53217,53220,53224,53232,53233,53235,53237,53244,53248,53252,53265,53272,53293,53300,53301,53304,53308,55061,55062,55063,55066,55067,55069,55070,55071,55073,55074,55075,55076,55077,55078,55079,55082,55084,55086,55087,55088,55089,55090,55091,55094,55095,55097,null,null,null,null,null,null,55098,55099,55101,55102,55103,55104,55105,55106,55107,55109,55110,55112,55114,55115,55116,55117,55118,55119,55122,55123,55125,55130,55131,55132,55133,55134,null,null,null,null,null,null,55135,55138,55140,55142,55143,55144,55146,55147,55149,55150,55151,55153,55154,55155,55157,55158,55159,55160,55161,55162,55163,55166,55167,55168,55170,55171,55172,55173,55174,55175,55178,55179,53316,53317,53319,53321,53328,53332,53336,53344,53356,53357,53360,53364,53372,53373,53377,53412,53413,53416,53420,53428,53429,53431,53433,53440,53441,53444,53448,53449,53456,53457,53459,53460,53461,53468,53469,53472,53476,53484,53485,53487,53488,53489,53496,53517,53552,53553,53556,53560,53562,53568,53569,53571,53572,53573,53580,53581,53584,53588,53596,53597,53599,53601,53608,53612,53628,53636,53640,53664,53665,53668,53672,53680,53681,53683,53685,53690,53692,53696,53720,53748,53752,53767,53769,53776,53804,53805,53808,53812,53820,53821,53823,53825,53832,53852,55181,55182,55183,55185,55186,55187,55188,55189,55190,55191,55194,55196,55198,55199,55200,55201,55202,55203,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,53860,53888,53889,53892,53896,53904,53905,53909,53916,53920,53924,53932,53937,53944,53945,53948,53951,53952,53954,53960,53961,53963,53972,53976,53980,53988,53989,54000,54001,54004,54008,54016,54017,54019,54021,54028,54029,54030,54032,54036,54038,54044,54045,54047,54048,54049,54053,54056,54057,54060,54064,54072,54073,54075,54076,54077,54084,54085,54140,54141,54144,54148,54156,54157,54159,54160,54161,54168,54169,54172,54176,54184,54185,54187,54189,54196,54200,54204,54212,54213,54216,54217,54224,54232,54241,54243,54252,54253,54256,54260,54268,54269,54271,54273,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,54280,54301,54336,54340,54364,54368,54372,54381,54383,54392,54393,54396,54399,54400,54402,54408,54409,54411,54413,54420,54441,54476,54480,54484,54492,54495,54504,54508,54512,54520,54523,54525,54532,54536,54540,54548,54549,54551,54588,54589,54592,54596,54604,54605,54607,54609,54616,54617,54620,54624,54629,54632,54633,54635,54637,54644,54645,54648,54652,54660,54661,54663,54664,54665,54672,54693,54728,54729,54732,54736,54738,54744,54745,54747,54749,54756,54757,54760,54764,54772,54773,54775,54777,54784,54785,54788,54792,54800,54801,54803,54804,54805,54812,54816,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,54820,54829,54840,54841,54844,54848,54853,54856,54857,54859,54861,54865,54868,54869,54872,54876,54887,54889,54896,54897,54900,54915,54917,54924,54925,54928,54932,54941,54943,54945,54952,54956,54960,54969,54971,54980,54981,54984,54988,54993,54996,54999,55001,55008,55012,55016,55024,55029,55036,55037,55040,55044,55057,55064,55065,55068,55072,55080,55081,55083,55085,55092,55093,55096,55100,55108,55111,55113,55120,55121,55124,55126,55127,55128,55129,55136,55137,55139,55141,55145,55148,55152,55156,55164,55165,55169,55176,55177,55180,55184,55192,55193,55195,55197,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20285,20339,20551,20729,21152,21487,21621,21733,22025,23233,23478,26247,26550,26551,26607,27468,29634,30146,31292,33499,33540,34903,34952,35382,36040,36303,36603,36838,39381,21051,21364,21508,24682,24932,27580,29647,33050,35258,35282,38307,20355,21002,22718,22904,23014,24178,24185,25031,25536,26438,26604,26751,28567,30286,30475,30965,31240,31487,31777,32925,33390,33393,35563,38291,20075,21917,26359,28212,30883,31469,33883,35088,34638,38824,21208,22350,22570,23884,24863,25022,25121,25954,26577,27204,28187,29976,30131,30435,30640,32058,37039,37969,37970,40853,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21283,23724,30002,32987,37440,38296,21083,22536,23004,23713,23831,24247,24378,24394,24951,27743,30074,30086,31968,32115,32177,32652,33108,33313,34193,35137,35611,37628,38477,40007,20171,20215,20491,20977,22607,24887,24894,24936,25913,27114,28433,30117,30342,30422,31623,33445,33995,63744,37799,38283,21888,23458,22353,63745,31923,32697,37301,20520,21435,23621,24040,25298,25454,25818,25831,28192,28844,31067,36317,36382,63746,36989,37445,37624,20094,20214,20581,24062,24314,24838,26967,33137,34388,36423,37749,39467,20062,20625,26480,26688,20745,21133,21138,27298,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30652,37392,40660,21163,24623,36850,20552,25001,25581,25802,26684,27268,28608,33160,35233,38548,22533,29309,29356,29956,32121,32365,32937,35211,35700,36963,40273,25225,27770,28500,32080,32570,35363,20860,24906,31645,35609,37463,37772,20140,20435,20510,20670,20742,21185,21197,21375,22384,22659,24218,24465,24950,25004,25806,25964,26223,26299,26356,26775,28039,28805,28913,29855,29861,29898,30169,30828,30956,31455,31478,32069,32147,32789,32831,33051,33686,35686,36629,36885,37857,38915,38968,39514,39912,20418,21843,22586,22865,23395,23622,24760,25106,26690,26800,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26856,28330,30028,30328,30926,31293,31995,32363,32380,35336,35489,35903,38542,40388,21476,21481,21578,21617,22266,22993,23396,23611,24235,25335,25911,25925,25970,26272,26543,27073,27837,30204,30352,30590,31295,32660,32771,32929,33167,33510,33533,33776,34241,34865,34996,35493,63747,36764,37678,38599,39015,39640,40723,21741,26011,26354,26767,31296,35895,40288,22256,22372,23825,26118,26801,26829,28414,29736,34974,39908,27752,63748,39592,20379,20844,20849,21151,23380,24037,24656,24685,25329,25511,25915,29657,31354,34467,36002,38799,20018,23521,25096,26524,29916,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31185,33747,35463,35506,36328,36942,37707,38982,24275,27112,34303,37101,63749,20896,23448,23532,24931,26874,27454,28748,29743,29912,31649,32592,33733,35264,36011,38364,39208,21038,24669,25324,36866,20362,20809,21281,22745,24291,26336,27960,28826,29378,29654,31568,33009,37979,21350,25499,32619,20054,20608,22602,22750,24618,24871,25296,27088,39745,23439,32024,32945,36703,20132,20689,21676,21932,23308,23968,24039,25898,25934,26657,27211,29409,30350,30703,32094,32761,33184,34126,34527,36611,36686,37066,39171,39509,39851,19992,20037,20061,20167,20465,20855,21246,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21312,21475,21477,21646,22036,22389,22434,23495,23943,24272,25084,25304,25937,26552,26601,27083,27472,27590,27628,27714,28317,28792,29399,29590,29699,30655,30697,31350,32127,32777,33276,33285,33290,33503,34914,35635,36092,36544,36881,37041,37476,37558,39378,39493,40169,40407,40860,22283,23616,33738,38816,38827,40628,21531,31384,32676,35033,36557,37089,22528,23624,25496,31391,23470,24339,31353,31406,33422,36524,20518,21048,21240,21367,22280,25331,25458,27402,28099,30519,21413,29527,34152,36470,38357,26426,27331,28528,35437,36556,39243,63750,26231,27512,36020,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,39740,63751,21483,22317,22862,25542,27131,29674,30789,31418,31429,31998,33909,35215,36211,36917,38312,21243,22343,30023,31584,33740,37406,63752,27224,20811,21067,21127,25119,26840,26997,38553,20677,21156,21220,25027,26020,26681,27135,29822,31563,33465,33771,35250,35641,36817,39241,63753,20170,22935,25810,26129,27278,29748,31105,31165,33449,34942,34943,35167,63754,37670,20235,21450,24613,25201,27762,32026,32102,20120,20834,30684,32943,20225,20238,20854,20864,21980,22120,22331,22522,22524,22804,22855,22931,23492,23696,23822,24049,24190,24524,25216,26071,26083,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26398,26399,26462,26827,26820,27231,27450,27683,27773,27778,28103,29592,29734,29738,29826,29859,30072,30079,30849,30959,31041,31047,31048,31098,31637,32000,32186,32648,32774,32813,32908,35352,35663,35912,36215,37665,37668,39138,39249,39438,39439,39525,40594,32202,20342,21513,25326,26708,37329,21931,20794,63755,63756,23068,25062,63757,25295,25343,63758,63759,63760,63761,63762,63763,37027,63764,63765,63766,63767,63768,35582,63769,63770,63771,63772,26262,63773,29014,63774,63775,38627,63776,25423,25466,21335,63777,26511,26976,28275,63778,30007,63779,63780,63781,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32013,63782,63783,34930,22218,23064,63784,63785,63786,63787,63788,20035,63789,20839,22856,26608,32784,63790,22899,24180,25754,31178,24565,24684,25288,25467,23527,23511,21162,63791,22900,24361,24594,63792,63793,63794,29785,63795,63796,63797,63798,63799,63800,39377,63801,63802,63803,63804,63805,63806,63807,63808,63809,63810,63811,28611,63812,63813,33215,36786,24817,63814,63815,33126,63816,63817,23615,63818,63819,63820,63821,63822,63823,63824,63825,23273,35365,26491,32016,63826,63827,63828,63829,63830,63831,33021,63832,63833,23612,27877,21311,28346,22810,33590,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20025,20150,20294,21934,22296,22727,24406,26039,26086,27264,27573,28237,30701,31471,31774,32222,34507,34962,37170,37723,25787,28606,29562,30136,36948,21846,22349,25018,25812,26311,28129,28251,28525,28601,30192,32835,33213,34113,35203,35527,35674,37663,27795,30035,31572,36367,36957,21776,22530,22616,24162,25095,25758,26848,30070,31958,34739,40680,20195,22408,22382,22823,23565,23729,24118,24453,25140,25825,29619,33274,34955,36024,38538,40667,23429,24503,24755,20498,20992,21040,22294,22581,22615,23566,23648,23798,23947,24230,24466,24764,25361,25481,25623,26691,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26873,27330,28120,28193,28372,28644,29182,30428,30585,31153,31291,33796,35241,36077,36339,36424,36867,36884,36947,37117,37709,38518,38876,27602,28678,29272,29346,29544,30563,31167,31716,32411,35712,22697,24775,25958,26109,26302,27788,28958,29129,35930,38931,20077,31361,20189,20908,20941,21205,21516,24999,26481,26704,26847,27934,28540,30140,30643,31461,33012,33891,37509,20828,26007,26460,26515,30168,31431,33651,63834,35910,36887,38957,23663,33216,33434,36929,36975,37389,24471,23965,27225,29128,30331,31561,34276,35588,37159,39472,21895,25078,63835,30313,32645,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,34367,34746,35064,37007,63836,27931,28889,29662,32097,33853,63837,37226,39409,63838,20098,21365,27396,27410,28734,29211,34349,40478,21068,36771,23888,25829,25900,27414,28651,31811,32412,34253,35172,35261,25289,33240,34847,24266,26391,28010,29436,29701,29807,34690,37086,20358,23821,24480,33802,20919,25504,30053,20142,20486,20841,20937,26753,27153,31918,31921,31975,33391,35538,36635,37327,20406,20791,21237,21570,24300,24942,25150,26053,27354,28670,31018,34268,34851,38317,39522,39530,40599,40654,21147,26310,27511,28701,31019,36706,38722,24976,25088,25891,28451,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29001,29833,32244,32879,34030,36646,36899,37706,20925,21015,21155,27916,28872,35010,24265,25986,27566,28610,31806,29557,20196,20278,22265,63839,23738,23994,24604,29618,31533,32666,32718,32838,36894,37428,38646,38728,38936,40801,20363,28583,31150,37300,38583,21214,63840,25736,25796,27347,28510,28696,29200,30439,32769,34310,34396,36335,36613,38706,39791,40442,40565,30860,31103,32160,33737,37636,40575,40595,35542,22751,24324,26407,28711,29903,31840,32894,20769,28712,29282,30922,36034,36058,36084,38647,20102,20698,23534,24278,26009,29134,30274,30637,32842,34044,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36988,39719,40845,22744,23105,23650,27155,28122,28431,30267,32047,32311,34078,35128,37860,38475,21129,26066,26611,27060,27969,28316,28687,29705,29792,30041,30244,30827,35628,39006,20845,25134,38520,20374,20523,23833,28138,32184,36650,24459,24900,26647,63841,38534,21202,32907,20956,20940,26974,31260,32190,33777,38517,20442,21033,21400,21519,21774,23653,24743,26446,26792,28012,29313,29432,29702,29827,63842,30178,31852,32633,32696,33673,35023,35041,37324,37328,38626,39881,21533,28542,29136,29848,34298,36522,38563,40023,40607,26519,28107,29747,33256,38678,30764,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31435,31520,31890,25705,29802,30194,30908,30952,39340,39764,40635,23518,24149,28448,33180,33707,37000,19975,21325,23081,24018,24398,24930,25405,26217,26364,28415,28459,28771,30622,33836,34067,34875,36627,39237,39995,21788,25273,26411,27819,33545,35178,38778,20129,22916,24536,24537,26395,32178,32596,33426,33579,33725,36638,37017,22475,22969,23186,23504,26151,26522,26757,27599,29028,32629,36023,36067,36993,39749,33032,35978,38476,39488,40613,23391,27667,29467,30450,30431,33804,20906,35219,20813,20885,21193,26825,27796,30468,30496,32191,32236,38754,40629,28357,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,34065,20901,21517,21629,26126,26269,26919,28319,30399,30609,33559,33986,34719,37225,37528,40180,34946,20398,20882,21215,22982,24125,24917,25720,25721,26286,26576,27169,27597,27611,29279,29281,29761,30520,30683,32791,33468,33541,35584,35624,35980,26408,27792,29287,30446,30566,31302,40361,27519,27794,22818,26406,33945,21359,22675,22937,24287,25551,26164,26483,28218,29483,31447,33495,37672,21209,24043,25006,25035,25098,25287,25771,26080,26969,27494,27595,28961,29687,30045,32326,33310,33538,34154,35491,36031,38695,40289,22696,40664,20497,21006,21563,21839,25991,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,27766,32010,32011,32862,34442,38272,38639,21247,27797,29289,21619,23194,23614,23883,24396,24494,26410,26806,26979,28220,28228,30473,31859,32654,34183,35598,36855,38753,40692,23735,24758,24845,25003,25935,26107,26108,27665,27887,29599,29641,32225,38292,23494,34588,35600,21085,21338,25293,25615,25778,26420,27192,27850,29632,29854,31636,31893,32283,33162,33334,34180,36843,38649,39361,20276,21322,21453,21467,25292,25644,25856,26001,27075,27886,28504,29677,30036,30242,30436,30460,30928,30971,31020,32070,33324,34784,36820,38930,39151,21187,25300,25765,28196,28497,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30332,36299,37297,37474,39662,39747,20515,20621,22346,22952,23592,24135,24439,25151,25918,26041,26049,26121,26507,27036,28354,30917,32033,32938,33152,33323,33459,33953,34444,35370,35607,37030,38450,40848,20493,20467,63843,22521,24472,25308,25490,26479,28227,28953,30403,32972,32986,35060,35061,35097,36064,36649,37197,38506,20271,20336,24091,26575,26658,30333,30334,39748,24161,27146,29033,29140,30058,63844,32321,34115,34281,39132,20240,31567,32624,38309,20961,24070,26805,27710,27726,27867,29359,31684,33539,27861,29754,20731,21128,22721,25816,27287,29863,30294,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30887,34327,38370,38713,63845,21342,24321,35722,36776,36783,37002,21029,30629,40009,40712,19993,20482,20853,23643,24183,26142,26170,26564,26821,28851,29953,30149,31177,31453,36647,39200,39432,20445,22561,22577,23542,26222,27493,27921,28282,28541,29668,29995,33769,35036,35091,35676,36628,20239,20693,21264,21340,23443,24489,26381,31119,33145,33583,34068,35079,35206,36665,36667,39333,39954,26412,20086,20472,22857,23553,23791,23792,25447,26834,28925,29090,29739,32299,34028,34562,36898,37586,40179,19981,20184,20463,20613,21078,21103,21542,21648,22496,22827,23142,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,23386,23413,23500,24220,63846,25206,25975,26023,28014,28325,29238,31526,31807,32566,33104,33105,33178,33344,33433,33705,35331,36000,36070,36091,36212,36282,37096,37340,38428,38468,39385,40167,21271,20998,21545,22132,22707,22868,22894,24575,24996,25198,26128,27774,28954,30406,31881,31966,32027,33452,36033,38640,63847,20315,24343,24447,25282,23849,26379,26842,30844,32323,40300,19989,20633,21269,21290,21329,22915,23138,24199,24754,24970,25161,25209,26000,26503,27047,27604,27606,27607,27608,27832,63848,29749,30202,30738,30865,31189,31192,31875,32203,32737,32933,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,33086,33218,33778,34586,35048,35513,35692,36027,37145,38750,39131,40763,22188,23338,24428,25996,27315,27567,27996,28657,28693,29277,29613,36007,36051,38971,24977,27703,32856,39425,20045,20107,20123,20181,20282,20284,20351,20447,20735,21490,21496,21766,21987,22235,22763,22882,23057,23531,23546,23556,24051,24107,24473,24605,25448,26012,26031,26614,26619,26797,27515,27801,27863,28195,28681,29509,30722,31038,31040,31072,31169,31721,32023,32114,32902,33293,33678,34001,34503,35039,35408,35422,35613,36060,36198,36781,37034,39164,39391,40605,21066,63849,26388,63850,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20632,21034,23665,25955,27733,29642,29987,30109,31639,33948,37240,38704,20087,25746,27578,29022,34217,19977,63851,26441,26862,28183,33439,34072,34923,25591,28545,37394,39087,19978,20663,20687,20767,21830,21930,22039,23360,23577,23776,24120,24202,24224,24258,24819,26705,27233,28248,29245,29248,29376,30456,31077,31665,32724,35059,35316,35443,35937,36062,38684,22622,29885,36093,21959,63852,31329,32034,33394,29298,29983,29989,63853,31513,22661,22779,23996,24207,24246,24464,24661,25234,25471,25933,26257,26329,26360,26646,26866,29312,29790,31598,32110,32214,32626,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32997,33298,34223,35199,35475,36893,37604,40653,40736,22805,22893,24109,24796,26132,26227,26512,27728,28101,28511,30707,30889,33990,37323,37675,20185,20682,20808,21892,23307,23459,25159,25982,26059,28210,29053,29697,29764,29831,29887,30316,31146,32218,32341,32680,33146,33203,33337,34330,34796,35445,36323,36984,37521,37925,39245,39854,21352,23633,26964,27844,27945,28203,33292,34203,35131,35373,35498,38634,40807,21089,26297,27570,32406,34814,36109,38275,38493,25885,28041,29166,63854,22478,22995,23468,24615,24826,25104,26143,26207,29481,29689,30427,30465,31596,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32854,32882,33125,35488,37266,19990,21218,27506,27927,31237,31545,32048,63855,36016,21484,22063,22609,23477,23567,23569,24034,25152,25475,25620,26157,26803,27836,28040,28335,28703,28836,29138,29990,30095,30094,30233,31505,31712,31787,32032,32057,34092,34157,34311,35380,36877,36961,37045,37559,38902,39479,20439,23660,26463,28049,31903,32396,35606,36118,36895,23403,24061,25613,33984,36956,39137,29575,23435,24730,26494,28126,35359,35494,36865,38924,21047,63856,28753,30862,37782,34928,37335,20462,21463,22013,22234,22402,22781,23234,23432,23723,23744,24101,24833,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,25101,25163,25480,25628,25910,25976,27193,27530,27700,27929,28465,29159,29417,29560,29703,29874,30246,30561,31168,31319,31466,31929,32143,32172,32353,32670,33065,33585,33936,34010,34282,34966,35504,35728,36664,36930,36995,37228,37526,37561,38539,38567,38568,38614,38656,38920,39318,39635,39706,21460,22654,22809,23408,23487,28113,28506,29087,29729,29881,32901,33789,24033,24455,24490,24642,26092,26642,26991,27219,27529,27957,28147,29667,30462,30636,31565,32020,33059,33308,33600,34036,34147,35426,35524,37255,37662,38918,39348,25100,34899,36848,37477,23815,23847,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,23913,29791,33181,34664,28629,25342,32722,35126,35186,19998,20056,20711,21213,21319,25215,26119,32361,34821,38494,20365,21273,22070,22987,23204,23608,23630,23629,24066,24337,24643,26045,26159,26178,26558,26612,29468,30690,31034,32709,33940,33997,35222,35430,35433,35553,35925,35962,22516,23508,24335,24687,25325,26893,27542,28252,29060,31698,34645,35672,36606,39135,39166,20280,20353,20449,21627,23072,23480,24892,26032,26216,29180,30003,31070,32051,33102,33251,33688,34218,34254,34563,35338,36523,36763,63857,36805,22833,23460,23526,24713,23529,23563,24515,27777,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63858,28145,28683,29978,33455,35574,20160,21313,63859,38617,27663,20126,20420,20818,21854,23077,23784,25105,29273,33469,33706,34558,34905,35357,38463,38597,39187,40201,40285,22538,23731,23997,24132,24801,24853,25569,27138,28197,37122,37716,38990,39952,40823,23433,23736,25353,26191,26696,30524,38593,38797,38996,39839,26017,35585,36555,38332,21813,23721,24022,24245,26263,30284,33780,38343,22739,25276,29390,40232,20208,22830,24591,26171,27523,31207,40230,21395,21696,22467,23830,24859,26326,28079,30861,33406,38552,38724,21380,25212,25494,28082,32266,33099,38989,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,27387,32588,40367,40474,20063,20539,20918,22812,24825,25590,26928,29242,32822,63860,37326,24369,63861,63862,32004,33509,33903,33979,34277,36493,63863,20335,63864,63865,22756,23363,24665,25562,25880,25965,26264,63866,26954,27171,27915,28673,29036,30162,30221,31155,31344,63867,32650,63868,35140,63869,35731,37312,38525,63870,39178,22276,24481,26044,28417,30208,31142,35486,39341,39770,40812,20740,25014,25233,27277,33222,20547,22576,24422,28937,35328,35578,23420,34326,20474,20796,22196,22852,25513,28153,23978,26989,20870,20104,20313,63871,63872,63873,22914,63874,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63875,27487,27741,63876,29877,30998,63877,33287,33349,33593,36671,36701,63878,39192,63879,63880,63881,20134,63882,22495,24441,26131,63883,63884,30123,32377,35695,63885,36870,39515,22181,22567,23032,23071,23476,63886,24310,63887,63888,25424,25403,63889,26941,27783,27839,28046,28051,28149,28436,63890,28895,28982,29017,63891,29123,29141,63892,30799,30831,63893,31605,32227,63894,32303,63895,34893,36575,63896,63897,63898,37467,63899,40182,63900,63901,63902,24709,28037,63903,29105,63904,63905,38321,21421,63906,63907,63908,26579,63909,28814,28976,29744,33398,33490,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63910,38331,39653,40573,26308,63911,29121,33865,63912,63913,22603,63914,63915,23992,24433,63916,26144,26254,27001,27054,27704,27891,28214,28481,28634,28699,28719,29008,29151,29552,63917,29787,63918,29908,30408,31310,32403,63919,63920,33521,35424,36814,63921,37704,63922,38681,63923,63924,20034,20522,63925,21000,21473,26355,27757,28618,29450,30591,31330,33454,34269,34306,63926,35028,35427,35709,35947,63927,37555,63928,38675,38928,20116,20237,20425,20658,21320,21566,21555,21978,22626,22714,22887,23067,23524,24735,63929,25034,25942,26111,26212,26791,27738,28595,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,28879,29100,29522,31613,34568,35492,39986,40711,23627,27779,29508,29577,37434,28331,29797,30239,31337,32277,34314,20800,22725,25793,29934,29973,30320,32705,37013,38605,39252,28198,29926,31401,31402,33253,34521,34680,35355,23113,23436,23451,26785,26880,28003,29609,29715,29740,30871,32233,32747,33048,33109,33694,35916,38446,38929,26352,24448,26106,26505,27754,29579,20525,23043,27498,30702,22806,23916,24013,29477,30031,63930,63931,20709,20985,22575,22829,22934,23002,23525,63932,63933,23970,25303,25622,25747,25854,63934,26332,63935,27208,63936,29183,29796,63937,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31368,31407,32327,32350,32768,33136,63938,34799,35201,35616,36953,63939,36992,39250,24958,27442,28020,32287,35109,36785,20433,20653,20887,21191,22471,22665,23481,24248,24898,27029,28044,28263,28342,29076,29794,29992,29996,32883,33592,33993,36362,37780,37854,63940,20110,20305,20598,20778,21448,21451,21491,23431,23507,23588,24858,24962,26100,29275,29591,29760,30402,31056,31121,31161,32006,32701,33419,34261,34398,36802,36935,37109,37354,38533,38632,38633,21206,24423,26093,26161,26671,29020,31286,37057,38922,20113,63941,27218,27550,28560,29065,32792,33464,34131,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36939,38549,38642,38907,34074,39729,20112,29066,38596,20803,21407,21729,22291,22290,22435,23195,23236,23491,24616,24895,25588,27781,27961,28274,28304,29232,29503,29783,33489,34945,36677,36960,63942,38498,39000,40219,26376,36234,37470,20301,20553,20702,21361,22285,22996,23041,23561,24944,26256,28205,29234,29771,32239,32963,33806,33894,34111,34655,34907,35096,35586,36949,38859,39759,20083,20369,20754,20842,63943,21807,21929,23418,23461,24188,24189,24254,24736,24799,24840,24841,25540,25912,26377,63944,26580,26586,63945,26977,26978,27833,27943,63946,28216,63947,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,28641,29494,29495,63948,29788,30001,63949,30290,63950,63951,32173,33278,33848,35029,35480,35547,35565,36400,36418,36938,36926,36986,37193,37321,37742,63952,63953,22537,63954,27603,32905,32946,63955,63956,20801,22891,23609,63957,63958,28516,29607,32996,36103,63959,37399,38287,63960,63961,63962,63963,32895,25102,28700,32104,34701,63964,22432,24681,24903,27575,35518,37504,38577,20057,21535,28139,34093,38512,38899,39150,25558,27875,37009,20957,25033,33210,40441,20381,20506,20736,23452,24847,25087,25836,26885,27589,30097,30691,32681,33380,34191,34811,34915,35516,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,35696,37291,20108,20197,20234,63965,63966,22839,23016,63967,24050,24347,24411,24609,63968,63969,63970,63971,29246,29669,63972,30064,30157,63973,31227,63974,32780,32819,32900,33505,33617,63975,63976,36029,36019,36999,63977,63978,39156,39180,63979,63980,28727,30410,32714,32716,32764,35610,20154,20161,20995,21360,63981,21693,22240,23035,23493,24341,24525,28270,63982,63983,32106,33589,63984,34451,35469,63985,38765,38775,63986,63987,19968,20314,20350,22777,26085,28322,36920,37808,39353,20219,22764,22922,23001,24641,63988,63989,31252,63990,33615,36035,20837,21316,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63991,63992,63993,20173,21097,23381,33471,20180,21050,21672,22985,23039,23376,23383,23388,24675,24904,28363,28825,29038,29574,29943,30133,30913,32043,32773,33258,33576,34071,34249,35566,36039,38604,20316,21242,22204,26027,26152,28796,28856,29237,32189,33421,37196,38592,40306,23409,26855,27544,28538,30430,23697,26283,28507,31668,31786,34870,38620,19976,20183,21280,22580,22715,22767,22892,23559,24115,24196,24373,25484,26290,26454,27167,27299,27404,28479,29254,63994,29520,29835,31456,31911,33144,33247,33255,33674,33900,34083,34196,34255,35037,36115,37292,38263,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38556,20877,21705,22312,23472,25165,26448,26685,26771,28221,28371,28797,32289,35009,36001,36617,40779,40782,29229,31631,35533,37658,20295,20302,20786,21632,22992,24213,25269,26485,26990,27159,27822,28186,29401,29482,30141,31672,32053,33511,33785,33879,34295,35419,36015,36487,36889,37048,38606,40799,21219,21514,23265,23490,25688,25973,28404,29380,63995,30340,31309,31515,31821,32318,32735,33659,35627,36042,36196,36321,36447,36842,36857,36969,37841,20291,20346,20659,20840,20856,21069,21098,22625,22652,22880,23560,23637,24283,24731,25136,26643,27583,27656,28593,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29006,29728,30000,30008,30033,30322,31564,31627,31661,31686,32399,35438,36670,36681,37439,37523,37666,37931,38651,39002,39019,39198,20999,25130,25240,27993,30308,31434,31680,32118,21344,23742,24215,28472,28857,31896,38673,39822,40670,25509,25722,34678,19969,20117,20141,20572,20597,21576,22979,23450,24128,24237,24311,24449,24773,25402,25919,25972,26060,26230,26232,26622,26984,27273,27491,27712,28096,28136,28191,28254,28702,28833,29582,29693,30010,30555,30855,31118,31243,31357,31934,32142,33351,35330,35562,35998,37165,37194,37336,37478,37580,37664,38662,38742,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38748,38914,40718,21046,21137,21884,22564,24093,24351,24716,25552,26799,28639,31085,31532,33229,34234,35069,35576,36420,37261,38500,38555,38717,38988,40778,20430,20806,20939,21161,22066,24340,24427,25514,25805,26089,26177,26362,26361,26397,26781,26839,27133,28437,28526,29031,29157,29226,29866,30522,31062,31066,31199,31264,31381,31895,31967,32068,32368,32903,34299,34468,35412,35519,36249,36481,36896,36973,37347,38459,38613,40165,26063,31751,36275,37827,23384,23562,21330,25305,29469,20519,23447,24478,24752,24939,26837,28121,29742,31278,32066,32156,32305,33131,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36394,36405,37758,37912,20304,22352,24038,24231,25387,32618,20027,20303,20367,20570,23005,32964,21610,21608,22014,22863,23449,24030,24282,26205,26417,26609,26666,27880,27954,28234,28557,28855,29664,30087,31820,32002,32044,32162,33311,34523,35387,35461,36208,36490,36659,36913,37198,37202,37956,39376,31481,31909,20426,20737,20934,22472,23535,23803,26201,27197,27994,28310,28652,28940,30063,31459,34850,36897,36981,38603,39423,33537,20013,20210,34886,37325,21373,27355,26987,27713,33914,22686,24974,26366,25327,28893,29969,30151,32338,33976,35657,36104,20043,21482,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21675,22320,22336,24535,25345,25351,25711,25903,26088,26234,26525,26547,27490,27744,27802,28460,30693,30757,31049,31063,32025,32930,33026,33267,33437,33463,34584,35468,63996,36100,36286,36978,30452,31257,31287,32340,32887,21767,21972,22645,25391,25634,26185,26187,26733,27035,27524,27941,28337,29645,29800,29857,30043,30137,30433,30494,30603,31206,32265,32285,33275,34095,34967,35386,36049,36587,36784,36914,37805,38499,38515,38663,20356,21489,23018,23241,24089,26702,29894,30142,31209,31378,33187,34541,36074,36300,36845,26015,26389,63997,22519,28503,32221,36655,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,37878,38598,24501,25074,28548,19988,20376,20511,21449,21983,23919,24046,27425,27492,30923,31642,63998,36425,36554,36974,25417,25662,30528,31364,37679,38015,40810,25776,28591,29158,29864,29914,31428,31762,32386,31922,32408,35738,36106,38013,39184,39244,21049,23519,25830,26413,32046,20717,21443,22649,24920,24921,25082,26028,31449,35730,35734,20489,20513,21109,21809,23100,24288,24432,24884,25950,26124,26166,26274,27085,28356,28466,29462,30241,31379,33081,33369,33750,33980,20661,22512,23488,23528,24425,25505,30758,32181,33756,34081,37319,37365,20874,26613,31574,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36012,20932,22971,24765,34389,20508,63999,21076,23610,24957,25114,25299,25842,26021,28364,30240,33034,36448,38495,38587,20191,21315,21912,22825,24029,25797,27849,28154,29588,31359,33307,34214,36068,36368,36983,37351,38369,38433,38854,20984,21746,21894,24505,25764,28552,32180,36639,36685,37941,20681,23574,27838,28155,29979,30651,31805,31844,35449,35522,22558,22974,24086,25463,29266,30090,30571,35548,36028,36626,24307,26228,28152,32893,33729,35531,38737,39894,64000,21059,26367,28053,28399,32224,35558,36910,36958,39636,21021,21119,21736,24980,25220,25307,26786,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26898,26970,27189,28818,28966,30813,30977,30990,31186,31245,32918,33400,33493,33609,34121,35970,36229,37218,37259,37294,20419,22225,29165,30679,34560,35320,23544,24534,26449,37032,21474,22618,23541,24740,24961,25696,32317,32880,34085,37507,25774,20652,23828,26368,22684,25277,25512,26894,27000,27166,28267,30394,31179,33467,33833,35535,36264,36861,37138,37195,37276,37648,37656,37786,38619,39478,39949,19985,30044,31069,31482,31569,31689,32302,33988,36441,36468,36600,36880,26149,26943,29763,20986,26414,40668,20805,24544,27798,34802,34909,34935,24756,33205,33795,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36101,21462,21561,22068,23094,23601,28810,32736,32858,33030,33261,36259,37257,39519,40434,20596,20164,21408,24827,28204,23652,20360,20516,21988,23769,24159,24677,26772,27835,28100,29118,30164,30196,30305,31258,31305,32199,32251,32622,33268,34473,36636,38601,39347,40786,21063,21189,39149,35242,19971,26578,28422,20405,23522,26517,27784,28024,29723,30759,37341,37756,34756,31204,31281,24555,20182,21668,21822,22702,22949,24816,25171,25302,26422,26965,33333,38464,39345,39389,20524,21331,21828,22396,64001,25176,64002,25826,26219,26589,28609,28655,29730,29752,35351,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,37944,21585,22022,22374,24392,24986,27470,28760,28845,32187,35477,22890,33067,25506,30472,32829,36010,22612,25645,27067,23445,24081,28271,64003,34153,20812,21488,22826,24608,24907,27526,27760,27888,31518,32974,33492,36294,37040,39089,64004,25799,28580,25745,25860,20814,21520,22303,35342,24927,26742,64005,30171,31570,32113,36890,22534,27084,33151,35114,36864,38969,20600,22871,22956,25237,36879,39722,24925,29305,38358,22369,23110,24052,25226,25773,25850,26487,27874,27966,29228,29750,30772,32631,33453,36315,38935,21028,22338,26495,29256,29923,36009,36774,37393,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38442,20843,21485,25420,20329,21764,24726,25943,27803,28031,29260,29437,31255,35207,35997,24429,28558,28921,33192,24846,20415,20559,25153,29255,31687,32232,32745,36941,38829,39449,36022,22378,24179,26544,33805,35413,21536,23318,24163,24290,24330,25987,32954,34109,38281,38491,20296,21253,21261,21263,21638,21754,22275,24067,24598,25243,25265,25429,64006,27873,28006,30129,30770,32990,33071,33502,33889,33970,34957,35090,36875,37610,39165,39825,24133,26292,26333,28689,29190,64007,20469,21117,24426,24915,26451,27161,28418,29922,31080,34920,35961,39111,39108,39491,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21697,31263,26963,35575,35914,39080,39342,24444,25259,30130,30382,34987,36991,38466,21305,24380,24517,27852,29644,30050,30091,31558,33534,39325,20047,36924,19979,20309,21414,22799,24264,26160,27827,29781,33655,34662,36032,36944,38686,39957,22737,23416,34384,35604,40372,23506,24680,24717,26097,27735,28450,28579,28698,32597,32752,38289,38290,38480,38867,21106,36676,20989,21547,21688,21859,21898,27323,28085,32216,33382,37532,38519,40569,21512,21704,30418,34532,38308,38356,38492,20130,20233,23022,23270,24055,24658,25239,26477,26689,27782,28207,32568,32923,33322,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,64008,64009,38917,20133,20565,21683,22419,22874,23401,23475,25032,26999,28023,28707,34809,35299,35442,35559,36994,39405,39608,21182,26680,20502,24184,26447,33607,34892,20139,21521,22190,29670,37141,38911,39177,39255,39321,22099,22687,34395,35377,25010,27382,29563,36562,27463,38570,39511,22869,29184,36203,38761,20436,23796,24358,25080,26203,27883,28843,29572,29625,29694,30505,30541,32067,32098,32291,33335,34898,64010,36066,37449,39023,23377,31348,34880,38913,23244,20448,21332,22846,23805,25406,28025,29433,33029,33031,33698,37583,38960,20136,20804,21009,22411,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,24418,27842,28366,28677,28752,28847,29074,29673,29801,33610,34722,34913,36872,37026,37795,39336,20846,24407,24800,24935,26291,34137,36426,37295,38795,20046,20114,21628,22741,22778,22909,23733,24359,25142,25160,26122,26215,27627,28009,28111,28246,28408,28564,28640,28649,28765,29392,29733,29786,29920,30355,31068,31946,32286,32993,33446,33899,33983,34382,34399,34676,35703,35946,37804,38912,39013,24785,25110,37239,23130,26127,28151,28222,29759,39746,24573,24794,31503,21700,24344,27742,27859,27946,28888,32005,34425,35340,40251,21270,21644,23301,27194,28779,30069,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31117,31166,33457,33775,35441,35649,36008,38772,64011,25844,25899,30906,30907,31339,20024,21914,22864,23462,24187,24739,25563,27489,26213,26707,28185,29029,29872,32008,36996,39529,39973,27963,28369,29502,35905,38346,20976,24140,24488,24653,24822,24880,24908,26179,26180,27045,27841,28255,28361,28514,29004,29852,30343,31681,31783,33618,34647,36945,38541,40643,21295,22238,24315,24458,24674,24724,25079,26214,26371,27292,28142,28590,28784,29546,32362,33214,33588,34516,35496,36036,21123,29554,23446,27243,37892,21742,22150,23389,25928,25989,26313,26783,28045,28102,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29243,32948,37237,39501,20399,20505,21402,21518,21564,21897,21957,24127,24460,26429,29030,29661,36869,21211,21235,22628,22734,28932,29071,29179,34224,35347,26248,34216,21927,26244,29002,33841,21321,21913,27585,24409,24509,25582,26249,28999,35569,36637,40638,20241,25658,28875,30054,34407,24676,35662,40440,20807,20982,21256,27958,33016,40657,26133,27427,28824,30165,21507,23673,32007,35350,27424,27453,27462,21560,24688,27965,32725,33288,20694,20958,21916,22123,22221,23020,23305,24076,24985,24984,25137,26206,26342,29081,29113,29114,29351,31143,31232,32690,35440,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], "gb18030":[19970,19972,19973,19974,19983,19986,19991,19999,20000,20001,20003,20006,20009,20014,20015,20017,20019,20021,20023,20028,20032,20033,20034,20036,20038,20042,20049,20053,20055,20058,20059,20066,20067,20068,20069,20071,20072,20074,20075,20076,20077,20078,20079,20082,20084,20085,20086,20087,20088,20089,20090,20091,20092,20093,20095,20096,20097,20098,20099,20100,20101,20103,20106,20112,20118,20119,20121,20124,20125,20126,20131,20138,20143,20144,20145,20148,20150,20151,20152,20153,20156,20157,20158,20168,20172,20175,20176,20178,20186,20187,20188,20192,20194,20198,20199,20201,20205,20206,20207,20209,20212,20216,20217,20218,20220,20222,20224,20226,20227,20228,20229,20230,20231,20232,20235,20236,20242,20243,20244,20245,20246,20252,20253,20257,20259,20264,20265,20268,20269,20270,20273,20275,20277,20279,20281,20283,20286,20287,20288,20289,20290,20292,20293,20295,20296,20297,20298,20299,20300,20306,20308,20310,20321,20322,20326,20328,20330,20331,20333,20334,20337,20338,20341,20343,20344,20345,20346,20349,20352,20353,20354,20357,20358,20359,20362,20364,20366,20368,20370,20371,20373,20374,20376,20377,20378,20380,20382,20383,20385,20386,20388,20395,20397,20400,20401,20402,20403,20404,20406,20407,20408,20409,20410,20411,20412,20413,20414,20416,20417,20418,20422,20423,20424,20425,20427,20428,20429,20434,20435,20436,20437,20438,20441,20443,20448,20450,20452,20453,20455,20459,20460,20464,20466,20468,20469,20470,20471,20473,20475,20476,20477,20479,20480,20481,20482,20483,20484,20485,20486,20487,20488,20489,20490,20491,20494,20496,20497,20499,20501,20502,20503,20507,20509,20510,20512,20514,20515,20516,20519,20523,20527,20528,20529,20530,20531,20532,20533,20534,20535,20536,20537,20539,20541,20543,20544,20545,20546,20548,20549,20550,20553,20554,20555,20557,20560,20561,20562,20563,20564,20566,20567,20568,20569,20571,20573,20574,20575,20576,20577,20578,20579,20580,20582,20583,20584,20585,20586,20587,20589,20590,20591,20592,20593,20594,20595,20596,20597,20600,20601,20602,20604,20605,20609,20610,20611,20612,20614,20615,20617,20618,20619,20620,20622,20623,20624,20625,20626,20627,20628,20629,20630,20631,20632,20633,20634,20635,20636,20637,20638,20639,20640,20641,20642,20644,20646,20650,20651,20653,20654,20655,20656,20657,20659,20660,20661,20662,20663,20664,20665,20668,20669,20670,20671,20672,20673,20674,20675,20676,20677,20678,20679,20680,20681,20682,20683,20684,20685,20686,20688,20689,20690,20691,20692,20693,20695,20696,20697,20699,20700,20701,20702,20703,20704,20705,20706,20707,20708,20709,20712,20713,20714,20715,20719,20720,20721,20722,20724,20726,20727,20728,20729,20730,20732,20733,20734,20735,20736,20737,20738,20739,20740,20741,20744,20745,20746,20748,20749,20750,20751,20752,20753,20755,20756,20757,20758,20759,20760,20761,20762,20763,20764,20765,20766,20767,20768,20770,20771,20772,20773,20774,20775,20776,20777,20778,20779,20780,20781,20782,20783,20784,20785,20786,20787,20788,20789,20790,20791,20792,20793,20794,20795,20796,20797,20798,20802,20807,20810,20812,20814,20815,20816,20818,20819,20823,20824,20825,20827,20829,20830,20831,20832,20833,20835,20836,20838,20839,20841,20842,20847,20850,20858,20862,20863,20867,20868,20870,20871,20874,20875,20878,20879,20880,20881,20883,20884,20888,20890,20893,20894,20895,20897,20899,20902,20903,20904,20905,20906,20909,20910,20916,20920,20921,20922,20926,20927,20929,20930,20931,20933,20936,20938,20941,20942,20944,20946,20947,20948,20949,20950,20951,20952,20953,20954,20956,20958,20959,20962,20963,20965,20966,20967,20968,20969,20970,20972,20974,20977,20978,20980,20983,20990,20996,20997,21001,21003,21004,21007,21008,21011,21012,21013,21020,21022,21023,21025,21026,21027,21029,21030,21031,21034,21036,21039,21041,21042,21044,21045,21052,21054,21060,21061,21062,21063,21064,21065,21067,21070,21071,21074,21075,21077,21079,21080,21081,21082,21083,21085,21087,21088,21090,21091,21092,21094,21096,21099,21100,21101,21102,21104,21105,21107,21108,21109,21110,21111,21112,21113,21114,21115,21116,21118,21120,21123,21124,21125,21126,21127,21129,21130,21131,21132,21133,21134,21135,21137,21138,21140,21141,21142,21143,21144,21145,21146,21148,21156,21157,21158,21159,21166,21167,21168,21172,21173,21174,21175,21176,21177,21178,21179,21180,21181,21184,21185,21186,21188,21189,21190,21192,21194,21196,21197,21198,21199,21201,21203,21204,21205,21207,21209,21210,21211,21212,21213,21214,21216,21217,21218,21219,21221,21222,21223,21224,21225,21226,21227,21228,21229,21230,21231,21233,21234,21235,21236,21237,21238,21239,21240,21243,21244,21245,21249,21250,21251,21252,21255,21257,21258,21259,21260,21262,21265,21266,21267,21268,21272,21275,21276,21278,21279,21282,21284,21285,21287,21288,21289,21291,21292,21293,21295,21296,21297,21298,21299,21300,21301,21302,21303,21304,21308,21309,21312,21314,21316,21318,21323,21324,21325,21328,21332,21336,21337,21339,21341,21349,21352,21354,21356,21357,21362,21366,21369,21371,21372,21373,21374,21376,21377,21379,21383,21384,21386,21390,21391,21392,21393,21394,21395,21396,21398,21399,21401,21403,21404,21406,21408,21409,21412,21415,21418,21419,21420,21421,21423,21424,21425,21426,21427,21428,21429,21431,21432,21433,21434,21436,21437,21438,21440,21443,21444,21445,21446,21447,21454,21455,21456,21458,21459,21461,21466,21468,21469,21470,21473,21474,21479,21492,21498,21502,21503,21504,21506,21509,21511,21515,21524,21528,21529,21530,21532,21538,21540,21541,21546,21552,21555,21558,21559,21562,21565,21567,21569,21570,21572,21573,21575,21577,21580,21581,21582,21583,21585,21594,21597,21598,21599,21600,21601,21603,21605,21607,21609,21610,21611,21612,21613,21614,21615,21616,21620,21625,21626,21630,21631,21633,21635,21637,21639,21640,21641,21642,21645,21649,21651,21655,21656,21660,21662,21663,21664,21665,21666,21669,21678,21680,21682,21685,21686,21687,21689,21690,21692,21694,21699,21701,21706,21707,21718,21720,21723,21728,21729,21730,21731,21732,21739,21740,21743,21744,21745,21748,21749,21750,21751,21752,21753,21755,21758,21760,21762,21763,21764,21765,21768,21770,21771,21772,21773,21774,21778,21779,21781,21782,21783,21784,21785,21786,21788,21789,21790,21791,21793,21797,21798,21800,21801,21803,21805,21810,21812,21813,21814,21816,21817,21818,21819,21821,21824,21826,21829,21831,21832,21835,21836,21837,21838,21839,21841,21842,21843,21844,21847,21848,21849,21850,21851,21853,21854,21855,21856,21858,21859,21864,21865,21867,21871,21872,21873,21874,21875,21876,21881,21882,21885,21887,21893,21894,21900,21901,21902,21904,21906,21907,21909,21910,21911,21914,21915,21918,21920,21921,21922,21923,21924,21925,21926,21928,21929,21930,21931,21932,21933,21934,21935,21936,21938,21940,21942,21944,21946,21948,21951,21952,21953,21954,21955,21958,21959,21960,21962,21963,21966,21967,21968,21973,21975,21976,21977,21978,21979,21982,21984,21986,21991,21993,21997,21998,22000,22001,22004,22006,22008,22009,22010,22011,22012,22015,22018,22019,22020,22021,22022,22023,22026,22027,22029,22032,22033,22034,22035,22036,22037,22038,22039,22041,22042,22044,22045,22048,22049,22050,22053,22054,22056,22057,22058,22059,22062,22063,22064,22067,22069,22071,22072,22074,22076,22077,22078,22080,22081,22082,22083,22084,22085,22086,22087,22088,22089,22090,22091,22095,22096,22097,22098,22099,22101,22102,22106,22107,22109,22110,22111,22112,22113,22115,22117,22118,22119,22125,22126,22127,22128,22130,22131,22132,22133,22135,22136,22137,22138,22141,22142,22143,22144,22145,22146,22147,22148,22151,22152,22153,22154,22155,22156,22157,22160,22161,22162,22164,22165,22166,22167,22168,22169,22170,22171,22172,22173,22174,22175,22176,22177,22178,22180,22181,22182,22183,22184,22185,22186,22187,22188,22189,22190,22192,22193,22194,22195,22196,22197,22198,22200,22201,22202,22203,22205,22206,22207,22208,22209,22210,22211,22212,22213,22214,22215,22216,22217,22219,22220,22221,22222,22223,22224,22225,22226,22227,22229,22230,22232,22233,22236,22243,22245,22246,22247,22248,22249,22250,22252,22254,22255,22258,22259,22262,22263,22264,22267,22268,22272,22273,22274,22277,22279,22283,22284,22285,22286,22287,22288,22289,22290,22291,22292,22293,22294,22295,22296,22297,22298,22299,22301,22302,22304,22305,22306,22308,22309,22310,22311,22315,22321,22322,22324,22325,22326,22327,22328,22332,22333,22335,22337,22339,22340,22341,22342,22344,22345,22347,22354,22355,22356,22357,22358,22360,22361,22370,22371,22373,22375,22380,22382,22384,22385,22386,22388,22389,22392,22393,22394,22397,22398,22399,22400,22401,22407,22408,22409,22410,22413,22414,22415,22416,22417,22420,22421,22422,22423,22424,22425,22426,22428,22429,22430,22431,22437,22440,22442,22444,22447,22448,22449,22451,22453,22454,22455,22457,22458,22459,22460,22461,22462,22463,22464,22465,22468,22469,22470,22471,22472,22473,22474,22476,22477,22480,22481,22483,22486,22487,22491,22492,22494,22497,22498,22499,22501,22502,22503,22504,22505,22506,22507,22508,22510,22512,22513,22514,22515,22517,22518,22519,22523,22524,22526,22527,22529,22531,22532,22533,22536,22537,22538,22540,22542,22543,22544,22546,22547,22548,22550,22551,22552,22554,22555,22556,22557,22559,22562,22563,22565,22566,22567,22568,22569,22571,22572,22573,22574,22575,22577,22578,22579,22580,22582,22583,22584,22585,22586,22587,22588,22589,22590,22591,22592,22593,22594,22595,22597,22598,22599,22600,22601,22602,22603,22606,22607,22608,22610,22611,22613,22614,22615,22617,22618,22619,22620,22621,22623,22624,22625,22626,22627,22628,22630,22631,22632,22633,22634,22637,22638,22639,22640,22641,22642,22643,22644,22645,22646,22647,22648,22649,22650,22651,22652,22653,22655,22658,22660,22662,22663,22664,22666,22667,22668,22669,22670,22671,22672,22673,22676,22677,22678,22679,22680,22683,22684,22685,22688,22689,22690,22691,22692,22693,22694,22695,22698,22699,22700,22701,22702,22703,22704,22705,22706,22707,22708,22709,22710,22711,22712,22713,22714,22715,22717,22718,22719,22720,22722,22723,22724,22726,22727,22728,22729,22730,22731,22732,22733,22734,22735,22736,22738,22739,22740,22742,22743,22744,22745,22746,22747,22748,22749,22750,22751,22752,22753,22754,22755,22757,22758,22759,22760,22761,22762,22765,22767,22769,22770,22772,22773,22775,22776,22778,22779,22780,22781,22782,22783,22784,22785,22787,22789,22790,22792,22793,22794,22795,22796,22798,22800,22801,22802,22803,22807,22808,22811,22813,22814,22816,22817,22818,22819,22822,22824,22828,22832,22834,22835,22837,22838,22843,22845,22846,22847,22848,22851,22853,22854,22858,22860,22861,22864,22866,22867,22873,22875,22876,22877,22878,22879,22881,22883,22884,22886,22887,22888,22889,22890,22891,22892,22893,22894,22895,22896,22897,22898,22901,22903,22906,22907,22908,22910,22911,22912,22917,22921,22923,22924,22926,22927,22928,22929,22932,22933,22936,22938,22939,22940,22941,22943,22944,22945,22946,22950,22951,22956,22957,22960,22961,22963,22964,22965,22966,22967,22968,22970,22972,22973,22975,22976,22977,22978,22979,22980,22981,22983,22984,22985,22988,22989,22990,22991,22997,22998,23001,23003,23006,23007,23008,23009,23010,23012,23014,23015,23017,23018,23019,23021,23022,23023,23024,23025,23026,23027,23028,23029,23030,23031,23032,23034,23036,23037,23038,23040,23042,23050,23051,23053,23054,23055,23056,23058,23060,23061,23062,23063,23065,23066,23067,23069,23070,23073,23074,23076,23078,23079,23080,23082,23083,23084,23085,23086,23087,23088,23091,23093,23095,23096,23097,23098,23099,23101,23102,23103,23105,23106,23107,23108,23109,23111,23112,23115,23116,23117,23118,23119,23120,23121,23122,23123,23124,23126,23127,23128,23129,23131,23132,23133,23134,23135,23136,23137,23139,23140,23141,23142,23144,23145,23147,23148,23149,23150,23151,23152,23153,23154,23155,23160,23161,23163,23164,23165,23166,23168,23169,23170,23171,23172,23173,23174,23175,23176,23177,23178,23179,23180,23181,23182,23183,23184,23185,23187,23188,23189,23190,23191,23192,23193,23196,23197,23198,23199,23200,23201,23202,23203,23204,23205,23206,23207,23208,23209,23211,23212,23213,23214,23215,23216,23217,23220,23222,23223,23225,23226,23227,23228,23229,23231,23232,23235,23236,23237,23238,23239,23240,23242,23243,23245,23246,23247,23248,23249,23251,23253,23255,23257,23258,23259,23261,23262,23263,23266,23268,23269,23271,23272,23274,23276,23277,23278,23279,23280,23282,23283,23284,23285,23286,23287,23288,23289,23290,23291,23292,23293,23294,23295,23296,23297,23298,23299,23300,23301,23302,23303,23304,23306,23307,23308,23309,23310,23311,23312,23313,23314,23315,23316,23317,23320,23321,23322,23323,23324,23325,23326,23327,23328,23329,23330,23331,23332,23333,23334,23335,23336,23337,23338,23339,23340,23341,23342,23343,23344,23345,23347,23349,23350,23352,23353,23354,23355,23356,23357,23358,23359,23361,23362,23363,23364,23365,23366,23367,23368,23369,23370,23371,23372,23373,23374,23375,23378,23382,23390,23392,23393,23399,23400,23403,23405,23406,23407,23410,23412,23414,23415,23416,23417,23419,23420,23422,23423,23426,23430,23434,23437,23438,23440,23441,23442,23444,23446,23455,23463,23464,23465,23468,23469,23470,23471,23473,23474,23479,23482,23483,23484,23488,23489,23491,23496,23497,23498,23499,23501,23502,23503,23505,23508,23509,23510,23511,23512,23513,23514,23515,23516,23520,23522,23523,23526,23527,23529,23530,23531,23532,23533,23535,23537,23538,23539,23540,23541,23542,23543,23549,23550,23552,23554,23555,23557,23559,23560,23563,23564,23565,23566,23568,23570,23571,23575,23577,23579,23582,23583,23584,23585,23587,23590,23592,23593,23594,23595,23597,23598,23599,23600,23602,23603,23605,23606,23607,23619,23620,23622,23623,23628,23629,23634,23635,23636,23638,23639,23640,23642,23643,23644,23645,23647,23650,23652,23655,23656,23657,23658,23659,23660,23661,23664,23666,23667,23668,23669,23670,23671,23672,23675,23676,23677,23678,23680,23683,23684,23685,23686,23687,23689,23690,23691,23694,23695,23698,23699,23701,23709,23710,23711,23712,23713,23716,23717,23718,23719,23720,23722,23726,23727,23728,23730,23732,23734,23737,23738,23739,23740,23742,23744,23746,23747,23749,23750,23751,23752,23753,23754,23756,23757,23758,23759,23760,23761,23763,23764,23765,23766,23767,23768,23770,23771,23772,23773,23774,23775,23776,23778,23779,23783,23785,23787,23788,23790,23791,23793,23794,23795,23796,23797,23798,23799,23800,23801,23802,23804,23805,23806,23807,23808,23809,23812,23813,23816,23817,23818,23819,23820,23821,23823,23824,23825,23826,23827,23829,23831,23832,23833,23834,23836,23837,23839,23840,23841,23842,23843,23845,23848,23850,23851,23852,23855,23856,23857,23858,23859,23861,23862,23863,23864,23865,23866,23867,23868,23871,23872,23873,23874,23875,23876,23877,23878,23880,23881,23885,23886,23887,23888,23889,23890,23891,23892,23893,23894,23895,23897,23898,23900,23902,23903,23904,23905,23906,23907,23908,23909,23910,23911,23912,23914,23917,23918,23920,23921,23922,23923,23925,23926,23927,23928,23929,23930,23931,23932,23933,23934,23935,23936,23937,23939,23940,23941,23942,23943,23944,23945,23946,23947,23948,23949,23950,23951,23952,23953,23954,23955,23956,23957,23958,23959,23960,23962,23963,23964,23966,23967,23968,23969,23970,23971,23972,23973,23974,23975,23976,23977,23978,23979,23980,23981,23982,23983,23984,23985,23986,23987,23988,23989,23990,23992,23993,23994,23995,23996,23997,23998,23999,24000,24001,24002,24003,24004,24006,24007,24008,24009,24010,24011,24012,24014,24015,24016,24017,24018,24019,24020,24021,24022,24023,24024,24025,24026,24028,24031,24032,24035,24036,24042,24044,24045,24048,24053,24054,24056,24057,24058,24059,24060,24063,24064,24068,24071,24073,24074,24075,24077,24078,24082,24083,24087,24094,24095,24096,24097,24098,24099,24100,24101,24104,24105,24106,24107,24108,24111,24112,24114,24115,24116,24117,24118,24121,24122,24126,24127,24128,24129,24131,24134,24135,24136,24137,24138,24139,24141,24142,24143,24144,24145,24146,24147,24150,24151,24152,24153,24154,24156,24157,24159,24160,24163,24164,24165,24166,24167,24168,24169,24170,24171,24172,24173,24174,24175,24176,24177,24181,24183,24185,24190,24193,24194,24195,24197,24200,24201,24204,24205,24206,24210,24216,24219,24221,24225,24226,24227,24228,24232,24233,24234,24235,24236,24238,24239,24240,24241,24242,24244,24250,24251,24252,24253,24255,24256,24257,24258,24259,24260,24261,24262,24263,24264,24267,24268,24269,24270,24271,24272,24276,24277,24279,24280,24281,24282,24284,24285,24286,24287,24288,24289,24290,24291,24292,24293,24294,24295,24297,24299,24300,24301,24302,24303,24304,24305,24306,24307,24309,24312,24313,24315,24316,24317,24325,24326,24327,24329,24332,24333,24334,24336,24338,24340,24342,24345,24346,24348,24349,24350,24353,24354,24355,24356,24360,24363,24364,24366,24368,24370,24371,24372,24373,24374,24375,24376,24379,24381,24382,24383,24385,24386,24387,24388,24389,24390,24391,24392,24393,24394,24395,24396,24397,24398,24399,24401,24404,24409,24410,24411,24412,24414,24415,24416,24419,24421,24423,24424,24427,24430,24431,24434,24436,24437,24438,24440,24442,24445,24446,24447,24451,24454,24461,24462,24463,24465,24467,24468,24470,24474,24475,24477,24478,24479,24480,24482,24483,24484,24485,24486,24487,24489,24491,24492,24495,24496,24497,24498,24499,24500,24502,24504,24505,24506,24507,24510,24511,24512,24513,24514,24519,24520,24522,24523,24526,24531,24532,24533,24538,24539,24540,24542,24543,24546,24547,24549,24550,24552,24553,24556,24559,24560,24562,24563,24564,24566,24567,24569,24570,24572,24583,24584,24585,24587,24588,24592,24593,24595,24599,24600,24602,24606,24607,24610,24611,24612,24620,24621,24622,24624,24625,24626,24627,24628,24630,24631,24632,24633,24634,24637,24638,24640,24644,24645,24646,24647,24648,24649,24650,24652,24654,24655,24657,24659,24660,24662,24663,24664,24667,24668,24670,24671,24672,24673,24677,24678,24686,24689,24690,24692,24693,24695,24702,24704,24705,24706,24709,24710,24711,24712,24714,24715,24718,24719,24720,24721,24723,24725,24727,24728,24729,24732,24734,24737,24738,24740,24741,24743,24745,24746,24750,24752,24755,24757,24758,24759,24761,24762,24765,24766,24767,24768,24769,24770,24771,24772,24775,24776,24777,24780,24781,24782,24783,24784,24786,24787,24788,24790,24791,24793,24795,24798,24801,24802,24803,24804,24805,24810,24817,24818,24821,24823,24824,24827,24828,24829,24830,24831,24834,24835,24836,24837,24839,24842,24843,24844,24848,24849,24850,24851,24852,24854,24855,24856,24857,24859,24860,24861,24862,24865,24866,24869,24872,24873,24874,24876,24877,24878,24879,24880,24881,24882,24883,24884,24885,24886,24887,24888,24889,24890,24891,24892,24893,24894,24896,24897,24898,24899,24900,24901,24902,24903,24905,24907,24909,24911,24912,24914,24915,24916,24918,24919,24920,24921,24922,24923,24924,24926,24927,24928,24929,24931,24932,24933,24934,24937,24938,24939,24940,24941,24942,24943,24945,24946,24947,24948,24950,24952,24953,24954,24955,24956,24957,24958,24959,24960,24961,24962,24963,24964,24965,24966,24967,24968,24969,24970,24972,24973,24975,24976,24977,24978,24979,24981,24982,24983,24984,24985,24986,24987,24988,24990,24991,24992,24993,24994,24995,24996,24997,24998,25002,25003,25005,25006,25007,25008,25009,25010,25011,25012,25013,25014,25016,25017,25018,25019,25020,25021,25023,25024,25025,25027,25028,25029,25030,25031,25033,25036,25037,25038,25039,25040,25043,25045,25046,25047,25048,25049,25050,25051,25052,25053,25054,25055,25056,25057,25058,25059,25060,25061,25063,25064,25065,25066,25067,25068,25069,25070,25071,25072,25073,25074,25075,25076,25078,25079,25080,25081,25082,25083,25084,25085,25086,25088,25089,25090,25091,25092,25093,25095,25097,25107,25108,25113,25116,25117,25118,25120,25123,25126,25127,25128,25129,25131,25133,25135,25136,25137,25138,25141,25142,25144,25145,25146,25147,25148,25154,25156,25157,25158,25162,25167,25168,25173,25174,25175,25177,25178,25180,25181,25182,25183,25184,25185,25186,25188,25189,25192,25201,25202,25204,25205,25207,25208,25210,25211,25213,25217,25218,25219,25221,25222,25223,25224,25227,25228,25229,25230,25231,25232,25236,25241,25244,25245,25246,25251,25254,25255,25257,25258,25261,25262,25263,25264,25266,25267,25268,25270,25271,25272,25274,25278,25280,25281,25283,25291,25295,25297,25301,25309,25310,25312,25313,25316,25322,25323,25328,25330,25333,25336,25337,25338,25339,25344,25347,25348,25349,25350,25354,25355,25356,25357,25359,25360,25362,25363,25364,25365,25367,25368,25369,25372,25382,25383,25385,25388,25389,25390,25392,25393,25395,25396,25397,25398,25399,25400,25403,25404,25406,25407,25408,25409,25412,25415,25416,25418,25425,25426,25427,25428,25430,25431,25432,25433,25434,25435,25436,25437,25440,25444,25445,25446,25448,25450,25451,25452,25455,25456,25458,25459,25460,25461,25464,25465,25468,25469,25470,25471,25473,25475,25476,25477,25478,25483,25485,25489,25491,25492,25493,25495,25497,25498,25499,25500,25501,25502,25503,25505,25508,25510,25515,25519,25521,25522,25525,25526,25529,25531,25533,25535,25536,25537,25538,25539,25541,25543,25544,25546,25547,25548,25553,25555,25556,25557,25559,25560,25561,25562,25563,25564,25565,25567,25570,25572,25573,25574,25575,25576,25579,25580,25582,25583,25584,25585,25587,25589,25591,25593,25594,25595,25596,25598,25603,25604,25606,25607,25608,25609,25610,25613,25614,25617,25618,25621,25622,25623,25624,25625,25626,25629,25631,25634,25635,25636,25637,25639,25640,25641,25643,25646,25647,25648,25649,25650,25651,25653,25654,25655,25656,25657,25659,25660,25662,25664,25666,25667,25673,25675,25676,25677,25678,25679,25680,25681,25683,25685,25686,25687,25689,25690,25691,25692,25693,25695,25696,25697,25698,25699,25700,25701,25702,25704,25706,25707,25708,25710,25711,25712,25713,25714,25715,25716,25717,25718,25719,25723,25724,25725,25726,25727,25728,25729,25731,25734,25736,25737,25738,25739,25740,25741,25742,25743,25744,25747,25748,25751,25752,25754,25755,25756,25757,25759,25760,25761,25762,25763,25765,25766,25767,25768,25770,25771,25775,25777,25778,25779,25780,25782,25785,25787,25789,25790,25791,25793,25795,25796,25798,25799,25800,25801,25802,25803,25804,25807,25809,25811,25812,25813,25814,25817,25818,25819,25820,25821,25823,25824,25825,25827,25829,25831,25832,25833,25834,25835,25836,25837,25838,25839,25840,25841,25842,25843,25844,25845,25846,25847,25848,25849,25850,25851,25852,25853,25854,25855,25857,25858,25859,25860,25861,25862,25863,25864,25866,25867,25868,25869,25870,25871,25872,25873,25875,25876,25877,25878,25879,25881,25882,25883,25884,25885,25886,25887,25888,25889,25890,25891,25892,25894,25895,25896,25897,25898,25900,25901,25904,25905,25906,25907,25911,25914,25916,25917,25920,25921,25922,25923,25924,25926,25927,25930,25931,25933,25934,25936,25938,25939,25940,25943,25944,25946,25948,25951,25952,25953,25956,25957,25959,25960,25961,25962,25965,25966,25967,25969,25971,25973,25974,25976,25977,25978,25979,25980,25981,25982,25983,25984,25985,25986,25987,25988,25989,25990,25992,25993,25994,25997,25998,25999,26002,26004,26005,26006,26008,26010,26013,26014,26016,26018,26019,26022,26024,26026,26028,26030,26033,26034,26035,26036,26037,26038,26039,26040,26042,26043,26046,26047,26048,26050,26055,26056,26057,26058,26061,26064,26065,26067,26068,26069,26072,26073,26074,26075,26076,26077,26078,26079,26081,26083,26084,26090,26091,26098,26099,26100,26101,26104,26105,26107,26108,26109,26110,26111,26113,26116,26117,26119,26120,26121,26123,26125,26128,26129,26130,26134,26135,26136,26138,26139,26140,26142,26145,26146,26147,26148,26150,26153,26154,26155,26156,26158,26160,26162,26163,26167,26168,26169,26170,26171,26173,26175,26176,26178,26180,26181,26182,26183,26184,26185,26186,26189,26190,26192,26193,26200,26201,26203,26204,26205,26206,26208,26210,26211,26213,26215,26217,26218,26219,26220,26221,26225,26226,26227,26229,26232,26233,26235,26236,26237,26239,26240,26241,26243,26245,26246,26248,26249,26250,26251,26253,26254,26255,26256,26258,26259,26260,26261,26264,26265,26266,26267,26268,26270,26271,26272,26273,26274,26275,26276,26277,26278,26281,26282,26283,26284,26285,26287,26288,26289,26290,26291,26293,26294,26295,26296,26298,26299,26300,26301,26303,26304,26305,26306,26307,26308,26309,26310,26311,26312,26313,26314,26315,26316,26317,26318,26319,26320,26321,26322,26323,26324,26325,26326,26327,26328,26330,26334,26335,26336,26337,26338,26339,26340,26341,26343,26344,26346,26347,26348,26349,26350,26351,26353,26357,26358,26360,26362,26363,26365,26369,26370,26371,26372,26373,26374,26375,26380,26382,26383,26385,26386,26387,26390,26392,26393,26394,26396,26398,26400,26401,26402,26403,26404,26405,26407,26409,26414,26416,26418,26419,26422,26423,26424,26425,26427,26428,26430,26431,26433,26436,26437,26439,26442,26443,26445,26450,26452,26453,26455,26456,26457,26458,26459,26461,26466,26467,26468,26470,26471,26475,26476,26478,26481,26484,26486,26488,26489,26490,26491,26493,26496,26498,26499,26501,26502,26504,26506,26508,26509,26510,26511,26513,26514,26515,26516,26518,26521,26523,26527,26528,26529,26532,26534,26537,26540,26542,26545,26546,26548,26553,26554,26555,26556,26557,26558,26559,26560,26562,26565,26566,26567,26568,26569,26570,26571,26572,26573,26574,26581,26582,26583,26587,26591,26593,26595,26596,26598,26599,26600,26602,26603,26605,26606,26610,26613,26614,26615,26616,26617,26618,26619,26620,26622,26625,26626,26627,26628,26630,26637,26640,26642,26644,26645,26648,26649,26650,26651,26652,26654,26655,26656,26658,26659,26660,26661,26662,26663,26664,26667,26668,26669,26670,26671,26672,26673,26676,26677,26678,26682,26683,26687,26695,26699,26701,26703,26706,26710,26711,26712,26713,26714,26715,26716,26717,26718,26719,26730,26732,26733,26734,26735,26736,26737,26738,26739,26741,26744,26745,26746,26747,26748,26749,26750,26751,26752,26754,26756,26759,26760,26761,26762,26763,26764,26765,26766,26768,26769,26770,26772,26773,26774,26776,26777,26778,26779,26780,26781,26782,26783,26784,26785,26787,26788,26789,26793,26794,26795,26796,26798,26801,26802,26804,26806,26807,26808,26809,26810,26811,26812,26813,26814,26815,26817,26819,26820,26821,26822,26823,26824,26826,26828,26830,26831,26832,26833,26835,26836,26838,26839,26841,26843,26844,26845,26846,26847,26849,26850,26852,26853,26854,26855,26856,26857,26858,26859,26860,26861,26863,26866,26867,26868,26870,26871,26872,26875,26877,26878,26879,26880,26882,26883,26884,26886,26887,26888,26889,26890,26892,26895,26897,26899,26900,26901,26902,26903,26904,26905,26906,26907,26908,26909,26910,26913,26914,26915,26917,26918,26919,26920,26921,26922,26923,26924,26926,26927,26929,26930,26931,26933,26934,26935,26936,26938,26939,26940,26942,26944,26945,26947,26948,26949,26950,26951,26952,26953,26954,26955,26956,26957,26958,26959,26960,26961,26962,26963,26965,26966,26968,26969,26971,26972,26975,26977,26978,26980,26981,26983,26984,26985,26986,26988,26989,26991,26992,26994,26995,26996,26997,26998,27002,27003,27005,27006,27007,27009,27011,27013,27018,27019,27020,27022,27023,27024,27025,27026,27027,27030,27031,27033,27034,27037,27038,27039,27040,27041,27042,27043,27044,27045,27046,27049,27050,27052,27054,27055,27056,27058,27059,27061,27062,27064,27065,27066,27068,27069,27070,27071,27072,27074,27075,27076,27077,27078,27079,27080,27081,27083,27085,27087,27089,27090,27091,27093,27094,27095,27096,27097,27098,27100,27101,27102,27105,27106,27107,27108,27109,27110,27111,27112,27113,27114,27115,27116,27118,27119,27120,27121,27123,27124,27125,27126,27127,27128,27129,27130,27131,27132,27134,27136,27137,27138,27139,27140,27141,27142,27143,27144,27145,27147,27148,27149,27150,27151,27152,27153,27154,27155,27156,27157,27158,27161,27162,27163,27164,27165,27166,27168,27170,27171,27172,27173,27174,27175,27177,27179,27180,27181,27182,27184,27186,27187,27188,27190,27191,27192,27193,27194,27195,27196,27199,27200,27201,27202,27203,27205,27206,27208,27209,27210,27211,27212,27213,27214,27215,27217,27218,27219,27220,27221,27222,27223,27226,27228,27229,27230,27231,27232,27234,27235,27236,27238,27239,27240,27241,27242,27243,27244,27245,27246,27247,27248,27250,27251,27252,27253,27254,27255,27256,27258,27259,27261,27262,27263,27265,27266,27267,27269,27270,27271,27272,27273,27274,27275,27276,27277,27279,27282,27283,27284,27285,27286,27288,27289,27290,27291,27292,27293,27294,27295,27297,27298,27299,27300,27301,27302,27303,27304,27306,27309,27310,27311,27312,27313,27314,27315,27316,27317,27318,27319,27320,27321,27322,27323,27324,27325,27326,27327,27328,27329,27330,27331,27332,27333,27334,27335,27336,27337,27338,27339,27340,27341,27342,27343,27344,27345,27346,27347,27348,27349,27350,27351,27352,27353,27354,27355,27356,27357,27358,27359,27360,27361,27362,27363,27364,27365,27366,27367,27368,27369,27370,27371,27372,27373,27374,27375,27376,27377,27378,27379,27380,27381,27382,27383,27384,27385,27386,27387,27388,27389,27390,27391,27392,27393,27394,27395,27396,27397,27398,27399,27400,27401,27402,27403,27404,27405,27406,27407,27408,27409,27410,27411,27412,27413,27414,27415,27416,27417,27418,27419,27420,27421,27422,27423,27429,27430,27432,27433,27434,27435,27436,27437,27438,27439,27440,27441,27443,27444,27445,27446,27448,27451,27452,27453,27455,27456,27457,27458,27460,27461,27464,27466,27467,27469,27470,27471,27472,27473,27474,27475,27476,27477,27478,27479,27480,27482,27483,27484,27485,27486,27487,27488,27489,27496,27497,27499,27500,27501,27502,27503,27504,27505,27506,27507,27508,27509,27510,27511,27512,27514,27517,27518,27519,27520,27525,27528,27532,27534,27535,27536,27537,27540,27541,27543,27544,27545,27548,27549,27550,27551,27552,27554,27555,27556,27557,27558,27559,27560,27561,27563,27564,27565,27566,27567,27568,27569,27570,27574,27576,27577,27578,27579,27580,27581,27582,27584,27587,27588,27590,27591,27592,27593,27594,27596,27598,27600,27601,27608,27610,27612,27613,27614,27615,27616,27618,27619,27620,27621,27622,27623,27624,27625,27628,27629,27630,27632,27633,27634,27636,27638,27639,27640,27642,27643,27644,27646,27647,27648,27649,27650,27651,27652,27656,27657,27658,27659,27660,27662,27666,27671,27676,27677,27678,27680,27683,27685,27691,27692,27693,27697,27699,27702,27703,27705,27706,27707,27708,27710,27711,27715,27716,27717,27720,27723,27724,27725,27726,27727,27729,27730,27731,27734,27736,27737,27738,27746,27747,27749,27750,27751,27755,27756,27757,27758,27759,27761,27763,27765,27767,27768,27770,27771,27772,27775,27776,27780,27783,27786,27787,27789,27790,27793,27794,27797,27798,27799,27800,27802,27804,27805,27806,27808,27810,27816,27820,27823,27824,27828,27829,27830,27831,27834,27840,27841,27842,27843,27846,27847,27848,27851,27853,27854,27855,27857,27858,27864,27865,27866,27868,27869,27871,27876,27878,27879,27881,27884,27885,27890,27892,27897,27903,27904,27906,27907,27909,27910,27912,27913,27914,27917,27919,27920,27921,27923,27924,27925,27926,27928,27932,27933,27935,27936,27937,27938,27939,27940,27942,27944,27945,27948,27949,27951,27952,27956,27958,27959,27960,27962,27967,27968,27970,27972,27977,27980,27984,27989,27990,27991,27992,27995,27997,27999,28001,28002,28004,28005,28007,28008,28011,28012,28013,28016,28017,28018,28019,28021,28022,28025,28026,28027,28029,28030,28031,28032,28033,28035,28036,28038,28039,28042,28043,28045,28047,28048,28050,28054,28055,28056,28057,28058,28060,28066,28069,28076,28077,28080,28081,28083,28084,28086,28087,28089,28090,28091,28092,28093,28094,28097,28098,28099,28104,28105,28106,28109,28110,28111,28112,28114,28115,28116,28117,28119,28122,28123,28124,28127,28130,28131,28133,28135,28136,28137,28138,28141,28143,28144,28146,28148,28149,28150,28152,28154,28157,28158,28159,28160,28161,28162,28163,28164,28166,28167,28168,28169,28171,28175,28178,28179,28181,28184,28185,28187,28188,28190,28191,28194,28198,28199,28200,28202,28204,28206,28208,28209,28211,28213,28214,28215,28217,28219,28220,28221,28222,28223,28224,28225,28226,28229,28230,28231,28232,28233,28234,28235,28236,28239,28240,28241,28242,28245,28247,28249,28250,28252,28253,28254,28256,28257,28258,28259,28260,28261,28262,28263,28264,28265,28266,28268,28269,28271,28272,28273,28274,28275,28276,28277,28278,28279,28280,28281,28282,28283,28284,28285,28288,28289,28290,28292,28295,28296,28298,28299,28300,28301,28302,28305,28306,28307,28308,28309,28310,28311,28313,28314,28315,28317,28318,28320,28321,28323,28324,28326,28328,28329,28331,28332,28333,28334,28336,28339,28341,28344,28345,28348,28350,28351,28352,28355,28356,28357,28358,28360,28361,28362,28364,28365,28366,28368,28370,28374,28376,28377,28379,28380,28381,28387,28391,28394,28395,28396,28397,28398,28399,28400,28401,28402,28403,28405,28406,28407,28408,28410,28411,28412,28413,28414,28415,28416,28417,28419,28420,28421,28423,28424,28426,28427,28428,28429,28430,28432,28433,28434,28438,28439,28440,28441,28442,28443,28444,28445,28446,28447,28449,28450,28451,28453,28454,28455,28456,28460,28462,28464,28466,28468,28469,28471,28472,28473,28474,28475,28476,28477,28479,28480,28481,28482,28483,28484,28485,28488,28489,28490,28492,28494,28495,28496,28497,28498,28499,28500,28501,28502,28503,28505,28506,28507,28509,28511,28512,28513,28515,28516,28517,28519,28520,28521,28522,28523,28524,28527,28528,28529,28531,28533,28534,28535,28537,28539,28541,28542,28543,28544,28545,28546,28547,28549,28550,28551,28554,28555,28559,28560,28561,28562,28563,28564,28565,28566,28567,28568,28569,28570,28571,28573,28574,28575,28576,28578,28579,28580,28581,28582,28584,28585,28586,28587,28588,28589,28590,28591,28592,28593,28594,28596,28597,28599,28600,28602,28603,28604,28605,28606,28607,28609,28611,28612,28613,28614,28615,28616,28618,28619,28620,28621,28622,28623,28624,28627,28628,28629,28630,28631,28632,28633,28634,28635,28636,28637,28639,28642,28643,28644,28645,28646,28647,28648,28649,28650,28651,28652,28653,28656,28657,28658,28659,28660,28661,28662,28663,28664,28665,28666,28667,28668,28669,28670,28671,28672,28673,28674,28675,28676,28677,28678,28679,28680,28681,28682,28683,28684,28685,28686,28687,28688,28690,28691,28692,28693,28694,28695,28696,28697,28700,28701,28702,28703,28704,28705,28706,28708,28709,28710,28711,28712,28713,28714,28715,28716,28717,28718,28719,28720,28721,28722,28723,28724,28726,28727,28728,28730,28731,28732,28733,28734,28735,28736,28737,28738,28739,28740,28741,28742,28743,28744,28745,28746,28747,28749,28750,28752,28753,28754,28755,28756,28757,28758,28759,28760,28761,28762,28763,28764,28765,28767,28768,28769,28770,28771,28772,28773,28774,28775,28776,28777,28778,28782,28785,28786,28787,28788,28791,28793,28794,28795,28797,28801,28802,28803,28804,28806,28807,28808,28811,28812,28813,28815,28816,28817,28819,28823,28824,28826,28827,28830,28831,28832,28833,28834,28835,28836,28837,28838,28839,28840,28841,28842,28848,28850,28852,28853,28854,28858,28862,28863,28868,28869,28870,28871,28873,28875,28876,28877,28878,28879,28880,28881,28882,28883,28884,28885,28886,28887,28890,28892,28893,28894,28896,28897,28898,28899,28901,28906,28910,28912,28913,28914,28915,28916,28917,28918,28920,28922,28923,28924,28926,28927,28928,28929,28930,28931,28932,28933,28934,28935,28936,28939,28940,28941,28942,28943,28945,28946,28948,28951,28955,28956,28957,28958,28959,28960,28961,28962,28963,28964,28965,28967,28968,28969,28970,28971,28972,28973,28974,28978,28979,28980,28981,28983,28984,28985,28986,28987,28988,28989,28990,28991,28992,28993,28994,28995,28996,28998,28999,29000,29001,29003,29005,29007,29008,29009,29010,29011,29012,29013,29014,29015,29016,29017,29018,29019,29021,29023,29024,29025,29026,29027,29029,29033,29034,29035,29036,29037,29039,29040,29041,29044,29045,29046,29047,29049,29051,29052,29054,29055,29056,29057,29058,29059,29061,29062,29063,29064,29065,29067,29068,29069,29070,29072,29073,29074,29075,29077,29078,29079,29082,29083,29084,29085,29086,29089,29090,29091,29092,29093,29094,29095,29097,29098,29099,29101,29102,29103,29104,29105,29106,29108,29110,29111,29112,29114,29115,29116,29117,29118,29119,29120,29121,29122,29124,29125,29126,29127,29128,29129,29130,29131,29132,29133,29135,29136,29137,29138,29139,29142,29143,29144,29145,29146,29147,29148,29149,29150,29151,29153,29154,29155,29156,29158,29160,29161,29162,29163,29164,29165,29167,29168,29169,29170,29171,29172,29173,29174,29175,29176,29178,29179,29180,29181,29182,29183,29184,29185,29186,29187,29188,29189,29191,29192,29193,29194,29195,29196,29197,29198,29199,29200,29201,29202,29203,29204,29205,29206,29207,29208,29209,29210,29211,29212,29214,29215,29216,29217,29218,29219,29220,29221,29222,29223,29225,29227,29229,29230,29231,29234,29235,29236,29242,29244,29246,29248,29249,29250,29251,29252,29253,29254,29257,29258,29259,29262,29263,29264,29265,29267,29268,29269,29271,29272,29274,29276,29278,29280,29283,29284,29285,29288,29290,29291,29292,29293,29296,29297,29299,29300,29302,29303,29304,29307,29308,29309,29314,29315,29317,29318,29319,29320,29321,29324,29326,29328,29329,29331,29332,29333,29334,29335,29336,29337,29338,29339,29340,29341,29342,29344,29345,29346,29347,29348,29349,29350,29351,29352,29353,29354,29355,29358,29361,29362,29363,29365,29370,29371,29372,29373,29374,29375,29376,29381,29382,29383,29385,29386,29387,29388,29391,29393,29395,29396,29397,29398,29400,29402,29403,58566,58567,58568,58569,58570,58571,58572,58573,58574,58575,58576,58577,58578,58579,58580,58581,58582,58583,58584,58585,58586,58587,58588,58589,58590,58591,58592,58593,58594,58595,58596,58597,58598,58599,58600,58601,58602,58603,58604,58605,58606,58607,58608,58609,58610,58611,58612,58613,58614,58615,58616,58617,58618,58619,58620,58621,58622,58623,58624,58625,58626,58627,58628,58629,58630,58631,58632,58633,58634,58635,58636,58637,58638,58639,58640,58641,58642,58643,58644,58645,58646,58647,58648,58649,58650,58651,58652,58653,58654,58655,58656,58657,58658,58659,58660,58661,12288,12289,12290,183,713,711,168,12291,12293,8212,65374,8214,8230,8216,8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12310,12311,12304,12305,177,215,247,8758,8743,8744,8721,8719,8746,8745,8712,8759,8730,8869,8741,8736,8978,8857,8747,8750,8801,8780,8776,8765,8733,8800,8814,8815,8804,8805,8734,8757,8756,9794,9792,176,8242,8243,8451,65284,164,65504,65505,8240,167,8470,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,8251,8594,8592,8593,8595,12307,58662,58663,58664,58665,58666,58667,58668,58669,58670,58671,58672,58673,58674,58675,58676,58677,58678,58679,58680,58681,58682,58683,58684,58685,58686,58687,58688,58689,58690,58691,58692,58693,58694,58695,58696,58697,58698,58699,58700,58701,58702,58703,58704,58705,58706,58707,58708,58709,58710,58711,58712,58713,58714,58715,58716,58717,58718,58719,58720,58721,58722,58723,58724,58725,58726,58727,58728,58729,58730,58731,58732,58733,58734,58735,58736,58737,58738,58739,58740,58741,58742,58743,58744,58745,58746,58747,58748,58749,58750,58751,58752,58753,58754,58755,58756,58757,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,59238,59239,59240,59241,59242,59243,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,9350,9351,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,8364,59245,12832,12833,12834,12835,12836,12837,12838,12839,12840,12841,59246,59247,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,59248,59249,58758,58759,58760,58761,58762,58763,58764,58765,58766,58767,58768,58769,58770,58771,58772,58773,58774,58775,58776,58777,58778,58779,58780,58781,58782,58783,58784,58785,58786,58787,58788,58789,58790,58791,58792,58793,58794,58795,58796,58797,58798,58799,58800,58801,58802,58803,58804,58805,58806,58807,58808,58809,58810,58811,58812,58813,58814,58815,58816,58817,58818,58819,58820,58821,58822,58823,58824,58825,58826,58827,58828,58829,58830,58831,58832,58833,58834,58835,58836,58837,58838,58839,58840,58841,58842,58843,58844,58845,58846,58847,58848,58849,58850,58851,58852,12288,65281,65282,65283,65509,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65339,65340,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,58854,58855,58856,58857,58858,58859,58860,58861,58862,58863,58864,58865,58866,58867,58868,58869,58870,58871,58872,58873,58874,58875,58876,58877,58878,58879,58880,58881,58882,58883,58884,58885,58886,58887,58888,58889,58890,58891,58892,58893,58894,58895,58896,58897,58898,58899,58900,58901,58902,58903,58904,58905,58906,58907,58908,58909,58910,58911,58912,58913,58914,58915,58916,58917,58918,58919,58920,58921,58922,58923,58924,58925,58926,58927,58928,58929,58930,58931,58932,58933,58934,58935,58936,58937,58938,58939,58940,58941,58942,58943,58944,58945,58946,58947,58948,58949,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,59250,59251,59252,59253,59254,59255,59256,59257,59258,59259,59260,58950,58951,58952,58953,58954,58955,58956,58957,58958,58959,58960,58961,58962,58963,58964,58965,58966,58967,58968,58969,58970,58971,58972,58973,58974,58975,58976,58977,58978,58979,58980,58981,58982,58983,58984,58985,58986,58987,58988,58989,58990,58991,58992,58993,58994,58995,58996,58997,58998,58999,59000,59001,59002,59003,59004,59005,59006,59007,59008,59009,59010,59011,59012,59013,59014,59015,59016,59017,59018,59019,59020,59021,59022,59023,59024,59025,59026,59027,59028,59029,59030,59031,59032,59033,59034,59035,59036,59037,59038,59039,59040,59041,59042,59043,59044,59045,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,59261,59262,59263,59264,59265,59266,59267,59268,59046,59047,59048,59049,59050,59051,59052,59053,59054,59055,59056,59057,59058,59059,59060,59061,59062,59063,59064,59065,59066,59067,59068,59069,59070,59071,59072,59073,59074,59075,59076,59077,59078,59079,59080,59081,59082,59083,59084,59085,59086,59087,59088,59089,59090,59091,59092,59093,59094,59095,59096,59097,59098,59099,59100,59101,59102,59103,59104,59105,59106,59107,59108,59109,59110,59111,59112,59113,59114,59115,59116,59117,59118,59119,59120,59121,59122,59123,59124,59125,59126,59127,59128,59129,59130,59131,59132,59133,59134,59135,59136,59137,59138,59139,59140,59141,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,59269,59270,59271,59272,59273,59274,59275,59276,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,59277,59278,59279,59280,59281,59282,59283,65077,65078,65081,65082,65087,65088,65085,65086,65089,65090,65091,65092,59284,59285,65083,65084,65079,65080,65073,59286,65075,65076,59287,59288,59289,59290,59291,59292,59293,59294,59295,59142,59143,59144,59145,59146,59147,59148,59149,59150,59151,59152,59153,59154,59155,59156,59157,59158,59159,59160,59161,59162,59163,59164,59165,59166,59167,59168,59169,59170,59171,59172,59173,59174,59175,59176,59177,59178,59179,59180,59181,59182,59183,59184,59185,59186,59187,59188,59189,59190,59191,59192,59193,59194,59195,59196,59197,59198,59199,59200,59201,59202,59203,59204,59205,59206,59207,59208,59209,59210,59211,59212,59213,59214,59215,59216,59217,59218,59219,59220,59221,59222,59223,59224,59225,59226,59227,59228,59229,59230,59231,59232,59233,59234,59235,59236,59237,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,59296,59297,59298,59299,59300,59301,59302,59303,59304,59305,59306,59307,59308,59309,59310,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,59311,59312,59313,59314,59315,59316,59317,59318,59319,59320,59321,59322,59323,714,715,729,8211,8213,8229,8245,8453,8457,8598,8599,8600,8601,8725,8735,8739,8786,8806,8807,8895,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9601,9602,9603,9604,9605,9606,9607,9608,9609,9610,9611,9612,9613,9614,9615,9619,9620,9621,9660,9661,9698,9699,9700,9701,9737,8853,12306,12317,12318,59324,59325,59326,59327,59328,59329,59330,59331,59332,59333,59334,257,225,462,224,275,233,283,232,299,237,464,236,333,243,466,242,363,250,468,249,470,472,474,476,252,234,593,7743,324,328,505,609,59337,59338,59339,59340,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,59341,59342,59343,59344,59345,59346,59347,59348,59349,59350,59351,59352,59353,59354,59355,59356,59357,59358,59359,59360,59361,12321,12322,12323,12324,12325,12326,12327,12328,12329,12963,13198,13199,13212,13213,13214,13217,13252,13262,13265,13266,13269,65072,65506,65508,59362,8481,12849,59363,8208,59364,59365,59366,12540,12443,12444,12541,12542,12294,12445,12446,65097,65098,65099,65100,65101,65102,65103,65104,65105,65106,65108,65109,65110,65111,65113,65114,65115,65116,65117,65118,65119,65120,65121,65122,65123,65124,65125,65126,65128,65129,65130,65131,12350,12272,12273,12274,12275,12276,12277,12278,12279,12280,12281,12282,12283,12295,59380,59381,59382,59383,59384,59385,59386,59387,59388,59389,59390,59391,59392,9472,9473,9474,9475,9476,9477,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,59393,59394,59395,59396,59397,59398,59399,59400,59401,59402,59403,59404,59405,59406,59407,29404,29405,29407,29410,29411,29412,29413,29414,29415,29418,29419,29429,29430,29433,29437,29438,29439,29440,29442,29444,29445,29446,29447,29448,29449,29451,29452,29453,29455,29456,29457,29458,29460,29464,29465,29466,29471,29472,29475,29476,29478,29479,29480,29485,29487,29488,29490,29491,29493,29494,29498,29499,29500,29501,29504,29505,29506,29507,29508,29509,29510,29511,29512,29513,29514,29515,29516,29518,29519,29521,29523,29524,29525,29526,29528,29529,29530,29531,29532,29533,29534,29535,29537,29538,29539,29540,29541,29542,29543,29544,29545,29546,29547,29550,29552,29553,57344,57345,57346,57347,57348,57349,57350,57351,57352,57353,57354,57355,57356,57357,57358,57359,57360,57361,57362,57363,57364,57365,57366,57367,57368,57369,57370,57371,57372,57373,57374,57375,57376,57377,57378,57379,57380,57381,57382,57383,57384,57385,57386,57387,57388,57389,57390,57391,57392,57393,57394,57395,57396,57397,57398,57399,57400,57401,57402,57403,57404,57405,57406,57407,57408,57409,57410,57411,57412,57413,57414,57415,57416,57417,57418,57419,57420,57421,57422,57423,57424,57425,57426,57427,57428,57429,57430,57431,57432,57433,57434,57435,57436,57437,29554,29555,29556,29557,29558,29559,29560,29561,29562,29563,29564,29565,29567,29568,29569,29570,29571,29573,29574,29576,29578,29580,29581,29583,29584,29586,29587,29588,29589,29591,29592,29593,29594,29596,29597,29598,29600,29601,29603,29604,29605,29606,29607,29608,29610,29612,29613,29617,29620,29621,29622,29624,29625,29628,29629,29630,29631,29633,29635,29636,29637,29638,29639,29643,29644,29646,29650,29651,29652,29653,29654,29655,29656,29658,29659,29660,29661,29663,29665,29666,29667,29668,29670,29672,29674,29675,29676,29678,29679,29680,29681,29683,29684,29685,29686,29687,57438,57439,57440,57441,57442,57443,57444,57445,57446,57447,57448,57449,57450,57451,57452,57453,57454,57455,57456,57457,57458,57459,57460,57461,57462,57463,57464,57465,57466,57467,57468,57469,57470,57471,57472,57473,57474,57475,57476,57477,57478,57479,57480,57481,57482,57483,57484,57485,57486,57487,57488,57489,57490,57491,57492,57493,57494,57495,57496,57497,57498,57499,57500,57501,57502,57503,57504,57505,57506,57507,57508,57509,57510,57511,57512,57513,57514,57515,57516,57517,57518,57519,57520,57521,57522,57523,57524,57525,57526,57527,57528,57529,57530,57531,29688,29689,29690,29691,29692,29693,29694,29695,29696,29697,29698,29700,29703,29704,29707,29708,29709,29710,29713,29714,29715,29716,29717,29718,29719,29720,29721,29724,29725,29726,29727,29728,29729,29731,29732,29735,29737,29739,29741,29743,29745,29746,29751,29752,29753,29754,29755,29757,29758,29759,29760,29762,29763,29764,29765,29766,29767,29768,29769,29770,29771,29772,29773,29774,29775,29776,29777,29778,29779,29780,29782,29784,29789,29792,29793,29794,29795,29796,29797,29798,29799,29800,29801,29802,29803,29804,29806,29807,29809,29810,29811,29812,29813,29816,29817,29818,57532,57533,57534,57535,57536,57537,57538,57539,57540,57541,57542,57543,57544,57545,57546,57547,57548,57549,57550,57551,57552,57553,57554,57555,57556,57557,57558,57559,57560,57561,57562,57563,57564,57565,57566,57567,57568,57569,57570,57571,57572,57573,57574,57575,57576,57577,57578,57579,57580,57581,57582,57583,57584,57585,57586,57587,57588,57589,57590,57591,57592,57593,57594,57595,57596,57597,57598,57599,57600,57601,57602,57603,57604,57605,57606,57607,57608,57609,57610,57611,57612,57613,57614,57615,57616,57617,57618,57619,57620,57621,57622,57623,57624,57625,29819,29820,29821,29823,29826,29828,29829,29830,29832,29833,29834,29836,29837,29839,29841,29842,29843,29844,29845,29846,29847,29848,29849,29850,29851,29853,29855,29856,29857,29858,29859,29860,29861,29862,29866,29867,29868,29869,29870,29871,29872,29873,29874,29875,29876,29877,29878,29879,29880,29881,29883,29884,29885,29886,29887,29888,29889,29890,29891,29892,29893,29894,29895,29896,29897,29898,29899,29900,29901,29902,29903,29904,29905,29907,29908,29909,29910,29911,29912,29913,29914,29915,29917,29919,29921,29925,29927,29928,29929,29930,29931,29932,29933,29936,29937,29938,57626,57627,57628,57629,57630,57631,57632,57633,57634,57635,57636,57637,57638,57639,57640,57641,57642,57643,57644,57645,57646,57647,57648,57649,57650,57651,57652,57653,57654,57655,57656,57657,57658,57659,57660,57661,57662,57663,57664,57665,57666,57667,57668,57669,57670,57671,57672,57673,57674,57675,57676,57677,57678,57679,57680,57681,57682,57683,57684,57685,57686,57687,57688,57689,57690,57691,57692,57693,57694,57695,57696,57697,57698,57699,57700,57701,57702,57703,57704,57705,57706,57707,57708,57709,57710,57711,57712,57713,57714,57715,57716,57717,57718,57719,29939,29941,29944,29945,29946,29947,29948,29949,29950,29952,29953,29954,29955,29957,29958,29959,29960,29961,29962,29963,29964,29966,29968,29970,29972,29973,29974,29975,29979,29981,29982,29984,29985,29986,29987,29988,29990,29991,29994,29998,30004,30006,30009,30012,30013,30015,30017,30018,30019,30020,30022,30023,30025,30026,30029,30032,30033,30034,30035,30037,30038,30039,30040,30045,30046,30047,30048,30049,30050,30051,30052,30055,30056,30057,30059,30060,30061,30062,30063,30064,30065,30067,30069,30070,30071,30074,30075,30076,30077,30078,30080,30081,30082,30084,30085,30087,57720,57721,57722,57723,57724,57725,57726,57727,57728,57729,57730,57731,57732,57733,57734,57735,57736,57737,57738,57739,57740,57741,57742,57743,57744,57745,57746,57747,57748,57749,57750,57751,57752,57753,57754,57755,57756,57757,57758,57759,57760,57761,57762,57763,57764,57765,57766,57767,57768,57769,57770,57771,57772,57773,57774,57775,57776,57777,57778,57779,57780,57781,57782,57783,57784,57785,57786,57787,57788,57789,57790,57791,57792,57793,57794,57795,57796,57797,57798,57799,57800,57801,57802,57803,57804,57805,57806,57807,57808,57809,57810,57811,57812,57813,30088,30089,30090,30092,30093,30094,30096,30099,30101,30104,30107,30108,30110,30114,30118,30119,30120,30121,30122,30125,30134,30135,30138,30139,30143,30144,30145,30150,30155,30156,30158,30159,30160,30161,30163,30167,30169,30170,30172,30173,30175,30176,30177,30181,30185,30188,30189,30190,30191,30194,30195,30197,30198,30199,30200,30202,30203,30205,30206,30210,30212,30214,30215,30216,30217,30219,30221,30222,30223,30225,30226,30227,30228,30230,30234,30236,30237,30238,30241,30243,30247,30248,30252,30254,30255,30257,30258,30262,30263,30265,30266,30267,30269,30273,30274,30276,57814,57815,57816,57817,57818,57819,57820,57821,57822,57823,57824,57825,57826,57827,57828,57829,57830,57831,57832,57833,57834,57835,57836,57837,57838,57839,57840,57841,57842,57843,57844,57845,57846,57847,57848,57849,57850,57851,57852,57853,57854,57855,57856,57857,57858,57859,57860,57861,57862,57863,57864,57865,57866,57867,57868,57869,57870,57871,57872,57873,57874,57875,57876,57877,57878,57879,57880,57881,57882,57883,57884,57885,57886,57887,57888,57889,57890,57891,57892,57893,57894,57895,57896,57897,57898,57899,57900,57901,57902,57903,57904,57905,57906,57907,30277,30278,30279,30280,30281,30282,30283,30286,30287,30288,30289,30290,30291,30293,30295,30296,30297,30298,30299,30301,30303,30304,30305,30306,30308,30309,30310,30311,30312,30313,30314,30316,30317,30318,30320,30321,30322,30323,30324,30325,30326,30327,30329,30330,30332,30335,30336,30337,30339,30341,30345,30346,30348,30349,30351,30352,30354,30356,30357,30359,30360,30362,30363,30364,30365,30366,30367,30368,30369,30370,30371,30373,30374,30375,30376,30377,30378,30379,30380,30381,30383,30384,30387,30389,30390,30391,30392,30393,30394,30395,30396,30397,30398,30400,30401,30403,21834,38463,22467,25384,21710,21769,21696,30353,30284,34108,30702,33406,30861,29233,38552,38797,27688,23433,20474,25353,26263,23736,33018,26696,32942,26114,30414,20985,25942,29100,32753,34948,20658,22885,25034,28595,33453,25420,25170,21485,21543,31494,20843,30116,24052,25300,36299,38774,25226,32793,22365,38712,32610,29240,30333,26575,30334,25670,20336,36133,25308,31255,26001,29677,25644,25203,33324,39041,26495,29256,25198,25292,20276,29923,21322,21150,32458,37030,24110,26758,27036,33152,32465,26834,30917,34444,38225,20621,35876,33502,32990,21253,35090,21093,30404,30407,30409,30411,30412,30419,30421,30425,30426,30428,30429,30430,30432,30433,30434,30435,30436,30438,30439,30440,30441,30442,30443,30444,30445,30448,30451,30453,30454,30455,30458,30459,30461,30463,30464,30466,30467,30469,30470,30474,30476,30478,30479,30480,30481,30482,30483,30484,30485,30486,30487,30488,30491,30492,30493,30494,30497,30499,30500,30501,30503,30506,30507,30508,30510,30512,30513,30514,30515,30516,30521,30523,30525,30526,30527,30530,30532,30533,30534,30536,30537,30538,30539,30540,30541,30542,30543,30546,30547,30548,30549,30550,30551,30552,30553,30556,34180,38649,20445,22561,39281,23453,25265,25253,26292,35961,40077,29190,26479,30865,24754,21329,21271,36744,32972,36125,38049,20493,29384,22791,24811,28953,34987,22868,33519,26412,31528,23849,32503,29997,27893,36454,36856,36924,40763,27604,37145,31508,24444,30887,34006,34109,27605,27609,27606,24065,24199,30201,38381,25949,24330,24517,36767,22721,33218,36991,38491,38829,36793,32534,36140,25153,20415,21464,21342,36776,36777,36779,36941,26631,24426,33176,34920,40150,24971,21035,30250,24428,25996,28626,28392,23486,25672,20853,20912,26564,19993,31177,39292,28851,30557,30558,30559,30560,30564,30567,30569,30570,30573,30574,30575,30576,30577,30578,30579,30580,30581,30582,30583,30584,30586,30587,30588,30593,30594,30595,30598,30599,30600,30601,30602,30603,30607,30608,30611,30612,30613,30614,30615,30616,30617,30618,30619,30620,30621,30622,30625,30627,30628,30630,30632,30635,30637,30638,30639,30641,30642,30644,30646,30647,30648,30649,30650,30652,30654,30656,30657,30658,30659,30660,30661,30662,30663,30664,30665,30666,30667,30668,30670,30671,30672,30673,30674,30675,30676,30677,30678,30680,30681,30682,30685,30686,30687,30688,30689,30692,30149,24182,29627,33760,25773,25320,38069,27874,21338,21187,25615,38082,31636,20271,24091,33334,33046,33162,28196,27850,39539,25429,21340,21754,34917,22496,19981,24067,27493,31807,37096,24598,25830,29468,35009,26448,25165,36130,30572,36393,37319,24425,33756,34081,39184,21442,34453,27531,24813,24808,28799,33485,33329,20179,27815,34255,25805,31961,27133,26361,33609,21397,31574,20391,20876,27979,23618,36461,25554,21449,33580,33590,26597,30900,25661,23519,23700,24046,35815,25286,26612,35962,25600,25530,34633,39307,35863,32544,38130,20135,38416,39076,26124,29462,30694,30696,30698,30703,30704,30705,30706,30708,30709,30711,30713,30714,30715,30716,30723,30724,30725,30726,30727,30728,30730,30731,30734,30735,30736,30739,30741,30745,30747,30750,30752,30753,30754,30756,30760,30762,30763,30766,30767,30769,30770,30771,30773,30774,30781,30783,30785,30786,30787,30788,30790,30792,30793,30794,30795,30797,30799,30801,30803,30804,30808,30809,30810,30811,30812,30814,30815,30816,30817,30818,30819,30820,30821,30822,30823,30824,30825,30831,30832,30833,30834,30835,30836,30837,30838,30840,30841,30842,30843,30845,30846,30847,30848,30849,30850,30851,22330,23581,24120,38271,20607,32928,21378,25950,30021,21809,20513,36229,25220,38046,26397,22066,28526,24034,21557,28818,36710,25199,25764,25507,24443,28552,37108,33251,36784,23576,26216,24561,27785,38472,36225,34924,25745,31216,22478,27225,25104,21576,20056,31243,24809,28548,35802,25215,36894,39563,31204,21507,30196,25345,21273,27744,36831,24347,39536,32827,40831,20360,23610,36196,32709,26021,28861,20805,20914,34411,23815,23456,25277,37228,30068,36364,31264,24833,31609,20167,32504,30597,19985,33261,21021,20986,27249,21416,36487,38148,38607,28353,38500,26970,30852,30853,30854,30856,30858,30859,30863,30864,30866,30868,30869,30870,30873,30877,30878,30880,30882,30884,30886,30888,30889,30890,30891,30892,30893,30894,30895,30901,30902,30903,30904,30906,30907,30908,30909,30911,30912,30914,30915,30916,30918,30919,30920,30924,30925,30926,30927,30929,30930,30931,30934,30935,30936,30938,30939,30940,30941,30942,30943,30944,30945,30946,30947,30948,30949,30950,30951,30953,30954,30955,30957,30958,30959,30960,30961,30963,30965,30966,30968,30969,30971,30972,30973,30974,30975,30976,30978,30979,30980,30982,30983,30984,30985,30986,30987,30988,30784,20648,30679,25616,35302,22788,25571,24029,31359,26941,20256,33337,21912,20018,30126,31383,24162,24202,38383,21019,21561,28810,25462,38180,22402,26149,26943,37255,21767,28147,32431,34850,25139,32496,30133,33576,30913,38604,36766,24904,29943,35789,27492,21050,36176,27425,32874,33905,22257,21254,20174,19995,20945,31895,37259,31751,20419,36479,31713,31388,25703,23828,20652,33030,30209,31929,28140,32736,26449,23384,23544,30923,25774,25619,25514,25387,38169,25645,36798,31572,30249,25171,22823,21574,27513,20643,25140,24102,27526,20195,36151,34955,24453,36910,30989,30990,30991,30992,30993,30994,30996,30997,30998,30999,31000,31001,31002,31003,31004,31005,31007,31008,31009,31010,31011,31013,31014,31015,31016,31017,31018,31019,31020,31021,31022,31023,31024,31025,31026,31027,31029,31030,31031,31032,31033,31037,31039,31042,31043,31044,31045,31047,31050,31051,31052,31053,31054,31055,31056,31057,31058,31060,31061,31064,31065,31073,31075,31076,31078,31081,31082,31083,31084,31086,31088,31089,31090,31091,31092,31093,31094,31097,31099,31100,31101,31102,31103,31106,31107,31110,31111,31112,31113,31115,31116,31117,31118,31120,31121,31122,24608,32829,25285,20025,21333,37112,25528,32966,26086,27694,20294,24814,28129,35806,24377,34507,24403,25377,20826,33633,26723,20992,25443,36424,20498,23707,31095,23548,21040,31291,24764,36947,30423,24503,24471,30340,36460,28783,30331,31561,30634,20979,37011,22564,20302,28404,36842,25932,31515,29380,28068,32735,23265,25269,24213,22320,33922,31532,24093,24351,36882,32532,39072,25474,28359,30872,28857,20856,38747,22443,30005,20291,30008,24215,24806,22880,28096,27583,30857,21500,38613,20939,20993,25481,21514,38035,35843,36300,29241,30879,34678,36845,35853,21472,31123,31124,31125,31126,31127,31128,31129,31131,31132,31133,31134,31135,31136,31137,31138,31139,31140,31141,31142,31144,31145,31146,31147,31148,31149,31150,31151,31152,31153,31154,31156,31157,31158,31159,31160,31164,31167,31170,31172,31173,31175,31176,31178,31180,31182,31183,31184,31187,31188,31190,31191,31193,31194,31195,31196,31197,31198,31200,31201,31202,31205,31208,31210,31212,31214,31217,31218,31219,31220,31221,31222,31223,31225,31226,31228,31230,31231,31233,31236,31237,31239,31240,31241,31242,31244,31247,31248,31249,31250,31251,31253,31254,31256,31257,31259,31260,19969,30447,21486,38025,39030,40718,38189,23450,35746,20002,19996,20908,33891,25026,21160,26635,20375,24683,20923,27934,20828,25238,26007,38497,35910,36887,30168,37117,30563,27602,29322,29420,35835,22581,30585,36172,26460,38208,32922,24230,28193,22930,31471,30701,38203,27573,26029,32526,22534,20817,38431,23545,22697,21544,36466,25958,39039,22244,38045,30462,36929,25479,21702,22810,22842,22427,36530,26421,36346,33333,21057,24816,22549,34558,23784,40517,20420,39069,35769,23077,24694,21380,25212,36943,37122,39295,24681,32780,20799,32819,23572,39285,27953,20108,31261,31263,31265,31266,31268,31269,31270,31271,31272,31273,31274,31275,31276,31277,31278,31279,31280,31281,31282,31284,31285,31286,31288,31290,31294,31296,31297,31298,31299,31300,31301,31303,31304,31305,31306,31307,31308,31309,31310,31311,31312,31314,31315,31316,31317,31318,31320,31321,31322,31323,31324,31325,31326,31327,31328,31329,31330,31331,31332,31333,31334,31335,31336,31337,31338,31339,31340,31341,31342,31343,31345,31346,31347,31349,31355,31356,31357,31358,31362,31365,31367,31369,31370,31371,31372,31374,31375,31376,31379,31380,31385,31386,31387,31390,31393,31394,36144,21457,32602,31567,20240,20047,38400,27861,29648,34281,24070,30058,32763,27146,30718,38034,32321,20961,28902,21453,36820,33539,36137,29359,39277,27867,22346,33459,26041,32938,25151,38450,22952,20223,35775,32442,25918,33778,38750,21857,39134,32933,21290,35837,21536,32954,24223,27832,36153,33452,37210,21545,27675,20998,32439,22367,28954,27774,31881,22859,20221,24575,24868,31914,20016,23553,26539,34562,23792,38155,39118,30127,28925,36898,20911,32541,35773,22857,20964,20315,21542,22827,25975,32932,23413,25206,25282,36752,24133,27679,31526,20239,20440,26381,31395,31396,31399,31401,31402,31403,31406,31407,31408,31409,31410,31412,31413,31414,31415,31416,31417,31418,31419,31420,31421,31422,31424,31425,31426,31427,31428,31429,31430,31431,31432,31433,31434,31436,31437,31438,31439,31440,31441,31442,31443,31444,31445,31447,31448,31450,31451,31452,31453,31457,31458,31460,31463,31464,31465,31466,31467,31468,31470,31472,31473,31474,31475,31476,31477,31478,31479,31480,31483,31484,31486,31488,31489,31490,31493,31495,31497,31500,31501,31502,31504,31506,31507,31510,31511,31512,31514,31516,31517,31519,31521,31522,31523,31527,31529,31533,28014,28074,31119,34993,24343,29995,25242,36741,20463,37340,26023,33071,33105,24220,33104,36212,21103,35206,36171,22797,20613,20184,38428,29238,33145,36127,23500,35747,38468,22919,32538,21648,22134,22030,35813,25913,27010,38041,30422,28297,24178,29976,26438,26577,31487,32925,36214,24863,31174,25954,36195,20872,21018,38050,32568,32923,32434,23703,28207,26464,31705,30347,39640,33167,32660,31957,25630,38224,31295,21578,21733,27468,25601,25096,40509,33011,30105,21106,38761,33883,26684,34532,38401,38548,38124,20010,21508,32473,26681,36319,32789,26356,24218,32697,31535,31536,31538,31540,31541,31542,31543,31545,31547,31549,31551,31552,31553,31554,31555,31556,31558,31560,31562,31565,31566,31571,31573,31575,31577,31580,31582,31583,31585,31587,31588,31589,31590,31591,31592,31593,31594,31595,31596,31597,31599,31600,31603,31604,31606,31608,31610,31612,31613,31615,31617,31618,31619,31620,31622,31623,31624,31625,31626,31627,31628,31630,31631,31633,31634,31635,31638,31640,31641,31642,31643,31646,31647,31648,31651,31652,31653,31662,31663,31664,31666,31667,31669,31670,31671,31673,31674,31675,31676,31677,31678,31679,31680,31682,31683,31684,22466,32831,26775,24037,25915,21151,24685,40858,20379,36524,20844,23467,24339,24041,27742,25329,36129,20849,38057,21246,27807,33503,29399,22434,26500,36141,22815,36764,33735,21653,31629,20272,27837,23396,22993,40723,21476,34506,39592,35895,32929,25925,39038,22266,38599,21038,29916,21072,23521,25346,35074,20054,25296,24618,26874,20851,23448,20896,35266,31649,39302,32592,24815,28748,36143,20809,24191,36891,29808,35268,22317,30789,24402,40863,38394,36712,39740,35809,30328,26690,26588,36330,36149,21053,36746,28378,26829,38149,37101,22269,26524,35065,36807,21704,31685,31688,31689,31690,31691,31693,31694,31695,31696,31698,31700,31701,31702,31703,31704,31707,31708,31710,31711,31712,31714,31715,31716,31719,31720,31721,31723,31724,31725,31727,31728,31730,31731,31732,31733,31734,31736,31737,31738,31739,31741,31743,31744,31745,31746,31747,31748,31749,31750,31752,31753,31754,31757,31758,31760,31761,31762,31763,31764,31765,31767,31768,31769,31770,31771,31772,31773,31774,31776,31777,31778,31779,31780,31781,31784,31785,31787,31788,31789,31790,31791,31792,31793,31794,31795,31796,31797,31798,31799,31801,31802,31803,31804,31805,31806,31810,39608,23401,28023,27686,20133,23475,39559,37219,25000,37039,38889,21547,28085,23506,20989,21898,32597,32752,25788,25421,26097,25022,24717,28938,27735,27721,22831,26477,33322,22741,22158,35946,27627,37085,22909,32791,21495,28009,21621,21917,33655,33743,26680,31166,21644,20309,21512,30418,35977,38402,27827,28088,36203,35088,40548,36154,22079,40657,30165,24456,29408,24680,21756,20136,27178,34913,24658,36720,21700,28888,34425,40511,27946,23439,24344,32418,21897,20399,29492,21564,21402,20505,21518,21628,20046,24573,29786,22774,33899,32993,34676,29392,31946,28246,31811,31812,31813,31814,31815,31816,31817,31818,31819,31820,31822,31823,31824,31825,31826,31827,31828,31829,31830,31831,31832,31833,31834,31835,31836,31837,31838,31839,31840,31841,31842,31843,31844,31845,31846,31847,31848,31849,31850,31851,31852,31853,31854,31855,31856,31857,31858,31861,31862,31863,31864,31865,31866,31870,31871,31872,31873,31874,31875,31876,31877,31878,31879,31880,31882,31883,31884,31885,31886,31887,31888,31891,31892,31894,31897,31898,31899,31904,31905,31907,31910,31911,31912,31913,31915,31916,31917,31919,31920,31924,31925,31926,31927,31928,31930,31931,24359,34382,21804,25252,20114,27818,25143,33457,21719,21326,29502,28369,30011,21010,21270,35805,27088,24458,24576,28142,22351,27426,29615,26707,36824,32531,25442,24739,21796,30186,35938,28949,28067,23462,24187,33618,24908,40644,30970,34647,31783,30343,20976,24822,29004,26179,24140,24653,35854,28784,25381,36745,24509,24674,34516,22238,27585,24724,24935,21321,24800,26214,36159,31229,20250,28905,27719,35763,35826,32472,33636,26127,23130,39746,27985,28151,35905,27963,20249,28779,33719,25110,24785,38669,36135,31096,20987,22334,22522,26426,30072,31293,31215,31637,31935,31936,31938,31939,31940,31942,31945,31947,31950,31951,31952,31953,31954,31955,31956,31960,31962,31963,31965,31966,31969,31970,31971,31972,31973,31974,31975,31977,31978,31979,31980,31981,31982,31984,31985,31986,31987,31988,31989,31990,31991,31993,31994,31996,31997,31998,31999,32000,32001,32002,32003,32004,32005,32006,32007,32008,32009,32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32033,32035,32036,32037,32038,32040,32041,32042,32044,32045,32046,32048,32049,32050,32051,32052,32053,32054,32908,39269,36857,28608,35749,40481,23020,32489,32521,21513,26497,26840,36753,31821,38598,21450,24613,30142,27762,21363,23241,32423,25380,20960,33034,24049,34015,25216,20864,23395,20238,31085,21058,24760,27982,23492,23490,35745,35760,26082,24524,38469,22931,32487,32426,22025,26551,22841,20339,23478,21152,33626,39050,36158,30002,38078,20551,31292,20215,26550,39550,23233,27516,30417,22362,23574,31546,38388,29006,20860,32937,33392,22904,32516,33575,26816,26604,30897,30839,25315,25441,31616,20461,21098,20943,33616,27099,37492,36341,36145,35265,38190,31661,20214,32055,32056,32057,32058,32059,32060,32061,32062,32063,32064,32065,32066,32067,32068,32069,32070,32071,32072,32073,32074,32075,32076,32077,32078,32079,32080,32081,32082,32083,32084,32085,32086,32087,32088,32089,32090,32091,32092,32093,32094,32095,32096,32097,32098,32099,32100,32101,32102,32103,32104,32105,32106,32107,32108,32109,32111,32112,32113,32114,32115,32116,32117,32118,32120,32121,32122,32123,32124,32125,32126,32127,32128,32129,32130,32131,32132,32133,32134,32135,32136,32137,32138,32139,32140,32141,32142,32143,32144,32145,32146,32147,32148,32149,32150,32151,32152,20581,33328,21073,39279,28176,28293,28071,24314,20725,23004,23558,27974,27743,30086,33931,26728,22870,35762,21280,37233,38477,34121,26898,30977,28966,33014,20132,37066,27975,39556,23047,22204,25605,38128,30699,20389,33050,29409,35282,39290,32564,32478,21119,25945,37237,36735,36739,21483,31382,25581,25509,30342,31224,34903,38454,25130,21163,33410,26708,26480,25463,30571,31469,27905,32467,35299,22992,25106,34249,33445,30028,20511,20171,30117,35819,23626,24062,31563,26020,37329,20170,27941,35167,32039,38182,20165,35880,36827,38771,26187,31105,36817,28908,28024,32153,32154,32155,32156,32157,32158,32159,32160,32161,32162,32163,32164,32165,32167,32168,32169,32170,32171,32172,32173,32175,32176,32177,32178,32179,32180,32181,32182,32183,32184,32185,32186,32187,32188,32189,32190,32191,32192,32193,32194,32195,32196,32197,32198,32199,32200,32201,32202,32203,32204,32205,32206,32207,32208,32209,32210,32211,32212,32213,32214,32215,32216,32217,32218,32219,32220,32221,32222,32223,32224,32225,32226,32227,32228,32229,32230,32231,32232,32233,32234,32235,32236,32237,32238,32239,32240,32241,32242,32243,32244,32245,32246,32247,32248,32249,32250,23613,21170,33606,20834,33550,30555,26230,40120,20140,24778,31934,31923,32463,20117,35686,26223,39048,38745,22659,25964,38236,24452,30153,38742,31455,31454,20928,28847,31384,25578,31350,32416,29590,38893,20037,28792,20061,37202,21417,25937,26087,33276,33285,21646,23601,30106,38816,25304,29401,30141,23621,39545,33738,23616,21632,30697,20030,27822,32858,25298,25454,24040,20855,36317,36382,38191,20465,21477,24807,28844,21095,25424,40515,23071,20518,30519,21367,32482,25733,25899,25225,25496,20500,29237,35273,20915,35776,32477,22343,33740,38055,20891,21531,23803,32251,32252,32253,32254,32255,32256,32257,32258,32259,32260,32261,32262,32263,32264,32265,32266,32267,32268,32269,32270,32271,32272,32273,32274,32275,32276,32277,32278,32279,32280,32281,32282,32283,32284,32285,32286,32287,32288,32289,32290,32291,32292,32293,32294,32295,32296,32297,32298,32299,32300,32301,32302,32303,32304,32305,32306,32307,32308,32309,32310,32311,32312,32313,32314,32316,32317,32318,32319,32320,32322,32323,32324,32325,32326,32328,32329,32330,32331,32332,32333,32334,32335,32336,32337,32338,32339,32340,32341,32342,32343,32344,32345,32346,32347,32348,32349,20426,31459,27994,37089,39567,21888,21654,21345,21679,24320,25577,26999,20975,24936,21002,22570,21208,22350,30733,30475,24247,24951,31968,25179,25239,20130,28821,32771,25335,28900,38752,22391,33499,26607,26869,30933,39063,31185,22771,21683,21487,28212,20811,21051,23458,35838,32943,21827,22438,24691,22353,21549,31354,24656,23380,25511,25248,21475,25187,23495,26543,21741,31391,33510,37239,24211,35044,22840,22446,25358,36328,33007,22359,31607,20393,24555,23485,27454,21281,31568,29378,26694,30719,30518,26103,20917,20111,30420,23743,31397,33909,22862,39745,20608,32350,32351,32352,32353,32354,32355,32356,32357,32358,32359,32360,32361,32362,32363,32364,32365,32366,32367,32368,32369,32370,32371,32372,32373,32374,32375,32376,32377,32378,32379,32380,32381,32382,32383,32384,32385,32387,32388,32389,32390,32391,32392,32393,32394,32395,32396,32397,32398,32399,32400,32401,32402,32403,32404,32405,32406,32407,32408,32409,32410,32412,32413,32414,32430,32436,32443,32444,32470,32484,32492,32505,32522,32528,32542,32567,32569,32571,32572,32573,32574,32575,32576,32577,32579,32582,32583,32584,32585,32586,32587,32588,32589,32590,32591,32594,32595,39304,24871,28291,22372,26118,25414,22256,25324,25193,24275,38420,22403,25289,21895,34593,33098,36771,21862,33713,26469,36182,34013,23146,26639,25318,31726,38417,20848,28572,35888,25597,35272,25042,32518,28866,28389,29701,27028,29436,24266,37070,26391,28010,25438,21171,29282,32769,20332,23013,37226,28889,28061,21202,20048,38647,38253,34174,30922,32047,20769,22418,25794,32907,31867,27882,26865,26974,20919,21400,26792,29313,40654,31729,29432,31163,28435,29702,26446,37324,40100,31036,33673,33620,21519,26647,20029,21385,21169,30782,21382,21033,20616,20363,20432,32598,32601,32603,32604,32605,32606,32608,32611,32612,32613,32614,32615,32619,32620,32621,32623,32624,32627,32629,32630,32631,32632,32634,32635,32636,32637,32639,32640,32642,32643,32644,32645,32646,32647,32648,32649,32651,32653,32655,32656,32657,32658,32659,32661,32662,32663,32664,32665,32667,32668,32672,32674,32675,32677,32678,32680,32681,32682,32683,32684,32685,32686,32689,32691,32692,32693,32694,32695,32698,32699,32702,32704,32706,32707,32708,32710,32711,32712,32713,32715,32717,32719,32720,32721,32722,32723,32726,32727,32729,32730,32731,32732,32733,32734,32738,32739,30178,31435,31890,27813,38582,21147,29827,21737,20457,32852,33714,36830,38256,24265,24604,28063,24088,25947,33080,38142,24651,28860,32451,31918,20937,26753,31921,33391,20004,36742,37327,26238,20142,35845,25769,32842,20698,30103,29134,23525,36797,28518,20102,25730,38243,24278,26009,21015,35010,28872,21155,29454,29747,26519,30967,38678,20020,37051,40158,28107,20955,36161,21533,25294,29618,33777,38646,40836,38083,20278,32666,20940,28789,38517,23725,39046,21478,20196,28316,29705,27060,30827,39311,30041,21016,30244,27969,26611,20845,40857,32843,21657,31548,31423,32740,32743,32744,32746,32747,32748,32749,32751,32754,32756,32757,32758,32759,32760,32761,32762,32765,32766,32767,32770,32775,32776,32777,32778,32782,32783,32785,32787,32794,32795,32797,32798,32799,32801,32803,32804,32811,32812,32813,32814,32815,32816,32818,32820,32825,32826,32828,32830,32832,32833,32836,32837,32839,32840,32841,32846,32847,32848,32849,32851,32853,32854,32855,32857,32859,32860,32861,32862,32863,32864,32865,32866,32867,32868,32869,32870,32871,32872,32875,32876,32877,32878,32879,32880,32882,32883,32884,32885,32886,32887,32888,32889,32890,32891,32892,32893,38534,22404,25314,38471,27004,23044,25602,31699,28431,38475,33446,21346,39045,24208,28809,25523,21348,34383,40065,40595,30860,38706,36335,36162,40575,28510,31108,24405,38470,25134,39540,21525,38109,20387,26053,23653,23649,32533,34385,27695,24459,29575,28388,32511,23782,25371,23402,28390,21365,20081,25504,30053,25249,36718,20262,20177,27814,32438,35770,33821,34746,32599,36923,38179,31657,39585,35064,33853,27931,39558,32476,22920,40635,29595,30721,34434,39532,39554,22043,21527,22475,20080,40614,21334,36808,33033,30610,39314,34542,28385,34067,26364,24930,28459,32894,32897,32898,32901,32904,32906,32909,32910,32911,32912,32913,32914,32916,32917,32919,32921,32926,32931,32934,32935,32936,32940,32944,32947,32949,32950,32952,32953,32955,32965,32967,32968,32969,32970,32971,32975,32976,32977,32978,32979,32980,32981,32984,32991,32992,32994,32995,32998,33006,33013,33015,33017,33019,33022,33023,33024,33025,33027,33028,33029,33031,33032,33035,33036,33045,33047,33049,33051,33052,33053,33055,33056,33057,33058,33059,33060,33061,33062,33063,33064,33065,33066,33067,33069,33070,33072,33075,33076,33077,33079,33081,33082,33083,33084,33085,33087,35881,33426,33579,30450,27667,24537,33725,29483,33541,38170,27611,30683,38086,21359,33538,20882,24125,35980,36152,20040,29611,26522,26757,37238,38665,29028,27809,30473,23186,38209,27599,32654,26151,23504,22969,23194,38376,38391,20204,33804,33945,27308,30431,38192,29467,26790,23391,30511,37274,38753,31964,36855,35868,24357,31859,31192,35269,27852,34588,23494,24130,26825,30496,32501,20885,20813,21193,23081,32517,38754,33495,25551,30596,34256,31186,28218,24217,22937,34065,28781,27665,25279,30399,25935,24751,38397,26126,34719,40483,38125,21517,21629,35884,25720,33088,33089,33090,33091,33092,33093,33095,33097,33101,33102,33103,33106,33110,33111,33112,33115,33116,33117,33118,33119,33121,33122,33123,33124,33126,33128,33130,33131,33132,33135,33138,33139,33141,33142,33143,33144,33153,33155,33156,33157,33158,33159,33161,33163,33164,33165,33166,33168,33170,33171,33172,33173,33174,33175,33177,33178,33182,33183,33184,33185,33186,33188,33189,33191,33193,33195,33196,33197,33198,33199,33200,33201,33202,33204,33205,33206,33207,33208,33209,33212,33213,33214,33215,33220,33221,33223,33224,33225,33227,33229,33230,33231,33232,33233,33234,33235,25721,34321,27169,33180,30952,25705,39764,25273,26411,33707,22696,40664,27819,28448,23518,38476,35851,29279,26576,25287,29281,20137,22982,27597,22675,26286,24149,21215,24917,26408,30446,30566,29287,31302,25343,21738,21584,38048,37027,23068,32435,27670,20035,22902,32784,22856,21335,30007,38590,22218,25376,33041,24700,38393,28118,21602,39297,20869,23273,33021,22958,38675,20522,27877,23612,25311,20320,21311,33147,36870,28346,34091,25288,24180,30910,25781,25467,24565,23064,37247,40479,23615,25423,32834,23421,21870,38218,38221,28037,24744,26592,29406,20957,23425,33236,33237,33238,33239,33240,33241,33242,33243,33244,33245,33246,33247,33248,33249,33250,33252,33253,33254,33256,33257,33259,33262,33263,33264,33265,33266,33269,33270,33271,33272,33273,33274,33277,33279,33283,33287,33288,33289,33290,33291,33294,33295,33297,33299,33301,33302,33303,33304,33305,33306,33309,33312,33316,33317,33318,33319,33321,33326,33330,33338,33340,33341,33343,33344,33345,33346,33347,33349,33350,33352,33354,33356,33357,33358,33360,33361,33362,33363,33364,33365,33366,33367,33369,33371,33372,33373,33374,33376,33377,33378,33379,33380,33381,33382,33383,33385,25319,27870,29275,25197,38062,32445,33043,27987,20892,24324,22900,21162,24594,22899,26262,34384,30111,25386,25062,31983,35834,21734,27431,40485,27572,34261,21589,20598,27812,21866,36276,29228,24085,24597,29750,25293,25490,29260,24472,28227,27966,25856,28504,30424,30928,30460,30036,21028,21467,20051,24222,26049,32810,32982,25243,21638,21032,28846,34957,36305,27873,21624,32986,22521,35060,36180,38506,37197,20329,27803,21943,30406,30768,25256,28921,28558,24429,34028,26842,30844,31735,33192,26379,40527,25447,30896,22383,30738,38713,25209,25259,21128,29749,27607,33386,33387,33388,33389,33393,33397,33398,33399,33400,33403,33404,33408,33409,33411,33413,33414,33415,33417,33420,33424,33427,33428,33429,33430,33434,33435,33438,33440,33442,33443,33447,33458,33461,33462,33466,33467,33468,33471,33472,33474,33475,33477,33478,33481,33488,33494,33497,33498,33501,33506,33511,33512,33513,33514,33516,33517,33518,33520,33522,33523,33525,33526,33528,33530,33532,33533,33534,33535,33536,33546,33547,33549,33552,33554,33555,33558,33560,33561,33565,33566,33567,33568,33569,33570,33571,33572,33573,33574,33577,33578,33582,33584,33586,33591,33595,33597,21860,33086,30130,30382,21305,30174,20731,23617,35692,31687,20559,29255,39575,39128,28418,29922,31080,25735,30629,25340,39057,36139,21697,32856,20050,22378,33529,33805,24179,20973,29942,35780,23631,22369,27900,39047,23110,30772,39748,36843,31893,21078,25169,38138,20166,33670,33889,33769,33970,22484,26420,22275,26222,28006,35889,26333,28689,26399,27450,26646,25114,22971,19971,20932,28422,26578,27791,20854,26827,22855,27495,30054,23822,33040,40784,26071,31048,31041,39569,36215,23682,20062,20225,21551,22865,30732,22120,27668,36804,24323,27773,27875,35755,25488,33598,33599,33601,33602,33604,33605,33608,33610,33611,33612,33613,33614,33619,33621,33622,33623,33624,33625,33629,33634,33648,33649,33650,33651,33652,33653,33654,33657,33658,33662,33663,33664,33665,33666,33667,33668,33671,33672,33674,33675,33676,33677,33679,33680,33681,33684,33685,33686,33687,33689,33690,33693,33695,33697,33698,33699,33700,33701,33702,33703,33708,33709,33710,33711,33717,33723,33726,33727,33730,33731,33732,33734,33736,33737,33739,33741,33742,33744,33745,33746,33747,33749,33751,33753,33754,33755,33758,33762,33763,33764,33766,33767,33768,33771,33772,33773,24688,27965,29301,25190,38030,38085,21315,36801,31614,20191,35878,20094,40660,38065,38067,21069,28508,36963,27973,35892,22545,23884,27424,27465,26538,21595,33108,32652,22681,34103,24378,25250,27207,38201,25970,24708,26725,30631,20052,20392,24039,38808,25772,32728,23789,20431,31373,20999,33540,19988,24623,31363,38054,20405,20146,31206,29748,21220,33465,25810,31165,23517,27777,38738,36731,27682,20542,21375,28165,25806,26228,27696,24773,39031,35831,24198,29756,31351,31179,19992,37041,29699,27714,22234,37195,27845,36235,21306,34502,26354,36527,23624,39537,28192,33774,33775,33779,33780,33781,33782,33783,33786,33787,33788,33790,33791,33792,33794,33797,33799,33800,33801,33802,33808,33810,33811,33812,33813,33814,33815,33817,33818,33819,33822,33823,33824,33825,33826,33827,33833,33834,33835,33836,33837,33838,33839,33840,33842,33843,33844,33845,33846,33847,33849,33850,33851,33854,33855,33856,33857,33858,33859,33860,33861,33863,33864,33865,33866,33867,33868,33869,33870,33871,33872,33874,33875,33876,33877,33878,33880,33885,33886,33887,33888,33890,33892,33893,33894,33895,33896,33898,33902,33903,33904,33906,33908,33911,33913,33915,33916,21462,23094,40843,36259,21435,22280,39079,26435,37275,27849,20840,30154,25331,29356,21048,21149,32570,28820,30264,21364,40522,27063,30830,38592,35033,32676,28982,29123,20873,26579,29924,22756,25880,22199,35753,39286,25200,32469,24825,28909,22764,20161,20154,24525,38887,20219,35748,20995,22922,32427,25172,20173,26085,25102,33592,33993,33635,34701,29076,28342,23481,32466,20887,25545,26580,32905,33593,34837,20754,23418,22914,36785,20083,27741,20837,35109,36719,38446,34122,29790,38160,38384,28070,33509,24369,25746,27922,33832,33134,40131,22622,36187,19977,21441,33917,33918,33919,33920,33921,33923,33924,33925,33926,33930,33933,33935,33936,33937,33938,33939,33940,33941,33942,33944,33946,33947,33949,33950,33951,33952,33954,33955,33956,33957,33958,33959,33960,33961,33962,33963,33964,33965,33966,33968,33969,33971,33973,33974,33975,33979,33980,33982,33984,33986,33987,33989,33990,33991,33992,33995,33996,33998,33999,34002,34004,34005,34007,34008,34009,34010,34011,34012,34014,34017,34018,34020,34023,34024,34025,34026,34027,34029,34030,34031,34033,34034,34035,34036,34037,34038,34039,34040,34041,34042,34043,34045,34046,34048,34049,34050,20254,25955,26705,21971,20007,25620,39578,25195,23234,29791,33394,28073,26862,20711,33678,30722,26432,21049,27801,32433,20667,21861,29022,31579,26194,29642,33515,26441,23665,21024,29053,34923,38378,38485,25797,36193,33203,21892,27733,25159,32558,22674,20260,21830,36175,26188,19978,23578,35059,26786,25422,31245,28903,33421,21242,38902,23569,21736,37045,32461,22882,36170,34503,33292,33293,36198,25668,23556,24913,28041,31038,35774,30775,30003,21627,20280,36523,28145,23072,32453,31070,27784,23457,23158,29978,32958,24910,28183,22768,29983,29989,29298,21319,32499,34051,34052,34053,34054,34055,34056,34057,34058,34059,34061,34062,34063,34064,34066,34068,34069,34070,34072,34073,34075,34076,34077,34078,34080,34082,34083,34084,34085,34086,34087,34088,34089,34090,34093,34094,34095,34096,34097,34098,34099,34100,34101,34102,34110,34111,34112,34113,34114,34116,34117,34118,34119,34123,34124,34125,34126,34127,34128,34129,34130,34131,34132,34133,34135,34136,34138,34139,34140,34141,34143,34144,34145,34146,34147,34149,34150,34151,34153,34154,34155,34156,34157,34158,34159,34160,34161,34163,34165,34166,34167,34168,34172,34173,34175,34176,34177,30465,30427,21097,32988,22307,24072,22833,29422,26045,28287,35799,23608,34417,21313,30707,25342,26102,20160,39135,34432,23454,35782,21490,30690,20351,23630,39542,22987,24335,31034,22763,19990,26623,20107,25325,35475,36893,21183,26159,21980,22124,36866,20181,20365,37322,39280,27663,24066,24643,23460,35270,35797,25910,25163,39318,23432,23551,25480,21806,21463,30246,20861,34092,26530,26803,27530,25234,36755,21460,33298,28113,30095,20070,36174,23408,29087,34223,26257,26329,32626,34560,40653,40736,23646,26415,36848,26641,26463,25101,31446,22661,24246,25968,28465,34178,34179,34182,34184,34185,34186,34187,34188,34189,34190,34192,34193,34194,34195,34196,34197,34198,34199,34200,34201,34202,34205,34206,34207,34208,34209,34210,34211,34213,34214,34215,34217,34219,34220,34221,34225,34226,34227,34228,34229,34230,34232,34234,34235,34236,34237,34238,34239,34240,34242,34243,34244,34245,34246,34247,34248,34250,34251,34252,34253,34254,34257,34258,34260,34262,34263,34264,34265,34266,34267,34269,34270,34271,34272,34273,34274,34275,34277,34278,34279,34280,34282,34283,34284,34285,34286,34287,34288,34289,34290,34291,34292,34293,34294,34295,34296,24661,21047,32781,25684,34928,29993,24069,26643,25332,38684,21452,29245,35841,27700,30561,31246,21550,30636,39034,33308,35828,30805,26388,28865,26031,25749,22070,24605,31169,21496,19997,27515,32902,23546,21987,22235,20282,20284,39282,24051,26494,32824,24578,39042,36865,23435,35772,35829,25628,33368,25822,22013,33487,37221,20439,32032,36895,31903,20723,22609,28335,23487,35785,32899,37240,33948,31639,34429,38539,38543,32485,39635,30862,23681,31319,36930,38567,31071,23385,25439,31499,34001,26797,21766,32553,29712,32034,38145,25152,22604,20182,23427,22905,22612,34297,34298,34300,34301,34302,34304,34305,34306,34307,34308,34310,34311,34312,34313,34314,34315,34316,34317,34318,34319,34320,34322,34323,34324,34325,34327,34328,34329,34330,34331,34332,34333,34334,34335,34336,34337,34338,34339,34340,34341,34342,34344,34346,34347,34348,34349,34350,34351,34352,34353,34354,34355,34356,34357,34358,34359,34361,34362,34363,34365,34366,34367,34368,34369,34370,34371,34372,34373,34374,34375,34376,34377,34378,34379,34380,34386,34387,34389,34390,34391,34392,34393,34395,34396,34397,34399,34400,34401,34403,34404,34405,34406,34407,34408,34409,34410,29549,25374,36427,36367,32974,33492,25260,21488,27888,37214,22826,24577,27760,22349,25674,36138,30251,28393,22363,27264,30192,28525,35885,35848,22374,27631,34962,30899,25506,21497,28845,27748,22616,25642,22530,26848,33179,21776,31958,20504,36538,28108,36255,28907,25487,28059,28372,32486,33796,26691,36867,28120,38518,35752,22871,29305,34276,33150,30140,35466,26799,21076,36386,38161,25552,39064,36420,21884,20307,26367,22159,24789,28053,21059,23625,22825,28155,22635,30000,29980,24684,33300,33094,25361,26465,36834,30522,36339,36148,38081,24086,21381,21548,28867,34413,34415,34416,34418,34419,34420,34421,34422,34423,34424,34435,34436,34437,34438,34439,34440,34441,34446,34447,34448,34449,34450,34452,34454,34455,34456,34457,34458,34459,34462,34463,34464,34465,34466,34469,34470,34475,34477,34478,34482,34483,34487,34488,34489,34491,34492,34493,34494,34495,34497,34498,34499,34501,34504,34508,34509,34514,34515,34517,34518,34519,34522,34524,34525,34528,34529,34530,34531,34533,34534,34535,34536,34538,34539,34540,34543,34549,34550,34551,34554,34555,34556,34557,34559,34561,34564,34565,34566,34571,34572,34574,34575,34576,34577,34580,34582,27712,24311,20572,20141,24237,25402,33351,36890,26704,37230,30643,21516,38108,24420,31461,26742,25413,31570,32479,30171,20599,25237,22836,36879,20984,31171,31361,22270,24466,36884,28034,23648,22303,21520,20820,28237,22242,25512,39059,33151,34581,35114,36864,21534,23663,33216,25302,25176,33073,40501,38464,39534,39548,26925,22949,25299,21822,25366,21703,34521,27964,23043,29926,34972,27498,22806,35916,24367,28286,29609,39037,20024,28919,23436,30871,25405,26202,30358,24779,23451,23113,19975,33109,27754,29579,20129,26505,32593,24448,26106,26395,24536,22916,23041,34585,34587,34589,34591,34592,34596,34598,34599,34600,34602,34603,34604,34605,34607,34608,34610,34611,34613,34614,34616,34617,34618,34620,34621,34624,34625,34626,34627,34628,34629,34630,34634,34635,34637,34639,34640,34641,34642,34644,34645,34646,34648,34650,34651,34652,34653,34654,34655,34657,34658,34662,34663,34664,34665,34666,34667,34668,34669,34671,34673,34674,34675,34677,34679,34680,34681,34682,34687,34688,34689,34692,34694,34695,34697,34698,34700,34702,34703,34704,34705,34706,34708,34709,34710,34712,34713,34714,34715,34716,34717,34718,34720,34721,34722,34723,34724,24013,24494,21361,38886,36829,26693,22260,21807,24799,20026,28493,32500,33479,33806,22996,20255,20266,23614,32428,26410,34074,21619,30031,32963,21890,39759,20301,28205,35859,23561,24944,21355,30239,28201,34442,25991,38395,32441,21563,31283,32010,38382,21985,32705,29934,25373,34583,28065,31389,25105,26017,21351,25569,27779,24043,21596,38056,20044,27745,35820,23627,26080,33436,26791,21566,21556,27595,27494,20116,25410,21320,33310,20237,20398,22366,25098,38654,26212,29289,21247,21153,24735,35823,26132,29081,26512,35199,30802,30717,26224,22075,21560,38177,29306,34725,34726,34727,34729,34730,34734,34736,34737,34738,34740,34742,34743,34744,34745,34747,34748,34750,34751,34753,34754,34755,34756,34757,34759,34760,34761,34764,34765,34766,34767,34768,34772,34773,34774,34775,34776,34777,34778,34780,34781,34782,34783,34785,34786,34787,34788,34790,34791,34792,34793,34795,34796,34797,34799,34800,34801,34802,34803,34804,34805,34806,34807,34808,34810,34811,34812,34813,34815,34816,34817,34818,34820,34821,34822,34823,34824,34825,34827,34828,34829,34830,34831,34832,34833,34834,34836,34839,34840,34841,34842,34844,34845,34846,34847,34848,34851,31232,24687,24076,24713,33181,22805,24796,29060,28911,28330,27728,29312,27268,34989,24109,20064,23219,21916,38115,27927,31995,38553,25103,32454,30606,34430,21283,38686,36758,26247,23777,20384,29421,19979,21414,22799,21523,25472,38184,20808,20185,40092,32420,21688,36132,34900,33335,38386,28046,24358,23244,26174,38505,29616,29486,21439,33146,39301,32673,23466,38519,38480,32447,30456,21410,38262,39321,31665,35140,28248,20065,32724,31077,35814,24819,21709,20139,39033,24055,27233,20687,21521,35937,33831,30813,38660,21066,21742,22179,38144,28040,23477,28102,26195,34852,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34867,34868,34869,34870,34871,34872,34874,34875,34877,34878,34879,34881,34882,34883,34886,34887,34888,34889,34890,34891,34894,34895,34896,34897,34898,34899,34901,34902,34904,34906,34907,34908,34909,34910,34911,34912,34918,34919,34922,34925,34927,34929,34931,34932,34933,34934,34936,34937,34938,34939,34940,34944,34947,34950,34951,34953,34954,34956,34958,34959,34960,34961,34963,34964,34965,34967,34968,34969,34970,34971,34973,34974,34975,34976,34977,34979,34981,34982,34983,34984,34985,34986,23567,23389,26657,32918,21880,31505,25928,26964,20123,27463,34638,38795,21327,25375,25658,37034,26012,32961,35856,20889,26800,21368,34809,25032,27844,27899,35874,23633,34218,33455,38156,27427,36763,26032,24571,24515,20449,34885,26143,33125,29481,24826,20852,21009,22411,24418,37026,34892,37266,24184,26447,24615,22995,20804,20982,33016,21256,27769,38596,29066,20241,20462,32670,26429,21957,38152,31168,34966,32483,22687,25100,38656,34394,22040,39035,24464,35768,33988,37207,21465,26093,24207,30044,24676,32110,23167,32490,32493,36713,21927,23459,24748,26059,29572,34988,34990,34991,34992,34994,34995,34996,34997,34998,35000,35001,35002,35003,35005,35006,35007,35008,35011,35012,35015,35016,35018,35019,35020,35021,35023,35024,35025,35027,35030,35031,35034,35035,35036,35037,35038,35040,35041,35046,35047,35049,35050,35051,35052,35053,35054,35055,35058,35061,35062,35063,35066,35067,35069,35071,35072,35073,35075,35076,35077,35078,35079,35080,35081,35083,35084,35085,35086,35087,35089,35092,35093,35094,35095,35096,35100,35101,35102,35103,35104,35106,35107,35108,35110,35111,35112,35113,35116,35117,35118,35119,35121,35122,35123,35125,35127,36873,30307,30505,32474,38772,34203,23398,31348,38634,34880,21195,29071,24490,26092,35810,23547,39535,24033,27529,27739,35757,35759,36874,36805,21387,25276,40486,40493,21568,20011,33469,29273,34460,23830,34905,28079,38597,21713,20122,35766,28937,21693,38409,28895,28153,30416,20005,30740,34578,23721,24310,35328,39068,38414,28814,27839,22852,25513,30524,34893,28436,33395,22576,29141,21388,30746,38593,21761,24422,28976,23476,35866,39564,27523,22830,40495,31207,26472,25196,20335,30113,32650,27915,38451,27687,20208,30162,20859,26679,28478,36992,33136,22934,29814,35128,35129,35130,35131,35132,35133,35134,35135,35136,35138,35139,35141,35142,35143,35144,35145,35146,35147,35148,35149,35150,35151,35152,35153,35154,35155,35156,35157,35158,35159,35160,35161,35162,35163,35164,35165,35168,35169,35170,35171,35172,35173,35175,35176,35177,35178,35179,35180,35181,35182,35183,35184,35185,35186,35187,35188,35189,35190,35191,35192,35193,35194,35196,35197,35198,35200,35202,35204,35205,35207,35208,35209,35210,35211,35212,35213,35214,35215,35216,35217,35218,35219,35220,35221,35222,35223,35224,35225,35226,35227,35228,35229,35230,35231,35232,35233,25671,23591,36965,31377,35875,23002,21676,33280,33647,35201,32768,26928,22094,32822,29239,37326,20918,20063,39029,25494,19994,21494,26355,33099,22812,28082,19968,22777,21307,25558,38129,20381,20234,34915,39056,22839,36951,31227,20202,33008,30097,27778,23452,23016,24413,26885,34433,20506,24050,20057,30691,20197,33402,25233,26131,37009,23673,20159,24441,33222,36920,32900,30123,20134,35028,24847,27589,24518,20041,30410,28322,35811,35758,35850,35793,24322,32764,32716,32462,33589,33643,22240,27575,38899,38452,23035,21535,38134,28139,23493,39278,23609,24341,38544,35234,35235,35236,35237,35238,35239,35240,35241,35242,35243,35244,35245,35246,35247,35248,35249,35250,35251,35252,35253,35254,35255,35256,35257,35258,35259,35260,35261,35262,35263,35264,35267,35277,35283,35284,35285,35287,35288,35289,35291,35293,35295,35296,35297,35298,35300,35303,35304,35305,35306,35308,35309,35310,35312,35313,35314,35316,35317,35318,35319,35320,35321,35322,35323,35324,35325,35326,35327,35329,35330,35331,35332,35333,35334,35336,35337,35338,35339,35340,35341,35342,35343,35344,35345,35346,35347,35348,35349,35350,35351,35352,35353,35354,35355,35356,35357,21360,33521,27185,23156,40560,24212,32552,33721,33828,33829,33639,34631,36814,36194,30408,24433,39062,30828,26144,21727,25317,20323,33219,30152,24248,38605,36362,34553,21647,27891,28044,27704,24703,21191,29992,24189,20248,24736,24551,23588,30001,37038,38080,29369,27833,28216,37193,26377,21451,21491,20305,37321,35825,21448,24188,36802,28132,20110,30402,27014,34398,24858,33286,20313,20446,36926,40060,24841,28189,28180,38533,20104,23089,38632,19982,23679,31161,23431,35821,32701,29577,22495,33419,37057,21505,36935,21947,23786,24481,24840,27442,29425,32946,35465,35358,35359,35360,35361,35362,35363,35364,35365,35366,35367,35368,35369,35370,35371,35372,35373,35374,35375,35376,35377,35378,35379,35380,35381,35382,35383,35384,35385,35386,35387,35388,35389,35391,35392,35393,35394,35395,35396,35397,35398,35399,35401,35402,35403,35404,35405,35406,35407,35408,35409,35410,35411,35412,35413,35414,35415,35416,35417,35418,35419,35420,35421,35422,35423,35424,35425,35426,35427,35428,35429,35430,35431,35432,35433,35434,35435,35436,35437,35438,35439,35440,35441,35442,35443,35444,35445,35446,35447,35448,35450,35451,35452,35453,35454,35455,35456,28020,23507,35029,39044,35947,39533,40499,28170,20900,20803,22435,34945,21407,25588,36757,22253,21592,22278,29503,28304,32536,36828,33489,24895,24616,38498,26352,32422,36234,36291,38053,23731,31908,26376,24742,38405,32792,20113,37095,21248,38504,20801,36816,34164,37213,26197,38901,23381,21277,30776,26434,26685,21705,28798,23472,36733,20877,22312,21681,25874,26242,36190,36163,33039,33900,36973,31967,20991,34299,26531,26089,28577,34468,36481,22122,36896,30338,28790,29157,36131,25321,21017,27901,36156,24590,22686,24974,26366,36192,25166,21939,28195,26413,36711,35457,35458,35459,35460,35461,35462,35463,35464,35467,35468,35469,35470,35471,35472,35473,35474,35476,35477,35478,35479,35480,35481,35482,35483,35484,35485,35486,35487,35488,35489,35490,35491,35492,35493,35494,35495,35496,35497,35498,35499,35500,35501,35502,35503,35504,35505,35506,35507,35508,35509,35510,35511,35512,35513,35514,35515,35516,35517,35518,35519,35520,35521,35522,35523,35524,35525,35526,35527,35528,35529,35530,35531,35532,35533,35534,35535,35536,35537,35538,35539,35540,35541,35542,35543,35544,35545,35546,35547,35548,35549,35550,35551,35552,35553,35554,35555,38113,38392,30504,26629,27048,21643,20045,28856,35784,25688,25995,23429,31364,20538,23528,30651,27617,35449,31896,27838,30415,26025,36759,23853,23637,34360,26632,21344,25112,31449,28251,32509,27167,31456,24432,28467,24352,25484,28072,26454,19976,24080,36134,20183,32960,30260,38556,25307,26157,25214,27836,36213,29031,32617,20806,32903,21484,36974,25240,21746,34544,36761,32773,38167,34071,36825,27993,29645,26015,30495,29956,30759,33275,36126,38024,20390,26517,30137,35786,38663,25391,38215,38453,33976,25379,30529,24449,29424,20105,24596,25972,25327,27491,25919,35556,35557,35558,35559,35560,35561,35562,35563,35564,35565,35566,35567,35568,35569,35570,35571,35572,35573,35574,35575,35576,35577,35578,35579,35580,35581,35582,35583,35584,35585,35586,35587,35588,35589,35590,35592,35593,35594,35595,35596,35597,35598,35599,35600,35601,35602,35603,35604,35605,35606,35607,35608,35609,35610,35611,35612,35613,35614,35615,35616,35617,35618,35619,35620,35621,35623,35624,35625,35626,35627,35628,35629,35630,35631,35632,35633,35634,35635,35636,35637,35638,35639,35640,35641,35642,35643,35644,35645,35646,35647,35648,35649,35650,35651,35652,35653,24103,30151,37073,35777,33437,26525,25903,21553,34584,30693,32930,33026,27713,20043,32455,32844,30452,26893,27542,25191,20540,20356,22336,25351,27490,36286,21482,26088,32440,24535,25370,25527,33267,33268,32622,24092,23769,21046,26234,31209,31258,36136,28825,30164,28382,27835,31378,20013,30405,24544,38047,34935,32456,31181,32959,37325,20210,20247,33311,21608,24030,27954,35788,31909,36724,32920,24090,21650,30385,23449,26172,39588,29664,26666,34523,26417,29482,35832,35803,36880,31481,28891,29038,25284,30633,22065,20027,33879,26609,21161,34496,36142,38136,31569,35654,35655,35656,35657,35658,35659,35660,35661,35662,35663,35664,35665,35666,35667,35668,35669,35670,35671,35672,35673,35674,35675,35676,35677,35678,35679,35680,35681,35682,35683,35684,35685,35687,35688,35689,35690,35691,35693,35694,35695,35696,35697,35698,35699,35700,35701,35702,35703,35704,35705,35706,35707,35708,35709,35710,35711,35712,35713,35714,35715,35716,35717,35718,35719,35720,35721,35722,35723,35724,35725,35726,35727,35728,35729,35730,35731,35732,35733,35734,35735,35736,35737,35738,35739,35740,35741,35742,35743,35756,35761,35771,35783,35792,35818,35849,35870,20303,27880,31069,39547,25235,29226,25341,19987,30742,36716,25776,36186,31686,26729,24196,35013,22918,25758,22766,29366,26894,38181,36861,36184,22368,32512,35846,20934,25417,25305,21331,26700,29730,33537,37196,21828,30528,28796,27978,20857,21672,36164,23039,28363,28100,23388,32043,20180,31869,28371,23376,33258,28173,23383,39683,26837,36394,23447,32508,24635,32437,37049,36208,22863,25549,31199,36275,21330,26063,31062,35781,38459,32452,38075,32386,22068,37257,26368,32618,23562,36981,26152,24038,20304,26590,20570,20316,22352,24231,59408,59409,59410,59411,59412,35896,35897,35898,35899,35900,35901,35902,35903,35904,35906,35907,35908,35909,35912,35914,35915,35917,35918,35919,35920,35921,35922,35923,35924,35926,35927,35928,35929,35931,35932,35933,35934,35935,35936,35939,35940,35941,35942,35943,35944,35945,35948,35949,35950,35951,35952,35953,35954,35956,35957,35958,35959,35963,35964,35965,35966,35967,35968,35969,35971,35972,35974,35975,35976,35979,35981,35982,35983,35984,35985,35986,35987,35989,35990,35991,35993,35994,35995,35996,35997,35998,35999,36000,36001,36002,36003,36004,36005,36006,36007,36008,36009,36010,36011,36012,36013,20109,19980,20800,19984,24319,21317,19989,20120,19998,39730,23404,22121,20008,31162,20031,21269,20039,22829,29243,21358,27664,22239,32996,39319,27603,30590,40727,20022,20127,40720,20060,20073,20115,33416,23387,21868,22031,20164,21389,21405,21411,21413,21422,38757,36189,21274,21493,21286,21294,21310,36188,21350,21347,20994,21000,21006,21037,21043,21055,21056,21068,21086,21089,21084,33967,21117,21122,21121,21136,21139,20866,32596,20155,20163,20169,20162,20200,20193,20203,20190,20251,20211,20258,20324,20213,20261,20263,20233,20267,20318,20327,25912,20314,20317,36014,36015,36016,36017,36018,36019,36020,36021,36022,36023,36024,36025,36026,36027,36028,36029,36030,36031,36032,36033,36034,36035,36036,36037,36038,36039,36040,36041,36042,36043,36044,36045,36046,36047,36048,36049,36050,36051,36052,36053,36054,36055,36056,36057,36058,36059,36060,36061,36062,36063,36064,36065,36066,36067,36068,36069,36070,36071,36072,36073,36074,36075,36076,36077,36078,36079,36080,36081,36082,36083,36084,36085,36086,36087,36088,36089,36090,36091,36092,36093,36094,36095,36096,36097,36098,36099,36100,36101,36102,36103,36104,36105,36106,36107,36108,36109,20319,20311,20274,20285,20342,20340,20369,20361,20355,20367,20350,20347,20394,20348,20396,20372,20454,20456,20458,20421,20442,20451,20444,20433,20447,20472,20521,20556,20467,20524,20495,20526,20525,20478,20508,20492,20517,20520,20606,20547,20565,20552,20558,20588,20603,20645,20647,20649,20666,20694,20742,20717,20716,20710,20718,20743,20747,20189,27709,20312,20325,20430,40864,27718,31860,20846,24061,40649,39320,20865,22804,21241,21261,35335,21264,20971,22809,20821,20128,20822,20147,34926,34980,20149,33044,35026,31104,23348,34819,32696,20907,20913,20925,20924,36110,36111,36112,36113,36114,36115,36116,36117,36118,36119,36120,36121,36122,36123,36124,36128,36177,36178,36183,36191,36197,36200,36201,36202,36204,36206,36207,36209,36210,36216,36217,36218,36219,36220,36221,36222,36223,36224,36226,36227,36230,36231,36232,36233,36236,36237,36238,36239,36240,36242,36243,36245,36246,36247,36248,36249,36250,36251,36252,36253,36254,36256,36257,36258,36260,36261,36262,36263,36264,36265,36266,36267,36268,36269,36270,36271,36272,36274,36278,36279,36281,36283,36285,36288,36289,36290,36293,36295,36296,36297,36298,36301,36304,36306,36307,36308,20935,20886,20898,20901,35744,35750,35751,35754,35764,35765,35767,35778,35779,35787,35791,35790,35794,35795,35796,35798,35800,35801,35804,35807,35808,35812,35816,35817,35822,35824,35827,35830,35833,35836,35839,35840,35842,35844,35847,35852,35855,35857,35858,35860,35861,35862,35865,35867,35864,35869,35871,35872,35873,35877,35879,35882,35883,35886,35887,35890,35891,35893,35894,21353,21370,38429,38434,38433,38449,38442,38461,38460,38466,38473,38484,38495,38503,38508,38514,38516,38536,38541,38551,38576,37015,37019,37021,37017,37036,37025,37044,37043,37046,37050,36309,36312,36313,36316,36320,36321,36322,36325,36326,36327,36329,36333,36334,36336,36337,36338,36340,36342,36348,36350,36351,36352,36353,36354,36355,36356,36358,36359,36360,36363,36365,36366,36368,36369,36370,36371,36373,36374,36375,36376,36377,36378,36379,36380,36384,36385,36388,36389,36390,36391,36392,36395,36397,36400,36402,36403,36404,36406,36407,36408,36411,36412,36414,36415,36419,36421,36422,36428,36429,36430,36431,36432,36435,36436,36437,36438,36439,36440,36442,36443,36444,36445,36446,36447,36448,36449,36450,36451,36452,36453,36455,36456,36458,36459,36462,36465,37048,37040,37071,37061,37054,37072,37060,37063,37075,37094,37090,37084,37079,37083,37099,37103,37118,37124,37154,37150,37155,37169,37167,37177,37187,37190,21005,22850,21154,21164,21165,21182,21759,21200,21206,21232,21471,29166,30669,24308,20981,20988,39727,21430,24321,30042,24047,22348,22441,22433,22654,22716,22725,22737,22313,22316,22314,22323,22329,22318,22319,22364,22331,22338,22377,22405,22379,22406,22396,22395,22376,22381,22390,22387,22445,22436,22412,22450,22479,22439,22452,22419,22432,22485,22488,22490,22489,22482,22456,22516,22511,22520,22500,22493,36467,36469,36471,36472,36473,36474,36475,36477,36478,36480,36482,36483,36484,36486,36488,36489,36490,36491,36492,36493,36494,36497,36498,36499,36501,36502,36503,36504,36505,36506,36507,36509,36511,36512,36513,36514,36515,36516,36517,36518,36519,36520,36521,36522,36525,36526,36528,36529,36531,36532,36533,36534,36535,36536,36537,36539,36540,36541,36542,36543,36544,36545,36546,36547,36548,36549,36550,36551,36552,36553,36554,36555,36556,36557,36559,36560,36561,36562,36563,36564,36565,36566,36567,36568,36569,36570,36571,36572,36573,36574,36575,36576,36577,36578,36579,36580,22539,22541,22525,22509,22528,22558,22553,22596,22560,22629,22636,22657,22665,22682,22656,39336,40729,25087,33401,33405,33407,33423,33418,33448,33412,33422,33425,33431,33433,33451,33464,33470,33456,33480,33482,33507,33432,33463,33454,33483,33484,33473,33449,33460,33441,33450,33439,33476,33486,33444,33505,33545,33527,33508,33551,33543,33500,33524,33490,33496,33548,33531,33491,33553,33562,33542,33556,33557,33504,33493,33564,33617,33627,33628,33544,33682,33596,33588,33585,33691,33630,33583,33615,33607,33603,33631,33600,33559,33632,33581,33594,33587,33638,33637,36581,36582,36583,36584,36585,36586,36587,36588,36589,36590,36591,36592,36593,36594,36595,36596,36597,36598,36599,36600,36601,36602,36603,36604,36605,36606,36607,36608,36609,36610,36611,36612,36613,36614,36615,36616,36617,36618,36619,36620,36621,36622,36623,36624,36625,36626,36627,36628,36629,36630,36631,36632,36633,36634,36635,36636,36637,36638,36639,36640,36641,36642,36643,36644,36645,36646,36647,36648,36649,36650,36651,36652,36653,36654,36655,36656,36657,36658,36659,36660,36661,36662,36663,36664,36665,36666,36667,36668,36669,36670,36671,36672,36673,36674,36675,36676,33640,33563,33641,33644,33642,33645,33646,33712,33656,33715,33716,33696,33706,33683,33692,33669,33660,33718,33705,33661,33720,33659,33688,33694,33704,33722,33724,33729,33793,33765,33752,22535,33816,33803,33757,33789,33750,33820,33848,33809,33798,33748,33759,33807,33795,33784,33785,33770,33733,33728,33830,33776,33761,33884,33873,33882,33881,33907,33927,33928,33914,33929,33912,33852,33862,33897,33910,33932,33934,33841,33901,33985,33997,34000,34022,33981,34003,33994,33983,33978,34016,33953,33977,33972,33943,34021,34019,34060,29965,34104,34032,34105,34079,34106,36677,36678,36679,36680,36681,36682,36683,36684,36685,36686,36687,36688,36689,36690,36691,36692,36693,36694,36695,36696,36697,36698,36699,36700,36701,36702,36703,36704,36705,36706,36707,36708,36709,36714,36736,36748,36754,36765,36768,36769,36770,36772,36773,36774,36775,36778,36780,36781,36782,36783,36786,36787,36788,36789,36791,36792,36794,36795,36796,36799,36800,36803,36806,36809,36810,36811,36812,36813,36815,36818,36822,36823,36826,36832,36833,36835,36839,36844,36847,36849,36850,36852,36853,36854,36858,36859,36860,36862,36863,36871,36872,36876,36878,36883,36885,36888,34134,34107,34047,34044,34137,34120,34152,34148,34142,34170,30626,34115,34162,34171,34212,34216,34183,34191,34169,34222,34204,34181,34233,34231,34224,34259,34241,34268,34303,34343,34309,34345,34326,34364,24318,24328,22844,22849,32823,22869,22874,22872,21263,23586,23589,23596,23604,25164,25194,25247,25275,25290,25306,25303,25326,25378,25334,25401,25419,25411,25517,25590,25457,25466,25486,25524,25453,25516,25482,25449,25518,25532,25586,25592,25568,25599,25540,25566,25550,25682,25542,25534,25669,25665,25611,25627,25632,25612,25638,25633,25694,25732,25709,25750,36889,36892,36899,36900,36901,36903,36904,36905,36906,36907,36908,36912,36913,36914,36915,36916,36919,36921,36922,36925,36927,36928,36931,36933,36934,36936,36937,36938,36939,36940,36942,36948,36949,36950,36953,36954,36956,36957,36958,36959,36960,36961,36964,36966,36967,36969,36970,36971,36972,36975,36976,36977,36978,36979,36982,36983,36984,36985,36986,36987,36988,36990,36993,36996,36997,36998,36999,37001,37002,37004,37005,37006,37007,37008,37010,37012,37014,37016,37018,37020,37022,37023,37024,37028,37029,37031,37032,37033,37035,37037,37042,37047,37052,37053,37055,37056,25722,25783,25784,25753,25786,25792,25808,25815,25828,25826,25865,25893,25902,24331,24530,29977,24337,21343,21489,21501,21481,21480,21499,21522,21526,21510,21579,21586,21587,21588,21590,21571,21537,21591,21593,21539,21554,21634,21652,21623,21617,21604,21658,21659,21636,21622,21606,21661,21712,21677,21698,21684,21714,21671,21670,21715,21716,21618,21667,21717,21691,21695,21708,21721,21722,21724,21673,21674,21668,21725,21711,21726,21787,21735,21792,21757,21780,21747,21794,21795,21775,21777,21799,21802,21863,21903,21941,21833,21869,21825,21845,21823,21840,21820,37058,37059,37062,37064,37065,37067,37068,37069,37074,37076,37077,37078,37080,37081,37082,37086,37087,37088,37091,37092,37093,37097,37098,37100,37102,37104,37105,37106,37107,37109,37110,37111,37113,37114,37115,37116,37119,37120,37121,37123,37125,37126,37127,37128,37129,37130,37131,37132,37133,37134,37135,37136,37137,37138,37139,37140,37141,37142,37143,37144,37146,37147,37148,37149,37151,37152,37153,37156,37157,37158,37159,37160,37161,37162,37163,37164,37165,37166,37168,37170,37171,37172,37173,37174,37175,37176,37178,37179,37180,37181,37182,37183,37184,37185,37186,37188,21815,21846,21877,21878,21879,21811,21808,21852,21899,21970,21891,21937,21945,21896,21889,21919,21886,21974,21905,21883,21983,21949,21950,21908,21913,21994,22007,21961,22047,21969,21995,21996,21972,21990,21981,21956,21999,21989,22002,22003,21964,21965,21992,22005,21988,36756,22046,22024,22028,22017,22052,22051,22014,22016,22055,22061,22104,22073,22103,22060,22093,22114,22105,22108,22092,22100,22150,22116,22129,22123,22139,22140,22149,22163,22191,22228,22231,22237,22241,22261,22251,22265,22271,22276,22282,22281,22300,24079,24089,24084,24081,24113,24123,24124,37189,37191,37192,37201,37203,37204,37205,37206,37208,37209,37211,37212,37215,37216,37222,37223,37224,37227,37229,37235,37242,37243,37244,37248,37249,37250,37251,37252,37254,37256,37258,37262,37263,37267,37268,37269,37270,37271,37272,37273,37276,37277,37278,37279,37280,37281,37284,37285,37286,37287,37288,37289,37291,37292,37296,37297,37298,37299,37302,37303,37304,37305,37307,37308,37309,37310,37311,37312,37313,37314,37315,37316,37317,37318,37320,37323,37328,37330,37331,37332,37333,37334,37335,37336,37337,37338,37339,37341,37342,37343,37344,37345,37346,37347,37348,37349,24119,24132,24148,24155,24158,24161,23692,23674,23693,23696,23702,23688,23704,23705,23697,23706,23708,23733,23714,23741,23724,23723,23729,23715,23745,23735,23748,23762,23780,23755,23781,23810,23811,23847,23846,23854,23844,23838,23814,23835,23896,23870,23860,23869,23916,23899,23919,23901,23915,23883,23882,23913,23924,23938,23961,23965,35955,23991,24005,24435,24439,24450,24455,24457,24460,24469,24473,24476,24488,24493,24501,24508,34914,24417,29357,29360,29364,29367,29368,29379,29377,29390,29389,29394,29416,29423,29417,29426,29428,29431,29441,29427,29443,29434,37350,37351,37352,37353,37354,37355,37356,37357,37358,37359,37360,37361,37362,37363,37364,37365,37366,37367,37368,37369,37370,37371,37372,37373,37374,37375,37376,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37387,37388,37389,37390,37391,37392,37393,37394,37395,37396,37397,37398,37399,37400,37401,37402,37403,37404,37405,37406,37407,37408,37409,37410,37411,37412,37413,37414,37415,37416,37417,37418,37419,37420,37421,37422,37423,37424,37425,37426,37427,37428,37429,37430,37431,37432,37433,37434,37435,37436,37437,37438,37439,37440,37441,37442,37443,37444,37445,29435,29463,29459,29473,29450,29470,29469,29461,29474,29497,29477,29484,29496,29489,29520,29517,29527,29536,29548,29551,29566,33307,22821,39143,22820,22786,39267,39271,39272,39273,39274,39275,39276,39284,39287,39293,39296,39300,39303,39306,39309,39312,39313,39315,39316,39317,24192,24209,24203,24214,24229,24224,24249,24245,24254,24243,36179,24274,24273,24283,24296,24298,33210,24516,24521,24534,24527,24579,24558,24580,24545,24548,24574,24581,24582,24554,24557,24568,24601,24629,24614,24603,24591,24589,24617,24619,24586,24639,24609,24696,24697,24699,24698,24642,37446,37447,37448,37449,37450,37451,37452,37453,37454,37455,37456,37457,37458,37459,37460,37461,37462,37463,37464,37465,37466,37467,37468,37469,37470,37471,37472,37473,37474,37475,37476,37477,37478,37479,37480,37481,37482,37483,37484,37485,37486,37487,37488,37489,37490,37491,37493,37494,37495,37496,37497,37498,37499,37500,37501,37502,37503,37504,37505,37506,37507,37508,37509,37510,37511,37512,37513,37514,37515,37516,37517,37519,37520,37521,37522,37523,37524,37525,37526,37527,37528,37529,37530,37531,37532,37533,37534,37535,37536,37537,37538,37539,37540,37541,37542,37543,24682,24701,24726,24730,24749,24733,24707,24722,24716,24731,24812,24763,24753,24797,24792,24774,24794,24756,24864,24870,24853,24867,24820,24832,24846,24875,24906,24949,25004,24980,24999,25015,25044,25077,24541,38579,38377,38379,38385,38387,38389,38390,38396,38398,38403,38404,38406,38408,38410,38411,38412,38413,38415,38418,38421,38422,38423,38425,38426,20012,29247,25109,27701,27732,27740,27722,27811,27781,27792,27796,27788,27752,27753,27764,27766,27782,27817,27856,27860,27821,27895,27896,27889,27863,27826,27872,27862,27898,27883,27886,27825,27859,27887,27902,37544,37545,37546,37547,37548,37549,37551,37552,37553,37554,37555,37556,37557,37558,37559,37560,37561,37562,37563,37564,37565,37566,37567,37568,37569,37570,37571,37572,37573,37574,37575,37577,37578,37579,37580,37581,37582,37583,37584,37585,37586,37587,37588,37589,37590,37591,37592,37593,37594,37595,37596,37597,37598,37599,37600,37601,37602,37603,37604,37605,37606,37607,37608,37609,37610,37611,37612,37613,37614,37615,37616,37617,37618,37619,37620,37621,37622,37623,37624,37625,37626,37627,37628,37629,37630,37631,37632,37633,37634,37635,37636,37637,37638,37639,37640,37641,27961,27943,27916,27971,27976,27911,27908,27929,27918,27947,27981,27950,27957,27930,27983,27986,27988,27955,28049,28015,28062,28064,27998,28051,28052,27996,28000,28028,28003,28186,28103,28101,28126,28174,28095,28128,28177,28134,28125,28121,28182,28075,28172,28078,28203,28270,28238,28267,28338,28255,28294,28243,28244,28210,28197,28228,28383,28337,28312,28384,28461,28386,28325,28327,28349,28347,28343,28375,28340,28367,28303,28354,28319,28514,28486,28487,28452,28437,28409,28463,28470,28491,28532,28458,28425,28457,28553,28557,28556,28536,28530,28540,28538,28625,37642,37643,37644,37645,37646,37647,37648,37649,37650,37651,37652,37653,37654,37655,37656,37657,37658,37659,37660,37661,37662,37663,37664,37665,37666,37667,37668,37669,37670,37671,37672,37673,37674,37675,37676,37677,37678,37679,37680,37681,37682,37683,37684,37685,37686,37687,37688,37689,37690,37691,37692,37693,37695,37696,37697,37698,37699,37700,37701,37702,37703,37704,37705,37706,37707,37708,37709,37710,37711,37712,37713,37714,37715,37716,37717,37718,37719,37720,37721,37722,37723,37724,37725,37726,37727,37728,37729,37730,37731,37732,37733,37734,37735,37736,37737,37739,28617,28583,28601,28598,28610,28641,28654,28638,28640,28655,28698,28707,28699,28729,28725,28751,28766,23424,23428,23445,23443,23461,23480,29999,39582,25652,23524,23534,35120,23536,36423,35591,36790,36819,36821,36837,36846,36836,36841,36838,36851,36840,36869,36868,36875,36902,36881,36877,36886,36897,36917,36918,36909,36911,36932,36945,36946,36944,36968,36952,36962,36955,26297,36980,36989,36994,37000,36995,37003,24400,24407,24406,24408,23611,21675,23632,23641,23409,23651,23654,32700,24362,24361,24365,33396,24380,39739,23662,22913,22915,22925,22953,22954,22947,37740,37741,37742,37743,37744,37745,37746,37747,37748,37749,37750,37751,37752,37753,37754,37755,37756,37757,37758,37759,37760,37761,37762,37763,37764,37765,37766,37767,37768,37769,37770,37771,37772,37773,37774,37776,37777,37778,37779,37780,37781,37782,37783,37784,37785,37786,37787,37788,37789,37790,37791,37792,37793,37794,37795,37796,37797,37798,37799,37800,37801,37802,37803,37804,37805,37806,37807,37808,37809,37810,37811,37812,37813,37814,37815,37816,37817,37818,37819,37820,37821,37822,37823,37824,37825,37826,37827,37828,37829,37830,37831,37832,37833,37835,37836,37837,22935,22986,22955,22942,22948,22994,22962,22959,22999,22974,23045,23046,23005,23048,23011,23000,23033,23052,23049,23090,23092,23057,23075,23059,23104,23143,23114,23125,23100,23138,23157,33004,23210,23195,23159,23162,23230,23275,23218,23250,23252,23224,23264,23267,23281,23254,23270,23256,23260,23305,23319,23318,23346,23351,23360,23573,23580,23386,23397,23411,23377,23379,23394,39541,39543,39544,39546,39551,39549,39552,39553,39557,39560,39562,39568,39570,39571,39574,39576,39579,39580,39581,39583,39584,39586,39587,39589,39591,32415,32417,32419,32421,32424,32425,37838,37839,37840,37841,37842,37843,37844,37845,37847,37848,37849,37850,37851,37852,37853,37854,37855,37856,37857,37858,37859,37860,37861,37862,37863,37864,37865,37866,37867,37868,37869,37870,37871,37872,37873,37874,37875,37876,37877,37878,37879,37880,37881,37882,37883,37884,37885,37886,37887,37888,37889,37890,37891,37892,37893,37894,37895,37896,37897,37898,37899,37900,37901,37902,37903,37904,37905,37906,37907,37908,37909,37910,37911,37912,37913,37914,37915,37916,37917,37918,37919,37920,37921,37922,37923,37924,37925,37926,37927,37928,37929,37930,37931,37932,37933,37934,32429,32432,32446,32448,32449,32450,32457,32459,32460,32464,32468,32471,32475,32480,32481,32488,32491,32494,32495,32497,32498,32525,32502,32506,32507,32510,32513,32514,32515,32519,32520,32523,32524,32527,32529,32530,32535,32537,32540,32539,32543,32545,32546,32547,32548,32549,32550,32551,32554,32555,32556,32557,32559,32560,32561,32562,32563,32565,24186,30079,24027,30014,37013,29582,29585,29614,29602,29599,29647,29634,29649,29623,29619,29632,29641,29640,29669,29657,39036,29706,29673,29671,29662,29626,29682,29711,29738,29787,29734,29733,29736,29744,29742,29740,37935,37936,37937,37938,37939,37940,37941,37942,37943,37944,37945,37946,37947,37948,37949,37951,37952,37953,37954,37955,37956,37957,37958,37959,37960,37961,37962,37963,37964,37965,37966,37967,37968,37969,37970,37971,37972,37973,37974,37975,37976,37977,37978,37979,37980,37981,37982,37983,37984,37985,37986,37987,37988,37989,37990,37991,37992,37993,37994,37996,37997,37998,37999,38000,38001,38002,38003,38004,38005,38006,38007,38008,38009,38010,38011,38012,38013,38014,38015,38016,38017,38018,38019,38020,38033,38038,38040,38087,38095,38099,38100,38106,38118,38139,38172,38176,29723,29722,29761,29788,29783,29781,29785,29815,29805,29822,29852,29838,29824,29825,29831,29835,29854,29864,29865,29840,29863,29906,29882,38890,38891,38892,26444,26451,26462,26440,26473,26533,26503,26474,26483,26520,26535,26485,26536,26526,26541,26507,26487,26492,26608,26633,26584,26634,26601,26544,26636,26585,26549,26586,26547,26589,26624,26563,26552,26594,26638,26561,26621,26674,26675,26720,26721,26702,26722,26692,26724,26755,26653,26709,26726,26689,26727,26688,26686,26698,26697,26665,26805,26767,26740,26743,26771,26731,26818,26990,26876,26911,26912,26873,38183,38195,38205,38211,38216,38219,38229,38234,38240,38254,38260,38261,38263,38264,38265,38266,38267,38268,38269,38270,38272,38273,38274,38275,38276,38277,38278,38279,38280,38281,38282,38283,38284,38285,38286,38287,38288,38289,38290,38291,38292,38293,38294,38295,38296,38297,38298,38299,38300,38301,38302,38303,38304,38305,38306,38307,38308,38309,38310,38311,38312,38313,38314,38315,38316,38317,38318,38319,38320,38321,38322,38323,38324,38325,38326,38327,38328,38329,38330,38331,38332,38333,38334,38335,38336,38337,38338,38339,38340,38341,38342,38343,38344,38345,38346,38347,26916,26864,26891,26881,26967,26851,26896,26993,26937,26976,26946,26973,27012,26987,27008,27032,27000,26932,27084,27015,27016,27086,27017,26982,26979,27001,27035,27047,27067,27051,27053,27092,27057,27073,27082,27103,27029,27104,27021,27135,27183,27117,27159,27160,27237,27122,27204,27198,27296,27216,27227,27189,27278,27257,27197,27176,27224,27260,27281,27280,27305,27287,27307,29495,29522,27521,27522,27527,27524,27538,27539,27533,27546,27547,27553,27562,36715,36717,36721,36722,36723,36725,36726,36728,36727,36729,36730,36732,36734,36737,36738,36740,36743,36747,38348,38349,38350,38351,38352,38353,38354,38355,38356,38357,38358,38359,38360,38361,38362,38363,38364,38365,38366,38367,38368,38369,38370,38371,38372,38373,38374,38375,38380,38399,38407,38419,38424,38427,38430,38432,38435,38436,38437,38438,38439,38440,38441,38443,38444,38445,38447,38448,38455,38456,38457,38458,38462,38465,38467,38474,38478,38479,38481,38482,38483,38486,38487,38488,38489,38490,38492,38493,38494,38496,38499,38501,38502,38507,38509,38510,38511,38512,38513,38515,38520,38521,38522,38523,38524,38525,38526,38527,38528,38529,38530,38531,38532,38535,38537,38538,36749,36750,36751,36760,36762,36558,25099,25111,25115,25119,25122,25121,25125,25124,25132,33255,29935,29940,29951,29967,29969,29971,25908,26094,26095,26096,26122,26137,26482,26115,26133,26112,28805,26359,26141,26164,26161,26166,26165,32774,26207,26196,26177,26191,26198,26209,26199,26231,26244,26252,26279,26269,26302,26331,26332,26342,26345,36146,36147,36150,36155,36157,36160,36165,36166,36168,36169,36167,36173,36181,36185,35271,35274,35275,35276,35278,35279,35280,35281,29294,29343,29277,29286,29295,29310,29311,29316,29323,29325,29327,29330,25352,25394,25520,38540,38542,38545,38546,38547,38549,38550,38554,38555,38557,38558,38559,38560,38561,38562,38563,38564,38565,38566,38568,38569,38570,38571,38572,38573,38574,38575,38577,38578,38580,38581,38583,38584,38586,38587,38591,38594,38595,38600,38602,38603,38608,38609,38611,38612,38614,38615,38616,38617,38618,38619,38620,38621,38622,38623,38625,38626,38627,38628,38629,38630,38631,38635,38636,38637,38638,38640,38641,38642,38644,38645,38648,38650,38651,38652,38653,38655,38658,38659,38661,38666,38667,38668,38672,38673,38674,38676,38677,38679,38680,38681,38682,38683,38685,38687,38688,25663,25816,32772,27626,27635,27645,27637,27641,27653,27655,27654,27661,27669,27672,27673,27674,27681,27689,27684,27690,27698,25909,25941,25963,29261,29266,29270,29232,34402,21014,32927,32924,32915,32956,26378,32957,32945,32939,32941,32948,32951,32999,33000,33001,33002,32987,32962,32964,32985,32973,32983,26384,32989,33003,33009,33012,33005,33037,33038,33010,33020,26389,33042,35930,33078,33054,33068,33048,33074,33096,33100,33107,33140,33113,33114,33137,33120,33129,33148,33149,33133,33127,22605,23221,33160,33154,33169,28373,33187,33194,33228,26406,33226,33211,38689,38690,38691,38692,38693,38694,38695,38696,38697,38699,38700,38702,38703,38705,38707,38708,38709,38710,38711,38714,38715,38716,38717,38719,38720,38721,38722,38723,38724,38725,38726,38727,38728,38729,38730,38731,38732,38733,38734,38735,38736,38737,38740,38741,38743,38744,38746,38748,38749,38751,38755,38756,38758,38759,38760,38762,38763,38764,38765,38766,38767,38768,38769,38770,38773,38775,38776,38777,38778,38779,38781,38782,38783,38784,38785,38786,38787,38788,38790,38791,38792,38793,38794,38796,38798,38799,38800,38803,38805,38806,38807,38809,38810,38811,38812,38813,33217,33190,27428,27447,27449,27459,27462,27481,39121,39122,39123,39125,39129,39130,27571,24384,27586,35315,26000,40785,26003,26044,26054,26052,26051,26060,26062,26066,26070,28800,28828,28822,28829,28859,28864,28855,28843,28849,28904,28874,28944,28947,28950,28975,28977,29043,29020,29032,28997,29042,29002,29048,29050,29080,29107,29109,29096,29088,29152,29140,29159,29177,29213,29224,28780,28952,29030,29113,25150,25149,25155,25160,25161,31035,31040,31046,31049,31067,31068,31059,31066,31074,31063,31072,31087,31079,31098,31109,31114,31130,31143,31155,24529,24528,38814,38815,38817,38818,38820,38821,38822,38823,38824,38825,38826,38828,38830,38832,38833,38835,38837,38838,38839,38840,38841,38842,38843,38844,38845,38846,38847,38848,38849,38850,38851,38852,38853,38854,38855,38856,38857,38858,38859,38860,38861,38862,38863,38864,38865,38866,38867,38868,38869,38870,38871,38872,38873,38874,38875,38876,38877,38878,38879,38880,38881,38882,38883,38884,38885,38888,38894,38895,38896,38897,38898,38900,38903,38904,38905,38906,38907,38908,38909,38910,38911,38912,38913,38914,38915,38916,38917,38918,38919,38920,38921,38922,38923,38924,38925,38926,24636,24669,24666,24679,24641,24665,24675,24747,24838,24845,24925,25001,24989,25035,25041,25094,32896,32895,27795,27894,28156,30710,30712,30720,30729,30743,30744,30737,26027,30765,30748,30749,30777,30778,30779,30751,30780,30757,30764,30755,30761,30798,30829,30806,30807,30758,30800,30791,30796,30826,30875,30867,30874,30855,30876,30881,30883,30898,30905,30885,30932,30937,30921,30956,30962,30981,30964,30995,31012,31006,31028,40859,40697,40699,40700,30449,30468,30477,30457,30471,30472,30490,30498,30489,30509,30502,30517,30520,30544,30545,30535,30531,30554,30568,38927,38928,38929,38930,38931,38932,38933,38934,38935,38936,38937,38938,38939,38940,38941,38942,38943,38944,38945,38946,38947,38948,38949,38950,38951,38952,38953,38954,38955,38956,38957,38958,38959,38960,38961,38962,38963,38964,38965,38966,38967,38968,38969,38970,38971,38972,38973,38974,38975,38976,38977,38978,38979,38980,38981,38982,38983,38984,38985,38986,38987,38988,38989,38990,38991,38992,38993,38994,38995,38996,38997,38998,38999,39000,39001,39002,39003,39004,39005,39006,39007,39008,39009,39010,39011,39012,39013,39014,39015,39016,39017,39018,39019,39020,39021,39022,30562,30565,30591,30605,30589,30592,30604,30609,30623,30624,30640,30645,30653,30010,30016,30030,30027,30024,30043,30066,30073,30083,32600,32609,32607,35400,32616,32628,32625,32633,32641,32638,30413,30437,34866,38021,38022,38023,38027,38026,38028,38029,38031,38032,38036,38039,38037,38042,38043,38044,38051,38052,38059,38058,38061,38060,38063,38064,38066,38068,38070,38071,38072,38073,38074,38076,38077,38079,38084,38088,38089,38090,38091,38092,38093,38094,38096,38097,38098,38101,38102,38103,38105,38104,38107,38110,38111,38112,38114,38116,38117,38119,38120,38122,39023,39024,39025,39026,39027,39028,39051,39054,39058,39061,39065,39075,39080,39081,39082,39083,39084,39085,39086,39087,39088,39089,39090,39091,39092,39093,39094,39095,39096,39097,39098,39099,39100,39101,39102,39103,39104,39105,39106,39107,39108,39109,39110,39111,39112,39113,39114,39115,39116,39117,39119,39120,39124,39126,39127,39131,39132,39133,39136,39137,39138,39139,39140,39141,39142,39145,39146,39147,39148,39149,39150,39151,39152,39153,39154,39155,39156,39157,39158,39159,39160,39161,39162,39163,39164,39165,39166,39167,39168,39169,39170,39171,39172,39173,39174,39175,38121,38123,38126,38127,38131,38132,38133,38135,38137,38140,38141,38143,38147,38146,38150,38151,38153,38154,38157,38158,38159,38162,38163,38164,38165,38166,38168,38171,38173,38174,38175,38178,38186,38187,38185,38188,38193,38194,38196,38198,38199,38200,38204,38206,38207,38210,38197,38212,38213,38214,38217,38220,38222,38223,38226,38227,38228,38230,38231,38232,38233,38235,38238,38239,38237,38241,38242,38244,38245,38246,38247,38248,38249,38250,38251,38252,38255,38257,38258,38259,38202,30695,30700,38601,31189,31213,31203,31211,31238,23879,31235,31234,31262,31252,39176,39177,39178,39179,39180,39182,39183,39185,39186,39187,39188,39189,39190,39191,39192,39193,39194,39195,39196,39197,39198,39199,39200,39201,39202,39203,39204,39205,39206,39207,39208,39209,39210,39211,39212,39213,39215,39216,39217,39218,39219,39220,39221,39222,39223,39224,39225,39226,39227,39228,39229,39230,39231,39232,39233,39234,39235,39236,39237,39238,39239,39240,39241,39242,39243,39244,39245,39246,39247,39248,39249,39250,39251,39254,39255,39256,39257,39258,39259,39260,39261,39262,39263,39264,39265,39266,39268,39270,39283,39288,39289,39291,39294,39298,39299,39305,31289,31287,31313,40655,39333,31344,30344,30350,30355,30361,30372,29918,29920,29996,40480,40482,40488,40489,40490,40491,40492,40498,40497,40502,40504,40503,40505,40506,40510,40513,40514,40516,40518,40519,40520,40521,40523,40524,40526,40529,40533,40535,40538,40539,40540,40542,40547,40550,40551,40552,40553,40554,40555,40556,40561,40557,40563,30098,30100,30102,30112,30109,30124,30115,30131,30132,30136,30148,30129,30128,30147,30146,30166,30157,30179,30184,30182,30180,30187,30183,30211,30193,30204,30207,30224,30208,30213,30220,30231,30218,30245,30232,30229,30233,39308,39310,39322,39323,39324,39325,39326,39327,39328,39329,39330,39331,39332,39334,39335,39337,39338,39339,39340,39341,39342,39343,39344,39345,39346,39347,39348,39349,39350,39351,39352,39353,39354,39355,39356,39357,39358,39359,39360,39361,39362,39363,39364,39365,39366,39367,39368,39369,39370,39371,39372,39373,39374,39375,39376,39377,39378,39379,39380,39381,39382,39383,39384,39385,39386,39387,39388,39389,39390,39391,39392,39393,39394,39395,39396,39397,39398,39399,39400,39401,39402,39403,39404,39405,39406,39407,39408,39409,39410,39411,39412,39413,39414,39415,39416,39417,30235,30268,30242,30240,30272,30253,30256,30271,30261,30275,30270,30259,30285,30302,30292,30300,30294,30315,30319,32714,31462,31352,31353,31360,31366,31368,31381,31398,31392,31404,31400,31405,31411,34916,34921,34930,34941,34943,34946,34978,35014,34999,35004,35017,35042,35022,35043,35045,35057,35098,35068,35048,35070,35056,35105,35097,35091,35099,35082,35124,35115,35126,35137,35174,35195,30091,32997,30386,30388,30684,32786,32788,32790,32796,32800,32802,32805,32806,32807,32809,32808,32817,32779,32821,32835,32838,32845,32850,32873,32881,35203,39032,39040,39043,39418,39419,39420,39421,39422,39423,39424,39425,39426,39427,39428,39429,39430,39431,39432,39433,39434,39435,39436,39437,39438,39439,39440,39441,39442,39443,39444,39445,39446,39447,39448,39449,39450,39451,39452,39453,39454,39455,39456,39457,39458,39459,39460,39461,39462,39463,39464,39465,39466,39467,39468,39469,39470,39471,39472,39473,39474,39475,39476,39477,39478,39479,39480,39481,39482,39483,39484,39485,39486,39487,39488,39489,39490,39491,39492,39493,39494,39495,39496,39497,39498,39499,39500,39501,39502,39503,39504,39505,39506,39507,39508,39509,39510,39511,39512,39513,39049,39052,39053,39055,39060,39066,39067,39070,39071,39073,39074,39077,39078,34381,34388,34412,34414,34431,34426,34428,34427,34472,34445,34443,34476,34461,34471,34467,34474,34451,34473,34486,34500,34485,34510,34480,34490,34481,34479,34505,34511,34484,34537,34545,34546,34541,34547,34512,34579,34526,34548,34527,34520,34513,34563,34567,34552,34568,34570,34573,34569,34595,34619,34590,34597,34606,34586,34622,34632,34612,34609,34601,34615,34623,34690,34594,34685,34686,34683,34656,34672,34636,34670,34699,34643,34659,34684,34660,34649,34661,34707,34735,34728,34770,39514,39515,39516,39517,39518,39519,39520,39521,39522,39523,39524,39525,39526,39527,39528,39529,39530,39531,39538,39555,39561,39565,39566,39572,39573,39577,39590,39593,39594,39595,39596,39597,39598,39599,39602,39603,39604,39605,39609,39611,39613,39614,39615,39619,39620,39622,39623,39624,39625,39626,39629,39630,39631,39632,39634,39636,39637,39638,39639,39641,39642,39643,39644,39645,39646,39648,39650,39651,39652,39653,39655,39656,39657,39658,39660,39662,39664,39665,39666,39667,39668,39669,39670,39671,39672,39674,39676,39677,39678,39679,39680,39681,39682,39684,39685,39686,34758,34696,34693,34733,34711,34691,34731,34789,34732,34741,34739,34763,34771,34749,34769,34752,34762,34779,34794,34784,34798,34838,34835,34814,34826,34843,34849,34873,34876,32566,32578,32580,32581,33296,31482,31485,31496,31491,31492,31509,31498,31531,31503,31559,31544,31530,31513,31534,31537,31520,31525,31524,31539,31550,31518,31576,31578,31557,31605,31564,31581,31584,31598,31611,31586,31602,31601,31632,31654,31655,31672,31660,31645,31656,31621,31658,31644,31650,31659,31668,31697,31681,31692,31709,31706,31717,31718,31722,31756,31742,31740,31759,31766,31755,39687,39689,39690,39691,39692,39693,39694,39696,39697,39698,39700,39701,39702,39703,39704,39705,39706,39707,39708,39709,39710,39712,39713,39714,39716,39717,39718,39719,39720,39721,39722,39723,39724,39725,39726,39728,39729,39731,39732,39733,39734,39735,39736,39737,39738,39741,39742,39743,39744,39750,39754,39755,39756,39758,39760,39762,39763,39765,39766,39767,39768,39769,39770,39771,39772,39773,39774,39775,39776,39777,39778,39779,39780,39781,39782,39783,39784,39785,39786,39787,39788,39789,39790,39791,39792,39793,39794,39795,39796,39797,39798,39799,39800,39801,39802,39803,31775,31786,31782,31800,31809,31808,33278,33281,33282,33284,33260,34884,33313,33314,33315,33325,33327,33320,33323,33336,33339,33331,33332,33342,33348,33353,33355,33359,33370,33375,33384,34942,34949,34952,35032,35039,35166,32669,32671,32679,32687,32688,32690,31868,25929,31889,31901,31900,31902,31906,31922,31932,31933,31937,31943,31948,31949,31944,31941,31959,31976,33390,26280,32703,32718,32725,32741,32737,32742,32745,32750,32755,31992,32119,32166,32174,32327,32411,40632,40628,36211,36228,36244,36241,36273,36199,36205,35911,35913,37194,37200,37198,37199,37220,39804,39805,39806,39807,39808,39809,39810,39811,39812,39813,39814,39815,39816,39817,39818,39819,39820,39821,39822,39823,39824,39825,39826,39827,39828,39829,39830,39831,39832,39833,39834,39835,39836,39837,39838,39839,39840,39841,39842,39843,39844,39845,39846,39847,39848,39849,39850,39851,39852,39853,39854,39855,39856,39857,39858,39859,39860,39861,39862,39863,39864,39865,39866,39867,39868,39869,39870,39871,39872,39873,39874,39875,39876,39877,39878,39879,39880,39881,39882,39883,39884,39885,39886,39887,39888,39889,39890,39891,39892,39893,39894,39895,39896,39897,39898,39899,37218,37217,37232,37225,37231,37245,37246,37234,37236,37241,37260,37253,37264,37261,37265,37282,37283,37290,37293,37294,37295,37301,37300,37306,35925,40574,36280,36331,36357,36441,36457,36277,36287,36284,36282,36292,36310,36311,36314,36318,36302,36303,36315,36294,36332,36343,36344,36323,36345,36347,36324,36361,36349,36372,36381,36383,36396,36398,36387,36399,36410,36416,36409,36405,36413,36401,36425,36417,36418,36433,36434,36426,36464,36470,36476,36463,36468,36485,36495,36500,36496,36508,36510,35960,35970,35978,35973,35992,35988,26011,35286,35294,35290,35292,39900,39901,39902,39903,39904,39905,39906,39907,39908,39909,39910,39911,39912,39913,39914,39915,39916,39917,39918,39919,39920,39921,39922,39923,39924,39925,39926,39927,39928,39929,39930,39931,39932,39933,39934,39935,39936,39937,39938,39939,39940,39941,39942,39943,39944,39945,39946,39947,39948,39949,39950,39951,39952,39953,39954,39955,39956,39957,39958,39959,39960,39961,39962,39963,39964,39965,39966,39967,39968,39969,39970,39971,39972,39973,39974,39975,39976,39977,39978,39979,39980,39981,39982,39983,39984,39985,39986,39987,39988,39989,39990,39991,39992,39993,39994,39995,35301,35307,35311,35390,35622,38739,38633,38643,38639,38662,38657,38664,38671,38670,38698,38701,38704,38718,40832,40835,40837,40838,40839,40840,40841,40842,40844,40702,40715,40717,38585,38588,38589,38606,38610,30655,38624,37518,37550,37576,37694,37738,37834,37775,37950,37995,40063,40066,40069,40070,40071,40072,31267,40075,40078,40080,40081,40082,40084,40085,40090,40091,40094,40095,40096,40097,40098,40099,40101,40102,40103,40104,40105,40107,40109,40110,40112,40113,40114,40115,40116,40117,40118,40119,40122,40123,40124,40125,40132,40133,40134,40135,40138,40139,39996,39997,39998,39999,40000,40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040,40041,40042,40043,40044,40045,40046,40047,40048,40049,40050,40051,40052,40053,40054,40055,40056,40057,40058,40059,40061,40062,40064,40067,40068,40073,40074,40076,40079,40083,40086,40087,40088,40089,40093,40106,40108,40111,40121,40126,40127,40128,40129,40130,40136,40137,40145,40146,40154,40155,40160,40161,40140,40141,40142,40143,40144,40147,40148,40149,40151,40152,40153,40156,40157,40159,40162,38780,38789,38801,38802,38804,38831,38827,38819,38834,38836,39601,39600,39607,40536,39606,39610,39612,39617,39616,39621,39618,39627,39628,39633,39749,39747,39751,39753,39752,39757,39761,39144,39181,39214,39253,39252,39647,39649,39654,39663,39659,39675,39661,39673,39688,39695,39699,39711,39715,40637,40638,32315,40578,40583,40584,40587,40594,37846,40605,40607,40667,40668,40669,40672,40671,40674,40681,40679,40677,40682,40687,40738,40748,40751,40761,40759,40765,40766,40772,40163,40164,40165,40166,40167,40168,40169,40170,40171,40172,40173,40174,40175,40176,40177,40178,40179,40180,40181,40182,40183,40184,40185,40186,40187,40188,40189,40190,40191,40192,40193,40194,40195,40196,40197,40198,40199,40200,40201,40202,40203,40204,40205,40206,40207,40208,40209,40210,40211,40212,40213,40214,40215,40216,40217,40218,40219,40220,40221,40222,40223,40224,40225,40226,40227,40228,40229,40230,40231,40232,40233,40234,40235,40236,40237,40238,40239,40240,40241,40242,40243,40244,40245,40246,40247,40248,40249,40250,40251,40252,40253,40254,40255,40256,40257,40258,57908,57909,57910,57911,57912,57913,57914,57915,57916,57917,57918,57919,57920,57921,57922,57923,57924,57925,57926,57927,57928,57929,57930,57931,57932,57933,57934,57935,57936,57937,57938,57939,57940,57941,57942,57943,57944,57945,57946,57947,57948,57949,57950,57951,57952,57953,57954,57955,57956,57957,57958,57959,57960,57961,57962,57963,57964,57965,57966,57967,57968,57969,57970,57971,57972,57973,57974,57975,57976,57977,57978,57979,57980,57981,57982,57983,57984,57985,57986,57987,57988,57989,57990,57991,57992,57993,57994,57995,57996,57997,57998,57999,58000,58001,40259,40260,40261,40262,40263,40264,40265,40266,40267,40268,40269,40270,40271,40272,40273,40274,40275,40276,40277,40278,40279,40280,40281,40282,40283,40284,40285,40286,40287,40288,40289,40290,40291,40292,40293,40294,40295,40296,40297,40298,40299,40300,40301,40302,40303,40304,40305,40306,40307,40308,40309,40310,40311,40312,40313,40314,40315,40316,40317,40318,40319,40320,40321,40322,40323,40324,40325,40326,40327,40328,40329,40330,40331,40332,40333,40334,40335,40336,40337,40338,40339,40340,40341,40342,40343,40344,40345,40346,40347,40348,40349,40350,40351,40352,40353,40354,58002,58003,58004,58005,58006,58007,58008,58009,58010,58011,58012,58013,58014,58015,58016,58017,58018,58019,58020,58021,58022,58023,58024,58025,58026,58027,58028,58029,58030,58031,58032,58033,58034,58035,58036,58037,58038,58039,58040,58041,58042,58043,58044,58045,58046,58047,58048,58049,58050,58051,58052,58053,58054,58055,58056,58057,58058,58059,58060,58061,58062,58063,58064,58065,58066,58067,58068,58069,58070,58071,58072,58073,58074,58075,58076,58077,58078,58079,58080,58081,58082,58083,58084,58085,58086,58087,58088,58089,58090,58091,58092,58093,58094,58095,40355,40356,40357,40358,40359,40360,40361,40362,40363,40364,40365,40366,40367,40368,40369,40370,40371,40372,40373,40374,40375,40376,40377,40378,40379,40380,40381,40382,40383,40384,40385,40386,40387,40388,40389,40390,40391,40392,40393,40394,40395,40396,40397,40398,40399,40400,40401,40402,40403,40404,40405,40406,40407,40408,40409,40410,40411,40412,40413,40414,40415,40416,40417,40418,40419,40420,40421,40422,40423,40424,40425,40426,40427,40428,40429,40430,40431,40432,40433,40434,40435,40436,40437,40438,40439,40440,40441,40442,40443,40444,40445,40446,40447,40448,40449,40450,58096,58097,58098,58099,58100,58101,58102,58103,58104,58105,58106,58107,58108,58109,58110,58111,58112,58113,58114,58115,58116,58117,58118,58119,58120,58121,58122,58123,58124,58125,58126,58127,58128,58129,58130,58131,58132,58133,58134,58135,58136,58137,58138,58139,58140,58141,58142,58143,58144,58145,58146,58147,58148,58149,58150,58151,58152,58153,58154,58155,58156,58157,58158,58159,58160,58161,58162,58163,58164,58165,58166,58167,58168,58169,58170,58171,58172,58173,58174,58175,58176,58177,58178,58179,58180,58181,58182,58183,58184,58185,58186,58187,58188,58189,40451,40452,40453,40454,40455,40456,40457,40458,40459,40460,40461,40462,40463,40464,40465,40466,40467,40468,40469,40470,40471,40472,40473,40474,40475,40476,40477,40478,40484,40487,40494,40496,40500,40507,40508,40512,40525,40528,40530,40531,40532,40534,40537,40541,40543,40544,40545,40546,40549,40558,40559,40562,40564,40565,40566,40567,40568,40569,40570,40571,40572,40573,40576,40577,40579,40580,40581,40582,40585,40586,40588,40589,40590,40591,40592,40593,40596,40597,40598,40599,40600,40601,40602,40603,40604,40606,40608,40609,40610,40611,40612,40613,40615,40616,40617,40618,58190,58191,58192,58193,58194,58195,58196,58197,58198,58199,58200,58201,58202,58203,58204,58205,58206,58207,58208,58209,58210,58211,58212,58213,58214,58215,58216,58217,58218,58219,58220,58221,58222,58223,58224,58225,58226,58227,58228,58229,58230,58231,58232,58233,58234,58235,58236,58237,58238,58239,58240,58241,58242,58243,58244,58245,58246,58247,58248,58249,58250,58251,58252,58253,58254,58255,58256,58257,58258,58259,58260,58261,58262,58263,58264,58265,58266,58267,58268,58269,58270,58271,58272,58273,58274,58275,58276,58277,58278,58279,58280,58281,58282,58283,40619,40620,40621,40622,40623,40624,40625,40626,40627,40629,40630,40631,40633,40634,40636,40639,40640,40641,40642,40643,40645,40646,40647,40648,40650,40651,40652,40656,40658,40659,40661,40662,40663,40665,40666,40670,40673,40675,40676,40678,40680,40683,40684,40685,40686,40688,40689,40690,40691,40692,40693,40694,40695,40696,40698,40701,40703,40704,40705,40706,40707,40708,40709,40710,40711,40712,40713,40714,40716,40719,40721,40722,40724,40725,40726,40728,40730,40731,40732,40733,40734,40735,40737,40739,40740,40741,40742,40743,40744,40745,40746,40747,40749,40750,40752,40753,58284,58285,58286,58287,58288,58289,58290,58291,58292,58293,58294,58295,58296,58297,58298,58299,58300,58301,58302,58303,58304,58305,58306,58307,58308,58309,58310,58311,58312,58313,58314,58315,58316,58317,58318,58319,58320,58321,58322,58323,58324,58325,58326,58327,58328,58329,58330,58331,58332,58333,58334,58335,58336,58337,58338,58339,58340,58341,58342,58343,58344,58345,58346,58347,58348,58349,58350,58351,58352,58353,58354,58355,58356,58357,58358,58359,58360,58361,58362,58363,58364,58365,58366,58367,58368,58369,58370,58371,58372,58373,58374,58375,58376,58377,40754,40755,40756,40757,40758,40760,40762,40764,40767,40768,40769,40770,40771,40773,40774,40775,40776,40777,40778,40779,40780,40781,40782,40783,40786,40787,40788,40789,40790,40791,40792,40793,40794,40795,40796,40797,40798,40799,40800,40801,40802,40803,40804,40805,40806,40807,40808,40809,40810,40811,40812,40813,40814,40815,40816,40817,40818,40819,40820,40821,40822,40823,40824,40825,40826,40827,40828,40829,40830,40833,40834,40845,40846,40847,40848,40849,40850,40851,40852,40853,40854,40855,40856,40860,40861,40862,40865,40866,40867,40868,40869,63788,63865,63893,63975,63985,58378,58379,58380,58381,58382,58383,58384,58385,58386,58387,58388,58389,58390,58391,58392,58393,58394,58395,58396,58397,58398,58399,58400,58401,58402,58403,58404,58405,58406,58407,58408,58409,58410,58411,58412,58413,58414,58415,58416,58417,58418,58419,58420,58421,58422,58423,58424,58425,58426,58427,58428,58429,58430,58431,58432,58433,58434,58435,58436,58437,58438,58439,58440,58441,58442,58443,58444,58445,58446,58447,58448,58449,58450,58451,58452,58453,58454,58455,58456,58457,58458,58459,58460,58461,58462,58463,58464,58465,58466,58467,58468,58469,58470,58471,64012,64013,64014,64015,64017,64019,64020,64024,64031,64032,64033,64035,64036,64039,64040,64041,11905,59414,59415,59416,11908,13427,13383,11912,11915,59422,13726,13850,13838,11916,11927,14702,14616,59430,14799,14815,14963,14800,59435,59436,15182,15470,15584,11943,59441,59442,11946,16470,16735,11950,17207,11955,11958,11959,59451,17329,17324,11963,17373,17622,18017,17996,59459,18211,18217,18300,18317,11978,18759,18810,18813,18818,18819,18821,18822,18847,18843,18871,18870,59476,59477,19619,19615,19616,19617,19575,19618,19731,19732,19733,19734,19735,19736,19737,19886,59492,58472,58473,58474,58475,58476,58477,58478,58479,58480,58481,58482,58483,58484,58485,58486,58487,58488,58489,58490,58491,58492,58493,58494,58495,58496,58497,58498,58499,58500,58501,58502,58503,58504,58505,58506,58507,58508,58509,58510,58511,58512,58513,58514,58515,58516,58517,58518,58519,58520,58521,58522,58523,58524,58525,58526,58527,58528,58529,58530,58531,58532,58533,58534,58535,58536,58537,58538,58539,58540,58541,58542,58543,58544,58545,58546,58547,58548,58549,58550,58551,58552,58553,58554,58555,58556,58557,58558,58559,58560,58561,58562,58563,58564,58565], "gb18030-ranges":[[0,128],[36,165],[38,169],[45,178],[50,184],[81,216],[89,226],[95,235],[96,238],[100,244],[103,248],[104,251],[105,253],[109,258],[126,276],[133,284],[148,300],[172,325],[175,329],[179,334],[208,364],[306,463],[307,465],[308,467],[309,469],[310,471],[311,473],[312,475],[313,477],[341,506],[428,594],[443,610],[544,712],[545,716],[558,730],[741,930],[742,938],[749,962],[750,970],[805,1026],[819,1104],[820,1106],[7922,8209],[7924,8215],[7925,8218],[7927,8222],[7934,8231],[7943,8241],[7944,8244],[7945,8246],[7950,8252],[8062,8365],[8148,8452],[8149,8454],[8152,8458],[8164,8471],[8174,8482],[8236,8556],[8240,8570],[8262,8596],[8264,8602],[8374,8713],[8380,8720],[8381,8722],[8384,8726],[8388,8731],[8390,8737],[8392,8740],[8393,8742],[8394,8748],[8396,8751],[8401,8760],[8406,8766],[8416,8777],[8419,8781],[8424,8787],[8437,8802],[8439,8808],[8445,8816],[8482,8854],[8485,8858],[8496,8870],[8521,8896],[8603,8979],[8936,9322],[8946,9372],[9046,9548],[9050,9588],[9063,9616],[9066,9622],[9076,9634],[9092,9652],[9100,9662],[9108,9672],[9111,9676],[9113,9680],[9131,9702],[9162,9735],[9164,9738],[9218,9793],[9219,9795],[11329,11906],[11331,11909],[11334,11913],[11336,11917],[11346,11928],[11361,11944],[11363,11947],[11366,11951],[11370,11956],[11372,11960],[11375,11964],[11389,11979],[11682,12284],[11686,12292],[11687,12312],[11692,12319],[11694,12330],[11714,12351],[11716,12436],[11723,12447],[11725,12535],[11730,12543],[11736,12586],[11982,12842],[11989,12850],[12102,12964],[12336,13200],[12348,13215],[12350,13218],[12384,13253],[12393,13263],[12395,13267],[12397,13270],[12510,13384],[12553,13428],[12851,13727],[12962,13839],[12973,13851],[13738,14617],[13823,14703],[13919,14801],[13933,14816],[14080,14964],[14298,15183],[14585,15471],[14698,15585],[15583,16471],[15847,16736],[16318,17208],[16434,17325],[16438,17330],[16481,17374],[16729,17623],[17102,17997],[17122,18018],[17315,18212],[17320,18218],[17402,18301],[17418,18318],[17859,18760],[17909,18811],[17911,18814],[17915,18820],[17916,18823],[17936,18844],[17939,18848],[17961,18872],[18664,19576],[18703,19620],[18814,19738],[18962,19887],[19043,40870],[33469,59244],[33470,59336],[33471,59367],[33484,59413],[33485,59417],[33490,59423],[33497,59431],[33501,59437],[33505,59443],[33513,59452],[33520,59460],[33536,59478],[33550,59493],[37845,63789],[37921,63866],[37948,63894],[38029,63976],[38038,63986],[38064,64016],[38065,64018],[38066,64021],[38069,64025],[38075,64034],[38076,64037],[38078,64042],[39108,65074],[39109,65093],[39113,65107],[39114,65112],[39115,65127],[39116,65132],[39265,65375],[39394,65510],[189000,65536]], "jis0208":[12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293,12294,12295,12540,8213,8208,65295,65340,65374,8741,65372,8230,8229,8216,8217,8220,8221,65288,65289,12308,12309,65339,65341,65371,65373,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,65291,65293,177,215,247,65309,8800,65308,65310,8806,8807,8734,8756,9794,9792,176,8242,8243,8451,65509,65284,65504,65505,65285,65283,65286,65290,65312,167,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,8251,12306,8594,8592,8593,8595,12307,null,null,null,null,null,null,null,null,null,null,null,8712,8715,8838,8839,8834,8835,8746,8745,null,null,null,null,null,null,null,null,8743,8744,65506,8658,8660,8704,8707,null,null,null,null,null,null,null,null,null,null,null,8736,8869,8978,8706,8711,8801,8786,8810,8811,8730,8765,8733,8757,8747,8748,null,null,null,null,null,null,null,8491,8240,9839,9837,9834,8224,8225,182,null,null,null,null,9711,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,null,null,null,null,null,null,null,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,null,null,null,null,null,null,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,null,null,null,null,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,null,null,null,null,null,null,null,null,null,null,null,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,null,null,null,null,null,null,null,null,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,null,null,null,null,null,null,null,null,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,null,null,null,null,null,null,null,null,null,null,null,null,null,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,null,13129,13076,13090,13133,13080,13095,13059,13110,13137,13143,13069,13094,13091,13099,13130,13115,13212,13213,13214,13198,13199,13252,13217,null,null,null,null,null,null,null,null,13179,12317,12319,8470,13261,8481,12964,12965,12966,12967,12968,12849,12850,12857,13182,13181,13180,8786,8801,8747,8750,8721,8730,8869,8736,8735,8895,8757,8745,8746,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20124,21782,23043,38463,21696,24859,25384,23030,36898,33909,33564,31312,24746,25569,28197,26093,33894,33446,39925,26771,22311,26017,25201,23451,22992,34427,39156,32098,32190,39822,25110,31903,34999,23433,24245,25353,26263,26696,38343,38797,26447,20197,20234,20301,20381,20553,22258,22839,22996,23041,23561,24799,24847,24944,26131,26885,28858,30031,30064,31227,32173,32239,32963,33806,34915,35586,36949,36986,21307,20117,20133,22495,32946,37057,30959,19968,22769,28322,36920,31282,33576,33419,39983,20801,21360,21693,21729,22240,23035,24341,39154,28139,32996,34093,38498,38512,38560,38907,21515,21491,23431,28879,32701,36802,38632,21359,40284,31418,19985,30867,33276,28198,22040,21764,27421,34074,39995,23013,21417,28006,29916,38287,22082,20113,36939,38642,33615,39180,21473,21942,23344,24433,26144,26355,26628,27704,27891,27945,29787,30408,31310,38964,33521,34907,35424,37613,28082,30123,30410,39365,24742,35585,36234,38322,27022,21421,20870,22290,22576,22852,23476,24310,24616,25513,25588,27839,28436,28814,28948,29017,29141,29503,32257,33398,33489,34199,36960,37467,40219,22633,26044,27738,29989,20985,22830,22885,24448,24540,25276,26106,27178,27431,27572,29579,32705,35158,40236,40206,40644,23713,27798,33659,20740,23627,25014,33222,26742,29281,20057,20474,21368,24681,28201,31311,38899,19979,21270,20206,20309,20285,20385,20339,21152,21487,22025,22799,23233,23478,23521,31185,26247,26524,26550,27468,27827,28779,29634,31117,31166,31292,31623,33457,33499,33540,33655,33775,33747,34662,35506,22057,36008,36838,36942,38686,34442,20420,23784,25105,29273,30011,33253,33469,34558,36032,38597,39187,39381,20171,20250,35299,22238,22602,22730,24315,24555,24618,24724,24674,25040,25106,25296,25913,39745,26214,26800,28023,28784,30028,30342,32117,33445,34809,38283,38542,35997,20977,21182,22806,21683,23475,23830,24936,27010,28079,30861,33995,34903,35442,37799,39608,28012,39336,34521,22435,26623,34510,37390,21123,22151,21508,24275,25313,25785,26684,26680,27579,29554,30906,31339,35226,35282,36203,36611,37101,38307,38548,38761,23398,23731,27005,38989,38990,25499,31520,27179,27263,26806,39949,28511,21106,21917,24688,25324,27963,28167,28369,33883,35088,36676,19988,39993,21494,26907,27194,38788,26666,20828,31427,33970,37340,37772,22107,40232,26658,33541,33841,31909,21000,33477,29926,20094,20355,20896,23506,21002,21208,21223,24059,21914,22570,23014,23436,23448,23515,24178,24185,24739,24863,24931,25022,25563,25954,26577,26707,26874,27454,27475,27735,28450,28567,28485,29872,29976,30435,30475,31487,31649,31777,32233,32566,32752,32925,33382,33694,35251,35532,36011,36996,37969,38291,38289,38306,38501,38867,39208,33304,20024,21547,23736,24012,29609,30284,30524,23721,32747,36107,38593,38929,38996,39000,20225,20238,21361,21916,22120,22522,22855,23305,23492,23696,24076,24190,24524,25582,26426,26071,26082,26399,26827,26820,27231,24112,27589,27671,27773,30079,31048,23395,31232,32000,24509,35215,35352,36020,36215,36556,36637,39138,39438,39740,20096,20605,20736,22931,23452,25135,25216,25836,27450,29344,30097,31047,32681,34811,35516,35696,25516,33738,38816,21513,21507,21931,26708,27224,35440,30759,26485,40653,21364,23458,33050,34384,36870,19992,20037,20167,20241,21450,21560,23470,24339,24613,25937,26429,27714,27762,27875,28792,29699,31350,31406,31496,32026,31998,32102,26087,29275,21435,23621,24040,25298,25312,25369,28192,34394,35377,36317,37624,28417,31142,39770,20136,20139,20140,20379,20384,20689,20807,31478,20849,20982,21332,21281,21375,21483,21932,22659,23777,24375,24394,24623,24656,24685,25375,25945,27211,27841,29378,29421,30703,33016,33029,33288,34126,37111,37857,38911,39255,39514,20208,20957,23597,26241,26989,23616,26354,26997,29577,26704,31873,20677,21220,22343,24062,37670,26020,27427,27453,29748,31105,31165,31563,32202,33465,33740,34943,35167,35641,36817,37329,21535,37504,20061,20534,21477,21306,29399,29590,30697,33510,36527,39366,39368,39378,20855,24858,34398,21936,31354,20598,23507,36935,38533,20018,27355,37351,23633,23624,25496,31391,27795,38772,36705,31402,29066,38536,31874,26647,32368,26705,37740,21234,21531,34219,35347,32676,36557,37089,21350,34952,31041,20418,20670,21009,20804,21843,22317,29674,22411,22865,24418,24452,24693,24950,24935,25001,25522,25658,25964,26223,26690,28179,30054,31293,31995,32076,32153,32331,32619,33550,33610,34509,35336,35427,35686,36605,38938,40335,33464,36814,39912,21127,25119,25731,28608,38553,26689,20625,27424,27770,28500,31348,32080,34880,35363,26376,20214,20537,20518,20581,20860,21048,21091,21927,22287,22533,23244,24314,25010,25080,25331,25458,26908,27177,29309,29356,29486,30740,30831,32121,30476,32937,35211,35609,36066,36562,36963,37749,38522,38997,39443,40568,20803,21407,21427,24187,24358,28187,28304,29572,29694,32067,33335,35328,35578,38480,20046,20491,21476,21628,22266,22993,23396,24049,24235,24359,25144,25925,26543,28246,29392,31946,34996,32929,32993,33776,34382,35463,36328,37431,38599,39015,40723,20116,20114,20237,21320,21577,21566,23087,24460,24481,24735,26791,27278,29786,30849,35486,35492,35703,37264,20062,39881,20132,20348,20399,20505,20502,20809,20844,21151,21177,21246,21402,21475,21521,21518,21897,22353,22434,22909,23380,23389,23439,24037,24039,24055,24184,24195,24218,24247,24344,24658,24908,25239,25304,25511,25915,26114,26179,26356,26477,26657,26775,27083,27743,27946,28009,28207,28317,30002,30343,30828,31295,31968,32005,32024,32094,32177,32789,32771,32943,32945,33108,33167,33322,33618,34892,34913,35611,36002,36092,37066,37237,37489,30783,37628,38308,38477,38917,39321,39640,40251,21083,21163,21495,21512,22741,25335,28640,35946,36703,40633,20811,21051,21578,22269,31296,37239,40288,40658,29508,28425,33136,29969,24573,24794,39592,29403,36796,27492,38915,20170,22256,22372,22718,23130,24680,25031,26127,26118,26681,26801,28151,30165,32058,33390,39746,20123,20304,21449,21766,23919,24038,24046,26619,27801,29811,30722,35408,37782,35039,22352,24231,25387,20661,20652,20877,26368,21705,22622,22971,23472,24425,25165,25505,26685,27507,28168,28797,37319,29312,30741,30758,31085,25998,32048,33756,35009,36617,38555,21092,22312,26448,32618,36001,20916,22338,38442,22586,27018,32948,21682,23822,22524,30869,40442,20316,21066,21643,25662,26152,26388,26613,31364,31574,32034,37679,26716,39853,31545,21273,20874,21047,23519,25334,25774,25830,26413,27578,34217,38609,30352,39894,25420,37638,39851,30399,26194,19977,20632,21442,23665,24808,25746,25955,26719,29158,29642,29987,31639,32386,34453,35715,36059,37240,39184,26028,26283,27531,20181,20180,20282,20351,21050,21496,21490,21987,22235,22763,22987,22985,23039,23376,23629,24066,24107,24535,24605,25351,25903,23388,26031,26045,26088,26525,27490,27515,27663,29509,31049,31169,31992,32025,32043,32930,33026,33267,35222,35422,35433,35430,35468,35566,36039,36060,38604,39164,27503,20107,20284,20365,20816,23383,23546,24904,25345,26178,27425,28363,27835,29246,29885,30164,30913,31034,32780,32819,33258,33940,36766,27728,40575,24335,35672,40235,31482,36600,23437,38635,19971,21489,22519,22833,23241,23460,24713,28287,28422,30142,36074,23455,34048,31712,20594,26612,33437,23649,34122,32286,33294,20889,23556,25448,36198,26012,29038,31038,32023,32773,35613,36554,36974,34503,37034,20511,21242,23610,26451,28796,29237,37196,37320,37675,33509,23490,24369,24825,20027,21462,23432,25163,26417,27530,29417,29664,31278,33131,36259,37202,39318,20754,21463,21610,23551,25480,27193,32172,38656,22234,21454,21608,23447,23601,24030,20462,24833,25342,27954,31168,31179,32066,32333,32722,33261,33311,33936,34886,35186,35728,36468,36655,36913,37195,37228,38598,37276,20160,20303,20805,21313,24467,25102,26580,27713,28171,29539,32294,37325,37507,21460,22809,23487,28113,31069,32302,31899,22654,29087,20986,34899,36848,20426,23803,26149,30636,31459,33308,39423,20934,24490,26092,26991,27529,28147,28310,28516,30462,32020,24033,36981,37255,38918,20966,21021,25152,26257,26329,28186,24246,32210,32626,26360,34223,34295,35576,21161,21465,22899,24207,24464,24661,37604,38500,20663,20767,21213,21280,21319,21484,21736,21830,21809,22039,22888,22974,23100,23477,23558,23567,23569,23578,24196,24202,24288,24432,25215,25220,25307,25484,25463,26119,26124,26157,26230,26494,26786,27167,27189,27836,28040,28169,28248,28988,28966,29031,30151,30465,30813,30977,31077,31216,31456,31505,31911,32057,32918,33750,33931,34121,34909,35059,35359,35388,35412,35443,35937,36062,37284,37478,37758,37912,38556,38808,19978,19976,19998,20055,20887,21104,22478,22580,22732,23330,24120,24773,25854,26465,26454,27972,29366,30067,31331,33976,35698,37304,37664,22065,22516,39166,25325,26893,27542,29165,32340,32887,33394,35302,39135,34645,36785,23611,20280,20449,20405,21767,23072,23517,23529,24515,24910,25391,26032,26187,26862,27035,28024,28145,30003,30137,30495,31070,31206,32051,33251,33455,34218,35242,35386,36523,36763,36914,37341,38663,20154,20161,20995,22645,22764,23563,29978,23613,33102,35338,36805,38499,38765,31525,35535,38920,37218,22259,21416,36887,21561,22402,24101,25512,27700,28810,30561,31883,32736,34928,36930,37204,37648,37656,38543,29790,39620,23815,23913,25968,26530,36264,38619,25454,26441,26905,33733,38935,38592,35070,28548,25722,23544,19990,28716,30045,26159,20932,21046,21218,22995,24449,24615,25104,25919,25972,26143,26228,26866,26646,27491,28165,29298,29983,30427,31934,32854,22768,35069,35199,35488,35475,35531,36893,37266,38738,38745,25993,31246,33030,38587,24109,24796,25114,26021,26132,26512,30707,31309,31821,32318,33034,36012,36196,36321,36447,30889,20999,25305,25509,25666,25240,35373,31363,31680,35500,38634,32118,33292,34633,20185,20808,21315,21344,23459,23554,23574,24029,25126,25159,25776,26643,26676,27849,27973,27927,26579,28508,29006,29053,26059,31359,31661,32218,32330,32680,33146,33307,33337,34214,35438,36046,36341,36984,36983,37549,37521,38275,39854,21069,21892,28472,28982,20840,31109,32341,33203,31950,22092,22609,23720,25514,26366,26365,26970,29401,30095,30094,30990,31062,31199,31895,32032,32068,34311,35380,38459,36961,40736,20711,21109,21452,21474,20489,21930,22766,22863,29245,23435,23652,21277,24803,24819,25436,25475,25407,25531,25805,26089,26361,24035,27085,27133,28437,29157,20105,30185,30456,31379,31967,32207,32156,32865,33609,33624,33900,33980,34299,35013,36208,36865,36973,37783,38684,39442,20687,22679,24974,33235,34101,36104,36896,20419,20596,21063,21363,24687,25417,26463,28204,36275,36895,20439,23646,36042,26063,32154,21330,34966,20854,25539,23384,23403,23562,25613,26449,36956,20182,22810,22826,27760,35409,21822,22549,22949,24816,25171,26561,33333,26965,38464,39364,39464,20307,22534,23550,32784,23729,24111,24453,24608,24907,25140,26367,27888,28382,32974,33151,33492,34955,36024,36864,36910,38538,40667,39899,20195,21488,22823,31532,37261,38988,40441,28381,28711,21331,21828,23429,25176,25246,25299,27810,28655,29730,35351,37944,28609,35582,33592,20967,34552,21482,21481,20294,36948,36784,22890,33073,24061,31466,36799,26842,35895,29432,40008,27197,35504,20025,21336,22022,22374,25285,25506,26086,27470,28129,28251,28845,30701,31471,31658,32187,32829,32966,34507,35477,37723,22243,22727,24382,26029,26262,27264,27573,30007,35527,20516,30693,22320,24347,24677,26234,27744,30196,31258,32622,33268,34584,36933,39347,31689,30044,31481,31569,33988,36880,31209,31378,33590,23265,30528,20013,20210,23449,24544,25277,26172,26609,27880,34411,34935,35387,37198,37619,39376,27159,28710,29482,33511,33879,36015,19969,20806,20939,21899,23541,24086,24115,24193,24340,24373,24427,24500,25074,25361,26274,26397,28526,29266,30010,30522,32884,33081,33144,34678,35519,35548,36229,36339,37530,38263,38914,40165,21189,25431,30452,26389,27784,29645,36035,37806,38515,27941,22684,26894,27084,36861,37786,30171,36890,22618,26626,25524,27131,20291,28460,26584,36795,34086,32180,37716,26943,28528,22378,22775,23340,32044,29226,21514,37347,40372,20141,20302,20572,20597,21059,35998,21576,22564,23450,24093,24213,24237,24311,24351,24716,25269,25402,25552,26799,27712,30855,31118,31243,32224,33351,35330,35558,36420,36883,37048,37165,37336,40718,27877,25688,25826,25973,28404,30340,31515,36969,37841,28346,21746,24505,25764,36685,36845,37444,20856,22635,22825,23637,24215,28155,32399,29980,36028,36578,39003,28857,20253,27583,28593,30000,38651,20814,21520,22581,22615,22956,23648,24466,26007,26460,28193,30331,33759,36077,36884,37117,37709,30757,30778,21162,24230,22303,22900,24594,20498,20826,20908,20941,20992,21776,22612,22616,22871,23445,23798,23947,24764,25237,25645,26481,26691,26812,26847,30423,28120,28271,28059,28783,29128,24403,30168,31095,31561,31572,31570,31958,32113,21040,33891,34153,34276,35342,35588,35910,36367,36867,36879,37913,38518,38957,39472,38360,20685,21205,21516,22530,23566,24999,25758,27934,30643,31461,33012,33796,36947,37509,23776,40199,21311,24471,24499,28060,29305,30563,31167,31716,27602,29420,35501,26627,27233,20984,31361,26932,23626,40182,33515,23493,37193,28702,22136,23663,24775,25958,27788,35930,36929,38931,21585,26311,37389,22856,37027,20869,20045,20970,34201,35598,28760,25466,37707,26978,39348,32260,30071,21335,26976,36575,38627,27741,20108,23612,24336,36841,21250,36049,32905,34425,24319,26085,20083,20837,22914,23615,38894,20219,22922,24525,35469,28641,31152,31074,23527,33905,29483,29105,24180,24565,25467,25754,29123,31896,20035,24316,20043,22492,22178,24745,28611,32013,33021,33075,33215,36786,35223,34468,24052,25226,25773,35207,26487,27874,27966,29750,30772,23110,32629,33453,39340,20467,24259,25309,25490,25943,26479,30403,29260,32972,32954,36649,37197,20493,22521,23186,26757,26995,29028,29437,36023,22770,36064,38506,36889,34687,31204,30695,33833,20271,21093,21338,25293,26575,27850,30333,31636,31893,33334,34180,36843,26333,28448,29190,32283,33707,39361,40614,20989,31665,30834,31672,32903,31560,27368,24161,32908,30033,30048,20843,37474,28300,30330,37271,39658,20240,32624,25244,31567,38309,40169,22138,22617,34532,38588,20276,21028,21322,21453,21467,24070,25644,26001,26495,27710,27726,29256,29359,29677,30036,32321,33324,34281,36009,31684,37318,29033,38930,39151,25405,26217,30058,30436,30928,34115,34542,21290,21329,21542,22915,24199,24444,24754,25161,25209,25259,26000,27604,27852,30130,30382,30865,31192,32203,32631,32933,34987,35513,36027,36991,38750,39131,27147,31800,20633,23614,24494,26503,27608,29749,30473,32654,40763,26570,31255,21305,30091,39661,24422,33181,33777,32920,24380,24517,30050,31558,36924,26727,23019,23195,32016,30334,35628,20469,24426,27161,27703,28418,29922,31080,34920,35413,35961,24287,25551,30149,31186,33495,37672,37618,33948,34541,39981,21697,24428,25996,27996,28693,36007,36051,38971,25935,29942,19981,20184,22496,22827,23142,23500,20904,24067,24220,24598,25206,25975,26023,26222,28014,29238,31526,33104,33178,33433,35676,36000,36070,36212,38428,38468,20398,25771,27494,33310,33889,34154,37096,23553,26963,39080,33914,34135,20239,21103,24489,24133,26381,31119,33145,35079,35206,28149,24343,25173,27832,20175,29289,39826,20998,21563,22132,22707,24996,25198,28954,22894,31881,31966,32027,38640,25991,32862,19993,20341,20853,22592,24163,24179,24330,26564,20006,34109,38281,38491,31859,38913,20731,22721,30294,30887,21029,30629,34065,31622,20559,22793,29255,31687,32232,36794,36820,36941,20415,21193,23081,24321,38829,20445,33303,37610,22275,25429,27497,29995,35036,36628,31298,21215,22675,24917,25098,26286,27597,31807,33769,20515,20472,21253,21574,22577,22857,23453,23792,23791,23849,24214,25265,25447,25918,26041,26379,27861,27873,28921,30770,32299,32990,33459,33804,34028,34562,35090,35370,35914,37030,37586,39165,40179,40300,20047,20129,20621,21078,22346,22952,24125,24536,24537,25151,26292,26395,26576,26834,20882,32033,32938,33192,35584,35980,36031,37502,38450,21536,38956,21271,20693,21340,22696,25778,26420,29287,30566,31302,37350,21187,27809,27526,22528,24140,22868,26412,32763,20961,30406,25705,30952,39764,40635,22475,22969,26151,26522,27598,21737,27097,24149,33180,26517,39850,26622,40018,26717,20134,20451,21448,25273,26411,27819,36804,20397,32365,40639,19975,24930,28288,28459,34067,21619,26410,39749,24051,31637,23724,23494,34588,28234,34001,31252,33032,22937,31885,27665,30496,21209,22818,28961,29279,30683,38695,40289,26891,23167,23064,20901,21517,21629,26126,30431,36855,37528,40180,23018,29277,28357,20813,26825,32191,32236,38754,40634,25720,27169,33538,22916,23391,27611,29467,30450,32178,32791,33945,20786,26408,40665,30446,26466,21247,39173,23588,25147,31870,36016,21839,24758,32011,38272,21249,20063,20918,22812,29242,32822,37326,24357,30690,21380,24441,32004,34220,35379,36493,38742,26611,34222,37971,24841,24840,27833,30290,35565,36664,21807,20305,20778,21191,21451,23461,24189,24736,24962,25558,26377,26586,28263,28044,29494,29495,30001,31056,35029,35480,36938,37009,37109,38596,34701,22805,20104,20313,19982,35465,36671,38928,20653,24188,22934,23481,24248,25562,25594,25793,26332,26954,27096,27915,28342,29076,29992,31407,32650,32768,33865,33993,35201,35617,36362,36965,38525,39178,24958,25233,27442,27779,28020,32716,32764,28096,32645,34746,35064,26469,33713,38972,38647,27931,32097,33853,37226,20081,21365,23888,27396,28651,34253,34349,35239,21033,21519,23653,26446,26792,29702,29827,30178,35023,35041,37324,38626,38520,24459,29575,31435,33870,25504,30053,21129,27969,28316,29705,30041,30827,31890,38534,31452,40845,20406,24942,26053,34396,20102,20142,20698,20001,20940,23534,26009,26753,28092,29471,30274,30637,31260,31975,33391,35538,36988,37327,38517,38936,21147,32209,20523,21400,26519,28107,29136,29747,33256,36650,38563,40023,40607,29792,22593,28057,32047,39006,20196,20278,20363,20919,21169,23994,24604,29618,31036,33491,37428,38583,38646,38666,40599,40802,26278,27508,21015,21155,28872,35010,24265,24651,24976,28451,29001,31806,32244,32879,34030,36899,37676,21570,39791,27347,28809,36034,36335,38706,21172,23105,24266,24324,26391,27004,27028,28010,28431,29282,29436,31725,32769,32894,34635,37070,20845,40595,31108,32907,37682,35542,20525,21644,35441,27498,36036,33031,24785,26528,40434,20121,20120,39952,35435,34241,34152,26880,28286,30871,33109,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,24332,19984,19989,20010,20017,20022,20028,20031,20034,20054,20056,20098,20101,35947,20106,33298,24333,20110,20126,20127,20128,20130,20144,20147,20150,20174,20173,20164,20166,20162,20183,20190,20205,20191,20215,20233,20314,20272,20315,20317,20311,20295,20342,20360,20367,20376,20347,20329,20336,20369,20335,20358,20374,20760,20436,20447,20430,20440,20443,20433,20442,20432,20452,20453,20506,20520,20500,20522,20517,20485,20252,20470,20513,20521,20524,20478,20463,20497,20486,20547,20551,26371,20565,20560,20552,20570,20566,20588,20600,20608,20634,20613,20660,20658,20681,20682,20659,20674,20694,20702,20709,20717,20707,20718,20729,20725,20745,20737,20738,20758,20757,20756,20762,20769,20794,20791,20796,20795,20799,20800,20818,20812,20820,20834,31480,20841,20842,20846,20864,20866,22232,20876,20873,20879,20881,20883,20885,20886,20900,20902,20898,20905,20906,20907,20915,20913,20914,20912,20917,20925,20933,20937,20955,20960,34389,20969,20973,20976,20981,20990,20996,21003,21012,21006,21031,21034,21038,21043,21049,21071,21060,21067,21068,21086,21076,21098,21108,21097,21107,21119,21117,21133,21140,21138,21105,21128,21137,36776,36775,21164,21165,21180,21173,21185,21197,21207,21214,21219,21222,39149,21216,21235,21237,21240,21241,21254,21256,30008,21261,21264,21263,21269,21274,21283,21295,21297,21299,21304,21312,21318,21317,19991,21321,21325,20950,21342,21353,21358,22808,21371,21367,21378,21398,21408,21414,21413,21422,21424,21430,21443,31762,38617,21471,26364,29166,21486,21480,21485,21498,21505,21565,21568,21548,21549,21564,21550,21558,21545,21533,21582,21647,21621,21646,21599,21617,21623,21616,21650,21627,21632,21622,21636,21648,21638,21703,21666,21688,21669,21676,21700,21704,21672,21675,21698,21668,21694,21692,21720,21733,21734,21775,21780,21757,21742,21741,21754,21730,21817,21824,21859,21836,21806,21852,21829,21846,21847,21816,21811,21853,21913,21888,21679,21898,21919,21883,21886,21912,21918,21934,21884,21891,21929,21895,21928,21978,21957,21983,21956,21980,21988,21972,22036,22007,22038,22014,22013,22043,22009,22094,22096,29151,22068,22070,22066,22072,22123,22116,22063,22124,22122,22150,22144,22154,22176,22164,22159,22181,22190,22198,22196,22210,22204,22209,22211,22208,22216,22222,22225,22227,22231,22254,22265,22272,22271,22276,22281,22280,22283,22285,22291,22296,22294,21959,22300,22310,22327,22328,22350,22331,22336,22351,22377,22464,22408,22369,22399,22409,22419,22432,22451,22436,22442,22448,22467,22470,22484,22482,22483,22538,22486,22499,22539,22553,22557,22642,22561,22626,22603,22640,27584,22610,22589,22649,22661,22713,22687,22699,22714,22750,22715,22712,22702,22725,22739,22737,22743,22745,22744,22757,22748,22756,22751,22767,22778,22777,22779,22780,22781,22786,22794,22800,22811,26790,22821,22828,22829,22834,22840,22846,31442,22869,22864,22862,22874,22872,22882,22880,22887,22892,22889,22904,22913,22941,20318,20395,22947,22962,22982,23016,23004,22925,23001,23002,23077,23071,23057,23068,23049,23066,23104,23148,23113,23093,23094,23138,23146,23194,23228,23230,23243,23234,23229,23267,23255,23270,23273,23254,23290,23291,23308,23307,23318,23346,23248,23338,23350,23358,23363,23365,23360,23377,23381,23386,23387,23397,23401,23408,23411,23413,23416,25992,23418,23424,23427,23462,23480,23491,23495,23497,23508,23504,23524,23526,23522,23518,23525,23531,23536,23542,23539,23557,23559,23560,23565,23571,23584,23586,23592,23608,23609,23617,23622,23630,23635,23632,23631,23409,23660,23662,20066,23670,23673,23692,23697,23700,22939,23723,23739,23734,23740,23735,23749,23742,23751,23769,23785,23805,23802,23789,23948,23786,23819,23829,23831,23900,23839,23835,23825,23828,23842,23834,23833,23832,23884,23890,23886,23883,23916,23923,23926,23943,23940,23938,23970,23965,23980,23982,23997,23952,23991,23996,24009,24013,24019,24018,24022,24027,24043,24050,24053,24075,24090,24089,24081,24091,24118,24119,24132,24131,24128,24142,24151,24148,24159,24162,24164,24135,24181,24182,24186,40636,24191,24224,24257,24258,24264,24272,24271,24278,24291,24285,24282,24283,24290,24289,24296,24297,24300,24305,24307,24304,24308,24312,24318,24323,24329,24413,24412,24331,24337,24342,24361,24365,24376,24385,24392,24396,24398,24367,24401,24406,24407,24409,24417,24429,24435,24439,24451,24450,24447,24458,24456,24465,24455,24478,24473,24472,24480,24488,24493,24508,24534,24571,24548,24568,24561,24541,24755,24575,24609,24672,24601,24592,24617,24590,24625,24603,24597,24619,24614,24591,24634,24666,24641,24682,24695,24671,24650,24646,24653,24675,24643,24676,24642,24684,24683,24665,24705,24717,24807,24707,24730,24708,24731,24726,24727,24722,24743,24715,24801,24760,24800,24787,24756,24560,24765,24774,24757,24792,24909,24853,24838,24822,24823,24832,24820,24826,24835,24865,24827,24817,24845,24846,24903,24894,24872,24871,24906,24895,24892,24876,24884,24893,24898,24900,24947,24951,24920,24921,24922,24939,24948,24943,24933,24945,24927,24925,24915,24949,24985,24982,24967,25004,24980,24986,24970,24977,25003,25006,25036,25034,25033,25079,25032,25027,25030,25018,25035,32633,25037,25062,25059,25078,25082,25076,25087,25085,25084,25086,25088,25096,25097,25101,25100,25108,25115,25118,25121,25130,25134,25136,25138,25139,25153,25166,25182,25187,25179,25184,25192,25212,25218,25225,25214,25234,25235,25238,25300,25219,25236,25303,25297,25275,25295,25343,25286,25812,25288,25308,25292,25290,25282,25287,25243,25289,25356,25326,25329,25383,25346,25352,25327,25333,25424,25406,25421,25628,25423,25494,25486,25472,25515,25462,25507,25487,25481,25503,25525,25451,25449,25534,25577,25536,25542,25571,25545,25554,25590,25540,25622,25652,25606,25619,25638,25654,25885,25623,25640,25615,25703,25711,25718,25678,25898,25749,25747,25765,25769,25736,25788,25818,25810,25797,25799,25787,25816,25794,25841,25831,33289,25824,25825,25260,25827,25839,25900,25846,25844,25842,25850,25856,25853,25880,25884,25861,25892,25891,25899,25908,25909,25911,25910,25912,30027,25928,25942,25941,25933,25944,25950,25949,25970,25976,25986,25987,35722,26011,26015,26027,26039,26051,26054,26049,26052,26060,26066,26075,26073,26080,26081,26097,26482,26122,26115,26107,26483,26165,26166,26164,26140,26191,26180,26185,26177,26206,26205,26212,26215,26216,26207,26210,26224,26243,26248,26254,26249,26244,26264,26269,26305,26297,26313,26302,26300,26308,26296,26326,26330,26336,26175,26342,26345,26352,26357,26359,26383,26390,26398,26406,26407,38712,26414,26431,26422,26433,26424,26423,26438,26462,26464,26457,26467,26468,26505,26480,26537,26492,26474,26508,26507,26534,26529,26501,26551,26607,26548,26604,26547,26601,26552,26596,26590,26589,26594,26606,26553,26574,26566,26599,27292,26654,26694,26665,26688,26701,26674,26702,26803,26667,26713,26723,26743,26751,26783,26767,26797,26772,26781,26779,26755,27310,26809,26740,26805,26784,26810,26895,26765,26750,26881,26826,26888,26840,26914,26918,26849,26892,26829,26836,26855,26837,26934,26898,26884,26839,26851,26917,26873,26848,26863,26920,26922,26906,26915,26913,26822,27001,26999,26972,27000,26987,26964,27006,26990,26937,26996,26941,26969,26928,26977,26974,26973,27009,26986,27058,27054,27088,27071,27073,27091,27070,27086,23528,27082,27101,27067,27075,27047,27182,27025,27040,27036,27029,27060,27102,27112,27138,27163,27135,27402,27129,27122,27111,27141,27057,27166,27117,27156,27115,27146,27154,27329,27171,27155,27204,27148,27250,27190,27256,27207,27234,27225,27238,27208,27192,27170,27280,27277,27296,27268,27298,27299,27287,34327,27323,27331,27330,27320,27315,27308,27358,27345,27359,27306,27354,27370,27387,27397,34326,27386,27410,27414,39729,27423,27448,27447,30428,27449,39150,27463,27459,27465,27472,27481,27476,27483,27487,27489,27512,27513,27519,27520,27524,27523,27533,27544,27541,27550,27556,27562,27563,27567,27570,27569,27571,27575,27580,27590,27595,27603,27615,27628,27627,27635,27631,40638,27656,27667,27668,27675,27684,27683,27742,27733,27746,27754,27778,27789,27802,27777,27803,27774,27752,27763,27794,27792,27844,27889,27859,27837,27863,27845,27869,27822,27825,27838,27834,27867,27887,27865,27882,27935,34893,27958,27947,27965,27960,27929,27957,27955,27922,27916,28003,28051,28004,27994,28025,27993,28046,28053,28644,28037,28153,28181,28170,28085,28103,28134,28088,28102,28140,28126,28108,28136,28114,28101,28154,28121,28132,28117,28138,28142,28205,28270,28206,28185,28274,28255,28222,28195,28267,28203,28278,28237,28191,28227,28218,28238,28196,28415,28189,28216,28290,28330,28312,28361,28343,28371,28349,28335,28356,28338,28372,28373,28303,28325,28354,28319,28481,28433,28748,28396,28408,28414,28479,28402,28465,28399,28466,28364,28478,28435,28407,28550,28538,28536,28545,28544,28527,28507,28659,28525,28546,28540,28504,28558,28561,28610,28518,28595,28579,28577,28580,28601,28614,28586,28639,28629,28652,28628,28632,28657,28654,28635,28681,28683,28666,28689,28673,28687,28670,28699,28698,28532,28701,28696,28703,28720,28734,28722,28753,28771,28825,28818,28847,28913,28844,28856,28851,28846,28895,28875,28893,28889,28937,28925,28956,28953,29029,29013,29064,29030,29026,29004,29014,29036,29071,29179,29060,29077,29096,29100,29143,29113,29118,29138,29129,29140,29134,29152,29164,29159,29173,29180,29177,29183,29197,29200,29211,29224,29229,29228,29232,29234,29243,29244,29247,29248,29254,29259,29272,29300,29310,29314,29313,29319,29330,29334,29346,29351,29369,29362,29379,29382,29380,29390,29394,29410,29408,29409,29433,29431,20495,29463,29450,29468,29462,29469,29492,29487,29481,29477,29502,29518,29519,40664,29527,29546,29544,29552,29560,29557,29563,29562,29640,29619,29646,29627,29632,29669,29678,29662,29858,29701,29807,29733,29688,29746,29754,29781,29759,29791,29785,29761,29788,29801,29808,29795,29802,29814,29822,29835,29854,29863,29898,29903,29908,29681,29920,29923,29927,29929,29934,29938,29936,29937,29944,29943,29956,29955,29957,29964,29966,29965,29973,29971,29982,29990,29996,30012,30020,30029,30026,30025,30043,30022,30042,30057,30052,30055,30059,30061,30072,30070,30086,30087,30068,30090,30089,30082,30100,30106,30109,30117,30115,30146,30131,30147,30133,30141,30136,30140,30129,30157,30154,30162,30169,30179,30174,30206,30207,30204,30209,30192,30202,30194,30195,30219,30221,30217,30239,30247,30240,30241,30242,30244,30260,30256,30267,30279,30280,30278,30300,30296,30305,30306,30312,30313,30314,30311,30316,30320,30322,30326,30328,30332,30336,30339,30344,30347,30350,30358,30355,30361,30362,30384,30388,30392,30393,30394,30402,30413,30422,30418,30430,30433,30437,30439,30442,34351,30459,30472,30471,30468,30505,30500,30494,30501,30502,30491,30519,30520,30535,30554,30568,30571,30555,30565,30591,30590,30585,30606,30603,30609,30624,30622,30640,30646,30649,30655,30652,30653,30651,30663,30669,30679,30682,30684,30691,30702,30716,30732,30738,31014,30752,31018,30789,30862,30836,30854,30844,30874,30860,30883,30901,30890,30895,30929,30918,30923,30932,30910,30908,30917,30922,30956,30951,30938,30973,30964,30983,30994,30993,31001,31020,31019,31040,31072,31063,31071,31066,31061,31059,31098,31103,31114,31133,31143,40779,31146,31150,31155,31161,31162,31177,31189,31207,31212,31201,31203,31240,31245,31256,31257,31264,31263,31104,31281,31291,31294,31287,31299,31319,31305,31329,31330,31337,40861,31344,31353,31357,31368,31383,31381,31384,31382,31401,31432,31408,31414,31429,31428,31423,36995,31431,31434,31437,31439,31445,31443,31449,31450,31453,31457,31458,31462,31469,31472,31490,31503,31498,31494,31539,31512,31513,31518,31541,31528,31542,31568,31610,31492,31565,31499,31564,31557,31605,31589,31604,31591,31600,31601,31596,31598,31645,31640,31647,31629,31644,31642,31627,31634,31631,31581,31641,31691,31681,31692,31695,31668,31686,31709,31721,31761,31764,31718,31717,31840,31744,31751,31763,31731,31735,31767,31757,31734,31779,31783,31786,31775,31799,31787,31805,31820,31811,31828,31823,31808,31824,31832,31839,31844,31830,31845,31852,31861,31875,31888,31908,31917,31906,31915,31905,31912,31923,31922,31921,31918,31929,31933,31936,31941,31938,31960,31954,31964,31970,39739,31983,31986,31988,31990,31994,32006,32002,32028,32021,32010,32069,32075,32046,32050,32063,32053,32070,32115,32086,32078,32114,32104,32110,32079,32099,32147,32137,32091,32143,32125,32155,32186,32174,32163,32181,32199,32189,32171,32317,32162,32175,32220,32184,32159,32176,32216,32221,32228,32222,32251,32242,32225,32261,32266,32291,32289,32274,32305,32287,32265,32267,32290,32326,32358,32315,32309,32313,32323,32311,32306,32314,32359,32349,32342,32350,32345,32346,32377,32362,32361,32380,32379,32387,32213,32381,36782,32383,32392,32393,32396,32402,32400,32403,32404,32406,32398,32411,32412,32568,32570,32581,32588,32589,32590,32592,32593,32597,32596,32600,32607,32608,32616,32617,32615,32632,32642,32646,32643,32648,32647,32652,32660,32670,32669,32666,32675,32687,32690,32697,32686,32694,32696,35697,32709,32710,32714,32725,32724,32737,32742,32745,32755,32761,39132,32774,32772,32779,32786,32792,32793,32796,32801,32808,32831,32827,32842,32838,32850,32856,32858,32863,32866,32872,32883,32882,32880,32886,32889,32893,32895,32900,32902,32901,32923,32915,32922,32941,20880,32940,32987,32997,32985,32989,32964,32986,32982,33033,33007,33009,33051,33065,33059,33071,33099,38539,33094,33086,33107,33105,33020,33137,33134,33125,33126,33140,33155,33160,33162,33152,33154,33184,33173,33188,33187,33119,33171,33193,33200,33205,33214,33208,33213,33216,33218,33210,33225,33229,33233,33241,33240,33224,33242,33247,33248,33255,33274,33275,33278,33281,33282,33285,33287,33290,33293,33296,33302,33321,33323,33336,33331,33344,33369,33368,33373,33370,33375,33380,33378,33384,33386,33387,33326,33393,33399,33400,33406,33421,33426,33451,33439,33467,33452,33505,33507,33503,33490,33524,33523,33530,33683,33539,33531,33529,33502,33542,33500,33545,33497,33589,33588,33558,33586,33585,33600,33593,33616,33605,33583,33579,33559,33560,33669,33690,33706,33695,33698,33686,33571,33678,33671,33674,33660,33717,33651,33653,33696,33673,33704,33780,33811,33771,33742,33789,33795,33752,33803,33729,33783,33799,33760,33778,33805,33826,33824,33725,33848,34054,33787,33901,33834,33852,34138,33924,33911,33899,33965,33902,33922,33897,33862,33836,33903,33913,33845,33994,33890,33977,33983,33951,34009,33997,33979,34010,34000,33985,33990,34006,33953,34081,34047,34036,34071,34072,34092,34079,34069,34068,34044,34112,34147,34136,34120,34113,34306,34123,34133,34176,34212,34184,34193,34186,34216,34157,34196,34203,34282,34183,34204,34167,34174,34192,34249,34234,34255,34233,34256,34261,34269,34277,34268,34297,34314,34323,34315,34302,34298,34310,34338,34330,34352,34367,34381,20053,34388,34399,34407,34417,34451,34467,34473,34474,34443,34444,34486,34479,34500,34502,34480,34505,34851,34475,34516,34526,34537,34540,34527,34523,34543,34578,34566,34568,34560,34563,34555,34577,34569,34573,34553,34570,34612,34623,34615,34619,34597,34601,34586,34656,34655,34680,34636,34638,34676,34647,34664,34670,34649,34643,34659,34666,34821,34722,34719,34690,34735,34763,34749,34752,34768,38614,34731,34756,34739,34759,34758,34747,34799,34802,34784,34831,34829,34814,34806,34807,34830,34770,34833,34838,34837,34850,34849,34865,34870,34873,34855,34875,34884,34882,34898,34905,34910,34914,34923,34945,34942,34974,34933,34941,34997,34930,34946,34967,34962,34990,34969,34978,34957,34980,34992,35007,34993,35011,35012,35028,35032,35033,35037,35065,35074,35068,35060,35048,35058,35076,35084,35082,35091,35139,35102,35109,35114,35115,35137,35140,35131,35126,35128,35148,35101,35168,35166,35174,35172,35181,35178,35183,35188,35191,35198,35203,35208,35210,35219,35224,35233,35241,35238,35244,35247,35250,35258,35261,35263,35264,35290,35292,35293,35303,35316,35320,35331,35350,35344,35340,35355,35357,35365,35382,35393,35419,35410,35398,35400,35452,35437,35436,35426,35461,35458,35460,35496,35489,35473,35493,35494,35482,35491,35524,35533,35522,35546,35563,35571,35559,35556,35569,35604,35552,35554,35575,35550,35547,35596,35591,35610,35553,35606,35600,35607,35616,35635,38827,35622,35627,35646,35624,35649,35660,35663,35662,35657,35670,35675,35674,35691,35679,35692,35695,35700,35709,35712,35724,35726,35730,35731,35734,35737,35738,35898,35905,35903,35912,35916,35918,35920,35925,35938,35948,35960,35962,35970,35977,35973,35978,35981,35982,35988,35964,35992,25117,36013,36010,36029,36018,36019,36014,36022,36040,36033,36068,36067,36058,36093,36090,36091,36100,36101,36106,36103,36111,36109,36112,40782,36115,36045,36116,36118,36199,36205,36209,36211,36225,36249,36290,36286,36282,36303,36314,36310,36300,36315,36299,36330,36331,36319,36323,36348,36360,36361,36351,36381,36382,36368,36383,36418,36405,36400,36404,36426,36423,36425,36428,36432,36424,36441,36452,36448,36394,36451,36437,36470,36466,36476,36481,36487,36485,36484,36491,36490,36499,36497,36500,36505,36522,36513,36524,36528,36550,36529,36542,36549,36552,36555,36571,36579,36604,36603,36587,36606,36618,36613,36629,36626,36633,36627,36636,36639,36635,36620,36646,36659,36667,36665,36677,36674,36670,36684,36681,36678,36686,36695,36700,36706,36707,36708,36764,36767,36771,36781,36783,36791,36826,36837,36834,36842,36847,36999,36852,36869,36857,36858,36881,36885,36897,36877,36894,36886,36875,36903,36918,36917,36921,36856,36943,36944,36945,36946,36878,36937,36926,36950,36952,36958,36968,36975,36982,38568,36978,36994,36989,36993,36992,37002,37001,37007,37032,37039,37041,37045,37090,37092,25160,37083,37122,37138,37145,37170,37168,37194,37206,37208,37219,37221,37225,37235,37234,37259,37257,37250,37282,37291,37295,37290,37301,37300,37306,37312,37313,37321,37323,37328,37334,37343,37345,37339,37372,37365,37366,37406,37375,37396,37420,37397,37393,37470,37463,37445,37449,37476,37448,37525,37439,37451,37456,37532,37526,37523,37531,37466,37583,37561,37559,37609,37647,37626,37700,37678,37657,37666,37658,37667,37690,37685,37691,37724,37728,37756,37742,37718,37808,37804,37805,37780,37817,37846,37847,37864,37861,37848,37827,37853,37840,37832,37860,37914,37908,37907,37891,37895,37904,37942,37931,37941,37921,37946,37953,37970,37956,37979,37984,37986,37982,37994,37417,38000,38005,38007,38013,37978,38012,38014,38017,38015,38274,38279,38282,38292,38294,38296,38297,38304,38312,38311,38317,38332,38331,38329,38334,38346,28662,38339,38349,38348,38357,38356,38358,38364,38369,38373,38370,38433,38440,38446,38447,38466,38476,38479,38475,38519,38492,38494,38493,38495,38502,38514,38508,38541,38552,38549,38551,38570,38567,38577,38578,38576,38580,38582,38584,38585,38606,38603,38601,38605,35149,38620,38669,38613,38649,38660,38662,38664,38675,38670,38673,38671,38678,38681,38692,38698,38704,38713,38717,38718,38724,38726,38728,38722,38729,38748,38752,38756,38758,38760,21202,38763,38769,38777,38789,38780,38785,38778,38790,38795,38799,38800,38812,38824,38822,38819,38835,38836,38851,38854,38856,38859,38876,38893,40783,38898,31455,38902,38901,38927,38924,38968,38948,38945,38967,38973,38982,38991,38987,39019,39023,39024,39025,39028,39027,39082,39087,39089,39094,39108,39107,39110,39145,39147,39171,39177,39186,39188,39192,39201,39197,39198,39204,39200,39212,39214,39229,39230,39234,39241,39237,39248,39243,39249,39250,39244,39253,39319,39320,39333,39341,39342,39356,39391,39387,39389,39384,39377,39405,39406,39409,39410,39419,39416,39425,39439,39429,39394,39449,39467,39479,39493,39490,39488,39491,39486,39509,39501,39515,39511,39519,39522,39525,39524,39529,39531,39530,39597,39600,39612,39616,39631,39633,39635,39636,39646,39647,39650,39651,39654,39663,39659,39662,39668,39665,39671,39675,39686,39704,39706,39711,39714,39715,39717,39719,39720,39721,39722,39726,39727,39730,39748,39747,39759,39757,39758,39761,39768,39796,39827,39811,39825,39830,39831,39839,39840,39848,39860,39872,39882,39865,39878,39887,39889,39890,39907,39906,39908,39892,39905,39994,39922,39921,39920,39957,39956,39945,39955,39948,39942,39944,39954,39946,39940,39982,39963,39973,39972,39969,39984,40007,39986,40006,39998,40026,40032,40039,40054,40056,40167,40172,40176,40201,40200,40171,40195,40198,40234,40230,40367,40227,40223,40260,40213,40210,40257,40255,40254,40262,40264,40285,40286,40292,40273,40272,40281,40306,40329,40327,40363,40303,40314,40346,40356,40361,40370,40388,40385,40379,40376,40378,40390,40399,40386,40409,40403,40440,40422,40429,40431,40445,40474,40475,40478,40565,40569,40573,40577,40584,40587,40588,40594,40597,40593,40605,40613,40617,40632,40618,40621,38753,40652,40654,40655,40656,40660,40668,40670,40669,40672,40677,40680,40687,40692,40694,40695,40697,40699,40700,40701,40711,40712,30391,40725,40737,40748,40766,40778,40786,40788,40803,40799,40800,40801,40806,40807,40812,40810,40823,40818,40822,40853,40860,40864,22575,27079,36953,29796,20956,29081,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32394,35100,37704,37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,20220,20224,20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,20510,20550,20592,20546,20628,20724,20696,20810,20836,20893,20926,20972,21013,21148,21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,21642,21673,21759,21894,22361,22373,22444,22472,22471,64015,64016,22686,22706,22795,22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,23582,23718,23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,24372,24423,24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,24880,24984,25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,26158,26142,26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,26382,63785,26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,27106,27184,27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,27866,27908,28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,28220,28351,28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,28998,28999,64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,29667,29650,29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,30338,30364,30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,64024,64025,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,32092,32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,33864,33972,34131,34137,34155,64031,34224,64032,64033,34823,35061,35346,35383,35449,35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,64035,36559,64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,37358,37348,37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,37479,37543,37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,37665,37627,64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,37937,37957,37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,38737,38741,38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,39794,39823,39857,39867,39936,40304,40299,64045,40473,40657,null,null,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,65506,65508,65287,65282,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,65506,65508,65287,65282,12849,8470,8481,8757,32394,35100,37704,37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,20220,20224,20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,20510,20550,20592,20546,20628,20724,20696,20810,20836,20893,20926,20972,21013,21148,21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,21642,21673,21759,21894,22361,22373,22444,22472,22471,64015,64016,22686,22706,22795,22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,23582,23718,23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,24372,24423,24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,24880,24984,25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,26158,26142,26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,26382,63785,26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,27106,27184,27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,27866,27908,28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,28220,28351,28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,28998,28999,64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,29667,29650,29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,30338,30364,30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,64024,64025,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,32092,32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,33864,33972,34131,34137,34155,64031,34224,64032,64033,34823,35061,35346,35383,35449,35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,64035,36559,64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,37358,37348,37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,37479,37543,37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,37665,37627,64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,37937,37957,37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,38737,38741,38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,39794,39823,39857,39867,39936,40304,40299,64045,40473,40657,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], "jis0212":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,728,711,184,729,733,175,731,730,65374,900,901,null,null,null,null,null,null,null,null,161,166,191,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,186,170,169,174,8482,164,8470,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,902,904,905,906,938,null,908,null,910,939,null,911,null,null,null,null,940,941,942,943,970,912,972,962,973,971,944,974,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1038,1039,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1118,1119,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,198,272,null,294,null,306,null,321,319,null,330,216,338,null,358,222,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,230,273,240,295,305,307,312,322,320,329,331,248,339,223,359,254,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,193,192,196,194,258,461,256,260,197,195,262,264,268,199,266,270,201,200,203,202,282,278,274,280,null,284,286,290,288,292,205,204,207,206,463,304,298,302,296,308,310,313,317,315,323,327,325,209,211,210,214,212,465,336,332,213,340,344,342,346,348,352,350,356,354,218,217,220,219,364,467,368,362,370,366,360,471,475,473,469,372,221,376,374,377,381,379,null,null,null,null,null,null,null,225,224,228,226,259,462,257,261,229,227,263,265,269,231,267,271,233,232,235,234,283,279,275,281,501,285,287,null,289,293,237,236,239,238,464,null,299,303,297,309,311,314,318,316,324,328,326,241,243,242,246,244,466,337,333,245,341,345,343,347,349,353,351,357,355,250,249,252,251,365,468,369,363,371,367,361,472,476,474,470,373,253,255,375,378,382,380,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,19970,19972,19973,19980,19986,19999,20003,20004,20008,20011,20014,20015,20016,20021,20032,20033,20036,20039,20049,20058,20060,20067,20072,20073,20084,20085,20089,20095,20109,20118,20119,20125,20143,20153,20163,20176,20186,20187,20192,20193,20194,20200,20207,20209,20211,20213,20221,20222,20223,20224,20226,20227,20232,20235,20236,20242,20245,20246,20247,20249,20270,20273,20320,20275,20277,20279,20281,20283,20286,20288,20290,20296,20297,20299,20300,20306,20308,20310,20312,20319,20323,20330,20332,20334,20337,20343,20344,20345,20346,20349,20350,20353,20354,20356,20357,20361,20362,20364,20366,20368,20370,20371,20372,20375,20377,20378,20382,20383,20402,20407,20409,20411,20412,20413,20414,20416,20417,20421,20422,20424,20425,20427,20428,20429,20431,20434,20444,20448,20450,20464,20466,20476,20477,20479,20480,20481,20484,20487,20490,20492,20494,20496,20499,20503,20504,20507,20508,20509,20510,20514,20519,20526,20528,20530,20531,20533,20544,20545,20546,20549,20550,20554,20556,20558,20561,20562,20563,20567,20569,20575,20576,20578,20579,20582,20583,20586,20589,20592,20593,20539,20609,20611,20612,20614,20618,20622,20623,20624,20626,20627,20628,20630,20635,20636,20638,20639,20640,20641,20642,20650,20655,20656,20665,20666,20669,20672,20675,20676,20679,20684,20686,20688,20691,20692,20696,20700,20701,20703,20706,20708,20710,20712,20713,20719,20721,20726,20730,20734,20739,20742,20743,20744,20747,20748,20749,20750,20722,20752,20759,20761,20763,20764,20765,20766,20771,20775,20776,20780,20781,20783,20785,20787,20788,20789,20792,20793,20802,20810,20815,20819,20821,20823,20824,20831,20836,20838,20862,20867,20868,20875,20878,20888,20893,20897,20899,20909,20920,20922,20924,20926,20927,20930,20936,20943,20945,20946,20947,20949,20952,20958,20962,20965,20974,20978,20979,20980,20983,20993,20994,20997,21010,21011,21013,21014,21016,21026,21032,21041,21042,21045,21052,21061,21065,21077,21079,21080,21082,21084,21087,21088,21089,21094,21102,21111,21112,21113,21120,21122,21125,21130,21132,21139,21141,21142,21143,21144,21146,21148,21156,21157,21158,21159,21167,21168,21174,21175,21176,21178,21179,21181,21184,21188,21190,21192,21196,21199,21201,21204,21206,21211,21212,21217,21221,21224,21225,21226,21228,21232,21233,21236,21238,21239,21248,21251,21258,21259,21260,21265,21267,21272,21275,21276,21278,21279,21285,21287,21288,21289,21291,21292,21293,21296,21298,21301,21308,21309,21310,21314,21324,21323,21337,21339,21345,21347,21349,21356,21357,21362,21369,21374,21379,21383,21384,21390,21395,21396,21401,21405,21409,21412,21418,21419,21423,21426,21428,21429,21431,21432,21434,21437,21440,21445,21455,21458,21459,21461,21466,21469,21470,21472,21478,21479,21493,21506,21523,21530,21537,21543,21544,21546,21551,21553,21556,21557,21571,21572,21575,21581,21583,21598,21602,21604,21606,21607,21609,21611,21613,21614,21620,21631,21633,21635,21637,21640,21641,21645,21649,21653,21654,21660,21663,21665,21670,21671,21673,21674,21677,21678,21681,21687,21689,21690,21691,21695,21702,21706,21709,21710,21728,21738,21740,21743,21750,21756,21758,21759,21760,21761,21765,21768,21769,21772,21773,21774,21781,21802,21803,21810,21813,21814,21819,21820,21821,21825,21831,21833,21834,21837,21840,21841,21848,21850,21851,21854,21856,21857,21860,21862,21887,21889,21890,21894,21896,21902,21903,21905,21906,21907,21908,21911,21923,21924,21933,21938,21951,21953,21955,21958,21961,21963,21964,21966,21969,21970,21971,21975,21976,21979,21982,21986,21993,22006,22015,22021,22024,22026,22029,22030,22031,22032,22033,22034,22041,22060,22064,22067,22069,22071,22073,22075,22076,22077,22079,22080,22081,22083,22084,22086,22089,22091,22093,22095,22100,22110,22112,22113,22114,22115,22118,22121,22125,22127,22129,22130,22133,22148,22149,22152,22155,22156,22165,22169,22170,22173,22174,22175,22182,22183,22184,22185,22187,22188,22189,22193,22195,22199,22206,22213,22217,22218,22219,22223,22224,22220,22221,22233,22236,22237,22239,22241,22244,22245,22246,22247,22248,22257,22251,22253,22262,22263,22273,22274,22279,22282,22284,22289,22293,22298,22299,22301,22304,22306,22307,22308,22309,22313,22314,22316,22318,22319,22323,22324,22333,22334,22335,22341,22342,22348,22349,22354,22370,22373,22375,22376,22379,22381,22382,22383,22384,22385,22387,22388,22389,22391,22393,22394,22395,22396,22398,22401,22403,22412,22420,22423,22425,22426,22428,22429,22430,22431,22433,22421,22439,22440,22441,22444,22456,22461,22471,22472,22476,22479,22485,22493,22494,22500,22502,22503,22505,22509,22512,22517,22518,22520,22525,22526,22527,22531,22532,22536,22537,22497,22540,22541,22555,22558,22559,22560,22566,22567,22573,22578,22585,22591,22601,22604,22605,22607,22608,22613,22623,22625,22628,22631,22632,22648,22652,22655,22656,22657,22663,22664,22665,22666,22668,22669,22671,22672,22676,22678,22685,22688,22689,22690,22694,22697,22705,22706,22724,22716,22722,22728,22733,22734,22736,22738,22740,22742,22746,22749,22753,22754,22761,22771,22789,22790,22795,22796,22802,22803,22804,34369,22813,22817,22819,22820,22824,22831,22832,22835,22837,22838,22847,22851,22854,22866,22867,22873,22875,22877,22878,22879,22881,22883,22891,22893,22895,22898,22901,22902,22905,22907,22908,22923,22924,22926,22930,22933,22935,22943,22948,22951,22957,22958,22959,22960,22963,22967,22970,22972,22977,22979,22980,22984,22986,22989,22994,23005,23006,23007,23011,23012,23015,23022,23023,23025,23026,23028,23031,23040,23044,23052,23053,23054,23058,23059,23070,23075,23076,23079,23080,23082,23085,23088,23108,23109,23111,23112,23116,23120,23125,23134,23139,23141,23143,23149,23159,23162,23163,23166,23179,23184,23187,23190,23193,23196,23198,23199,23200,23202,23207,23212,23217,23218,23219,23221,23224,23226,23227,23231,23236,23238,23240,23247,23258,23260,23264,23269,23274,23278,23285,23286,23293,23296,23297,23304,23319,23348,23321,23323,23325,23329,23333,23341,23352,23361,23371,23372,23378,23382,23390,23400,23406,23407,23420,23421,23422,23423,23425,23428,23430,23434,23438,23440,23441,23443,23444,23446,23464,23465,23468,23469,23471,23473,23474,23479,23482,23484,23488,23489,23501,23503,23510,23511,23512,23513,23514,23520,23535,23537,23540,23549,23564,23575,23582,23583,23587,23590,23593,23595,23596,23598,23600,23602,23605,23606,23641,23642,23644,23650,23651,23655,23656,23657,23661,23664,23668,23669,23674,23675,23676,23677,23687,23688,23690,23695,23698,23709,23711,23712,23714,23715,23718,23722,23730,23732,23733,23738,23753,23755,23762,23773,23767,23790,23793,23794,23796,23809,23814,23821,23826,23851,23843,23844,23846,23847,23857,23860,23865,23869,23871,23874,23875,23878,23880,23893,23889,23897,23882,23903,23904,23905,23906,23908,23914,23917,23920,23929,23930,23934,23935,23937,23939,23944,23946,23954,23955,23956,23957,23961,23963,23967,23968,23975,23979,23984,23988,23992,23993,24003,24007,24011,24016,24014,24024,24025,24032,24036,24041,24056,24057,24064,24071,24077,24082,24084,24085,24088,24095,24096,24110,24104,24114,24117,24126,24139,24144,24137,24145,24150,24152,24155,24156,24158,24168,24170,24171,24172,24173,24174,24176,24192,24203,24206,24226,24228,24229,24232,24234,24236,24241,24243,24253,24254,24255,24262,24268,24267,24270,24273,24274,24276,24277,24284,24286,24293,24299,24322,24326,24327,24328,24334,24345,24348,24349,24353,24354,24355,24356,24360,24363,24364,24366,24368,24372,24374,24379,24381,24383,24384,24388,24389,24391,24397,24400,24404,24408,24411,24416,24419,24420,24423,24431,24434,24436,24437,24440,24442,24445,24446,24457,24461,24463,24470,24476,24477,24482,24487,24491,24484,24492,24495,24496,24497,24504,24516,24519,24520,24521,24523,24528,24529,24530,24531,24532,24542,24545,24546,24552,24553,24554,24556,24557,24558,24559,24562,24563,24566,24570,24572,24583,24586,24589,24595,24596,24599,24600,24602,24607,24612,24621,24627,24629,24640,24647,24648,24649,24652,24657,24660,24662,24663,24669,24673,24679,24689,24702,24703,24706,24710,24712,24714,24718,24721,24723,24725,24728,24733,24734,24738,24740,24741,24744,24752,24753,24759,24763,24766,24770,24772,24776,24777,24778,24779,24782,24783,24788,24789,24793,24795,24797,24798,24802,24805,24818,24821,24824,24828,24829,24834,24839,24842,24844,24848,24849,24850,24851,24852,24854,24855,24857,24860,24862,24866,24874,24875,24880,24881,24885,24886,24887,24889,24897,24901,24902,24905,24926,24928,24940,24946,24952,24955,24956,24959,24960,24961,24963,24964,24971,24973,24978,24979,24983,24984,24988,24989,24991,24992,24997,25000,25002,25005,25016,25017,25020,25024,25025,25026,25038,25039,25045,25052,25053,25054,25055,25057,25058,25063,25065,25061,25068,25069,25071,25089,25091,25092,25095,25107,25109,25116,25120,25122,25123,25127,25129,25131,25145,25149,25154,25155,25156,25158,25164,25168,25169,25170,25172,25174,25178,25180,25188,25197,25199,25203,25210,25213,25229,25230,25231,25232,25254,25256,25267,25270,25271,25274,25278,25279,25284,25294,25301,25302,25306,25322,25330,25332,25340,25341,25347,25348,25354,25355,25357,25360,25363,25366,25368,25385,25386,25389,25397,25398,25401,25404,25409,25410,25411,25412,25414,25418,25419,25422,25426,25427,25428,25432,25435,25445,25446,25452,25453,25457,25460,25461,25464,25468,25469,25471,25474,25476,25479,25482,25488,25492,25493,25497,25498,25502,25508,25510,25517,25518,25519,25533,25537,25541,25544,25550,25553,25555,25556,25557,25564,25568,25573,25578,25580,25586,25587,25589,25592,25593,25609,25610,25616,25618,25620,25624,25630,25632,25634,25636,25637,25641,25642,25647,25648,25653,25661,25663,25675,25679,25681,25682,25683,25684,25690,25691,25692,25693,25695,25696,25697,25699,25709,25715,25716,25723,25725,25733,25735,25743,25744,25745,25752,25753,25755,25757,25759,25761,25763,25766,25768,25772,25779,25789,25790,25791,25796,25801,25802,25803,25804,25806,25808,25809,25813,25815,25828,25829,25833,25834,25837,25840,25845,25847,25851,25855,25857,25860,25864,25865,25866,25871,25875,25876,25878,25881,25883,25886,25887,25890,25894,25897,25902,25905,25914,25916,25917,25923,25927,25929,25936,25938,25940,25951,25952,25959,25963,25978,25981,25985,25989,25994,26002,26005,26008,26013,26016,26019,26022,26030,26034,26035,26036,26047,26050,26056,26057,26062,26064,26068,26070,26072,26079,26096,26098,26100,26101,26105,26110,26111,26112,26116,26120,26121,26125,26129,26130,26133,26134,26141,26142,26145,26146,26147,26148,26150,26153,26154,26155,26156,26158,26160,26161,26163,26169,26167,26176,26181,26182,26186,26188,26193,26190,26199,26200,26201,26203,26204,26208,26209,26363,26218,26219,26220,26238,26227,26229,26239,26231,26232,26233,26235,26240,26236,26251,26252,26253,26256,26258,26265,26266,26267,26268,26271,26272,26276,26285,26289,26290,26293,26299,26303,26304,26306,26307,26312,26316,26318,26319,26324,26331,26335,26344,26347,26348,26350,26362,26373,26375,26382,26387,26393,26396,26400,26402,26419,26430,26437,26439,26440,26444,26452,26453,26461,26470,26476,26478,26484,26486,26491,26497,26500,26510,26511,26513,26515,26518,26520,26521,26523,26544,26545,26546,26549,26555,26556,26557,26617,26560,26562,26563,26565,26568,26569,26578,26583,26585,26588,26593,26598,26608,26610,26614,26615,26706,26644,26649,26653,26655,26664,26663,26668,26669,26671,26672,26673,26675,26683,26687,26692,26693,26698,26700,26709,26711,26712,26715,26731,26734,26735,26736,26737,26738,26741,26745,26746,26747,26748,26754,26756,26758,26760,26774,26776,26778,26780,26785,26787,26789,26793,26794,26798,26802,26811,26821,26824,26828,26831,26832,26833,26835,26838,26841,26844,26845,26853,26856,26858,26859,26860,26861,26864,26865,26869,26870,26875,26876,26877,26886,26889,26890,26896,26897,26899,26902,26903,26929,26931,26933,26936,26939,26946,26949,26953,26958,26967,26971,26979,26980,26981,26982,26984,26985,26988,26992,26993,26994,27002,27003,27007,27008,27021,27026,27030,27032,27041,27045,27046,27048,27051,27053,27055,27063,27064,27066,27068,27077,27080,27089,27094,27095,27106,27109,27118,27119,27121,27123,27125,27134,27136,27137,27139,27151,27153,27157,27162,27165,27168,27172,27176,27184,27186,27188,27191,27195,27198,27199,27205,27206,27209,27210,27214,27216,27217,27218,27221,27222,27227,27236,27239,27242,27249,27251,27262,27265,27267,27270,27271,27273,27275,27281,27291,27293,27294,27295,27301,27307,27311,27312,27313,27316,27325,27326,27327,27334,27337,27336,27340,27344,27348,27349,27350,27356,27357,27364,27367,27372,27376,27377,27378,27388,27389,27394,27395,27398,27399,27401,27407,27408,27409,27415,27419,27422,27428,27432,27435,27436,27439,27445,27446,27451,27455,27462,27466,27469,27474,27478,27480,27485,27488,27495,27499,27502,27504,27509,27517,27518,27522,27525,27543,27547,27551,27552,27554,27555,27560,27561,27564,27565,27566,27568,27576,27577,27581,27582,27587,27588,27593,27596,27606,27610,27617,27619,27622,27623,27630,27633,27639,27641,27647,27650,27652,27653,27657,27661,27662,27664,27666,27673,27679,27686,27687,27688,27692,27694,27699,27701,27702,27706,27707,27711,27722,27723,27725,27727,27730,27732,27737,27739,27740,27755,27757,27759,27764,27766,27768,27769,27771,27781,27782,27783,27785,27796,27797,27799,27800,27804,27807,27824,27826,27828,27842,27846,27853,27855,27856,27857,27858,27860,27862,27866,27868,27872,27879,27881,27883,27884,27886,27890,27892,27908,27911,27914,27918,27919,27921,27923,27930,27942,27943,27944,27751,27950,27951,27953,27961,27964,27967,27991,27998,27999,28001,28005,28007,28015,28016,28028,28034,28039,28049,28050,28052,28054,28055,28056,28074,28076,28084,28087,28089,28093,28095,28100,28104,28106,28110,28111,28118,28123,28125,28127,28128,28130,28133,28137,28143,28144,28148,28150,28156,28160,28164,28190,28194,28199,28210,28214,28217,28219,28220,28228,28229,28232,28233,28235,28239,28241,28242,28243,28244,28247,28252,28253,28254,28258,28259,28264,28275,28283,28285,28301,28307,28313,28320,28327,28333,28334,28337,28339,28347,28351,28352,28353,28355,28359,28360,28362,28365,28366,28367,28395,28397,28398,28409,28411,28413,28420,28424,28426,28428,28429,28438,28440,28442,28443,28454,28457,28458,28463,28464,28467,28470,28475,28476,28461,28495,28497,28498,28499,28503,28505,28506,28509,28510,28513,28514,28520,28524,28541,28542,28547,28551,28552,28555,28556,28557,28560,28562,28563,28564,28566,28570,28575,28576,28581,28582,28583,28584,28590,28591,28592,28597,28598,28604,28613,28615,28616,28618,28634,28638,28648,28649,28656,28661,28665,28668,28669,28672,28677,28678,28679,28685,28695,28704,28707,28719,28724,28727,28729,28732,28739,28740,28744,28745,28746,28747,28756,28757,28765,28766,28750,28772,28773,28780,28782,28789,28790,28798,28801,28805,28806,28820,28821,28822,28823,28824,28827,28836,28843,28848,28849,28852,28855,28874,28881,28883,28884,28885,28886,28888,28892,28900,28922,28931,28932,28933,28934,28935,28939,28940,28943,28958,28960,28971,28973,28975,28976,28977,28984,28993,28997,28998,28999,29002,29003,29008,29010,29015,29018,29020,29022,29024,29032,29049,29056,29061,29063,29068,29074,29082,29083,29088,29090,29103,29104,29106,29107,29114,29119,29120,29121,29124,29131,29132,29139,29142,29145,29146,29148,29176,29182,29184,29191,29192,29193,29203,29207,29210,29213,29215,29220,29227,29231,29236,29240,29241,29249,29250,29251,29253,29262,29263,29264,29267,29269,29270,29274,29276,29278,29280,29283,29288,29291,29294,29295,29297,29303,29304,29307,29308,29311,29316,29321,29325,29326,29331,29339,29352,29357,29358,29361,29364,29374,29377,29383,29385,29388,29397,29398,29400,29407,29413,29427,29428,29434,29435,29438,29442,29444,29445,29447,29451,29453,29458,29459,29464,29465,29470,29474,29476,29479,29480,29484,29489,29490,29493,29498,29499,29501,29507,29517,29520,29522,29526,29528,29533,29534,29535,29536,29542,29543,29545,29547,29548,29550,29551,29553,29559,29561,29564,29568,29569,29571,29573,29574,29582,29584,29587,29589,29591,29592,29596,29598,29599,29600,29602,29605,29606,29610,29611,29613,29621,29623,29625,29628,29629,29631,29637,29638,29641,29643,29644,29647,29650,29651,29654,29657,29661,29665,29667,29670,29671,29673,29684,29685,29687,29689,29690,29691,29693,29695,29696,29697,29700,29703,29706,29713,29722,29723,29732,29734,29736,29737,29738,29739,29740,29741,29742,29743,29744,29745,29753,29760,29763,29764,29766,29767,29771,29773,29777,29778,29783,29789,29794,29798,29799,29800,29803,29805,29806,29809,29810,29824,29825,29829,29830,29831,29833,29839,29840,29841,29842,29848,29849,29850,29852,29855,29856,29857,29859,29862,29864,29865,29866,29867,29870,29871,29873,29874,29877,29881,29883,29887,29896,29897,29900,29904,29907,29912,29914,29915,29918,29919,29924,29928,29930,29931,29935,29940,29946,29947,29948,29951,29958,29970,29974,29975,29984,29985,29988,29991,29993,29994,29999,30006,30009,30013,30014,30015,30016,30019,30023,30024,30030,30032,30034,30039,30046,30047,30049,30063,30065,30073,30074,30075,30076,30077,30078,30081,30085,30096,30098,30099,30101,30105,30108,30114,30116,30132,30138,30143,30144,30145,30148,30150,30156,30158,30159,30167,30172,30175,30176,30177,30180,30183,30188,30190,30191,30193,30201,30208,30210,30211,30212,30215,30216,30218,30220,30223,30226,30227,30229,30230,30233,30235,30236,30237,30238,30243,30245,30246,30249,30253,30258,30259,30261,30264,30265,30266,30268,30282,30272,30273,30275,30276,30277,30281,30283,30293,30297,30303,30308,30309,30317,30318,30319,30321,30324,30337,30341,30348,30349,30357,30363,30364,30365,30367,30368,30370,30371,30372,30373,30374,30375,30376,30378,30381,30397,30401,30405,30409,30411,30412,30414,30420,30425,30432,30438,30440,30444,30448,30449,30454,30457,30460,30464,30470,30474,30478,30482,30484,30485,30487,30489,30490,30492,30498,30504,30509,30510,30511,30516,30517,30518,30521,30525,30526,30530,30533,30534,30538,30541,30542,30543,30546,30550,30551,30556,30558,30559,30560,30562,30564,30567,30570,30572,30576,30578,30579,30580,30586,30589,30592,30596,30604,30605,30612,30613,30614,30618,30623,30626,30631,30634,30638,30639,30641,30645,30654,30659,30665,30673,30674,30677,30681,30686,30687,30688,30692,30694,30698,30700,30704,30705,30708,30712,30715,30725,30726,30729,30733,30734,30737,30749,30753,30754,30755,30765,30766,30768,30773,30775,30787,30788,30791,30792,30796,30798,30802,30812,30814,30816,30817,30819,30820,30824,30826,30830,30842,30846,30858,30863,30868,30872,30881,30877,30878,30879,30884,30888,30892,30893,30896,30897,30898,30899,30907,30909,30911,30919,30920,30921,30924,30926,30930,30931,30933,30934,30948,30939,30943,30944,30945,30950,30954,30962,30963,30976,30966,30967,30970,30971,30975,30982,30988,30992,31002,31004,31006,31007,31008,31013,31015,31017,31021,31025,31028,31029,31035,31037,31039,31044,31045,31046,31050,31051,31055,31057,31060,31064,31067,31068,31079,31081,31083,31090,31097,31099,31100,31102,31115,31116,31121,31123,31124,31125,31126,31128,31131,31132,31137,31144,31145,31147,31151,31153,31156,31160,31163,31170,31172,31175,31176,31178,31183,31188,31190,31194,31197,31198,31200,31202,31205,31210,31211,31213,31217,31224,31228,31234,31235,31239,31241,31242,31244,31249,31253,31259,31262,31265,31271,31275,31277,31279,31280,31284,31285,31288,31289,31290,31300,31301,31303,31304,31308,31317,31318,31321,31324,31325,31327,31328,31333,31335,31338,31341,31349,31352,31358,31360,31362,31365,31366,31370,31371,31376,31377,31380,31390,31392,31395,31404,31411,31413,31417,31419,31420,31430,31433,31436,31438,31441,31451,31464,31465,31467,31468,31473,31476,31483,31485,31486,31495,31508,31519,31523,31527,31529,31530,31531,31533,31534,31535,31536,31537,31540,31549,31551,31552,31553,31559,31566,31573,31584,31588,31590,31593,31594,31597,31599,31602,31603,31607,31620,31625,31630,31632,31633,31638,31643,31646,31648,31653,31660,31663,31664,31666,31669,31670,31674,31675,31676,31677,31682,31685,31688,31690,31700,31702,31703,31705,31706,31707,31720,31722,31730,31732,31733,31736,31737,31738,31740,31742,31745,31746,31747,31748,31750,31753,31755,31756,31758,31759,31769,31771,31776,31781,31782,31784,31788,31793,31795,31796,31798,31801,31802,31814,31818,31829,31825,31826,31827,31833,31834,31835,31836,31837,31838,31841,31843,31847,31849,31853,31854,31856,31858,31865,31868,31869,31878,31879,31887,31892,31902,31904,31910,31920,31926,31927,31930,31931,31932,31935,31940,31943,31944,31945,31949,31951,31955,31956,31957,31959,31961,31962,31965,31974,31977,31979,31989,32003,32007,32008,32009,32015,32017,32018,32019,32022,32029,32030,32035,32038,32042,32045,32049,32060,32061,32062,32064,32065,32071,32072,32077,32081,32083,32087,32089,32090,32092,32093,32101,32103,32106,32112,32120,32122,32123,32127,32129,32130,32131,32133,32134,32136,32139,32140,32141,32145,32150,32151,32157,32158,32166,32167,32170,32179,32182,32183,32185,32194,32195,32196,32197,32198,32204,32205,32206,32215,32217,32256,32226,32229,32230,32234,32235,32237,32241,32245,32246,32249,32250,32264,32272,32273,32277,32279,32284,32285,32288,32295,32296,32300,32301,32303,32307,32310,32319,32324,32325,32327,32334,32336,32338,32344,32351,32353,32354,32357,32363,32366,32367,32371,32376,32382,32385,32390,32391,32394,32397,32401,32405,32408,32410,32413,32414,32572,32571,32573,32574,32575,32579,32580,32583,32591,32594,32595,32603,32604,32605,32609,32611,32612,32613,32614,32621,32625,32637,32638,32639,32640,32651,32653,32655,32656,32657,32662,32663,32668,32673,32674,32678,32682,32685,32692,32700,32703,32704,32707,32712,32718,32719,32731,32735,32739,32741,32744,32748,32750,32751,32754,32762,32765,32766,32767,32775,32776,32778,32781,32782,32783,32785,32787,32788,32790,32797,32798,32799,32800,32804,32806,32812,32814,32816,32820,32821,32823,32825,32826,32828,32830,32832,32836,32864,32868,32870,32877,32881,32885,32897,32904,32910,32924,32926,32934,32935,32939,32952,32953,32968,32973,32975,32978,32980,32981,32983,32984,32992,33005,33006,33008,33010,33011,33014,33017,33018,33022,33027,33035,33046,33047,33048,33052,33054,33056,33060,33063,33068,33072,33077,33082,33084,33093,33095,33098,33100,33106,33111,33120,33121,33127,33128,33129,33133,33135,33143,33153,33168,33156,33157,33158,33163,33166,33174,33176,33179,33182,33186,33198,33202,33204,33211,33227,33219,33221,33226,33230,33231,33237,33239,33243,33245,33246,33249,33252,33259,33260,33264,33265,33266,33269,33270,33272,33273,33277,33279,33280,33283,33295,33299,33300,33305,33306,33309,33313,33314,33320,33330,33332,33338,33347,33348,33349,33350,33355,33358,33359,33361,33366,33372,33376,33379,33383,33389,33396,33403,33405,33407,33408,33409,33411,33412,33415,33417,33418,33422,33425,33428,33430,33432,33434,33435,33440,33441,33443,33444,33447,33448,33449,33450,33454,33456,33458,33460,33463,33466,33468,33470,33471,33478,33488,33493,33498,33504,33506,33508,33512,33514,33517,33519,33526,33527,33533,33534,33536,33537,33543,33544,33546,33547,33620,33563,33565,33566,33567,33569,33570,33580,33581,33582,33584,33587,33591,33594,33596,33597,33602,33603,33604,33607,33613,33614,33617,33621,33622,33623,33648,33656,33661,33663,33664,33666,33668,33670,33677,33682,33684,33685,33688,33689,33691,33692,33693,33702,33703,33705,33708,33726,33727,33728,33735,33737,33743,33744,33745,33748,33757,33619,33768,33770,33782,33784,33785,33788,33793,33798,33802,33807,33809,33813,33817,33709,33839,33849,33861,33863,33864,33866,33869,33871,33873,33874,33878,33880,33881,33882,33884,33888,33892,33893,33895,33898,33904,33907,33908,33910,33912,33916,33917,33921,33925,33938,33939,33941,33950,33958,33960,33961,33962,33967,33969,33972,33978,33981,33982,33984,33986,33991,33992,33996,33999,34003,34012,34023,34026,34031,34032,34033,34034,34039,34098,34042,34043,34045,34050,34051,34055,34060,34062,34064,34076,34078,34082,34083,34084,34085,34087,34090,34091,34095,34099,34100,34102,34111,34118,34127,34128,34129,34130,34131,34134,34137,34140,34141,34142,34143,34144,34145,34146,34148,34155,34159,34169,34170,34171,34173,34175,34177,34181,34182,34185,34187,34188,34191,34195,34200,34205,34207,34208,34210,34213,34215,34228,34230,34231,34232,34236,34237,34238,34239,34242,34247,34250,34251,34254,34221,34264,34266,34271,34272,34278,34280,34285,34291,34294,34300,34303,34304,34308,34309,34317,34318,34320,34321,34322,34328,34329,34331,34334,34337,34343,34345,34358,34360,34362,34364,34365,34368,34370,34374,34386,34387,34390,34391,34392,34393,34397,34400,34401,34402,34403,34404,34409,34412,34415,34421,34422,34423,34426,34445,34449,34454,34456,34458,34460,34465,34470,34471,34472,34477,34481,34483,34484,34485,34487,34488,34489,34495,34496,34497,34499,34501,34513,34514,34517,34519,34522,34524,34528,34531,34533,34535,34440,34554,34556,34557,34564,34565,34567,34571,34574,34575,34576,34579,34580,34585,34590,34591,34593,34595,34600,34606,34607,34609,34610,34617,34618,34620,34621,34622,34624,34627,34629,34637,34648,34653,34657,34660,34661,34671,34673,34674,34683,34691,34692,34693,34694,34695,34696,34697,34699,34700,34704,34707,34709,34711,34712,34713,34718,34720,34723,34727,34732,34733,34734,34737,34741,34750,34751,34753,34760,34761,34762,34766,34773,34774,34777,34778,34780,34783,34786,34787,34788,34794,34795,34797,34801,34803,34808,34810,34815,34817,34819,34822,34825,34826,34827,34832,34841,34834,34835,34836,34840,34842,34843,34844,34846,34847,34856,34861,34862,34864,34866,34869,34874,34876,34881,34883,34885,34888,34889,34890,34891,34894,34897,34901,34902,34904,34906,34908,34911,34912,34916,34921,34929,34937,34939,34944,34968,34970,34971,34972,34975,34976,34984,34986,35002,35005,35006,35008,35018,35019,35020,35021,35022,35025,35026,35027,35035,35038,35047,35055,35056,35057,35061,35063,35073,35078,35085,35086,35087,35093,35094,35096,35097,35098,35100,35104,35110,35111,35112,35120,35121,35122,35125,35129,35130,35134,35136,35138,35141,35142,35145,35151,35154,35159,35162,35163,35164,35169,35170,35171,35179,35182,35184,35187,35189,35194,35195,35196,35197,35209,35213,35216,35220,35221,35227,35228,35231,35232,35237,35248,35252,35253,35254,35255,35260,35284,35285,35286,35287,35288,35301,35305,35307,35309,35313,35315,35318,35321,35325,35327,35332,35333,35335,35343,35345,35346,35348,35349,35358,35360,35362,35364,35366,35371,35372,35375,35381,35383,35389,35390,35392,35395,35397,35399,35401,35405,35406,35411,35414,35415,35416,35420,35421,35425,35429,35431,35445,35446,35447,35449,35450,35451,35454,35455,35456,35459,35462,35467,35471,35472,35474,35478,35479,35481,35487,35495,35497,35502,35503,35507,35510,35511,35515,35518,35523,35526,35528,35529,35530,35537,35539,35540,35541,35543,35549,35551,35564,35568,35572,35573,35574,35580,35583,35589,35590,35595,35601,35612,35614,35615,35594,35629,35632,35639,35644,35650,35651,35652,35653,35654,35656,35666,35667,35668,35673,35661,35678,35683,35693,35702,35704,35705,35708,35710,35713,35716,35717,35723,35725,35727,35732,35733,35740,35742,35743,35896,35897,35901,35902,35909,35911,35913,35915,35919,35921,35923,35924,35927,35928,35931,35933,35929,35939,35940,35942,35944,35945,35949,35955,35957,35958,35963,35966,35974,35975,35979,35984,35986,35987,35993,35995,35996,36004,36025,36026,36037,36038,36041,36043,36047,36054,36053,36057,36061,36065,36072,36076,36079,36080,36082,36085,36087,36088,36094,36095,36097,36099,36105,36114,36119,36123,36197,36201,36204,36206,36223,36226,36228,36232,36237,36240,36241,36245,36254,36255,36256,36262,36267,36268,36271,36274,36277,36279,36281,36283,36288,36293,36294,36295,36296,36298,36302,36305,36308,36309,36311,36313,36324,36325,36327,36332,36336,36284,36337,36338,36340,36349,36353,36356,36357,36358,36363,36369,36372,36374,36384,36385,36386,36387,36390,36391,36401,36403,36406,36407,36408,36409,36413,36416,36417,36427,36429,36430,36431,36436,36443,36444,36445,36446,36449,36450,36457,36460,36461,36463,36464,36465,36473,36474,36475,36482,36483,36489,36496,36498,36501,36506,36507,36509,36510,36514,36519,36521,36525,36526,36531,36533,36538,36539,36544,36545,36547,36548,36551,36559,36561,36564,36572,36584,36590,36592,36593,36599,36601,36602,36589,36608,36610,36615,36616,36623,36624,36630,36631,36632,36638,36640,36641,36643,36645,36647,36648,36652,36653,36654,36660,36661,36662,36663,36666,36672,36673,36675,36679,36687,36689,36690,36691,36692,36693,36696,36701,36702,36709,36765,36768,36769,36772,36773,36774,36789,36790,36792,36798,36800,36801,36806,36810,36811,36813,36816,36818,36819,36821,36832,36835,36836,36840,36846,36849,36853,36854,36859,36862,36866,36868,36872,36876,36888,36891,36904,36905,36911,36906,36908,36909,36915,36916,36919,36927,36931,36932,36940,36955,36957,36962,36966,36967,36972,36976,36980,36985,36997,37000,37003,37004,37006,37008,37013,37015,37016,37017,37019,37024,37025,37026,37029,37040,37042,37043,37044,37046,37053,37068,37054,37059,37060,37061,37063,37064,37077,37079,37080,37081,37084,37085,37087,37093,37074,37110,37099,37103,37104,37108,37118,37119,37120,37124,37125,37126,37128,37133,37136,37140,37142,37143,37144,37146,37148,37150,37152,37157,37154,37155,37159,37161,37166,37167,37169,37172,37174,37175,37177,37178,37180,37181,37187,37191,37192,37199,37203,37207,37209,37210,37211,37217,37220,37223,37229,37236,37241,37242,37243,37249,37251,37253,37254,37258,37262,37265,37267,37268,37269,37272,37278,37281,37286,37288,37292,37293,37294,37296,37297,37298,37299,37302,37307,37308,37309,37311,37314,37315,37317,37331,37332,37335,37337,37338,37342,37348,37349,37353,37354,37356,37357,37358,37359,37360,37361,37367,37369,37371,37373,37376,37377,37380,37381,37382,37383,37385,37386,37388,37392,37394,37395,37398,37400,37404,37405,37411,37412,37413,37414,37416,37422,37423,37424,37427,37429,37430,37432,37433,37434,37436,37438,37440,37442,37443,37446,37447,37450,37453,37454,37455,37457,37464,37465,37468,37469,37472,37473,37477,37479,37480,37481,37486,37487,37488,37493,37494,37495,37496,37497,37499,37500,37501,37503,37512,37513,37514,37517,37518,37522,37527,37529,37535,37536,37540,37541,37543,37544,37547,37551,37554,37558,37560,37562,37563,37564,37565,37567,37568,37569,37570,37571,37573,37574,37575,37576,37579,37580,37581,37582,37584,37587,37589,37591,37592,37593,37596,37597,37599,37600,37601,37603,37605,37607,37608,37612,37614,37616,37625,37627,37631,37632,37634,37640,37645,37649,37652,37653,37660,37661,37662,37663,37665,37668,37669,37671,37673,37674,37683,37684,37686,37687,37703,37704,37705,37712,37713,37714,37717,37719,37720,37722,37726,37732,37733,37735,37737,37738,37741,37743,37744,37745,37747,37748,37750,37754,37757,37759,37760,37761,37762,37768,37770,37771,37773,37775,37778,37781,37784,37787,37790,37793,37795,37796,37798,37800,37803,37812,37813,37814,37818,37801,37825,37828,37829,37830,37831,37833,37834,37835,37836,37837,37843,37849,37852,37854,37855,37858,37862,37863,37881,37879,37880,37882,37883,37885,37889,37890,37892,37896,37897,37901,37902,37903,37909,37910,37911,37919,37934,37935,37937,37938,37939,37940,37947,37951,37949,37955,37957,37960,37962,37964,37973,37977,37980,37983,37985,37987,37992,37995,37997,37998,37999,38001,38002,38020,38019,38264,38265,38270,38276,38280,38284,38285,38286,38301,38302,38303,38305,38310,38313,38315,38316,38324,38326,38330,38333,38335,38342,38344,38345,38347,38352,38353,38354,38355,38361,38362,38365,38366,38367,38368,38372,38374,38429,38430,38434,38436,38437,38438,38444,38449,38451,38455,38456,38457,38458,38460,38461,38465,38482,38484,38486,38487,38488,38497,38510,38516,38523,38524,38526,38527,38529,38530,38531,38532,38537,38545,38550,38554,38557,38559,38564,38565,38566,38569,38574,38575,38579,38586,38602,38610,23986,38616,38618,38621,38622,38623,38633,38639,38641,38650,38658,38659,38661,38665,38682,38683,38685,38689,38690,38691,38696,38705,38707,38721,38723,38730,38734,38735,38741,38743,38744,38746,38747,38755,38759,38762,38766,38771,38774,38775,38776,38779,38781,38783,38784,38793,38805,38806,38807,38809,38810,38814,38815,38818,38828,38830,38833,38834,38837,38838,38840,38841,38842,38844,38846,38847,38849,38852,38853,38855,38857,38858,38860,38861,38862,38864,38865,38868,38871,38872,38873,38877,38878,38880,38875,38881,38884,38895,38897,38900,38903,38904,38906,38919,38922,38937,38925,38926,38932,38934,38940,38942,38944,38947,38950,38955,38958,38959,38960,38962,38963,38965,38949,38974,38980,38983,38986,38993,38994,38995,38998,38999,39001,39002,39010,39011,39013,39014,39018,39020,39083,39085,39086,39088,39092,39095,39096,39098,39099,39103,39106,39109,39112,39116,39137,39139,39141,39142,39143,39146,39155,39158,39170,39175,39176,39185,39189,39190,39191,39194,39195,39196,39199,39202,39206,39207,39211,39217,39218,39219,39220,39221,39225,39226,39227,39228,39232,39233,39238,39239,39240,39245,39246,39252,39256,39257,39259,39260,39262,39263,39264,39323,39325,39327,39334,39344,39345,39346,39349,39353,39354,39357,39359,39363,39369,39379,39380,39385,39386,39388,39390,39399,39402,39403,39404,39408,39412,39413,39417,39421,39422,39426,39427,39428,39435,39436,39440,39441,39446,39454,39456,39458,39459,39460,39463,39469,39470,39475,39477,39478,39480,39495,39489,39492,39498,39499,39500,39502,39505,39508,39510,39517,39594,39596,39598,39599,39602,39604,39605,39606,39609,39611,39614,39615,39617,39619,39622,39624,39630,39632,39634,39637,39638,39639,39643,39644,39648,39652,39653,39655,39657,39660,39666,39667,39669,39673,39674,39677,39679,39680,39681,39682,39683,39684,39685,39688,39689,39691,39692,39693,39694,39696,39698,39702,39705,39707,39708,39712,39718,39723,39725,39731,39732,39733,39735,39737,39738,39741,39752,39755,39756,39765,39766,39767,39771,39774,39777,39779,39781,39782,39784,39786,39787,39788,39789,39790,39795,39797,39799,39800,39801,39807,39808,39812,39813,39814,39815,39817,39818,39819,39821,39823,39824,39828,39834,39837,39838,39846,39847,39849,39852,39856,39857,39858,39863,39864,39867,39868,39870,39871,39873,39879,39880,39886,39888,39895,39896,39901,39903,39909,39911,39914,39915,39919,39923,39927,39928,39929,39930,39933,39935,39936,39938,39947,39951,39953,39958,39960,39961,39962,39964,39966,39970,39971,39974,39975,39976,39977,39978,39985,39989,39990,39991,39997,40001,40003,40004,40005,40009,40010,40014,40015,40016,40019,40020,40022,40024,40027,40029,40030,40031,40035,40041,40042,40028,40043,40040,40046,40048,40050,40053,40055,40059,40166,40178,40183,40185,40203,40194,40209,40215,40216,40220,40221,40222,40239,40240,40242,40243,40244,40250,40252,40261,40253,40258,40259,40263,40266,40275,40276,40287,40291,40290,40293,40297,40298,40299,40304,40310,40311,40315,40316,40318,40323,40324,40326,40330,40333,40334,40338,40339,40341,40342,40343,40344,40353,40362,40364,40366,40369,40373,40377,40380,40383,40387,40391,40393,40394,40404,40405,40406,40407,40410,40414,40415,40416,40421,40423,40425,40427,40430,40432,40435,40436,40446,40458,40450,40455,40462,40464,40465,40466,40469,40470,40473,40476,40477,40570,40571,40572,40576,40578,40579,40580,40581,40583,40590,40591,40598,40600,40603,40606,40612,40616,40620,40622,40623,40624,40627,40628,40629,40646,40648,40651,40661,40671,40676,40679,40684,40685,40686,40688,40689,40690,40693,40696,40703,40706,40707,40713,40719,40720,40721,40722,40724,40726,40727,40729,40730,40731,40735,40738,40742,40746,40747,40751,40753,40754,40756,40759,40761,40762,40764,40765,40767,40769,40771,40772,40773,40774,40775,40787,40789,40790,40791,40792,40794,40797,40798,40808,40809,40813,40814,40815,40816,40817,40819,40821,40826,40829,40847,40848,40849,40850,40852,40854,40855,40862,40865,40866,40867,40869,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], "ibm866":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160], "iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729], "iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729], "iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729], "iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119], "iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null], "iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null], "iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null], "iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312], "iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217], "iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255], "iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255], "iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255], "koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066], "koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066], "macintosh":[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711], "windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null], "windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729], "windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103], "windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255], "windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null], "windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255], "windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null], "windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746], "windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729], "windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255], "x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364] }; // For strict environments where `this` inside the global scope // is `undefined`, take a pure object instead }(this || {})); },{}],68:[function(require,module,exports){ // This is free and unencumbered software released into the public domain. // See LICENSE.md for more information. /** * @fileoverview Global |this| required for resolving indexes in node. * @suppress {globalThis} */ (function(global) { 'use strict'; // If we're in node require encoding-indexes and attach it to the global. if (typeof module !== "undefined" && module.exports && !global["encoding-indexes"]) { global["encoding-indexes"] = require("./encoding-indexes.js")["encoding-indexes"]; } // // Utilities // /** * @param {number} a The number to test. * @param {number} min The minimum value in the range, inclusive. * @param {number} max The maximum value in the range, inclusive. * @return {boolean} True if a >= min and a <= max. */ function inRange(a, min, max) { return min <= a && a <= max; } /** * @param {!Array.<*>} array The array to check. * @param {*} item The item to look for in the array. * @return {boolean} True if the item appears in the array. */ function includes(array, item) { return array.indexOf(item) !== -1; } var floor = Math.floor; /** * @param {*} o * @return {Object} */ function ToDictionary(o) { if (o === undefined) return {}; if (o === Object(o)) return o; throw TypeError('Could not convert argument to dictionary'); } /** * @param {string} string Input string of UTF-16 code units. * @return {!Array.} Code points. */ function stringToCodePoints(string) { // https://heycam.github.io/webidl/#dfn-obtain-unicode // 1. Let S be the DOMString value. var s = String(string); // 2. Let n be the length of S. var n = s.length; // 3. Initialize i to 0. var i = 0; // 4. Initialize U to be an empty sequence of Unicode characters. var u = []; // 5. While i < n: while (i < n) { // 1. Let c be the code unit in S at index i. var c = s.charCodeAt(i); // 2. Depending on the value of c: // c < 0xD800 or c > 0xDFFF if (c < 0xD800 || c > 0xDFFF) { // Append to U the Unicode character with code point c. u.push(c); } // 0xDC00 ≤ c ≤ 0xDFFF else if (0xDC00 <= c && c <= 0xDFFF) { // Append to U a U+FFFD REPLACEMENT CHARACTER. u.push(0xFFFD); } // 0xD800 ≤ c ≤ 0xDBFF else if (0xD800 <= c && c <= 0xDBFF) { // 1. If i = n−1, then append to U a U+FFFD REPLACEMENT // CHARACTER. if (i === n - 1) { u.push(0xFFFD); } // 2. Otherwise, i < n−1: else { // 1. Let d be the code unit in S at index i+1. var d = s.charCodeAt(i + 1); // 2. If 0xDC00 ≤ d ≤ 0xDFFF, then: if (0xDC00 <= d && d <= 0xDFFF) { // 1. Let a be c & 0x3FF. var a = c & 0x3FF; // 2. Let b be d & 0x3FF. var b = d & 0x3FF; // 3. Append to U the Unicode character with code point // 2^16+2^10*a+b. u.push(0x10000 + (a << 10) + b); // 4. Set i to i+1. i += 1; } // 3. Otherwise, d < 0xDC00 or d > 0xDFFF. Append to U a // U+FFFD REPLACEMENT CHARACTER. else { u.push(0xFFFD); } } } // 3. Set i to i+1. i += 1; } // 6. Return U. return u; } /** * @param {!Array.} code_points Array of code points. * @return {string} string String of UTF-16 code units. */ function codePointsToString(code_points) { var s = ''; for (var i = 0; i < code_points.length; ++i) { var cp = code_points[i]; if (cp <= 0xFFFF) { s += String.fromCharCode(cp); } else { cp -= 0x10000; s += String.fromCharCode((cp >> 10) + 0xD800, (cp & 0x3FF) + 0xDC00); } } return s; } // // Implementation of Encoding specification // https://encoding.spec.whatwg.org/ // // // 4. Terminology // /** * An ASCII byte is a byte in the range 0x00 to 0x7F, inclusive. * @param {number} a The number to test. * @return {boolean} True if a is in the range 0x00 to 0x7F, inclusive. */ function isASCIIByte(a) { return 0x00 <= a && a <= 0x7F; } /** * An ASCII code point is a code point in the range U+0000 to * U+007F, inclusive. */ var isASCIICodePoint = isASCIIByte; /** * End-of-stream is a special token that signifies no more tokens * are in the stream. * @const */ var end_of_stream = -1; /** * A stream represents an ordered sequence of tokens. * * @constructor * @param {!(Array.|Uint8Array)} tokens Array of tokens that provide * the stream. */ function Stream(tokens) { /** @type {!Array.} */ this.tokens = [].slice.call(tokens); // Reversed as push/pop is more efficient than shift/unshift. this.tokens.reverse(); } Stream.prototype = { /** * @return {boolean} True if end-of-stream has been hit. */ endOfStream: function() { return !this.tokens.length; }, /** * When a token is read from a stream, the first token in the * stream must be returned and subsequently removed, and * end-of-stream must be returned otherwise. * * @return {number} Get the next token from the stream, or * end_of_stream. */ read: function() { if (!this.tokens.length) return end_of_stream; return this.tokens.pop(); }, /** * When one or more tokens are prepended to a stream, those tokens * must be inserted, in given order, before the first token in the * stream. * * @param {(number|!Array.)} token The token(s) to prepend to the * stream. */ prepend: function(token) { if (Array.isArray(token)) { var tokens = /**@type {!Array.}*/(token); while (tokens.length) this.tokens.push(tokens.pop()); } else { this.tokens.push(token); } }, /** * When one or more tokens are pushed to a stream, those tokens * must be inserted, in given order, after the last token in the * stream. * * @param {(number|!Array.)} token The tokens(s) to push to the * stream. */ push: function(token) { if (Array.isArray(token)) { var tokens = /**@type {!Array.}*/(token); while (tokens.length) this.tokens.unshift(tokens.shift()); } else { this.tokens.unshift(token); } } }; // // 5. Encodings // // 5.1 Encoders and decoders /** @const */ var finished = -1; /** * @param {boolean} fatal If true, decoding errors raise an exception. * @param {number=} opt_code_point Override the standard fallback code point. * @return {number} The code point to insert on a decoding error. */ function decoderError(fatal, opt_code_point) { if (fatal) throw TypeError('Decoder error'); return opt_code_point || 0xFFFD; } /** * @param {number} code_point The code point that could not be encoded. * @return {number} Always throws, no value is actually returned. */ function encoderError(code_point) { throw TypeError('The code point ' + code_point + ' could not be encoded.'); } /** @interface */ function Decoder() {} Decoder.prototype = { /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point, or |finished|. */ handler: function(stream, bite) {} }; /** @interface */ function Encoder() {} Encoder.prototype = { /** * @param {Stream} stream The stream of code points being encoded. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit, or |finished|. */ handler: function(stream, code_point) {} }; // 5.2 Names and labels // TODO: Define @typedef for Encoding: {name:string,labels:Array.} // https://github.com/google/closure-compiler/issues/247 /** * @param {string} label The encoding label. * @return {?{name:string,labels:Array.}} */ function getEncoding(label) { // 1. Remove any leading and trailing ASCII whitespace from label. label = String(label).trim().toLowerCase(); // 2. If label is an ASCII case-insensitive match for any of the // labels listed in the table below, return the corresponding // encoding, and failure otherwise. if (Object.prototype.hasOwnProperty.call(label_to_encoding, label)) { return label_to_encoding[label]; } return null; } /** * Encodings table: https://encoding.spec.whatwg.org/encodings.json * @const * @type {!Array.<{ * heading: string, * encodings: Array.<{name:string,labels:Array.}> * }>} */ var encodings = [ { "encodings": [ { "labels": [ "unicode-1-1-utf-8", "utf-8", "utf8" ], "name": "UTF-8" } ], "heading": "The Encoding" }, { "encodings": [ { "labels": [ "866", "cp866", "csibm866", "ibm866" ], "name": "IBM866" }, { "labels": [ "csisolatin2", "iso-8859-2", "iso-ir-101", "iso8859-2", "iso88592", "iso_8859-2", "iso_8859-2:1987", "l2", "latin2" ], "name": "ISO-8859-2" }, { "labels": [ "csisolatin3", "iso-8859-3", "iso-ir-109", "iso8859-3", "iso88593", "iso_8859-3", "iso_8859-3:1988", "l3", "latin3" ], "name": "ISO-8859-3" }, { "labels": [ "csisolatin4", "iso-8859-4", "iso-ir-110", "iso8859-4", "iso88594", "iso_8859-4", "iso_8859-4:1988", "l4", "latin4" ], "name": "ISO-8859-4" }, { "labels": [ "csisolatincyrillic", "cyrillic", "iso-8859-5", "iso-ir-144", "iso8859-5", "iso88595", "iso_8859-5", "iso_8859-5:1988" ], "name": "ISO-8859-5" }, { "labels": [ "arabic", "asmo-708", "csiso88596e", "csiso88596i", "csisolatinarabic", "ecma-114", "iso-8859-6", "iso-8859-6-e", "iso-8859-6-i", "iso-ir-127", "iso8859-6", "iso88596", "iso_8859-6", "iso_8859-6:1987" ], "name": "ISO-8859-6" }, { "labels": [ "csisolatingreek", "ecma-118", "elot_928", "greek", "greek8", "iso-8859-7", "iso-ir-126", "iso8859-7", "iso88597", "iso_8859-7", "iso_8859-7:1987", "sun_eu_greek" ], "name": "ISO-8859-7" }, { "labels": [ "csiso88598e", "csisolatinhebrew", "hebrew", "iso-8859-8", "iso-8859-8-e", "iso-ir-138", "iso8859-8", "iso88598", "iso_8859-8", "iso_8859-8:1988", "visual" ], "name": "ISO-8859-8" }, { "labels": [ "csiso88598i", "iso-8859-8-i", "logical" ], "name": "ISO-8859-8-I" }, { "labels": [ "csisolatin6", "iso-8859-10", "iso-ir-157", "iso8859-10", "iso885910", "l6", "latin6" ], "name": "ISO-8859-10" }, { "labels": [ "iso-8859-13", "iso8859-13", "iso885913" ], "name": "ISO-8859-13" }, { "labels": [ "iso-8859-14", "iso8859-14", "iso885914" ], "name": "ISO-8859-14" }, { "labels": [ "csisolatin9", "iso-8859-15", "iso8859-15", "iso885915", "iso_8859-15", "l9" ], "name": "ISO-8859-15" }, { "labels": [ "iso-8859-16" ], "name": "ISO-8859-16" }, { "labels": [ "cskoi8r", "koi", "koi8", "koi8-r", "koi8_r" ], "name": "KOI8-R" }, { "labels": [ "koi8-ru", "koi8-u" ], "name": "KOI8-U" }, { "labels": [ "csmacintosh", "mac", "macintosh", "x-mac-roman" ], "name": "macintosh" }, { "labels": [ "dos-874", "iso-8859-11", "iso8859-11", "iso885911", "tis-620", "windows-874" ], "name": "windows-874" }, { "labels": [ "cp1250", "windows-1250", "x-cp1250" ], "name": "windows-1250" }, { "labels": [ "cp1251", "windows-1251", "x-cp1251" ], "name": "windows-1251" }, { "labels": [ "ansi_x3.4-1968", "ascii", "cp1252", "cp819", "csisolatin1", "ibm819", "iso-8859-1", "iso-ir-100", "iso8859-1", "iso88591", "iso_8859-1", "iso_8859-1:1987", "l1", "latin1", "us-ascii", "windows-1252", "x-cp1252" ], "name": "windows-1252" }, { "labels": [ "cp1253", "windows-1253", "x-cp1253" ], "name": "windows-1253" }, { "labels": [ "cp1254", "csisolatin5", "iso-8859-9", "iso-ir-148", "iso8859-9", "iso88599", "iso_8859-9", "iso_8859-9:1989", "l5", "latin5", "windows-1254", "x-cp1254" ], "name": "windows-1254" }, { "labels": [ "cp1255", "windows-1255", "x-cp1255" ], "name": "windows-1255" }, { "labels": [ "cp1256", "windows-1256", "x-cp1256" ], "name": "windows-1256" }, { "labels": [ "cp1257", "windows-1257", "x-cp1257" ], "name": "windows-1257" }, { "labels": [ "cp1258", "windows-1258", "x-cp1258" ], "name": "windows-1258" }, { "labels": [ "x-mac-cyrillic", "x-mac-ukrainian" ], "name": "x-mac-cyrillic" } ], "heading": "Legacy single-byte encodings" }, { "encodings": [ { "labels": [ "chinese", "csgb2312", "csiso58gb231280", "gb2312", "gb_2312", "gb_2312-80", "gbk", "iso-ir-58", "x-gbk" ], "name": "GBK" }, { "labels": [ "gb18030" ], "name": "gb18030" } ], "heading": "Legacy multi-byte Chinese (simplified) encodings" }, { "encodings": [ { "labels": [ "big5", "big5-hkscs", "cn-big5", "csbig5", "x-x-big5" ], "name": "Big5" } ], "heading": "Legacy multi-byte Chinese (traditional) encodings" }, { "encodings": [ { "labels": [ "cseucpkdfmtjapanese", "euc-jp", "x-euc-jp" ], "name": "EUC-JP" }, { "labels": [ "csiso2022jp", "iso-2022-jp" ], "name": "ISO-2022-JP" }, { "labels": [ "csshiftjis", "ms932", "ms_kanji", "shift-jis", "shift_jis", "sjis", "windows-31j", "x-sjis" ], "name": "Shift_JIS" } ], "heading": "Legacy multi-byte Japanese encodings" }, { "encodings": [ { "labels": [ "cseuckr", "csksc56011987", "euc-kr", "iso-ir-149", "korean", "ks_c_5601-1987", "ks_c_5601-1989", "ksc5601", "ksc_5601", "windows-949" ], "name": "EUC-KR" } ], "heading": "Legacy multi-byte Korean encodings" }, { "encodings": [ { "labels": [ "csiso2022kr", "hz-gb-2312", "iso-2022-cn", "iso-2022-cn-ext", "iso-2022-kr" ], "name": "replacement" }, { "labels": [ "utf-16be" ], "name": "UTF-16BE" }, { "labels": [ "utf-16", "utf-16le" ], "name": "UTF-16LE" }, { "labels": [ "x-user-defined" ], "name": "x-user-defined" } ], "heading": "Legacy miscellaneous encodings" } ]; // Label to encoding registry. /** @type {Object.}>} */ var label_to_encoding = {}; encodings.forEach(function(category) { category.encodings.forEach(function(encoding) { encoding.labels.forEach(function(label) { label_to_encoding[label] = encoding; }); }); }); // Registry of of encoder/decoder factories, by encoding name. /** @type {Object.} */ var encoders = {}; /** @type {Object.} */ var decoders = {}; // // 6. Indexes // /** * @param {number} pointer The |pointer| to search for. * @param {(!Array.|undefined)} index The |index| to search within. * @return {?number} The code point corresponding to |pointer| in |index|, * or null if |code point| is not in |index|. */ function indexCodePointFor(pointer, index) { if (!index) return null; return index[pointer] || null; } /** * @param {number} code_point The |code point| to search for. * @param {!Array.} index The |index| to search within. * @return {?number} The first pointer corresponding to |code point| in * |index|, or null if |code point| is not in |index|. */ function indexPointerFor(code_point, index) { var pointer = index.indexOf(code_point); return pointer === -1 ? null : pointer; } /** * @param {string} name Name of the index. * @return {(!Array.|!Array.>)} * */ function index(name) { if (!('encoding-indexes' in global)) { throw Error("Indexes missing." + " Did you forget to include encoding-indexes.js first?"); } return global['encoding-indexes'][name]; } /** * @param {number} pointer The |pointer| to search for in the gb18030 index. * @return {?number} The code point corresponding to |pointer| in |index|, * or null if |code point| is not in the gb18030 index. */ function indexGB18030RangesCodePointFor(pointer) { // 1. If pointer is greater than 39419 and less than 189000, or // pointer is greater than 1237575, return null. if ((pointer > 39419 && pointer < 189000) || (pointer > 1237575)) return null; // 2. If pointer is 7457, return code point U+E7C7. if (pointer === 7457) return 0xE7C7; // 3. Let offset be the last pointer in index gb18030 ranges that // is equal to or less than pointer and let code point offset be // its corresponding code point. var offset = 0; var code_point_offset = 0; var idx = index('gb18030-ranges'); var i; for (i = 0; i < idx.length; ++i) { /** @type {!Array.} */ var entry = idx[i]; if (entry[0] <= pointer) { offset = entry[0]; code_point_offset = entry[1]; } else { break; } } // 4. Return a code point whose value is code point offset + // pointer − offset. return code_point_offset + pointer - offset; } /** * @param {number} code_point The |code point| to locate in the gb18030 index. * @return {number} The first pointer corresponding to |code point| in the * gb18030 index. */ function indexGB18030RangesPointerFor(code_point) { // 1. If code point is U+E7C7, return pointer 7457. if (code_point === 0xE7C7) return 7457; // 2. Let offset be the last code point in index gb18030 ranges // that is equal to or less than code point and let pointer offset // be its corresponding pointer. var offset = 0; var pointer_offset = 0; var idx = index('gb18030-ranges'); var i; for (i = 0; i < idx.length; ++i) { /** @type {!Array.} */ var entry = idx[i]; if (entry[1] <= code_point) { offset = entry[1]; pointer_offset = entry[0]; } else { break; } } // 3. Return a pointer whose value is pointer offset + code point // − offset. return pointer_offset + code_point - offset; } /** * @param {number} code_point The |code_point| to search for in the Shift_JIS * index. * @return {?number} The code point corresponding to |pointer| in |index|, * or null if |code point| is not in the Shift_JIS index. */ function indexShiftJISPointerFor(code_point) { // 1. Let index be index jis0208 excluding all entries whose // pointer is in the range 8272 to 8835, inclusive. shift_jis_index = shift_jis_index || index('jis0208').map(function(code_point, pointer) { return inRange(pointer, 8272, 8835) ? null : code_point; }); var index_ = shift_jis_index; // 2. Return the index pointer for code point in index. return index_.indexOf(code_point); } var shift_jis_index; /** * @param {number} code_point The |code_point| to search for in the big5 * index. * @return {?number} The code point corresponding to |pointer| in |index|, * or null if |code point| is not in the big5 index. */ function indexBig5PointerFor(code_point) { // 1. Let index be index Big5 excluding all entries whose pointer big5_index_no_hkscs = big5_index_no_hkscs || index('big5').map(function(code_point, pointer) { return (pointer < (0xA1 - 0x81) * 157) ? null : code_point; }); var index_ = big5_index_no_hkscs; // 2. If code point is U+2550, U+255E, U+2561, U+256A, U+5341, or // U+5345, return the last pointer corresponding to code point in // index. if (code_point === 0x2550 || code_point === 0x255E || code_point === 0x2561 || code_point === 0x256A || code_point === 0x5341 || code_point === 0x5345) { return index_.lastIndexOf(code_point); } // 3. Return the index pointer for code point in index. return indexPointerFor(code_point, index_); } var big5_index_no_hkscs; // // 8. API // /** @const */ var DEFAULT_ENCODING = 'utf-8'; // 8.1 Interface TextDecoder /** * @constructor * @param {string=} label The label of the encoding; * defaults to 'utf-8'. * @param {Object=} options */ function TextDecoder(label, options) { // Web IDL conventions if (!(this instanceof TextDecoder)) throw TypeError('Called as a function. Did you forget \'new\'?'); label = label !== undefined ? String(label) : DEFAULT_ENCODING; options = ToDictionary(options); // A TextDecoder object has an associated encoding, decoder, // stream, ignore BOM flag (initially unset), BOM seen flag // (initially unset), error mode (initially replacement), and do // not flush flag (initially unset). /** @private */ this._encoding = null; /** @private @type {?Decoder} */ this._decoder = null; /** @private @type {boolean} */ this._ignoreBOM = false; /** @private @type {boolean} */ this._BOMseen = false; /** @private @type {string} */ this._error_mode = 'replacement'; /** @private @type {boolean} */ this._do_not_flush = false; // 1. Let encoding be the result of getting an encoding from // label. var encoding = getEncoding(label); // 2. If encoding is failure or replacement, throw a RangeError. if (encoding === null || encoding.name === 'replacement') throw RangeError('Unknown encoding: ' + label); if (!decoders[encoding.name]) { throw Error('Decoder not present.' + ' Did you forget to include encoding-indexes.js first?'); } // 3. Let dec be a new TextDecoder object. var dec = this; // 4. Set dec's encoding to encoding. dec._encoding = encoding; // 5. If options's fatal member is true, set dec's error mode to // fatal. if (Boolean(options['fatal'])) dec._error_mode = 'fatal'; // 6. If options's ignoreBOM member is true, set dec's ignore BOM // flag. if (Boolean(options['ignoreBOM'])) dec._ignoreBOM = true; // For pre-ES5 runtimes: if (!Object.defineProperty) { this.encoding = dec._encoding.name.toLowerCase(); this.fatal = dec._error_mode === 'fatal'; this.ignoreBOM = dec._ignoreBOM; } // 7. Return dec. return dec; } if (Object.defineProperty) { // The encoding attribute's getter must return encoding's name. Object.defineProperty(TextDecoder.prototype, 'encoding', { /** @this {TextDecoder} */ get: function() { return this._encoding.name.toLowerCase(); } }); // The fatal attribute's getter must return true if error mode // is fatal, and false otherwise. Object.defineProperty(TextDecoder.prototype, 'fatal', { /** @this {TextDecoder} */ get: function() { return this._error_mode === 'fatal'; } }); // The ignoreBOM attribute's getter must return true if ignore // BOM flag is set, and false otherwise. Object.defineProperty(TextDecoder.prototype, 'ignoreBOM', { /** @this {TextDecoder} */ get: function() { return this._ignoreBOM; } }); } /** * @param {BufferSource=} input The buffer of bytes to decode. * @param {Object=} options * @return {string} The decoded string. */ TextDecoder.prototype.decode = function decode(input, options) { var bytes; if (typeof input === 'object' && input instanceof ArrayBuffer) { bytes = new Uint8Array(input); } else if (typeof input === 'object' && 'buffer' in input && input.buffer instanceof ArrayBuffer) { bytes = new Uint8Array(input.buffer, input.byteOffset, input.byteLength); } else { bytes = new Uint8Array(0); } options = ToDictionary(options); // 1. If the do not flush flag is unset, set decoder to a new // encoding's decoder, set stream to a new stream, and unset the // BOM seen flag. if (!this._do_not_flush) { this._decoder = decoders[this._encoding.name]({ fatal: this._error_mode === 'fatal'}); this._BOMseen = false; } // 2. If options's stream is true, set the do not flush flag, and // unset the do not flush flag otherwise. this._do_not_flush = Boolean(options['stream']); // 3. If input is given, push a copy of input to stream. // TODO: Align with spec algorithm - maintain stream on instance. var input_stream = new Stream(bytes); // 4. Let output be a new stream. var output = []; /** @type {?(number|!Array.)} */ var result; // 5. While true: while (true) { // 1. Let token be the result of reading from stream. var token = input_stream.read(); // 2. If token is end-of-stream and the do not flush flag is // set, return output, serialized. // TODO: Align with spec algorithm. if (token === end_of_stream) break; // 3. Otherwise, run these subsubsteps: // 1. Let result be the result of processing token for decoder, // stream, output, and error mode. result = this._decoder.handler(input_stream, token); // 2. If result is finished, return output, serialized. if (result === finished) break; if (result !== null) { if (Array.isArray(result)) output.push.apply(output, /**@type {!Array.}*/(result)); else output.push(result); } // 3. Otherwise, if result is error, throw a TypeError. // (Thrown in handler) // 4. Otherwise, do nothing. } // TODO: Align with spec algorithm. if (!this._do_not_flush) { do { result = this._decoder.handler(input_stream, input_stream.read()); if (result === finished) break; if (result === null) continue; if (Array.isArray(result)) output.push.apply(output, /**@type {!Array.}*/(result)); else output.push(result); } while (!input_stream.endOfStream()); this._decoder = null; } // A TextDecoder object also has an associated serialize stream // algorithm... /** * @param {!Array.} stream * @return {string} * @this {TextDecoder} */ function serializeStream(stream) { // 1. Let token be the result of reading from stream. // (Done in-place on array, rather than as a stream) // 2. If encoding is UTF-8, UTF-16BE, or UTF-16LE, and ignore // BOM flag and BOM seen flag are unset, run these subsubsteps: if (includes(['UTF-8', 'UTF-16LE', 'UTF-16BE'], this._encoding.name) && !this._ignoreBOM && !this._BOMseen) { if (stream.length > 0 && stream[0] === 0xFEFF) { // 1. If token is U+FEFF, set BOM seen flag. this._BOMseen = true; stream.shift(); } else if (stream.length > 0) { // 2. Otherwise, if token is not end-of-stream, set BOM seen // flag and append token to stream. this._BOMseen = true; } else { // 3. Otherwise, if token is not end-of-stream, append token // to output. // (no-op) } } // 4. Otherwise, return output. return codePointsToString(stream); } return serializeStream.call(this, output); }; // 8.2 Interface TextEncoder /** * @constructor * @param {string=} label The label of the encoding. NONSTANDARD. * @param {Object=} options NONSTANDARD. */ function TextEncoder(label, options) { // Web IDL conventions if (!(this instanceof TextEncoder)) throw TypeError('Called as a function. Did you forget \'new\'?'); options = ToDictionary(options); // A TextEncoder object has an associated encoding and encoder. /** @private */ this._encoding = null; /** @private @type {?Encoder} */ this._encoder = null; // Non-standard /** @private @type {boolean} */ this._do_not_flush = false; /** @private @type {string} */ this._fatal = Boolean(options['fatal']) ? 'fatal' : 'replacement'; // 1. Let enc be a new TextEncoder object. var enc = this; // 2. Set enc's encoding to UTF-8's encoder. if (Boolean(options['NONSTANDARD_allowLegacyEncoding'])) { // NONSTANDARD behavior. label = label !== undefined ? String(label) : DEFAULT_ENCODING; var encoding = getEncoding(label); if (encoding === null || encoding.name === 'replacement') throw RangeError('Unknown encoding: ' + label); if (!encoders[encoding.name]) { throw Error('Encoder not present.' + ' Did you forget to include encoding-indexes.js first?'); } enc._encoding = encoding; } else { // Standard behavior. enc._encoding = getEncoding('utf-8'); if (label !== undefined && 'console' in global) { console.warn('TextEncoder constructor called with encoding label, ' + 'which is ignored.'); } } // For pre-ES5 runtimes: if (!Object.defineProperty) this.encoding = enc._encoding.name.toLowerCase(); // 3. Return enc. return enc; } if (Object.defineProperty) { // The encoding attribute's getter must return encoding's name. Object.defineProperty(TextEncoder.prototype, 'encoding', { /** @this {TextEncoder} */ get: function() { return this._encoding.name.toLowerCase(); } }); } /** * @param {string=} opt_string The string to encode. * @param {Object=} options * @return {!Uint8Array} Encoded bytes, as a Uint8Array. */ TextEncoder.prototype.encode = function encode(opt_string, options) { opt_string = opt_string === undefined ? '' : String(opt_string); options = ToDictionary(options); // NOTE: This option is nonstandard. None of the encodings // permitted for encoding (i.e. UTF-8, UTF-16) are stateful when // the input is a USVString so streaming is not necessary. if (!this._do_not_flush) this._encoder = encoders[this._encoding.name]({ fatal: this._fatal === 'fatal'}); this._do_not_flush = Boolean(options['stream']); // 1. Convert input to a stream. var input = new Stream(stringToCodePoints(opt_string)); // 2. Let output be a new stream var output = []; /** @type {?(number|!Array.)} */ var result; // 3. While true, run these substeps: while (true) { // 1. Let token be the result of reading from input. var token = input.read(); if (token === end_of_stream) break; // 2. Let result be the result of processing token for encoder, // input, output. result = this._encoder.handler(input, token); if (result === finished) break; if (Array.isArray(result)) output.push.apply(output, /**@type {!Array.}*/(result)); else output.push(result); } // TODO: Align with spec algorithm. if (!this._do_not_flush) { while (true) { result = this._encoder.handler(input, input.read()); if (result === finished) break; if (Array.isArray(result)) output.push.apply(output, /**@type {!Array.}*/(result)); else output.push(result); } this._encoder = null; } // 3. If result is finished, convert output into a byte sequence, // and then return a Uint8Array object wrapping an ArrayBuffer // containing output. return new Uint8Array(output); }; // // 9. The encoding // // 9.1 utf-8 // 9.1.1 utf-8 decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function UTF8Decoder(options) { var fatal = options.fatal; // utf-8's decoder's has an associated utf-8 code point, utf-8 // bytes seen, and utf-8 bytes needed (all initially 0), a utf-8 // lower boundary (initially 0x80), and a utf-8 upper boundary // (initially 0xBF). var /** @type {number} */ utf8_code_point = 0, /** @type {number} */ utf8_bytes_seen = 0, /** @type {number} */ utf8_bytes_needed = 0, /** @type {number} */ utf8_lower_boundary = 0x80, /** @type {number} */ utf8_upper_boundary = 0xBF; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and utf-8 bytes needed is not 0, // set utf-8 bytes needed to 0 and return error. if (bite === end_of_stream && utf8_bytes_needed !== 0) { utf8_bytes_needed = 0; return decoderError(fatal); } // 2. If byte is end-of-stream, return finished. if (bite === end_of_stream) return finished; // 3. If utf-8 bytes needed is 0, based on byte: if (utf8_bytes_needed === 0) { // 0x00 to 0x7F if (inRange(bite, 0x00, 0x7F)) { // Return a code point whose value is byte. return bite; } // 0xC2 to 0xDF else if (inRange(bite, 0xC2, 0xDF)) { // 1. Set utf-8 bytes needed to 1. utf8_bytes_needed = 1; // 2. Set UTF-8 code point to byte & 0x1F. utf8_code_point = bite & 0x1F; } // 0xE0 to 0xEF else if (inRange(bite, 0xE0, 0xEF)) { // 1. If byte is 0xE0, set utf-8 lower boundary to 0xA0. if (bite === 0xE0) utf8_lower_boundary = 0xA0; // 2. If byte is 0xED, set utf-8 upper boundary to 0x9F. if (bite === 0xED) utf8_upper_boundary = 0x9F; // 3. Set utf-8 bytes needed to 2. utf8_bytes_needed = 2; // 4. Set UTF-8 code point to byte & 0xF. utf8_code_point = bite & 0xF; } // 0xF0 to 0xF4 else if (inRange(bite, 0xF0, 0xF4)) { // 1. If byte is 0xF0, set utf-8 lower boundary to 0x90. if (bite === 0xF0) utf8_lower_boundary = 0x90; // 2. If byte is 0xF4, set utf-8 upper boundary to 0x8F. if (bite === 0xF4) utf8_upper_boundary = 0x8F; // 3. Set utf-8 bytes needed to 3. utf8_bytes_needed = 3; // 4. Set UTF-8 code point to byte & 0x7. utf8_code_point = bite & 0x7; } // Otherwise else { // Return error. return decoderError(fatal); } // Return continue. return null; } // 4. If byte is not in the range utf-8 lower boundary to utf-8 // upper boundary, inclusive, run these substeps: if (!inRange(bite, utf8_lower_boundary, utf8_upper_boundary)) { // 1. Set utf-8 code point, utf-8 bytes needed, and utf-8 // bytes seen to 0, set utf-8 lower boundary to 0x80, and set // utf-8 upper boundary to 0xBF. utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0; utf8_lower_boundary = 0x80; utf8_upper_boundary = 0xBF; // 2. Prepend byte to stream. stream.prepend(bite); // 3. Return error. return decoderError(fatal); } // 5. Set utf-8 lower boundary to 0x80 and utf-8 upper boundary // to 0xBF. utf8_lower_boundary = 0x80; utf8_upper_boundary = 0xBF; // 6. Set UTF-8 code point to (UTF-8 code point << 6) | (byte & // 0x3F) utf8_code_point = (utf8_code_point << 6) | (bite & 0x3F); // 7. Increase utf-8 bytes seen by one. utf8_bytes_seen += 1; // 8. If utf-8 bytes seen is not equal to utf-8 bytes needed, // continue. if (utf8_bytes_seen !== utf8_bytes_needed) return null; // 9. Let code point be utf-8 code point. var code_point = utf8_code_point; // 10. Set utf-8 code point, utf-8 bytes needed, and utf-8 bytes // seen to 0. utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0; // 11. Return a code point whose value is code point. return code_point; }; } // 9.1.2 utf-8 encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function UTF8Encoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. Set count and offset based on the range code point is in: var count, offset; // U+0080 to U+07FF, inclusive: if (inRange(code_point, 0x0080, 0x07FF)) { // 1 and 0xC0 count = 1; offset = 0xC0; } // U+0800 to U+FFFF, inclusive: else if (inRange(code_point, 0x0800, 0xFFFF)) { // 2 and 0xE0 count = 2; offset = 0xE0; } // U+10000 to U+10FFFF, inclusive: else if (inRange(code_point, 0x10000, 0x10FFFF)) { // 3 and 0xF0 count = 3; offset = 0xF0; } // 4. Let bytes be a byte sequence whose first byte is (code // point >> (6 × count)) + offset. var bytes = [(code_point >> (6 * count)) + offset]; // 5. Run these substeps while count is greater than 0: while (count > 0) { // 1. Set temp to code point >> (6 × (count − 1)). var temp = code_point >> (6 * (count - 1)); // 2. Append to bytes 0x80 | (temp & 0x3F). bytes.push(0x80 | (temp & 0x3F)); // 3. Decrease count by one. count -= 1; } // 6. Return bytes bytes, in order. return bytes; }; } /** @param {{fatal: boolean}} options */ encoders['UTF-8'] = function(options) { return new UTF8Encoder(options); }; /** @param {{fatal: boolean}} options */ decoders['UTF-8'] = function(options) { return new UTF8Decoder(options); }; // // 10. Legacy single-byte encodings // // 10.1 single-byte decoder /** * @constructor * @implements {Decoder} * @param {!Array.} index The encoding index. * @param {{fatal: boolean}} options */ function SingleByteDecoder(index, options) { var fatal = options.fatal; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream, return finished. if (bite === end_of_stream) return finished; // 2. If byte is an ASCII byte, return a code point whose value // is byte. if (isASCIIByte(bite)) return bite; // 3. Let code point be the index code point for byte − 0x80 in // index single-byte. var code_point = index[bite - 0x80]; // 4. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 5. Return a code point whose value is code point. return code_point; }; } // 10.2 single-byte encoder /** * @constructor * @implements {Encoder} * @param {!Array.} index The encoding index. * @param {{fatal: boolean}} options */ function SingleByteEncoder(index, options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. Let pointer be the index pointer for code point in index // single-byte. var pointer = indexPointerFor(code_point, index); // 4. If pointer is null, return error with code point. if (pointer === null) encoderError(code_point); // 5. Return a byte whose value is pointer + 0x80. return pointer + 0x80; }; } (function() { if (!('encoding-indexes' in global)) return; encodings.forEach(function(category) { if (category.heading !== 'Legacy single-byte encodings') return; category.encodings.forEach(function(encoding) { var name = encoding.name; var idx = index(name.toLowerCase()); /** @param {{fatal: boolean}} options */ decoders[name] = function(options) { return new SingleByteDecoder(idx, options); }; /** @param {{fatal: boolean}} options */ encoders[name] = function(options) { return new SingleByteEncoder(idx, options); }; }); }); }()); // // 11. Legacy multi-byte Chinese (simplified) encodings // // 11.1 gbk // 11.1.1 gbk decoder // gbk's decoder is gb18030's decoder. /** @param {{fatal: boolean}} options */ decoders['GBK'] = function(options) { return new GB18030Decoder(options); }; // 11.1.2 gbk encoder // gbk's encoder is gb18030's encoder with its gbk flag set. /** @param {{fatal: boolean}} options */ encoders['GBK'] = function(options) { return new GB18030Encoder(options, true); }; // 11.2 gb18030 // 11.2.1 gb18030 decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function GB18030Decoder(options) { var fatal = options.fatal; // gb18030's decoder has an associated gb18030 first, gb18030 // second, and gb18030 third (all initially 0x00). var /** @type {number} */ gb18030_first = 0x00, /** @type {number} */ gb18030_second = 0x00, /** @type {number} */ gb18030_third = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and gb18030 first, gb18030 // second, and gb18030 third are 0x00, return finished. if (bite === end_of_stream && gb18030_first === 0x00 && gb18030_second === 0x00 && gb18030_third === 0x00) { return finished; } // 2. If byte is end-of-stream, and gb18030 first, gb18030 // second, or gb18030 third is not 0x00, set gb18030 first, // gb18030 second, and gb18030 third to 0x00, and return error. if (bite === end_of_stream && (gb18030_first !== 0x00 || gb18030_second !== 0x00 || gb18030_third !== 0x00)) { gb18030_first = 0x00; gb18030_second = 0x00; gb18030_third = 0x00; decoderError(fatal); } var code_point; // 3. If gb18030 third is not 0x00, run these substeps: if (gb18030_third !== 0x00) { // 1. Let code point be null. code_point = null; // 2. If byte is in the range 0x30 to 0x39, inclusive, set // code point to the index gb18030 ranges code point for // (((gb18030 first − 0x81) × 10 + gb18030 second − 0x30) × // 126 + gb18030 third − 0x81) × 10 + byte − 0x30. if (inRange(bite, 0x30, 0x39)) { code_point = indexGB18030RangesCodePointFor( (((gb18030_first - 0x81) * 10 + gb18030_second - 0x30) * 126 + gb18030_third - 0x81) * 10 + bite - 0x30); } // 3. Let buffer be a byte sequence consisting of gb18030 // second, gb18030 third, and byte, in order. var buffer = [gb18030_second, gb18030_third, bite]; // 4. Set gb18030 first, gb18030 second, and gb18030 third to // 0x00. gb18030_first = 0x00; gb18030_second = 0x00; gb18030_third = 0x00; // 5. If code point is null, prepend buffer to stream and // return error. if (code_point === null) { stream.prepend(buffer); return decoderError(fatal); } // 6. Return a code point whose value is code point. return code_point; } // 4. If gb18030 second is not 0x00, run these substeps: if (gb18030_second !== 0x00) { // 1. If byte is in the range 0x81 to 0xFE, inclusive, set // gb18030 third to byte and return continue. if (inRange(bite, 0x81, 0xFE)) { gb18030_third = bite; return null; } // 2. Prepend gb18030 second followed by byte to stream, set // gb18030 first and gb18030 second to 0x00, and return error. stream.prepend([gb18030_second, bite]); gb18030_first = 0x00; gb18030_second = 0x00; return decoderError(fatal); } // 5. If gb18030 first is not 0x00, run these substeps: if (gb18030_first !== 0x00) { // 1. If byte is in the range 0x30 to 0x39, inclusive, set // gb18030 second to byte and return continue. if (inRange(bite, 0x30, 0x39)) { gb18030_second = bite; return null; } // 2. Let lead be gb18030 first, let pointer be null, and set // gb18030 first to 0x00. var lead = gb18030_first; var pointer = null; gb18030_first = 0x00; // 3. Let offset be 0x40 if byte is less than 0x7F and 0x41 // otherwise. var offset = bite < 0x7F ? 0x40 : 0x41; // 4. If byte is in the range 0x40 to 0x7E, inclusive, or 0x80 // to 0xFE, inclusive, set pointer to (lead − 0x81) × 190 + // (byte − offset). if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0x80, 0xFE)) pointer = (lead - 0x81) * 190 + (bite - offset); // 5. Let code point be null if pointer is null and the index // code point for pointer in index gb18030 otherwise. code_point = pointer === null ? null : indexCodePointFor(pointer, index('gb18030')); // 6. If code point is null and byte is an ASCII byte, prepend // byte to stream. if (code_point === null && isASCIIByte(bite)) stream.prepend(bite); // 7. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 8. Return a code point whose value is code point. return code_point; } // 6. If byte is an ASCII byte, return a code point whose value // is byte. if (isASCIIByte(bite)) return bite; // 7. If byte is 0x80, return code point U+20AC. if (bite === 0x80) return 0x20AC; // 8. If byte is in the range 0x81 to 0xFE, inclusive, set // gb18030 first to byte and return continue. if (inRange(bite, 0x81, 0xFE)) { gb18030_first = bite; return null; } // 9. Return error. return decoderError(fatal); }; } // 11.2.2 gb18030 encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options * @param {boolean=} gbk_flag */ function GB18030Encoder(options, gbk_flag) { var fatal = options.fatal; // gb18030's decoder has an associated gbk flag (initially unset). /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. If code point is U+E5E5, return error with code point. if (code_point === 0xE5E5) return encoderError(code_point); // 4. If the gbk flag is set and code point is U+20AC, return // byte 0x80. if (gbk_flag && code_point === 0x20AC) return 0x80; // 5. Let pointer be the index pointer for code point in index // gb18030. var pointer = indexPointerFor(code_point, index('gb18030')); // 6. If pointer is not null, run these substeps: if (pointer !== null) { // 1. Let lead be floor(pointer / 190) + 0x81. var lead = floor(pointer / 190) + 0x81; // 2. Let trail be pointer % 190. var trail = pointer % 190; // 3. Let offset be 0x40 if trail is less than 0x3F and 0x41 otherwise. var offset = trail < 0x3F ? 0x40 : 0x41; // 4. Return two bytes whose values are lead and trail + offset. return [lead, trail + offset]; } // 7. If gbk flag is set, return error with code point. if (gbk_flag) return encoderError(code_point); // 8. Set pointer to the index gb18030 ranges pointer for code // point. pointer = indexGB18030RangesPointerFor(code_point); // 9. Let byte1 be floor(pointer / 10 / 126 / 10). var byte1 = floor(pointer / 10 / 126 / 10); // 10. Set pointer to pointer − byte1 × 10 × 126 × 10. pointer = pointer - byte1 * 10 * 126 * 10; // 11. Let byte2 be floor(pointer / 10 / 126). var byte2 = floor(pointer / 10 / 126); // 12. Set pointer to pointer − byte2 × 10 × 126. pointer = pointer - byte2 * 10 * 126; // 13. Let byte3 be floor(pointer / 10). var byte3 = floor(pointer / 10); // 14. Let byte4 be pointer − byte3 × 10. var byte4 = pointer - byte3 * 10; // 15. Return four bytes whose values are byte1 + 0x81, byte2 + // 0x30, byte3 + 0x81, byte4 + 0x30. return [byte1 + 0x81, byte2 + 0x30, byte3 + 0x81, byte4 + 0x30]; }; } /** @param {{fatal: boolean}} options */ encoders['gb18030'] = function(options) { return new GB18030Encoder(options); }; /** @param {{fatal: boolean}} options */ decoders['gb18030'] = function(options) { return new GB18030Decoder(options); }; // // 12. Legacy multi-byte Chinese (traditional) encodings // // 12.1 Big5 // 12.1.1 Big5 decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function Big5Decoder(options) { var fatal = options.fatal; // Big5's decoder has an associated Big5 lead (initially 0x00). var /** @type {number} */ Big5_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and Big5 lead is not 0x00, set // Big5 lead to 0x00 and return error. if (bite === end_of_stream && Big5_lead !== 0x00) { Big5_lead = 0x00; return decoderError(fatal); } // 2. If byte is end-of-stream and Big5 lead is 0x00, return // finished. if (bite === end_of_stream && Big5_lead === 0x00) return finished; // 3. If Big5 lead is not 0x00, let lead be Big5 lead, let // pointer be null, set Big5 lead to 0x00, and then run these // substeps: if (Big5_lead !== 0x00) { var lead = Big5_lead; var pointer = null; Big5_lead = 0x00; // 1. Let offset be 0x40 if byte is less than 0x7F and 0x62 // otherwise. var offset = bite < 0x7F ? 0x40 : 0x62; // 2. If byte is in the range 0x40 to 0x7E, inclusive, or 0xA1 // to 0xFE, inclusive, set pointer to (lead − 0x81) × 157 + // (byte − offset). if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0xA1, 0xFE)) pointer = (lead - 0x81) * 157 + (bite - offset); // 3. If there is a row in the table below whose first column // is pointer, return the two code points listed in its second // column // Pointer | Code points // --------+-------------- // 1133 | U+00CA U+0304 // 1135 | U+00CA U+030C // 1164 | U+00EA U+0304 // 1166 | U+00EA U+030C switch (pointer) { case 1133: return [0x00CA, 0x0304]; case 1135: return [0x00CA, 0x030C]; case 1164: return [0x00EA, 0x0304]; case 1166: return [0x00EA, 0x030C]; } // 4. Let code point be null if pointer is null and the index // code point for pointer in index Big5 otherwise. var code_point = (pointer === null) ? null : indexCodePointFor(pointer, index('big5')); // 5. If code point is null and byte is an ASCII byte, prepend // byte to stream. if (code_point === null && isASCIIByte(bite)) stream.prepend(bite); // 6. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 7. Return a code point whose value is code point. return code_point; } // 4. If byte is an ASCII byte, return a code point whose value // is byte. if (isASCIIByte(bite)) return bite; // 5. If byte is in the range 0x81 to 0xFE, inclusive, set Big5 // lead to byte and return continue. if (inRange(bite, 0x81, 0xFE)) { Big5_lead = bite; return null; } // 6. Return error. return decoderError(fatal); }; } // 12.1.2 Big5 encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function Big5Encoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. Let pointer be the index Big5 pointer for code point. var pointer = indexBig5PointerFor(code_point); // 4. If pointer is null, return error with code point. if (pointer === null) return encoderError(code_point); // 5. Let lead be floor(pointer / 157) + 0x81. var lead = floor(pointer / 157) + 0x81; // 6. If lead is less than 0xA1, return error with code point. if (lead < 0xA1) return encoderError(code_point); // 7. Let trail be pointer % 157. var trail = pointer % 157; // 8. Let offset be 0x40 if trail is less than 0x3F and 0x62 // otherwise. var offset = trail < 0x3F ? 0x40 : 0x62; // Return two bytes whose values are lead and trail + offset. return [lead, trail + offset]; }; } /** @param {{fatal: boolean}} options */ encoders['Big5'] = function(options) { return new Big5Encoder(options); }; /** @param {{fatal: boolean}} options */ decoders['Big5'] = function(options) { return new Big5Decoder(options); }; // // 13. Legacy multi-byte Japanese encodings // // 13.1 euc-jp // 13.1.1 euc-jp decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function EUCJPDecoder(options) { var fatal = options.fatal; // euc-jp's decoder has an associated euc-jp jis0212 flag // (initially unset) and euc-jp lead (initially 0x00). var /** @type {boolean} */ eucjp_jis0212_flag = false, /** @type {number} */ eucjp_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and euc-jp lead is not 0x00, set // euc-jp lead to 0x00, and return error. if (bite === end_of_stream && eucjp_lead !== 0x00) { eucjp_lead = 0x00; return decoderError(fatal); } // 2. If byte is end-of-stream and euc-jp lead is 0x00, return // finished. if (bite === end_of_stream && eucjp_lead === 0x00) return finished; // 3. If euc-jp lead is 0x8E and byte is in the range 0xA1 to // 0xDF, inclusive, set euc-jp lead to 0x00 and return a code // point whose value is 0xFF61 − 0xA1 + byte. if (eucjp_lead === 0x8E && inRange(bite, 0xA1, 0xDF)) { eucjp_lead = 0x00; return 0xFF61 - 0xA1 + bite; } // 4. If euc-jp lead is 0x8F and byte is in the range 0xA1 to // 0xFE, inclusive, set the euc-jp jis0212 flag, set euc-jp lead // to byte, and return continue. if (eucjp_lead === 0x8F && inRange(bite, 0xA1, 0xFE)) { eucjp_jis0212_flag = true; eucjp_lead = bite; return null; } // 5. If euc-jp lead is not 0x00, let lead be euc-jp lead, set // euc-jp lead to 0x00, and run these substeps: if (eucjp_lead !== 0x00) { var lead = eucjp_lead; eucjp_lead = 0x00; // 1. Let code point be null. var code_point = null; // 2. If lead and byte are both in the range 0xA1 to 0xFE, // inclusive, set code point to the index code point for (lead // − 0xA1) × 94 + byte − 0xA1 in index jis0208 if the euc-jp // jis0212 flag is unset and in index jis0212 otherwise. if (inRange(lead, 0xA1, 0xFE) && inRange(bite, 0xA1, 0xFE)) { code_point = indexCodePointFor( (lead - 0xA1) * 94 + (bite - 0xA1), index(!eucjp_jis0212_flag ? 'jis0208' : 'jis0212')); } // 3. Unset the euc-jp jis0212 flag. eucjp_jis0212_flag = false; // 4. If byte is not in the range 0xA1 to 0xFE, inclusive, // prepend byte to stream. if (!inRange(bite, 0xA1, 0xFE)) stream.prepend(bite); // 5. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 6. Return a code point whose value is code point. return code_point; } // 6. If byte is an ASCII byte, return a code point whose value // is byte. if (isASCIIByte(bite)) return bite; // 7. If byte is 0x8E, 0x8F, or in the range 0xA1 to 0xFE, // inclusive, set euc-jp lead to byte and return continue. if (bite === 0x8E || bite === 0x8F || inRange(bite, 0xA1, 0xFE)) { eucjp_lead = bite; return null; } // 8. Return error. return decoderError(fatal); }; } // 13.1.2 euc-jp encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function EUCJPEncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. If code point is U+00A5, return byte 0x5C. if (code_point === 0x00A5) return 0x5C; // 4. If code point is U+203E, return byte 0x7E. if (code_point === 0x203E) return 0x7E; // 5. If code point is in the range U+FF61 to U+FF9F, inclusive, // return two bytes whose values are 0x8E and code point − // 0xFF61 + 0xA1. if (inRange(code_point, 0xFF61, 0xFF9F)) return [0x8E, code_point - 0xFF61 + 0xA1]; // 6. If code point is U+2212, set it to U+FF0D. if (code_point === 0x2212) code_point = 0xFF0D; // 7. Let pointer be the index pointer for code point in index // jis0208. var pointer = indexPointerFor(code_point, index('jis0208')); // 8. If pointer is null, return error with code point. if (pointer === null) return encoderError(code_point); // 9. Let lead be floor(pointer / 94) + 0xA1. var lead = floor(pointer / 94) + 0xA1; // 10. Let trail be pointer % 94 + 0xA1. var trail = pointer % 94 + 0xA1; // 11. Return two bytes whose values are lead and trail. return [lead, trail]; }; } /** @param {{fatal: boolean}} options */ encoders['EUC-JP'] = function(options) { return new EUCJPEncoder(options); }; /** @param {{fatal: boolean}} options */ decoders['EUC-JP'] = function(options) { return new EUCJPDecoder(options); }; // 13.2 iso-2022-jp // 13.2.1 iso-2022-jp decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function ISO2022JPDecoder(options) { var fatal = options.fatal; /** @enum */ var states = { ASCII: 0, Roman: 1, Katakana: 2, LeadByte: 3, TrailByte: 4, EscapeStart: 5, Escape: 6 }; // iso-2022-jp's decoder has an associated iso-2022-jp decoder // state (initially ASCII), iso-2022-jp decoder output state // (initially ASCII), iso-2022-jp lead (initially 0x00), and // iso-2022-jp output flag (initially unset). var /** @type {number} */ iso2022jp_decoder_state = states.ASCII, /** @type {number} */ iso2022jp_decoder_output_state = states.ASCII, /** @type {number} */ iso2022jp_lead = 0x00, /** @type {boolean} */ iso2022jp_output_flag = false; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // switching on iso-2022-jp decoder state: switch (iso2022jp_decoder_state) { default: case states.ASCII: // ASCII // Based on byte: // 0x1B if (bite === 0x1B) { // Set iso-2022-jp decoder state to escape start and return // continue. iso2022jp_decoder_state = states.EscapeStart; return null; } // 0x00 to 0x7F, excluding 0x0E, 0x0F, and 0x1B if (inRange(bite, 0x00, 0x7F) && bite !== 0x0E && bite !== 0x0F && bite !== 0x1B) { // Unset the iso-2022-jp output flag and return a code point // whose value is byte. iso2022jp_output_flag = false; return bite; } // end-of-stream if (bite === end_of_stream) { // Return finished. return finished; } // Otherwise // Unset the iso-2022-jp output flag and return error. iso2022jp_output_flag = false; return decoderError(fatal); case states.Roman: // Roman // Based on byte: // 0x1B if (bite === 0x1B) { // Set iso-2022-jp decoder state to escape start and return // continue. iso2022jp_decoder_state = states.EscapeStart; return null; } // 0x5C if (bite === 0x5C) { // Unset the iso-2022-jp output flag and return code point // U+00A5. iso2022jp_output_flag = false; return 0x00A5; } // 0x7E if (bite === 0x7E) { // Unset the iso-2022-jp output flag and return code point // U+203E. iso2022jp_output_flag = false; return 0x203E; } // 0x00 to 0x7F, excluding 0x0E, 0x0F, 0x1B, 0x5C, and 0x7E if (inRange(bite, 0x00, 0x7F) && bite !== 0x0E && bite !== 0x0F && bite !== 0x1B && bite !== 0x5C && bite !== 0x7E) { // Unset the iso-2022-jp output flag and return a code point // whose value is byte. iso2022jp_output_flag = false; return bite; } // end-of-stream if (bite === end_of_stream) { // Return finished. return finished; } // Otherwise // Unset the iso-2022-jp output flag and return error. iso2022jp_output_flag = false; return decoderError(fatal); case states.Katakana: // Katakana // Based on byte: // 0x1B if (bite === 0x1B) { // Set iso-2022-jp decoder state to escape start and return // continue. iso2022jp_decoder_state = states.EscapeStart; return null; } // 0x21 to 0x5F if (inRange(bite, 0x21, 0x5F)) { // Unset the iso-2022-jp output flag and return a code point // whose value is 0xFF61 − 0x21 + byte. iso2022jp_output_flag = false; return 0xFF61 - 0x21 + bite; } // end-of-stream if (bite === end_of_stream) { // Return finished. return finished; } // Otherwise // Unset the iso-2022-jp output flag and return error. iso2022jp_output_flag = false; return decoderError(fatal); case states.LeadByte: // Lead byte // Based on byte: // 0x1B if (bite === 0x1B) { // Set iso-2022-jp decoder state to escape start and return // continue. iso2022jp_decoder_state = states.EscapeStart; return null; } // 0x21 to 0x7E if (inRange(bite, 0x21, 0x7E)) { // Unset the iso-2022-jp output flag, set iso-2022-jp lead // to byte, iso-2022-jp decoder state to trail byte, and // return continue. iso2022jp_output_flag = false; iso2022jp_lead = bite; iso2022jp_decoder_state = states.TrailByte; return null; } // end-of-stream if (bite === end_of_stream) { // Return finished. return finished; } // Otherwise // Unset the iso-2022-jp output flag and return error. iso2022jp_output_flag = false; return decoderError(fatal); case states.TrailByte: // Trail byte // Based on byte: // 0x1B if (bite === 0x1B) { // Set iso-2022-jp decoder state to escape start and return // continue. iso2022jp_decoder_state = states.EscapeStart; return decoderError(fatal); } // 0x21 to 0x7E if (inRange(bite, 0x21, 0x7E)) { // 1. Set the iso-2022-jp decoder state to lead byte. iso2022jp_decoder_state = states.LeadByte; // 2. Let pointer be (iso-2022-jp lead − 0x21) × 94 + byte − 0x21. var pointer = (iso2022jp_lead - 0x21) * 94 + bite - 0x21; // 3. Let code point be the index code point for pointer in // index jis0208. var code_point = indexCodePointFor(pointer, index('jis0208')); // 4. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 5. Return a code point whose value is code point. return code_point; } // end-of-stream if (bite === end_of_stream) { // Set the iso-2022-jp decoder state to lead byte, prepend // byte to stream, and return error. iso2022jp_decoder_state = states.LeadByte; stream.prepend(bite); return decoderError(fatal); } // Otherwise // Set iso-2022-jp decoder state to lead byte and return // error. iso2022jp_decoder_state = states.LeadByte; return decoderError(fatal); case states.EscapeStart: // Escape start // 1. If byte is either 0x24 or 0x28, set iso-2022-jp lead to // byte, iso-2022-jp decoder state to escape, and return // continue. if (bite === 0x24 || bite === 0x28) { iso2022jp_lead = bite; iso2022jp_decoder_state = states.Escape; return null; } // 2. Prepend byte to stream. stream.prepend(bite); // 3. Unset the iso-2022-jp output flag, set iso-2022-jp // decoder state to iso-2022-jp decoder output state, and // return error. iso2022jp_output_flag = false; iso2022jp_decoder_state = iso2022jp_decoder_output_state; return decoderError(fatal); case states.Escape: // Escape // 1. Let lead be iso-2022-jp lead and set iso-2022-jp lead to // 0x00. var lead = iso2022jp_lead; iso2022jp_lead = 0x00; // 2. Let state be null. var state = null; // 3. If lead is 0x28 and byte is 0x42, set state to ASCII. if (lead === 0x28 && bite === 0x42) state = states.ASCII; // 4. If lead is 0x28 and byte is 0x4A, set state to Roman. if (lead === 0x28 && bite === 0x4A) state = states.Roman; // 5. If lead is 0x28 and byte is 0x49, set state to Katakana. if (lead === 0x28 && bite === 0x49) state = states.Katakana; // 6. If lead is 0x24 and byte is either 0x40 or 0x42, set // state to lead byte. if (lead === 0x24 && (bite === 0x40 || bite === 0x42)) state = states.LeadByte; // 7. If state is non-null, run these substeps: if (state !== null) { // 1. Set iso-2022-jp decoder state and iso-2022-jp decoder // output state to states. iso2022jp_decoder_state = iso2022jp_decoder_state = state; // 2. Let output flag be the iso-2022-jp output flag. var output_flag = iso2022jp_output_flag; // 3. Set the iso-2022-jp output flag. iso2022jp_output_flag = true; // 4. Return continue, if output flag is unset, and error // otherwise. return !output_flag ? null : decoderError(fatal); } // 8. Prepend lead and byte to stream. stream.prepend([lead, bite]); // 9. Unset the iso-2022-jp output flag, set iso-2022-jp // decoder state to iso-2022-jp decoder output state and // return error. iso2022jp_output_flag = false; iso2022jp_decoder_state = iso2022jp_decoder_output_state; return decoderError(fatal); } }; } // 13.2.2 iso-2022-jp encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function ISO2022JPEncoder(options) { var fatal = options.fatal; // iso-2022-jp's encoder has an associated iso-2022-jp encoder // state which is one of ASCII, Roman, and jis0208 (initially // ASCII). /** @enum */ var states = { ASCII: 0, Roman: 1, jis0208: 2 }; var /** @type {number} */ iso2022jp_state = states.ASCII; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream and iso-2022-jp encoder // state is not ASCII, prepend code point to stream, set // iso-2022-jp encoder state to ASCII, and return three bytes // 0x1B 0x28 0x42. if (code_point === end_of_stream && iso2022jp_state !== states.ASCII) { stream.prepend(code_point); iso2022jp_state = states.ASCII; return [0x1B, 0x28, 0x42]; } // 2. If code point is end-of-stream and iso-2022-jp encoder // state is ASCII, return finished. if (code_point === end_of_stream && iso2022jp_state === states.ASCII) return finished; // 3. If ISO-2022-JP encoder state is ASCII or Roman, and code // point is U+000E, U+000F, or U+001B, return error with U+FFFD. if ((iso2022jp_state === states.ASCII || iso2022jp_state === states.Roman) && (code_point === 0x000E || code_point === 0x000F || code_point === 0x001B)) { return encoderError(0xFFFD); } // 4. If iso-2022-jp encoder state is ASCII and code point is an // ASCII code point, return a byte whose value is code point. if (iso2022jp_state === states.ASCII && isASCIICodePoint(code_point)) return code_point; // 5. If iso-2022-jp encoder state is Roman and code point is an // ASCII code point, excluding U+005C and U+007E, or is U+00A5 // or U+203E, run these substeps: if (iso2022jp_state === states.Roman && ((isASCIICodePoint(code_point) && code_point !== 0x005C && code_point !== 0x007E) || (code_point == 0x00A5 || code_point == 0x203E))) { // 1. If code point is an ASCII code point, return a byte // whose value is code point. if (isASCIICodePoint(code_point)) return code_point; // 2. If code point is U+00A5, return byte 0x5C. if (code_point === 0x00A5) return 0x5C; // 3. If code point is U+203E, return byte 0x7E. if (code_point === 0x203E) return 0x7E; } // 6. If code point is an ASCII code point, and iso-2022-jp // encoder state is not ASCII, prepend code point to stream, set // iso-2022-jp encoder state to ASCII, and return three bytes // 0x1B 0x28 0x42. if (isASCIICodePoint(code_point) && iso2022jp_state !== states.ASCII) { stream.prepend(code_point); iso2022jp_state = states.ASCII; return [0x1B, 0x28, 0x42]; } // 7. If code point is either U+00A5 or U+203E, and iso-2022-jp // encoder state is not Roman, prepend code point to stream, set // iso-2022-jp encoder state to Roman, and return three bytes // 0x1B 0x28 0x4A. if ((code_point === 0x00A5 || code_point === 0x203E) && iso2022jp_state !== states.Roman) { stream.prepend(code_point); iso2022jp_state = states.Roman; return [0x1B, 0x28, 0x4A]; } // 8. If code point is U+2212, set it to U+FF0D. if (code_point === 0x2212) code_point = 0xFF0D; // 9. Let pointer be the index pointer for code point in index // jis0208. var pointer = indexPointerFor(code_point, index('jis0208')); // 10. If pointer is null, return error with code point. if (pointer === null) return encoderError(code_point); // 11. If iso-2022-jp encoder state is not jis0208, prepend code // point to stream, set iso-2022-jp encoder state to jis0208, // and return three bytes 0x1B 0x24 0x42. if (iso2022jp_state !== states.jis0208) { stream.prepend(code_point); iso2022jp_state = states.jis0208; return [0x1B, 0x24, 0x42]; } // 12. Let lead be floor(pointer / 94) + 0x21. var lead = floor(pointer / 94) + 0x21; // 13. Let trail be pointer % 94 + 0x21. var trail = pointer % 94 + 0x21; // 14. Return two bytes whose values are lead and trail. return [lead, trail]; }; } /** @param {{fatal: boolean}} options */ encoders['ISO-2022-JP'] = function(options) { return new ISO2022JPEncoder(options); }; /** @param {{fatal: boolean}} options */ decoders['ISO-2022-JP'] = function(options) { return new ISO2022JPDecoder(options); }; // 13.3 Shift_JIS // 13.3.1 Shift_JIS decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function ShiftJISDecoder(options) { var fatal = options.fatal; // Shift_JIS's decoder has an associated Shift_JIS lead (initially // 0x00). var /** @type {number} */ Shift_JIS_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and Shift_JIS lead is not 0x00, // set Shift_JIS lead to 0x00 and return error. if (bite === end_of_stream && Shift_JIS_lead !== 0x00) { Shift_JIS_lead = 0x00; return decoderError(fatal); } // 2. If byte is end-of-stream and Shift_JIS lead is 0x00, // return finished. if (bite === end_of_stream && Shift_JIS_lead === 0x00) return finished; // 3. If Shift_JIS lead is not 0x00, let lead be Shift_JIS lead, // let pointer be null, set Shift_JIS lead to 0x00, and then run // these substeps: if (Shift_JIS_lead !== 0x00) { var lead = Shift_JIS_lead; var pointer = null; Shift_JIS_lead = 0x00; // 1. Let offset be 0x40, if byte is less than 0x7F, and 0x41 // otherwise. var offset = (bite < 0x7F) ? 0x40 : 0x41; // 2. Let lead offset be 0x81, if lead is less than 0xA0, and // 0xC1 otherwise. var lead_offset = (lead < 0xA0) ? 0x81 : 0xC1; // 3. If byte is in the range 0x40 to 0x7E, inclusive, or 0x80 // to 0xFC, inclusive, set pointer to (lead − lead offset) × // 188 + byte − offset. if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0x80, 0xFC)) pointer = (lead - lead_offset) * 188 + bite - offset; // 4. If pointer is in the range 8836 to 10715, inclusive, // return a code point whose value is 0xE000 − 8836 + pointer. if (inRange(pointer, 8836, 10715)) return 0xE000 - 8836 + pointer; // 5. Let code point be null, if pointer is null, and the // index code point for pointer in index jis0208 otherwise. var code_point = (pointer === null) ? null : indexCodePointFor(pointer, index('jis0208')); // 6. If code point is null and byte is an ASCII byte, prepend // byte to stream. if (code_point === null && isASCIIByte(bite)) stream.prepend(bite); // 7. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 8. Return a code point whose value is code point. return code_point; } // 4. If byte is an ASCII byte or 0x80, return a code point // whose value is byte. if (isASCIIByte(bite) || bite === 0x80) return bite; // 5. If byte is in the range 0xA1 to 0xDF, inclusive, return a // code point whose value is 0xFF61 − 0xA1 + byte. if (inRange(bite, 0xA1, 0xDF)) return 0xFF61 - 0xA1 + bite; // 6. If byte is in the range 0x81 to 0x9F, inclusive, or 0xE0 // to 0xFC, inclusive, set Shift_JIS lead to byte and return // continue. if (inRange(bite, 0x81, 0x9F) || inRange(bite, 0xE0, 0xFC)) { Shift_JIS_lead = bite; return null; } // 7. Return error. return decoderError(fatal); }; } // 13.3.2 Shift_JIS encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function ShiftJISEncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point or U+0080, return a // byte whose value is code point. if (isASCIICodePoint(code_point) || code_point === 0x0080) return code_point; // 3. If code point is U+00A5, return byte 0x5C. if (code_point === 0x00A5) return 0x5C; // 4. If code point is U+203E, return byte 0x7E. if (code_point === 0x203E) return 0x7E; // 5. If code point is in the range U+FF61 to U+FF9F, inclusive, // return a byte whose value is code point − 0xFF61 + 0xA1. if (inRange(code_point, 0xFF61, 0xFF9F)) return code_point - 0xFF61 + 0xA1; // 6. If code point is U+2212, set it to U+FF0D. if (code_point === 0x2212) code_point = 0xFF0D; // 7. Let pointer be the index Shift_JIS pointer for code point. var pointer = indexShiftJISPointerFor(code_point); // 8. If pointer is null, return error with code point. if (pointer === null) return encoderError(code_point); // 9. Let lead be floor(pointer / 188). var lead = floor(pointer / 188); // 10. Let lead offset be 0x81, if lead is less than 0x1F, and // 0xC1 otherwise. var lead_offset = (lead < 0x1F) ? 0x81 : 0xC1; // 11. Let trail be pointer % 188. var trail = pointer % 188; // 12. Let offset be 0x40, if trail is less than 0x3F, and 0x41 // otherwise. var offset = (trail < 0x3F) ? 0x40 : 0x41; // 13. Return two bytes whose values are lead + lead offset and // trail + offset. return [lead + lead_offset, trail + offset]; }; } /** @param {{fatal: boolean}} options */ encoders['Shift_JIS'] = function(options) { return new ShiftJISEncoder(options); }; /** @param {{fatal: boolean}} options */ decoders['Shift_JIS'] = function(options) { return new ShiftJISDecoder(options); }; // // 14. Legacy multi-byte Korean encodings // // 14.1 euc-kr // 14.1.1 euc-kr decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function EUCKRDecoder(options) { var fatal = options.fatal; // euc-kr's decoder has an associated euc-kr lead (initially 0x00). var /** @type {number} */ euckr_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and euc-kr lead is not 0x00, set // euc-kr lead to 0x00 and return error. if (bite === end_of_stream && euckr_lead !== 0) { euckr_lead = 0x00; return decoderError(fatal); } // 2. If byte is end-of-stream and euc-kr lead is 0x00, return // finished. if (bite === end_of_stream && euckr_lead === 0) return finished; // 3. If euc-kr lead is not 0x00, let lead be euc-kr lead, let // pointer be null, set euc-kr lead to 0x00, and then run these // substeps: if (euckr_lead !== 0x00) { var lead = euckr_lead; var pointer = null; euckr_lead = 0x00; // 1. If byte is in the range 0x41 to 0xFE, inclusive, set // pointer to (lead − 0x81) × 190 + (byte − 0x41). if (inRange(bite, 0x41, 0xFE)) pointer = (lead - 0x81) * 190 + (bite - 0x41); // 2. Let code point be null, if pointer is null, and the // index code point for pointer in index euc-kr otherwise. var code_point = (pointer === null) ? null : indexCodePointFor(pointer, index('euc-kr')); // 3. If code point is null and byte is an ASCII byte, prepend // byte to stream. if (pointer === null && isASCIIByte(bite)) stream.prepend(bite); // 4. If code point is null, return error. if (code_point === null) return decoderError(fatal); // 5. Return a code point whose value is code point. return code_point; } // 4. If byte is an ASCII byte, return a code point whose value // is byte. if (isASCIIByte(bite)) return bite; // 5. If byte is in the range 0x81 to 0xFE, inclusive, set // euc-kr lead to byte and return continue. if (inRange(bite, 0x81, 0xFE)) { euckr_lead = bite; return null; } // 6. Return error. return decoderError(fatal); }; } // 14.1.2 euc-kr encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function EUCKREncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. Let pointer be the index pointer for code point in index // euc-kr. var pointer = indexPointerFor(code_point, index('euc-kr')); // 4. If pointer is null, return error with code point. if (pointer === null) return encoderError(code_point); // 5. Let lead be floor(pointer / 190) + 0x81. var lead = floor(pointer / 190) + 0x81; // 6. Let trail be pointer % 190 + 0x41. var trail = (pointer % 190) + 0x41; // 7. Return two bytes whose values are lead and trail. return [lead, trail]; }; } /** @param {{fatal: boolean}} options */ encoders['EUC-KR'] = function(options) { return new EUCKREncoder(options); }; /** @param {{fatal: boolean}} options */ decoders['EUC-KR'] = function(options) { return new EUCKRDecoder(options); }; // // 15. Legacy miscellaneous encodings // // 15.1 replacement // Not needed - API throws RangeError // 15.2 Common infrastructure for utf-16be and utf-16le /** * @param {number} code_unit * @param {boolean} utf16be * @return {!Array.} bytes */ function convertCodeUnitToBytes(code_unit, utf16be) { // 1. Let byte1 be code unit >> 8. var byte1 = code_unit >> 8; // 2. Let byte2 be code unit & 0x00FF. var byte2 = code_unit & 0x00FF; // 3. Then return the bytes in order: // utf-16be flag is set: byte1, then byte2. if (utf16be) return [byte1, byte2]; // utf-16be flag is unset: byte2, then byte1. return [byte2, byte1]; } // 15.2.1 shared utf-16 decoder /** * @constructor * @implements {Decoder} * @param {boolean} utf16_be True if big-endian, false if little-endian. * @param {{fatal: boolean}} options */ function UTF16Decoder(utf16_be, options) { var fatal = options.fatal; var /** @type {?number} */ utf16_lead_byte = null, /** @type {?number} */ utf16_lead_surrogate = null; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream and either utf-16 lead byte or // utf-16 lead surrogate is not null, set utf-16 lead byte and // utf-16 lead surrogate to null, and return error. if (bite === end_of_stream && (utf16_lead_byte !== null || utf16_lead_surrogate !== null)) { return decoderError(fatal); } // 2. If byte is end-of-stream and utf-16 lead byte and utf-16 // lead surrogate are null, return finished. if (bite === end_of_stream && utf16_lead_byte === null && utf16_lead_surrogate === null) { return finished; } // 3. If utf-16 lead byte is null, set utf-16 lead byte to byte // and return continue. if (utf16_lead_byte === null) { utf16_lead_byte = bite; return null; } // 4. Let code unit be the result of: var code_unit; if (utf16_be) { // utf-16be decoder flag is set // (utf-16 lead byte << 8) + byte. code_unit = (utf16_lead_byte << 8) + bite; } else { // utf-16be decoder flag is unset // (byte << 8) + utf-16 lead byte. code_unit = (bite << 8) + utf16_lead_byte; } // Then set utf-16 lead byte to null. utf16_lead_byte = null; // 5. If utf-16 lead surrogate is not null, let lead surrogate // be utf-16 lead surrogate, set utf-16 lead surrogate to null, // and then run these substeps: if (utf16_lead_surrogate !== null) { var lead_surrogate = utf16_lead_surrogate; utf16_lead_surrogate = null; // 1. If code unit is in the range U+DC00 to U+DFFF, // inclusive, return a code point whose value is 0x10000 + // ((lead surrogate − 0xD800) << 10) + (code unit − 0xDC00). if (inRange(code_unit, 0xDC00, 0xDFFF)) { return 0x10000 + (lead_surrogate - 0xD800) * 0x400 + (code_unit - 0xDC00); } // 2. Prepend the sequence resulting of converting code unit // to bytes using utf-16be decoder flag to stream and return // error. stream.prepend(convertCodeUnitToBytes(code_unit, utf16_be)); return decoderError(fatal); } // 6. If code unit is in the range U+D800 to U+DBFF, inclusive, // set utf-16 lead surrogate to code unit and return continue. if (inRange(code_unit, 0xD800, 0xDBFF)) { utf16_lead_surrogate = code_unit; return null; } // 7. If code unit is in the range U+DC00 to U+DFFF, inclusive, // return error. if (inRange(code_unit, 0xDC00, 0xDFFF)) return decoderError(fatal); // 8. Return code point code unit. return code_unit; }; } // 15.2.2 shared utf-16 encoder /** * @constructor * @implements {Encoder} * @param {boolean} utf16_be True if big-endian, false if little-endian. * @param {{fatal: boolean}} options */ function UTF16Encoder(utf16_be, options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is in the range U+0000 to U+FFFF, inclusive, // return the sequence resulting of converting code point to // bytes using utf-16be encoder flag. if (inRange(code_point, 0x0000, 0xFFFF)) return convertCodeUnitToBytes(code_point, utf16_be); // 3. Let lead be ((code point − 0x10000) >> 10) + 0xD800, // converted to bytes using utf-16be encoder flag. var lead = convertCodeUnitToBytes( ((code_point - 0x10000) >> 10) + 0xD800, utf16_be); // 4. Let trail be ((code point − 0x10000) & 0x3FF) + 0xDC00, // converted to bytes using utf-16be encoder flag. var trail = convertCodeUnitToBytes( ((code_point - 0x10000) & 0x3FF) + 0xDC00, utf16_be); // 5. Return a byte sequence of lead followed by trail. return lead.concat(trail); }; } // 15.3 utf-16be // 15.3.1 utf-16be decoder /** @param {{fatal: boolean}} options */ encoders['UTF-16BE'] = function(options) { return new UTF16Encoder(true, options); }; // 15.3.2 utf-16be encoder /** @param {{fatal: boolean}} options */ decoders['UTF-16BE'] = function(options) { return new UTF16Decoder(true, options); }; // 15.4 utf-16le // 15.4.1 utf-16le decoder /** @param {{fatal: boolean}} options */ encoders['UTF-16LE'] = function(options) { return new UTF16Encoder(false, options); }; // 15.4.2 utf-16le encoder /** @param {{fatal: boolean}} options */ decoders['UTF-16LE'] = function(options) { return new UTF16Decoder(false, options); }; // 15.5 x-user-defined // 15.5.1 x-user-defined decoder /** * @constructor * @implements {Decoder} * @param {{fatal: boolean}} options */ function XUserDefinedDecoder(options) { var fatal = options.fatal; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.)} The next code point(s) * decoded, or null if not enough data exists in the input * stream to decode a complete code point. */ this.handler = function(stream, bite) { // 1. If byte is end-of-stream, return finished. if (bite === end_of_stream) return finished; // 2. If byte is an ASCII byte, return a code point whose value // is byte. if (isASCIIByte(bite)) return bite; // 3. Return a code point whose value is 0xF780 + byte − 0x80. return 0xF780 + bite - 0x80; }; } // 15.5.2 x-user-defined encoder /** * @constructor * @implements {Encoder} * @param {{fatal: boolean}} options */ function XUserDefinedEncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1.If code point is end-of-stream, return finished. if (code_point === end_of_stream) return finished; // 2. If code point is an ASCII code point, return a byte whose // value is code point. if (isASCIICodePoint(code_point)) return code_point; // 3. If code point is in the range U+F780 to U+F7FF, inclusive, // return a byte whose value is code point − 0xF780 + 0x80. if (inRange(code_point, 0xF780, 0xF7FF)) return code_point - 0xF780 + 0x80; // 4. Return error with code point. return encoderError(code_point); }; } /** @param {{fatal: boolean}} options */ encoders['x-user-defined'] = function(options) { return new XUserDefinedEncoder(options); }; /** @param {{fatal: boolean}} options */ decoders['x-user-defined'] = function(options) { return new XUserDefinedDecoder(options); }; if (!global['TextEncoder']) global['TextEncoder'] = TextEncoder; if (!global['TextDecoder']) global['TextDecoder'] = TextDecoder; if (typeof module !== "undefined" && module.exports) { module.exports = { TextEncoder: global['TextEncoder'], TextDecoder: global['TextDecoder'], EncodingIndexes: global["encoding-indexes"] }; } // For strict environments where `this` inside the global scope // is `undefined`, take a pure object instead }(this || {})); },{"./encoding-indexes.js":67}],69:[function(require,module,exports){ /*! diff v3.5.0 Software License Agreement (BSD License) Copyright (c) 2009-2015, Kevin Decker All rights reserved. Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Kevin Decker nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @license */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["JsDiff"] = factory(); else root["JsDiff"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.canonicalize = exports.convertChangesToXML = exports.convertChangesToDMP = exports.merge = exports.parsePatch = exports.applyPatches = exports.applyPatch = exports.createPatch = exports.createTwoFilesPatch = exports.structuredPatch = exports.diffArrays = exports.diffJson = exports.diffCss = exports.diffSentences = exports.diffTrimmedLines = exports.diffLines = exports.diffWordsWithSpace = exports.diffWords = exports.diffChars = exports.Diff = undefined; /*istanbul ignore end*/var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); /*istanbul ignore end*/var /*istanbul ignore start*/_character = __webpack_require__(2) /*istanbul ignore end*/; var /*istanbul ignore start*/_word = __webpack_require__(3) /*istanbul ignore end*/; var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/; var /*istanbul ignore start*/_sentence = __webpack_require__(6) /*istanbul ignore end*/; var /*istanbul ignore start*/_css = __webpack_require__(7) /*istanbul ignore end*/; var /*istanbul ignore start*/_json = __webpack_require__(8) /*istanbul ignore end*/; var /*istanbul ignore start*/_array = __webpack_require__(9) /*istanbul ignore end*/; var /*istanbul ignore start*/_apply = __webpack_require__(10) /*istanbul ignore end*/; var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/; var /*istanbul ignore start*/_merge = __webpack_require__(13) /*istanbul ignore end*/; var /*istanbul ignore start*/_create = __webpack_require__(14) /*istanbul ignore end*/; var /*istanbul ignore start*/_dmp = __webpack_require__(16) /*istanbul ignore end*/; var /*istanbul ignore start*/_xml = __webpack_require__(17) /*istanbul ignore end*/; /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /* See LICENSE file for terms of use */ /* * Text diff implementation. * * This library supports the following APIS: * JsDiff.diffChars: Character by character diff * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace * JsDiff.diffLines: Line based diff * * JsDiff.diffCss: Diff targeted at CSS content * * These methods are based on the implementation proposed in * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 */ exports. /*istanbul ignore end*/Diff = _base2['default']; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffChars = _character.diffChars; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWords = _word.diffWords; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = _word.diffWordsWithSpace; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffLines = _line.diffLines; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = _line.diffTrimmedLines; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffSentences = _sentence.diffSentences; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffCss = _css.diffCss; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffJson = _json.diffJson; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffArrays = _array.diffArrays; /*istanbul ignore start*/exports. /*istanbul ignore end*/structuredPatch = _create.structuredPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = _create.createTwoFilesPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = _create.createPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatch = _apply.applyPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = _apply.applyPatches; /*istanbul ignore start*/exports. /*istanbul ignore end*/parsePatch = _parse.parsePatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = _merge.merge; /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToDMP = _dmp.convertChangesToDMP; /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToXML = _xml.convertChangesToXML; /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = _json.canonicalize; /***/ }), /* 1 */ /***/ (function(module, exports) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports['default'] = /*istanbul ignore end*/Diff; function Diff() {} Diff.prototype = { /*istanbul ignore start*/ /*istanbul ignore end*/diff: function diff(oldString, newString) { /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var callback = options.callback; if (typeof options === 'function') { callback = options; options = {}; } this.options = options; var self = this; function done(value) { if (callback) { setTimeout(function () { callback(undefined, value); }, 0); return true; } else { return value; } } // Allow subclasses to massage the input prior to running oldString = this.castInput(oldString); newString = this.castInput(newString); oldString = this.removeEmpty(this.tokenize(oldString)); newString = this.removeEmpty(this.tokenize(newString)); var newLen = newString.length, oldLen = oldString.length; var editLength = 1; var maxEditLength = newLen + oldLen; var bestPath = [{ newPos: -1, components: [] }]; // Seed editLength = 0, i.e. the content starts with the same values var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { // Identity per the equality and tokenizer return done([{ value: this.join(newString), count: newString.length }]); } // Main worker method. checks all permutations of a given edit length for acceptance. function execEditLength() { for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; if (addPath) { // No one else is going to attempt to use this value, clear it bestPath[diagonalPath - 1] = undefined; } var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; if (!canAdd && !canRemove) { // If this path is a terminal then prune bestPath[diagonalPath] = undefined; continue; } // Select the diagonal that we want to branch from. We select the prior // path whose position in the new string is the farthest from the origin // and does not pass the bounds of the diff graph if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { basePath = clonePath(removePath); self.pushComponent(basePath.components, undefined, true); } else { basePath = addPath; // No need to clone, we've pulled it from the list basePath.newPos++; self.pushComponent(basePath.components, true, undefined); } _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); } else { // Otherwise track this path as a potential candidate and continue. bestPath[diagonalPath] = basePath; } } editLength++; } // Performs the length of edit iteration. Is a bit fugly as this has to support the // sync and async mode which is never fun. Loops over execEditLength until a value // is produced. if (callback) { (function exec() { setTimeout(function () { // This should not happen, but we want to be safe. /* istanbul ignore next */ if (editLength > maxEditLength) { return callback(); } if (!execEditLength()) { exec(); } }, 0); })(); } else { while (editLength <= maxEditLength) { var ret = execEditLength(); if (ret) { return ret; } } } }, /*istanbul ignore start*/ /*istanbul ignore end*/pushComponent: function pushComponent(components, added, removed) { var last = components[components.length - 1]; if (last && last.added === added && last.removed === removed) { // We need to clone here as the component clone operation is just // as shallow array clone components[components.length - 1] = { count: last.count + 1, added: added, removed: removed }; } else { components.push({ count: 1, added: added, removed: removed }); } }, /*istanbul ignore start*/ /*istanbul ignore end*/extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0; while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { newPos++; oldPos++; commonCount++; } if (commonCount) { basePath.components.push({ count: commonCount }); } basePath.newPos = newPos; return oldPos; }, /*istanbul ignore start*/ /*istanbul ignore end*/equals: function equals(left, right) { if (this.options.comparator) { return this.options.comparator(left, right); } else { return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); } }, /*istanbul ignore start*/ /*istanbul ignore end*/removeEmpty: function removeEmpty(array) { var ret = []; for (var i = 0; i < array.length; i++) { if (array[i]) { ret.push(array[i]); } } return ret; }, /*istanbul ignore start*/ /*istanbul ignore end*/castInput: function castInput(value) { return value; }, /*istanbul ignore start*/ /*istanbul ignore end*/tokenize: function tokenize(value) { return value.split(''); }, /*istanbul ignore start*/ /*istanbul ignore end*/join: function join(chars) { return chars.join(''); } }; function buildValues(diff, components, newString, oldString, useLongestToken) { var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; for (; componentPos < componentLen; componentPos++) { var component = components[componentPos]; if (!component.removed) { if (!component.added && useLongestToken) { var value = newString.slice(newPos, newPos + component.count); value = value.map(function (value, i) { var oldValue = oldString[oldPos + i]; return oldValue.length > value.length ? oldValue : value; }); component.value = diff.join(value); } else { component.value = diff.join(newString.slice(newPos, newPos + component.count)); } newPos += component.count; // Common case if (!component.added) { oldPos += component.count; } } else { component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); oldPos += component.count; // Reverse add and remove so removes are output first to match common convention // The diffing algorithm is tied to add then remove output and this is the simplest // route to get the desired output with minimal overhead. if (componentPos && components[componentPos - 1].added) { var tmp = components[componentPos - 1]; components[componentPos - 1] = components[componentPos]; components[componentPos] = tmp; } } } // Special case handle for when one terminal is ignored (i.e. whitespace). // For this case we merge the terminal into the prior string and drop the change. // This is only available for string mode. var lastComponent = components[componentLen - 1]; if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { components[componentLen - 2].value += lastComponent.value; components.pop(); } return components; } function clonePath(path) { return { newPos: path.newPos, components: path.components.slice(0) }; } /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.characterDiff = undefined; exports. /*istanbul ignore end*/diffChars = diffChars; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/var characterDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/characterDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); function diffChars(oldStr, newStr, options) { return characterDiff.diff(oldStr, newStr, options); } /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.wordDiff = undefined; exports. /*istanbul ignore end*/diffWords = diffWords; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = diffWordsWithSpace; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); /*istanbul ignore end*/var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/; /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/ // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode // // Ranges and exceptions: // Latin-1 Supplement, 0080–00FF // - U+00D7 × Multiplication sign // - U+00F7 ÷ Division sign // Latin Extended-A, 0100–017F // Latin Extended-B, 0180–024F // IPA Extensions, 0250–02AF // Spacing Modifier Letters, 02B0–02FF // - U+02C7 ˇ ˇ Caron // - U+02D8 ˘ ˘ Breve // - U+02D9 ˙ ˙ Dot Above // - U+02DA ˚ ˚ Ring Above // - U+02DB ˛ ˛ Ogonek // - U+02DC ˜ ˜ Small Tilde // - U+02DD ˝ ˝ Double Acute Accent // Latin Extended Additional, 1E00–1EFF var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; var reWhitespace = /\S/; var wordDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/wordDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); wordDiff.equals = function (left, right) { if (this.options.ignoreCase) { left = left.toLowerCase(); right = right.toLowerCase(); } return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); }; wordDiff.tokenize = function (value) { var tokens = value.split(/(\s+|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set. for (var i = 0; i < tokens.length - 1; i++) { // If we have an empty string in the next field and we have only word chars before and after, merge if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { tokens[i] += tokens[i + 2]; tokens.splice(i + 1, 2); i--; } } return tokens; }; function diffWords(oldStr, newStr, options) { options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(options, { ignoreWhitespace: true }); return wordDiff.diff(oldStr, newStr, options); } function diffWordsWithSpace(oldStr, newStr, options) { return wordDiff.diff(oldStr, newStr, options); } /***/ }), /* 4 */ /***/ (function(module, exports) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports. /*istanbul ignore end*/generateOptions = generateOptions; function generateOptions(options, defaults) { if (typeof options === 'function') { defaults.callback = options; } else if (options) { for (var name in options) { /* istanbul ignore else */ if (options.hasOwnProperty(name)) { defaults[name] = options[name]; } } } return defaults; } /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.lineDiff = undefined; exports. /*istanbul ignore end*/diffLines = diffLines; /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = diffTrimmedLines; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); /*istanbul ignore end*/var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/; /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/var lineDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/lineDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); lineDiff.tokenize = function (value) { var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line if (!linesAndNewlines[linesAndNewlines.length - 1]) { linesAndNewlines.pop(); } // Merge the content and line separators into single tokens for (var i = 0; i < linesAndNewlines.length; i++) { var line = linesAndNewlines[i]; if (i % 2 && !this.options.newlineIsToken) { retLines[retLines.length - 1] += line; } else { if (this.options.ignoreWhitespace) { line = line.trim(); } retLines.push(line); } } return retLines; }; function diffLines(oldStr, newStr, callback) { return lineDiff.diff(oldStr, newStr, callback); } function diffTrimmedLines(oldStr, newStr, callback) { var options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(callback, { ignoreWhitespace: true }); return lineDiff.diff(oldStr, newStr, options); } /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.sentenceDiff = undefined; exports. /*istanbul ignore end*/diffSentences = diffSentences; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/var sentenceDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/sentenceDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); sentenceDiff.tokenize = function (value) { return value.split(/(\S.+?[.!?])(?=\s+|$)/); }; function diffSentences(oldStr, newStr, callback) { return sentenceDiff.diff(oldStr, newStr, callback); } /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.cssDiff = undefined; exports. /*istanbul ignore end*/diffCss = diffCss; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/var cssDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/cssDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); cssDiff.tokenize = function (value) { return value.split(/([{}:;,]|\s+)/); }; function diffCss(oldStr, newStr, callback) { return cssDiff.diff(oldStr, newStr, callback); } /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.jsonDiff = undefined; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; exports. /*istanbul ignore end*/diffJson = diffJson; /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = canonicalize; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); /*istanbul ignore end*/var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/; /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/var objectPrototypeToString = Object.prototype.toString; var jsonDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/jsonDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: jsonDiff.useLongestToken = true; jsonDiff.tokenize = /*istanbul ignore start*/_line.lineDiff /*istanbul ignore end*/.tokenize; jsonDiff.castInput = function (value) { /*istanbul ignore start*/var _options = /*istanbul ignore end*/this.options, undefinedReplacement = _options.undefinedReplacement, _options$stringifyRep = _options.stringifyReplacer, stringifyReplacer = _options$stringifyRep === undefined ? function (k, v) /*istanbul ignore start*/{ return (/*istanbul ignore end*/typeof v === 'undefined' ? undefinedReplacement : v ); } : _options$stringifyRep; return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' '); }; jsonDiff.equals = function (left, right) { return (/*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1')) ); }; function diffJson(oldObj, newObj, options) { return jsonDiff.diff(oldObj, newObj, options); } // This function handles the presence of circular references by bailing out when encountering an // object that is already on the "stack" of items being processed. Accepts an optional replacer function canonicalize(obj, stack, replacementStack, replacer, key) { stack = stack || []; replacementStack = replacementStack || []; if (replacer) { obj = replacer(key, obj); } var i = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; for (i = 0; i < stack.length; i += 1) { if (stack[i] === obj) { return replacementStack[i]; } } var canonicalizedObj = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; if ('[object Array]' === objectPrototypeToString.call(obj)) { stack.push(obj); canonicalizedObj = new Array(obj.length); replacementStack.push(canonicalizedObj); for (i = 0; i < obj.length; i += 1) { canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key); } stack.pop(); replacementStack.pop(); return canonicalizedObj; } if (obj && obj.toJSON) { obj = obj.toJSON(); } if ( /*istanbul ignore start*/(typeof /*istanbul ignore end*/obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null) { stack.push(obj); canonicalizedObj = {}; replacementStack.push(canonicalizedObj); var sortedKeys = [], _key = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; for (_key in obj) { /* istanbul ignore else */ if (obj.hasOwnProperty(_key)) { sortedKeys.push(_key); } } sortedKeys.sort(); for (i = 0; i < sortedKeys.length; i += 1) { _key = sortedKeys[i]; canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); } stack.pop(); replacementStack.pop(); } else { canonicalizedObj = obj; } return canonicalizedObj; } /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports.arrayDiff = undefined; exports. /*istanbul ignore end*/diffArrays = diffArrays; var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/; /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/var arrayDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/(); arrayDiff.tokenize = function (value) { return value.slice(); }; arrayDiff.join = arrayDiff.removeEmpty = function (value) { return value; }; function diffArrays(oldArr, newArr, callback) { return arrayDiff.diff(oldArr, newArr, callback); } /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports. /*istanbul ignore end*/applyPatch = applyPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = applyPatches; var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/; var /*istanbul ignore start*/_distanceIterator = __webpack_require__(12) /*istanbul ignore end*/; /*istanbul ignore start*/var _distanceIterator2 = _interopRequireDefault(_distanceIterator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /*istanbul ignore end*/function applyPatch(source, uniDiff) { /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; if (typeof uniDiff === 'string') { uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff); } if (Array.isArray(uniDiff)) { if (uniDiff.length > 1) { throw new Error('applyPatch only works with a single input.'); } uniDiff = uniDiff[0]; } // Apply the diff to the input var lines = source.split(/\r\n|[\n\v\f\r\x85]/), delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], hunks = uniDiff.hunks, compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) /*istanbul ignore start*/{ return (/*istanbul ignore end*/line === patchContent ); }, errorCount = 0, fuzzFactor = options.fuzzFactor || 0, minLine = 0, offset = 0, removeEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/, addEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; /** * Checks if the hunk exactly fits on the provided location */ function hunkFits(hunk, toPos) { for (var j = 0; j < hunk.lines.length; j++) { var line = hunk.lines[j], operation = line.length > 0 ? line[0] : ' ', content = line.length > 0 ? line.substr(1) : line; if (operation === ' ' || operation === '-') { // Context sanity check if (!compareLine(toPos + 1, lines[toPos], operation, content)) { errorCount++; if (errorCount > fuzzFactor) { return false; } } toPos++; } } return true; } // Search best fit offsets for each hunk based on the previous ones for (var i = 0; i < hunks.length; i++) { var hunk = hunks[i], maxLine = lines.length - hunk.oldLines, localOffset = 0, toPos = offset + hunk.oldStart - 1; var iterator = /*istanbul ignore start*/(0, _distanceIterator2['default']) /*istanbul ignore end*/(toPos, minLine, maxLine); for (; localOffset !== undefined; localOffset = iterator()) { if (hunkFits(hunk, toPos + localOffset)) { hunk.offset = offset += localOffset; break; } } if (localOffset === undefined) { return false; } // Set lower text limit to end of the current hunk, so next ones don't try // to fit over already patched text minLine = hunk.offset + hunk.oldStart + hunk.oldLines; } // Apply patch hunks var diffOffset = 0; for (var _i = 0; _i < hunks.length; _i++) { var _hunk = hunks[_i], _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1; diffOffset += _hunk.newLines - _hunk.oldLines; if (_toPos < 0) { // Creating a new file _toPos = 0; } for (var j = 0; j < _hunk.lines.length; j++) { var line = _hunk.lines[j], operation = line.length > 0 ? line[0] : ' ', content = line.length > 0 ? line.substr(1) : line, delimiter = _hunk.linedelimiters[j]; if (operation === ' ') { _toPos++; } else if (operation === '-') { lines.splice(_toPos, 1); delimiters.splice(_toPos, 1); /* istanbul ignore else */ } else if (operation === '+') { lines.splice(_toPos, 0, content); delimiters.splice(_toPos, 0, delimiter); _toPos++; } else if (operation === '\\') { var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null; if (previousOperation === '+') { removeEOFNL = true; } else if (previousOperation === '-') { addEOFNL = true; } } } } // Handle EOFNL insertion/removal if (removeEOFNL) { while (!lines[lines.length - 1]) { lines.pop(); delimiters.pop(); } } else if (addEOFNL) { lines.push(''); delimiters.push('\n'); } for (var _k = 0; _k < lines.length - 1; _k++) { lines[_k] = lines[_k] + delimiters[_k]; } return lines.join(''); } // Wrapper that supports multiple file patches via callbacks. function applyPatches(uniDiff, options) { if (typeof uniDiff === 'string') { uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff); } var currentIndex = 0; function processIndex() { var index = uniDiff[currentIndex++]; if (!index) { return options.complete(); } options.loadFile(index, function (err, data) { if (err) { return options.complete(err); } var updatedContent = applyPatch(data, index, options); options.patched(index, updatedContent, function (err) { if (err) { return options.complete(err); } processIndex(); }); }); } processIndex(); } /***/ }), /* 11 */ /***/ (function(module, exports) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports. /*istanbul ignore end*/parsePatch = parsePatch; function parsePatch(uniDiff) { /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], list = [], i = 0; function parseIndex() { var index = {}; list.push(index); // Parse diff metadata while (i < diffstr.length) { var line = diffstr[i]; // File header found, end parsing diff metadata if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { break; } // Diff index var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); if (header) { index.index = header[1]; } i++; } // Parse file headers if they are defined. Unified diff requires them, but // there's no technical issues to have an isolated hunk without file header parseFileHeader(index); parseFileHeader(index); // Parse hunks index.hunks = []; while (i < diffstr.length) { var _line = diffstr[i]; if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { break; } else if (/^@@/.test(_line)) { index.hunks.push(parseHunk()); } else if (_line && options.strict) { // Ignore unexpected content unless in strict mode throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); } else { i++; } } } // Parses the --- and +++ headers, if none are found, no lines // are consumed. function parseFileHeader(index) { var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]); if (fileHeader) { var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; var data = fileHeader[2].split('\t', 2); var fileName = data[0].replace(/\\\\/g, '\\'); if (/^".*"$/.test(fileName)) { fileName = fileName.substr(1, fileName.length - 2); } index[keyPrefix + 'FileName'] = fileName; index[keyPrefix + 'Header'] = (data[1] || '').trim(); i++; } } // Parses a hunk // This assumes that we are at the start of a hunk. function parseHunk() { var chunkHeaderIndex = i, chunkHeaderLine = diffstr[i++], chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); var hunk = { oldStart: +chunkHeader[1], oldLines: +chunkHeader[2] || 1, newStart: +chunkHeader[3], newLines: +chunkHeader[4] || 1, lines: [], linedelimiters: [] }; var addCount = 0, removeCount = 0; for (; i < diffstr.length; i++) { // Lines starting with '---' could be mistaken for the "remove line" operation // But they could be the header for the next file. Therefore prune such cases out. if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) { break; } var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0]; if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { hunk.lines.push(diffstr[i]); hunk.linedelimiters.push(delimiters[i] || '\n'); if (operation === '+') { addCount++; } else if (operation === '-') { removeCount++; } else if (operation === ' ') { addCount++; removeCount++; } } else { break; } } // Handle the empty block count case if (!addCount && hunk.newLines === 1) { hunk.newLines = 0; } if (!removeCount && hunk.oldLines === 1) { hunk.oldLines = 0; } // Perform optional sanity checking if (options.strict) { if (addCount !== hunk.newLines) { throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); } if (removeCount !== hunk.oldLines) { throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); } } return hunk; } while (i < diffstr.length) { parseIndex(); } return list; } /***/ }), /* 12 */ /***/ (function(module, exports) { /*istanbul ignore start*/"use strict"; exports.__esModule = true; exports["default"] = /*istanbul ignore end*/function (start, minLine, maxLine) { var wantForward = true, backwardExhausted = false, forwardExhausted = false, localOffset = 1; return function iterator() { if (wantForward && !forwardExhausted) { if (backwardExhausted) { localOffset++; } else { wantForward = false; } // Check if trying to fit beyond text length, and if not, check it fits // after offset location (or desired location on first iteration) if (start + localOffset <= maxLine) { return localOffset; } forwardExhausted = true; } if (!backwardExhausted) { if (!forwardExhausted) { wantForward = true; } // Check if trying to fit before text beginning, and if not, check it fits // before offset location if (minLine <= start - localOffset) { return -localOffset++; } backwardExhausted = true; return iterator(); } // We tried to fit hunk before text beginning and beyond text length, then // hunk can't fit on the text. Return undefined }; }; /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports. /*istanbul ignore end*/calcLineCount = calcLineCount; /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = merge; var /*istanbul ignore start*/_create = __webpack_require__(14) /*istanbul ignore end*/; var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/; var /*istanbul ignore start*/_array = __webpack_require__(15) /*istanbul ignore end*/; /*istanbul ignore start*/function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } /*istanbul ignore end*/function calcLineCount(hunk) { /*istanbul ignore start*/var _calcOldNewLineCount = /*istanbul ignore end*/calcOldNewLineCount(hunk.lines), oldLines = _calcOldNewLineCount.oldLines, newLines = _calcOldNewLineCount.newLines; if (oldLines !== undefined) { hunk.oldLines = oldLines; } else { delete hunk.oldLines; } if (newLines !== undefined) { hunk.newLines = newLines; } else { delete hunk.newLines; } } function merge(mine, theirs, base) { mine = loadPatch(mine, base); theirs = loadPatch(theirs, base); var ret = {}; // For index we just let it pass through as it doesn't have any necessary meaning. // Leaving sanity checks on this to the API consumer that may know more about the // meaning in their own context. if (mine.index || theirs.index) { ret.index = mine.index || theirs.index; } if (mine.newFileName || theirs.newFileName) { if (!fileNameChanged(mine)) { // No header or no change in ours, use theirs (and ours if theirs does not exist) ret.oldFileName = theirs.oldFileName || mine.oldFileName; ret.newFileName = theirs.newFileName || mine.newFileName; ret.oldHeader = theirs.oldHeader || mine.oldHeader; ret.newHeader = theirs.newHeader || mine.newHeader; } else if (!fileNameChanged(theirs)) { // No header or no change in theirs, use ours ret.oldFileName = mine.oldFileName; ret.newFileName = mine.newFileName; ret.oldHeader = mine.oldHeader; ret.newHeader = mine.newHeader; } else { // Both changed... figure it out ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); } } ret.hunks = []; var mineIndex = 0, theirsIndex = 0, mineOffset = 0, theirsOffset = 0; while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { var mineCurrent = mine.hunks[mineIndex] || { oldStart: Infinity }, theirsCurrent = theirs.hunks[theirsIndex] || { oldStart: Infinity }; if (hunkBefore(mineCurrent, theirsCurrent)) { // This patch does not overlap with any of the others, yay. ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); mineIndex++; theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; } else if (hunkBefore(theirsCurrent, mineCurrent)) { // This patch does not overlap with any of the others, yay. ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); theirsIndex++; mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; } else { // Overlap, merge as best we can var mergedHunk = { oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), oldLines: 0, newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), newLines: 0, lines: [] }; mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); theirsIndex++; mineIndex++; ret.hunks.push(mergedHunk); } } return ret; } function loadPatch(param, base) { if (typeof param === 'string') { if (/^@@/m.test(param) || /^Index:/m.test(param)) { return (/*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(param)[0] ); } if (!base) { throw new Error('Must provide a base reference or pass in a patch'); } return (/*istanbul ignore start*/(0, _create.structuredPatch) /*istanbul ignore end*/(undefined, undefined, base, param) ); } return param; } function fileNameChanged(patch) { return patch.newFileName && patch.newFileName !== patch.oldFileName; } function selectField(index, mine, theirs) { if (mine === theirs) { return mine; } else { index.conflict = true; return { mine: mine, theirs: theirs }; } } function hunkBefore(test, check) { return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; } function cloneHunk(hunk, offset) { return { oldStart: hunk.oldStart, oldLines: hunk.oldLines, newStart: hunk.newStart + offset, newLines: hunk.newLines, lines: hunk.lines }; } function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { // This will generally result in a conflicted hunk, but there are cases where the context // is the only overlap where we can successfully merge the content here. var mine = { offset: mineOffset, lines: mineLines, index: 0 }, their = { offset: theirOffset, lines: theirLines, index: 0 }; // Handle any leading content insertLeading(hunk, mine, their); insertLeading(hunk, their, mine); // Now in the overlap content. Scan through and select the best changes from each. while (mine.index < mine.lines.length && their.index < their.lines.length) { var mineCurrent = mine.lines[mine.index], theirCurrent = their.lines[their.index]; if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) { // Both modified ... mutualChange(hunk, mine, their); } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') { /*istanbul ignore start*/var _hunk$lines; /*istanbul ignore end*/ // Mine inserted /*istanbul ignore start*/(_hunk$lines = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(mine))); } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') { /*istanbul ignore start*/var _hunk$lines2; /*istanbul ignore end*/ // Theirs inserted /*istanbul ignore start*/(_hunk$lines2 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(their))); } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') { // Mine removed or edited removal(hunk, mine, their); } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') { // Their removed or edited removal(hunk, their, mine, true); } else if (mineCurrent === theirCurrent) { // Context identity hunk.lines.push(mineCurrent); mine.index++; their.index++; } else { // Context mismatch conflict(hunk, collectChange(mine), collectChange(their)); } } // Now push anything that may be remaining insertTrailing(hunk, mine); insertTrailing(hunk, their); calcLineCount(hunk); } function mutualChange(hunk, mine, their) { var myChanges = collectChange(mine), theirChanges = collectChange(their); if (allRemoves(myChanges) && allRemoves(theirChanges)) { // Special case for remove changes that are supersets of one another if ( /*istanbul ignore start*/(0, _array.arrayStartsWith) /*istanbul ignore end*/(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { /*istanbul ignore start*/var _hunk$lines3; /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines3 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges)); return; } else if ( /*istanbul ignore start*/(0, _array.arrayStartsWith) /*istanbul ignore end*/(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { /*istanbul ignore start*/var _hunk$lines4; /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines4 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines4 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges)); return; } } else if ( /*istanbul ignore start*/(0, _array.arrayEqual) /*istanbul ignore end*/(myChanges, theirChanges)) { /*istanbul ignore start*/var _hunk$lines5; /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines5 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines5 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges)); return; } conflict(hunk, myChanges, theirChanges); } function removal(hunk, mine, their, swap) { var myChanges = collectChange(mine), theirChanges = collectContext(their, myChanges); if (theirChanges.merged) { /*istanbul ignore start*/var _hunk$lines6; /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines6 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines6 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges.merged)); } else { conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); } } function conflict(hunk, mine, their) { hunk.conflict = true; hunk.lines.push({ conflict: true, mine: mine, theirs: their }); } function insertLeading(hunk, insert, their) { while (insert.offset < their.offset && insert.index < insert.lines.length) { var line = insert.lines[insert.index++]; hunk.lines.push(line); insert.offset++; } } function insertTrailing(hunk, insert) { while (insert.index < insert.lines.length) { var line = insert.lines[insert.index++]; hunk.lines.push(line); } } function collectChange(state) { var ret = [], operation = state.lines[state.index][0]; while (state.index < state.lines.length) { var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one "atomic" modify change. if (operation === '-' && line[0] === '+') { operation = '+'; } if (operation === line[0]) { ret.push(line); state.index++; } else { break; } } return ret; } function collectContext(state, matchChanges) { var changes = [], merged = [], matchIndex = 0, contextChanges = false, conflicted = false; while (matchIndex < matchChanges.length && state.index < state.lines.length) { var change = state.lines[state.index], match = matchChanges[matchIndex]; // Once we've hit our add, then we are done if (match[0] === '+') { break; } contextChanges = contextChanges || change[0] !== ' '; merged.push(match); matchIndex++; // Consume any additions in the other block as a conflict to attempt // to pull in the remaining context after this if (change[0] === '+') { conflicted = true; while (change[0] === '+') { changes.push(change); change = state.lines[++state.index]; } } if (match.substr(1) === change.substr(1)) { changes.push(change); state.index++; } else { conflicted = true; } } if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) { conflicted = true; } if (conflicted) { return changes; } while (matchIndex < matchChanges.length) { merged.push(matchChanges[matchIndex++]); } return { merged: merged, changes: changes }; } function allRemoves(changes) { return changes.reduce(function (prev, change) { return prev && change[0] === '-'; }, true); } function skipRemoveSuperset(state, removeChanges, delta) { for (var i = 0; i < delta; i++) { var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); if (state.lines[state.index + i] !== ' ' + changeContent) { return false; } } state.index += delta; return true; } function calcOldNewLineCount(lines) { var oldLines = 0; var newLines = 0; lines.forEach(function (line) { if (typeof line !== 'string') { var myCount = calcOldNewLineCount(line.mine); var theirCount = calcOldNewLineCount(line.theirs); if (oldLines !== undefined) { if (myCount.oldLines === theirCount.oldLines) { oldLines += myCount.oldLines; } else { oldLines = undefined; } } if (newLines !== undefined) { if (myCount.newLines === theirCount.newLines) { newLines += myCount.newLines; } else { newLines = undefined; } } } else { if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) { newLines++; } if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) { oldLines++; } } }); return { oldLines: oldLines, newLines: newLines }; } /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports. /*istanbul ignore end*/structuredPatch = structuredPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = createTwoFilesPatch; /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = createPatch; var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/; /*istanbul ignore start*/function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } /*istanbul ignore end*/function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { if (!options) { options = {}; } if (typeof options.context === 'undefined') { options.context = 4; } var diff = /*istanbul ignore start*/(0, _line.diffLines) /*istanbul ignore end*/(oldStr, newStr, options); diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier function contextLines(lines) { return lines.map(function (entry) { return ' ' + entry; }); } var hunks = []; var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; /*istanbul ignore start*/var _loop = function _loop( /*istanbul ignore end*/i) { var current = diff[i], lines = current.lines || current.value.replace(/\n$/, '').split('\n'); current.lines = lines; if (current.added || current.removed) { /*istanbul ignore start*/var _curRange; /*istanbul ignore end*/ // If we have previous context, start with that if (!oldRangeStart) { var prev = diff[i - 1]; oldRangeStart = oldLine; newRangeStart = newLine; if (prev) { curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; oldRangeStart -= curRange.length; newRangeStart -= curRange.length; } } // Output our changes /*istanbul ignore start*/(_curRange = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/lines.map(function (entry) { return (current.added ? '+' : '-') + entry; }))); // Track the updated file position if (current.added) { newLine += lines.length; } else { oldLine += lines.length; } } else { // Identical context lines. Track line changes if (oldRangeStart) { // Close out any changes that have been output (or join overlapping) if (lines.length <= options.context * 2 && i < diff.length - 2) { /*istanbul ignore start*/var _curRange2; /*istanbul ignore end*/ // Overlapping /*istanbul ignore start*/(_curRange2 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines))); } else { /*istanbul ignore start*/var _curRange3; /*istanbul ignore end*/ // end the range and output var contextSize = Math.min(lines.length, options.context); /*istanbul ignore start*/(_curRange3 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines.slice(0, contextSize)))); var hunk = { oldStart: oldRangeStart, oldLines: oldLine - oldRangeStart + contextSize, newStart: newRangeStart, newLines: newLine - newRangeStart + contextSize, lines: curRange }; if (i >= diff.length - 2 && lines.length <= options.context) { // EOF is inside this hunk var oldEOFNewline = /\n$/.test(oldStr); var newEOFNewline = /\n$/.test(newStr); if (lines.length == 0 && !oldEOFNewline) { // special case: old has no eol and no trailing context; no-nl can end up before adds curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file'); } else if (!oldEOFNewline || !newEOFNewline) { curRange.push('\\ No newline at end of file'); } } hunks.push(hunk); oldRangeStart = 0; newRangeStart = 0; curRange = []; } } oldLine += lines.length; newLine += lines.length; } }; for (var i = 0; i < diff.length; i++) { /*istanbul ignore start*/_loop( /*istanbul ignore end*/i); } return { oldFileName: oldFileName, newFileName: newFileName, oldHeader: oldHeader, newHeader: newHeader, hunks: hunks }; } function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); var ret = []; if (oldFileName == newFileName) { ret.push('Index: ' + oldFileName); } ret.push('==================================================================='); ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); for (var i = 0; i < diff.hunks.length; i++) { var hunk = diff.hunks[i]; ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); ret.push.apply(ret, hunk.lines); } return ret.join('\n') + '\n'; } function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); } /***/ }), /* 15 */ /***/ (function(module, exports) { /*istanbul ignore start*/"use strict"; exports.__esModule = true; exports. /*istanbul ignore end*/arrayEqual = arrayEqual; /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayStartsWith = arrayStartsWith; function arrayEqual(a, b) { if (a.length !== b.length) { return false; } return arrayStartsWith(a, b); } function arrayStartsWith(array, start) { if (start.length > array.length) { return false; } for (var i = 0; i < start.length; i++) { if (start[i] !== array[i]) { return false; } } return true; } /***/ }), /* 16 */ /***/ (function(module, exports) { /*istanbul ignore start*/"use strict"; exports.__esModule = true; exports. /*istanbul ignore end*/convertChangesToDMP = convertChangesToDMP; // See: http://code.google.com/p/google-diff-match-patch/wiki/API function convertChangesToDMP(changes) { var ret = [], change = /*istanbul ignore start*/void 0 /*istanbul ignore end*/, operation = /*istanbul ignore start*/void 0 /*istanbul ignore end*/; for (var i = 0; i < changes.length; i++) { change = changes[i]; if (change.added) { operation = 1; } else if (change.removed) { operation = -1; } else { operation = 0; } ret.push([operation, change.value]); } return ret; } /***/ }), /* 17 */ /***/ (function(module, exports) { /*istanbul ignore start*/'use strict'; exports.__esModule = true; exports. /*istanbul ignore end*/convertChangesToXML = convertChangesToXML; function convertChangesToXML(changes) { var ret = []; for (var i = 0; i < changes.length; i++) { var change = changes[i]; if (change.added) { ret.push(''); } else if (change.removed) { ret.push(''); } ret.push(escapeHTML(change.value)); if (change.added) { ret.push(''); } else if (change.removed) { ret.push(''); } } return ret.join(''); } function escapeHTML(s) { var n = s; n = n.replace(/&/g, '&'); n = n.replace(//g, '>'); n = n.replace(/"/g, '"'); return n; } /***/ }) /******/ ]) }); ; },{}],70:[function(require,module,exports){ module.exports = Array.isArray || function (arr) { return Object.prototype.toString.call(arr) == '[object Array]'; }; },{}],71:[function(require,module,exports){ module.exports = extend; /* var obj = {a: 3, b: 5}; extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8} obj; // {a: 4, b: 5, c: 8} var obj = {a: 3, b: 5}; extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8} obj; // {a: 3, b: 5} var arr = [1, 2, 3]; var obj = {a: 3, b: 5}; extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]} arr.push(4); obj; // {a: 3, b: 5, c: [1, 2, 3, 4]} var arr = [1, 2, 3]; var obj = {a: 3, b: 5}; extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]} arr.push(4); obj; // {a: 3, b: 5, c: [1, 2, 3]} extend({a: 4, b: 5}); // {a: 4, b: 5} extend({a: 4, b: 5}, 3); {a: 4, b: 5} extend({a: 4, b: 5}, true); {a: 4, b: 5} extend('hello', {a: 4, b: 5}); // throws extend(3, {a: 4, b: 5}); // throws */ function extend(/* [deep], obj1, obj2, [objn] */) { var args = [].slice.call(arguments); var deep = false; if (typeof args[0] == 'boolean') { deep = args.shift(); } var result = args[0]; if (!result || (typeof result != 'object' && typeof result != 'function')) { throw new Error('extendee must be an object'); } var extenders = args.slice(1); var len = extenders.length; for (var i = 0; i < len; i++) { var extender = extenders[i]; for (var key in extender) { if (extender.hasOwnProperty(key)) { var value = extender[key]; if (deep && isCloneable(value)) { var base = Array.isArray(value) ? [] : {}; result[key] = extend(true, result.hasOwnProperty(key) ? result[key] : base, value); } else { result[key] = value; } } } } return result; } function isCloneable(obj) { return Array.isArray(obj) || {}.toString.call(obj) == '[object Object]'; } },{}],72:[function(require,module,exports){ (function (global){ /** * @license * Lodash * Copyright JS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ ;(function() { /** Used as a safe reference for `undefined` in pre-ES5 environments. */ var undefined; /** Used as the semantic version number. */ var VERSION = '4.17.11'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** Error message constants. */ var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', FUNC_ERROR_TEXT = 'Expected a function'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; /** Used as default options for `_.truncate`. */ var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = '...'; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /** Used to indicate the type of lazy iteratees. */ var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 1.7976931348623157e+308, NAN = 0 / 0; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; /** Used to associate wrap methods with their bit flags. */ var wrapFlags = [ ['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG] ]; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', asyncTag = '[object AsyncFunction]', boolTag = '[object Boolean]', dateTag = '[object Date]', domExcTag = '[object DOMException]', errorTag = '[object Error]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', mapTag = '[object Map]', numberTag = '[object Number]', nullTag = '[object Null]', objectTag = '[object Object]', promiseTag = '[object Promise]', proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]', undefinedTag = '[object Undefined]', weakMapTag = '[object WeakMap]', weakSetTag = '[object WeakSet]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to match empty string literals in compiled template source. */ var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; /** Used to match HTML entities and HTML characters. */ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); /** Used to match template delimiters. */ var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g, reTrimStart = /^\s+/, reTrimEnd = /\s+$/; /** Used to match wrap detail comments. */ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; /** Used to match words composed of alphanumeric characters. */ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Used to match * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). */ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** Used to match Latin Unicode letters (excluding mathematical operators). */ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; /** Used to ensure capturing order of template delimiters. */ var reNoMatch = /($^)/; /** Used to match unescaped characters in compiled string literals. */ var reUnescapedString = /['\n\r\u2028\u2029\\]/g; /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = '\\u2700-\\u27bf', rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', rsPunctuationRange = '\\u2000-\\u206f', rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', rsVarRange = '\\ufe0e\\ufe0f', rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; /** Used to compose unicode capture groups. */ var rsApos = "['\u2019]", rsAstral = '[' + rsAstralRange + ']', rsBreak = '[' + rsBreakRange + ']', rsCombo = '[' + rsComboRange + ']', rsDigits = '\\d+', rsDingbat = '[' + rsDingbatRange + ']', rsLower = '[' + rsLowerRange + ']', rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsUpper = '[' + rsUpperRange + ']', rsZWJ = '\\u200d'; /** Used to compose unicode regexes. */ var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match apostrophes. */ var reApos = RegExp(rsApos, 'g'); /** * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). */ var reComboMark = RegExp(rsCombo, 'g'); /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** Used to match complex or compound words. */ var reUnicodeWord = RegExp([ rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, rsUpper + '+' + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji ].join('|'), 'g'); /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); /** Used to detect strings that need a more robust regexp to match words. */ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; /** Used to assign default `context` object properties. */ var contextProps = [ 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' ]; /** Used to make template sourceURLs easier to identify. */ var templateCounter = -1; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** 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; /** Used to map Latin Unicode letters to basic Latin letters. */ var deburredLetters = { // Latin-1 Supplement block. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', '\xc7': 'C', '\xe7': 'c', '\xd0': 'D', '\xf0': 'd', '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', '\xd1': 'N', '\xf1': 'n', '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', '\xc6': 'Ae', '\xe6': 'ae', '\xde': 'Th', '\xfe': 'th', '\xdf': 'ss', // Latin Extended-A block. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', '\u0134': 'J', '\u0135': 'j', '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', '\u0163': 't', '\u0165': 't', '\u0167': 't', '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', '\u0174': 'W', '\u0175': 'w', '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', '\u0132': 'IJ', '\u0133': 'ij', '\u0152': 'Oe', '\u0153': 'oe', '\u0149': "'n", '\u017f': 's' }; /** Used to map characters to HTML entities. */ var htmlEscapes = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; /** Used to map HTML entities to characters. */ var htmlUnescapes = { '&': '&', '<': '<', '>': '>', '"': '"', ''': "'" }; /** Used to escape characters for inclusion in compiled string literals. */ var stringEscapes = { '\\': '\\', "'": "'", '\n': 'n', '\r': 'r', '\u2028': 'u2028', '\u2029': 'u2029' }; /** Built-in method references without a dependency on `root`. */ var freeParseFloat = parseFloat, freeParseInt = parseInt; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = 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 = typeof exports == 'object' && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; if (types) { return types; } // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); /* Node.js helper references. */ var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /*--------------------------------------------------------------------------*/ /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } /** * A specialized version of `baseAggregator` for arrays. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; setter(accumulator, value, iteratee(value), array); } return accumulator; } /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } /** * A specialized version of `_.forEachRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEachRight(array, iteratee) { var length = array == null ? 0 : array.length; while (length--) { if (iteratee(array[length], length, array) === false) { break; } } return array; } /** * A specialized version of `_.every` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. */ function arrayEvery(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (!predicate(array[index], index, array)) { return false; } } return true; } /** * A specialized version of `_.filter` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[resIndex++] = value; } } return result; } /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } /** * Appends the elements of `values` to `array`. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to append. * @returns {Array} Returns `array`. */ function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } /** * A specialized version of `_.reduceRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the last element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; } /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } /** * Gets the size of an ASCII `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ var asciiSize = baseProperty('length'); /** * Converts an ASCII `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function asciiToArray(string) { return string.split(''); } /** * Splits an ASCII `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function asciiWords(string) { return string.match(reAsciiWord) || []; } /** * The base implementation of methods like `_.findKey` and `_.findLastKey`, * without support for iteratee shorthands, which iterates over `collection` * using `eachFunc`. * * @private * @param {Array|Object} collection The collection to inspect. * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the found element or its key, else `undefined`. */ function baseFindKey(collection, predicate, eachFunc) { var result; eachFunc(collection, function(value, key, collection) { if (predicate(value, key, collection)) { result = key; return false; } }); return result; } /** * The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { return index; } } return -1; } /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } /** * This function is like `baseIndexOf` except that it accepts a comparator. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @param {Function} comparator The comparator invoked per element. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOfWith(array, value, fromIndex, comparator) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (comparator(array[index], value)) { return index; } } return -1; } /** * The base implementation of `_.isNaN` without support for number objects. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ function baseIsNaN(value) { return value !== value; } /** * The base implementation of `_.mean` and `_.meanBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the mean. */ function baseMean(array, iteratee) { var length = array == null ? 0 : array.length; return length ? (baseSum(array, iteratee) / length) : NAN; } /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.propertyOf` without support for deep paths. * * @private * @param {Object} object The object to query. * @returns {Function} Returns the new accessor function. */ function basePropertyOf(object) { return function(key) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.reduce` and `_.reduceRight`, without support * for iteratee shorthands, which iterates over `collection` using `eachFunc`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. * @param {boolean} initAccum Specify using the first or last element of * `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection) { accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); }); return accumulator; } /** * The base implementation of `_.sortBy` which uses `comparer` to define the * sort order of `array` and replaces criteria objects with their corresponding * values. * * @private * @param {Array} array The array to sort. * @param {Function} comparer The function to define sort order. * @returns {Array} Returns `array`. */ function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } /** * The base implementation of `_.sum` and `_.sumBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the sum. */ function baseSum(array, iteratee) { var result, index = -1, length = array.length; while (++index < length) { var current = iteratee(array[index]); if (current !== undefined) { result = result === undefined ? current : (result + current); } } return result; } /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } /** * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array * of key-value pairs for `object` corresponding to the property names of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the key-value pairs. */ function baseToPairs(object, props) { return arrayMap(props, function(key) { return [key, object[key]]; }); } /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } /** * The base implementation of `_.values` and `_.valuesIn` which creates an * array of `object` property values corresponding to the property names * of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { return arrayMap(props, function(key) { return object[key]; }); } /** * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function cacheHas(cache, key) { return cache.has(key); } /** * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the first unmatched string symbol. */ function charsStartIndex(strSymbols, chrSymbols) { var index = -1, length = strSymbols.length; while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the last unmatched string symbol. */ function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length; while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Gets the number of `placeholder` occurrences in `array`. * * @private * @param {Array} array The array to inspect. * @param {*} placeholder The placeholder to search for. * @returns {number} Returns the placeholder count. */ function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } /** * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A * letters to basic Latin letters. * * @private * @param {string} letter The matched letter to deburr. * @returns {string} Returns the deburred letter. */ var deburrLetter = basePropertyOf(deburredLetters); /** * Used by `_.escape` to convert characters to HTML entities. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ var escapeHtmlChar = basePropertyOf(htmlEscapes); /** * Used by `_.template` to escape characters for inclusion in compiled string literals. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ function escapeStringChar(chr) { return '\\' + stringEscapes[chr]; } /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function hasUnicode(string) { return reHasUnicode.test(string); } /** * Checks if `string` contains a word composed of Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a word is found, else `false`. */ function hasUnicodeWord(string) { return reHasUnicodeWord.test(string); } /** * Converts `iterator` to an array. * * @private * @param {Object} iterator The iterator to convert. * @returns {Array} Returns the converted array. */ function iteratorToArray(iterator) { var data, result = []; while (!(data = iterator.next()).done) { result.push(data.value); } return result; } /** * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { var index = -1, result = Array(map.size); map.forEach(function(value, key) { result[++index] = [key, value]; }); return result; } /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. * * @private * @param {Array} array The array to modify. * @param {*} placeholder The placeholder to replace. * @returns {Array} Returns the new array of placeholder indexes. */ function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; result[resIndex++] = index; } } return result; } /** * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the values. */ function setToArray(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = value; }); return result; } /** * Converts `set` to its value-value pairs. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the value-value pairs. */ function setToPairs(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = [value, value]; }); return result; } /** * A specialized version of `_.indexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } /** * A specialized version of `_.lastIndexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictLastIndexOf(array, value, fromIndex) { var index = fromIndex + 1; while (index--) { if (array[index] === value) { return index; } } return index; } /** * Gets the number of symbols in `string`. * * @private * @param {string} string The string to inspect. * @returns {number} Returns the string size. */ function stringSize(string) { return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); } /** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } /** * Used by `_.unescape` to convert HTML entities to characters. * * @private * @param {string} chr The matched character to unescape. * @returns {string} Returns the unescaped character. */ var unescapeHtmlChar = basePropertyOf(htmlUnescapes); /** * Gets the size of a Unicode `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ function unicodeSize(string) { var result = reUnicode.lastIndex = 0; while (reUnicode.test(string)) { ++result; } return result; } /** * Converts a Unicode `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function unicodeToArray(string) { return string.match(reUnicode) || []; } /** * Splits a Unicode `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function unicodeWords(string) { return string.match(reUnicodeWord) || []; } /*--------------------------------------------------------------------------*/ /** * Create a new pristine `lodash` function using the `context` object. * * @static * @memberOf _ * @since 1.1.0 * @category Util * @param {Object} [context=root] The context object. * @returns {Function} Returns a new `lodash` function. * @example * * _.mixin({ 'foo': _.constant('foo') }); * * var lodash = _.runInContext(); * lodash.mixin({ 'bar': lodash.constant('bar') }); * * _.isFunction(_.foo); * // => true * _.isFunction(_.bar); * // => false * * lodash.isFunction(lodash.foo); * // => false * lodash.isFunction(lodash.bar); * // => true * * // Create a suped-up `defer` in Node.js. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; */ var runInContext = (function runInContext(context) { context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); /** Built-in constructor references. */ var Array = context.Array, Date = context.Date, Error = context.Error, Function = context.Function, Math = context.Math, Object = context.Object, RegExp = context.RegExp, String = context.String, TypeError = context.TypeError; /** 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 = context['__core-js_shared__']; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to generate unique IDs. */ var idCounter = 0; /** 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 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** Used to restore the original `_` reference in `_.noConflict`. */ var oldDash = root._; /** 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 ? context.Buffer : undefined, Symbol = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, symIterator = Symbol ? Symbol.iterator : undefined, symToStringTag = Symbol ? Symbol.toStringTag : undefined; var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); /** Mocked built-ins. */ var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max, nativeMin = Math.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse; /* Built-in method references that are verified to be native. */ var DataView = getNative(context, 'DataView'), Map = getNative(context, 'Map'), Promise = getNative(context, 'Promise'), Set = getNative(context, 'Set'), WeakMap = getNative(context, 'WeakMap'), nativeCreate = getNative(Object, 'create'); /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; /** Used to lookup unminified function names. */ var realNames = {}; /** 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, symbolToString = symbolProto ? symbolProto.toString : undefined; /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object which wraps `value` to enable implicit method * chain sequences. Methods that operate on and return arrays, collections, * and functions can be chained together. Methods that retrieve a single value * or may return a primitive value will automatically end the chain sequence * and return the unwrapped value. Otherwise, the value must be unwrapped * with `_#value`. * * Explicit chain sequences, which must be unwrapped with `_#value`, may be * enabled using `_.chain`. * * The execution of chained methods is lazy, that is, it's deferred until * `_#value` is implicitly or explicitly called. * * Lazy evaluation allows several methods to support shortcut fusion. * Shortcut fusion is an optimization to merge iteratee calls; this avoids * the creation of intermediate arrays and can greatly reduce the number of * iteratee executions. Sections of a chain sequence qualify for shortcut * fusion if the section is applied to an array and iteratees accept only * one argument. The heuristic for whether a section qualifies for shortcut * fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. * * In addition to lodash methods, wrappers have `Array` and `String` methods. * * The wrapper `Array` methods are: * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` * * The wrapper `String` methods are: * `replace` and `split` * * The wrapper methods that support shortcut fusion are: * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` * * The chainable wrapper methods are: * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, * `zipObject`, `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, * `upperFirst`, `value`, and `words` * * @name _ * @constructor * @category Seq * @param {*} value The value to wrap in a `lodash` instance. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2, 3]); * * // Returns an unwrapped value. * wrapped.reduce(_.add); * // => 6 * * // Returns a wrapped value. * var squares = wrapped.map(square); * * _.isArray(squares); * // => false * * _.isArray(squares.value()); * // => true */ function lodash(value) { if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty.call(value, '__wrapped__')) { return wrapperClone(value); } } return new LodashWrapper(value); } /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); /** * The function whose prototype chain sequence wrappers inherit from. * * @private */ function baseLodash() { // No operation performed. } /** * The base constructor for creating `lodash` wrapper objects. * * @private * @param {*} value The value to wrap. * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined; } /** * By default, the template delimiters used by lodash are like those in * embedded Ruby (ERB) as well as ES2015 template strings. Change the * following template settings to use alternative delimiters. * * @static * @memberOf _ * @type {Object} */ lodash.templateSettings = { /** * Used to detect `data` property values to be HTML-escaped. * * @memberOf _.templateSettings * @type {RegExp} */ 'escape': reEscape, /** * Used to detect code to be evaluated. * * @memberOf _.templateSettings * @type {RegExp} */ 'evaluate': reEvaluate, /** * Used to detect `data` property values to inject. * * @memberOf _.templateSettings * @type {RegExp} */ 'interpolate': reInterpolate, /** * Used to reference the data object in the template text. * * @memberOf _.templateSettings * @type {string} */ 'variable': '', /** * Used to import variables into the compiled template. * * @memberOf _.templateSettings * @type {Object} */ 'imports': { /** * A reference to the `lodash` function. * * @memberOf _.templateSettings.imports * @type {Function} */ '_': lodash } }; // Ensure wrappers are instances of `baseLodash`. lodash.prototype = baseLodash.prototype; lodash.prototype.constructor = lodash; LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; /*------------------------------------------------------------------------*/ /** * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private * @constructor * @param {*} value The value to wrap. */ function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } /** * Creates a clone of the lazy wrapper object. * * @private * @name clone * @memberOf LazyWrapper * @returns {Object} Returns the cloned `LazyWrapper` object. */ function lazyClone() { var result = new LazyWrapper(this.__wrapped__); result.__actions__ = copyArray(this.__actions__); result.__dir__ = this.__dir__; result.__filtered__ = this.__filtered__; result.__iteratees__ = copyArray(this.__iteratees__); result.__takeCount__ = this.__takeCount__; result.__views__ = copyArray(this.__views__); return result; } /** * Reverses the direction of lazy iteration. * * @private * @name reverse * @memberOf LazyWrapper * @returns {Object} Returns the new reversed `LazyWrapper` object. */ function lazyReverse() { if (this.__filtered__) { var result = new LazyWrapper(this); result.__dir__ = -1; result.__filtered__ = true; } else { result = this.clone(); result.__dir__ *= -1; } return result; } /** * Extracts the unwrapped value from its lazy wrapper. * * @private * @name value * @memberOf LazyWrapper * @returns {*} Returns the unwrapped value. */ function lazyValue() { var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : (start - 1), iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); if (!isArr || (!isRight && arrLength == length && takeCount == length)) { return baseWrapperValue(array, this.__actions__); } var result = []; outer: while (length-- && resIndex < takeCount) { index += dir; var iterIndex = -1, value = array[index]; while (++iterIndex < iterLength) { var data = iteratees[iterIndex], iteratee = data.iteratee, type = data.type, computed = iteratee(value); if (type == LAZY_MAP_FLAG) { value = computed; } else if (!computed) { if (type == LAZY_FILTER_FLAG) { continue outer; } else { break outer; } } } result[resIndex++] = value; } return result; } // Ensure `LazyWrapper` is an instance of `baseLodash`. LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; /*------------------------------------------------------------------------*/ /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(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; } /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; /*------------------------------------------------------------------------*/ /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(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); } --this.size; return true; } /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; /*------------------------------------------------------------------------*/ /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; /*------------------------------------------------------------------------*/ /** * * Creates an array cache object to store unique values. * * @private * @constructor * @param {Array} [values] The values to cache. */ function SetCache(values) { var index = -1, length = values == null ? 0 : values.length; this.__data__ = new MapCache; while (++index < length) { this.add(values[index]); } } /** * Adds `value` to the array cache. * * @private * @name add * @memberOf SetCache * @alias push * @param {*} value The value to cache. * @returns {Object} Returns the cache instance. */ function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED); return this; } /** * Checks if `value` is in the array cache. * * @private * @name has * @memberOf SetCache * @param {*} value The value to search for. * @returns {number} Returns `true` if `value` is found, else `false`. */ function setCacheHas(value) { return this.__data__.has(value); } // Add methods to `SetCache`. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; /*------------------------------------------------------------------------*/ /** * Creates a stack cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new ListCache; this.size = 0; } /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { var data = this.__data__, result = data['delete'](key); this.size = data.size; return result; } /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } // Add methods to `Stack`. Stack.prototype.clear = stackClear; Stack.prototype['delete'] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; /*------------------------------------------------------------------------*/ /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode. key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == 'offset' || key == 'parent')) || // PhantomJS 2 has enumerable non-index properties on typed arrays. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. isIndex(key, length) ))) { result.push(key); } } return result; } /** * A specialized version of `_.sample` for arrays. * * @private * @param {Array} array The array to sample. * @returns {*} Returns the random element. */ function arraySample(array) { var length = array.length; return length ? array[baseRandom(0, length - 1)] : undefined; } /** * A specialized version of `_.sampleSize` for arrays. * * @private * @param {Array} array The array to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function arraySampleSize(array, n) { return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); } /** * A specialized version of `_.shuffle` for arrays. * * @private * @param {Array} array The array to shuffle. * @returns {Array} Returns the new shuffled array. */ function arrayShuffle(array) { return shuffleSelf(copyArray(array)); } /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } /** * Aggregates elements of `collection` on `accumulator` with keys transformed * by `iteratee` and values set by `setter`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function baseAggregator(collection, setter, iteratee, accumulator) { baseEach(collection, function(value, key, collection) { setter(accumulator, value, iteratee(value), collection); }); return accumulator; } /** * The base implementation of `_.assign` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } /** * The base implementation of `_.assignIn` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } /** * The base implementation of `_.at` without support for individual paths. * * @private * @param {Object} object The object to iterate over. * @param {string[]} paths The property paths to pick. * @returns {Array} Returns the picked elements. */ function baseAt(object, paths) { var index = -1, length = paths.length, result = Array(length), skip = object == null; while (++index < length) { result[index] = skip ? undefined : get(object, paths[index]); } return result; } /** * The base implementation of `_.clamp` which doesn't coerce arguments. * * @private * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. */ function baseClamp(number, lower, upper) { if (number === number) { if (upper !== undefined) { number = number <= upper ? number : upper; } if (lower !== undefined) { number = number >= lower ? number : lower; } } return number; } /** * The base implementation of `_.clone` and `_.cloneDeep` which tracks * traversed objects. * * @private * @param {*} value The value to clone. * @param {boolean} bitmask The bitmask flags. * 1 - Deep clone * 2 - Flatten inherited properties * 4 - Clone symbols * @param {Function} [customizer] The function to customize cloning. * @param {string} [key] The key of `value`. * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. */ function baseClone(value, bitmask, customizer, key, object, stack) { var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; 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)) { result = (isFlat || isFunc) ? {} : initCloneObject(value); if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result = initCloneByTag(value, tag, isDeep); } } // Check for circular references and return its corresponding clone. stack || (stack = new Stack); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result); if (isSet(value)) { value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); return result; } if (isMap(value)) { value.forEach(function(subValue, key) { result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } var keysFunc = isFull ? (isFlat ? getAllKeysIn : getAllKeys) : (isFlat ? keysIn : keys); var props = isArr ? undefined : keysFunc(value); arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; subValue = value[key]; } // Recursively populate clone (susceptible to call stack limits). assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } /** * The base implementation of `_.conforms` which doesn't clone `source`. * * @private * @param {Object} source The object of property predicates to conform to. * @returns {Function} Returns the new spec function. */ function baseConforms(source) { var props = keys(source); return function(object) { return baseConformsTo(object, source, props); }; } /** * The base implementation of `_.conformsTo` which accepts `props` to check. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. */ function baseConformsTo(object, source, props) { var length = props.length; if (object == null) { return !length; } object = Object(object); while (length--) { var key = props[length], predicate = source[key], value = object[key]; if ((value === undefined && !(key in object)) || !predicate(value)) { return false; } } return true; } /** * The base implementation of `_.delay` and `_.defer` which accepts `args` * to provide to `func`. * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {Array} args The arguments to provide to `func`. * @returns {number|Object} Returns the timer id or timeout object. */ function baseDelay(func, wait, args) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return setTimeout(function() { func.apply(undefined, args); }, wait); } /** * The base implementation of methods like `_.difference` without support * for excluding multiple arrays or iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Array} values The values to exclude. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. */ function baseDifference(array, values, iteratee, comparator) { var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length; if (!length) { return result; } if (iteratee) { values = arrayMap(values, baseUnary(iteratee)); } if (comparator) { includes = arrayIncludesWith; isCommon = false; } else if (values.length >= LARGE_ARRAY_SIZE) { includes = cacheHas; isCommon = false; values = new SetCache(values); } outer: while (++index < length) { var value = array[index], computed = iteratee == null ? value : iteratee(value); value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var valuesIndex = valuesLength; while (valuesIndex--) { if (values[valuesIndex] === computed) { continue outer; } } result.push(value); } else if (!includes(values, computed, comparator)) { result.push(value); } } return result; } /** * The base implementation of `_.forEach` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEach = createBaseEach(baseForOwn); /** * The base implementation of `_.forEachRight` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEachRight = createBaseEach(baseForOwnRight, true); /** * The base implementation of `_.every` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false` */ function baseEvery(collection, predicate) { var result = true; baseEach(collection, function(value, index, collection) { result = !!predicate(value, index, collection); return result; }); return result; } /** * The base implementation of methods like `_.max` and `_.min` which accepts a * `comparator` to determine the extremum value. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The iteratee invoked per iteration. * @param {Function} comparator The comparator used to compare values. * @returns {*} Returns the extremum value. */ function baseExtremum(array, iteratee, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current = iteratee(value); if (current != null && (computed === undefined ? (current === current && !isSymbol(current)) : comparator(current, computed) )) { var computed = current, result = value; } } return result; } /** * The base implementation of `_.fill` without an iteratee call guard. * * @private * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. */ function baseFill(array, value, start, end) { var length = array.length; start = toInteger(start); if (start < 0) { start = -start > length ? 0 : (length + start); } end = (end === undefined || end > length) ? length : toInteger(end); if (end < 0) { end += length; } end = start > end ? 0 : toLength(end); while (start < end) { array[start++] = value; } return array; } /** * The base implementation of `_.filter` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { var result = []; baseEach(collection, function(value, index, collection) { if (predicate(value, index, collection)) { result.push(value); } }); return result; } /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); /** * This function is like `baseFor` except that it iterates over properties * in the opposite order. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseForRight = createBaseFor(true); /** * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { return object && baseFor(object, iteratee, keys); } /** * The base implementation of `_.forOwnRight` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwnRight(object, iteratee) { return object && baseForRight(object, iteratee, keys); } /** * The base implementation of `_.functions` which creates an array of * `object` function property names filtered from `props`. * * @private * @param {Object} object The object to inspect. * @param {Array} props The property names to filter. * @returns {Array} Returns the function names. */ function baseFunctions(object, props) { return arrayFilter(props, function(key) { return isFunction(object[key]); }); } /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses * `keysFunc` and `symbolsFunc` to get the enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @param {Function} keysFunc The function to get the keys of `object`. * @param {Function} symbolsFunc The function to get the symbols of `object`. * @returns {Array} Returns the array of property names and symbols. */ function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } /** * The base implementation of `_.gt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. */ function baseGt(value, other) { return value > other; } /** * The base implementation of `_.has` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } /** * The base implementation of `_.hasIn` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { return object != null && key in Object(object); } /** * The base implementation of `_.inRange` which doesn't coerce arguments. * * @private * @param {number} number The number to check. * @param {number} start The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. */ function baseInRange(number, start, end) { return number >= nativeMin(start, end) && number < nativeMax(start, end); } /** * The base implementation of methods like `_.intersection`, without support * for iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of shared values. */ function baseIntersection(arrays, iteratee, comparator) { var includes = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = []; while (othIndex--) { var array = arrays[othIndex]; if (othIndex && iteratee) { array = arrayMap(array, baseUnary(iteratee)); } maxLength = nativeMin(array.length, maxLength); caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) ? new SetCache(othIndex && array) : undefined; } array = arrays[0]; var index = -1, seen = caches[0]; outer: while (++index < length && result.length < maxLength) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator) )) { othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator)) ) { continue outer; } } if (seen) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.invert` and `_.invertBy` which inverts * `object` with values transformed by `iteratee` and set by `setter`. * * @private * @param {Object} object The object to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform values. * @param {Object} accumulator The initial inverted object. * @returns {Function} Returns `accumulator`. */ function baseInverter(object, setter, iteratee, accumulator) { baseForOwn(object, function(value, key, object) { setter(accumulator, iteratee(value), key, object); }); return accumulator; } /** * The base implementation of `_.invoke` without support for individual * method arguments. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {Array} args The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. */ function baseInvoke(object, path, args) { path = castPath(path, object); object = parent(object, path); var func = object == null ? object : object[toKey(last(path))]; return func == null ? undefined : apply(func, object, args); } /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } /** * The base implementation of `_.isArrayBuffer` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. */ function baseIsArrayBuffer(value) { return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; } /** * The base implementation of `_.isDate` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. */ function baseIsDate(value) { return isObjectLike(value) && baseGetTag(value) == dateTag; } /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {boolean} bitmask The bitmask flags. * 1 - Unordered comparison * 2 - Partial comparison * @param {Function} [customizer] The function to customize comparisons. * @param {Object} [stack] Tracks traversed `value` and `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } /** * A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } /** * The base implementation of `_.isMap` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ function baseIsMap(value) { return isObjectLike(value) && getTag(value) == mapTag; } /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Array} matchData The property names, values, and compare flags to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object(object); while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object) ) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var stack = new Stack; if (customizer) { var result = customizer(objValue, srcValue, key, object, source, stack); } if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result )) { return false; } } } return true; } /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * The base implementation of `_.isRegExp` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. */ function baseIsRegExp(value) { return isObjectLike(value) && baseGetTag(value) == regexpTag; } /** * The base implementation of `_.isSet` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ function baseIsSet(value) { return isObjectLike(value) && getTag(value) == setTag; } /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity; } if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(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; } /** * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } /** * The base implementation of `_.lt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. */ function baseLt(value, other) { return value < other; } /** * The base implementation of `_.map` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } /** * The base implementation of `_.matches` which doesn't clone `source`. * * @private * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); }; } /** * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path), srcValue); } return function(object) { var objValue = get(object, path); return (objValue === undefined && objValue === srcValue) ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key) { if (isObject(srcValue)) { stack || (stack = new Stack); baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } assignMergeValue(object, key, newValue); } /** * The base implementation of `_.nth` which doesn't coerce arguments. * * @private * @param {Array} array The array to query. * @param {number} n The index of the element to return. * @returns {*} Returns the nth element of `array`. */ function baseNth(array, n) { var length = array.length; if (!length) { return; } n += n < 0 ? length : 0; return isIndex(n, length) ? array[n] : undefined; } /** * The base implementation of `_.orderBy` without param guards. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. * @param {string[]} orders The sort orders of `iteratees`. * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { var index = -1; iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); return { 'criteria': criteria, 'index': ++index, 'value': value }; }); return baseSortBy(result, function(object, other) { return compareMultiple(object, other, orders); }); } /** * The base implementation of `_.pick` without support for individual * property identifiers. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @returns {Object} Returns the new object. */ function basePick(object, paths) { return basePickBy(object, paths, function(value, path) { return hasIn(object, path); }); } /** * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @param {Function} predicate The function invoked per property. * @returns {Object} Returns the new object. */ function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result = {}; while (++index < length) { var path = paths[index], value = baseGet(object, path); if (predicate(value, path)) { baseSet(result, castPath(path, object), value); } } return result; } /** * A specialized version of `baseProperty` which supports deep paths. * * @private * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function(object) { return baseGet(object, path); }; } /** * The base implementation of `_.pullAllBy` without support for iteratee * shorthands. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. */ function basePullAll(array, values, iteratee, comparator) { var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array; if (array === values) { values = copyArray(values); } if (iteratee) { seen = arrayMap(array, baseUnary(iteratee)); } while (++index < length) { var fromIndex = 0, value = values[index], computed = iteratee ? iteratee(value) : value; while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { splice.call(seen, fromIndex, 1); } splice.call(array, fromIndex, 1); } } return array; } /** * The base implementation of `_.pullAt` without support for individual * indexes or capturing the removed elements. * * @private * @param {Array} array The array to modify. * @param {number[]} indexes The indexes of elements to remove. * @returns {Array} Returns `array`. */ function basePullAt(array, indexes) { var length = array ? indexes.length : 0, lastIndex = length - 1; while (length--) { var index = indexes[length]; if (length == lastIndex || index !== previous) { var previous = index; if (isIndex(index)) { splice.call(array, index, 1); } else { baseUnset(array, index); } } } return array; } /** * The base implementation of `_.random` without support for returning * floating-point numbers. * * @private * @param {number} lower The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the random number. */ function baseRandom(lower, upper) { return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); } /** * The base implementation of `_.range` and `_.rangeRight` which doesn't * coerce arguments. * * @private * @param {number} start The start of the range. * @param {number} end The end of the range. * @param {number} step The value to increment or decrement by. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the range of numbers. */ function baseRange(start, end, step, fromRight) { var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length); while (length--) { result[fromRight ? length : ++index] = start; start += step; } return result; } /** * The base implementation of `_.repeat` which doesn't coerce arguments. * * @private * @param {string} string The string to repeat. * @param {number} n The number of times to repeat the string. * @returns {string} Returns the repeated string. */ function baseRepeat(string, n) { var result = ''; if (!string || n < 1 || n > MAX_SAFE_INTEGER) { return result; } // Leverage the exponentiation by squaring algorithm for a faster repeat. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. do { if (n % 2) { result += string; } n = nativeFloor(n / 2); if (n) { string += string; } } while (n); return result; } /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ''); } /** * The base implementation of `_.sample`. * * @private * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. */ function baseSample(collection) { return arraySample(values(collection)); } /** * The base implementation of `_.sampleSize` without param guards. * * @private * @param {Array|Object} collection The collection to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function baseSampleSize(collection, n) { var array = values(collection); return shuffleSelf(array, baseClamp(n, 0, array.length)); } /** * The base implementation of `_.set`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { if (!isObject(object)) { return object; } path = castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), newValue = value; if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { newValue = isObject(objValue) ? objValue : (isIndex(path[index + 1]) ? [] : {}); } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } /** * The base implementation of `setData` without support for hot loop shorting. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; }; /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), 'writable': true }); }; /** * The base implementation of `_.shuffle`. * * @private * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. */ function baseShuffle(collection) { return shuffleSelf(values(collection)); } /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function baseSlice(array, start, end) { var index = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : (length + start); } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } /** * The base implementation of `_.some` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function baseSome(collection, predicate) { var result; baseEach(collection, function(value, index, collection) { result = predicate(value, index, collection); return !result; }); return !!result; } /** * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which * performs a binary search of `array` to determine the index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndex(array, value, retHighest) { var low = 0, high = array == null ? low : array.length; if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { while (low < high) { var mid = (low + high) >>> 1, computed = array[mid]; if (computed !== null && !isSymbol(computed) && (retHighest ? (computed <= value) : (computed < value))) { low = mid + 1; } else { high = mid; } } return high; } return baseSortedIndexBy(array, value, identity, retHighest); } /** * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` * which invokes `iteratee` for `value` and each element of `array` to compute * their sort ranking. The iteratee is invoked with one argument; (value). * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} iteratee The iteratee invoked per element. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndexBy(array, value, iteratee, retHighest) { value = iteratee(value); var low = 0, high = array == null ? 0 : array.length, valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined; while (low < high) { var mid = nativeFloor((low + high) / 2), computed = iteratee(array[mid]), othIsDefined = computed !== undefined, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed); if (valIsNaN) { var setLow = retHighest || othIsReflexive; } else if (valIsUndefined) { setLow = othIsReflexive && (retHighest || othIsDefined); } else if (valIsNull) { setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); } else if (valIsSymbol) { setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); } else if (othIsNull || othIsSymbol) { setLow = false; } else { setLow = retHighest ? (computed <= value) : (computed < value); } if (setLow) { low = mid + 1; } else { high = mid; } } return nativeMin(high, MAX_ARRAY_INDEX); } /** * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseSortedUniq(array, iteratee) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; if (!index || !eq(computed, seen)) { var seen = computed; result[resIndex++] = value === 0 ? 0 : value; } } return result; } /** * The base implementation of `_.toNumber` which doesn't ensure correct * conversions of binary, hexadecimal, or octal string values. * * @private * @param {*} value The value to process. * @returns {number} Returns the number. */ function baseToNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } return +value; } /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray(value)) { // Recursively convert values (susceptible to call stack limits). return arrayMap(value, baseToString) + ''; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * The base implementation of `_.uniqBy` without support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseUniq(array, iteratee, comparator) { var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result; if (comparator) { isCommon = false; includes = arrayIncludesWith; } else if (length >= LARGE_ARRAY_SIZE) { var set = iteratee ? null : createSet(array); if (set) { return setToArray(set); } isCommon = false; includes = cacheHas; seen = new SetCache; } else { seen = iteratee ? [] : result; } outer: while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee) { seen.push(computed); } result.push(value); } else if (!includes(seen, computed, comparator)) { if (seen !== result) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.unset`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The property path to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ function baseUnset(object, path) { path = castPath(path, object); object = parent(object, path); return object == null || delete object[toKey(last(path))]; } /** * The base implementation of `_.update`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to update. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseUpdate(object, path, updater, customizer) { return baseSet(object, path, updater(baseGet(object, path)), customizer); } /** * The base implementation of methods like `_.dropWhile` and `_.takeWhile` * without support for iteratee shorthands. * * @private * @param {Array} array The array to query. * @param {Function} predicate The function invoked per iteration. * @param {boolean} [isDrop] Specify dropping elements instead of taking them. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the slice of `array`. */ function baseWhile(array, predicate, isDrop, fromRight) { var length = array.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); } /** * The base implementation of `wrapperValue` which returns the result of * performing a sequence of actions on the unwrapped `value`, where each * successive action is supplied the return value of the previous. * * @private * @param {*} value The unwrapped value. * @param {Array} actions Actions to perform to resolve the unwrapped value. * @returns {*} Returns the resolved value. */ function baseWrapperValue(value, actions) { var result = value; if (result instanceof LazyWrapper) { result = result.value(); } return arrayReduce(actions, function(result, action) { return action.func.apply(action.thisArg, arrayPush([result], action.args)); }, result); } /** * The base implementation of methods like `_.xor`, without support for * iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of values. */ function baseXor(arrays, iteratee, comparator) { var length = arrays.length; if (length < 2) { return length ? baseUniq(arrays[0]) : []; } var index = -1, result = Array(length); while (++index < length) { var array = arrays[index], othIndex = -1; while (++othIndex < length) { if (othIndex != index) { result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); } } } return baseUniq(baseFlatten(result, 1), iteratee, comparator); } /** * This base implementation of `_.zipObject` which assigns values using `assignFunc`. * * @private * @param {Array} props The property identifiers. * @param {Array} values The property values. * @param {Function} assignFunc The function to assign values. * @returns {Object} Returns the new object. */ function baseZipObject(props, values, assignFunc) { var index = -1, length = props.length, valsLength = values.length, result = {}; while (++index < length) { var value = index < valsLength ? values[index] : undefined; assignFunc(result, props[index], value); } return result; } /** * Casts `value` to an empty array if it's not an array like object. * * @private * @param {*} value The value to inspect. * @returns {Array|Object} Returns the cast array-like object. */ function castArrayLikeObject(value) { return isArrayLikeObject(value) ? value : []; } /** * Casts `value` to `identity` if it's not a function. * * @private * @param {*} value The value to inspect. * @returns {Function} Returns cast function. */ function castFunction(value) { return typeof value == 'function' ? value : identity; } /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } /** * A `baseRest` alias which can be replaced with `identity` by module * replacement plugins. * * @private * @type {Function} * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ var castRest = baseRest; /** * Casts `array` to a slice if it's needed. * * @private * @param {Array} array The array to inspect. * @param {number} start The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the cast slice. */ function castSlice(array, start, end) { var length = array.length; end = end === undefined ? length : end; return (!start && end >= length) ? array : baseSlice(array, start, end); } /** * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). * * @private * @param {number|Object} id The timer id or timeout object of the timer to clear. */ var clearTimeout = ctxClearTimeout || function(id) { return root.clearTimeout(id); }; /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } /** * Creates a clone of `dataView`. * * @private * @param {Object} dataView The data view to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned data view. */ function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } /** * Creates a clone of `regexp`. * * @private * @param {Object} regexp The regexp to clone. * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } /** * Creates a clone of the `symbol` object. * * @private * @param {Object} symbol The symbol object to clone. * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } /** * Compares values to sort them in ascending order. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {number} Returns the sort order indicator for `value`. */ function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || (valIsNull && othIsDefined && othIsReflexive) || (!valIsDefined && othIsReflexive) || !valIsReflexive) { return 1; } if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || (othIsNull && valIsDefined && valIsReflexive) || (!othIsDefined && valIsReflexive) || !othIsReflexive) { return -1; } } return 0; } /** * Used by `_.orderBy` to compare multiple properties of a value to another * and stable sort them. * * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, * specify an order of "desc" for descending or "asc" for ascending sort order * of corresponding values. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {boolean[]|string[]} orders The order to sort by for each property. * @returns {number} Returns the sort order indicator for `object`. */ function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result = compareAscending(objCriteria[index], othCriteria[index]); if (result) { if (index >= ordersLength) { return result; } var order = orders[index]; return result * (order == 'desc' ? -1 : 1); } } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications // that causes it, under certain circumstances, to provide the same value for // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 // for more details. // // This also ensures a stable sort in V8 and other engines. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } /** * Creates an array that is the composition of partially applied arguments, * placeholders, and provided arguments into a single array of arguments. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result[leftIndex++] = args[argsIndex++]; } return result; } /** * This function is like `composeArgs` except that the arguments composition * is tailored for `_.partialRight`. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[offset + holders[holdersIndex]] = args[argsIndex++]; } } return result; } /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } /** * Copies own symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } /** * Copies own and inherited symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn(source), object); } /** * Creates a function like `_.groupBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} [initializer] The accumulator object initializer. * @returns {Function} Returns the new aggregator function. */ function createAggregator(setter, initializer) { return function(collection, iteratee) { var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, getIteratee(iteratee, 2), accumulator); }; } /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } /** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } /** * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg`. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } /** * Creates a function like `_.lowerFirst`. * * @private * @param {string} methodName The name of the `String` case method to use. * @returns {Function} Returns the new case function. */ function createCaseFirst(methodName) { return function(string) { string = toString(string); var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined; var chr = strSymbols ? strSymbols[0] : string.charAt(0); var trailing = strSymbols ? castSlice(strSymbols, 1).join('') : string.slice(1); return chr[methodName]() + trailing; }; } /** * Creates a function like `_.camelCase`. * * @private * @param {Function} callback The function to combine each word. * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { return function(string) { return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); }; } /** * Creates a function that produces an instance of `Ctor` regardless of * whether it was invoked as part of a `new` expression or by `call` or `apply`. * * @private * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { case 0: return new Ctor; case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior. // See https://es5.github.io/#x13.2.2 for more details. return isObject(result) ? result : thisBinding; }; } /** * Creates a function that wraps `func` to enable currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createCurry(func, bitmask, arity) { var Ctor = createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; } var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) ? [] : replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); } var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return apply(fn, this, args); } return wrapper; } /** * Creates a `_.find` or `_.findLast` function. * * @private * @param {Function} findIndexFunc The function to find the collection index. * @returns {Function} Returns the new find function. */ function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); if (!isArrayLike(collection)) { var iteratee = getIteratee(predicate, 3); collection = keys(collection); predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } var index = findIndexFunc(collection, predicate, fromIndex); return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } /** * Creates a `_.flow` or `_.flowRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new flow function. */ function createFlow(fromRight) { return flatRest(function(funcs) { var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru; if (fromRight) { funcs.reverse(); } while (index--) { var func = funcs[index]; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (prereq && !wrapper && getFuncName(func) == 'wrapper') { var wrapper = new LodashWrapper([], true); } } index = wrapper ? index : length; while (++index < length) { func = funcs[index]; var funcName = getFuncName(func), data = funcName == 'wrapper' ? getData(func) : undefined; if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1 ) { wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); } else { wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); } } return function() { var args = arguments, value = args[0]; if (wrapper && args.length == 1 && isArray(value)) { return wrapper.plant(value).value(); } var index = 0, result = length ? funcs[index].apply(this, args) : value; while (++index < length) { result = funcs[index].call(this, result); } return result; }; }); } /** * Creates a function that wraps `func` to invoke it with optional `this` * binding of `thisArg`, partial application, and currying. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [partialsRight] The arguments to append to those provided * to the new function. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined : createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length ); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary < length) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { fn = Ctor || createCtor(fn); } return fn.apply(thisBinding, args); } return wrapper; } /** * Creates a function like `_.invertBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} toIteratee The function to resolve iteratees. * @returns {Function} Returns the new inverter function. */ function createInverter(setter, toIteratee) { return function(object, iteratee) { return baseInverter(object, setter, toIteratee(iteratee), {}); }; } /** * Creates a function that performs a mathematical operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @param {number} [defaultValue] The value used for `undefined` arguments. * @returns {Function} Returns the new mathematical operation function. */ function createMathOperation(operator, defaultValue) { return function(value, other) { var result; if (value === undefined && other === undefined) { return defaultValue; } if (value !== undefined) { result = value; } if (other !== undefined) { if (result === undefined) { return other; } if (typeof value == 'string' || typeof other == 'string') { value = baseToString(value); other = baseToString(other); } else { value = baseToNumber(value); other = baseToNumber(other); } result = operator(value, other); } return result; }; } /** * Creates a function like `_.over`. * * @private * @param {Function} arrayFunc The function to iterate over iteratees. * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { return flatRest(function(iteratees) { iteratees = arrayMap(iteratees, baseUnary(getIteratee())); return baseRest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { return apply(iteratee, thisArg, args); }); }); }); } /** * Creates the padding for `string` based on `length`. The `chars` string * is truncated if the number of characters exceeds `length`. * * @private * @param {number} length The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padding for `string`. */ function createPadding(length, chars) { chars = chars === undefined ? ' ' : baseToString(chars); var charsLength = chars.length; if (charsLength < 2) { return charsLength ? baseRepeat(chars, length) : chars; } var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join('') : result.slice(0, length); } /** * Creates a function that wraps `func` to invoke it with the `this` binding * of `thisArg` and `partials` prepended to the arguments it receives. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to * the new function. * @returns {Function} Returns the new wrapped function. */ function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return apply(fn, isBind ? thisArg : this, args); } return wrapper; } /** * Creates a `_.range` or `_.rangeRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new range function. */ function createRange(fromRight) { return function(start, end, step) { if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { end = step = undefined; } // Ensure the sign of `-0` is preserved. start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); return baseRange(start, end, step, fromRight); }; } /** * Creates a function that performs a relational operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @returns {Function} Returns the new relational operation function. */ function createRelationalOperation(operator) { return function(value, other) { if (!(typeof value == 'string' && typeof other == 'string')) { value = toNumber(value); other = toNumber(other); } return operator(value, other); }; } /** * Creates a function that wraps `func` to continue currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ]; var result = wrapFunc.apply(undefined, newData); if (isLaziable(func)) { setData(result, newData); } result.placeholder = placeholder; return setWrapToString(result, func, bitmask); } /** * Creates a function like `_.round`. * * @private * @param {string} methodName The name of the `Math` method to use when rounding. * @returns {Function} Returns the new round function. */ function createRound(methodName) { var func = Math[methodName]; return function(number, precision) { number = toNumber(number); precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); if (precision) { // Shift with exponential notation to avoid floating-point issues. // See [MDN](https://mdn.io/round#Examples) for more details. var pair = (toString(number) + 'e').split('e'), value = func(pair[0] + 'e' + (+pair[1] + precision)); pair = (toString(value) + 'e').split('e'); return +(pair[0] + 'e' + (+pair[1] - precision)); } return func(number); }; } /** * Creates a set object of `values`. * * @private * @param {Array} values The values to add to the set. * @returns {Object} Returns the new set. */ var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { return new Set(values); }; /** * Creates a `_.toPairs` or `_.toPairsIn` function. * * @private * @param {Function} keysFunc The function to get the keys of a given object. * @returns {Function} Returns the new pairs function. */ function createToPairs(keysFunc) { return function(object) { var tag = getTag(object); if (tag == mapTag) { return mapToArray(object); } if (tag == setTag) { return setToPairs(object); } return baseToPairs(object, keysFunc(object)); }; } /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. * 1 - `_.bind` * 2 - `_.bindKey` * 4 - `_.curry` or `_.curryRight` of a bound function * 8 - `_.curry` * 16 - `_.curryRight` * 32 - `_.partial` * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` * 512 - `_.flip` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); partials = holders = undefined; } ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); arity = arity === undefined ? arity : toInteger(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined; } var data = isBindKey ? undefined : getData(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity ]; if (data) { mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === undefined ? (isBindKey ? 0 : func.length) : nativeMax(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == WRAP_BIND_FLAG) { var result = createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { result = createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { result = createPartial(func, bitmask, thisArg, partials); } else { result = createHybrid.apply(undefined, newData); } var setter = data ? baseSetData : setData; return setWrapToString(setter(result, newData), func, bitmask); } /** * Used by `_.defaults` to customize its `_.assignIn` use to assign properties * of source objects to the destination object for all destination properties * that resolve to `undefined`. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to assign. * @param {Object} object The parent object of `objValue`. * @returns {*} Returns the value to assign. */ function customDefaultsAssignIn(objValue, srcValue, key, object) { if (objValue === undefined || (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { return srcValue; } return objValue; } /** * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source * objects into destination objects that are passed thru. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to merge. * @param {Object} object The parent object of `objValue`. * @param {Object} source The parent object of `srcValue`. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. * @returns {*} Returns the value to assign. */ function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, objValue); baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); stack['delete'](srcValue); } return objValue; } /** * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain * objects. * * @private * @param {*} value The value to inspect. * @param {string} key The key of the property to inspect. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. */ function customOmitClone(value) { return isPlainObject(value) ? undefined : value; } /** * A specialized version of `baseIsEqualDeep` for arrays with support for * partial deep comparisons. * * @private * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } // Assume cyclic values are equal. var stacked = stack.get(array); if (stacked && stack.get(other)) { return stacked == other; } var index = -1, result = true, seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; stack.set(array, other); stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined) { if (compared) { continue; } result = false; break; } // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!arraySome(other, function(othValue, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!( arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack) )) { result = false; break; } } stack['delete'](array); stack['delete'](other); return result; } /** * A specialized version of `baseIsEqualDeep` for comparing objects of * the same `toStringTag`. * * **Note:** This function only supports comparing values with tags of * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if ((object.byteLength != other.byteLength) || (object.byteOffset != other.byteOffset)) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if ((object.byteLength != other.byteLength) || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: // Coerce booleans to `1` or `0` and dates to milliseconds. // Invalid dates are coerced to `NaN`. return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == (other + ''); case mapTag: var convert = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; convert || (convert = setToArray); if (object.size != other.size && !isPartial) { return false; } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG; // Recursively compare objects (susceptible to call stack limits). stack.set(object, other); var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack['delete'](object); return result; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked && stack.get(other)) { return stacked == other; } var result = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) : compared )) { result = false; break; } skipCtor || (skipCtor = key == 'constructor'); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { result = false; } } stack['delete'](object); stack['delete'](other); return result; } /** * A specialized version of `baseRest` which flattens the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ function flatRest(func) { return setToString(overRest(func, undefined, flatten), func + ''); } /** * Creates an array of own enumerable property names and symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } /** * Creates an array of own and inherited enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn); } /** * Gets metadata for `func`. * * @private * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ var getData = !metaMap ? noop : function(func) { return metaMap.get(func); }; /** * Gets the name of `func`. * * @private * @param {Function} func The function to query. * @returns {string} Returns the function name. */ function getFuncName(func) { var result = (func.name + ''), array = realNames[result], length = hasOwnProperty.call(realNames, result) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result; } /** * Gets the argument placeholder value for `func`. * * @private * @param {Function} func The function to inspect. * @returns {*} Returns the placeholder value. */ function getHolder(func) { var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; return object.placeholder; } /** * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, * this function returns the custom method, otherwise it returns `baseIteratee`. * If arguments are provided, the chosen function is invoked with them and * its result is returned. * * @private * @param {*} [value] The value to convert to an iteratee. * @param {number} [arity] The arity of the created iteratee. * @returns {Function} Returns the chosen function or its result. */ function getIteratee() { var result = lodash.iteratee || iteratee; result = result === iteratee ? baseIteratee : result; return arguments.length ? result(arguments[0], arguments[1]) : result; } /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } /** * Gets the property names, values, and compare flags of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { var result = keys(object), length = result.length; while (length--) { var key = result[length], value = object[key]; result[length] = [key, value, isStrictComparable(value)]; } return result; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } /** * Creates an array of the own enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbols = !nativeGetSymbols ? stubArray : function(object) { if (object == null) { return []; } object = Object(object); return arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; /** * Creates an array of the own and inherited enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result = []; while (object) { arrayPush(result, getSymbols(object)); object = getPrototype(object); } return result; }; /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. 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(value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : ''; 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; }; } /** * Gets the view, applying any `transforms` to the `start` and `end` positions. * * @private * @param {number} start The start of the view. * @param {number} end The end of the view. * @param {Array} transforms The transformations to apply to the view. * @returns {Object} Returns an object containing the `start` and `end` * positions of the view. */ function getView(start, end, transforms) { var index = -1, length = transforms.length; while (++index < length) { var data = transforms[index], size = data.size; switch (data.type) { case 'drop': start += size; break; case 'dropRight': end -= size; break; case 'take': end = nativeMin(end, start + size); break; case 'takeRight': start = nativeMax(start, end - size); break; } } return { 'start': start, 'end': end }; } /** * Extracts wrapper details from the `source` body comment. * * @private * @param {string} source The source to inspect. * @returns {Array} Returns the wrapper details. */ function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } /** * Initializes an array clone. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the initialized clone. */ function initCloneArray(array) { var length = array.length, result = new array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { result.index = array.index; result.input = array.input; } return result; } /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(getPrototype(object)) : {}; } /** * Initializes an object clone based on its `toStringTag`. * * **Note:** This function only supports cloning values with tags of * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. * * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ function initCloneByTag(object, tag, 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 new Ctor; case numberTag: case stringTag: return new Ctor(object); case regexpTag: return cloneRegExp(object); case setTag: return new Ctor; case symbolTag: return cloneSymbol(object); } } /** * Inserts wrapper `details` in a comment at the top of the `source` body. * * @private * @param {string} source The source to modify. * @returns {Array} details The details to insert. * @returns {string} Returns the modified source. */ function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; details = details.join(length > 2 ? ', ' : ' '); return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } /** * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object) ) { return eq(object[index], value); } return false; } /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } /** * Checks if `func` has a lazy counterpart. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` has a lazy counterpart, * else `false`. */ function isLaziable(func) { var funcName = getFuncName(func), other = lodash[funcName]; if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = getData(other); return !!data && func === data[0]; } /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } /** * Checks if `func` is capable of being masked. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `func` is maskable, else `false`. */ var isMaskable = coreJsData ? isFunction : stubFalse; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` if suitable for strict * equality comparisons, else `false`. */ function isStrictComparable(value) { return value === value && !isObject(value); } /** * A specialized version of `matchesProperty` for source values suitable * for strict equality comparisons, i.e. `===`. * * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function(object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined || (key in Object(object))); }; } /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } /** * Merges the function metadata of `source` into `data`. * * Merging metadata reduces the number of wrappers used to invoke a function. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` * may be applied regardless of execution order. Methods like `_.ary` and * `_.rearg` modify function arguments, making the order in which they are * executed important, preventing the merging of metadata. However, we make * an exception for a safe combined case where curried functions have `_.ary` * and or `_.rearg` applied. * * @private * @param {Array} data The destination metadata. * @param {Array} source The source metadata. * @returns {Array} Returns `data`. */ function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); var isCombo = ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); // Exit early if metadata can't be merged. if (!(isCommon || isCombo)) { return data; } // Use source `thisArg` if available. if (srcBitmask & WRAP_BIND_FLAG) { data[2] = source[2]; // Set when currying a bound function. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; } // Compose partial arguments. var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials, value, source[4]) : value; data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } // Compose partial right arguments. value = source[5]; if (value) { partials = data[5]; data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } // Use source `argPos` if available. value = source[7]; if (value) { data[7] = value; } // Use source `ary` if it's smaller. if (srcBitmask & WRAP_ARY_FLAG) { data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); } // Use source `arity` if one is not provided. if (data[9] == null) { data[9] = source[9]; } // Use source `func` and merge bitmasks. data[0] = source[0]; data[1] = newBitmask; return data; } /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } /** * Gets the parent value at `path` of `object`. * * @private * @param {Object} object The object to query. * @param {Array} path The path to get the parent value of. * @returns {*} Returns the parent value. */ function parent(object, path) { return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); } /** * Reorder `array` according to the specified indexes where the element at * the first index is assigned as the first element, the element at * the second index is assigned as the second element, and so on. * * @private * @param {Array} array The array to reorder. * @param {Array} indexes The arranged array indexes. * @returns {Array} Returns `array`. */ function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index = indexes[length]; array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; } return array; } /** * Gets the value at `key`, unless `key` is "__proto__". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function safeGet(object, key) { if (key == '__proto__') { return; } return object[key]; } /** * Sets metadata for `func`. * * **Note:** If this function becomes hot, i.e. is invoked a lot in a short * period of time, it will trip its breaker and transition to an identity * function to avoid garbage collection pauses in V8. See * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) * for more details. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var setData = shortOut(baseSetData); /** * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @returns {number|Object} Returns the timer id or timeout object. */ var setTimeout = ctxSetTimeout || function(func, wait) { return root.setTimeout(func, wait); }; /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = shortOut(baseSetToString); /** * Sets the `toString` method of `wrapper` to mimic the source of `reference` * with wrapper details in a comment at the top of the source body. * * @private * @param {Function} wrapper The function to modify. * @param {Function} reference The reference function. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Function} Returns `wrapper`. */ function setWrapToString(wrapper, reference, bitmask) { var source = (reference + ''); return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } /** * A specialized version of `_.shuffle` which mutates and sets the size of `array`. * * @private * @param {Array} array The array to shuffle. * @param {number} [size=array.length] The size of `array`. * @returns {Array} Returns `array`. */ function shuffleSelf(array, size) { var index = -1, length = array.length, lastIndex = length - 1; size = size === undefined ? length : size; while (++index < size) { var rand = baseRandom(index, lastIndex), value = array[rand]; array[rand] = array[index]; array[index] = value; } array.length = size; return array; } /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoizeCapped(function(string) { var result = []; if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } /** * Updates wrapper `details` based on `bitmask` flags. * * @private * @returns {Array} details The details to modify. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Array} Returns `details`. */ function updateWrapDetails(details, bitmask) { arrayEach(wrapFlags, function(pair) { var value = '_.' + pair[0]; if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } /** * Creates a clone of `wrapper`. * * @private * @param {Object} wrapper The wrapper to clone. * @returns {Object} Returns the cloned wrapper. */ function wrapperClone(wrapper) { if (wrapper instanceof LazyWrapper) { return wrapper.clone(); } var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result.__actions__ = copyArray(wrapper.__actions__); result.__index__ = wrapper.__index__; result.__values__ = wrapper.__values__; return result; } /*------------------------------------------------------------------------*/ /** * Creates an array of elements split into groups the length of `size`. * If `array` can't be split evenly, the final chunk will be the remaining * elements. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to process. * @param {number} [size=1] The length of each chunk * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the new array of chunks. * @example * * _.chunk(['a', 'b', 'c', 'd'], 2); * // => [['a', 'b'], ['c', 'd']] * * _.chunk(['a', 'b', 'c', 'd'], 3); * // => [['a', 'b', 'c'], ['d']] */ function chunk(array, size, guard) { if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { size = 1; } else { size = nativeMax(toInteger(size), 0); } var length = array == null ? 0 : array.length; if (!length || size < 1) { return []; } var index = 0, resIndex = 0, result = Array(nativeCeil(length / size)); while (index < length) { result[resIndex++] = baseSlice(array, index, (index += size)); } return result; } /** * Creates an array with all falsey values removed. The values `false`, `null`, * `0`, `""`, `undefined`, and `NaN` are falsey. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to compact. * @returns {Array} Returns the new array of filtered values. * @example * * _.compact([0, 1, false, 2, '', 3]); * // => [1, 2, 3] */ function compact(array) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value) { result[resIndex++] = value; } } return result; } /** * Creates a new array concatenating `array` with any additional arrays * and/or values. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to concatenate. * @param {...*} [values] The values to concatenate. * @returns {Array} Returns the new concatenated array. * @example * * var array = [1]; * var other = _.concat(array, 2, [3], [[4]]); * * console.log(other); * // => [1, 2, 3, [4]] * * console.log(array); * // => [1] */ function concat() { var length = arguments.length; if (!length) { return []; } var args = Array(length - 1), array = arguments[0], index = length; while (index--) { args[index - 1] = arguments[index]; } return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } /** * Creates an array of `array` values not included in the other given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.without, _.xor * @example * * _.difference([2, 1], [2, 3]); * // => [1] */ var difference = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; }); /** * This method is like `_.difference` except that it accepts `iteratee` which * is invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * **Note:** Unlike `_.pullAllBy`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2] * * // The `_.property` iteratee shorthand. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var differenceBy = baseRest(function(array, values) { var iteratee = last(values); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.difference` except that it accepts `comparator` * which is invoked to compare elements of `array` to `values`. The order and * references of result values are determined by the first array. The comparator * is invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.pullAllWith`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); * // => [{ 'x': 2, 'y': 1 }] */ var differenceWith = baseRest(function(array, values) { var comparator = last(values); if (isArrayLikeObject(comparator)) { comparator = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : []; }); /** * Creates a slice of `array` with `n` elements dropped from the beginning. * * @static * @memberOf _ * @since 0.5.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.drop([1, 2, 3]); * // => [2, 3] * * _.drop([1, 2, 3], 2); * // => [3] * * _.drop([1, 2, 3], 5); * // => [] * * _.drop([1, 2, 3], 0); * // => [1, 2, 3] */ function drop(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with `n` elements dropped from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.dropRight([1, 2, 3]); * // => [1, 2] * * _.dropRight([1, 2, 3], 2); * // => [1] * * _.dropRight([1, 2, 3], 5); * // => [] * * _.dropRight([1, 2, 3], 0); * // => [1, 2, 3] */ function dropRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` excluding elements dropped from the end. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.dropRightWhile(users, function(o) { return !o.active; }); * // => objects for ['barney'] * * // The `_.matches` iteratee shorthand. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['barney', 'fred'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropRightWhile(users, ['active', false]); * // => objects for ['barney'] * * // The `_.property` iteratee shorthand. * _.dropRightWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; } /** * Creates a slice of `array` excluding elements dropped from the beginning. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.dropWhile(users, function(o) { return !o.active; }); * // => objects for ['pebbles'] * * // The `_.matches` iteratee shorthand. * _.dropWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['fred', 'pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropWhile(users, ['active', false]); * // => objects for ['pebbles'] * * // The `_.property` iteratee shorthand. * _.dropWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true) : []; } /** * Fills elements of `array` with `value` from `start` up to, but not * including, `end`. * * **Note:** This method mutates `array`. * * @static * @memberOf _ * @since 3.2.0 * @category Array * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.fill(array, 'a'); * console.log(array); * // => ['a', 'a', 'a'] * * _.fill(Array(3), 2); * // => [2, 2, 2] * * _.fill([4, 6, 8, 10], '*', 1, 3); * // => [4, '*', '*', 10] */ function fill(array, value, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { start = 0; end = length; } return baseFill(array, value, start, end); } /** * This method is like `_.find` except that it returns the index of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.findIndex(users, function(o) { return o.user == 'barney'; }); * // => 0 * * // The `_.matches` iteratee shorthand. * _.findIndex(users, { 'user': 'fred', 'active': false }); * // => 1 * * // The `_.matchesProperty` iteratee shorthand. * _.findIndex(users, ['active', false]); * // => 0 * * // The `_.property` iteratee shorthand. * _.findIndex(users, 'active'); * // => 2 */ function findIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseFindIndex(array, getIteratee(predicate, 3), index); } /** * This method is like `_.findIndex` except that it iterates over elements * of `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); * // => 2 * * // The `_.matches` iteratee shorthand. * _.findLastIndex(users, { 'user': 'barney', 'active': true }); * // => 0 * * // The `_.matchesProperty` iteratee shorthand. * _.findLastIndex(users, ['active', false]); * // => 2 * * // The `_.property` iteratee shorthand. * _.findLastIndex(users, 'active'); * // => 0 */ function findLastIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length - 1; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return baseFindIndex(array, getIteratee(predicate, 3), index, true); } /** * Flattens `array` a single level deep. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flatten([1, [2, [3, [4]], 5]]); * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, 1) : []; } /** * Recursively flattens `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flattenDeep([1, [2, [3, [4]], 5]]); * // => [1, 2, 3, 4, 5] */ function flattenDeep(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, INFINITY) : []; } /** * Recursively flatten `array` up to `depth` times. * * @static * @memberOf _ * @since 4.4.0 * @category Array * @param {Array} array The array to flatten. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * var array = [1, [2, [3, [4]], 5]]; * * _.flattenDepth(array, 1); * // => [1, 2, [3, [4]], 5] * * _.flattenDepth(array, 2); * // => [1, 2, 3, [4], 5] */ function flattenDepth(array, depth) { var length = array == null ? 0 : array.length; if (!length) { return []; } depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(array, depth); } /** * The inverse of `_.toPairs`; this method returns an object composed * from key-value `pairs`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} pairs The key-value pairs. * @returns {Object} Returns the new object. * @example * * _.fromPairs([['a', 1], ['b', 2]]); * // => { 'a': 1, 'b': 2 } */ function fromPairs(pairs) { var index = -1, length = pairs == null ? 0 : pairs.length, result = {}; while (++index < length) { var pair = pairs[index]; result[pair[0]] = pair[1]; } return result; } /** * Gets the first element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @alias first * @category Array * @param {Array} array The array to query. * @returns {*} Returns the first element of `array`. * @example * * _.head([1, 2, 3]); * // => 1 * * _.head([]); * // => undefined */ function head(array) { return (array && array.length) ? array[0] : undefined; } /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. If `fromIndex` is negative, it's used as the * offset from the end of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.indexOf([1, 2, 1, 2], 2); * // => 1 * * // Search from the `fromIndex`. * _.indexOf([1, 2, 1, 2], 2, 2); * // => 3 */ function indexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseIndexOf(array, value, index); } /** * Gets all but the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.initial([1, 2, 3]); * // => [1, 2] */ function initial(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 0, -1) : []; } /** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersection([2, 1], [2, 3]); * // => [2] */ var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) : []; }); /** * This method is like `_.intersection` except that it accepts `iteratee` * which is invoked for each element of each `arrays` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [2.1] * * // The `_.property` iteratee shorthand. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }] */ var intersectionBy = baseRest(function(arrays) { var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee === last(mapped)) { iteratee = undefined; } else { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.intersection` except that it accepts `comparator` * which is invoked to compare elements of `arrays`. The order and references * of result values are determined by the first array. The comparator is * invoked with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.intersectionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }] */ var intersectionWith = baseRest(function(arrays) { var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); comparator = typeof comparator == 'function' ? comparator : undefined; if (comparator) { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, undefined, comparator) : []; }); /** * Converts all elements in `array` into a string separated by `separator`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to convert. * @param {string} [separator=','] The element separator. * @returns {string} Returns the joined string. * @example * * _.join(['a', 'b', 'c'], '~'); * // => 'a~b~c' */ function join(array, separator) { return array == null ? '' : nativeJoin.call(array, separator); } /** * Gets the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. * @example * * _.last([1, 2, 3]); * // => 3 */ function last(array) { var length = array == null ? 0 : array.length; return length ? array[length - 1] : undefined; } /** * This method is like `_.indexOf` except that it iterates over elements of * `array` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.lastIndexOf([1, 2, 1, 2], 2); * // => 3 * * // Search from the `fromIndex`. * _.lastIndexOf([1, 2, 1, 2], 2, 2); * // => 1 */ function lastIndexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true); } /** * Gets the element at index `n` of `array`. If `n` is negative, the nth * element from the end is returned. * * @static * @memberOf _ * @since 4.11.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=0] The index of the element to return. * @returns {*} Returns the nth element of `array`. * @example * * var array = ['a', 'b', 'c', 'd']; * * _.nth(array, 1); * // => 'b' * * _.nth(array, -2); * // => 'c'; */ function nth(array, n) { return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; } /** * Removes all given values from `array` using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` * to remove elements from an array by predicate. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {...*} [values] The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pull(array, 'a', 'c'); * console.log(array); * // => ['b', 'b'] */ var pull = baseRest(pullAll); /** * This method is like `_.pull` except that it accepts an array of values to remove. * * **Note:** Unlike `_.difference`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pullAll(array, ['a', 'c']); * console.log(array); * // => ['b', 'b'] */ function pullAll(array, values) { return (array && array.length && values && values.length) ? basePullAll(array, values) : array; } /** * This method is like `_.pullAll` except that it accepts `iteratee` which is * invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The iteratee is invoked with one argument: (value). * * **Note:** Unlike `_.differenceBy`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; * * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); * console.log(array); * // => [{ 'x': 2 }] */ function pullAllBy(array, values, iteratee) { return (array && array.length && values && values.length) ? basePullAll(array, values, getIteratee(iteratee, 2)) : array; } /** * This method is like `_.pullAll` except that it accepts `comparator` which * is invoked to compare elements of `array` to `values`. The comparator is * invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.differenceWith`, this method mutates `array`. * * @static * @memberOf _ * @since 4.6.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; * * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); * console.log(array); * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] */ function pullAllWith(array, values, comparator) { return (array && array.length && values && values.length) ? basePullAll(array, values, undefined, comparator) : array; } /** * Removes elements from `array` corresponding to `indexes` and returns an * array of removed elements. * * **Note:** Unlike `_.at`, this method mutates `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to modify. * @param {...(number|number[])} [indexes] The indexes of elements to remove. * @returns {Array} Returns the new array of removed elements. * @example * * var array = ['a', 'b', 'c', 'd']; * var pulled = _.pullAt(array, [1, 3]); * * console.log(array); * // => ['a', 'c'] * * console.log(pulled); * // => ['b', 'd'] */ var pullAt = flatRest(function(array, indexes) { var length = array == null ? 0 : array.length, result = baseAt(array, indexes); basePullAt(array, arrayMap(indexes, function(index) { return isIndex(index, length) ? +index : index; }).sort(compareAscending)); return result; }); /** * Removes all elements from `array` that `predicate` returns truthy for * and returns an array of the removed elements. The predicate is invoked * with three arguments: (value, index, array). * * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` * to pull elements from an array by value. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new array of removed elements. * @example * * var array = [1, 2, 3, 4]; * var evens = _.remove(array, function(n) { * return n % 2 == 0; * }); * * console.log(array); * // => [1, 3] * * console.log(evens); * // => [2, 4] */ function remove(array, predicate) { var result = []; if (!(array && array.length)) { return result; } var index = -1, indexes = [], length = array.length; predicate = getIteratee(predicate, 3); while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result.push(value); indexes.push(index); } } basePullAt(array, indexes); return result; } /** * Reverses `array` so that the first element becomes the last, the second * element becomes the second to last, and so on. * * **Note:** This method mutates `array` and is based on * [`Array#reverse`](https://mdn.io/Array/reverse). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.reverse(array); * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function reverse(array) { return array == null ? array : nativeReverse.call(array); } /** * Creates a slice of `array` from `start` up to, but not including, `end`. * * **Note:** This method is used instead of * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are * returned. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function slice(array, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { start = 0; end = length; } else { start = start == null ? 0 : toInteger(start); end = end === undefined ? length : toInteger(end); } return baseSlice(array, start, end); } /** * Uses a binary search to determine the lowest index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedIndex([30, 50], 40); * // => 1 */ function sortedIndex(array, value) { return baseSortedIndex(array, value); } /** * This method is like `_.sortedIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 0 * * // The `_.property` iteratee shorthand. * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); * // => 0 */ function sortedIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); } /** * This method is like `_.indexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedIndexOf([4, 5, 5, 5, 6], 5); * // => 1 */ function sortedIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value); if (index < length && eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.sortedIndex` except that it returns the highest * index at which `value` should be inserted into `array` in order to * maintain its sort order. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedLastIndex([4, 5, 5, 5, 6], 5); * // => 4 */ function sortedLastIndex(array, value) { return baseSortedIndex(array, value, true); } /** * This method is like `_.sortedLastIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 1 * * // The `_.property` iteratee shorthand. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); * // => 1 */ function sortedLastIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); } /** * This method is like `_.lastIndexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); * // => 3 */ function sortedLastIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value, true) - 1; if (eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.uniq` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniq([1, 1, 2]); * // => [1, 2] */ function sortedUniq(array) { return (array && array.length) ? baseSortedUniq(array) : []; } /** * This method is like `_.uniqBy` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); * // => [1.1, 2.3] */ function sortedUniqBy(array, iteratee) { return (array && array.length) ? baseSortedUniq(array, getIteratee(iteratee, 2)) : []; } /** * Gets all but the first element of `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.tail([1, 2, 3]); * // => [2, 3] */ function tail(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 1, length) : []; } /** * Creates a slice of `array` with `n` elements taken from the beginning. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.take([1, 2, 3]); * // => [1] * * _.take([1, 2, 3], 2); * // => [1, 2] * * _.take([1, 2, 3], 5); * // => [1, 2, 3] * * _.take([1, 2, 3], 0); * // => [] */ function take(array, n, guard) { if (!(array && array.length)) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` with `n` elements taken from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.takeRight([1, 2, 3]); * // => [3] * * _.takeRight([1, 2, 3], 2); * // => [2, 3] * * _.takeRight([1, 2, 3], 5); * // => [1, 2, 3] * * _.takeRight([1, 2, 3], 0); * // => [] */ function takeRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with elements taken from the end. Elements are * taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.takeRightWhile(users, function(o) { return !o.active; }); * // => objects for ['fred', 'pebbles'] * * // The `_.matches` iteratee shorthand. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeRightWhile(users, ['active', false]); * // => objects for ['fred', 'pebbles'] * * // The `_.property` iteratee shorthand. * _.takeRightWhile(users, 'active'); * // => [] */ function takeRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; } /** * Creates a slice of `array` with elements taken from the beginning. Elements * are taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.takeWhile(users, function(o) { return !o.active; }); * // => objects for ['barney', 'fred'] * * // The `_.matches` iteratee shorthand. * _.takeWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeWhile(users, ['active', false]); * // => objects for ['barney', 'fred'] * * // The `_.property` iteratee shorthand. * _.takeWhile(users, 'active'); * // => [] */ function takeWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3)) : []; } /** * Creates an array of unique values, in order, from all given arrays using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of combined values. * @example * * _.union([2], [1, 2]); * // => [2, 1] */ var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); /** * This method is like `_.union` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which uniqueness is computed. Result values are chosen from the first * array in which the value occurs. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * _.unionBy([2.1], [1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ var unionBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); }); /** * This method is like `_.union` except that it accepts `comparator` which * is invoked to compare elements of `arrays`. Result values are chosen from * the first array in which the value occurs. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.unionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var unionWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); }); /** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each element * is kept. The order of result values is determined by the order they occur * in the array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniq([2, 1, 2]); * // => [2, 1] */ function uniq(array) { return (array && array.length) ? baseUniq(array) : []; } /** * This method is like `_.uniq` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * uniqueness is computed. The order of result values is determined by the * order they occur in the array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniqBy([2.1, 1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ function uniqBy(array, iteratee) { return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; } /** * This method is like `_.uniq` except that it accepts `comparator` which * is invoked to compare elements of `array`. The order of result values is * determined by the order they occur in the array.The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.uniqWith(objects, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] */ function uniqWith(array, comparator) { comparator = typeof comparator == 'function' ? comparator : undefined; return (array && array.length) ? baseUniq(array, undefined, comparator) : []; } /** * This method is like `_.zip` except that it accepts an array of grouped * elements and creates an array regrouping the elements to their pre-zip * configuration. * * @static * @memberOf _ * @since 1.2.0 * @category Array * @param {Array} array The array of grouped elements to process. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] * * _.unzip(zipped); * // => [['a', 'b'], [1, 2], [true, false]] */ function unzip(array) { if (!(array && array.length)) { return []; } var length = 0; array = arrayFilter(array, function(group) { if (isArrayLikeObject(group)) { length = nativeMax(group.length, length); return true; } }); return baseTimes(length, function(index) { return arrayMap(array, baseProperty(index)); }); } /** * This method is like `_.unzip` except that it accepts `iteratee` to specify * how regrouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {Array} array The array of grouped elements to process. * @param {Function} [iteratee=_.identity] The function to combine * regrouped values. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip([1, 2], [10, 20], [100, 200]); * // => [[1, 10, 100], [2, 20, 200]] * * _.unzipWith(zipped, _.add); * // => [3, 30, 300] */ function unzipWith(array, iteratee) { if (!(array && array.length)) { return []; } var result = unzip(array); if (iteratee == null) { return result; } return arrayMap(result, function(group) { return apply(iteratee, undefined, group); }); } /** * Creates an array excluding all given values using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.pull`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...*} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.xor * @example * * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ var without = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : []; }); /** * Creates an array of unique values that is the * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) * of the given arrays. The order of result values is determined by the order * they occur in the arrays. * * @static * @memberOf _ * @since 2.4.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.without * @example * * _.xor([2, 1], [2, 3]); * // => [1, 3] */ var xor = baseRest(function(arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); }); /** * This method is like `_.xor` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which by which they're compared. The order of result values is determined * by the order they occur in the arrays. The iteratee is invoked with one * argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2, 3.4] * * // The `_.property` iteratee shorthand. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var xorBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); }); /** * This method is like `_.xor` except that it accepts `comparator` which is * invoked to compare elements of `arrays`. The order of result values is * determined by the order they occur in the arrays. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.xorWith(objects, others, _.isEqual); * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var xorWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); }); /** * Creates an array of grouped elements, the first of which contains the * first elements of the given arrays, the second of which contains the * second elements of the given arrays, and so on. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] */ var zip = baseRest(unzip); /** * This method is like `_.fromPairs` except that it accepts two arrays, * one of property identifiers and one of corresponding values. * * @static * @memberOf _ * @since 0.4.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObject(['a', 'b'], [1, 2]); * // => { 'a': 1, 'b': 2 } */ function zipObject(props, values) { return baseZipObject(props || [], values || [], assignValue); } /** * This method is like `_.zipObject` except that it supports property paths. * * @static * @memberOf _ * @since 4.1.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } */ function zipObjectDeep(props, values) { return baseZipObject(props || [], values || [], baseSet); } /** * This method is like `_.zip` except that it accepts `iteratee` to specify * how grouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @param {Function} [iteratee=_.identity] The function to combine * grouped values. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { * return a + b + c; * }); * // => [111, 222] */ var zipWith = baseRest(function(arrays) { var length = arrays.length, iteratee = length > 1 ? arrays[length - 1] : undefined; iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; return unzipWith(arrays, iteratee); }); /*------------------------------------------------------------------------*/ /** * Creates a `lodash` wrapper instance that wraps `value` with explicit method * chain sequences enabled. The result of such sequences must be unwrapped * with `_#value`. * * @static * @memberOf _ * @since 1.3.0 * @category Seq * @param {*} value The value to wrap. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'pebbles', 'age': 1 } * ]; * * var youngest = _ * .chain(users) * .sortBy('age') * .map(function(o) { * return o.user + ' is ' + o.age; * }) * .head() * .value(); * // => 'pebbles is 1' */ function chain(value) { var result = lodash(value); result.__chain__ = true; return result; } /** * This method invokes `interceptor` and returns `value`. The interceptor * is invoked with one argument; (value). The purpose of this method is to * "tap into" a method chain sequence in order to modify intermediate results. * * @static * @memberOf _ * @since 0.1.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns `value`. * @example * * _([1, 2, 3]) * .tap(function(array) { * // Mutate input array. * array.pop(); * }) * .reverse() * .value(); * // => [2, 1] */ function tap(value, interceptor) { interceptor(value); return value; } /** * This method is like `_.tap` except that it returns the result of `interceptor`. * The purpose of this method is to "pass thru" values replacing intermediate * results in a method chain sequence. * * @static * @memberOf _ * @since 3.0.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns the result of `interceptor`. * @example * * _(' abc ') * .chain() * .trim() * .thru(function(value) { * return [value]; * }) * .value(); * // => ['abc'] */ function thru(value, interceptor) { return interceptor(value); } /** * This method is the wrapper version of `_.at`. * * @name at * @memberOf _ * @since 1.0.0 * @category Seq * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] */ var wrapperAt = flatRest(function(paths) { var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) { return baseAt(object, paths); }; if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { return this.thru(interceptor); } value = value.slice(start, +start + (length ? 1 : 0)); value.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); return new LodashWrapper(value, this.__chain__).thru(function(array) { if (length && !array.length) { array.push(undefined); } return array; }); }); /** * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. * * @name chain * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 } * ]; * * // A sequence without explicit chaining. * _(users).head(); * // => { 'user': 'barney', 'age': 36 } * * // A sequence with explicit chaining. * _(users) * .chain() * .head() * .pick('user') * .value(); * // => { 'user': 'barney' } */ function wrapperChain() { return chain(this); } /** * Executes the chain sequence and returns the wrapped result. * * @name commit * @memberOf _ * @since 3.2.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2]; * var wrapped = _(array).push(3); * * console.log(array); * // => [1, 2] * * wrapped = wrapped.commit(); * console.log(array); * // => [1, 2, 3] * * wrapped.last(); * // => 3 * * console.log(array); * // => [1, 2, 3] */ function wrapperCommit() { return new LodashWrapper(this.value(), this.__chain__); } /** * Gets the next value on a wrapped object following the * [iterator protocol](https://mdn.io/iteration_protocols#iterator). * * @name next * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the next iterator value. * @example * * var wrapped = _([1, 2]); * * wrapped.next(); * // => { 'done': false, 'value': 1 } * * wrapped.next(); * // => { 'done': false, 'value': 2 } * * wrapped.next(); * // => { 'done': true, 'value': undefined } */ function wrapperNext() { if (this.__values__ === undefined) { this.__values__ = toArray(this.value()); } var done = this.__index__ >= this.__values__.length, value = done ? undefined : this.__values__[this.__index__++]; return { 'done': done, 'value': value }; } /** * Enables the wrapper to be iterable. * * @name Symbol.iterator * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the wrapper object. * @example * * var wrapped = _([1, 2]); * * wrapped[Symbol.iterator]() === wrapped; * // => true * * Array.from(wrapped); * // => [1, 2] */ function wrapperToIterator() { return this; } /** * Creates a clone of the chain sequence planting `value` as the wrapped value. * * @name plant * @memberOf _ * @since 3.2.0 * @category Seq * @param {*} value The value to plant. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2]).map(square); * var other = wrapped.plant([3, 4]); * * other.value(); * // => [9, 16] * * wrapped.value(); * // => [1, 4] */ function wrapperPlant(value) { var result, parent = this; while (parent instanceof baseLodash) { var clone = wrapperClone(parent); clone.__index__ = 0; clone.__values__ = undefined; if (result) { previous.__wrapped__ = clone; } else { result = clone; } var previous = clone; parent = parent.__wrapped__; } previous.__wrapped__ = value; return result; } /** * This method is the wrapper version of `_.reverse`. * * **Note:** This method mutates the wrapped array. * * @name reverse * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2, 3]; * * _(array).reverse().value() * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function wrapperReverse() { var value = this.__wrapped__; if (value instanceof LazyWrapper) { var wrapped = value; if (this.__actions__.length) { wrapped = new LazyWrapper(this); } wrapped = wrapped.reverse(); wrapped.__actions__.push({ 'func': thru, 'args': [reverse], 'thisArg': undefined }); return new LodashWrapper(wrapped, this.__chain__); } return this.thru(reverse); } /** * Executes the chain sequence to resolve the unwrapped value. * * @name value * @memberOf _ * @since 0.1.0 * @alias toJSON, valueOf * @category Seq * @returns {*} Returns the resolved unwrapped value. * @example * * _([1, 2, 3]).value(); * // => [1, 2, 3] */ function wrapperValue() { return baseWrapperValue(this.__wrapped__, this.__actions__); } /*------------------------------------------------------------------------*/ /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the number of times the key was returned by `iteratee`. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.5.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.countBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': 1, '6': 2 } * * // The `_.property` iteratee shorthand. * _.countBy(['one', 'two', 'three'], 'length'); * // => { '3': 2, '5': 1 } */ var countBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { ++result[key]; } else { baseAssignValue(result, key, 1); } }); /** * Checks if `predicate` returns truthy for **all** elements of `collection`. * Iteration is stopped once `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index|key, collection). * * **Note:** This method returns `true` for * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of * elements of empty collections. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. * @example * * _.every([true, 1, null, 'yes'], Boolean); * // => false * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.every(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.every(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.every(users, 'active'); * // => false */ function every(collection, predicate, guard) { var func = isArray(collection) ? arrayEvery : baseEvery; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning an array of all elements * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * **Note:** Unlike `_.remove`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.reject * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * _.filter(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.filter(users, { 'age': 36, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.filter(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.filter(users, 'active'); * // => objects for ['barney'] */ function filter(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning the first element * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false }, * { 'user': 'pebbles', 'age': 1, 'active': true } * ]; * * _.find(users, function(o) { return o.age < 40; }); * // => object for 'barney' * * // The `_.matches` iteratee shorthand. * _.find(users, { 'age': 1, 'active': true }); * // => object for 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.find(users, ['active', false]); * // => object for 'fred' * * // The `_.property` iteratee shorthand. * _.find(users, 'active'); * // => object for 'barney' */ var find = createFind(findIndex); /** * This method is like `_.find` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=collection.length-1] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * _.findLast([1, 2, 3, 4], function(n) { * return n % 2 == 1; * }); * // => 3 */ var findLast = createFind(findLastIndex); /** * Creates a flattened array of values by running each element in `collection` * thru `iteratee` and flattening the mapped results. The iteratee is invoked * with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [n, n]; * } * * _.flatMap([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMap(collection, iteratee) { return baseFlatten(map(collection, iteratee), 1); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDeep([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMapDeep(collection, iteratee) { return baseFlatten(map(collection, iteratee), INFINITY); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results up to `depth` times. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDepth([1, 2], duplicate, 2); * // => [[1, 1], [2, 2]] */ function flatMapDepth(collection, iteratee, depth) { depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(map(collection, iteratee), depth); } /** * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * * **Note:** As with other "Collections" methods, objects with a "length" * property are iterated like arrays. To avoid this behavior use `_.forIn` * or `_.forOwn` for object iteration. * * @static * @memberOf _ * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEachRight * @example * * _.forEach([1, 2], function(value) { * console.log(value); * }); * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.forEach` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @alias eachRight * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEach * @example * * _.forEachRight([1, 2], function(value) { * console.log(value); * }); * // => Logs `2` then `1`. */ function forEachRight(collection, iteratee) { var func = isArray(collection) ? arrayEachRight : baseEachRight; return func(collection, getIteratee(iteratee, 3)); } /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The order of grouped values * is determined by the order they occur in `collection`. The corresponding * value of each key is an array of elements responsible for generating the * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.groupBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': [4.2], '6': [6.1, 6.3] } * * // The `_.property` iteratee shorthand. * _.groupBy(['one', 'two', 'three'], 'length'); * // => { '3': ['one', 'two'], '5': ['three'] } */ var groupBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { result[key].push(value); } else { baseAssignValue(result, key, [value]); } }); /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * * _.includes([1, 2, 3], 1); * // => true * * _.includes([1, 2, 3], 1, 2); * // => false * * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { collection = isArrayLike(collection) ? collection : values(collection); fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString(collection) ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) : (!!length && baseIndexOf(collection, value, fromIndex) > -1); } /** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments * are provided to each invoked method. If `path` is a function, it's invoked * for, and `this` bound to, each element in `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array|Function|string} path The path of the method to invoke or * the function invoked per iteration. * @param {...*} [args] The arguments to invoke each method with. * @returns {Array} Returns the array of results. * @example * * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); * // => [[1, 5, 7], [1, 2, 3]] * * _.invokeMap([123, 456], String.prototype.split, ''); * // => [['1', '2', '3'], ['4', '5', '6']] */ var invokeMap = baseRest(function(collection, path, args) { var index = -1, isFunc = typeof path == 'function', result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value) { result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); }); return result; }); /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the last element responsible for generating the key. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * var array = [ * { 'dir': 'left', 'code': 97 }, * { 'dir': 'right', 'code': 100 } * ]; * * _.keyBy(array, function(o) { * return String.fromCharCode(o.code); * }); * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } * * _.keyBy(array, 'dir'); * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ var keyBy = createAggregator(function(result, value, key) { baseAssignValue(result, key, value); }); /** * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. * * The guarded methods are: * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * * function square(n) { * return n * n; * } * * _.map([4, 8], square); * // => [16, 64] * * _.map({ 'a': 4, 'b': 8 }, square); * // => [16, 64] (iteration order is not guaranteed) * * var users = [ * { 'user': 'barney' }, * { 'user': 'fred' } * ]; * * // The `_.property` iteratee shorthand. * _.map(users, 'user'); * // => ['barney', 'fred'] */ function map(collection, iteratee) { var func = isArray(collection) ? arrayMap : baseMap; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.sortBy` except that it allows specifying the sort * orders of the iteratees to sort by. If `orders` is unspecified, all values * are sorted in ascending order. Otherwise, specify an order of "desc" for * descending or "asc" for ascending sort order of corresponding values. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] * The iteratees to sort by. * @param {string[]} [orders] The sort orders of `iteratees`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 34 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 36 } * ]; * * // Sort by `user` in ascending order and by `age` in descending order. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ function orderBy(collection, iteratees, orders, guard) { if (collection == null) { return []; } if (!isArray(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } orders = guard ? undefined : orders; if (!isArray(orders)) { orders = orders == null ? [] : [orders]; } return baseOrderBy(collection, iteratees, orders); } /** * Creates an array of elements split into two groups, the first of which * contains elements `predicate` returns truthy for, the second of which * contains elements `predicate` returns falsey for. The predicate is * invoked with one argument: (value). * * @static * @memberOf _ * @since 3.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the array of grouped elements. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true }, * { 'user': 'pebbles', 'age': 1, 'active': false } * ]; * * _.partition(users, function(o) { return o.active; }); * // => objects for [['fred'], ['barney', 'pebbles']] * * // The `_.matches` iteratee shorthand. * _.partition(users, { 'age': 1, 'active': false }); * // => objects for [['pebbles'], ['barney', 'fred']] * * // The `_.matchesProperty` iteratee shorthand. * _.partition(users, ['active', false]); * // => objects for [['barney', 'pebbles'], ['fred']] * * // The `_.property` iteratee shorthand. * _.partition(users, 'active'); * // => objects for [['fred'], ['barney', 'pebbles']] */ var partition = createAggregator(function(result, value, key) { result[key ? 0 : 1].push(value); }, function() { return [[], []]; }); /** * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.reduce`, `_.reduceRight`, and `_.transform`. * * The guarded methods are: * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, * and `sortBy` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduceRight * @example * * _.reduce([1, 2], function(sum, n) { * return sum + n; * }, 0); * // => 3 * * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * return result; * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) */ function reduce(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); } /** * This method is like `_.reduce` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduce * @example * * var array = [[0, 1], [2, 3], [4, 5]]; * * _.reduceRight(array, function(flattened, other) { * return flattened.concat(other); * }, []); * // => [4, 5, 2, 3, 0, 1] */ function reduceRight(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); } /** * The opposite of `_.filter`; this method returns the elements of `collection` * that `predicate` does **not** return truthy for. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.filter * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true } * ]; * * _.reject(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.reject(users, { 'age': 40, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.reject(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.reject(users, 'active'); * // => objects for ['barney'] */ function reject(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, negate(getIteratee(predicate, 3))); } /** * Gets a random element from `collection`. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. * @example * * _.sample([1, 2, 3, 4]); * // => 2 */ function sample(collection) { var func = isArray(collection) ? arraySample : baseSample; return func(collection); } /** * Gets `n` random elements at unique keys from `collection` up to the * size of `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @param {number} [n=1] The number of elements to sample. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the random elements. * @example * * _.sampleSize([1, 2, 3], 2); * // => [3, 1] * * _.sampleSize([1, 2, 3], 4); * // => [2, 3, 1] */ function sampleSize(collection, n, guard) { if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } var func = isArray(collection) ? arraySampleSize : baseSampleSize; return func(collection, n); } /** * Creates an array of shuffled values, using a version of the * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. * @example * * _.shuffle([1, 2, 3, 4]); * // => [4, 1, 3, 2] */ function shuffle(collection) { var func = isArray(collection) ? arrayShuffle : baseShuffle; return func(collection); } /** * Gets the size of `collection` by returning its length for array-like * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @returns {number} Returns the collection size. * @example * * _.size([1, 2, 3]); * // => 3 * * _.size({ 'a': 1, 'b': 2 }); * // => 2 * * _.size('pebbles'); * // => 7 */ function size(collection) { if (collection == null) { return 0; } if (isArrayLike(collection)) { return isString(collection) ? stringSize(collection) : collection.length; } var tag = getTag(collection); if (tag == mapTag || tag == setTag) { return collection.size; } return baseKeys(collection).length; } /** * Checks if `predicate` returns truthy for **any** element of `collection`. * Iteration is stopped once `predicate` returns truthy. The predicate is * invoked with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. * @example * * _.some([null, 0, 'yes', false], Boolean); * // => true * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.some(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.some(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.some(users, 'active'); * // => true */ function some(collection, predicate, guard) { var func = isArray(collection) ? arraySome : baseSome; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Creates an array of elements, sorted in ascending order by the results of * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {...(Function|Function[])} [iteratees=[_.identity]] * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] */ var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { return []; } var length = iteratees.length; if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); /*------------------------------------------------------------------------*/ /** * Gets the timestamp of the number of milliseconds that have elapsed since * the Unix epoch (1 January 1970 00:00:00 UTC). * * @static * @memberOf _ * @since 2.4.0 * @category Date * @returns {number} Returns the timestamp. * @example * * _.defer(function(stamp) { * console.log(_.now() - stamp); * }, _.now()); * // => Logs the number of milliseconds it took for the deferred invocation. */ var now = ctxNow || function() { return root.Date.now(); }; /*------------------------------------------------------------------------*/ /** * The opposite of `_.before`; this method creates a function that invokes * `func` once it's called `n` or more times. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {number} n The number of calls before `func` is invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var saves = ['profile', 'settings']; * * var done = _.after(saves.length, function() { * console.log('done saving!'); * }); * * _.forEach(saves, function(type) { * asyncSave({ 'type': type, 'complete': done }); * }); * // => Logs 'done saving!' after the two async saves have completed. */ function after(n, func) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n < 1) { return func.apply(this, arguments); } }; } /** * Creates a function that invokes `func`, with up to `n` arguments, * ignoring any additional arguments. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @param {number} [n=func.length] The arity cap. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.ary(parseInt, 1)); * // => [6, 8, 10] */ function ary(func, n, guard) { n = guard ? undefined : n; n = (func && n == null) ? func.length : n; return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); } /** * Creates a function that invokes `func`, with the `this` binding and arguments * of the created function, while it's called less than `n` times. Subsequent * calls to the created function return the result of the last `func` invocation. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {number} n The number of calls at which `func` is no longer invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * jQuery(element).on('click', _.before(5, addContactToList)); * // => Allows adding up to 4 contacts to the list. */ function before(n, func) { var result; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n > 0) { result = func.apply(this, arguments); } if (n <= 1) { func = undefined; } return result; }; } /** * Creates a function that invokes `func` with the `this` binding of `thisArg` * and `partials` prepended to the arguments it receives. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" * property of bound functions. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * function greet(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * * var object = { 'user': 'fred' }; * * var bound = _.bind(greet, object, 'hi'); * bound('!'); * // => 'hi fred!' * * // Bound with placeholders. * var bound = _.bind(greet, object, _, '!'); * bound('hi'); * // => 'hi fred!' */ var bind = baseRest(function(func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(func, bitmask, thisArg, partials, holders); }); /** * Creates a function that invokes the method at `object[key]` with `partials` * prepended to the arguments it receives. * * This method differs from `_.bind` by allowing bound functions to reference * methods that may be redefined or don't yet exist. See * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) * for more details. * * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * @static * @memberOf _ * @since 0.10.0 * @category Function * @param {Object} object The object to invoke the method on. * @param {string} key The key of the method. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * var object = { * 'user': 'fred', * 'greet': function(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * }; * * var bound = _.bindKey(object, 'greet', 'hi'); * bound('!'); * // => 'hi fred!' * * object.greet = function(greeting, punctuation) { * return greeting + 'ya ' + this.user + punctuation; * }; * * bound('!'); * // => 'hiya fred!' * * // Bound with placeholders. * var bound = _.bindKey(object, 'greet', _, '!'); * bound('hi'); * // => 'hiya fred!' */ var bindKey = baseRest(function(object, key, partials) { var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(key, bitmask, object, partials, holders); }); /** * Creates a function that accepts arguments of `func` and either invokes * `func` returning its result, if at least `arity` number of arguments have * been provided, or returns a function that accepts the remaining `func` * arguments, and so on. The arity of `func` may be specified if `func.length` * is not sufficient. * * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 2.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curry(abc); * * curried(1)(2)(3); * // => [1, 2, 3] * * curried(1, 2)(3); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(1)(_, 3)(2); * // => [1, 2, 3] */ function curry(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curry.placeholder; return result; } /** * This method is like `_.curry` except that arguments are applied to `func` * in the manner of `_.partialRight` instead of `_.partial`. * * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curryRight(abc); * * curried(3)(2)(1); * // => [1, 2, 3] * * curried(2, 3)(1); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(3)(1, _)(2); * // => [1, 2, 3] */ function curryRight(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curryRight.placeholder; return result; } /** * Creates a debounced function that delays invoking `func` until after `wait` * milliseconds have elapsed since the last time the debounced function was * invoked. The debounced function comes with a `cancel` method to cancel * delayed `func` invocations and a `flush` method to immediately invoke them. * Provide `options` to indicate whether `func` should be invoked on the * leading and/or trailing edge of the `wait` timeout. The `func` is invoked * with the last arguments provided to the debounced function. Subsequent * calls to the debounced function return the result of the last `func` * invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the debounced function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.debounce` and `_.throttle`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to debounce. * @param {number} [wait=0] The number of milliseconds to delay. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=false] * Specify invoking on the leading edge of the timeout. * @param {number} [options.maxWait] * The maximum time `func` is allowed to be delayed before it's invoked. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new debounced function. * @example * * // Avoid costly calculations while the window size is in flux. * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); * * // Invoke `sendMail` when clicked, debouncing subsequent calls. * jQuery(element).on('click', _.debounce(sendMail, 300, { * 'leading': true, * 'trailing': false * })); * * // Ensure `batchLog` is invoked once after 1 second of debounced calls. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); * var source = new EventSource('/stream'); * jQuery(source).on('message', debounced); * * // Cancel the trailing debounced invocation. * jQuery(window).on('popstate', debounced.cancel); */ function debounce(func, wait, options) { var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } wait = toNumber(wait) || 0; if (isObject(options)) { leading = !!options.leading; maxing = 'maxWait' in options; maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = 'trailing' in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = undefined; lastInvokeTime = time; result = func.apply(thisArg, args); return result; } function leadingEdge(time) { // Reset any `maxWait` timer. lastInvokeTime = time; // Start the timer for the trailing edge. timerId = setTimeout(timerExpired, wait); // Invoke the leading edge. return leading ? invokeFunc(time) : result; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the // trailing edge, the system time has gone backwards and we're treating // it as the trailing edge, or we've hit the `maxWait` limit. return (lastCallTime === undefined || (timeSinceLastCall >= wait) || (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); } function timerExpired() { var time = now(); if (shouldInvoke(time)) { return trailingEdge(time); } // Restart the timer. timerId = setTimeout(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been // debounced at least once. if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined; return result; } function cancel() { if (timerId !== undefined) { clearTimeout(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; } function flush() { return timerId === undefined ? result : trailingEdge(now()); } function debounced() { var time = now(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined) { return leadingEdge(lastCallTime); } if (maxing) { // Handle invocations in a tight loop. timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined) { timerId = setTimeout(timerExpired, wait); } return result; } debounced.cancel = cancel; debounced.flush = flush; return debounced; } /** * Defers invoking the `func` until the current call stack has cleared. Any * additional arguments are provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to defer. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.defer(function(text) { * console.log(text); * }, 'deferred'); * // => Logs 'deferred' after one millisecond. */ var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); }); /** * Invokes `func` after `wait` milliseconds. Any additional arguments are * provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.delay(function(text) { * console.log(text); * }, 1000, 'later'); * // => Logs 'later' after one second. */ var delay = baseRest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); /** * Creates a function that invokes `func` with arguments reversed. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to flip arguments for. * @returns {Function} Returns the new flipped function. * @example * * var flipped = _.flip(function() { * return _.toArray(arguments); * }); * * flipped('a', 'b', 'c', 'd'); * // => ['d', 'c', 'b', 'a'] */ function flip(func) { return createWrap(func, WRAP_FLIP_FLAG); } /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } // Expose `MapCache`. memoize.Cache = MapCache; /** * Creates a function that negates the result of the predicate `func`. The * `func` predicate is invoked with the `this` binding and arguments of the * created function. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. * @returns {Function} Returns the new negated function. * @example * * function isEven(n) { * return n % 2 == 0; * } * * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); * // => [1, 3, 5] */ function negate(predicate) { if (typeof predicate != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return function() { var args = arguments; switch (args.length) { case 0: return !predicate.call(this); case 1: return !predicate.call(this, args[0]); case 2: return !predicate.call(this, args[0], args[1]); case 3: return !predicate.call(this, args[0], args[1], args[2]); } return !predicate.apply(this, args); }; } /** * Creates a function that is restricted to invoking `func` once. Repeat calls * to the function return the value of the first invocation. The `func` is * invoked with the `this` binding and arguments of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var initialize = _.once(createApplication); * initialize(); * initialize(); * // => `createApplication` is invoked once */ function once(func) { return before(2, func); } /** * Creates a function that invokes `func` with its arguments transformed. * * @static * @since 4.0.0 * @memberOf _ * @category Function * @param {Function} func The function to wrap. * @param {...(Function|Function[])} [transforms=[_.identity]] * The argument transforms. * @returns {Function} Returns the new function. * @example * * function doubled(n) { * return n * 2; * } * * function square(n) { * return n * n; * } * * var func = _.overArgs(function(x, y) { * return [x, y]; * }, [square, doubled]); * * func(9, 3); * // => [81, 6] * * func(10, 5); * // => [100, 10] */ var overArgs = castRest(function(func, transforms) { transforms = (transforms.length == 1 && isArray(transforms[0])) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); var funcsLength = transforms.length; return baseRest(function(args) { var index = -1, length = nativeMin(args.length, funcsLength); while (++index < length) { args[index] = transforms[index].call(this, args[index]); } return apply(func, this, args); }); }); /** * Creates a function that invokes `func` with `partials` prepended to the * arguments it receives. This method is like `_.bind` except it does **not** * alter the `this` binding. * * The `_.partial.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 0.2.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var sayHelloTo = _.partial(greet, 'hello'); * sayHelloTo('fred'); * // => 'hello fred' * * // Partially applied with placeholders. * var greetFred = _.partial(greet, _, 'fred'); * greetFred('hi'); * // => 'hi fred' */ var partial = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partial)); return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); }); /** * This method is like `_.partial` except that partially applied arguments * are appended to the arguments it receives. * * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 1.0.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var greetFred = _.partialRight(greet, 'fred'); * greetFred('hi'); * // => 'hi fred' * * // Partially applied with placeholders. * var sayHelloTo = _.partialRight(greet, 'hello', _); * sayHelloTo('fred'); * // => 'hello fred' */ var partialRight = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)); return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); /** * Creates a function that invokes `func` with arguments arranged according * to the specified `indexes` where the argument value at the first index is * provided as the first argument, the argument value at the second index is * provided as the second argument, and so on. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to rearrange arguments for. * @param {...(number|number[])} indexes The arranged argument indexes. * @returns {Function} Returns the new function. * @example * * var rearged = _.rearg(function(a, b, c) { * return [a, b, c]; * }, [2, 0, 1]); * * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] */ var rearg = flatRest(function(func, indexes) { return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); }); /** * Creates a function that invokes `func` with the `this` binding of the * created function and arguments from `start` and beyond provided as * an array. * * **Note:** This method is based on the * [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. * @example * * var say = _.rest(function(what, names) { * return what + ' ' + _.initial(names).join(', ') + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); * }); * * say('hello', 'fred', 'barney', 'pebbles'); * // => 'hello fred, barney, & pebbles' */ function rest(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start === undefined ? start : toInteger(start); return baseRest(func, start); } /** * Creates a function that invokes `func` with the `this` binding of the * create function and an array of arguments much like * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). * * **Note:** This method is based on the * [spread operator](https://mdn.io/spread_operator). * * @static * @memberOf _ * @since 3.2.0 * @category Function * @param {Function} func The function to spread arguments over. * @param {number} [start=0] The start position of the spread. * @returns {Function} Returns the new function. * @example * * var say = _.spread(function(who, what) { * return who + ' says ' + what; * }); * * say(['fred', 'hello']); * // => 'fred says hello' * * var numbers = Promise.all([ * Promise.resolve(40), * Promise.resolve(36) * ]); * * numbers.then(_.spread(function(x, y) { * return x + y; * })); * // => a Promise of 76 */ function spread(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start == null ? 0 : nativeMax(toInteger(start), 0); return baseRest(function(args) { var array = args[start], otherArgs = castSlice(args, 0, start); if (array) { arrayPush(otherArgs, array); } return apply(func, this, otherArgs); }); } /** * Creates a throttled function that only invokes `func` at most once per * every `wait` milliseconds. The throttled function comes with a `cancel` * method to cancel delayed `func` invocations and a `flush` method to * immediately invoke them. Provide `options` to indicate whether `func` * should be invoked on the leading and/or trailing edge of the `wait` * timeout. The `func` is invoked with the last arguments provided to the * throttled function. Subsequent calls to the throttled function return the * result of the last `func` invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the throttled function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.throttle` and `_.debounce`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to throttle. * @param {number} [wait=0] The number of milliseconds to throttle invocations to. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=true] * Specify invoking on the leading edge of the timeout. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new throttled function. * @example * * // Avoid excessively updating the position while scrolling. * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); * * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); * jQuery(element).on('click', throttled); * * // Cancel the trailing throttled invocation. * jQuery(window).on('popstate', throttled.cancel); */ function throttle(func, wait, options) { var leading = true, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (isObject(options)) { leading = 'leading' in options ? !!options.leading : leading; trailing = 'trailing' in options ? !!options.trailing : trailing; } return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing }); } /** * Creates a function that accepts up to one argument, ignoring any * additional arguments. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.unary(parseInt)); * // => [6, 8, 10] */ function unary(func) { return ary(func, 1); } /** * Creates a function that provides `value` to `wrapper` as its first * argument. Any additional arguments provided to the function are appended * to those provided to the `wrapper`. The wrapper is invoked with the `this` * binding of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {*} value The value to wrap. * @param {Function} [wrapper=identity] The wrapper function. * @returns {Function} Returns the new function. * @example * * var p = _.wrap(_.escape, function(func, text) { * return '

          ' + func(text) + '

          '; * }); * * p('fred, barney, & pebbles'); * // => '

          fred, barney, & pebbles

          ' */ function wrap(value, wrapper) { return partial(castFunction(wrapper), value); } /*------------------------------------------------------------------------*/ /** * Casts `value` as an array if it's not one. * * @static * @memberOf _ * @since 4.4.0 * @category Lang * @param {*} value The value to inspect. * @returns {Array} Returns the cast array. * @example * * _.castArray(1); * // => [1] * * _.castArray({ 'a': 1 }); * // => [{ 'a': 1 }] * * _.castArray('abc'); * // => ['abc'] * * _.castArray(null); * // => [null] * * _.castArray(undefined); * // => [undefined] * * _.castArray(); * // => [] * * var array = [1, 2, 3]; * console.log(_.castArray(array) === array); * // => true */ function castArray() { if (!arguments.length) { return []; } var value = arguments[0]; return isArray(value) ? value : [value]; } /** * Creates a shallow clone of `value`. * * **Note:** This method is loosely based on the * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) * and supports cloning arrays, array buffers, booleans, date objects, maps, * numbers, `Object` objects, regexes, sets, strings, symbols, and typed * arrays. The own enumerable properties of `arguments` objects are cloned * as plain objects. An empty object is returned for uncloneable values such * as error objects, functions, DOM nodes, and WeakMaps. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to clone. * @returns {*} Returns the cloned value. * @see _.cloneDeep * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var shallow = _.clone(objects); * console.log(shallow[0] === objects[0]); * // => true */ function clone(value) { return baseClone(value, CLONE_SYMBOLS_FLAG); } /** * This method is like `_.clone` except that it accepts `customizer` which * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with * up to four arguments; (value [, index|key, object, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the cloned value. * @see _.cloneDeepWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(false); * } * } * * var el = _.cloneWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 0 */ function cloneWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); } /** * This method is like `_.clone` except that it recursively clones `value`. * * @static * @memberOf _ * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. * @see _.clone * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var deep = _.cloneDeep(objects); * console.log(deep[0] === objects[0]); * // => false */ function cloneDeep(value) { return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } /** * This method is like `_.cloneWith` except that it recursively clones `value`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to recursively clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the deep cloned value. * @see _.cloneWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(true); * } * } * * var el = _.cloneDeepWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 20 */ function cloneDeepWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); } /** * Checks if `object` conforms to `source` by invoking the predicate * properties of `source` with the corresponding property values of `object`. * * **Note:** This method is equivalent to `_.conforms` when `source` is * partially applied. * * @static * @memberOf _ * @since 4.14.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); * // => true * * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); * // => false */ function conformsTo(object, source) { return source == null || baseConformsTo(object, source, keys(source)); } /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } /** * Checks if `value` is greater than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. * @see _.lt * @example * * _.gt(3, 1); * // => true * * _.gt(3, 3); * // => false * * _.gt(1, 3); * // => false */ var gt = createRelationalOperation(baseGt); /** * Checks if `value` is greater than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than or equal to * `other`, else `false`. * @see _.lte * @example * * _.gte(3, 1); * // => true * * _.gte(3, 3); * // => true * * _.gte(1, 3); * // => false */ var gte = createRelationalOperation(function(value, other) { return value >= other; }); /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is classified as an `ArrayBuffer` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. * @example * * _.isArrayBuffer(new ArrayBuffer(2)); * // => true * * _.isArrayBuffer(new Array(2)); * // => false */ var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } /** * Checks if `value` is classified as a boolean primitive or object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. * @example * * _.isBoolean(false); * // => true * * _.isBoolean(null); * // => false */ function isBoolean(value) { return value === true || value === false || (isObjectLike(value) && baseGetTag(value) == boolTag); } /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; /** * Checks if `value` is classified as a `Date` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * _.isDate(new Date); * // => true * * _.isDate('Mon April 23 2012'); * // => false */ var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; /** * Checks if `value` is likely a DOM element. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. * @example * * _.isElement(document.body); * // => true * * _.isElement(''); * // => false */ function isElement(value) { return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); } /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */ function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } return true; } /** * Performs a deep comparison between two values to determine if they are * equivalent. * * **Note:** This method supports comparing arrays, array buffers, booleans, * date objects, error objects, maps, numbers, `Object` objects, regexes, * sets, strings, symbols, and typed arrays. `Object` objects are compared * by their own, not inherited, enumerable properties. Functions and DOM * nodes are compared by strict equality, i.e. `===`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true * * object === other; * // => false */ function isEqual(value, other) { return baseIsEqual(value, other); } /** * This method is like `_.isEqual` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with up to * six arguments: (objValue, othValue [, index|key, object, other, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, othValue) { * if (isGreeting(objValue) && isGreeting(othValue)) { * return true; * } * } * * var array = ['hello', 'goodbye']; * var other = ['hi', 'goodbye']; * * _.isEqualWith(array, other, customizer); * // => true */ function isEqualWith(value, other, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; var result = customizer ? customizer(value, other) : undefined; return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; } /** * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, * `SyntaxError`, `TypeError`, or `URIError` object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * * _.isError(new Error); * // => true * * _.isError(Error); * // => false */ function isError(value) { if (!isObjectLike(value)) { return false; } var tag = baseGetTag(value); return tag == errorTag || tag == domExcTag || (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); } /** * Checks if `value` is a finite primitive number. * * **Note:** This method is based on * [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. * @example * * _.isFinite(3); * // => true * * _.isFinite(Number.MIN_VALUE); * // => true * * _.isFinite(Infinity); * // => false * * _.isFinite('3'); * // => false */ function isFinite(value) { return typeof value == 'number' && nativeIsFinite(value); } /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } /** * Checks if `value` is an integer. * * **Note:** This method is based on * [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an integer, else `false`. * @example * * _.isInteger(3); * // => true * * _.isInteger(Number.MIN_VALUE); * // => false * * _.isInteger(Infinity); * // => false * * _.isInteger('3'); * // => false */ function isInteger(value) { return typeof value == 'number' && value == toInteger(value); } /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } /** * Checks if `value` is classified as a `Map` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * * _.isMap(new Map); * // => true * * _.isMap(new WeakMap); * // => false */ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; /** * Performs a partial deep comparison between `object` and `source` to * determine if `object` contains equivalent property values. * * **Note:** This method is equivalent to `_.matches` when `source` is * partially applied. * * Partial comparisons will match empty array and empty object `source` * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.isMatch(object, { 'b': 2 }); * // => true * * _.isMatch(object, { 'b': 1 }); * // => false */ function isMatch(object, source) { return object === source || baseIsMatch(object, source, getMatchData(source)); } /** * This method is like `_.isMatch` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with five * arguments: (objValue, srcValue, index|key, object, source). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, srcValue) { * if (isGreeting(objValue) && isGreeting(srcValue)) { * return true; * } * } * * var object = { 'greeting': 'hello' }; * var source = { 'greeting': 'hi' }; * * _.isMatchWith(object, source, customizer); * // => true */ function isMatchWith(object, source, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseIsMatch(object, source, getMatchData(source), customizer); } /** * Checks if `value` is `NaN`. * * **Note:** This method is based on * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for * `undefined` and other non-number values. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. * @example * * _.isNaN(NaN); * // => true * * _.isNaN(new Number(NaN)); * // => true * * isNaN(undefined); * // => true * * _.isNaN(undefined); * // => false */ function isNaN(value) { // An `NaN` primitive is the only value that is not equal to itself. // Perform the `toStringTag` check first to avoid errors with some // ActiveX objects in IE. return isNumber(value) && value != +value; } /** * Checks if `value` is a pristine native function. * * **Note:** This method can't reliably detect native functions in the presence * of the core-js package because core-js circumvents this kind of detection. * Despite multiple requests, the core-js maintainer has made it clear: any * attempt to fix the detection will be obstructed. As a result, we're left * with little choice but to throw an error. Unfortunately, this also affects * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), * which rely on core-js. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. * @example * * _.isNative(Array.prototype.push); * // => true * * _.isNative(_); * // => false */ function isNative(value) { if (isMaskable(value)) { throw new Error(CORE_ERROR_TEXT); } return baseIsNative(value); } /** * Checks if `value` is `null`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `null`, else `false`. * @example * * _.isNull(null); * // => true * * _.isNull(void 0); * // => false */ function isNull(value) { return value === null; } /** * Checks if `value` is `null` or `undefined`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is nullish, else `false`. * @example * * _.isNil(null); * // => true * * _.isNil(void 0); * // => true * * _.isNil(NaN); * // => false */ function isNil(value) { return value == null; } /** * Checks if `value` is classified as a `Number` primitive or object. * * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * * _.isNumber(3); * // => true * * _.isNumber(Number.MIN_VALUE); * // => true * * _.isNumber(Infinity); * // => true * * _.isNumber('3'); * // => false */ function isNumber(value) { return typeof value == 'number' || (isObjectLike(value) && baseGetTag(value) == numberTag); } /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } /** * Checks if `value` is classified as a `RegExp` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. * @example * * _.isRegExp(/abc/); * // => true * * _.isRegExp('/abc/'); * // => false */ var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; /** * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 * double precision number which isn't the result of a rounded unsafe integer. * * **Note:** This method is based on * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. * @example * * _.isSafeInteger(3); * // => true * * _.isSafeInteger(Number.MIN_VALUE); * // => false * * _.isSafeInteger(Infinity); * // => false * * _.isSafeInteger('3'); * // => false */ function isSafeInteger(value) { return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is classified as a `Set` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * * _.isSet(new Set); * // => true * * _.isSet(new WeakSet); * // => false */ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && baseGetTag(value) == symbolTag); } /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; /** * Checks if `value` is `undefined`. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. * @example * * _.isUndefined(void 0); * // => true * * _.isUndefined(null); * // => false */ function isUndefined(value) { return value === undefined; } /** * Checks if `value` is classified as a `WeakMap` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. * @example * * _.isWeakMap(new WeakMap); * // => true * * _.isWeakMap(new Map); * // => false */ function isWeakMap(value) { return isObjectLike(value) && getTag(value) == weakMapTag; } /** * Checks if `value` is classified as a `WeakSet` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. * @example * * _.isWeakSet(new WeakSet); * // => true * * _.isWeakSet(new Set); * // => false */ function isWeakSet(value) { return isObjectLike(value) && baseGetTag(value) == weakSetTag; } /** * Checks if `value` is less than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. * @see _.gt * @example * * _.lt(1, 3); * // => true * * _.lt(3, 3); * // => false * * _.lt(3, 1); * // => false */ var lt = createRelationalOperation(baseLt); /** * Checks if `value` is less than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than or equal to * `other`, else `false`. * @see _.gte * @example * * _.lte(1, 3); * // => true * * _.lte(3, 3); * // => true * * _.lte(3, 1); * // => false */ var lte = createRelationalOperation(function(value, other) { return value <= other; }); /** * Converts `value` to an array. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to convert. * @returns {Array} Returns the converted array. * @example * * _.toArray({ 'a': 1, 'b': 2 }); * // => [1, 2] * * _.toArray('abc'); * // => ['a', 'b', 'c'] * * _.toArray(1); * // => [] * * _.toArray(null); * // => [] */ function toArray(value) { if (!value) { return []; } if (isArrayLike(value)) { return isString(value) ? stringToArray(value) : copyArray(value); } if (symIterator && value[symIterator]) { return iteratorToArray(value[symIterator]()); } var tag = getTag(value), func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); return func(value); } /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = (value < 0 ? -1 : 1); return sign * MAX_INTEGER; } return value === value ? value : 0; } /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? (remainder ? result - remainder : result) : 0; } /** * Converts `value` to an integer suitable for use as the length of an * array-like object. * * **Note:** This method is based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toLength(3.2); * // => 3 * * _.toLength(Number.MIN_VALUE); * // => 0 * * _.toLength(Infinity); * // => 4294967295 * * _.toLength('3.2'); * // => 3 */ function toLength(value) { return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; } /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); } /** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return copyObject(value, keysIn(value)); } /** * Converts `value` to a safe integer. A safe integer can be compared and * represented correctly. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toSafeInteger(3.2); * // => 3 * * _.toSafeInteger(Number.MIN_VALUE); * // => 0 * * _.toSafeInteger(Infinity); * // => 9007199254740991 * * _.toSafeInteger('3.2'); * // => 3 */ function toSafeInteger(value) { return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : (value === 0 ? value : 0); } /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } /*------------------------------------------------------------------------*/ /** * Assigns own enumerable string keyed properties of source objects to the * destination object. Source objects are applied from left to right. * Subsequent sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object` and is loosely based on * [`Object.assign`](https://mdn.io/Object/assign). * * @static * @memberOf _ * @since 0.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assignIn * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assign({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function(object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } for (var key in source) { if (hasOwnProperty.call(source, key)) { assignValue(object, key, source[key]); } } }); /** * This method is like `_.assign` except that it iterates over own and * inherited source properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extend * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assign * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assignIn({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function(object, source) { copyObject(source, keysIn(source), object); }); /** * This method is like `_.assignIn` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extendWith * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignInWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keysIn(source), object, customizer); }); /** * This method is like `_.assign` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignInWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keys(source), object, customizer); }); /** * Creates an array of values corresponding to `paths` of `object`. * * @static * @memberOf _ * @since 1.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Array} Returns the picked values. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _.at(object, ['a[0].b.c', 'a[1]']); * // => [3, 4] */ var at = flatRest(baseAt); /** * Creates an object that inherits from the `prototype` object. If a * `properties` object is given, its own enumerable string keyed properties * are assigned to the created object. * * @static * @memberOf _ * @since 2.3.0 * @category Object * @param {Object} prototype The object to inherit from. * @param {Object} [properties] The properties to assign to the object. * @returns {Object} Returns the new object. * @example * * function Shape() { * this.x = 0; * this.y = 0; * } * * function Circle() { * Shape.call(this); * } * * Circle.prototype = _.create(Shape.prototype, { * 'constructor': Circle * }); * * var circle = new Circle; * circle instanceof Circle; * // => true * * circle instanceof Shape; * // => true */ function create(prototype, properties) { var result = baseCreate(prototype); return properties == null ? result : baseAssign(result, properties); } /** * Assigns own and inherited enumerable string keyed properties of source * objects to the destination object for all destination properties that * resolve to `undefined`. Source objects are applied from left to right. * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaultsDeep * @example * * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var defaults = baseRest(function(object, sources) { object = Object(object); var index = -1; var length = sources.length; var guard = length > 2 ? sources[2] : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index < length) { var source = sources[index]; var props = keysIn(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key = props[propsIndex]; var value = object[key]; if (value === undefined || (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { object[key] = source[key]; } } } return object; }); /** * This method is like `_.defaults` except that it recursively assigns * default properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaults * @example * * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); * // => { 'a': { 'b': 2, 'c': 3 } } */ var defaultsDeep = baseRest(function(args) { args.push(undefined, customDefaultsMerge); return apply(mergeWith, undefined, args); }); /** * This method is like `_.find` except that it returns the key of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findKey(users, function(o) { return o.age < 40; }); * // => 'barney' (iteration order is not guaranteed) * * // The `_.matches` iteratee shorthand. * _.findKey(users, { 'age': 1, 'active': true }); * // => 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.findKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findKey(users, 'active'); * // => 'barney' */ function findKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); } /** * This method is like `_.findKey` except that it iterates over elements of * a collection in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findLastKey(users, function(o) { return o.age < 40; }); * // => returns 'pebbles' assuming `_.findKey` returns 'barney' * * // The `_.matches` iteratee shorthand. * _.findLastKey(users, { 'age': 36, 'active': true }); * // => 'barney' * * // The `_.matchesProperty` iteratee shorthand. * _.findLastKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findLastKey(users, 'active'); * // => 'pebbles' */ function findLastKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); } /** * Iterates over own and inherited enumerable string keyed properties of an * object and invokes `iteratee` for each property. The iteratee is invoked * with three arguments: (value, key, object). Iteratee functions may exit * iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forInRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forIn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). */ function forIn(object, iteratee) { return object == null ? object : baseFor(object, getIteratee(iteratee, 3), keysIn); } /** * This method is like `_.forIn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forIn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forInRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. */ function forInRight(object, iteratee) { return object == null ? object : baseForRight(object, getIteratee(iteratee, 3), keysIn); } /** * Iterates over own enumerable string keyed properties of an object and * invokes `iteratee` for each property. The iteratee is invoked with three * arguments: (value, key, object). Iteratee functions may exit iteration * early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwnRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { return object && baseForOwn(object, getIteratee(iteratee, 3)); } /** * This method is like `_.forOwn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwnRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ function forOwnRight(object, iteratee) { return object && baseForOwnRight(object, getIteratee(iteratee, 3)); } /** * Creates an array of function property names from own enumerable properties * of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functionsIn * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functions(new Foo); * // => ['a', 'b'] */ function functions(object) { return object == null ? [] : baseFunctions(object, keys(object)); } /** * Creates an array of function property names from own and inherited * enumerable properties of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functions * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functionsIn(new Foo); * // => ['a', 'b', 'c'] */ function functionsIn(object) { return object == null ? [] : baseFunctions(object, keysIn(object)); } /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } /** * Checks if `path` is a direct property of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = { 'a': { 'b': 2 } }; * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * * _.has(object, 'a.b'); * // => true * * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { return object != null && hasPath(object, path, baseHas); } /** * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * * _.hasIn(object, 'a.b'); * // => true * * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { return object != null && hasPath(object, path, baseHasIn); } /** * Creates an object composed of the inverted keys and values of `object`. * If `object` contains duplicate values, subsequent values overwrite * property assignments of previous values. * * @static * @memberOf _ * @since 0.7.0 * @category Object * @param {Object} object The object to invert. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invert(object); * // => { '1': 'c', '2': 'b' } */ var invert = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } result[value] = key; }, constant(identity)); /** * This method is like `_.invert` except that the inverted object is generated * from the results of running each element of `object` thru `iteratee`. The * corresponding inverted value of each inverted key is an array of keys * responsible for generating the inverted value. The iteratee is invoked * with one argument: (value). * * @static * @memberOf _ * @since 4.1.0 * @category Object * @param {Object} object The object to invert. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invertBy(object); * // => { '1': ['a', 'c'], '2': ['b'] } * * _.invertBy(object, function(value) { * return 'group' + value; * }); * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ var invertBy = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } if (hasOwnProperty.call(result, value)) { result[value].push(key); } else { result[value] = [key]; } }, getIteratee); /** * Invokes the method at `path` of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. * @example * * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; * * _.invoke(object, 'a[0].b.c.slice', 1, 3); * // => [2, 3] */ var invoke = baseRest(baseInvoke); /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } /** * The opposite of `_.mapValues`; this method creates an object with the * same values as `object` and keys generated by running each own enumerable * string keyed property of `object` thru `iteratee`. The iteratee is invoked * with three arguments: (value, key, object). * * @static * @memberOf _ * @since 3.8.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapValues * @example * * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { * return key + value; * }); * // => { 'a1': 1, 'b2': 2 } */ function mapKeys(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, iteratee(value, key, object), value); }); return result; } /** * Creates an object with the same keys as `object` and values generated * by running each own enumerable string keyed property of `object` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, key, object). * * @static * @memberOf _ * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapKeys * @example * * var users = { * 'fred': { 'user': 'fred', 'age': 40 }, * 'pebbles': { 'user': 'pebbles', 'age': 1 } * }; * * _.mapValues(users, function(o) { return o.age; }); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) * * // The `_.property` iteratee shorthand. * _.mapValues(users, 'age'); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ function mapValues(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, key, iteratee(value, key, object)); }); return result; } /** * This method is like `_.assign` except that it recursively merges own and * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are * skipped if a destination value exists. Array and plain object properties * are merged recursively. Other objects and value types are overridden by * assignment. Source objects are applied from left to right. Subsequent * sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 0.5.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @example * * var object = { * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * * var other = { * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); }); /** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source * properties. If `customizer` returns `undefined`, merging is handled by the * method instead. The `customizer` is invoked with six arguments: * (objValue, srcValue, key, object, source, stack). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} customizer The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * function customizer(objValue, srcValue) { * if (_.isArray(objValue)) { * return objValue.concat(srcValue); * } * } * * var object = { 'a': [1], 'b': [2] }; * var other = { 'a': [3], 'b': [4] }; * * _.mergeWith(object, other, customizer); * // => { 'a': [1, 3], 'b': [2, 4] } */ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); /** * The opposite of `_.pick`; this method creates an object composed of the * own and inherited enumerable property paths of `object` that are not omitted. * * **Note:** This method is considerably slower than `_.pick`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to omit. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ var omit = flatRest(function(object, paths) { var result = {}; if (object == null) { return result; } var isDeep = false; paths = arrayMap(paths, function(path) { path = castPath(path, object); isDeep || (isDeep = path.length > 1); return path; }); copyObject(object, getAllKeysIn(object), result); if (isDeep) { result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } var length = paths.length; while (length--) { baseUnset(result, paths[length]); } return result; }); /** * The opposite of `_.pickBy`; this method creates an object composed of * the own and inherited enumerable string keyed properties of `object` that * `predicate` doesn't return truthy for. The predicate is invoked with two * arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omitBy(object, _.isNumber); * // => { 'b': '2' } */ function omitBy(object, predicate) { return pickBy(object, negate(getIteratee(predicate))); } /** * Creates an object composed of the picked `object` properties. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); /** * Creates an object composed of the `object` properties `predicate` returns * truthy for. The predicate is invoked with two arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pickBy(object, _.isNumber); * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { if (object == null) { return {}; } var props = arrayMap(getAllKeysIn(object), function(prop) { return [prop]; }); predicate = getIteratee(predicate); return basePickBy(object, props, function(value, path) { return predicate(value, path[0]); }); } /** * This method is like `_.get` except that if the resolved value is a * function it's invoked with the `this` binding of its parent object and * its result is returned. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to resolve. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; * * _.result(object, 'a[0].b.c1'); * // => 3 * * _.result(object, 'a[0].b.c2'); * // => 4 * * _.result(object, 'a[0].b.c3', 'default'); * // => 'default' * * _.result(object, 'a[0].b.c3', _.constant('default')); * // => 'default' */ function result(object, path, defaultValue) { path = castPath(path, object); var index = -1, length = path.length; // Ensure the loop is entered when path is empty. if (!length) { length = 1; object = undefined; } while (++index < length) { var value = object == null ? undefined : object[toKey(path[index])]; if (value === undefined) { index = length; value = defaultValue; } object = isFunction(value) ? value.call(object) : value; } return object; } /** * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.set(object, 'a[0].b.c', 4); * console.log(object.a[0].b.c); * // => 4 * * _.set(object, ['x', '0', 'y', 'z'], 5); * console.log(object.x[0].y.z); * // => 5 */ function set(object, path, value) { return object == null ? object : baseSet(object, path, value); } /** * This method is like `_.set` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.setWith(object, '[0][1]', 'a', Object); * // => { '0': { '1': 'a' } } */ function setWith(object, path, value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseSet(object, path, value, customizer); } /** * Creates an array of own enumerable string keyed-value pairs for `object` * which can be consumed by `_.fromPairs`. If `object` is a map or set, its * entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entries * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairs(new Foo); * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) */ var toPairs = createToPairs(keys); /** * Creates an array of own and inherited enumerable string keyed-value pairs * for `object` which can be consumed by `_.fromPairs`. If `object` is a map * or set, its entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entriesIn * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairsIn(new Foo); * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) */ var toPairsIn = createToPairs(keysIn); /** * An alternative to `_.reduce`; this method transforms `object` to a new * `accumulator` object which is the result of running each of its own * enumerable string keyed properties thru `iteratee`, with each invocation * potentially mutating the `accumulator` object. If `accumulator` is not * provided, a new object with the same `[[Prototype]]` will be used. The * iteratee is invoked with four arguments: (accumulator, value, key, object). * Iteratee functions may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 1.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The custom accumulator value. * @returns {*} Returns the accumulated value. * @example * * _.transform([2, 3, 4], function(result, n) { * result.push(n *= n); * return n % 2 == 0; * }, []); * // => [4, 9] * * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); iteratee = getIteratee(iteratee, 4); if (accumulator == null) { var Ctor = object && object.constructor; if (isArrLike) { accumulator = isArr ? new Ctor : []; } else if (isObject(object)) { accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } else { accumulator = {}; } } (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; } /** * Removes the property at `path` of `object`. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. * @example * * var object = { 'a': [{ 'b': { 'c': 7 } }] }; * _.unset(object, 'a[0].b.c'); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; * * _.unset(object, ['a', '0', 'b', 'c']); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; */ function unset(object, path) { return object == null ? true : baseUnset(object, path); } /** * This method is like `_.set` except that accepts `updater` to produce the * value to set. Use `_.updateWith` to customize `path` creation. The `updater` * is invoked with one argument: (value). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.update(object, 'a[0].b.c', function(n) { return n * n; }); * console.log(object.a[0].b.c); * // => 9 * * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); * console.log(object.x[0].y.z); * // => 0 */ function update(object, path, updater) { return object == null ? object : baseUpdate(object, path, castFunction(updater)); } /** * This method is like `_.update` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.updateWith(object, '[0][1]', _.constant('a'), Object); * // => { '0': { '1': 'a' } } */ function updateWith(object, path, updater, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); } /** * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.values(new Foo); * // => [1, 2] (iteration order is not guaranteed) * * _.values('hi'); * // => ['h', 'i'] */ function values(object) { return object == null ? [] : baseValues(object, keys(object)); } /** * Creates an array of the own and inherited enumerable string keyed property * values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.valuesIn(new Foo); * // => [1, 2, 3] (iteration order is not guaranteed) */ function valuesIn(object) { return object == null ? [] : baseValues(object, keysIn(object)); } /*------------------------------------------------------------------------*/ /** * Clamps `number` within the inclusive `lower` and `upper` bounds. * * @static * @memberOf _ * @since 4.0.0 * @category Number * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. * @example * * _.clamp(-10, -5, 5); * // => -5 * * _.clamp(10, -5, 5); * // => 5 */ function clamp(number, lower, upper) { if (upper === undefined) { upper = lower; lower = undefined; } if (upper !== undefined) { upper = toNumber(upper); upper = upper === upper ? upper : 0; } if (lower !== undefined) { lower = toNumber(lower); lower = lower === lower ? lower : 0; } return baseClamp(toNumber(number), lower, upper); } /** * Checks if `n` is between `start` and up to, but not including, `end`. If * `end` is not specified, it's set to `start` with `start` then set to `0`. * If `start` is greater than `end` the params are swapped to support * negative ranges. * * @static * @memberOf _ * @since 3.3.0 * @category Number * @param {number} number The number to check. * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. * @see _.range, _.rangeRight * @example * * _.inRange(3, 2, 4); * // => true * * _.inRange(4, 8); * // => true * * _.inRange(4, 2); * // => false * * _.inRange(2, 2); * // => false * * _.inRange(1.2, 2); * // => true * * _.inRange(5.2, 4); * // => false * * _.inRange(-3, -2, -6); * // => true */ function inRange(number, start, end) { start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } number = toNumber(number); return baseInRange(number, start, end); } /** * Produces a random number between the inclusive `lower` and `upper` bounds. * If only one argument is provided a number between `0` and the given number * is returned. If `floating` is `true`, or either `lower` or `upper` are * floats, a floating-point number is returned instead of an integer. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static * @memberOf _ * @since 0.7.0 * @category Number * @param {number} [lower=0] The lower bound. * @param {number} [upper=1] The upper bound. * @param {boolean} [floating] Specify returning a floating-point number. * @returns {number} Returns the random number. * @example * * _.random(0, 5); * // => an integer between 0 and 5 * * _.random(5); * // => also an integer between 0 and 5 * * _.random(5, true); * // => a floating-point number between 0 and 5 * * _.random(1.2, 5.2); * // => a floating-point number between 1.2 and 5.2 */ function random(lower, upper, floating) { if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { upper = floating = undefined; } if (floating === undefined) { if (typeof upper == 'boolean') { floating = upper; upper = undefined; } else if (typeof lower == 'boolean') { floating = lower; lower = undefined; } } if (lower === undefined && upper === undefined) { lower = 0; upper = 1; } else { lower = toFinite(lower); if (upper === undefined) { upper = lower; lower = 0; } else { upper = toFinite(upper); } } if (lower > upper) { var temp = lower; lower = upper; upper = temp; } if (floating || lower % 1 || upper % 1) { var rand = nativeRandom(); return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); } return baseRandom(lower, upper); } /*------------------------------------------------------------------------*/ /** * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the camel cased string. * @example * * _.camelCase('Foo Bar'); * // => 'fooBar' * * _.camelCase('--foo-bar--'); * // => 'fooBar' * * _.camelCase('__FOO_BAR__'); * // => 'fooBar' */ var camelCase = createCompounder(function(result, word, index) { word = word.toLowerCase(); return result + (index ? capitalize(word) : word); }); /** * Converts the first character of `string` to upper case and the remaining * to lower case. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to capitalize. * @returns {string} Returns the capitalized string. * @example * * _.capitalize('FRED'); * // => 'Fred' */ function capitalize(string) { return upperFirst(toString(string).toLowerCase()); } /** * Deburrs `string` by converting * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) * letters to basic Latin letters and removing * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to deburr. * @returns {string} Returns the deburred string. * @example * * _.deburr('déjà vu'); * // => 'deja vu' */ function deburr(string) { string = toString(string); return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); } /** * Checks if `string` ends with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to search up to. * @returns {boolean} Returns `true` if `string` ends with `target`, * else `false`. * @example * * _.endsWith('abc', 'c'); * // => true * * _.endsWith('abc', 'b'); * // => false * * _.endsWith('abc', 'b', 2); * // => true */ function endsWith(string, target, position) { string = toString(string); target = baseToString(target); var length = string.length; position = position === undefined ? length : baseClamp(toInteger(position), 0, length); var end = position; position -= target.length; return position >= 0 && string.slice(position, end) == target; } /** * Converts the characters "&", "<", ">", '"', and "'" in `string` to their * corresponding HTML entities. * * **Note:** No other characters are escaped. To escape additional * characters use a third-party library like [_he_](https://mths.be/he). * * Though the ">" character is escaped for symmetry, characters like * ">" and "/" don't need escaping in HTML and have no special meaning * unless they're part of a tag or unquoted attribute value. See * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * When working with HTML you should always * [quote attribute values](http://wonko.com/post/html-escaping) to reduce * XSS vectors. * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escape('fred, barney, & pebbles'); * // => 'fred, barney, & pebbles' */ function escape(string) { string = toString(string); return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; } /** * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escapeRegExp('[lodash](https://lodash.com/)'); * // => '\[lodash\]\(https://lodash\.com/\)' */ function escapeRegExp(string) { string = toString(string); return (string && reHasRegExpChar.test(string)) ? string.replace(reRegExpChar, '\\$&') : string; } /** * Converts `string` to * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the kebab cased string. * @example * * _.kebabCase('Foo Bar'); * // => 'foo-bar' * * _.kebabCase('fooBar'); * // => 'foo-bar' * * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' */ var kebabCase = createCompounder(function(result, word, index) { return result + (index ? '-' : '') + word.toLowerCase(); }); /** * Converts `string`, as space separated words, to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * * _.lowerCase('--Foo-Bar--'); * // => 'foo bar' * * _.lowerCase('fooBar'); * // => 'foo bar' * * _.lowerCase('__FOO_BAR__'); * // => 'foo bar' */ var lowerCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + word.toLowerCase(); }); /** * Converts the first character of `string` to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. * @example * * _.lowerFirst('Fred'); * // => 'fred' * * _.lowerFirst('FRED'); * // => 'fRED' */ var lowerFirst = createCaseFirst('toLowerCase'); /** * Pads `string` on the left and right sides if it's shorter than `length`. * Padding characters are truncated if they can't be evenly divided by `length`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.pad('abc', 8); * // => ' abc ' * * _.pad('abc', 8, '_-'); * // => '_-abc_-_' * * _.pad('abc', 3); * // => 'abc' */ function pad(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; if (!length || strLength >= length) { return string; } var mid = (length - strLength) / 2; return ( createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars) ); } /** * Pads `string` on the right side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padEnd('abc', 6); * // => 'abc ' * * _.padEnd('abc', 6, '_-'); * // => 'abc_-_' * * _.padEnd('abc', 3); * // => 'abc' */ function padEnd(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (string + createPadding(length - strLength, chars)) : string; } /** * Pads `string` on the left side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padStart('abc', 6); * // => ' abc' * * _.padStart('abc', 6, '_-'); * // => '_-_abc' * * _.padStart('abc', 3); * // => 'abc' */ function padStart(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (createPadding(length - strLength, chars) + string) : string; } /** * Converts `string` to an integer of the specified radix. If `radix` is * `undefined` or `0`, a `radix` of `10` is used unless `value` is a * hexadecimal, in which case a `radix` of `16` is used. * * **Note:** This method aligns with the * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. * * @static * @memberOf _ * @since 1.1.0 * @category String * @param {string} string The string to convert. * @param {number} [radix=10] The radix to interpret `value` by. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {number} Returns the converted integer. * @example * * _.parseInt('08'); * // => 8 * * _.map(['6', '08', '10'], _.parseInt); * // => [6, 8, 10] */ function parseInt(string, radix, guard) { if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); } /** * Repeats the given string `n` times. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to repeat. * @param {number} [n=1] The number of times to repeat the string. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the repeated string. * @example * * _.repeat('*', 3); * // => '***' * * _.repeat('abc', 2); * // => 'abcabc' * * _.repeat('abc', 0); * // => '' */ function repeat(string, n, guard) { if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } return baseRepeat(toString(string), n); } /** * Replaces matches for `pattern` in `string` with `replacement`. * * **Note:** This method is based on * [`String#replace`](https://mdn.io/String/replace). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to modify. * @param {RegExp|string} pattern The pattern to replace. * @param {Function|string} replacement The match replacement. * @returns {string} Returns the modified string. * @example * * _.replace('Hi Fred', 'Fred', 'Barney'); * // => 'Hi Barney' */ function replace() { var args = arguments, string = toString(args[0]); return args.length < 3 ? string : string.replace(args[1], args[2]); } /** * Converts `string` to * [snake case](https://en.wikipedia.org/wiki/Snake_case). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the snake cased string. * @example * * _.snakeCase('Foo Bar'); * // => 'foo_bar' * * _.snakeCase('fooBar'); * // => 'foo_bar' * * _.snakeCase('--FOO-BAR--'); * // => 'foo_bar' */ var snakeCase = createCompounder(function(result, word, index) { return result + (index ? '_' : '') + word.toLowerCase(); }); /** * Splits `string` by `separator`. * * **Note:** This method is based on * [`String#split`](https://mdn.io/String/split). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to split. * @param {RegExp|string} separator The separator pattern to split by. * @param {number} [limit] The length to truncate results to. * @returns {Array} Returns the string segments. * @example * * _.split('a-b-c', '-', 2); * // => ['a', 'b'] */ function split(string, separator, limit) { if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { separator = limit = undefined; } limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; if (!limit) { return []; } string = toString(string); if (string && ( typeof separator == 'string' || (separator != null && !isRegExp(separator)) )) { separator = baseToString(separator); if (!separator && hasUnicode(string)) { return castSlice(stringToArray(string), 0, limit); } } return string.split(separator, limit); } /** * Converts `string` to * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). * * @static * @memberOf _ * @since 3.1.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the start cased string. * @example * * _.startCase('--foo-bar--'); * // => 'Foo Bar' * * _.startCase('fooBar'); * // => 'Foo Bar' * * _.startCase('__FOO_BAR__'); * // => 'FOO BAR' */ var startCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + upperFirst(word); }); /** * Checks if `string` starts with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. * @returns {boolean} Returns `true` if `string` starts with `target`, * else `false`. * @example * * _.startsWith('abc', 'a'); * // => true * * _.startsWith('abc', 'b'); * // => false * * _.startsWith('abc', 'b', 1); * // => true */ function startsWith(string, target, position) { string = toString(string); position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); target = baseToString(target); return string.slice(position, position + target.length) == target; } /** * Creates a compiled template function that can interpolate data properties * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * properties may be accessed as free variables in the template. If a setting * object is given, it takes precedence over `_.templateSettings` values. * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) * for easier debugging. * * For more information on precompiling templates see * [lodash's custom builds documentation](https://lodash.com/custom-builds). * * For more information on Chrome extension sandboxes see * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The template string. * @param {Object} [options={}] The options object. * @param {RegExp} [options.escape=_.templateSettings.escape] * The HTML "escape" delimiter. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] * The "evaluate" delimiter. * @param {Object} [options.imports=_.templateSettings.imports] * An object to import into the template as free variables. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] * The "interpolate" delimiter. * @param {string} [options.sourceURL='lodash.templateSources[n]'] * The sourceURL of the compiled template. * @param {string} [options.variable='obj'] * The data object variable name. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the compiled template function. * @example * * // Use the "interpolate" delimiter to create a compiled template. * var compiled = _.template('hello <%= user %>!'); * compiled({ 'user': 'fred' }); * // => 'hello fred!' * * // Use the HTML "escape" delimiter to escape data property values. * var compiled = _.template('<%- value %>'); * compiled({ 'value': '

          Microsoft Application Insights JavaScript SDK - AISKU

          ================================================ FILE: examples/AISKU/package.json ================================================ { "name": "@microsoft/applicationinsights-example-aisku", "author": "Microsoft Application Insights Team", "version": "3.4.1", "description": "Microsoft Application Insights AISKU Example", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "keywords": [ "azure", "cloud", "script errors", "microsoft", "application insights", "browser performance monitoring", "web analytics", "example" ], "scripts": { "clean": "git clean -xdf", "build": "npm run build:esm && npm run build:browser", "build:esm": "grunt example-aisku", "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs", "rebuild": "npm run build", "test": "", "mintest": "", "perftest": "", "lint": "tslint -p tsconfig.json", "ai-min": "", "ai-restore": "" }, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/examples/AISKU" }, "license": "MIT", "sideEffects": false, "devDependencies": { "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es5": "1.0.2", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "rollup": "^3.20.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "^4.9.3" }, "peerDependencies": { "tslib": ">= 1.0.0" }, "dependencies": { "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-web": "3.4.1", "@microsoft/applicationinsights-core-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x" } } ================================================ FILE: examples/AISKU/rollup.config.js ================================================ import nodeResolve from "@rollup/plugin-node-resolve"; import { uglify } from "@microsoft/applicationinsights-rollup-plugin-uglify3-js"; import replace from "@rollup/plugin-replace"; import cleanup from "rollup-plugin-cleanup"; import dynamicRemove from "@microsoft/dynamicproto-js/tools/rollup/dist/node/removedynamic"; import { es5Poly, es5Check, importCheck } from "@microsoft/applicationinsights-rollup-es5"; import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const workerName = "aisku-example-index"; const banner = [ "/*!", ` * Application Insights JavaScript SDK Example - AISKU, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the MIT License.": "" }; function doCleanup() { return cleanup({ comments: [ 'some', /^.\s*@DynamicProtoStub/i, /^\*\*\s*@class\s*$/ ] }) } const browserRollupConfigFactory = (name, isProduction, format = "umd", extension = "") => { const browserRollupConfig = { input: `dist-es5/${name}.js`, output: { file: `browser/es5/${name}${extension ? "." +extension : ""}.js`, banner: banner, format: format, name: "Microsoft.ApplicationInsights.Example", extend: true, freeze: false, sourcemap: true }, treeshake: { propertyReadSideEffects: false, moduleSideEffects: false, tryCatchDeoptimization: false, correctVarValueBeforeDeclaration: false }, plugins: [ dynamicRemove(), replace({ preventAssignment: true, delimiters: ["", ""], values: replaceValues }), // This just makes sure we are importing the example dependencies correctly importCheck({ exclude: [ "aisku-example-index" ] }), nodeResolve({ module: true, browser: true, preferBuiltins: false }), doCleanup(), es5Poly(), es5Check() ] }; if (isProduction) { browserRollupConfig.output.file = `browser/${name}${extension ? "." +extension : ""}.min.js`; browserRollupConfig.plugins.push( uglify({ ie8: false, ie: true, compress: { ie: true, passes:3, unsafe: true, }, output: { ie: true, preamble: banner, webkit:true } }) ); } return browserRollupConfig; }; updateDistEsmFiles(replaceValues, banner); export default [ browserRollupConfigFactory(workerName, false, "iife", "gbl") ]; ================================================ FILE: examples/AISKU/src/aisku-example-index.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { addTelemetryInitializer, changeConfig, eventItem, getConfig, getCookieMgr, initApplicationInsights, metricItem, pageviewItem, startTrackEvent, stopTrackEvent, traceItem, trackEvent, trackMetric, trackPageView, trackTrace } from "./aisku-init"; import { ai_session, ai_user, buttonSectionId, clearDetailsList, clearEle, configContainerId, configDetails, cookieWatchList, createButton, createContainers, createDetailList, detailsContainerId, detailsWatchList, manual_event, triggerException } from "./utils"; function createPageviewTracks() { trackPageView(pageviewItem); } function createEventTracks() { trackEvent(eventItem, {prop2: "prop2"}); } function startEvent() { startTrackEvent(manual_event); } function stopEvent() { stopTrackEvent(manual_event, {prop:"prop"}, {metric: 1}); } function createTraceTracks() { trackTrace(traceItem); } function createMetricTracks() { trackMetric(metricItem, {prop2: "prop2"}); } function getCookieMgrdetails() { let cookieMgr = getCookieMgr(); if(cookieMgr) { let details = { isEnabled: cookieMgr.isEnabled(), ai_session: cookieMgr.get(ai_session), ai_user: cookieMgr.get(ai_user) } as any; createDetailList(cookieWatchList, details, detailsContainerId, "Cookie"); } } function addTelemetryListener() { addTelemetryInitializer((env: any) => { console.log("The following Event is triggered."); console.log(env); createDetailList(detailsWatchList, env, detailsContainerId, "Telemetry"); }); } function createConfigDetails() { let config = getConfig(); clearEle(configContainerId); createDetailList(configDetails, config, configContainerId, "Config"); } function changeConfigOnClick() { changeConfig(); createConfigDetails(); } function createButtonSection() { let container = document.getElementById(buttonSectionId); let changeConfigBtn = createButton("Change Config", changeConfigOnClick); let pageviewButton = createButton("Create Pageview", createPageviewTracks); let eventButton = createButton("Create Event", createEventTracks); let startButton = createButton("Start Tracking Event", startEvent); let stopButton = createButton("Stop Tracking Event", stopEvent); let traceButton = createButton("Create Trace", createTraceTracks); let metricButton = createButton("Create Metric", createMetricTracks); let exceptionButton = createButton("Create Exception", triggerException); let cookieButton = createButton("Get Cookie", getCookieMgrdetails); let clearButton = createButton("Clear Details", clearDetailsList); let buttons = [changeConfigBtn, pageviewButton, eventButton, traceButton, metricButton, startButton, stopButton, exceptionButton, cookieButton, clearButton]; buttons.forEach(ele => { container?.appendChild(ele); }); } function analyticsSample() { initApplicationInsights(); createContainers(); addTelemetryListener(); createButtonSection(); createConfigDetails(); } analyticsSample(); ================================================ FILE: examples/AISKU/src/aisku-init.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { ApplicationInsights, IConfiguration, IEventTelemetry, IMetricTelemetry, IPageViewTelemetry, ITraceTelemetry } from "@microsoft/applicationinsights-web"; import { generateNewConfig } from "./utils"; import { runTargetUnload } from "@microsoft/applicationinsights-core-js"; // ****************************************************************************************************************************** // Snippet Initialization. If you want to use NPM initialization, replace this section with the NPM Initialization section at the end. let _appInsights: any; export function initApplicationInsights(config: IConfiguration = {}) { if (!_appInsights) { _appInsights = (window as any).appInsights; return _appInsights; } _appInsights = new ApplicationInsights({ config: config }); _appInsights.loadAppInsights(); _appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview return _appInsights; } // *********************************************************************************************************************************** /** * Unload the SDK if it has been initialized * @returns */ export function unloadApplicationInsights() { if (_appInsights) { runTargetUnload(_appInsights); _appInsights = null; return true; } return false; } /** * Request a page view request if the SDK has been initialized */ export function trackPageView(pageView?: IPageViewTelemetry) { if (_appInsights) { _appInsights.trackPageView(pageView); return true; } return false; } /** * Log a custom event if the SDK has been initialized */ export function trackEvent(event: IEventTelemetry, customProperties?: {[key: string]: any;} ) { if (_appInsights) { _appInsights.trackEvent(event, customProperties); return true; } return false; } /** * Start timing an event with given name if the SDK has been initialized */ export function startTrackEvent(name?: string) { if (_appInsights) { _appInsights.startTrackEvent(name); return true; } return false; } /** * Stop timing an event with given name if the SDK has been initialized */ export function stopTrackEvent(name: string, properties?: { [key: string]: string; }, measurements?: { [key: string]: number; }) { if (_appInsights) { _appInsights.stopTrackEvent(name, properties, measurements); return true; } return false; } /** * Log traces if the SDK has been initialized * Typically used to send regular reports of performance indicators */ export function trackTrace(trace: ITraceTelemetry) { if (_appInsights) { _appInsights.trackTrace(trace); return true; } return false; } /** * Log Metric if the SDK has been initialized */ export function trackMetric(metric: IMetricTelemetry, customProperties?: {[name: string]: any}) { if (_appInsights) { _appInsights.trackMetric(metric, customProperties); return true; } return false; } /** * Adds a telemetry initializer to the collection if the SDK has been initialized * Telemetry initializers will be called before the telemetry item is pushed for sending */ export function addTelemetryInitializer(telemetryInitializer: (item: any) => boolean | void) { if (_appInsights) { _appInsights.addTelemetryInitializer(telemetryInitializer); return true; } return false; } /** * Use getCookieMgr to get cookie details if the SDK has been initialized * cookieMgr can be used to del, get, purge, set cookies */ export function getCookieMgr() { if (_appInsights) { return _appInsights.getCookieMgr(); } return null; } /** * Get current config settings if the SDK has been initialized */ export function getConfig() { if (_appInsights) { let config = _appInsights["config"]; console.log("current config"); console.log(config); return config; } return null; } /** * Change current config settings dynamically if the SDK has been initialized */ export function changeConfig() { if (_appInsights) { let newConfig = generateNewConfig(); // generate new config object _appInsights["config"] = newConfig; // change config return true; } return false; } /** * An example of customized pageview item */ export const pageviewItem: IPageViewTelemetry = { name: "pageviewWithproperities", // Defaults to the document title uri: "https://pageview", refUri: "https://sample", pageType: "type", isLoggedIn: false, properties: { duration: 100, // pre-defined property prop: "prop", prop1: {prop1:"prop1"} }, measurements: { metric: 1 } }; /** * An example of customized event item */ export const eventItem: IEventTelemetry = { name: "eventWithproperities", properties: { prop: {prop1:"prop1"} }, measurements: { metirc: 1 } }; /** * An example of customized trace item */ export const traceItem: ITraceTelemetry = { message: "trace", severityLevel: 1, properties: { prop: {prop1:"prop1"} }, measurements: { metirc: 1 } }; /** * An example of customized metric item */ export const metricItem: IMetricTelemetry = { name: "metric", average: 1.2, //default to 1 sampleCount: 2, //default to average min: 1, //default to average max: 2, // default to 0 stdDev: 1.23, properties: { prop: {prop1:"prop1"} }, measurements: { metirc: 1 } }; // // *********************************************************************************************************** // // NPM Initialization // // Use this section to initialize Application Insights with NPM // import { ApplicationInsights, IConfiguration } from "@microsoft/applicationinsights-web" // // Cache the previously initialized instance to avoid creating multiple instances // let _appInsights: ApplicationInsights; // export function initApplicationInsights(config: IConfiguration) { // if (!_appInsights) { // // Make sure we have a configuration object // config = config || {}; // if (!config.instrumentationKey || !config.connectionString) { // config.connectionString = "InstrumentationKey=YOUR_INSTRUMENTATION_KEY_GOES_HERE"; // } // _appInsights = new ApplicationInsights({ // config: config // }); // _appInsights.loadAppInsights(); // _appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview // return _appInsights; // } // return _appInsights; // } // // ************************************************************************************************************** ================================================ FILE: examples/AISKU/src/utils.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { arrForEach, arrIncludes } from "@nevware21/ts-utils"; export const detailsContainerId = "details-container"; export const detailsWatchList = ["baseType", "name", "time", "properties"]; export const ajaxDetails: string[] = ["disabbleFetchTracking", "disableExceptionTracking", "enableAutoRouteTracking"]; export const analyticsDetails: string[] = ["autoTrackPageVisitTime", "appId", "enableAjaxPerfTracking", "enableCorsCorrelation"]; export const configDetails: string[] = ["connectionString", ...ajaxDetails, ...analyticsDetails]; export const buttonSectionId = "button-section"; export const configContainerId = "config-details"; export const containerId = "aisku-container"; export const ai_session = "ai_session"; export const ai_user = "ai_user"; export const manual_event = "manual_record_event"; export const cookieWatchList = ["isEnabled", ai_session, ai_user]; export function randomBoolean() { if (Math.random() > 0.5) { return true; } return false; } export function clearEle(id: string) { let ele = document.getElementById(id); if (ele) { ele.innerHTML = ""; } } export function clearDetailsList() { clearEle(detailsContainerId); } export function createSubContainer(id: string, className?: string) { let ele = document.createElement("div"); ele.className = className || "container-main"; ele.id = id; return ele; } export function createButton(buttontextContent: string, buttobuttononclickFn: any, id?: string): HTMLButtonElement { let btn = document.createElement("button"); if (id) { btn.id = id; } btn.innerHTML = buttontextContent; btn.onclick = buttobuttononclickFn; return btn; } export function generateNewConfig() { let prefix = Math.random().toString(36).slice(6); let newConfig: any = { connectionString: `InstrumentationKey=newKey${prefix}`, extensionConfig: { ApplicationInsightsAnalytics: { autoTrackPageVisitTime: randomBoolean(), appId: Math.random().toString(36).slice(8), enableAjaxPerfTracking: randomBoolean(), enableCorsCorrelation: randomBoolean() }, AjaxDependencyPlugin: { disabbleFetchTracking: randomBoolean(), // false block fetch tracking disableExceptionTracking: randomBoolean(), enableAutoRouteTracking: randomBoolean() } } } return newConfig; } export function createDetailList(propsToWatch: string[], details: any, id: string, title: string) { let container = document.getElementById(id); let ele = document.createElement("div"); ele.className = "list"; let list = ""; if (details) { list += `
          ${title} Details

          Not all auto-captured events and details are displayed here.

          Check console and network trace for complete details

          `; arrForEach(propsToWatch, (prop) => { let obj; if (details["baseData"]) { obj = details["baseData"][prop] || details[prop] || details["baseData"]; } else { obj = details[prop] || details["baseData"]; } if (arrIncludes(analyticsDetails, prop)) { obj = details["extensionConfig"]["ApplicationInsightsAnalytics"][prop]; } if (arrIncludes(ajaxDetails, prop)) { obj = details["extensionConfig"]["AjaxDependencyPlugin"][prop]; } if (prop === "item") { obj = {name: obj.name, target: obj.target}; } obj = (obj === undefined)? "undefined" : obj; if (typeof obj === "object") { obj = JSON.stringify(obj); } list += `
        1. ${prop}: ${obj}
        2. `; }); list += "
          -------------------------
          "; ele.innerHTML = list; container?.appendChild(ele); } } export function createContainers() { let container = document.createElement("div"); container.className = "container"; container.id = containerId; let buttonSection = createSubContainer(buttonSectionId, "container"); container.appendChild(buttonSection); let configSection = createSubContainer(configContainerId); container.appendChild(configSection); let detailsSection = createSubContainer(detailsContainerId); container.appendChild(detailsSection); document.body.append(container); } export function triggerException() { // This will trigger exception telemetry automatically throw new Error("error is triggered"); } ================================================ FILE: examples/AISKU/style/style.css ================================================ body { margin: 0; } h1 { font-size: 1.875rem; margin: 0.67rem 0; } h2 { font-size: 1.5rem; margin: 0.83rem 0; } h3 { font-size: 1.25rem; margin: 1rem 0; } h4 { font-size: 1.05rem; margin: 1.33rem 0; } h5 { font-size: 1rem; margin: 1.5rem 0; } h6 { font-size: 0.875rem; margin: 0.3rem 0; } .uppercase { text-transform: uppercase; } pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; } ol, ul { margin: 1em 0; } .container { max-width: 1600px; padding: 0 2rem; } .container-main { justify-content: space-between; font-size: 0.9rem; position: relative; margin: 1rem auto; padding-left: 1rem; background-color: azure; overflow: auto; max-height: 350px; } body { font-family: "Segoe UI", sans-serif; font-size: 16px; padding-left: 1rem; } code, pre { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; padding: 0.2em; margin: 0; font-size: 0.875rem; border-radius: 0.8em; } button { font-family: "Segoe UI", sans-serif; margin: 0.5rem; padding: 0.2em; } p{ font-size: 12px; margin: 0; } ================================================ FILE: examples/AISKU/tsconfig.json ================================================ { "compilerOptions": { "target": "es5", "module": "es6", "sourceMap": true, "inlineSources": true, "moduleResolution": "node", "strict": true, "allowSyntheticDefaultImports": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "noImplicitAny": false, "importHelpers": true, "allowJs": true, "resolveJsonModule": true, "declaration": true, "declarationDir": "build/types", "outDir": "dist-es5", "rootDir": "./src", "removeComments": false }, "include": [ "./src" ], "exclude": [ "node_modules" ] } ================================================ FILE: examples/README.md ================================================ # Microsoft Application Insights JavaScript SDK Examples A collection of examples using the ApplicationInsights SDK, these examples are compiled as part of every build (unless otherwise stated), but may not be executed as part of any automated test pass -- this may change/vary. ## Examples [Shared Worker](./shared-worker/README.md) [AISKU](./AISKU/README.md) [Dependency](./dependency/README.md) ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. ## License [MIT](LICENSE) ================================================ FILE: examples/cfgSync/CfgSync.html ================================================ Sample

          Microsoft Application Insights JavaScript SDK - CfgSync Plugin

          Check console for details

          ================================================ FILE: examples/cfgSync/README.md ================================================ # Microsoft Application Insights JavaScript SDK Example - CfgSync Plugin ## Sample Build You WILL NEED to have compiled the repository before running this example as it loads the compiled scripts, and you will also NEED to start the local web server via `npm run serve` from the root of repository. You can load the example via the [CfgSync.html](CfgSync.html). ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. ## License [MIT](LICENSE) ================================================ FILE: examples/cfgSync/package.json ================================================ { "name": "@microsoft/applicationinsights-example-cfgsync", "author": "Microsoft Application Insights Team", "version": "3.4.1", "description": "Microsoft Application Insights CfgSync Plugin Example", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "keywords": [ "azure", "cloud", "script errors", "microsoft", "application insights", "browser performance monitoring", "web analytics", "example" ], "module": "dist-es5/example-cfgsync-index.js", "types": "types/example-cfgsync-index.d.ts", "scripts": { "clean": "git clean -xdf", "build": "npm run build:esm && npm run build:browser", "build:esm": "grunt example-cfgsync", "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs", "rebuild": "npm run build", "test": "", "mintest": "", "perftest": "", "lint": "tslint -p tsconfig.json", "ai-min": "", "ai-restore": "" }, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/examples/cfgSync" }, "license": "MIT", "sideEffects": false, "devDependencies": { "@microsoft/ai-test-framework": "0.0.1", "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es5": "1.0.2", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "@nevware21/grunt-ts-plugin": "^0.5.2", "@nevware21/grunt-eslint-ts": "^0.5.2", "globby": "^11.0.0", "magic-string": "^0.25.7", "pako": "^2.0.3", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "rollup": "^3.20.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "^4.9.3", "tslib": "^2.0.0", "qunit": "^2.11.2", "sinon": "^7.3.1" }, "peerDependencies": { "tslib": ">= 1.0.0" }, "dependencies": { "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/applicationinsights-cfgsync-js": "3.4.1", "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-web": "3.4.1", "@microsoft/applicationinsights-core-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x" } } ================================================ FILE: examples/cfgSync/rollup.config.js ================================================ import nodeResolve from "@rollup/plugin-node-resolve"; import { uglify } from "@microsoft/applicationinsights-rollup-plugin-uglify3-js"; import replace from "@rollup/plugin-replace"; import cleanup from "rollup-plugin-cleanup"; import dynamicRemove from "@microsoft/dynamicproto-js/tools/rollup/dist/node/removedynamic"; import { es5Poly, es5Check, importCheck } from "@microsoft/applicationinsights-rollup-es5"; import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const workerName = "example-cfgsync-index"; const banner = [ "/*!", ` * Application Insights JavaScript SDK Example - CfgSync Plugin, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the MIT License.": "" }; function doCleanup() { return cleanup({ comments: [ 'some', /^.\s*@DynamicProtoStub/i, /^\*\*\s*@class\s*$/ ] }) } const browserRollupConfigFactory = (name, isProduction, format = "umd", extension = "") => { const browserRollupConfig = { input: `dist-es5/${name}.js`, output: { file: `browser/es5/${name}${extension ? "." +extension : ""}.js`, banner: banner, format: format, name: "Microsoft.ApplicationInsights.Example", extend: true, freeze: false, sourcemap: true }, treeshake: { propertyReadSideEffects: false, moduleSideEffects: false, tryCatchDeoptimization: false, correctVarValueBeforeDeclaration: false }, plugins: [ dynamicRemove(), replace({ preventAssignment: true, delimiters: ["", ""], values: replaceValues }), // This just makes sure we are importing the example dependencies correctly importCheck({ exclude: [ "example-cfgsync-index" ] }), nodeResolve({ module: true, browser: true, preferBuiltins: false }), doCleanup(), es5Poly(), es5Check() ] }; if (isProduction) { browserRollupConfig.output.file = `browser/${name}${extension ? "." +extension : ""}.min.js`; browserRollupConfig.plugins.push( uglify({ ie8: false, ie: true, compress: { ie: true, passes:3, unsafe: true, }, output: { ie: true, preamble: banner, webkit:true } }) ); } return browserRollupConfig; }; updateDistEsmFiles(replaceValues, banner); export default [ browserRollupConfigFactory(workerName, false, "iife", "gbl") ]; ================================================ FILE: examples/cfgSync/src/example-cfgsync-index.ts ================================================ // // Copyright (c) Microsoft Corporation. All rights reserved. // // Licensed under the MIT License. import { ApplicationInsights } from "@microsoft/applicationinsights-web"; import { addListener, getConfig } from "./example-cfgsync-init"; import { initListenerInstance1 } from "./listener1"; import { initListenerInstance2 } from "./listener2"; import { initMainInstance } from "./main"; export function createButton(inst: ApplicationInsights): HTMLButtonElement { let ele = document.createElement("div"); let btn = document.createElement("button"); btn.className = "button"; btn.innerHTML = "Change Config"; btn.onclick = () => { inst.updateCfg(getConfig()); } ele.appendChild(btn); document.body.appendChild(ele); return btn; } export function createGetCfgButton(inst: ApplicationInsights, name?: string): HTMLButtonElement { let ele = document.createElement("div"); let btn = document.createElement("button"); btn.className = "button"; btn.innerHTML = `Get ${name} Config`; btn.onclick = () => { console.log(`${name} config`); console.log(inst.config); } ele.appendChild(btn); document.body.appendChild(ele); return btn; } function start() { addListener(); let mainInst = initMainInstance(); let listener1 = initListenerInstance1(); let listener2 = initListenerInstance2(); createButton(mainInst); createGetCfgButton(listener1, "listener1"); createGetCfgButton(listener2, "listener2"); } start(); ================================================ FILE: examples/cfgSync/src/example-cfgsync-init.ts ================================================ import { IConfiguration, random32 } from "@microsoft/applicationinsights-core-js" export function addListener() { window.addEventListener("ai_cfgsync", (e) => { console.log("new event"); console.log(e); }) } export function getConfig() { let newConfig = { instrumentationKey: `InstrumentationKey=main${random32()}`, cookieCfg:{domain: `domain${random32()}`} } as IConfiguration; return newConfig; } ================================================ FILE: examples/cfgSync/src/listener1.ts ================================================ import { ApplicationInsights, IConfiguration} from "@microsoft/applicationinsights-web"; import {CfgSyncPlugin, ICfgSyncConfig, ICfgSyncMode} from "@microsoft/applicationinsights-cfgsync-js" export function initListenerInstance1() { let listenerCfgSyncPlugin1 = new CfgSyncPlugin(); let listenerInstCfg1 = { connectionString: "InstrumentationKey=listener1", disableInstrumentationKeyValidation: true, extensionConfig:{ [listenerCfgSyncPlugin1.identifier]: { syncMode: ICfgSyncMode.Receive, nonOverrideConfigs: { connectionString: true, instrumentationKey: true, endpointUrl: true, extensionConfig: { ["ApplicationInsightsAnalytics"]: { accountId: true } } } } as ICfgSyncConfig }, extensions:[listenerCfgSyncPlugin1] } as IConfiguration; let listenerAppInsights1 = new ApplicationInsights({config: listenerInstCfg1}); listenerAppInsights1.loadAppInsights(); console.log("listener 1"); console.log(listenerAppInsights1); return listenerAppInsights1; } ================================================ FILE: examples/cfgSync/src/listener2.ts ================================================ import { ApplicationInsights, IConfiguration} from "@microsoft/applicationinsights-web"; import {CfgSyncPlugin, ICfgSyncConfig, ICfgSyncMode} from "@microsoft/applicationinsights-cfgsync-js" export function initListenerInstance2() { let listenerCfgSyncPlugin2 = new CfgSyncPlugin(); let listenerInstCfg2 = { connectionString: "InstrumentationKey=listener2", disableInstrumentationKeyValidation: true, extensionConfig:{ [listenerCfgSyncPlugin2.identifier]: { syncMode: ICfgSyncMode.Receive, nonOverrideConfigs: { connectionString: true, instrumentationKey: true, endpointUrl: true, extensionConfig: { ["ApplicationInsightsAnalytics"]: { excludeRequestFromAutoTrackingPatterns: true, bufferOverride: true } } } } as ICfgSyncConfig }, extensions:[listenerCfgSyncPlugin2] } as IConfiguration; let listenerAppInsights2 = new ApplicationInsights({config: listenerInstCfg2}); listenerAppInsights2.loadAppInsights(); console.log("listener 2"); console.log(listenerAppInsights2); return listenerAppInsights2; } ================================================ FILE: examples/cfgSync/src/main.ts ================================================ import { ApplicationInsights, IConfig, IConfiguration, IDiagnosticLogger} from "@microsoft/applicationinsights-web"; import {CfgSyncPlugin, ICfgSyncConfig, ICfgSyncMode} from "@microsoft/applicationinsights-cfgsync-js"; export function initMainInstance() { let mainCfgSyncPlugin = new CfgSyncPlugin(); let mainInstCfg = { instrumentationKey: "InstrumentationKey=main", disableInstrumentationKeyValidation: true, extensionConfig:{ [mainCfgSyncPlugin.identifier]: { syncMode: ICfgSyncMode.Broadcast } as ICfgSyncConfig, ["ApplicationInsightsAnalytics"]: { emitLineDelimitedJson: false, accountId: "mainaccid", sessionRenewalMs: 1000000, excludeRequestFromAutoTrackingPatterns: ["excludeRequest1","excludeRequest2"], bufferOverride: { getItem: (logger: IDiagnosticLogger, name: string) => { return `${name}test`; }, setItem: (logger: IDiagnosticLogger, name: string, data: string) => { return name === "delete" } } } as IConfig }, extensions:[mainCfgSyncPlugin] } as IConfiguration; let mainAppInsights = new ApplicationInsights({config: mainInstCfg}); mainAppInsights.loadAppInsights(); console.log("main instance"); console.log(mainAppInsights); return mainAppInsights; } ================================================ FILE: examples/cfgSync/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": true, "module": "es6", "moduleResolution": "node", "target": "es5", "forceConsistentCasingInFileNames": true, "importHelpers": true, "noEmitHelpers": true, "skipLibCheck": false, "alwaysStrict": true, "skipDefaultLibCheck": true, "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "declaration": true, "declarationDir": "build/types", "outDir": "dist-es5", "rootDir": "./src", "removeComments": false }, "include": [ "src/**/*" ], "exclude": ["node_modules/"] } ================================================ FILE: examples/dependency/README.md ================================================ # Application Insights JavaScript SDK ## Dependency Sample This Sample shows how to filter, modify, block and disable dependency data with [`addDependencyListener`](https://microsoft.github.io/ApplicationInsights-JS/API-reference#adddependencylistener) and [`addDependencyInitializer`](https://microsoft.github.io/ApplicationInsights-JS/API-reference#adddependencyinitializer). ## Sample Build - Build the repository before running this example. - Run `npm run serve` under root folder. - Open `http://localhost:9001/examples/dependency/`. ## Description - button `change-config` will change config dynamically. - button `add-handlers` will add a dependencyListener with the following changes: ```javascript context.listener = "dependency-listener-context"; traceFlags = 0; ``` and a dependencyInitializer with the following changes: ```javascript item.name = "dependency-name"; item.properties.url = item.target; context.initializer = "dependency-initializer-context"; ``` - button `stop-dependency-event` will block all dependency events. - button `remove-all-handlers` will remove all previously added dependency initializers and listeners. - button `create-fetch-request` will trigger a fetch request. - button `create-xhr-request` will trigger a xhr request. - button `untrack-fetch-request` will trigger a fetch request that will be blocked. ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at [here](https://go.microsoft.com/fwlink/?LinkID=824704). You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. ## License MIT ================================================ FILE: examples/dependency/index.html ================================================ Dependency Sample

          Microsoft Application Insights JavaScript SDK - Dependencies

          ================================================ FILE: examples/dependency/package.json ================================================ { "name": "@microsoft/applicationinsights-example-dependencies", "author": "Microsoft Application Insights Team", "version": "3.4.1", "description": "Microsoft Application Insights Dependencies Example", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "keywords": [ "azure", "cloud", "script errors", "microsoft", "application insights", "browser performance monitoring", "web analytics", "example" ], "scripts": { "clean": "git clean -xdf", "build": "npm run build:esm && npm run build:browser", "build:esm": "grunt example-dependency", "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs", "rebuild": "npm run build", "test": "", "mintest": "", "perftest": "", "lint": "tslint -p tsconfig.json", "ai-min": "", "ai-restore": "" }, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/examples/dependency" }, "license": "MIT", "sideEffects": false, "devDependencies": { "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es5": "1.0.2", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "rollup": "^3.20.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "^4.9.3" }, "peerDependencies": { "tslib": ">= 1.0.0" }, "dependencies": { "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-web": "3.4.1", "@microsoft/applicationinsights-dependencies-js": "3.4.1", "@microsoft/applicationinsights-core-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x" } } ================================================ FILE: examples/dependency/rollup.config.js ================================================ import nodeResolve from "@rollup/plugin-node-resolve"; import { uglify } from "@microsoft/applicationinsights-rollup-plugin-uglify3-js"; import replace from "@rollup/plugin-replace"; import cleanup from "rollup-plugin-cleanup"; import dynamicRemove from "@microsoft/dynamicproto-js/tools/rollup/dist/node/removedynamic"; import { es5Poly, es5Check, importCheck } from "@microsoft/applicationinsights-rollup-es5"; import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const workerName = "dependencies-example-index"; const banner = [ "/*!", ` * Application Insights JavaScript SDK Example - AISKU, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the MIT License.": "" }; function doCleanup() { return cleanup({ comments: [ 'some', /^.\s*@DynamicProtoStub/i, /^\*\*\s*@class\s*$/ ] }) } const browserRollupConfigFactory = (name, isProduction, format = "umd", extension = "") => { const browserRollupConfig = { input: `dist-es5/${name}.js`, output: { file: `browser/${name}${extension ? "." +extension : ""}.js`, banner: banner, format: format, name: "Microsoft.ApplicationInsights.Example", extend: true, freeze: false, sourcemap: true }, treeshake: { propertyReadSideEffects: false, moduleSideEffects: false, tryCatchDeoptimization: false, correctVarValueBeforeDeclaration: false }, plugins: [ dynamicRemove(), replace({ preventAssignment: true, delimiters: ["", ""], values: replaceValues }), // This just makes sure we are importing the example dependencies correctly importCheck({ exclude: [ "dependencies-example-index" ] }), nodeResolve({ module: true, browser: true, preferBuiltins: false }), doCleanup(), es5Poly(), es5Check() ] }; if (isProduction) { browserRollupConfig.output.file = `browser/${name}${extension ? "." +extension : ""}.min.js`; browserRollupConfig.plugins.push( uglify({ ie8: false, ie: true, compress: { ie: true, passes:3, unsafe: true, }, output: { ie: true, preamble: banner, webkit:true } }) ); } return browserRollupConfig; }; updateDistEsmFiles(replaceValues, banner); export default [ browserRollupConfigFactory(workerName, false, "iife", "gbl") ]; ================================================ FILE: examples/dependency/src/appinsights-init.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { ApplicationInsights, IConfiguration, DependencyListenerFunction, DependencyInitializerFunction, IDependencyInitializerHandler, IDependencyListenerHandler, OTelSpanKind } from "@microsoft/applicationinsights-web"; import { generateNewConfig } from "./utils"; // Cache the previously initialized instance to avoid creating multiple instances let _appInsights: ApplicationInsights; export function initApplicationInsights(config?: IConfiguration) { if (!_appInsights) { // Make sure we have a configuration object config = config || {}; if (!config.connectionString) { config.connectionString = "InstrumentationKey=YOUR_INSTRUMENTATION_KEY_GOES_HERE"; } _appInsights = new ApplicationInsights({ config: config }); _appInsights.loadAppInsights(); _appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview return _appInsights; } return _appInsights; } /** * Use addDependencyListener to modify dependencyDetails if the SDK has been initialized */ export function addDependencyListener(dependencyListener: DependencyListenerFunction): IDependencyListenerHandler | null { if (_appInsights) { return _appInsights.addDependencyListener(dependencyListener); } return null; } /** * Use addDependencyInitializer to modify dependencyInitializerDetails if the SDK has been initialized */ export function addDependencyInitializer(dependencyInitializer: DependencyInitializerFunction): IDependencyInitializerHandler | null { if (_appInsights) { return _appInsights.addDependencyInitializer(dependencyInitializer); } return null; } /** * Use addDependencyInitializer to block any event from being reported */ export function stopDependencyEvent() { if (_appInsights) { _appInsights.addDependencyInitializer((details: any) => { // Check console to view details console.log("dependency event tracking is stopped, the following event will not be reported"); console.log(details); // To stop any event from being reported return false; }); return true; } return false; } /** * Get current config settings if the SDK has been initialized */ export function getConfig() { if (_appInsights) { let config = _appInsights["config"]; console.log("current config"); console.log(config); return config; } return null; } /** * Change current config settings dynamically if the SDK has been initialized */ export function changeConfig() { if (_appInsights) { let newConfig = generateNewConfig(); // generate new config object _appInsights.updateCfg(newConfig); // change config merging any changes return true; } return false; } export function enableAjaxPerfTrackingConfig() { if (_appInsights && _appInsights.config.extensionConfig) { _appInsights.config.extensionConfig["AjaxDependencyPlugin"].enableAjaxPerfTracking = true; return true; } return false; } /** * Example of using the new OpenTelemetry trace API */ export function createSpanWithTraceAPI() { if (_appInsights) { // Get the OpenTelemetry trace API const trace = _appInsights.trace; // Get a tracer instance const tracer = trace.getTracer("example-service", "1.0.0"); // Create a span using the OpenTelemetry API const span = tracer.startSpan("api-request", { kind: OTelSpanKind.SERVER, attributes: { "http.method": "POST", "http.url": "/api/users", "service.name": "user-service" } }); if (!span) { console.warn("Failed to create span in createSpanWithTraceAPI"); return null; } // Set additional attributes span.setAttribute("user.id", "12345"); span.setAttributes({ "request.size": 1024, "response.status_code": 200 }); // Simulate some async work setTimeout(() => { if (span) { // Update span name if needed span.updateName("api-request-completed"); // End the span - this will automatically create telemetry span.end(); } }, 800); return span; } return null; } /** * Example of using multiple tracers for different components */ export function createMultipleTracers() { if (_appInsights) { const trace = _appInsights.trace; // Get different tracers for different services const userServiceTracer = trace.getTracer("user-service", "1.2.3"); const paymentServiceTracer = trace.getTracer("payment-service", "2.1.0"); // Create spans from different tracers const userSpan = userServiceTracer.startSpan("validate-user", { attributes: { "component": "authentication" } }); const paymentSpan = paymentServiceTracer.startSpan("process-payment", { attributes: { "component": "billing" } }); if (!userSpan || !paymentSpan) { console.warn("Failed to create one or more spans in createMultipleTracers"); return null; } // End spans after some work setTimeout(() => { if (userSpan) { userSpan.end(); } if (paymentSpan) { paymentSpan.end(); } }, 500); return { userSpan, paymentSpan }; } return null; } /** * Example of using the new startSpan API for distributed tracing */ export function createExampleSpan() { if (_appInsights) { // Create a span for a user operation const span = _appInsights.core.startSpan("user-checkout", { kind: OTelSpanKind.SERVER, attributes: { "user.action": "checkout", "cart.items": 3, "component": "shopping-cart" } }); // Check if span is available before using it if (!span) { console.warn("Span creation failed - tracing may not be enabled"); return null; } // Set additional attributes span.setAttribute("order.total", 99.99); span.setAttributes({ "payment.method": "credit_card", "shipping.method": "standard" }); // Simulate some async work setTimeout(() => { if (span) { // Update span name if needed span.updateName("user-checkout-completed"); // End the span span.end(); } }, 1000); return span; } return null; } /** * Example of creating child spans for nested operations */ export function createChildSpanExample() { if (_appInsights) { // Create parent span const parentSpan = _appInsights.core.startSpan("process-order", { kind: OTelSpanKind.INTERNAL, attributes: { "order.id": "12345" } }); // Create child span for payment processing const paymentSpan = _appInsights.core.startSpan("process-payment", { kind: OTelSpanKind.CLIENT, attributes: { "payment.processor": "stripe", "amount": 99.99 } }); // Check if spans are available before using them if (!parentSpan || !paymentSpan) { console.warn("Span creation failed - tracing may not be enabled"); // Clean up any successfully created spans if (parentSpan) { parentSpan.end(); } if (paymentSpan) { paymentSpan.end(); } return null; } // Simulate payment processing setTimeout(() => { if (paymentSpan) { paymentSpan.setAttribute("payment.status", "success"); paymentSpan.end(); } // End parent span if (parentSpan) { parentSpan.setAttribute("order.status", "completed"); parentSpan.end(); } }, 500); return { parentSpan, paymentSpan }; } return null; } ================================================ FILE: examples/dependency/src/dependencies-example-index.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { arrForEach, eW3CTraceFlags } from "@microsoft/applicationinsights-core-js"; import { addDependencyListener, addDependencyInitializer, stopDependencyEvent, changeConfig, initApplicationInsights, getConfig, enableAjaxPerfTrackingConfig } from "./appinsights-init"; import { addHandlersButtonId, ajaxCallId, buttonSectionId, changeConfigButtonId, clearDetailsButtonId, clearDetailsList, clearEle, configContainerId, configDetails, createButton, createContainers, createDetailList, createFetchRequest, createUnTrackRequest, createXhrRequest, dependencyInitializerDetails, dependencyInitializerDetailsContainerId, dependencyListenerButtonId, dependencyListenerDetails, dependencyListenerDetailsContainerId, fetchCallId, fetchXhrId, removeAllHandlersId, stopDependencyEventButtonId, untrackFetchRequestId } from "./utils"; let dependencyListenerHandler: any = null; let dependencyInitializerHandler: any = null; // This function is an example of using addDependencyListener to modify dependencyDetails function addDependencyListenerOnclick() { dependencyListenerHandler = addDependencyListener((details: any) => { // Check console to view details console.log("The folloing event is passed to addDependencyListener"); console.log(details); // Add additional context values (any) that can be used by other listeners and is also passed to any dependency initializers details.context.listener = "dependency-listener-context"; details.traceFlags = eW3CTraceFlags.None; createDetailList(dependencyListenerDetails, details, dependencyListenerDetailsContainerId, "Listener"); }); } // This function is an example of using addDependencyInitializer to modify dependencyInitializerDetails function addDependencyInitializerOnClick() { dependencyInitializerHandler = addDependencyInitializer((details: any) => { // Check console to view details console.log("The folloing event is passed to addDependencyInitializer"); console.log(details); // Events from https://api.npms.io/v2/search?q=angular&size=1 will not be reported if (details.item?.target === "https://api.npms.io/v2/search?q=angular&size=1") { return false; } // Change properties of telemetry event "before" it's been processed details.item.name = "dependency-name"; details.item.properties.url = details.item?.target; details.context.initializer = "dependency-initializer-context"; createDetailList(dependencyInitializerDetails, details, dependencyInitializerDetailsContainerId, "Initializer"); }); } // This function is an example of removing addDependencyInitializer and addDependencyListener function removeAllHandlers() { if (dependencyInitializerHandler) { // Remove the dependency initializer dependencyInitializerHandler.remove(); console.log("dependencyInitializerHandler is removed"); } if (dependencyListenerHandler) { // Remove the dependency Listener dependencyListenerHandler.remove(); console.log("dependencyListenerHandler is removed"); } } function createConfigDetails() { let config = getConfig(); clearEle(configContainerId); createDetailList(configDetails, config, configContainerId, "Config"); } function changeConfigOnClick() { changeConfig(); createConfigDetails(); } function onAddHandlersClick() { addDependencyListenerOnclick(); addDependencyInitializerOnClick(); } function createAjaxPerformRequest() { console.log("turn on perf tracking for ajax calls"); enableAjaxPerfTrackingConfig(); createConfigDetails(); createXhrRequest(); } function createButtonSection() { let container = document.getElementById(buttonSectionId); let changeConfigBtn = createButton(changeConfigButtonId, changeConfigOnClick, changeConfigButtonId); let handlersBtn = createButton(addHandlersButtonId, onAddHandlersClick, dependencyListenerButtonId); let fetchButton = createButton(fetchCallId, createFetchRequest); let ajaxPerfButton = createButton(ajaxCallId, createAjaxPerformRequest); let xhrButton = createButton(fetchXhrId, createXhrRequest); let untrackRequestButton = createButton(untrackFetchRequestId, createUnTrackRequest); let stopEventButton = createButton(stopDependencyEventButtonId, stopDependencyEvent); let removeHandlersButton = createButton(removeAllHandlersId, removeAllHandlers); let clearBtn = createButton(clearDetailsButtonId, clearDetailsList); let buttons = [changeConfigBtn, handlersBtn, fetchButton, xhrButton, ajaxPerfButton, untrackRequestButton, stopEventButton, removeHandlersButton, clearBtn]; arrForEach(buttons, ele => { container?.appendChild(ele); }); } function dependencySample() { initApplicationInsights(); createContainers(); createButtonSection(); createConfigDetails(); } dependencySample(); ================================================ FILE: examples/dependency/src/startSpan-example.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { IReadableSpan } from "@microsoft/applicationinsights-core-js"; import { ApplicationInsights, OTelSpanKind } from "@microsoft/applicationinsights-web"; /** * Example demonstrating the simplified OpenTelemetry-like span interface * which focuses on ApplicationInsights telemetry needs. * * Key features of the simplified interface: * - setAttribute/setAttributes for additional properties * - updateName for changing span names * - end() to complete spans * - isRecording() to check if span is active * - spanContext() for getting trace/span IDs * * Note: This implementation does NOT include: * - addEvent() - events are not part of this simplified interface * - setStatus() - status tracking is not part of this simplified interface * * Attributes set on spans are sent as additional properties with ApplicationInsights telemetry. */ export class StartSpanExample { private _appInsights: ApplicationInsights; constructor(appInsights: ApplicationInsights) { this._appInsights = appInsights; } /** * Basic span creation example showing simplified interface */ public basicSpanExample(): IReadableSpan | null { if (!this._appInsights) { return null; } // Create a root span with attributes const span = this._appInsights.appInsights.core.startSpan("user-action", { kind: OTelSpanKind.SERVER, attributes: { "user.id": "user123", "action.type": "button_click", "component": "ui" } }); // Check if span is available before using it if (!span) { console.warn("Span creation failed - tracing may not be enabled"); return null; } // Set additional individual attributes span.setAttribute("session.id", "session456"); span.setAttribute("page.url", window.location.href); // Set multiple attributes at once span.setAttributes({ "browser.name": navigator.userAgent, "screen.resolution": `${screen.width}x${screen.height}`, "timestamp": Date.now() }); // Update the span name if needed span.updateName("user-button-click"); // Check if span is still recording console.log("Span is recording:", span.isRecording()); // Get span context for trace/span IDs const spanContext = span.spanContext(); console.log("Trace ID:", spanContext.traceId); console.log("Span ID:", spanContext.spanId); // End the span after some work setTimeout(() => { if (span) { span.end(); console.log("Span ended. Still recording:", span.isRecording()); } }, 1000); return span; } /** * Example showing child span creation for nested operations */ public nestedSpanExample(): { parent: IReadableSpan, child: IReadableSpan } | null { if (!this._appInsights) { return null; } // Create parent span for overall operation const parentSpan = this._appInsights.appInsights.core.startSpan("data-processing", { kind: OTelSpanKind.INTERNAL, attributes: { "operation.type": "batch_process", "data.source": "user_upload" } }); // Create child span for specific sub-operation // The child will automatically inherit the parent's trace context const childSpan = this._appInsights.appInsights.core.startSpan("validate-data", { kind: OTelSpanKind.INTERNAL, attributes: { "validation.rules": "strict", "data.format": "csv" } }); // Check if spans are available before using them if (!parentSpan || !childSpan) { console.warn("Span creation failed - tracing may not be enabled"); // Clean up any successfully created spans if (parentSpan) { parentSpan.end(); } if (childSpan) { childSpan.end(); } return null; } // Both spans share the same trace ID but have different span IDs console.log("Parent Trace ID:", parentSpan.spanContext().traceId); console.log("Child Trace ID:", childSpan.spanContext().traceId); console.log("Parent Span ID:", parentSpan.spanContext().spanId); console.log("Child Span ID:", childSpan.spanContext().spanId); // Simulate nested operations setTimeout(() => { // Child operation completes first if (childSpan) { childSpan.setAttribute("validation.result", "passed"); childSpan.setAttribute("records.validated", 1500); childSpan.end(); } // Parent operation completes after child setTimeout(() => { if (parentSpan) { parentSpan.setAttribute("processing.result", "success"); parentSpan.setAttribute("total.records", 1500); parentSpan.end(); } }, 200); }, 800); return { parent: parentSpan, child: childSpan }; } /** * Example showing HTTP request tracking with spans */ public httpRequestSpanExample(): IReadableSpan | null { if (!this._appInsights) { return null; } // Create span for HTTP request const httpSpan = this._appInsights.appInsights.core.startSpan("api-call", { kind: OTelSpanKind.CLIENT, attributes: { "http.method": "POST", "http.url": "https://api.example.com/data", "http.user_agent": navigator.userAgent } }); // Check if span is available before using it if (!httpSpan) { console.warn("HTTP span creation failed - tracing may not be enabled"); return null; } // Simulate making an HTTP request fetch("https://api.example.com/data", { method: "POST", body: JSON.stringify({ test: "data" }), headers: { "Content-Type": "application/json" } }).then(response => { // Set response attributes if (httpSpan) { httpSpan.setAttribute("http.status_code", response.status); httpSpan.setAttribute("http.response.size", response.headers.get("content-length") || 0); if (response.ok) { httpSpan.setAttribute("http.result", "success"); } else { httpSpan.setAttribute("http.result", "error"); httpSpan.setAttribute("error.message", `HTTP ${response.status}`); } } return response.json(); }).then(data => { if (httpSpan) { httpSpan.setAttribute("response.records", data?.length || 0); httpSpan.end(); } }).catch(error => { if (httpSpan) { httpSpan.setAttribute("http.result", "error"); httpSpan.setAttribute("error.message", error.message); httpSpan.setAttribute("error.type", error.name); httpSpan.end(); } }); return httpSpan; } /** * Example showing manual trace context management */ public manualTraceContextExample(): void { if (!this._appInsights) { return; } // Get current trace context const currentContext = this._appInsights.appInsights.core.getTraceCtx(); console.log("Current trace context:", currentContext); // Create a span - this automatically becomes the active trace context const span = this._appInsights.appInsights.core.startSpan("background-task", { kind: OTelSpanKind.INTERNAL, attributes: { "task.priority": "low" } }); // Check if span is available before using it if (!span) { console.warn("Background task span creation failed - tracing may not be enabled"); return; } // The span's context is now active for distributed tracing const newContext = this._appInsights.appInsights.core.getTraceCtx(); console.log("New trace context after span creation:", newContext); // Any HTTP requests or other telemetry will now include this trace context setTimeout(() => { if (span) { span.setAttribute("task.result", "completed"); span.end(); } // Context remains until explicitly changed or another span is created console.log("Trace context after span end:", this._appInsights?.appInsights.core.getTraceCtx()); }, 500); } /** * Example showing span attribute best practices for ApplicationInsights */ public attributeBestPracticesExample(): IReadableSpan | null { if (!this._appInsights) { return null; } const span = this._appInsights.appInsights.core.startSpan("business-operation", { kind: OTelSpanKind.INTERNAL, attributes: { // Use semantic naming conventions "operation.name": "calculate_price", "operation.version": "1.2.0", // Include business context "customer.tier": "premium", "product.category": "electronics", // Include technical context "service.name": "pricing-service", "service.version": "2.1.3" } }); // Check if span is available before using it if (!span) { console.warn("Span creation failed - tracing may not be enabled"); return null; } // Add dynamic attributes during operation span.setAttributes({ "calculation.start_time": Date.now(), "input.items_count": 5, "pricing.rules_applied": "discount,tax,shipping" }); // Simulate business logic setTimeout(() => { // Ensure span is still available in callback if (span) { // Add result attributes span.setAttribute("calculation.duration_ms", 150); span.setAttribute("output.base_price", 299.99); span.setAttribute("output.final_price", 254.99); span.setAttribute("discount.applied", 45.00); // These attributes will be sent as additional properties // with ApplicationInsights telemetry for correlation and analysis span.end(); } }, 150); return span; } } /** * Helper function to initialize ApplicationInsights with startSpan support */ export function createApplicationInsightsWithSpanSupport(connectionString: string): ApplicationInsights { const appInsights = new ApplicationInsights({ config: { connectionString: connectionString, // Enable distributed tracing for span context propagation disableAjaxTracking: false, disableFetchTracking: false, enableCorsCorrelation: true, enableRequestHeaderTracking: true, enableResponseHeaderTracking: true } }); appInsights.loadAppInsights(); return appInsights; } /** * Usage example */ export function runStartSpanExamples() { // Initialize ApplicationInsights const appInsights = createApplicationInsightsWithSpanSupport( "InstrumentationKey=YOUR_INSTRUMENTATION_KEY_GOES_HERE" ); // Create example instance const examples = new StartSpanExample(appInsights); // Run examples console.log("Running basic span example..."); examples.basicSpanExample(); setTimeout(() => { console.log("Running nested span example..."); examples.nestedSpanExample(); }, 1500); setTimeout(() => { console.log("Running HTTP request span example..."); examples.httpRequestSpanExample(); }, 3000); setTimeout(() => { console.log("Running manual trace context example..."); examples.manualTraceContextExample(); }, 4500); setTimeout(() => { console.log("Running attribute best practices example..."); examples.attributeBestPracticesExample(); }, 6000); } ================================================ FILE: examples/dependency/src/utils.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { arrForEach } from "@microsoft/applicationinsights-core-js"; import { arrIncludes } from "@nevware21/ts-utils"; export const containerId = "dependency-sample-container"; export const dependencyListenerButtonId = "dependency-listener-button"; export const dependencyListenerDetailsContainerId = "dependency-listener-detail-container"; export const dependencyInitializerDetailsContainerId = "dependency-initializer-detail-container"; export const stopDependencyEventButtonId = "stop-dependency-events"; export const changeConfigButtonId = "change-config"; export const fetchCallId = "create-fetch-request"; export const fetchXhrId = "create-xhr-request"; export const ajaxCallId = "create-ajaxPerf-request"; export const untrackFetchRequestId = "create-untrack-fetch-request"; export const removeAllHandlersId = "remove-all-handlers"; export const buttonSectionId = "button-section"; export const clearDetailsButtonId = "clear-all-details"; export const addHandlersButtonId = "add-handlers"; export const configContainerId = "config-details"; export const dependencyListenerDetails: string[] = ["input","traceId","spanId","traceFlags","context"]; // check full details in console export const dependencyInitializerDetails: string[] = ["item","properties","sysProperties","context"]; // check full details in console export const ajaxDetails: string[] = ["disabbleFetchTracking", "disableExceptionTracking", "enableAutoRouteTracking"]; export const analyticsDetails: string[] = ["autoTrackPageVisitTime", "appId", "enableAjaxPerfTracking", "enableCorsCorrelation"]; export const configDetails: string[] = ["connectionString",...ajaxDetails, ...analyticsDetails]; // check full details in console export function createFetchRequest() { fetch("https://api.npms.io/v2/search?q=react&size=1").then(() =>{ console.log("a fetch call triggered"); }); } export function createXhrRequest() { let xhr = new XMLHttpRequest(); xhr.open("GET", "https://api.npms.io/v2/search?q=react&size=1"); xhr.onload = function() { console.log("a xhr call triggered"); }; xhr.send(); } export function createUnTrackRequest() { fetch("https://api.npms.io/v2/search?q=angular&size=1").then(() =>{ console.log("a untracked fetch call triggered"); }); } export function randomBoolean() { if (Math.random() > 0.5) { return true; } return false; } export function createDetailList(propsToWatch: string[], details: any, id: string, title: string) { let container = document.getElementById(id); let ele = document.createElement("div"); ele.className = "list"; let date = new Date(); let list = ""; if (details) { list += `
          Dependency ${title} Details After Modifications
          Check console for details before modifications and network trace for complete details
          Date: ${date}
          `; arrForEach(propsToWatch, (prop) => { let obj = details[prop]; if (prop === "item") { obj = {name: obj.name, target: obj.target}; } if (arrIncludes(analyticsDetails, prop)) { obj = details["extensionConfig"]["ApplicationInsightsAnalytics"][prop]; } if (arrIncludes(ajaxDetails, prop)) { obj = details["extensionConfig"]["AjaxDependencyPlugin"][prop]; } obj = (obj === undefined)? "undefined" : obj; if (typeof obj === "object") { obj = JSON.stringify(obj); } list += `
        3. ${prop}: ${obj}
        4. `; }); list += "
          -------------------------
          "; ele.innerHTML = list; container?.appendChild(ele); } } export function createContainers() { let container = document.createElement("div"); container.className = "container"; container.id = containerId; let buttonSection = createSubContainer(buttonSectionId, "container"); container.appendChild(buttonSection); let configSection = createSubContainer(configContainerId); container.appendChild(configSection); let ListenerSection = createSubContainer(dependencyListenerDetailsContainerId); container.appendChild(ListenerSection); let initializerSection = createSubContainer(dependencyInitializerDetailsContainerId); container.appendChild(initializerSection); document.body.appendChild(container); } export function createSubContainer(id: string, className?: string) { let ele = document.createElement("div"); ele.className = className || "container-main"; ele.id = id; return ele } export function createButton(buttonTextContent: string, buttonOnclickFn: any, id?: string): HTMLButtonElement { let btn = document.createElement("button"); if (id) { btn.id = id; } btn.innerHTML = buttonTextContent btn.onclick = buttonOnclickFn; return btn; } export function generateNewConfig() { let prefix = Math.random().toString(36).slice(6); let newConfig: any = { connectionString: `InstrumentationKey=newKey${prefix}`, extensionConfig: { ApplicationInsightsAnalytics: { autoTrackPageVisitTime: randomBoolean(), appId: Math.random().toString(36).slice(8), enableAjaxPerfTracking: randomBoolean(), enableCorsCorrelation: randomBoolean() }, AjaxDependencyPlugin: { disabbleFetchTracking: randomBoolean(), // if true, fetch tracking will be blocked disableExceptionTracking: randomBoolean(), enableAutoRouteTracking: randomBoolean() } } } return newConfig; } export function clearEle(id: string) { let ele = document.getElementById(id); if (ele) { ele.innerHTML = ""; } } export function clearDetailsList() { clearEle(dependencyListenerDetailsContainerId); clearEle(dependencyInitializerDetailsContainerId); } ================================================ FILE: examples/dependency/style/style.css ================================================ body { margin: 0; font-family: "Segoe UI", sans-serif; font-size: 16px; padding-left: 1rem; } h1 { font-size: 1.875rem; margin: 0.67rem 0; } h2 { font-size: 1.5rem; margin: 0.83rem 0; } h3 { font-size: 1.25rem; margin: 1rem 0; } h4 { font-size: 1.05rem; margin: 1.33rem 0; } h5 { font-size: 1rem; margin: 0.67rem 0; } h6 { font-size: 0.875rem; margin: 0.3rem 0; } .uppercase { text-transform: uppercase; } pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; } ol, ul { margin: 1em 0; } .container { max-width: 1600px; padding: 0 0.5rem; } .container-main { justify-content: space-between; font-size: 0.9rem; position: relative; margin: 1.5rem auto; padding-left: 0.5rem; max-height: 200px; overflow: auto; background-color: azure; } code, pre { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; padding: 0.2em; margin: 0; font-size: 0.875rem; border-radius: 0.8em; } button { font-family: "Segoe UI", sans-serif; margin: 0.5rem; padding: 0.2em; } .time { font-weight: bold; font-size: 0.8rem; } ================================================ FILE: examples/dependency/tsconfig.json ================================================ { "compilerOptions": { "target": "es5", "module": "es6", "sourceMap": true, "inlineSources": true, "moduleResolution": "node", "strict": true, "allowSyntheticDefaultImports": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "noImplicitAny": false, "importHelpers": true, "allowJs": true, "resolveJsonModule": true, "declaration": true, "declarationDir": "build/types", "outDir": "dist-es5", "rootDir": "./src", "removeComments": false }, "include": [ "./src" ], "exclude": [ "node_modules" ] } ================================================ FILE: examples/shared-worker/README.md ================================================ # Microsoft Application Insights JavaScript SDK Example - Shared Worker [![GitHub Workflow Status (main)](https://img.shields.io/github/actions/workflow/status/microsoft/ApplicationInsights-JS/ci.yml?branch=main)](https://github.com/microsoft/ApplicationInsights-JS/tree/main) Example to instrument a Shared-Worker ## Simple Instrumented Shared Worker Example This is a simple example that uses 2 Shared Workers as defined by - [worker.ts](./src/worker.ts) - [worker2.ts](./src/worker2.ts) You WILL NEED to have compiled the repository before running this example as it loads the compiled scripts, and you will also NEED to start the local web server via `npm run serve` from the root of repository. You can load the Shared Worker example via the [SharedWorker.html](SharedWorker.html). This implements a VERY simple Shared Worker example that passes messages between the current page and the workers using the type in the [IExampleMessage](./src/interfaces/IExampleMessage.ts), And the support functions for the Web page are located in [example-shared-worker.ts](./src/example-shared-worker.ts) ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. ## License [MIT](LICENSE) ================================================ FILE: examples/shared-worker/SharedWorker.html ================================================

          Simple Instrumented Shared Worker Example

          Please make sure that you have compiled the repository before running this example as it loads the compiled scripts.

          This script also needs to be run from the hosted `localhost` instance which can be started by running
          > npm run serve
          from the root folder of the repository.

          And then re-laoding this page from http://localhost:9001/examples/shared-worker/SharedWorker.html

          Work is sent to the worker(s) and any responses are returned and displayed on the main console, if you want to inspect the console of the workers you can access and debug the worker code via these links. You will need to manually open as accessing local resources is generally prohibited.

          • Chrome: chrome://inspect/#workers
          • MS Edge: edge://inspect/#workers


          Worker 1 - Instrumented

          You must use the Initialize SDK button at least once to initialize Application Insights within the worker. The Unload SDK will cause the SDK instance in the worker to unload and this will disable the reporting of fetch calls.
          Once the SDK in initialized it will report back when events are sent from the Workers SDK instance.


          This will cause the worker (if the SDK is initialized) to send a RemoteDependency event.
          (Contents will be sent to the main page console via a post)
          This will cause the worker (if the SDK is initialized) to send a new PageView event.
          Send an invalid request to the worker

          This is the information returned by the worker, when the SDK is initialized you will see an "Events Sent" message when the SDK has sent the events to Azure Monitor, if the connection string is valid you will see the generated events in the Azure Monitor Portal.


          Worker 2 - Not Instrumented

          (Contents will be sent to the main page console via a post)
          Send an invalid request to the worker

          This is the information returned by the worker 2.

          ================================================ FILE: examples/shared-worker/package.json ================================================ { "name": "@microsoft/applicationinsights-example-shared-worker", "author": "Microsoft Application Insights Team", "version": "3.4.1", "description": "Microsoft Application Insights Shared Worker Example", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "keywords": [ "azure", "cloud", "script errors", "microsoft", "application insights", "browser performance monitoring", "web analytics", "example" ], "module": "dist-es5/applicationinsights-example-shared-worker.js", "types": "types/applicationinsights-example-shared-worker.d.ts", "scripts": { "clean": "git clean -xdf", "build": "npm run build:esm && npm run build:browser", "build:esm": "grunt example-shared-worker", "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs", "rebuild": "npm run build", "test": "", "mintest": "", "perftest": "", "lint": "tslint -p tsconfig.json", "ai-min": "", "ai-restore": "" }, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/examples/shared-worker" }, "license": "MIT", "sideEffects": false, "devDependencies": { "@microsoft/ai-test-framework": "0.0.1", "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es5": "1.0.2", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "@nevware21/grunt-ts-plugin": "^0.5.2", "@nevware21/grunt-eslint-ts": "^0.5.2", "globby": "^11.0.0", "magic-string": "^0.25.7", "pako": "^2.0.3", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "rollup": "^3.20.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "^4.9.3", "tslib": "^2.0.0", "qunit": "^2.11.2", "sinon": "^7.3.1" }, "peerDependencies": { "tslib": ">= 1.0.0" }, "dependencies": { "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-web": "3.4.1", "@microsoft/applicationinsights-core-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x" } } ================================================ FILE: examples/shared-worker/rollup.config.js ================================================ import nodeResolve from "@rollup/plugin-node-resolve"; import { uglify } from "@microsoft/applicationinsights-rollup-plugin-uglify3-js"; import replace from "@rollup/plugin-replace"; import cleanup from "rollup-plugin-cleanup"; import dynamicRemove from "@microsoft/dynamicproto-js/tools/rollup/dist/node/removedynamic"; import { es5Poly, es5Check, importCheck } from "@microsoft/applicationinsights-rollup-es5"; import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const workerName = "example-shared-worker"; const workerModule = "worker"; const worker2Module = "worker2"; const banner = [ "/*!", ` * Application Insights JavaScript SDK Example - Shared Worker, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the MIT License.": "" }; function doCleanup() { return cleanup({ comments: [ 'some', /^.\s*@DynamicProtoStub/i, /^\*\*\s*@class\s*$/ ] }) } const browserRollupConfigFactory = (name, isProduction, format = "umd", extension = "") => { const browserRollupConfig = { input: `dist-es5/${name}.js`, output: { file: `browser/${name}${extension ? "." +extension : ""}.js`, banner: banner, format: format, name: "Microsoft.ApplicationInsights.Example", extend: true, freeze: false, sourcemap: true }, treeshake: { propertyReadSideEffects: false, moduleSideEffects: false, tryCatchDeoptimization: false, correctVarValueBeforeDeclaration: false }, plugins: [ dynamicRemove(), replace({ preventAssignment: true, delimiters: ["", ""], values: replaceValues }), // This just makes sure we are importing the example dependencies correctly importCheck({ exclude: [ "applicationinsights-example-shared-worker" ] }), nodeResolve({ module: true, browser: true, preferBuiltins: false }), doCleanup(), es5Poly(), es5Check() ] }; if (isProduction) { browserRollupConfig.output.file = `browser/${name}${extension ? "." +extension : ""}.min.js`; browserRollupConfig.plugins.push( uglify({ ie8: false, ie: true, compress: { ie: true, passes:3, unsafe: true, }, output: { ie: true, preamble: banner, webkit:true } }) ); } return browserRollupConfig; }; updateDistEsmFiles(replaceValues, banner); export default [ browserRollupConfigFactory(workerName, false, "iife", "gbl"), browserRollupConfigFactory(workerModule, false, "esm"), browserRollupConfigFactory(worker2Module, false, "esm") ]; ================================================ FILE: examples/shared-worker/src/example-shared-worker.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { getDocument } from "@nevware21/ts-utils"; import { ExampleMessageType, IExampleRequest } from "./interfaces/IExampleMessage"; let _logContainers = { log: "", log2: "" }; let _worker: SharedWorker; let _worker2: SharedWorker; //------------------------------------------------------------------------------------- // Main Page Helper functions //------------------------------------------------------------------------------------- /** * Log details to the named HTML Text Area * @param message * @param dest */ function logMessage(message: string, dest: keyof typeof _logContainers) { var dateTime = new Date().toLocaleString(); var target = "_logContainer-" + dest || "log"; var elm = document.getElementById(target); _logContainers[target] = dateTime + ": " + message + "\n" + (_logContainers[target] ||""); if (_logContainers[target].length > 4096) { _logContainers[target] = _logContainers[target].substring(0, 4090) + "...\n"; } if (elm) { elm.innerHTML = _logContainers[target]; } console.log(message); } /** * Clear the log and the named HTML Text Area * @param dest */ export function clearLog(dest: keyof typeof _logContainers) { var target = "_logContainer-" + dest || "log"; var elm = document.getElementById(target); _logContainers[target] = ""; if (elm) { elm.innerHTML = _logContainers[target]; } } //------------------------------------------------------------------------------------- // Worker 1 functions for main page //------------------------------------------------------------------------------------- /** * Cause Worker 1 to be loaded and started or return the previous loaded / started reference * @returns */ export function loadSharedWorker() { if (!_worker) { _worker = new SharedWorker("./browser/worker.js"); _worker.port.onmessage = (evt) => { let resp = evt.data; if (resp) { logMessage(JSON.stringify(resp), "log"); } } } return _worker; } /** * Send a message to Worker 1, this will initialize the worker if has not already been started * @param message */ export function sendWorkerMessage(message: IExampleRequest) { let worker = loadSharedWorker(); worker.port.postMessage(message); } /** * Ask Worker 1 to initialize the SDK * @param connectionStringId */ export function loadSdk(connectionStringId: string) { let doc = getDocument(); let elm = doc.getElementById(connectionStringId) as HTMLInputElement; let connectionString: string; if (elm) { connectionString = elm.value; } sendWorkerMessage({ type: ExampleMessageType.Load, connectionString: connectionString }); } /** * Ask Worker 1 to unload the SDK */ export function unloadSdk() { sendWorkerMessage({ type: ExampleMessageType.Unload }); } /** * Ask Worker 1 to fetch the provided URL (this will cause the worker fetch to trigger a Dependency Request) * @param urlId */ export function fetchUrl(urlId: string) { let doc = getDocument(); let elm = doc.getElementById(urlId) as HTMLInputElement; let theUrl: string; if (elm) { theUrl = elm.value; } sendWorkerMessage({ type: ExampleMessageType.Fetch, url: theUrl }); } /** * Ask Worker 1 to perform a track Page view */ export function trackPageView() { sendWorkerMessage({ type: ExampleMessageType.TrackPageView }); } /** * Send an invalid request to Worker 1 */ export function sendInvalidRequest() { sendWorkerMessage({ type: 9999 }); } //------------------------------------------------------------------------------------- // Worker 2 functions for main page //------------------------------------------------------------------------------------- /** * Cause Worker 2 to be loaded and started or return the previous loaded / started reference * @returns */ export function loadSharedWorker2() { if (!_worker2) { _worker2 = new SharedWorker("./browser/worker2.js"); _worker2.port.onmessage = (evt) => { let resp = evt.data; if (resp) { logMessage(JSON.stringify(resp), "log2"); } } } return _worker2; } /** * Send a message to Worker 2, this will initialize the worker if has not already been started * @param message */ export function sendWorker2Message(message: IExampleRequest) { let worker = loadSharedWorker2(); worker.port.postMessage(message); } /** * Ask Worker 2 to fetch the provided URL (this will cause the worker fetch to trigger a Dependency Request) * @param urlId */ export function fetch2Url(urlId: string) { let doc = getDocument(); let elm = doc.getElementById(urlId) as HTMLInputElement; let theUrl: string; if (elm) { theUrl = elm.value; } sendWorker2Message({ type: ExampleMessageType.Fetch, url: theUrl }); } /** * Send an invalid request to Worker 2 */ export function sendInvalidRequest2() { sendWorker2Message({ type: 9999 }); } ================================================ FILE: examples/shared-worker/src/interfaces/IExampleMessage.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. /** * Enum to identify the examples support messages */ export const enum ExampleMessageType { Invalid = 0, Load = 1, Unload = 2, Fetch = 3, TrackPageView = 4 } /** * The format of a request to the example workers */ export interface IExampleRequest { type: ExampleMessageType; connectionString?: string; url?: string; } /** * The format of the response returned from the workers */ export interface IExampleResponse { success: boolean; message?: string; resp?: string; } ================================================ FILE: examples/shared-worker/src/worker-npm-init.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { ApplicationInsights, IConfiguration } from "@microsoft/applicationinsights-web" import { runTargetUnload } from "@microsoft/applicationinsights-core-js"; // Cache the previously initialized instance to avoid creating multiple instances let _appInsights: ApplicationInsights; /** * Initialize (or return the previously initialized) SDK instance for the worker * @param config * @returns */ export function initApplicationInsights(config: IConfiguration, onInitCallback: (appInsights: ApplicationInsights, port: MessagePort) => void, port: MessagePort) { if (!_appInsights) { // Make sure we have a configuration object config = config || {}; if (!config.instrumentationKey || !config.connectionString) { config.connectionString = "InstrumentationKey=YOUR_INSTRUMENTATION_KEY_GOES_HERE"; } _appInsights = new ApplicationInsights({ config: config }); _appInsights.loadAppInsights(); if (_appInsights.core.isInitialized()) { // Call the callback before the trackPageView onInitCallback(_appInsights, port); _appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview } return _appInsights; } return _appInsights; } /** * Unload the SDK if it has been initialized * @returns */ export function unloadApplicationInsights() { if (_appInsights) { runTargetUnload(_appInsights); _appInsights = null; return true; } return false; } /** * Request a page view request if the SDK has been initialized * @returns */ export function trackPageView() { if (_appInsights) { _appInsights.trackPageView(); return true; } return false; } ================================================ FILE: examples/shared-worker/src/worker.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { initApplicationInsights, trackPageView, unloadApplicationInsights } from "./worker-npm-init"; import { ExampleMessageType, IExampleRequest, IExampleResponse } from "./interfaces/IExampleMessage"; import { ApplicationInsights, IConfiguration, INotificationListener } from "@microsoft/applicationinsights-web"; import { dumpObj, objAssign } from "@nevware21/ts-utils"; /** * Default base configuration, add your defaults here. * Or simply specify your entire configuration and don't have the main page pass * the connection string. */ const defaultApplicationInsightsConfig: IConfiguration = { /** * Telemtry logging level to instrumentation key. All logs with a severity * level higher than the configured level will sent as telemetry data to * the configured instrumentation key. * * 0: ALL iKey logging off * 1: logs to iKey: severity >= CRITICAL * 2: logs to iKey: severity >= WARNING */ loggingLevelTelemetry: 2 }; /** * Simple lookup table which matches the request type to the function that will process the request */ const EventHandlers: { [key: number]: (request: IExampleRequest, port: MessagePort) => IExampleResponse } = { [ExampleMessageType.Invalid]: workerInvalid, [ExampleMessageType.Load]: workerLoadSdk, [ExampleMessageType.Unload]: workerUnloadSdk, [ExampleMessageType.Fetch]: workerFetch, [ExampleMessageType.TrackPageView]: workerTrackPageView }; /** * The main shared worker entry point */ addEventListener("connect", (evt: MessageEvent) => { const port = evt.ports[0]; // Add the message listener port.addEventListener("message", (evt: MessageEvent) => { const request = evt.data; if (!request || !request.type) { // doesn't look correct port.postMessage(workerInvalid(request)); return; } console.log(`Worker: Received message [${request.type}] from main script`); let handler: (request: IExampleRequest, port: MessagePort) => IExampleResponse = EventHandlers[request.type]; if (!handler) { handler = workerInvalid; } try { let response = handler(request, port); if (response) { port.postMessage(response); } } catch (e) { port.postMessage({ success: false, message: dumpObj(e) }); } }); port.start(); }); /** * Handle "Invalid" (Unknown) request * @param request * @returns */ function workerInvalid(request: IExampleRequest) { return { success: false, message: `Unsupported command - ${request ? request.type : "Invalid Request"}` } } /** * Internal hook to listen to the events send notification from the Application Insights Sender * @param port * @returns */ function notificationListener(port: MessagePort): INotificationListener { return { eventsSendRequest: function () { port.postMessage({ success: true, message: `Events Sent: ${dumpObj(arguments)}` }); } }; } /** * We only want to add any notification listener or telemetry initializer once * otherwise they WILL get called multiple times during processing. * @param appInsights * @param port */ function onInitAddInitializers(appInsights: ApplicationInsights, port: MessagePort) { // This callback is only called once, otherwise we would keep adding listeners and initializers appInsights.core.getNotifyMgr().addNotificationListener(notificationListener(port)); // This is not normally needed, but this provides a view from the worker to the // main page about errors that the worker is having / seeing appInsights.addTelemetryInitializer((theEvent) => { if (theEvent && theEvent.name && theEvent.name["startsWith"]("InternalMessageId") && theEvent.baseData) { port.postMessage({ success: true, message: "Internal Message: " + (theEvent.baseData?.message || "--") }); // Drop ALL internal message from being sent to Azure Monitor portal return false; } }); } /** * Initialize the SDK using the passed connection string from the request (if supplied) * @param request * @param port * @returns */ function workerLoadSdk(request: IExampleRequest, port: MessagePort) { let theConfig = objAssign({}, defaultApplicationInsightsConfig); theConfig.connectionString = request.connectionString; let appInsights = initApplicationInsights(theConfig, onInitAddInitializers, port); if (appInsights && appInsights.core.isInitialized()) { return { success: true, message: `SDK Loaded and Initialized with - ${appInsights.config.connectionString}` }; } return { success: true, message: "SDK Failed to initialize" }; } /** * Unload the SDK instance * @param request * @returns */ function workerUnloadSdk(request: IExampleRequest) { if (unloadApplicationInsights()) { return { success: true, message: "SDK Unloading" }; } return { success: true, message: "SDK Already unloaded" }; } /** * Perform a "fetch" request for the provided URL * @param request * @param port * @returns */ function workerFetch(request: IExampleRequest, port: MessagePort) { function fetchFailed(reason: any) { port.postMessage({ success: false, message: dumpObj(reason) }); } fetch(request.url).then((value) => { value.text().then((theResponse) => { port.postMessage({ success: true, resp: theResponse }); }, fetchFailed); }, fetchFailed); // Will return message asynchronously return { success: true, message: "Fetch request received" }; } /** * Attempt to send a PageView event (if the SDK is initialized) * @param request * @param port * @returns */ function workerTrackPageView(request: IExampleRequest, port: MessagePort) { return { success: trackPageView(), message: "TrackPageView requested" }; } ================================================ FILE: examples/shared-worker/src/worker2.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { ExampleMessageType, IExampleRequest, IExampleResponse } from "./interfaces/IExampleMessage"; import { dumpObj } from "@nevware21/ts-utils"; const EventHandlers: { [key: number]: (request: IExampleRequest, port: MessagePort) => IExampleResponse } = { [ExampleMessageType.Invalid]: workerInvalid, [ExampleMessageType.Fetch]: workerFetch }; /** * The main shared worker entry point */ addEventListener("connect", (evt: MessageEvent) => { const port = evt.ports[0]; // Add the message listener port.addEventListener("message", (evt: MessageEvent) => { const request = evt.data; if (!request || !request.type) { // doesn't look correct console.log("Worker2: Invalid message received -- ignoring!"); return; } console.log(`Worker2: Received message [${request.type}] from main script`); let handler: (request: IExampleRequest, port: MessagePort) => IExampleResponse = EventHandlers[request.type]; if (!handler) { handler = workerInvalid; } try { let response = handler(request, port); if (response) { port.postMessage(response); } } catch (e) { port.postMessage({ success: false, message: dumpObj(e) }); } }); port.start(); }); /** * Handle "Invalid" (Unknown) request * @param request * @returns */ function workerInvalid(request: IExampleRequest) { return { success: false, message: `Unsupported commend - ${request.type}` } } /** * Perform a "fetch" request for the provided URL * @param request * @param port * @returns */ function workerFetch(request: IExampleRequest, port: MessagePort) { function fetchFailed(reason: any) { port.postMessage({ success: false, message: dumpObj(reason) }); } fetch(request.url).then((value) => { value.text().then((theResponse) => { port.postMessage({ success: true, resp: theResponse }); }, fetchFailed); }, fetchFailed); // Will return message asynchronously return { success: true, message: "Worker2: Fetch request received" }; } ================================================ FILE: examples/shared-worker/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": true, "module": "es6", "moduleResolution": "node", "target": "es5", "forceConsistentCasingInFileNames": true, "importHelpers": true, "noEmitHelpers": true, "skipLibCheck": false, "alwaysStrict": true, "skipDefaultLibCheck": true, "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "declaration": true, "declarationDir": "build/types", "outDir": "dist-es5", "rootDir": "./src", "removeComments": false }, "include": [ "src/**/*" ], "exclude": ["node_modules/"] } ================================================ FILE: examples/startSpan/package.json ================================================ { "name": "@microsoft/applicationinsights-example-startspan", "author": "Microsoft Application Insights Team", "version": "3.4.1", "description": "Microsoft Application Insights startSpan Example", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "keywords": [ "azure", "cloud", "script errors", "microsoft", "application insights", "browser performance monitoring", "web analytics", "opentelemetry", "tracing", "spans", "example" ], "scripts": { "clean": "git clean -xdf", "build": "npm run build:esm && npm run build:browser", "build:esm": "grunt example-startspan", "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs", "rebuild": "npm run build", "test": "", "mintest": "", "perftest": "", "lint": "tslint -p tsconfig.json", "ai-min": "", "ai-restore": "" }, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/examples/startSpan" }, "license": "MIT", "sideEffects": false, "devDependencies": { "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es5": "1.0.2", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "rollup": "^3.20.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "^4.9.3" }, "peerDependencies": { "tslib": ">= 1.0.0" }, "dependencies": { "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-web": "3.4.1", "@microsoft/applicationinsights-core-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x" } } ================================================ FILE: examples/startSpan/rollup.config.js ================================================ import nodeResolve from "@rollup/plugin-node-resolve"; import { uglify } from "@microsoft/applicationinsights-rollup-plugin-uglify3-js"; import replace from "@rollup/plugin-replace"; import cleanup from "rollup-plugin-cleanup"; import dynamicRemove from "@microsoft/dynamicproto-js/tools/rollup/dist/node/removedynamic"; import { es5Poly, es5Check, importCheck } from "@microsoft/applicationinsights-rollup-es5"; import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const workerName = "startspan-example-index"; const banner = [ "/*!", ` * Application Insights JavaScript SDK Example - startSpan, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the MIT License.": "" }; function doCleanup() { return cleanup({ comments: [ 'some', /^.\s*@DynamicProtoStub/i, /^\*\*\s*@class\s*$/ ] }) } const browserRollupConfigFactory = (name, isProduction, format = "umd", extension = "") => { const browserRollupConfig = { input: `dist-es5/${name}.js`, output: { file: `browser/${name}${extension ? "." +extension : ""}.js`, banner: banner, format: format, name: "Microsoft.ApplicationInsights.Example", extend: true, freeze: false, sourcemap: true }, treeshake: { propertyReadSideEffects: false, moduleSideEffects: false, tryCatchDeoptimization: false, correctVarValueBeforeDeclaration: false }, plugins: [ dynamicRemove(), replace({ preventAssignment: true, delimiters: ["", ""], values: replaceValues }), // This just makes sure we are importing the example dependencies correctly importCheck({ exclude: [ "startspan-example-index" ] }), nodeResolve({ module: true, browser: true, preferBuiltins: false }), doCleanup(), es5Poly(), es5Check() ] }; if (isProduction) { browserRollupConfig.output.file = `browser/${name}${extension ? "." +extension : ""}.min.js`; browserRollupConfig.plugins.push( uglify({ ie8: false, ie: true, compress: { ie: true, passes:3, unsafe: true, }, output: { ie: true, preamble: banner, webkit:true } }) ); } return browserRollupConfig; }; updateDistEsmFiles(replaceValues, banner); export default [ browserRollupConfigFactory(workerName, false, "iife", "gbl") ]; ================================================ FILE: examples/startSpan/src/startSpanExample.ts ================================================ // Example usage of the new startSpan implementation with withSpan helper // This shows how to use the startSpan API to create spans and set distributed trace context // // The withSpan helper provides several benefits: // 1. Automatic span context management - sets span as active during execution // 2. Context restoration - restores previous active span after execution // 3. Exception safety - ensures context is restored even if function throws // 4. Cleaner code - eliminates manual span context management // 5. Nested span support - handles complex span hierarchies automatically import { AppInsightsCore, OTelSpanKind, eOTelSpanStatusCode, withSpan } from "@microsoft/applicationinsights-core-js"; // Example 1: Basic span creation with withSpan helper function exampleBasicSpanUsage() { const core = new AppInsightsCore(); // Initialize core (simplified) core.initialize({ instrumentationKey: "your-ikey-here" }, []); // Create a span - this will automatically set it as the active trace context const span = core.startSpan("my-operation", { kind: OTelSpanKind.INTERNAL, attributes: { "operation.type": "example", "user.id": "123" } }); if (span) { // Use withSpan to execute work within the span's context const result = withSpan(core, span, () => { // Do some work within the span context... span.setAttribute("result", "success"); // span.addEvent("Processing started"); // Not implemented yet // Create a child span that will automatically inherit the current active context const childSpan = core.startSpan("child-operation", { kind: OTelSpanKind.CLIENT, attributes: { "http.method": "GET", "http.url": "https://api.example.com/data" } }); if (childSpan) { // Execute child work within its own span context withSpan(core, childSpan, () => { // childSpan.addEvent("API call completed"); // Not implemented yet childSpan.setStatus({ code: eOTelSpanStatusCode.OK }); }); childSpan.end(); } return "operation completed"; }); // Complete the parent span // span.addEvent("Processing completed"); // Not implemented yet span.setStatus({ code: eOTelSpanStatusCode.OK }); span.end(); console.log("Operation result:", result); } } // Example 2: Manual parent context management with withSpan function exampleManualParentContext() { const core = new AppInsightsCore(); // Get the current active trace context const currentTraceCtx = core.getTraceCtx(); if (currentTraceCtx) { // Create a new span with explicit parent const span = core.startSpan("background-task", { kind: OTelSpanKind.INTERNAL, attributes: { "task.type": "background" } }, currentTraceCtx); if (span) { // Use withSpan to execute work within the span context // This ensures the span is properly active during execution withSpan(core, span, () => { // span.addEvent("Task started"); // Not implemented yet // Simulate some background work // In real scenarios, this could make HTTP requests, database calls, etc. // All will inherit this span's context automatically console.log("Executing background task with trace context:", span.spanContext().traceId); // Create a child operation within this context const childSpan = core.startSpan("background-subtask", { kind: OTelSpanKind.INTERNAL, attributes: { "subtask.type": "data-processing" } }); if (childSpan) { withSpan(core, childSpan, () => { // This subtask automatically inherits the parent context childSpan.setAttribute("processed.items", 42); }); childSpan.end(); } return "background work completed"; }); // span.addEvent("Task completed"); // Not implemented yet span.end(); } } } // Example 3: Integration with existing telemetry using withSpan function exampleWithTelemetry() { const core = new AppInsightsCore(); // Start a span for a user action const userActionSpan = core.startSpan("user-checkout", { kind: OTelSpanKind.SERVER, attributes: { "user.id": "user123", "action": "checkout", "cart.items": 5 } }); if (userActionSpan) { // Use withSpan to execute the entire checkout process within the span context const result = withSpan(core, userActionSpan, () => { // Now all subsequent telemetry will inherit this trace context // including dependency calls, custom events, etc. // Simulate processing steps // userActionSpan.addEvent("Validating cart"); // Not implemented yet console.log("Processing checkout for user in trace context:", userActionSpan.spanContext().traceId); // Create child span for payment processing const paymentSpan = core.startSpan("process-payment", { kind: OTelSpanKind.CLIENT, attributes: { "payment.method": "credit_card", "payment.amount": 99.99 } }); if (paymentSpan) { // Execute payment processing within its own span context const paymentResult = withSpan(core, paymentSpan, () => { // paymentSpan.addEvent("Payment authorized"); // Not implemented yet paymentSpan.setAttribute("payment.processor", "stripe"); paymentSpan.setAttribute("payment.status", "authorized"); paymentSpan.setStatus({ code: eOTelSpanStatusCode.OK }); return { success: true, transactionId: "txn_12345" }; }); paymentSpan.end(); // Update parent span with payment result userActionSpan.setAttribute("payment.success", paymentResult.success); userActionSpan.setAttribute("transaction.id", paymentResult.transactionId); return { checkoutSuccess: true, payment: paymentResult, completedAt: new Date().toISOString() }; } return { checkoutSuccess: false, error: "Payment processing failed" }; }); // Complete the user action span // userActionSpan.addEvent("Checkout completed"); // Not implemented yet userActionSpan.setStatus({ code: eOTelSpanStatusCode.OK }); userActionSpan.end(); console.log("Checkout completed:", result); return result; } return null; } export { exampleBasicSpanUsage, exampleManualParentContext, exampleWithTelemetry }; ================================================ FILE: examples/startSpan/src/startspan-example-index.ts ================================================ // startSpan Example Index // This file exports the startSpan example functions for use in browser builds export { exampleBasicSpanUsage, exampleManualParentContext, exampleWithTelemetry } from "./startSpanExample"; ================================================ FILE: examples/startSpan/tsconfig.json ================================================ { "compilerOptions": { "target": "es5", "module": "es6", "sourceMap": true, "inlineSources": true, "moduleResolution": "node", "strict": true, "allowSyntheticDefaultImports": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "noImplicitAny": false, "importHelpers": true, "allowJs": true, "resolveJsonModule": true, "declaration": true, "declarationDir": "build/types", "outDir": "dist-es5", "rootDir": "./src", "removeComments": false }, "include": [ "./src" ], "exclude": [ "node_modules" ] } ================================================ FILE: extensions/applicationinsights-analytics-js/.npmignore ================================================ # NPM Ignore # ignore everything * # ... but these files !package.json !tsconfig.json !/CODE_OF_CONDUCT.md !/CONTRIBUTING.md !/README.md !/SECURITY.md !/SUPPORT.md !/NOTICE !/PRIVACY !/LICENSE !/LICENSE.TXT !dist-es*/** !dist/** !browser/** !types/** ================================================ FILE: extensions/applicationinsights-analytics-js/LICENSE ================================================ The MIT License (MIT) Copyright (c) Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: extensions/applicationinsights-analytics-js/NOTICE ================================================ NOTICES AND INFORMATION Do Not Translate or Localize This software incorporates material from third parties. Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, or you may send a check or money order for US $5.00, including the product name, the open source component name, and version number, to: Source Code Compliance Team Microsoft Corporation One Microsoft Way Redmond, WA 98052 USA Notwithstanding any other terms, you may reverse engineer this software to the extent required to debug changes to any libraries licensed under the GNU Lesser General Public License. ================================================ FILE: extensions/applicationinsights-analytics-js/PRIVACY ================================================ # Data Collection The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ================================================ FILE: extensions/applicationinsights-analytics-js/README.md ================================================ # Microsoft Application Insights JavaScript SDK - Analytics [![GitHub Workflow Status (main)](https://img.shields.io/github/actions/workflow/status/microsoft/ApplicationInsights-JS/ci.yml?branch=main)](https://github.com/microsoft/ApplicationInsights-JS/tree/main) [![Build Status](https://dev.azure.com/mseng/AppInsights/_apis/build/status%2FAppInsights%20-%20DevTools%2F1DS%20JavaScript%20SDK%20web%20SKU%20(main%3B%20master)?branchName=main)](https://dev.azure.com/mseng/AppInsights/_build/latest?definitionId=8184&branchName=main) [![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-analytics-js.svg)](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-analytics-js) Web Analytics Plugin for the Application Insights Javascript SDK ## Build: ``` npm install -g grunt-cli npm install npm run build --silent ``` ## Run unit tests: ``` npm run test ``` ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. ## License [MIT](LICENSE) ================================================ FILE: extensions/applicationinsights-analytics-js/Tests/Unit/src/AnalyticsExtensionSize.tests.ts ================================================ import { Assert, AITestClass } from "@microsoft/ai-test-framework"; import { dumpObj } from '@nevware21/ts-utils'; import { createPromise, doAwait, IPromise } from '@nevware21/ts-async'; import * as pako from "pako"; const PACKAGE_JSON = "../package.json"; function removeTrailingComma(text) { return text.replace(/,(\s*[}\],])/g, "$1"); } function _loadPackageJson(cb:(isNightly: boolean, packageJson: any) => IPromise): IPromise { return createPromise((testCompleted, testFailed) => { function _handleCallback(packageJson: any) { let version = packageJson.version || "unknown"; let isNightly = version.includes("nightly") || version.includes("dev"); doAwait(cb(isNightly, packageJson), () => { testCompleted(); }, (error) => { Assert.ok(false, `checkIsNightlyBuild error: ${error}`); testFailed(error); }); } fetch(PACKAGE_JSON).then((response) => { if (!response.ok) { Assert.ok(false, `fetch package.json error: ${dumpObj(response)}`); _handleCallback(false); } else { return response.text().then((content) => { let json = JSON.parse(removeTrailingComma(content)); _handleCallback(json); }, (error) => { Assert.ok(false, `fetch package.json error: ${error}`); _handleCallback({}); }); } }, (error) => { Assert.ok(false, `fetch package.json error: ${error}`); _handleCallback({}); }); }); } function _checkSize(checkType: string, maxSize: number, size: number, isNightly: boolean): void { if (isNightly) { maxSize += .5; } Assert.ok(size <= maxSize, `exceed ${maxSize} KB, current ${checkType} size is: ${size} KB`); } export class AnalyticsExtensionSizeCheck extends AITestClass { private readonly MAX_DEFLATE_SIZE = 27; private readonly rawFilePath = "../dist/es5/applicationinsights-analytics-js.min.js"; private readonly prodFilePaath = "../browser/es5/applicationinsights-analytics-js.min.js" public testInitialize() { } public testCleanup() { } public registerTests() { this.addRawFileSizeCheck(); this.addProdFileSizeCheck(); } constructor() { super("AnalyticsExtensionSizeCheck"); } private addRawFileSizeCheck(): void { this._fileSizeCheck(false); } private addProdFileSizeCheck(): void { this._fileSizeCheck(true); } private _fileSizeCheck(isProd: boolean): void { let _filePath = isProd? this.prodFilePaath : this.rawFilePath; let postfix = isProd? "" : "-raw"; let fileName = _filePath.split("..")[1]; this.testCase({ name: `Test applicationinsights-analytics-extension${postfix} deflate size`, test: () => { Assert.ok(true, `test file: ${fileName}`); return _loadPackageJson((isNightly, packageJson) => { Assert.ok(true, ` checking : ${packageJson.name || "??"} v${packageJson.version || "unknown"}`); let request = new Request(_filePath, {method:"GET"}); return fetch(request).then((response) => { if (!response.ok) { Assert.ok(false, `fetch applicationinsights-analytics${postfix} error: ${response.statusText}`); return; } else { return response.text().then(text => { let size = Math.ceil((pako.deflate(text).length/1024) * 100) / 100.0; _checkSize("deflate", this.MAX_DEFLATE_SIZE, size, isNightly); }).catch((error) => { Assert.ok(false, `applicationinsights-analytics-extension${postfix} response error: ${error}`); }); } }).catch((error: Error) => { Assert.ok(false, `applicationinsights-analytics-extension${postfix} deflate size error: ${error}`); }); }); } }); } } ================================================ FILE: extensions/applicationinsights-analytics-js/Tests/Unit/src/AnalyticsPlugin.tests.ts ================================================ import { Assert, AITestClass, PollingAssert, EventValidator, TraceValidator, ExceptionValidator, MetricValidator, PageViewPerformanceValidator, PageViewValidator, RemoteDepdencyValidator } from "@microsoft/ai-test-framework"; import { SinonStub, SinonSpy } from 'sinon'; import { Exception, SeverityLevel, Event, Trace, PageViewPerformance, IConfig, IExceptionInternal, AnalyticsPluginIdentifier, IAppInsights, Metric, PageView, RemoteDependencyData, utlCanUseLocalStorage, createDomEvent, ExceptionDataType, TraceDataType, PageViewPerformanceDataType, RemoteDependencyDataType, PageViewDataType, MetricDataType, EventDataType, ExceptionEnvelopeType, TraceEnvelopeType, PageViewPerformanceEnvelopeType } from "@microsoft/applicationinsights-core-js"; import { ITelemetryItem, AppInsightsCore, IPlugin, IConfiguration, IAppInsightsCore, setEnableEnvMocks, getLocation, dumpObj, __getRegisteredEvents, createCookieMgr, findAllScripts } from "@microsoft/applicationinsights-core-js"; import { Sender } from "@microsoft/applicationinsights-channel-js" import { PropertiesPlugin } from "@microsoft/applicationinsights-properties-js"; import { AnalyticsPlugin } from "../../../src/JavaScriptSDK/AnalyticsPlugin"; declare class ExceptionHelper { capture: (appInsights:IAppInsights) => void; captureStrict: (appInsights:IAppInsights) => void; throw: (value:any) => void; throwCors: () => void; throwStrict: (value:any) => void; throwRuntimeException: (timeoutFunc: VoidFunction) => void; throwStrictRuntimeException: (timeoutFunc: VoidFunction) => void; }; export class AnalyticsPluginTests extends AITestClass { private _onerror:any = null; private trackSpy:SinonSpy; private throwInternalSpy:SinonSpy; private exceptionHelper: any = new ExceptionHelper(); private cookieMgr = createCookieMgr(); constructor(name?: string, emulateIe?: boolean) { super(name, emulateIe); this.assertNoEvents = true; this.assertNoHooks = true; } public testInitialize() { this._onerror = window.onerror; setEnableEnvMocks(false); super.testInitialize(); this.cookieMgr.set('ai_session', ""); this.cookieMgr.set('ai_user', ""); if (utlCanUseLocalStorage()) { window.localStorage.clear(); } } public testCleanup() { super.testCleanup(); this.cookieMgr.set('ai_session', ""); this.cookieMgr.set('ai_user', ""); if (utlCanUseLocalStorage()) { window.localStorage.clear(); } window.onerror = this._onerror; } public causeException(cb:Function) { AITestClass.orgSetTimeout(() => { cb(); }, 0); } public registerTests() { this.testCase({ name: 'enableAutoRouteTracking: event listener is added to the popstate event', test: () => { // Setup const appInsights = new AnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const eventListenerStub = this.sandbox.stub(window, 'addEventListener'); let evtNamespace = (appInsights as any)._evtNamespace; let registeredEvents = __getRegisteredEvents(window, null, evtNamespace); Assert.equal(0, registeredEvents.length, "No Events should be registered"); this.onDone(() => { core.unload(false); }); // Act core.initialize({ instrumentationKey: '', enableAutoRouteTracking: true } as IConfig & IConfiguration, [appInsights, channel]); registeredEvents = __getRegisteredEvents(window, null, evtNamespace); Assert.equal(2, registeredEvents.length, "Two Events should be registered"); // Assert Assert.ok(eventListenerStub.calledTwice); Assert.equal(eventListenerStub.args[0][0], "popstate"); Assert.equal(eventListenerStub.args[1][0], "locationchange"); core.getPlugin(appInsights.identifier).remove(false); registeredEvents = __getRegisteredEvents(window, null, evtNamespace); Assert.equal(0, registeredEvents.length, "All Events should have been removed"); } }); this.testCase({ name: 'enableAutoRouteTracking: route changes trigger a new pageview', useFakeTimers: true, assertNoEvents: true, test: () => { // Current URL will be the test page setEnableEnvMocks(true); this.setLocationHref("firstUri"); // Setup const appInsights = new AnalyticsPlugin(); appInsights.autoRoutePVDelay = 500; const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const properties = new PropertiesPlugin(); const trackPageViewStub = this.sandbox.stub(appInsights, 'trackPageView'); let evtNamespace = (appInsights as any)._evtNamespace; let registeredEvents = __getRegisteredEvents(window, null, evtNamespace); Assert.equal(0, registeredEvents.length, "No Events should be registered"); this.onDone(() => { if (core.isInitialized()) { core.unload(false); } }); // Act core.initialize({ instrumentationKey: '', enableAutoRouteTracking: true } as IConfig & IConfiguration, [appInsights, channel, properties]); properties.context.telemetryTrace.traceID = 'not set'; properties.context.telemetryTrace.name = 'name not set'; registeredEvents = __getRegisteredEvents(window, null, evtNamespace); Assert.equal(2, registeredEvents.length, "Two Events should be registered"); this.setLocationHref("secondUri"); window.dispatchEvent(createDomEvent('locationchange')); this.clock.tick(500); this.setLocationHref("thirdUri"); window.dispatchEvent(createDomEvent('locationchange')); this.clock.tick(500); // Assert Assert.equal(2, trackPageViewStub.callCount); Assert.ok(properties.context.telemetryTrace.traceID); Assert.ok(properties.context.telemetryTrace.name); Assert.notEqual(properties.context.telemetryTrace.traceID, 'not set', 'current operation id is updated after route change'); Assert.notEqual(properties.context.telemetryTrace.name, 'name not set', 'current operation name is updated after route change'); // Assert.equal(appInsights['_prevUri'], 'secondUri', "the previous uri is stored on variable _prevUri"); // Assert.equal(appInsights['_currUri'], window.location.href, "the current uri is stored on variable _currUri"); Assert.equal("firstUri", trackPageViewStub.args[0][0].refUri, "previous uri is assigned to refUri as firstUri, and send as an argument of trackPageview method"); Assert.equal("secondUri", trackPageViewStub.args[1][0].refUri, "previous uri is assigned to refUri as secondUri and send as an argument of trackPageview method"); core.unload(false); registeredEvents = __getRegisteredEvents(window, null, evtNamespace); Assert.equal(0, registeredEvents.length, "All Events should have been removed"); } }); this.testCase({ name: 'enableAutoRouteTracking: route changes trigger a new pageview with correct refUri when route changes happening before the timer autoRoutePVDelay stops', useFakeTimers: true, test: () => { // Setup setEnableEnvMocks(true); this.setLocationHref("firstUri"); const appInsights = new AnalyticsPlugin(); appInsights.autoRoutePVDelay = 500; const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const properties = new PropertiesPlugin(); appInsights['_prevUri'] = "firstUri"; const trackPageViewStub = this.sandbox.stub(appInsights, 'trackPageView'); this.onDone(() => { core.unload(false); }); // Act core.initialize({ instrumentationKey: '', enableAutoRouteTracking: true } as IConfig & IConfiguration, [appInsights, channel, properties]); properties.context.telemetryTrace.traceID = 'not set'; properties.context.telemetryTrace.name = 'name not set'; window.dispatchEvent(createDomEvent('locationchange')); this.clock.tick(200); // set up second dispatch window.dispatchEvent(createDomEvent('locationchange')); this.clock.tick(500); // Assert Assert.equal(2, trackPageViewStub.callCount); Assert.ok(properties.context.telemetryTrace.traceID); Assert.ok(properties.context.telemetryTrace.name); Assert.notEqual(properties.context.telemetryTrace.traceID, 'not set', 'current operation id is updated after route change'); Assert.notEqual(properties.context.telemetryTrace.name, 'name not set', 'current operation name is updated after route change'); // first trackPageView event Assert.equal(trackPageViewStub.args[0][0].refUri, 'firstUri', "first trackPageview event: refUri grabs the value of existing _prevUri"); // Assert.equal(appInsights['_currUri'], getLocation(true).href, "first trackPageview event: the current uri is stored on variable _currUri"); // second trackPageView event Assert.equal(trackPageViewStub.args[1][0].refUri, getLocation(true).href, "second trackPageview event: refUri grabs the value of updated _prevUri, which is the first pageView event's _currUri"); } }); this.testCase({ name: 'enableAutoRouteTracking: (IE9) app does not crash if history.pushState does not exist', test: () => { // Setup const originalPushState = history.pushState; const originalReplaceState = history.replaceState; history.pushState = null; history.replaceState = null; const appInsights = new AnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const properties = new PropertiesPlugin(); this.sandbox.stub(appInsights, 'trackPageView'); this.onDone(() => { core.unload(false); }); // Act core.initialize({ instrumentationKey: '', enableAutoRouteTracking: true } as IConfig & IConfiguration, [appInsights, channel, properties]); properties.context.telemetryTrace.traceID = 'not set'; properties.context.telemetryTrace.parentID = undefined; window.dispatchEvent(createDomEvent('locationchange')); // Assert Assert.ok(true, 'App does not crash when history object is incomplete'); // Cleanup history.pushState = originalPushState; history.replaceState = originalReplaceState; } }); this.testCase({ name: 'AppInsightsTests: PageVisitTimeManager is constructed when analytics plugin is initialized', test: () => { // Setup const channel = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights: AnalyticsPlugin = new AnalyticsPlugin(); // Act const config = { instrumentationKey: 'ikey' }; this.onDone(() => { core.unload(false); }); core.initialize( config, [appInsights, channel] ); const pvtm = appInsights['_pageVisitTimeManager']; // Assert Assert.ok(pvtm) Assert.ok(pvtm['_logger']); Assert.ok(pvtm['pageVisitTimeTrackingHandler']); } }); this.testCase({ name: 'AppInsightsTests: PageVisitTimeManager is available when config.autoTrackPageVisitTime is true and trackPageView is called', test: () => { // Setup const channel = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights: AnalyticsPlugin = new AnalyticsPlugin(); const config = { instrumentationKey: 'ikey', autoTrackPageVisitTime: true }; this.onDone(() => { core.unload(false); }); core.initialize( config, [appInsights, channel] ); const pvtm = appInsights['_pageVisitTimeManager']; const pvtmSpy = this.sandbox.spy(pvtm, 'trackPreviousPageVisit'); Assert.ok(pvtm) Assert.ok(pvtmSpy.notCalled); // Act appInsights.trackPageView(); // Assert Assert.ok(pvtmSpy.calledOnce); } }); this.testCase({ name: 'AppInsightsTests: config can be set from root', test: () => { // Setup const appInsights = new AnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const properties = new PropertiesPlugin(); // Act const config = { instrumentationKey: 'instrumentation_key', samplingPercentage: 12, accountId: 'aaa', extensionConfig: { [appInsights.identifier]: { accountId: 'def' } } }; this.onDone(() => { core.unload(false); }); // Initialize core.initialize(config, [appInsights, channel, properties]); // Assert Assert.equal(12, appInsights.config.samplingPercentage); Assert.notEqual('aaa', appInsights.config.accountId); Assert.equal('def', appInsights.config.accountId); //Assert.equal('instrumentation_key', (appInsights['config'] as IConfiguration).instrumentationKey); Assert.equal(30 * 60 * 1000, appInsights.config.sessionRenewalMs); Assert.equal(24 * 60 * 60 * 1000, appInsights.config.sessionExpirationMs); let extConfig = core.config.extensionConfig![AnalyticsPluginIdentifier] as IConfig; Assert.equal('instrumentation_key', core.config.instrumentationKey); Assert.equal(12, extConfig.samplingPercentage); Assert.notEqual('aaa', extConfig.accountId); Assert.equal('def', extConfig.accountId); Assert.equal(30 * 60 * 1000, extConfig.sessionRenewalMs); Assert.equal(24 * 60 * 60 * 1000, extConfig.sessionExpirationMs); } }); this.testCase({ name: "AppInsightsTests: autoExceptionInstrumented can be set correctly without root config", test: () => { let appInsights = new AnalyticsPlugin(); let core = new AppInsightsCore(); let channel = new ChannelPlugin(); let config: IConfig & IConfiguration = { instrumentationKey: "instrumentation_key", samplingPercentage: 12, extensionConfig: {} }; this.onDone(() => { core.unload(false); }); // Initialize core.initialize(config, [appInsights, channel]); let extConfig = (core.config.extensionConfig || {})[AnalyticsPluginIdentifier] as IConfig; Assert.equal(extConfig.autoExceptionInstrumented, undefined, "auto exception hook should be undefined for extenstion config"); let autoExceptionHooked = appInsights["_getDbgPlgTargets"]()[1]; Assert.equal(autoExceptionHooked, true, "autoExceptionInstrumented should be set true"); let errorHookCnt = appInsights["_getDbgPlgTargets"]()[0]; Assert.equal(errorHookCnt, 1, "auto exception hook should be instrumented"); Assert.equal(extConfig.autoUnhandledPromiseInstrumented, false, "autoUnhandledPromise should not be Instrumented"); } }); this.testCase({ name: "AppInsightsTests: autoExceptionInstrumented can be set correctly without root config and with enableUnhandledPromiseRejectionTracking ", test: () => { let appInsights = new AnalyticsPlugin(); let core = new AppInsightsCore(); let channel = new ChannelPlugin(); let config: IConfig & IConfiguration = { instrumentationKey: "instrumentation_key", samplingPercentage: 12, extensionConfig: { [appInsights.identifier]: { enableUnhandledPromiseRejectionTracking: true } } }; this.onDone(() => { core.unload(false); }); // Initialize core.initialize(config, [appInsights, channel]); let extConfig = (core.config.extensionConfig || {})[AnalyticsPluginIdentifier] as IConfig; Assert.equal(extConfig.autoExceptionInstrumented, undefined, "auto exception hook should be undefined for extenstion config"); let autoExceptionHooked = appInsights["_getDbgPlgTargets"]()[1]; Assert.equal(autoExceptionHooked, true, "autoExceptionInstrumented should be set true"); Assert.equal(extConfig.autoUnhandledPromiseInstrumented, true, "autoUnhandledPromiseInstrumented is set to true"); let errorHookCnt = appInsights["_getDbgPlgTargets"]()[0]; Assert.equal(errorHookCnt, 2, "auto exception hook should be instrumented twice"); } }); this.testCase({ name: "AppInsightsTests: autoExceptionInstrumented can be set correctly with root config", useFakeTimers: true, test: () => { let appInsights = new AnalyticsPlugin(); let core = new AppInsightsCore(); let channel = new ChannelPlugin(); let config: IConfig & IConfiguration = { instrumentationKey: "instrumentation_key", samplingPercentage: 12, autoExceptionInstrumented: true, extensionConfig: {} }; this.onDone(() => { core.unload(false); }); // Initialize core.initialize(config, [appInsights, channel]); let extConfig = (core.config.extensionConfig || {})[AnalyticsPluginIdentifier] as IConfig; Assert.equal(extConfig.autoExceptionInstrumented, undefined, "auto exception hook should be undefined for extenstion config"); let autoExceptionHooked = appInsights["_getDbgPlgTargets"]()[1]; Assert.equal(autoExceptionHooked, true, "autoExceptionInstrumented should be set true"); let errorHookCnt = appInsights["_getDbgPlgTargets"]()[0]; Assert.equal(errorHookCnt, 0, "auto exception hook should not be instrumented again"); Assert.equal(extConfig.autoUnhandledPromiseInstrumented, false, "autoUnhandledPromise should not be Instrumented"); (core.config as IConfiguration & IConfig).autoExceptionInstrumented = false; extConfig.autoExceptionInstrumented = false; this.clock.tick(1); autoExceptionHooked = appInsights["_getDbgPlgTargets"]()[1]; Assert.equal(autoExceptionHooked, true, "autoExceptionInstrumented should be not be override"); } }); this.testCase({ name: "AppInsightsTests: autoExceptionInstrumented can be set correctly with root config and enableUnhandledPromiseRejectionTracking", test: () => { let appInsights = new AnalyticsPlugin(); let core = new AppInsightsCore(); let channel = new ChannelPlugin(); let config: IConfig & IConfiguration = { instrumentationKey: "instrumentation_key", samplingPercentage: 12, autoExceptionInstrumented: true, extensionConfig: { [appInsights.identifier]: { enableUnhandledPromiseRejectionTracking: true } } }; this.onDone(() => { core.unload(false); }); // Initialize core.initialize(config, [appInsights, channel]); let extConfig = (core.config.extensionConfig || {})[AnalyticsPluginIdentifier] as IConfig; Assert.equal(extConfig.autoExceptionInstrumented, undefined, "auto exception hook should be undefined for extenstion config"); let autoExceptionHooked = appInsights["_getDbgPlgTargets"]()[1]; Assert.equal(autoExceptionHooked, true, "autoExceptionInstrumented should be set true"); Assert.equal(extConfig.autoUnhandledPromiseInstrumented, true, "autoUnhandledPromiseInstrumented is set to true"); let errorHookCnt = appInsights["_getDbgPlgTargets"]()[0]; Assert.equal(errorHookCnt, 1, "auto exception hook should be instrumented for autoUnhandledPromiseInstrumented"); } }); this.testCase({ name: "AppInsightsTests: public members are correct", test: () => { // setup const appInsights = new AnalyticsPlugin(); const leTest = (name) => { // assert Assert.ok(name in appInsights, name + " exists"); } // act const members = [ "config", "trackException", "_onerror", "trackEvent", "trackTrace", "trackMetric", "trackPageView", "trackPageViewPerformance", "startTrackPage", "stopTrackPage", "startTrackEvent", "stopTrackEvent" ]; while (members.length) { leTest(members.pop()); } } }); this.addGenericTests(); this.addStartStopTrackPageTests(); this.addStartStopTrackEventTests() this.addTrackExceptionTests(); this.addOnErrorTests(); this.addTrackMetricTests(); this.addTelemetryInitializerTests(); this.addScriptInfoTests(); } private addScriptInfoTests(): void { this.testCase({ name: "AppInsightsTests: findAllScripts function returns correct information", useFakeTimers: true, test: () => { // Initialize Application Insights core with plugins let script = window.document.createElement("script"); script.src = "https://www.example.com/test.js"; script.innerHTML = 'test script'; window.document.body.appendChild(script); let doc = window.document; let scriptsInfo = findAllScripts(doc); Assert.deepEqual(true, JSON.stringify(scriptsInfo).indexOf("https://www.example.com/test.js") !== -1, "script info contains the correct url"); } }); this.testCase({ name: "AppInsightsTests: trackException would contain scrips info when config turns on", useFakeTimers: true, test: () => { const appInsights = new AnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const properties = new PropertiesPlugin(); // Configuration const config = { instrumentationKey: 'ikey', }; this.onDone(() => { core.unload(false); }); // Initialize Application Insights core with plugins core.initialize(config, [appInsights, channel, properties]); // add test script let script = window.document.createElement("script"); script.src = "https://www.example1.com/test.js"; script.setAttribute("referrerpolicy", "no-referrer"); script.innerHTML = 'test script'; let script2 = window.document.createElement("script"); script2.src = "https://www.test.com/test.js"; script2.innerHTML = "test tests"; script2.setAttribute("async", ""); window.document.body.appendChild(script); window.document.body.appendChild(script2); const trackStub = this.sandbox.stub(appInsights.core, "track"); appInsights.trackException({error: new Error(), severityLevel: SeverityLevel.Critical}); Assert.ok(trackStub.calledOnce, "single exception is tracked"); const baseData = (trackStub.args[0][0] as ITelemetryItem).baseData as IExceptionInternal; const prop = baseData.properties; Assert.equal(-1, JSON.stringify(prop).indexOf("https://www.example.com/test.js"), "script info is not included"); appInsights.config.expCfg.inclScripts = true; this.clock.tick(1); appInsights.trackException({error: new Error(), severityLevel: SeverityLevel.Critical}); Assert.ok(trackStub.calledTwice, "single exception is tracked"); const baseData2 = (trackStub.args[1][0] as ITelemetryItem).baseData as IExceptionInternal; const prop2 = baseData2.properties; Assert.deepEqual(true, prop2["exceptionScripts"].includes('"url":"https://www.test.com/test.js","async":true}')) Assert.deepEqual(true, prop2["exceptionScripts"].includes('"url":"https://www.example1.com/test.js","referrerPolicy":"no-referrer"')) } }); this.testCase({ name: "AppInsightsTests: trackException would contain log info when config turns on", useFakeTimers: true, test: () => { const appInsights = new AnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const properties = new PropertiesPlugin(); // Configuration const config = { instrumentationKey: 'ikey', }; this.onDone(() => { core.unload(false); }); // Initialize Application Insights core with plugins core.initialize(config, [appInsights, channel, properties]); const trackStub = this.sandbox.stub(appInsights.core, "track"); appInsights.trackException({error: new Error(), severityLevel: SeverityLevel.Critical}); Assert.ok(trackStub.calledOnce, "single exception is tracked"); const baseData = (trackStub.args[0][0] as ITelemetryItem).baseData as IExceptionInternal; const prop = baseData.properties; Assert.equal(-1, JSON.stringify(prop).indexOf("test message"), "log info is not included"); let applelist = new Array(49).fill("apple"); // check maxLength default value appInsights.config.expCfg.expLog = () => { return {logs: applelist.concat(['pear', 'banana'])}; };; this.clock.tick(1); appInsights.trackException({error: new Error(), severityLevel: SeverityLevel.Critical}); Assert.ok(trackStub.calledTwice, "second exception is tracked"); const baseData2 = (trackStub.args[1][0] as ITelemetryItem).baseData as IExceptionInternal; const prop2 = baseData2.properties; Assert.deepEqual(true, prop2["exceptionLog"].includes('apple'), "log info before max length is included"); Assert.deepEqual(true, prop2["exceptionLog"].includes('pear'), "log info before max length is included"); Assert.equal(-1, prop2["exceptionLog"].indexOf("banana"), "text after max length should not be included"); // check maxLength would truncate the log info let myLogFunction = () => { return {logs: ['test message', 'check message', 'banana']}; }; appInsights.config.expCfg.expLog = myLogFunction; appInsights.config.expCfg.maxLogs = 2; this.clock.tick(1); appInsights.trackException({error: new Error(), severityLevel: SeverityLevel.Critical}); this.clock.tick(1); Assert.ok(trackStub.calledThrice, "third exception is tracked"); const baseData3 = (trackStub.args[2][0] as ITelemetryItem).baseData as IExceptionInternal; const prop3 = baseData3.properties; Assert.deepEqual(true, prop3["exceptionLog"].includes('test'), "log info is included"); Assert.equal(false, prop3["exceptionLog"].includes("banana"), "text after max length should not be included"); } }); } private addGenericTests(): void { this.testCase({ name: 'AppInsightsGenericTests: envelope type, data type, and ikey are correct', test: () => { // setup const iKey: string = "BDC8736D-D8E8-4B69-B19B-B0CE6B66A456"; const iKeyNoDash: string = "BDC8736DD8E84B69B19BB0CE6B66A456"; const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); core.initialize( {instrumentationKey: iKey}, [plugin] ); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.addPlugin(appInsights); const trackStub = this.sandbox.stub(appInsights.core, "track"); let envelope: ITelemetryItem; const test = (action, expectedEnvelopeType, expectedDataType, test?: () => void) => { action(); envelope = this.getFirstResult(action, trackStub); Assert.equal("", envelope.iKey, "envelope iKey"); Assert.equal(expectedEnvelopeType, envelope.name, "envelope name"); Assert.equal(expectedDataType, envelope.baseType, "data type name"); if (typeof test === 'function') {test();} trackStub.reset(); }; // Test test(() => appInsights.trackException({exception: new Error(), severityLevel: SeverityLevel.Critical}), ExceptionEnvelopeType, ExceptionDataType) test(() => appInsights.trackException({error: new Error(), severityLevel: SeverityLevel.Critical}), ExceptionEnvelopeType, ExceptionDataType) test(() => appInsights.trackTrace({message: "some string"}), TraceEnvelopeType, TraceDataType); test(() => appInsights.trackPageViewPerformance({name: undefined, uri: undefined, measurements: {somefield: 123}}, {vpHeight: 123}), PageViewPerformanceEnvelopeType, PageViewPerformanceDataType, () => { Assert.deepEqual(undefined, envelope.baseData.properties, 'Properties does not exist in Part B'); }); } }); this.testCase({ name: 'AppInsightsGenericTests: public APIs call track', useFakeTimers: true, test: () => { // setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const senderStub = this.sandbox.stub(appInsights.core, "track"); // Act appInsights.trackException({exception: new Error(), severityLevel: SeverityLevel.Critical}); appInsights.trackException({error: new Error(), severityLevel: SeverityLevel.Critical}); appInsights.trackException({exception: "Critical Exception" as any, severityLevel: SeverityLevel.Critical}); appInsights.trackException("Critical Exception" as any); this.clock.tick(1); // Test Assert.equal(4, senderStub.callCount, "Telemetry is sent when master switch is on"); } }); } private addTrackExceptionTests(): void { this.testCase({ name: "TrackExceptionTests: trackException accepts single exception", test: () => { // setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const trackStub = this.sandbox.stub(appInsights.core, "track"); // Test appInsights.trackException({error: new Error(), severityLevel: SeverityLevel.Critical}); Assert.ok(trackStub.calledOnce, "single exception is tracked"); // Verify ver is a string, as required by CS4.0 const baseData = (trackStub.args[0][0] as ITelemetryItem).baseData as IExceptionInternal; Assert.equal("string", typeof baseData.ver, "Exception.ver should be a string for CS4.0"); Assert.equal("4.0", baseData.ver); } }); this.testCase({ name: "TrackExceptionTests: trackException allows logging errors with different severity level", test: () => { // setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const trackStub = this.sandbox.stub(appInsights.core, "track"); // Test appInsights.trackException({error: new Error(), severityLevel: SeverityLevel.Critical}); Assert.ok(trackStub.calledOnce, "single exception is tracked"); Assert.equal(SeverityLevel.Critical, trackStub.firstCall.args[0].baseData.severityLevel); trackStub.reset(); appInsights.trackException({error: new Error(), severityLevel: SeverityLevel.Error}); Assert.ok(trackStub.calledOnce, "single exception is tracked"); Assert.equal(SeverityLevel.Error, trackStub.firstCall.args[0].baseData.severityLevel); } }); this.testCase({ name: "TrackExceptionTests: trackException with a string as the exception", test: () => { // setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const trackStub = this.sandbox.stub(appInsights.core, "track"); // Test appInsights.trackException({exception: new Error("Critical Exception"), severityLevel: SeverityLevel.Critical}); Assert.ok(trackStub.calledOnce, "single exception is tracked"); Assert.equal(SeverityLevel.Critical, trackStub.firstCall.args[0].baseData.severityLevel); Assert.equal("Critical Exception", trackStub.firstCall.args[0].baseData.exceptions[0].message); trackStub.reset(); appInsights.trackException({exception: "String Exception" as any, severityLevel: SeverityLevel.Error}); Assert.ok(trackStub.calledOnce, "single exception is tracked"); Assert.equal(SeverityLevel.Error, trackStub.firstCall.args[0].baseData.severityLevel); Assert.equal("String Exception", trackStub.firstCall.args[0].baseData.exceptions[0].message); trackStub.reset(); appInsights.trackException("Direct String Exception" as any); Assert.ok(trackStub.calledOnce, "single exception is tracked"); Assert.equal("string: Direct String Exception", trackStub.firstCall.args[0].baseData.exceptions[0].message); trackStub.reset(); appInsights.trackException(new Error("Wrapped String Exception") as any); Assert.ok(trackStub.calledOnce, "single exception is tracked"); Assert.equal("Wrapped String Exception", trackStub.firstCall.args[0].baseData.exceptions[0].message); trackStub.reset(); appInsights.trackException(null as any); Assert.ok(trackStub.calledOnce, "single exception is tracked"); Assert.equal("not_specified", trackStub.firstCall.args[0].baseData.exceptions[0].message, JSON.stringify(trackStub.firstCall.args[0].baseData.exceptions[0])); } }); } private addOnErrorTests(): void { this.testCase({ name: "OnErrorTests: _onerror creates a dump of unexpected error thrown by trackException for logging", test: () => { // setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const unexpectedError = new Error(); const expectedString = dumpObj(unexpectedError); const throwSpy = this.sandbox.spy(core.logger, "throwInternal"); this.sandbox.stub(appInsights, "trackException").throws(unexpectedError); // Act appInsights._onerror({message: "msg", url: "some://url", lineNumber: 123, columnNumber: 456, error: unexpectedError}); // Assert Assert.equal(1, throwSpy.callCount); // Check Message Assert.ok(throwSpy.args[0][2].indexOf("_onError threw exception while logging error,") !== -1, "Message should indicate that _onError failed"); // Check Exception contains the exception details Assert.ok(throwSpy.args[0][3].exception.indexOf(expectedString) !== -1, "Expected error to contain - " + expectedString); } }); this.testCase({ name: "OnErrorTests: _onerror stringifies error object", test: () => { // setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const unexpectedError = new Error("some message"); const throwSpy = this.sandbox.spy(core.logger, "throwInternal"); const stub = this.sandbox.stub(appInsights, "trackException").throws(unexpectedError); // Act appInsights._onerror({message: "any message", url: "any://url", lineNumber: 123, columnNumber: 456, error: unexpectedError}); // Test const dumpExMsg = throwSpy.args[0][3].exception; Assert.ok(dumpExMsg.indexOf("stack: ") != -1); Assert.ok(dumpExMsg.indexOf(`message: \"${unexpectedError.message}\"`) !== -1 || dumpExMsg.indexOf(`message: '${unexpectedError.message}'`) !== -1); Assert.ok(dumpExMsg.indexOf("name: \"Error\"") !== -1 || dumpExMsg.indexOf("name: 'Error'") !== -1); } }); this.testCase({ name: "OnErrorTests: _onerror logs name of unexpected error thrown by trackException for diagnostics", test: () => { // setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "key"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const throwInternal = this.sandbox.spy(appInsights.core.logger, "throwInternal"); this.sandbox.stub(appInsights, "trackException").throws(new CustomTestError("Simulated Error")); const expectedErrorName: string = "CustomTestError"; appInsights._onerror({message: "some message", url: "some://url", lineNumber: 1234, columnNumber: 5678, error: new Error()}); Assert.ok(throwInternal.calledOnce, "throwInternal called once"); const logMessage: string = throwInternal.getCall(0).args[2]; Assert.notEqual(-1, logMessage.indexOf(expectedErrorName), "expected: " + logMessage); } }); this.testCase({ name: "OnErrorTests: _onerror adds document URL in case of CORS error", test: () => { // setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const trackSpy = this.sandbox.spy(appInsights.core, "track"); // Act appInsights._onerror({message: "Script error.", url: "", lineNumber: 0, columnNumber: 0, error: null}); // Assert Assert.equal(document.URL, trackSpy.args[0][0].baseData.url); } }); this.testCase({ name: "OnErrorTests: _onerror adds document URL in case of no CORS error", test: () => { // setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const trackExceptionSpy = this.sandbox.spy(appInsights, "trackException"); // Act // Last arg is not an error/null which will be treated as not CORS issue appInsights._onerror({message: "Script error.", url: "", lineNumber: 0, columnNumber: 0, error: new Object() as any}); // Assert // properties are passed as a 3rd parameter Assert.equal(document.URL, trackExceptionSpy.args[0][1].url); } }); this.testCase({ name: "OnErrorTests: _onerror logs name of unexpected error thrown by trackException for diagnostics", test: () => { // setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "key"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const throwInternal = this.sandbox.spy(appInsights.core.logger, "throwInternal"); // Internal code does call this anymore! const expectedErrorName: string = "test error"; let theError = new Error(); theError.name = expectedErrorName; this.sandbox.stub(appInsights, "trackException").throws(theError); appInsights._onerror({message: "some message", url: "some://url", lineNumber: 1234, columnNumber: 5678, error: "the error message"}); Assert.ok(throwInternal.calledOnce, "throwInternal called once"); const logMessage: string = throwInternal.getCall(0).args[2]; Assert.notEqual(-1, logMessage.indexOf(expectedErrorName), "logMessage: " + logMessage); } }); this.testCase({ name: "OnErrorTests: _onerror logs name of unexpected error thrown by trackException for diagnostics", useFakeTimers: true, test: () => { // setup const sender: Sender = new Sender(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( { instrumentationKey: "key", extensionConfig: { [sender.identifier]: { enableSessionStorageBuffer: false, maxBatchInterval: 1 } } }, [sender] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); appInsights.addTelemetryInitializer((item: ITelemetryItem) => { Assert.equal("4.0", item.ver, "Telemetry items inside telemetry initializers should be in CS4.0 format"); }); this.throwInternalSpy = this.sandbox.spy(appInsights.core.logger, "throwInternal"); sender._sender = (payload:any[], isAsync:boolean) => { sender._onSuccess(payload, payload.length); }; this.sandbox.spy() this.trackSpy = this.sandbox.spy(sender, "_onSuccess"); this.exceptionHelper.capture(appInsights); this.causeException(() => { this.exceptionHelper.throwRuntimeException(AITestClass.orgSetTimeout); }); Assert.ok(!this.trackSpy.calledOnce, "track not called yet"); Assert.ok(!this.throwInternalSpy.called, "No internal errors"); return this._asyncQueue() .add(this.waitForExceptionPromise(1)) .add(() => { let isLocal = window.location.protocol === "file:"; let exp = this.trackSpy.args[0]; const payloadStr: string[] = this.getPayloadMessages(this.trackSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data, "Has Data"); if (data) { Assert.ok(data.baseData, "Has BaseData"); let baseData = data.baseData; if (baseData) { const ex = baseData.exceptions[0]; if (isLocal) { Assert.ok(ex.message.indexOf("Script error:") !== -1, "Make sure the error message is present [" + ex.message + "]"); Assert.equal("String", ex.typeName, "Got the correct typename [" + ex.typeName + "]"); } else { Assert.ok(ex.message.indexOf("ug is not a function") !== -1, "Make sure the error message is present [" + ex.message + "]"); Assert.equal("TypeError", ex.typeName, "Got the correct typename [" + ex.typeName + "]"); Assert.ok(baseData.properties["columnNumber"], "has column number"); Assert.ok(baseData.properties["lineNumber"], "has Line number"); } Assert.ok(ex.stack.length > 0, "Has stack"); Assert.ok(ex.parsedStack, "Stack was parsed"); Assert.ok(ex.hasFullStack, "Stack has been decoded"); Assert.ok(baseData.properties["url"], "has Url"); Assert.ok(baseData.properties["errorSrc"].indexOf("window.onerror@") !== -1, "has source"); } } } }); } }); this.testCase({ name: "OnErrorTests: _onerror logs name of unexpected error thrown by trackException for diagnostics with a text exception", useFakeTimers: true, test: () => { // setup const sender: Sender = new Sender(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( { instrumentationKey: "key", extensionConfig: { [sender.identifier]: { enableSessionStorageBuffer: false, maxBatchInterval: 1 } } }, [sender] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); appInsights.addTelemetryInitializer((item: ITelemetryItem) => { Assert.equal("4.0", item.ver, "Telemetry items inside telemetry initializers should be in CS4.0 format"); }); this.throwInternalSpy = this.sandbox.spy(appInsights.core.logger, "throwInternal"); sender._sender = (payload:any[], isAsync:boolean) => { sender._onSuccess(payload, payload.length); }; this.sandbox.spy() this.trackSpy = this.sandbox.spy(sender, "_onSuccess"); this.exceptionHelper.capture(appInsights); this.causeException(() => { this.exceptionHelper.throw("Test Text Error!"); }); Assert.ok(!this.trackSpy.calledOnce, "track not called yet"); Assert.ok(!this.throwInternalSpy.called, "No internal errors"); return this._asyncQueue() .add(this.waitForExceptionPromise(1)) .add(() => { let exp = this.trackSpy.args[0]; const payloadStr: string[] = this.getPayloadMessages(this.trackSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data, "Has Data"); if (data) { Assert.ok(data.baseData, "Has BaseData"); let baseData = data.baseData; if (baseData) { const ex = baseData.exceptions[0]; Assert.ok(ex.message.indexOf("Test Text Error!") !== -1, "Make sure the error message is present [" + ex.message + "]"); Assert.ok(baseData.properties["columnNumber"], "has column number"); Assert.ok(baseData.properties["lineNumber"], "has Line number"); Assert.equal("String", ex.typeName, "Got the correct typename"); Assert.ok(ex.stack.length > 0, "Has stack"); Assert.ok(ex.parsedStack, "Stack was parsed"); Assert.ok(ex.hasFullStack, "Stack has been decoded"); Assert.ok(baseData.properties["url"], "has Url"); Assert.ok(baseData.properties["errorSrc"].indexOf("window.onerror@") !== -1, "has source"); } } } }); } }); this.testCase({ name: "OnErrorTests: _onerror logs name of unexpected error thrown by trackException for diagnostics with a custom direct exception", useFakeTimers: true, test: () => { // setup const sender: Sender = new Sender(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( { instrumentationKey: "key", extensionConfig: { [sender.identifier]: { enableSessionStorageBuffer: false, maxBatchInterval: 1 } } }, [sender] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); appInsights.addTelemetryInitializer((item: ITelemetryItem) => { Assert.equal("4.0", item.ver, "Telemetry items inside telemetry initializers should be in CS4.0 format"); }); this.throwInternalSpy = this.sandbox.spy(appInsights.core.logger, "throwInternal"); sender._sender = (payload:any[], isAsync:boolean) => { sender._onSuccess(payload, payload.length); }; this.sandbox.spy() this.trackSpy = this.sandbox.spy(sender, "_onSuccess"); this.exceptionHelper.capture(appInsights); this.causeException(() => { this.exceptionHelper.throw(new CustomTestError("Test Text Error!")); }); Assert.ok(!this.trackSpy.calledOnce, "track not called yet"); Assert.ok(!this.throwInternalSpy.called, "No internal errors"); return this._asyncQueue() .add(this.waitForExceptionPromise(1)) .add(() => { let isLocal = window.location.protocol === "file:"; let exp = this.trackSpy.args[0]; const payloadStr: string[] = this.getPayloadMessages(this.trackSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data, "Has Data"); if (data) { Assert.ok(data.baseData, "Has BaseData"); let baseData = data.baseData; if (baseData) { const ex = baseData.exceptions[0]; if (isLocal) { Assert.ok(ex.message.indexOf("Script error:") !== -1, "Make sure the error message is present [" + ex.message + "]"); Assert.equal("String", ex.typeName, "Got the correct typename"); } else { Assert.ok(ex.message.indexOf("Test Text Error!") !== -1, "Make sure the error message is present [" + ex.message + "]"); Assert.ok(ex.message.indexOf("CustomTestError") !== -1, "Make sure the error type is present [" + ex.message + "]"); Assert.equal("CustomTestError", ex.typeName, "Got the correct typename"); Assert.ok(baseData.properties["columnNumber"], "has column number"); Assert.ok(baseData.properties["lineNumber"], "has Line number"); } Assert.ok(ex.stack.length > 0, "Has stack"); Assert.ok(ex.parsedStack, "Stack was parsed"); Assert.ok(ex.hasFullStack, "Stack has been decoded"); Assert.ok(baseData.properties["url"], "has Url"); Assert.ok(baseData.properties["errorSrc"].indexOf("window.onerror@") !== -1, "has source"); } } } }); } }); this.testCase({ name: "OnErrorTests: _onerror logs name of unexpected error thrown by trackException for diagnostics with a strict custom direct exception", useFakeTimers: true, test: () => { // setup const sender: Sender = new Sender(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( { instrumentationKey: "key", extensionConfig: { [sender.identifier]: { enableSessionStorageBuffer: false, maxBatchInterval: 1 } } }, [sender] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); appInsights.addTelemetryInitializer((item: ITelemetryItem) => { Assert.equal("4.0", item.ver, "Telemetry items inside telemetry initializers should be in CS4.0 format"); }); this.throwInternalSpy = this.sandbox.spy(appInsights.core.logger, "throwInternal"); sender._sender = (payload:any[], isAsync:boolean) => { sender._onSuccess(payload, payload.length); }; this.sandbox.spy() this.trackSpy = this.sandbox.spy(sender, "_onSuccess"); this.exceptionHelper.capture(appInsights); this.causeException(() => { this.exceptionHelper.throwStrict(new CustomTestError("Test Text Error!")); }); Assert.ok(!this.trackSpy.calledOnce, "track not called yet"); Assert.ok(!this.throwInternalSpy.called, "No internal errors"); return this._asyncQueue() .add(this.waitForExceptionPromise(1)) .add(() => { let isLocal = window.location.protocol === "file:"; let exp = this.trackSpy.args[0]; const payloadStr: string[] = this.getPayloadMessages(this.trackSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const data = payload.data; Assert.ok(data, "Has Data"); if (data) { Assert.ok(data.baseData, "Has BaseData"); let baseData = data.baseData; if (baseData) { const ex = baseData.exceptions[0]; if (isLocal) { Assert.ok(ex.message.indexOf("Script error:") !== -1, "Make sure the error message is present [" + ex.message + "]"); Assert.equal("String", ex.typeName, "Got the correct typename"); } else { Assert.ok(ex.message.indexOf("Test Text Error!") !== -1, "Make sure the error message is present [" + ex.message + "]"); Assert.ok(ex.message.indexOf("CustomTestError") !== -1, "Make sure the error type is present [" + ex.message + "]"); Assert.equal("CustomTestError", ex.typeName, "Got the correct typename"); Assert.ok(baseData.properties["columnNumber"], "has column number"); Assert.ok(baseData.properties["lineNumber"], "has Line number"); } Assert.ok(ex.stack.length > 0, "Has stack"); Assert.ok(ex.parsedStack, "Stack was parsed"); Assert.ok(ex.hasFullStack, "Stack has been decoded"); Assert.ok(baseData.properties["url"], "has Url"); Assert.ok(baseData.properties["errorSrc"].indexOf("window.onerror@") !== -1, "has source"); } } } }); } }); } private throwStrictRuntimeException() { "use strict"; function doThrow() { var ug: any = "Hello"; // This should throw ug(); } doThrow(); } private addStartStopTrackPageTests() { const testValues = { name: "name", url: "url", duration: 200, properties: { "property1": "5", "property2": "10", "refUri": "test.com" }, measurements: { "measurement": 300 } }; this.testCase({ name: "Timing Tests: Start/StopPageView pass correct duration", useFakeTimers: true, test: () => { // setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "key"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const spy = this.sandbox.spy(appInsights, "sendPageViewInternal"); this.clock.tick(1); // act appInsights.startTrackPage(testValues.name); this.clock.tick(testValues.duration); appInsights.stopTrackPage(testValues.name, testValues.url, testValues.properties, testValues.measurements); // verify Assert.ok(spy.calledOnce, "stop track page view sent data"); const actual = spy.args[0][0]; Assert.equal(testValues.name, actual.name); Assert.equal(testValues.url, actual.uri); const actualProperties = actual.properties; const actualMeasurements = actual.measurements; Assert.equal(testValues.duration, actualProperties.duration, "duration is calculated and sent correctly"); Assert.equal(testValues.properties.property1, actualProperties.property1); Assert.equal(testValues.properties.property2, actualProperties.property2); Assert.equal(testValues.properties.refUri, actualProperties.refUri); Assert.equal(testValues.measurements.measurement, actualMeasurements.measurement); } }); this.testCase({ name: "Timing Tests: Start/StopPageView tracks single page view with no parameters", useFakeTimers: true, test: () => { // setup const core = new AppInsightsCore(); // this.sandbox.stub(core, "getTransmissionControls"); const appInsights = new AnalyticsPlugin(); this.onDone(() => { appInsights.teardown(); }); appInsights.initialize({ "instrumentationKey": "ikey" }, core, []); const trackStub = this.sandbox.stub(appInsights.core, "track"); this.clock.tick(10); // Needed to ensure the duration calculation works // act appInsights.startTrackPage(); this.clock.tick(testValues.duration); appInsights.stopTrackPage(); Assert.ok(trackStub.calledOnce, "single page view tracking stopped"); // verify const telemetry: ITelemetryItem = trackStub.args[0][0]; Assert.equal(window.document.title, telemetry.baseData.name); Assert.equal(testValues.duration, telemetry.baseData.properties.duration); } }); this.testCase({ name: "Timing Tests: Multiple Start/StopPageView track single pages view ", useFakeTimers: true, test: () => { // setup const core = new AppInsightsCore(); // this.sandbox.stub(core, "getTransmissionControls"); const appInsights = new AnalyticsPlugin(); this.onDone(() => { appInsights.teardown(); }); appInsights.initialize({ "instrumentationKey": "ikey" }, core, []); const trackStub = this.sandbox.stub(appInsights.core, "track"); this.clock.tick(10); // Needed to ensure the duration calculation works // act appInsights.startTrackPage(testValues.name); this.clock.tick(testValues.duration); appInsights.startTrackPage(); this.clock.tick(testValues.duration); appInsights.stopTrackPage(); Assert.ok(trackStub.calledOnce, "single page view tracking stopped no parameters"); this.clock.tick(testValues.duration); appInsights.stopTrackPage(testValues.name, testValues.url, testValues.properties); Assert.ok(trackStub.calledTwice, "single page view tracking stopped all parameters"); // verify // Empty parameters let telemetry: ITelemetryItem = trackStub.args[0][0]; Assert.equal(window.document.title, telemetry.baseData.name); Assert.equal(window.document.location.href, telemetry.baseData.uri); // // All parameters telemetry = trackStub.args[1][0]; Assert.equal(testValues.name, telemetry.baseData.name); Assert.equal(testValues.url, telemetry.baseData.uri); Assert.deepEqual(testValues.properties, telemetry.baseData.properties); } }); this.testCase({ name: "Timing Tests: Multiple startTrackPage", useFakeTimers: true, test: () => { // setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const logStub = this.sandbox.stub(core.logger, "throwInternal"); core.config.loggingLevelConsole = 999; this.clock.tick(1); // act appInsights.startTrackPage(); appInsights.startTrackPage(); // verify Assert.ok(logStub.calledOnce, "calling start twice triggers warning to user"); } }); this.testCase({ name: "Timing Tests: stopTrackPage called without a corresponding start", useFakeTimers: true, test: () => { // setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const logStub = this.sandbox.stub(core.logger, "throwInternal"); core.config.loggingLevelConsole = 999; this.clock.tick(1); // act appInsights.stopTrackPage(); // verify Assert.ok(logStub.calledOnce, "calling stop without a corresponding start triggers warning to user"); } }); } private addTrackMetricTests() { this.testCase({ name: 'TrackMetricTests: trackMetric batches metrics sent in a hot loop', useFakeTimers: true, test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin] ); const appInsights = new AnalyticsPlugin(); core.addPlugin(appInsights); const trackStub = this.sandbox.stub(appInsights.core, "track"); // Act appInsights.trackMetric({name: "test metric", average: 0}); this.clock.tick(1); // Verify Assert.ok(trackStub.calledOnce, "core.track was called once after sending one metric"); trackStub.reset(); // Act for (let i = 0; i < 100; i++) { appInsights.trackMetric({name: "test metric", average: 0}); } this.clock.tick(1); // Test Assert.equal(100, trackStub.callCount, "core.track was called 100 times for sending 100 metrics"); } }); } private addStartStopTrackEventTests() { const testValues = { name: "testStopTrack", properties: { "property1": "5", "property2": "10", "refUri": "test.com" }, measurements: { "measurement": 300 } }; this.testCase({ name: "TelemetryContex: empty Start/StopTrackEvent should only have duration properties", useFakeTimers: true, test: () => { const core = new AppInsightsCore(); // this.sandbox.stub(core, "getTransmissionControls"); const appInsights = new AnalyticsPlugin(); this.onDone(() => { appInsights.teardown(); }); appInsights.initialize({ "instrumentationKey": "ikey" }, core, []); const trackStub = this.sandbox.stub(appInsights.core, "track"); this.clock.tick(5); // act appInsights.startTrackEvent(testValues.name); this.clock.tick(5); appInsights.stopTrackEvent(testValues.name); Assert.ok(trackStub.calledOnce, "single event tracking stopped"); // verify const telemetry = trackStub.args[0][0]; Assert.equal(testValues.name,telemetry.baseData.name); Assert.deepEqual({ "duration": "5"},telemetry.baseData.properties); Assert.equal(undefined, telemetry.baseData.measurements.measurement); } }); this.testCase({ name: "TelemetryContex: Start/StopTrackEvent capture correct properties and measurements", useFakeTimers: true, test: () => { const core = new AppInsightsCore(); // this.sandbox.stub(core, "getTransmissionControls"); const appInsights = new AnalyticsPlugin(); this.onDone(() => { appInsights.teardown(); }); appInsights.initialize({ "instrumentationKey": "ikey" }, core, []); const trackStub = this.sandbox.stub(appInsights.core, "track"); this.clock.tick(5); // act appInsights.startTrackEvent(testValues.name); this.clock.tick(5); appInsights.stopTrackEvent(testValues.name,testValues.properties,testValues.measurements); Assert.ok(trackStub.calledOnce, "single event tracking stopped"); // verify const telemetry = trackStub.args[0][0]; Assert.equal(testValues.name,telemetry.baseData.name); Assert.equal(testValues.properties.property1,telemetry.baseData.properties.property1); Assert.equal(testValues.properties.property2, telemetry.baseData.properties.property2); Assert.equal(testValues.properties.refUri, telemetry.baseData.properties.refUri); Assert.equal("5", telemetry.baseData.properties.duration); Assert.equal(testValues.measurements.measurement, telemetry.baseData.measurements.measurement); } }); } private addTelemetryInitializerTests(): void { this.testCase({ name: "TelemetryContext: onBeforeSendTelemetry is called within track() and gets the envelope as an argument", useFakeTimers: true, test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin, appInsights] ); const trackStub = this.sandbox.spy(plugin, 'processTelemetry'); const telemetryInitializer = { initializer: (envelope) => { } } const spy = this.sandbox.spy(telemetryInitializer, "initializer"); // act appInsights.addTelemetryInitializer(telemetryInitializer.initializer); appInsights.trackEvent({name: 'test event'}); this.clock.tick(1); // verify Assert.ok(spy.calledOnce, 'telemetryInitializer was called'); Assert.deepEqual(trackStub.args[0][0], spy.args[0][0], 'expected envelope is used'); } }); this.testCase({ name: "TelemetryContext: onBeforeSendTelemetry changes the envelope props and sender gets them", useFakeTimers: true, test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin, appInsights] ); const trackStub = this.sandbox.spy(plugin, 'processTelemetry'); const nameOverride = "my unique name"; const telemetryInitializer = { initializer: (envelope) => { envelope.name = nameOverride; return true;} } // act appInsights.addTelemetryInitializer(telemetryInitializer.initializer); appInsights.trackTrace({message: 'test message'}); this.clock.tick(1); // verify Assert.ok(trackStub.calledOnce, "channel sender was called"); const envelope: ITelemetryItem = trackStub.args[0][0]; Assert.equal(envelope.name, nameOverride, 'expected envelope is used'); } }); this.testCase({ name: "TelemetryContext: telemetry initializer can modify the contents of an envelope", test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin, appInsights] ); const trackStub = this.sandbox.spy(plugin, 'processTelemetry'); const messageOverride = "my unique name"; const propOverride = "val1"; const telemetryInitializer = { // This illustrates how to use telemetry initializer (onBeforeSendTelemetry) // to access/ modify the contents of an envelope. initializer: (envelope) => { if (envelope.baseType === TraceDataType) { const telemetryItem = envelope.baseData; telemetryItem.message = messageOverride; telemetryItem.properties = telemetryItem.properties || {}; telemetryItem.properties["prop1"] = propOverride; return true; } } } appInsights.addTelemetryInitializer(telemetryInitializer.initializer); // act appInsights.trackTrace({message: 'test message'}); // verify Assert.ok(trackStub.calledOnce, "sender should be called"); const envelope: ITelemetryItem = trackStub.args[0][0]; Assert.equal(messageOverride, envelope.baseData.message); Assert.equal(propOverride, envelope.baseData.properties["prop1"]); } }); this.testCase({ name: "TelemetryContext: all added telemetry initializers get invoked", test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin, appInsights] ); const initializer1 = { init: () => { } }; const initializer2 = { init: () => { } }; const spy1 = this.sandbox.spy(initializer1, "init"); const spy2 = this.sandbox.spy(initializer2, "init"); // act appInsights.addTelemetryInitializer(initializer1.init); appInsights.addTelemetryInitializer(initializer2.init); appInsights.trackTrace({message: 'test message'}); // verify Assert.ok(spy1.calledOnce); Assert.ok(spy2.calledOnce); } }); this.testCase({ name: "TelemetryContext: all added telemetry initializers get invoked for trackException", test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin, appInsights] ); const initializer1 = { init: (item: ITelemetryItem) => { if (item.data !== undefined) { item.data.init1 = true; } } }; const initializer2 = { init: (item: ITelemetryItem) => { if (item.data !== undefined) { item.data.init2 = true; } } }; const spy1 = this.sandbox.spy(initializer1, "init"); const spy2 = this.sandbox.spy(initializer2, "init"); // act appInsights.addTelemetryInitializer(initializer1.init); appInsights.addTelemetryInitializer(initializer2.init); // Act appInsights._onerror({message: "msg", url: "some://url", lineNumber: 123, columnNumber: 456, error: new Error()}); // verify Assert.ok(spy1.calledOnce); Assert.ok(spy2.calledOnce); } }); this.testCase({ name: "TelemetryContext: all added telemetry initializers get invoked for _onError calls", test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin, appInsights] ); const initializer1 = { init: () => { } }; const initializer2 = { init: () => { } }; const spy1 = this.sandbox.spy(initializer1, "init"); const spy2 = this.sandbox.spy(initializer2, "init"); // act appInsights.addTelemetryInitializer(initializer1.init); appInsights.addTelemetryInitializer(initializer2.init); appInsights.trackException({exception: new Error(), severityLevel: SeverityLevel.Critical}); // verify Assert.ok(spy1.calledOnce); Assert.ok(spy2.calledOnce); } }); this.testCase({ name: "TelemetryContext: telemetry initializer - returning false means don't send an item", test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin, appInsights] ); const trackStub = this.sandbox.spy(plugin, 'processTelemetry'); // act appInsights.addTelemetryInitializer(() => false); appInsights.trackTrace({message: 'test message'}); // verify Assert.ok(trackStub.notCalled); } }); this.testCase({ name: "TelemetryContext: telemetry initializer - returning void means do send an item (back compact with older telemetry initializers)", test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin, appInsights] ); const trackStub = this.sandbox.spy(plugin, 'processTelemetry'); // act appInsights.addTelemetryInitializer(() => { return; }); appInsights.trackTrace({message: 'test message'}); // verify Assert.ok(trackStub.calledOnce); // TODO: use sender } }); this.testCase({ name: "TelemetryContext: telemetry initializer - returning true means do send an item", test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin, appInsights] ); const trackStub = this.sandbox.spy(plugin, 'processTelemetry'); // act appInsights.addTelemetryInitializer(() => true); appInsights.trackTrace({message: 'test message'}); // verify Assert.ok(trackStub.calledOnce); } }); this.testCase({ name: "TelemetryContext: telemetry initializer - if one of initializers returns false than item is not sent", test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin, appInsights] ); const trackStub = this.sandbox.spy(plugin, 'processTelemetry'); // act appInsights.addTelemetryInitializer(() => true); appInsights.addTelemetryInitializer(() => false); appInsights.trackTrace({message: 'test message'}); // verify Assert.ok(trackStub.notCalled); } }); this.testCase({ name: "TelemetryContext: telemetry initializer - if one of initializers returns false (any order) than item is not sent", test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin, appInsights] ); const trackStub = this.sandbox.spy(plugin, 'processTelemetry'); // act appInsights.addTelemetryInitializer(() => false); appInsights.addTelemetryInitializer(() => true); appInsights.trackTrace({message: 'test message'}); // verify Assert.ok(trackStub.notCalled); } }); this.testCase({ name: "TelemetryContext: telemetry initializer - returning not boolean/undefined/null means do send an item (back compat with older telemetry initializers)", test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin, appInsights] ); const trackStub = this.sandbox.spy(plugin, 'processTelemetry'); // act appInsights.addTelemetryInitializer((() => "asdf") as any); appInsights.addTelemetryInitializer(() => null); appInsights.addTelemetryInitializer(() => undefined); appInsights.trackTrace({message: 'test message'}); // verify Assert.ok(trackStub.calledOnce); // TODO: use sender } }); this.testCase({ name: "TelemetryContext: telemetry initializer - if one initializer fails then error logged and is still sent", test: () => { // Setup const plugin = new ChannelPlugin(); const core = new AppInsightsCore(); const appInsights = new AnalyticsPlugin(); this.onDone(() => { core.unload(false); }); core.initialize( {instrumentationKey: "ikey"}, [plugin, appInsights] ); const trackStub = this.sandbox.spy(plugin, 'processTelemetry'); const logStub = this.sandbox.spy(appInsights.core.logger, "throwInternal") // act appInsights.addTelemetryInitializer(() => { throw new Error("Test error IGNORE"); }); appInsights.addTelemetryInitializer(() => { }); appInsights.trackTrace({message: 'test message'}); // verify Assert.ok(trackStub.calledOnce); Assert.ok(logStub.calledOnce); } }); } private getFirstResult(action: string, trackStub: SinonStub, skipSessionState?: boolean): ITelemetryItem { const index: number = skipSessionState ? 1 : 0; Assert.ok(trackStub.args && trackStub.args[index] && trackStub.args[index][0], "track was called for: " + action); return trackStub.args[index][0] as ITelemetryItem; } private checkNoInternalErrors() { if (this.throwInternalSpy) { Assert.ok(this.throwInternalSpy.notCalled, "Check no internal errors"); if (this.throwInternalSpy.called) { Assert.ok(false, JSON.stringify(this.throwInternalSpy.args[0])); } } } // waitForExceptionPromise for use with _asyncQueue that returns a promise private waitForExceptionPromise(expectedCount: number, action: string = "", includeInit: boolean = false) { const testContext = this._testContext; const self = this; // Capture 'this' context to use in the polling function // Execute initial setup actions outside of the polling function const message = "polling: " + new Date().toISOString() + " " + action; Assert.ok(true, message); console.log(message); self.checkNoInternalErrors(); if (testContext && testContext.clock) { testContext.clock.tick(500); } return PollingAssert.asyncTaskPollingAssert(function () { let argCount = 0; if (self.trackSpy && self.trackSpy.called) { self.trackSpy.args.forEach(call => { argCount += call.length; }); } Assert.ok(true, "* [" + argCount + " of " + expectedCount + "] checking spy " + new Date().toISOString()); try { if (argCount >= expectedCount) { // Use the existing getPayloadMessages method to extract payload data properly const payloadStr: string[] = self.getPayloadMessages(self.trackSpy); if (payloadStr.length > 0) { const payload = JSON.parse(payloadStr[0]); const baseType = payload.data.baseType; // call the appropriate Validate depending on the baseType switch (baseType) { case EventDataType: return EventValidator.EventValidator.Validate(payload, baseType); case TraceDataType: return TraceValidator.TraceValidator.Validate(payload, baseType); case ExceptionDataType: return ExceptionValidator.ExceptionValidator.Validate(payload, baseType); case MetricDataType: return MetricValidator.MetricValidator.Validate(payload, baseType); case PageViewDataType: return PageViewValidator.PageViewValidator.Validate(payload, baseType); case PageViewPerformanceDataType: return PageViewPerformanceValidator.PageViewPerformanceValidator.Validate(payload, baseType); case RemoteDependencyDataType: return RemoteDepdencyValidator.RemoteDepdencyValidator.Validate(payload, baseType); default: return EventValidator.EventValidator.Validate(payload, baseType); } } } } finally { if (testContext && testContext.clock) { testContext.clock.tick(500); } } return false; }, "sender succeeded", 10, 1000); } } class ChannelPlugin implements IPlugin { public isFlushInvoked = false; public isTearDownInvoked = false; public isResumeInvoked = false; public isPauseInvoked = false; public identifier = "Sender"; public priority: number = 1001; constructor() { this.processTelemetry = this._processTelemetry.bind(this); } public pause(): void { this.isPauseInvoked = true; } public resume(): void { this.isResumeInvoked = true; } public teardown(): void { this.isTearDownInvoked = true; } flush(async?: boolean, callBack?: () => void): void { this.isFlushInvoked = true; if (callBack) { callBack(); } } public processTelemetry(env: ITelemetryItem) {} setNextPlugin(next: any) { // no next setup } public initialize = (config: IConfiguration, core: IAppInsightsCore, plugin: IPlugin[]) => { } private _processTelemetry(env: ITelemetryItem) { } } class CustomTestError extends Error { constructor(message = "") { super(message); this.name = "CustomTestError"; this.message = message + " -- test error."; } } ================================================ FILE: extensions/applicationinsights-analytics-js/Tests/Unit/src/GlobalTestHooks.Test.ts ================================================ import { Assert } from "@microsoft/ai-test-framework"; import { _testHookMaxUnloadHooksCb } from "@microsoft/applicationinsights-core-js"; import { dumpObj } from "@nevware21/ts-utils"; export class GlobalTestHooks { public registerTests() { // Set a global maximum _testHookMaxUnloadHooksCb(20, (state: string, hooks: Array) => { Assert.ok(false, "Max unload hooks exceeded [" + hooks.length + "] - " + state + " - " + dumpObj(hooks)); }); } } ================================================ FILE: extensions/applicationinsights-analytics-js/Tests/Unit/src/TelemetryItemCreator.tests.ts ================================================ import { Assert, AITestClass } from "@microsoft/ai-test-framework"; import { PageViewPerformance, PageView, TelemetryItemCreator, IPageViewTelemetry, IEventTelemetry, Event as EventTelemetry, Trace, ITraceTelemetry, Metric, IMetricTelemetry, RemoteDependencyData, IDependencyTelemetry, PageViewPerformanceDataType, PageViewDataType, EventDataType, TraceDataType, MetricDataType, RemoteDependencyDataType, PageViewPerformanceEnvelopeType, PageViewEnvelopeType, EventEnvelopeType, TraceEnvelopeType, MetricEnvelopeType, RemoteDependencyEnvelopeType, } from '@microsoft/applicationinsights-core-js'; import { AnalyticsPlugin } from '../../../src/JavaScriptSDK/AnalyticsPlugin' import { IAppInsightsCore, AppInsightsCore, ITelemetryItem, IConfiguration, IPlugin } from '@microsoft/applicationinsights-core-js'; export class TelemetryItemCreatorTests extends AITestClass { private _core: IAppInsightsCore; private _appInsights: AnalyticsPlugin; constructor(name?: string, emulateIe?: boolean) { super(name, emulateIe); this.assertNoEvents = true; this.assertNoHooks = true; } public testInitialize() { const plugin: IPlugin = new ChannelPlugin(); this._core = new AppInsightsCore(); this._core.initialize( {instrumentationKey: "ikey"}, [plugin] ); this._appInsights = new AnalyticsPlugin(); this._core.addPlugin(this._appInsights); } public testFinishedCleanup(): void { if (this._core) { this._core.unload(false); } } public registerTests() { this.testCase({ name: "TelemetryItemCreatorTests: create a valid ITelemetryItem for a page view performance item", test: () => { // setup const name = "testName"; const uri = "testUri"; const pageViewPerformance = new PageViewPerformance(this._core.logger, name, uri, null); const properties = { "propKey1": "PropVal1", "propKey2": "PropVal2" }; // act const telemetryItem = TelemetryItemCreator.create( pageViewPerformance, PageViewPerformanceDataType, PageViewPerformanceEnvelopeType, this._core.logger, properties); // assert Assert.ok(telemetryItem); Assert.equal("Microsoft.ApplicationInsights.{0}.PageviewPerformance", telemetryItem.name, "telemtryItem.name"); Assert.equal("Microsoft.ApplicationInsights.{0}.PageviewPerformance", telemetryItem.name, "telemtryItem.name"); Assert.equal("", telemetryItem.iKey, "telemetryItem.iKey"); Assert.deepEqual({"propKey1":"PropVal1","propKey2":"PropVal2"},telemetryItem.data, "telemetryItem.data"); } }); this.testCase({ name: "TelemetryItemCreatorTests: create a valid ITelemetryItem for a page view item", test: () => { // setup const name = "testName"; const uri = "testUri"; const pageView: IPageViewTelemetry = { name, uri }; const properties = { "propKey1": "PropVal1", "propKey2": "PropVal2" }; // act const telemetryItem = TelemetryItemCreator.create( pageView, PageViewDataType, PageViewEnvelopeType, this._core.logger, properties); // assert Assert.ok(telemetryItem); Assert.equal("Microsoft.ApplicationInsights.{0}.Pageview", telemetryItem.name, "telemtryItem.name"); Assert.equal("PageviewData", telemetryItem.baseType, "telemetryItem.baseType"); Assert.equal("",telemetryItem.iKey,"telemetryItem.iKey"); Assert.deepEqual({"propKey1":"PropVal1","propKey2":"PropVal2"},telemetryItem.data, "telemetryItem.data"); } }); this.testCase({ name: "TelemetryItemCreatorTests: create a valid TelemetryItem for trackEvent with iKey", test: () => { // setup const event: IEventTelemetry = { name: "trackEventNewtTest", iKey: "newTestIkey", properties: { "prop1": "value1" }, measurements: { "measurement1": 200 } } const customProperties = {"propKey1":"PropVal1"}; // act const telemetryItem = TelemetryItemCreator.create( event, EventDataType, EventEnvelopeType, this._appInsights.diagLog(), customProperties); // assert Assert.equal("Microsoft.ApplicationInsights.{0}.Event", telemetryItem.name, "telemtryItem.name"); Assert.equal("EventData", telemetryItem.baseType, "telemetryItem.baseType"); Assert.equal("newTestIkey", telemetryItem.iKey, "telemtryItem.iKey"); Assert.deepEqual({"propKey1":"PropVal1"},telemetryItem.data, "telemetryItem.data"); Assert.deepEqual( "trackEventNewtTest",telemetryItem.baseData.name, "telemetryItem.baseData.name"); Assert.deepEqual({ "prop1": "value1" },telemetryItem.baseData.properties, "telemetryItem.baseData.properties"); Assert.deepEqual({ "measurement1": 200 },telemetryItem.baseData.measurements, "telemetryItem.baseData.measurements"); } }); this.testCase({ name: "TelemetryItemCreatorTests: create a valid ITelemetryItem for a page view item with iKey", test: () => { // setup const name = "testName"; const uri = "testUri"; const pageView: IPageViewTelemetry = { name: name, uri: uri, iKey: "newIkey" }; const properties = { "propKey1": "PropVal1" }; // act const telemetryItem = TelemetryItemCreator.create( pageView, PageViewDataType, PageViewEnvelopeType, this._core.logger, properties); // assert Assert.ok(telemetryItem); Assert.equal("Microsoft.ApplicationInsights.{0}.Pageview", telemetryItem.name, "telemtryItem.name"); Assert.equal("newIkey", telemetryItem.iKey, "telemtryItem.iKey"); Assert.equal("PageviewData", telemetryItem.baseType, "telemetryItem.baseType"); Assert.equal("testUri", telemetryItem.baseData.uri, "telemetryItem.baseData.uri"); Assert.equal("testName", telemetryItem.baseData.name, "telemetryItem.baseData.name"); Assert.deepEqual({ "propKey1": "PropVal1" }, telemetryItem.data, "telemetryItem.data"); } }); this.testCase({ name: "TelemetryItemCreatorTests: create a valid ITelemetryItem for a trace item with iKey", test: () => { // setup const trace: ITraceTelemetry = { message:"traceMessage", iKey: "newIkey" }; const customProperties = { "propKey1": "PropVal1" }; // act const telemetryItem = TelemetryItemCreator.create( trace, TraceDataType, TraceEnvelopeType, this._core.logger, customProperties); // assert Assert.ok(telemetryItem); Assert.equal("Microsoft.ApplicationInsights.{0}.Message", telemetryItem.name, "telemtryItem.name"); Assert.equal("newIkey", telemetryItem.iKey, "telemtryItem.iKey"); Assert.equal("MessageData", telemetryItem.baseType, "telemetryItem.baseType"); Assert.equal("traceMessage", telemetryItem.baseData.message, "telemetryItem.baseData.message"); Assert.deepEqual({"propKey1":"PropVal1"},telemetryItem.data, "telemetryItem.data"); } }); this.testCase({ name: "TelemetryItemCreatorTests: create a valid ITelemetryItem for a metric item with iKey", test: () => { // setup const metric: IMetricTelemetry = { name:"metricName", average: 5, iKey: "newIkey" }; // act const telemetryItem = TelemetryItemCreator.create( metric, MetricDataType, MetricEnvelopeType, this._core.logger ); // assert Assert.ok(telemetryItem); Assert.equal("Microsoft.ApplicationInsights.{0}.Metric", telemetryItem.name, "telemtryItem.name"); Assert.equal("newIkey", telemetryItem.iKey, "telemtryItem.iKey"); Assert.equal("MetricData", telemetryItem.baseType, "telemetryItem.baseType"); Assert.equal("metricName",telemetryItem.baseData.name, "telemetryItem.baseData.name"); Assert.equal(5,telemetryItem.baseData.average, "telemetryItem.baseData.average"); } }); this.testCase({ name: "TelemetryItemCreatorTests: create a valid ITelemetryItem for a dependency item with iKey", test: () => { // setup const dependency: IDependencyTelemetry = { name:"dependencyName", id:"id", responseCode: 200, iKey: "newIkey" }; // act const telemetryItem = TelemetryItemCreator.create( dependency, RemoteDependencyDataType, RemoteDependencyEnvelopeType, this._core.logger, ); // assert Assert.ok(telemetryItem); Assert.equal("Microsoft.ApplicationInsights.{0}.RemoteDependency", telemetryItem.name, "telemtryItem.name"); Assert.equal("newIkey", telemetryItem.iKey, "telemtryItem.iKey"); Assert.equal("RemoteDependencyData", telemetryItem.baseType, "telemetryItem.baseType"); Assert.equal("dependencyName",telemetryItem.baseData.name, "telemetryItem.baseData.name"); Assert.equal(200,telemetryItem.baseData.responseCode, "telemetryItem.baseData.responseCode"); Assert.equal("id",telemetryItem.baseData.id, "telemetryItem.baseData.id"); } }); } } class ChannelPlugin implements IPlugin { public isFlushInvoked = false; public isTearDownInvoked = false; public isResumeInvoked = false; public isPauseInvoked = false; public processTelemetry; public identifier = "Sender"; public priority: number = 1001; constructor() { this.processTelemetry = this._processTelemetry.bind(this); } public pause(): void { this.isPauseInvoked = true; } public resume(): void { this.isResumeInvoked = true; } public teardown(): void { this.isTearDownInvoked = true; } flush(async?: boolean, callBack?: () => void): void { this.isFlushInvoked = true; if (callBack) { callBack(); } } setNextPlugin(next: any) { // no next setup } public initialize = (config: IConfiguration) => { } private _processTelemetry(env: ITelemetryItem) { } } ================================================ FILE: extensions/applicationinsights-analytics-js/Tests/Unit/src/appinsights-analytics.tests.ts ================================================ import { AnalyticsPluginTests } from './AnalyticsPlugin.tests'; import { TelemetryItemCreatorTests } from './TelemetryItemCreator.tests'; import { AnalyticsExtensionSizeCheck } from "./AnalyticsExtensionSize.tests"; import { GlobalTestHooks } from "./GlobalTestHooks.Test"; export function runTests() { new GlobalTestHooks().registerTests(); new AnalyticsPluginTests().registerTests(); new TelemetryItemCreatorTests().registerTests(); new AnalyticsExtensionSizeCheck().registerTests(); } ================================================ FILE: extensions/applicationinsights-analytics-js/Tests/UnitTests.html ================================================  Tests for Application Insights JavaScript Analytics Extension -->
          ================================================ FILE: extensions/applicationinsights-analytics-js/Tests/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": false, "module": "amd", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "declaration": true }, "files": [] } ================================================ FILE: extensions/applicationinsights-analytics-js/api-extractor.json ================================================ /** * Config file for API Extractor. For more info, please visit: https://api-extractor.com */ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", /** * Optionally specifies another JSON config file that this file extends from. This provides a way for * standard settings to be shared across multiple projects. * * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be * resolved using NodeJS require(). * * SUPPORTED TOKENS: none * DEFAULT VALUE: "" */ // "extends": "./shared/api-extractor-base.json" // "extends": "my-package/include/api-extractor-base.json" /** * Determines the "" token that can be used with other config file settings. The project folder * typically contains the tsconfig.json and package.json config files, but the path is user-defined. * * The path is resolved relative to the folder of the config file that contains the setting. * * The default value for "projectFolder" is the token "", which means the folder is determined by traversing * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error * will be reported. * * SUPPORTED TOKENS: * DEFAULT VALUE: "" */ "projectFolder": ".", /** * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor * analyzes the symbols exported by this module. * * The file extension must be ".d.ts" and not ".ts". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , */ "mainEntryPointFilePath": "/build/types/applicationinsights-analytics-js.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. * * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly * imports library2. To avoid this, we can specify: * * "bundledPackages": [ "library2" ], * * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been * local files for library1. */ "bundledPackages": [ ], /** * Determines how the TypeScript compiler engine will be invoked by API Extractor. */ "compiler": { /** * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * Note: This setting will be ignored if "overrideTsconfig" is used. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/tsconfig.json" */ // "tsconfigFilePath": "/tsconfig.json", /** * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. * The object must conform to the TypeScript tsconfig schema: * * http://json.schemastore.org/tsconfig * * If omitted, then the tsconfig.json file will be read from the "projectFolder". * * DEFAULT VALUE: no overrideTsconfig section */ // "overrideTsconfig": { // . . . // } /** * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. * * DEFAULT VALUE: false */ // "skipLibCheck": true, }, /** * Configures how the API report file (*.api.md) will be generated. */ "apiReport": { /** * (REQUIRED) Whether to generate an API report. */ "enabled": true, /** * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce * a full file path. * * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". * * SUPPORTED TOKENS: , * DEFAULT VALUE: ".api.md" */ "reportFileName": ".api.md", /** * Specifies the folder where the API report file is written. The file name portion is determined by * the "reportFileName" setting. * * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, * e.g. for an API review. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/etc/" */ "reportFolder": "/build/dts/", /** * Specifies the folder where the temporary report file is written. The file name portion is determined by * the "reportFileName" setting. * * After the temporary file is written to disk, it is compared with the file in the "reportFolder". * If they are different, a production build will fail. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/" */ // "reportTempFolder": "/temp/" }, /** * Configures how the doc model file (*.api.json) will be generated. */ "docModel": { /** * (REQUIRED) Whether to generate a doc model file. */ "enabled": true, /** * The output path for the doc model file. The file extension should be ".api.json". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/.api.json" */ "apiJsonFilePath": "/build/dts/.api.json" }, /** * Configures how the .d.ts rollup file will be generated. */ "dtsRollup": { /** * (REQUIRED) Whether to generate the .d.ts rollup file. */ "enabled": true, /** * Specifies the output path for a .d.ts rollup file to be generated without any trimming. * This file will include all declarations that are exported by the main entry point. * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/dist/.d.ts" */ "untrimmedFilePath": "/build/dts/.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. * This file will include only declarations that are marked as "@public" or "@beta". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "betaTrimmedFilePath": "/build/dts/-beta.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. * This file will include only declarations that are marked as "@public". * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "publicTrimmedFilePath": "/build/dts/-public.d.ts", /** * When a declaration is trimmed, by default it will be replaced by a code comment such as * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the * declaration completely. * * DEFAULT VALUE: false */ // "omitTrimmingComments": true }, /** * Configures how the tsdoc-metadata.json file will be generated. */ "tsdocMetadata": { /** * Whether to generate the tsdoc-metadata.json file. * * DEFAULT VALUE: true */ "enabled": false, /** * Specifies where the TSDoc metadata file should be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup * falls back to "tsdoc-metadata.json" in the package folder. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ "tsdocMetadataFilePath": "/build/dts/tsdoc-metadata.json" }, /** * Configures how API Extractor reports error and warning messages produced during analysis. * * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. */ "messages": { /** * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing * the input .d.ts files. * * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "compilerMessageReporting": { /** * Configures the default routing for messages that don't match an explicit rule in this table. */ "default": { /** * Specifies whether the message should be written to the the tool's output log. Note that * the "addToApiReportFile" property may supersede this option. * * Possible values: "error", "warning", "none" * * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes * the "--local" option), the warning is displayed but the build will not fail. * * DEFAULT VALUE: "warning" */ "logLevel": "warning", /** * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), * then the message will be written inside that file; otherwise, the message is instead logged according to * the "logLevel" option. * * DEFAULT VALUE: false */ // "addToApiReportFile": false }, // "TS2551": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . }, /** * Configures handling of messages reported by API Extractor during its analysis. * * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" * * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings */ "extractorMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false }, "ae-missing-release-tag": { "logLevel": "none" }, // // . . . }, /** * Configures handling of messages reported by the TSDoc parser when analyzing code comments. * * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "tsdocMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false } // "tsdoc-link-tag-unescaped-text": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . } } } ================================================ FILE: extensions/applicationinsights-analytics-js/package.json ================================================ { "name": "@microsoft/applicationinsights-analytics-js", "version": "3.4.1", "description": "Microsoft Application Insights JavaScript SDK - Web Analytics", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "author": "Microsoft Application Insights Team", "main": "dist/es5/applicationinsights-analytics-js.js", "module": "dist-es5/applicationinsights-analytics-js.js", "types": "types/applicationinsights-analytics-js.d.ts", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/extensions/applicationinsights-analytics-js" }, "scripts": { "clean": "git clean -xdf", "build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen", "build:esm": "grunt ai", "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs", "rebuild": "npm run build", "test": "grunt aitests", "mintest": "grunt ai-mintests", "lint": "tslint -p tsconfig.json", "dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights JavaScript SDK - Web Analytics\"", "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js", "ai-min": "grunt ai-min", "ai-restore": "grunt ai-restore", "npm-pack": "npm pack", "api-docs": "typedoc" }, "devDependencies": { "@microsoft/ai-test-framework": "0.0.1", "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es5": "1.0.2", "@microsoft/applicationinsights-properties-js": "3.4.1", "@microsoft/applicationinsights-channel-js": "3.4.1", "@microsoft/applicationinsights-dependencies-js": "3.4.1", "@microsoft/api-extractor": "^7.40.0", "typescript": "^4.9.3", "tslib": "^2.0.0", "globby": "^11.0.0", "magic-string": "^0.25.7", "pako": "^2.0.3", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "rollup": "^3.20.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-sourcemaps": "^0.6.3", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "@nevware21/grunt-ts-plugin": "^0.5.2", "@nevware21/grunt-eslint-ts": "^0.5.2", "qunit": "^2.11.2", "typedoc": "^0.26.6", "sinon": "^7.3.1" }, "peerDependencies": { "tslib": ">= 1.0.0" }, "dependencies": { "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/applicationinsights-core-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x" }, "license": "MIT" } ================================================ FILE: extensions/applicationinsights-analytics-js/rollup.config.js ================================================ import { createUnVersionedConfig } from "../../rollup.base.config"; import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const outputName = "applicationinsights-analytics-js"; const banner = [ "/*!", ` * Application Insights JavaScript SDK - Web Analytics, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the MIT License.": "" }; updateDistEsmFiles(replaceValues, banner, true, true, "dist-es5"); export default createUnVersionedConfig(banner, { namespace: "Microsoft.ApplicationInsights", version: version, node: { entryPoint: outputName, outputName: outputName }, browser: { entryPoint: outputName, outputName: outputName }, }, [ "applicationinsights-analytics-js" ], false ); ================================================ FILE: extensions/applicationinsights-analytics-js/src/JavaScriptSDK/AnalyticsPlugin.ts ================================================ /** * ApplicationInsights.ts * @copyright Microsoft 2018 */ import dynamicProto from "@microsoft/dynamicproto-js"; import { AnalyticsPluginIdentifier, BaseTelemetryPlugin, EventDataType, EventEnvelopeType, Exception, ExceptionDataType, ExceptionEnvelopeType, IAppInsights, IAppInsightsCore, IAutoExceptionTelemetry, IConfig, IConfigDefaults, IConfiguration, ICookieMgr, ICustomProperties, IDependencyTelemetry, IDistributedTraceContext, IEventTelemetry, IExceptionConfig, IExceptionInternal, IExceptionTelemetry, IInstrumentCallDetails, IMetricTelemetry, IPageViewPerformanceTelemetry, IPageViewPerformanceTelemetryInternal, IPageViewTelemetry, IPageViewTelemetryInternal, IPlugin, IProcessTelemetryContext, IProcessTelemetryUnloadContext, ITelemetryInitializerHandler, ITelemetryItem, ITelemetryPluginChain, ITelemetryUnloadState, ITraceTelemetry, InstrumentEvent, MetricDataType, MetricEnvelopeType, PageViewDataType, PageViewEnvelopeType, PageViewPerformanceDataType, PageViewPerformanceEnvelopeType, RemoteDependencyDataType, TelemetryInitializerFunction, TraceDataType, TraceEnvelopeType, _eInternalMessageId, arrForEach, cfgDfBoolean, cfgDfMerge, cfgDfSet, cfgDfString, cfgDfValidate, createDistributedTraceContext, createDomEvent, createProcessTelemetryContext, createTelemetryItem, createUniqueNamespace, dataSanitizeString, dumpObj, eLoggingSeverity, eSeverityLevel, eventOff, eventOn, fieldRedaction, findAllScripts, generateW3CId, getDocument, getExceptionName, getHistory, getLocation, getWindow, hasHistory, hasWindow, isCrossOriginError, isFunction, isNullOrUndefined, isString, isUndefined, mergeEvtNamespace, onConfigChange, safeGetCookieMgr, strNotSpecified, strUndefined, throwError, utlDisableStorage, utlEnableStorage, utlSetStoragePrefix } from "@microsoft/applicationinsights-core-js"; import { IAjaxMonitorPlugin } from "@microsoft/applicationinsights-dependencies-js"; import { isArray, isError, objDeepFreeze, objDefine, scheduleTimeout, strIndexOf } from "@nevware21/ts-utils"; import { IAnalyticsConfig, eRouteTraceStrategy } from "./Interfaces/IAnalyticsConfig"; import { IAppInsightsInternal, IPageViewManager, createPageViewManager } from "./Telemetry/PageViewManager"; import { IPageViewPerformanceManager, createPageViewPerformanceManager } from "./Telemetry/PageViewPerformanceManager"; import { IPageVisitTimeManager, createPageVisitTimeManager } from "./Telemetry/PageVisitTimeManager"; import { ITiming, createTiming } from "./Timing"; const strEvent = "event"; function _dispatchEvent(target:EventTarget, evnt: Event) { if (target && target.dispatchEvent && evnt) { target.dispatchEvent(evnt); } } function _getReason(error: any) { if (error && error.reason) { const reason = error.reason; if (!isString(reason) && isFunction(reason.toString)) { return reason.toString(); } return dumpObj(reason); } // Pass the original object down which will eventually get evaluated for any message or description return error || ""; } const MinMilliSeconds = 60000; const defaultValues: IConfigDefaults = objDeepFreeze({ sessionRenewalMs: cfgDfSet(_chkConfigMilliseconds, 30 * 60 * 1000), sessionExpirationMs: cfgDfSet(_chkConfigMilliseconds, 24 * 60 * 60 * 1000), disableExceptionTracking: cfgDfBoolean(), autoTrackPageVisitTime: cfgDfBoolean(), overridePageViewDuration: cfgDfBoolean(), enableUnhandledPromiseRejectionTracking: cfgDfBoolean(), autoUnhandledPromiseInstrumented: false, samplingPercentage: cfgDfValidate(_chkSampling, 100), isStorageUseDisabled: cfgDfBoolean(), isBrowserLinkTrackingEnabled: cfgDfBoolean(), enableAutoRouteTracking: cfgDfBoolean(), namePrefix: cfgDfString(), enableDebug: cfgDfBoolean(), disableFlushOnBeforeUnload: cfgDfBoolean(), disableFlushOnUnload: cfgDfBoolean(false, "disableFlushOnBeforeUnload"), expCfg: cfgDfMerge({inclScripts: false, expLog: undefined, maxLogs: 50}), routeTraceStrategy: eRouteTraceStrategy.Server }); function _chkConfigMilliseconds(value: number, defValue: number): number { value = value || defValue; if (value < MinMilliSeconds) { value = MinMilliSeconds; } return +value; } function _chkSampling(value: number) { return !isNaN(value) && value > 0 && value <= 100; } function _updateStorageUsage(extConfig: IAnalyticsConfig) { // Not resetting the storage usage as someone may have manually called utlDisableStorage, so this will only // reset based if the configuration option is provided if (!isUndefined(extConfig.isStorageUseDisabled)) { if (extConfig.isStorageUseDisabled) { utlDisableStorage(); } else { utlEnableStorage(); } } } export class AnalyticsPlugin extends BaseTelemetryPlugin implements IAppInsights, IAppInsightsInternal { public static Version = "#version#"; // Not currently used anywhere public identifier: string = AnalyticsPluginIdentifier; // do not change name or priority public priority: number = 180; // take from reserved priority range 100- 200 public readonly config: IConfig & IConfiguration; public queue: Array<() => void>; public autoRoutePVDelay = 500; // ms; Time to wait after a route change before triggering a pageview to allow DOM changes to take place constructor() { super(); let _eventTracking: ITiming; let _pageTracking: ITiming; let _pageViewManager: IPageViewManager; let _pageViewPerformanceManager: IPageViewPerformanceManager; let _pageVisitTimeManager: IPageVisitTimeManager; let _preInitTelemetryInitializers: TelemetryInitializerFunction[]; let _isBrowserLinkTrackingEnabled: boolean; let _browserLinkInitializerAdded: boolean; let _enableAutoRouteTracking: boolean; let _historyListenerAdded: boolean; let _disableExceptionTracking: boolean; let _autoExceptionInstrumented: boolean; let _enableUnhandledPromiseRejectionTracking: boolean; let _autoUnhandledPromiseInstrumented: boolean; let _extConfig: IAnalyticsConfig; let _autoTrackPageVisitTime: boolean; let _expCfg: IExceptionConfig; // New configuration variables for trace context management let _routeTraceStrategy: eRouteTraceStrategy; // array with max length of 2 that store current url and previous url for SPA page route change trackPageview use. let _prevUri: string; // Assigned in the constructor let _currUri: string; let _evtNamespace: string | string[]; // For testing error hooks only let _errorHookCnt: number; dynamicProto(AnalyticsPlugin, this, (_self, _base) => { let _addHook = _base._addHook; _initDefaults(); _self.getCookieMgr = () => { return safeGetCookieMgr(_self.core); }; _self.processTelemetry = (env: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => { _self.processNext(env, itemCtx); }; _self.trackEvent = (event: IEventTelemetry, customProperties?: ICustomProperties): void => { try { let telemetryItem = createTelemetryItem( event, EventDataType, EventEnvelopeType, _self.diagLog(), customProperties ); _self.core.track(telemetryItem); } catch (e) { _throwInternal(eLoggingSeverity.WARNING, _eInternalMessageId.TrackTraceFailed, "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; /** * Start timing an extended event. Call `stopTrackEvent` to log the event when it ends. * @param name - A string that identifies this event uniquely within the document. */ _self.startTrackEvent = (name: string) => { try { _eventTracking.start(name); } catch (e) { _throwInternal(eLoggingSeverity.CRITICAL, _eInternalMessageId.StartTrackEventFailed, "startTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; /** * Log an extended event that you started timing with `startTrackEvent`. * @param name - The string you used to identify this event in `startTrackEvent`. * @param properties - map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. * @param measurements - map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. */ _self.stopTrackEvent = (name: string, properties?: { [key: string]: string }, measurements?: { [key: string]: number }) => { try { _eventTracking.stop(name, undefined, properties, measurements); } catch (e) { _throwInternal(eLoggingSeverity.CRITICAL, _eInternalMessageId.StopTrackEventFailed, "stopTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; /** * @description Log a diagnostic message * @param trace - the trace message * @param customProperties - Additional custom properties to include in the event */ _self.trackTrace = (trace: ITraceTelemetry, customProperties?: ICustomProperties): void => { try { let telemetryItem = createTelemetryItem( trace, TraceDataType, TraceEnvelopeType, _self.diagLog(), customProperties); _self.core.track(telemetryItem); } catch (e) { _throwInternal(eLoggingSeverity.WARNING, _eInternalMessageId.TrackTraceFailed, "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; /** * @description Log a numeric value that is not associated with a specific event. Typically * used to send regular reports of performance indicators. To send single measurement, just * use the name and average fields of {@link IMetricTelemetry}. If you take measurements * frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements * and sending the resulting average at intervals * @param metric - input object argument. Only name and average are mandatory. * @param } customProperties additional data used to filter metrics in the * portal. Defaults to empty. */ _self.trackMetric = (metric: IMetricTelemetry, customProperties?: ICustomProperties): void => { try { let telemetryItem = createTelemetryItem( metric, MetricDataType, MetricEnvelopeType, _self.diagLog(), customProperties ); _self.core.track(telemetryItem); } catch (e) { _throwInternal(eLoggingSeverity.CRITICAL, _eInternalMessageId.TrackMetricFailed, "trackMetric failed, metric will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; /** * Logs that a page or other item was viewed. * @param IPageViewTelemetry - The string you used as the name in startTrackPage. Defaults to the document title. * @param customProperties - Additional data used to filter events and metrics. Defaults to empty. * If a user wants to provide duration for pageLoad, it'll have to be in pageView.properties.duration */ _self.trackPageView = (pageView?: IPageViewTelemetry, customProperties?: ICustomProperties) => { try { let inPv = pageView || {}; if (_self.core && _self.core.config) { inPv.uri = fieldRedaction(inPv.uri, _self.core.config); } _pageViewManager.trackPageView(inPv, { ...inPv.properties, ...inPv.measurements, ...customProperties }); if (_autoTrackPageVisitTime) { _pageVisitTimeManager.trackPreviousPageVisit(inPv.name, inPv.uri); } } catch (e) { _throwInternal( eLoggingSeverity.CRITICAL, _eInternalMessageId.TrackPVFailed, "trackPageView failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; /** * Create a page view telemetry item and send it to the SDK pipeline through the core.track API * @param pageView - Page view item to be sent * @param properties - Custom properties (Part C) that a user can add to the telemetry item * @param systemProperties - System level properties (Part A) that a user can add to the telemetry item */ _self.sendPageViewInternal = (pageView: IPageViewTelemetryInternal, properties?: { [key: string]: any }, systemProperties?: { [key: string]: any }) => { let doc = getDocument(); if (doc) { pageView.refUri = pageView.refUri === undefined ? doc.referrer : pageView.refUri; } if (_self.core && _self.core.config) { pageView.refUri = fieldRedaction(pageView.refUri, _self.core.config); } if (isNullOrUndefined(pageView.startTime)) { // calculate the start time manually let duration = ((properties || pageView.properties || {}).duration || 0); pageView.startTime = new Date(new Date().getTime() - duration); } let telemetryItem = createTelemetryItem( pageView, PageViewDataType, PageViewEnvelopeType, _self.diagLog(), properties, systemProperties); _self.core.track(telemetryItem); // reset ajaxes counter _resetAjaxAttempts(); }; /** * @ignore INTERNAL ONLY * @param pageViewPerformance * @param properties */ _self.sendPageViewPerformanceInternal = (pageViewPerformance: IPageViewPerformanceTelemetryInternal, properties?: { [key: string]: any }, systemProperties?: { [key: string]: any }) => { let telemetryItem = createTelemetryItem( pageViewPerformance, PageViewPerformanceDataType, PageViewPerformanceEnvelopeType, _self.diagLog(), properties, systemProperties); _self.core.track(telemetryItem); }; /** * Send browser performance metrics. * @param pageViewPerformance * @param customProperties */ _self.trackPageViewPerformance = (pageViewPerformance: IPageViewPerformanceTelemetry, customProperties?: ICustomProperties): void => { let inPvp = pageViewPerformance || {}; try { _pageViewPerformanceManager.populatePageViewPerformanceEvent(inPvp); _self.sendPageViewPerformanceInternal(inPvp, customProperties); } catch (e) { _throwInternal( eLoggingSeverity.CRITICAL, _eInternalMessageId.TrackPVFailed, "trackPageViewPerformance failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; /** * Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops, * but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view * and send the event. * @param name - A string that idenfities this item, unique within this HTML document. Defaults to the document title. */ _self.startTrackPage = (name?: string) => { try { if (typeof name !== "string") { let doc = getDocument(); name = doc && doc.title || ""; } _pageTracking.start(name); } catch (e) { _throwInternal( eLoggingSeverity.CRITICAL, _eInternalMessageId.StartTrackFailed, "startTrackPage failed, page view may not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; /** * Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements. * The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`. * @param name - The string you used as the name in startTrackPage. Defaults to the document title. * @param url - String - a relative or absolute URL that identifies the page or other item. Defaults to the window location. * @param properties - map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty. * @param measurements - map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty. */ _self.stopTrackPage = (name?: string, url?: string, properties?: { [key: string]: string }, measurement?: { [key: string]: number }) => { try { if (typeof name !== "string") { let doc = getDocument(); name = doc && doc.title || ""; } if (typeof url !== "string") { let loc = getLocation(); url = loc && loc.href || ""; } if (_self.core && _self.core.config) { url = fieldRedaction(url, _self.core.config); } _pageTracking.stop(name, url, properties, measurement); if (_autoTrackPageVisitTime) { _pageVisitTimeManager.trackPreviousPageVisit(name, url); } } catch (e) { _throwInternal( eLoggingSeverity.CRITICAL, _eInternalMessageId.StopTrackFailed, "stopTrackPage failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; /** * @ignore INTERNAL ONLY * @param exception * @param properties * @param systemProperties */ _self.sendExceptionInternal = (exception: IExceptionTelemetry, customProperties?: { [key: string]: any }, systemProperties?: { [key: string]: any }) => { // Adding additional edge cases to handle // - Not passing anything (null / undefined) const theError = (exception && (exception.exception || exception.error)) || // - Handle someone calling trackException based of v1 API where the exception was the Error isError(exception) && exception || // - Handles no error being defined and instead of creating a new Error() instance attempt to map so any stacktrace // is preserved and does not list ApplicationInsights code as the source { name: (exception && typeof exception) as string, message: exception as any || strNotSpecified }; // If no exception object was passed assign to an empty object to avoid internal exceptions exception = exception || {}; let exceptionPartB = new Exception( _self.diagLog(), theError, exception.properties || customProperties, exception.measurements, exception.severityLevel, exception.id ).toInterface(); var doc = getDocument(); if (doc && _expCfg?.inclScripts) { var scriptsInfo = findAllScripts(doc); exceptionPartB.properties["exceptionScripts"] = JSON.stringify(scriptsInfo); } if (_expCfg?.expLog) { let logs = _expCfg.expLog(); if (logs && logs.logs && isArray(logs.logs)) { exceptionPartB.properties["exceptionLog"] = logs.logs.slice(0, _expCfg.maxLogs).join("\n"); } } let telemetryItem: ITelemetryItem = createTelemetryItem( exceptionPartB, ExceptionDataType, ExceptionEnvelopeType, _self.diagLog(), customProperties, systemProperties ); _self.core.track(telemetryItem); }; /** * Log an exception you have caught. * * @param exception - Object which contains exception to be sent * @param } customProperties Additional data used to filter pages and metrics in the portal. Defaults to empty. * * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric. */ _self.trackException = (exception: IExceptionTelemetry, customProperties?: ICustomProperties): void => { if (exception && !exception.exception && (exception as any).error) { exception.exception = (exception as any).error; } try { _self.sendExceptionInternal(exception, customProperties); } catch (e) { _throwInternal( eLoggingSeverity.CRITICAL, _eInternalMessageId.TrackExceptionFailed, "trackException failed, exception will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; /** * @description Custom error handler for Application Insights Analytics * @param exception */ _self._onerror = (exception: IAutoExceptionTelemetry): void => { let error = exception && exception.error; let evt = exception && exception.evt; try { if (!evt) { let _window = getWindow(); if (_window) { evt = _window[strEvent]; } } const url = (exception && exception.url) || (getDocument() || {} as any).URL; // If no error source is provided assume the default window.onerror handler const errorSrc = exception.errorSrc || "window.onerror@" + url + ":" + (exception.lineNumber || 0) + ":" + (exception.columnNumber || 0); let properties = { errorSrc, url, lineNumber: exception.lineNumber || 0, columnNumber: exception.columnNumber || 0, message: exception.message }; if (isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception.error)) { _sendCORSException(Exception.CreateAutoException( "Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.", url, exception.lineNumber || 0, exception.columnNumber || 0, error, evt, null, errorSrc ), properties); } else { if (!exception.errorSrc) { exception.errorSrc = errorSrc; } _self.trackException({ exception, severityLevel: eSeverityLevel.Error }, properties); } } catch (e) { const errorString = error ? (error.name + ", " + error.message) : "null"; _throwInternal( eLoggingSeverity.CRITICAL, _eInternalMessageId.ExceptionWhileLoggingError, "_onError threw exception while logging error, error will not be collected: " + getExceptionName(e), { exception: dumpObj(e), errorString } ); } }; _self.addTelemetryInitializer = (telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler => { if (_self.core) { // Just add to the core return _self.core.addTelemetryInitializer(telemetryInitializer); } // Handle "pre-initialization" telemetry initializers (for backward compatibility) if (!_preInitTelemetryInitializers) { _preInitTelemetryInitializers = []; } _preInitTelemetryInitializers.push(telemetryInitializer); }; _self.initialize = (config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) => { if (_self.isInitialized()) { return; } if (isNullOrUndefined(core)) { throwError("Error initializing"); } _base.initialize(config, core, extensions, pluginChain); try { _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace()); if (_preInitTelemetryInitializers) { arrForEach(_preInitTelemetryInitializers, (initializer) => { core.addTelemetryInitializer(initializer); }); _preInitTelemetryInitializers = null; } _populateDefaults(config); _pageViewPerformanceManager = createPageViewPerformanceManager(_self.core); _pageViewManager = createPageViewManager(_self, _extConfig.overridePageViewDuration, _self.core, _pageViewPerformanceManager); _pageVisitTimeManager = createPageVisitTimeManager(_self.diagLog(), (pageName, pageUrl, pageVisitTime) => trackPageVisitTime(pageName, pageUrl, pageVisitTime)); _eventTracking = createTiming(_self.diagLog(), "trackEvent"); _eventTracking.action = (name?: string, url?: string, duration?: number, properties?: { [key: string]: string }, measurements?: { [key: string]: number }) => { if (!properties) { properties = {}; } if (!measurements) { measurements = {}; } properties.duration = duration.toString(); _self.trackEvent({ name, properties, measurements } as IEventTelemetry); } // initialize page view timing _pageTracking = createTiming(_self.diagLog(), "trackPageView"); _pageTracking.action = (name, url, duration, properties, measurements) => { // duration must be a custom property in order for the collector to extract it if (isNullOrUndefined(properties)) { properties = {}; } properties.duration = duration.toString(); let pageViewItem: IPageViewTelemetry = { name, uri: url, properties, measurements }; _self.sendPageViewInternal(pageViewItem, properties); } if (hasWindow()) { _updateExceptionTracking(); _updateLocationChange(); } } catch (e) { // resetting the initialized state because of failure _self.setInitialized(false); throw e; } }; _self._doTeardown = (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => { _pageViewManager && _pageViewManager.teardown(unloadCtx, unloadState) // Just register to remove all events associated with this namespace eventOff(window, null, null, _evtNamespace); _initDefaults(); }; _self["_getDbgPlgTargets"] = () => { return [_errorHookCnt, _autoExceptionInstrumented]; }; function _resetAjaxAttempts() { // Reset ajax attempts counter for the new page view if (_self.core) { let ajaxPlugin = _self.core.getPlugin("AjaxDependencyPlugin"); if (ajaxPlugin && ajaxPlugin.plugin && ajaxPlugin.plugin.resetAjaxAttempts) { ajaxPlugin.plugin.resetAjaxAttempts(); } } } function _populateDefaults(config: IConfiguration) { // it is used for 1DS as well, so config type should be IConfiguration only let identifier = _self.identifier; let core = _self.core; _self._addHook(onConfigChange(config, () => { let ctx = createProcessTelemetryContext(null, config, core); _extConfig = ctx.getExtCfg(identifier, defaultValues); // make sure auto exception is instrumented only once and it won't be overriden by the following config changes _autoExceptionInstrumented = _autoExceptionInstrumented || (config as any).autoExceptionInstrumented || _extConfig.autoExceptionInstrumented; _expCfg = _extConfig.expCfg; _autoTrackPageVisitTime = _extConfig.autoTrackPageVisitTime; // Initialize new trace context configuration options _routeTraceStrategy = _extConfig.routeTraceStrategy || eRouteTraceStrategy.Server; if (config.storagePrefix){ utlSetStoragePrefix(config.storagePrefix); } _updateStorageUsage(_extConfig); // _updateBrowserLinkTracking _isBrowserLinkTrackingEnabled = _extConfig.isBrowserLinkTrackingEnabled; _addDefaultTelemetryInitializers(); })); } /** * Log a page visit time * @param pageName - Name of page * @param pageVisitDuration - Duration of visit to the page in milliseconds */ function trackPageVisitTime(pageName: string, pageUrl: string, pageVisitTime: number) { let properties = { PageName: pageName, PageUrl: pageUrl }; _self.trackMetric({ name: "PageVisitTime", average: pageVisitTime, max: pageVisitTime, min: pageVisitTime, sampleCount: 1 }, properties); } function _addDefaultTelemetryInitializers() { if (!_browserLinkInitializerAdded && _isBrowserLinkTrackingEnabled) { const browserLinkPaths = ["/browserLinkSignalR/", "/__browserLink/"]; const dropBrowserLinkRequests = (envelope: ITelemetryItem) => { if (_isBrowserLinkTrackingEnabled && envelope.baseType === RemoteDependencyDataType) { let remoteData = envelope.baseData as IDependencyTelemetry; if (remoteData) { for (let i = 0; i < browserLinkPaths.length; i++) { if (remoteData.target && strIndexOf(remoteData.target, browserLinkPaths[i]) >= 0) { return false; } } } } return true; } _self._addHook(_self.addTelemetryInitializer(dropBrowserLinkRequests)); _browserLinkInitializerAdded = true; } } function _sendCORSException(exception: IAutoExceptionTelemetry, properties?: ICustomProperties) { let telemetryItem: ITelemetryItem = createTelemetryItem( exception, ExceptionDataType, ExceptionEnvelopeType, _self.diagLog(), properties ); _self.core.track(telemetryItem); } function _updateExceptionTracking() { let _window = getWindow(); let locn = getLocation(true); _self._addHook(onConfigChange(_extConfig, () => { _disableExceptionTracking = _extConfig.disableExceptionTracking; if (!_disableExceptionTracking && !_autoExceptionInstrumented && !_extConfig.autoExceptionInstrumented) { // We want to enable exception auto collection and it has not been done so yet _addHook(InstrumentEvent(_window, "onerror", { ns: _evtNamespace, rsp: (callDetails: IInstrumentCallDetails, message, url, lineNumber, columnNumber, error) => { if (!_disableExceptionTracking && callDetails.rslt !== true) { _self._onerror(Exception.CreateAutoException( message, url, lineNumber, columnNumber, error, callDetails.evt )); } } }, false)); _errorHookCnt ++; _autoExceptionInstrumented = true; } })); _addUnhandledPromiseRejectionTracking(_window, locn); } function _updateLocationChange() { let win = getWindow(); let locn = getLocation(true); _self._addHook(onConfigChange(_extConfig, () => { _enableAutoRouteTracking = _extConfig.enableAutoRouteTracking === true; /** * Create a custom "locationchange" event which is triggered each time the history object is changed */ if (win && _enableAutoRouteTracking && !_historyListenerAdded && hasHistory()) { let _history = getHistory(); if (isFunction(_history.pushState) && isFunction(_history.replaceState) && typeof Event !== strUndefined) { _addHistoryListener(win, _history, locn); } } })); } /** * Create a custom "locationchange" event which is triggered each time the history object is changed */ function _addHistoryListener(win: Window, history: History, locn: Location) { if (_historyListenerAdded) { return; } // Name Prefix is only referenced during the initial initialization and cannot be changed afterwards let namePrefix = _extConfig.namePrefix || ""; function _popstateHandler() { if (_enableAutoRouteTracking) { _dispatchEvent(win, createDomEvent(namePrefix + "locationchange")); } } function _locationChangeHandler() { // We always track the changes (if the handler is installed) to handle the feature being disabled between location changes if (_currUri) { _prevUri = _currUri; _currUri = locn && locn.href || ""; } else { _currUri = locn && locn.href || ""; } if (_self.core && _self.core.config) { _currUri = fieldRedaction(_currUri, _self.core.config); } if (_enableAutoRouteTracking) { // TODO(OTelSpan) (create new "context") / spans for the new page view // Should "end" any previous span (once we have a new one) let newContext: IDistributedTraceContext; // Quick and dirty backward compatibility check -- should never be needed but here to avoid a JS exception if (_self.core && _self.core.getTraceCtx) { let currentContext = _self.core.getTraceCtx(false); // Get current context without creating new if (currentContext && _routeTraceStrategy === eRouteTraceStrategy.Page) { // Create new context with the determined parent newContext = createDistributedTraceContext(currentContext); } else { // Fall back to original behavior - use server context as parent newContext = _self.core.getTraceCtx(true); } // Always generate new trace ID for route changes (this also generates new span ID) newContext.traceId = generateW3CId(); // This populates the ai.operation.name which has a maximum size of 1024 so we need to sanitize it newContext.pageName = dataSanitizeString(_self.diagLog(), newContext.pageName || "_unknown_"); _self.core.setTraceCtx(newContext); } // Single page view tracking call for all scenarios scheduleTimeout(((uri: string) => { _self.trackPageView({ refUri: uri, properties: { duration: 0 } }); }).bind(_self, _prevUri), _self.autoRoutePVDelay); } } _addHook(InstrumentEvent(history, "pushState", { ns: _evtNamespace, rsp: () => { if (_enableAutoRouteTracking) { _dispatchEvent(win, createDomEvent(namePrefix + "pushState")); _dispatchEvent(win, createDomEvent(namePrefix + "locationchange")); } } }, true)); _addHook(InstrumentEvent(history, "replaceState", { ns: _evtNamespace, rsp: () => { if (_enableAutoRouteTracking) { _dispatchEvent(win, createDomEvent(namePrefix + "replaceState")); _dispatchEvent(win, createDomEvent(namePrefix + "locationchange")); } } }, true)); eventOn(win, namePrefix + "popstate", _popstateHandler, _evtNamespace); eventOn(win, namePrefix + "locationchange", _locationChangeHandler, _evtNamespace); _historyListenerAdded = true; } function _addUnhandledPromiseRejectionTracking(_window: Window, _location: Location) { _self._addHook(onConfigChange(_extConfig, () => { _enableUnhandledPromiseRejectionTracking = _extConfig.enableUnhandledPromiseRejectionTracking === true; _autoExceptionInstrumented = _autoExceptionInstrumented || _extConfig.autoUnhandledPromiseInstrumented; if (_enableUnhandledPromiseRejectionTracking && !_autoUnhandledPromiseInstrumented) { // We want to enable exception auto collection and it has not been done so yet _addHook(InstrumentEvent(_window, "onunhandledrejection", { ns: _evtNamespace, rsp: (callDetails: IInstrumentCallDetails, error: PromiseRejectionEvent) => { if (_enableUnhandledPromiseRejectionTracking && callDetails.rslt !== true) { // handled could be typeof function _self._onerror(Exception.CreateAutoException( _getReason(error), _location ? _location.href : "", 0, 0, error, callDetails.evt )); } } }, false)); _errorHookCnt ++; _extConfig.autoUnhandledPromiseInstrumented = _autoUnhandledPromiseInstrumented = true; } })); } /** * This method will throw exceptions in debug mode or attempt to log the error as a console warning. * @param severity - The severity of the log message * @param msgId - The log message. */ function _throwInternal(severity: eLoggingSeverity, msgId: _eInternalMessageId, msg: string, properties?: Object, isUserAct?: boolean): void { _self.diagLog().throwInternal(severity, msgId, msg, properties, isUserAct); } function _initDefaults() { _eventTracking = null; _pageTracking = null; _pageViewManager = null; _pageViewPerformanceManager = null; _pageVisitTimeManager = null; _preInitTelemetryInitializers = null; _isBrowserLinkTrackingEnabled = false; _browserLinkInitializerAdded = false; _enableAutoRouteTracking = false; _historyListenerAdded = false; _disableExceptionTracking = false; _autoExceptionInstrumented = false; _enableUnhandledPromiseRejectionTracking = false; _autoUnhandledPromiseInstrumented = false; _autoTrackPageVisitTime = false; // Reset ajax attempts counter _resetAjaxAttempts(); // array with max length of 2 that store current url and previous url for SPA page route change trackPageview use. let location = getLocation(true); _prevUri = location && location.href || ""; if (_self.core && _self.core.config) { _prevUri = fieldRedaction(_prevUri, _self.core.config); } _currUri = null; _evtNamespace = null; _extConfig = null; _errorHookCnt = 0; // Define _self.config objDefine(_self, "config", { g: () => _extConfig }); } // For backward compatibility objDefine(_self, "_pageViewManager", { g: () => _pageViewManager }); objDefine(_self, "_pageViewPerformanceManager", { g: () => _pageViewPerformanceManager }); objDefine(_self, "_pageVisitTimeManager", { g: () => _pageVisitTimeManager }); objDefine(_self, "_evtNamespace", { g: () => "." + _evtNamespace }); }); } /** * Get the current cookie manager for this instance */ public getCookieMgr(): ICookieMgr { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } public processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public trackEvent(event: IEventTelemetry, customProperties?: ICustomProperties): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Start timing an extended event. Call `stopTrackEvent` to log the event when it ends. * @param name - A string that identifies this event uniquely within the document. */ public startTrackEvent(name: string) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Log an extended event that you started timing with `startTrackEvent`. * @param name - The string you used to identify this event in `startTrackEvent`. * @param properties - map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. * @param measurements - map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. */ public stopTrackEvent(name: string, properties?: { [key: string]: string }, measurements?: { [key: string]: number }) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * @description Log a diagnostic message * @param trace - the trace message * @param customProperties - Additional custom properties to include in the event */ public trackTrace(trace: ITraceTelemetry, customProperties?: ICustomProperties): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * @description Log a numeric value that is not associated with a specific event. Typically * used to send regular reports of performance indicators. To send single measurement, just * use the name and average fields of {@link IMetricTelemetry}. If you take measurements * frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements * and sending the resulting average at intervals * @param metric - input object argument. Only name and average are mandatory. * @param customProperties - additional data used to filter metrics in the * portal. Defaults to empty. */ public trackMetric(metric: IMetricTelemetry, customProperties?: ICustomProperties): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Logs that a page or other item was viewed. * @param IPageViewTelemetry - The string you used as the name in startTrackPage. Defaults to the document title. * @param customProperties - Additional data used to filter events and metrics. Defaults to empty. * If a user wants to provide duration for pageLoad, it'll have to be in pageView.properties.duration */ public trackPageView(pageView?: IPageViewTelemetry, customProperties?: ICustomProperties) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Create a page view telemetry item and send it to the SDK pipeline through the core.track API * @param pageView - Page view item to be sent * @param properties - Custom properties (Part C) that a user can add to the telemetry item * @param systemProperties - System level properties (Part A) that a user can add to the telemetry item */ public sendPageViewInternal(pageView: IPageViewTelemetryInternal, properties?: { [key: string]: any }, systemProperties?: { [key: string]: any }) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * @ignore INTERNAL ONLY * @param pageViewPerformance - The page view performance item to be sent * @param properties - Custom properties (Part C) that a user can add to the telemetry item */ public sendPageViewPerformanceInternal(pageViewPerformance: IPageViewPerformanceTelemetryInternal, properties?: { [key: string]: any }, systemProperties?: { [key: string]: any }) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Send browser performance metrics. * @param pageViewPerformance - The page view performance item to be sent * @param customProperties - Additional data used to filter pages and metrics in the portal. Defaults to empty. */ public trackPageViewPerformance(pageViewPerformance: IPageViewPerformanceTelemetry, customProperties?: ICustomProperties): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops, * but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view * and send the event. * @param name - A string that idenfities this item, unique within this HTML document. Defaults to the document title. */ public startTrackPage(name?: string) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements. * The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`. * @param name - The string you used as the name in startTrackPage. Defaults to the document title. * @param url - String - a relative or absolute URL that identifies the page or other item. Defaults to the window location. * @param properties - map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty. * @param measurements - map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty. */ public stopTrackPage(name?: string, url?: string, properties?: { [key: string]: string }, measurement?: { [key: string]: number }) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * @ignore INTERNAL ONLY * @param exception - The exception item to be sent * @param properties - Custom properties (Part C) that a user can add to the telemetry item * @param systemProperties - System level properties (Part A) that a user can add to the telemetry item */ public sendExceptionInternal(exception: IExceptionTelemetry, customProperties?: { [key: string]: any }, systemProperties?: { [key: string]: any }) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Log an exception you have caught. * * @param exception - Object which contains exception to be sent * @param customProperties - Additional data used to filter pages and metrics in the portal. Defaults to empty. * * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric. */ public trackException(exception: IExceptionTelemetry, customProperties?: ICustomProperties): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * @description Custom error handler for Application Insights Analytics * @param exception - The exception item to be sent */ public _onerror(exception: IAutoExceptionTelemetry): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): ITelemetryInitializerHandler { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } public initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?:ITelemetryPluginChain) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } } ================================================ FILE: extensions/applicationinsights-analytics-js/src/JavaScriptSDK/Interfaces/IAnalyticsConfig.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { IExceptionConfig } from "@microsoft/applicationinsights-core-js"; /** * Enum values for configuring trace context strategy for SPA route changes. * Controls how trace contexts are managed when navigating between pages in a Single Page Application. * @since 3.4.0 */ export const enum eRouteTraceStrategy { /** * Server strategy: Each page view gets a new, independent trace context. * No parent-child relationships are created between page views. * Each page will use the original server-provided trace context (if available) as its parent, * as defined by the {@link IConfiguration.traceHdrMode} configuration for distributed tracing headers. * This is the traditional behavior where each page view is treated as a separate operation. */ Server = 0, /** * Page strategy: Page views are chained together with parent-child relationships. * Each new page view inherits the trace context from the previous page view, * creating a connected chain of related operations for better correlation. */ Page = 1 } /** * Configuration interface specifically for AnalyticsPlugin * This interface defines only the configuration properties that the Analytics plugin uses. */ export interface IAnalyticsConfig { /** * A session is logged if the user is inactive for this amount of time in milliseconds. * @default 1800000 (30 minutes) */ sessionRenewalMs?: number; /** * A session is logged if it has continued for this amount of time in milliseconds. * @default 86400000 (24 hours) */ sessionExpirationMs?: number; /** * If true, exceptions are not autocollected. * @default false */ disableExceptionTracking?: boolean; /** * If true, on a pageview, the previous instrumented page's view time is tracked and sent as telemetry and a new timer is started for the current pageview. * @default false */ autoTrackPageVisitTime?: boolean; /** * If true, default behavior of trackPageView is changed to record end of page view duration interval when trackPageView is called. * @default false */ overridePageViewDuration?: boolean; /** * Define whether to track unhandled promise rejections and report as JS errors. * @default false */ enableUnhandledPromiseRejectionTracking?: boolean; /** * Internal flag to track if unhandled promise instrumentation is already set up. * @default false * @internal Internal use only * @ignore INTERNAL ONLY */ autoUnhandledPromiseInstrumented?: boolean; /** * Percentage of events that will be sent. Value must be between 0 and 100. * @default 100 * @example 50 // Only send 50% of events */ samplingPercentage?: number; /** * If true, the SDK will not store or read any data from local and session storage. * @default false */ isStorageUseDisabled?: boolean; /** * If true, the SDK will track all Browser Link requests. * @default false */ isBrowserLinkTrackingEnabled?: boolean; /** * Automatically track route changes in Single Page Applications (SPA). If true, each route change will send a new Pageview to Application Insights. * @default false */ enableAutoRouteTracking?: boolean; /** * An optional value that will be used as name postfix for localStorage and session cookie name. * @default "" * @example "MyApp" // Results in localStorage keys like "ai_session_MyApp" */ namePrefix?: string; /** * If true, debugging data is thrown as an exception by the logger. * @default false */ enableDebug?: boolean; /** * If true, flush method will not be called when onBeforeUnload event triggers. * @default false */ disableFlushOnBeforeUnload?: boolean; /** * If true, flush method will not be called when onPageHide or onVisibilityChange (hidden state) event(s) trigger. * @default false */ disableFlushOnUnload?: boolean; /** * Internal flag to track if exception instrumentation is already set up. * @default false * @internal Internal use only * @ignore INTERNAL ONLY */ autoExceptionInstrumented?: boolean; /** * Exception configuration for additional exception handling options. * @default { inclScripts: false, expLog: undefined, maxLogs: 50 } */ expCfg?: IExceptionConfig; /** * Controls the trace context strategy for SPA route changes. * Determines how trace contexts are managed and correlated across virtual page views * in Single Page Applications, affecting telemetry correlation and operation tracking. * @default eRouteTraceStrategy.Server * @since 3.4.0 */ routeTraceStrategy?: eRouteTraceStrategy; } ================================================ FILE: extensions/applicationinsights-analytics-js/src/JavaScriptSDK/Telemetry/PageViewManager.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { IAppInsightsCore, IDiagnosticLogger, IPageViewPerformanceTelemetryInternal, IPageViewTelemetry, IPageViewTelemetryInternal, IProcessTelemetryUnloadContext, ITelemetryUnloadState, _eInternalMessageId, _throwInternal, arrForEach, dateTimeUtilsDuration, dumpObj, eLoggingSeverity, fieldRedaction, getDocument, getExceptionName, getLocation, isNullOrUndefined } from "@microsoft/applicationinsights-core-js"; import { ITimerHandler, getPerformance, isUndefined, isWebWorker, scheduleTimeout } from "@nevware21/ts-utils"; import { IPageViewPerformanceManager } from "./PageViewPerformanceManager"; /** * Internal interface to pass appInsights object to subcomponents without coupling */ export interface IAppInsightsInternal { sendPageViewInternal(pageViewItem: IPageViewTelemetryInternal, properties?: Object, systemProperties?: Object): void; sendPageViewPerformanceInternal(pageViewPerformance: IPageViewPerformanceTelemetryInternal, properties?: Object, systemProperties?: Object): void; } /** * Internal interface for PageViewManager. * @internal */ export interface IPageViewManager { /** * Currently supported cases: * 1) (default case) track page view called with default parameters, overridePageViewDuration = false. Page view is sent with page view performance when navigation timing data is available. * a. If navigation timing is not supported then page view is sent right away with undefined duration. Page view performance is not sent. * 2) overridePageViewDuration = true, custom duration provided. Custom duration is used, page view sends right away. * 3) overridePageViewDuration = true, custom duration NOT provided. Page view is sent right away, duration is time spent from page load till now (or undefined if navigation timing is not supported). * 4) overridePageViewDuration = false, custom duration is provided. Page view is sent right away with custom duration. * * In all cases page view performance is sent once (only for the 1st call of trackPageView), or not sent if navigation timing is not supported. */ trackPageView(pageView: IPageViewTelemetry, customProperties?: { [key: string]: any }): void; teardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void; } /** * Factory function to create a PageViewManager instance. * @param appInsights - Internal interface to send telemetry * @param overridePageViewDuration - Whether to override page view duration * @param core - App Insights core instance * @param pageViewPerformanceManager - Page view performance manager instance * @returns A new IPageViewManager instance. * @internal */ export function createPageViewManager( appInsights: IAppInsightsInternal, overridePageViewDuration: boolean, core: IAppInsightsCore, pageViewPerformanceManager: IPageViewPerformanceManager): IPageViewManager { let queueTimer: ITimerHandler = null; let itemQueue: Array<() => boolean> = []; let pageViewPerformanceSent: boolean = false; let firstPageViewSent: boolean = false; let _logger: IDiagnosticLogger; if (core) { _logger = core.logger; } function _flushChannels(isAsync: boolean) { if (core) { core.flush(isAsync, () => { // Event flushed, callback added to prevent promise creation }); } } function _startTimer() { if (!queueTimer) { queueTimer = scheduleTimeout((() => { queueTimer = null; let allItems = itemQueue.slice(0); let doFlush = false; itemQueue = []; arrForEach(allItems, (item) => { if (!item()) { // Not processed so rescheduled itemQueue.push(item); } else { doFlush = true; } }); if (itemQueue.length > 0) { _startTimer(); } if (doFlush) { // We process at least one item so flush the queue _flushChannels(true); } }), 100); } } function _addQueue(cb:() => boolean) { itemQueue.push(cb); _startTimer(); } return { trackPageView: (pageView: IPageViewTelemetry, customProperties?: { [key: string]: any }) => { let name = pageView.name; if (isNullOrUndefined(name) || typeof name !== "string") { let doc = getDocument(); name = pageView.name = doc && doc.title || ""; } let uri = pageView.uri; if (isNullOrUndefined(uri) || typeof uri !== "string") { let location = getLocation(); uri = pageView.uri = location && location.href || ""; } if (core && core.config){ uri = pageView.uri = fieldRedaction(pageView.uri, core.config); } if (!firstPageViewSent){ let perf = getPerformance(); // Access the performance timing object const navigationEntries = (perf && perf.getEntriesByType && perf.getEntriesByType("navigation")); // Edge Case the navigation Entries may return an empty array and the timeOrigin is not supported on IE if (navigationEntries && navigationEntries[0] && !isUndefined(perf.timeOrigin)) { // Get the value of loadEventStart const loadEventStart = (navigationEntries[0] as PerformanceNavigationTiming).loadEventStart; pageView.startTime = new Date(perf.timeOrigin + loadEventStart); } else { // calculate the start time manually let duration = ((customProperties || pageView.properties || {}).duration || 0); pageView.startTime = new Date(new Date().getTime() - duration); } firstPageViewSent = true; } // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user // do not provide the duration, set duration to undefined // Also this is case 4 if (!pageViewPerformanceManager.isPerformanceTimingSupported()) { appInsights.sendPageViewInternal( pageView, customProperties ); _flushChannels(true); if (!isWebWorker()) { // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing) _throwInternal(_logger, eLoggingSeverity.WARNING, _eInternalMessageId.NavigationTimingNotSupported, "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info."); } return; } let pageViewSent = false; let customDuration: number; // if the performance timing is supported by the browser, calculate the custom duration const start = pageViewPerformanceManager.getPerformanceTiming().navigationStart; if (start > 0) { customDuration = dateTimeUtilsDuration(start, +new Date); if (!pageViewPerformanceManager.shouldCollectDuration(customDuration)) { customDuration = undefined; } } // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier let duration; if (!isNullOrUndefined(customProperties) && !isNullOrUndefined(customProperties.duration)) { duration = customProperties.duration; } if (overridePageViewDuration || !isNaN(duration)) { if (isNaN(duration)) { // case 3 if (!customProperties) { customProperties = {}; } customProperties.duration = customDuration; } // case 2 appInsights.sendPageViewInternal( pageView, customProperties ); _flushChannels(true); pageViewSent = true; } // now try to send the page view performance telemetry const maxDurationLimit = 60000; if (!customProperties) { customProperties = {}; } // Queue the event for processing _addQueue(() => { let processed = false; try { if (pageViewPerformanceManager.isPerformanceTimingDataReady()) { processed = true; const pageViewPerformance: IPageViewPerformanceTelemetryInternal = { name, uri }; pageViewPerformanceManager.populatePageViewPerformanceEvent(pageViewPerformance); if (!pageViewPerformance.isValid && !pageViewSent) { // If navigation timing gives invalid numbers, then go back to "override page view duration" mode. // That's the best value we can get that makes sense. customProperties.duration = customDuration; appInsights.sendPageViewInternal( pageView, customProperties); } else { if (!pageViewSent) { customProperties.duration = pageViewPerformance.durationMs; appInsights.sendPageViewInternal( pageView, customProperties); } if (!pageViewPerformanceSent) { appInsights.sendPageViewPerformanceInternal(pageViewPerformance, customProperties); pageViewPerformanceSent = true; } } } else if (start > 0 && dateTimeUtilsDuration(start, +new Date) > maxDurationLimit) { // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready processed = true; if (!pageViewSent) { customProperties.duration = maxDurationLimit; appInsights.sendPageViewInternal( pageView, customProperties ); } } } catch (e) { _throwInternal(_logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.TrackPVFailedCalc, "trackPageView failed on page load calculation: " + getExceptionName(e), { exception: dumpObj(e) }); } return processed; }); }, teardown: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => { if (queueTimer) { queueTimer.cancel(); queueTimer = null; let allItems = itemQueue.slice(0); itemQueue = []; arrForEach(allItems, (item) => { if (item()) { // Item processed successfully } }); } } }; } ================================================ FILE: extensions/applicationinsights-analytics-js/src/JavaScriptSDK/Telemetry/PageViewPerformanceManager.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { IAppInsightsCore, IDiagnosticLogger, IPageViewPerformanceTelemetryInternal, _eInternalMessageId, _throwInternal, dateTimeUtilsDuration, eLoggingSeverity, getNavigator, getPerformance, msToTimeSpan, safeGetLogger } from "@microsoft/applicationinsights-core-js"; import { mathFloor, strIndexOf } from "@nevware21/ts-utils"; const MAX_DURATION_ALLOWED = 3600000; // 1h const botAgentNames = ["googlebot", "adsbot-google", "apis-google", "mediapartners-google"]; function _isPerformanceTimingSupported() { let perf = getPerformance(); return perf && !!perf.timing; } function _isPerformanceNavigationTimingSupported() { let perf = getPerformance(); return perf && perf.getEntriesByType && perf.getEntriesByType("navigation").length > 0; } function _isPerformanceTimingDataReady() { let perf = getPerformance(); const timing = perf ? perf.timing : 0; return timing && timing.domainLookupStart > 0 && timing.navigationStart > 0 && timing.responseStart > 0 && timing.requestStart > 0 && timing.loadEventEnd > 0 && timing.responseEnd > 0 && timing.connectEnd > 0 && timing.domLoading > 0; } function _getPerformanceTiming(): PerformanceTiming | null { if (_isPerformanceTimingSupported()) { return getPerformance().timing; } return null; } function _getPerformanceNavigationTiming(): PerformanceNavigationTiming | null { if (_isPerformanceNavigationTimingSupported()) { return getPerformance().getEntriesByType("navigation")[0] as PerformanceNavigationTiming; } return null; } /** * This method tells if given durations should be excluded from collection. */ function _shouldCollectDuration(...durations: number[]): boolean { var _navigator = getNavigator() || {} as any; // a full list of Google crawlers user agent strings - https://support.google.com/webmasters/answer/1061943?hl=en const userAgent = _navigator.userAgent; let isGoogleBot = false; if (userAgent) { for (let i = 0; i < botAgentNames.length; i++) { isGoogleBot = isGoogleBot || strIndexOf(userAgent.toLowerCase(), botAgentNames[i]) !== -1; } } if (isGoogleBot) { // Don't report durations for GoogleBot, it is returning invalid values in performance.timing API. return false; } else { // for other page views, don't report if it's outside of a reasonable range for (let i = 0; i < durations.length; i++) { if (durations[i] < 0 || durations[i] >= MAX_DURATION_ALLOWED) { return false; } } } return true; } /** * Internal interface for PageViewPerformanceManager. * @internal */ export interface IPageViewPerformanceManager { populatePageViewPerformanceEvent(pageViewPerformance: IPageViewPerformanceTelemetryInternal): void; getPerformanceTiming(): PerformanceTiming | null; /** * Returns true is window performance timing API is supported, false otherwise. */ isPerformanceTimingSupported(): boolean; /** * As page loads different parts of performance timing numbers get set. When all of them are set we can report it. * Returns true if ready, false otherwise. */ isPerformanceTimingDataReady(): boolean; /** * This method tells if given durations should be excluded from collection. */ shouldCollectDuration(...durations: number[]): boolean; } /** * Factory function to create a PageViewPerformanceManager instance. * @param core - App Insights core instance * @returns A new IPageViewPerformanceManager instance. * @internal */ export function createPageViewPerformanceManager(core: IAppInsightsCore): IPageViewPerformanceManager { let _logger: IDiagnosticLogger = safeGetLogger(core); return { populatePageViewPerformanceEvent: (pageViewPerformance: IPageViewPerformanceTelemetryInternal): void => { pageViewPerformance.isValid = false; /* * http://www.w3.org/TR/navigation-timing/#processing-model * |-navigationStart * | |-connectEnd * | ||-requestStart * | || |-responseStart * | || | |-responseEnd * | || | | * | || | | |-loadEventEnd * |---network---||---request---|---response---|---dom---| * |--------------------------total----------------------| * * total = The difference between the load event of the current document is completed and the first recorded timestamp of the performance entry : https://developer.mozilla.org/en-US/docs/Web/Performance/Navigation_and_resource_timings#duration * network = Redirect time + App Cache + DNS lookup time + TCP connection time * request = Request time : https://developer.mozilla.org/en-US/docs/Web/Performance/Navigation_and_resource_timings#request_time * response = Response time * dom = Document load time : https://html.spec.whatwg.org/multipage/dom.html#document-load-timing-info * = Document processing time : https://developers.google.com/web/fundamentals/performance/navigation-and-resource-timing/#document_processing * + Loading time : https://developers.google.com/web/fundamentals/performance/navigation-and-resource-timing/#loading */ const navigationTiming = _getPerformanceNavigationTiming(); const timing = _getPerformanceTiming(); let total = 0; let network = 0; let request = 0; let response = 0; let dom = 0; if (navigationTiming || timing) { if (navigationTiming) { total = navigationTiming.duration; /** * support both cases: * - startTime is always zero: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming * - for older browsers where the startTime is not zero */ network = navigationTiming.startTime === 0 ? navigationTiming.connectEnd : dateTimeUtilsDuration(navigationTiming.startTime, navigationTiming.connectEnd); request = dateTimeUtilsDuration(navigationTiming.requestStart, navigationTiming.responseStart); response = dateTimeUtilsDuration(navigationTiming.responseStart, navigationTiming.responseEnd); dom = dateTimeUtilsDuration(navigationTiming.responseEnd, navigationTiming.loadEventEnd); } else { total = dateTimeUtilsDuration(timing.navigationStart, timing.loadEventEnd); network = dateTimeUtilsDuration(timing.navigationStart, timing.connectEnd); request = dateTimeUtilsDuration(timing.requestStart, timing.responseStart); response = dateTimeUtilsDuration(timing.responseStart, timing.responseEnd); dom = dateTimeUtilsDuration(timing.responseEnd, timing.loadEventEnd); } if (total === 0) { _throwInternal(_logger, eLoggingSeverity.WARNING, _eInternalMessageId.ErrorPVCalc, "error calculating page view performance.", { total, network, request, response, dom }); } else if (!_shouldCollectDuration(total, network, request, response, dom)) { _throwInternal(_logger, eLoggingSeverity.WARNING, _eInternalMessageId.InvalidDurationValue, "Invalid page load duration value. Browser perf data won't be sent.", { total, network, request, response, dom }); } else if (total < mathFloor(network) + mathFloor(request) + mathFloor(response) + mathFloor(dom)) { // some browsers may report individual components incorrectly so that the sum of the parts will be bigger than total PLT // in this case, don't report client performance from this page _throwInternal(_logger, eLoggingSeverity.WARNING, _eInternalMessageId.ClientPerformanceMathError, "client performance math error.", { total, network, request, response, dom }); } else { pageViewPerformance.durationMs = total; // // convert to timespans pageViewPerformance.perfTotal = pageViewPerformance.duration = msToTimeSpan(total); pageViewPerformance.networkConnect = msToTimeSpan(network); pageViewPerformance.sentRequest = msToTimeSpan(request); pageViewPerformance.receivedResponse = msToTimeSpan(response); pageViewPerformance.domProcessing = msToTimeSpan(dom); pageViewPerformance.isValid = true; } } }, getPerformanceTiming: _getPerformanceTiming, isPerformanceTimingSupported: _isPerformanceTimingSupported, isPerformanceTimingDataReady: _isPerformanceTimingDataReady, shouldCollectDuration: _shouldCollectDuration }; } ================================================ FILE: extensions/applicationinsights-analytics-js/src/JavaScriptSDK/Telemetry/PageVisitTimeManager.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { IDiagnosticLogger, _warnToConsole, dateNow, dumpObj, getJSON, hasJSON, throwError, utlCanUseSessionStorage, utlGetSessionStorage, utlRemoveSessionStorage, utlSetSessionStorage } from "@microsoft/applicationinsights-core-js"; export interface IPageVisitData { pageName: string; pageUrl: string; pageVisitStartTime: number; pageVisitTime: number; } /** * Factory function to create a page visit data object * @param pageName - Name of the page * @param pageUrl - URL of the page * @returns IPageVisitData instance */ export function createPageVisitData(pageName: string, pageUrl: string): IPageVisitData { return { pageVisitStartTime: dateNow(), pageName: pageName, pageUrl: pageUrl, pageVisitTime: 0 }; } /** * Internal interface for PageVisitTimeManager. * @internal */ export interface IPageVisitTimeManager { /** * Tracks the previous page visit time telemetry (if exists) and starts timing of new page visit time * @param currentPageName - Name of page to begin timing for visit duration * @param currentPageUrl - Url of page to begin timing for visit duration */ trackPreviousPageVisit(currentPageName: string, currentPageUrl: string): void; // These properties are exposed for backward compatibility with tests readonly _logger?: IDiagnosticLogger; readonly pageVisitTimeTrackingHandler?: (pageName: string, pageUrl: string, pageVisitTime: number) => void; } /** * Factory function to create a PageVisitTimeManager instance. * @param logger - Diagnostic logger * @param pageVisitTimeTrackingHandler - Delegate that will be called to send telemetry data to AI (when trackPreviousPageVisit is called) * @returns A new IPageVisitTimeManager instance. * @internal */ export function createPageVisitTimeManager(logger: IDiagnosticLogger, pageVisitTimeTrackingHandler: (pageName: string, pageUrl: string, pageVisitTime: number) => void): IPageVisitTimeManager { let prevPageVisitDataKeyName: string = "prevPageVisitData"; /** * Stops timing of current page (if exists) and starts timing for duration of visit to pageName * @param pageName - Name of page to begin timing visit duration * @returns {IPageVisitData} Page visit data (including duration) of pageName from last call to start or restart, if exists. Null if not. */ function restartPageVisitTimer(pageName: string, pageUrl: string) { let prevPageVisitData: IPageVisitData = null; try { prevPageVisitData = stopPageVisitTimer(); if (utlCanUseSessionStorage()) { if (utlGetSessionStorage(logger, prevPageVisitDataKeyName) != null) { throwError("Cannot call startPageVisit consecutively without first calling stopPageVisit"); } const currPageVisitDataStr = getJSON().stringify(createPageVisitData(pageName, pageUrl)); utlSetSessionStorage(logger, prevPageVisitDataKeyName, currPageVisitDataStr); } } catch (e) { _warnToConsole(logger, "Call to restart failed: " + dumpObj(e)); prevPageVisitData = null; } return prevPageVisitData; } /** * Stops timing of current page, if exists. * @returns {IPageVisitData} Page visit data (including duration) of pageName from call to start, if exists. Null if not. */ function stopPageVisitTimer() { let prevPageVisitData: IPageVisitData = null; try { if (utlCanUseSessionStorage()) { // Define end time of page's visit const pageVisitEndTime = dateNow(); // Try to retrieve page name and start time from session storage const pageVisitDataJsonStr = utlGetSessionStorage(logger, prevPageVisitDataKeyName); if (pageVisitDataJsonStr && hasJSON()) { // if previous page data exists, set end time of visit prevPageVisitData = getJSON().parse(pageVisitDataJsonStr); prevPageVisitData.pageVisitTime = pageVisitEndTime - prevPageVisitData.pageVisitStartTime; // Remove data from storage since we already used it utlRemoveSessionStorage(logger, prevPageVisitDataKeyName); } } } catch (e) { _warnToConsole(logger, "Stop page visit timer failed: " + dumpObj(e)); prevPageVisitData = null; } return prevPageVisitData; } return { trackPreviousPageVisit: (currentPageName: string, currentPageUrl: string) => { try { // Restart timer for new page view const prevPageVisitTimeData = restartPageVisitTimer(currentPageName, currentPageUrl); // If there was a page already being timed, track the visit time for it now. if (prevPageVisitTimeData) { pageVisitTimeTrackingHandler(prevPageVisitTimeData.pageName, prevPageVisitTimeData.pageUrl, prevPageVisitTimeData.pageVisitTime); } } catch (e) { _warnToConsole(logger, "Auto track page visit time failed, metric will not be collected: " + dumpObj(e)); } }, // Expose for backward compatibility with tests _logger: logger, pageVisitTimeTrackingHandler: pageVisitTimeTrackingHandler }; } ================================================ FILE: extensions/applicationinsights-analytics-js/src/JavaScriptSDK/Timing.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { IDiagnosticLogger, _eInternalMessageId, _throwInternal, dateTimeUtilsDuration, eLoggingSeverity } from "@microsoft/applicationinsights-core-js"; /** * Internal interface for Timing. * @internal */ export interface ITiming { action: (name?: string, url?: string, duration?: number, properties?: { [key: string]: string }, measurements?: { [key: string]: number }) => void; start: (name: string) => void; stop: (name: string, url: string, properties?: { [key: string]: string }, measurements?: { [key: string]: number }) => void; } /** * Factory function to create a Timing instance. * @param logger - Diagnostic logger * @param name - Name identifier for timing operations * @returns A new ITiming instance. * @internal */ export function createTiming(logger: IDiagnosticLogger, name: string): ITiming { let _events: { [key: string]: number; } = {} const timing: ITiming = { action: null, // Will be set by the caller start: (name: string) => { if (typeof _events[name] !== "undefined") { _throwInternal(logger, eLoggingSeverity.WARNING, _eInternalMessageId.StartCalledMoreThanOnce, "start was called more than once for this event without calling stop.", { name, key: name }, true); } _events[name] = +new Date; }, stop: (name: string, url: string, properties?: { [key: string]: string }, measurements?: { [key: string]: number }) => { const start = _events[name]; if (isNaN(start)) { _throwInternal(logger, eLoggingSeverity.WARNING, _eInternalMessageId.StopCalledWithoutStart, "stop was called without a corresponding start.", { name, key: name }, true); } else { const end = +new Date; const duration = dateTimeUtilsDuration(start, end); timing.action(name, url, duration, properties, measurements); } delete _events[name]; _events[name] = undefined; } }; return timing; } ================================================ FILE: extensions/applicationinsights-analytics-js/src/applicationinsights-analytics-js.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. export { AnalyticsPlugin, AnalyticsPlugin as ApplicationInsights } from "./JavaScriptSDK/AnalyticsPlugin"; export { IAppInsightsInternal } from "./JavaScriptSDK/Telemetry/PageViewManager"; export { IAnalyticsConfig } from "./JavaScriptSDK/Interfaces/IAnalyticsConfig"; ================================================ FILE: extensions/applicationinsights-analytics-js/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": true, "module": "es6", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "importHelpers": true, "noEmitHelpers": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "declaration": true, "declarationDir": "build/types", "outDir": "dist-es5", "rootDir": "./src", "removeComments": false }, "include": [ "./src/**/*.ts" ], "exclude": [ "./node_modules/**" ] } ================================================ FILE: extensions/applicationinsights-analytics-js/tsdoc.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", "extends": ["../../tsdoc.json"] } ================================================ FILE: extensions/applicationinsights-analytics-js/tslint.json ================================================ { "extends": [ "../../tslint-base.json" ] } ================================================ FILE: extensions/applicationinsights-analytics-js/typedoc.json ================================================ { "$schema": "https://typedoc.org/schema.json", "entryPoints": [ "./src/applicationinsights-analytics-js.ts" ], "exclude": [ "**/internal/**/*.ts", "node_modules/**" ], "externalPattern": [ "**/node_modules/**", "node_modules/**" ], "sort": [ "alphabetical", "kind", "instance-first" ], "basePath": "./src", "sourceLinkTemplate": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/{path}#L{line}", "cleanOutputDir": true, "excludeExternals": false, "excludeInternal": true, "excludePrivate": true, "includeVersion": true, "groupOrder": [ "Entrypoint", "Modules", "Namespaces", "Enumerations", "Enumeration Members", "Classes", "Interfaces", "Type Aliases", "Constructors", "Properties", "Variables", "Functions", "Accessors", "Methods", "References", "*" ], "tsconfig": "./tsconfig.json", "out": "../../docs/webSdk/applicationinsights-analytics-js", "readme": "none", "githubPages": true, "gitRevision": "main", "compilerOptions": { "stripInternal": true }, "sidebarLinks": { "Changelog": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/RELEASES.md", "Examples": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/examples/README.md", "Readme": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/extensions/applicationinsights-analytics-js" }, "navigationLinks": { "GitHub": "https://github.com/Microsoft/ApplicationInsights-JS", "npm": "https://www.npmjs.com/package/@microsoft/applicationinsights-analytics-js" }, "visibilityFilters": { "protected": false, "private": false, "inherited": true, "external": true } } ================================================ FILE: extensions/applicationinsights-angularplugin-js/README.md ================================================ # Microsoft Application Insights JavaScript SDK - Angular Plugin (< 2.5.10) ******************* :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: # The current development repo location of the [Angular Plugin Repo has moved here](https://github.com/microsoft/applicationinsights-angularplugin-js) - (for v2.5.11 or greater) ## Please refer to the new repo for usage instructions, and open issues there. ### This repo folder is no longer compiled and tested as part of the PR and merge validation, thus it WILL go stale :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: :exclamation: ******************* ### Where is the source code for the previous version For historical purposes the previous code for the angular plugin has been archived in the [angularplugin-legacy branch to review all previous code and documentation](https://github.com/microsoft/ApplicationInsights-JS/tree/angularplugin-legacy/extensions/applicationinsights-angularplugin-js) branch. No further changes are scheduled or expected, any and all changes will occur in the [new repo](https://github.com/microsoft/applicationinsights-angularplugin-js) only. ### Links - [v2.5.10 Readme](https://github.com/microsoft/ApplicationInsights-JS/blob/angularplugin-legacy/extensions/applicationinsights-angularplugin-js/README.md) ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. ## License [MIT](LICENSE) ================================================ FILE: extensions/applicationinsights-angularplugin-js/tsdoc.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", "extends": ["../../tsdoc.json"] } ================================================ FILE: extensions/applicationinsights-cfgsync-js/.npmignore ================================================ # NPM Ignore # ignore everything * # ... but these files !package.json !tsconfig.json !/CODE_OF_CONDUCT.md !/CONTRIBUTING.md !/README.md !/SECURITY.md !/SUPPORT.md !/NOTICE !/PRIVACY !/LICENSE !/LICENSE.TXT !dist-es*/** !dist/** !browser/** !types/** ================================================ FILE: extensions/applicationinsights-cfgsync-js/README.md ================================================ # Microsoft Application Insights JavaScript SDK - CfgSync Plugin [![GitHub Workflow Status (main)](https://img.shields.io/github/actions/workflow/status/microsoft/ApplicationInsights-JS/ci.yml?branch=main)](https://github.com/microsoft/ApplicationInsights-JS/tree/main) [![Build Status](https://dev.azure.com/mseng/AppInsights/_apis/build/status/AppInsights%20-%20DevTools/1DS%20JavaScript%20SDK%20web%20SKU%20vNext?branchName=main)](https://dev.azure.com/mseng/AppInsights/_build/latest?definitionId=8184&branchName=main) [![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-cfgsync-js.svg)](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-cfgsync-js) Application Insights CfgSync Plugin enables configuration change communication among mutiple instances. Refer to [our GitHub page](https://github.com/microsoft/ApplicationInsights-JS) for more details on getting started. ## [Configuration](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-cfgsync-js/interfaces/ICfgSyncConfig.html) | Name | Type | Default | Description | |------|------|---------|-------------| | [syncMode](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-cfgsync-js/interfaces/ICfgSyncConfig.html#syncMode) | ICfgSyncMode
          [Optional]| Broadcast | Sync mode of current instance. If set to `None`, current instance will NOT receive or broadcast config changes. If set to `Broadcast`, current instance will ONLY broadcast changes. If set to `Receive`, instance will ONLY receive config changes but NOT broadcast config changes. | | [customEvtName](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-cfgsync-js/interfaces/ICfgSyncConfig.html#customEvtName) | string
          [Optional] | ai_cfgsync | Event name for sending or listening to configuration change details. | | [cfgUrl](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-cfgsync-js/interfaces/ICfgSyncConfig.html#cfgUrl) | string
          [Optional] | null | CDN endpoint for fetching configuration. If cfgUrl is defined, instance will NOT listen to core configuration changes. Details defined in the CDN endpoint should follow `ICfgSyncCdnConfig` interface. | | [blkCdnCfg](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-cfgsync-js/interfaces/ICfgSyncConfig.html#blkCdnCfg) | boolean
          [Optional] | false | Determines if fetching the CDN endpoint should be blocked or not. | | [onCfgChangeReceive](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-cfgsync-js/interfaces/ICfgSyncConfig.html#onCfgChangeReceive) | function
          [Optional] | null | Overrides callback function to handle event details when changes are received via event listener. | | [overrideSyncFn](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-cfgsync-js/interfaces/ICfgSyncConfig.html#overrideSyncFn) | function
          [Optional] | null | Overrides sync() function to broadcast changes. | | [overrideFetchFn](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-cfgsync-js/interfaces/ICfgSyncConfig.html#overrideFetchFn) | function
          [Optional] | null | Overrides fetch function to get config from cfgUrl when cfgUrl is defined. | | [nonOverrideConfigs](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-cfgsync-js/interfaces/ICfgSyncConfig.html#nonOverrideConfigs) | NonOverrideCfg
          [Optional] | {instrumentationKey: true, connectionString: true, endpointUrl: true } | When current instance is set with syncMode: `Receive`, config fields under nonOverrideConfigs will NOT be changed by any confif details sent out from other instances. NOTE: this config will be ONLY applied during initialization, so it won't be changed dynamically. | | [scheduleFetchTimeout](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-cfgsync-js/interfaces/ICfgSyncConfig.html#scheduleFetchTimeout) | number
          [Optional] | 30 mins | Identifies the time interval (in milliseconds) for fetching config details from cfgUrl when cfgUrl is defined. If set to 0, the fetch operation will only be called once during initialization. | ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at . You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. ## License [MIT](LICENSE) ================================================ FILE: extensions/applicationinsights-cfgsync-js/Tests/Unit/src/GlobalTestHooks.Test.ts ================================================ import { Assert } from "@microsoft/ai-test-framework"; import { _testHookMaxUnloadHooksCb } from "@microsoft/applicationinsights-core-js"; import { dumpObj } from "@nevware21/ts-utils"; export class GlobalTestHooks { public registerTests() { // Set a global maximum _testHookMaxUnloadHooksCb(20, (state: string, hooks: Array) => { Assert.ok(false, "Max unload hooks exceeded [" + hooks.length + "] - " + state + " - " + dumpObj(hooks)); }); } } ================================================ FILE: extensions/applicationinsights-cfgsync-js/Tests/Unit/src/cfgsync.tests.ts ================================================ import { CfgSyncHelperTests } from "./cfgsynchelper.tests"; import {CfgSyncPluginTests} from "./cfgsyncplugin.tests"; import { GlobalTestHooks } from "./GlobalTestHooks.Test"; export function runTests() { new GlobalTestHooks().registerTests(); new CfgSyncPluginTests().registerTests(); new CfgSyncHelperTests().registerTests(); } ================================================ FILE: extensions/applicationinsights-cfgsync-js/Tests/Unit/src/cfgsynchelper.tests.ts ================================================ import { AITestClass, Assert } from "@microsoft/ai-test-framework"; import { NonOverrideCfg } from "../../../src/Interfaces/ICfgSyncConfig"; import { ICookieMgrConfig, AppInsightsCore, CdnFeatureMode, FeatureOptInMode, IAppInsightsCore, IConfiguration, IFeatureOptIn, IFeatureOptInDetails, INotificationManager, IPlugin, ITelemetryItem, PerfManager, suppressTracing } from "@microsoft/applicationinsights-core-js"; import { IConfig, IStorageBuffer } from "@microsoft/applicationinsights-core-js"; import { resolveCdnFeatureCfg, replaceByNonOverrideCfg, applyCdnfeatureCfg } from "../../../src/CfgSyncHelperFuncs"; import { ICfgSyncCdnConfig } from "../../../src/Interfaces/ICfgSyncCdnConfig"; export class CfgSyncHelperTests extends AITestClass { constructor(emulateIe?: boolean) { super("CfgSyncHelperTests", emulateIe); } public testInitialize() { } public testCleanup() { } public registerTests() { this.testCase({ name: "CfgSyncPluginHelper: replaceByNonOverrideCfg should work with flat-level config", useFakeTimers: true, test: () => { let testFunc = (core: IAppInsightsCore, notificationManager: INotificationManager) => { return new PerfManager(notificationManager); } let config = { instrumentationKey: "Test-iKey", maxMessageLimit: 100, loggingLevelConsole: 0, endpointUrl: "testurl", loggingLevelTelemetry: 0, disableInstrumentationKeyValidation: true, enablePerfMgr: false, createPerfMgr: testFunc, perfEvtsSendAll: true, idLength: 100, cookieDomain: "test", cookiePath: "test", disableCookiesUsage: true, disablePageUnloadEvents: ["eve1", "eve2"] } as IConfig & IConfiguration; let newConfig = { instrumentationKey: "Test-iKey123", maxMessageLimit: 1000, loggingLevelConsole: 1, endpointUrl: "testurl123", loggingLevelTelemetry: 1, disableInstrumentationKeyValidation: false, enablePerfMgr: true, perfEvtsSendAll: false, idLength: 10, cookieDomain: "test123", cookiePath: "test123", disableCookiesUsage: true, disablePageUnloadEvents: ["eve123", "eve223"] } as IConfig & IConfiguration; let nonoverrideCfg = { instrumentationKey: true, maxMessageLimit: true, loggingLevelConsole: true, endpointUrl: undefined, loggingLevelTelemetry: false, disableInstrumentationKeyValidation: true, enablePerfMgr: true, createPerfMgr: true, perfEvtsSendAll: true, idLength: true, cookieDomain: true, cookiePath: false, disableCookiesUsage: true, disablePageUnloadEvents: true } as NonOverrideCfg; let expectedNewCfg = { endpointUrl:"testurl123", loggingLevelTelemetry: 1, cookiePath:"test123" } let expectedCoreCfg = { instrumentationKey:"Test-iKey", maxMessageLimit: 100, loggingLevelConsole:0, endpointUrl:"testurl123", loggingLevelTelemetry: 1, disableInstrumentationKeyValidation: true, enablePerfMgr: false, perfEvtsSendAll: true, idLength: 100, cookieDomain: "test", cookiePath: "test123", disableCookiesUsage: true, disablePageUnloadEvents:["eve1","eve2"], cookieCfg:{}, extensions:[{isFlushInvoked:false,isTearDownInvoked:false,isResumeInvoked:false,isPauseInvoked:false,identifier:"Sender",priority:1001}], channels:[], extensionConfig:{}, //_sdk: { // stats: { // endCfg: [] // } //}, traceHdrMode: 3, traceCfg: { generalLimits: { attributeCountLimit: 128 }, // spanLimits: { // attributeCountLimit: 128, // linkCountLimit: 128, // eventCountLimit: 128, // attributePerEventCountLimit: 128, // attributePerLinkCountLimit: 128 // }, serviceName: null, suppressTracing: false }, errorHandlers: {}, enableDebug: false }; let core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); let channel = new ChannelPlugin(); core.initialize(config, [channel]); let coreCfg = core.config; let newCfg = replaceByNonOverrideCfg(newConfig, nonoverrideCfg, 0, 4); Assert.deepEqual(JSON.stringify(newCfg), JSON.stringify(expectedNewCfg), "only expected configs are changed under new config"); core.updateCfg(newCfg); this.clock.tick(1); coreCfg = core.config; Assert.deepEqual(JSON.stringify(coreCfg), JSON.stringify(expectedCoreCfg), "core config should be updated as expected"); } }); this.testCase({ name: "CfgSyncPluginHelper: replaceByNonOverrideCfg should work with 2 nested levels config", useFakeTimers: true, test: () => { let cookieCfg = { enabled: false, domain: "test", path: "testpath", ignoreCookies: ["test1", "test2"], getCookie: (name) => { let theValue = name || ""; return theValue + "Test"; } } as ICookieMgrConfig; let newCookieCfg = { enabled: true, domain: "test123", path: "testpath123", ignoreCookies: ["test1123", "test2123"], getCookie: (name) => { let theValue = name || ""; return theValue + "Test123"; }, setCookie: (name, value) => { name = value; }, delCookie: (name) => { return null; } } as ICookieMgrConfig; let config = { instrumentationKey: "Test-iKey", endpointUrl: "testurl", maxMessageLimit: 100, disablePageUnloadEvents: ["eve1", "eve2"], cookieCfg: cookieCfg } as IConfig & IConfiguration; let newConfig = { instrumentationKey: "Test-iKey123", endpointUrl: "testurl123", maxMessageLimit: 1000, cookieCfg: newCookieCfg, disablePageUnloadEvents: ["eve123", "eve223"] } as IConfig & IConfiguration; let nonoverrideCfg = { instrumentationKey: true, endpointUrl: true, cookieCfg: { enabled: true, domain: true, getCookie: true } } as NonOverrideCfg; let expectedNewCfg = { maxMessageLimit: 1000, cookieCfg: { path: "testpath123", ignoreCookies: ["test1123", "test2123"], setCookie: (name, value) => { name = value; }, delCookie: (name) => { return null; } }, disablePageUnloadEvents: ["eve123", "eve223"] } let core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); let channel = new ChannelPlugin(); core.initialize(config, [channel]); let coreCfg = core.config; let newCfg = replaceByNonOverrideCfg(newConfig, nonoverrideCfg, 0, 4); Assert.deepEqual(JSON.stringify(newCfg), JSON.stringify(expectedNewCfg), "only expected configs are changed under new config"); core.updateCfg(newCfg); this.clock.tick(1); coreCfg = core.config; let ikey = coreCfg.instrumentationKey; let endpoint = coreCfg.endpointUrl; let maxMessageLimit = coreCfg.maxMessageLimit; let disablePageUnloadEvents = coreCfg.disablePageUnloadEvents; Assert.deepEqual(ikey, "Test-iKey", "core config ikey should not be updated"); Assert.deepEqual(endpoint, "testurl", "core config endpoint url should not be updated"); Assert.deepEqual(maxMessageLimit, 1000, "core config maxMessageLimit url should be updated"); Assert.deepEqual(disablePageUnloadEvents, ["eve123", "eve223"], "core config disablePageUnloadEvents should be updated"); let coreCookieCfg = core.config.cookieCfg || {}; Assert.ok(coreCookieCfg, "cookie config should exist"); let enabled = coreCookieCfg.enabled; Assert.equal(enabled, false, "cookie config enabled should not be udpated"); let path = coreCookieCfg.path; Assert.equal(path, "testpath123", "cookie config path should be udpated"); let domain = coreCookieCfg.domain; Assert.equal(domain, "test", "cookie config domain should not be udpated"); let cookie = coreCfg.cookieCfg; let getFunc = cookie?.getCookie; let val = getFunc && getFunc(""); Assert.equal(val, "Test", "cookie config domain should not be udpated"); } }); this.testCase({ name: "CfgSyncPluginHelper: replaceByNonOverrideCfg should work with 3 & 4 nested levels config", useFakeTimers: true, test: () => { let storageBuffer = { getItem: (logger: any, name: string) => { return "test" }, setItem: (logger: any, name: string, data: string) => { return true; } } as IStorageBuffer; let newStorageBuffer = { getItem: (logger: any, name: string) => { return "test123" }, setItem: (logger: any, name: string, data: string) => { return false; } } as IStorageBuffer; let config = { instrumentationKey: "Test-iKey", maxMessageLimit: 100, extensionConfig: { ["ApplicationInsightsAnalytics"]: { emitLineDelimitedJson: true, sessionRenewalMs: 100, bufferOverride: storageBuffer } as IConfig } } as IConfiguration; let newConfig = { instrumentationKey: "Test-iKey123", maxMessageLimit: 1000, extensionConfig: { ["ApplicationInsightsAnalytics"]: { emitLineDelimitedJson: false, sessionRenewalMs: 1000, bufferOverride: newStorageBuffer } as IConfig } } as IConfiguration; let nonoverrideCfg = { instrumentationKey: true, extensionConfig: { ["ApplicationInsightsAnalytics"]: { emitLineDelimitedJson: true, bufferOverride: { getItem: true } } } } as NonOverrideCfg; let core = new AppInsightsCore(); this.onDone(() => { core.unload(false); }); let channel = new ChannelPlugin(); core.initialize(config, [channel]); let coreCfg = core.config; let newCfg = replaceByNonOverrideCfg(newConfig, nonoverrideCfg, 0, 4); let newCfgIkey = newCfg.instrumentationKey; Assert.deepEqual(newCfgIkey, undefined, "new config ikey should be deleted"); let newMsgLimit = newCfg.maxMessageLimit; Assert.deepEqual(newMsgLimit, 1000, "new config maxMessageLimit should not be deleted"); let newExtConfig = newCfg.extensionConfig || {}; Assert.ok(newExtConfig, "new ext config should not be deleted"); let newPluginConfig = newExtConfig["ApplicationInsightsAnalytics"] || {}; Assert.ok(newPluginConfig, "new plugin config should not be deleted"); Assert.ok(!newPluginConfig.emitLineDelimitedJson, "new plugin config emitLineDelimitedJson should be updated"); Assert.deepEqual(newPluginConfig.sessionRenewalMs, 1000, "new plugin config sessionRenewalMs should not be deleted"); let newBuffer = newPluginConfig.bufferOverride || {}; Assert.ok(newBuffer, "new plugin config bufferOverride should not be deleted"); Assert.deepEqual(newBuffer.getItem, undefined, "new bufferOveride getItem should be deleted"); let setItem = newBuffer && newBuffer.setItem; Assert.deepEqual(setItem(null, "name", "data"), false, "new bufferOveride setItem should not be deleted"); core.updateCfg(newCfg); this.clock.tick(1); coreCfg = core.config; let ikey = coreCfg.instrumentationKey; Assert.deepEqual(ikey, "Test-iKey", "core config ikey should not be updated"); let coreMsgLimit = coreCfg.maxMessageLimit; Assert.deepEqual(coreMsgLimit, 1000, "core config maxMessageLimit should not be deleted"); let coreExtConfig = coreCfg.extensionConfig || {}; Assert.ok(coreExtConfig, "core ext config should not be deleted"); let corePluginConfig = coreExtConfig["ApplicationInsightsAnalytics"] || {}; Assert.ok(corePluginConfig, "core plugin config should not be deleted"); Assert.ok(corePluginConfig.emitLineDelimitedJson, "core plugin config emitLineDelimitedJson should not be updated"); Assert.deepEqual(corePluginConfig.sessionRenewalMs, 1000, "core plugin config sessionRenewalMs should not be deleted"); let coreBuffer = corePluginConfig.bufferOverride || {}; Assert.ok(coreBuffer, "core plugin config bufferOverride should not be deleted"); let coreGetItem = coreBuffer && coreBuffer.getItem; Assert.ok(coreGetItem, "core plugin config getItem should not be deleted"); Assert.deepEqual( coreGetItem && coreGetItem(null, "test"), "test", "core bufferOveride getItem should not be updated"); let coreSetItem = coreBuffer && coreBuffer.setItem; Assert.ok(coreSetItem, "core plugin config setItem should not be deleted"); Assert.deepEqual(coreSetItem(null, "name", "data"), false, "new bufferOveride setItem should be updated"); } }); this.testCase({ name: "CfgSyncPluginHelper: replaceByNonOverrideCfg should work with max nested level config", useFakeTimers: true, test: () => { let newCookieCfg = { enabled: true, domain: "test123", path: "testpath123", ignoreCookies: ["test1123", "test2123"], getCookie: (name) => { let theValue = name || ""; return theValue + "Test123"; }, setCookie: (name, value) => { name = value; }, delCookie: (name) => { return null; } } as ICookieMgrConfig; let newConfig = { instrumentationKey: "Test-iKey123", maxMessageLimit: 1000, cookieCfg: newCookieCfg, disablePageUnloadEvents: ["eve123", "eve223"] } as IConfig & IConfiguration; let nonoverrideCfg = { instrumentationKey: true, cookieCfg: { enabled: true, domain: true, getCookie: true }, disablePageUnloadEvents: true } as NonOverrideCfg; let newCfg = replaceByNonOverrideCfg(newConfig, nonoverrideCfg, 0, 0); Assert.deepEqual(newCfg.instrumentationKey, undefined, "instrumentationKey should be deleted"); Assert.deepEqual(newCfg.maxMessageLimit, 1000, "maxMessageLimit should not be deleted"); Assert.deepEqual(newCfg.disablePageUnloadEvents, undefined, "disablePageUnloadEvents should be deleted"); Assert.deepEqual(newCfg.cookieCfg, null, "cookieCfg should exceed max level"); let storageBuffer = { getItem: (logger: any, name: string) => { return "test" }, setItem: (logger: any, name: string, data: string) => { return true; } } as IStorageBuffer; let newConfig2 = { instrumentationKey: "Test-iKey", maxMessageLimit: 100, extensionConfig: { ["ApplicationInsightsAnalytics"]: { emitLineDelimitedJson: true, sessionRenewalMs: 100, bufferOverride: storageBuffer } as IConfig } } as IConfiguration; let nonoverrideCfg2 = { instrumentationKey: true, extensionConfig: { ["ApplicationInsightsAnalytics"]: { emitLineDelimitedJson: true, bufferOverride: { getItem: true } } } } as NonOverrideCfg; let newCfg2 = replaceByNonOverrideCfg(newConfig2, nonoverrideCfg2, 0, 2); Assert.deepEqual(newCfg2.instrumentationKey, undefined, "instrumentationKey should be deleted"); let extCfg = newCfg2.extensionConfig || {}; Assert.ok(extCfg, "ext config should not be deleted"); let pluginCfg = extCfg.ApplicationInsightsAnalytics || null; Assert.ok(pluginCfg, "plugin config should not be deleted"); Assert.deepEqual(pluginCfg.emitLineDelimitedJson, undefined, "emitLineDelimitedJson should be deleted"); Assert.deepEqual(pluginCfg.sessionRenewalMs, 100, " sessionRenewalMs should not be deleted"); Assert.deepEqual(pluginCfg.bufferOverride, null, "bufferOverride should exceed max level"); } }); this.testCase({ name: "CfgSyncPluginHelper: shouldOptInFeature should work as expected with empty or undefiend or cdn config is disabled", useFakeTimers: true, test: () => { let mfield = "featureOptIn.enableWParamFeature.mode"; let vField = "featureOptIn.enableWParamFeature.onCfg"; let dField = "featureOptIn.enableWParamFeature.offCfg"; //Case1: cdn cfg and custom cfg are both undefined or empty let featureValue = resolveCdnFeatureCfg("enableWParamFeature"); Assert.deepEqual(null, featureValue, "feature value should be null when cfg are undefined case1"); featureValue = resolveCdnFeatureCfg("enableWParamFeature", {}, {}); Assert.deepEqual(null, featureValue, "feature value should be null when cfg are empty case1"); //Case2: custom cfg is undefined or empty let cdnConfig = { enabled: false } as ICfgSyncCdnConfig; featureValue = resolveCdnFeatureCfg("enableWParamFeature", cdnConfig); Assert.deepEqual(null, featureValue, "feature value should be null when custom cfg is undefined and cdn config is disabled case2"); cdnConfig = { enabled: true } as ICfgSyncCdnConfig; featureValue = resolveCdnFeatureCfg("enableWParamFeature", cdnConfig, {}); Assert.deepEqual({[mfield]: FeatureOptInMode.disable, [vField]: undefined, [dField]: undefined}, featureValue, "feature value should be disbale when custom cfg is empty and cdn config is enabled case2"); cdnConfig = { enabled: true, featureOptIn:{["enableWParamFeature"]: {mode: CdnFeatureMode.enable}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; featureValue = resolveCdnFeatureCfg("enableWParamFeature", cdnConfig); Assert.deepEqual({[mfield]: FeatureOptInMode.disable, [vField]: undefined, [dField]: undefined}, featureValue, "feature value should be disable when custom cfg is undefined case2"); featureValue = resolveCdnFeatureCfg("enableWP", cdnConfig); Assert.deepEqual({"featureOptIn.enableWP.mode": FeatureOptInMode.disable, "featureOptIn.enableWP.onCfg": undefined,"featureOptIn.enableWP.offCfg": undefined}, featureValue, "feature value should be null when field is not defined case2"); //Case3: cdn config is undefined or empty let customFeatureOptIn = { ["enableWParamFeature"]: {mode: FeatureOptInMode.enable, onCfg: {"config1": true}, offCfg: {"config2": false}} as IFeatureOptInDetails }as IFeatureOptIn; featureValue = resolveCdnFeatureCfg("enableWParamFeature", {}, customFeatureOptIn); Assert.deepEqual(null, featureValue, "feature value should be disable case3"); //Case4: cdn config is disbaled cdnConfig = { enabled: false, featureOptIn:{["enableWParamFeature"]: {mode: CdnFeatureMode.disable}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; customFeatureOptIn = { ["enableWParamFeature"]: {mode: FeatureOptInMode.enable, onCfg: {"config1": true}, offCfg: {"config2": false}} as IFeatureOptInDetails }as IFeatureOptIn; featureValue = resolveCdnFeatureCfg("enableWParamFeature", cdnConfig, customFeatureOptIn); Assert.deepEqual(null, featureValue, "feature value should be disable case4"); //Case5: cdn config has value and custom details is none cdnConfig = { enabled: true, featureOptIn:{["enableWParamFeature"]: {mode: CdnFeatureMode.enable, onCfg: {"config1": true}, offCfg: {"config2": false}}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; featureValue = resolveCdnFeatureCfg("enableWParamFeature", cdnConfig); Assert.deepEqual({[mfield]: FeatureOptInMode.disable, [vField]: {"config1": true}, [dField]: {"config2": false}}, featureValue, "feature value should be cdn Value case5"); cdnConfig = { enabled: true, featureOptIn:{["enableWParamFeature"]: {mode: CdnFeatureMode.disable, onCfg: {"config1": true}, offCfg: {"config2": false}}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; featureValue = resolveCdnFeatureCfg("enableWParamFeature", cdnConfig); Assert.deepEqual({[mfield]: FeatureOptInMode.disable, [vField]: {"config1": true}, [dField]: {"config2": false}}, featureValue, "feature value should combine user and cdn values case5"); } }); this.testCase({ name: "CfgSyncPluginHelper: shouldOptInFeature should work with cdn mode set enabled and custom mode set to enable", useFakeTimers: true, test: () => { let field = "enableWParamFeature"; let mField = `featureOptIn.${field}.mode`; let vField = `featureOptIn.${field}.onCfg`; let dField = `featureOptIn.${field}.offCfg`; let cdnConfig = { enabled: true, featureOptIn:{[field]: {mode: CdnFeatureMode.enable, onCfg: {"config1": true}, offCfg: {"config2": false}}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; // case 1 let customFeatureOptIn = { [field]: {mode: FeatureOptInMode.enable} as IFeatureOptInDetails } as IFeatureOptIn; let featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.enable, [vField]: {"config1": true}, [dField]: {"config2": false}}, featureValue, "feature value should be cdn value case1"); // case 1-1 customFeatureOptIn = { [field]: {mode: FeatureOptInMode.enable, onCfg: {"config3": true}} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.enable, [vField]: {"config3": true}, [dField]: {"config2": false}}, featureValue, "feature value should be custom value case1-1"); // case 2 customFeatureOptIn = { [field]: {mode: FeatureOptInMode.enable, onCfg: {"config3": true}, offCfg: {"config4": false}} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.enable, [vField]: {"config3": true}, [dField]: {"config4": false}}, featureValue, "feature value should be custom value case2"); // case 3 customFeatureOptIn = { [field]: {mode: FeatureOptInMode.enable, blockCdnCfg: true} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.enable, [vField]: undefined, [dField]: undefined}, featureValue, "feature value should be custom value case3"); //case 4 cdnConfig = { enabled: true, featureOptIn:{[field]: {mode: CdnFeatureMode.enable}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; customFeatureOptIn = { [field]: {mode: FeatureOptInMode.enable} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.enable, [vField]: undefined, [dField]: undefined}, featureValue, "feature value should be undefined case4"); } }); this.testCase({ name: "CfgSyncPluginHelper: shouldOptInFeature should work with cdn mode set enabled and custom mode set to none", useFakeTimers: true, test: () => { let field = "enableWParamFeature"; let mField = `featureOptIn.${field}.mode`; let vField = `featureOptIn.${field}.onCfg`; let dField = `featureOptIn.${field}.offCfg`; let cdnConfig = { enabled: true, featureOptIn:{[field]: {mode: CdnFeatureMode.enable, onCfg: {"config1": true}}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; // case 1 let customFeatureOptIn = { [field]: {mode: FeatureOptInMode.none} as IFeatureOptInDetails } as IFeatureOptIn; let featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.enable, [vField]: {"config1": true}, [dField]: undefined}, featureValue, "feature value should be enable case1"); // case 2 customFeatureOptIn = { [field]: {mode: FeatureOptInMode.none, onCfg: {"config1": false}} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.enable, [vField]: {"config1": false}, [dField]: undefined}, featureValue, "feature value should be enable case2"); //case 3 cdnConfig = { enabled: true, featureOptIn:{[field]: {mode: CdnFeatureMode.disable}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; customFeatureOptIn = { [field]: {mode: FeatureOptInMode.none, onCfg: {"config1": true}} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.disable, [vField]: {"config1": true}, [dField]: undefined }, featureValue, "feature value should be disable case3"); // case 4 customFeatureOptIn = { [field]: {mode: FeatureOptInMode.none, blockCdnCfg: true} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.none, [vField]: undefined, [dField]: undefined}, featureValue, "feature value should be custom value case4"); // case 5 cdnConfig = { enabled: true, featureOptIn:{[field]: {mode: CdnFeatureMode.none}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; customFeatureOptIn = { [field]: {mode: FeatureOptInMode.none, onCfg: {"config1": false}} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.none, [vField]: {"config1": false}, [dField]: undefined}, featureValue, "feature value should be custom value case5"); } }); this.testCase({ name: "CfgSyncPluginHelper: shouldOptInFeature should work with cdn mode set enabled and custom mode set to disable", useFakeTimers: true, test: () => { let field = "enableWParamFeature"; let mField = `featureOptIn.${field}.mode`; let vField = `featureOptIn.${field}.onCfg`; let dField = `featureOptIn.${field}.offCfg`; let cdnConfig = { enabled: true, featureOptIn:{[field]: {mode: CdnFeatureMode.enable, onCfg: {"config1": false}}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; // case 1 let customFeatureOptIn = { [field]: {mode: FeatureOptInMode.disable} as IFeatureOptInDetails } as IFeatureOptIn; let featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.disable, [vField]: {"config1": false}, [dField]: undefined}, featureValue, "feature value should be disable case1"); // case 2 customFeatureOptIn = { [field]: {mode: FeatureOptInMode.disable, onCfg: {"config1": false}} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.disable, [vField]: {"config1": false}, [dField]: undefined}, featureValue, "feature value should be disable case2"); } }); this.testCase({ name: "CfgSyncPluginHelper: shouldOptInFeature should work with cdn mode set to force", useFakeTimers: true, test: () => { let field = "enableWParamFeature"; let mField = `featureOptIn.${field}.mode`; let vField = `featureOptIn.${field}.onCfg`; let dField = `featureOptIn.${field}.offCfg`; let cdnConfig = { enabled: true, featureOptIn:{[field]: {mode: CdnFeatureMode.forceOn, onCfg: {"config1": false}}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; // case 1 let customFeatureOptIn = { [field]: {mode: FeatureOptInMode.disable, onCfg: {"config1": true}} as IFeatureOptInDetails } as IFeatureOptIn; let featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.enable, [vField]: {"config1": false}, [dField]: undefined}, featureValue, "feature value should be cdn value case1"); // case 2 customFeatureOptIn = { [field]: {mode: FeatureOptInMode.disable, blockCdnCfg: true} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.disable, [vField]: undefined, [dField]: undefined}, featureValue, "feature value should be custom value case2"); // case 3 customFeatureOptIn = { [field]: {mode: FeatureOptInMode.enable, onCfg: {"config1": true}} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.enable, [vField]: {"config1": false}, [dField]: undefined}, featureValue, "feature value should be cdn value case3"); // case 4 customFeatureOptIn = { [field]: {mode: FeatureOptInMode.enable, onCfg: {"config1": true}, blockCdnCfg: true} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.enable, [vField]: {"config1": true}, [dField]: undefined}, featureValue, "feature value should be custom value case4"); } }); this.testCase({ name: "CfgSyncPluginHelper: shouldOptInFeature should work with cdn mode set to none or disable", useFakeTimers: true, test: () => { let field = "enableWParamFeature"; let mField = `featureOptIn.${field}.mode`; let vField = `featureOptIn.${field}.onCfg`; let dField = `featureOptIn.${field}.offCfg`; let cdnConfig = { enabled: true, featureOptIn:{[field]: {mode: CdnFeatureMode.disable, onCfg: {"config1": false}}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; // case 1 let customFeatureOptIn = { [field]: {mode: FeatureOptInMode.none} as IFeatureOptInDetails } as IFeatureOptIn; let featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.disable, [vField]: {"config1": false}, [dField]: undefined}, featureValue, "feature value should be null case1"); // case 2 customFeatureOptIn = { [field]: {mode: FeatureOptInMode.enable, onCfg: {"config1": true}} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.disable, [vField]: {"config1": true}, [dField]: undefined}, featureValue, "feature value should be enable case2"); // case 2-1 customFeatureOptIn = { [field]: {mode: FeatureOptInMode.disable, onCfg: {"config1": true}} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.disable, [vField]: {"config1": true}, [dField]: undefined}, featureValue, "feature value should be disable case2-1"); //case 3 cdnConfig = { enabled: true, featureOptIn:{[field]: {mode: CdnFeatureMode.none}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; customFeatureOptIn = { [field]: {mode: FeatureOptInMode.disable} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.disable, [vField]: undefined, [dField]: undefined}, featureValue, "feature value should be null case3"); // case 4 customFeatureOptIn = { [field]: {mode: FeatureOptInMode.none, onCfg:{"config1": true}} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.none, [vField]: {"config1": true}, [dField]: undefined}, featureValue, "feature value should be custom value case4"); // case 5 customFeatureOptIn = { [field]: {mode: FeatureOptInMode.enable, onCfg:{"config1": true}} as IFeatureOptInDetails } as IFeatureOptIn; featureValue = resolveCdnFeatureCfg(field, cdnConfig, customFeatureOptIn); Assert.deepEqual({[mField]: FeatureOptInMode.enable, [vField]: {"config1": true}, [dField]: undefined}, featureValue, "feature value should be null case5"); } }); this.testCase({ name: "CfgSyncPluginHelper: getConfigFromCdn should get config correctly with none custom opt-in", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let channel = new ChannelPlugin() this.onDone(() => { core.unload(false); }); let field = "enableWParamFeature"; let cdnConfig = { enabled: true, featureOptIn:{[field]: {mode: CdnFeatureMode.enable, onCfg: {["maxMessageLimit"]: 11}}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; let config = {instrumentationKey: "test"} as IConfiguration; core.initialize(config, [channel]); let expectedCfg = { maxMessageLimit: 10, featureOptIn: {[field]: {mode: FeatureOptInMode.disable, onCfg: {["maxMessageLimit"]: 11}, offCfg: undefined}} }; let actualCdnCfg = applyCdnfeatureCfg(cdnConfig, core); Assert.deepEqual(expectedCfg, actualCdnCfg, "cdn config should not enable feature"); } }); this.testCase({ name: "CfgSyncPluginHelper: getConfigFromCdn should get config correctly with custom opt-in", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let channel = new ChannelPlugin() this.onDone(() => { core.unload(false); }); let field = "enableWParamFeature"; let cdnConfig = { enabled: true, featureOptIn:{[field]: {mode: CdnFeatureMode.enable, onCfg: {["maxMessageLimit"]: 11}}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; let customFeatureOptIn = { [field]: {mode: FeatureOptInMode.enable} as IFeatureOptInDetails } as IFeatureOptIn; let config = {instrumentationKey: "test", featureOptIn: customFeatureOptIn} as IConfiguration; core.initialize(config, [channel]); let actualCdnCfg = applyCdnfeatureCfg(cdnConfig, core); let expectedCfg = { maxMessageLimit: 11, featureOptIn: {[field]: {mode: FeatureOptInMode.enable, onCfg: {["maxMessageLimit"]: 11}, offCfg: undefined}} } Assert.deepEqual(expectedCfg, actualCdnCfg, "cdn config should contain feature"); } }); this.testCase({ name: "CfgSyncPluginHelper: getConfigFromCdn should override config correctly with custom opt-in", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let channel = new ChannelPlugin() this.onDone(() => { core.unload(false); }); let field = "enableWParamFeature"; let cdnConfig = { enabled: true, featureOptIn:{[field]: {mode: CdnFeatureMode.enable, onCfg: {["maxMessageLimit"]: 11}}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; let customFeatureOptIn = { [field]: {mode: FeatureOptInMode.enable, onCfg: {["maxMessageLimit"]: 12}} as IFeatureOptInDetails } as IFeatureOptIn; let config = {instrumentationKey: "test", featureOptIn: customFeatureOptIn} as IConfiguration; core.initialize(config, [channel]); let actualCdnCfg = applyCdnfeatureCfg(cdnConfig, core); let expectedCfg = { maxMessageLimit: 12, featureOptIn: {[field]: {mode: FeatureOptInMode.enable, onCfg: {["maxMessageLimit"]: 12}, offCfg: undefined}} } Assert.deepEqual(expectedCfg, actualCdnCfg, "cdn config should contain feature"); core.updateCfg(actualCdnCfg as any); this.clock.tick(1); Assert.deepEqual(core.config.instrumentationKey, "test", "core ikey config"); Assert.deepEqual(core.config.maxMessageLimit, 12, "core maxMessageLimit config"); Assert.deepEqual(core.config.featureOptIn, expectedCfg.featureOptIn, "core featureOptIn config"); } }); this.testCase({ name: "CfgSyncPluginHelper: getConfigFromCdn should override enable and disaled config correctly with custom opt-in", useFakeTimers: true, test: () => { let core = new AppInsightsCore(); let channel = new ChannelPlugin() this.onDone(() => { core.unload(false); }); let field = "enableWParamFeature"; let cdnConfig = { enabled: true, featureOptIn:{[field]: {mode: CdnFeatureMode.enable, onCfg: {["maxMessageLimit"]: 11}, offCfg: {["maxMessageLimit"]: 12}}}, config: { maxMessageLimit: 10 } } as ICfgSyncCdnConfig; let customFeatureOptIn = { [field]: {mode: FeatureOptInMode.enable, onCfg: {["maxMessageLimit"]: 13}, offCfg: {["maxMessageLimit"]: 14}} as IFeatureOptInDetails } as IFeatureOptIn; let config = {instrumentationKey: "test", featureOptIn: customFeatureOptIn} as IConfiguration; core.initialize(config, [channel]); let actualCdnCfg = applyCdnfeatureCfg(cdnConfig, core); let expectedCfg = { maxMessageLimit: 13, featureOptIn: {[field]: {mode: FeatureOptInMode.enable, onCfg: {["maxMessageLimit"]: 13}, offCfg: {["maxMessageLimit"]: 14}}} } Assert.deepEqual(expectedCfg, actualCdnCfg, "cdn config should contain feature"); Assert.deepEqual(cdnConfig.config?.maxMessageLimit, 13, "original cdn config object is updated"); core.updateCfg(actualCdnCfg as any); this.clock.tick(1); Assert.deepEqual(core.config.instrumentationKey, "test", "core ikey config"); Assert.deepEqual(core.config.maxMessageLimit, 13, "core maxMessageLimit config"); Assert.deepEqual(core.config.featureOptIn, expectedCfg.featureOptIn, "core featureOptIn config"); } }); } } class ChannelPlugin implements IPlugin { public isFlushInvoked = false; public isTearDownInvoked = false; public isResumeInvoked = false; public isPauseInvoked = false; public identifier = "Sender"; public priority: number = 1001; constructor() { this.processTelemetry = this._processTelemetry.bind(this); } public pause(): void { this.isPauseInvoked = true; } public resume(): void { this.isResumeInvoked = true; } public teardown(): void { this.isTearDownInvoked = true; } flush(async?: boolean, callBack?: () => void): void { this.isFlushInvoked = true; if (callBack) { callBack(); } } public processTelemetry(env: ITelemetryItem) {} setNextPlugin(next: any) { // no next setup } public initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[]) { } private _processTelemetry(env: ITelemetryItem) { } } ================================================ FILE: extensions/applicationinsights-cfgsync-js/Tests/Unit/src/cfgsyncplugin.tests.ts ================================================ import { Assert, AITestClass, IFetchArgs, PollingAssert } from "@microsoft/ai-test-framework"; import { AppInsightsCore, FeatureOptInMode, IAppInsightsCore, IPlugin, ITelemetryItem, getGlobal, getGlobalInst } from "@microsoft/applicationinsights-core-js"; import { IConfiguration } from "@microsoft/applicationinsights-core-js"; import { CfgSyncPlugin } from "../../../../applicationinsights-cfgsync-js/src/applicationinsights-cfgsync-js"; import { ICfgSyncConfig, ICfgSyncMode, NonOverrideCfg } from "../../../src/Interfaces/ICfgSyncConfig"; import { DisabledPropertyName, IConfig } from "@microsoft/applicationinsights-core-js"; import { createSyncPromise } from "@nevware21/ts-async"; export class CfgSyncPluginTests extends AITestClass { private core: AppInsightsCore; private _config: IConfiguration & IConfig; private mainInst: CfgSyncPlugin; private identifier: string; private _channel: ChannelPlugin; private _context:any = {}; private _fetch; constructor(emulateIe?: boolean) { super("CfgSyncPluginTests", emulateIe); } public testInitialize() { let _self = this; _self.mainInst = new CfgSyncPlugin(); _self.identifier = _self.mainInst.identifier; _self._config = { instrumentationKey: "Test-iKey", disableInstrumentationKeyValidation: true, maxMessageLimit: 3000, enablePerfMgr: true, extensions: [_self.mainInst], extensionConfig: { [_self.identifier]: { syncMode: ICfgSyncMode.Broadcast } as ICfgSyncConfig } }; _self._channel = new ChannelPlugin(); _self.core = new AppInsightsCore(); this._fetch = getGlobalInst("fetch"); } public testCleanup() { this.mainInst.teardown(); this.core = null as any; this._config = null as any; this.mainInst = null as any; getGlobal().fetch = this._fetch; this._context = {}; } public registerTests() { this.testCase({ name: "CfgSyncPlugin: default config should be set dynamically from root", useFakeTimers: true, test: () => { let doc = getGlobal(); let patchEvnSpy = this.sandbox.spy(doc, "dispatchEvent"); this.onDone(() => { this.core.unload(false); }); this.core.initialize({instrumentationKey: "Test-iKey", extensions: [this.mainInst], extensionConfig: {[this.identifier]: {}}}, [this._channel]); let udfVal = undefined; let defaultNonOverrideCfg: NonOverrideCfg = {instrumentationKey: true, connectionString: true, endpointUrl: true } let expectedDefaults = { syncMode: ICfgSyncMode.Broadcast, customEvtName: udfVal, cfgUrl: udfVal, overrideSyncFn: udfVal, overrideFetchFn: udfVal, onCfgChangeReceive: udfVal, scheduleFetchTimeout: 1800000, nonOverrideConfigs: defaultNonOverrideCfg, blkCdnCfg: udfVal, enableAjax: false }; this.core.config.extensionConfig = this.core.config.extensionConfig || {}; let actualDefaults = this.core.config.extensionConfig[this.identifier]; Assert.deepEqual(expectedDefaults, actualDefaults, "default config should be set dynamically"); let targets = this.mainInst["_getDbgPlgTargets"](); Assert.equal(targets[0], true, "auto broadcast is on by default"); Assert.equal(targets[1], false, "receive changes is off by default"); Assert.equal(targets[2], "ai_cfgsync", "default event name is set by default"); Assert.equal(targets[3], false, "default blkCdnCfg is set by default"); Assert.equal(patchEvnSpy.callCount, 1, "event is dispatched for one time"); let curMainCfg = this.mainInst.getCfg(); Assert.deepEqual(curMainCfg, this.core.config, "main config should be set"); this.core.config.extensionConfig[this.identifier].customEvtName = "test"; this.clock.tick(1); targets = this.mainInst["_getDbgPlgTargets"](); Assert.equal(targets[2], "test", "default event name should be changed dynamically"); Assert.equal(patchEvnSpy.callCount, 2, "event dispatch should be called again"); curMainCfg = this.mainInst.getCfg(); Assert.deepEqual(curMainCfg, this.core.config, "main config should be set test1"); this.core.config.extensionConfig[this.identifier].syncMode = ICfgSyncMode.Receive; this.core.config.extensionConfig[this.identifier].receiveChanges = true; this.core.config.extensionConfig[this.identifier].blkCdnCfg = true; this.core.config.extensionConfig[this.identifier].nonOverrideConfigs = {}; this.clock.tick(1); targets = this.mainInst["_getDbgPlgTargets"](); Assert.equal(targets[0], true, "auto sync should not be changed to false dynamically"); Assert.equal(targets[1], false, "receive changes should not be changed dynamically"); Assert.equal(targets[3], true, "blkCdnCfg changes should be changed dynamically"); Assert.deepEqual(targets[4], defaultNonOverrideCfg, "nonOverrideCfg changes should not be changed dynamically"); Assert.equal(patchEvnSpy.callCount, 3, "event dispatch should be called again"); curMainCfg = this.mainInst.getCfg(); Assert.deepEqual(curMainCfg, this.core.config, "main config should be set test2"); } }); this.testCase({ name: "CfgSyncPlugin: override function configs from root", useFakeTimers: true, test: () => { this.onDone(() => { this.core.unload(false); }); let called = 0; let send = 0; let overrideSyncFn = (config?:IConfiguration & IConfig, customDetails?: any) => { called ++; return true; } let onCompleteCallback = (status: number, response?: string, isAutoSync?: boolean) => { return; }; let sendGetFunction = (url: string, oncomplete: any, isAutoSync?: boolean) => { send++; return; }; this.core.initialize({instrumentationKey: "Test-iKey", extensions: [this.mainInst], extensionConfig: {[this.identifier]: {overrideSyncFn: overrideSyncFn, overrideFetchFn: sendGetFunction} as ICfgSyncConfig}}, [this._channel]); this.core.config.extensionConfig = this.core.config.extensionConfig || {}; let actualsyncFn = this.core.config.extensionConfig[this.identifier].overrideSyncFn; let actualFetchFn = this.core.config.extensionConfig[this.identifier].overrideFetchFn; actualsyncFn(); Assert.equal(called, 1, "sync function should be replced"); actualFetchFn("test", onCompleteCallback); Assert.equal(send, 1, "fetch function should be replced"); } }); this.testCase({ name: "CfgSyncPlugin: eventListener should be set correctly to broadcast mode instacne", test: () => { let doc = getGlobal(); let patchEvnSpy = this.sandbox.spy(doc, "dispatchEvent"); let global = getGlobal(); let eventListenerStub = this.sandbox.spy(global, "addEventListener"); this.onDone(() => { this.core.unload(false); }); this.core.initialize(this._config, [this._channel]); let targets = this.mainInst["_getDbgPlgTargets"](); Assert.equal(targets[0], true, "auto broadcast is on by default"); Assert.equal(targets[1], false, "receive changes is on"); Assert.equal(targets[2], "ai_cfgsync", "default event name is set by default"); Assert.equal(patchEvnSpy.callCount, 1, "event is dispatched"); Assert.equal(eventListenerStub.callCount, 0, "event listener is not added to broadcase mode instance"); this.mainInst.updateEventListenerName("test"); targets = this.mainInst["_getDbgPlgTargets"](); Assert.equal(targets[2], "test", "event name should be changed"); Assert.equal(patchEvnSpy.callCount, 1, "event dispatch shoule not be called again"); Assert.equal(eventListenerStub.callCount, 0, "event listener is should not be added to broadcast mode instance again"); } }); this.testCase({ name: "CfgSyncPlugin: eventListener should be set correctly to receive mode instance", test: () => { let doc = getGlobal(); let patchEvnSpy = this.sandbox.spy(doc, "dispatchEvent"); let global = getGlobal(); let eventListenerStub = this.sandbox.spy(global, "addEventListener"); this.onDone(() => { this.core.unload(false); }); this._config.extensionConfig = this._config.extensionConfig || {}; this._config.extensionConfig[this.identifier].syncMode = ICfgSyncMode.Receive; this.core.initialize(this._config, [this._channel]); let targets = this.mainInst["_getDbgPlgTargets"](); Assert.equal(targets[0], false, "auto broadcast is off by default"); Assert.equal(targets[1], true, "receive changes is on"); Assert.equal(targets[2], "ai_cfgsync", "default event name is set by default"); Assert.equal(patchEvnSpy.callCount, 0, "no event should be dispatched"); Assert.equal(eventListenerStub.callCount, 1, "event listener is added to receive mode instance"); this.mainInst.updateEventListenerName("test"); targets = this.mainInst["_getDbgPlgTargets"](); Assert.equal(targets[2], "test", "event name should be changed"); Assert.equal(patchEvnSpy.callCount, 0, "event dispatch shoule not be called again"); Assert.equal(eventListenerStub.callCount, 2, "event listener is be added to receive modeinstance again"); } }); this.testCase({ name: "CfgSyncPlugin: eventListener should be set correctly to None mode instance", test: () => { let doc = getGlobal(); let patchEvnSpy = this.sandbox.spy(doc, "dispatchEvent"); let global = getGlobal(); let eventListenerStub = this.sandbox.spy(global, "addEventListener"); this.onDone(() => { this.core.unload(false); }); this._config.extensionConfig = this._config.extensionConfig || {}; this._config.extensionConfig[this.identifier].syncMode = ICfgSyncMode.None; this.core.initialize(this._config, [this._channel]); let targets = this.mainInst["_getDbgPlgTargets"](); Assert.equal(targets[0], false, "auto broadcast is off by default"); Assert.equal(targets[1], false, "receive changes is off"); Assert.equal(targets[2], "ai_cfgsync", "default event name is set by default"); Assert.equal(patchEvnSpy.callCount, 0, "no event should be dispatched"); Assert.equal(eventListenerStub.callCount, 0, "no event listener is added to none mode instance"); this.mainInst.updateEventListenerName("test"); targets = this.mainInst["_getDbgPlgTargets"](); Assert.equal(targets[2], "test", "event name should be changed"); Assert.equal(patchEvnSpy.callCount, 0, "event dispatch shoule not be called again"); Assert.equal(eventListenerStub.callCount, 0, "event listener should not be added to none mode instance again"); } }); this.testCaseAsync({ name: "CfgSyncPlugin: should fetch from config url", stepDelay: 10, useFakeTimers: true, steps: [ () => { let doc = getGlobal(); let config = { instrumentationKey:"testIkey", enableAjaxPerfTracking: true } as IConfiguration & IConfig; let cdnCfg = { enabled: true, config: config } as ICfgSyncConfig; let res = new (doc as any).Response(JSON.stringify(cdnCfg), { status: 200, headers: { "Content-type": "application/json" } }); this.onDone(() => { this.core.unload(false); }); hookFetch((resolve) => { AITestClass.orgSetTimeout(function() { resolve(res); }, 0); }); let patchEvnSpy = this.sandbox.spy(doc, "dispatchEvent"); let fetchStub = this.sandbox.spy((doc as any), "fetch"); this._config.extensionConfig = { [this.identifier]: { cfgUrl: "testURL" }}; this._context["patchEvnSpy"] = patchEvnSpy; this._context["fetchStub"] = fetchStub; this.core.initialize(this._config, [this._channel]); }].concat(PollingAssert.createPollingAssert(() => { let fetchStub = this._context["fetchStub"]; let patchEvnSpy = this._context["patchEvnSpy"]; let config = { //instrumentationKey:"testIkey", // should not be override enableAjaxPerfTracking: true } as IConfiguration & IConfig; if (fetchStub.called && patchEvnSpy.called) { Assert.ok(fetchStub.calledOnce, "fetch is called"); Assert.ok(patchEvnSpy.calledOnce, "patchEvnSpy is called"); let targets = this.mainInst["_getDbgPlgTargets"](); Assert.equal(targets[0], true, "auto broadcast is on by default"); Assert.equal(targets[1], false, "receive changes is off"); Assert.equal(targets[2], "ai_cfgsync", "default event name is set by default"); let curMainCfg = this.mainInst.getCfg(); Assert.deepEqual(curMainCfg, config, "main config should be get from url"); Assert.equal(patchEvnSpy.callCount, 1, "event should be dispatched"); Assert.equal(fetchStub.callCount, 1, "fetch is called"); return true; } return false; }, "response received", 60, 1000) as any) }); this.testCaseAsync({ name: "CfgSyncPlugin: should fetch call with disabledProperty when enableAjax is true", stepDelay: 10, useFakeTimers: true, steps: [ () => { let doc = getGlobal(); let config = { instrumentationKey:"testIkey", enableAjaxPerfTracking: true } as IConfiguration & IConfig; let cdnCfg = { enabled: true, config: config } as ICfgSyncConfig; let res = new (doc as any).Response(JSON.stringify(cdnCfg), { status: 200, headers: { "Content-type": "application/json" } }); this.onDone(() => { this.core.unload(false); }); hookFetch((resolve) => { AITestClass.orgSetTimeout(function() { resolve(res); }, 0); }); let fetchStub = this.sandbox.spy((doc as any), "fetch"); this._config.extensionConfig = { [this.identifier]: { cfgUrl: "testURL" }}; this._context["fetchStub"] = fetchStub; this.core.initialize(this._config, [this._channel]); }].concat(PollingAssert.createPollingAssert(() => { let fetchStub = this._context["fetchStub"]; if (fetchStub.called) { Assert.equal(fetchStub.callCount, 1, "fetch is called once"); let rlt = fetchStub.args[0][0][DisabledPropertyName]; Assert.equal(rlt, true, "disableProperty tag should be true") return true; } return false; }, "response received", 60, 1000) as any) }); this.testCaseAsync({ name: "CfgSyncPlugin: should fetch call without disabledProperty when enableAjax is false", stepDelay: 10, useFakeTimers: true, steps: [ () => { let doc = getGlobal(); let config = { instrumentationKey:"testIkey", enableAjaxPerfTracking: true } as IConfiguration & IConfig; let cdnCfg = { enabled: true, config: config } as ICfgSyncConfig; let res = new (doc as any).Response(JSON.stringify(cdnCfg), { status: 200, headers: { "Content-type": "application/json" } }); this.onDone(() => { this.core.unload(false); }); hookFetch((resolve) => { AITestClass.orgSetTimeout(function() { resolve(res); }, 0); }); let fetchStub = this.sandbox.spy((doc as any), "fetch"); this._config.extensionConfig = { [this.identifier]: { cfgUrl: "testURL", enableAjax: true }}; this._context["fetchStub"] = fetchStub; this.core.initialize(this._config, [this._channel]); }].concat(PollingAssert.createPollingAssert(() => { let fetchStub = this._context["fetchStub"]; if (fetchStub.called) { Assert.equal(fetchStub.callCount, 1, "fetch is called once"); let rlt = fetchStub.args[0][0][DisabledPropertyName]; Assert.equal(!!rlt, false, "disableProperty tag should be true") return true; } return false; }, "response received", 60, 1000) as any) }); this.testCaseAsync({ name: "CfgSyncPlugin: should fetch from config url at expected interval", stepDelay: 100, useFakeTimers: true, steps: [ () => { let doc = getGlobal(); let config = { instrumentationKey:"testIkey", enableAjaxPerfTracking: true } as IConfiguration & IConfig; let cdnCfg = { enabled: true, config: config } as ICfgSyncConfig; this.onDone(() => { this.core.unload(false); }); hookFetch((resolve) => { AITestClass.orgSetTimeout(function() { resolve(new (doc as any).Response(JSON.stringify(cdnCfg), { status: 200, headers: { "Content-type": "application/json" } })); }, 0); }); let patchEvnSpy = this.sandbox.spy(doc, "dispatchEvent"); let fetchStub = this.sandbox.spy((doc as any), "fetch"); this._config.extensionConfig = { [this.identifier]: { cfgUrl: "testURL", scheduleFetchTimeout: 1000 }}; this._context["patchEvnSpy"] = patchEvnSpy; this._context["fetchStub"] = fetchStub; this.core.initialize(this._config, [this._channel]); }].concat(PollingAssert.createPollingAssert(() => { let fetchStub = this._context["fetchStub"]; let patchEvnSpy = this._context["patchEvnSpy"]; let config = { //instrumentationKey:"testIkey", // should not be override enableAjaxPerfTracking: true } as IConfiguration & IConfig; if (fetchStub.called && patchEvnSpy.called) { Assert.ok(patchEvnSpy.calledOnce, "patchEvnSpy is called"); let targets = this.mainInst["_getDbgPlgTargets"](); Assert.equal(targets[0], true, "auto braodcast is on by default"); Assert.equal(targets[1], false, "receive changes is off"); Assert.equal(targets[2], "ai_cfgsync", "default event name is set by default"); let curMainCfg = this.mainInst.getCfg(); Assert.deepEqual(curMainCfg, config, "main config should be get from url"); Assert.equal(fetchStub.callCount, 2, "fetch is called 2 times"); Assert.equal(patchEvnSpy.callCount, 1, "event should be dispatched 1 time"); return true; } return false; }, "response received", 60, 1000) as any).concat(PollingAssert.createPollingAssert(() => { let fetchStub = this._context["fetchStub"]; let patchEvnSpy = this._context["patchEvnSpy"]; if (fetchStub.called && patchEvnSpy.called && fetchStub.callCount >= 3 && patchEvnSpy.callCount >= 3) { Assert.equal(fetchStub.callCount, 3, "fetch is called 3 times"); Assert.equal(patchEvnSpy.callCount, 3, "event should be dispatched 3 times"); return true; } return false; }, "response received", 60, 100) as any) }); this.testCaseAsync({ name: "CfgSyncPlugin: should not fetch from config url at when retry count > 2", stepDelay: 10, steps: [ () => { let doc = getGlobal(); this.onDone(() => { this.core.unload(false); }); hookFetch((resolve) => { AITestClass.orgSetTimeout(function() { resolve(new (doc as any).Response(JSON.stringify({}), { status: 400, headers: { "Content-type": "application/json" } })); }, 0); }); let patchEvnSpy = this.sandbox.spy(doc, "dispatchEvent"); let fetchStub = this.sandbox.spy((doc as any), "fetch"); this._config.extensionConfig = { [this.identifier]: { cfgUrl: "testURL", scheduleFetchTimeout: 1000 }}; this._context["patchEvnSpy"] = patchEvnSpy; this._context["fetchStub"] = fetchStub; this.core.initialize(this._config, [this._channel]); }].concat(PollingAssert.createPollingAssert(() => { let fetchStub = this._context["fetchStub"]; let patchEvnSpy = this._context["patchEvnSpy"]; if (fetchStub.called) { Assert.ok(!patchEvnSpy.calledOnce, "patchEvnSpy should not be called"); let targets = this.mainInst["_getDbgPlgTargets"](); Assert.equal(targets[0], true, "auto braodcast is on by default"); Assert.equal(targets[1], false, "receive changes is off"); Assert.equal(targets[2], "ai_cfgsync", "default event name is set by default"); let curMainCfg = this.mainInst.getCfg(); Assert.deepEqual(curMainCfg, null, "main config should not be set from url"); Assert.equal(fetchStub.callCount, 2, "fetch is called 2 times"); Assert.equal(patchEvnSpy.callCount, 0, "no event should be dispatched 1 time"); return true; } return false; }, "response received", 60, 1000) as any).concat(PollingAssert.createPollingAssert(() => { let fetchStub = this._context["fetchStub"]; let patchEvnSpy = this._context["patchEvnSpy"]; if (fetchStub.called) { Assert.equal(fetchStub.callCount, 2, "fetch should not be called 3 times"); Assert.equal(patchEvnSpy.callCount, 0, "event should not be dispatched again"); return true; } return false; }, "response received", 60, 100) as any) }); this.testCase({ name: "CfgSyncPlugin: main instance should change listeners config", useFakeTimers: true, test: () => { let listener = new CfgSyncPlugin(); let core = new AppInsightsCore(); let config = { instrumentationKey: "Test-iKey123", disableInstrumentationKeyValidation: false, maxMessageLimit: 3001, enablePerfMgr: false, extensions: [listener], extensionConfig: { [this.identifier]: { syncMode: ICfgSyncMode.Receive } } } let doc = getGlobal(); let patchEvnSpy = this.sandbox.spy(doc, "dispatchEvent"); let eventListenerStub = this.sandbox.spy(doc, "addEventListener"); this._config.extensionConfig = { [this.identifier]: {}}; this.onDone(() => { this.core.unload(false); core.unload(false); }); core.initialize(config, [this._channel]); this.core.initialize(this._config, [this._channel]); let targets = this.mainInst["_getDbgPlgTargets"](); Assert.equal(targets[0], true, "auto broadcast is on by default"); Assert.equal(targets[1], false, "receive changes is off"); Assert.equal(targets[2], "ai_cfgsync", "default event name is set by default"); Assert.equal(patchEvnSpy.callCount, 1, "event should be dispatched"); let curMainCfg = this.mainInst.getCfg(); Assert.deepEqual(curMainCfg, this.core.config, "main config should be set"); let listenerTargets = listener["_getDbgPlgTargets"](); Assert.equal(listenerTargets[0], false, "auto broadcast is off by default"); Assert.equal(listenerTargets[1], true, "receive changes is true"); Assert.equal(listenerTargets[2], "ai_cfgsync", "default event name is set by default"); Assert.equal(patchEvnSpy.callCount, 1, "event should not be dispatched"); Assert.equal(eventListenerStub.callCount, 1, "event listener is added"); let curListenerMainCfg = listener.getCfg(); Assert.deepEqual(curListenerMainCfg, core.config, "listener config should be set"); this.clock.tick(1); Assert.equal(core.config.instrumentationKey, "Test-iKey123", "config ikey should not be updated"); Assert.equal(core.config.maxMessageLimit, 3000, "config maxMessageLimit should be updated"); Assert.equal(core.config.enablePerfMgr, true, "config enablePerfMgr should be updated"); Assert.equal(this.core.config.instrumentationKey, "Test-iKey", "main inst config ikey should not be updated"); Assert.equal(this.core.config.maxMessageLimit, 3000, "main inst config maxMessageLimit should not be updated"); Assert.equal(this.core.config.enablePerfMgr, true, "main inst config enablePerfMgr should not be updated"); } }); this.testCaseAsync({ name: "CfgSyncPlugin: should not fetch when blkCdnCfg is set to true", stepDelay: 10, useFakeTimers: true, useFakeServer: true, steps: [ () => { let doc = getGlobal(); this.onDone(() => { this.core.unload(false); }); hookFetch((resolve) => { AITestClass.orgSetTimeout(function() { resolve(new (doc as any).Response(JSON.stringify({}), { status: 400, headers: { "Content-type": "application/json" } })); }, 0); }); let patchEvnSpy = this.sandbox.spy(doc, "dispatchEvent"); let fetchStub = this.sandbox.spy((doc as any), "fetch"); this._config.extensionConfig = { [this.identifier]: { cfgUrl: "testURL", scheduleFetchTimeout: 1000, blkCdnCfg: true }}; this._context["patchEvnSpy"] = patchEvnSpy; this._context["fetchStub"] = fetchStub; this.core.initialize(this._config, [this._channel]); }].concat(PollingAssert.createPollingAssert(() => { let fetchStub = this._context["fetchStub"]; let patchEvnSpy = this._context["patchEvnSpy"]; Assert.equal(fetchStub.callCount, 0, "fetch is should not be called"); Assert.equal(patchEvnSpy.callCount, 0, "no event should be dispatched 1 time"); if (fetchStub.called) { return false; } return true; }, "response received", 60, 1000) as any).concat(PollingAssert.createPollingAssert(() => { let fetchStub = this._context["fetchStub"]; let patchEvnSpy = this._context["patchEvnSpy"]; Assert.equal(fetchStub.callCount, 0, "fetch is should not be called"); Assert.equal(patchEvnSpy.callCount, 0, "no event should be dispatched 1 time"); if (fetchStub.called) { return false; } return true; }, "response received", 60, 100) as any) }); this.testCaseAsync({ name: "CfgSyncPlugin: Test with current cfgSync CDN v1", stepDelay: 10, useFakeTimers: true, useFakeServer: true, steps: [ () => { let doc = getGlobal(); this.onDone(() => { this.core.unload(false); }); let fetchStub = this.sandbox.spy((doc as any), "fetch"); this._config.featureOptIn = {["iKeyUsage"]: {mode: FeatureOptInMode.enable}, ["CdnUsage"]:{mode: FeatureOptInMode.disable}} this._config.throttleMgrCfg = { ["109"]: {disabled: true}, ["106"]: {disabled: true}, ["110"]: {disabled: true} } this._config.extensionConfig = { [this.identifier]: { syncMode: ICfgSyncMode.Receive, cfgUrl: "https://js.monitor.azure.com/scripts/b/ai.config.1.cfg.json", scheduleFetchTimeout: 10000 }}; this._context["fetchStub"] = fetchStub; this.core.initialize(this._config, [this._channel]); }].concat(PollingAssert.createPollingAssert(() => { let fetchStub = this._context["fetchStub"]; Assert.equal(fetchStub.callCount, 1, "fetch is should called once"); if (fetchStub.called) { return true; } return false; }, "wait for fetch response", 60, 100) as any).concat(PollingAssert.createPollingAssert(() => { let coreConfig = this.core.config as IConfig & IConfiguration; let featureOptIn = coreConfig.featureOptIn || {}; let throttleMgrConfig = coreConfig.throttleMgrCfg || {}; let ikeyOptIn = featureOptIn["iKeyUsage"]; let defaultIkey = throttleMgrConfig["109"]; let defaultEnabled = !defaultIkey.disabled; let onConfig = ikeyOptIn.onCfg; let offConfig = ikeyOptIn.onCfg; if (onConfig && offConfig && defaultEnabled) { let ikeyMsg = throttleMgrConfig["106"]; Assert.equal(ikeyMsg.disabled, false, "ikey msg should be enabled"); let otherMsg = throttleMgrConfig["110"]; Assert.equal(otherMsg.disabled, false, "other msg should be enabled"); let cdnOptIn = featureOptIn["CdnUsage"]; Assert.equal(cdnOptIn.mode, 3, "cdn feature optin should be enabled"); Assert.equal(ikeyOptIn.mode, 3, "ikey feature optin should be enabled"); return true; } return false; }, "wait for core config update", 60, 100) as any) }); this.testCaseAsync({ name: "CfgSyncPlugin: NonOverride values should not be changed Test with current cfgSync CDN v1", stepDelay: 10, useFakeTimers: true, useFakeServer: true, steps: [ () => { let doc = getGlobal(); this.onDone(() => { this.core.unload(false); }); let fetchStub = this.sandbox.spy((doc as any), "fetch"); this._config.throttleMgrCfg = {}; this._config.featureOptIn = {["iKeyUsage"]: {mode: FeatureOptInMode.enable}, ["CdnUsage"]:{mode: FeatureOptInMode.disable}} this._config.throttleMgrCfg = { ["109"]: {disabled: true}, ["106"]: {disabled: true}, ["110"]: {disabled: true} } this._config.extensionConfig = { [this.identifier]: { syncMode: ICfgSyncMode.Receive, cfgUrl: "https://js.monitor.azure.com/scripts/b/ai.config.1.cfg.json", scheduleFetchTimeout: 10000, nonOverrideConfigs: {throttleMgrCfg: true} } as ICfgSyncConfig}; this._context["fetchStub"] = fetchStub; this.core.initialize(this._config, [this._channel]); }].concat(PollingAssert.createPollingAssert(() => { let fetchStub = this._context["fetchStub"]; Assert.equal(fetchStub.callCount, 1, "fetch is should called once"); if (fetchStub.called) { return true; } return false; }, "wait for fetch response", 60, 100) as any).concat(PollingAssert.createPollingAssert(() => { let coreConfig = this.core.config as IConfig & IConfiguration; let featureOptIn = coreConfig.featureOptIn || {}; let throttleMgrConfig = coreConfig.throttleMgrCfg || {}; let ikeyOptIn = featureOptIn["iKeyUsage"]; let onConfig = ikeyOptIn.onCfg; let offConfig = ikeyOptIn.onCfg; if (onConfig && offConfig) { let defaultIkey = throttleMgrConfig["109"]; Assert.equal(defaultIkey.disabled, true, "ikey msg should be disbaled"); let ikeyMsg = throttleMgrConfig["106"]; Assert.equal(ikeyMsg.disabled, true, "ikey msg should be disabled"); let otherMsg = throttleMgrConfig["110"]; Assert.equal(otherMsg.disabled, true, "other msg should be disabled"); let cdnOptIn = featureOptIn["CdnUsage"]; Assert.equal(cdnOptIn.mode, 3, "cdn feature optin should be disabled"); Assert.equal(ikeyOptIn.mode, 3, "ikey feature optin should be enabled"); return true; } return false; }, "wait for core config update", 60, 100) as any) }); } } function hookFetch(executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): IFetchArgs[] { let calls:IFetchArgs[] = []; let global = getGlobal() as any; global.fetch = function(input: RequestInfo, init?: RequestInit) { calls.push({ input, init }); return createSyncPromise(executor); } return calls; } class ChannelPlugin implements IPlugin { public isFlushInvoked = false; public isTearDownInvoked = false; public isResumeInvoked = false; public isPauseInvoked = false; public identifier = "Sender"; public priority: number = 1001; constructor() { this.processTelemetry = this._processTelemetry.bind(this); } public pause(): void { this.isPauseInvoked = true; } public resume(): void { this.isResumeInvoked = true; } public teardown(): void { this.isTearDownInvoked = true; } flush(async?: boolean, callBack?: () => void): void { this.isFlushInvoked = true; if (callBack) { callBack(); } } public processTelemetry(env: ITelemetryItem) {} setNextPlugin(next: any) { // no next setup } public initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[]) { } private _processTelemetry(env: ITelemetryItem) { } } ================================================ FILE: extensions/applicationinsights-cfgsync-js/Tests/UnitTests.html ================================================  Tests for Application Insights JavaScript Idsync Plugin
          ================================================ FILE: extensions/applicationinsights-cfgsync-js/Tests/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": false, "module": "amd", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "declaration": true }, "files": [] } ================================================ FILE: extensions/applicationinsights-cfgsync-js/api-extractor.json ================================================ /** * Config file for API Extractor. For more info, please visit: https://api-extractor.com */ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", /** * Optionally specifies another JSON config file that this file extends from. This provides a way for * standard settings to be shared across multiple projects. * * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be * resolved using NodeJS require(). * * SUPPORTED TOKENS: none * DEFAULT VALUE: "" */ // "extends": "./shared/api-extractor-base.json" // "extends": "my-package/include/api-extractor-base.json" /** * Determines the "" token that can be used with other config file settings. The project folder * typically contains the tsconfig.json and package.json config files, but the path is user-defined. * * The path is resolved relative to the folder of the config file that contains the setting. * * The default value for "projectFolder" is the token "", which means the folder is determined by traversing * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error * will be reported. * * SUPPORTED TOKENS: * DEFAULT VALUE: "" */ "projectFolder": ".", /** * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor * analyzes the symbols exported by this module. * * The file extension must be ".d.ts" and not ".ts". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , */ "mainEntryPointFilePath": "/build/types/applicationinsights-cfgsync-js.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. * * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly * imports library2. To avoid this, we can specify: * * "bundledPackages": [ "library2" ], * * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been * local files for library1. */ "bundledPackages": [ ], /** * Determines how the TypeScript compiler engine will be invoked by API Extractor. */ "compiler": { /** * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * Note: This setting will be ignored if "overrideTsconfig" is used. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/tsconfig.json" */ // "tsconfigFilePath": "/tsconfig.json", /** * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. * The object must conform to the TypeScript tsconfig schema: * * http://json.schemastore.org/tsconfig * * If omitted, then the tsconfig.json file will be read from the "projectFolder". * * DEFAULT VALUE: no overrideTsconfig section */ // "overrideTsconfig": { // . . . // } /** * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. * * DEFAULT VALUE: false */ // "skipLibCheck": true, }, /** * Configures how the API report file (*.api.md) will be generated. */ "apiReport": { /** * (REQUIRED) Whether to generate an API report. */ "enabled": true, /** * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce * a full file path. * * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". * * SUPPORTED TOKENS: , * DEFAULT VALUE: ".api.md" */ "reportFileName": ".api.md", /** * Specifies the folder where the API report file is written. The file name portion is determined by * the "reportFileName" setting. * * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, * e.g. for an API review. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/etc/" */ "reportFolder": "/build/dts/", /** * Specifies the folder where the temporary report file is written. The file name portion is determined by * the "reportFileName" setting. * * After the temporary file is written to disk, it is compared with the file in the "reportFolder". * If they are different, a production build will fail. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/" */ // "reportTempFolder": "/temp/" }, /** * Configures how the doc model file (*.api.json) will be generated. */ "docModel": { /** * (REQUIRED) Whether to generate a doc model file. */ "enabled": true, /** * The output path for the doc model file. The file extension should be ".api.json". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/.api.json" */ "apiJsonFilePath": "/build/dts/.api.json" }, /** * Configures how the .d.ts rollup file will be generated. */ "dtsRollup": { /** * (REQUIRED) Whether to generate the .d.ts rollup file. */ "enabled": true, /** * Specifies the output path for a .d.ts rollup file to be generated without any trimming. * This file will include all declarations that are exported by the main entry point. * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/dist/.d.ts" */ "untrimmedFilePath": "/build/dts/.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. * This file will include only declarations that are marked as "@public" or "@beta". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "betaTrimmedFilePath": "/build/dts/-beta.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. * This file will include only declarations that are marked as "@public". * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "publicTrimmedFilePath": "/build/dts/-public.d.ts", /** * When a declaration is trimmed, by default it will be replaced by a code comment such as * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the * declaration completely. * * DEFAULT VALUE: false */ // "omitTrimmingComments": true }, /** * Configures how the tsdoc-metadata.json file will be generated. */ "tsdocMetadata": { /** * Whether to generate the tsdoc-metadata.json file. * * DEFAULT VALUE: true */ "enabled": false, /** * Specifies where the TSDoc metadata file should be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup * falls back to "tsdoc-metadata.json" in the package folder. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ "tsdocMetadataFilePath": "/build/dts/tsdoc-metadata.json" }, /** * Configures how API Extractor reports error and warning messages produced during analysis. * * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. */ "messages": { /** * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing * the input .d.ts files. * * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "compilerMessageReporting": { /** * Configures the default routing for messages that don't match an explicit rule in this table. */ "default": { /** * Specifies whether the message should be written to the the tool's output log. Note that * the "addToApiReportFile" property may supersede this option. * * Possible values: "error", "warning", "none" * * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes * the "--local" option), the warning is displayed but the build will not fail. * * DEFAULT VALUE: "warning" */ "logLevel": "warning", /** * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), * then the message will be written inside that file; otherwise, the message is instead logged according to * the "logLevel" option. * * DEFAULT VALUE: false */ // "addToApiReportFile": false }, // "TS2551": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . }, /** * Configures handling of messages reported by API Extractor during its analysis. * * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" * * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings */ "extractorMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false }, "ae-missing-release-tag": { "logLevel": "none" }, // // . . . }, /** * Configures handling of messages reported by the TSDoc parser when analyzing code comments. * * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "tsdocMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false } // "tsdoc-link-tag-unescaped-text": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . } } } ================================================ FILE: extensions/applicationinsights-cfgsync-js/package.json ================================================ { "name": "@microsoft/applicationinsights-cfgsync-js", "version": "3.4.1", "description": "Microsoft Application Insights CfgSync Plugin", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "author": "Microsoft Application Insights Team", "main": "dist/es5/applicationinsights-cfgsync-js.js", "module": "dist-es5/applicationinsights-cfgsync-js.js", "types": "types/applicationinsights-cfgsync-js.d.ts", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/extensions/applicationinsights-cfgsync-js" }, "scripts": { "build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen", "build:esm": "grunt cfgsync", "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs", "rebuild": "npm run build", "test": "grunt cfgsynctests", "mintest": "grunt cfgsync-mintests", "lint": "tslint -p tsconfig.json", "dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights idsync plugin\"", "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js", "ai-min": "grunt cfgsync-min", "ai-restore": "grunt cfgsync-restore", "npm-pack": "npm pack", "api-docs": "typedoc" }, "devDependencies": { "@microsoft/ai-test-framework": "0.0.1", "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es5": "1.0.2", "@microsoft/api-extractor": "^7.40.0", "typescript": "^4.9.3", "tslib": "^2.0.0", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "@nevware21/grunt-ts-plugin": "^0.5.2", "@nevware21/grunt-eslint-ts": "^0.5.2", "globby": "^11.0.0", "magic-string": "^0.25.7", "pako": "^2.0.3", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "rollup": "^3.20.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-sourcemaps": "^0.6.3", "typedoc": "^0.26.6", "qunit": "^2.11.2", "sinon": "^7.3.1" }, "peerDependencies": { "tslib": ">= 1.0.0" }, "dependencies": { "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/applicationinsights-core-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x", "@nevware21/ts-async": ">= 0.5.5 < 2.x" }, "license": "MIT" } ================================================ FILE: extensions/applicationinsights-cfgsync-js/rollup.config.js ================================================ import { createConfig } from "../../rollup.base.config"; import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const browserEntryPointName = "applicationinsights-cfgsync-js"; const browserOutputName = "ai.cfgsync"; const entryPointName = "applicationinsights-cfgsync-js"; const outputName = "applicationinsights-cfgsync-js"; const banner = [ "/*!", ` * Application Insights JavaScript SDK - Properties Plugin, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the MIT License.": "" }; updateDistEsmFiles(replaceValues, banner, true, true, "dist-es5"); export default createConfig(banner, { namespace: "Microsoft.ApplicationInsights", version: version, node: { entryPoint: entryPointName, outputName: outputName }, browser: { entryPoint: browserEntryPointName, outputName: browserOutputName } }, [ outputName ]); ================================================ FILE: extensions/applicationinsights-cfgsync-js/src/CfgSyncHelperFuncs.ts ================================================ import { CdnFeatureMode, FeatureOptInMode, IAppInsightsCore, IConfig, IConfiguration, IFeatureOptIn } from "@microsoft/applicationinsights-core-js"; import { isNullOrUndefined, isObject, objExtend, objForEachKey, setValueByKey } from "@nevware21/ts-utils"; import { ICfgSyncCdnConfig } from "./Interfaces/ICfgSyncCdnConfig"; import { NonOverrideCfg } from "./Interfaces/ICfgSyncConfig"; /** * Delete a config key in the given cfg, if the config key exists in nonOverrideConfigs and its value is set to true * @param cfg - cfg to modify * @param nonOverrideConfigs - nonOverrideConfigs * @param curLevel - cur config level, starting at 0 * @param maxLevel - max config level * @returns new copy of modified configs */ export function replaceByNonOverrideCfg(cfg: T , nonOverrideConfigs: T1, curLevel: number, maxLevel: number): T { try { let exceedMaxLevel = curLevel > maxLevel; if (exceedMaxLevel) { cfg = null; } let curCfg = curLevel == 0? objExtend({}, cfg): cfg; // only copy cfg at the begining level if (curCfg && nonOverrideConfigs && !exceedMaxLevel) { objForEachKey(curCfg, (key) => { let nonOverrideVal = nonOverrideConfigs[key]; if (!!nonOverrideVal) { if (isObject(curCfg[key]) && isObject(nonOverrideVal)) { curCfg[key] = replaceByNonOverrideCfg(curCfg[key], nonOverrideVal, ++curLevel, maxLevel); } else { delete curCfg[key]; } } }); } return curCfg; } catch(e) { // eslint-disable-next-line no-empty } // if errors happen, do nothing return cfg; } // CDN Mode, value = B (CDN value = B) // |--------------------------------------------------------------------------|-----------| // | | none | disabled | enabled | forceOn | forceOff | // | ------------------ | ----------- | ----------- | ----------- | --------- | --------- | // | User Mode, value = A | none | none | disabled | enabled | enabled | disabled | // (user Value = A) | disabled | disabled | disabled | disabled | enabled | disabled | // | enabled | enabled | disabled | enabled | enabled | disabled | // | none(blockCdn) | none | none | none | none | none | // | disabled(blockCdn) | disabled | disabled | disabled | disabled | disabled | // | enabled(blockCdn) | enabled | enabled | enabled | enabled | enabled | // This matrix identifies how feature based overrides are selected (if present) // cdn Mode (cdn Value = B) // |---------------------------------------------------------------------------| // | | none | disabled | enabled | forceOn | forceOff | // | ------------------ | ---------| ---------| ---------| ---------|----------| // | User Mode | none | A | A | A || B | B || A | B || A | // (user Value = A) | disabled | A | A | A | B || A | B || A | // | enabled | A | A | A || B | B || A | B || A | // | none(blockCdn) | A | A | A | A | A | // | disabled(blockCdn) | A | A | A | A | A | // | enabled(blockCdn) | A | A | A | A | A | // Note: // Where the "value" is an object (map) of encoded key/values which will be used to override the real configuration // A = either the user supplied enable/disable value (via the `config.featureOptIn[name]`) or if not defined by the user the SDK defaults of the same. // B = The enable/disable value obtained from the CDN for the named feature // These are evaluated based on the above matrix to either // - A (Always the user/sdk value) // - B (Always the value from the CDN) // - A || B (If A is null or undefined use the value from the CDN (B) otherwise A) // - B || A (If B is null or undefined use the user/SDK value otherwise use the value from the CDN) // // The result of the value may also be null / undefined, which means there are no overrides to apply when the feature is enabled const F = "featureOptIn."; const M = ".mode"; const ON = ".onCfg"; const OFF = ".offCfg"; export function resolveCdnFeatureCfg(field: string, cdnCfg?: ICfgSyncCdnConfig, userOptInDetails?: IFeatureOptIn) { // cdn conifg value if (!cdnCfg || !cdnCfg.enabled) { return null; } let cdnFt = (cdnCfg.featureOptIn || {})[field] || {mode: CdnFeatureMode.none}; let cdnM = cdnFt.mode; let cdnOnV = cdnFt.onCfg; let cdnOffV = cdnFt.offCfg; let userFt = (userOptInDetails || {})[field] || {mode: FeatureOptInMode.disable}; // default user mode is disable let userM = userFt.mode; let userOnV= userFt.onCfg; let userOffV= userFt.offCfg; let blockCdn = !!userFt.blockCdnCfg; let mFld = F + field + M; let onFld = F + field + ON; let offFld = F + field + OFF; let mode = userM; let onV = userOnV; let offV = userOffV; if (!blockCdn) { if (cdnM === CdnFeatureMode.forceOn || cdnM === CdnFeatureMode.forceOff) { mode = (cdnM == CdnFeatureMode.forceOn? FeatureOptInMode.enable : FeatureOptInMode.disable); onV = cdnOnV || userOnV; offV = cdnOffV || userOffV; } else if (cdnM === CdnFeatureMode.disable || userM === FeatureOptInMode.disable) { mode = FeatureOptInMode.disable; onV = userOnV || cdnOnV; offV = userOffV || cdnOffV; } else if (cdnM === CdnFeatureMode.enable) { mode = FeatureOptInMode.enable; onV = userOnV || cdnOnV; offV = userOffV || cdnOffV; } else if (cdnM === CdnFeatureMode.none && userM === FeatureOptInMode.none) { mode = FeatureOptInMode.none; } } return { [mFld]: mode, [onFld]: onV, [offFld]: offV }; } // helper function to get cdn config with opt-in features export function applyCdnfeatureCfg(cdnCfg: ICfgSyncCdnConfig, core: IAppInsightsCore) { try { if (!cdnCfg || !cdnCfg.enabled) { return null; } if (!cdnCfg.featureOptIn) { return cdnCfg.config; } let optInMap = cdnCfg.featureOptIn; let cdnConfig = cdnCfg.config || {}; objForEachKey(optInMap, (key) => { let featureVal = resolveCdnFeatureCfg(key, cdnCfg, core.config.featureOptIn); if (!isNullOrUndefined(featureVal)) { objForEachKey(featureVal, (config, val) => { setValueByKey(cdnConfig, config, val); }); _overrideCdnCfgByFeature(key, featureVal, cdnConfig); } }); return cdnConfig; } catch (e) { // eslint-disable-next-line no-empty } return null; } function _overrideCdnCfgByFeature(field: string, ftVal: any, config: IConfiguration & IConfig) { let mode = ftVal[F + field + M]; let val = ftVal[F + field + ON]; let dVal= ftVal[F + field + OFF]; let target = null; if (mode === FeatureOptInMode.enable) { target = val; } if (mode === FeatureOptInMode.disable) { target = dVal; } if (target) { objForEachKey(target, (key, cfg) => { setValueByKey(config, key, cfg); }); } } ================================================ FILE: extensions/applicationinsights-cfgsync-js/src/CfgSyncPlugin.ts ================================================ /** * CfgSyncPlugin.ts * @copyright Microsoft 2018 */ import dynamicProto from "@microsoft/dynamicproto-js"; import { BaseTelemetryPlugin, DisabledPropertyName, IAppInsightsCore, IConfig, IConfigDefaults, IConfiguration, IPlugin, IProcessTelemetryContext, IProcessTelemetryUnloadContext, ITelemetryItem, ITelemetryPluginChain, ITelemetryUnloadState, createProcessTelemetryContext, createUniqueNamespace, eventOff, eventOn, getGlobal, getJSON, isFetchSupported, isXhrSupported, mergeEvtNamespace, onConfigChange, sendCustomEvent } from "@microsoft/applicationinsights-core-js"; import { doAwaitResponse } from "@nevware21/ts-async"; import { ITimerHandler, isFunction, isNullOrUndefined, isPlainObject, objDeepFreeze, scheduleTimeout } from "@nevware21/ts-utils"; import { applyCdnfeatureCfg, replaceByNonOverrideCfg } from "./CfgSyncHelperFuncs"; import { ICfgSyncConfig, ICfgSyncEvent, ICfgSyncMode, NonOverrideCfg, OnCompleteCallback, SendGetFunction } from "./Interfaces/ICfgSyncConfig"; import { ICfgSyncPlugin } from "./Interfaces/ICfgSyncPlugin"; const EVENT_NAME = "ai_cfgsync"; const STR_GET_METHOD = "GET"; const FETCH_TIMEOUT = 1800000; // 30 minutes const udfVal: undefined = undefined; let defaultNonOverrideCfg: NonOverrideCfg = {instrumentationKey: true, connectionString: true, endpointUrl: true } const _defaultConfig: IConfigDefaults = objDeepFreeze({ syncMode: ICfgSyncMode.Broadcast, blkCdnCfg: udfVal, customEvtName: udfVal, cfgUrl: udfVal, overrideSyncFn: udfVal, overrideFetchFn: udfVal, onCfgChangeReceive: udfVal, scheduleFetchTimeout: FETCH_TIMEOUT, nonOverrideConfigs: defaultNonOverrideCfg, enableAjax: false }); export class CfgSyncPlugin extends BaseTelemetryPlugin implements ICfgSyncPlugin { public priority = 198; public identifier = "AppInsightsCfgSyncPlugin"; constructor() { super(); let _extensionConfig: ICfgSyncConfig; let _mainConfig: IConfiguration & IConfig; // throttle config should be wrapped in IConfiguration let _evtName: string; let _evtNamespace: string | string[]; let _cfgUrl: string; let _timeoutHandle: ITimerHandler; let _receiveChanges: boolean; let _broadcastChanges: boolean; let _blkCdnCfg: boolean; let _fetchTimeout: number; let _retryCnt: number; let _onCfgChangeReceive: (event: ICfgSyncEvent) => void; let _nonOverrideConfigs: NonOverrideCfg; let _fetchFn: SendGetFunction; let _overrideFetchFn: SendGetFunction; let _overrideSyncFn: (config?:IConfiguration & IConfig, customDetails?: any) => boolean; let _paused = false; let _enableAjax: boolean; dynamicProto(CfgSyncPlugin, this, (_self, _base) => { _initDefaults(); _self.initialize = (config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?:ITelemetryPluginChain) => { _base.initialize(config, core, extensions, pluginChain); _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace()); _populateDefaults(config); }; _self.getCfg = () => { return _mainConfig; } _self.pause = () => { _paused = true; _clearScheduledTimer(); } _self.resume = () => { _paused = false; _setupTimer(); } // used for V2 to manaully trigger config udpate _self.setCfg = (config?: IConfiguration & IConfig) => { return _setCfg(config); } _self.sync = (customDetails?: any) => { return _sendCfgsyncEvents(customDetails); } _self.updateEventListenerName = (eventName?: string) => { return _updateEventListenerName(eventName); } _self._doTeardown = (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => { _eventOff(); _clearScheduledTimer(); _initDefaults(); }; _self["_getDbgPlgTargets"] = () => { return [_broadcastChanges, _receiveChanges, _evtName, _blkCdnCfg, _nonOverrideConfigs]; }; function _initDefaults() { _mainConfig = null; _evtName = null; _evtNamespace = null; _cfgUrl = null; _receiveChanges = null; _broadcastChanges = null; _nonOverrideConfigs = null; _timeoutHandle = null; _fetchTimeout = null; _retryCnt = null; _blkCdnCfg = null; _enableAjax = false; _overrideFetchFn = null; _overrideSyncFn = null; _onCfgChangeReceive = null; } function _populateDefaults(config: IConfiguration) { let identifier = _self.identifier; let core = _self.core; _self._addHook(onConfigChange(config, () => { let ctx = createProcessTelemetryContext(null, config, core); _extensionConfig = ctx.getExtCfg(identifier, _defaultConfig); let preBlkCdn = _blkCdnCfg; _blkCdnCfg = !!_extensionConfig.blkCdnCfg; _enableAjax = !!_extensionConfig.enableAjax; // avoid initial call if (!isNullOrUndefined(preBlkCdn) && preBlkCdn !== _blkCdnCfg) { if (!_blkCdnCfg && _cfgUrl) { _fetchFn && _fetchFn(_cfgUrl, _onFetchComplete, _broadcastChanges); } else { _clearScheduledTimer(); } } if (isNullOrUndefined(_receiveChanges)) { _receiveChanges = _extensionConfig.syncMode === ICfgSyncMode.Receive; } if (isNullOrUndefined(_broadcastChanges)) { _broadcastChanges = _extensionConfig.syncMode === ICfgSyncMode.Broadcast; } let newEvtName = _extensionConfig.customEvtName || EVENT_NAME; if (_evtName !== newEvtName) { if (_receiveChanges) { _updateEventListenerName(newEvtName); } else { _eventOff(); _evtName = newEvtName; } } if (isNullOrUndefined(_cfgUrl)) { _cfgUrl = _extensionConfig.cfgUrl; } // if cfgUrl is set, we will ignore core config change if (!_cfgUrl) { _mainConfig = config; if (_broadcastChanges) { _sendCfgsyncEvents(); } } })); _overrideSyncFn = _extensionConfig.overrideSyncFn; _overrideFetchFn = _extensionConfig.overrideFetchFn; _onCfgChangeReceive = _extensionConfig.onCfgChangeReceive; _nonOverrideConfigs = _extensionConfig.nonOverrideConfigs; // override values should not be changed _fetchTimeout = _extensionConfig.scheduleFetchTimeout; _fetchFn = _getFetchFnInterface(); _retryCnt = 0; // NOT support cfgURL change to avoid mutiple fetch calls if (_cfgUrl && !_blkCdnCfg) { _fetchFn && _fetchFn(_cfgUrl, _onFetchComplete, _broadcastChanges); } } function _setCfg(config?: IConfiguration & IConfig, isAutoSync?: boolean) { if (config) { _mainConfig = config; if (!!isAutoSync && !_paused) { return _sendCfgsyncEvents(); } if (_receiveChanges && !_paused) { _self.core.updateCfg(config); return true; } } return false; } function _eventOff() { try { let global = getGlobal(); if (global) { eventOff(global, null, null, _evtNamespace); } } catch (e) { // eslint-disable-next-line no-empty } } function _sendCfgsyncEvents(customDetails?: any) { try { if (!!_overrideSyncFn && isFunction(_overrideSyncFn)) { return _overrideSyncFn(_mainConfig, customDetails); } return sendCustomEvent(_evtName, _mainConfig, customDetails); } catch (e) { // eslint-disable-next-line no-empty } return false; } function _updateEventListenerName(name?: string) { try { _eventOff(); if (name) { _evtName = name; _addEventListener(); } return true; } catch (e) { // eslint-disable-next-line no-empty } return false; } function _getFetchFnInterface() { let _fetchFn = _overrideFetchFn; if (isNullOrUndefined(_fetchFn)) { if (isFetchSupported()) { _fetchFn = _fetchSender; } else if (isXhrSupported()) { _fetchFn = _xhrSender; } } return _fetchFn; } function _fetchSender(url: string, oncomplete: OnCompleteCallback, isAutoSync?: boolean) { let global = getGlobal(); let fetchFn = (global && global.fetch) || null; if (url && fetchFn && isFunction(fetchFn)) { try { const init: RequestInit = { method: STR_GET_METHOD }; if (!_enableAjax) { init[DisabledPropertyName] = true; } const request = new Request(url, init); if (!_enableAjax) { try { // Also try and tag the request (just in case the value in init is not copied over) request[DisabledPropertyName] = true; } catch(e) { // If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would // cause the request to fail and we no telemetry would be sent } } doAwaitResponse(fetch(request), (result) => { let response = result.value; if (!result.rejected) { if (response.ok) { doAwaitResponse(response.text(), (res) => { _doOnComplete(oncomplete, response.status, res.value, isAutoSync); }); } else { _doOnComplete(oncomplete, response.status, null, isAutoSync); } } else { _doOnComplete(oncomplete, 400); } }); } catch (e) { // eslint-disable-next-line no-empty } } } function _xhrSender(url: string, oncomplete: OnCompleteCallback, isAutoSync?: boolean) { try { let xhr = new XMLHttpRequest(); if (!_enableAjax) { xhr[DisabledPropertyName] = true; } xhr.open(STR_GET_METHOD, url); xhr.onreadystatechange = () => { if (xhr.readyState === XMLHttpRequest.DONE) { _doOnComplete(oncomplete, xhr.status, xhr.responseText, isAutoSync); } }; xhr.onerror = () => { _doOnComplete(oncomplete, 400); }; xhr.ontimeout = () => { _doOnComplete(oncomplete, 400); }; xhr.send(); } catch (e) { // eslint-disable-next-line no-empty } } function _onFetchComplete(status: number, response?: string, isAutoSync?: boolean) { try { if (status >= 200 && status < 400 && response) { _retryCnt = 0; // any successful response will reset retry count to 0 let JSON = getJSON(); if (JSON) { let cdnCfg = JSON.parse(response); //comments are not allowed let cfg = applyCdnfeatureCfg(cdnCfg, _self.core); let newCfg = cfg && isPlainObject(cfg) && _replaceTartgetByKeys(cfg); newCfg && _setCfg(newCfg, isAutoSync); //cfg && _setCfg(cfg, isAutoSync); } } else { _retryCnt ++; } if (_retryCnt < 3) { _setupTimer(); } } catch (e) { // eslint-disable-next-line no-empty } } function _doOnComplete(oncomplete: OnCompleteCallback, status: number, response?: string, isAutoSync?: boolean) { try { oncomplete(status, response, isAutoSync); } catch (e) { // eslint-disable-next-line no-empty } } function _addEventListener() { if (_receiveChanges) { let global = getGlobal(); if (global) { try { eventOn(global, _evtName, (event: any) => { // TODO: add more validation here // may include a "name" or some other features to check let cfgEvent = event && (event as any).detail; if (_onCfgChangeReceive && cfgEvent) { _onCfgChangeReceive(cfgEvent); } else { let cfg = cfgEvent && cfgEvent.cfg; let newCfg = cfg && isPlainObject(cfg) && _replaceTartgetByKeys(cfg); newCfg && _setCfg(newCfg); } }, _evtNamespace, true); } catch(e) { // eslint-disable-next-line no-empty } } } } // 4 levels function _replaceTartgetByKeys(cfg: T , level?: number) { let _cfg: IConfiguration & IConfig = null; try { if (cfg) { _cfg = replaceByNonOverrideCfg(cfg, _nonOverrideConfigs, 0, 5); } } catch(e) { // eslint-disable-next-line no-empty } return _cfg; } /** * Sets up the timer which triggers fetching cdn every 30mins after inital call */ function _setupTimer() { if (!_timeoutHandle && _fetchTimeout) { _timeoutHandle = scheduleTimeout(() => { _timeoutHandle = null; _fetchFn(_cfgUrl, _onFetchComplete, _broadcastChanges); }, _fetchTimeout); _timeoutHandle.unref(); } } function _clearScheduledTimer() { _timeoutHandle && _timeoutHandle.cancel(); _timeoutHandle = null; _retryCnt = 0; } _self.processTelemetry = (env: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => { _self.processNext(env, itemCtx); }; }); } public initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?:ITelemetryPluginChain) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Get current configs of current instance. * @param config - current configs */ public getCfg(): IConfiguration & IConfig { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Manually set configs of current instance. * @param config - new configs */ public setCfg(config?: IConfiguration & IConfig): boolean { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Manually broadcast configs of current instance to all other instances. * @param customDetails - additional details should also be sent out to other instances */ public sync(customDetails?: any): boolean { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Manually update event name. * If current instance is the main instance, then following config changes will be sent out under this new event name. * If current instance is listener instances, it will listen to event details under this new name. * @param eventName - new event name */ public updateEventListenerName(eventName?: string): boolean { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } /** * Pause the sending/receiving of events */ public pause(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Resume the sending/receiving of events */ public resume(): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } // /** // * Add Part A fields to the event // * @param event - The event that needs to be processed // */ public processTelemetry(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } } ================================================ FILE: extensions/applicationinsights-cfgsync-js/src/Interfaces/ICfgSyncCdnConfig.ts ================================================ import { CdnFeatureMode, IConfiguration } from "@microsoft/applicationinsights-core-js"; export interface ICfgSyncCdnConfig { /** * Identifies whether cfgSync plugin should be enabled or not * @default false */ enabled?: boolean; /** * Identifies if the feature should be opt-in or disabled and sets configuration values * @default undefined */ featureOptIn?: {[field: string]: ICdnFeatureOptIn}; /** * Identifies IConfiguration that will be used for IConfigSync Plugin, especially throttleMgr Config * @default undefined */ config?: IConfiguration; /** * Identifies fields of IConfiguration should be overridden (not in use currently) * only override for opt-in instances when enabled is set to true * NOTE: should use flat string for fields, for example, if you want to use extensionConfig.Ananlytics.disableAjaxTrackig as one opt-in field, * you should use "extensionConfig.Ananlytics.disableAjaxTrackig" as field name * TODO: add implementations on this config * @example overrides:{"endpointUrl":{"endpoint1":"endpoint2", "endpoint3":"endpoint4"}, "extensionConfig.Analytics.disableAjaxTrackig":{"true": false}} * @default undefined */ overrides?: {[field: string]: {[value: string]: any}}; } export interface ICdnFeatureOptIn { /** * Identifies current cdn opt in mode */ mode: CdnFeatureMode, /** * Identifies override configuration values when given feature is enabled * NOTE: should use flat string for fields, for example, if you want to set value for extensionConfig.Ananlytics.disableAjaxTrackig in configurations, * you should use "extensionConfig.Ananlytics.disableAjaxTrackig" as field name: {["extensionConfig.Analytics.disableAjaxTrackig"]:1} * Default: undefined */ onCfg?: {[field: string]: any}; /** * Identifies override configuration values when given feature is disabled * NOTE: should use flat string for fields, for example, if you want to set value for extensionConfig.Ananlytics.disableAjaxTrackig in configurations, * you should use "extensionConfig.Ananlytics.disableAjaxTrackig" as field name: {["extensionConfig.Analytics.disableAjaxTrackig"]:1} * Default: undefined */ offCfg?: {[field: string]: any}; } ================================================ FILE: extensions/applicationinsights-cfgsync-js/src/Interfaces/ICfgSyncConfig.ts ================================================ import { IConfig, IConfiguration } from "@microsoft/applicationinsights-core-js"; export interface ICfgSyncConfig { /** * Identifies whether instance should receive or broadcast config changes * @default Broadcast */ syncMode?: ICfgSyncMode; /** * Event name for sending or listening to configuration change details * @default ai_cfgsync */ customEvtName?: string; /** * CDN endpoint for fetching configuration. If cfgUrl is defined, instance will NOT listen to core configuration changes. * @default null */ cfgUrl?: string; /** * Determines if fetching the CDN endpoint should be blocked or not. * @default false */ blkCdnCfg?: boolean; /** * Overrides callback function to handle event details when changes are received via event listener. * @default null */ onCfgChangeReceive?: (event?: ICfgSyncEvent) => void; /** * Overrides sync() function to broadcast changes. * @default null */ overrideSyncFn?: (config?:IConfiguration & IConfig, customDetails?: any) => boolean; /** * Overrides fetch function to get config from cfgUrl when cfgUrl is defined. * @default null */ overrideFetchFn?: SendGetFunction; /** * When current instance is set with syncMode: `Receive`, config fields under nonOverrideConfigs will NOT be changed by any config details sent out from other instances. * NOTE: this config will be ONLY applied during initialization, so it won't be changed dynamically * @default \{instrumentationKey:true,connectionString:true,endpointUrl:true\} */ nonOverrideConfigs?: NonOverrideCfg; /** * Identifies the time interval (in milliseconds) for fetching config details from cfgUrl when cfgUrl is defined. * Default to 30 mins, 30*60*1000ms. * If set to 0, the fetch operation will only be called once during initialization. * @default 30mins (30*60*1000ms) */ scheduleFetchTimeout?: number; /** * An internal flag to determine if sending requests with the internal endpoints as dependency requests. * @internal * @default false * @since 3.3.6 */ enableAjax?: boolean; } export const enum ICfgSyncMode { /** * Instance will NOT receive config changes or broadcast changes */ None = 0, /** * Instance will only broadcast config changes but NOT receive changes */ Broadcast = 1, /** * Instance will only receive config changes but NOT broadcast changes */ Receive = 2 } export interface ICfgSyncEvent { /** * Identifies config changes are expected to send out to other instances. */ cfg?: IConfiguration & IConfig; /** * Identifies additional details that are expected to send out with config changes. */ customDetails?: any; } export type NonOverrideCfg = { /** * Identifies config that should NOT be changed when the config is set to TRUE. * If it is set to undefined, null or false, changes will be applied to this config. * Default: undefined */ [key in keyof T]?: boolean | NonOverrideCfg | undefined; } export type OnCompleteCallback = (status: number, response?: string, isAutoSync?: boolean) => void; export type SendGetFunction = (url: string, oncomplete: OnCompleteCallback, isAutoSync?: boolean) => void; ================================================ FILE: extensions/applicationinsights-cfgsync-js/src/Interfaces/ICfgSyncPlugin.ts ================================================ import { IConfig, IConfiguration } from "@microsoft/applicationinsights-core-js"; export declare interface ICfgSyncPlugin { /** * Get current configs of current instance. * @param config - current configs */ getCfg(): IConfiguration & IConfig; /** * Manually set configs of current instance. * @param config - new configs */ setCfg(config?:IConfiguration & IConfig): boolean; /** * Manually broadcast configs of current instance to all other instances. * @param customDetails - additional details should also be sent out to other instances */ sync(customDetails?: any): boolean; /** * Manually update event name. * If current instance is the main instance, then following config changes will be sent out under this new event name. * If current instance is listener instances, it will listen to event details under this new name. * @param eventName - new event name */ updateEventListenerName(eventName?: string): boolean; /** * Pause the sending/receiving of events */ pause(): void; /** * Resume the sending/receiving of events */ resume(): void; } ================================================ FILE: extensions/applicationinsights-cfgsync-js/src/applicationinsights-cfgsync-js.ts ================================================ import { CfgSyncPlugin } from "./CfgSyncPlugin"; import { ICfgSyncConfig, ICfgSyncEvent, ICfgSyncMode, NonOverrideCfg, OnCompleteCallback, SendGetFunction } from "./Interfaces/ICfgSyncConfig"; import { ICfgSyncPlugin } from "./Interfaces/ICfgSyncPlugin"; export { CfgSyncPlugin, ICfgSyncPlugin, ICfgSyncConfig, ICfgSyncEvent, ICfgSyncMode, NonOverrideCfg, OnCompleteCallback, SendGetFunction }; ================================================ FILE: extensions/applicationinsights-cfgsync-js/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": true, "module": "es6", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "importHelpers": true, "noEmitHelpers": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "declaration": true, "declarationDir": "build/types", "outDir": "dist-es5", "rootDir": "./src", "removeComments": false }, "include": [ "./src/**/*.ts" ], "exclude": [ "./node_modules/**" ] } ================================================ FILE: extensions/applicationinsights-cfgsync-js/tsdoc.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", "extends": ["../../tsdoc.json"] } ================================================ FILE: extensions/applicationinsights-cfgsync-js/tslint.json ================================================ { "extends": [ "../../tslint-base.json" ], "rules": { "prefer-conditional-expression": false } } ================================================ FILE: extensions/applicationinsights-cfgsync-js/typedoc.json ================================================ { "$schema": "https://typedoc.org/schema.json", "entryPoints": [ "./src/applicationinsights-cfgsync-js.ts" ], "exclude": [ "**/internal/**/*.ts", "node_modules/**" ], "externalPattern": [ "**/node_modules/**", "node_modules/**" ], "sort": [ "alphabetical", "kind", "instance-first" ], "basePath": "./src", "sourceLinkTemplate": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/{path}#L{line}", "cleanOutputDir": true, "excludeExternals": false, "excludeInternal": true, "excludePrivate": true, "includeVersion": true, "groupOrder": [ "Entrypoint", "Modules", "Namespaces", "Enumerations", "Enumeration Members", "Classes", "Interfaces", "Type Aliases", "Constructors", "Properties", "Variables", "Functions", "Accessors", "Methods", "References", "*" ], "tsconfig": "./tsconfig.json", "out": "../../docs/webSdk/applicationinsights-cfgsync-js", "readme": "none", "githubPages": true, "gitRevision": "main", "compilerOptions": { "stripInternal": true }, "sidebarLinks": { "Changelog": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/RELEASES.md", "Examples": "https://github.com/microsoft/ApplicationInsights-JS/blob/main/examples/README.md", "Readme": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/extensions/applicationinsights-cfgsync-js" }, "navigationLinks": { "GitHub": "https://github.com/Microsoft/ApplicationInsights-JS", "npm": "https://www.npmjs.com/package/@microsoft/applicationinsights-cfgsync-js" }, "visibilityFilters": { "protected": false, "private": false, "inherited": true, "external": true } } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/.npmignore ================================================ # NPM Ignore # ignore everything * # ... but these files !package.json !tsconfig.json !/CODE_OF_CONDUCT.md !/CONTRIBUTING.md !/README.md !/SECURITY.md !/SUPPORT.md !/NOTICE !/PRIVACY !/LICENSE !/LICENSE.TXT !dist-es*/** !dist/** !browser/** !types/** ================================================ FILE: extensions/applicationinsights-clickanalytics-js/LICENSE ================================================ The MIT License (MIT) Copyright (c) Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: extensions/applicationinsights-clickanalytics-js/NOTICE ================================================ NOTICES AND INFORMATION Do Not Translate or Localize This software incorporates material from third parties. Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, or you may send a check or money order for US $5.00, including the product name, the open source component name, and version number, to: Source Code Compliance Team Microsoft Corporation One Microsoft Way Redmond, WA 98052 USA Notwithstanding any other terms, you may reverse engineer this software to the extent required to debug changes to any libraries licensed under the GNU Lesser General Public License. ================================================ FILE: extensions/applicationinsights-clickanalytics-js/PRIVACY ================================================ # Data Collection The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ================================================ FILE: extensions/applicationinsights-clickanalytics-js/README.md ================================================ # Microsoft Application Insights JavaScript SDK - Click Analytics Plugin Click Analytics Plugin for the Application Insights Javascript SDK, enables automatic tracking of the click events on web pages based on `data-*` meta tags. This plugin uses the `data-*` global attributes to capture the click events and populate telemetry data. ## How to effectively use the plugin 1. Telemetry data generated from the click events are stored as `customEvents` in the Application Insights section of the Azure portal. 2. The `name` of the customEvent is populated based on the following rules: 1. The `id` provided in the `data-*-id` will be used as the customEvent name. For example, if the clicked HTML element has the attribute "data-sample-id"="button1", then "button1" will be the customEvent name. 2. If no such attribute exists and if the `useDefaultContentNameOrId` is set to `true` in the configuration, then the clicked element's HTML attribute `id` or content name of the element will be used as the customEvent name. If both `id` and content name are present, precedence is given to `id`. 3. If `useDefaultContentNameOrId` is false, then the customEvent name will be "not_specified". > [!TIP] > Our recommendations is to set `useDefaultContentNameOrId` to true for generating meaningful data. 3. `parentDataTag` does two things: 1. If this tag is present, the plugin will fetch the `data-*` attributes and values from all the parent HTML elements of the clicked element. 2. To improve efficiency, the plugin uses this tag as a flag, when encountered it will stop itself from further processing the DOM (Document Object Model) upwards. > [!CAUTION] > Once `parentDataTag` is used, the SDK will begin looking for parent tags across your entire application and not just the HTML element where you used it. 4. `customDataPrefix` provided by the user should always start with `data-`, for example `data-sample-`. In HTML the `data-*` global attributes form a class of attributes called custom data attributes, that allow proprietary information to be exchanged between the HTML and its DOM representation by scripts. Older browsers (Internet Explorer, Safari) will drop attributes that it doesn't understand, unless they start with `data-`. The `*` in `data-*` may be replaced by any name following the [production rule of XML names](https://www.w3.org/TR/REC-xml/#NT-Name) with the following restrictions: - The name must not start with "xml", whatever case is used for these letters. - The name must not contain any semicolon (U+003A). - The name must not contain capital letters. ## What data does the plugin collect The following are some of the key properties captured by default when the plugin is enabled: ### Custom Event Properties | Name | Description | Sample | | --------------------- | ---------------------------------------|-----------------| | name | The `name` of the customEvent. More info on how this is populated is shown [here](#how-to-effectively-use-the-plugin).| About | | itemType | Type of event. | customEvent | |sdkVersion | version of Application Insights SDK along with click plugin|javascript:2.6.2_ClickPlugin2.6.2| ### Custom Dimensions | Name | Description | Sample | | --------------------- | ---------------------------------------|-----------------| | actionType | Action type that caused the click event. Can be left-click or right-click. | CL | | baseTypeSource | Base Type source of the custom event. | ClickEvent | | clickCoordinates | Coordinates where the click event is triggered. | 659X47 | | content | Placeholder to store additional `data-*` attributes and values. | [{sample1:value1, sample2:value2}] | | pageName | Title of the page where the click event is triggered. | Sample Title | | parentId | Id or name of the parent element | navbarContainer | ### Custom Measurements | Name | Description | Sample | | --------------------- | ---------------------------------------|-----------------| | timeToAction | Time taken in millisecs for the user to click the element since initial page load | 87407 | ## Getting Started ## NPM Setup (ignore if using Snippet Setup) Install npm package: ```bash npm install --save @microsoft/applicationinsights-clickanalytics-js @microsoft/applicationinsights-web ``` ```js import { ApplicationInsights } from '@microsoft/applicationinsights-web'; import { ClickAnalyticsPlugin } from '@microsoft/applicationinsights-clickanalytics-js'; const clickPluginInstance = new ClickAnalyticsPlugin(); // Click Analytics configuration const clickPluginConfig = { autoCapture: true }; // Application Insights Configuration const configObj = { connectionString: 'YOUR_CONNECTION_STRING', extensions: [clickPluginInstance], extensionConfig: { [clickPluginInstance.identifier]: clickPluginConfig }, }; const appInsights = new ApplicationInsights({ config: configObj }); appInsights.loadAppInsights(); ``` ## Snippet Setup (ignore if using NPM setup) ```html ``` ## [Configuration](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IClickAnalyticsConfiguration.html) | Name | Type | Default | Description | | --------------------- | -----------------------------------| --------| ---------------------------------------------------------------------------------------------------------------------------------------- | | [autoCapture](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IClickAnalyticsConfiguration.html#autoCapture) | boolean | true | Automatic capture configuration. | | [callback](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IClickAnalyticsConfiguration.html#callback) | [IValueCallback](#ivaluecallback) | null | Callbacks configuration. | | [pageTags](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IClickAnalyticsConfiguration.html#pageTags) | string | null | Page tags. | | [dataTags](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IClickAnalyticsConfiguration.html#dataTags) | [ICustomDataTags](#icustomdatatags)| null | Custom Data Tags provided to override default tags used to capture click data. | | [urlCollectHash](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IClickAnalyticsConfiguration.html#urlCollectHash) | boolean | false | Enables the logging of values after a "#" character of the URL. | | [urlCollectQuery](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IClickAnalyticsConfiguration.html#urlCollectQuery) | boolean | false | Enables the logging of the query string of the URL. | | [behaviorValidator](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IClickAnalyticsConfiguration.html#behaviorValidator) | Function | null | Callback function to use for the `data-*-bhvr` value validation. For more information, go to [behaviorValidator section](#behaviorvalidator).| | [defaultRightClickBhvr](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IClickAnalyticsConfiguration.html#defaultRightClickBhvr) | string (or) number | '' | Default Behavior value when Right Click event has occurred. This value will be overridden if the element has the `data-*-bhvr` attribute. | | [dropInvalidEvents](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IClickAnalyticsConfiguration.html#dropInvalidEvents) | boolean | false | Flag to drop events that do not have useful click data. | ### [IValueCallback](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IValueCallback.html) | Name | Type | Default | Description | | ------------------ | -------- | ------- | --------------------------------------------------------------------------------------- | | [pageName](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IValueCallback.html#pageName) | Function | null | Function to override the default pageName capturing behavior. | | [pageActionPageTags](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IValueCallback.html#pageActionPageTags) | Function | null | A callback function to augment the default pageTags collected during pageAction event. | | [contentName](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/IValueCallback.html#contentName) | Function | null | A callback function to populate customized contentName. | ### [ICustomDataTags](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/ICustomDataTags.html) | Name | Type | Default | Default Tag to Use in HTML | Description | |---------------------------|---------|-----------|-------------|----------------------------------------------------------------------------------------------| | [useDefaultContentNameOrId](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/ICustomDataTags.html#useDefaultContentNameOrId) | boolean | false | N/A |Collects standard HTML attribute for contentName when a particular element is not tagged with default customDataPrefix or when customDataPrefix is not provided by user. | | [customDataPrefix](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/ICustomDataTags.html#customDataPrefix) | string | `data-` | `data-*`| Automatic capture content name and value of elements that are tagged with provided prefix. For example, `data-*-id`, `data-` can be used in the HTML tags. | | [aiBlobAttributeTag](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/ICustomDataTags.html#aiBlobAttributeTag) | string | `ai-blob` | `data-ai-blob`| Plugin supports a JSON blob attribute instead of individual `data-*` attributes. | | [metaDataPrefix](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/ICustomDataTags.html#metaDataPrefix) | string | null | N/A | Automatic capture HTML Head's meta element name and content with provided prefix when capture. For example, `custom-` can be used in the HTML meta tag. | | [captureAllMetaDataContent](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/ICustomDataTags.html#captureAllMetaDataContent) | boolean | false | N/A | Automatic capture all HTML Head's meta element names and content. Default is false. If enabled this will override provided metaDataPrefix. | | [parentDataTag](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/ICustomDataTags.html#parentDataTag) | string | null | N/A | Stops traversing up the DOM to capture content name and value of elements when encountered with this tag. For example, `data-` can be used in the HTML tags.| | [dntDataTag](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-clickanalytics-js/interfaces/ICustomDataTags.html#dntDataTag) | string | `ai-dnt` | `data-ai-dnt`| HTML elements with this attribute will be ignored by the plugin for capturing telemetry data.| ### behaviorValidator The behaviorValidator functions automatically checks that tagged behaviors in code conform to a pre-defined list. This ensures tagged behaviors are consistent with your enterprise's established taxonomy. It is not required or expected that most Azure Monitor customers will use this, but it's available for advanced scenarios. There are three different behaviorValidator callback functions exposed as part of this extension. However, users can use their own callback functions if the exposed functions do not solve your requirement. The intent is to bring your own behaviors data structure, the plugin uses this validator function while extracting the behaviors from the data tags. | Name | Description | | ---------------------- | -----------------------------------------------------------------------------------| | BehaviorValueValidator | Use this callback function if your behaviors data structure is an array of strings.| | BehaviorMapValidator | Use this callback function if your behaviors data structure is a dictionary. | | BehaviorEnumValidator | Use this callback function if your behaviors data structure is an Enum. | #### Sample usage with behaviorValidator ```js var clickPlugin = Microsoft.ApplicationInsights.ClickAnalyticsPlugin; var clickPluginInstance = new clickPlugin(); // Behavior enum values var behaviorMap = { UNDEFINED: 0, // default, Undefined /////////////////////////////////////////////////////////////////////////////////////////////////// // Page Experience [1-19] /////////////////////////////////////////////////////////////////////////////////////////////////// NAVIGATIONBACK: 1, // Advancing to the previous index position within a webpage NAVIGATION: 2, // Advancing to a specific index position within a webpage NAVIGATIONFORWARD: 3, // Advancing to the next index position within a webpage APPLY: 4, // Applying filter(s) or making selections REMOVE: 5, // Applying filter(s) or removing selections SORT: 6, // Sorting content EXPAND: 7, // Expanding content or content container REDUCE: 8, // Sorting content CONTEXTMENU: 9, // Context Menu TAB: 10, // Tab control COPY: 11, // Copy the contents of a page EXPERIMENTATION: 12, // Used to identify a third party experimentation event PRINT: 13, // User printed page SHOW: 14, // Displaying an overlay HIDE: 15, // Hiding an overlay MAXIMIZE: 16, // Maximizing an overlay MINIMIZE: 17, // Minimizing an overlay BACKBUTTON: 18, // Clicking the back button /////////////////////////////////////////////////////////////////////////////////////////////////// // Scenario Process [20-39] /////////////////////////////////////////////////////////////////////////////////////////////////// STARTPROCESS: 20, // Initiate a web process unique to adopter PROCESSCHECKPOINT: 21, // Represents a checkpoint in a web process unique to adopter COMPLETEPROCESS: 22, // Page Actions that complete a web process unique to adopter SCENARIOCANCEL: 23, // Actions resulting from cancelling a process/scenario /////////////////////////////////////////////////////////////////////////////////////////////////// // Download [40-59] /////////////////////////////////////////////////////////////////////////////////////////////////// DOWNLOADCOMMIT: 40, // Initiating an unmeasurable off-network download DOWNLOAD: 41, // Initiating a download /////////////////////////////////////////////////////////////////////////////////////////////////// // Search [60-79] /////////////////////////////////////////////////////////////////////////////////////////////////// SEARCHAUTOCOMPLETE: 60, // Auto-completing a search query during user input SEARCH: 61, // Submitting a search query SEARCHINITIATE: 62, // Initiating a search query TEXTBOXINPUT: 63, // Typing or entering text in the text box /////////////////////////////////////////////////////////////////////////////////////////////////// // Commerce [80-99] /////////////////////////////////////////////////////////////////////////////////////////////////// VIEWCART: 82, // Viewing the cart ADDWISHLIST: 83, // Adding a physical or digital good or services to a wishlist FINDSTORE: 84, // Finding a physical store CHECKOUT: 85, // Before you fill in credit card info REMOVEFROMCART: 86, // Remove an item from the cart PURCHASECOMPLETE: 87, // Used to track the pageView event that happens when the CongratsPage or Thank You page loads after a successful purchase VIEWCHECKOUTPAGE: 88, // View the checkout page VIEWCARTPAGE: 89, // View the cart page VIEWPDP: 90, // View a PDP UPDATEITEMQUANTITY: 91, // Update an item's quantity INTENTTOBUY: 92, // User has the intent to buy an item PUSHTOINSTALL: 93, // User has selected the push to install option /////////////////////////////////////////////////////////////////////////////////////////////////// // Authentication [100-119] /////////////////////////////////////////////////////////////////////////////////////////////////// SIGNIN: 100, // User sign-in SIGNOUT: 101, // User sign-out /////////////////////////////////////////////////////////////////////////////////////////////////// // Social [120-139] /////////////////////////////////////////////////////////////////////////////////////////////////// SOCIALSHARE: 120, // "Sharing" content for a specific social channel SOCIALLIKE: 121, // "Liking" content for a specific social channel SOCIALREPLY: 122, // "Replying" content for a specific social channel CALL: 123, // Click on a "call" link EMAIL: 124, // Click on an "email" link COMMUNITY: 125, // Click on a "community" link /////////////////////////////////////////////////////////////////////////////////////////////////// // Feedback [140-159] /////////////////////////////////////////////////////////////////////////////////////////////////// VOTE: 140, // Rating content or voting for content SURVEYCHECKPOINT: 145, // reaching the survey page/form /////////////////////////////////////////////////////////////////////////////////////////////////// // Registration, Contact [160-179] /////////////////////////////////////////////////////////////////////////////////////////////////// REGISTRATIONINITIATE: 161, // Initiating a registration process REGISTRATIONCOMPLETE: 162, // Completing a registration process CANCELSUBSCRIPTION: 163, // Canceling a subscription RENEWSUBSCRIPTION: 164, // Renewing a subscription CHANGESUBSCRIPTION: 165, // Changing a subscription REGISTRATIONCHECKPOINT: 166, // Reaching the registration page/form /////////////////////////////////////////////////////////////////////////////////////////////////// // Chat [180-199] /////////////////////////////////////////////////////////////////////////////////////////////////// CHATINITIATE: 180, // Initiating a chat experience CHATEND: 181, // Ending a chat experience /////////////////////////////////////////////////////////////////////////////////////////////////// // Trial [200-209] /////////////////////////////////////////////////////////////////////////////////////////////////// TRIALSIGNUP: 200, // Signing-up for a trial TRIALINITIATE: 201, // Initiating a trial /////////////////////////////////////////////////////////////////////////////////////////////////// // Signup [210-219] /////////////////////////////////////////////////////////////////////////////////////////////////// SIGNUP: 210, // Signing-up for a notification or service FREESIGNUP: 211, // Signing-up for a free service /////////////////////////////////////////////////////////////////////////////////////////////////// // Referals [220-229] /////////////////////////////////////////////////////////////////////////////////////////////////// PARTNERREFERRAL: 220, // Navigating to a partner's web property /////////////////////////////////////////////////////////////////////////////////////////////////// // Intents [230-239] /////////////////////////////////////////////////////////////////////////////////////////////////// LEARNLOWFUNNEL: 230, // Engaging in learning behavior on a commerce page (ex. "Learn more click") LEARNHIGHFUNNEL: 231, // Engaging in learning behavior on a non-commerce page (ex. "Learn more click") SHOPPINGINTENT: 232, // Shopping behavior prior to landing on a commerce page /////////////////////////////////////////////////////////////////////////////////////////////////// // Video [240-259] /////////////////////////////////////////////////////////////////////////////////////////////////// VIDEOSTART: 240, // Initiating a video VIDEOPAUSE: 241, // Pausing a video VIDEOCONTINUE: 242, // Pausing or resuming a video. VIDEOCHECKPOINT: 243, // Capturing predetermined video percentage complete. VIDEOJUMP: 244, // Jumping to a new video location. VIDEOCOMPLETE: 245, // Completing a video (or % proxy) VIDEOBUFFERING: 246, // Capturing a video buffer event VIDEOERROR: 247, // Capturing a video error VIDEOMUTE: 248, // Muting a video VIDEOUNMUTE: 249, // Unmuting a video VIDEOFULLSCREEN: 250, // Making a video full screen VIDEOUNFULLSCREEN: 251, // Making a video return from full screen to original size VIDEOREPLAY: 252, // Making a video replay VIDEOPLAYERLOAD: 253, // Loading the video player VIDEOPLAYERCLICK: 254, // Click on a button within the interactive player VIDEOVOLUMECONTROL: 255, // Click on video volume control VIDEOAUDIOTRACKCONTROL: 256, // Click on audio control within a video VIDEOCLOSEDCAPTIONCONTROL: 257, // Click on the closed caption control VIDEOCLOSEDCAPTIONSTYLE: 258, // Click to change closed caption style VIDEORESOLUTIONCONTROL: 259, // Click to change resolution /////////////////////////////////////////////////////////////////////////////////////////////////// // Advertisement Engagement [280-299] /////////////////////////////////////////////////////////////////////////////////////////////////// ADBUFFERING: 283, // Ad is buffering ADERROR: 284, // Ad error ADSTART: 285, // Ad start ADCOMPLETE: 286, // Ad complete ADSKIP: 287, // Ad skipped ADTIMEOUT: 288, // Ad timed-out OTHER: 300 // Other }; // Application Insights Configuration var configObj = { connectionString: "YOUR CONNECTION STRING", extensions: [clickPluginInstance], extensionConfig: { [clickPluginInstance.identifier]: { behaviorValidator: Microsoft.ApplicationInsights.BehaviorMapValidator(behaviorMap), defaultRightClickBhvr: 9 }, }, }; var appInsights = new Microsoft.ApplicationInsights.ApplicationInsights({ config: configObj }); appInsights.loadAppInsights(); ``` ## Sample app [Simple web app with Click Analytics Auto-collection Plugin enabled](https://go.microsoft.com/fwlink/?linkid=2152871). ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Data Collection As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. ## License [MIT](LICENSE) ================================================ FILE: extensions/applicationinsights-clickanalytics-js/Tests/Unit/src/ClickEventTest.ts ================================================ /** * @copyright Microsoft 2020 */ import { Assert, AITestClass } from "@microsoft/ai-test-framework"; import { IConfig, utlCanUseLocalStorage } from "@microsoft/applicationinsights-core-js"; import { ITelemetryItem, AppInsightsCore, IPlugin, IConfiguration, DiagnosticLogger, hasDocument, isFunction, IAppInsightsCore } from '@microsoft/applicationinsights-core-js'; import { ClickAnalyticsPlugin, BehaviorMapValidator, BehaviorValueValidator, BehaviorEnumValidator } from '../../../src/ClickAnalyticsPlugin'; import { PageAction } from "../../../src/events/PageAction"; import { DomContentHandler } from '../../../src/handlers/DomContentHandler'; import { IClickAnalyticsConfiguration, IPageActionOverrideValues } from '../../../src/Interfaces/Datamodel'; import { sanitizeUrl } from "../../../src/DataCollector"; import { DEFAULT_AI_BLOB_ATTRIBUTE_TAG, DEFAULT_DATA_PREFIX, DEFAULT_DONOT_TRACK_TAG } from "../../../src/common/Utils"; import { PropertiesPlugin } from "@microsoft/applicationinsights-properties-js"; import { strContains } from "@nevware21/ts-utils"; export class ClickEventTest extends AITestClass { public testInitialize() { if (utlCanUseLocalStorage()) { window.localStorage.clear(); } } public testCleanup() { if (utlCanUseLocalStorage()) { window.localStorage.clear(); } } public registerTests() { this.testCase({ name: "clickPlugin: config can be set from roots dynamically", useFakeTimers: true, test: () => { const dataTagsDefault = { useDefaultContentNameOrId: false, aiBlobAttributeTag: DEFAULT_AI_BLOB_ATTRIBUTE_TAG, customDataPrefix: DEFAULT_DATA_PREFIX, captureAllMetaDataContent: false, dntDataTag: DEFAULT_DONOT_TRACK_TAG, metaDataPrefix: "", parentDataTag: "" }; const coreDataDefault = { referrerUri: hasDocument() ? document.referrer : "", requestUri: "", pageName: "", pageType: "" }; const defaultElementTypes = "A,BUTTON,AREA,INPUT"; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const id = clickAnalyticsPlugin.identifier; core.initialize({ instrumentationKey: "testIkey", extensionConfig : { } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config.extensionConfig = core.config.extensionConfig? core.config.extensionConfig : {}; let extConfig = core.config.extensionConfig[id]; Assert.ok(extConfig, "default config should not be null"); //check defaults Assert.equal(extConfig.autoCapture,true, "autoCapture should be true by default"); Assert.deepEqual(extConfig.pageTags, {}, "pageTags should be {} by default"); Assert.equal(extConfig.defaultRightClickBhvr, "", "defaultRightClickBhvr should be '' by default"); Assert.equal(extConfig.dropInvalidEvents, false, "dropInvalidEvents should be false by default"); Assert.equal(extConfig.urlCollectHash, false, "urlCollectHash should be false by default"); Assert.equal(extConfig.urlCollectQuery, false, "urlCollectQuery should be false by default"); Assert.deepEqual(extConfig.dataTags, dataTagsDefault, "udataTags should be set by default"); Assert.deepEqual(extConfig.coreData, coreDataDefault, "udataTags should be set by default"); Assert.deepEqual(extConfig.trackElementTypes, defaultElementTypes, "trackElementTypes should be set by default"); Assert.ok(extConfig.callback, "callback should be set by default"); let callbacks = extConfig.callback; let pageActionPageTags = callbacks.pageActionPageTags; let pageName = callbacks.pageName; let contentName = callbacks.contentName; Assert.equal(pageName, null, "pageName should be set by default"); Assert.equal(pageActionPageTags, null, "pageActionPageTags should be set by default"); Assert.equal(contentName, null, "contentName should be set by default"); Assert.ok(extConfig.behaviorValidator,"behaviorValidator should be set by default"); let bhvVal = extConfig.behaviorValidator; Assert.equal(bhvVal(), "", "behaviorValidator should return ''"); Assert.equal(bhvVal(1), 1, "behaviorValidator should return key"); //config(non-Object) changes let config = { urlCollectHash: true, urlCollectQuery: true, dropInvalidEvents: true, autoCapture: true, defaultRightClickBhvr: "click" } core.config.extensionConfig[id] = config; this.clock.tick(1); extConfig = core.config.extensionConfig[id]; Assert.equal(extConfig.urlCollectHash, true, "urlCollectHash should be updated"); Assert.equal(extConfig.urlCollectQuery, true, "urlCollectQuery should be updated"); Assert.equal(extConfig.dropInvalidEvents, true, "dropInvalidEvents should be updated"); Assert.equal(extConfig.autoCapture, true, "autoCapture should be updated"); Assert.equal(extConfig.defaultRightClickBhvr, "click", "defaultRightClickBhvrshould be updated"); //config(object) changes let dataTags = { useDefaultContentNameOrId: true }; core.config.extensionConfig[id].dataTags = dataTags; this.clock.tick(1); extConfig = core.config.extensionConfig[id]; let expectedDataTags ={...dataTagsDefault}; expectedDataTags.useDefaultContentNameOrId = true; Assert.deepEqual(extConfig.dataTags, expectedDataTags, "dataTags should be updated"); let dataTags1 = { dntDataTag: "dnt", captureAllMetaDataContent: true, customDataPrefix: "wrongtage" }; core.config.extensionConfig[id].dataTags = dataTags1; this.clock.tick(1); let extConfig1 = core.config.extensionConfig[id]; let expectedDataTags1 = {...dataTagsDefault}; expectedDataTags1.dntDataTag = "dnt"; expectedDataTags1.captureAllMetaDataContent = true; Assert.deepEqual(extConfig1.dataTags, expectedDataTags1, "dataTags should be updated with correct prefixName"); let coreData = { referrerUri: "url", pageName: "name" } core.config.extensionConfig[id].coreData =coreData; this.clock.tick(1); extConfig = core.config.extensionConfig[id]; let expectedCoreData = { referrerUri: "url", requestUri: "", pageName: "name", pageType: "" }; Assert.deepEqual(extConfig.coreData, expectedCoreData, "coreData should be updated"); let pageTags = { tag1: "tag1", tag2: true, tag3: 1, tag4: {tag: "val1"}, tag5: ["val1","val2"] } core.config.extensionConfig[id].pageTags = pageTags; this.clock.tick(1); extConfig = core.config.extensionConfig[id]; Assert.deepEqual(extConfig.pageTags, pageTags, "PageTags should be updated"); } }); this.testCase({ name: "autoCapture: click events are automatically captured and tracked", useFakeTimers: true, test: () => { const config = { coreData: {}, autoCapture: true, dataTags: { useDefaultContentNameOrId: true, metaDataPrefix: "ha-", customDataPrefix: "data-ha-", aiBlobAttributeTag: "blob" } } as IClickAnalyticsConfiguration; let clickAnalyticsPlugin = new ClickAnalyticsPlugin(); let core = new AppInsightsCore(); let channel = new ChannelPlugin(); core.initialize({ instrumentationKey: "testIkey", extensionConfig: { [clickAnalyticsPlugin.identifier]: config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, "track"); let element = document.createElement("button"); element.setAttribute("id", "testAutoCaptureBtn"); element.setAttribute("data-ha-aN", "autoCaptureArea"); document.body.appendChild(element); const mouseDownEvent = new MouseEvent("mousedown", { bubbles: true, cancelable: true }); element.dispatchEvent(mouseDownEvent); this.clock.tick(500); Assert.equal(true, spy.called, "track should be called on click event"); let calledEvent: ITelemetryItem = spy.getCall(0).args[0]; Assert.equal("testAutoCaptureBtn", calledEvent.baseData["name"]); // Clean up document.body.removeChild(element); } }); this.testCase({ name: "autoCapture: click events are automatically captured and tracked with customized config", useFakeTimers: true, test: () => { const config = { coreData: {}, autoCapture: true, dataTags: { useDefaultContentNameOrId: true, metaDataPrefix: "ha-", customDataPrefix: "data-ha-", aiBlobAttributeTag: "blob" }, trackElementTypes: "A" } as IClickAnalyticsConfiguration; let clickAnalyticsPlugin = new ClickAnalyticsPlugin(); let core = new AppInsightsCore(); let channel = new ChannelPlugin(); core.initialize({ instrumentationKey: "testIkey", extensionConfig: { [clickAnalyticsPlugin.identifier]: config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, "track"); let element = document.createElement("a"); element.setAttribute("id", "testAutoCaptureA"); element.setAttribute("data-ha-aN", "autoCaptureArea"); document.body.appendChild(element); let elementNotToTrack = document.createElement("button"); elementNotToTrack.setAttribute("id", "testAutoCaptureBtn"); elementNotToTrack.setAttribute("data-ha-aN", "autoCaptureArea"); document.body.appendChild(elementNotToTrack); let mouseDownEvent = new MouseEvent("mousedown", { bubbles: true, cancelable: true }); element.dispatchEvent(mouseDownEvent); let mouseDownEventNotToTrack = new MouseEvent("mousedown", { bubbles: true, cancelable: true }); elementNotToTrack.dispatchEvent(mouseDownEventNotToTrack); this.clock.tick(500); Assert.equal(true, spy.called, "track should be called on click event"); let calledEvent: ITelemetryItem = spy.getCall(0).args[0]; Assert.equal("testAutoCaptureA", calledEvent.baseData["name"]); // Clean up document.body.removeChild(element); document.body.removeChild(elementNotToTrack); } }); this.testCase({ name: "trackPageView properties are correctly assigned (Empty)", test: () => { let config = { coreData: {}, callback: { pageActionPageTags: () => ({ key2: "value2" }) }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:"ha-", customDataPrefix: "data-ha-", aiBlobAttributeTag: "blob", parentDataTag: "parent", dntDataTag: "donotTrack" } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); core.initialize({ instrumentationKey: "testIkey", extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, extConfig.callback?.pageActionPageTags, {}, traceLogger ); clickAnalyticsPlugin.trackPageAction() const element = document.createElement("a"); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, "track"); // clickAnalyticsPlugin.capturePageAction(element, {} as IOverrideValues, {}, false); pageAction.capturePageAction(element); Assert.equal(true, spy.called); let calledEvent: ITelemetryItem = spy.getCall(0).args[0]; Assert.notEqual(-1, calledEvent.data["uri"].indexOf("Tests.html")); Assert.equal(undefined, calledEvent.data["behavior"]); Assert.equal(undefined, calledEvent.data["actionType"]); Assert.equal("[{}]", calledEvent.data["content"]); Assert.equal(false, isNaN(calledEvent.data["timeToAction"] as number)); Assert.equal("value2", calledEvent.data["properties"]["pageTags"].key2); } }); this.testCase({ name: "PageAction properties are correctly assigned (Empty)", test: () => { let config = { coreData: {}, callback: { pageActionPageTags: () => ({ key2: "value2" }) }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:"ha-", customDataPrefix: "data-ha-", aiBlobAttributeTag: "blob", parentDataTag: "parent", dntDataTag: "donotTrack" } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const properties = new PropertiesPlugin(); core.initialize({ instrumentationKey: "testIkey", extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel, properties]); this.onDone(() => { core.unload(false); }); let sdkVersion = properties.context.internal.sdkVersion; Assert.ok(strContains(sdkVersion, "_ClickPlugin"), sdkVersion); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, extConfig.callback?.pageActionPageTags, {}, traceLogger ); const element = document.createElement("a"); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, "track"); // clickAnalyticsPlugin.capturePageAction(element, {} as IOverrideValues, {}, false); pageAction.capturePageAction(element); Assert.equal(true, spy.called); let calledEvent: ITelemetryItem = spy.getCall(0).args[0]; Assert.notEqual(-1, calledEvent.data["uri"].indexOf("Tests.html")); Assert.equal(undefined, calledEvent.data["behavior"]); Assert.equal(undefined, calledEvent.data["actionType"]); Assert.equal("[{}]", calledEvent.data["content"]); Assert.equal(false, isNaN(calledEvent.data["timeToAction"] as number)); Assert.equal("value2", calledEvent.data["properties"]["pageTags"].key2); } }); this.testCase({ name: "PageAction properties are correctly assigned (Overrides)", useFakeTimers: true, test: () => { const overrides: IPageActionOverrideValues = { actionType: "overrideActionType", contentTags: { 'testTag': 'testValue' }, refUri: "overrideReferrerUri", behavior: 2 }; const config = { coreData: {}, autoCapture: false, }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); const element = document.createElement('a'); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); this.clock.tick(500); // clickAnalyticsPlugin.capturePageAction(element, overrides, { customProperty: { customNextedProperty: "test" } }); pageAction.capturePageAction(element, overrides, { customProperty: { customNextedProperty: "test" } }); Assert.equal(true, spy.called); var calledEvent: ITelemetryItem = spy.getCall(0).args[0]; Assert.equal("overrideActionType", calledEvent.data["actionType"]); Assert.equal('[{"testTag":"testValue"}]', calledEvent.data["content"]); Assert.equal(2, calledEvent.data["behavior"]); Assert.equal("overrideReferrerUri", calledEvent.data["refUri"]); Assert.equal("test", calledEvent.data["customProperty"]["customNextedProperty"]); } }); this.testCase({ name: "PageAction properties are correctly assigned (Populated)", useFakeTimers: true, test: () => { const contentNameFn = () => "testContentName"; const config = { callback: { contentName: contentNameFn }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob' } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier]; Assert.ok(extConfig, "Make sure it is not null/undefined"); const behaviorValidator = extConfig.behaviorValidator; Assert.ok(isFunction(behaviorValidator), "Make sure we have a function") const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("id","testId"); element.setAttribute("data-ha-aN", "testAn"); element.setAttribute("data-ha-sN", "testsN"); element.setAttribute("data-ha-cS", "testcS"); element.setAttribute("data-ha-tN", "testtN"); element.setAttribute("data-ha-pid", "testpid"); element.setAttribute("data-ha-cT", "testcT"); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ an: "testAn", sn: "testsN", cs: "testcS", tn: "testtN", pid: "testpid", ct: "testcT", contentName: "testContentName" }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent: ITelemetryItem = spy.getCall(0).args[0]; Assert.equal("testId", calledEvent.baseData["name"]); Assert.equal(expectedContent, calledEvent.data["content"]); // Check the "merged" config Assert.deepEqual({ // Check the "merged" config autoCapture: true, callback: { contentName: contentNameFn, pageActionPageTags: null, pageName: null }, coreData: { referrerUri: document.referrer, requestUri: "", pageName: "", pageType: "" }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob', captureAllMetaDataContent: false, dntDataTag: DEFAULT_DONOT_TRACK_TAG, parentDataTag: "" }, pageTags: {}, behaviorValidator: behaviorValidator, defaultRightClickBhvr: "", dropInvalidEvents : false, urlCollectHash: false, urlCollectQuery: false, trackElementTypes: "A,BUTTON,AREA,INPUT" }, core.config.extensionConfig[clickAnalyticsPlugin.identifier]); } }); this.testCase({ name: "trackElementTypes: validate empty string, string with spaces, lowercase, and dynamic changes", useFakeTimers: true, test: () => { const config = { trackElementTypes: "A,BUTTON,AREA,INPUT" }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); core.initialize({ instrumentationKey: 'testIkey', extensionConfig: { [clickAnalyticsPlugin.identifier]: config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); let currentConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier].trackElementTypes; // Validate default value Assert.equal("A,BUTTON,AREA,INPUT", currentConfig, "Default trackElementTypes should be 'A,BUTTON,AREA,INPUT'"); // Test empty string core.config["extensionConfig"][clickAnalyticsPlugin.identifier].trackElementTypes = null; this.clock.tick(1); currentConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier].trackElementTypes; Assert.equal("A,BUTTON,AREA,INPUT", currentConfig, "default value would be applied"); // Test dynamic change core.config["extensionConfig"][clickAnalyticsPlugin.identifier].trackElementTypes = "A,BUTTON,AREA,INPUT,TEST"; this.clock.tick(1); currentConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier].trackElementTypes; Assert.equal("A,BUTTON,AREA,INPUT,TEST", currentConfig, "spaces and lowercase string will be converted to uppercase and trimmed"); } }); this.testCase({ name: "PageAction properties are correctly assigned (Populated) with useDefaultContentNameOrId flag false", useFakeTimers: true, test: () => { const config = { callback: { contentName: () => "testContentName" }, dataTags : { useDefaultContentNameOrId : false, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob' } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier]; const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("id","testId") element.setAttribute("data-ha-aN", "testAn"); element.setAttribute("data-ha-sN", "testsN"); element.setAttribute("data-ha-cS", "testcS"); element.setAttribute("data-ha-tN", "testtN"); element.setAttribute("data-ha-pid", "testpid"); element.setAttribute("data-ha-cT", "testcT"); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ an: "testAn", sn: "testsN", cs: "testcS", tn: "testtN", pid: "testpid", ct: "testcT", }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent: ITelemetryItem = spy.getCall(0).args[0]; Assert.equal("not_specified", calledEvent.baseData["name"]); Assert.equal(expectedContent, calledEvent.data["content"]); } }); // pageAction - clicked element has no tags, capture the id of the html element this.testCase({ name: "PageAction properties are correctly populated when parent element has data tags", useFakeTimers: true, test: () => { const config = { callback: { contentName: () => "testContentName" }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob' } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("id", "testId") const parentElement = document.createElement('div'); parentElement.setAttribute("data-ha-id", "testParentId"); parentElement.setAttribute("data-ha-name", "testParentName"); parentElement.appendChild(element); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ contentName: "testContentName", }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent = spy.getCall(0).args[0]; Assert.equal("testId", calledEvent.baseData["name"]); Assert.equal("not_specified", calledEvent.data["parentId"]); Assert.equal(expectedContent, calledEvent.data["content"]); } }); // pageAction - clicked element has no tags on current element, capture the id of the html element and parentId of the parent this.testCase({ name: "PageAction - clicked element has no tags on current element, capture the id of the html element and parentId of the parent", useFakeTimers: true, test: () => { const config = { callback: { contentName: () => "testContentName" }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob', parentDataTag:'parentgroup' } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("id", "testId") const parentElement = document.createElement('div'); parentElement.setAttribute("data-ha-id", "testParentId"); parentElement.setAttribute("data-ha-name", "testParentName"); parentElement.setAttribute("data-ha-parentgroup", "testParentGroup"); parentElement.appendChild(element); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ contentName: "testContentName", name: "testParentName" }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent = spy.getCall(0).args[0]; Assert.equal("testId", calledEvent.baseData["name"]); Assert.equal("testParentId", calledEvent.data["parentId"]); Assert.equal(expectedContent, calledEvent.data["content"]); } }); // pageAction - clicked element has no tags on current element, capture the id of the html element and html id of the parent this.testCase({ name: "PageAction - clicked element has no tags on current element, capture the id of the html element and html id of the parent", useFakeTimers: true, test: () => { const config = { callback: { contentName: () => "testContentName" }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob', parentDataTag:'parentgroup' } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("id", "testId") const parentElement = document.createElement('div'); parentElement.setAttribute("id","testParentId") parentElement.setAttribute("data-ha-name", "testParentName"); parentElement.setAttribute("data-ha-parentgroup", "testParentGroup"); parentElement.appendChild(element); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ contentName: "testContentName", name: "testParentName" }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent = spy.getCall(0).args[0]; Assert.equal("testId", calledEvent.baseData["name"]); Assert.equal("testParentId", calledEvent.data["parentId"]); Assert.equal(expectedContent, calledEvent.data["content"]); } }); // pageAction - clicked element has no tags, no html id capture the content name of html element should be event name this.testCase({ name: "PageAction name populated from contentname", useFakeTimers: true, test: () => { const config = { callback: { contentName: () => "testContentName" }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob' } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); const parentElement = document.createElement('div'); parentElement.setAttribute("data-ha-id", "testParentId"); parentElement.setAttribute("data-ha-name", "testParentName"); parentElement.appendChild(element); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ contentName: "testContentName", }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent = spy.getCall(0).args[0]; Assert.equal("testContentName", calledEvent.baseData["name"]); Assert.equal(expectedContent, calledEvent.data["content"]); } }); // Parent element has no tags, continue walk up the DOM to find grand parent element's info this.testCase({ name: "PageAction: element and its upper element does not have any tags, so grand parent element is recognize as under one area, no parent info is populated.", useFakeTimers: true, test: () => { const config = { callback: { contentName: () => "testContentName" }, dataTags : { useDefaultContentNameOrId : true, customDataPrefix: 'data-ha-', parentDataTag:'parentgroup' } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("id", "testId") const parentElement = document.createElement('div'); parentElement.setAttribute("id", "testParentId"); parentElement.appendChild(element); const grandParentElement = document.createElement('div'); grandParentElement.setAttribute("data-ha-parentgroup", "group1"); grandParentElement.setAttribute("data-ha-id", "testGrandParentId"); grandParentElement.setAttribute("data-ha-name", "testGrandParentName"); grandParentElement.appendChild(parentElement); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ contentName: "testContentName", name: "testGrandParentName", }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent = spy.getCall(0).args[0]; Assert.equal("testId", calledEvent.baseData["name"]); Assert.equal("testGrandParentId", calledEvent.data["parentId"]); Assert.equal(expectedContent, calledEvent.data["content"]); } }); // no data tags found, do not populate any data except the id this.testCase({ name: "PageAction: no parentId or parentName data is found", useFakeTimers: true, test: () => { const config = { dataTags : { useDefaultContentNameOrId : true, customDataPrefix: 'data-ha-', } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("id", "testId") const parentElement = document.createElement('div'); parentElement.setAttribute("id", "testParentId"); parentElement.appendChild(element); const grandParentElement = document.createElement('div'); grandParentElement.setAttribute("id", "testGrandParentId"); grandParentElement.appendChild(parentElement); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent = spy.getCall(0).args[0]; Assert.equal("testId", calledEvent.baseData["name"]); Assert.equal("not_specified", calledEvent.data["parentId"]); Assert.equal(expectedContent, calledEvent.data["content"]); } }); // element use data-ha-blob this.testCase({ name: "Element uses data* blob ", useFakeTimers: true, test: () => { const config = { dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob' }, }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("data-ha-id", "testId"); element.setAttribute("data-ha-blob", '{"id":"parentTestId","aN":"areaTestName","sN":"slotTestName","cN":"contentTestName", "pI":"parentIdSelfDefined", "pN":"parentNameSelfDefined"}'); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ aN: "areaTestName", sN: "slotTestName", cN: "contentTestName", pI: "parentIdSelfDefined", pN: "parentNameSelfDefined" }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent = spy.getCall(0).args[0]; Assert.equal("parentTestId", calledEvent.baseData["name"]); Assert.equal(expectedContent, calledEvent.data["content"]); } }); // parent element use data-ha-blob this.testCase({ name: "Parent Element uses data* blob ", useFakeTimers: true, test: () => { const config = { dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob', parentDataTag:'parentgroup' } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); const parentElement = document.createElement('div'); parentElement.setAttribute("id", "testParentId"); parentElement.setAttribute("data-ha-parentgroup", "group1"); parentElement.setAttribute("data-ha-blob", '{"id":"parentTestId","aN":"areaTestName","sN":"slotTestName","cN":"contentTestName", "pI":"parentIdSelfDefined", "pN":"parentNameSelfDefined"}'); parentElement.appendChild(element); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent = spy.getCall(0).args[0]; Assert.equal("not_specified", calledEvent.baseData["name"]); Assert.equal("parentTestId", calledEvent.data["parentId"]); Assert.equal(expectedContent, calledEvent.data["content"]); } }); // parent element use data-ha-parent, donot populate data from grandparent this.testCase({ name: "Parent element use data-ha-parent, donot populate data from grandparent", useFakeTimers: true, test: () => { const config = { dataTags : { useDefaultContentNameOrId : true, customDataPrefix: 'data-ha-', parentDataTag: 'parent' } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("data-ha-id", "testId"); const parentElement = document.createElement('div'); parentElement.setAttribute("data-ha-parentid", "testParentId"); parentElement.setAttribute("data-ha-name", "testParentName"); parentElement.appendChild(element); const grandParentElement = document.createElement('div'); grandParentElement.setAttribute("data-ha-grandparent-id", "testGrandParentId"); grandParentElement.setAttribute("data-ha-grandparent-name", "testGrandParentName"); grandParentElement.appendChild(parentElement); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ name: "testParentName", }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent = spy.getCall(0).args[0]; Assert.equal("testId", calledEvent.baseData["name"]); Assert.equal("testParentId", calledEvent.data["parentId"]); Assert.equal(expectedContent, calledEvent.data["content"]); } }); this.testCase({ name: "PageAction Behaviours test default value", useFakeTimers: true, test: () => { const config = { callback: { contentName: () => "testContentName" }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob' } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("id","testId") element.setAttribute("data-ha-aN", "testAn"); element.setAttribute("data-ha-bhvr", "testBehavior"); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ an: "testAn", contentName: "testContentName" }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent: ITelemetryItem = spy.getCall(0).args[0]; Assert.equal(expectedContent, calledEvent.data["content"]); Assert.equal("testBehavior",calledEvent.data["behavior"]); } }); this.testCase({ name: "PageAction Behaviours test empty default value", useFakeTimers: true, test: () => { const config = { callback: { contentName: () => "testContentName" }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob' } }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("id","testId") element.setAttribute("data-ha-aN", "testAn"); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ an: "testAn", contentName: "testContentName" }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent: ITelemetryItem = spy.getCall(0).args[0]; Assert.equal(expectedContent, calledEvent.data["content"]); Assert.equal(undefined, calledEvent.data["behavior"]); } }); this.testCase({ name: "PageAction Behaviours test default BehaviorMapValidator", useFakeTimers: true, test: () => { const behaviorMap = { BEHAVIOR1:"behavior1_Value", BEHAVIOR2:"behavior2_Value", } const config = { callback: { contentName: () => "testContentName" }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob' }, behaviorValidator : BehaviorMapValidator(behaviorMap) }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("id","testId") element.setAttribute("data-ha-aN", "testAn"); element.setAttribute("data-ha-bhvr", "BEHAVIOR1"); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ an: "testAn", contentName: "testContentName", }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent: ITelemetryItem = spy.getCall(0).args[0]; Assert.equal(expectedContent, calledEvent.data["content"]); Assert.equal("behavior1_Value",calledEvent.data["behavior"]); } }); this.testCase({ name: "PageAction Behaviours test default BehaviorValueValidator", useFakeTimers: true, test: () => { const behaviorArray = [ "BEHAVIOR1", "BEHAVIOR2" ] const config = { callback: { contentName: () => "testContentName" }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob' }, behaviorValidator : BehaviorValueValidator(behaviorArray) }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("id","testId") element.setAttribute("data-ha-aN", "testAn"); element.setAttribute("data-ha-bhvr", "BEHAVIOR1"); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ an: "testAn", contentName: "testContentName", }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent: ITelemetryItem = spy.getCall(0).args[0]; Assert.equal(expectedContent, calledEvent.data["content"]); Assert.equal("BEHAVIOR1",calledEvent.data["behavior"]); } }); this.testCase({ name: "PageAction Behaviours test default BehaviorEnumValidator", useFakeTimers: true, test: () => { const behaviorEnum = { NAVIGATIONBACK: 1, NAVIGATION: 2, NAVIGATIONFORWARD: 3 }; const config = { callback: { contentName: () => "testContentName" }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob' }, behaviorValidator : BehaviorEnumValidator(behaviorEnum) }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("id","testId") element.setAttribute("data-ha-aN", "testAn"); element.setAttribute("data-ha-bhvr", "NAVIGATION"); ((element) as HTMLBaseElement).href = "testClickTarget"; var expectedContent = JSON.stringify([{ an: "testAn", contentName: "testContentName" }]); // clickAnalyticsPlugin.capturePageAction(element); pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(true, spy.called); var calledEvent: ITelemetryItem = spy.getCall(0).args[0]; Assert.equal(expectedContent, calledEvent.data["content"]); Assert.equal(2,calledEvent.data["behavior"]); } }); this.testCase({ name: "PageAction not called on undefined event and disableUndefinedEventsTracking is set to true", useFakeTimers: true, test: () => { const config = { callback: { contentName: () => "testContentName" }, dataTags : { useDefaultContentNameOrId : false, metaDataPrefix:'ha-', customDataPrefix: 'data-ha-', aiBlobAttributeTag: 'blob' }, dropInvalidEvents:true }; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const traceLogger = new DiagnosticLogger({ loggingLevelConsole: 1 } as any); core.initialize({ instrumentationKey: 'testIkey', extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel]); this.onDone(() => { core.unload(false); }); core.config["extensionConfig"] = core.config["extensionConfig"]? core.config["extensionConfig"] : {}; let extConfig = core.config["extensionConfig"][clickAnalyticsPlugin.identifier] const contentHandler = new DomContentHandler(extConfig, traceLogger); const pageAction = new PageAction(clickAnalyticsPlugin, extConfig, contentHandler, null, {}, traceLogger ); let spy = this.sandbox.spy(clickAnalyticsPlugin.core, 'track'); const element = document.createElement('a'); element.setAttribute("id","testId"); ((element) as HTMLBaseElement).href = "testClickTarget"; pageAction.capturePageAction(element); this.clock.tick(500); Assert.equal(false, spy.called); } }); this.testCase({ name: "Test sanitizeUrl", test: () => { let fakeLocation1 = null; let fakeLocation2 = { protocol:"https:", hostname:"www.test.com", host:"www.test.com", port:"3000", pathname:"/path", hash:"#test", search:"?q=search&rlz=1C1CHBF" } as any; let fakeLocation3 = { protocol:"https:", host:"www.test.com", port:"", pathname:"", hash:"", search:"?q=search&rlz=1C1CHBF" } as any; const config1 = { urlCollectHash: true, urlCollectQuery: true }; const config2 = { urlCollectHash: false, urlCollectQuery: false }; const config3 = { urlCollectHash:false, urlCollectQuery: true }; let url1 = sanitizeUrl(config1, fakeLocation1); Assert.equal(null, url1); let url2 = sanitizeUrl(config2, fakeLocation2); Assert.equal("https://www.test.com:3000/path", url2); let url3 = sanitizeUrl(config1,fakeLocation2); Assert.equal("https://www.test.com:3000/path#test?q=search&rlz=1C1CHBF", url3); let url4 = sanitizeUrl(config3, fakeLocation3); Assert.equal("https://www.test.com?q=search&rlz=1C1CHBF", url4); let url5 = sanitizeUrl(config1, fakeLocation3); Assert.equal("https://www.test.com?q=search&rlz=1C1CHBF", url5); } }); this.testCase({ name: "Check sdkVersion length limitation", test: () => { let config = { coreData: {}, callback: { pageActionPageTags: () => ({ key2: "value2" }) }, dataTags : { useDefaultContentNameOrId : true, metaDataPrefix:"ha-", customDataPrefix: "data-ha-", aiBlobAttributeTag: "blob", parentDataTag: "parent", dntDataTag: "donotTrack" } }; let prevVersion = ClickAnalyticsPlugin.Version try { ClickAnalyticsPlugin.Version = "9.9.9-nightly3.2305-999.reallylongversionthatshouldgettruncated"; const clickAnalyticsPlugin = new ClickAnalyticsPlugin(); const core = new AppInsightsCore(); const channel = new ChannelPlugin(); const properties = new PropertiesPlugin(); core.initialize({ instrumentationKey: "testIkey", extensionConfig : { [clickAnalyticsPlugin.identifier] : config } } as IConfig & IConfiguration, [clickAnalyticsPlugin, channel, properties]); this.onDone(() => { core.unload(false); }); let sdkVersion = properties.context.internal.sdkVersion; Assert.ok(strContains(sdkVersion, "_ClickPlugin"), sdkVersion); Assert.equal(64, sdkVersion.length); } finally { ClickAnalyticsPlugin.Version = prevVersion; } } }); } } class ChannelPlugin implements IPlugin { public isFlushInvoked = false; public isTearDownInvoked = false; public isResumeInvoked = false; public isPauseInvoked = false; public identifier = "Sender"; public priority: number = 1001; constructor() { this.processTelemetry = this._processTelemetry.bind(this); } public pause(): void { this.isPauseInvoked = true; } public resume(): void { this.isResumeInvoked = true; } public teardown(): void { this.isTearDownInvoked = true; } flush(async?: boolean, callBack?: () => void): void { this.isFlushInvoked = true; if (callBack) { callBack(); } } public processTelemetry(env: ITelemetryItem) {} setNextPlugin(next: any) { // no next setup } public initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[]) { } private _processTelemetry(env: ITelemetryItem) { } } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/Tests/Unit/src/GlobalTestHooks.Test.ts ================================================ import { Assert } from "@microsoft/ai-test-framework"; import { _testHookMaxUnloadHooksCb } from "@microsoft/applicationinsights-core-js"; import { dumpObj } from "@nevware21/ts-utils"; export class GlobalTestHooks { public registerTests() { // Set a global maximum _testHookMaxUnloadHooksCb(20, (state: string, hooks: Array) => { Assert.ok(false, "Max unload hooks exceeded [" + hooks.length + "] - " + state + " - " + dumpObj(hooks)); }); } } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/Tests/Unit/src/appinsights-clickanalytics.tests.ts ================================================ import { ClickEventTest } from './ClickEventTest'; import { GlobalTestHooks } from './GlobalTestHooks.Test'; export function runTests() { new GlobalTestHooks().registerTests(); new ClickEventTest().registerTests(); } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/Tests/UnitTests.html ================================================  Tests for Application Insights JavaScript API
          ================================================ FILE: extensions/applicationinsights-clickanalytics-js/Tests/tsconfig.json ================================================ { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": false, "module": "amd", "moduleResolution": "Node", "target": "es5", "alwaysStrict": true, "declaration": true }, "files": [] } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/api-extractor.json ================================================ /** * Config file for API Extractor. For more info, please visit: https://api-extractor.com */ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", /** * Optionally specifies another JSON config file that this file extends from. This provides a way for * standard settings to be shared across multiple projects. * * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be * resolved using NodeJS require(). * * SUPPORTED TOKENS: none * DEFAULT VALUE: "" */ // "extends": "./shared/api-extractor-base.json" // "extends": "my-package/include/api-extractor-base.json" /** * Determines the "" token that can be used with other config file settings. The project folder * typically contains the tsconfig.json and package.json config files, but the path is user-defined. * * The path is resolved relative to the folder of the config file that contains the setting. * * The default value for "projectFolder" is the token "", which means the folder is determined by traversing * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error * will be reported. * * SUPPORTED TOKENS: * DEFAULT VALUE: "" */ "projectFolder": ".", /** * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor * analyzes the symbols exported by this module. * * The file extension must be ".d.ts" and not ".ts". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , */ "mainEntryPointFilePath": "/build/types/applicationinsights-clickanalytics-js.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. * * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly * imports library2. To avoid this, we can specify: * * "bundledPackages": [ "library2" ], * * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been * local files for library1. */ "bundledPackages": [ ], /** * Determines how the TypeScript compiler engine will be invoked by API Extractor. */ "compiler": { /** * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * Note: This setting will be ignored if "overrideTsconfig" is used. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/tsconfig.json" */ // "tsconfigFilePath": "/tsconfig.json", /** * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. * The object must conform to the TypeScript tsconfig schema: * * http://json.schemastore.org/tsconfig * * If omitted, then the tsconfig.json file will be read from the "projectFolder". * * DEFAULT VALUE: no overrideTsconfig section */ // "overrideTsconfig": { // . . . // } /** * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. * * DEFAULT VALUE: false */ // "skipLibCheck": true, }, /** * Configures how the API report file (*.api.md) will be generated. */ "apiReport": { /** * (REQUIRED) Whether to generate an API report. */ "enabled": true, /** * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce * a full file path. * * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". * * SUPPORTED TOKENS: , * DEFAULT VALUE: ".api.md" */ "reportFileName": ".api.md", /** * Specifies the folder where the API report file is written. The file name portion is determined by * the "reportFileName" setting. * * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, * e.g. for an API review. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/etc/" */ "reportFolder": "/build/dts/", /** * Specifies the folder where the temporary report file is written. The file name portion is determined by * the "reportFileName" setting. * * After the temporary file is written to disk, it is compared with the file in the "reportFolder". * If they are different, a production build will fail. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/" */ // "reportTempFolder": "/temp/" }, /** * Configures how the doc model file (*.api.json) will be generated. */ "docModel": { /** * (REQUIRED) Whether to generate a doc model file. */ "enabled": true, /** * The output path for the doc model file. The file extension should be ".api.json". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/.api.json" */ "apiJsonFilePath": "/build/dts/.api.json" }, /** * Configures how the .d.ts rollup file will be generated. */ "dtsRollup": { /** * (REQUIRED) Whether to generate the .d.ts rollup file. */ "enabled": true, /** * Specifies the output path for a .d.ts rollup file to be generated without any trimming. * This file will include all declarations that are exported by the main entry point. * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/dist/.d.ts" */ "untrimmedFilePath": "/build/dts/.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. * This file will include only declarations that are marked as "@public" or "@beta". * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "betaTrimmedFilePath": "/build/dts/-beta.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. * This file will include only declarations that are marked as "@public". * * If the path is an empty string, then this file will not be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ // "publicTrimmedFilePath": "/build/dts/-public.d.ts", /** * When a declaration is trimmed, by default it will be replaced by a code comment such as * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the * declaration completely. * * DEFAULT VALUE: false */ // "omitTrimmingComments": true }, /** * Configures how the tsdoc-metadata.json file will be generated. */ "tsdocMetadata": { /** * Whether to generate the tsdoc-metadata.json file. * * DEFAULT VALUE: true */ "enabled": false, /** * Specifies where the TSDoc metadata file should be written. * * The path is resolved relative to the folder of the config file that contains the setting; to change this, * prepend a folder token such as "". * * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup * falls back to "tsdoc-metadata.json" in the package folder. * * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ "tsdocMetadataFilePath": "/build/dts/tsdoc-metadata.json" }, /** * Configures how API Extractor reports error and warning messages produced during analysis. * * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. */ "messages": { /** * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing * the input .d.ts files. * * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "compilerMessageReporting": { /** * Configures the default routing for messages that don't match an explicit rule in this table. */ "default": { /** * Specifies whether the message should be written to the the tool's output log. Note that * the "addToApiReportFile" property may supersede this option. * * Possible values: "error", "warning", "none" * * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes * the "--local" option), the warning is displayed but the build will not fail. * * DEFAULT VALUE: "warning" */ "logLevel": "warning", /** * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), * then the message will be written inside that file; otherwise, the message is instead logged according to * the "logLevel" option. * * DEFAULT VALUE: false */ // "addToApiReportFile": false }, // "TS2551": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . }, /** * Configures handling of messages reported by API Extractor during its analysis. * * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" * * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings */ "extractorMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false }, "ae-missing-release-tag": { "logLevel": "none" }, // // . . . }, /** * Configures handling of messages reported by the TSDoc parser when analyzing code comments. * * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" * * DEFAULT VALUE: A single "default" entry with logLevel=warning. */ "tsdocMessageReporting": { "default": { "logLevel": "warning", // "addToApiReportFile": false } // "tsdoc-link-tag-unescaped-text": { // "logLevel": "warning", // "addToApiReportFile": true // }, // // . . . } } } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/package.json ================================================ { "name": "@microsoft/applicationinsights-clickanalytics-js", "version": "3.4.1", "description": "Microsoft Application Insights Click Analytics extension", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "author": "Microsoft Application Insights Team", "main": "dist/es5/applicationinsights-clickanalytics-js.js", "module": "dist-es5/applicationinsights-clickanalytics-js.js", "types": "types/applicationinsights-clickanalytics-js.d.ts", "sideEffects": false, "scripts": { "clean": "git clean -xdf", "build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen", "build:esm": "grunt clickanalytics", "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs", "rebuild": "npm run build", "test": "grunt clickanalyticstests", "mintest": "grunt clickanalytics-mintests", "lint": "tslint -p tsconfig.json", "dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js 'Microsoft.ApplicationInsights'", "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js", "ai-min": "grunt clickanalytics-min", "ai-restore": "grunt clickanalytics-restore", "npm-pack": "npm pack", "api-docs": "typedoc" }, "devDependencies": { "@microsoft/ai-test-framework": "0.0.1", "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es5": "1.0.2", "@microsoft/api-extractor": "^7.40.0", "typescript": "^4.9.3", "tslib": "^2.0.0", "globby": "^11.0.0", "magic-string": "^0.25.7", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "rollup": "^3.20.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-sourcemaps": "^0.6.3", "typedoc": "^0.26.6", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "@nevware21/grunt-ts-plugin": "^0.5.2", "@nevware21/grunt-eslint-ts": "^0.5.2" }, "peerDependencies": { "tslib": ">= 1.0.0" }, "dependencies": { "@microsoft/dynamicproto-js": "^2.0.3", "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/applicationinsights-core-js": "3.4.1", "@microsoft/applicationinsights-properties-js": "3.4.1", "@nevware21/ts-utils": ">= 0.12.6 < 2.x" }, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/extensions/applicationinsights-clickanalytics-js" }, "license": "MIT" } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/rollup.config.js ================================================ import { createConfig } from "../../rollup.base.config"; import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm"; const version = require("./package.json").version; const browserOutputName = "ai.clck"; const outputName = "applicationinsights-clickanalytics-js"; const banner = [ "/*!", ` * Application Insights JavaScript SDK - Click Analytics, ${version}`, " * Copyright (c) Microsoft and contributors. All rights reserved.", " */" ].join("\n"); const replaceValues = { "// Copyright (c) Microsoft Corporation. All rights reserved.": "", "// Licensed under the MIT License.": "" }; updateDistEsmFiles(replaceValues, banner, true, true, "dist-es5"); export default createConfig(banner, { namespace: "Microsoft.ApplicationInsights", version: version, node: { entryPoint: outputName, outputName: outputName }, browser: { entryPoint: outputName, outputName: browserOutputName } }, [ outputName ]); ================================================ FILE: extensions/applicationinsights-clickanalytics-js/scripts/listAzCdnVersions.ps1 ================================================ param ( [string] $container = $null, # Identify the container that you want to check blank == all [string] $storeContainer = "cdn", # Identifies the destination storage account container [string] $cdnStorePath = "cdnstoragename", # Identifies the target Azure Storage account (by name) [string] $subscriptionId = $null, # Identifies the target Azure Subscription Id (if not encoded in the cdnStorePath) [string] $resourceGroup = $null, # Identifies the target Azure Subscription Resource Group (if not encoded in the cdnStorePath) [string] $sasToken = $null, # The SAS Token to use rather than using or attempting to login [string] $logPath = $null, # The location where logs should be written [switch] $showFiles = $false, # Show the individual files with details as well [switch] $activeOnly = $false, # Only show the active (deployed) versions [switch] $testOnly = $false, # Uploads to a "tst" test container on the storage account [switch] $cdn = $false, # (No longer used -- kept for now for backward compatibility) [switch] $useConnectedAccount = $false # Use Entra Id to connect to Azure ) Import-Module -Force -Name "../../../common/publish/Logging" Import-Module -Force -Name "../../../common/publish/AzStorageHelper" [hashtable]$global:connectDetails = @{} $global:connectDetails.storeContainer = $storeContainer $global:connectDetails.cdnStorePath = $cdnStorePath $global:connectDetails.resourceGroup = $resourceGroup $global:connectDetails.storeName = $null # The endpoint needs to the base name of the endpoint, not the full URL (eg. “my-cdn” rather than “my-cdn.azureedge.net”) $global:connectDetails.subscriptionId = $subscriptionId $global:connectDetails.sasToken = $sasToken $global:connectDetails.storageContext = $null $global:connectDetails.testOnly = $testOnly $global:connectDetails.useConnectedAccount = $useConnectedAccount Function Write-LogParams { $logDir = Get-LogPath Write-Log "Container : $container" Write-Log "Storage Container : $storeContainer" Write-Log "Store Path : $($global:connectDetails.cdnStorePath)" Write-Log "Log Path : $logDir" Write-Log "Show Files : $showFiles" Write-Log "Test Mode : $testOnly" Write-Log "Use Connected Acct: $useConnectedAccount" if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "Mode : User-Credentials" } else { Write-Log "Mode : Sas-Token" } } Function Validate-Params { # Validate parameters if ([string]::IsNullOrWhiteSpace($container) -ne $true -and "beta","next","public", "dev", "nightly" -NotContains $container) { Write-LogFailure "[$($container)] is not a valid value, must be beta, next or public" } } Function Get-AllVersionFiles( [system.collections.generic.dictionary[string, system.collections.generic.list[hashtable]]] $files, [string] $storagePath ) { Get-VersionFiles $files "$storagePath/ext" "ai.clck." $null } $Error.Clear() #----------------------------------------------------------------------------- # Start of Script #----------------------------------------------------------------------------- Set-LogPath $logPath, "listCdnVersionsLog" Write-LogParams Validate-Params # Don't try and list anything if any errors have been logged if (Get-HasErrors -eq $true) { exit 2 } # You will need to at least have the Az modules installed InstallRequiredModules $global:connectDetails = ParseCdnStorePath $global:connectDetails if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "**********************************************************************" Write-Log "Validating user access" Write-Log "**********************************************************************" $global:connectDetails = ValidateAccess $global:connectDetails } Write-Log "======================================================================" # List the files for each container $files = New-Object 'system.collections.generic.dictionary[string, system.collections.generic.list[hashtable]]' # Get the public files (scripts/b) if ([string]::IsNullOrWhiteSpace($container) -eq $true) { Get-AllVersionFiles $files "scripts/b" Get-AllVersionFiles $files "beta" Get-AllVersionFiles $files "next" Get-AllVersionFiles $files "dev" Get-AllVersionFiles $files "nightly" } if ([string]::IsNullOrWhiteSpace($container) -ne $true) { if ($container -eq "public") { Get-AllVersionFiles $files "scripts/b" } elseif ($container -eq "beta" -or $container -eq "next" -or $container -eq "dev" -or $container -eq "nightly") { Get-AllVersionFiles $files "$container" } else { $global:connectDetails.testOnly = $true $global:connectDetails.storeContainer = "tst" Get-AllVersionFiles $files "$container" } } ListVersions $files $activeOnly $showFiles Write-Log "======================================================================" ================================================ FILE: extensions/applicationinsights-clickanalytics-js/scripts/publishAzReleaseToCdn.ps1 ================================================ param ( [string] $releaseFrom = $null, # The root path for where to find the files to be released [string] $storeContainer = "cdn", # Identifies the destination storage account container [string] $cdnStorePath = "cdnstoragename", # Identifies the target Azure Storage account (by name) [string] $subscriptionId = $null, # Identifies the target Azure Subscription Id (if not encoded in the cdnStorePath) [string] $resourceGroup = $null, # Identifies the target Azure Subscription Resource Group (if not encoded in the cdnStorePath) [string] $sasToken = $null, # The SAS Token to use rather than using or attempting to login [string] $logPath = $null, # The location where logs should be written [switch] $overwrite = $false, # Overwrite any existing files [switch] $testOnly = $false, # Uploads to a "tst" test container on the storage account [switch] $cdn = $false, # (No longer used -- kept for now for backward compatibility) [switch] $useConnectedAccount = $false # Use Entra Id to connect to Azure ) Import-Module -Force -Name "../../../common/publish/Logging" Import-Module -Force -Name "../../../common/publish/AzStorageHelper" [hashtable]$global:connectDetails = @{} $global:connectDetails.storeContainer = $storeContainer $global:connectDetails.cdnStorePath = $cdnStorePath $global:connectDetails.resourceGroup = $resourceGroup $global:connectDetails.storeName = $null # The endpoint needs to the base name of the endpoint, not the full URL (eg. “my-cdn” rather than “my-cdn.azureedge.net”) $global:connectDetails.subscriptionId = $subscriptionId $global:connectDetails.sasToken = $sasToken $global:connectDetails.storageContext = $null $global:connectDetails.testOnly = $testOnly $global:connectDetails.useConnectedAccount = $useConnectedAccount $global:cacheValue = $null Function Write-LogParams { $logDir = Get-LogPath Write-Log "Storage Container : $storeContainer" Write-Log "Store Path : $($global:connectDetails.cdnStorePath)" Write-Log "Overwrite : $overwrite" Write-Log "Test Mode : $testOnly" Write-Log "SourcePath : $jsSdkDir" Write-Log "Log Path : $logDir" Write-Log "Use Connected Acct: $useConnectedAccount" if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "Mode : User-Credentials" } else { Write-Log "Mode : Sas-Token" } } Function GetReleaseFiles ( [hashtable] $verDetails ) { $version = $verDetails.full Write-Log "Version : $($verDetails.full)" Write-Log " Number : $($verDetails.ver)" Write-Log " Type : $($verDetails.type)" Write-Log " BldNum : $($verDetails.bldNum)" # check if the minified dir exists $jsSdkSrcDir = Join-Path $jssdkDir -ChildPath "browser\es5\"; if (-Not (Test-Path $jsSdkSrcDir)) { Write-LogWarning "'$jsSdkSrcDir' directory doesn't exist. Compile JSSDK first."; exit } $files = New-Object 'system.collections.generic.dictionary[string,string]' Write-Log "Adding files"; AddReleaseFile $files $jsSdkSrcDir "ai.clck.$version.integrity.json" $true AddReleaseFile $files $jsSdkSrcDir "ai.clck.$version.js" AddReleaseFile $files $jsSdkSrcDir "ai.clck.$version.js.map" AddReleaseFile $files $jsSdkSrcDir "ai.clck.$version.min.js" AddReleaseFile $files $jsSdkSrcDir "ai.clck.$version.min.js.map" AddReleaseFile $files $jsSdkSrcDir "ai.clck.$version.cjs.js" AddReleaseFile $files $jsSdkSrcDir "ai.clck.$version.cjs.js.map" AddReleaseFile $files $jsSdkSrcDir "ai.clck.$version.cjs.min.js" AddReleaseFile $files $jsSdkSrcDir "ai.clck.$version.cjs.min.js.map" AddReleaseFile $files $jsSdkSrcDir "ai.clck.$version.gbl.js" AddReleaseFile $files $jsSdkSrcDir "ai.clck.$version.gbl.js.map" AddReleaseFile $files $jsSdkSrcDir "ai.clck.$version.gbl.min.js" AddReleaseFile $files $jsSdkSrcDir "ai.clck.$version.gbl.min.js.map" return $files } #----------------------------------------------------------------------------- # Start of Script #----------------------------------------------------------------------------- Set-LogPath $logPath "publishReleaseCdnLog" $jsSdkDir = $releaseFrom if ([string]::IsNullOrWhiteSpace($jsSdkDir) -eq $true) { $jsSdkDir = Split-Path (Split-Path $MyInvocation.MyCommand.Path) -Parent } $cacheControl1Year = "public, max-age=31536000, immutable, no-transform"; $contentType = "text/javascript; charset=utf-8"; Write-LogParams # You will need to at least have the Az modules installed InstallRequiredModules $global:connectDetails = ParseCdnStorePath $global:connectDetails if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "**********************************************************************" Write-Log "Validating user access" Write-Log "**********************************************************************" $global:connectDetails = ValidateAccess $global:connectDetails } Write-Log "======================================================================" $version = GetPackageVersion $jsSdkDir $releaseFiles = GetReleaseFiles $version # Get the versioned files only if ($null -eq $releaseFiles -or $releaseFiles.Count -eq 0) { Write-LogFailure "Unable to find any release files" } Write-Log "Release Files : $($releaseFiles.Count)" Write-Log "----------------------------------------------------------------------" # Publish the full versioned files to all release folders if ($version.type -eq "release") { # Normal publishing deployment PublishFiles $releaseFiles "beta/ext" $cacheControl1Year $contentType $overwrite PublishFiles $releaseFiles "next/ext" $cacheControl1Year $contentType $overwrite PublishFiles $releaseFiles "scripts/b/ext" $cacheControl1Year $contentType $overwrite } elseif ($version.type -eq "rc") { PublishFiles $releaseFiles "beta/ext" $cacheControl1Year $contentType $overwrite PublishFiles $releaseFiles "next/ext" $cacheControl1Year $contentType $overwrite } elseif ($version.type -eq "dev" -or $version.type -eq "beta") { # Publish to release type folder folder PublishFiles $releaseFiles "$($version.type)/ext" $cacheControl1Year $contentType $overwrite } elseif ($version.type -like "nightly*") { # Publish to release nightly folder folder PublishFiles $releaseFiles "nightly/ext" $cacheControl1Year $contentType $overwrite } else { # Upload to the test container rather than the supplied one $global:connectDetails.testOnly = $true $global:connectDetails.storeContainer = "tst" PublishFiles $releaseFiles "$($version.type)/ext" $cacheControl1Year $contentType $overwrite } Write-Log "======================================================================" ================================================ FILE: extensions/applicationinsights-clickanalytics-js/scripts/setAzActiveCdnVersion.ps1 ================================================ [CmdletBinding()] param ( [string] $container = "", # The container to update [string] $activeVersion = "", # The version to copy as the active version [string] $storeContainer = "cdn", # Identifies the destination storage account container [string] $cdnStorePath = "cdnstoragename", # Identifies the target Azure Storage account (by name) [string] $subscriptionId = $null, # Identifies the target Azure Subscription Id (if not encoded in the cdnStorePath) [string] $resourceGroup = $null, # Identifies the target Azure Subscription Resource Group (if not encoded in the cdnStorePath) [string] $sasToken = $null, # The SAS Token to use rather than using or attempting to login [string] $logPath = $null, # The location where logs should be written [switch] $minorOnly = $false, # Only set the active minor version (v2.x) and not the major version (v2) [switch] $testOnly = $false, # Uploads to a "tst" test container on the storage account [switch] $cdn = $false, # (No longer used -- kept for now for backward compatibility) [switch] $useConnectedAccount = $false # Use Entra Id to connect to Azure ) Import-Module -Force -Name "../../../common/publish/Logging" Import-Module -Force -Name "../../../common/publish/AzStorageHelper" [hashtable]$global:connectDetails = @{} $global:connectDetails.storeContainer = $storeContainer $global:connectDetails.cdnStorePath = $cdnStorePath $global:connectDetails.resourceGroup = $resourceGroup $global:connectDetails.storeName = $null # The endpoint needs to the base name of the endpoint, not the full URL (eg. “my-cdn” rather than “my-cdn.azureedge.net”) $global:connectDetails.subscriptionId = $subscriptionId $global:connectDetails.sasToken = $sasToken $global:connectDetails.storageContext = $null $global:connectDetails.testOnly = $testOnly $global:connectDetails.useConnectedAccount = $useConnectedAccount Function Write-LogParams { Write-Log "Container : $container" Write-Log "Version : $activeVersion" Write-Log "Storage Container : $storeContainer" Write-Log "Store Path : $($global:connectDetails.cdnStorePath)" Write-Log "Test Mode : $testOnly" Write-Log "Log Path : $logDir" Write-Log "Use Connected Acct: $useConnectedAccount" if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "Mode : User-Credentials" } else { Write-Log "Mode : Sas-Token" } } Function Validate-Params { if ([string]::IsNullOrWhiteSpace($activeVersion) -eq $true) { Write-LogFailure "The Active version is not specified" exit } $version = Get-VersionDetails $activeVersion if ([string]::IsNullOrWhiteSpace($version.type) -eq $true) { Write-LogFailure "Unknown release type" } $versionParts = $version.ver.Split(".") if ($versionParts.Length -ne 3) { Write-LogFailure "Active Version [$activeVersion] is not a valid version number" } foreach ($verNum in $versionParts) { [int]$value = 0 if ([int32]::TryParse($verNum, [ref]$value) -ne $true) { Write-LogFailure "[$($verNum)] is not a valid number within the version[$activeVersion]" } } # Publish the full versioned files to all release folders if ($version.type -eq "release") { # Normal publishing deployment if ("beta","next","public" -NotContains $container) { Write-LogFailure "Container [$container] is not valid for version type [$($version.type)]" } } elseif ($version.type -eq "rc") { if ("beta","next" -NotContains $container) { Write-LogFailure "Container [$container] is not valid for version type [$($version.type)]" } } elseif ($version.type -eq "dev" -or $version.type -eq "beta") { if ($version.type -ne $container) { Write-LogFailure "Container [$container] is not valid for version type [$($version.type)]" } } elseif ($version.type -like "nightly*") { if ("nightly" -ne $container) { Write-LogFailure "Container [$container] is not valid for version type [$($version.type)]" } } else { # Upload to the test container rather than the supplied one $global:connectDetails.testOnly = $true if ($version.type -ne $container) { Write-LogFailure "Container [$container] is not valid for version type [$($version.type)]" } else { Write-LogWarning "Non-Standard release type using tst/$container as the destination" } } return $version; } $Error.Clear() #----------------------------------------------------------------------------- # Start of Script #----------------------------------------------------------------------------- Set-LogPath $logPath "setActiveCdnVersionLog" Write-LogParams $version = Validate-Params # Don't try and publish anything if any errors have been logged if (Get-HasErrors -eq $true) { exit 2 } # You will need to at least have the Az modules installed InstallRequiredModules $global:connectDetails = ParseCdnStorePath $global:connectDetails if ([string]::IsNullOrWhiteSpace($global:connectDetails.sasToken) -eq $true) { Write-Log "**********************************************************************" Write-Log "Validating user access" Write-Log "**********************************************************************" $global:connectDetails = ValidateAccess $global:connectDetails } Write-Log "======================================================================" # List the files for each container $files = New-Object 'system.collections.generic.dictionary[string, system.collections.generic.list[hashtable]]' $storePath = "$container/ext" if ($container -eq "public") { $storePath = "scripts/b/ext" } elseif ($container -ne "beta" -and $container -ne "next" -and $container -ne "dev" -and $container -ne "nightly") { $global:connectDetails.testOnly = $true $global:connectDetails.storeContainer = "tst/ext" } Get-VersionFiles $files $storePath "ai.clck." $activeVersion if ($files.ContainsKey($activeVersion) -ne $true) { Write-LogFailure "Version [$activeVersion] does not appear to be deployed to [$container]" } elseif ($files[$activeVersion].Count -ne 12 -and $files[$activeVersion].Count -ne 13) { # Since 2.6.5 Write-LogFailure "Version [$activeVersion] does not fully deployed to [$container] -- only found [$($files[$activeVersion].Count)] file(s)" } # Don't try and publish anything if any errors have been logged if (Get-HasErrors -eq $true) { exit 2 } SetActiveVersion $files[$activeVersion] $storePath $minorOnly Write-Log "======================================================================" ================================================ FILE: extensions/applicationinsights-clickanalytics-js/src/Behaviours.ts ================================================ /** * @copyright Microsoft 2020 */ // Behavior enum values export enum Behavior { UNDEFINED = 0, // default, Undefined /////////////////////////////////////////////////////////////////////////////////////////////////// // Page Experience [1-19] /////////////////////////////////////////////////////////////////////////////////////////////////// NAVIGATIONBACK = 1, // Advancing to the previous index position within a webpage NAVIGATION = 2, // Advancing to a specific index position within a webpage NAVIGATIONFORWARD = 3, // Advancing to the next index position within a webpage APPLY = 4, // Applying filter(s) or making selections REMOVE = 5, // Applying filter(s) or removing selections SORT = 6, // Sorting content EXPAND = 7, // Expanding content or content container REDUCE = 8, // Sorting content CONTEXTMENU = 9, // Context Menu TAB = 10, // Tab control COPY = 11, // Copy the contents of a page EXPERIMENTATION = 12, // Used to identify a third party experimentation event PRINT = 13, // User printed page SHOW = 14, // Displaying an overlay HIDE = 15, // Hiding an overlay MAXIMIZE = 16, // Maximizing an overlay MINIMIZE = 17, // Minimizing an overlay BACKBUTTON = 18, // Clicking the back button /////////////////////////////////////////////////////////////////////////////////////////////////// // Scenario Process [20-39] /////////////////////////////////////////////////////////////////////////////////////////////////// STARTPROCESS = 20, // Initiate a web process unique to adopter PROCESSCHECKPOINT = 21, // Represents a checkpoint in a web process unique to adopter COMPLETEPROCESS = 22, // Page Actions that complete a web process unique to adopter SCENARIOCANCEL = 23, // Actions resulting from cancelling a process/scenario /////////////////////////////////////////////////////////////////////////////////////////////////// // Download [40-59] /////////////////////////////////////////////////////////////////////////////////////////////////// DOWNLOADCOMMIT = 40, // Initiating an unmeasurable off-network download DOWNLOAD = 41, // Initiating a download /////////////////////////////////////////////////////////////////////////////////////////////////// // Search [60-79] /////////////////////////////////////////////////////////////////////////////////////////////////// SEARCHAUTOCOMPLETE = 60, // Auto-completing a search query during user input SEARCH = 61, // Submitting a search query SEARCHINITIATE = 62, // Initiating a search query TEXTBOXINPUT = 63, // Typing or entering text in the text box /////////////////////////////////////////////////////////////////////////////////////////////////// // Commerce [80-99] /////////////////////////////////////////////////////////////////////////////////////////////////// VIEWCART = 82, // Viewing the cart ADDWISHLIST = 83, // Adding a physical or digital good or services to a wishlist FINDSTORE = 84, // Finding a physical store CHECKOUT = 85, // Before you fill in credit card info REMOVEFROMCART = 86, // Remove an item from the cart PURCHASECOMPLETE = 87, // Used to track the pageView event that happens when the CongratsPage or Thank You page loads after a successful purchase VIEWCHECKOUTPAGE = 88, // View the checkout page VIEWCARTPAGE = 89, // View the cart page VIEWPDP = 90, // View a PDP UPDATEITEMQUANTITY = 91, // Update an item's quantity INTENTTOBUY = 92, // User has the intent to buy an item PUSHTOINSTALL = 93, // User has selected the push to install option /////////////////////////////////////////////////////////////////////////////////////////////////// // Authentication [100-119] /////////////////////////////////////////////////////////////////////////////////////////////////// SIGNIN = 100, // User sign-in SIGNOUT = 101, // User sign-out /////////////////////////////////////////////////////////////////////////////////////////////////// // Social [120-139] /////////////////////////////////////////////////////////////////////////////////////////////////// SOCIALSHARE = 120, // "Sharing" content for a specific social channel SOCIALLIKE = 121, // "Liking" content for a specific social channel SOCIALREPLY = 122, // "Replying" content for a specific social channel CALL = 123, // Click on a "call" link EMAIL = 124, // Click on an "email" link COMMUNITY = 125, // Click on a "community" link /////////////////////////////////////////////////////////////////////////////////////////////////// // Feedback [140-159] /////////////////////////////////////////////////////////////////////////////////////////////////// VOTE = 140, // Rating content or voting for content SURVEYCHECKPOINT = 145, // reaching the survey page/form /////////////////////////////////////////////////////////////////////////////////////////////////// // Registration, Contact [160-179] /////////////////////////////////////////////////////////////////////////////////////////////////// REGISTRATIONINITIATE = 161, // Initiating a registration process REGISTRATIONCOMPLETE = 162, // Completing a registration process CANCELSUBSCRIPTION = 163, // Canceling a subscription RENEWSUBSCRIPTION = 164, // Renewing a subscription CHANGESUBSCRIPTION = 165, // Changing a subscription REGISTRATIONCHECKPOINT = 166, // Reaching the registration page/form /////////////////////////////////////////////////////////////////////////////////////////////////// // Chat [180-199] /////////////////////////////////////////////////////////////////////////////////////////////////// CHATINITIATE = 180, // Initiating a chat experience CHATEND = 181, // Ending a chat experience /////////////////////////////////////////////////////////////////////////////////////////////////// // Trial [200-209] /////////////////////////////////////////////////////////////////////////////////////////////////// TRIALSIGNUP = 200, // Signing-up for a trial TRIALINITIATE = 201, // Initiating a trial /////////////////////////////////////////////////////////////////////////////////////////////////// // Signup [210-219] /////////////////////////////////////////////////////////////////////////////////////////////////// SIGNUP = 210, // Signing-up for a notification or service FREESIGNUP = 211, // Signing-up for a free service /////////////////////////////////////////////////////////////////////////////////////////////////// // Referals [220-229] /////////////////////////////////////////////////////////////////////////////////////////////////// PARTNERREFERRAL = 220, // Navigating to a partner's web property /////////////////////////////////////////////////////////////////////////////////////////////////// // Intents [230-239] /////////////////////////////////////////////////////////////////////////////////////////////////// LEARNLOWFUNNEL = 230, // Engaging in learning behavior on a commerce page (ex. "Learn more click") LEARNHIGHFUNNEL = 231, // Engaging in learning behavior on a non-commerce page (ex. "Learn more click") SHOPPINGINTENT = 232, // Shopping behavior prior to landing on a commerce page /////////////////////////////////////////////////////////////////////////////////////////////////// // Video [240-259] /////////////////////////////////////////////////////////////////////////////////////////////////// VIDEOSTART = 240, // Initiating a video VIDEOPAUSE = 241, // Pausing a video VIDEOCONTINUE = 242, // Pausing or resuming a video. VIDEOCHECKPOINT = 243, // Capturing predetermined video percentage complete. VIDEOJUMP = 244, // Jumping to a new video location. VIDEOCOMPLETE = 245, // Completing a video (or % proxy) VIDEOBUFFERING = 246, // Capturing a video buffer event VIDEOERROR = 247, // Capturing a video error VIDEOMUTE = 248, // Muting a video VIDEOUNMUTE = 249, // Unmuting a video VIDEOFULLSCREEN = 250, // Making a video full screen VIDEOUNFULLSCREEN = 251, // Making a video return from full screen to original size VIDEOREPLAY = 252, // Making a video replay VIDEOPLAYERLOAD = 253, // Loading the video player VIDEOPLAYERCLICK = 254, // Click on a button within the interactive player VIDEOVOLUMECONTROL = 255, // Click on video volume control VIDEOAUDIOTRACKCONTROL = 256, // Click on audio control within a video VIDEOCLOSEDCAPTIONCONTROL = 257, // Click on the closed caption control VIDEOCLOSEDCAPTIONSTYLE = 258, // Click to change closed caption style VIDEORESOLUTIONCONTROL = 259, // Click to change resolution /////////////////////////////////////////////////////////////////////////////////////////////////// // Advertisement Engagement [280-299] /////////////////////////////////////////////////////////////////////////////////////////////////// ADBUFFERING = 283, // Ad is buffering ADERROR = 284, // Ad error ADSTART = 285, // Ad start ADCOMPLETE = 286, // Ad complete ADSKIP = 287, // Ad skipped ADTIMEOUT = 288, // Ad timed-out OTHER = 300 // Other } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/src/ClickAnalyticsPlugin.ts ================================================ /** * @copyright Microsoft 2020 */ import dynamicProto from "@microsoft/dynamicproto-js"; import { BaseTelemetryPlugin, IAppInsightsCore, IConfig, IConfigDefaults, IConfiguration, ICustomProperties, IPlugin, IProcessTelemetryContext, IProcessTelemetryUnloadContext, IPropertiesPlugin, ITelemetryItem, ITelemetryPluginChain, ITelemetryUnloadState, PropertiesPluginIdentifier, _eInternalMessageId, _throwInternal, arrForEach, cfgDfFunc, cfgDfMerge, cfgDfString, cfgDfValidate, createProcessTelemetryContext, dumpObj, eLoggingSeverity, getExceptionName, isNullOrUndefined, onConfigChange, throwError, unloadComponents } from "@microsoft/applicationinsights-core-js"; import { PropertiesPlugin } from "@microsoft/applicationinsights-properties-js"; import { getDocument, hasDocument, objDeepFreeze, strSubstring, strTrim } from "@nevware21/ts-utils"; import { IAutoCaptureHandler, IClickAnalyticsConfiguration, IContentHandler, ICoreData, ICustomDataTags, IPageActionTelemetry, IValueCallback } from "./Interfaces/Datamodel"; import { BehaviorEnumValidator, BehaviorMapValidator, BehaviorValueValidator, DEFAULT_AI_BLOB_ATTRIBUTE_TAG, DEFAULT_DATA_PREFIX, DEFAULT_DONOT_TRACK_TAG } from "./common/Utils"; import { PageAction } from "./events/PageAction"; import { AutoCaptureHandler } from "./handlers/AutoCaptureHandler"; import { DomContentHandler } from "./handlers/DomContentHandler"; export { BehaviorMapValidator, BehaviorValueValidator, BehaviorEnumValidator } const defaultValues: IConfigDefaults = objDeepFreeze({ autoCapture: true, callback: cfgDfMerge({ pageActionPageTags: cfgDfFunc(), pageName: cfgDfFunc(), contentName: cfgDfFunc() }), pageTags: {}, coreData: cfgDfMerge({ referrerUri: hasDocument() ? getDocument().referrer : "", requestUri: cfgDfString(), pageName: cfgDfString(), pageType: cfgDfString() }), dataTags: cfgDfMerge({ useDefaultContentNameOrId: false, aiBlobAttributeTag: DEFAULT_AI_BLOB_ATTRIBUTE_TAG, customDataPrefix: cfgDfValidate(_dataPrefixChk, DEFAULT_DATA_PREFIX), captureAllMetaDataContent: false, dntDataTag: DEFAULT_DONOT_TRACK_TAG, metaDataPrefix: cfgDfString(), parentDataTag: cfgDfString() }), behaviorValidator: cfgDfFunc((key:string) => key || ""), defaultRightClickBhvr: cfgDfString(), dropInvalidEvents : false, urlCollectHash: false, urlCollectQuery: false, trackElementTypes: cfgDfString("A,BUTTON,AREA,INPUT") }); function _dataPrefixChk(val: any) { return val && val.indexOf(DEFAULT_DATA_PREFIX) === 0; } export class ClickAnalyticsPlugin extends BaseTelemetryPlugin { public identifier: string = "ClickAnalyticsPlugin"; public priority: number = 181; public static Version = "#version#"; constructor() { super(); let _config: IClickAnalyticsConfiguration; let _pageAction: PageAction; let _autoCaptureHandler: IAutoCaptureHandler; let _contentHandler: IContentHandler; let _autoCapture: boolean; dynamicProto(ClickAnalyticsPlugin, this, (_self, _base) => { let _identifier = _self.identifier; _initDefaults(); _self.initialize = (config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) => { if (isNullOrUndefined(core)) { throwError("Error initializing"); } super.initialize(config, core, extensions, pluginChain); _populateDefaults(config); // Find the properties plugin. let _propertiesExtension:IPropertiesPlugin; arrForEach(extensions, extension => { if (extension.identifier === PropertiesPluginIdentifier) { _propertiesExtension = extension as PropertiesPlugin; } }); // Append Click Analytics Plugin Version to SDK version. if (_propertiesExtension && _propertiesExtension.context && _propertiesExtension.context.internal) { let theVersion = _propertiesExtension.context.internal.sdkVersion; if (theVersion) { theVersion += "_ClickPlugin"+ ClickAnalyticsPlugin.Version; if (theVersion.length > 64) { theVersion = strTrim(strSubstring(theVersion, 0, 64)); } _propertiesExtension.context.internal.sdkVersion = theVersion } } } _self.processTelemetry = (env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void => { _self.processNext(env, itemCtx); }; _self.trackPageAction = (pageAction?: IPageActionTelemetry, customProperties?: ICustomProperties) => { try { _pageAction.trackPageAction(pageAction, customProperties); } catch (e) { _throwInternal( _self.diagLog(), eLoggingSeverity.CRITICAL, _eInternalMessageId.TrackPageActionEventFailed, "trackPageAction failed, page action event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) }); } }; _self._doTeardown = (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void): void | boolean => { return unloadComponents([ _autoCaptureHandler, _contentHandler, _pageAction ], unloadCtx, unloadState, () => { _initDefaults(); asyncCallback && asyncCallback(); }) }; function _populateDefaults(config: IConfiguration) { let core = _self.core; _self._addHook(onConfigChange(config, (details) => { let config = details.cfg; let ctx = createProcessTelemetryContext(null, config, core); let _config = ctx.getExtCfg(_identifier, defaultValues); let logger = _self.diagLog(); _contentHandler = new DomContentHandler(_config, logger); let metaTags = _contentHandler.getMetadata(); _pageAction = new PageAction(_self, _config, _contentHandler, _config.callback.pageActionPageTags, metaTags, logger); // Default to DOM autoCapture handler if (_autoCaptureHandler) { _autoCaptureHandler._doUnload(); } _autoCaptureHandler = new AutoCaptureHandler(_self, _config, _pageAction, logger); let autoCapture = !!_config.autoCapture; if (!_autoCapture && autoCapture) { _autoCaptureHandler.click(); } _autoCapture = autoCapture; })); } function _initDefaults() { _config = null; _pageAction = null; _autoCaptureHandler = null; _contentHandler = null; _autoCapture = false; } }); } public initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } public processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Logs a page action event. * @param IPageActionTelemetry - The page action event to log. * @param customProperties - Additional data used to filter events and metrics. Defaults to empty. */ public trackPageAction(pageAction?: IPageActionTelemetry, customProperties?: ICustomProperties) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/src/DataCollector.ts ================================================ /** * @copyright Microsoft 2020 */ import { IConfiguration, fieldRedaction, getDocument, getLocation, getWindow, hasDocument, isFunction } from "@microsoft/applicationinsights-core-js"; import { scheduleTimeout } from "@nevware21/ts-utils"; import { IClickAnalyticsConfiguration, IOverrideValues } from "./Interfaces/Datamodel"; import { findClosestAnchor, isValueAssigned } from "./common/Utils"; var clickCaptureInputTypes = { BUTTON: true, CHECKBOX: true, RADIO: true, RESET: true, SUBMIT: true }; /** * Get Image href of a given HTMLImageElement * @param element - An html image element * @returns Href value. */ export function getImageHref(element: HTMLImageElement): string { var temp = element; if (temp) { var parent = findClosestAnchor(temp as Element); if (parent && (parent as any).length === 1) { const firstParent = parent[0]; if (firstParent.href) { return firstParent.href; } else if (firstParent.src) { return (firstParent.src); } } } return ""; } /** * Get click target * @returns Click target URI */ export function getClickTarget(element: any) { var clickTarget = ""; switch (element.tagName) { case "A": case "AREA": clickTarget = element.href || ""; break; case "IMG": clickTarget = getImageHref(element as HTMLImageElement); break; case "INPUT": var type = element.type; if (type && (clickCaptureInputTypes[type.toUpperCase()])) { let loc = getLocation() || ({} as Location); if (element.form) { clickTarget = element.form.action || (loc.pathname || ""); } else { clickTarget = loc.pathname || ""; } } break; default: break; } return clickTarget; } /** * Execute callback when DOM finish loading */ export function onDomLoaded(callback: () => void) { onDomReadyDo(() => { if (hasDocument() && getDocument().readyState === "complete") { callback(); } else { let win = getWindow(); if (win) { if (win.addEventListener) { win.addEventListener("load", () => { callback(); }); // NB **not** 'onload' } else if ((win as any).attachEvent) { (win as any).attachEvent("onload", () => { callback(); }); // IE8 } } } }); } // use smallest domready ever for IE8. When IE8 is deprecated, use addEventListener('DomContentLoaded') function onDomReadyDo(f: any) { /// fires function f on domRead /// function to call on domRead let doc = getDocument() || ({} as Document); /in/.test(doc.readyState) ? scheduleTimeout(() => { onDomReadyDo(f); }, 100) : f.call(); } /** * Gets the pageName from the DOM or by calling a override if set. * @param config - configuration object * @returns Page name. */ export function getPageName(config: IClickAnalyticsConfiguration, overrideValues: IOverrideValues) { /// /// Gets the pageName from the DOM or by calling a override if set. /// if (overrideValues && overrideValues.pageName) { return overrideValues.pageName; } else if (config.callback && isFunction(config.callback.pageName)) { return config.callback.pageName(); } else if (config.coreData && config.coreData.pageName) { return config.coreData.pageName; } else { const doc = getDocument(); return doc && doc.title || ""; } } /** * Sanitize URL values * @param config - Configuration * @param location - window.location or document.location * @returns Flag indicating if an element is market PII. */ export function sanitizeUrl(config: IClickAnalyticsConfiguration, location: Location, rootConfig?: IConfiguration): string { if (!location) { return null; } var url = location.protocol + "//" + (location.hostname || location.host) + // location.hostname is not supported on Opera and Opera for Android (isValueAssigned(location.port) ? ":" + location.port : "") + location.pathname; if (!!config.urlCollectHash) { // false by default url += (isValueAssigned(location.hash)? location.hash : ""); } if (!!config.urlCollectQuery) { // false by default url += (isValueAssigned(location.search)? location.search : ""); } url = fieldRedaction(url, rootConfig); return url; } /** * Get URI, sanitize the value if configured on * @param config - Configuration * @param location - window.location or document.location * @returns Flag indicating if an element is market PII. */ export function getUri(config: IClickAnalyticsConfiguration, location: any): string { if (config.coreData && config.coreData.requestUri && config.coreData.requestUri !== "") { return config.coreData.requestUri; } return sanitizeUrl(config, location); } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/src/Enums.ts ================================================ /** * @copyright Microsoft 2020 */ export const ActionType = { CLICKLEFT: "CL", CLICKRIGHT: "CR", CLICKMIDDLE: "CM", SCROLL: "S", ZOOM: "Z", RESIZE: "R", KEYBOARDENTER: "KE", KEYBOARDSPACE: "KS", OTHER: "O" }; ================================================ FILE: extensions/applicationinsights-clickanalytics-js/src/Interfaces/Datamodel.ts ================================================ /** * @copyright Microsoft 2020 */ import { IEventTelemetry, IUnloadableComponent } from "@microsoft/applicationinsights-core-js"; /** * ClickAnalytics Configuration */ export interface IClickAnalyticsConfiguration { /** * Automatic capture configuration. Default is true */ autoCapture?: boolean; /** * Callbacks configuration */ callback?: IValueCallback; /** * Page tags */ pageTags?: { [name: string]: string | number | boolean | string[] | number[] | boolean[] | object }; /** * Core data configuration */ coreData?: ICoreData; /** * Custom Data Tags provided to ovverride default tags used to capture click data. */ dataTags?: ICustomDataTags; /** * Validator to use for the data-bhvr value */ behaviorValidator?: (value: string | number) => string | number; /** * Default Behavior value when Right Click event has occured. This * value will be ovverriden if the element has the data-*-bhvr attribute present. */ defaultRightClickBhvr?: string | number; /** * Flag to drop events that do not have custom event names, no parentId and no data in content (basically no useful click data). * Default will be false */ dropInvalidEvents?: boolean; /** * Enables the logging of values after a "#" character of the URL. Default is "false." */ urlCollectHash?: boolean; /** * Enables the logging of the query string of the URL. Default is "false." */ urlCollectQuery?: boolean; /** * A list of element types to track. Default is "undefined" which means default elements ["a", "button", "area", "input"] are tracked. * If set, it will combine with the default element types. */ trackElementTypes?: string; } /** * Custom Data Tags Configuration */ export interface ICustomDataTags { /** * When a particular element is not tagged with content name prefix or content name prefix is not provided by user, this flag is used to collect standard HTML attribute for contentName and id. */ useDefaultContentNameOrId?: boolean; /** * Automatic capture content name and value of elements which are tagged with provided prefix */ customDataPrefix?: string; /** * Click Analytics supports a JSON blob content meta data tagging instead of individual data-* attributes. The default attribute is data-ai-blob. This property allows for changing that attribute name. */ aiBlobAttributeTag?: string; /** * Automatic capture metadata name and content with provided prefix */ metaDataPrefix?: string; /** * Automatic capture all metadata names and content. Default is false. If enabled this will override provided metaTagPrefix. */ captureAllMetaDataContent?: boolean; /** * Stop traversing up the DOM to capture content name and value of elements when encountered with this tag */ parentDataTag?: string; /** * Custom attribute Tag to not track telemetry data */ dntDataTag?: string } /** * Core data configuration */ export interface ICoreData { /** * document.referrer is the default. This is used to override the default value. */ referrerUri?: string; /** * window.location.href is the default. This is used to override the default value. */ requestUri?: string; /** * Default page name is derived from the url. This is used to override the default. */ pageName?: string; /** * PageType is captured from a meta tag named awa-pageType. This is used to override the value or bypass defining meta tags. */ pageType?: string; } /** * Value Callbacks configuration */ export interface IValueCallback { /** * Function to override the default pageName capturing behavior. */ pageName?: () => string; /** * A callback function to augument the default pageTags collected during pageAction event. */ pageActionPageTags?: (element?: Element) => IPageTags; /** * A callback function to populate customized contentName. */ contentName?: (element?: any, useDefaultContentName?: boolean) => string; } /** * PageTags format */ export interface IPageTags { /** * Meta data tags */ metaTags?: { [name: string]: string }; /** * Any other page tag */ [name: string]: string | number | boolean | string[] | number[] | boolean[] | object | undefined; } /** * Auto capture handler interface */ export interface IAutoCaptureHandler extends IUnloadableComponent { /** * Auto capture click */ click: () => void; } export interface IPageActionOverrideValues extends IOverrideValues { /** * Uri of the referrer page */ refUri?: string; /** * One of the awa.actionType values */ actionType?: string; /** * Target uri for PageAction events */ targetUri?: string; /** * Click coordinates relative to the top left of the fully rendered content area in the browser */ clickCoordinateX?: number; /** * Click coordinates relative to the top left of the fully rendered content area in the browser */ clickCoordinateY?: number; /** * KVP of the content */ content?: any; /** * KVPs to be added to the content tags collected on a Page Action event; extends the items in the Content blob in Page Action events */ contentTags?: any; } /** * Override values interface */ export interface IOverrideValues { /** * One of the awa.behavior values. */ behavior?: string | number; /** * Page name */ pageName?: string; /** * Page type */ pageType?: string; /** * KVP to be added to the page tags collected */ pageTags?: any; /** * Indicates if the event was fired automatically */ isAuto?: boolean; } /** * Content interface */ export interface IContent { /** * Friendly name (Content Name) of the content to be used reporting/visualization purposes */ cN?: string; /** * Unique identifier (friendly names allowed) of the content (Content Id) as designated by the content provider. * The name should be unique per contentSource such that the two make up the compound key and such that the contentId can be * looked up in the contentSource for additional metadata. */ id?: string; /** * User specified custom content properties */ [name: string]: string | number | boolean | string[] | number[] | boolean[] | object | undefined; } /** * Content handler interface */ export interface IContentHandler extends IUnloadableComponent { /** * Get meta data */ getMetadata: () => { [name: string]: string }; /** * Get element content */ getElementContent: (element: Element) => IContent; } /** * Page Action event */ export interface IPageActionTelemetry extends IEventTelemetry { /** * Target uri for PageAction events */ targetUri?: string; /** * One of the awa.actionType values */ actionType?: string; /** * One of the awa.behavior values. */ behavior?: string | number; /** * X, Y representing the absolute co-ordinates withrespect to topleft corner of the page. This should be normalized for the screen resolution to provide better heat map. */ clickCoordinates?: string; /** * JSON-formatted array of content acted upon */ content?: any; /** * Version indicating content version which aids in parsing the content. */ contentVer?: string; /** * Uri of the referrer, this is a convinence for adaptors to just leverage PageAction for click analytics without linking it to the respective Page Views. */ refUri?: string; /** * Time taken in milliseconds since the user saw the page and took the action (such as click on a link, etc.). This will be in seconds. */ timeToAction?: number; /** * A relative or absolute URL that identifies the page or other item. Defaults to the window location. */ uri?: string; /** * Page type */ pageType?: string; /** * Title of the page */ pageName?: string; /** * Content Id (Parent Id) of the parent in which the content was located; */ parentId?: string; } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/src/applicationinsights-clickanalytics-js.ts ================================================ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { Behavior } from "./Behaviours"; import { BehaviorEnumValidator, BehaviorMapValidator, BehaviorValueValidator, ClickAnalyticsPlugin } from "./ClickAnalyticsPlugin"; import { IClickAnalyticsConfiguration, IContent, ICoreData, ICustomDataTags, IOverrideValues, IPageActionOverrideValues, IPageActionTelemetry, IPageTags, IValueCallback } from "./Interfaces/Datamodel"; // Re-export ICustomProperties from core export { ICustomProperties } from "@microsoft/applicationinsights-core-js"; export { IClickAnalyticsConfiguration, IValueCallback, ICustomDataTags, ICoreData, IPageTags, IPageActionTelemetry, IContent, IOverrideValues, IPageActionOverrideValues, Behavior, ClickAnalyticsPlugin, BehaviorMapValidator, BehaviorValueValidator, BehaviorEnumValidator } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/src/common/Utils.ts ================================================ /** * @copyright Microsoft 2020 * File containing utility functions. */ import { arrForEach, isNullOrUndefined } from "@microsoft/applicationinsights-core-js"; import { IClickAnalyticsConfiguration } from "../Interfaces/Datamodel"; export const DEFAULT_DONOT_TRACK_TAG = "ai-dnt"; export const DEFAULT_AI_BLOB_ATTRIBUTE_TAG = "ai-blob"; export const DEFAULT_DATA_PREFIX = "data-"; /** * Finds attributes in overrideConfig which are invalid or should be objects * and deletes them. useful in override config * @param overrideConfig - override config object * @param attributeNamesExpectedObjects - attributes that should be objects in override config object */ export function removeNonObjectsAndInvalidElements(overrideConfig: IClickAnalyticsConfiguration, attributeNamesExpectedObjects: Array): void { removeInvalidElements(overrideConfig); arrForEach(attributeNamesExpectedObjects, (i) => { var objectName = attributeNamesExpectedObjects[i]; if (typeof overrideConfig[objectName] === "object") { removeInvalidElements(overrideConfig[objectName]); } else { delete overrideConfig[objectName]; } }); } /** * Finds attributes in object which are invalid * and deletes them. useful in override config * @param object - Input object */ export function removeInvalidElements(object: Object): void { /// Because the config object 'callback' contains only functions, /// when it is stringified it returns the empty object. This explains /// the workaround regarding 'callback' for (var property in object) { if (!isValueAssigned(object[property]) || (JSON.stringify(object[property]) === "{}" && (property !== "callback"))) { delete object[property]; } } } /** * Checks if value is assigned to the given param. * @param value - The token from which the tenant id is to be extracted. * @returns True/false denoting if value is assigned to the param. */ export function isValueAssigned(value: any) { /// takes a value and checks for undefined, null and empty string /// value to be tested /// true if value is null undefined or emptyString return !(isNullOrUndefined(value) || value === ""); } /** * Determines whether an event is a right click or not * @param evt - Mouse event * @returns true if the event is a right click */ export function isRightClick(evt: any): boolean { try { if ("which" in evt) { // Chrome, FF, ... return (evt.which === 3); } else if ("button" in evt) { // IE, ... return (evt.button === 2); } } catch (e) { // This can happen with some native browser objects, but should not happen for the type we are checking for } } /** * Determines whether an event is a left click or not * @param evt - Mouse event * @returns true if the event is a left click */ export function isLeftClick(evt: any): boolean { try { if ("which" in evt) { // Chrome, FF, ... return (evt.which === 1); } else if ("button" in evt) { // IE, ... return (evt.button === 1); } } catch (e) { // This can happen with some native browser objects, but should not happen for the type we are checking for } } /** * Determines whether an event is a middle click or not * @param evt - Mouse event * @returns true if the event is a middle click */ export function isMiddleClick(evt: any): boolean { try { if ("which" in evt) { // Chrome, FF, ... return (evt.which === 2); } else if ("button" in evt) { // IE, ... return (evt.button === 4); } } catch (e) { // This can happen with some native browser objects, but should not happen for the type we are checking for } } /** * Determines whether an event is a keyboard enter or not * @param evt - Keyboard event * @returns true if the event is a keyboard enter */ export function isKeyboardEnter(evt: KeyboardEvent): boolean { try { if ("keyCode" in evt) { // Chrome, FF, ... return (evt.keyCode === 13); } } catch (e) { // This can happen with some native browser objects, but should not happen for the type we are checking for } } /** * Determines whether an event is a keyboard space or not * @param evt - Keyboard event * @returns true if the event is a space enter */ export function isKeyboardSpace(evt: KeyboardEvent) { try { if ("keyCode" in evt) { // Chrome, FF, ... return (evt.keyCode === 32); } } catch (e) { // This can happen with some native browser objects, but should not happen for the type we are checking for } } /** * Determines whether the elemt have a DNT(Do Not Track) tag * @param element - DOM element * @param doNotTrackFieldName - DOM element * @returns true if the element must not be tarcked */ export function isElementDnt(element: Element, doNotTrackFieldName: string): boolean { var dntElement = findClosestByAttribute(element, doNotTrackFieldName); if (!isValueAssigned(dntElement)) { return false; } return true; } /** * Walks up DOM tree to find element with attribute * @param el - DOM element * @param attribute - Attribute name * @returns Dom element which contains attribute */ export function findClosestByAttribute(el: Element, attribute: string): Element { return walkUpDomChainWithElementValidation(el, isAttributeInElement, attribute); } /** * checks if attribute is in element. * method checks for empty string, in case the attribute is set but no value is assigned to it * @param element - DOM element * @param attributeToLookFor - Attribute name * @returns true if attribute is in element, even if empty string */ export function isAttributeInElement(element: Element, attributeToLookFor: string): Boolean { var value = element.getAttribute(attributeToLookFor); return isValueAssigned(value); } /** * Walks up DOM tree to find element which matches validationMethod * @param el - DOM element * @param validationMethod - DOM element validation method * @param validationMethodParam - DOM element validation method parameters * @returns Dom element which is an anchor */ export function walkUpDomChainWithElementValidation(el: Element, validationMethod: Function, validationMethodParam?: any): Element { var element = el; if (element) { while (!validationMethod(element, validationMethodParam)) { element = (element.parentNode as Element); if (!element || !(element.getAttribute)) { return null; } } return element; } } /** * Determine if DOM element is an anchor * @param element - DOM element * @returns Is element an anchor */ export function isElementAnAnchor(element: Element): boolean { return element.nodeName === "A"; } /** * Walks up DOM tree to find anchor element * @param element - DOM element * @returns Dom element which is an anchor */ export function findClosestAnchor(element: Element): Element { /// Walks up DOM tree to find anchor element /// DOM element /// Dom element which is an anchor return walkUpDomChainWithElementValidation(element, isElementAnAnchor); } /** * Returns the specified field and also removes the property from the object if exists. * @param obj - Input object * @param fieldName - >Name of the field/property to be extracted * @returns Value of the specified tag */ export function extractFieldFromObject(obj: Object, fieldName: string): string { var fieldValue: any; if (obj && obj[fieldName]) { fieldValue = obj[fieldName]; delete obj[fieldName]; } return fieldValue; } /** * Adds surrounding square brackets to the passed in text * @param str - Input string * @returns String with surrounding brackets */ export function bracketIt(str: string): string { /// /// Adds surrounding square brackets to the passed in text /// return "[" + str + "]"; } export function validateContentNamePrefix ( config: IClickAnalyticsConfiguration, defaultDataPrefix: string) { return isValueAssigned(config.dataTags.customDataPrefix) && (config.dataTags.customDataPrefix.indexOf(defaultDataPrefix) === 0); } export function BehaviorMapValidator (map: any) { return (key: string) => map[key] || ""; } export function BehaviorValueValidator (behaviorArray: string[]) { return (key: string) => { let result; arrForEach(behaviorArray, (value) => { if (value === key) { result = value; return -1; } }); return result || ""; } } export function BehaviorEnumValidator (enumObj: any) { return (key: string) => enumObj[key] || ""; } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/src/events/PageAction.ts ================================================ /** * @copyright Microsoft 2020 */ import dynamicProto from "@microsoft/dynamicproto-js"; import { ICustomProperties, IDiagnosticLogger, ITelemetryItem, _eInternalMessageId, _throwInternal, eLoggingSeverity, getPerformance, objExtend, objForEachKey, strNotSpecified } from "@microsoft/applicationinsights-core-js"; import { ClickAnalyticsPlugin } from "../ClickAnalyticsPlugin"; import { getClickTarget } from "../DataCollector"; import { IClickAnalyticsConfiguration, IContentHandler, IPageActionOverrideValues, IPageActionTelemetry } from "../Interfaces/Datamodel"; import { bracketIt, extractFieldFromObject, isValueAssigned } from "../common/Utils"; import { WebEvent } from "./WebEvent"; export class PageAction extends WebEvent { constructor( clickAnalyticsPlugin: ClickAnalyticsPlugin, config: IClickAnalyticsConfiguration, contentHandler: IContentHandler, pageTagsCallback: any, metaTags: { [name: string]: string }, traceLogger: IDiagnosticLogger) { super(clickAnalyticsPlugin, config, contentHandler, pageTagsCallback, metaTags, traceLogger); dynamicProto(PageAction, this, (_self, _base) => { _self.trackPageAction = (pageActionEvent: IPageActionTelemetry, properties?: ICustomProperties): void => { // Get part A properties var ext = {}; ext["web"] = {}; let event: ITelemetryItem = { name: "Microsoft.ApplicationInsights.{0}.Event", baseType: "EventData", ext, data: {}, baseData: {} }; _populateEventDataIfPresent(event.baseData, "name", pageActionEvent.name); _populateEventDataIfPresent(event.data, "baseTypeSource", "ClickEvent"); _populateEventDataIfPresent(event.data, "uri", pageActionEvent.uri); _populateEventDataIfPresent(event.data, "pageType", pageActionEvent.pageType); _populateEventDataIfPresent(event.data, "properties", pageActionEvent.properties); _populateEventDataIfPresent(event.data, "actionType", pageActionEvent.actionType); _populateEventDataIfPresent(event.data, "behavior", pageActionEvent.behavior); _populateEventDataIfPresent(event.data, "clickCoordinates", pageActionEvent.clickCoordinates); _populateEventDataIfPresent(event.data, "content", pageActionEvent.content); _populateEventDataIfPresent(event.data, "targetUri", pageActionEvent.targetUri); _populateEventDataIfPresent(event.data, "timeToAction", pageActionEvent.timeToAction); _populateEventDataIfPresent(event.data, "refUri", pageActionEvent.refUri); _populateEventDataIfPresent(event.data, "pageName", pageActionEvent.pageName); _populateEventDataIfPresent(event.data, "parentId", pageActionEvent.parentId); if (properties) { objForEachKey(properties, (property, value) => { if (!event.data[property]) { _populateEventDataIfPresent(event.data, property, value); } }); } _self._clickAnalyticsPlugin.core.track(event); }; /** * API to create and send a populated PageAction event * @param element - DOM element * @param overrideValues - PageAction overrides * @param customProperties - Custom properties(Part C) * @param isRightClick - Flag for mouse right clicks */ _self.capturePageAction = (element: Element, overrideValues?: IPageActionOverrideValues, customProperties?: { [name: string]: string | number | boolean | string[] | number[] | boolean[] | object }, isRightClick?: boolean): void => { overrideValues = !isValueAssigned(overrideValues) ? {} : overrideValues; let pageActionEvent: IPageActionTelemetry = { name : ""}; let pageActionProperties: ICustomProperties = isValueAssigned(customProperties) ? customProperties : {}; _self.setCommonProperties(pageActionEvent, overrideValues); pageActionEvent.behavior = _self._getBehavior(overrideValues); // element in scope is needed for below properties. We cannot pass element into the plugin call chain. // process them here. let elementContent: any = {}; if (isRightClick) { // Default behavior for righ click pageActionEvent.behavior = _self._config.defaultRightClickBhvr; } // Fill PartB if (element) { pageActionEvent.targetUri = getClickTarget(element); elementContent = _self._contentHandler.getElementContent(element); // collect id,cn tags // if the element has a data-*-bhvr attrib defined, use it. if (elementContent.bhvr && !isValueAssigned(overrideValues.behavior)) { let currentBehavior: string = extractFieldFromObject(elementContent, "bhvr"); pageActionEvent.behavior = _self._getValidBehavior(currentBehavior); } // Validate to ensure the minimum required field 'contentName' or 'id' is present. However, // requiring these fields would result in majority of adopter's content from being collected. // Just throw a warning and continue collection. if (!isValueAssigned(elementContent.id) && !isValueAssigned(elementContent.contentName)) { _throwInternal(_self._traceLogger, eLoggingSeverity.WARNING, _eInternalMessageId.InvalidContentBlob, "Missing attributes id or contentName in click event. Click event information will still be collected!" ); } } pageActionEvent.name = elementContent.id || elementContent.contentName || strNotSpecified; pageActionEvent.parentId = elementContent.parentid || elementContent.parentName || strNotSpecified; if (isValueAssigned(overrideValues.actionType)) { pageActionEvent.actionType = overrideValues.actionType; } if (isValueAssigned(overrideValues.clickCoordinateX) && isValueAssigned(overrideValues.clickCoordinateY)) { pageActionEvent.clickCoordinates = overrideValues.clickCoordinateX + "X" + overrideValues.clickCoordinateY; } _sanitizePageActionEventContent(elementContent); pageActionEvent.content = bracketIt(JSON.stringify(objExtend( elementContent, overrideValues && overrideValues.contentTags ? overrideValues.contentTags : {}))); pageActionEvent.timeToAction = _getTimeToClick(); pageActionEvent.refUri = isValueAssigned(overrideValues.refUri) ? overrideValues.refUri : _self._config.coreData.referrerUri; if(_isUndefinedEvent(pageActionEvent)) { return; } _self.trackPageAction(pageActionEvent, pageActionProperties); }; // capture performance data into PageTags function _getTimeToClick() { const perf = getPerformance(); if (perf && perf.timing) { var isNavigationStart = perf.timing.navigationStart; if (isNavigationStart && isNavigationStart !== 0) { return new Date().getTime() - isNavigationStart; } } return -1; } function _populateEventDataIfPresent(obj:any, property:any, value:any) { if(isValueAssigned(value)) { obj[property] = value; } } function _sanitizePageActionEventContent(pageActionContent: any) { if(pageActionContent) { delete pageActionContent.id; delete pageActionContent.parentid; delete pageActionContent.parentname; if(_self._config && _self._config.dataTags && isValueAssigned(_self._config.dataTags.parentDataTag)) { delete pageActionContent[_self._config.dataTags.parentDataTag]; } } } function _isUndefinedEvent(pageActionEvent: IPageActionTelemetry) { if(_self._config.dropInvalidEvents) { if(pageActionEvent.name === strNotSpecified && pageActionEvent.parentId === strNotSpecified && pageActionEvent.content === "[{}]") { return true; } } return false; } }); } /** * API to send pageAction event * @param pageActionEvent - PageAction event * @param properties - PageAction properties(Part C) */ public trackPageAction(pageActionEvent: IPageActionTelemetry, properties?: ICustomProperties): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * API to create and send a populated PageAction event * @param element - DOM element * @param overrideValues - PageAction overrides * @param customProperties - Custom properties(Part C) * @param isRightClick - Flag for mouse right clicks */ public capturePageAction(element: Element, overrideValues?: IPageActionOverrideValues, customProperties?: { [name: string]: string | number | boolean | string[] | number[] | boolean[] | object }, isRightClick?: boolean): void { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/src/events/WebEvent.ts ================================================ /** * @copyright Microsoft 2020 */ import dynamicProto from "@microsoft/dynamicproto-js"; import { IDiagnosticLogger, IProcessTelemetryUnloadContext, ITelemetryUnloadState, IUnloadableComponent, getLocation, hasWindow, objExtend } from "@microsoft/applicationinsights-core-js"; import { ClickAnalyticsPlugin } from "../ClickAnalyticsPlugin"; import { getPageName, getUri } from "../DataCollector"; import { IClickAnalyticsConfiguration, IContentHandler, ICoreData, IOverrideValues, IPageActionTelemetry, IPageTags } from "../Interfaces/Datamodel"; import { isValueAssigned } from "../common/Utils"; export class WebEvent implements IUnloadableComponent { protected _pageTags: IPageTags; protected _pageTypeMetaTag: string; protected _marketMetaTag: string; protected _behaviorMetaTag: string; protected _clickAnalyticsPlugin: ClickAnalyticsPlugin; protected _config: IClickAnalyticsConfiguration; protected _contentHandler: IContentHandler; protected _pageTagsCallback: any; protected _metaTags: { [name: string]: string }; protected _traceLogger: IDiagnosticLogger; /** * @param clickAnalyticsPlugin - Click Analytics plugin instance * @param config - ClickAnalytics configuration object * @param contentHandler - Content handler * @param id - Id object * @param pageTagsCallback - callback methods to get pageTags value * @param metaTags - Meta tags * @param traceLogger - Trace logger to log to console. */ constructor( clickAnalyticsPlugin: ClickAnalyticsPlugin, config: IClickAnalyticsConfiguration, contentHandler: IContentHandler, pageTagsCallback: any, metaTags: { [name: string]: string }, traceLogger: IDiagnosticLogger) { dynamicProto(WebEvent, this, (_self) => { _initDefaults(); function _initDefaults() { _self._pageTags = {}; _self._clickAnalyticsPlugin = clickAnalyticsPlugin; _self._config = config; _self._contentHandler = contentHandler; _self._pageTagsCallback = pageTagsCallback; _self._metaTags = metaTags; _self._traceLogger = traceLogger; } _self.setBasicProperties = (event: IPageActionTelemetry, overrideValues: IOverrideValues) => { if (!isValueAssigned(event.name)) { event.pageName = getPageName(_self._config, overrideValues); } if (!isValueAssigned(event.uri) && hasWindow()) { event.uri = getUri(_self._config, getLocation()); } }; /** * Sets common properties for events that are based on the WebEvent schema. * @param event - The event */ _self.setCommonProperties = (event: IPageActionTelemetry, overrideValues: IOverrideValues) => { _self.setBasicProperties(event, overrideValues); _self._setPageTags(event, overrideValues); // extract specific meta tags out of the pageTags.metaTags collection. These will go into assigned first class fields in the event. // the rest will go into pageTags.metaTags collection as is. _self._pageTypeMetaTag = _getMetaData(_self._metaTags, _self._config.coreData, "pageType"); _self._behaviorMetaTag = _getMetaData(_self._metaTags, _self._config.coreData, "behavior"); if (isValueAssigned(overrideValues.pageType)) { event.pageType = overrideValues.pageType; } // Only assign if not overriden and meta data is available if (isValueAssigned(_self._pageTypeMetaTag) && !isValueAssigned(event.pageType)) { event.pageType = _self._pageTypeMetaTag; } }; /** * Sets pageTags. * @param event - The event */ _self._setPageTags = (event: IPageActionTelemetry, overrideValues: IOverrideValues) => { // Prepare the pageTags object that is mostly the same for all events. Event specific pageTags will be added inside event constructors. if (_self._pageTagsCallback) { _self._pageTags = objExtend(true, _self._pageTags, _self._pageTagsCallback()); } if (isValueAssigned(overrideValues.pageTags)) { _self._pageTags = objExtend(true, _self._pageTags, overrideValues.pageTags); } // If metadata is present add it to pageTags property if (_self._metaTags) { _self._pageTags.metaTags = {}; // Remove not supported meta data in pageTags.metaTags for (var metaTag in _self._metaTags) { if (metaTag != "behavior" && metaTag != "market" && metaTag != "pageType") { _self._pageTags.metaTags[metaTag] = _self._metaTags[metaTag]; } } } // All metadata tags that must be saved as properties have been extracted at this point. Assign pageTags as is. event.properties = event.properties || {}; event.properties["pageTags"] = _self._pageTags; }; _self._getBehavior = (overrideValues?: IOverrideValues): string | number => { let behavior: string | number; // If override specified if (overrideValues && isValueAssigned(overrideValues.behavior)) { behavior = overrideValues.behavior; } else if (isValueAssigned(_self._behaviorMetaTag)) { // If behavior meta tag available behavior = _self._behaviorMetaTag; } return _self._getValidBehavior(behavior); }; _self._getValidBehavior = (behavior: string | number): string | number => { return _self._config.behaviorValidator(behavior); }; _self._doUnload = (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void): void | boolean => { _initDefaults(); }; /** * Get the specified metadata value from the collection * If overrideValue is specified in the config that takes precedence. * @param metaTags - Meta data. * @param coreData - Coredata values from configuration. * @param metaTagName - Name of the metaTag to get. * @returns Meta data value */ function _getMetaData(metaTags: { [name: string]: string }, coreData: ICoreData, metaTagName: string): string { if (coreData && coreData[metaTagName]) { return coreData[metaTagName]; } if (metaTags) { return metaTags[metaTagName]; } return ""; } }); } // Fill common PartB fields public setBasicProperties(event: IPageActionTelemetry, overrideValues: IOverrideValues) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Sets common properties for events that are based on the WebEvent schema. * @param event - The event */ public setCommonProperties(event: IPageActionTelemetry, overrideValues: IOverrideValues) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Teardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin * finishes it's removal. * @param unloadCtx - This is the context that should be used during unloading. * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload. * @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations. * @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations. */ public _doUnload(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void): void | boolean { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } /** * Sets pageTags. * @param event - The event */ protected _setPageTags(event: IPageActionTelemetry, overrideValues: IOverrideValues) { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging } protected _getBehavior(overrideValues?: IOverrideValues): string | number { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } protected _getValidBehavior(behavior: string | number): string | number { // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging return null; } } ================================================ FILE: extensions/applicationinsights-clickanalytics-js/src/handlers/AutoCaptureHandler.ts ================================================ /** * @copyright Microsoft 2020 */ import dynamicProto from "@microsoft/dynamicproto-js"; import { IDiagnosticLogger, IProcessTelemetryUnloadContext, ITelemetryUnloadState, IUnloadHook, createUniqueNamespace, eventOff, eventOn, getDocument, getWindow, isNullOrUndefined, mergeEvtNamespace, onConfigChange } from "@microsoft/applicationinsights-core-js"; import { arrIncludes, arrMap, strTrim } from "@nevware21/ts-utils"; import { ClickAnalyticsPlugin } from "../ClickAnalyticsPlugin"; import { ActionType } from "../Enums"; import { IAutoCaptureHandler, IClickAnalyticsConfiguration, IPageActionOverrideValues } from "../Interfaces/Datamodel"; import { isElementDnt, isKeyboardEnter, isKeyboardSpace, isLeftClick, isMiddleClick, isRightClick } from "../common/Utils"; import { PageAction } from "../events/PageAction"; const clickCaptureInputTypes = { BUTTON: true, CHECKBOX: true, RADIO: true, RESET: true, SUBMIT: true }; export class AutoCaptureHandler implements IAutoCaptureHandler { /** * @param analyticsPlugin - WebAnalytics plugin * @param traceLogger - Trace logger to log to console. */ constructor(protected _analyticsPlugin: ClickAnalyticsPlugin, protected _config: IClickAnalyticsConfiguration, protected _pageAction: PageAction, protected _traceLogger: IDiagnosticLogger) { let _evtNamespace = mergeEvtNamespace(createUniqueNamespace("AutoCaptureHandler"), (_analyticsPlugin as any)._evtNamespace); let _clickCaptureElements: string[]; let unloadHandler: IUnloadHook = onConfigChange(_config, () => { _clickCaptureElements = arrMap(_config.trackElementTypes.toUpperCase().split(","), tag => strTrim(tag)); }); dynamicProto(AutoCaptureHandler, this, (_self) => { _self.click = () => { let win = getWindow(); let doc = getDocument(); if (win) { // IE9 onwards addEventListener is available, 'click' event captures mouse click. mousedown works on other browsers const event = (navigator.appVersion.indexOf("MSIE") !== -1) ? "click" : "mousedown"; eventOn(win, event, _processClick, _evtNamespace); eventOn(win, "keyup", _processClick, _evtNamespace); } else if (doc) { // IE8 and below doesn't have addEventListener so it will use attachEvent // attaching to window does not work in IE8 eventOn(doc, "click", _processClick, _evtNamespace); eventOn(doc, "keyup", _processClick, _evtNamespace); } }; _self._doUnload = (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void): void | boolean => { eventOff(getWindow(), null, null, _evtNamespace); eventOff(getDocument(), null, null, _evtNamespace); unloadHandler && unloadHandler.rm(); unloadHandler = null; }; function _capturePageAction(element: Element, overrideValues?: IPageActionOverrideValues, customProperties?: { [name: string]: string | number | boolean | string[] | number[] | boolean[] | object }, isRightClick?: boolean): void { const donotTrackTag = _self._config.dataTags.customDataPrefix + _self._config.dataTags.dntDataTag; if (!isElementDnt(element, donotTrackTag)) { _self._pageAction.capturePageAction(element, overrideValues, customProperties, isRightClick); } } // Process click event function _processClick(clickEvent: any) { let win = getWindow(); if (isNullOrUndefined(clickEvent) && win) { clickEvent = win.event; // IE 8 does not pass the event } if (clickEvent) { let element = clickEvent.srcElement || clickEvent.target; // populate overrideValues var overrideValues: IPageActionOverrideValues = { clickCoordinateX: clickEvent.pageX, clickCoordinateY: clickEvent.pageY }; var isRightClickObj = isRightClick(clickEvent as MouseEvent); if (isRightClickObj) { overrideValues.actionType = ActionType.CLICKRIGHT; } else if (isLeftClick(clickEvent as MouseEvent)) { overrideValues.actionType = ActionType.CLICKLEFT; } else if (isKeyboardEnter(clickEvent as KeyboardEvent)) { overrideValues.actionType = ActionType.KEYBOARDENTER; } else if (isKeyboardSpace(clickEvent as KeyboardEvent)) { overrideValues.actionType = ActionType.KEYBOARDSPACE; } else if (isMiddleClick(clickEvent as MouseEvent)) { overrideValues.actionType = ActionType.CLICKMIDDLE; } else { return; } while (element && element.tagName) { // control property will be available for